From: tomo Date: Wed, 11 Dec 2002 17:39:38 +0000 (+0000) Subject: This commit was generated by cvs2svn to compensate for changes in r5670, X-Git-Tag: r21-4-11-chise-0_20-2^2~2 X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=commitdiff_plain;h=1a5e625ffcc6b2e9a9828a89763c062a0b09b361;hp=ac7d0619aad74b1d57c4748ebb3ab29d9c32e3d8 This commit was generated by cvs2svn to compensate for changes in r5670, which included commits to RCS files with non-trunk default branches. --- diff --git a/.cvsignore b/.cvsignore index 7a7fc50..42e5786 100644 --- a/.cvsignore +++ b/.cvsignore @@ -7,7 +7,3 @@ config.status GNUmakefile Makefile.in so_locations -xemacs-packages -mule-packages -site-packages -gmon.out diff --git a/CHANGES-beta b/CHANGES-beta index 1fc567c..48c24ee 100644 --- a/CHANGES-beta +++ b/CHANGES-beta @@ -1,508 +1,6 @@ -to 21.2.46 "Urania" --- GTK code has been merged as an experimental display type -- William Perry - -to 21.2.45 "Thelxepeia" --- lib-src Makefile fixes -- Martin Buchholz --- startup path fixes -- Michael Sperber --- Port FSF 20.7 syntax table improvements -- Matt Tucker --- --pdump now works with HP-UX native cc -- Martin Buchholz --- copy-file now works correctly with non-ascii filenames -- Martin Buchholz --- More pdump improvements -- Martin Buchholz --- Prefer more standard utime() to utimes() -- Martin Buchholz - -to 21.2.44 "Thalia" --- Upgrade to etags 14.15 -- Francesco Potorti --- XEmacs now works on Unixware 7 -- Martin Buchholz --- Work around AIX C compiler bug causing "scroll-up has no effect" - -- Martin Buchholz --- Fix crash in kill-emacs -- Martin Buchholz --- XEmacs builds with gcc 2.97 -- Martin Buchholz --- XEmacs builds with g++ 2.97 -- Martin Buchholz --- Port .gdbinit debugging support to many systems -- Martin Buchholz --- XEmacs builds on mips-sgi-irix6.5 with 64-bit compilers -- Martin Buchholz --- The C variable containing the value of a DEFVAR_INT is now - EMACS_INT, not int -- Martin Buchholz --- config.sug, config.guess upgraded to official versions -- Martin Buchholz --- Support mouse-6 and mouse-7 for newfangled mice -- Martin Buchholz --- portable dumper alignment fixes -- Martin Buchholz --- sound fixes -- Didier Verna --- Progress gauge now goes away if C-g'ed -- Andy Piper - -to 21.2.43 "Terspichore" --- Important gnuserv security fix. Upgrade if you use gnuserv. - -- Klaus Frank, Jan Vroonhof, Gunnar Evermann --- C-level alignment correctness fixes -- Martin Buchholz --- cut-and-paste slowness under Motif fixed -- Andy Piper --- pdump now works on SunOS 4 and HP-UX -- Martin Buchholz --- Packages documentation updates -- Steve Youngs --- Windows netinstall changes -- Andy Piper - -to 21.2.42 "Poseidon" --- 64-bit platforms (Alpha) broken in 21.2.41 now fixed -- Martin Buchholz --- Windows packaging changes -- Andy Piper --- Widget bug fixes -- Andy Piper --- Modeline scrolling documented -- Didier Verna --- C-level alignment hackery -- Martin Buchholz - -to 21.2.41 "Polyhymnia" --- A very important fix to the byte-compiler was made. - RE-BYTE-COMPILE all your .el files that were compiled by any older - 21.2 byte-compiler (the 21.1 byte-compiler was OK.) - Explicitly remove all .elc files using - cd XEMACS; find . -name '*.elc' -print | xargs rm - and then rebuild using `make'. - -- Martin Buchholz --- More Windows installer changes -- Andy Piper --- Another tab widget fix -- Andy Piper --- pdump code cleanup -- Martin Buchholz --- lisp path changes -- Mike Sperber --- init file changes -- Mike Sperber --- debugging support works better with pdump -- Martin Buchholz --- Port to AIX cc -O3 -qansi-aliasing -- Martin Buchholz --- Allow building 64-bit binaries on AIX. -- Martin Buchholz --- Make code more resistant to aliasing optimizations. -- Martin Buchholz --- XEmacs now works on Netbsd 1.5. -- Martin Buchholz --- Eliminate kludgy checks for non-standard _dlopen -- Golubev I. N. --- Make Purify a little happier working on pdumped xemacs -- Martin Buchholz --- Fix never-used macro LISP_TO_CVOID -- Jerry James - -to 21.2.40 "Persephone" --- various doc fixes -- Stephen Turnbull --- more widget bug fixes -- Andy Piper --- Introduce yet another hash table weakness type -- Andy Piper --- SCO 5 fixes -- Golubev I. N. --- SunOS 4 works again -- MIYASHITA Hisashi --- Make peace with Mandrake's Alt-Meta hacks -- Stephen Turnbull --- Remove input-method-xfs.o -- Kazuyuki IENAGA - -to 21.2.39 "Millennium" --- Safer coding-priority-list -- Stephen Turnbull --- Andreas Jaeger resigns as core maintainer :-( --- Make font-lock know about all C++ keywords -- Enrico Scholz --- Comments beginning in column zero are no longer indented by - indent-for-comment -- Adrian Aichner --- Better documentation for package creation -- Stephen Turnbull --- input-method-xfs.c removed. Functionality incorporated into - input-method-xlib.c -- Kazuyuki IENAGA --- replace-buffer-in-windows fixes -- Yoshiki Hayashi --- Fix redisplay bugs with buffer-local face specifiers -- Yoshiki Hayashi --- More printing fixes -- Martin Buchholz --- Another SGI dumping fix -- Martin Buchholz --- A new Windows installer in netinstall -- Andy Piper --- Support Berkeley DB 3.1 -- Daiki Ueno - -to 21.2.38 "Peisino,Ak(B" --- Keyboard commands to set code system now work in file-coding - Emacsen! -- Jan Vroonhof (actually in 21.2.37) --- Calls to the following functions are now better optimized: - backward-char backward-word plusp, minusp oddp evenp -- Martin Buchholz --- COUNT argument to following functions is now optional: - forward-word backward-word mark-word kill-word backward-kill-word - forward-comment delete-char backward-delete-char -- Martin Buchholz --- Don't put gutters/tabs on popup windows -- Andy Piper --- Fix up info file cross references -- Adrian Aichner --- Make `format' 64-bit clean -- Martin Buchholz --- unexec changes on Windows -- Martin Buchholz --- Make ptys work again on Cygwin -- Philip Aston --- GCPRO fixes -- Yoshiki Hayashi, Gunnar Evermann, Martin Buchholz --- Fix dumping problems on SGI Irix 6 -- Max Matveev, Martin Buchholz --- Make DEBUG_GCPRO work again -- Gunnar Evermann --- Pdump fixes -- Olivier Galibert --- Case table changes -- Yoshiki Hayashi --- Fix remaining tab oddities -- Andy Piper --- Fix Windows unexec -- Andy Piper --- byte-compiler arithmetic improvements -- Martin Buchholz - -to 21.2.37 "Pan" --- etags fix -- Stephen Carney --- more gutters and tab changes -- Andy Piper --- eval-when-compile no longer compiles its body -- Martin Buchholz --- top-level (defvar foo) no longer generates a run-time load-history - entry -- Martin Buchholz --- Windows 1251 code page encoding for Cyrillic -- Sergey Groznyh --- `local-key-binding' and `global-key-binding' now have an optional - `accepts-defaults' parameter, just like `lookup-key' -- Martin Buchholz --- 1000 arglist-related lispref documentation bugs fixed -- Martin Buchholz --- arg to `down-list', `up-list', `backward-up-list', `kill-sexp', - `backward-kill-sexp' are now optional, just like FSF Emacs -- Martin Buchholz --- info mode fixes -- Didier Verna --- Massive CCL upgrade -- MIYASHITA Hisashi --- byte-code optimizations -- Yoshiki Hayashi --- historical purecopy's purged -- Robert Pluim --- `mwheel-install', `turn-on-auto-fill', `turn-on-font-lock', - `turn-off-font-lock' are now interactive -- Martin Buchholz --- Detect _getpty correctly (for SGIs) -- Martin Buchholz --- Several GCPRO bugs found -- Yoshiki Hayashi --- `replace-buffer-in-windows' now has the same WHICH-FRAMES and - WHICH-DEVICES parameters as `delete-windows-on' -- Martin Buchholz --- Add support for Compaq C on Alpha Linux -- Martin Buchholz --- auto-save fixes -- Yoshiki Hayashi --- Removed unused C vars detected by Compaq C -- Martin Buchholz --- More 64-bit cleanliness micro-fixes -- Martin Buchholz --- Fix cachel.merged_faces memory leak -- Golubev I. N. --- More changes to allow definitions of lisp object types by - third-party modules -- Daiki Ueno. --- Extbyte is now a char, not unsigned char -- Martin Buchholz --- C++ compilability is restored -- Martin Buchholz --- New tests for CCL -- MIYASHITA Hisashi, Yoshiki Hayashi --- Use stropts.h, not sys/stropts.h. Likewise for strtio.h -- Martin Buchholz - -to 21.2.36 "Notus" --- Fix build problems on AIX 4.3 -- Martin Buchholz --- Fix build problems on HP-UX 10.20 -- Alexandre Oliva and Martin Buchholz --- Fix build problems on SunOS 4.1.4 -- Martin Buchholz --- Fix build problems on IA64/Linux -- Martin Buchholz --- Fix build problems on Alpha/Linux -- Steve Baur --- Fix build problems on Unixware -- Martin Buchholz --- Support pty input lines longer than 512 bytes on HP-UX 10.20. -- Martin Buchholz --- `equal' of hash tables is now the same as `eq'. -- Martin Buchholz --- ucs fixes - Daiki Ueno --- Lots of little doc fixes. -- Martin Buchholz --- Process-signaling code rewritten -- Martin Buchholz --- pty allocation code rewritten -- Martin Buchholz --- The byte compiler generates more efficient code -- Martin Buchholz --- build-report fixes -- Adrian Aichner --- next-window/next-frame functions rewritten -- Martin Buchholz --- Windows fixes -- Jonathan Harris --- Multiple info buffer support -- Golubev I. N. --- regex crash fixes -- Yoshiki Hayashi --- Widget/windows fixes -- Andy Piper --- structured lisp errors -- Ben Wing --- allow modules to define their own lisp object types -- Andrew Begel - -to 21.2.35 "Nike" --- You now again build XEmacs in a directory containing a predefined - CPP symbol -- Martin Buchholz --- Minor fixes for Postgres integration -- Martin Buchholz --- Many fixes for DEC OSF 4.0 -- Martin Buchholz --- More C++ compilation support (for quality control) -- Martin Buchholz --- XEmacs can now be built with XFree86 4.0 -- Martin Buchholz --- Fix lots of byte-compiler warnings -- Martin Buchholz --- Many documentation fixes -- Adrian Aichner --- support for S390 has been added -- Andreas Jaeger, Martin Schwidefsky --- clean up Windows includes/defines -- Ben Wing --- numerous configure/GCC-warning fixes -- Martin Buchholz --- generalize selection support to arbitrary types -- Alastair Houghton --- MS Windows printer improvements -- Kirill Katsnelson --- MinGW fixes -- Craig Lanning --- NT process fixes -- Mixe Alexander, Adrian Aichner --- new key-value weak hashtable type -- Andy Piper/Olivier Galibert --- migrate .emacs to .xemacs/init.el -- Mike Sperber --- new file compat.el for cleaner compatibility functions -- Ben Wing - -to 21.2.34 "Molpe" --- Lots of changes to GUI, Windows, font-lock code, Ben Wing --- Lots of changes to GUI, Windows code, Andy Piper --- Various fixes, Karl Hegbloom --- User manual documentation updates, Yoshiki Hayashi --- Dumping fixes, Yoshiki Hayashi --- Define C-x BS to backward-kill-sentence, Yoshiki Hayashi - -to 21.2.33 "Melpomene" --- Yet more progress gauge and gutter redisplay fixes from Andy Piper --- glyph error checking from Andy Piper --- Proper implementation of string glyphs makes them Mule safe (IKEYAMA Tomonori) --- Bug fixes from the usual suspects --- --with-clash-detection now defaults to `yes', at least for betas. --- Autoconf support for detecting how to #include header files - with names containing preprocessor constants, Didier Verna. --- LDAP documentation updated, Oscar Figueiredo. --- clash-detection code cleaned and audited, Yoshiki and Martin --- Fix hangs on DEC OSF 4.0 when (process-send-string) sends strings - longer than 252 bytes. --- Fix non-ANSI macro hacking to allow compilation by Irix native compiler. --- redisplay fixes, IKEYAMA Tomonori --- Code cleaning, Mike Alexander --- Pdump + Windows support, Mike Alexander --- Sound code cleanup, Jan Vroonhof --- yes-or-no-p-dialog-box no longer gives unpredictable results with - focus follows mouse, Martin Buchholz - -to 21.2.32 "Kastor & Polydeukes" --- Internal Postgres RDBMS support from Steve Baur --- Improve gutter useability --- Fix window geometry with gutters --- Fix async updates so that they only occur when necessary --- Gutter documentation from Stephen Turnbull --- redisplay-gutter-area fixes from Andy Piper --- pdump file in MS-Windows executable from Mike Alexander --- Miscellaneous fixes from Andy Piper --- Windows and menubar changes from Ben Wing --- dumper changes from Olivier Galibert - -to 21.2.31 "Iris" --- Make XEmacs work on Windows again. - -to 21.2.30 "Hygeia" --- Make (find-tag-other-window) always use other window, - even if tag is found in buffer of current window, Samuel Mikes --- Make configure complain about broken compiler versions (Jan Vroonhof, Yoshiki Hayashi, Bill Perry) --- `write-region' now deals properly with non-ASCII file names, Martin Buchholz --- `file-truename' now respects file-name-coding-system, Martin Buchholz --- arm configure support fixed. --- non-ASCII string handling performance boost, Martin Buchholz --- Garbage collector performance boost, Martin Buchholz --- Lisp engine performance boost, Martin Buchholz --- New ldap API (Oscar Figueiredo) --- (- 0) is now optimized to 0, not (-), Martin Buchholz --- More gutter tabs fixes, Andy Piper - -to 21.2.29 "Hestia" --- Fix compile errors on pre-X11R6 systems, introduced in 21.2.28. --- Fix autodetection of Berkeley DB on Linux Glibc 2 systems. - (but more work needed) --- Allow non-symbols (anything compared with `eq') in object plists. --- Cleanup of property frobbing code. --- Various AIX 4 fixes, including port of PDUMP. --- Unconditionally define _POSIX_C_SOURCE, _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED. --- MS-Windows redisplay and font fixes from Jonathan Harris. --- various fixes from Craig Lanning, Daiki Ueno. --- Asynchronous widget updates from Andy Piper. --- More widget fixes from Andy Piper. --- Don't use rel_alloc on glibc systems, including Linux --- Upgrade etags.c to version 13.44, Francesco Potorti --- etags does a better job of finding the exact match first, Kyle Jones --- Portable dumper now described in Internals manual, Olivier and Martin --- Object Plist documentation in lispref updated, Martin Buchholz --- Just use standard `const' everywhere, instead of CONST --- More pdump changes, Olivier Galibert - -to 21.2.28 "Hermes" --- Add configure support for NetWinders, Sean MacLennan --- Make the "Load .emacs" menu item work again, Kirill Katsnelson --- 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 --git a/CHANGES-msw b/CHANGES-msw new file mode 100644 index 0000000..41b1460 --- /dev/null +++ b/CHANGES-msw @@ -0,0 +1,23 @@ +CHANGES-msw + +This file briefly describes all mswindows-specific changes to XEmacs +in the OXYMORON series of releases. The mswindows release branch +contains additional changes on top of the mainline XEmacs +release. These changes are deemed necessary for XEmacs to be fully +functional under mswindows. It is not intended that these changes +cause problems on UNIX systems, but they have not been tested on UNIX +platforms. Caveat Emptor. + +See the file 'CHANGES-release' for a full list of mainline changes. + +to XEmacs 21.4.5 "Civil Service (Windows)" + + - Fixed a scrollbar problem when selecting the frame with focus. + - Fixed `mswindows-shell-execute' under cygwin. + - Added a new function `mswindows-cygwin-to-win32-path' for JDE. + - Added support for dialog-based directory selection. + - The installer version has been updated to the 21.5 netinstaller. The 21.5 + installer now does proper dde file association and adds uninstall + capability. + - Handle leak fix from Mike Alexander. + - New release build script. diff --git a/CHANGES-release b/CHANGES-release new file mode 100644 index 0000000..36c7a04 --- /dev/null +++ b/CHANGES-release @@ -0,0 +1,123 @@ +CHANGES-release + +This file briefly describes all changes to XEmacs in the OXYMORON +series of releases. In principle there should be no user interface +changes listed here, since this is intended to be a stable series. In +practice, some bugfixes do involve user-visible changes. In general +users should be happy about them, but they may affect workarounds you +have put in place. So those that do are noted here with (**). + +Also, the MS Windows platform support is not fully mature, and the GTK +platform support is explicitly experimental. In those cases +improvements that provably do not affect other platforms are accepted. +The platform affected is noted, and the change is flagged (**). + +Fixing a critical bug is not considered a "user interface change" in the +sense that there should be no way for it to interfere with you getting +more work done. + +Where there are many changes, they will be grouped into run-time, +build-time, and "documentation and data" changes. + +For more details, including developers involved and dates, see the +ChangeLogs, or use CVS diff to view the patches. + +to XEmacs 21.4.4 "Artificial Intelligence" + + - (**) There is a bug in "window procedures" under MS Windows only. + Non-debug builds print a warning on stderr, and you may want to + consider XEmacs unstable (save and restart) if you see it (debug + builds assert here). + - Printing the selection is implemented for MS Windows + - C-g now works on MS Windows + - Kinsoku (text wrapping for Asian scripts) fixes + - "Scrolling with no scrollbar" crash on MS Windows fixed + Krause). + - Case conversion works for Cyrillic + - Help is available with C-x s + - M-x locate-library completes library names + - (**) `replace-match' supports FSF-style match subexpressions + - `compose-mail' is supported in about.el + - (**) Renaming custom.el to inhibit loading it works + - (**) "Reset to standard" works with "set" and "saved" Custom + buffers + - `Unbalanced parentheses' bug when dealing with mixed comment + styles in c++/java/etc. mode fixed + - Byte-compiler optimization fixes + - Dired can handle directory names with unusual characters + - Popup menus work with popup-menu-titles turned off + - (**) M-? now invokes Help + - Data corruption in network streams on MS Windows fixed + - A few improvements and bug fixes in GTK support. + + - (**) EsounD support is no longer autodetected; you must explicitly + request it. EsounD does evil things with signals and XEmacs + cannot protect itself from the race conditions created. + - (**) The "excessively long startup when not networked" (often on + Red Hat Linux) problem is addressed with a configure option that + defeats IPv6 host name canonicalization, `--with-ipv6-cname=no'. + See also the discussion in PROBLEMS. + - Better detection of Cygwin Perl + - Support for old Cygwin betas dropped + - Better support for Windows Millenium Edition + - --with-widgets=no no longer autodetects Athena + - Self tests work if directory is a symlink + - Use ld reported by gcc, not gcc itself, to link + - TAR define added to src/Makefile + + - Many small and medium documentation fixes, including an improved + etc/sample.init.el, German tutorial, CCL fonts documentation + - etc/xemacs-ja.1 replaced with new translation + - much improved FAQ + +to XEmacs 21.4.3 "Academic Rigor" + + - Restore include of src/events-mod.h. + - Detect Windows native sound under Cygwin + - Restore patch for building --with-scrollbars=no + + - Update package docs + - More photos + - Misc comment fixes in source + +to XEmacs 21.4.2 "Developer-Friendly Unix APIs" + + - (**) Stop shifted motion from making active region persist if no motion. + - (**) MS Windows: Printer support now (optionally) adds headers/footers. + - (**) MS Windows: Critical-quit works. + - (**) GTK: Face editor changes can apply to GTK too. + - Fix hang in Customize menu on Windows platforms. + - Fix crash with xlc -O3 on AIX. + - make-charset handles short-name correctly. + + - Trivial sign-compare warning fix. + - MS Windows: nt/*.mak version string fix and assorted build cleanups. + - GCC 3.0 link error from cruft fixed. + - make-stds.info builds again with makeinfo 3.12 + + - Remove CVS keywords from build-report.el. + - Miscellaneous documentation fixes. + - Add photos, update descriptions in about.el. + - Update copyright notice on splash screen. + - FTP mirror site updates + +to XEmacs 21.4.1 "Copyleft" + + - Temporary fix to crash in map-keymap applied. + - Crash in Motif builds on closing frame fixed. + + - Descriptions of workarounds for crashes and hangs related to ESD + (don't configure it) and Athena3d (how to configure it properly) + added to PROBLEMS. + + - about.el overhauled, a few new hackers' entries or photos added, + and old ones updated. + - More etc\NEWS. + - Typo fix in etc\sample.init.el. + - Typos fixed in a number of documents. + +to XEmacs 21.4.0 "Solid Vapor" + + - Initial release of 21.4 series. See NEWS for changes since the last + stable release, 21.1. + diff --git a/ChangeLog b/ChangeLog index b743ab6..bb8025d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,1681 +1,3 @@ -2002-11-02 Stephen J. Turnbull - - * XEmacs 21.4.10 "Military Intelligence" is released. - -2002-11-01 Stephen J. Turnbull - - * Makefile.in.in (lisp/custom-load.el): Depend on auto-autoloads.el. - -2002-10-31 Christopher Sekiya - - * etc/OXYMORONS: "Too much Mozart" is an oxymoron. - -2002-10-25 Steve Youngs - - * etc/TUTORIAL.fr (suivante): Typo fix. - From juergen stuber . - -2002-10-23 Stephen J. Turnbull - - * Makefile.in.in (lisp/auto-autoloads.el): - (lisp/custom-load.el): - Use -no-autoloads for these targets; can't load 'em if they ain't. - -2002-10-18 Stephen J. Turnbull - - * PROBLEMS (Running/Cygwin): "No cygXpm-noX" fatal error. - -2002-10-17 Stephen J. Turnbull - - * PROBLEMS (Missing charsets): Remove ambiguity. - -2002-10-10 Stephen J. Turnbull - - * INSTALL (PREREQUISITES): Recommend Texinfo 4.2. - -2002-10-09 Stephen J. Turnbull - - * etc/BETA: Improve descriptions of XEmacs Patches; mention Design. - -2002-10-08 Stephen J. Turnbull - - * PROBLEMS (MacOS/X): Describe stack limitation. - (Digital Unix): Generalize to all regexp-using applications. - * INSTALL (PREQUISITES): Mention MacOS/X stack limitation. - (PROBLEMS): Point to PROBLEMS file for build notes. - Thanks to Skip Montanaro for the report. - -2002-10-07 Stephen J. Turnbull - - * Makefile.in.in (all-elcs): Depend on autoloads. - (autoloads): Depend on lib-src, lwlib, and src. - -2002-10-04 Stephen J. Turnbull - - * configure.in (Check for POSIX functions): New section head. - getaddrinfo is detected on HP-UX 11.XX, but appears to be - non-functional. Disable it. Based on work by Darryl Okahata. - -2002-09-27 Stephen J. Turnbull - - * PROBLEMS (Running, General): Missing charset in FontSet warnings. - - * Emacs.ad: Add charsets to *menubar*FontSet and *popup*FontSet. - -2002-08-29 Ville Skyttä - - * Emacs.ad: Add *menubar*FontSet and *popup*FontSet entries, - (self-)obtained from Red Hat. - -2002-09-25 Stephen J. Turnbull - - * etc/OXYMORONS: A couple new ones. - -2002-09-03 Stephen J. Turnbull - - * configure.usage: Complete rewrite and reorganization. - -2002-08-23 Stephen J. Turnbull - - * XEmacs 21.4.9 "Informed Management" is released. - -2002-05-22 Andy Piper - - * build-msw-release.sh (TMPINSTALL): install to a tmpdir so that - xemacs can be running while we build a dist. - -2002-04-26 Andy Piper - - * configure.in: make sure that a combined X and windows build gets - widgets. - -2002-08-10 Stephen J. Turnbull - - * etc/package-index.LATEST.pgp: Update. - -2002-08-10 Stephen J. Turnbull - - * PROBLEMS (General advice): Define runtime and build problems. - -2002-07-24 Stephen J. Turnbull - - * PROBLEMS (Running, Linux): Rewrite "Hannibal Lecter" ld stuff. - -2002-07-12 Stephen J. Turnbull - - * etc/BETA (Large contributions): Typo fix per JPW. - -2002-07-12 Stephen J. Turnbull - - * etc/BETA (Large contributions): New section. Reorganize file. - -2002-06-04 Jerry James - - * configure.usage: Identify --with-modules as autodetecting. - -2002-07-04 Stephen J. Turnbull - - * PROBLEMS: Add two basic configuration questions. - -2002-05-17 Stephen J. Turnbull - - * PROBLEMS: Describe "Hannibal Lecter" crash on Linux. Reorder - Linux runtime issues section. - * INSTALL: Improve description of mail locking. - -2002-05-10 Stephen J. Turnbull - - * etc/OXYMORONS (21.4.15): New. Not a reference to Vin. - - * build-msw-release.sh: Synch to Andy. - -2002-03-18 Gregory Steuck - - * configure.in: Improve OpenBSD support: correct check for - socklen_t, check for libtermcap is libncurses. - -2002-02-28 Malcolm Purvis - - * configure.in: Protect nocomboreloc linker arguments to avoid - problem on the ppc. - -2002-05-09 Stephen J. Turnbull - - * XEmacs 21.4.8 "Honest Recruiter" is released. - -2002-05-09 Stephen J. Turnbull - - * info/.cvsignore: New file from 21.5. - -2002-05-04 Stephen J. Turnbull - - * XEmacs 21.4.7 "Economic Science" is released. - -2002-05-04 Stephen J. Turnbull - - * etc/sample.init.el: Fix comment typo about resize-minibuffer. - - * etc/sample.init.el: Add description of initialization process, - the custom.el file, and code to load custom.el early instead of - late. - -2002-05-04 Stephen J. Turnbull - - * PROBLEMS (General): Decribe failed AUTH with EFS. - -2002-04-22 Hrvoje Niksic - - * etc/photos/hniksic.png, etc/photos/hniksic.png: Update. - -2002-04-25 Mike Fabian - - * configure.in: add option moduledir as mentioned - in ./configure --help - -2001-04-21 Martin Buchholz - - * configure.in: Detect MacOS/X "Darwin". - Thanks to Greg Parker . - -2002-03-30 Steve Youngs - - * etc/package-index.LATEST.pgp: Update to current reality. - -2002-02-28 Stephen J. Turnbull - - * etc/TUTORIAL.se: New from Mats Lidell. - -2002-01-07 Jan Vroonhof - - * configure.in: Make explicit "--with-widgets" mean "=yes". - If "--with-widgets=yes" autodetect athena. - -2001-12-29 Steve Youngs - - * etc/package-index.LATEST.pgp: Update. - -2001-12-13 William M. Perry - - * configure.in (GTK): add -Wno-shadow. - -2002-02-04 Stephen J. Turnbull - - * etc/BETA: Synch to 21.5. - -2002-01-23 Jarl Friis - - * etc/BETA (http): Informing of xemacs-patches mailing list. Added - note on patch etiquette. - -2001-12-17 Stephen J. Turnbull - - * XEmacs 21.4.6 "Common Lisp" is released. - -2001-12-04 Jan Vroonhof - - * etc/photos/jan.png: New photo. - -2001-11-21 Robert Pluim - - * PROBLEMS (Sun/Solaris): Document fix for Motif related crashes - -2001-12-15 Stephen J. Turnbull - - * configure.in (Miscellaneous Flags): test for -z nocombreloc, - instead of -z combreloc, to avoid confusing Solaris. - -2001-11-24 Stephen J. Turnbull - - * configure.usage: Makefile.in -> Makefile.in.in. - -2001-11-21 Stephen J. Turnbull - - * Makefile.in.in: HP-UX needs LDFLAGS. From Lutz Jaenicke - . - -2001-11-17 Stephen J. Turnbull - - * configure.in: Fix typos in comments. - * (Miscellaneous flags): Use -z nocombreloc if supported and !pdump. - * (Installation): Suggest pdump instead of -z nocomboreloc. - * configure.usage: Document --quick-build. - -2001-10-30 Stephen J. Turnbull - - * configure.in: Typo in reference to with_ipv6_cname. - -2001-10-30 Stephen J. Turnbull - - * configure.in: Initialize with_ipv6_cname=no. - * configure.usage: Document it. - -2001-10-23 Stephen J. Turnbull - - * XEmacs 21.4.5 "Civil Service" is released. - -2001-10-05 Stephen J. Turnbull - - * configure.in: Document that autoconf 2.5x is unsupported. - -2001-10-02 Stephen J. Turnbull - - * PROBLEMS: configure doesn't support --with-{ld,as}, use environment - variables. Suggested by Goran Koruga . - -2001-09-17 Ben Wing - - * configure.in (TAB): - * configure.in (XE_COMPUTE_RUNPATH): - Don't use -Wshadow when compiling with g++ or you get buried in - silly warnings. This patch was already applied but somehow got - unapplied. Stephen? - -2001-08-19 Charles Wilson - - * configure.in (for graphics libraries): Detect Cygwin xpm-nox. - -2001-08-02 Peter Brown - - Synch options documentation with those in configure.in: - - * configure.usage (--with-dialogs): added lucid to list of options - * configure.usage (--with-widgets): added lucid to list of options - * configure.usage (--with-dragndrop): added GTK to list of protocols - * configure.usage (--mail-locking): added `locking' or `mmdf'. to list - of options - - -2001-09-25 Didier Verna - - * configure.ac: new. Autoconf 2.5x guard. - -2001-08-29 Jered Floyd - - * configure.in (moduledir,sitemoduledir,archlibdir): - Place arch-specific files under ${libdir}, not under ${datadir}. - -2001-07-28 Stephen J. Turnbull - - * XEmacs 21.4.4 "Artificial Intelligence" is released. - -2001-07-22 Stephen J. Turnbull - - * configure.in (with_esd_sound): Default to no. - - * configure.usage: Various documentation improvements. - - * configure.in (--with-ipv6-cname): New Boolean option. Defaults on. - * configure.usage: - * PROBLEMS (IPv6 CNAME lookup): - Document it. - -2001-07-18 Adrian Aichner - - * etc\TUTORIAL: Fix minor typo. - * etc\TUTORIAL.de: Sync with TUTORIAL. - -2001-05-23 Ben Wing - - * etc\sample.init.el: - * etc\sample.init.el (Init-safe-require): New. - * etc\sample.init.el ((fboundp 'pending-delete-mode)): - * etc\sample.init.el ((eq system-type 'windows-nt)): - * etc\sample.init.el (dired): - * etc\sample.init.el ((Init-safe-require 'efs-auto)): - * etc\sample.init.el (completer): - * etc\sample.init.el (crypt): - * etc\sample.init.el (filladapt): - * etc\sample.init.el ((fboundp 'turn-on-lazy-lock)): - * etc\sample.init.el ((fboundp 'resize-minibuffer-mode)): - * etc\sample.init.el ((Init-safe-require 'scroll-in-place)): - Rewrite to be much more careful about loading features -- now - it decays gracefully even in the complete absence of packages. - Also avoid doing obnoxious things when loading efs. - -2001-04-14 Gordon Sadler - - * configure.in: Add GTK_CFLAGS to CPPFLAGS for glade.h check. - -2001-07-01 Alexey Mahotkin - - * configure.in (option processing): with_widgets=m is ambiguous; - don't allow it. - (AC_CHECKING for the Athena widgets): Don't check for Athena when - with_widgets=no. - -2001-05-29 Martin Buchholz - - * configure.in: Remove stray backslash. - -2001-05-27 Kazuo Oishi - - * etc/xemacs-ja.1: Replace with new translation. - -2001-05-17 Andrew Begel - - * aclocal.m4 (LTLD): Don't use "gcc", use the ld reported by gcc. - -2001-05-17 Stephen J. Turnbull - - * XEmacs 21.4.3 "Academic Rigor" is released. - -2001-05-10 Paul Stodghill - - * configure.in: Reverse the order of Windows and Linux sound tests - so that Cygwin will find Windows first. - -2001-05-15 Steve Youngs - - * etc/photos/{youngs,youngsm}.png: New photos. - -2001-05-15 Steve Youngs - - * etc/PACKAGES: Update to reflect new package dir tree. - -2001-05-10 Stephen J. Turnbull - - * XEmacs 21.4.2 "Developer-Friendly Unix APIs" is released. - -2001-05-04 Martin Buchholz - - * configure.in (opsys): - Use lower-case `uname -s` as the default value for opsys. - The previous code effectively did the non-sensical - opsys=$canonical because [] magically disappear in configure.in. - -2001-01-31 Jason R. Mastaler - - * etc/FTP: Updated FTP mirrors list. - -2001-05-04 Ben Wing - - * etc\NEWS: Remove kill-whole-line changes. - -2001-04-25 Ben Wing - - * PROBLEMS: - * PROBLEMS (Note): - * PROBLEMS (ftp): - Correct general info about init file. - Fix up Cygwin section. - -2001-04-19 Stephen J. Turnbull - - * XEmacs 21.4.1 "Copyleft" is released. - -2001-04-17 Ben Wing - - * etc\NEWS: More changes. - - * etc\sample.init.el (grep-all-files-in-current-directory-and-below): - Missing argument. - - * etc\photos\fabrice.png: - * etc\photos\fabricem.png: - * etc\photos\juhp.png: - * etc\photos\juhpm.png: - Add photos. - * etc\photos\jwz.png: - * etc\photos\jwzm.png: - Update photos. - -2001-04-17 Stephen J. Turnbull - - * README: - * etc/README: - * etc/MACHINES: - * etc/PACKAGES: - * etc/TUTORIAL.ja: - Fixup 21.2 -> 21.4. - - * configure: Regenerate. - - * PROBLEMS (Running/Linux): Add entries for ESD interrupts and - Debian Athena3d workarounds. - - * PROBLEMS: s/xemacs@xemacs.org/xemacs-beta@xemacs.org/ in - requests for developer volunteers. - -2001-04-16 Stephen J. Turnbull - - * XEmacs 21.4.0 "Solid Vapor" is released. - -2001-04-16 Stephen J. Turnbull - - * etc/photos/wing*.png: Rename to ben*.png. - -2001-04-14 Stephen J. Turnbull - - * XEmacs 21.2.47 "Zephir" is released. - -2001-03-26 Paul Stodghill - - * configure.in: Don't #define __STDC__ in confdefs.h - -2001-03-30 Ben Wing - - * etc\sample.init.el: - * etc\sample.init.el (Init-kill-entire-line): - * etc\sample.init.el (describe-foo-at-point): - * etc\sample.init.el (kill-current-buffer): - * etc\sample.init.el (kill-current-buffer-and-window): - * etc\sample.init.el (grep-c-files): Removed. - * etc\sample.init.el (grep-all-files-history): New. - * etc\sample.init.el (grep-all-files-omitted-expressions): New. - * etc\sample.init.el (grep-all-files-omitted-directories): New. - * etc\sample.init.el (construct-grep-all-files-command): New. - * etc\sample.init.el (grep-all-files-in-current-directory): New. - * etc\sample.init.el (grep-lisp-files): Removed. - * etc\sample.init.el (grep-all-files-in-current-directory-and-below): New. - * etc\sample.init.el (clear-select): - * etc\sample.init.el ((control kp-add)): - * etc\sample.init.el (pause): - * etc\sample.init.el ((eq system-type 'windows-nt)): - - Add documentation for defined functions. Change grep functions to - be more generally useful. Document more specifically what the - `menu-force' setting actually does -- what commands are overridden - and how to access them. - -2001-03-30 Stephen J. Turnbull - - * configure.usage: Document --with-file-coding. - - * etc/OXYMORONS: Add 2 oxymorons, clean up numbering, close RFC. - - * etc/NEWS: Fix typo. - - * configure.in: - * configure: - Fix typo, add -Wsign-compare if GCC, run autoconf. - -2001-03-23 Stephen J. Turnbull - - * etc/gnuserv.1 (UNIX_DOMAIN_SOCKETS: - * PROBLEMS (Problems with running XEmacs): - Document TMPDIR lossage in gnuserv/gnuclient. - -2001-03-06 Ben Wing - - * etc\sample.init.el: - * etc\sample.init.el (Init-kill-entire-line): New. - Fix to take into account the removed kill-whole-line changes. - -2001-03-21 Martin Buchholz - - * XEmacs 21.2.46 "Urania" is released. - -2001-03-19 Andy Piper - - * configure.in: default rel-alloc to off under cygwin - -2001-03-15 Stephen J. Turnbull - - * ChangeLog: Fix CVS commit breakage from GTK merge, log GTK merge. - - * CHANGES-beta: - * configure.in: - Fix gratuitous whitespace changes from GTK merge. - - * configure.usage: Untabify --with-{gtk,gnome}. - -2001-03-15 Stephen J. Turnbull - - * etc/OXYMORONS: New file of 21.4 codenames. - -2001-03-12 Andy Piper - - * configure.in: only pick up mingw directory. - -2001-03-02 Ben Wing - - * info\dir: Update to 21.4; clean up descriptions of manuals; - replace misnomer "Local Packages" with more correct "Other - Documentation". - -2001-03-02 Ben Wing - - * etc\README: sample.emacs -> sample.init.el. - -2001-03-09 William M. Perry - - * CHANGES-beta: - * configure.in: - * configure.usage: - The Great GTK Merge. - -2001-02-23 Andy Piper - - * configure.usage (--with-netinstall): add docs. - - * configure.in: with_netinstall is a new option. Default to off. - -2001-02-23 Martin Buchholz - - * XEmacs 21.2.45 "Thelxepeia" is released. - -2001-02-13 Martin Buchholz - - * aclocal.m4: Fix module support for AIX cc. - Support possible future OSes irix7, aix5, osf[56]. - -2001-02-12 Martin Buchholz - - * configure.in: No need for NON_GNU_CPP on SCO. - -2001-02-10 Martin Buchholz - - * etc/MACHINES: Rewritten. Bitrot discarded. - -2001-02-09 Martin Buchholz - - * configure.in: Prefer utime to utimes - it's more standard. - Remove explicit checking for struct utimbuf. - Remove explicit checking for . - Combined into one simpler test for utime. - Add explicit check for utimes, if utime not found. - -2001-02-08 Martin Buchholz - - * XEmacs 21.2.44 "Thalia" is released. - -2001-01-16 Mike Sperber - - * configure.in: Remove bogus path variable definitions. - Reflect the fact that specifying --datadir also affects docdir and - archlibdir. - -2001-02-06 Martin Buchholz - - * configure.in: Only use -Wpointer-arith on non-glibc systems. - -2001-02-02 Martin Buchholz - - * configure.in (wnn): Make sure wnn/commonhd.h can be #included, - for the sake of gcc 2.97 fixincludes, which breaks it. - -2001-01-27 Martin Buchholz - - * configure.in: Check for util.h for NetBSD's openpty. - -2001-01-28 Martin Buchholz - - * config.sub: Upgrade to offical version 2001-01-12. - * config.guess: Upgrade to offical version 2001-01-17. - -2001-01-26 Martin Buchholz - - * XEmacs 21.2.43 "Terspichore" is released. - -2001-01-21 Steve Youngs - - * ./etc/PACKAGES: Doc fix. - - * README.packages: Doc fix. - -2001-01-17 Steve Youngs - - * README.packages: Update. - - * ./etc/PACKAGES: Update. - -2001-01-20 Martin Buchholz - - * XEmacs 21.2.42 "Poseidon" is released. - -2001-01-18 Martin Buchholz - - * PROBLEMS (Sun/Solaris): Yet another microimprovement. - -2001-01-17 Martin Buchholz - - * PROBLEMS (Sun/Solaris): Replace --with-gnu-ld=no with - --with-ld=/usr/ccs/bin/ld - -2001-01-16 Robert Pluim - - * PROBLEMS (SunOS/Solaris): Document workaround for GNU ld bug on - Solaris. Half mine, half Raymond Toy, half Martin Buchholz. - -2001-01-16 Didier Verna - - * NEWS: document the modeline horizontal scrolling feature. - -2001-01-17 Martin Buchholz - - * XEmacs 21.2.41 "Polyhymnia" is released. - -2001-01-16 Martin Buchholz - - * PROBLEMS: Document MIPSpro ICE problem workaround. - -2001-01-06 Golubev I. N. - - * configure.in: check for dlopen by linking program with - . - -2001-01-08 Andy Piper - - * configure.in: add extra_includes and populate appropriately for - cygwin and mingw. - -2000-12-28 Andy Piper - - * configure.in: allow --with-widgets=msw - -2001-01-08 Martin Buchholz - - * XEmacs 21.2.40 is released. - -2000-12-26 Stephen J. Turnbull - - * PROBLEMS (Running/Linux): Rehabilitate Mandrake; tip for color-gcc. - -2000-12-20 Stephen J. Turnbull - - * PROBLEMS (Linux): document Mandrake policy, how to get Meta on - Alt, and getaddrinfo() blocking trying to get localhost's CNAME. - -2000-07-20 Kazuyuki IENAGA - - * configure.in: use input-method-xlib.o for USE_XFONTSET instead - of input-method-xfs.o. - - * configure: ditto - -2000-12-31 Martin Buchholz - - * XEmacs 21.2.39 is released. - -2000-02-02 Daiki Ueno - - * configure.in: Added check if the berkdb has db_create or not. - -2000-10-11 Yoshiki Hayashi - - * configure.in: Fix broken gcc detection for 2.7.2. - -2000-12-11 Andy Piper - - * configure.in (XE_COMPUTE_RUNPATH): add netinstall as a subdirectory. - - * netinstall: new net installer for MS-Windows. - -2000-12-05 Martin Buchholz - - * XEmacs 21.2.38 is released. - -2000-11-26 Bjrn Torkelsson - - * configure.in: Only show message about DnD API if compiling with DnD - -2000-11-09 Martin Buchholz - - * configure.in: Autodetect elf.h. - -2000-11-14 Martin Buchholz - - * XEmacs 21.2.37 is released. - -2000-10-19 Stephen J. Turnbull - - * README.packages: Add "uninstalled package" FAQ. - - * etc/PACKAGES: Add details on os-utils contents. - -2000-11-01 Martin Buchholz - - * configure.in: Handle alloca with Compaq C on Alpha Linux. - -2000-10-27 Martin Buchholz - - * configure.in: Oops, _getpt ==> _getpty - -2000-10-23 Yoshiki Hayashi - - * Makefile.in.in: Remove lockdir related things. - -2000-10-11 Martin Buchholz - - * configure.in: - Remove checking for XFree86. Use feature tests instead! - Add check for XRegisterIMInstantiateCallback. - Add check for XRegisterIMInstantiateCallback's prototype. - -2000-10-04 Yoshiki Hayashi - - * etc/NEWS: Change lprogress-display to progress-feedback. - -2000-10-08 Karl M. Hegbloom - - * configure.in: Typo - missing paren. - -2000-10-10 Martin Buchholz - - * configure.in: - Use stropts.h, not sys/stropts.h. - Use strtio.h, not sys/strtio.h. - -2000-10-06 Martin Buchholz - - * configure.in: Pretend that DEC OSF >= 5 is really DEC OSF 4. - -2000-10-04 Martin Buchholz - - * XEmacs 21.2.36 is released. - -2000-08-29 Robert Pluim - - * etc/NEWS: fix reference to progress-feedback-use-echo-area - -2000-09-27 Martin Buchholz - - * configure.in: Big signal/process handling overhaul. - Autoconfiscate lots of functions and headers: - getpt _getpt grantpt unlockpt ptsname killpg tcgetpgrp - openpty pty.h libutil.h sys/stropts.h sys/strtio.h isastream - -2000-09-20 Martin Buchholz - - * etc/xemacs.1: Spelling fixes. Remove stuff that doesn't belong. - -2000-09-19 Martin Buchholz - - * *: Spelling mega-patch - -2000-09-16 Martin Buchholz - - * configure.in: Remove strcasecmp. - - * etc/Emacs.ad: Remove Energize from comments. - -2000-09-16 Martin Buchholz - - * configure.in: Add -Kalloca to $c_switch_system when using - Unixware native compiler (if necessary). - -2000-09-15 Martin Buchholz - - * configure.in: Prevent spurious "No" in configure output when not - using gcc. Oh, and it's "no", not "No". Oh, and it's "yes", not "Yes". - -2000-09-14 Martin Buchholz - - * configure.in: Save 2 sed process invocations per Makefile. - -2000-08-22 SL Baur - - * configure.in (after_morecore_hook_exists): Don't add /usr/shlib - to link path if compiling on Alpha/Linux. - -2000-09-01 Martin Buchholz - - * Makefile.in.in (depend): cd to the correct directory. - -2000-08-31 Martin Buchholz - - * configure.in: with_widgets is incompatible with X11 R4. - - * configure.in: Make Balloon Help conditional on finding shape.h - -2000-08-02 Stephen J. Turnbull - - * etc/Emacs.ad: Document usage of FontSet resource for menubar. - -2000-08-09 Vin Shelton - - * configure.in: Check for UNIX98 PTYs. Patch from Florian Weimer - . - -2000-07-31 Yoshiki Hayashi - - * configure.usage: Remove lockdir document. - -2000-07-31 Martin Buchholz - - * configure.in: - Make knowledge of machine and opsys optional. - Make existence of s&m files optional. - Rely on configure alone if s&m files not found. - - * configure.in: - Use only configure-time tests to detect getloadavg(). - Don't check for kstat.h if we have getloadavg(). - Check for sys/loadavg.h if we have getloadavg(). - -2000-07-15 Ben Wing - - * Makefile.in.in (configure): - all-elcs target now uses update-elc-2.el not update-elc.sh - -2000-07-19 Martin Buchholz - - * XEmacs 21.2.35 is released. - -2000-07-13 Martin Buchholz - - * configure.in: --with-menubars=yes should not be an error. - - * configure.in: "compiling in support for Athena" message was - sometimes lying. - -2000-07-12 Martin Buchholz - - * configure.in: Rewrite xmkmf symbol detection to avoid - redefinition of symbols we've already defined. - Also, handle xmkmf symbols with values other than 1. - -2000-07-12 Martin Buchholz - - * configure.in: - Make sure Unix98 socklen_t is defined. - Use ANSI C mode `-std1' with DEC C instead of `-std'. - -2000-07-09 Martin Buchholz - - * configure.in: - Replace SMART_INCLUDE with a dumber, but more reliable method. -2000-07-10 Martin Buchholz - - * modules/zlib/Makefile: - * modules/sample/Makefile: - * modules/ldap/Makefile: - * modules/base64/Makefile: - * Makefile.in.in: - rm -f ==> $(RM) - define SHELL=/bin/sh - -2000-07-09 Martin Buchholz - - * configure.in: PostgreSQL rewrite. - - Don't look for postgreSQL in /usr/local. - - Simplify detection code. - - Don't use SMART_INCLUDE. - - Don't autodetect if --with-postgresql=no. - -2000-07-08 Ben Wing - - * configure.usage: addl doc for graphics libs, with-msw. - -2000-07-09 Martin Buchholz - - * configure.in: sh builtin `test' uses `=', not `=='. - -2000-07-08 Ben Wing - - * configure.in: add -lcomdlg32 for cygwin. - -2000-07-05 Craig Lanning - - * aclocal.m4 (can_build_shared): - First pass at module support for cygwin and mingw. - - * configure: - * configure (xe_check_libs): - * configure (acfindx): - * configure (ac_x_includes): - * configure (ac_x_libraries): - * configure (ac_cv_lib_dnet_dnet_ntoa): - * configure (xe_msg_checking): - * configure (xe_runpath_dir): - * configure (xetest): - * configure (ac_err): - * configure (ac_safe): - * configure (with_xmu): - * configure (bitmapdir): - * configure (with_xauth): - * configure (libs_xauth): - * configure (with_cde): - * configure (with_ldap): - * configure (with_ldap_krbdes): - * configure (save_c_switch_site): - * configure (with_postgresql): - * configure (with_xface): - * configure (with_jpeg): - * configure (with_png): - * configure (with_tiff): - * configure (athena_lib): - * configure (have_motif): - * configure (all_widgets): - * configure (with_xim): - * configure (with_xfs): - * configure (with_wnn): - * configure (with_canna): - * configure (extra_objs): - * configure (ac_cv_c_inline): - * configure (have_esd_config): - * configure (c_switch_site): - * configure (with_ncurses): - * configure (with_gpm): - * configure (xealias): - * configure (xehost_os): - * configure (can_build_shared): - * configure (xcldf): - * configure (LTLD): - * configure (ld_dynamic_link_flags): - * configure (Mail): - * configure.in: - * configure.in (after_morecore_hook_exists): - * configure.in (xetest): - * configure.in (emacs_cv_localtime_cache): - * configure.in (Mail): - * configure.in: - Clean up configure support for cygwin and mingw. - -2000-06-27 Darryl Okahata - - * PROBLEMS: Document broken native audio for recent patches and - releases of HP-UX. - -2000-06-10 Ben Wing - - * Makefile.in.in (install-arch-dep): - WINDOWSNT -> WIN32_NATIVE. - __CYGWIN32__ -> CYGWIN. - -2000-06-01 Andreas Jaeger - - * configure.in: Recognize s390. - - * config.guess: New version from GNU config archive. - * config.sub: Likewise. - -2000-05-28 Martin Buchholz - - * XEmacs 21.2.34 is released. - -2000-05-15 Yoshiki Hayashi - - * configure.in: - Do not define DOUG_LEA_MALLOC when using other malloc scheme. - Remove unused variable use_minimal_tagbits. - -2000-05-02 Yoshiki Hayashi - - * configure.in: Remove lockdir. - -2000-04-15 Andy Piper - - * etc/Emacs.ad: add select-start() back into text translations. - -2000-05-01 Martin Buchholz - - * XEmacs 21.2.33 is released. - -2000-04-27 Katsumi Yamaoka - - * configure.in: Use ORDINARY_LD instead of "\$(ORDINARY_LD)" for - the value of LD. - -2000-04-26 Ben Wing - - * configure.in: add support for --quick-build. Remove --no-doc-file, - subsumed. - -2000-04-19 Martin Buchholz - - * configure.in: - * src/config.h.in: - Rewrite SMART_INCLUDE implementation to actually work. - Be paranoid - Avoid use of spaces in these macro definitions. - Leave alloca() definition at start of compilation unit, - as AIX requests. - Rename SMART_INCLUDE_MACRO to SMART_INCLUDE_INDIRECTIONS. - -2000-04-13 Yoshiki Hayashi - - * configure.in: Enable clash-detection by default. - * configure.usage: Update documentation. - -2000-04-06 Andy Piper - - * configure.in: fix typo. - -2000-04-12 Andy Piper - - * etc/Emacs.ad: give the gui-element face the same font as the - menubar and popups. Add translations for text widgets. - -2000-04-03 Yoshiki Hayashi - - * configure.in : Fix printing error check warning even if - it is not compiled in. - -2000-02-19 Jan Vroonhof - - * xemacs/configure.in: Do a normal link when compiling with - --pdump. Don't try compiling an unexec object file. - -2000-03-27 Didier Verna - - * configure.in: reorganize the output by topic. - New configure test to define the proper SMART_INCLUDE macro. - - * configure.usage: slightly rearanged some options. - -2000-03-25 Didier Verna - - * configure.in: rename `foo_h_path' to `foo_h_file' for variables - representing real headers and not directories. This applies to - `db_h_path', `curses_h_path', `term_h_path', `tt_c_h_path' and - `soundcard_h_path'. - -2000-03-21 Didier Verna - - * configure.in: try to find postgresql headers at different places - and define POSTGRES_H_PATH as appropriate. - -2000-03-22 Andy Piper - - * config.h.in: add ERROR_CHECK_GLYPHS. - - * configure.in: add error_check_glyphs. - -2000-03-20 Martin Buchholz - - * XEmacs 21.2.32 is released. - -2000-03-15 Olivier Galibert - - * configure.in: Add dumper.o object when pdumping. - -2000-02-20 Olivier Galibert - - * Makefile.in.in: Add pdump install support - - * configure.in: Add EMACS_PROGNAME config.h variable. - -2000-03-10 SL Baur - - * configure.usage: document --with-postgresql flag. - -2000-03-06 SL Baur - - * configure.in: add autodetection of PostgreSQL runtime libraries - -2000-03-09 Yoshiki Hayashi - - * aclocal.m4 (XE_SHLIB_STUFF): Define ld_shlibs to yes - when C compiler can produce shared libraries. - -2000-03-01 Didier Verna - - * etc/NEWS: update the rect.el entry. - -2000-02-26 Martin Buchholz - - * configure.in: Unconditionally define SHELL, to allow working - with (unreleased) autoconf 2.14.1, found on Mandrake 7.0 systems. - -2000-02-23 Martin Buchholz - - * XEmacs 21.2.31 is released. - -2000-02-21 Martin Buchholz - - * XEmacs 21.2.30 is released. - -2000-02-20 Martin Buchholz - - * configure.in: Enforce use of autoconf version >= 2.13. - - * configure.in: Fix OS release test on Solaris. - -2000-02-19 Marcus Thiessel - - * PROBLEMS: Update email address. Describe more HP Motif errors. - -2000-02-19 Jan Vroonhof - - * configure.in: Split Solaris version test in two parts. In the - Bourne shell the "-a" operator does NOT short-circuit. - -1999-12-15 Jan Vroonhof - - * (configure.in): Autodetect broken gcc versions. Patch from WM - Perry with tiny tweaks by Yoshiki Hayashi and yours truly. - -2000-02-17 Martin Buchholz - - * configure.in: Autodetect sys/param.h. Reorganize - AC_CHECK_HEADERS call. - * src/config.h.in: Add HAVE_SYS_PARAM_H. - -2000-02-16 Martin Buchholz - - * configure.in: Test for arm simply using arm* instead of arm-* - -2000-01-05 Yoshiki Hayashi - - * etc/TUTORIAL.ja: Synch with English version. - -2000-02-16 Martin Buchholz - - * XEmacs 21.2.29 is released. - -2000-02-16 Martin Buchholz - - * configure.in: Don't use rel_alloc if malloc() calls mmap(). - Discover this by looking for M_MMAP_THRESHOLD. - - * configure.in: Don't define POSIX_C_SOURCE on Solaris, due to - bugs in (at least) Solaris 2.5 headers. - -2000-01-29 Craig Lanning - - * configure.in: Fix detection of XPM on systems without X11. - -2000-02-11 Martin Buchholz - - * configure.in: - * src/config.h.in: - Define _POSIX_C_SOURCE, _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, - but only on tested Operating systems - Linux && SunOS >= 5.5. - -2000-02-09 Valdis Kletnieks - - * aclocal.m4: Support dlls on aix[34]. - -2000-02-09 Martin Buchholz - - * .cvsignore: Ignore gmon.out - -2000-02-08 Martin Buchholz - - * configure.in: Sync Berkeley db autodetection with src/database.c - -2000-02-07 Martin Buchholz - - * configure.in: check for XConvertCase. - -2000-02-07 Martin Buchholz - - * XEmacs 21.2.28 is released. - -2000-01-27 URA Hiroshi - - * configure.in: added getaddrinfo and getnameinfo to AC_FUNC. - -2000-01-26 Martin Buchholz - - * 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 @@ -1686,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 @@ -1756,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 @@ -1777,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 @@ -1834,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 @@ -1986,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. @@ -1997,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 @@ -2552,7 +874,7 @@ Thu Apr 16 12:59:35 1998 Andy Piper * 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. @@ -2815,7 +1137,7 @@ Wed Jan 28 13:41:22 1998 Andy Piper * 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 @@ -2897,7 +1219,7 @@ Wed Jan 21 10:49:47 1998 Andy Piper * 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. @@ -3213,7 +1535,7 @@ Sun November 01 12:00:00 1997 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 @@ -3229,13 +1551,13 @@ Sun November 01 12:00:00 1997 * 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 @@ -3248,12 +1570,12 @@ Sun November 01 12:00:00 1997 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, @@ -3384,7 +1706,7 @@ Sun November 01 12:00:00 1997 1997-10-18 SL Baur - * XEmacs 20.3-beta91 is released. + * XEmacs 20.3-beta91 is released. 1997-10-16 Hrvoje Niksic @@ -4706,7 +3028,7 @@ Sat Mar 22 16:47:08 1997 Steven L Baur 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 @@ -5134,3 +3456,5 @@ Thu Dec 5 20:42:35 1996 Steven L Baur Thu Dec 5 11:56:05 1996 Joseph J Nuspl * configure.in (LIBS): Fix typo in dialog box test. + + diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..3a59498 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,631 @@ +## DIST: This is the distribution Makefile for XEmacs. configure can +## DIST: make most of the changes to this file you might want, so try +## DIST: that first. + +## This file is part of XEmacs. + +## XEmacs is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by the +## Free Software Foundation; either version 2, or (at your option) any +## later version. + +## XEmacs is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. + +## You should have received a copy of the GNU General Public License +## along with XEmacs; see the file COPYING. If not, write to +## the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +## Boston, MA 02111-1307, USA. + +## make all to compile and build XEmacs. +## make install to build and install it. +## make install-only to install after a previous complete build +## make TAGS to update tags tables. + +## make clean or make mostlyclean +## Delete all files from the current directory that are normally +## created by building the program. Don't delete the files that +## record the configuration. Also preserve files that could be made +## by building, but normally aren't because the distribution comes +## with them. + +## Delete `.dvi' files here if they are not part of the distribution. + +## make distclean +## Delete all files from the current directory that are created by +## configuring or building the program. If you have unpacked the +## source and built the program without creating any other files, +## `make distclean' should leave only the files that were in the +## distribution. + +## make realclean +## Delete everything from the current directory that can be +## reconstructed with this Makefile. This typically includes +## everything deleted by distclean, plus more: C source files +## produced by Bison, tags tables, info files, and so on. + +## make extraclean +## Still more severe - delete backup and autosave files, too. + +@SET_MAKE@ +RECURSIVE_MAKE=@RECURSIVE_MAKE@ +SHELL = /bin/sh +LANG = C +RM = rm -f +pwd = /bin/pwd + +## ==================== Things `configure' Might Edit ==================== + +CC=@CC@ +CPP=@CPP@ +LN_S=@LN_S@ +CFLAGS=@CFLAGS@ +CPPFLAGS=@CPPFLAGS@ +LDFLAGS=@LDFLAGS@ + +## These help us choose version- and architecture-specific directories +## to install files in. + +## This should be the number of the XEmacs version we're building, +## like `19.12' or `19.13'. +version=@version@ + +## This should be the name of the configuration we're building XEmacs +## for, like `mips-dec-ultrix' or `sparc-sun-sunos'. +configuration=@configuration@ + +## This will be the name of the generated binary and is set automatically +## by configure. +PROGNAME=@PROGNAME@ + +## ==================== Where To Install Things ==================== + +## The default location for installation. Everything is placed in +## subdirectories of this directory. The default values for many of +## the variables below are expressed in terms of this one, so you may +## not need to change them. This defaults to /usr/local. +prefix=@prefix@ + +## Like `prefix', but used for architecture-specific files. +exec_prefix=@exec_prefix@ + +## Where to install XEmacs and other binaries that people will want to +## run directly (like etags). +bindir=@bindir@ + +## Where to install architecture-independent data files. +## ${lispdir} and ${etcdir} are subdirectories of this. +datadir=@datadir@ + +## Where to find XEmacs packages. +pkgdir=@pkgdir@ + +## Where to install and expect the files that XEmacs modifies as it runs. +## These files are all architecture-independent. Right now, the +## only such data is the locking directory; +## ${lockdir} is a subdirectory of this. +statedir=@statedir@ + +## Where to install and expect executable files to be run by XEmacs +## rather than directly by users, and other architecture-dependent data +## ${archlibdir} is a subdirectory of this. +libdir=@libdir@ + +## Where to install XEmacs's man pages, and what extension they should have. +mandir=@mandir@ +manext=.1 + +## Where to install and expect the info files describing XEmacs. In the +## past, this defaulted to a subdirectory of ${prefix}/lib/xemacs, but +## since there are now many packages documented with the texinfo +## system, it is inappropriate to imply that it is part of XEmacs. +infodir=@infodir@ + +## Document me. +## See callproc.c for code which references this. +infopath=@infopath@ + +## Where to find the source code. The source code for XEmacs's C kernel is +## expected to be in ${srcdir}/src, and the source code for XEmacs's +## utility programs is expected to be in ${srcdir}/lib-src. This is +## set by the configure script's `--srcdir' option. +srcdir=@srcdir@ + +## Where the build is done. +blddir=@blddir@ + +## ==================== XEmacs-specific directories ==================== + +## These variables hold the values XEmacs will actually use. They are +## based on the values of the standard Make variables above. + +## Where to install the lisp files distributed with +## XEmacs. This includes the XEmacs version, so that the +## lisp files for different versions of XEmacs will install +## themselves in separate directories. +lispdir=@lispdir@ + +## Directory XEmacs should search for lisp files specific +## to this site (i.e. customizations), before consulting +## ${lispdir}. +sitelispdir=@sitelispdir@ + +## Where XEmacs will search for its lisp files while +## building. This is only used during the process of +## compiling XEmacs, to help XEmacs find its lisp files +## before they've been installed in their final location. +## It's usually identical to lispdir, except that the +## entry for the directory containing the installed lisp +## files has been replaced with ../lisp. This should be a +## colon-separated list of directories. +buildlispdir=${srcdir}/lisp + +## Where to install the other architecture-independent +## data files distributed with XEmacs (like the tutorial, +## the cookie recipes and the Zippy database). This path +## usually contains the XEmacs version number, so the data +## files for multiple versions of XEmacs may be installed +## at once. +etcdir=@etcdir@ + +## Where to create and expect the locking directory, where +## the XEmacs locking code keeps track of which files are +## currently being edited. +lockdir=@lockdir@ + +## 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 +## for multiple versions of XEmacs may be installed at +## once. +archlibdir=@archlibdir@ + +## ==================== Utility Programs for the Build ==================== + +## Allow the user to specify the install program. +INSTALL = @install_pp@ @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +## ============================= Targets ============================== + +## Subdirectories to make recursively. `lisp' is not included +## because the compiled lisp files are part of the distribution +## and you cannot remake them without installing XEmacs first. +MAKE_SUBDIR = @MAKE_SUBDIR@ + +## Subdirectories that can be made recursively. +SUBDIR = ${MAKE_SUBDIR} man + +## The makefiles of the directories in ${MAKE_SUBDIR}. +SUBDIR_MAKEFILES = @SUBDIR_MAKEFILES@ + +## Subdirectories to `make install-arch-dep' recursively +INSTALL_ARCH_DEP_SUBDIR = @INSTALL_ARCH_DEP_SUBDIR@ + +## Subdirectories to install, and where they'll go. +## lib-src's makefile knows how to install it, so we don't do that here. +## When installing the info files, we need to do special things to +## avoid nuking an existing dir file, so we don't do that here; +## instead, we have written out explicit code in the `install' targets. +COPYDIR = ${srcdir}/etc ${srcdir}/lisp +COPYDESTS = ${etcdir} ${lispdir} +GENERATED_HEADERS = src/paths.h src/Emacs.ad.h src/puresize-adjust.h src/config.h lwlib/config.h src/sheap-adjust.h +GENERATED_LISP = lisp/finder-inf.el + +all: ${PROGNAME} all-elc info + +${PROGNAME}: ${GENERATED_HEADERS} ${MAKE_SUBDIR} ${GENERATED_LISP} + +## For performance and consistency, no built-in rules +.SUFFIXES: + +.NO_PARALLEL: ${GENERATED_HEADERS} ${MAKE_SUBDIR} dump-elcs +.PHONY: ${SUBDIR} all beta all-elc all-elcs dump-elc dump-elcs autoloads finder + +## Convenience target for XEmacs beta testers +beta: clean all-elc finder + +## Convenience target for XEmacs maintainers +## This would run `make-xemacsdist' if I were really confident that everything +## was turnkey. +dist: all-elc info + +## Convenience target for XEmacs maintainers +## Updates some rarely generated files: +## - configure from configure.in +## - config.values.in from configure +## - src/depend from src/*.[ch] +.PHONY: config configure depend +config: configure depend +configure: ${srcdir}/configure +${srcdir}/configure: ${srcdir}/configure.in + cd ${srcdir} && autoconf + cd ${srcdir} && /bin/sh lib-src/config.values.sh + +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)' 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: src + MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-autoloads.sh + +custom-loads: + MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-custom.sh + +finder: src + @echo "Building finder database ..." + @(cd ./lisp; \ + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -eval '(setq finder-compile-keywords-quiet t)' \ + -l finder -f finder-compile-keywords ) + @echo "Building finder database ...(done)" + +lisp/finder-inf.el: + @echo "Building finder database ..." + @(cd ./lisp; \ + ${blddir}/src/${PROGNAME} -batch -vanilla \ + -eval '(setq finder-compile-keywords-quiet t)' \ + -l finder -f finder-compile-keywords ) + @echo "Building finder database ...(done)" + +## We have to force the building of Emacs.ad.h as well in order to get it +## updated correctly when VPATH is being used. Since we use move-if-change, +## it will only actually change if the user modified ${etcdir}/Emacs.ad. +src/Emacs.ad.h: ${srcdir}/etc/Emacs.ad + @echo "Producing \`src/Emacs.ad.h' from \`etc/Emacs.ad'." + @$(RM) src/Emacs.ad.h + @(echo "/* Do not edit this file!" ; \ + echo " Automatically generated from ${srcdir}/etc/Emacs.ad" ; \ + echo " */" ; \ + /bin/sh ${srcdir}/lib-src/ad2c ${srcdir}/etc/Emacs.ad ) > \ + src/Emacs.ad.h + +src/puresize-adjust.h: ${srcdir}/src/puresize.h + @echo "Resetting \`src/puresize-adjust.h'."; \ + (echo "/* Do not edit this file!" ; \ + echo " Automatically generated by XEmacs */" ; \ + echo "#define PURESIZE_ADJUSTMENT 0") > $@ + +src/sheap-adjust.h: + @echo "Resetting \`src/sheap-adjust.h'."; \ + (echo "/* Do not edit this file!" ; \ + echo " Automatically generated by XEmacs */" ; \ + echo "#define SHEAP_ADJUSTMENT 0") > $@ + +src: @SRC_SUBDIR_DEPS@ FRC.src +pkg-src/tree-x: pkg-src/FRC.tree-x +lib-src: FRC.lib-src +lwlib: FRC.lwlib +dynodump: FRC.dynodump +FRC.src FRC.lib-src FRC.lwlib FRC.dynodump pkg-src/FRC.tree-x: +FRC.lisp.finder-inf.el: + +${SUBDIR}: ${SUBDIR_MAKEFILES} ${GENERATED_HEADERS} FRC + cd ./$@ && $(RECURSIVE_MAKE) all + +Makefile: ${srcdir}/Makefile.in config.status + ./config.status + +src/Makefile: ${srcdir}/src/Makefile.in.in ${srcdir}/src/depend config.status + ./config.status + +lib-src/Makefile: ${srcdir}/lib-src/Makefile.in.in config.status + ./config.status + +lwlib/Makefile: ${srcdir}/lwlib/Makefile.in.in config.status + ./config.status + +pkg-src/tree-x/Makefile: ${srcdir}/pkg-src/tree-x/Makefile.in.in config.status + ./config.status + +src/config.h: ${srcdir}/src/config.h.in + ./config.status && touch $@ + +src/paths.h: ${srcdir}/src/paths.h.in + ./config.status && touch $@ + +lwlib/config.h: ${srcdir}/lwlib/config.h.in + ./config.status && touch $@ + +## ==================== Installation ==================== + +## If we let lib-src do its own installation, that means we +## don't have to duplicate the list of utilities to install in +## this Makefile as well. + +## On AIX, use tar xBf. +## On Xenix, use tar xpf. + +.PHONY: install-only install install-arch-dep install-arch-indep gzip.el mkdir +.PHONY: check-features + +## We delete each directory in ${COPYDESTS} before we copy into it; +## that way, we can reinstall over directories that have been put in +## place with their files read-only (perhaps because they are checked +## into RCS). In order to make this safe, we make sure that the +## source exists and is distinct from the destination. + +## FSF doesn't depend on `all', but rather on ${MAKE_SUBDIR}, so that +## they "won't ever modify src/paths.h". But that means you can't do +## 'make install' right off the bat because src/paths.h won't exist. +## And, in XEmacs case, src/Emacs.ad.h won't exist either. I also +## don't see the point in avoiding modifying paths.h. It creates an +## inconsistency in the build process. So we go ahead and depend on +## all. --cet + +check-features: all + ${blddir}/src/${PROGNAME} -batch -l check-features.el + +install-only: ${MAKE_SUBDIR} check-features install-arch-dep install-arch-indep + +install: all check-features install-arch-dep install-arch-indep + +install-arch-dep: mkdir + for subdir in ${INSTALL_ARCH_DEP_SUBDIR}; do \ + (cd ./$${subdir} && $(RECURSIVE_MAKE) install prefix=${prefix} \ + exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \ + archlibdir=${archlibdir}) ; done + if test "`(cd ${archlibdir} && $(pwd))`" != \ + "`(cd ./lib-src && $(pwd))`"; then \ + if test -f ../Installation; then \ + ${INSTALL_DATA} ../Installation ${archlibdir}/Installation; \ + fi; \ + 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 + ${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version} + -chmod 0755 ${bindir}/${PROGNAME}-${version} + cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME} + if test "${prefix}" != "${exec_prefix}"; then \ + for dir in \ + 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; \ + fi + +install-arch-indep: mkdir info + -@set ${COPYDESTS} ; \ + for dir in ${COPYDIR} ; do \ + if test "`(cd $$1 && $(pwd))`" != \ + "`(cd $${dir} && $(pwd))`"; then \ + : do nothing - echo "rm -rf $$1" ; \ + fi ; \ + shift ; \ + done + -set ${COPYDESTS} ; \ + for dir in ${COPYDESTS} ; do \ + if test ! -d $${dir} ; then mkdir $${dir} ; fi ; \ + done ; \ + for dir in ${COPYDIR} ; do \ + dest=$$1 ; shift ; \ + test -d $${dir} \ + -a "`(cd $${dir} && $(pwd))`" != \ + "`(cd $${dest} && $(pwd))`" \ + && (echo "Copying $${dir}..." ; \ + (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 \#* *~) ; \ + done) ; \ + done + if test "`(cd ${srcdir}/info && $(pwd))`" != \ + "`(cd ${infodir} && $(pwd))`" && cd ${srcdir}/info; then \ + if test ! -f ${infodir}/dir -a -f dir ; then \ + ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir ; \ + fi ; \ + for file in *.info* ; do \ + ${INSTALL_DATA} $${file} ${infodir}/$${file} ; \ + 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} ; \ + chmod 0644 ${mandir}/$${page}${manext} ; \ + done + @echo "If you would like to save approximately 2M of disk space, do" + @echo "make gzip-el" + @echo "or you may run " + @echo ${srcdir}/lib-src/gzip-el.sh lispdir " from the command line." + @echo "Where lispdir is where the lisp files were installed, i.e.," + @echo "${lispdir}" + +gzip-el: + ${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} ${infodir} ${archlibdir} \ + ${mandir} ${bindir} ${datadir} ${libdir} ${pkgdir} + -chmod 0777 ${lockdir} + +## Delete all the installed files that the `install' target would +## create (but not the noninstalled files such as `make all' would +## create). + +#### Don't delete the lisp and etc directories if they're in the source tree. +#### This target has not been updated in sometime and until it is it +#### would be extremely dangerous for anyone to use it. +#uninstall: +# (cd ./lib-src; \ +# $(RECURSIVE_MAKE) uninstall \ +# prefix=${prefix} exec_prefix=${exec_prefix} \ +# bindir=${bindir} libdir=${libdir} archlibdir=${archlibdir}) +# for dir in ${lispdir} ${etcdir} ; do \ +# case `(cd $${dir} ; $(pwd))` in \ +# `(cd ${srcdir} ; $(pwd))`* ) ;; \ +# * ) $(RM) $${dir} ;; \ +# esac ; \ +# case $${dir} in \ +# ${datadir}/${PROGNAME}/${version}/* ) \ +# $(RM) -r ${datadir}/${PROGNAME}/${version} \ +# ;; \ +# esac ; \ +# done +# cd ${infodir} && $(RM) cl* ${PROGNAME}* forms* info* vip* +# cd ${mandir} && $(RM) xemacs.1 etags.1 ctags.1 gnuserv.1 +# cd ${bindir} && $(RM) ${PROGNAME}-${version} ${PROGNAME} + + +## Some makes seem to remember that they've built something called FRC, +## so you can only use a given FRC once per makefile. +FRC FRC.src.paths.h FRC.mkdir FRC.dump-elcs FRC.info: +FRC.mostlyclean FRC.clean FRC.distclean FRC.realclean FRC.tags: + +## ==================== Cleaning up and miscellanea ==================== + +.PHONY: mostlyclean clean distclean realclean extraclean + +## `mostlyclean' +## Like `clean', but may refrain from deleting a few files that people +## normally don't want to recompile. For example, the `mostlyclean' +## target for GCC does not delete `libgcc.a', because recompiling it +## is rarely necessary and takes a lot of time. +mostlyclean: FRC.mostlyclean + for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + +## `clean' +## Delete all files from the current directory that are normally +## created by building the program. Don't delete the files that +## record the configuration. Also preserve files that could be made +## by building, but normally aren't because the distribution comes +## with them. + +## Delete `.dvi' files here if they are not part of the distribution. +clean: FRC.clean + for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + $(RM) core + +## `distclean' +## Delete all files from the current directory that are created by +## configuring or building the program. If you have unpacked the +## source and built the program without creating any other files, +## `make distclean' should leave only the files that were in the +## distribution. +top_distclean=\ + $(RM) config.status config.log config-tmp-* build-install Installation ; \ + for d in src lib-src lwlib dynodump ; do \ + $(RM) $$d/Makefile $$d/Makefile.in ; \ + done ; \ + $(RM) core .sbinit Makefile lock/*; \ + $(RM) lisp/finder-inf.el* Installation.el Installation.elc; \ + $(RM) packages mule-packages site-lisp + +distclean: FRC.distclean + for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + -${top_distclean} + +## `realclean' +## Delete everything from the current directory that can be +## reconstructed with this Makefile. This typically includes +## everything deleted by distclean, plus more: C source files +## produced by Bison, tags tables, info files, and so on. + +## One exception, however: `make realclean' should not delete +## `configure' even if `configure' can be remade using a rule in the +## Makefile. More generally, `make realclean' should not delete +## anything that needs to exist in order to run `configure' and then +## begin to build the program. +realclean: FRC.realclean + for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + -${top_distclean} + $(RM) TAGS + +## This doesn't actually appear in the coding standards, but Karl +## says GCC supports it, and that's where the configuration part of +## the coding standards seem to come from. It's like distclean, but +## it deletes backup and autosave files too. +extraclean: + for d in $(SUBDIR); do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + $(RM) *~ \#* + -${top_distclean} + +## Unlocking and relocking. The idea of these productions is to reduce +## hassles when installing an incremental tar of XEmacs. Do `make unlock' +## before unlocking the file to take the write locks off all sources so +## that tar xvof will overwrite them without fuss. Then do `make relock' +## afterward so that VC mode will know which files should be checked in +## if you want to mung them. + +## Note: it's no disaster if these productions miss a file or two; tar +## and VC will swiftly let you know if this happens, and it is easily +## corrected. +SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \ + README build-install.in configure make-dist move-if-change + +.PHONY: unlock relock TAGS tags check dist info dvi mcs + +unlock: + chmod u+w $(SOURCES) cpp/* + -cd ./elisp && chmod u+w Makefile README *.texi + for d in src etc lib-src lisp; do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + cd ./lisp/term && chmod u+w README *.el + cd ./man && chmod u+w *texi* ChangeLog split-man + cd ./lwlib && chmod u+w *.[ch] Makefile.in.in + +relock: + chmod u-w $(SOURCES) cpp/* + -cd ./elisp && chmod u-w Makefile README *.texi + for d in src etc lib-src lisp; do (cd ./$$d && $(RECURSIVE_MAKE) $@); done + cd ./lisp/term && chmod u+w README *.el + cd ./man && chmod u+w *texi* ChangeLog split-man + cd ./lwlib && chmod u+w *.[ch] Makefile.in.in + +PRUNE_VC = -name SCCS -prune -o -name RCS -prune -o -name CVS -prune -o +TAGS tags: FRC.tags + @echo "If you don't have a copy of etags around, then do 'make lib-src' first." + $(RM) ${srcdir}/TAGS + @PATH=`$(pwd)`/lib-src:$$PATH HOME=/-=-; export PATH HOME; \ + echo "Using etags from `which etags`." + PATH=`$(pwd)`/lib-src:$$PATH ; export PATH; cd ${srcdir} && \ + find src lwlib lib-src ${PRUNE_VC} -name '*.[ch]' -print | \ + xargs etags -a -r '/[ ]*DEF\(VAR\|INE\)_[A-Z_]+[ ]*([ ]*"\([^"]+\)"/\2/'; \ + find lisp ${PRUNE_VC} -name '*.el' -print | \ + xargs etags -a -l none -r "/^(def\\(var\\|un\\|alias\\|const\\|macro\\)[ ]+'?\\([^ ]+\\)/\\2/" + +## We have automated tests! +testdir = ${srcdir}/tests +tests = ${testdir}/basic-lisp.el ${testdir}/database.el + +check: + src/${PROGNAME} -batch -l ${testdir}/test-emacs.el -f batch-test-emacs ${tests} + +info: FRC.info + cd ${srcdir}/man && $(RECURSIVE_MAKE) $@ + +dvi: + cd ${srcdir}/man && $(RECURSIVE_MAKE) $@ + +## Fix up version information in executables (Solaris-only) +mcs: + date=`LANG=C LC_ALL=C date -u '+%e %b %Y'`; \ + ident="@(#)RELEASE VERSION XEmacs ${version} $${date}"; \ + for f in `file lib-src/* src/${PROGNAME} | grep ELF | sed -e 's/:.*//'`; do \ + mcs -da "$${ident} `echo $${f} | sed 's/.*\///'`" $${f}; \ + done diff --git a/Makefile.in.in b/Makefile.in.in index bf5656f..69496da 100644 --- a/Makefile.in.in +++ b/Makefile.in.in @@ -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 @@ SHELL = /bin/sh LANG = C LC_ALL = C RM = rm -f -MAKEPATH=./lib-src/make-path pwd = /bin/pwd -TAR = tar ## ==================== Things `configure' Might Edit ==================== @@ -74,7 +69,6 @@ CPP=@CPP@ LN_S=@LN_S@ CFLAGS=@CFLAGS@ CPPFLAGS=@CPPFLAGS@ -LDFLAGS=@LDFLAGS@ ## These help us choose version- and architecture-specific directories ## to install files in. @@ -99,14 +93,6 @@ PROGNAME=@PROGNAME@ ## 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@ @@ -124,6 +110,7 @@ pkgdir=@pkgdir@ ## Where to install and expect the files that XEmacs modifies as it runs. ## These files are all architecture-independent. Right now, the ## only such data is the locking directory; +## ${lockdir} is a subdirectory of this. statedir=@statedir@ ## Where to install and expect executable files to be run by XEmacs @@ -199,8 +186,10 @@ buildlispdir=${srcdir}/lisp ## at once. etcdir=@etcdir@ -## Where to put the DOC file. -docdir=@docdir@ +## Where to create and expect the locking directory, where +## the XEmacs locking code keeps track of which files are +## currently being edited. +lockdir=@lockdir@ ## Where to put executables to be run by XEmacs rather than ## the user. This path usually includes the XEmacs version @@ -224,10 +213,7 @@ INSTALL_DATA = @INSTALL_DATA@ 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@ @@ -256,7 +242,7 @@ ${PROGNAME}: ${GENERATED_HEADERS} ${MAKE_SUBDIR} ${GENERATED_LISP} .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 @@ -270,42 +256,30 @@ dist: all-elc info ## - 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 - -${srcdir}/lib-src/config.values.in : ${srcdir}/configure - cd ${srcdir} && $(SHELL) lib-src/config.values.sh + cd ${srcdir} && /bin/sh lib-src/config.values.sh depend ${srcdir}/src/depend: - cd ./src && $(RECURSIVE_MAKE) 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: autoloads dump-elcs - ${blddir}/src/${PROGNAME} -batch -vanilla \ - -l update-elc-2.el -f batch-update-elc-2 lisp +all-elc all-elcs: lib-src lwlib dump-elcs src + 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: lib-src lwlib src lisp/auto-autoloads.el lisp/custom-load.el - -FRC.lisp.auto.autoloads.el: -lisp/auto-autoloads.el: FRC.lisp.auto.autoloads.el - $(RM) lisp/auto-autoloads.el - ${blddir}/src/${PROGNAME} -batch -no-autoloads \ - -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~ +autoloads: src + MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' sh ${srcdir}/lib-src/update-autoloads.sh -FRC.lisp.custom.load.el: -lisp/custom-load.el: FRC.lisp.custom.load.el lisp/auto-autoloads.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 ..." @@ -332,7 +306,7 @@ src/Emacs.ad.h: ${srcdir}/etc/Emacs.ad @(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: @@ -419,33 +393,21 @@ install-arch-dep: mkdir 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; \ @@ -470,8 +432,8 @@ install-arch-indep: mkdir info -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 \#* *~) ; \ @@ -487,6 +449,7 @@ install-arch-indep: mkdir info 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} ; \ @@ -500,16 +463,18 @@ install-arch-indep: mkdir info @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} ${docdir} ${infodir} ${archlibdir} \ + ${MAKEPATH} ${COPYDESTS} ${lockdir} ${infodir} ${archlibdir} \ ${mandir} ${bindir} ${datadir} ${libdir} ${pkgdir} \ ${sitelispdir} ${moduledir} ${sitemoduledir} + -chmod 0777 ${lockdir} ## Delete all the installed files that the `install' target would ## create (but not the noninstalled files such as `make all' would @@ -578,10 +543,10 @@ top_distclean=\ $(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 --git a/build-msw-release.sh b/build-msw-release.sh new file mode 100755 index 0000000..7cf8ccd --- /dev/null +++ b/build-msw-release.sh @@ -0,0 +1,120 @@ +#!/bin/sh + +# This file builds the release kits for both cygwin and win32. You +# must have both environments configured for it to work properly. In +# particular you must provide a suitable value for NATIVE_ZLIB_DIR. + +# configuration +NATIVE_ZLIB_DIR=/usr/local/mingw/lib +PROGRAM_FILES='c:/Program Files/XEmacs' +# no configuration past this point + +INSTALL= +FILES= +BUILD=1 + +for OPT in $* +do + case $OPT in + --install) INSTALL=1;; + --installonly) INSTALL=1; BUILD='';; + --help) echo "usage: build-msw-release.sh [--install]" && exit;; + --*) ;; + *) FILES="$FILES $OPT";; + esac +done + +# pick up version info +. version.sh + +# decide on names +emacs_ver=${emacs_major_version}.${emacs_minor_version}.${emacs_beta_version} +cygwin_tarball=xemacs-i686-pc-cygwin-${emacs_ver}.tar.gz +win32_tarball=xemacs-i586-pc-win32-${emacs_ver}.tar.gz + +# create a dist directory +mkdir -p windows/cygwin32 +mkdir -p windows/win32 +mkdir -p /usr/local +DISTDIR=`pwd`/windows + +# check to see if we should build +if test "$BUILD" = "1" +then + +echo "Building the mswindows ${emacs_ver} release" + +# cleanup everything first +if [ -f Makefile ] ; then + make distclean +fi + +# first build win32 +(cd nt; + nmake -f xemacs.mak) +(cd "${PROGRAM_FILES}"; + rm -rf ./XEmacs-${emacs_ver}) +(cd nt; + nmake -f xemacs.mak install; + nmake -f xemacs.mak clean) + +# now build cygwin +./configure --with-dragndrop --with-postgresql=no --with-x=no \ + --bindir=/usr/local/bin/i686-pc-cygwin --with-site-lisp=yes \ + --with-ipv6-cname=no --with-netinstall +make CFLAGS=-O3 MINGW_ZLIB_DIR=${NATIVE_ZLIB_DIR} beta + +# deal with the netinstaller +(cd netinstall; + strip setup.exe) +cp netinstall/setup.exe windows + +# the win32 tar ball needs setup.exe +cp netinstall/setup.exe \ + "${PROGRAM_FILES}"/XEmacs-${emacs_ver}/i586-pc-win32 + +# make the win32 tarball +(cd "${PROGRAM_FILES}"; + tar czvf ${DISTDIR}/win32/${win32_tarball} \ + ./XEmacs-${emacs_ver}) + +# make the tarball +make install +(cd /usr/local; + tar czvf ${DISTDIR}/cygwin32/${cygwin_tarball} \ + ./bin/i686-pc-cygwin \ + ./lib/xemacs-${emacs_ver} \ + ./lib/xemacs/lock \ + ./man/man1/ctags.1 \ + ./man/man1/etags.1 \ + ./man/man1/gnuattach.1 \ + ./man/man1/gnuclient.1 \ + ./man/man1/gnudoit.1 \ + ./man/man1/gnuserv.1 \ + ./man/man1/xemacs.1) + +# figure out the ini file. +cygwin_tarball_size=`ls -l windows/cygwin32/${cygwin_tarball} | awk '{ print $5; }'` +win32_tarball_size=`ls -l windows/win32/${win32_tarball} | awk '{ print $5; }'` + +(cd netinstall; + make CYGWIN_SIZE=${cygwin_tarball_size} \ + WIN32_SIZE=${win32_tarball_size} setup-bin.ini ) +cp netinstall/setup-bin.ini windows + +# tidy up +make distclean + +fi +# end of build + +# optionally install to the ftp site +if test "$INSTALL" != "" +then + echo "Installing the mswindows ${emacs_ver} release" + scp -r -oUser=slb -oProtocol=1 windows/* \ + ftp.xemacs.org:/pub/xemacs/windows + # update setup.ini + ssh -1 -l slb ftp.xemacs.org 'cd /pub/xemacs/windows; sh makeini.sh' +fi + diff --git a/configure b/configure index 8aad1af..8e677b0 100755 --- a/configure +++ b/configure @@ -2,12 +2,11 @@ #### Configuration script for XEmacs. Largely divergent from FSF. #### Guess values for system-dependent variables and create Makefiles. -#### Generated automatically using autoconf version 2.13 -#### Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +#### 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. #### Copyright (C) 1995, 1996 Ben Wing. -#### Copyright (C) 2000, 2001 Martin Buchholz. #### Copyright (C) 1998, 1999 J. Kean Johnston. ### Don't edit this script! @@ -15,8 +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. -### Note: this script has not yet been ported to autoconf version 2.5x. +### in the this directory. You must have autoconf version 2.12 or later. ### This file is part of XEmacs. @@ -79,9 +77,21 @@ verbose= x_includes=NONE x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${{exec_prefix}}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + 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 @@ -183,14 +193,12 @@ done 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 $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard' +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 -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 @@ -217,49 +225,37 @@ datadir='${prefix}/lib' 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='${libdir}/${instvardir}/${configuration}/modules' -sitelispdir='${datadir}/${inststaticdir}/site-lisp' -sitemoduledir='${libdir}/${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='${libdir}/${instvardir}/${configuration}' -docdir='${archlibdir}' -with_netinstall="no" -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='' -extra_includes='' dynamic='' with_x11='' with_msw='' rel_alloc='default' with_system_malloc='default' with_dlmalloc='default' -with_esd_sound='no' native_sound_lib='' -with_gtk='no' -with_gnome='no' use_assertions="yes" with_toolbars="" with_tty="" use_union_type="no" with_dnet="" -pdump="no" -with_dragndrop="no" -with_ipv6_cname="no" @@ -308,12 +304,9 @@ while test $# != 0; do case "$opt" in with_site_lisp | \ - with_prefix | \ - with_site_modules | \ + with_site_modules | \ with_x | \ with_x11 | \ - with_gtk | \ - with_gnome | \ with_msw | \ with_gcc | \ dynamic | \ @@ -330,7 +323,7 @@ while test $# != 0; do with_jpeg | \ with_png | \ with_tiff | \ - with_wmcommand | \ + with_session | \ with_xmu | \ with_purify | \ with_quantify | \ @@ -347,26 +340,23 @@ while test $# != 0; do with_sparcworks | \ with_tooltalk | \ with_ldap | \ - with_postgresql | \ with_pop | \ with_kerberos | \ with_hesiod | \ with_dnet | \ with_infodock | \ - with_netinstall | \ - with_ipv6_cname | \ 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 ;; @@ -424,22 +414,22 @@ echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; "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." @@ -448,51 +438,15 @@ echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; "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. -Option \`all' or \`none' must be first in the list. -The default is to autodetect native and NAS 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 @@ echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; 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 @@ echo " Use \`$progname --help' to show usage.") >&2 && exit 1 ;; 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 @@ echo " Use \`$progname --help' to show usage.") >&2 && exit 1 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,8 +528,8 @@ echo " Use \`$progname --help' to show usage.") >&2 && exit 1 prefix | exec_prefix | bindir | datadir | statedir | libdir | \ - mandir | infodir | infopath | lispdir | etcdir | pkgdir | \ - archlibdir | docdir | package_path | moduledir ) + mandir | infodir | infopath | lispdir | etcdir | lockdir | pkgdir | \ + archlibdir | docdir | package_path ) if test "$valomitted" = "yes"; then if test "$#" = 0; then (echo "$progname: Usage error:" @@ -596,14 +541,6 @@ echo " Use \`$progname --help' to show usage.") >&2 && exit 1; 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 @@ -661,7 +598,7 @@ EOF } ;; datadir ) - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining INFODIR_USER_DEFINED EOF cat >> confdefs.h <<\EOF @@ -669,7 +606,7 @@ cat >> confdefs.h <<\EOF EOF } - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining LISPDIR_USER_DEFINED EOF cat >> confdefs.h <<\EOF @@ -677,7 +614,7 @@ cat >> confdefs.h <<\EOF EOF } - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining MODULEDIR_USER_DEFINED EOF cat >> confdefs.h <<\EOF @@ -692,28 +629,12 @@ cat >> confdefs.h <<\EOF #define ETCDIR_USER_DEFINED 1 EOF } - - { test "$extra_verbose" = "yes" && cat << \EOF - Defining DOCDIR_USER_DEFINED -EOF -cat >> confdefs.h <<\EOF -#define DOCDIR_USER_DEFINED 1 -EOF -} - - { test "$extra_verbose" = "yes" && cat << \EOF - Defining ARCHLIBDIR_USER_DEFINED -EOF -cat >> confdefs.h <<\EOF -#define ARCHLIBDIR_USER_DEFINED 1 -EOF -} ;; - docdir ) { test "$extra_verbose" = "yes" && cat << \EOF - Defining DOCDIR_USER_DEFINED + statedir | lockdir ) { test "$extra_verbose" = "yes" && cat << \EOF + Defining LOCKDIR_USER_DEFINED EOF cat >> confdefs.h <<\EOF -#define DOCDIR_USER_DEFINED 1 +#define LOCKDIR_USER_DEFINED 1 EOF } ;; @@ -734,29 +655,22 @@ EOF "with_menubars" | \ "with_scrollbars" | \ - "with_dialogs" | \ - "with_widgets" ) + "with_dialogs" ) case "$val" in l | lu | luc | luci | lucid ) val=lucid ;; - mo | mot | moti | motif ) val=motif ;; + 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 ;; - "") val=yes ;; - g | gt | gtk ) val=gtk ;; - ms | msw ) val=msw ;; + n | no | non | none ) val=no ;; * ) (echo "$progname: Usage error:" echo " " "The \`--$optname' option must have one of these values: - \`gtk', \`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 ;; @@ -849,7 +763,7 @@ echo " Use \`$progname --help' to show usage.") >&2 && exit 1 fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:853: 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 @@ -867,7 +781,7 @@ else 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" @@ -914,7 +828,7 @@ vpath %.in $(srcdir)' 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 @@ -933,10 +847,9 @@ cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <<\EOF EOF } -test "${error_check_byte_code=$beta}" = yes && { test "$extra_verbose" = "yes" && cat << \EOF - Defining ERROR_CHECK_BYTE_CODE -EOF -cat >> 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 @@ -1114,7 +988,7 @@ EOF echo $ac_n "checking "host system type"""... $ac_c" 1>&6 -echo "configure:1118: 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/'` @@ -1132,9 +1006,7 @@ case "$canonical" in 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 ;; @@ -1144,7 +1016,7 @@ case "$canonical" in m68*-sony-* ) machine=news ;; mips-sony-* ) machine=news-risc ;; clipper-* ) machine=clipper ;; - arm* ) machine=arm ;; + arm-* ) machine=arm ;; ns32k-* ) machine=ns32000 ;; esac @@ -1159,7 +1031,7 @@ case "$canonical" in *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;; *-dec-osf3.[2-9] ) opsys=decosf3-2 ;; *-dec-osf3* ) opsys=decosf3-1 ;; - *-dec-osf[4-9]* ) opsys=decosf4-0 ;; + *-dec-osf4* ) opsys=decosf4-0 ;; *-*-ultrix[0-3].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;; *-*-ultrix4.[12]* ) opsys=bsd4-3 ;; @@ -1244,10 +1116,6 @@ case "$canonical" in i[3-9]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;; - *-*-darwin*) - opsys=darwin - RANLIB="ranlib -c" pdump=yes ;; - i586-dg-dgux*R4* | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;; m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;; m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;; @@ -1497,8 +1365,12 @@ EOF *-bsdi3* ) opsys=bsdos3 ;; *-bsdi2.1* ) opsys=bsdos2-1 ;; *-bsdi2* ) opsys=bsdos2 ;; - *-sco3.2v5* ) opsys=sco5 ;; - *-sysv5* ) opsys=sco7 ;; + *-sco3.2v5* ) opsys=sco5 ; + if test "$dynamic" = "yes" ; then + NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF" ; + else + NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE" ; + fi ;; *-386bsd* ) opsys=386bsd ;; *-freebsd* ) opsys=freebsd ;; *-nextstep* ) opsys=nextstep ;; @@ -1512,41 +1384,13 @@ EOF esac -test -z "$machine" && machine=`echo $canonical | sed 's/-.*$//'` - -test -z "$opsys" && opsys=`uname -s | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - -if test -r "${srcdir}/src/m/${machine}.h"; then - machfile="m/${machine}.h" - { test "$extra_verbose" = "yes" && cat << EOF - Defining config_machfile = "$machfile" -EOF -cat >> confdefs.h <> confdefs.h <&2 + exit 1 fi - if test -z "$dynamic"; then case "$opsys" in hpux* | sunos4* ) dynamic=no ;; @@ -1580,6 +1424,9 @@ EOF } +machfile="m/${machine}.h" +opsysfile="s/${opsys}.h" + test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias if test "$with_workshop $with_tooltalk" = "yes no"; then @@ -1604,7 +1451,7 @@ EOF 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 @@ -1633,14 +1480,13 @@ xe_save_CFLAGS="$CFLAGS" # 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:1637: 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" @@ -1660,15 +1506,14 @@ if test -z "$CC"; then # 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:1664: 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 @@ -1702,60 +1547,27 @@ else 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:1712: 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:1741: 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' 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 $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard' +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 -cat > conftest.$ac_ext << EOF - -#line 1754 "configure" +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 @@ -1769,33 +1581,25 @@ else 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 $libs_gtk $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:1787: 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:1792: 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 @@ -1805,15 +1609,11 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6 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:1817: 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 @@ -1825,20 +1625,16 @@ rm -f conftest* 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 +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" fi if test "$with_gcc" = "no" -a "$GCC" = "yes"; then @@ -1846,14 +1642,13 @@ if test "$with_gcc" = "no" -a "$GCC" = "yes"; then # 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:1850: 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" @@ -1873,15 +1668,14 @@ if test -z "$CC"; then # 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:1877: 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 @@ -1915,60 +1709,27 @@ else 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:1925: 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:1954: 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' 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 $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard' +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 -cat > conftest.$ac_ext << EOF - -#line 1967 "configure" +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 @@ -1982,33 +1743,25 @@ else 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 $libs_gtk $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:2000: 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:2005: 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 @@ -2018,15 +1771,11 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6 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:2030: 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 @@ -2038,20 +1787,16 @@ rm -f conftest* 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 +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" fi elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then @@ -2059,14 +1804,13 @@ elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then # 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:2063: 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" @@ -2086,15 +1830,14 @@ if test -z "$CC"; then # 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:2090: 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 @@ -2128,60 +1871,27 @@ else 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:2138: 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:2167: 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' 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 $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard' +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 -cat > conftest.$ac_ext << EOF - -#line 2180 "configure" +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 @@ -2195,33 +1905,25 @@ else 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 $libs_gtk $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:2213: 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:2218: 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 @@ -2231,15 +1933,11 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6 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:2243: 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 @@ -2251,20 +1949,16 @@ rm -f conftest* 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 +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" fi fi @@ -2276,7 +1970,7 @@ test -n "$CPP" -a -d "$CPP" && CPP= 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:2280: 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= @@ -2289,14 +1983,14 @@ if test -z "$CPP"; then # 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:2299: \"$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 @@ -2306,31 +2000,14 @@ else 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:2316: \"$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:2333: \"$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 @@ -2343,8 +2020,6 @@ fi rm -f conftest* fi rm -f conftest* -fi -rm -f conftest* ac_cv_prog_CPP="$CPP" CPP="$ac_cv_prog_CPP" else @@ -2353,11 +2028,10 @@ fi echo "$ac_t""$CPP" 1>&6 - echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:2359: checking for AIX" >&5 +echo "configure:2033: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:2388: checking for GNU libc" >&5 +echo "configure:2062: checking for GNU libc" >&5 cat > conftest.$ac_ext < int main() { @@ -2398,7 +2072,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2402: \"$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 @@ -2418,78 +2092,21 @@ EOF } -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 @@ -2500,7 +2117,6 @@ else case "$conftest_rc" in 11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;; 12) echo "You appear to be using the DEC C compiler." ; __DECC=yes ;; - 13) echo "You appear to be using the SCO C compiler." ; __USLC__=yes ;; esac fi rm -fr conftest* @@ -2514,8 +2130,7 @@ tempcname="conftest.c" -cat > $tempcname < confdefs.h -cat >> $tempcname < $tempcname <> $tempcname <&6 -echo "configure:2727: checking for whether the -Kalloca compiler flag is needed" >&5 - need_kalloca=no - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - xe_save_c_switch_system="$c_switch_system" - c_switch_system="$c_switch_system -Kalloca" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - need_kalloca=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - c_switch_system="$xe_save_c_switch_system" -fi -rm -f conftest* - echo "$ac_t""$need_kalloca" 1>&6 - test "$need_kalloca" = "yes" && c_switch_system="$c_switch_system -Kalloca" && if test "$extra_verbose" = "yes"; then echo " Appending \"-Kalloca\" to \$c_switch_system"; fi -fi +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 -Winline -Wmissing-prototypes" - CFLAGS="$CFLAGS -Wsign-compare" - if test "$xemacs_compiler" != "g++"; then - CFLAGS="$CFLAGS -Wshadow" - fi - test "$have_glibc" != "yes" && CFLAGS="$CFLAGS -Wpointer-arith" + CFLAGS="-g -O3 -Wall -Wno-switch" elif test "$__SUNPRO_C" = "yes"; then case "$opsys" in sol2 ) CFLAGS="-v -xO4" ;; @@ -2787,75 +2316,6 @@ if test "$cflags_specified" = "no"; then CFLAGS="-O" ; fi fi -if test "$GCC" = "yes"; then -echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6 -echo "configure:2793: 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 "$CFLAGS" in - *-O2*|*-O3*) - case "$GCC_VERSION" in - 2.7.2) - 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 - 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 - ;; -esac -echo "$ac_t""no" 1>&6 -fi - -if test "$pdump" != "yes"; then - echo $ac_n "checking for \"-z nocombreloc\" linker flag""... $ac_c" 1>&6 -echo "configure:2851: checking for \"-z nocombreloc\" linker flag" >&5 - case "`ld --help 2>&1`" in - *-z\ nocombreloc* ) echo "$ac_t""yes" 1>&6 - ld_switch_site="-z nocombreloc $ld_switch_site" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-z nocombreloc\" to \$ld_switch_site"; fi ;; - *) echo "$ac_t""no" 1>&6 ;; - esac -fi - - if test "$GCC" = "yes"; then set x $ld_switch_system; shift; ld_switch_system="" @@ -2884,19 +2344,6 @@ if test "$GCC" = "yes"; then fi if test "$GCC" = "yes"; then - set x $ld_switch_site; shift; ld_switch_site="" - while test -n "$1"; do - case $1 in - -L | -l | -u ) ld_switch_site="$ld_switch_site $1 $2"; shift ;; - -L* | -l* | -u* | -Wl* | -pg ) ld_switch_site="$ld_switch_site $1" ;; - -Xlinker* ) ;; - * ) ld_switch_site="$ld_switch_site -Xlinker $1" ;; - esac - shift - done -fi - -if test "$GCC" = "yes"; then set x $LDFLAGS; shift; LDFLAGS="" while test -n "$1"; do case $1 in @@ -2928,15 +2375,12 @@ test -n "$objects_machine" && extra_objs="$extra_objs $objects_machine" && if t 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:2940: checking for dynodump" >&5 +echo "configure:2384: checking for dynodump" >&5 if test "$unexec" != "unexsol2.o"; then echo "$ac_t""no" 1>&6 else @@ -2974,12 +2418,12 @@ if test "$unexec" = "unexaix.o"; then done echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6 -echo "configure:2978: 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 @@ -3057,16 +2501,16 @@ fi 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 - lib_dir="${dir}/lib" inc_dir="${dir}/include" + lib_dir="${dir}/lib" 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 @@ -3074,7 +2518,7 @@ fi 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 @@ -3084,11 +2528,7 @@ if test -n "$site_runtime_libraries"; then 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 ;; @@ -3098,7 +2538,7 @@ fi if test "$add_runtime_path" = "yes"; then echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:3102: 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 " ;; @@ -3120,14 +2560,14 @@ if test "$GCC" = "yes"; then done fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +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 @@ -3220,6 +2660,7 @@ fi + GNU_MALLOC=yes if test "$with_dlmalloc" != "no"; then doug_lea_malloc=yes @@ -3227,11 +2668,57 @@ else 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:3232: checking for malloc_set_state" >&5 +echo "configure:2719: checking for malloc_set_state" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure: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 @@ -3274,16 +2761,16 @@ doug_lea_malloc=no fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:3278: checking whether __after_morecore_hook exists" >&5 +echo "configure:2765: checking whether __after_morecore_hook exists" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -3297,20 +2784,22 @@ rm -f conftest* 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 { test "$extra_verbose" = "yes" && cat << \EOF Defining DOUG_LEA_MALLOC EOF @@ -3321,7 +2810,7 @@ EOF 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 @@ -3331,6 +2820,7 @@ EOF } fi + use_minimal_tagbits=yes fi @@ -3339,14 +2829,13 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3343: 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" @@ -3389,28 +2878,26 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # 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:3398: 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" @@ -3439,8 +2926,6 @@ echo "$ac_t""$INSTALL" 1>&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 @@ -3448,14 +2933,13 @@ do # 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:3452: 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" @@ -3476,20 +2960,102 @@ done test -n "$YACC" || YACC="yacc" -for ac_hdr in a.out.h elf.h cygwin/version.h fcntl.h inttypes.h libgen.h locale.h mach/mach.h sys/param.h sys/pstat.h sys/time.h sys/timeb.h sys/un.h ulimit.h unistd.h +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:2968: 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: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:3484: checking for $ac_hdr" >&5 +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:3492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +{ (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" @@ -3518,10 +3084,10 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:3522: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:3088: checking for sys/wait.h that is POSIX.1 compatible" >&5 cat > conftest.$ac_ext < #include @@ -3537,7 +3103,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:3541: \"$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 @@ -3561,10 +3127,10 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3565: checking for ANSI C header files" >&5 +echo "configure:3131: checking for ANSI C header files" >&5 cat > conftest.$ac_ext < #include @@ -3572,8 +3138,8 @@ cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3576: \"$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 @@ -3589,7 +3155,7 @@ rm -f conftest* 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 @@ -3607,7 +3173,7 @@ fi 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 @@ -3625,7 +3191,7 @@ fi 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') @@ -3636,7 +3202,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3640: \"$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 @@ -3662,10 +3228,10 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3666: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3232: checking whether time.h and sys/time.h may both be included" >&5 cat > conftest.$ac_ext < #include @@ -3674,7 +3240,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3678: \"$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 @@ -3698,10 +3264,10 @@ EOF fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3702: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:3268: checking for sys_siglist declaration in signal.h or unistd.h" >&5 cat > conftest.$ac_ext < #include @@ -3713,7 +3279,7 @@ int main() { char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3717: \"$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 @@ -3737,26 +3303,36 @@ EOF fi - -echo $ac_n "checking for utime""... $ac_c" 1>&6 -echo "configure:3743: checking for utime" >&5 +echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 +echo "configure:3308: checking for struct utimbuf" >&5 cat > conftest.$ac_ext < +#ifdef TIME_WITH_SYS_TIME +#include +#include +#else +#ifdef HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif +#ifdef HAVE_UTIME_H #include +#endif int main() { -struct utimbuf x; x.actime = x.modtime = 0; utime ("/", &x); +static struct utimbuf x; x.actime = x.modtime; ; return 0; } EOF -if { (eval echo configure:3753: \"$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 - Defining HAVE_UTIME + Defining HAVE_STRUCT_UTIMBUF EOF cat >> confdefs.h <<\EOF -#define HAVE_UTIME 1 +#define HAVE_STRUCT_UTIMBUF 1 EOF } @@ -3765,71 +3341,14 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 - for ac_func in utimes -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3772: checking for $ac_func" >&5 +fi +rm -f conftest* + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:3349: checking return type of signal handlers" >&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:3798: \"$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 -rm -f conftest* - - -echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3830: checking return type of signal handlers" >&5 - -cat > conftest.$ac_ext < #include @@ -3846,7 +3365,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:3850: \"$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 @@ -3868,10 +3387,10 @@ EOF echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3872: checking for size_t" >&5 +echo "configure:3391: checking for size_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3880,7 +3399,7 @@ cat > conftest.$ac_ext <&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 @@ -3902,10 +3421,10 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3906: checking for pid_t" >&5 +echo "configure:3425: checking for pid_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3914,7 +3433,7 @@ cat > conftest.$ac_ext <&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 @@ -3936,10 +3455,10 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3940: checking for uid_t in sys/types.h" >&5 +echo "configure:3459: checking for uid_t in sys/types.h" >&5 cat > conftest.$ac_ext < EOF @@ -3975,10 +3494,10 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:3979: checking for mode_t" >&5 +echo "configure:3498: checking for mode_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3987,7 +3506,7 @@ cat > conftest.$ac_ext <&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 @@ -4009,10 +3528,10 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:4013: checking for off_t" >&5 +echo "configure:3532: checking for off_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -4021,7 +3540,7 @@ cat > conftest.$ac_ext <&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 @@ -4042,108 +3561,11 @@ EOF fi -echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:4047: 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:4082: checking for socklen_t" >&5 -cat > conftest.$ac_ext < -#include -socklen_t x; - -int main() { - -; return 0; } -EOF -if { (eval echo configure:4094: \"$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 < -#include -int accept (int, struct sockaddr *, size_t *); - -int main() { - -; return 0; } -EOF -if { (eval echo configure:4113: \"$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:4145: checking for struct timeval" >&5 +echo "configure:3567: checking for struct timeval" >&5 cat > conftest.$ac_ext < @@ -4159,7 +3581,7 @@ int main() { static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:4163: \"$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 @@ -4181,10 +3603,10 @@ fi rm -f conftest* echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:4185: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:3607: checking whether struct tm is in sys/time.h or time.h" >&5 cat > conftest.$ac_ext < #include @@ -4192,7 +3614,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:4196: \"$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 @@ -4216,10 +3638,10 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:4220: checking for tm_zone in struct tm" >&5 +echo "configure:3642: checking for tm_zone in struct tm" >&5 cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -4227,7 +3649,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:4231: \"$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 @@ -4250,10 +3672,10 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:4254: checking for tzname" >&5 +echo "configure:3676: checking for tzname" >&5 cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -4263,7 +3685,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:4267: \"$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 @@ -4289,10 +3711,10 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4293: checking for working const" >&5 +echo "configure:3715: checking for working const" >&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 @@ -4366,7 +3788,7 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:4370: 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 @@ -4391,12 +3813,12 @@ fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4395: 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 @@ -4407,11 +3829,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4411: \"$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 @@ -4422,7 +3844,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4426: \"$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 @@ -4439,7 +3861,7 @@ fi 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 @@ -4479,13 +3901,12 @@ fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:4483: checking size of short" >&5 +echo "configure:3905: checking size of short" >&5 cat > conftest.$ac_ext < -#include main() { FILE *f=fopen("conftestval", "w"); @@ -4494,7 +3915,7 @@ main() exit(0); } EOF -if { (eval echo configure:4498: \"$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 @@ -4522,13 +3943,12 @@ if test "$ac_cv_sizeof_short" = 0; then exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4526: checking size of int" >&5 +echo "configure:3947: checking size of int" >&5 cat > conftest.$ac_ext < -#include main() { FILE *f=fopen("conftestval", "w"); @@ -4537,7 +3957,7 @@ main() exit(0); } EOF -if { (eval echo configure:4541: \"$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 @@ -4559,13 +3979,12 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4563: checking size of long" >&5 +echo "configure:3983: checking size of long" >&5 cat > conftest.$ac_ext < -#include main() { FILE *f=fopen("conftestval", "w"); @@ -4574,7 +3993,7 @@ main() exit(0); } EOF -if { (eval echo configure:4578: \"$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 @@ -4596,13 +4015,12 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4600: checking size of long long" >&5 +echo "configure:4019: checking size of long long" >&5 cat > conftest.$ac_ext < -#include main() { FILE *f=fopen("conftestval", "w"); @@ -4611,7 +4029,7 @@ main() exit(0); } EOF -if { (eval echo configure:4615: \"$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 @@ -4633,13 +4051,12 @@ EOF echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4637: checking size of void *" >&5 +echo "configure:4055: checking size of void *" >&5 cat > conftest.$ac_ext < -#include main() { FILE *f=fopen("conftestval", "w"); @@ -4648,7 +4065,7 @@ main() exit(0); } EOF -if { (eval echo configure:4652: \"$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 @@ -4671,7 +4088,7 @@ EOF echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:4675: 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: @@ -4717,10 +4134,10 @@ fi echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:4721: checking for sin" >&5 +echo "configure:4138: checking for sin" >&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 @@ -4761,12 +4178,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:4765: 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 @@ -4821,14 +4238,14 @@ EOF cat > conftest.$ac_ext < int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:4832: \"$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 @@ -4845,124 +4262,37 @@ fi rm -f conftest* echo "checking type of mail spool file locking" 1>&6 -echo "configure:4849: 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:4853: 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:4879: \"$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 + Defining REAL_MAIL_USE_LOCKF EOF cat >> confdefs.h <<\EOF -#define MAIL_LOCK_LOCKF 1 +#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 + Defining REAL_MAIL_USE_FLOCK EOF cat >> confdefs.h <<\EOF -#define MAIL_LOCK_DOT 1 +#define REAL_MAIL_USE_FLOCK 1 EOF } +else mail_locking="dot-locking" 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; } case "$opsys" in decosf*) echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:4961: 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 @@ -5008,9 +4338,8 @@ fi c_switch_site="$c_switch_site -threads" ;; esac - echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:5014: 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; @@ -5019,550 +4348,122 @@ if ${CC-cc} '-###' -xildon no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/nu 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:5026: 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:5037: checking "for specified window system"" >&5 - - -GNOME_CONFIG=no -GTK_CONFIG=no - -if test "$with_gnome" != "no"; then - echo $ac_n "checking for GNOME configuration script""... $ac_c" 1>&6 -echo "configure:5045: checking for GNOME configuration script" >&5 - for possible in gnome-config - do - possible_version=`${possible} --version 2> /dev/null` - if test "x${possible_version}" != "x"; then - GNOME_CONFIG="${possible}" - with_gnome=yes - with_gtk=yes - break - fi - done - echo "$ac_t""${GNOME_CONFIG}" 1>&6 -fi +echo "configure:4364: checking "for specified window system"" >&5 -if test "${GNOME_CONFIG}" != "no"; then - GNOME_LIBS=`${GNOME_CONFIG} --libs gnomeui` - GNOME_CFLAGS=`${GNOME_CONFIG} --cflags gnomeui` - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_GNOME -EOF -cat >> confdefs.h <<\EOF -#define HAVE_GNOME 1 -EOF -} +if test "$with_x11" != "no"; then + test "$x_includes $x_libraries" != "NONE NONE" && \ + window_system=x11 with_x11=yes - libs_gtk="$libs_gtk ${GNOME_LIBS}" && if test "$extra_verbose" = "yes"; then echo " Appending \"${GNOME_LIBS}\" to \$libs_gtk"; fi - c_switch_gtk="$c_switch_gtk ${GNOME_CFLAGS}" && if test "$extra_verbose" = "yes"; then echo " Appending \"${GNOME_CFLAGS}\" to \$c_switch_gtk"; fi -fi + + if test "$x_includes $x_libraries" = "NONE NONE" \ + -a -n "$OPENWINHOME" \ + -a "$OPENWINHOME" != "/usr/openwin" \ + -a -d "$OPENWINHOME"; then + test -d "$OPENWINHOME/lib" && x_libraries="$OPENWINHOME/lib" + test -d "$OPENWINHOME/include" && x_includes="$OPENWINHOME/include" + test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include" + fi -if test "$with_gtk" != "no";then - echo $ac_n "checking for GTK configuration script""... $ac_c" 1>&6 -echo "configure:5076: checking for GTK configuration script" >&5 - for possible in gtk12-config gtk14-config gtk-config - do - possible_version=`${possible} --version 2> /dev/null` - if test "x${possible_version}" != "x"; then - GTK_CONFIG="${possible}" - fi - case "${possible_version}" in - 1.0.*) echo "configure: warning: GTK 1.2 is required, please upgrade your version of GTK." 1>&2; with_gtk=no;; - 1.3.*) echo "configure: warning: GTK 1.3 is not supported right now" 1>&2; with_gtk=no;; - 1.2.*) - with_gtk=yes - break - ;; - *) echo "configure: warning: Found unsupported version of GTK: $possible_version" 1>&2;; - esac - done - echo "$ac_t""${GTK_CONFIG}" 1>&6 -fi - -if test "${GTK_CONFIG}" != "no"; then - echo $ac_n "checking gtk version""... $ac_c" 1>&6 -echo "configure:5098: checking gtk version" >&5 - GTK_VERSION=`${GTK_CONFIG} --version` - echo "$ac_t""${GTK_VERSION}" 1>&6 - - echo $ac_n "checking gtk libs""... $ac_c" 1>&6 -echo "configure:5103: checking gtk libs" >&5 - GTK_LIBS=`${GTK_CONFIG} --libs` - libs_gtk="$libs_gtk ${GTK_LIBS}" && if test "$extra_verbose" = "yes"; then echo " Appending \"${GTK_LIBS}\" to \$libs_gtk"; fi - echo "$ac_t""${GTK_LIBS}" 1>&6 - - echo $ac_n "checking gtk cflags""... $ac_c" 1>&6 -echo "configure:5109: checking gtk cflags" >&5 - GTK_CFLAGS=`${GTK_CONFIG} --cflags` - if test "$GCC" = "yes"; then - GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow" - fi - c_switch_gtk="$c_switch_gtk ${GTK_CFLAGS}" && if test "$extra_verbose" = "yes"; then echo " Appending \"${GTK_CFLAGS}\" to \$c_switch_gtk"; fi - echo "$ac_t""${GTK_CFLAGS}" 1>&6 + if test "$x_includes" = "NONE"; then + for dir in "/usr/X11" "/usr/X11R6"; do + if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi + done + fi - -echo $ac_n "checking for main in -lgdk_imlib""... $ac_c" 1>&6 -echo "configure:5119: checking for main in -lgdk_imlib" >&5 -ac_lib_var=`echo gdk_imlib'_'main | sed 'y%./+-%__p_%'` + if test "$x_libraries" = "NONE"; then + for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do + if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi + done + fi -xe_check_libs=" -lgdk_imlib " -cat > conftest.$ac_ext <&6 +echo "configure:4397: checking for X" >&5 -int main() { -main() -; return 0; } -EOF -if { (eval echo configure:5131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + : 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 - libs_gtk="-lgdk_imlib $libs_gtk" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lgdk_imlib\" to \$libs_gtk"; fi -else - echo "$ac_t""no" 1>&6 -fi - - - -echo $ac_n "checking for Imlib_init in -lImlib""... $ac_c" 1>&6 -echo "configure:5153: checking for Imlib_init in -lImlib" >&5 -ac_lib_var=`echo Imlib'_'Imlib_init | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lImlib " -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - 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 - libs_gtk="$libs_gtk -lImlib" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lImlib\" to \$libs_gtk"; fi -else - echo "$ac_t""no" 1>&6 -fi - - - for ac_func in gdk_imlib_init -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5192: 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:5218: \"$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" +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled 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 test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else -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 < Imakefile <<'EOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' EOF -} - -else - echo "$ac_t""no" 1>&6 + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case "$ac_im_incroot" in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; + esac + case "$ac_im_usrlibdir" in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; + esac + fi + cd .. + rm -fr conftestdir fi -done - - - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_XPM -EOF -cat >> confdefs.h <<\EOF -#define HAVE_XPM 1 -EOF -} - - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_GTK -EOF -cat >> confdefs.h <<\EOF -#define HAVE_GTK 1 -EOF -} - - - - window_system=gtk - with_gtk=yes - with_x11=no - - test "${with_scrollbars}" != "no" && with_scrollbars=gtk - test "${with_toolbars}" != no && with_toolbars=gtk - test "${with_menubars}" != "no" && with_menubars=gtk - test "${with_dialogs}" != "no" && with_dialogs=gtk - test "${with_widgets}" != "no" && with_widgets=gtk - - extra_objs="$extra_objs console-gtk.o device-gtk.o event-gtk.o frame-gtk.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"console-gtk.o device-gtk.o event-gtk.o frame-gtk.o\"" - fi - extra_objs="$extra_objs objects-gtk.o redisplay-gtk.o glyphs-gtk.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"objects-gtk.o redisplay-gtk.o glyphs-gtk.o\"" - fi - extra_objs="$extra_objs select-gtk.o gccache-gtk.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"select-gtk.o gccache-gtk.o\"" - fi - extra_objs="$extra_objs gtk-xemacs.o ui-gtk.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"gtk-xemacs.o ui-gtk.o\"" - fi - OLD_CFLAGS="${CFLAGS}" - OLD_CPPFLAGS="${CPPFLAGS}" - OLD_LDFLAGS="${LDFLAGS}" - CFLAGS="${GTK_CFLAGS} ${CFLAGS}" - CPPFLAGS="${GTK_CFLAGS} ${CFLAGS}" - LDFLAGS="${LDFLAGS} ${GTK_LIBS}" - for ac_hdr in glade/glade.h glade.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5297: checking for $ac_hdr" >&5 +if test "$ac_x_includes" = NO; then + # Guess where to find include files, by looking for this one X11 .h file. + test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h + # First, try using that file with no special directory specified. cat > conftest.$ac_ext < +#include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5305: \"$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* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_hdr -EOF -cat >> confdefs.h <&6 -fi -done - - -echo $ac_n "checking for main in -lxml""... $ac_c" 1>&6 -echo "configure:5336: checking for main in -lxml" >&5 -ac_lib_var=`echo xml'_'main | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lxml " -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - 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 - libs_gtk="-lxml $libs_gtk" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lxml\" to \$libs_gtk"; fi -else - echo "$ac_t""no" 1>&6 -fi - - - -echo $ac_n "checking for main in -lglade""... $ac_c" 1>&6 -echo "configure:5370: checking for main in -lglade" >&5 -ac_lib_var=`echo glade'_'main | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lglade " -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - 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 - libs_gtk="-lglade $libs_gtk" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lglade\" to \$libs_gtk"; fi -else - echo "$ac_t""no" 1>&6 -fi - - - -echo $ac_n "checking for main in -lglade-gnome""... $ac_c" 1>&6 -echo "configure:5404: checking for main in -lglade-gnome" >&5 -ac_lib_var=`echo glade-gnome'_'main | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lglade-gnome " -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - 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 - libs_gtk="-lglade-gnome $libs_gtk" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lglade-gnome\" to \$libs_gtk"; fi -else - echo "$ac_t""no" 1>&6 -fi - - - cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "char \*txtdomain;" >/dev/null 2>&1; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6 - { test "$extra_verbose" = "yes" && cat << \EOF - Defining LIBGLADE_XML_TXTDOMAIN = 1 -EOF -cat >> confdefs.h <<\EOF -#define LIBGLADE_XML_TXTDOMAIN 1 -EOF -} - -else - rm -rf conftest* - echo "$ac_t""no" 1>&6 -fi -rm -f conftest* - - CFLAGS="${OLD_CFLAGS}" - CPPFLAGS="${OLD_CPPFLAGS}" - LDFLAGS="${OLD_LDFLAGS}" -fi - - -if test "$with_x11" != "no"; then - test "$x_includes $x_libraries" != "NONE NONE" && \ - window_system=x11 with_x11=yes - - - if test "$x_includes $x_libraries" = "NONE NONE" \ - -a -n "$OPENWINHOME" \ - -a "$OPENWINHOME" != "/usr/openwin" \ - -a -d "$OPENWINHOME"; then - test -d "$OPENWINHOME/lib" && x_libraries="$OPENWINHOME/lib" - test -d "$OPENWINHOME/include" && x_includes="$OPENWINHOME/include" - test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include" - fi - - if test "$x_includes" = "NONE"; then - for dir in "/usr/X11" "/usr/X11R6"; do - if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi - done - fi - - if test "$x_libraries" = "NONE"; then - for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do - if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi - done - fi - - # If we find X, set shell vars x_includes and x_libraries to the -# paths, otherwise set no_x=yes. -# 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:5496: checking for X" >&5 - -# Check whether --with-x or --without-x was given. -if test "${with_x+set}" = set; then - withval="$with_x" - : -fi - -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else - -# One or both of the vars are not set, and there is no cached value. -ac_x_includes=NO ac_x_libraries=NO -rm -fr conftestdir -if mkdir conftestdir; then - cd conftestdir - # Make sure to not put "make" in the Imakefile rules, since we grep it out. - cat > Imakefile <<'EOF' -acfindx: - @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -EOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case "$ac_im_incroot" in - /usr/include) ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; - esac - case "$ac_im_usrlibdir" in - /usr/lib | /lib) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; - esac - fi - cd .. - rm -fr conftestdir -fi - -if test "$ac_x_includes" = NO; then - # Guess where to find include files, by looking for this one X11 .h file. - test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h - - # 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:5561: \"$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* - # We can compile using X headers with no special include directory. -ac_x_includes= + # We can compile using X headers with no special include directory. +ac_x_includes= else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 @@ -5604,1386 +4505,230 @@ else \ /usr/openwin/include \ /usr/openwin/share/include \ - ; \ - do - if test -r "$ac_dir/$x_direct_test_include"; then - ac_x_includes=$ac_dir - break - fi - done -fi -rm -f conftest* -fi # $ac_x_includes = NO - -if test "$ac_x_libraries" = NO; then - # Check for the libraries. - - test -z "$x_direct_test_library" && x_direct_test_library=Xt - test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc - - # See if we find them without any special options. - # Don't add to $LIBS permanently. - 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 - rm -rf conftest* - LIBS="$ac_save_LIBS" -# We can link X programs with no special library path. -ac_x_libraries= -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - LIBS="$ac_save_LIBS" -# First see if replacing the include by lib works. -# Check X11 before X11Rn because it is often a symlink to the current release. -for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ - /usr/X11/lib \ - /usr/X11R6/lib \ - /usr/X11R5/lib \ - /usr/X11R4/lib \ - \ - /usr/lib/X11 \ - /usr/lib/X11R6 \ - /usr/lib/X11R5 \ - /usr/lib/X11R4 \ - \ - /usr/local/X11/lib \ - /usr/local/X11R6/lib \ - /usr/local/X11R5/lib \ - /usr/local/X11R4/lib \ - \ - /usr/local/lib/X11 \ - /usr/local/lib/X11R6 \ - /usr/local/lib/X11R5 \ - /usr/local/lib/X11R4 \ - \ - /usr/X386/lib \ - /usr/x386/lib \ - /usr/XFree86/lib/X11 \ - \ - /usr/lib \ - /usr/local/lib \ - /usr/unsupported/lib \ - /usr/athena/lib \ - /usr/local/x11r5/lib \ - /usr/lpp/Xamples/lib \ - /lib/usr/lib/X11 \ - \ - /usr/openwin/lib \ - /usr/openwin/share/lib \ - ; \ -do - for ac_extension in a so sl; do - if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then - ac_x_libraries=$ac_dir - break 2 - fi - done -done -fi -rm -f conftest* -fi # $ac_x_libraries = NO - -if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi - fi - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - echo "$ac_t""$have_x" 1>&6 - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 -fi - -if test "$no_x" = yes; then - # Not all programs may use this symbol, but it does not hurt to define it. - { test "$extra_verbose" = "yes" && cat << \EOF - Defining X_DISPLAY_MISSING -EOF -cat >> confdefs.h <<\EOF -#define X_DISPLAY_MISSING 1 -EOF -} - - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= -else - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi - - # It would also be nice to do this for all -L options, not just this one. - if test -n "$x_libraries"; then - X_LIBS="$X_LIBS -L$x_libraries" - # For Solaris; some versions of Sun CC require a space after -R and - # others require no space. Words are not sufficient . . . . - 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:5746: 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 - rm -rf conftest* - ac_R_nospace=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_R_nospace=no -fi -rm -f conftest* - if test $ac_R_nospace = yes; then - echo "$ac_t""no" 1>&6 - X_LIBS="$X_LIBS -R$x_libraries" - else - LIBS="$ac_xsave_LIBS -R $x_libraries" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_R_space=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_R_space=no -fi -rm -f conftest* - if test $ac_R_space = yes; then - echo "$ac_t""yes" 1>&6 - X_LIBS="$X_LIBS -R $x_libraries" - else - echo "$ac_t""neither works" 1>&6 - fi - fi - LIBS="$ac_xsave_LIBS" - esac - fi - - # Check for system-dependent libraries X programs must link with. - # Do this before checking for the system-independent R6 libraries - # (-lICE), since we may need -lsocket or whatever for X linking. - - if test "$ISC" = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" - else - # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And karl@cs.umb.edu says - # the Alpha needs dnet_stub (dnet does not exist). - if test "$with_dnet" = "no" ; then -ac_cv_lib_dnet_dnet_ntoa=no -else - -echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:5815: 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 - 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 - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" -else - echo "$ac_t""no" 1>&6 -fi - -fi - - 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:5855: 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 - 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 - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" -else - echo "$ac_t""no" 1>&6 -fi - - - fi - - # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, - # to get the SysV transport functions. - # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) - # needs -lnsl. - # 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:5900: checking for gethostbyname" >&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 gethostbyname(); - -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_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -gethostbyname(); -#endif - -; return 0; } -EOF -if { (eval echo configure:5926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_gethostbyname=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_gethostbyname=no" -fi -rm -f conftest* - -if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_gethostbyname = no; then - -echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:5947: 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 - 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 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" -else - echo "$ac_t""no" 1>&6 -fi - - - fi - - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT - # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says simon@lia.di.epfl.ch: it contains - # gethostby* variants that don't use the nameserver (or something). - # -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:5993: checking for connect" >&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 connect(); - -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_connect) || defined (__stub___connect) -choke me -#else -connect(); -#endif - -; return 0; } -EOF -if { (eval echo configure:6019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_connect=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_connect=no" -fi -rm -f conftest* - -if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_connect = no; then - -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:6042: 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 - 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 - X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" -else - echo "$ac_t""no" 1>&6 -fi - - - fi - - # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. - echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:6082: checking for remove" >&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 remove(); - -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_remove) || defined (__stub___remove) -choke me -#else -remove(); -#endif - -; return 0; } -EOF -if { (eval echo configure:6108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_remove=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_remove=no" -fi -rm -f conftest* - -if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_remove = no; then - -echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:6129: 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 - 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 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" -else - echo "$ac_t""no" 1>&6 -fi - - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:6169: checking for shmat" >&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 shmat(); - -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_shmat) || defined (__stub___shmat) -choke me -#else -shmat(); -#endif - -; return 0; } -EOF -if { (eval echo configure:6195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_shmat=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_shmat=no" -fi -rm -f conftest* - -if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - - if test $ac_cv_func_shmat = no; then - -echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:6216: 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 - 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 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" -else - echo "$ac_t""no" 1>&6 -fi - - - fi - fi - - # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS="$LDFLAGS" - test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" - # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to - # check for ICE first), but we must link in the order -lSM -lICE or - # we get undefined symbols. So assume we have SM if we have ICE. - # These have to be linked with before -lX11, unlike the other - # 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:6268: checking "$xe_msg_checking"" >&5 -ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lICE $X_EXTRA_LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - 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 - X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" -else - echo "$ac_t""no" 1>&6 -fi - - - LDFLAGS="$ac_save_LDFLAGS" - -fi - # Autoconf claims to find X library and include dirs for us. - if test "$no_x" = "yes" - then with_x11=no window_system=none HAVE_X_WINDOWS=no - else with_x11=yes window_system=x11 HAVE_X_WINDOWS=yes - fi -fi - - -if test "$with_x11" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_X_WINDOWS -EOF -cat >> confdefs.h <<\EOF -#define HAVE_X_WINDOWS 1 -EOF -} - - MAKE_SUBDIR="$MAKE_SUBDIR lwlib" && if test "$extra_verbose" = "yes"; then echo " Appending \"lwlib\" to \$MAKE_SUBDIR"; fi - SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" && if test "$extra_verbose" = "yes"; then echo " Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi - - for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do - inc_dir=`echo $lib_dir | sed -e 's/lib/include/'` - if test -d "$lib_dir" -a -d "$inc_dir"; then - case "$x_libraries" in *"$lib_dir"* ) ;; *) - x_libraries="$lib_dir $x_libraries" - X_LIBS="-L${lib_dir} $X_LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;; - esac - case "$x_includes" in "$inc_dir"* ) ;; *) - x_includes="$inc_dir $x_includes" - X_CFLAGS="-I${inc_dir} $X_CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;; - esac - break; fi - done - - for rel in "X11R6" "X11R5" "X11R4"; do - lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include" - if test -d "$lib_dir" -a -d "$inc_dir"; then - case "$x_libraries" in *"$lib_dir"* ) ;; *) - x_libraries="$x_libraries $lib_dir" - X_LIBS="$X_LIBS -L${lib_dir}" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L${lib_dir}\" to \$X_LIBS"; fi - esac - case "$x_includes" in "$inc_dir"* ) ;; *) - x_includes="$x_includes $inc_dir" - X_CFLAGS="$X_CFLAGS -I${inc_dir}" && if test "$extra_verbose" = "yes"; then echo " Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi - esac - break; fi - done - - case "$opsys" in - decosf*) if test "$GCC" = yes -a -d /usr/shlib; then X_LIBS="$X_LIBS -L/usr/shlib" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L/usr/shlib\" to \$X_LIBS"; fi; fi ;; - esac - - ld_switch_x_site="$X_LIBS" - - -if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then - ld_switch_site=`echo '' $ld_switch_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"` - ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"` - - runpath="" runpath_dirs="" - if test -n "$LD_RUN_PATH"; then - runpath="$LD_RUN_PATH" - elif test "$GCC" = "yes"; then - ld_switch_run_save="$ld_switch_run"; ld_switch_run="" - echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c - xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null' - for arg in `eval "$xe_runpath_link" | grep ' -L'`; do - case "$arg" in P,* | -L* | -R* ) - for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do - { -xe_runpath_dir="$dir" - test "$xe_runpath_dir" != "/lib" -a \ - "$xe_runpath_dir" != "/usr/lib" -a \ - -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \ - eval "$xe_add_unique_runpath_dir" -} - done ;; - esac - done - ld_switch_run="$ld_switch_run_save" - rm -f conftest* - else - for arg in $ld_switch_site $ld_switch_x_site; do - case "$arg" in -L*) { -xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'` - test "$xe_runpath_dir" != "/lib" -a \ - "$xe_runpath_dir" != "/usr/lib" -a \ - -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \ - eval "$xe_add_unique_runpath_dir" -};; esac - done - if test "$opsys $need_motif" = "sol2 yes"; then - xe_runpath_dir="/opt/SUNWdt/lib"; - eval "$xe_add_unique_runpath_dir"; - fi - fi - if test -n "$runpath"; then - ld_switch_run="${dash_r}${runpath}" - -if test "$GCC" = "yes"; then - set x $ld_switch_run; shift; ld_switch_run="" - while test -n "$1"; do - case $1 in - -L | -l | -u ) ld_switch_run="$ld_switch_run $1 $2"; shift ;; - -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;; - -Xlinker* ) ;; - * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;; - esac - shift - done -fi - test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" - fi -fi - - - if test "$extra_verbose" = "yes"; then - echo; echo "X11 compilation variables:" - for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done - echo - fi - - bitmapdirs= - if test "$x_includes" != NONE; then - for i in $x_includes; do - if test -d "$i/bitmaps"; then - bitmapdirs="$i/bitmaps:$bitmapdirs" - fi - if test -d "$i/X11/bitmaps"; then - bitmapdirs="$i/X11/bitmaps:$bitmapdirs" - fi - done - bitmapdirs=`echo "$bitmapdirs" | sed s/.$//` - fi - test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF - Defining BITMAPDIR = "$bitmapdirs" -EOF -cat >> confdefs.h <&6 -echo "configure:6451: checking for X defines extracted by xmkmf" >&5 - rm -fr conftestdir - if mkdir conftestdir; then - cd conftestdir - cat > Imakefile <<'EOF' -xetest: - @echo ${PROTO_DEFINES} ${STD_DEFINES} -EOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make` - fi - cd .. - rm -fr conftestdir - for word in $xmkmf_defines; do - case "$word" in - -D__STDC__*) ;; - -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 -EOF -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:6500: checking for X11/Intrinsic.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6508: \"$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 - : -else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; } -fi - - - -echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:6532: 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 - 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_lib_x11=yes -else - echo "$ac_t""no" 1>&6 -fi - - - if test "$have_lib_x11" != "yes"; then - -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:6573: 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 - 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 - ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site" -else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; } -fi - - - fi - libs_x="-lX11" - test "$extra_verbose" = "yes" && echo " Setting libs_x to \"-lX11\"" - - -echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:6616: 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 - 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 - libs_x="-lXext $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXext\" to \$libs_x"; fi -else - echo "$ac_t""no" 1>&6 -fi - - - - -echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:6655: 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 - 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 - libs_x="-lXt $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXt\" to \$libs_x"; fi -else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; } -fi - - - - echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:6694: 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:6701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 -then - ./conftest foobar; x11_release=$? -else - conftest_rc="$?" - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - x11_release=4 -fi -rm -fr conftest* - echo "$ac_t""R${x11_release}" 1>&6 - { test "$extra_verbose" = "yes" && cat << EOF - Defining THIS_IS_X11R${x11_release} -EOF -cat >> confdefs.h <&2; exit 1; } ;; - esac - fi - - for ac_func in XConvertCase -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6732: 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:6758: \"$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 + ; \ + do + if test -r "$ac_dir/$x_direct_test_include"; then + ac_x_includes=$ac_dir + break + fi + done fi -done +rm -f conftest* +fi # $ac_x_includes = NO +if test "$ac_x_libraries" = NO; then + # Check for the libraries. - 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:6790: checking for $ac_hdr" >&5 + test -z "$x_direct_test_library" && x_direct_test_library=Xt + test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS="$LIBS" + LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext < + +int main() { +${x_direct_test_function}() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6798: \"$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 +if { (eval echo configure:4538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + LIBS="$ac_save_LIBS" +# We can link X programs with no special library path. +ac_x_libraries= 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" + LIBS="$ac_save_LIBS" +# First see if replacing the include by lib works. +# Check X11 before X11Rn because it is often a symlink to the current release. +for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ + /usr/X11/lib \ + /usr/X11R6/lib \ + /usr/X11R5/lib \ + /usr/X11R4/lib \ + \ + /usr/lib/X11 \ + /usr/lib/X11R6 \ + /usr/lib/X11R5 \ + /usr/lib/X11R4 \ + \ + /usr/local/X11/lib \ + /usr/local/X11R6/lib \ + /usr/local/X11R5/lib \ + /usr/local/X11R4/lib \ + \ + /usr/local/lib/X11 \ + /usr/local/lib/X11R6 \ + /usr/local/lib/X11R5 \ + /usr/local/lib/X11R4 \ + \ + /usr/X386/lib \ + /usr/x386/lib \ + /usr/XFree86/lib/X11 \ + \ + /usr/lib \ + /usr/local/lib \ + /usr/unsupported/lib \ + /usr/athena/lib \ + /usr/local/x11r5/lib \ + /usr/lpp/Xamples/lib \ + /lib/usr/lib/X11 \ + \ + /usr/openwin/lib \ + /usr/openwin/share/lib \ + ; \ +do + for ac_extension in a so sl; do + if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done 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 + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi -done - - - for ac_func in XRegisterIMInstantiateCallback -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6831: 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 + fi + eval "$ac_cv_have_x" +fi # $with_x != no -; return 0; } -EOF -if { (eval echo configure:6857: \"$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" +if test "$have_x" != yes; then + echo "$ac_t""$have_x" 1>&6 + no_x=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 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 +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + { test "$extra_verbose" = "yes" && cat << \EOF + Defining X_DISPLAY_MISSING EOF -cat >> confdefs.h <> confdefs.h <<\EOF +#define X_DISPLAY_MISSING 1 EOF } - + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else - echo "$ac_t""no" 1>&6 -fi -done + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi - echo $ac_n "checking for standard XRegisterIMInstantiateCallback prototype""... $ac_c" 1>&6 -echo "configure:6885: checking for standard XRegisterIMInstantiateCallback prototype" >&5 - cat > conftest.$ac_ext </dev/null`" in + "SunOS 5"*) + echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 +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 < -extern Bool XRegisterIMInstantiateCallback( - Display*, struct _XrmHashBucketRec*, char*, char*, XIMProc, XPointer*); - int main() { ; return 0; } EOF -if { (eval echo configure:6899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - echo "$ac_t""yes" 1>&6 + ac_R_nospace=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""no" 1>&6 - { test "$extra_verbose" = "yes" && cat << \EOF - Defining XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE -EOF -cat >> confdefs.h <<\EOF -#define XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE 1 -EOF -} - + ac_R_nospace=no fi rm -f conftest* - - test -z "$with_xmu" && { -echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:6920: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 -ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lXmu " -cat > conftest.$ac_ext <&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + ac_R_space=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + ac_R_space=no fi rm -f conftest* -xe_check_libs="" + if test $ac_R_space = yes; then + echo "$ac_t""yes" 1>&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$ac_t""neither works" 1>&6 + fi + fi + LIBS="$ac_xsave_LIBS" + esac + fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then - echo "$ac_t""yes" 1>&6 - with_xmu=yes -else - echo "$ac_t""no" 1>&6 -with_xmu=no -fi + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. - } - if test "$with_xmu" = "no"; then - extra_objs="$extra_objs xmu.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"xmu.o\"" - fi + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else - libs_x="-lXmu $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXmu\" to \$libs_x"; fi - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_XMU -EOF -cat >> confdefs.h <<\EOF -#define HAVE_XMU 1 -EOF -} - - fi + # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And karl@cs.umb.edu says + # the Alpha needs dnet_stub (dnet does not exist). + if test "$with_dnet" = "no" ; then +ac_cv_lib_dnet_dnet_ntoa=no +else - -echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:6975: checking for main in -lXbsd" >&5 -ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` +echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 +echo "configure:4716: checking for dnet_ntoa in -ldnet" >&5 +ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` -xe_check_libs=" -lXbsd " +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 @@ -6997,45 +4742,33 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - libs_x="-lXbsd $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXbsd\" to \$libs_x"; fi + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" else echo "$ac_t""no" 1>&6 fi +fi + 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:4756: checking for dnet_ntoa in -ldnet_stub" >&5 +ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` - if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then - if test "$GCC" = "yes"; then - X_CFLAGS="-mthreads $X_CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-mthreads\" to \$X_CFLAGS"; fi - libs_x="-mthreads $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-mthreads\" to \$libs_x"; fi - else - case "$CC" in - "xlc" ) CC="xlc_r" ;; - "xlC" ) CC="xlC_r" ;; - "cc" ) CC="cc_r" ;; - esac - fi - fi - -fi -if test "$with_msw" != "no"; then - echo "checking for MS-Windows" 1>&6 -echo "configure:7024: checking for MS-Windows" >&5 - -echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:7027: checking for main in -lgdi32" >&5 -ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'` - -xe_check_libs=" -lgdi32 " +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 @@ -7049,257 +4782,180 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - with_msw=yes + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" else echo "$ac_t""no" 1>&6 fi - if test "$with_msw" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_MS_WINDOWS -EOF -cat >> confdefs.h <<\EOF -#define HAVE_MS_WINDOWS 1 -EOF -} - - - if test "$with_netinstall" = "yes"; then - MAKE_SUBDIR="$MAKE_SUBDIR netinstall" && if test "$extra_verbose" = "yes"; then echo " Appending \"netinstall\" to \$MAKE_SUBDIR"; fi - SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS netinstall" && if test "$extra_verbose" = "yes"; then echo " Appending \"netinstall\" to \$SRC_SUBDIR_DEPS"; fi - INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR netinstall" && if test "$extra_verbose" = "yes"; then echo " Appending \"netinstall\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi - fi - - 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 - 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 - test "$with_scrollbars" != "no" && with_scrollbars=msw \ - && extra_objs="$extra_objs scrollbar-msw.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"scrollbar-msw.o\"" - fi - test "$with_menubars" != "no" && with_menubars=msw \ - && extra_objs="$extra_objs menubar-msw.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"menubar-msw.o\"" - fi - test "$with_toolbars" != "no" && with_toolbars=msw \ - && extra_objs="$extra_objs toolbar-msw.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"toolbar-msw.o\"" - fi - test "$with_dialogs" != "no" && with_dialogs=msw \ - && 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\"" - fi - test "$with_menubars" != "no" && extra_objs="$extra_objs menubar-msw.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"menubar-msw.o\"" - fi - test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar-msw.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"toolbar-msw.o\"" - fi - test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog-msw.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"dialog-msw.o\"" - fi fi - cat > conftest.$ac_ext < - int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; } -EOF -if { (eval echo configure:7117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 -then - need_event_unixoid=yes; { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_MSG_SELECT -EOF -cat >> confdefs.h <<\EOF -#define HAVE_MSG_SELECT 1 -EOF -} -else - conftest_rc="$?" - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -fr conftest* - 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\"" - fi - fi -fi + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # 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:4801: checking for gethostbyname" >&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 gethostbyname(); +int main() { -test -z "$window_system" && window_system="none" +/* 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_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +gethostbyname(); +#endif -if test "$window_system" = "none"; then - for feature in menubars scrollbars toolbars dialogs dragndrop xface - do - if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then - echo "configure: warning: --with-$feature ignored: Not valid without window system support" 1>&2 - fi - eval "with_${feature}=no" - done +; return 0; } +EOF +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 - test -z "$with_toolbars" && with_toolbars=yes + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_gethostbyname=no" fi +rm -f conftest* -if test "$with_msw" != "yes"; then - for feature in MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES - do - if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then - echo "configure: warning: --with-$feature ignored: Not valid without MS-Windows support" 1>&2 - fi - eval "with_${feature}=no" - done -else +if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then + echo "$ac_t""yes" 1>&6 : +else + echo "$ac_t""no" 1>&6 fi -if test "$with_x11" != "yes"; then - for feature in tooltalk cde offix wmcommand xim xmu nas_sound - 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 - fi - eval "with_${feature}=no" - done -fi - -if test "$with_x11" = "yes"; then - ac_safe=`echo "X11/extensions/shape.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for X11/extensions/shape.h""... $ac_c" 1>&6 -echo "configure:7181: checking for X11/extensions/shape.h" >&5 + if test $ac_cv_func_gethostbyname = no; then + +echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 +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 < +/* 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 gethostbyname(); + +int main() { +gethostbyname() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7189: \"$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 +if { (eval echo configure:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=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" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_BALLOON_HELP -EOF -cat >> confdefs.h <<\EOF -#define HAVE_BALLOON_HELP 1 -EOF -} +xe_check_libs="" - extra_objs="$extra_objs balloon_help.o balloon-x.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"balloon_help.o balloon-x.o\"" - fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" else echo "$ac_t""no" 1>&6 fi -fi - -bitmapdir= -case "$window_system" in - x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;; - msw ) HAVE_X_WINDOWS=no ; echo " Using MS-Windows." ;; - gtk ) - HAVE_X_WINDOWS=no - test "$with_gnome" = "yes" && echo " Using GNOME." - test "$with_gnome" = "no" && echo " Using GTK." - ;; - none ) HAVE_X_WINDOWS=no ; echo " Using no window system." ;; -esac + fi -case "$x_libraries" in *X11R4* ) - test "$opsys" = "hpux9" && opsysfile="s/hpux9-x11r4.h" - test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h" -esac + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says simon@lia.di.epfl.ch: it contains + # gethostby* variants that don't use the nameserver (or something). + # -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:4894: checking for connect" >&5 -echo "checking for WM_COMMAND option" 1>&6 -echo "configure:7241: checking for WM_COMMAND option" >&5; -if test "$with_wmcommand" != "no"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_WMCOMMAND -EOF -cat >> confdefs.h <<\EOF -#define HAVE_WMCOMMAND 1 -EOF -} +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 connect(); -fi +int main() { -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:7256: checking for X11/Xauth.h" >&5 +/* 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_connect) || defined (__stub___connect) +choke me +#else +connect(); +#endif -cat > conftest.$ac_ext < +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7264: \"$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 +if { (eval echo configure:4920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_connect=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" + eval "ac_cv_func_connect=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 -with_xauth=no fi - } -test -z "$with_xauth" && { -echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:7287: checking for XauGetAuthByAddr in -lXau" >&5 -ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'` -xe_check_libs=" -lXau " + if test $ac_cv_func_connect = no; then + +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: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 @@ -7313,98 +4969,80 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - : + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" else echo "$ac_t""no" 1>&6 -with_xauth=no fi - } -test -z "$with_xauth" && with_xauth=yes -if test "$with_xauth" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_XAUTH -EOF -cat >> confdefs.h <<\EOF -#define HAVE_XAUTH 1 -EOF -} - - -T="" -for W in $GTK_LIBS $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done -libs_xauth="$T" -fi + fi + # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. + echo $ac_n "checking for remove""... $ac_c" 1>&6 +echo "configure:4983: checking for remove" >&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 remove(); +int main() { -if test "$with_tooltalk" != "no" ; then - 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:7348: checking for ${dir}tt_c.h" >&5 +/* 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_remove) || defined (__stub___remove) +choke me +#else +remove(); +#endif -cat > conftest.$ac_ext < +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7356: \"$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 +if { (eval echo configure:5009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_remove=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" + eval "ac_cv_func_remove=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then echo "$ac_t""yes" 1>&6 - tt_c_h_file="${dir}tt_c.h"; break + : else echo "$ac_t""no" 1>&6 fi - done - if test -z "$tt_c_h_file"; then - if test "$with_tooltalk" = "yes"; then - (echo "$progname: Usage error:" -echo " " "Unable to find required tooltalk header files." -echo " Use \`$progname --help' to show usage.") >&2 && exit 1 - fi - with_tooltalk=no - fi -fi -if test "$with_tooltalk" != "no" ; then - for extra_libs in "" "-lI18N -lce" "-lcxx"; do - -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:7392: checking "$xe_msg_checking"" >&5 -ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'` + if test $ac_cv_func_remove = no; then + +echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 +echo "configure:5030: checking for remove in -lposix" >&5 +ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` -xe_check_libs=" -ltt $extra_libs" +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 @@ -7418,97 +5056,130 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - tt_libs="-ltt $extra_libs"; break + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" else echo "$ac_t""no" 1>&6 -: fi - done - if test -z "$tt_libs"; then - if test "$with_tooltalk" = "yes"; then - (echo "$progname: Usage error:" -echo " " "Unable to find required tooltalk libraries." -echo " Use \`$progname --help' to show usage.") >&2 && exit 1 fi - with_tooltalk=no - fi -fi -test -z "$with_tooltalk" && with_tooltalk=yes -if test "$with_tooltalk" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining TOOLTALK -EOF -cat >> confdefs.h <<\EOF -#define TOOLTALK 1 -EOF -} - { test "$extra_verbose" = "yes" && cat << EOF - Defining TT_C_H_FILE = "$tt_c_h_file" -EOF -cat >> confdefs.h <&6 +echo "configure:5070: checking for shmat" >&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 shmat(); + +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_shmat) || defined (__stub___shmat) +choke me +#else +shmat(); +#endif + +; return 0; } EOF -} +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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_shmat=no" +fi +rm -f conftest* - libs_x="$tt_libs $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"$tt_libs\" to \$libs_x"; fi - extra_objs="$extra_objs tooltalk.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"tooltalk.o\"" - fi +if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 fi -test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6 -echo "configure:7465: checking for Dt/Dt.h" >&5 + if test $ac_cv_func_shmat = no; then + +echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 +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 < +/* 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 shmat(); + +int main() { +shmat() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7473: \"$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 +if { (eval echo configure:5133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=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" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" else echo "$ac_t""no" 1>&6 -with_cde=no fi - } -test -z "$with_cde" && { -echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:7496: checking for DtDndDragStart in -lDtSvc" >&5 -ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` -xe_check_libs=" -lDtSvc " + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS="$LDFLAGS" + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. + +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 " cat > 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 @@ -7522,98 +5193,203 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - : + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" else echo "$ac_t""no" 1>&6 -with_cde=no fi - } -test -z "$with_cde" && with_cde=yes -if test "$with_dragndrop" = no; then - echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2 - with_cde=no + + LDFLAGS="$ac_save_LDFLAGS" + fi -if test "$with_cde" = "yes" ; then + # Autoconf claims to find X library and include dirs for us. + if test "$no_x" = "yes" + then with_x11=no window_system=none HAVE_X_WINDOWS=no + else with_x11=yes window_system=x11 HAVE_X_WINDOWS=yes + fi +fi + +case "$with_x11" in + yes ) window_system=x11 HAVE_X_WINDOWS=yes ;; + no ) window_system=none HAVE_X_WINDOWS=no ;; +esac + +if test "$with_x11" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_CDE + Defining HAVE_X_WINDOWS EOF cat >> confdefs.h <<\EOF -#define HAVE_CDE 1 +#define HAVE_X_WINDOWS 1 EOF } - libs_x="-lDtSvc $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lDtSvc\" to \$libs_x"; fi - dragndrop_proto="$dragndrop_proto CDE" && if test "$extra_verbose" = "yes"; then echo " Appending \"CDE\" to \$dragndrop_proto"; fi - with_tooltalk=yes # CDE requires Tooltalk - need_motif=yes # CDE requires Motif -fi + MAKE_SUBDIR="$MAKE_SUBDIR lwlib" && if test "$extra_verbose" = "yes"; then echo " Appending \"lwlib\" to \$MAKE_SUBDIR"; fi + SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS lwlib" && if test "$extra_verbose" = "yes"; then echo " Appending \"lwlib\" to \$SRC_SUBDIR_DEPS"; fi -test "$window_system" != "x11" && with_offix=no -if test "$with_xmu" != yes -a "$with_x11" = yes; then - echo "configure: warning: No OffiX without real Xmu support" 1>&2 - with_offix=no -fi -if test "$with_dragndrop" = no; then - echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2 - with_offix=no + for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do + inc_dir=`echo $lib_dir | sed -e 's/lib/include/'` + if test -d "$lib_dir" -a -d "$inc_dir"; then + case "$x_libraries" in *"$lib_dir"* ) ;; *) + x_libraries="$lib_dir $x_libraries" + X_LIBS="-L${lib_dir} $X_LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-L${lib_dir}\" to \$X_LIBS"; fi ;; + esac + case "$x_includes" in "$inc_dir"* ) ;; *) + x_includes="$inc_dir $x_includes" + X_CFLAGS="-I${inc_dir} $X_CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-I${inc_dir}\" to \$X_CFLAGS"; fi ;; + esac + break; fi + done + + for rel in "X11R6" "X11R5" "X11R4"; do + lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include" + if test -d "$lib_dir" -a -d "$inc_dir"; then + case "$x_libraries" in *"$lib_dir"* ) ;; *) + x_libraries="$x_libraries $lib_dir" + X_LIBS="$X_LIBS -L${lib_dir}" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L${lib_dir}\" to \$X_LIBS"; fi + esac + case "$x_includes" in "$inc_dir"* ) ;; *) + x_includes="$x_includes $inc_dir" + X_CFLAGS="$X_CFLAGS -I${inc_dir}" && if test "$extra_verbose" = "yes"; then echo " Appending \"-I${inc_dir}\" to \$X_CFLAGS"; fi + esac + break; fi + done + + if test "$GCC" = yes -a -d /usr/shlib; then X_LIBS="$X_LIBS -L/usr/shlib" && if test "$extra_verbose" = "yes"; then echo " Appending \"-L/usr/shlib\" to \$X_LIBS"; fi; fi + + ld_switch_x_site="$X_LIBS" + + +if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then + ld_switch_site=`echo '' $ld_switch_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"` + ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"` + + runpath="" runpath_dirs="" + if test -n "$LD_RUN_PATH"; then + runpath="$LD_RUN_PATH" + elif test "$GCC" = "yes"; then + ld_switch_run_save="$ld_switch_run"; ld_switch_run="" + echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c + xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null' + for arg in `eval "$xe_runpath_link" | grep ' -L'`; do + case "$arg" in P,* | -L* | -R* ) + for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do + { +xe_runpath_dir="$dir" + test "$xe_runpath_dir" != "/lib" -a \ + "$xe_runpath_dir" != "/usr/lib" -a \ + -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \ + eval "$xe_add_unique_runpath_dir" +} + done ;; + esac + done + ld_switch_run="$ld_switch_run_save" + rm -f conftest* + else + for arg in $ld_switch_site $ld_switch_x_site; do + case "$arg" in -L*) { +xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'` + test "$xe_runpath_dir" != "/lib" -a \ + "$xe_runpath_dir" != "/usr/lib" -a \ + -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \ + eval "$xe_add_unique_runpath_dir" +};; esac + done + if test "$opsys $need_motif" = "sol2 yes"; then + xe_runpath_dir="/opt/SUNWdt/lib"; + eval "$xe_add_unique_runpath_dir"; + fi + fi + if test -n "$runpath"; then + ld_switch_run="${dash_r}${runpath}" + +if test "$GCC" = "yes"; then + set x $ld_switch_run; shift; ld_switch_run="" + while test -n "$1"; do + case $1 in + -L | -l | -u ) ld_switch_run="$ld_switch_run $1 $2"; shift ;; + -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;; + -Xlinker* ) ;; + * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;; + esac + shift + done fi -if test "$with_cde" = yes; then - echo "configure: warning: CDE already found, disabling OffiX support" 1>&2 - with_offix=no + test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" + fi fi -test -z "$with_offix" && with_offix=no -if test "$with_offix" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_OFFIX_DND + + + if test "$extra_verbose" = "yes"; then + echo; echo "X11 compilation variables:" + for var in x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS; do eval "echo \"$var = '\$$var'\""; done + echo + fi + + bitmapdirs= + if test "$x_includes" != NONE; then + for i in $x_includes; do + if test -d "$i/bitmaps"; then + bitmapdirs="$i/bitmaps:$bitmapdirs" + fi + if test -d "$i/X11/bitmaps"; then + bitmapdirs="$i/X11/bitmaps:$bitmapdirs" + fi + done + bitmapdirs=`echo "$bitmapdirs" | sed s/.$//` + fi + test ! -z "$bitmapdirs" && { test "$extra_verbose" = "yes" && cat << EOF + Defining BITMAPDIR = "$bitmapdirs" EOF -cat >> confdefs.h <<\EOF -#define HAVE_OFFIX_DND 1 +cat >> confdefs.h <&6 -echo "configure:7585: checking if drag and drop API is needed" >&5 - if test -n "$dragndrop_proto" ; then - with_dragndrop=yes - echo "$ac_t""yes (${dragndrop_proto} )" 1>&6 - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_DRAGNDROP + echo "checking for X defines extracted by xmkmf" 1>&6 +echo "configure:5352: checking for X defines extracted by xmkmf" >&5 + rm -fr conftestdir + if mkdir conftestdir; then + cd conftestdir + cat > Imakefile <<'EOF' +xetest: + @echo ${PROTO_DEFINES} ${STD_DEFINES} EOF -cat >> confdefs.h <<\EOF -#define HAVE_DRAGNDROP 1 + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make` + fi + cd .. + rm -fr conftestdir + for word in $xmkmf_defines; do + case "$word" in + -D*=* ) ;; + -D* ) word=`echo '' $word | sed -e 's:^ *-D::'` + { test "$extra_verbose" = "yes" && cat << EOF + Defining $word +EOF +cat >> confdefs.h <&6 + ;; + esac + done fi -fi -echo "checking for LDAP" 1>&6 -echo "configure:7605: 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:7608: checking for ldap.h" >&5 + ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6 +echo "configure:5384: checking for X11/Intrinsic.h" >&5 cat > conftest.$ac_ext < +#include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7616: \"$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" @@ -7630,60 +5406,29 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then : else echo "$ac_t""no" 1>&6 -with_ldap=no +{ echo "configure: error: "Unable to find X11 header files."" 1>&2; exit 1; } fi - } -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:7639: checking for lber.h" >&5 -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7647: \"$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 - : -else - echo "$ac_t""no" 1>&6 -with_ldap=no -fi - } -if test "$with_ldap" != "no"; then - -echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6 -echo "configure:7671: checking for ldap_search in -lldap" >&5 -ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'` -xe_check_libs=" -lldap " + +echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 +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 @@ -7697,34 +5442,34 @@ 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 + have_lib_x11=yes else echo "$ac_t""no" 1>&6 -with_ldap_nolber=no fi - test "$with_ldap_nolber" = "no" && { -xe_msg_checking="for ldap_open in -lldap" -test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber" + if test "$have_lib_x11" != "yes"; then + +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:7712: checking "$xe_msg_checking"" >&5 -ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` +echo "configure:5457: checking "$xe_msg_checking"" >&5 +ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'` -xe_check_libs=" -lldap -llber" +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 @@ -7738,34 +5483,36 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - with_ldap_lber=yes + ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site" else echo "$ac_t""no" 1>&6 -with_ldap_lber=no +{ echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; } 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:7753: checking "$xe_msg_checking"" >&5 -ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` -xe_check_libs=" -lldap -llber -lkrb" + fi + libs_x="-lX11" + test "$extra_verbose" = "yes" && echo " Setting libs_x to \"-lX11\"" + + +echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 +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 @@ -7779,34 +5526,32 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - with_ldap_krb=yes + libs_x="-lXext $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXext\" to \$libs_x"; fi else echo "$ac_t""no" 1>&6 -with_ldap_krb=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:7794: checking "$xe_msg_checking"" >&5 -ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` -xe_check_libs=" -lldap -llber -lkrb -ldes" + + +echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 +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 @@ -7820,115 +5565,57 @@ 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 + libs_x="-lXt $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXt\" to \$libs_x"; fi else echo "$ac_t""no" 1>&6 -with_ldap_krbdes=no +{ echo "configure: error: "Unable to find X11 libraries."" 1>&2; exit 1; } 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 -fi -if test "$with_ldap" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_LDAP -EOF -cat >> confdefs.h <<\EOF -#define HAVE_LDAP 1 -EOF -} - 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 - 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:7861: checking for $ac_func" >&5 -cat > conftest.$ac_ext <&6 +echo "configure:5578: checking the version of X11 being used" >&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; } +#include + int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; } EOF -if { (eval echo configure:7887: \"$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" +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 + conftest_rc="$?" echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + rm -fr conftest* + x11_release=4 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'` +rm -fr conftest* + echo "$ac_t""R${x11_release}" 1>&6 { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_func + Defining THIS_IS_X11R${x11_release} EOF cat >> confdefs.h <&6 -fi -done -fi - -if test "$with_postgresql" != "no"; then - echo "checking for PostgreSQL" 1>&6 -echo "configure:7918: 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:7923: checking for ${header_dir}libpq-fe.h" >&5 + 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:5610: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < +#include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7931: \"$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" @@ -7942,81 +5629,59 @@ 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:7955: 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 +cat >> confdefs.h <&6 fi +done - } - if test -n "$libpq_fe_h_file" -a "$have_libpq" = "yes"; then - with_postgresql=yes + echo $ac_n "checking for XFree86""... $ac_c" 1>&6 +echo "configure:5649: checking for XFree86" >&5 + if test -d "/usr/X386/include" -o \ + -f "/etc/XF86Config" -o \ + -f "/etc/X11/XF86Config" -o \ + -f "/usr/X11R6/lib/X11/XF86Config"; then + echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_POSTGRESQL + Defining HAVE_XFREE386 EOF cat >> confdefs.h <<\EOF -#define HAVE_POSTGRESQL 1 +#define HAVE_XFREE386 1 EOF } - -echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6 -echo "configure:8004: checking for PQconnectStart in -lpq" >&5 -ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'` + else + echo "$ac_t""no" 1>&6 + fi + + test -z "$with_xmu" && { +echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 +echo "configure:5669: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'` -xe_check_libs=" -lpq " +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 @@ -8030,206 +5695,96 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - with_postgresqlv7=yes; - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_POSTGRESQLV7 -EOF -cat >> confdefs.h <<\EOF -#define HAVE_POSTGRESQLV7 1 -EOF -} - -else - echo "$ac_t""no" 1>&6 -fi - - - { test "$extra_verbose" = "yes" && cat << EOF - Defining LIBPQ_FE_H_FILE = "$libpq_fe_h_file" -EOF -cat >> confdefs.h <&2; exit 1; } - fi -fi - - -if test "$window_system" != "none"; then - echo "checking for graphics libraries" 1>&6 -echo "configure:8068: checking for graphics libraries" >&5 - - libpath_xpm= - incpath_xpm= - case "$opsys" in - cygwin*) - cygwin_top=`eval "gcc -print-file-name=libc.a"` ; - cygwin_top=`eval "dirname ${cygwin_top}"`; - cygwin_top="${cygwin_top}/.."; - case "$window_system" in - x11) ;; - msw) libpath_xpm="-L${cygwin_top}/lib/noX" - incpath_xpm="-I${cygwin_top}/include/noX" - ;; - gtk) ;; - none) ;; - *) ;; - esac - ;; - *) ;; - esac - xpm_problem="" - if test -z "$with_xpm"; then - CFLAGS=""$incpath_xpm" $CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$incpath_xpm"\" to \$CFLAGS"; fi - LDFLAGS=""$libpath_xpm" $LDFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$libpath_xpm"\" to \$LDFLAGS"; fi - echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6 -echo "configure:8094: 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:8106: \"$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 - with_xpm=yes; - else - with_xpm=no; - if test "$xpm_status" = "1"; then - xpm_problem="Xpm library version and header file version don't match!" - elif test "$xpm_status" = "2"; then - xpm_problem="Xpm library version is too old!" - else - xpm_problem="Internal xpm detection logic error!" - fi - echo " -*** WARNING *** $xpm_problem - I'm not touching that with a 10-foot pole! - If you really want to use the installed version of Xpm, rerun - configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!" - fi -else - conftest_rc="$?" - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - with_xpm=no -fi -rm -fr conftest* - xe_check_libs= - echo "$ac_t""$with_xpm" 1>&6 - fi - if test "$with_xpm" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_XPM -EOF -cat >> confdefs.h <<\EOF -#define HAVE_XPM 1 -EOF -} - - LDFLAGS=""$libpath_xpm" $LDFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$libpath_xpm"\" to \$LDFLAGS"; fi - libs_x="-lXpm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXpm\" to \$libs_x"; fi - CFLAGS=""$incpath_xpm" $CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$incpath_xpm"\" to \$CFLAGS"; fi - echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6 -echo "configure:8150: 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 - rm -rf conftest* - xpm_for_msw=no + with_xmu=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - xpm_for_msw=yes + echo "$ac_t""no" 1>&6 +with_xmu=no fi -rm -f conftest* - xe_check_libs= - echo "$ac_t""$xpm_for_msw" 1>&6 - if test "$xpm_for_msw" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining FOR_MSW + + } + if test "$with_xmu" = "no"; then + extra_objs="$extra_objs xmu.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"xmu.o\"" + fi + else + libs_x="-lXmu $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXmu\" to \$libs_x"; fi + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_XMU EOF cat >> confdefs.h <<\EOF -#define FOR_MSW 1 +#define HAVE_XMU 1 EOF } - fi fi - test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for compface.h""... $ac_c" 1>&6 -echo "configure:8186: checking for compface.h" >&5 + +echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 +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 < + +int main() { +main() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8194: \"$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 +if { (eval echo configure:5736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=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" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - : + libs_x="-lXbsd $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXbsd\" to \$libs_x"; fi else echo "$ac_t""no" 1>&6 -with_xface=no fi - } - test -z "$with_xface" && { -echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:8217: checking for UnGenFace in -lcompface" >&5 -ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` -xe_check_libs=" -lcompface " + + + if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then + if test "$GCC" = "yes"; then + X_CFLAGS="-mthreads $X_CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-mthreads\" to \$X_CFLAGS"; fi + libs_x="-mthreads $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-mthreads\" to \$libs_x"; fi + else + case "$CC" in + "xlc" ) CC="xlc_r" ;; + "xlC" ) CC="xlC_r" ;; + "cc" ) CC="cc_r" ;; + esac + fi + fi + +fi +if test "$with_msw" != "no"; then + echo "checking for MS-Windows" 1>&6 +echo "configure:5773: checking for MS-Windows" >&5 + +echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 +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 @@ -8243,61 +5798,201 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - : + with_msw=yes else echo "$ac_t""no" 1>&6 -with_xface=no fi - } - test -z "$with_xface" && with_xface=yes - if test "$with_xface" = "yes"; then + + if test "$with_msw" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_XFACE + Defining HAVE_MS_WINDOWS EOF cat >> confdefs.h <<\EOF -#define HAVE_XFACE 1 +#define HAVE_MS_WINDOWS 1 EOF } - libs_x="-lcompface $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lcompface\" to \$libs_x"; fi - fi - - if test "$with_gif" != "no"; then - with_gif="yes" - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_GIF + install_pp="$blddir/lib-src/installexe.sh" + 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 + test "$with_scrollbars" != "no" && with_scrollbars=msw \ + && extra_objs="$extra_objs scrollbar-msw.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"scrollbar-msw.o\"" + fi + test "$with_menubars" != "no" && with_menubars=msw \ + && extra_objs="$extra_objs menubar-msw.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"menubar-msw.o\"" + fi + test "$with_toolbars" != "no" && with_toolbars=msw \ + && extra_objs="$extra_objs toolbar-msw.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"toolbar-msw.o\"" + fi + test "$with_dialogs" != "no" && with_dialogs=msw \ + && extra_objs="$extra_objs dialog-msw.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"dialog-msw.o\"" + fi + 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\"" + fi + test "$with_menubars" != "no" && extra_objs="$extra_objs menubar-msw.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"menubar-msw.o\"" + fi + test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar-msw.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"toolbar-msw.o\"" + fi + test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog-msw.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"dialog-msw.o\"" + fi + fi + cat > conftest.$ac_ext < + int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; } +EOF +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 EOF cat >> confdefs.h <<\EOF -#define HAVE_GIF 1 +#define HAVE_MSG_SELECT 1 EOF } - extra_objs="$extra_objs dgif_lib.o gif_io.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"dgif_lib.o gif_io.o\"" +else + conftest_rc="$?" + echo "configure: failed program was:" >&5 + 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\"" fi fi +fi - if test "$with_png $with_tiff" != "no no"; then - -echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 -echo "configure:8285: checking for inflate in -lc" >&5 -ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'` -xe_check_libs=" -lc " + +test -z "$window_system" && window_system="none" + +if test "$window_system" = "none"; then + for feature in menubars scrollbars toolbars dialogs dragndrop xface + do + if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then + echo "configure: warning: --with-$feature ignored: Not valid without window system support" 1>&2 + fi + eval "with_${feature}=no" + done +else + test -z "$with_toolbars" && with_toolbars=yes +fi + +if test "$with_msw" != "yes"; then + for feature in MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES + do + if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then + echo "configure: warning: --with-$feature ignored: Not valid without MS-Windows support" 1>&2 + fi + eval "with_${feature}=no" + done +else + : +fi + +if test "$with_x11" != "yes"; then + 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 + fi + eval "with_${feature}=no" + done +fi + +bitmapdir= + +case "$window_system" in + x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;; + msw ) HAVE_X_WINDOWS=no ; echo " Using MS-Windows." ;; + none ) HAVE_X_WINDOWS=no ; echo " Using no window system." ;; +esac + +case "$x_libraries" in *X11R4* ) + test "$opsys" = "hpux9" && opsysfile="s/hpux9-x11r4.h" + test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h" +esac + +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_SESSION +EOF +cat >> confdefs.h <<\EOF +#define HAVE_SESSION 1 +EOF +} + +fi + +test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no +test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6 +echo "configure:5949: checking for X11/Xauth.h" >&5 + +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure: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" +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 + : +else + echo "$ac_t""no" 1>&6 +with_xauth=no +fi + } +test -z "$with_xauth" && { +echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 +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 @@ -8314,60 +6009,95 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then : else echo "$ac_t""no" 1>&6 +with_xauth=no +fi -echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 -echo "configure:8320: checking for inflate in -lz" >&5 -ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'` + } +test -z "$with_xauth" && with_xauth=yes +if test "$with_xauth" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_XAUTH +EOF +cat >> confdefs.h <<\EOF +#define HAVE_XAUTH 1 +EOF +} + + +T="" +for W in $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done +libs_xauth="$T" + +fi + + + + +if test "$with_tooltalk" != "no" ; then + 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:6041: checking for ${dir}tt_c.h" >&5 -xe_check_libs=" -lz " cat > conftest.$ac_ext < EOF -if { (eval echo configure:8336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (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_lib_$ac_lib_var=yes" + 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_lib_$ac_lib_var=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* -xe_check_libs="" - -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - libs_x="-lz $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lz\" to \$libs_x"; fi + tt_c_h_path="${dir}tt_c.h"; break else echo "$ac_t""no" 1>&6 +fi -echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 -echo "configure:8355: checking for inflate in -lgz" >&5 -ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'` + done + 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." +echo " Use \`$progname --help' to show usage.") >&2 && exit 1 + fi + with_tooltalk=no + fi +fi +if test "$with_tooltalk" != "no" ; then + for extra_libs in "" "-lI18N -lce" "-lcxx"; do + +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:6085: checking "$xe_msg_checking"" >&5 +ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'` -xe_check_libs=" -lgz " +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 @@ -8381,32 +6111,59 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - libs_x="-lgz $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lgz\" to \$libs_x"; fi + tt_libs="-ltt $extra_libs"; break else echo "$ac_t""no" 1>&6 +: fi + done + if test -z "$tt_libs"; then + if test "$with_tooltalk" = "yes"; then + (echo "$progname: Usage error:" +echo " " "Unable to find required tooltalk libraries." +echo " Use \`$progname --help' to show usage.") >&2 && exit 1 + fi + with_tooltalk=no + fi fi +test -z "$with_tooltalk" && with_tooltalk=yes +if test "$with_tooltalk" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining TOOLTALK +EOF +cat >> confdefs.h <<\EOF +#define TOOLTALK 1 +EOF +} + { test "$extra_verbose" = "yes" && cat << EOF + Defining TT_C_H_PATH = "$tt_c_h_path" +EOF +cat >> confdefs.h <&6 -echo "configure:8401: checking for jpeglib.h" >&5 +test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6 +echo "configure:6158: checking for Dt/Dt.h" >&5 cat > conftest.$ac_ext < +#include
EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8409: \"$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" @@ -8423,28 +6180,28 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then : else echo "$ac_t""no" 1>&6 -with_jpeg=no +with_cde=no fi } - test -z "$with_jpeg" && { -echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:8432: checking for jpeg_destroy_decompress in -ljpeg" >&5 -ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'` +test -z "$with_cde" && { +echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 +echo "configure:6189: checking for DtDndDragStart in -lDtSvc" >&5 +ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` -xe_check_libs=" -ljpeg " +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 @@ -8461,120 +6218,203 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then : else echo "$ac_t""no" 1>&6 -with_jpeg=no +with_cde=no fi } - test -z "$with_jpeg" && with_jpeg=yes - if test "$with_jpeg" = "yes"; then +test -z "$with_cde" && with_cde=yes +if test "$with_dragndrop" = no; then + echo "configure: warning: No CDE without generic Drag'n'Drop support" 1>&2 + with_cde=no +fi +if test "$with_cde" = "yes" ; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_CDE +EOF +cat >> confdefs.h <<\EOF +#define HAVE_CDE 1 +EOF +} + + libs_x="-lDtSvc $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lDtSvc\" to \$libs_x"; fi + dragndrop_proto="$dragndrop_proto CDE" && if test "$extra_verbose" = "yes"; then echo " Appending \"CDE\" to \$dragndrop_proto"; fi + with_tooltalk=yes # CDE requires Tooltalk + need_motif=yes # CDE requires Motif +fi + +test "$window_system" != "x11" && with_offix=no +if test "$with_xmu" != yes -a "$with_x11" = yes; then + echo "configure: warning: No OffiX without real Xmu support" 1>&2 + with_offix=no +fi +if test "$with_dragndrop" = no; then + echo "configure: warning: No OffiX without generic Drag'n'Drop support" 1>&2 + with_offix=no +fi +if test "$with_cde" = yes; then + echo "configure: warning: CDE already found, disabling OffiX support" 1>&2 + with_offix=no +fi +test -z "$with_offix" && with_offix=no +if test "$with_offix" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_OFFIX_DND +EOF +cat >> confdefs.h <<\EOF +#define HAVE_OFFIX_DND 1 +EOF +} + + dnd_objs="$dnd_objs offix.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"offix.o\" to \$dnd_objs"; fi + dragndrop_proto="$dragndrop_proto OffiX" && if test "$extra_verbose" = "yes"; then echo " Appending \"OffiX\" to \$dragndrop_proto"; fi +fi + +echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6 +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 + echo "$ac_t""yes (${dragndrop_proto} )" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_JPEG + Defining HAVE_DRAGNDROP EOF cat >> confdefs.h <<\EOF -#define HAVE_JPEG 1 +#define HAVE_DRAGNDROP 1 EOF } - libs_x="-ljpeg $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ljpeg\" to \$libs_x"; fi + extra_objs="$extra_objs dragdrop.o" && if test "$extra_verbose" = "yes"; then echo " Appending \"dragdrop.o\" to \$extra_objs"; fi + else + with_dragndrop=no + echo "$ac_t""no" 1>&6 fi +fi - png_problem="" - test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:8484: checking for pow" >&5 +echo "checking for LDAP" 1>&6 +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:6298: checking for ldap.h" >&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 pow(); - -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_pow) || defined (__stub___pow) -choke me -#else -pow(); -#endif - -; return 0; } +#include EOF -if { (eval echo configure:8510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (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_func_pow=yes" + 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_func_pow=no" + 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 + : +else + echo "$ac_t""no" 1>&6 +with_ldap=no +fi + } +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:6329: checking for lber.h" >&5 -if eval "test \"`echo '$ac_cv_func_'pow`\" = yes"; then +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (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" +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 : else echo "$ac_t""no" 1>&6 -with_png=no +with_ldap=no fi } - test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for png.h""... $ac_c" 1>&6 -echo "configure:8531: checking for png.h" >&5 +if test "$with_ldap" != "no"; then + 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: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 < +/* 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 ldap_open(); + +int main() { +ldap_open() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8539: \"$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 +if { (eval echo configure:6379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=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" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - : + with_umich_ldap=yes else echo "$ac_t""no" 1>&6 -with_png=no +with_umich_ldap=no fi + } - test -z "$with_png" && { -echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:8562: checking for png_read_image in -lpng" >&5 -ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` + 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=" -lpng " +xe_check_libs=" -lldap10 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6418: \"$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 @@ -8588,165 +6428,160 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - : + with_ns_ldap=yes else echo "$ac_t""no" 1>&6 -with_png=no +with_ns_ldap=no fi } - if test -z "$with_png"; then - echo $ac_n "checking for workable png version information""... $ac_c" 1>&6 -echo "configure:8601: checking for workable png version information" >&5 - xe_check_libs="-lpng -lz" + 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 + Defining HAVE_LDAP +EOF +cat >> confdefs.h <<\EOF +#define HAVE_LDAP 1 +EOF +} + + extra_objs="$extra_objs eldap.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"eldap.o\"" + 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 + elif test "$with_ldap" = "yes" -a "$with_ns_ldap" = "yes" ; then + { test "$extra_verbose" = "yes" && cat << \EOF + 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: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:6487: checking for Xpm - no older than 3.4f" >&5 + xe_check_libs=-lXpm cat > conftest.$ac_ext < +#include int main(int c, char **v) { - if (c == 1) return 0; - if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1; - return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;} + return c == 1 ? 0 : + XpmIncludeVersion != XpmLibraryVersion() ? 1 : + XpmIncludeVersion < 30406 ? 2 : 0 ;} EOF -if { (eval echo configure:8612: \"$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; png_status=$?; - if test "$png_status" = "0"; then - with_png=yes; + ./conftest dummy_arg; xpm_status=$?; + if test "$xpm_status" = "0"; then + with_xpm=yes; else - with_png=no; - if test "$png_status" = "1"; then - png_problem="PNG library version and header file don't match!" - elif test "$png_status" = "2"; then - png_problem="PNG library version too old (pre 1.0.2)!" - fi - echo " -*** WARNING *** $png_problem + with_xpm=no; + if test "$xpm_status" = "1"; then + xpm_problem="Xpm library version and header file version don't match!" + elif test "$xpm_status" = "2"; then + xpm_problem="Xpm library version is too old!" + else + xpm_problem="Internal xpm detection logic error!" + fi + echo " +*** WARNING *** $xpm_problem I'm not touching that with a 10-foot pole! - If you really want to use the installed version of libPNG, rerun - configure and add '--with-png=yes', but don't blame me if XEmacs crashes!" + If you really want to use the installed version of Xpm, rerun + configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!" fi else conftest_rc="$?" echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* - with_png=no + with_xpm=no fi rm -fr conftest* xe_check_libs= - echo "$ac_t""$with_png" 1>&6 + echo "$ac_t""$with_xpm" 1>&6 fi - if test "$with_png" = "yes"; then + if test "$with_xpm" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_PNG + Defining HAVE_XPM EOF cat >> confdefs.h <<\EOF -#define HAVE_PNG 1 +#define HAVE_XPM 1 EOF } - libs_x="-lpng $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lpng\" to \$libs_x"; fi - fi - - 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:8655: checking for tiffio.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8663: \"$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 - : -else - echo "$ac_t""no" 1>&6 -with_tiff=no -fi - } - test -z "$with_tiff" && { -echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:8686: checking for TIFFClientOpen in -ltiff" >&5 -ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'` - -xe_check_libs=" -ltiff " -cat > conftest.$ac_ext <&6 +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* - eval "ac_cv_lib_$ac_lib_var=yes" + xpm_for_msw=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + xpm_for_msw=yes 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 - : -else - echo "$ac_t""no" 1>&6 -with_tiff=no -fi - - } - test -z "$with_tiff" && with_tiff=yes - if test "$with_tiff" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_TIFF + xe_check_libs= + echo "$ac_t""$xpm_for_msw" 1>&6 + if test "$xpm_for_msw" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining FOR_MSW EOF cat >> confdefs.h <<\EOF -#define HAVE_TIFF 1 +#define FOR_MSW 1 EOF } - libs_x="-ltiff $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ltiff\" to \$libs_x"; fi + fi fi -fi - -if test "$with_gtk" = "yes"; then test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for compface.h""... $ac_c" 1>&6 -echo "configure:8741: checking for compface.h" >&5 +echo "configure:6576: checking for compface.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8749: \"$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" @@ -8768,12 +6603,12 @@ fi } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:8772: 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 @@ -8815,87 +6650,44 @@ cat >> confdefs.h <<\EOF EOF } - libs_gtk="-lcompface $libs_gtk" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lcompface\" to \$libs_gtk"; fi + libs_x="-lcompface $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lcompface\" to \$libs_x"; fi fi -fi - - - -if test "$with_x11" = "yes"; then - echo "checking for X11 graphics libraries" 1>&6 -echo "configure:8827: checking for X11 graphics libraries" >&5 -fi - -case "$with_widgets" in - "yes" | "athena") detect_athena=yes ;; - *) detect_athena=no ;; -esac - -if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then - echo "checking for the Athena widgets" 1>&6 -echo "configure:8837: 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 $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:8851: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 -ac_lib_var=`echo $athena_variant'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` - -xe_check_libs=" -l$athena_variant " -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - 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="" +cat >> confdefs.h <<\EOF +#define HAVE_GIF 1 +EOF +} -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:8883: checking for threeDClassRec in -l$athena_variant" >&5 -ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'` + extra_objs="$extra_objs dgif_lib.o gif_io.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"dgif_lib.o gif_io.o\"" + fi + fi + + if test "$with_png $with_tiff" != "no no"; then + +echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 +echo "configure:6675: checking for inflate in -lc" >&5 +ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'` -xe_check_libs=" -l$athena_variant " +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 @@ -8909,40 +6701,28 @@ 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:8930: checking for threeDClassRec in -l$athena_variant" >&5 -ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'` +echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 +echo "configure:6710: checking for inflate in -lz" >&5 +ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'` -xe_check_libs=" -l$athena_variant " +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 @@ -8956,27 +6736,28 @@ 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 + libs_x="-lz $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lz\" to \$libs_x"; fi else echo "$ac_t""no" 1>&6 -echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6 -echo "configure:8964: checking for threeDClassRec in -lXaw" >&5 -ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'` -xe_check_libs=" -lXaw " +echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 +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 @@ -8990,12 +6771,12 @@ xe_check_libs="" 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; - + libs_x="-lgz $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lgz\" to \$libs_x"; fi 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 @@ -9004,19 +6785,18 @@ 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:9011: checking for X11/Xaw/ThreeD.h" >&5 + 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:6791: checking for jpeglib.h" >&5 cat > conftest.$ac_ext < +#include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9019: \"$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" @@ -9030,178 +6810,123 @@ 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:9039: checking for X11/Xaw/XawInit.h" >&5 +with_jpeg=no +fi + } + test -z "$with_jpeg" && { +echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 +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 < +/* 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 jpeg_destroy_decompress(); + +int main() { +jpeg_destroy_decompress() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9047: \"$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 +if { (eval echo configure:6838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=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" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = 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 +with_jpeg=no fi -fi + } + test -z "$with_jpeg" && with_jpeg=yes + if test "$with_jpeg" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_JPEG +EOF +cat >> confdefs.h <<\EOF +#define HAVE_JPEG 1 +EOF +} - 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:9073: checking for X11/$athena_variant/XawInit.h" >&5 + libs_x="-ljpeg $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ljpeg\" to \$libs_x"; fi + fi -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9081: \"$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:9098: checking for X11/$athena_variant/ThreeD.h" >&5 + png_problem="" + test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 +echo "configure:6874: checking for pow" >&5 cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9106: \"$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 +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char pow(); below. */ +#include +/* 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 pow(); +int main() { - 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:9134: checking for $athena_variant/XawInit.h" >&5 +/* 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_pow) || defined (__stub___pow) +choke me +#else +pow(); +#endif -cat > conftest.$ac_ext < +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9142: \"$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 +if { (eval echo configure:6900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_pow=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" + eval "ac_cv_func_pow=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:9159: 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:9167: \"$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 +if eval "test \"`echo '$ac_cv_func_'pow`\" = 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 +with_png=no 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:9196: checking for X11/Xaw3d/XawInit.h" >&5 + } + 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:6921: checking for png.h" >&5 cat > conftest.$ac_ext < +#include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9204: \"$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" @@ -9215,58 +6940,117 @@ 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:9221: checking for X11/Xaw3d/ThreeD.h" >&5 + : +else + echo "$ac_t""no" 1>&6 +with_png=no +fi + } + test -z "$with_png" && { +echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 +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 < +/* 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 png_read_image(); + +int main() { +png_read_image() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9229: \"$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 +if { (eval echo configure:6968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=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" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = 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 +with_png=no fi + } + if test -z "$with_png"; then + echo $ac_n "checking for workable png version information""... $ac_c" 1>&6 +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) { + if (c == 1) return 0; + if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1; + return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;} +EOF +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 + with_png=yes; + else + with_png=no; + if test "$png_status" = "1"; then + png_problem="PNG library version and header file don't match!" + elif test "$png_status" = "2"; then + png_problem="PNG library version too old (pre 1.0.2)!" + fi + echo " +*** WARNING *** $png_problem + I'm not touching that with a 10-foot pole! + If you really want to use the installed version of libPNG, rerun + configure and add '--with-png=yes', but don't blame me if XEmacs crashes!" + fi else - echo "$ac_t""no" 1>&6 + conftest_rc="$?" + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + with_png=no fi +rm -fr conftest* + xe_check_libs= + echo "$ac_t""$with_png" 1>&6 + fi + if test "$with_png" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_PNG +EOF +cat >> confdefs.h <<\EOF +#define HAVE_PNG 1 +EOF +} - fi + libs_x="-lpng $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lpng\" to \$libs_x"; 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:9261: checking for Xaw3d/XawInit.h" >&5 + 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:7045: checking for tiffio.h" >&5 cat > conftest.$ac_ext < +#include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9269: \"$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" @@ -9280,105 +7064,123 @@ 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:9286: checking for Xaw3d/ThreeD.h" >&5 + : +else + echo "$ac_t""no" 1>&6 +with_tiff=no +fi + } + test -z "$with_tiff" && { +echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6 +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 < +/* 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 TIFFClientOpen(); + +int main() { +TIFFClientOpen() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9294: \"$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 +if { (eval echo configure:7092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=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" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = 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 +with_tiff=no fi -else - echo "$ac_t""no" 1>&6 + } + test -z "$with_tiff" && with_tiff=yes + if test "$with_tiff" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_TIFF +EOF +cat >> confdefs.h <<\EOF +#define HAVE_TIFF 1 +EOF +} + + libs_x="-ltiff $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ltiff\" to \$libs_x"; fi + fi 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:9326: checking for X11/Xaw/ThreeD.h" >&5 +if test "$with_x11" = "yes"; then + + echo "checking for X11 graphics libraries" 1>&6 +echo "configure:7131: checking for X11 graphics libraries" >&5 + + +echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&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 < +/* 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 XawScrollbarSetThumb(); + +int main() { +XawScrollbarSetThumb() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9334: \"$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 +if { (eval echo configure:7151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=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" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = 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 - + have_xaw=yes else echo "$ac_t""no" 1>&6 -echo "configure: warning: "Could not find a suitable 3d Athena header set."" 1>&2 +have_xaw=no fi - fi - fi - - if test -n "$athena_lib" -a -n "$athena_h_path"; then - have_xaw=yes - else - have_xaw=no - fi -else - have_xaw=no -fi -if test "$with_x11" = "yes"; then + ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:9373: checking for Xm/Xm.h" >&5 +echo "configure:7175: checking for Xm/Xm.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9381: \"$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" @@ -9394,12 +7196,12 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:9398: 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 @@ -9439,9 +7241,9 @@ fi if test "$have_motif" = "yes"; then echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 -echo "configure:9443: checking for Lesstif" >&5 +echo "configure:7245: checking for Lesstif" >&5 cat > conftest.$ac_ext < #ifdef LESSTIF_VERSION @@ -9464,119 +7266,23 @@ rm -f conftest* 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 @@ -9584,7 +7290,7 @@ cat >> confdefs.h <<\EOF EOF } - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining NEED_ATHENA EOF cat >> confdefs.h <<\EOF @@ -9592,19 +7298,8 @@ cat >> confdefs.h <<\EOF 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* ) @@ -9631,11 +7326,6 @@ esac 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 @@ -9650,25 +7340,23 @@ esac -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 @@ -9676,7 +7364,7 @@ cat >> confdefs.h <<\EOF 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 @@ -9684,25 +7372,6 @@ cat >> confdefs.h <<\EOF 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 @@ -9736,14 +7405,6 @@ cat >> confdefs.h <<\EOF 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 @@ -9786,62 +7447,42 @@ cat >> confdefs.h <<\EOF 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_gtk" = "yes"; then - test "$with_menubars" != "no" && extra_objs="$extra_objs menubar-gtk.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"menubar-gtk.o\"" - fi - test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-gtk.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"scrollbar-gtk.o\"" - fi - test "$with_dialogs" != "no" && extra_objs="$extra_objs dialog-gtk.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"dialog-gtk.o\"" - fi - test "$with_toolbars" != "no" && extra_objs="$extra_objs toolbar-gtk.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"toolbar-gtk.o\"" - fi - test "$all_widgets" != "no no no no no" && extra_objs="$extra_objs gui-gtk.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"gui-gtk.o\"" - fi -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 @@ -9865,7 +7506,7 @@ fi if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:9869: checking for Mule-related features" >&5 +echo "configure:7510: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -9890,16 +7531,16 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9894: checking for $ac_hdr" >&5 +echo "configure:7535: 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:9902: \"$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" @@ -9929,12 +7570,12 @@ done echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:9933: 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 @@ -9978,18 +7619,18 @@ fi echo "checking for Mule input methods" 1>&6 -echo "configure:9982: 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:9985: 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:9988: 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 @@ -10024,12 +7665,12 @@ fi if test "$have_motif $have_lesstif" = "yes no"; then echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:10028: 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 @@ -10105,15 +7746,15 @@ EOF if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:10109: 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:10112: 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 @@ -10141,70 +7782,39 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then : else echo "$ac_t""no" 1>&6 -with_xfs=no -fi - - - if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining USE_XFONTSET -EOF -cat >> confdefs.h <<\EOF -#define USE_XFONTSET 1 -EOF -} - - if test "$with_xim" = "no" ; then - extra_objs="$extra_objs input-method-xlib.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"input-method-xlib.o\"" - fi - fi - fi - fi - 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:10168: checking for wnn/jllib.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10176: \"$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 - : -else - echo "$ac_t""no" 1>&6 -with_wnn=no +with_xfs=no fi - } - test -z "$with_wnn" && { ac_safe=`echo "wnn/commonhd.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for wnn/commonhd.h""... $ac_c" 1>&6 -echo "configure:10199: checking for wnn/commonhd.h" >&5 + + + if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining USE_XFONTSET +EOF +cat >> confdefs.h <<\EOF +#define USE_XFONTSET 1 +EOF +} + + if test "$with_xim" = "no" ; then + extra_objs="$extra_objs input-method-xfs.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"input-method-xfs.o\"" + fi + fi + fi + fi + 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:7809: checking for wnn/jllib.h" >&5 cat > conftest.$ac_ext < +#include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10207: \"$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" @@ -10228,10 +7838,10 @@ fi for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10232: checking for $ac_func" >&5 +echo "configure:7842: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure: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 @@ -10283,12 +7893,12 @@ done test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:10287: 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 @@ -10334,12 +7944,12 @@ fi 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:10338: 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 @@ -10368,12 +7978,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6 -echo "configure:10372: 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 @@ -10399,277 +8009,26 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 libwnn=wnn4 -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6 -echo "configure:10406: 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 - 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 - libwnn=wnn6 -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6 -echo "configure:10440: 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 - 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 - libwnn=wnn6_fromsrc -else - echo "$ac_t""no" 1>&6 -with_wnn=no -fi - - -fi - - -fi - - -fi - - - fi - test -z "$with_wnn" && with_wnn=yes - if test "$with_wnn" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_WNN -EOF -cat >> confdefs.h <<\EOF -#define HAVE_WNN 1 -EOF -} - - libs_x="-l$libwnn $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-l$libwnn\" to \$libs_x"; fi - extra_objs="$extra_objs mule-wnnfns.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"mule-wnnfns.o\"" - fi - if test "$with_wnn6" != "no"; then - -echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6 -echo "configure:10504: 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 - 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_wnn6=yes -else - echo "$ac_t""no" 1>&6 -fi - - - test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF - Defining WNN6 -EOF -cat >> confdefs.h <<\EOF -#define WNN6 1 -EOF -} - - fi - fi - - canna_includes_found=no - 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:10555: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10563: \"$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 - canna_includes_found=yes -else - echo "$ac_t""no" 1>&6 -fi - - fi - if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \ - -d "/usr/local/canna/include"; then - save_c_switch_site="$c_switch_site" - 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:10590: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10598: \"$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 - canna_includes_found=yes -else - echo "$ac_t""no" 1>&6 -fi - - if test "$canna_includes_found" != "yes"; then - c_switch_site="$save_c_switch_site" - with_canna="no" - fi - fi - - test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6 -echo "configure:10626: checking for canna/RK.h" >&5 - -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -with_canna=no -fi - } - test -z "$with_canna" && { -echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:10657: checking for RkBgnBun in -lRKC" >&5 -ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'` +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6 +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=" -lRKC " +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 @@ -10683,32 +8042,27 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - : + libwnn=wnn6 else echo "$ac_t""no" 1>&6 -with_canna=no -fi - - } - test -z "$with_canna" && { -echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:10696: checking for jrKanjiControl in -lcanna" >&5 -ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` +echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6 +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=" -lcanna " +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 @@ -10722,58 +8076,57 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - : + libwnn=wnn6_fromsrc else echo "$ac_t""no" 1>&6 -with_canna=no +with_wnn=no fi - } - test -z "$with_canna" && with_canna=yes - if test "$with_canna" = "yes"; then + +fi + + +fi + + +fi + + + fi + test -z "$with_wnn" && with_wnn=yes + if test "$with_wnn" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_CANNA + Defining HAVE_WNN EOF cat >> confdefs.h <<\EOF -#define HAVE_CANNA 1 +#define HAVE_WNN 1 EOF } - libs_x="-lcanna -lRKC $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lcanna -lRKC\" to \$libs_x"; fi - extra_objs="$extra_objs mule-canna.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"mule-canna.o\"" + libs_x="-l$libwnn $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-l$libwnn\" to \$libs_x"; fi + extra_objs="$extra_objs mule-wnnfns.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"mule-wnnfns.o\"" fi - fi - -else for feature in xim canna wnn; do - if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then - echo "configure: warning: "--with-${feature} ignored: Not valid without Mule support"" 1>&2 - fi - eval "with_${feature}=no" - done -fi - -if test "$need_motif" = "yes" ; then - 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:10761: checking for layout_object_getvalue in -li18n" >&5 -ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'` + if test "$with_wnn6" != "no"; then + +echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6 +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=" -li18n " +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 @@ -10787,263 +8140,185 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - libs_x="-li18n $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-li18n\" to \$libs_x"; fi + with_wnn6=yes else echo "$ac_t""no" 1>&6 fi - -if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then - ld_switch_site=`echo '' $ld_switch_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"` - ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[^ ]*//g"` - - runpath="" runpath_dirs="" - if test -n "$LD_RUN_PATH"; then - runpath="$LD_RUN_PATH" - elif test "$GCC" = "yes"; then - ld_switch_run_save="$ld_switch_run"; ld_switch_run="" - echo "int main(int argc, char *argv[]) {return 0;}" > conftest.c - xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null' - for arg in `eval "$xe_runpath_link" | grep ' -L'`; do - case "$arg" in P,* | -L* | -R* ) - for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do - { -xe_runpath_dir="$dir" - test "$xe_runpath_dir" != "/lib" -a \ - "$xe_runpath_dir" != "/usr/lib" -a \ - -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \ - eval "$xe_add_unique_runpath_dir" + test "$with_wnn6" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF + Defining WNN6 +EOF +cat >> confdefs.h <<\EOF +#define WNN6 1 +EOF } - done ;; - esac - done - ld_switch_run="$ld_switch_run_save" - rm -f conftest* - else - for arg in $ld_switch_site $ld_switch_x_site; do - case "$arg" in -L*) { -xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'` - test "$xe_runpath_dir" != "/lib" -a \ - "$xe_runpath_dir" != "/usr/lib" -a \ - -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \ - eval "$xe_add_unique_runpath_dir" -};; esac - done - if test "$opsys $need_motif" = "sol2 yes"; then - xe_runpath_dir="/opt/SUNWdt/lib"; - eval "$xe_add_unique_runpath_dir"; + fi - fi - if test -n "$runpath"; then - ld_switch_run="${dash_r}${runpath}" - -if test "$GCC" = "yes"; then - set x $ld_switch_run; shift; ld_switch_run="" - while test -n "$1"; do - case $1 in - -L | -l | -u ) ld_switch_run="$ld_switch_run $1 $2"; shift ;; - -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;; - -Xlinker* ) ;; - * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;; - esac - shift - done -fi - test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" fi -fi -fi - - -for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10864: checking for $ac_func" >&5 + canna_includes_found=no + 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:8165: checking for canna/jrkanji.h" >&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; } +#include EOF -if { (eval echo configure:10890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (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_func_$ac_func=yes" + 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_func_$ac_func=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_func -EOF -cat >> confdefs.h <&6 fi -done - - -if test "$ac_cv_func_getaddrinfo" != "no" ; then - case "$opsys" in - hpux11 ) - echo "configure: warning: Use of getaddrinfo is disabled for HP-UX 11.XX." 1>&2 - ac_cv_func_getaddrinfo=no - ;; - esac -fi - -for ac_func in getpt _getpty grantpt unlockpt ptsname killpg tcgetpgrp -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10931: checking for $ac_func" >&5 + fi + if test "$canna_includes_found" = "no" -a "$with_canna" != "no" -a \ + -d "/usr/local/canna/include"; then + save_c_switch_site="$c_switch_site" + 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:8200: checking for canna/jrkanji.h" >&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(); +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (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" +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 + canna_includes_found=yes +else + echo "$ac_t""no" 1>&6 +fi -int main() { + if test "$canna_includes_found" != "yes"; then + c_switch_site="$save_c_switch_site" + with_canna="no" + fi + fi -/* 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 + 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:8236: checking for canna/RK.h" >&5 -; return 0; } +cat > conftest.$ac_ext < EOF -if { (eval echo configure:10957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (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_func_$ac_func=yes" + 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_func_$ac_func=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = 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 +with_canna=no fi -done - - -echo $ac_n "checking for openpty""... $ac_c" 1>&6 -echo "configure:10986: checking for openpty" >&5 + } + test -z "$with_canna" && { +echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 +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 < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char openpty(); +char RkBgnBun(); int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_openpty) || defined (__stub___openpty) -choke me -#else -openpty(); -#endif - +RkBgnBun() ; return 0; } EOF -if { (eval echo configure:11012: \"$ac_link\") 1>&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_func_openpty=yes" + 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_func_openpty=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* +xe_check_libs="" -if eval "test \"`echo '$ac_cv_func_'openpty`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - have_openpty=yes + : else echo "$ac_t""no" 1>&6 +with_canna=no +fi - -echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6 -echo "configure:11031: checking for openpty in -lutil" >&5 -ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'` + } + test -z "$with_canna" && { +echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 +echo "configure:8306: checking for jrKanjiControl in -lcanna" >&5 +ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` -xe_check_libs=" -lutil " +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 @@ -11057,116 +8332,147 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - have_openpty=yes need_libutil=yes + : else echo "$ac_t""no" 1>&6 +with_canna=no fi - -fi - -if test "$have_openpty" = "yes"; then - { test "$extra_verbose" = "yes" && cat << \EOF - Defining HAVE_OPENPTY + } + test -z "$with_canna" && with_canna=yes + if test "$with_canna" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_CANNA EOF cat >> confdefs.h <<\EOF -#define HAVE_OPENPTY 1 +#define HAVE_CANNA 1 EOF } - for ac_hdr in pty.h libutil.h util.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11082: checking for $ac_hdr" >&5 + libs_x="-lcanna -lRKC $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lcanna -lRKC\" to \$libs_x"; fi + extra_objs="$extra_objs mule-canna.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"mule-canna.o\"" + fi + fi + +else for feature in xim canna wnn; do + if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then + echo "configure: warning: "--with-${feature} ignored: Not valid without Mule support"" 1>&2 + fi + eval "with_${feature}=no" + done +fi + +if test "$need_motif" = "yes" ; then + 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: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 < +/* 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 layout_object_getvalue(); + +int main() { +layout_object_getvalue() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11090: \"$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 +if { (eval echo configure:8387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=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" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_hdr -EOF -cat >> confdefs.h <&6 fi -done - - test "$need_libutil" = "yes" && libs_system="$libs_system -lutil" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lutil\" to \$libs_system"; fi -fi -for ac_hdr in stropts.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11126: 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:11134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_hdr -EOF -cat >> confdefs.h < conftest.c + xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null' + for arg in `eval "$xe_runpath_link" | grep ' -L'`; do + case "$arg" in P,* | -L* | -R* ) + for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do + { +xe_runpath_dir="$dir" + test "$xe_runpath_dir" != "/lib" -a \ + "$xe_runpath_dir" != "/usr/lib" -a \ + -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \ + eval "$xe_add_unique_runpath_dir" } - -else - echo "$ac_t""no" 1>&6 + done ;; + esac + done + ld_switch_run="$ld_switch_run_save" + rm -f conftest* + else + for arg in $ld_switch_site $ld_switch_x_site; do + case "$arg" in -L*) { +xe_runpath_dir=`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'` + test "$xe_runpath_dir" != "/lib" -a \ + "$xe_runpath_dir" != "/usr/lib" -a \ + -n "`ls ${xe_runpath_dir}/*.s[ol] 2>/dev/null`" && \ + eval "$xe_add_unique_runpath_dir" +};; esac + done + if test "$opsys $need_motif" = "sol2 yes"; then + xe_runpath_dir="/opt/SUNWdt/lib"; + eval "$xe_add_unique_runpath_dir"; + fi + fi + if test -n "$runpath"; then + ld_switch_run="${dash_r}${runpath}" + +if test "$GCC" = "yes"; then + set x $ld_switch_run; shift; ld_switch_run="" + while test -n "$1"; do + case $1 in + -L | -l | -u ) ld_switch_run="$ld_switch_run $1 $2"; shift ;; + -L* | -l* | -u* | -Wl* | -pg ) ld_switch_run="$ld_switch_run $1" ;; + -Xlinker* ) ;; + * ) ld_switch_run="$ld_switch_run -Xlinker $1" ;; + esac + shift + done +fi + test "$extra_verbose" = "yes" && echo "Setting runpath to $runpath" + fi +fi + fi -done -if test "$ac_cv_header_stropts_h" = "yes"; then - for ac_func in isastream +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:11167: checking for $ac_func" >&5 +echo "configure:8473: checking for $ac_func" >&5 cat > conftest.$ac_ext <&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 strtio.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11224: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext < +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11232: \"$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 +if { (eval echo configure:8499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_$ac_func=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" + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_hdr + Defining $ac_tr_func EOF cat >> confdefs.h <&6 fi done - fi -extra_objs="$extra_objs realpath.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"realpath.o\"" - fi -for ac_func in getloadavg + +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 ;; + * ) + 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:11269: checking for $ac_func" >&5 +echo "configure:8540: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure: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 @@ -11318,41 +8589,60 @@ else 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 -if test "$ac_cv_func_getloadavg" = "yes"; then - for ac_hdr in sys/loadavg.h +for ac_func in getloadavg do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11328: checking for $ac_hdr" >&5 +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:8602: checking for $ac_func" >&5 cat > conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include +/* 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 -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11336: \"$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 +if { (eval echo configure:8628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_func_$ac_func=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" + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_hdr + Defining $ac_tr_func EOF cat >> confdefs.h <&6 -echo "configure:11372: 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 @@ -11415,56 +8707,15 @@ else fi - for ac_hdr in kstat.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11423: 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:11431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_hdr -EOF -cat >> confdefs.h <&6 -fi -done - echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:11463: 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 @@ -11509,16 +8760,16 @@ fi fi echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:11513: checking whether netdb declares h_errno" >&5 +echo "configure:8764: checking whether netdb declares h_errno" >&5 cat > conftest.$ac_ext < int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:11522: \"$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 @@ -11538,16 +8789,16 @@ fi rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:11542: checking for sigsetjmp" >&5 +echo "configure:8793: checking for sigsetjmp" >&5 cat > conftest.$ac_ext < int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:11551: \"$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 @@ -11567,11 +8818,11 @@ fi rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:11571: 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 @@ -11606,7 +8857,7 @@ main() exit (0); } EOF -if { (eval echo configure:11610: \"$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 @@ -11636,9 +8887,9 @@ fi if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6 -echo "configure:11640: checking whether gettimeofday accepts one or two arguments" >&5 +echo "configure:8891: checking whether gettimeofday accepts one or two arguments" >&5 cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +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 @@ -11681,19 +8933,19 @@ fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:11685: 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 @@ -11725,26 +8977,35 @@ EOF ;; 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 -if test "$__DECC" != "yes"; then - # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# 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:11738: checking for working alloca.h" >&5 +echo "configure:8999: checking for working alloca.h" >&5 cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:11748: \"$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 @@ -11768,28 +9029,23 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:11772: checking for alloca" >&5 +echo "configure:9033: checking for alloca" >&5 cat > conftest.$ac_ext < -# define alloca _alloca +# if HAVE_ALLOCA_H +# include # else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX +# ifdef _AIX #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); -# endif # endif # endif # endif @@ -11799,7 +9055,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:11803: \"$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 @@ -11827,7 +9083,7 @@ if test $ac_cv_func_alloca_works = no; then # 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 @@ -11838,10 +9094,10 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:11842: checking whether alloca needs Cray hooks" >&5 +echo "configure:9098: checking whether alloca needs Cray hooks" >&5 cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11869: checking for $ac_func" >&5 +echo "configure:9125: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure: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 @@ -11921,10 +9177,10 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:11925: checking stack direction for C alloca" >&5 +echo "configure:9181: checking stack direction for C alloca" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure: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 @@ -11966,23 +9222,22 @@ EOF fi - test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" && if test "$extra_verbose" = "yes"; then +test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"$ALLOCA\"" fi -fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:11977: checking for vfork.h" >&5 +echo "configure:9232: checking for vfork.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11985: \"$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" @@ -12009,10 +9264,10 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:12013: checking for working vfork" >&5 +echo "configure:9268: checking for working vfork" >&5 cat > conftest.$ac_ext < @@ -12107,7 +9362,7 @@ main() { } } EOF -if { (eval echo configure:12111: \"$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 @@ -12133,10 +9388,10 @@ fi echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:12137: checking for working strcoll" >&5 +echo "configure:9392: checking for working strcoll" >&5 cat > conftest.$ac_ext < main () @@ -12146,7 +9401,7 @@ main () strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:12150: \"$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 @@ -12174,10 +9429,10 @@ fi for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12178: checking for $ac_func" >&5 +echo "configure:9433: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure: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 @@ -12228,10 +9483,10 @@ fi done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:12232: checking whether getpgrp takes no argument" >&5 +echo "configure:9487: checking whether getpgrp takes no argument" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure: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 @@ -12313,56 +9568,319 @@ fi echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:12317: 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 #include #include -#ifndef MAP_VARIABLE -#define MAP_VARIABLE 0 -#endif +#ifndef MAP_VARIABLE +#define MAP_VARIABLE 0 +#endif + +#ifndef MAP_FAILED +#define MAP_FAILED -1 +#endif + +int main (int argc, char *argv[]) +{ + int fd = -1; + caddr_t p; +#ifndef MAP_ANONYMOUS + fd = open ("/dev/zero", O_RDWR); + if (fd < 0) + return 1; +#define MAP_ANONYMOUS 0 +#endif + if (mmap(0, 1024, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS, + fd, 0) != (void *) MAP_FAILED) + return 0; + perror ("conftest: mmap failed"); + return 1; +} +EOF +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 + conftest_rc="$?" + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + have_mmap=no +fi +rm -fr conftest* ;; +esac +echo "$ac_t""$have_mmap" 1>&6 +test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_MMAP +EOF +cat >> confdefs.h <<\EOF +#define HAVE_MMAP 1 +EOF +} + +for ac_hdr in unistd.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure: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 -#ifndef MAP_FAILED -#define MAP_FAILED -1 +/* 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 (int argc, char *argv[]) +int +main() { - int fd = -1; - caddr_t p; -#ifndef MAP_ANONYMOUS - fd = open ("/dev/zero", O_RDWR); - if (fd < 0) - return 1; -#define MAP_ANONYMOUS 0 -#endif - if (mmap(0, 1024, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS, - fd, 0) != (void *) MAP_FAILED) - return 0; - perror ("conftest: mmap failed"); - return 1; -} -EOF -if { (eval echo configure:12353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 + 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 - have_mmap=yes + ac_cv_func_mmap_fixed_mapped=yes else conftest_rc="$?" echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* - have_mmap=no + ac_cv_func_mmap_fixed_mapped=no fi -rm -fr conftest* ;; -esac -echo "$ac_t""$have_mmap" 1>&6 -test "$have_mmap" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF +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 @@ -12370,42 +9888,11 @@ cat >> confdefs.h <<\EOF EOF } +fi -case "$opsys" in cygwin*) - test "$rel_alloc" = "default" && rel_alloc=no ;; -esac -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:12382: 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:12396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - rel_alloc=no; echo "$ac_t""yes" 1>&6; -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - rel_alloc=yes; echo "$ac_t""no" 1>&6; -fi -rm -f conftest* - else - rel_alloc=yes - fi -fi +test "$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 @@ -12417,16 +9904,16 @@ EOF ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:12421: checking for termios.h" >&5 +echo "configure:9908: checking for termios.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12429: \"$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" @@ -12468,16 +9955,16 @@ else 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:12472: checking for termio.h" >&5 +echo "configure:9959: checking for termio.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12480: \"$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" @@ -12508,10 +9995,10 @@ fi echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:12512: checking for socket" >&5 +echo "configure:9999: checking for socket" >&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 @@ -12549,16 +10036,16 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then 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:12553: checking for netinet/in.h" >&5 +echo "configure:10040: checking for netinet/in.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12561: \"$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" @@ -12574,16 +10061,16 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 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:12578: checking for arpa/inet.h" >&5 +echo "configure:10065: checking for arpa/inet.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12586: \"$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" @@ -12607,9 +10094,9 @@ EOF } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:12611: 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 < @@ -12620,7 +10107,7 @@ int main() { static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:12624: \"$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 @@ -12638,9 +10125,9 @@ else fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:12642: 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 < @@ -12650,7 +10137,7 @@ int main() { static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:12654: \"$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 @@ -12681,10 +10168,10 @@ fi echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:12685: checking for msgget" >&5 +echo "configure:10172: checking for msgget" >&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 @@ -12722,16 +10209,16 @@ if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then 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:12726: checking for sys/ipc.h" >&5 +echo "configure:10213: checking for sys/ipc.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12734: \"$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" @@ -12747,16 +10234,16 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 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:12751: checking for sys/msg.h" >&5 +echo "configure:10238: checking for sys/msg.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12759: \"$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" @@ -12793,16 +10280,16 @@ fi ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:12797: checking for dirent.h" >&5 +echo "configure:10284: checking for dirent.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12805: \"$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" @@ -12828,16 +10315,16 @@ else 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:12832: checking for sys/dir.h" >&5 +echo "configure:10319: checking for sys/dir.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12840: \"$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" @@ -12869,16 +10356,16 @@ fi ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:12873: checking for nlist.h" >&5 +echo "configure:10360: checking for nlist.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12881: \"$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" @@ -12907,23 +10394,27 @@ fi echo "checking "for sound support"" 1>&6 -echo "configure:12911: 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:12918: checking for multimedia/audio_device.h" >&5 +echo "configure:10409: checking for multimedia/audio_device.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12926: \"$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" @@ -12970,12 +10461,12 @@ fi if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:12974: 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 @@ -13017,12 +10508,12 @@ fi if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:13021: 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 @@ -13068,26 +10559,19 @@ fi fi if test -z "$sound_found"; then - if test "$with_msw" = "yes"; then - sound_found=yes - native_sound_lib= - fi - fi - - if test -z "$sound_found"; then 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:13082: checking for ${dir}/soundcard.h" >&5 +echo "configure:10566: checking for ${dir}/soundcard.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13090: \"$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" @@ -13102,15 +10586,14 @@ rm -f conftest* 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:13144: 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:13152: \"$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:13170: 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 @@ -13216,12 +10635,12 @@ cat >> confdefs.h <<\EOF 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 @@ -13230,7 +10649,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | : 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 @@ -13241,124 +10660,14 @@ EOF 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:13256: 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:13285: 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:13311: \"$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:13362: 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 @@ -13374,12 +10683,12 @@ EOF if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:13378: 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 @@ -13423,16 +10732,16 @@ EOF ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:13427: checking for ncurses/curses.h" >&5 +echo "configure:10736: checking for ncurses/curses.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13435: \"$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" @@ -13446,23 +10755,23 @@ fi 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:13457: checking for ncurses/term.h" >&5 +echo "configure:10766: checking for ncurses/term.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13465: \"$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" @@ -13476,7 +10785,7 @@ fi 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 @@ -13491,16 +10800,16 @@ fi 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:13495: checking for ncurses/curses.h" >&5 +echo "configure:10804: checking for ncurses/curses.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13503: \"$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" @@ -13514,7 +10823,7 @@ fi 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 @@ -13534,12 +10843,12 @@ fi for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:13538: 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 @@ -13572,76 +10881,21 @@ fi done fi - else if test -n "$libs_termcap" -a "$opsys" = "openbsd"; then - -echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6 -echo "configure:13579: checking for tgoto in -ltermcap" >&5 -ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'` - -xe_check_libs=" -ltermcap " -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 - ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - { test "$extra_verbose" = "yes" && cat << EOF - Defining $ac_tr_lib -EOF -cat >> confdefs.h <&6 -extra_objs="$extra_objs tparam.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"tparam.o\"" - fi -fi - - - else - extra_objs="$extra_objs tparam.o" && if test "$extra_verbose" = "yes"; then + else extra_objs="$extra_objs tparam.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"tparam.o\"" fi - fi case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac if test -n "$libs_termcap"; then LIBS="$libs_termcap $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"$libs_termcap\" to \$LIBS"; fi else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:13640: 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 @@ -13670,12 +10924,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:13674: 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 @@ -13716,34 +10970,34 @@ fi 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:13738: checking for gpm.h" >&5 +echo "configure:10992: checking for gpm.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13746: \"$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" @@ -13765,12 +11019,12 @@ fi } test -z "$with_gpm" && { echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:13769: 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 @@ -13824,28 +11078,28 @@ else for feature in ncurses gpm; do eval "with_${feature}=no" done fi -test "$with_x11" = "yes" -o "$with_tty" = "yes" -o "$need_event_unixoid" = "yes" && extra_objs="$extra_objs event-unixoid.o" && if test "$extra_verbose" = "yes"; then +test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event-unixoid.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"event-unixoid.o\"" 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:13835: checking for database support" >&5 +echo "configure:11089: checking for database support" >&5 -if test "$with_database_gdbm $with_database_dbm" != "no no"; then +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:13840: checking for ndbm.h" >&5 +echo "configure:11094: checking for ndbm.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13848: \"$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" @@ -13863,23 +11117,23 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 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 + with_database_gnudbm=no with_database_dbm=no fi fi -if test "$with_database_gdbm" != "no"; then +if test "$with_database_gnudbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:13878: 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 @@ -13904,13 +11158,13 @@ xe_check_libs="" 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 + with_database_gnudbm=yes with_database_dbm=no libdbm=-lgdbm else echo "$ac_t""no" 1>&6 -if test "$with_database_gdbm" = "yes"; then +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 @@ -13918,10 +11172,10 @@ fi if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:13922: checking for dbm_open" >&5 +echo "configure:11176: checking for dbm_open" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure: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 @@ -13963,12 +11217,12 @@ else echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:13967: 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 @@ -14007,8 +11261,8 @@ fi 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 @@ -14020,14 +11274,11 @@ EOF if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6 -echo "configure:14024: 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) #ifdef HAVE_INTTYPES_H #define __BIT_TYPES_DEFINED__ #include @@ -14038,74 +11289,53 @@ typedef uint32_t u_int32_t; typedef uint64_t u_int64_t; #endif #endif -#endif -#include <$header> +#include <$path> int main() { ; return 0; } EOF -if { (eval echo configure:14049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - db_h_file="$header"; break + 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:14065: checking for Berkeley DB version" >&5 +echo "configure:11315: checking for Berkeley DB version" >&5 cat > conftest.$ac_ext < +#include <$db_h_path> #if DB_VERSION_MAJOR > 1 yes #endif EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "yes" >/dev/null 2>&1; then - rm -rf conftest* - cat > conftest.$ac_ext < -#if DB_VERSION_MAJOR > 2 -yes -#endif - -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "yes" >/dev/null 2>&1; then - rm -rf conftest* - echo "$ac_t""3" 1>&6; dbfunc=db_create -else - rm -rf conftest* - - echo "$ac_t""2" 1>&6; dbfunc=db_open -fi -rm -f conftest* - +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""2" 1>&6; dbfunc=db_open else rm -rf conftest* - - echo "$ac_t""1" 1>&6; dbfunc=dbopen + echo "$ac_t""1" 1>&6; dbfunc=dbopen fi rm -f conftest* echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6 -echo "configure:14106: checking for $dbfunc" >&5 +echo "configure:11336: checking for $dbfunc" >&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 @@ -14147,12 +11377,12 @@ else echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:14151: 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 @@ -14189,10 +11419,10 @@ fi 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:14231: 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 @@ -14296,25 +11526,20 @@ EOF 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:14302: 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:14309: checking for dlfcn.h" >&5 +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 < +#include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14317: \"$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" @@ -14328,72 +11553,171 @@ 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 dlopen in -lc""... $ac_c" 1>&6 -echo "configure:14334: checking for dlopen in -lc" >&5 - cat > conftest.$ac_ext <> 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:11581: checking for dlopen in -ldl" >&5 +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` + +xe_check_libs=" -ldl " +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 dlopen(); + int main() { - dlopen ("", 0); +dlopen() ; return 0; } EOF -if { (eval echo configure:14343: \"$ac_link\") 1>&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* - have_dl=yes + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - - echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:14352: checking for dlopen in -ldl" >&5 - ac_save_LIBS="$LIBS" - LIBS="-ldl $LIBS" - cat > conftest.$ac_ext <&6 + { 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 < +/* 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 ("", 0); +_dlopen() ; return 0; } EOF -if { (eval echo configure:14363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - have_dl=yes + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - LIBS="$ac_save_LIBS" -fi -rm -f conftest* - ac_save_LIBS= + 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_DLOPEN +EOF +cat >> confdefs.h <<\EOF +#define HAVE_DLOPEN 1 +EOF +} + DLL_LIB=; with_shlib=yes else echo "$ac_t""no" 1>&6 fi - if test -n "$have_dl"; then - { test "$extra_verbose" = "yes" && cat << \EOF + } +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 + 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_DLOPEN EOF cat >> confdefs.h <<\EOF #define HAVE_DLOPEN 1 EOF } + DLL_LIB=; with_shlib=yes +else + echo "$ac_t""no" 1>&6 +fi - else - + } +test -z "$with_shlib" && { echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:14392: checking for shl_load in -ldld" >&5 +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 +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 @@ -14418,25 +11742,27 @@ xe_check_libs="" 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:14435: checking for dld_init in -ldld" >&5 +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${ac_exeext}; then +if { (eval echo configure:11777: \"$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 @@ -14461,27 +11787,21 @@ xe_check_libs="" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - libdl=dld have_dl=yes; - { test "$extra_verbose" = "yes" && cat << \EOF + { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_DLD_INIT EOF cat >> confdefs.h <<\EOF #define HAVE_DLD_INIT 1 EOF } - + DLL_LIB=dld; with_shlib=yes else echo "$ac_t""no" 1>&6 fi - -fi - - - fi - fi - if test -n "$have_dl"; then - + } +if test "$with_shlib" = "yes"; then + dll_ld= dll_ldflags= dll_cflags= @@ -14492,7 +11812,7 @@ xehost=$canonical xealias=$internal_configuration echo "checking how to build dynamic libraries for ${xehost}" 1>&6 -echo "configure:14496: 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*) ;; @@ -14520,9 +11840,9 @@ if test "$GCC" = "yes"; then XEGCC=yes else echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:14524: 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:14548: checking how to produce PIC code" >&5 +echo "configure:11868: checking how to produce PIC code" >&5 wl= can_build_shared=yes @@ -14552,7 +11872,7 @@ if test "$XEGCC" = yes; then wl='-Wl,' case "$xehost_os" in - aix[3-9]* | irix[5-9]* | osf[3-9]) + aix3* | aix4* | irix5* | irix6* | osf3* | osf4*) # PIC is the default for these OSes. ;; @@ -14565,9 +11885,6 @@ if test "$XEGCC" = yes; then # like `-m68040'. dll_cflags='-m68020 -resident32 -malways-restore-a4' ;; - *cygwin* | *mingw* ) - # PIC is the default - ;; *) dll_cflags='-fPIC' ;; @@ -14575,13 +11892,13 @@ if test "$XEGCC" = yes; then 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' ;; - irix[5-9]*) + irix5* | irix6*) wl='-Wl,' # PIC (with -KPIC) is the default. ;; @@ -14590,16 +11907,11 @@ else # We can build DLLs from non-PIC. ;; - osf[3-9]*) + osf3* | osf4*) # All OSF/1 code is PIC. wl='-Wl,' ;; - aix[3-9]*) - # All AIX code is PIC. - wl='-Wl,' - ;; - sco3.2v5*) dll_cflags='-belf -Kpic' wl='-Wl,' @@ -14642,21 +11954,21 @@ fi if test -n "$dll_cflags"; then echo "$ac_t""${dll_cflags}" 1>&6 - + # Check to make sure the dll_cflags actually works. echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6 -echo "configure:14649: 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 @@ -14687,13 +11999,13 @@ cc_produces_so=no xldf= xcldf= echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6 -echo "configure:14691: 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" else # Not using GCC case "$xehost_os" in - aix[3-9]*) + aix3* | aix4*) xldf="-bE:ELLSONAME.exp -H512 -T512 -bhalt:4 -bM:SRE -bnoentry -lc" xcldf="${wl}-bE:ELLSONAME.exp ${wl}-H512 ${wl}-T512 ${wl}-bhalt:4 ${wl}-bM:SRE ${wl}-bnoentry ${wl}-lc" ;; @@ -14712,7 +12024,7 @@ else # Not using GCC xcldf="${wl}-b ${wl}+s" ;; - irix[5-9]* | osf[3-9]*) + irix5* | irix6* | osf3* | osf4*) xcldf="${wl}-shared" xldf="-shared" ;; @@ -14738,14 +12050,14 @@ if test -n "$xcldf"; then 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 @@ -14770,19 +12082,18 @@ if test -z "$LTLD"; then 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:14774: 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. /*) if test -z "$LTLD"; then -# case "$ac_prog" in -# *gcc-lib*) LTLD="$CC" -# ;; -# *) - LTLD="$ac_prog" -# ;; -# esac + case "$ac_prog" in + *gcc-lib*) LTLD="$CC" + ;; + *) LTLD="$ac_prog" + ;; + esac fi ;; "") @@ -14796,7 +12107,7 @@ echo "configure:14774: checking for ld used by GCC" >&5 esac else echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:14800: checking for GNU ld" >&5 +echo "configure:12111: checking for GNU ld" >&5 fi if test -z "$LTLD"; then @@ -14834,7 +12145,7 @@ ld_dynamic_link_flags= # 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:14838: 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 @@ -14857,12 +12168,11 @@ if test "$cc_produces_so" = "yes"; then 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:14866: 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 @@ -14884,7 +12194,7 @@ echo "configure:14866: checking whether the linker supports shared libraries" >& dll_ldflags=$xldf ;; - aix[4-9]*) + aix4*) dll_ldflags=$xcldf ;; @@ -14914,7 +12224,7 @@ echo "configure:14866: checking whether the linker supports shared libraries" >& dll_ldflags=$xldf ;; - irix[5-9]*) + irix5* | irix6*) dll_ld=$LTLD dll_ldflags=$xldf ;; @@ -14987,7 +12297,11 @@ fi if test -z "$ld_dynamic_link_flags"; then case "$xehost_os" in - aix[3-9]*) + aix3*) + ld_dynamic_link_flags= + ;; + + aix4*) ld_dynamic_link_flags= ;; @@ -15007,7 +12321,7 @@ if test -z "$ld_dynamic_link_flags"; then ld_dynamic_link_flags="${wl}-E" ;; - irix[5-9]*) + irix5* | irix6*) ld_dynamic_link_flags= ;; @@ -15024,7 +12338,7 @@ if test -z "$ld_dynamic_link_flags"; then ;; solaris2* | solaris7*) - ld_dynamic_link_flags= + ld_dynamic_link_flags="${wl}-Bdynamic" ;; sco3.2v5* | unixware* | sysv5* | sysv4*) @@ -15054,8 +12368,6 @@ fi # End of if test "$can_build_shared" = "yes" - fi - if test "$can_build_shared" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SHLIB @@ -15065,18 +12377,21 @@ cat >> confdefs.h <<\EOF 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:15077: checking for $ac_func" >&5 +echo "configure:12392: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure: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 @@ -15126,23 +12441,18 @@ else 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 + echo "configure: warning: disabling shared library support" 1>&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 @@ -15205,7 +12515,7 @@ c_switch_general="$T" T="" -for W in $c_switch_x_site $c_switch_gtk $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done +for W in $c_switch_x_site $X_CFLAGS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done c_switch_window_system="$T" @@ -15235,7 +12545,7 @@ ld_libs_general="$T" T="" -for W in $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done +for W in $X_EXTRA_LIBS $libs_x $X_PRE_LIBS; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done ld_libs_window_system="$T" @@ -15283,25 +12593,13 @@ if test "$extra_verbose" = "yes"; then 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 @@ -15325,10 +12623,6 @@ rm -f core - - - - PREFIX=$prefix while true; do case "$PREFIX" in @@ -15339,7 +12633,6 @@ done - EXEC_PREFIX=$exec_prefix while true; do case "$EXEC_PREFIX" in @@ -15439,10 +12732,10 @@ done -DOCDIR=$docdir +LOCKDIR=$lockdir while true; do - case "$DOCDIR" in - *\$* ) eval "DOCDIR=$DOCDIR" ;; + case "$LOCKDIR" in + *\$* ) eval "LOCKDIR=$LOCKDIR" ;; *) break ;; esac done @@ -15488,16 +12781,6 @@ RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$( : ${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 @@ -15526,10 +12809,10 @@ for W in $ac_configure_args; do if test -z "$T"; then T="$W"; else T="$T $W"; fi ac_configure_args="$T" { test "$extra_verbose" = "yes" && cat << EOF - Defining EMACS_CONFIGURATION = "$configuration" + Defining EMACS_CONFIGURATION = "$canonical" EOF cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <<\EOF EOF } -test "$quick_build" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF - Defining QUICK_BUILD +test "$no_doc_file" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF + Defining NO_DOC_FILE EOF cat >> confdefs.h <<\EOF -#define QUICK_BUILD 1 +#define NO_DOC_FILE 1 EOF } @@ -15699,22 +12998,6 @@ cat >> confdefs.h <<\EOF EOF } -test "$pdump" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF - Defining PDUMP -EOF -cat >> confdefs.h <<\EOF -#define PDUMP 1 -EOF -} - -test "$with_ipv6_cname" = "yes" && { test "$extra_verbose" = "yes" && cat << \EOF - Defining IPV6_CANONICALIZE -EOF -cat >> confdefs.h <<\EOF -#define IPV6_CANONICALIZE 1 -EOF -} - ( @@ -15726,143 +13009,62 @@ echo "" 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 - -if test -n "$opsysfile" -then echo " Operating system description file: \`$opsysfile'" -else echo " Not using any operating system description file" -fi -if test -n "$machfile" -then echo " Machine description file: \`$machfile'" -else echo " Not using any machine description file" -fi - -echo " Compiler: $CC $CFLAGS" -echo " Relocating allocator for buffers: $rel_alloc" -echo " GNU version of malloc: ${GNU_MALLOC}${GNU_MALLOC_reason}" -case "$ld_switch_site" in - *nocombreloc*) echo " Linking with \`-z nocombreloc'. - - Consider configuring with --pdump." ;; -esac - -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 + echo " Runtime library search path: $runpath" 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 - gtk ) echo " Using GTK menubars." ;; - 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 - gtk ) echo " Using GTK scrollbars." ;; - 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 - gtk ) echo " Using GTK dialog boxes." ;; - 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 - gtk ) echo " Using GTK native widgets." ;; - 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" @@ -15870,67 +13072,87 @@ elif test "$window_system" != "none"; then 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." +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." -echo " -Sound:" -test "$with_native_sound" = yes && echo " Compiling in support for sound (native)." -test "$with_nas_sound" = yes && echo " Compiling in support for NAS (network audio system)." -test "$old_nas" = yes && echo " - NAS library lacks error trapping; will play synchronously." -test "$with_esd_sound" = yes && echo " Compiling in support for ESD (Enlightened Sound Daemon)." - -echo " -Databases:" -test "$with_database_berkdb" = yes && echo " Compiling in support for Berkeley database." +test "$with_database_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." +test "$with_i18n3" = yes && echo " Compiling in I18N support, level 3 (doesn't currently work)." -echo " -Other Features:" -test "$with_ipv6_cname" = no && echo " Inhibiting IPv6 canonicalization at startup." +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." @@ -15952,10 +13174,12 @@ test -n "$exec_prefix" && 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 @@ -16001,7 +13225,7 @@ do 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 ;; @@ -16021,11 +13245,9 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; 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 @@ -16055,11 +13277,9 @@ s%@ld@%$ld%g 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 -s%@GTK_CONFIG@%$GTK_CONFIG%g s%@X_CFLAGS@%$X_CFLAGS%g s%@X_PRE_LIBS@%$X_PRE_LIBS%g s%@X_LIBS@%$X_LIBS%g @@ -16069,7 +13289,6 @@ s%@libs_xauth@%$libs_xauth%g 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 @@ -16084,15 +13303,10 @@ s%@PROGNAME@%$PROGNAME%g 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%@extra_includes@%$extra_includes%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 @@ -16117,12 +13331,13 @@ s%@SITEMODULEDIR@%$SITEMODULEDIR%g 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 @@ -16383,8 +13598,8 @@ $CPP -I. -I${top_srcdir}/src junk.c \ | sed -e 's/^\#.*//' \ -e 's/^[ ][ ]*$//'\ -e 's/^ / /' \ - -e '/^[ ]*$/d' \ - -e '/^\"/ { + | sed -n -e '/^..*$/p' \ + | sed '/^\"/ { s/\\\([\"]\)/\1/g s/^[ ]*\"// s/\"[ ]*$// @@ -16397,8 +13612,8 @@ $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \ | sed -e 's/^\#.*//' \ -e 's/^[ ][ ]*$//'\ -e 's/^ / /' \ - -e '/^[ ]*$/d' \ - -e '/^\"/ { + | sed -n -e '/^..*$/p' \ + | sed '/^\"/ { s/\\\([\"]\)/\1/g s/^[ ]*\"// s/\"[ ]*$// diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..e4a3d74 --- /dev/null +++ b/configure.ac @@ -0,0 +1,6 @@ +AC_FATAL([ + +#### Autoconf 2.5x is not yet supported by XEmacs. +#### Our configure script is known *not* to work with these versions of +#### Autoconf. Please continue using Autoconf 2.13 for now. +]) diff --git a/configure.in b/configure.in index 0bf8449..e77bf16 100644 --- a/configure.in +++ b/configure.in @@ -3,11 +3,10 @@ define([AC_INIT_NOTICE], [#### Configuration script for XEmacs. Largely divergent from FSF. #### Guess values for system-dependent variables and create Makefiles. #### Generated automatically using autoconf version] AC_ACVERSION [ -#### Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +#### 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. #### Copyright (C) 1995, 1996 Ben Wing. -#### Copyright (C) 2000, 2001 Martin Buchholz. #### Copyright (C) 1998, 1999 J. Kean Johnston. ### Don't edit this script! @@ -15,8 +14,7 @@ define([AC_INIT_NOTICE], ### 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. -### Note: this script has not yet been ported to autoconf version 2.5x. +### in the this directory. You must have autoconf version 2.12 or later. ### This file is part of XEmacs. @@ -52,14 +50,14 @@ dnl configuration code and autoconf macros. 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 dnl - non-standard options -dnl - support for extra-verbosity +dnl - suport for extra-verbosity dnl - ordinary libs are handled separately from X libs (might be a mistake) -dnl - various random kludges (e.g. -with-dnet=no) +dnl - various random kludges (e.g. -with-dnet=no dnl PRINT_VAR(var var ...) prints values of shell variables define([PRINT_VAR],[for var in patsubst([$1],[[ @@ -126,7 +124,7 @@ EOF dnl redefine AC_CHECK_LIB in accordance with our own value of ac_link dnl Add in extra kludgy check to support with_dnet=no -dnl Add in extra LDFLAGS arg, which PRECEDES libs +dnl Add in extra LDFLAGS arg, which PRECEDE libs dnl Support --with-dnet=no dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND @@ -199,7 +197,7 @@ dnl ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC' dnl ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' xe_cppflags='$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 $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard' +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>&AC_FD_CC' ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&AC_FD_CC' @@ -286,10 +284,29 @@ verbose= x_includes=NONE x_libraries=NONE +dnl Installation directory options. +dnl These are left unexpanded so users can "make install exec_prefix=/foo" +dnl and all the variables that are supposed to be based on exec_prefix +dnl by default will actually change. +dnl Use braces instead of parens because sh, perl, etc. also accept them. +dnl If you change these, you need to synchronize with the settings of the +dnl various ..._USER_DEFINED variables further down. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${{exec_prefix}}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + 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 @@ -328,44 +345,35 @@ datadir='${prefix}/lib' 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='${libdir}/${instvardir}/${configuration}/modules' -sitelispdir='${datadir}/${inststaticdir}/site-lisp' -sitemoduledir='${libdir}/${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='${libdir}/${instvardir}/${configuration}' -docdir='${archlibdir}' -with_netinstall="no" -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='' -extra_includes='' dynamic='' with_x11='' with_msw='' rel_alloc='default' with_system_malloc='default' with_dlmalloc='default' -dnl ESD is associated with crashes and lockups due to incorrect signal use. -with_esd_sound='no' native_sound_lib='' -dnl These should be set to the empty string when we want gtk / gnome to -dnl be auto-detected instead of manually specified. -with_gtk='no' -with_gnome='no' dnl use_assertions should be 'yes' by default. Too many people in this dnl world have core dumps turned off by default or \"cannot find where the dnl core file went\". At least we should get some useful output ... @@ -375,11 +383,6 @@ with_toolbars="" 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 Too annoying, even if mandated by IPv6 (and I'm not even sure of that) -with_ipv6_cname="no" dnl ------------------ dnl Options Processing @@ -460,12 +463,9 @@ while test $# != 0; do dnl Process (many) boolean options with_site_lisp | \ - with_prefix | \ - with_site_modules | \ + with_site_modules | \ with_x | \ with_x11 | \ - with_gtk | \ - with_gnome | \ with_msw | \ with_gcc | \ dynamic | \ @@ -482,7 +482,7 @@ while test $# != 0; do with_jpeg | \ with_png | \ with_tiff | \ - with_wmcommand | \ + with_session | \ with_xmu | \ with_purify | \ with_quantify | \ @@ -499,26 +499,23 @@ while test $# != 0; do with_sparcworks | \ with_tooltalk | \ with_ldap | \ - with_postgresql | \ with_pop | \ with_kerberos | \ with_hesiod | \ with_dnet | \ with_infodock | \ - with_netinstall | \ - with_ipv6_cname | \ 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 ;; @@ -577,20 +574,20 @@ while test $# != 0; do "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 @@ -598,55 +595,16 @@ while test $# != 0; do 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. -Option \`all' or \`none' must be first in the list. -The default is to autodetect native and NAS 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 preferred 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\"" ;; @@ -669,10 +627,9 @@ The default is to autodetect native and NAS sound support."]) 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\"" ;; @@ -704,20 +661,14 @@ The default is to autodetect native and NAS sound support."]) 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."]) @@ -727,8 +678,6 @@ The default is to autodetect native and NAS sound support."]) 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 @@ -742,8 +691,8 @@ The default is to autodetect native and NAS sound support."]) dnl Has the user specified one of the path options? prefix | exec_prefix | bindir | datadir | statedir | libdir | \ - mandir | infodir | infopath | lispdir | etcdir | pkgdir | \ - archlibdir | docdir | package_path | moduledir ) + 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 if test "$#" = 0; then @@ -756,8 +705,6 @@ The default is to autodetect native and NAS sound support."]) 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) ;; @@ -766,13 +713,11 @@ The default is to autodetect native and NAS sound support."]) infopath ) AC_DEFINE(INFOPATH_USER_DEFINED) ;; package_path ) AC_DEFINE(PACKAGE_PATH_USER_DEFINED) ;; datadir ) - AC_DEFINE(INFODIR_USER_DEFINED) - AC_DEFINE(LISPDIR_USER_DEFINED) - AC_DEFINE(MODULEDIR_USER_DEFINED) - AC_DEFINE(ETCDIR_USER_DEFINED) - AC_DEFINE(DOCDIR_USER_DEFINED) - AC_DEFINE(ARCHLIBDIR_USER_DEFINED) ;; - docdir ) AC_DEFINE(DOCDIR_USER_DEFINED) ;; + AC_DEFINE(INFODIR_USER_DEFINED) + AC_DEFINE(LISPDIR_USER_DEFINED) + AC_DEFINE(MODULEDIR_USER_DEFINED) + AC_DEFINE(ETCDIR_USER_DEFINED) ;; + statedir | lockdir ) AC_DEFINE(LOCKDIR_USER_DEFINED) ;; exec_prefix | libdir | archlibdir ) AC_DEFINE(ARCHLIBDIR_USER_DEFINED) ;; esac ;; @@ -786,29 +731,21 @@ The default is to autodetect native and NAS sound support."]) 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 ;; - mo | mot | moti | motif ) val=motif ;; + 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 ;; - dnl Explicit --with-widgets on command line means yes. - "") val=yes ;; - g | gt | gtk ) val=gtk ;; - ms | msw ) val=msw ;; + n | no | non | none ) val=no ;; * ) USAGE_ERROR(["The \`--$optname' option must have one of these values: - \`gtk', \`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.]) ;; @@ -914,7 +851,7 @@ dnl is still relative. We do not symlink lock because someone may 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" @@ -972,25 +909,20 @@ dnl Find out which version of XEmacs this is 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 @@ -1009,28 +941,23 @@ else 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) @@ -1082,9 +1009,7 @@ case "$canonical" in 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 ;; @@ -1094,7 +1019,7 @@ case "$canonical" in m68*-sony-* ) machine=news ;; mips-sony-* ) machine=news-risc ;; clipper-* ) machine=clipper ;; - arm* ) machine=arm ;; + arm-* ) machine=arm ;; ns32k-* ) machine=ns32000 ;; esac @@ -1111,7 +1036,7 @@ case "$canonical" in *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;; *-dec-osf3.[[2-9]] ) opsys=decosf3-2 ;; *-dec-osf3* ) opsys=decosf3-1 ;; - *-dec-osf[[4-9]]* ) opsys=decosf4-0 ;; + *-dec-osf4* ) opsys=decosf4-0 ;; dnl DEC Ultrix *-*-ultrix[[0-3]].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;; @@ -1214,13 +1139,6 @@ case "$canonical" in dnl Cubix QBx/386 i[[3-9]]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;; - dnl Darwin, a.k.a. MacOS X (based on Mach and Freebsd) - *-*-darwin*) - opsys=darwin - RANLIB="ranlib -c" dnl Avoids a link error with lwlib-config.c - pdump=yes dnl No "native" working dumper available - ;; - dnl Data General AViiON Machines i586-dg-dgux*R4* | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;; m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;; @@ -1533,8 +1451,18 @@ case "$canonical" in *-bsdi3* ) opsys=bsdos3 ;; *-bsdi2.1* ) opsys=bsdos2-1 ;; *-bsdi2* ) opsys=bsdos2 ;; - *-sco3.2v5* ) opsys=sco5 ;; - *-sysv5* ) opsys=sco7 ;; + *-sco3.2v5* ) opsys=sco5 ; + dnl This is a pain. Like the current USL cc, SCO cc -E + dnl tokenizes as it preprocesses, making configure very + dnl unhappy. Unfortunately, /lib/cpp does not understand + dnl flags like "-b elf", so we have to cheat in order to + dnl pick up the right defines for UNEXEC from the s-file. + dnl 01/05/95 robertl@dgii.com + if test "$dynamic" = "yes" ; then + NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE -D_SCO_ELF" ; + else + NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE" ; + fi ;; *-386bsd* ) opsys=386bsd ;; *-freebsd* ) opsys=freebsd ;; *-nextstep* ) opsys=nextstep ;; @@ -1550,30 +1478,13 @@ case "$canonical" in esac -dnl Initialize machine from $canonical if not in our database above. -test -z "$machine" && machine=`echo $canonical | sed 's/-.*$//'` - -dnl Initialize opsys from `uname -s` if not in our database above. -test -z "$opsys" && opsys=`uname -s | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - -dnl Use configure-time autodetection if s&m not available -if test -r "${srcdir}/src/m/${machine}.h"; then - machfile="m/${machine}.h" - AC_DEFINE_UNQUOTED(config_machfile, "$machfile") -else - echo "XEmacs has no builtin knowledge of \`$machine' machines." - echo "Using configure-time autodetection only." -fi - -if test -r "${srcdir}/src/s/${opsys}.h"; then - opsysfile="s/${opsys}.h" - AC_DEFINE_UNQUOTED(config_opsysfile, "$opsysfile") -else - echo "XEmacs has no builtin knowledge of \`$opsys' operating systems." - echo "Using configure-time autodetection only." +if test -z "$machine" -o -z "$opsys"; then + (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems." + echo "$progname: Check \`etc/MACHINES' for recognized configuration names." + ) >&2 + exit 1 fi - if test -z "$dynamic"; then case "$opsys" in hpux* | sunos4* ) dynamic=no ;; @@ -1602,6 +1513,9 @@ case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'` AC_DEFINE_UNQUOTED(STACK_TRACE_EYE_CATCHER, $stack_trace_eye_catcher) +machfile="m/${machine}.h" +opsysfile="s/${opsys}.h" + dnl -------------------------------------------------- dnl Determine the compiler, set up for feature testing dnl -------------------------------------------------- @@ -1614,7 +1528,7 @@ if test "$with_workshop" = "yes"; then 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 @@ -1661,14 +1575,7 @@ test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP" 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 ],[ @@ -1682,23 +1589,6 @@ dnl I'm tired of pop being broken with GLIBC -slb 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! @@ -1708,8 +1598,6 @@ AC_TRY_RUN([int main () { return 11; #elif defined __DECC return 12; -#elif defined __USLC__ && defined __SCO_VERSION__ -return 13; #else return 0; #endif @@ -1717,7 +1605,6 @@ return 0; [case "$conftest_rc" in 11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;; 12) echo "You appear to be using the DEC C compiler." ; __DECC=yes ;; - 13) echo "You appear to be using the SCO C compiler." ; __USLC__=yes ;; esac]) @@ -1753,8 +1640,7 @@ configure___ [$2]=no [#]endif ])dnl CPP_boolean_to_sh -cat > $tempcname < confdefs.h -cat >> $tempcname < $tempcname <> $tempcname <&1`" in - *-z\ nocombreloc* ) AC_MSG_RESULT(yes) - XE_PREPEND(-z nocombreloc, ld_switch_site) ;; - *) AC_MSG_RESULT(no) ;; - esac -fi - - dnl Inform compiler that certain flags are meant for the linker dnl XE_PROTECT_LINKER_FLAGS(shell_var) define([XE_PROTECT_LINKER_FLAGS], [ @@ -2034,15 +1779,13 @@ if test "$GCC" = "yes"; then fi])dnl XE_PROTECT_LINKER_FLAGS(ld_switch_system) XE_PROTECT_LINKER_FLAGS(ld_switch_machine) -XE_PROTECT_LINKER_FLAGS(ld_switch_site) XE_PROTECT_LINKER_FLAGS(LDFLAGS) XE_PROTECT_LINKER_FLAGS(ld_call_shared) 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) @@ -2139,16 +1882,16 @@ dnl site-includes and site-libraries. COLON_TO_SPACE(site_prefixes) if test -n "$site_prefixes"; then for dir in $site_prefixes; do - lib_dir="${dir}/lib" inc_dir="${dir}/include" + lib_dir="${dir}/lib" 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 @@ -2162,7 +1905,7 @@ dnl fi dnl Extra system-specific library directories - please add to list for dir in "/usr/ccs/lib"; do - test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_system) + test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_site) done dnl --site-runtime-libraries (multiple dirs) @@ -2172,31 +1915,11 @@ if test -n "$site_runtime_libraries"; then 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 one 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 ;; @@ -2298,6 +2021,9 @@ fi ])dnl XE_COMPUTE_RUNPATH() +dnl JKJ REMOVEME +dnl XE_SHLIB_STUFF + dnl ----------------------------------- dnl Do some misc autoconf-special tests dnl ----------------------------------- @@ -2311,6 +2037,7 @@ else 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], @@ -2320,26 +2047,29 @@ AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 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. @@ -2368,45 +2098,32 @@ AC_PROG_INSTALL AC_PROG_YACC dnl checks for header files -AC_CHECK_HEADERS(dnl - a.out.h dnl - elf.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/time.h dnl - sys/timeb.h dnl - sys/un.h dnl - ulimit.h dnl - unistd.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 AC_DECL_SYS_SIGLIST - -dnl ---------------------------------------------------------------- -dnl Checking for utime() or utimes(). -dnl We prefer utime, since it is more standard. -dnl Some systems have utime.h but do not declare the struct anyplace, -dnl so we use a more sophisticated test for utime than AC_CHECK_FUNCS. -dnl ---------------------------------------------------------------- -AC_MSG_CHECKING(for utime) -AC_TRY_COMPILE([#include -#include ], -[struct utimbuf x; x.actime = x.modtime = 0; utime ("/", &x);], +dnl Some systems have utime.h but do not declare the struct anyplace. +AC_MSG_CHECKING(for struct utimbuf) +AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME +#include +#include +#else +#ifdef HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif +#ifdef HAVE_UTIME_H +#include +#endif], [static struct utimbuf x; x.actime = x.modtime;], [AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_UTIME)], - [AC_MSG_RESULT(no) - dnl We don't have utime(); how about utimes()? - AC_CHECK_FUNCS(utimes)]) - + AC_DEFINE(HAVE_STRUCT_UTIMBUF)], + AC_MSG_RESULT(no)) dnl checks for typedefs AC_TYPE_SIGNAL @@ -2415,22 +2132,6 @@ AC_TYPE_PID_T 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 -#include -socklen_t x; -],[],[AC_MSG_RESULT(yes)],[ -AC_TRY_COMPILE([#include -#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 @@ -2490,31 +2191,12 @@ AC_TRY_LINK([#include ], 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 -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) +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 -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) @@ -2522,10 +2204,6 @@ case "$opsys" in decosf*) c_switch_site="$c_switch_site -threads" ;; esac -dnl ---------------------------------------------------------------- -dnl Miscellaneous flags -dnl ---------------------------------------------------------------- - AC_MSG_CHECKING(whether the -xildoff compiler flag is required) if ${CC-cc} '-###' -xildon no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; @@ -2536,15 +2214,13 @@ if ${CC-cc} '-###' -xildon no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/nu 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 ---------------------- @@ -2553,122 +2229,6 @@ dnl ---------------------- AC_CHECKING("for specified window system") -dnl Autodetection of Gdk libraries and includes -dnl ------------------------------------------- -dnl On some systems (FreeBSD springs to mind), they use -dnl versions on the utility routines, so instead of gtk-config -dnl you must use gtk12-config, etc, etc. - -GNOME_CONFIG=no -GTK_CONFIG=no - -if test "$with_gnome" != "no"; then - AC_MSG_CHECKING(for GNOME configuration script) - for possible in gnome-config - do - possible_version=`${possible} --version 2> /dev/null` - if test "x${possible_version}" != "x"; then - GNOME_CONFIG="${possible}" - with_gnome=yes - with_gtk=yes - break - fi - done - AC_MSG_RESULT([${GNOME_CONFIG}]) -fi - -if test "${GNOME_CONFIG}" != "no"; then - GNOME_LIBS=`${GNOME_CONFIG} --libs gnomeui` - GNOME_CFLAGS=`${GNOME_CONFIG} --cflags gnomeui` - AC_DEFINE(HAVE_GNOME) - XE_APPEND(${GNOME_LIBS}, libs_gtk) - XE_APPEND(${GNOME_CFLAGS}, c_switch_gtk) -fi - -if test "$with_gtk" != "no";then - AC_MSG_CHECKING(for GTK configuration script) - for possible in gtk12-config gtk14-config gtk-config - do - possible_version=`${possible} --version 2> /dev/null` - if test "x${possible_version}" != "x"; then - GTK_CONFIG="${possible}" - fi - case "${possible_version}" in - 1.0.*) AC_MSG_WARN([GTK 1.2 is required, please upgrade your version of GTK.]); with_gtk=no;; - 1.3.*) AC_MSG_WARN([GTK 1.3 is not supported right now]); with_gtk=no;; - 1.2.*) - with_gtk=yes - break - ;; - *) AC_MSG_WARN([Found unsupported version of GTK: $possible_version]);; - esac - done - AC_MSG_RESULT([${GTK_CONFIG}]) -fi - -if test "${GTK_CONFIG}" != "no"; then - AC_MSG_CHECKING(gtk version) - GTK_VERSION=`${GTK_CONFIG} --version` - AC_MSG_RESULT(${GTK_VERSION}) - - AC_MSG_CHECKING(gtk libs) - GTK_LIBS=`${GTK_CONFIG} --libs` - XE_APPEND(${GTK_LIBS}, libs_gtk) - AC_MSG_RESULT(${GTK_LIBS}) - - AC_MSG_CHECKING(gtk cflags) - GTK_CFLAGS=`${GTK_CONFIG} --cflags` - if test "$GCC" = "yes"; then - GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow" - fi - XE_APPEND(${GTK_CFLAGS}, c_switch_gtk) - AC_MSG_RESULT(${GTK_CFLAGS}) - - AC_CHECK_LIB(gdk_imlib, main, XE_PREPEND(-lgdk_imlib, libs_gtk)) - AC_CHECK_LIB(Imlib, Imlib_init, XE_APPEND(-lImlib, libs_gtk)) - AC_CHECK_FUNCS(gdk_imlib_init) - - AC_DEFINE(HAVE_XPM) - AC_DEFINE(HAVE_GTK) - AC_SUBST(GTK_CONFIG) - - window_system=gtk - with_gtk=yes - with_x11=no - - test "${with_scrollbars}" != "no" && with_scrollbars=gtk - test "${with_toolbars}" != no && with_toolbars=gtk - test "${with_menubars}" != "no" && with_menubars=gtk - test "${with_dialogs}" != "no" && with_dialogs=gtk - test "${with_widgets}" != "no" && with_widgets=gtk - - XE_ADD_OBJS(console-gtk.o device-gtk.o event-gtk.o frame-gtk.o) - XE_ADD_OBJS(objects-gtk.o redisplay-gtk.o glyphs-gtk.o) - XE_ADD_OBJS(select-gtk.o gccache-gtk.o) - XE_ADD_OBJS(gtk-xemacs.o ui-gtk.o) - - dnl Check for libglade support (it rocks) - OLD_CFLAGS="${CFLAGS}" - OLD_CPPFLAGS="${CPPFLAGS}" - OLD_LDFLAGS="${LDFLAGS}" - CFLAGS="${GTK_CFLAGS} ${CFLAGS}" - CPPFLAGS="${GTK_CFLAGS} ${CFLAGS}" - LDFLAGS="${LDFLAGS} ${GTK_LIBS}" - AC_CHECK_HEADERS(glade/glade.h glade.h) - AC_CHECK_LIB(xml, main, XE_PREPEND(-lxml, libs_gtk)) - AC_CHECK_LIB(glade, main, XE_PREPEND(-lglade, libs_gtk)) - AC_CHECK_LIB(glade-gnome, main, XE_PREPEND(-lglade-gnome, libs_gtk)) - AC_EGREP_HEADER([char \*txtdomain;], [glade/glade-xml.h], - [AC_MSG_RESULT(yes) - AC_DEFINE(LIBGLADE_XML_TXTDOMAIN,1)], - [AC_MSG_RESULT(no)]) - CFLAGS="${OLD_CFLAGS}" - CPPFLAGS="${OLD_CPPFLAGS}" - LDFLAGS="${OLD_LDFLAGS}" -fi - -dnl We may eventually prefer gtk/gdk over vanilla X11... - if test "$with_x11" != "no"; then dnl User-specified --x-includes or --x-libraries implies --with-x11. test "$x_includes $x_libraries" != "NONE NONE" && \ @@ -2713,11 +2273,10 @@ if test "$with_x11" != "no"; then fi fi -dnl #### wmperry:: !x11 != NONE -dnl case "$with_x11" in -dnl yes ) window_system=x11 HAVE_X_WINDOWS=yes ;; -dnl no ) window_system=none HAVE_X_WINDOWS=no ;; -dnl esac +case "$with_x11" in + yes ) window_system=x11 HAVE_X_WINDOWS=yes ;; + no ) window_system=none HAVE_X_WINDOWS=no ;; +esac if test "$with_x11" = "yes"; then AC_DEFINE(HAVE_X_WINDOWS) @@ -2758,9 +2317,7 @@ if test "$with_x11" = "yes"; then done dnl Avoid version mismatch for shared library libXm.so on osf4 - case "$opsys" in - decosf*) if test "$GCC" = yes -a -d /usr/shlib; then XE_APPEND(-L/usr/shlib, X_LIBS); fi ;; - esac + if test "$GCC" = yes -a -d /usr/shlib; then XE_APPEND(-L/usr/shlib, X_LIBS); fi ld_switch_x_site="$X_LIBS" @@ -2807,21 +2364,10 @@ EOF cd .. rm -fr conftestdir for word in $xmkmf_defines; do - case "$word" in - -D__STDC__*) ;; - -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 @@ -2856,29 +2402,19 @@ dnl Avoid re-AC_DEFINE-ing xmkmf symbols we've already defined above. AC_MSG_RESULT(R${x11_release}) AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release}) - if test "${x11_release}" = "4"; then - case "$with_widgets" in - "" | "no") with_widgets=no ;; - *) XE_DIE("Widget support requires X11R5 or greater") ;; - esac - fi - - AC_CHECK_FUNCS(XConvertCase) - AC_CHECK_HEADERS(X11/Xlocale.h) - dnl XFree86 has a non-standard prototype for this X11R6 function - AC_CHECK_FUNCS(XRegisterIMInstantiateCallback) - AC_MSG_CHECKING(for standard XRegisterIMInstantiateCallback prototype) - AC_TRY_COMPILE([ -#define NeedFunctionPrototypes 1 -#include -extern Bool XRegisterIMInstantiateCallback( - Display*, struct _XrmHashBucketRec*, char*, char*, XIMProc, XPointer*); -], [], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) - AC_DEFINE(XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE)]) + dnl remove this - we should avoid checking for specific OS + AC_MSG_CHECKING(for XFree86) + if test -d "/usr/X386/include" -o \ + -f "/etc/XF86Config" -o \ + -f "/etc/X11/XF86Config" -o \ + -f "/usr/X11R6/lib/X11/XF86Config"; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_XFREE386) + else + AC_MSG_RESULT(no) + fi dnl autodetect -lXmu test -z "$with_xmu" && { AC_CHECK_LIB(Xmu, XmuReadBitmapDataFromFile, @@ -2916,16 +2452,8 @@ if test "$with_msw" != "no"; then AC_CHECK_LIB(gdi32,main,with_msw=yes) if test "$with_msw" = "yes"; then AC_DEFINE(HAVE_MS_WINDOWS) - - dnl The net installer only works with MS-Windows currently - if test "$with_netinstall" = "yes"; then - XE_APPEND(netinstall, MAKE_SUBDIR) - XE_APPEND(netinstall, SRC_SUBDIR_DEPS) - XE_APPEND(netinstall, INSTALL_ARCH_DEP_SUBDIR) - fi - 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 @@ -2937,7 +2465,6 @@ if test "$with_msw" != "no"; then && 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) @@ -2947,7 +2474,8 @@ if test "$with_msw" != "no"; then dnl check for our special version of select AC_TRY_RUN([#include int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }], - [need_event_unixoid=yes; AC_DEFINE(HAVE_MSG_SELECT)]) + [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 @@ -2991,7 +2519,7 @@ if test "$with_x11" != "yes"; then 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]) @@ -3000,25 +2528,12 @@ if test "$with_x11" != "yes"; then done fi -dnl Balloon Help requires the Shape extension, not available everywhere, -dnl for example not on AIX 4.3. -if test "$with_x11" = "yes"; then - AC_CHECK_HEADER(X11/extensions/shape.h, [ - AC_DEFINE(HAVE_BALLOON_HELP) - XE_ADD_OBJS(balloon_help.o balloon-x.o)]) -fi - dnl FSF 19.29 has some bitmapdir stuff here. bitmapdir= case "$window_system" in x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;; msw ) HAVE_X_WINDOWS=no ; echo " Using MS-Windows." ;; - gtk ) - HAVE_X_WINDOWS=no - test "$with_gnome" = "yes" && echo " Using GNOME." - test "$with_gnome" = "no" && echo " Using GTK." - ;; none ) HAVE_X_WINDOWS=no ; echo " Using no window system." ;; esac @@ -3027,11 +2542,11 @@ case "$x_libraries" in *X11R4* ) 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 @@ -3042,7 +2557,7 @@ test -z "$with_xauth" && { AC_CHECK_LIB(Xau, XauGetAuthByAddr,[:],with_xauth=no) test -z "$with_xauth" && with_xauth=yes if test "$with_xauth" = "yes"; then AC_DEFINE(HAVE_XAUTH) - XE_SPACE(libs_xauth, $GTK_LIBS $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS) + XE_SPACE(libs_xauth, $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS) fi AC_SUBST(libs_xauth) @@ -3055,9 +2570,9 @@ if test "$with_tooltalk" != "no" ; then 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 @@ -3079,7 +2594,7 @@ fi 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 @@ -3124,14 +2639,11 @@ if test "$with_offix" = "yes"; then XE_APPEND(offix.o, dnd_objs) XE_APPEND(OffiX, dragndrop_proto) fi -if test "$with_gtk" = "yes"; then - XE_APPEND(GTK, dragndrop_proto) -fi dnl Autodetect Drag'n'Drop support dnl always included if CDE, Offix, or MSWindows are defined +AC_MSG_CHECKING(if drag and drop API is needed) if test "$with_dragndrop" != "no" ; then - AC_MSG_CHECKING(if drag and drop API is needed) if test -n "$dragndrop_proto" ; then with_dragndrop=yes AC_MSG_RESULT([yes (${dragndrop_proto} )]) @@ -3148,60 +2660,22 @@ AC_CHECKING(for LDAP) 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 @@ -3212,42 +2686,12 @@ dnl ---------------------- if test "$window_system" != "none"; then AC_CHECKING(for graphics libraries) - dnl add special code to handle xpm-nox on Cygwin (csw) - dnl -- should only happen if CYGWIN && WITH_XPM && WITH_MSW && !WITH_X - libpath_xpm= - incpath_xpm= - case "$opsys" in - cygwin*) - cygwin_top=`eval "gcc -print-file-name=libc.a"` ; - cygwin_top=`eval "dirname ${cygwin_top}"`; - cygwin_top="${cygwin_top}/.."; - case "$window_system" in - dnl use "standard" search pattern - x11) ;; - dnl hardcode "standard" non-X11 xpm lib/inc dirs - msw) libpath_xpm="-L${cygwin_top}/lib/noX" - incpath_xpm="-I${cygwin_top}/include/noX" - ;; - dnl not supported on cygwin (yet?) - gtk) ;; - dnl probably not reached... - none) ;; - dnl ditto - *) ;; - esac - ;; - dnl use "standard" search pattern for all other OS's - *) ;; - esac dnl Autodetect Xpm xpm_problem="" if test -z "$with_xpm"; then - XE_PREPEND("$incpath_xpm", CFLAGS) - XE_PREPEND("$libpath_xpm", LDFLAGS) 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 : @@ -3275,13 +2719,8 @@ if test "$window_system" != "none"; then AC_MSG_RESULT($with_xpm) fi if test "$with_xpm" = "yes"; then - dnl #### This code assumes that if AC_CHECK_LIB fails, - dnl #### then it will succeed if FOR_MSW is defined, - dnl #### but doesn't actually verify this assumption. AC_DEFINE(HAVE_XPM) - XE_PREPEND("$libpath_xpm", LDFLAGS) XE_PREPEND(-lXpm, libs_x) - XE_PREPEND("$incpath_xpm", CFLAGS) AC_MSG_CHECKING(for \"FOR_MSW\" xpm) xe_check_libs=-lXpm AC_TRY_LINK(, [XpmCreatePixmapFromData()], @@ -3378,139 +2817,21 @@ if test "$window_system" != "none"; then fi dnl ---------------------- -dnl GTK-Specific Graphics libraries -dnl ---------------------- - -if test "$with_gtk" = "yes"; then - dnl Autodetect XFACE - test -z "$with_xface" && { AC_CHECK_HEADER(compface.h, ,with_xface=no) } - test -z "$with_xface" && { AC_CHECK_LIB(compface, UnGenFace,[:] ,with_xface=no) } - test -z "$with_xface" && with_xface=yes - if test "$with_xface" = "yes"; then - AC_DEFINE(HAVE_XFACE) - XE_PREPEND(-lcompface, libs_gtk) - fi -fi - - -dnl ---------------------- dnl X-Specific Graphics libraries dnl ---------------------- if test "$with_x11" = "yes"; then - AC_CHECKING(for X11 graphics libraries) -fi - -dnl We don't automatically trigger widgets if athena is present -dnl because of stability concerns. -dnl But if the user wants widgets, still offer him autodetections -case "$with_widgets" in - "yes" | "athena") detect_athena=yes ;; - *) detect_athena=no ;; -esac - -if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then - 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 + AC_CHECKING(for X11 graphics libraries) -else - have_xaw=no -fi dnl "$with_x11" = "yes" -a "detect_athena" = "yes" + 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 -if test "$with_x11" = "yes"; then dnl autodetect Motif - but only add to libs_x later (if necessary) AC_CHECK_HEADER(Xm/Xm.h, [AC_CHECK_LIB(Xm, XmStringFree, have_motif=yes, have_motif=no)], @@ -3534,62 +2855,26 @@ dnl Finish ensuring that we have values for the various toolkit items. dnl Not all toolkits support all widgets dnl if Motif is available we use it for the dialog boxes. -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 +all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars" - 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 - ;; +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* ) @@ -3602,11 +2887,6 @@ esac 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) ;; @@ -3614,23 +2894,15 @@ esac 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) @@ -3638,27 +2910,24 @@ test "$with_scrollbars" = "lucid" && AC_DEFINE(LWLIB_SCROLLBARS_LUCID) 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) - -if test "$with_gtk" = "yes"; then - test "$with_menubars" != "no" && XE_ADD_OBJS(menubar-gtk.o) - test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar-gtk.o) - test "$with_dialogs" != "no" && XE_ADD_OBJS(dialog-gtk.o) - test "$with_toolbars" != "no" && XE_ADD_OBJS(toolbar-gtk.o) - test "$all_widgets" != "no no no no no" && XE_ADD_OBJS(gui-gtk.o) -fi + +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 ---------------------- @@ -3725,7 +2994,7 @@ if test "$with_mule" = "yes" ; then if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then AC_DEFINE(USE_XFONTSET) if test "$with_xim" = "no" ; then - XE_ADD_OBJS(input-method-xlib.o) + XE_ADD_OBJS(input-method-xfs.o) fi fi fi dnl with_xfs @@ -3733,8 +3002,6 @@ if test "$with_mule" = "yes" ; then dnl Autodetect WNN test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/jllib.h, ,with_wnn=no) } - dnl gcc 2.97 fixincludes breaks inclusion of wnn/commonhd.h - test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/commonhd.h, ,with_wnn=no) } dnl Detour to find crypt if test "$with_wnn" != "no"; then AC_CHECK_FUNCS(crypt) @@ -3802,71 +3069,35 @@ if test "$need_motif" = "yes" ; then XE_COMPUTE_RUNPATH() fi -dnl ---------------------------------------------------------------- -dnl Check for POSIX functions. -dnl ---------------------------------------------------------------- - -AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask) - -dnl getaddrinfo() is borked under hpux11 -if test "$ac_cv_func_getaddrinfo" != "no" ; then - case "$opsys" in - hpux11 ) - AC_MSG_WARN([Use of getaddrinfo is disabled for HP-UX 11.XX.]) - ac_cv_func_getaddrinfo=no - ;; - esac -fi - -dnl ---------------------------------------------------------------- -dnl Check for PTY support functions. -dnl ---------------------------------------------------------------- - -dnl There is no "standard" pty allocation method. Every system is different. -dnl getpt() is the preferred pty allocation method on glibc systems. -dnl _getpty() is the preferred pty allocation method on SGI systems. -dnl grantpt(), unlockpt(), ptsname() are defined by Unix98. -AC_CHECK_FUNCS(getpt _getpty grantpt unlockpt ptsname killpg tcgetpgrp) - -dnl openpty() is the preferred pty allocation method on BSD and Tru64 systems. -dnl openpty() might be declared in: -dnl - pty.h (Tru64 or Linux) -dnl - libutil.h (FreeBSD) -dnl - util.h (NetBSD) -AC_CHECK_FUNC(openpty, have_openpty=yes, [ - AC_CHECK_LIB(util, openpty, have_openpty=yes need_libutil=yes)]) -if test "$have_openpty" = "yes"; then - AC_DEFINE(HAVE_OPENPTY) - AC_CHECK_HEADERS(pty.h libutil.h util.h, break) - test "$need_libutil" = "yes" && XE_APPEND(-lutil, libs_system) -fi +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 Check for STREAM support functions. -dnl Confusingly, "str" means both "string" and "SysV Streams". -AC_CHECK_HEADERS(stropts.h) -if test "$ac_cv_header_stropts_h" = "yes"; then - AC_CHECK_FUNCS(isastream) - AC_CHECK_HEADERS(strtio.h) dnl TIOCSIGNAL -fi +dnl realpath is buggy on linux, decosf and aix4 -dnl Use our own realpath always. -XE_ADD_OBJS(realpath.o) +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(). +dnl Check whether the system provides getloadavg (Solaris 7 has it) AC_CHECK_FUNCS(getloadavg) -if test "$ac_cv_func_getloadavg" = "yes"; then - dnl Solaris 8 declares getloadavg() in . - dnl glibc 2.2 declares getloadavg() in ... - dnl ...if we #define _GNU_SOURCE, which we do. - AC_CHECK_HEADERS(sys/loadavg.h) -else - dnl We define our own getloadavg() using lower level functions. +if test "$ac_cv_func_getloadavg" != "yes" +then XE_ADD_OBJS(getloadavg.o) dnl Used by getloadavg() - does not require root priveleges AC_CHECK_LIB(kstat, kstat_open) - AC_CHECK_HEADERS(kstat.h) dnl Another way to get the load average AC_CHECK_LIB(kvm, kvm_read) @@ -3950,7 +3181,8 @@ AC_TRY_LINK([ ], [ struct timeval time; - gettimeofday (&time, 0); + struct timezone dummy; + gettimeofday (&time, &dummy); ], [AC_MSG_RESULT(two)], [AC_MSG_RESULT(one) @@ -3959,18 +3191,18 @@ fi 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* ) dnl AC_CHECK_FUNC(alloca, [:], [AC_CHECK_LIB(PW, alloca)]) dnl esac -dnl AC_FUNC_ALLOCA doesn't know about DEC C's #pragma intrinsic(alloca) -if test "$__DECC" != "yes"; then - AC_FUNC_ALLOCA - test -n "$ALLOCA" && XE_ADD_OBJS($ALLOCA) -fi +AC_FUNC_ALLOCA +test -n "$ALLOCA" && XE_ADD_OBJS($ALLOCA) dnl Check whether vfork exists and works correctly. (This does more dnl than just check for its existence.) If so, it defines HAVE_VFORK_H. @@ -4024,28 +3256,12 @@ int main (int argc, char *argv[]) esac AC_MSG_RESULT($have_mmap) test "$have_mmap" = "yes" && AC_DEFINE(HAVE_MMAP) +AC_FUNC_MMAP -dnl By default we switch off rel-alloc on cygwin as it generally causes us grief -case "$opsys" in cygwin*) - test "$rel_alloc" = "default" && rel_alloc=no ;; -esac 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 @@ -4097,6 +3313,10 @@ dnl Check for sound of various sorts. 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 @@ -4149,22 +3369,13 @@ if test "$with_native_sound" != "no"; then esac fi - dnl Win32 Native uses native sound - if test -z "$sound_found"; then - if test "$with_msw" = "yes"; then - sound_found=yes - native_sound_lib= - fi - fi - dnl Check for Linux/BSD native sound if test -z "$sound_found"; then 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 @@ -4172,55 +3383,25 @@ if test "$with_native_sound" != "no"; then test "$sound_found" = "yes" && with_native_sound=yes fi -if test "$with_native_sound" = "yes"; then - AC_DEFINE(HAVE_NATIVE_SOUND) - 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 +if test -z "$with_sound"; then + if test "$with_native_sound" = "yes" -o -n "$native_sound_lib"; then + with_sound=native 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 +if test "$with_native_sound" = "yes"; then + AC_DEFINE(HAVE_NATIVE_SOUND) + test -n "$native_sound_lib" && XE_PREPEND($native_sound_lib, LIBS) 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 @@ -4239,8 +3420,8 @@ if test "$with_tty" = "yes" ; then 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) @@ -4250,7 +3431,7 @@ if test "$with_tty" = "yes" ; then 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" @@ -4268,17 +3449,10 @@ if test "$with_tty" = "yes" ; then done fi else dnl "$have_terminfo" = "no" && "with_ncurses" = "no" - if test -n "$libs_termcap" -a "$opsys" = "openbsd"; then - dnl We need to check if tgoto does not exist in termcap yet - dnl because on OpenBSD libtermcap is another name for libcurses - dnl which provides the same tgoto as ncurses - AC_CHECK_LIB(termcap, tgoto, , XE_ADD_OBJS(tparam.o)) - else - XE_ADD_OBJS(tparam.o) - fi + XE_ADD_OBJS(tparam.o) dnl The HP-UX curses library seems to have a badly broken version of select(2) dnl that makes "poll: interrupted system call" messages to appear and - dnl Emacs subprocesses to hang (e.g. TeX compilation w/ AUCTeX) */ + dnl Emacs suprocesses to hang (e.g. TeX compilation w/ AUCTeX) */ case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac if test -n "$libs_termcap"; then XE_PREPEND($libs_termcap, LIBS) @@ -4289,8 +3463,8 @@ if test "$with_tty" = "yes" ; then 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) } @@ -4311,35 +3485,33 @@ else dnl "$with_tty" = "no" fi dnl with_tty dnl Do we need event-unixoid.o ? -dnl This is needed for X, or for TTY, or for MSWIN w/Cygwin select() -dnl [but not Mingw MSWIN] -test "$with_x11" = "yes" -o "$with_tty" = "yes" -o "$need_event_unixoid" = "yes" && XE_ADD_OBJS(event-unixoid.o) +test "$with_x11" = "yes" -o "$with_tty" = "yes" && XE_ADD_OBJS(event-unixoid.o) dnl Database support dnl We do not necessarily have to have libdb/lib(g)dbm for DB/(G)DBM support. 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. @@ -4353,18 +3525,15 @@ fi 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; @@ -4374,43 +3543,35 @@ typedef uint32_t u_int32_t; 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 -], [AC_EGREP_CPP(yes, -[#include <$db_h_file> -#if DB_VERSION_MAJOR > 2 -yes -#endif -], [AC_MSG_RESULT(3); dbfunc=db_create],[ - AC_MSG_RESULT(2); dbfunc=db_open])],[ - AC_MSG_RESULT(1); dbfunc=dbopen]) +], [AC_MSG_RESULT(2); dbfunc=db_open], [AC_MSG_RESULT(1); dbfunc=dbopen]) AC_CHECK_FUNC($dbfunc, with_database_berkdb=yes need_libdb=no, [ AC_CHECK_LIB(db, $dbfunc, with_database_berkdb=yes need_libdb=yes)]) 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) @@ -4429,56 +3590,25 @@ if test "$usage_tracking" = "yes"; then 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_MSG_CHECKING([for dlopen in -lc]) - AC_TRY_LINK([#include ],dnl - [dlopen ("", 0);], [ have_dl=yes ], [ - AC_MSG_CHECKING([for dlopen in -ldl]) - ac_save_LIBS="$LIBS" - LIBS="-ldl $LIBS" - AC_TRY_LINK([#include ],dnl - [dlopen ("", 0);], [ have_dl=yes ], - [LIBS="$ac_save_LIBS"]) - ac_save_LIBS=])]) - if test -n "$have_dl"; then - AC_DEFINE(HAVE_DLOPEN) - else - AC_CHECK_LIB(dld, shl_load, [ - libdl=dld have_dl=yes; - AC_DEFINE(HAVE_SHL_LOAD)], [ - AC_CHECK_LIB(dld, dld_init, [ - libdl=dld have_dl=yes; - AC_DEFINE(HAVE_DLD_INIT)])]) - fi - 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 @@ -4520,13 +3650,13 @@ dnl Use XE_SPACE instead of plain assignment statements to remove extraneous bla XE_SPACE(CFLAGS, $CFLAGS) XE_SPACE(extra_objs, $extra_objs) XE_SPACE(c_switch_general, -DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system) -XE_SPACE(c_switch_window_system, $c_switch_x_site $c_switch_gtk $X_CFLAGS) +XE_SPACE(c_switch_window_system, $c_switch_x_site $X_CFLAGS) XE_SPACE(c_switch_all, $c_switch_general $c_switch_window_system) XE_SPACE(ld_switch_general, $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_run) XE_SPACE(ld_switch_window_system, $ld_switch_x_site) XE_SPACE(ld_switch_all, $ld_switch_general $ld_switch_window_system) XE_SPACE(ld_libs_general, $LIBS $libs_machine $libs_system $libs_standard) -XE_SPACE(ld_libs_window_system, $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS) +XE_SPACE(ld_libs_window_system, $X_EXTRA_LIBS $libs_x $X_PRE_LIBS) XE_SPACE(ld_libs_all, $ld_libs_window_system $ld_libs_general) dnl Compute lists of Makefiles and subdirs @@ -4566,32 +3696,15 @@ if test "$extra_verbose" = "yes"; then 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 @@ -4612,8 +3725,6 @@ AC_SUBST(PROGNAME) AC_SUBST(version) AC_SUBST(configuration) AC_SUBST(canonical) -AC_SUBST(inststaticdir) -AC_SUBST(instvardir) AC_SUBST(srcdir) AC_SUBST(bindir) AC_SUBST(datadir) @@ -4621,10 +3732,8 @@ AC_SUBST(pkgdir) AC_SUBST(statedir) AC_SUBST(libdir) AC_SUBST(mandir) -AC_SUBST(extra_includes) AC_SUBST(prefix) -AC_SUBST(PREFIX_USER_DEFINED) dnl Yo, Stephen Bourne! I want to marry you! PREFIX=$prefix while true; do @@ -4636,7 +3745,6 @@ done AC_SUBST(PREFIX) AC_SUBST(exec_prefix) -AC_SUBST(EXEC_PREFIX_USER_DEFINED) EXEC_PREFIX=$exec_prefix while true; do case "$EXEC_PREFIX" in @@ -4734,16 +3842,16 @@ while true; do 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) @@ -4792,10 +3900,6 @@ dnl Useful for building XEmacs with a C++ or 64-bit compiler. : ${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 @@ -4807,8 +3911,10 @@ if test "$with_site_modules" = "no"; then 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") dnl Following are deprecated @@ -4833,15 +3939,14 @@ fi 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) -test "$with_ipv6_cname" = "yes" && AC_DEFINE(IPV6_CANONICALIZE) dnl ------------------------------- dnl Report on what we decided to do @@ -4858,144 +3963,63 @@ echo "" 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 - -if test -n "$opsysfile" -then echo " Operating system description file: \`$opsysfile'" -else echo " Not using any operating system description file" -fi -if test -n "$machfile" -then echo " Machine description file: \`$machfile'" -else echo " Not using any machine description file" -fi - -echo " Compiler: $CC $CFLAGS" -echo " Relocating allocator for buffers: $rel_alloc" -echo " GNU version of malloc: ${GNU_MALLOC}${GNU_MALLOC_reason}" -case "$ld_switch_site" in - *nocombreloc*) echo " Linking with \`-z nocombreloc'. - - Consider configuring with --pdump." ;; -esac - -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 + echo " Runtime library search path: $runpath" 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 - gtk ) echo " Using GTK menubars." ;; - 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 - gtk ) echo " Using GTK scrollbars." ;; - 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 - gtk ) echo " Using GTK dialog boxes." ;; - 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 - gtk ) echo " Using GTK native widgets." ;; - 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" @@ -5003,67 +4027,87 @@ elif test "$window_system" != "none"; then 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." +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." -echo " -Sound:" -test "$with_native_sound" = yes && echo " Compiling in support for sound (native)." -test "$with_nas_sound" = yes && echo " Compiling in support for NAS (network audio system)." -test "$old_nas" = yes && echo " - NAS library lacks error trapping; will play synchronously." -test "$with_esd_sound" = yes && echo " Compiling in support for ESD (Enlightened Sound Daemon)." - -echo " -Databases:" -test "$with_database_berkdb" = yes && echo " Compiling in support for Berkeley database." +test "$with_database_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." +test "$with_i18n3" = yes && echo " Compiling in I18N support, level 3 (doesn't currently work)." -echo " -Other Features:" -test "$with_ipv6_cname" = no && echo " Inhibiting IPv6 canonicalization at startup." +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." @@ -5092,10 +4136,12 @@ dnl except ./Makefile from $srcdir/Makefile.in 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 @@ -5133,9 +4179,9 @@ dnl Delete spurious blanks inserted by $CPP -e 's/^[ TAB][ TAB]*$//'\ -e 's/^ /TAB/' \ dnl Delete blank lines - -e '/^[ ]*$/d' \ + | sed -n -e '/^..*$/p' \ dnl Restore lines quoted above to original contents. - -e '/^\"/ { + | sed '/^\"/ { s/\\\([\"]\)/\1/g s/^[ TAB]*\"// s/\"[ TAB]*$// diff --git a/etc/MYTHOLOGY b/etc/MYTHOLOGY new file mode 100644 index 0000000..bbdfdc9 --- /dev/null +++ b/etc/MYTHOLOGY @@ -0,0 +1,25 @@ +Reference: Robert W. Brockway, Myth from the Ice Age to Mickey Mouse + + A collective definition of myth composed of many theories might be + framed by the following paraphrase: + + Myths are stories, usually, about gods and other supernatural + beings. They are often stories of origins, how the world and + everything in it came to be in illo tempore. They are usually + strongly structured and their meaning is only discerned by + linguistic analysis. Sometimes they are public dreams which, like + private dreams, emerge from the unconscious mind. Indeed, they + often reveal the archetypes of the collective unconscious. They + are symbolic and metaphorical. They orient people to the + metaphysical dimension, explain the origins and nature of the + cosmos, validate social issues, and, on the psychological plane, + address themselves to the innermost depths of the psyche. Some of + them are explanatory, being prescientific attempts to interpret + the natural world. As such, they are usually functional and are + the science of primitive peoples. Often, they are enacted in + rituals. Religious myths are sacred histories, and distinguished + from the profane. But, being semiotic expressions, they are a + "disease of language." They are both individual and social in + scope, but they are first and foremost stories. + + diff --git a/etc/OXYMORONS b/etc/OXYMORONS index da16190..3528654 100644 --- a/etc/OXYMORONS +++ b/etc/OXYMORONS @@ -18,31 +18,25 @@ The rest of the codenames are in alphabetical order. N.B. I expect that the Stable Release Maintainer will choose a new theme for the releases following the promotion of 21.4 from "gamma" to -"stable". So 15 or so should be enough.... +"stable". So 15 should be enough.... 21.4.0: Solid Vapor 21.4.1: Copyleft 21.4.2: Developer-Friendly Unix APIs 21.4.3: Academic Rigor -21.4.4: Artificial Intelligence -21.4.5: Civil Service -21.4.6: Common Lisp -21.4.7: Economic Science -21.4.8: Honest Recruiter -21.4.9: Informed Management -21.4.10: Military Intelligence -21.4.11: Portable Code -21.4.12: Rational FORTRAN -21.4.13: Reasonable Discussion -21.4.14: Security Through Obscurity -21.4.15: Social Property -21.4.16: Stable Release Maintainer -21.4.17: Standard C -21.4.18: Successful IPO -21.4.19: Sufficiently Smart Compiler -21.4.20: The Gift Economy -21.4.21: Too Much Mozart -21.4.22: UTF-8 BOM +21.4.3: Artificial Intelligence +21.4.3: Civil Service +21.4.3: Common Lisp +21.4.3: Economic Science +21.4.3: Honest Politician +21.4.3: Informed Management +21.4.3: Military Intelligence +21.4.3: Portable Code +21.4.3: Rational FORTRAN +21.4.3: Reasonable Discussion +21.4.3: Standard C -N.B. Only incredibly redeeming suggestions can be accepted now. +N.B. Suggestions welcome until shortly before the release. (The +non-incrementing version number is precisely to make it easy to add +new oxymorons.) diff --git a/etc/TUTORIAL.se b/etc/TUTORIAL.se new file mode 100644 index 0000000..b823079 --- /dev/null +++ b/etc/TUTORIAL.se @@ -0,0 +1,1165 @@ +Detta dokument är baserat på den engelska handledningen, som har +Copyright (c) 1985, 1996 Free Software Foundation, Inc. Se slutet av +dokumentet för villkor och förutsättningar. + +Detta är den Svenska användarhandledningen till Emacs. + +Emacs-kommandon innebär ofta användning av kontrolltangenten (oftast +märkt CTRL eller CTL) eller META-tangenten. På vissa tangentbord är +META-tangenten märkt ALT eller EDIT eller något annat. På Suns +tangentbord, till exempel, är det rutertangenten till vänster om +mellanslagstangenten. Om du inte har någon META-tangent kan du använda +ESC. Istället för att skriva META eller KONTROLL kommer vi här att +använda följande förkortningar: + + C- betyder att du skall hålla ner kontrolltangenten samtidigt + som du skriver bokstaven . Alltså betyder C-f: håll ner + kontrolltangenten och tryck f. + M- betyder att du skall hålla ned META-, EDIT- eller + ALT-tangenten samtidigt som du skriver . Om du inte har + någon META-, EDIT- eller ALT-tangent kan du trycka , + släppa tangenten och sedan trycka bokstaven . När vi + skriver avser vi ESC-tangenten. + +Viktigt: För att avsluta Emacs trycker du C-x C-c (två tecken). +Tecknen ">>" i vänstermarginalen anger att du kan prova ett +kommando. Till exempel: +<> +>> Tryck C-v (View next screen) för att hoppa till nästa skärmbild. + Prova nu. Håll ned kontrolltangenten och tryck v. + Från och med nu bör du göra detta när du är färdig med en + skärmbild. + +Notera att det är ett överlapp på två rader när du byter från +skärmbild till skärmbild. Detta är för att behålla sammanhanget när du +bläddrar framåt i filen. + +Det första du behöver veta är hur du manövrerar från plats till plats +i texten. Du har redan lärt dig hur du flyttar en skärmbild framåt, +med C-v. För att flytta dig en skärmbild bakåt trycker du M-v. (Håll +ned META-tangenten och tryck v eller tryck v om du inte har +META-, EDIT- eller ALT-tangent.) + +>> Prova att trycka M-v och C-v några gånger. + + +* SAMMANFATTNING +---------------- + +Följande kommandon är bra för att se hela skärmbilder: + + C-v Flytta en skärmbild framåt. + M-v Flytta en skärmbild bakåt. + C-l Rita om skärmen och placera texten där markören står + mitt på skärmbilden. (Det är KONTROLL-L, inte + KONTROLL-1.) + +>> Leta reda på markören och se vad som står där. Tryck sedan C-l. + Hitta markören igen och notera att det är samma text som står kring + markören nu. + + +* GRUNDLÄGGANDE MARKÖRRÖRELSER +------------------------------ + +Att flytta sig från skärmbild till skärmbild kan vara bra, men hur +förflyttar man sig till en speciell plats på skärmen? + +Det finns flera sätt att göra detta på. Det vanligaste är att använda +kommandona C-p, C-b, C-f och C-n. Vart och ett av dessa kommandon +flyttar markören en rad eller en kolumn i en bestämd riktning på +skärmen. Här visas dessa fyra kommandon och i vilken riktning de +flyttar markören: + + + Föregående rad, C-p + : + : + Bakåt, C-b .... Nuvarande markörposition .... Framåt, C-f + : + : + Nästa rad, C-n + +>> Flytta markören till linjen mitt i diagrammet genom att använda C-n + och C-p. Använd sedan C-l för att centrera diagrammet på + skärmbilden. + +Detta är säkert lite enklare att förstå om du tänker på dessa +förkortningar: P för föregående (previous), N för nästa (next), B för +bakåt (backward) och F för framåt (forward). Detta är de grundläggande +kommandona för att flytta markören och du kommer säkert att använda +dem hela tiden, så det är en stor fördel om du lär dig dem nu. + +>> Gör några C-n så att du kommer ned till den här raden. + +>> Flytta dig in i raden med hjälp av några C-f och sedan uppåt + med några C-p. Lägg märke till vad C-p gör när markören står mitt + på en rad. + +Textrader är åtskilda med radslutstecken. Den sista raden i filen +avslutas också vanligtvis med ett radslut men Emacs kräver inte att +den gör det. + +>> Prova med C-b i början av en rad. Detta gör att markören + flyttas till slutet av den tidigare raden. Detta är för att den + flyttar markören över radslutstecknet. + +C-f flyttar också över radslut, precis som C-b. + +>> Gör några fler C-b så att du får en känsla för var markören + är. Tryck sedan några C-f tills du kommer till slutet av + raden. Tryck ytterligare en C-f så att du flyttar markören till + nästa rad. + +När du flyttar markören förbi toppen eller botten av skärmbilden +kommer texten utanför skärmen att komma fram. Detta kallas "rullning" +och gör det möjligt för Emacs att flytta markören utan att den +försvinner ut ur skärmbilden. + +>> Prova att flytta markören förbi skärmbildens nederkant med hjälp av + C-n och se vad som händer. + +Om det går för sakta att flytta markören ett tecken i taget kan du +flytta den ett ord. M-f flyttar markören ett ord framåt och M-b +flyttar den ett ord bakåt. + +>> Prova några M-f och M-b. + +Om markören står mitt i ett ord kommer M-f att flytta markören till +slutet av ordet. Om du står mitt emellan två ord kommer M-f att flytta +markören till slutet av nästa ord. M-b fungerar på samma sätt men i +motsatt riktning. + +>> Tryck M-f och M-b några gånger och skifta markörposition med några + C-f och C-b så att du ser hur M-f och M-b uppför sig vid olika + placeringar av markören både i och mellan ord. + +Lägg märke till likheten mellan C-f och C-b å ena sidan och M-f och +M-b å den andra. Ofta används META-kommandon till språkrelaterade +operationer (ord, stycken, avsnitt), medan kontrollkommandon används +till grundläggande operationer som inte beror av vad man redigerar +(bokstäver, rader, etc.). + +Denna likhet finns också mellan rader och stycken: C-a och C-e flyttar +markören till början av en rad eller till slutet av en rad, medan M-a +och M-e flyttar den till början respektive slutet av ett stycke. + +>> Prova några C-a och sedan några C-e. + Prova också några M-a och sedan några M-e. + +Se hur efterföljande C-a efter varandra inte gör något, medan flera +M-a fortsätter att flytta markören till nästa stycke. Även om detta +inte verkar självklart är det ganska naturligt. + +Platsen där markören är i texten kallas också för "arbetspunkt" +(point). Eller omskrivet: Markören visar på skärmen var arbetspunkten +är i texten. + +Här är en kort sammanfattning av de enklaste markörförflyttnings- +kommandona, inklusive ord- och styckesförflyttningskommandon: + + C-f Flytta markören ett steg framåt + C-b Flytta markören ett steg bakåt + + M-f Flytta markören ett ord framåt + M-b Flytta markören ett ord bakåt + + C-n Flytta markören till nästa rad + C-p Flytta markören till föregående rad + + C-a Flytta markören till början av raden + C-e Flytta markören till slutet av raden + + M-a Flytta markören till början av meningen + M-e Flytta markören till slutet av meningen + +>> Prova alla dessa kommandon några gånger för tränings skull. + Dessa är de kommandon som används mest. + +Två andra viktiga markörrörelsekommandon är M-< (META mindre-än), som +flyttar markören till början av texten, och M-> (META större-än), som +flyttar den till slutet av texten. + +På en del tangentbord är "<" placerad över komma, så att man måste +använda skift för att få fram den. På dessa tangentbord måste man +också använda skift för att skriva M-<. Utan skifttangenten skulle det +bli M-komma. + +>> Prova M-< nu för att flytta markören till början av vägledningen. + Använd sedan C-v för att flytta markören tillbaka hit igen. + +>> Prova också M-> för att flytta markören till slutet av vägledningen. + Använd sedan M-v för att flytta markören tillbaka hit igen. + +Du kan också flytta markören med hjälp av piltangenterna, om +terminalen har piltangenter. Vi föreslår att du lär dig C-b, C-f, C-n +och C-p av tre skäl. För det första kommer de att fungera på alla +slags terminaler. För det andra kommer du att finna, när du har fått +lite träning i att använda Emacs, att det går mycket snabbare att +använda kontrollfunktionerna än piltangenterna (för att du undviker +att ändra fingersättningen). Den tredje anledningen är att när man har +lärt sig att använda kontrolltangenten blir det lättare att lära sig +de mer avancerade kontrollfunktionerna. + +De flesta kommandon i Emacs tar ett numeriskt argument och för de +flesta kommandon leder detta till att de repeteras. Ett numeriskt +argument anges genom att du skriver C-u och sedan talet, innan du +skriver kommandot. Om du har en META- (eller EDIT- eller ALT-) tangent +så finns det ett annat alternativ för att ge numeriska argument: skriv +talet medan du håller ned META-tangenten. Vi föreslår att du använder +C-u för det fungerar på alla slags terminaler. Det numeriska +argumentet kallas också för "prefixargument" eftersom det skrivs före +kommandot. + +Till exempel: C-u 8 C-f flyttar markören åtta steg framåt. + +>> Prova C-n eller C-p med ett numeriskt argument så att du + kommer så nära den här raden som möjligt med ett enda kommando. + +De flesta kommandon använder det numeriska argumentet för ett +repeterat utförande men det finns kommandon som använder det +annorlunda. Flera kommandon, men inga av dem du lärt dig hittills, +använder det som en flagga. Med ett prefixargument, och oberoende av +dess värde, gör kommandot något annat. + +C-v och M-v finns med bland dessa undantag. Om man ger ett argument +till ett av dessa kommandon kommer skärmbilden flytta sig upp eller +ned så många rader som argumentet anger, istället för så många +skärmbilder. Till exempel kommer C-u 8 C-v flytta skärmbilden 8 rader +uppåt. + +>> Prova C-u 8 C-v nu. + +Detta borde ha flyttat skärmbilden 8 rader uppåt. Om du önskar flytta +tillbaka igen är det bara att ge samma argument till M-v. + +Om du använder Emacs under ett fönstersystem, som X11 eller +MS-Windows, finns det troligen ett rektangulärt område på vänster sida +av Emacs-fönstret, en så kallad rullningslist. Genom att klicka i den +med musen kan du rulla texten. + +>> Prova att trycka med den mellersta musknappen i det utvalda området + på rullningslisten. Detta bör flytta skärmbilden till en plats i + texten beroende på var i rullningslisten du trycker. + +>> Prova att flytta musen upp och ner medan du håller ner den + mellersta musknappen. Du ser att texten rullar upp och ner beroende + på hur du för musen. + + +* MARKÖRFÖRFLYTTNINGAR PÅ EN X-TERMINAL +--------------------------------------- + +Om du sitter vid en X-terminal kommer du antagligen finna det mycket +enklare att använda piltangenterna för att flytta markören. Vänster-, +höger-, upp- och nedåt-pilarna flyttar markören i önskad riktning. De +fungerar på samma sätt som C-b, C-f, C-p och C-n men är enklare att +slå och förstå. Du kan också använda C-vänsterpil och C-högerpil för +att flytta markören över ord och C-uppåtpil och C-nedåtpil för att +flytta den över textblock. (Till exempel för att flytta förbi ett +stycke om du redigerar text.) + +Om du har tangenter märkta med HOME (eller BEGIN) och END kan du +använda dessa för att gå till början respektive slutet av raden och +C-HOME och C-END kommer att gå till början respektive slutet av +filen. Om tangentbordet har PgUp- och PgDn-tangenter kan du använda +dem för att gå upp och ner en skärmbild åt gången på samma sätt som +med M-v och C-v. + +Alla dessa kan också ta numeriska argument, som beskrivits tidigare. +Du kan också använda en genväg för att skriva in dessa argument: håll +ned CONTROL eller META tangenten och skriv in numret. Till exempel för +att gå 12 ord till höger trycker du C-1 C-2 C-högerpil. Lägg märke +till att det är mycket enkelt att skriva eftersom du inte behöver +släppa kontrolltangenten mellan tangenttryckningarna. + + +* OM EMACS HÄNGER +----------------- + +Om Emacs slutar att reagera på kommandon kan du lugnt stoppa dem genom +att trycka C-g. Du kan också använda C-g för att stoppa ett kommando +som tar för lång tid att utföra. + +Det är också möjligt att använda C-g för att avbryta ett numeriskt +argument eller början på ett kommando som du inte önskar att utföra. + +>> Skriv C-u 100 för att ge ett numeriskt argument på 100 och tryck + C-g. Tryck nu C-f. Markören skall nu flytta sig bara ett steg, för att + du avbröt argumentet med C-g. + +Om du av misstag slår blir du kvitt detta med ett C-g. + + +* SPÄRRADE KOMMANDON +-------------------- + +En del Emacs-kommandon är "spärrade" så att nybörjare inte skall +använda dem av misstag. + +Om du provar ett av dessa spärrade kommandon kommer Emacs ge ett +meddelande som berättar vilket kommando det är och kommer att fråga om +du verkligen vill fortsätta och utföra detta kommando. + +Om du verkligen önskar att utföra kommandot trycker du mellanslag som +svar på frågan. Normalt, om du inte önskar att utföra detta kommando, +svarar du "n" på frågan. + +>> Skriv C-x n p (som är ett spärrat kommando). + Skriv n som svar på frågan. + + +* FÖNSTER +--------- + +Emacs kan ha flera fönster och varje fönster kan visa sin egen text. +Lägg märke till att "fönster" i Emacs inte refererar till separata +överlappande fönster i fönstersystemet, utan till separata delar i ett +enda X-fönster.(Emacs kan också ha flera X-fönster eller "ramar" i +Emacs-terminologi. Detta beskrivs senare.) + +Vi kommer förklara senare hur man använder flera fönster. Här skall vi +förklara hur man blir av med extra fönster för att komma tillbaka till +det grundläggande läget med endast ett fönster. Det är enkelt: + + C-x 1 Ett fönster (dvs. ta bort alla andra fönster). + +Det är KONTROLL-x följt av siffran 1. C-x 1 utvidgar fönstret där +markören står så att det fyller hela skärmbilden. Alla andra fönster +tas bort. + +>> Flytta markören till den här raden och tryck C-u 0 C-l. + +(Kom ihåg att C-l rensar skärmen och mittställer raden där markören +står. Om du ger ett numeriskt argument till detta kommando betyder det +"rensa skärmen och placera raden där markören står på raden som +argumentet anger". Därför betyder C-u 0 C-l att skärmen skall rensas +och raden där markören står placeras överst.) + +>> Skriv C-x 2. + Se hur det här fönstret krymper samtidigt som ett nytt uppträder + med samma innehåll som detta. + +>> Slå C-x 1 och se hur det nya fönstret nu försvinner. + + +* SKRIVA OCH TA BORT TEXT +------------------------- + +Om du önskar att sätta in text är det bara att skriva in +texten. Tecken som du kan se, så som A, 7, *, etc. tolkas som text och +sätts in direkt. Skriv (retur-tangenten) för att sätta in en +radbrytning. + +Du kan radera det sista tecknet du skrev genom att trycka . + är en tangent på tangentbordet, som kan vara märkt "Del". I +några fall fungerar också "backsteg" som men inte alltid! + +Generellt raderar tecknet precis före den aktuella +markörspositionen. + +>> Gör detta nu: Skriv in några tecken och ta bort dem genom att + använda . Var inte rädd för att skriva i den här filen, du + kommer inte att kunna förändra originalet till vägledningen. Detta + är bara en lokal kopia. + +När en rad blir för lång för att rymmas på en skärmbredd så fortsätter +den på raden under. Ett bakstreck ("\") (eller om du kör under ett +fönstersystem, en liten böjd pil) i slutet av högermarginalen +indikerar att raden fortsätter. + +>> Skriv in lite text så att du kommer till slutet av raden och + fortsätt att skriva lite till. Du kommer då att se hur + fortsättningstecknet ser ut. + +>> Använd för att radera texten tills raden ryms på en + skärmbredd igen. Fortsättningstecknet kommer då att försvinna. + +Du kan radera radbrytning precis som andra tecken. Genom att radera +radbrytningen mellan två rader slås dessa samman till en. Om +resultatet av denna sammanslagning blir för stor för att passa inom en +skärmbredd, så kommer den att visas med ett fortsättningstecken. + +>> Flytta markören till början av en rad och tryck . + Detta kommer att klistra ihop raden med raden över. + +>> Tryck för att sätta in radbrytningen du tog bort. + +Tänk på att de flesta Emacs-kommandon kan ta numeriska argument. Detta +gäller också texttecken. Genom att repetera ett texttecken kommer det +skrivas flera gånger. + +>> Prova det nu: Skriv C-u 8 * för att sätta in ********. + +Du har nu lärt dig de mest grundläggande sätten att skriva något i +Emacs och att rätta fel. Du kan radera ord och rader också. Här är en +översikt över kommandon för radering: + + raderar tecknet som står precis före markören + C-d raderar tecknet som står precis under markören + + M- raderar ordet precis före markören + M-d raderar ordet precis efter markören + + C-k raderar från markören till slutet av raden + M-k raderar till slutet av stycket + +Lägg märke till att och C-d kontra M- och M-d följer +mönstret som började med C-f och M-f. ( är inte precis +ett kontrolltecken men låt oss inte bry oss om det.) C-k och M-k +fungerar på samma sätt som C-e och M-e (nästan). + +När du raderar mer än ett tecken åt gången kommer Emacs att spara den +borttagna texten så att du han hämta tillbaka den igen. Denna text +kallas borttagen (killed). Att få tillbaka borttagen text kallas att +hämta den (yank). Du kan antingen hämta tillbaka borttagen text till +samma plats som den blev raderad eller också kan du sätta in den på en +annan plats i texten. Du kan också hämta tillbaka den flera gånger så +att du får flera lika förekomster av den. Kommandot för att hämta +tillbaka texten är C-y. + +Skillnaden mellan att "ta bort" (killing) och "radera" (deleting) text +är att "borttagen" text kan hämtas tillbaka, medan raderad text inte +kan det. Återinsättning av borttagen text kallas "återhämtning" +(yanking). Generellt kan man säga att kommandon som tar bort fler än +ett tecken sparar undan texten (så att den kan återhämtas) medan +kommandon som bara raderar ett tecken eller tomma rader och mellanrum +inte sparar någonting (och den texten kan alltså inte återhämtas). + +>> Flytta markören till början av en rad som inte är tom. + Tryck C-k för att ta bort texten på raden. +>> Tryck C-k en gång till. Du kommer nu se att den raderar den tomma + raden som var kvar. + +Lägg märke till att ett enstaka C-k bara raderar texten på raden och +att det andra C-k raderar själva raden och flyttar upp texten på raden +under ett steg. C-k hanterar numeriska argument lite speciellt. Den +raderar så många rader OCH innehållet i dem. Detta är alltså inte bara +en repetition av kommandot. C-u 2 C-k raderar två rader samt de tomma +raderna, medan C-k två gånger inte kommer att göra det. + +Kommandot för att hämta tillbaka text är C-y. Kommandot hämtar +tillbaka den sist borttagna texten och placerar den där markören är. + +>> Prova: Gör C-y för att få tillbaka texten. + +Tänk på C-y som om du rycker, eller drar, tillbaka något som någon +tagit ifrån dig. Notera att om du gör flera C-k i rad så kommer all +bortagen text att sparas samlat så att ett C-y återhämtar alla raderna +på en gång. + +>> Prova detta. Tryck C-k ett par gånger. + +Och hämta så tillbaka igen: + +>> Tryck C-y. Flytta markören några rader ned och tryck C-y igen. + Så kopierar man text. + +Men vad gör du om du har en text du önskar att hämta tillbaka men du +har redan tagit bort något nytt? C-y skulle hämta tillbaka den senaste +texten som blev borttagen men tidigare bortagen text är inte +förlorad. Du kan få tillbaka den med kommandot M-y. Efter att du har +använt C-y för att hämta tillbaka den sist borttagna texten kommer M-y +ersätta denna text med tidigare borttagen text. Genom att göra M-y om +och om igen hämtas allt tidigare borttagen text tillbaka. När du har +nått den önskade texten behöver du inte göra något ytterligare för att +behålla den. Fortsätt bara med din redigeringen och lämna den +återtagna texten där den är. + +Om du gör M-y tillräckligt många gånger kommer du att komma tillbaka +till startpunkten (texten som sist blev borttagen). + +>> Ta bort en rad, flytta markören till en ny rad och ta bort även + denna rad. Använd C-y för att hämta tillbaka den sista raden. Tryck + M-y för att byta den mot den tidigare borttagna raden. Tryck flera + M-y och se vad du får. Fortsätt med detta tills du får tillbaka den + första raden igen och sedan några gånger till. Om du vill kan du + prova med positiva och negativa argument till M-y. + + +* ÅNGRA +------- + +Om du gör en förändring i texten och sedan ångrar dig, så kan du +upphäva ändringen med kommandot C-x u (undo). + +Normalt kommer C-x u upphäva förändringen som gjordes av det sist +utförda kommandot. Om du repeterar C-x u flera gånger kommer varje +repetition upphäva ett kommando till. + +Det finns två undantag. Kommandon som inte förändrar texten räknas +inte (detta inkluderar markörförflyttningar och bläddringskommandon), +och inskrivna enkelbokstäver blir vanligtvis grupperade i grupper om +upp till 20 tecken. Detta är för att reducera antalet C-x u som behövs +för att ångra inskriven text. + +>> Ta bort den här raden med C-k. C-x u kommer att hämta tillbaka den + igen. + +C-_ är ett alternativ till ångra-kommandot. Den fungerar på samma sätt +som C-x u men är enklare att trycka flera gånger i följd. Det +olämpliga med C-_ är att den är svår att hitta på en del tangentbord. +Det är därför vi också har C-x u. På en del terminaler kan du få fram +C-_ genom att trycka / samtidigt som Ctrl hålls nere. + +Ett numeriskt argument till C-_ eller C-x u medför repetering. + +Du kan ångra radering av text precis på samma sätt som du kan ångra +att du tagit bort text. Skillnaden mellan att ta bort och att radera +någonting påverkar endast om du kan hämta tillbaka det med C-y. För +ångerfunktionen spelar det ingen roll hur texten försvunnit. + + +* FILER +------- + +För att texten du har förändrat skall sparas permanent måste du lägga +den i en fil. Om du inte gör det kommer texten att försvinna när du +avslutar Emacs. Du lägger texten i en fil genom att först finna (find) +denna fil. Detta kallas också för att besöka filen (visit). + +Att finna en fil innebär att du ser filens innehåll i Emacs. På många +sätt är det som om du förändrar själva filen men förändringen du gör +kommer inte bli permanent förrän filen sparas (save). Detta är för att +undvika att halvförändrade filer sparas när du inte vill det. Till och +med när du sparar filen kommer Emacs att behålla originalet under ett +nytt namn, som backup, ifall du senare ångrar alltihop. + +Om du tittar nästan längst ner på skärmbilden så kommer du se en rad +som börjar och slutar med minustecken, och som innehåller texten +"--:-- TUTORIAL.se". Denna del av skärmbilden visar alltid namnet på +filen du besöker. Just nu är du inne i en fil som heter "TUTORIAL.se" +och som är en personlig kopia av vägledningen till Emacs. Vilken fil +du än är inne i så kommer filnamnet stå där. + +Kommandot för att finna filer och spara filer skiljer sig lite från +andra kommandon du har lärt dig eftersom de består av två tecken. +Bägge startar med tecknet KONTROLL-x. Det är faktisk många kommandon +som startar med KONTROLL-x och många av dem har med filer, skärmbilder +och liknande saker att göra. Dessa kommandon är två, tre eller fyra +tecken långa. + +En annan sak med kommandot för att finna filer är att du måste ange +vilket filnamn du önskar. Vi säger att kommandot "läser ett argument +från terminalen". I detta fall är argumentet namnet på filen. Efter +att du gett kommandot + + C-x C-f Finn en fil + +kommer Emacs fråga efter ett filnamn. Filnamnet du skriver syns på den +nedersta raden i skärmbilden. Denna sista rad kallas minibuffert när +den används på det här sättet. Du kan använda vanliga Emacs-kommandon +för att förändra filnamnet. + +När du skriver in filnamnet, eller något annat i minibufferten, kan du +avbryta med kommandot C-g. + +>> Skriv C-x C-f och så C-g. Detta avbryter minibufferten och + avbryter också C-x C-f kommandot som använde minibufferten. Så att + du inte finner någon fil. + +När du är färdig med att skriva filnamnet trycker du för att +utföra kommandot. Då kommer C-x C-f kommandot att börja leta fram +filen. Minibufferten försvinner när C-x C-f kommandot är färdigt. + +Efter en liten stund kommer filen upp på skärmen och du kan börja +redigera innehållet. När du vill spara filen kan du använda detta +kommando + + C-x C-s Spara fil + +Detta sparar texten på skärmen till filen. Första gången detta görs +kommer Emacs att ge originalfilen ett nytt namn så att den inte går +förlorad. Det nya filnamnet bildas genom att lägga till ett "~" i +slutet av det ursprungliga filnamnet. + +När lagringen är utförd kommer Emacs skriva ut namnet på filen som +blev sparad. Du bör spara ofta så att du inte förlorar så mycket om +systemet kraschar. + +>> Skriv C-x C-s för att spara en kopia av denna vägledning. + Detta skall leda till att "Wrote ...TUTORIAL.se" skrivs ut nederst + på skärmbilden. + +Observera: På vissa system leder C-x C-s till att skärmen låser +sig. Detta tyder på att systemet har "flödeskontroll" och att denna +har fångat C-s och inte skickat den vidare till Emacs. För att +fortsätta måste du trycka C-q. Se i så fall i avsnittet "Spontaneous +Entry to Incremental Search" i Emacs-manualen för att få tips på hur +detta kan undvikas. + +Du kan finna en existerande fil, antingen för att förändra den eller +för att titta på den. Du kan också finna en fil som inte existerar. +Det är så man skapar nya filer med Emacs: finn filen, som är tom till +att börja med, och sätt igång med att skriva texten som skall in i +filen. Först när du sparar filen kommer Emacs att verkligen skapa +filen med den text du har skrivit. Från och med detta editerar du en +fil som existerar. + + +* BUFFERTAR +----------- + +Om du finner en ny fil med C-x C-f kommer den första filen fortsätta +att vara öppen i Emacs. Du kan byta tillbaka till den genom att finna +den på nytt med C-x C-f. På så sätt kan du ha ett stort antal filer +öppna i Emacs. + +>> Skapa en fil med namnet "foo" genom att trycka C-x C-f foo . + Skriv in lite text, redigera den och spara "foo" genom att använda + C-x C-s. Skriv till slut C-x C-f TUTORIAL.se för att komma + tillbaka till den här vägledningen. + +Emacs sparar texten för varje fil i ett objekt kallat "buffert". När +du finner en ny fil skapas en ny buffert i Emacs. För att se en lista +över existerande buffertar i Emacs kan du skriva + + C-x C-b Listning av buffertar. + +>> Prova C-x C-b nu. + +Se hur varje buffert har ett namn och att de också kan ha namnet på +den fil som innehållet kommer från. En del buffertar är inte knutna +till någon fil, till exempel bufferten "*Buffer List*". Det är den +buffert som innehåller buffertlistan som skapades med C-x C-b. Vilken +text du än ser i ett Emacs-fönster så tillhör den alltid en buffert. + +>> Skriv C-x 1 för att bli kvitt buffertlistan. + +Om du ändrar texten till en fil och sedan öppnar en ny fil, så kommer +inte den första filen sparas. Förändringen ligger kvar i +bufferten. Skapande och redigering av den nya filen påverkar inte den +första filens buffert. Detta kan vara bra men betyder också att du +behöver ett lämpligt sätt att spara den första filens buffert. Det är +omständligt att flytta tillbaka till den tidigare bufferten med C-x +C-f för att sedan spara filen med C-x C-s. Därför finns kommandot + + C-x s Spara buffertar + +C-x s frågar för varje buffert med ändringar, som inte sparats, om du +vill spara eller ej. + +>> Sätt in en rad med text och spara med C-x s + Du skall nu få frågan om du önskar spara bufferten + TUTORIAL.se. Svara ja på frågan genom att trycka "y" (yes). + + +* ANVÄNDNING AV MENYER +---------------------- + +Om du använder en X-terminal kommer du säkert att lägga märke till +menyerna på toppen av skärmbilden. Via dessa menyer får du tillgång +till de mest använda Emacs-kommandona, till exempel find-file +(Open...). Detta är enklast i början, när du inte känner till alla +tangenttryckningar som skall till för varje kommando. När du lärt +känna Emacs kommer det vara lättare att använda tangentbordet. +Tangentbordskombinationen står precis efter respektive menykommando. + +Lägg märke till att det är många menykommandon som inte har någon +tangentbordskombination. Ett exempel är buffertmenyn (Buffers), som +listar alla tillgängliga buffertar. Du kan enkelt byta till en buffert +genom att välja namnet på den i buffertmenyn. + + +* ANVÄNDNING AV MUSEN +--------------------- + +När du kör Emacs under X är det möjligt att använda musen. Du kan +placera markören genom att trycka på den vänstra musknappen vid önskad +position och du kan markera text genom att hålla ned vänstra +musknappen samtidigt som du flyttar markören över texten du vill +markera. Alternativt kan du klicka med vänster musknapp i den ena +änden av texten du önskar att markera, flytta muspekaren till den +andra änden och använd skiftklick (tryck med musknappen samtidigt som +skifttangenten trycks ned) för att markera texten. + +För att ta bort den markerade texten kan du använda kommandot C-w +eller välja "Klipp" (Cut) från redigeramenyn (Edit). Lägg märke till +att dessa *inte* är likvärdiga. C-w sparar bara texten internt i Emacs +(a`la C-k, som beskrivits tidigare), medan Klipp också lägger texten i +X klippbord, där den är tillgänglig även för andra applikationer. + +För att hämta text från klippbordet kan du använda "Klistra in" +(Paste) från redigeramenyn. + +Den mellersta musknappen används vanligen för att välja saker från +skärmen. Om du till exempel går in i Info (on-line dokumentationen +till Emacs) med C-h i eller via hjälpmenyn (Help), kan du följa +länkarna genom att trycka med den mellersta musknappen. Om du skriver +in ett filnamn (till exempel efter C-x C-f) och trycker TAB för att få +fram en fillistning, så kan du avsluta filnamnet genom att trycka ned +den mellersta musknappen på filnamnet. + +Genom att trycka med höger musknapp kan du få fram en popupmeny. +Innehållet i den menyn är beroende av vilket läge du är i och +vanligtvis innehåller den några av de mest använda kommandona så att +de blir lätt tillgängliga. + +>> Tryck på höger musknapp nu. + +Du måste hålla knappen nere för att menyn skall visas. + + +* UTVIDGNING AV KOMMANDOMÄNGDEN +------------------------------- + +Det finns mycket fler Emacs-kommandon än antalet KONTROLL- eller +META-tangenter. För att komma förbi denna begränsning har Emacs ett +"X"- (eXtend) kommando. Detta finns i två varianter: + + C-x Tecken-utvidgning. Följs av ett tecken. + M-x Namngiven kommandoutvidgning. Följs av ett + kommandonamn. + +Detta är kommandon som är bra att ha men används mer sällan än de +kommandon du redan har lärt dig. Du har redan sett två av dem, C-x C-f +för finn, och C-x C-s för spara. Ett annat exempel är kommandot för +att avsluta Emacs som är C-x C-c. Var inte rädd för att förlora +förändringar du har gjort. C-x C-c erbjuder dig att spara förändringar +innan Emacs avslutas. + +C-z är kommandot för att avsluta Emacs *tillfälligt* så att du kan +återvända till samma Emacs senare. + +På system som tillåter det kommer C-z suspendera Emacs, dvs. returnera +till kommandoraden utan att avsluta Emacs. I de flesta system kan du få +tillbaka Emacs med kommandot 'fg' eller '%emacs'. + +På system som saknar suspendering startar C-z ett skal som kör under +Emacs och som ger dig chansen till att köra andra program och sedan +återgå till Emacs efteråt. Den ger ingen riktig avslutning av Emacs. I +detta fall återvänder man vanligtvis till Emacs med kommandot 'exit'. + +C-x C-c används när du skall avsluta Emacs. Det är klokt att avsluta +Emacs om den har startats av ett mail-program eller andra +applikationer eftersom det inte är säkert att de kan hantera +suspendering av Emacs. Under normala omständigheter, om du inte har +tänkt att logga ut, är det bättre att suspendera Emacs med C-z +istället för att avsluta. + +Det finns många C-x kommandon. Här är en lista över de du har lärt dig +hittills: + + C-x C-f Finn fil. + C-x C-s Spara fil. + C-x C-b Lista buffertar. + C-x C-c Avsluta Emacs. + C-x 1 Ta bort alla utom ett fönster. + C-x u Ångra. + +Namngivna utvidgade kommandon är kommandon som används mycket sällan +eller bara i vissa lägen. Ett exempel på ett sådant kommando är +replace-string, som globalt ersätter en teckensträng med en annan. När +du skriver M-x kommer Emacs visa en prompt nederst i skärmbilden med +M-x där du skall skriva in kommandot du önskar att köra, i det här +fallet "replace-string". Det är bara att skriva "repl s" och +Emacs kommer då att fylla i kommandonamnet. ( är +tabulatortangenten, som vanligtvis finns över CapsLock- eller +skifttangenten nära den vänstra kanten på tangentbordet.) Avsluta +kommandot med . + +Kommandot replace-string kräver två argument, teckensträngen som skall +ersättas och teckensträngen som den skall ersättas med. Du måste +avsluta bägge argumenten med . + +>> Flytta markören till den blanka raden två rader under denna rad. + Skriv M-x repl sförändradändrad. + + Lägg märke till hur den här raden har blivit förändrad. Du har + ersatt ordet f-ö-r-ä-n-d-r-a-d med "ändrad" på alla platser där + ordet förekom, från markören och nedåt. + + +* SPARAUTOMATIK +--------------- + +När du har gjort förändringar i en fil men inte sparat den, så kommer +ändringarna att gå förlorade om maskinen kraschar. Som ett skydd mot +detta sparar Emacs periodiskt ändringarna i en autosparfil för varje +fil du redigerar. Denna fil har ett # i början och slutet av +filnamnet. Om du till exempel har en fil med namnet "hej.c" så kommer +namnet på autosparfilen bli "#hej.c#". När du sparar filen på vanlig +sätt kommer Emacs radera autosparfilen. + +Om maskinen kraschar kan du återfå dina automatiskt sparade ändringar +genom att finna filen på vanlig sätt (filen du redigerade, inte +autosparfilen) och skriva M-x recover-file. När Emacs vill ha +bekräftelse svarar du yes för att återställa filen. + + +* EKOOMRÅDE +----------- + +Om Emacs ser att du skriver kommandon långsamt så kommer de att visas +på den nedersta raden i skärmbilden i ett område som kallas +"ekoområde" (echo area). Detta område innehåller den nedersta raden på +skärmbilden. + + +* LÄGESRADEN +------------ + +Raden precis över ekoområdet kallas "lägesrad" (modeline). Den ser +ungefär ut så här: + +--:** TUTORIAL (Fundamental)--L670--58%---------------- + +Raden innehåller information om Emacs och texten du redigerar. + +Du vet redan vad filnamnet betyder, det är den fil du har funnit. +-NN%-- visar den aktuella positionen i texten, dvs. NN procent av +texten befinner sig över toppen av skärmbilden. Om toppen av filen är +i skärmbilden kommer det stå --Top-- istället för --00%-- och om +slutet av filen är i skärmbilden kommer det stå --Bot--. Om du ser på +en fil där hela texten passar in på en sida kommer det stå --All--. + +Bokstaven L följd av siffror anger positionen på ett annat +sätt. Siffrorna visar vilken rad som markören befinner sig på. + +Stjärnorna nära början av raden visar att det har skett förändringar i +filen sedan den sist blev sparad. När du precis har öppnat en fil +kommer det inte stå något här, bara minustecken. + +Den del av lägesraden som står inom parentes visar vilket +redigeringsläge (mode) du använder. Standardläget är "Fundamental", +som du använder nu. Det är ett exempel på ett huvudläge (major mode). + +Emacs har många olika huvudlägen. Några av dem är gjorda för +redigering av olika programmeringsspråk eller typer av text, till +exempel Lisp mode och Text mode. Det kan bara vara ett huvudläge åt +gången och lägesnamnet står alltid där det står Fundamental nu. + +Varje huvudläge gör att en del kommandon uppför sig annorlunda. Det +finns till exempel kommandon för att sätta in kommentarer i programkod +och eftersom varje programmeringsspråk har sitt sätt att skriva +kommentarer på så måste de olika huvudlägena sätta in dessa +kommentarer på olika sätt. Varje huvudläge namnger ett utvidgat +kommando som används för att byte till det läget. Till exempel är M-x +fundamental-mode kommandot för att byta till huvudläget Fundamental. + +Om du skall redigera text, såsom den här filen, bör du troligen +använda Text-läge. + +>> Skriv M-x text mode. + +Inget av kommandona du har lärt dig hittills förändrar Emacs i någon +högre grad. Men lägg märke till att M-f och M-b nu behandlar +apostrofer som en del av ord. Tidigare, i Fundamental mode, behandlade +M-f och M-b apostrofer som ordavskiljare. + +Varje huvudläge gör vanligtvis små förändringar som denna och de flesta +kommandon gör samma sak i varje huvudläge, de fungerar bara lite +annorlunda. + +För att få fram dokumentationen för det läge du är i nu kan du skriva +C-h m. + +>> Använd C-u C-v så att denna rad kommer nära toppen av + skärmbilden. +>> Skriv C-h m och se hur Text-läget skiljer sig från + Fundamental-läget. +>> Tryck q för att ta bort dokumentationen från skärmbilden. + +Huvudläge kallas så för att det även finns sidolägen (minor mode). +Ett sidoläge ersätter inte ett huvudläge, utan modifierar det. Varje +sidoläge kan stängas av och på oberoende av andra sidolägen och +oberoende av huvudläget. Därför kan du använda ett sidoläge, en +kombination av flera sidolägen eller inget sidoläge alls. + +Ett bra sidoläge, speciellt för redigering av text, är +radbrytningsläget (auto-fill-mode). När detta läge är på bryter Emacs +rader mellan ord automatisk när du skriver in text så att en rad blir +för lång. + +Du kan slå på radbrytningsläget genom att skriva M-x auto fill +mode. När läget är påslaget kan du slå av det igen genom att +upprepa M-x auto fill mode. Om läget är avslaget slår +kommandot på det och vice versa. Vi säger att kommandot "växlar +läget". + +>> Skriv M-x auto fill mode nu. Skriv så in en rad med + "asdf " tills raden delar sig. Du måste sätta in blanktecken, för + Auto Fill bryter bara raden mellan ord. + +Marginalen är vanligtvis satt till 70 tecken men du kan ändra detta +genom att använda kommandot C-x f. Antalet tecken ges till kommandot +genom ett numeriskt argument. + +>> Skriv C-x f med ett argument på 20. (C-u 2 0 C-x f). Skriv sedan in + någon text och lägg märke till att Emacs bryter rader som är längre + än 20 tecken. Sätt tillbaka marginalen till 70 tecken igen, genom + att använda C-x f en gång till. + +Om du gör förändringar mitt i en rad så kommer inte sidoläget Auto +Fill att kunna omformattera raderna för dig. +För att göra detta kan du trycka M-q med markören inne i det avsnittet +du önskar att omformatera. + +>> Flytta markören in i föregående stycke och tryck M-q. + + +* SÖKNING +--------- + +Emacs kan söka efter textsträngar (grupper med sammanhängande +bokstäver eller ord) antingen framåt eller bakåt i texten. När du +söker efter text kommer markören att flytta sig till nästa plats där +teckensträngen uppträder. + +Sökmetoden i Emacs skiljer sig lite från sökmetoder i andra +redigeringsprogram genom att den är inkrementell. Detta betyder att +sökandet fortgår medan du skriver in teckensträngen du skall söka +efter. + +Kommandot för att inleda en sökning är C-s för att söka framåt och C-r +för att söka bakåt. MEN VÄNTA! Prova dem inte än. + +När du skriver C-s kommer du lägga märke till att texten "I-search" +dyker upp i eko-området. Detta säger dig att Emacs är inne i sidoläget +inkrementell sökning och väntar på att du skall skriva in det du letar +efter. avslutar sökandet. + +>> Skriv nu C-s för att starta en sökning. Skriv nu långsamt, en + bokstav i taget, ordet 'markör', och gör en paus efter varje gång + du skriver en bokstav så att du ser vad som sker med markören. Nu + har du sökt efter ordet "markör" en gång. +>> Skriv C-s en gång till för att söka efter nästa förekomst av ordet + "markör". +>> Tryck nu på fyra gånger och se hur markören flyttar sig +>> Tryck för att avsluta sökandet. + +Såg du vad som hände? Under inkrementell sökning försöker Emacs att gå +till den första förekomsten av texten som du har skrivit så långt, och +markerar träffen så att du ser var den är. För att gå till nästa +förekomst av ordet 'markör' är det bara att trycka C-s en gång till. +Om det inte finns flera förekomster kommer Emacs att pipa och meddela +att sökandet har misslyckats. C-g avbryter också sökandet. + +Observera: På vissa system gör C-s att skärmen låser sig. Detta tyder +på att systemets flödeskontroll har fångat upp C-s och inte skickat +den vidare till Emacs. För att fortsätta måste du trycka C-q. Se i så +fall avsnittet "Spontaneous Entry to Incremental Search" i +Emacs-manualen för råd om hur detta kan undvikas. + +Om du är inne i en inkrementell sökning och trycker kommer du +lägga märke till att den sista bokstaven i söksträngen blir raderad +och sökandet hoppar tillbaka till en tidigare förekomst. Om du till +exempel skriver "m" för att söka efter den första förekomsten av "m", +och sedan trycker "a" så kommer markören flytta sig till första +förekomsten av "ma". Tryck nu . Detta avlägsnar "a" från +söksträngen, och markören flyttar sig tillbaka till den första +förekomsten av "m". + +Om du är mitt i en sökning och trycker ett KONTROLL- eller META-tecken +så avbryts sökandet. Undantag är tecken som används under sökningen, +så som C-s och C-r. + +C-s startar en sökning som letar efter varje förekomst av söksträngen +EFTER markörspositionen. Om du skall söka efter en sträng tidigare i +texten måste du använda C-r. Allt vi har sagt om C-s gäller också för +C-r, bortsett från att riktningen på sökningen är den omvända. + + +* FLERA FÖNSTER +--------------- + +En av egenskaperna hos Emacs är att den kan visa mera än en buffert på +skärmen samtidig. + +>> Flytta markören till den här raden och tryck C-u 0 C-l (alltså + KONTROLL-L, inte KONTROLL-1). + +>> Skriv nu C-x 2, som leder till att skärmen delas i två + fönster. Bägge fönstren visar den här vägledningen. Markören står i + det övre fönstret. + +>> Skriv C-M-v för att rulla det nedre fönstret. + (Om du inte har META-tangenten trycker du ESC C-v.) + +>> Skriv C-x o (o för other) för att flytta markören till det + nedre fönstret. + +>> Använd C-v och M-v i det nedre fönstret för att flytta upp + och ned i texten. Fortsätt att läsa den här texten i det övre + fönstret. + +>> Skriv C-x o igen för att flytta markören tillbaka till det övre + fönstret. Markören i det övre fönstret står på samma plats som det + gjorde när du lämnade det. + +Du kan fortsätta att använda C-x o för att byta mellan de två +fönstren. Vart och ett av fönstren har sin egen markörposition men det +är bara ett av fönstren som visar den. Alla redigeringskommandon +fungerar i det fönster där markören är synlig. Vi kallar detta fönster +för det valda fönstret (selected window). + +Kommandot C-M-v är bra när du redigerar text i ett fönster och +använder det andra fönstret för referenser. Då kan du kan ha markören +i samma fönster hela tiden och du kan använda C-M-v för att flytta dig +i det andra fönstret. + +C-M-v är ett exempel på en KONTROLL-META-kombination. Om du har +META-tangenten håller du både KONTROLL och META nedtryckt samtidigt +som du trycker v. Det har ingen betydelse vilken av tangenterna +KONTROLL och META som trycks först, för bägge fungerar så att de +"modifierar" de andra tangenterna du trycker. + +Om du inte har META-tangenten och använder ESC istället är +ordningsföljden viktig. Du måste trycka ESC följt av KONTROLL-v, +KONTROLL-ESC v fungerar inte. Det är för att ESC är ett tecken i sig +och inte en äkta "modifierare". + +>> Skriv C-x 1 i det övre fönstret för att bli kvitt det nedre + fönstret. + +Om du hade skrivit C-x 1 i det nedre fönstret skulle det övre ha +försvunnit. Tänk på detta kommando som "Behåll bara ett fönster, det +som markören står i." + +Du måste inte ha samma buffert i bägge fönstren. Du kan använda C-x +C-f för att finna en ny fil i ett av fönstren samtidigt som det andra +fönstret förblir oförändrat. Du kommer att märka att fönstren är helt +oberoende. + +Här är ett annat sätt att använda två fönster till att visa två olika +filer: + +>> Skriv C-x 4 C-f följt av ett filnamn. Avsluta med . + Den nya filen kommer då att dyka upp i det nedre fönstret. + Markören flyttats också dit. + +>> Skriv C-x o för att gå tillbaka till det övre fönstret och C-x + 1 för att bli kvitt det nedre igen. + + +* REKURSIVA REDIGERINGSNIVÅER +----------------------------- + +Ibland kan du hamna i något som kallas "rekursiv redigering" +(recursive editing level). Detta indikeras med hakparenteser runt +huvudläget i lägesraden. Till exempel kan det stå [(Fundamental)] +istället för (Fundamental). + +För att komma ur rekursiv redigering trycker du ESC ESC ESC. Detta är +ett generellt brytkommando. Du kan också använda det för att bli kvitt +extra fönster och för att komma ut ur minibufferten. + +>> Skriv M-x för att komma in i minibufferten. Skriv så ESC ESC ESC + för att komma ut. + +Du kan inte använda C-g för att komma ut ur rekursiv redigering. +Detta är för att C-g används för att avbryta kommandon och argument +under rekursiv redigering. + + +* MER HJÄLP +----------- + +I denna vägledning har vi försökt inkludera precis så mycket +information att du kan börja använda Emacs. Det finns så många +möjligheter i Emacs att det skulle vara omöjligt att förklara alla +här. Men du VILL säkert lära dig mer om Emacs eftersom den har många +goda egenskaper. Emacs tillhandahåller kommandon för att läsa all +dokumentation. Dessa hjälpkommandon startas med teckenkombinationen +C-h. + +För att använda hjälpen skriver du C-h följt av ett tecken för den +hjälp du behöver. Om du verkligen är helt villrådig kan du trycka C-h +? för att Emacs skall visa vilken hjälp som finns tillgänglig. Om du +har skrivit C-h och bestämmer dig för att du inte behöver ha någon +hjälp kan du trycka C-g för att avbryta. + +(På vissa platser är C-h omkonfigurerad. Det är normalt ingen bra ide´, +så du kan på goda grunder klaga hos systemadministratören. Under +tiden, om C-h inte visar ett hjälpmeddelande längst ner på skärmen, +kan du i stället försöka med funktionstangenten F1 eller M-x +help.) + +Den mest grundläggande hjälp-funktionen är C-h c. Skriv C-h, ett "c" +och en knappsekvens. Emacs ger då en beskrivning av kommandot. + +>> Skriv C-h c C-p. + Meddelandet skall då bli något i stil med + + C-p runs the command previous-line + +Detta ger ett funktionsnamn. Funktionsnamnen används huvudsakligen för +att specialanpassa och utvidga Emacs. Men eftersom funktionerna har +beskrivande namn kan de också fungera som en enkel dokumentation, +tillräckligt för att påminna dig om kommandon du redan lärt dig. + +Flerteckenskommandon, så som C-x C-s och (om du inte har META, EDIT +eller ALT tangenten) v, är också tillåtna efter C-h c. + +För att få mer information om ett kommando kan du använda C-h k +istället för C-h c. + +>> Skriv C-h k C-p. + +Detta kommer visa funktionens dokumentation och namn i ett eget +fönster. För att avsluta hjälpfönstret kan du trycka q. Du behöver +inte göra det omedelbart. Du kan editera med hjälptexten som stöd för +att först senare ta bort fönstret med q. + +Här är fler varianter på C-h: + + C-h f Beskriv en funktion. Du skriver in funktionsnamnet. + +>> Prova att skriva C-h f previous-line. + Detta ger den information Emacs har om funktionen + som implementerar kommandot C-p. + + C-h a Apropos. Listar alla funktioner och variabler som + innehåller söksträngen. Kommandon som startas med M-x + markeras med en stjärna (*) till vänster om + funktionsnamnet. + +>> Skriv C-h a newline. + +Detta ger en lista över alla funktioner och variabler där "newline" +ingår i namnet. Du kan trycka eller klicka med den mellersta +musknappen för att hitta mer information om en funktion eller +variabel. Tryck q för att avsluta. + + +* TILL SIST +----------- + +Tänk på att använda C-x C-c för att avsluta Emacs permanent. För att +tillfälligt gå till ett skal, så att du senare kan komma tillbaka +igen, använd C-z. (Under X kommer detta att minimera Emacs.) + +Denna vägledningen är avsedd för nya användare, om det är något som är +oklart duger det inte att sitta och tycka synd om sig själv -- Skicka +ett mail och klaga! + + +* KOPIERING +----------- + +Denna vägledning härstammar från en hel rad Emacs-vägledningar och den +första skrevs av Stuart Cracraft för den ursprungliga Emacs. Ben Wing +uppdaterade vägledningen för X Windows. Martin Buchholz och Hrvoje +Niksic lade till mer ändringar för XEmacs och Mats Lidell översatte +den till Svenska. + +This version of the tutorial, like GNU Emacs, is copyrighted, and +comes with permission to distribute copies on certain conditions: + +Copyright (c) 1985, 1996 Free Software Foundation + + Permission is granted to anyone to make or distribute verbatim copies + of this document as received, in any medium, provided that the + copyright notice and permission notice are preserved, + and that the distributor grants the recipient permission + for further redistribution as permitted by this notice. + + Permission is granted to distribute modified versions + of this document, or of portions of it, + under the above conditions, provided also that they + carry prominent notices stating who last altered them. + +The conditions for copying Emacs itself are more complex, but in the +same spirit. Please read the file COPYING and then do give copies of +GNU Emacs to your friends. Help stamp out software obstructionism +("ownership") by using, writing, and sharing free software! diff --git a/etc/package-index.LATEST.pgp b/etc/package-index.LATEST.pgp index 46b7e8d..a980601 100644 --- a/etc/package-index.LATEST.pgp +++ b/etc/package-index.LATEST.pgp @@ -1,549 +1,109 @@ ;; Package Index file -- Do not edit manually. ;;;@@@ (package-get-update-base-entry (quote -(ess - (standards-version 1.1 - version "1.02" - author-version "5.1.21" - date "2002-06-04" - build-date "2002-06-04" - maintainer "A.J. Rossini " - distribution xemacs - priority medium - category "standard" - dump nil - description "ESS: Emacs Speaks Statistics." - filename "ess-1.02-pkg.tar.gz" - md5sum "3eff981706623221b5af048dc8a00f17" - size 469304 - provides (ess-batch ess-comp ess-cust ess-dump ess-emcs ess-font-lock ess-help ess-inf ess-iw32 ess-latex-mode ess-menu ess-mode ess-mous ess-noweb ess-site ess-sysdp ess-utils ess-vars ess essa-r essa-sas essd-arc essd-els essd-r essd-omg essd-r essd-s3 essd-s4 essd-sas essd-sp3 essd-sp4 essd-sp5 essd-sp6 essd-sta essd-vst essd-xls essddr essdsp6w essl-bug essl-lsp essl-omg essl-py essl-s essl-sas essl-sta make-regexp mouseme msdos noweb-font-lock-mode noweb-mode) - requires (xemacs-base mail-lib fsf-compat edit-utils) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(haskell-mode - (standards-version 1.1 - version "1.03" - author-version "1.43" - date "2002-05-07" - build-date "2002-05-07" - maintainer "Ville Skyttä " - distribution xemacs - priority low - category "standard" - dump nil - description "Haskell editing support." - filename "haskell-mode-1.03-pkg.tar.gz" - md5sum "c734831433d7330094064fe3959d94f1" - size 91983 - provides (haskell-decl-scan haskell-doc haskell-font-lock haskell-indent haskell-mode haskell-simple-indent) - requires (dired mail-lib xemacs-base edit-utils) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(xslide - (standards-version 1.1 - version "1.01" - author-version "0.2" - date "2002-03-25" - build-date "2002-03-26" - maintainer "Ville Skyttä " - distribution xemacs - priority medium - category "standard" - dump nil - description "XSL editing support." - filename "xslide-1.01-pkg.tar.gz" - md5sum "8f23eb3d45f7c2ca2f6024c3771a6d80" - size 35451 - provides (xslide-abbrev xslide-data xslide-font xslide-process xslide) - requires (ispell mail-lib xemacs-base) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(liece - (standards-version 1.1 - version "1.07" - author-version "1.4.7" - date "2002-07-14" - build-date "2002-07-14" - maintainer "Daiki Ueno " - distribution xemacs - priority high - category "standard" - dump nil - description "IRC (Internet Relay Chat) client for Emacs." - filename "liece-1.07-pkg.tar.gz" - md5sum "10a70f816b57757a6dc58b29f342881f" - size 197755 - provides (liece-xemacs gettext liece-clfns liece-handler liece-compat liece-version liece-vars liece-globals liece-inlines liece-filter liece-coding liece-dcc liece-menu liece-000 liece-200 liece-300 liece-400 liece-500 liece-nick liece-channel liece-commands liece-ctcp liece-q-el liece-message liece-handle liece-hilit liece-intl liece-mail liece-minibuf liece-misc liece-tcp liece-url liece-x-face liece-window liece) - requires (apel mail-lib fsf-compat xemacs-base) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(latin-unity - (standards-version 1.1 - version "1.05" - author-version "1.05" - date "2002-05-07" - build-date "2002-05-07" - maintainer "Stephen J. Turnbull " - distribution mule - priority high - category "mule" - dump nil - description "MULE: find single ISO 8859 character set to encode a buffer." - filename "latin-unity-1.05-pkg.tar.gz" - md5sum "fc968dc2682d52ab37634e22028d8598" - size 86755 - provides (latin-unity latin-unity-tables latin-unity-utils) - requires (mule-base mule-ucs leim fsf-compat) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(mmm-mode - (standards-version 1.1 - version "1.00" - author-version "0.4.7" - date "2002-02-24" - build-date "2002-02-28" - maintainer "XEmacs Development Team " - distribution xemacs - priority medium - category "standard" - dump nil - description "Multiple major modes in a single buffer" - filename "mmm-mode-1.00-pkg.tar.gz" - md5sum "c07c752ffd029d9a430c2fb118127e88" - size 176080 - provides (mmm-auto mmm-class mmm-cmds mmm-compat mmm-mason mmm-mode mmm-region mmm-rpm mmm-sample mmm-univ mmm-utils mmm-vars) - requires (xemacs-base fsf-compat ) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(ibuffer - (standards-version 1.1 - version "1.08" - author-version "21.5b6" - date "2002-07-14" - build-date "2002-07-14" - maintainer "John Paul Wallington " - distribution xemacs +(ediff + (standards-version 1.0 + version "1.19" + author-version "2.72" + date "1999-04-06" + build-date "1999-05-13" + maintainer "Michael Kifer " + distribution stable priority medium - category "standard" - dump nil - description "Advanced replacement for buffer-menu" - filename "ibuffer-1.08-pkg.tar.gz" - md5sum "e7203eeeca98a89c2bfe051d81c729de" - size 87113 - provides (ibuf-ext ibuf-macs ibuffer) - requires (ibuffer xemacs-base) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(xemacs-base - (standards-version 1.1 - version "1.66" - author-version "21.5b6" - date "2002-07-14" - build-date "2002-07-14" - maintainer "XEmacs Development Team " - distribution xemacs - priority high - category "standard" - dump nil - description "Fundamental XEmacs support, you almost certainly need this." - filename "xemacs-base-1.66-pkg.tar.gz" - md5sum "108cb98a37dd6270618b942e0fe97b48" - size 464634 - provides (add-log advice-preload 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 passwd pp regexp-opt regi ring shell skeleton sort thing time-stamp timezone tq xbm-button xpm-button) - requires () - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(tramp - (standards-version 1.1 - version "1.05" - author-version "2002-02-18" - date "2002-04-24" - build-date "2002-04-24" - maintainer "Kai Großjohann " - distribution xemacs - priority low - category "standard" - dump nil - description "Remote shell-based file editing." - filename "tramp-1.05-pkg.tar.gz" - md5sum "a0c020f425b6344ea0c133dc26e7f689" - size 136196 - provides (tramp tramp-util tramp-vc trampcache) - requires (tramp xemacs-base vc fsf-compat efs dired mail-lib gnus) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(text-modes - (standards-version 1.1 - version "1.48" - author-version "21.5b6" - date "2002-06-27" - build-date "2002-06-27" - maintainer "XEmacs Development Team " - distribution xemacs - priority high - category "standard" + category "prog" dump nil - description "Miscellaneous support for editing text files." - filename "text-modes-1.48-pkg.tar.gz" - md5sum "f2df17af03a7f47e3b2e7b970d0b9f0b" - size 345796 - provides (ansi-color autoinsert crontab-edit filladapt flyspell folding fold-isearch hexl htmlize image-mode iso-acc iso-ascii iso-cvt iso-insert iso-swed rtf-support swedish tabify whitespace-mode winmgr-mode xpm-mode xrdb-mode apache-mode po-mode css-mode) - requires (ispell fsf-compat xemacs-base) + description "Interface over GNU patch." + filename "ediff-1.19-pkg.tar.gz" + md5sum "d6e0edc88c5d09279df71ce9aff41b25" + size 281804 + provides (ediff) + requires (pcl-cvs elib dired xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote -(pcl-cvs - (standards-version 1.1 - version "1.63" - author-version "R-2_9_9" - date "2002-06-04" - build-date "2002-06-04" +(hm--html-menus + (standards-version 1.0 + version "1.12" + author-version "5.9" + date "1999-02-05" + build-date "1999-02-05" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" - dump nil - description "CVS frontend." - filename "pcl-cvs-1.63-pkg.tar.gz" - md5sum "87b7a9ebd1aa6d24ee4c3c0ff914daad" - size 161146 - provides (cvs-compat cvs-edit cvs-log cvs-status easy-mmode pcl-cvs-defs pcl-cvs-info pcl-cvs-parse pcl-cvs-util pcl-cvs) - requires (xemacs-base elib vc dired edebug ediff edit-utils mail-lib prog-modes) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(mail-lib - (standards-version 1.1 - version "1.47" - author-version "21.5b6" - date "2002-07-14" - build-date "2002-07-14" - maintainer "Simon Josefsson " - distribution xemacs - priority medium - category "standard" + category "oa" dump nil - description "Fundamental lisp files for providing email support." - filename "mail-lib-1.47-pkg.tar.gz" - md5sum "3cba556078ece30b7538ade56e138041" - size 186598 - provides (base64 browse-url-xemacs browse-url highlight-headers mail-abbrevs mail-extr mail-utils mailheader netrc pop3 reporter rfc2104 rfc822 rmail rmail-mini rmailout sendmail smtpmail starttls) - requires (eterm xemacs-base fsf-compat sh-script) + description "HTML editing." + filename "hm--html-menus-1.12-pkg.tar.gz" + md5sum "fc80ef260cc0682bde6e706cdc8ddae4" + size 177442 + provides (adapt hm--date hm--html-configuration hm--html-drag-and-drop hm--html-indentation hm--html-keys hm--html-menu hm--html-mode hm--html-not-standard hm--html html-view tmpl-minor-mode) + requires (dired xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (jde - (standards-version 1.1 - version "1.35" - author-version "2.2.8" - date "2002-05-09" - build-date "2002-05-10" - maintainer "Paul Kinnucan " - distribution xemacs + (standards-version 1.0 + version "1.14" + author-version "2.14" + date "1999-02-05" + build-date "1999-02-05" + maintainer "Andy Piper " + distribution stable priority medium - category "standard" + category "prog" dump nil description "Java language and development support." - filename "jde-1.35-pkg.tar.gz" - md5sum "b0289c057ce2a0d95c417409f5f17ba4" - size 1635420 + filename "jde-1.14-pkg.tar.gz" + md5sum "1028c54ef317d8dd4d4c78e5b9c004e6" + size 320702 provides (jde) - requires (jde cc-mode semantic debug speedbar edit-utils eterm mail-lib xemacs-base xemacs-devel eieio elib sh-script fsf-compat) + requires (cc-mode debug speedbar edit-utils mail-lib xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote -(fsf-compat - (standards-version 1.1 - version "1.11" - author-version "21.5b5" - date "2002-03-25" - build-date "2002-03-25" - maintainer "XEmacs Development Team " - distribution xemacs - priority high - category "standard" - dump nil - description "FSF Emacs compatibility files." - filename "fsf-compat-1.11-pkg.tar.gz" - md5sum "5616165f4aa5bf4a45982e9185851d22" - size 21263 - provides (overlay thingatpt timer x-popup-menu) - requires (xemacs-base) - type single -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(edit-utils - (standards-version 1.1 - version "1.89" - author-version "21.5b6" - date "2002-06-27" - build-date "2002-06-27" - maintainer "XEmacs Development Team " - distribution xemacs - priority high - category "standard" - dump nil - description "Miscellaneous editor extensions, you probably need this." - filename "edit-utils-1.89-pkg.tar.gz" - md5sum "b7d94a10cda4795bbb759e0ee88ae86e" - size 650996 - provides (abbrevlist after-save-commands 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 makesum man mic-paren paren mode-motion+ outl-mouse outln-18 page-ext blink-paren paren permanent-buffers popper power-macros recent-files redo reportmail resume rsz-minibuf saveconf savehist saveplace scroll-in-place setnu shell-font tempo toolbar-utils tree-menu uniquify vertical-mode where-was-i-db winring) - requires (xemacs-base fsf-compat dired mail-lib) - type single -)) -)) -;;;@@@ -(package-get-update-base-entry (quote (skk - (standards-version 1.1 - version "1.22" - author-version "10.62a" - date "2002-04-30" - build-date "2002-04-30" - maintainer "XEmacs Development Team " + (standards-version 1.0 + version "1.12" + author-version "10.38" + date "1998-10-01" + build-date "1999-02-02" + maintainer "SL Baur " distribution mule priority medium category "mule" - dump nil - description "MULE: Japanese Language Input Method." - filename "skk-1.22-pkg.tar.gz" - md5sum "05457e10b156dbcc2e0f735d46d934a1" - size 1461781 - provides (skk-auto skk-comp skk-cursor skk-develop skk-foreword skk-gadget skk-isearch skk-kakasi skk-kcode skk-leim skk-look skk-num skk-obsolete skk-server skk-tut skk-vars skk-viper skk vip) - requires (viper mule-base elib xemacs-base apel) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(ps-print - (standards-version 1.1 - version "1.04" - author-version "6.5.6" - date "2002-04-24" - build-date "2002-04-24" - maintainer "XEmacs Development Team " - distribution xemacs - priority medium - category "standard" - dump nil - description "Printing functions and utilities" - filename "ps-print-1.04-pkg.tar.gz" - md5sum "e4c3f93b960454cf6dc559a0704fb084" - size 154281 - provides (lpr ps-bdf ps-mule ps-print) - requires (text-modes) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(sieve - (standards-version 1.1 - version "1.07" - author-version "21.5b6" - date "2002-06-04" - build-date "2002-06-04" - maintainer "Simon Josefsson " - distribution xemacs - priority low - category "standard" - dump nil - description "Manage Sieve email filtering scripts." - filename "sieve-1.07-pkg.tar.gz" - md5sum "d86e60ea1b6c552be2b6db7cca60e151" - size 23498 - provides (sieve sieve-mode sieve-manage) - requires (xemacs-base mail-lib cc-mode) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(mule-ucs - (standards-version 1.1 - version "1.04" - author-version "0.84" - date "2002-03-25" - build-date "2002-03-25" - maintainer "Stephen J. Turnbull " - distribution mule - priority high - category "mule" - dump nil - description "MULE: Extended coding systems (including Unicode) for XEmacs." - filename "mule-ucs-1.04-pkg.tar.gz" - md5sum "08df8359e7999c60f62f6ec92cccc197" - size 1313726 - provides (mccl-font mucs-ccl mucs-error mucs-type mucs mule-uni tae tbl-mg trans-util txt-tbl un-data un-define un-supple un-tools un-trbase unicode unidata utf u-cns-1 u-cns-2 u-cns-3 u-cns-4 u-cns-5 u-cns-6 u-cns-7 uascii ubig5 uetiopic ugb2312 uipa uiscii uiso8859-1 uiso8859-14 uiso8859-15 uiso8859-2 uiso8859-3 uiso8859-4 uiso8859-5 uiso8859-6 uiso8859-7 uiso8859-8 uiso8859-9 ujisx0201 ujisx0208 ujisx0212 uksc5601 usisheng usupple utibetan utis620 uviscii) - requires (mule-base) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(clearcase - (standards-version 1.0 - version "1.04" - author-version "21.5b6" - date "2002-06-27" - build-date "2002-06-27" - maintainer "Michael Diers " - distribution xemacs - priority low - category "standard" - dump nil - description "New Clearcase Version Control for XEmacs (UNIX, Windows)." - filename "clearcase-1.04-pkg.tar.gz" - md5sum "c60546db0605910ec57af7151a7fc9a7" - size 89274 - provides (clearcase) - requires (dired fsf-compat mail-lib xemacs-base) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(dictionary - (standards-version 1.1 - version "1.11" - author-version "1.8" - date "2002-05-20" - build-date "2002-05-20" - maintainer "Torsten Hilbrich " - distribution xemacs - priority low - category "standard" - dump nil - description "Interface to RFC2229 dictionary servers." - filename "dictionary-1.11-pkg.tar.gz" - md5sum "6bead861baac049fb1807dd2e03a1475" - size 39886 - provides (dictionary connection link) - requires (xemacs-base) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(build - (standards-version 1.0 - version "1.06" - author-version "2.00" - date "2002-07-20" - build-date "2002-07-20" - maintainer "Adrian Aichner " - distribution stable - priority low - category "standard" - dump nil - description "Build XEmacs from within (UNIX, Windows)." - filename "build-1.06-pkg.tar.gz" - md5sum "2d0fb08caf67bb89759be4ac54b6a0fb" - size 39500 - provides (build) - requires (xemacs-base pcl-cvs dired w3 prog-modes) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(xslt-process - (standards-version 1.0 - version "1.10" - author-version "1.2.1" - date "2002-07-14" - build-date "2002-07-14" - maintainer "Ovidiu Predescu " - distribution xemacs - priority medium - category "standard" - dump nil - description "XSLT processing support." - filename "xslt-process-1.10-pkg.tar.gz" - md5sum "b6fedc8eb356d6e4277ff505324a2abe" - size 199744 - provides (xslt-process) - requires (jde cc-mode semantic debug speedbar edit-utils eterm mail-lib xemacs-base elib eieio sh-script fsf-compat) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(eieio - (standards-version 1.1 - version "1.02" - author-version "0.16" - date "2002-01-13" - build-date "2002-01-14" - maintainer "Eric Ludlam " - distribution xemacs - priority low - category "standard" - dump nil - description "Enhanced Implementation of Emacs Interpreted Objects" - filename "eieio-1.02-pkg.tar.gz" - md5sum "ab05fadf432fb733fcae6b6517741902" - size 136679 - provides (call-tree chart compare-strings eieio-base eieio-comp eieio-custom eieio-doc eieio-opt eieio-speedbar eieio-tests eieio tree) - requires (eieio speedbar xemacs-base ) + dump t + description "Japanese Language Input Method." + filename "skk-1.12-pkg.tar.gz" + md5sum "f690c518a0da65c4dc9fe2a867026c26" + size 1514106 + provides (skk skk-tut) + requires (viper mule-base elib xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (egg-its - (standards-version 1.1 - version "1.26" - author-version "21.5b1" - date "2001-05-07" - build-date "2001-05-10" + (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 - description "MULE: Wnn (4.2 and 6) support. SJ3 support." - filename "egg-its-1.26-pkg.tar.gz" - md5sum "a69b09fedc9aee8422ed7ed35b6649eb" - size 260749 + dump t + description "Wnn (4.2 and 6) support. SJ3 support." + 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 @@ -552,20 +112,20 @@ ;;;@@@ (package-get-update-base-entry (quote (edict - (standards-version 1.1 - version "1.13" - author-version "0.9.9" - date "2002-01-30" - build-date "2002-02-13" - maintainer "Stephen J. Turnbull " + (standards-version 1.0 + version "1.07" + author-version "0.9.8" + date "1998-07-23" + build-date "1999-02-02" + maintainer "Stephen J. Turnbull " distribution mule priority high category "mule" dump nil - description "MULE: Lisp Interface to EDICT, Kanji Dictionary" - filename "edict-1.13-pkg.tar.gz" - md5sum "ceef82c336de553e504aa3d216fbd366" - size 95541 + description "Lisp Interface to EDICT, Kanji Dictionary" + 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 @@ -573,43 +133,21 @@ )) ;;;@@@ (package-get-update-base-entry (quote -(lookup - (standards-version 1.1 - version "1.12" - author-version "1.0" - date "2002-06-27" - build-date "2002-06-27" - maintainer "XEmacs Development Team " - distribution mule - priority high - category "mule" - dump nil - description "MULE: Dictionary support" - filename "lookup-1.12-pkg.tar.gz" - md5sum "f07a3791e49f75c7f1504edb077a5560" - size 190864 - provides (evi-mule evi lookup-content lookup-defs lookup-entry lookup-select lookup-package lookup-select lookup-types lookup-utils lookup-vars lookup-vse lookup ndcookie ndeb ndic ndict ndkks ndmisc ndnmz ndspell ndsrd ndtp sdicf stem) - requires (mule-base cookie lookup) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote (leim - (standards-version 1.1 - version "1.18" - author-version "21.5b5" - date "2002-04-24" - build-date "2002-04-24" + (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 "MULE: Quail. All non-English and non-Japanese language support." - filename "leim-1.18-pkg.tar.gz" - md5sum "b0467e2a3a93b46590bd2fe9bbf9675e" - size 1708615 + description "Quail. All non-English and non-Japanese language support." + filename "leim-1.12-pkg.tar.gz" + md5sum "07cc5be34a0d9d312b883b430349a882" + size 1671757 provides () requires (mule-base fsf-compat xemacs-base) type regular @@ -618,20 +156,20 @@ ;;;@@@ (package-get-update-base-entry (quote (locale - (standards-version 1.1 - version "1.18" - author-version "21.1" - date "2000-11-08" - build-date "2001-01-15" + (standards-version 1.0 + version "1.13" + author-version "21.0" + date "1999-05-11" + build-date "1999-05-13" maintainer "XEmacs Development Team " distribution mule priority high category "mule" dump nil - description "MULE: Localized menubars and localized splash screens." - filename "locale-1.18-pkg.tar.gz" - md5sum "dbc3b123a7f12804fb81643b40fe766a" - size 38660 + description "Localized menubars and localized splash screens." + filename "locale-1.13-pkg.tar.gz" + md5sum "4735b4005dfce55cf3581885add18836" + size 33964 provides () requires (mule-base) type regular @@ -640,42 +178,42 @@ ;;;@@@ (package-get-update-base-entry (quote (mule-base - (standards-version 1.1 - version "1.42" - author-version "21.5b6" - date "2002-06-27" - build-date "2002-06-27" - maintainer "XEmacs Development Team " + (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 - description "MULE: Basic Mule support, required for building with Mule." - filename "mule-base-1.42-pkg.tar.gz" - md5sum "d521ca4256a8333db5dc686b9d719232" - size 443826 + dump t + description "Basic Mule support, required for building with Mule." + 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.08" - author-version "21.1" - date "2000-10-05" - build-date "2001-01-15" + (standards-version 1.0 + version "1.04" + author-version "21.0b62" + date "1998-01-25" + 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.08-pkg.tar.gz" - md5sum "c5ab0860ceb23b40798b11a1fa4c0240" - size 43486 + filename "strokes-1.04-pkg.tar.gz" + md5sum "9a83020e888d140da2360dcac83c7c86" + size 43481 provides (strokes) requires (text-modes edit-utils mail-lib xemacs-base) type regular @@ -684,20 +222,20 @@ ;;;@@@ (package-get-update-base-entry (quote (time - (standards-version 1.1 - version "1.11" + (standards-version 1.0 + version "1.07" author-version "1.17" - date "2000-10-05" - build-date "2001-01-15" + date "1998-04-24" + 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.11-pkg.tar.gz" - md5sum "93ca34fe3275dc3ef5b8fd4c6824551d" - size 19983 + filename "time-1.07-pkg.tar.gz" + md5sum "4cc97d84357412fb7d737a88b6f05cbe" + size 20006 provides (time) requires (xemacs-base) type regular @@ -705,21 +243,43 @@ )) ;;;@@@ (package-get-update-base-entry (quote +(text-modes + (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 stable + priority high + category "oa" + dump nil + description "Miscellaneous support for editing text files." + 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 +)) +)) +;;;@@@ +(package-get-update-base-entry (quote (slider - (standards-version 1.1 - version "1.13" + (standards-version 1.0 + version "1.09" author-version "0.3x1" - date "2000-10-05" - build-date "2001-01-15" + date "1998-08-13" + 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.13-pkg.tar.gz" - md5sum "3fbc16b2caeef30e87969e19efa40f32" - size 12021 + filename "slider-1.09-pkg.tar.gz" + md5sum "b211a950179fee88712fc5c38e395069" + size 12004 provides (slider color-selector) requires () type regular @@ -728,20 +288,20 @@ ;;;@@@ (package-get-update-base-entry (quote (sgml - (standards-version 1.1 - version "1.08" - author-version "21.1" - date "2000-10-05" - build-date "2001-01-15" + (standards-version 1.0 + version "1.04" + author-version "21.0b62" + date "1998-01-25" + 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.08-pkg.tar.gz" - md5sum "bdadf462489fa1540cc56d1c561aaa54" - size 26964 + filename "sgml-1.04-pkg.tar.gz" + md5sum "2b762a0fbdda616916624dc2fa53e647" + size 26938 provides (sgml linuxdoc-sgml) requires (xemacs-base) type regular @@ -750,42 +310,42 @@ ;;;@@@ (package-get-update-base-entry (quote (psgml - (standards-version 1.1 - version "1.28" - author-version "1.22" - date "2002-05-09" - build-date "2002-05-10" + (standards-version 1.0 + version "1.12" + author-version "1.01" + date "1999-03-05" + build-date "1999-03-05" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium - category "standard" + category "oa" dump nil description "Validated HTML/SGML editing." - filename "psgml-1.28-pkg.tar.gz" - md5sum "e559c5b88300e414654550806eab8c7a" - size 651867 - provides (iso-sgml psgml-api psgml-charent psgml-debug psgml-dtd psgml-edit psgml-fs psgml-html psgml-info psgml-parse psgml-xemacs psgml sgml-mode) - requires (xemacs-base edit-utils edebug xemacs-devel mail-lib) + filename "psgml-1.12-pkg.tar.gz" + md5sum "7303b3a604659b64f24b0847b3a686d5" + size 425458 + provides (psgml sgml) + requires (edit-utils) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (pc - (standards-version 1.1 - version "1.25" - author-version "21.5b6" - date "2002-06-04" - build-date "2002-06-04" + (standards-version 1.0 + version "1.15" + author-version "21.0" + date "1999-04-13" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" + category "oa" dump nil description "PC style interface emulation." - filename "pc-1.25-pkg.tar.gz" - md5sum "03b7fcc55e1ce79a6017cdfa7fd49f3d" - size 17429 + 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 @@ -794,20 +354,20 @@ ;;;@@@ (package-get-update-base-entry (quote (ispell - (standards-version 1.1 - version "1.24" + (standards-version 1.0 + version "1.15" author-version "3.2" - date "2002-01-07" - build-date "2002-01-14" + date "1999-05-13" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" + category "oa" dump nil description "Spell-checking with GNU ispell." - filename "ispell-1.24-pkg.tar.gz" - md5sum "409bfa4ca95d91bc03d8dcfe7c8f7810" - size 72543 + filename "ispell-1.15-pkg.tar.gz" + md5sum "23632bd9fc2f7e4c0303865c35c5f4a5" + size 68118 provides (ispell) requires () type regular @@ -815,43 +375,21 @@ )) ;;;@@@ (package-get-update-base-entry (quote -(hm--html-menus - (standards-version 1.1 - version "1.18" - author-version "5.9" - date "2002-03-25" - build-date "2002-03-25" - maintainer "XEmacs Development Team " - distribution xemacs - priority low - category "standard" - dump nil - description "HTML editing." - filename "hm--html-menus-1.18-pkg.tar.gz" - md5sum "ad6c2d438e56fdc1cf0a81945f52605d" - size 179112 - provides (adapt hm--date hm--html-configuration hm--html-drag-and-drop hm--html-indentation hm--html-keys hm--html-menu hm--html-mode hm--html-not-standard hm--html html-view internal-drag-and-drop tmpl-minor-mode) - requires (dired xemacs-base) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote (frame-icon - (standards-version 1.1 - version "1.09" - author-version "21.1" + (standards-version 1.0 + version "1.06" + author-version "21.0b62" date "1998-07-14" - build-date "2001-01-15" + 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.09-pkg.tar.gz" - md5sum "91922e43447422f175065428367fb00b" - size 33436 + filename "frame-icon-1.06-pkg.tar.gz" + md5sum "bc4f6e838a4fa12d7f3b8b1996b3a9ac" + size 33483 provides (forms forms-mode) requires () type regular @@ -860,20 +398,20 @@ ;;;@@@ (package-get-update-base-entry (quote (forms - (standards-version 1.1 - version "1.14" + (standards-version 1.0 + version "1.10" author-version "2.37" - date "2002-01-07" - build-date "2002-01-14" + date "1999-05-11" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low - category "standard" + category "oa" dump nil description "Forms editing support (obsolete, use Widget instead)." - filename "forms-1.14-pkg.tar.gz" - md5sum "c6530292a349a0c567311502c2038270" - size 48263 + filename "forms-1.10-pkg.tar.gz" + md5sum "a8ad3a114859c0981a1f884072bf4b1b" + size 48264 provides (forms forms-mode) requires () type regular @@ -882,21 +420,21 @@ ;;;@@@ (package-get-update-base-entry (quote (calendar - (standards-version 1.1 - version "1.18" - author-version "21.5b3" - date "2001-12-22" - build-date "2001-12-22" + (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 "standard" + category "oa" dump nil description "Calendar and diary support." - filename "calendar-1.18-pkg.tar.gz" - md5sum "1fbd29614f2b1b29494dc2ea3241c16a" - size 252308 - provides (appt cal-china cal-coptic cal-dst cal-french cal-hebrew cal-islam cal-iso cal-japanese cal-julian cal-mayan cal-move cal-persia cal-tex cal-x cal-xemacs calendar diary-lib holidays lunar solar) + 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 )) @@ -904,108 +442,86 @@ ;;;@@@ (package-get-update-base-entry (quote (calc - (standards-version 1.1 - version "1.23" + (standards-version 1.0 + version "1.10" author-version "2.02fX3" - date "2002-05-09" - build-date "2002-05-10" + date "1998-07-25" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" + category "oa" dump nil description "Emacs calculator" - filename "calc-1.23-pkg.tar.gz" - md5sum "e66651dacc67325f6e6d033f80f2e989" - size 1615158 - provides (calc-ext calc-macs calc) - requires (xemacs-base) + filename "calc-1.10-pkg.tar.gz" + md5sum "148c82bf6f213d6e2fb234e1f21e4699" + size 1616821 + provides (calc) + requires () type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (speedbar - (standards-version 1.1 - version "1.23" - author-version "0.13" - date "2002-03-25" - build-date "2002-03-25" - maintainer "Eric M. Ludlam " - distribution xemacs + (standards-version 1.0 + version "1.12" + author-version "0.6.2x" + date "1999-03-05" + build-date "1999-03-12" + maintainer "XEmacs Development Team " + distribution stable priority low - category "standard" + category "oa" dump nil - description "Provides a separate frame with convenient references." - filename "speedbar-1.23-pkg.tar.gz" - md5sum "768952f9dcce464670fb4737b576dd89" - size 136753 - provides (bigclock dframe rpm sb-gud sb-image sb-info sb-rmail sb-texinfo sb-w3 speedbar) + description "Provides a seperate frame with convenient references." + filename "speedbar-1.12-pkg.tar.gz" + md5sum "3b578d06426921193ac2b8337a669bfa" + size 64892 + provides (speedbar) requires (xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote -(pcomplete - (standards-version 1.1 - version "1.01" - author-version "1.1.6" - date "2000-03-06" - build-date "2001-01-15" - maintainer "John Wiegley " - distribution xemacs - priority medium - category "os" - dump nil - description "Provides programmatic completion." - filename "pcomplete-1.01-pkg.tar.gz" - md5sum "ee42f90e2a4bb878bd5768ba49ed96ba" - size 37289 - provides (pcomplete) - requires (sh-script) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(eshell - (standards-version 1.1 - version "1.03" - author-version "2.4.1" - date "2002-03-25" - build-date "2002-03-25" - maintainer "John Wiegley " - distribution xemacs - priority medium - category "standard" +(edit-utils + (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 stable + priority high + category "oa" dump nil - description "Command shell implemented entirely in Emacs Lisp" - filename "eshell-1.03-pkg.tar.gz" - md5sum "d78600bee5b93c9dfc491bd8c03d012e" - size 231181 - provides (em-alias em-banner em-basic em-cmpl em-dirs em-glob em-hist em-ls em-pred em-prompt em-rebind em-script em-smart em-term em-unix em-xtra esh-arg esh-cmd esh-ext esh-io esh-maint esh-mode esh-module esh-opt esh-proc esh-test esh-toggle esh-util esh-var eshell) - requires (xemacs-base eterm) - type regular + description "Miscellaneous editor extensions, you probably need this." + 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 )) )) ;;;@@@ (package-get-update-base-entry (quote (view-process - (standards-version 1.1 - version "1.11" + (standards-version 1.0 + version "1.06" author-version "2.4" - date "2000-10-05" - build-date "2001-01-15" + date "1998-01-24" + 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.11-pkg.tar.gz" - md5sum "8273fcfd035804c4b376786629c7b205" - size 60260 + filename "view-process-1.06-pkg.tar.gz" + md5sum "61c4c7175f23cb4cfd314e10303b238c" + size 59958 provides (view-process-mode) requires (xemacs-base) type regular @@ -1014,21 +530,21 @@ ;;;@@@ (package-get-update-base-entry (quote (os-utils - (standards-version 1.1 - version "1.28" - author-version "21.5b6" - date "2002-05-10" - build-date "2002-05-10" + (standards-version 1.0 + version "1.15" + author-version "21.0" + date "1999-03-19" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium - category "standard" + category "os" dump nil description "Miscellaneous O/S utilities." - filename "os-utils-1.28-pkg.tar.gz" - md5sum "57d2aa4e6f7d1ad321e1d1d84b2c458c" - size 200020 - provides (archive-mode background crypt++ crypt ftelnet inf-lisp jka-compr mchat rlogin ssh tar-mode telnet terminal uncompress) + filename "os-utils-1.15-pkg.tar.gz" + md5sum "92a3d72b0df1fb79fef2aee88a4d4f50" + size 228261 + provides (archive-mode background crypt crypt++ inf-lisp jka-compr lpr mchat ps-print tar-mode telnet terminal uncompress) requires (xemacs-base) type single )) @@ -1036,42 +552,42 @@ ;;;@@@ (package-get-update-base-entry (quote (ilisp - (standards-version 1.1 - version "1.27" - author-version "5.12.0" - date "2002-06-27" - build-date "2002-06-27" - maintainer "ilisp Maintainers " - distribution xemacs + (standards-version 1.0 + version "1.07" + author-version "5.8" + date "1998-01-24" + build-date "1999-02-02" + maintainer "XEmacs Development Team " + distribution stable priority low - category "standard" + category "os" dump nil description "Front-end for Inferior Lisp." - filename "ilisp-1.27-pkg.tar.gz" - md5sum "a95a698b28301250971e8076d7ce89fd" - size 335702 - provides (bridge comint-ipc comint completer ilcompat compat-fsf18 compat-fsf-19 compat-fsf-20 ilisp-chs ilisp-cl-easy-menu ilisp-ext ilisp-lw ilisp-key ilisp-menu ilisp-mnb ilisp-scheme-easy-menu ilisp il-luc19 il-luc19) - requires (xemacs-base mail-lib fsf-compat eterm) + filename "ilisp-1.07-pkg.tar.gz" + md5sum "38cb2d94926e310a6e71ec1be854d636" + size 262173 + provides (ilisp completer) + requires (xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (igrep - (standards-version 1.1 - version "1.08" + (standards-version 1.0 + version "1.05" author-version "2.83" date "1998-08-11" - build-date "2001-01-15" + 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.08-pkg.tar.gz" - md5sum "bc3e4d7a897edb164f93ef49eeff87d3" - size 15184 + filename "igrep-1.05-pkg.tar.gz" + md5sum "e70d4973a2af4dbd6222f5943bfa1a50" + size 14935 provides (igrep) requires (dired xemacs-base) type regular @@ -1080,20 +596,20 @@ ;;;@@@ (package-get-update-base-entry (quote (eterm - (standards-version 1.1 - version "1.13" - author-version "21.1" - date "2000-10-05" - build-date "2001-01-15" + (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.13-pkg.tar.gz" - md5sum "ebd64834d12a2a3fc04bbb6f4dd836fa" - size 109184 + filename "eterm-1.08-pkg.tar.gz" + md5sum "77e56529b5de6a0a0dd46c5d1634eebf" + size 108905 provides (eterm) requires (xemacs-base) type regular @@ -1102,21 +618,21 @@ ;;;@@@ (package-get-update-base-entry (quote (viper - (standards-version 1.1 - version "1.34" - author-version "3.09" - date "2002-04-24" - build-date "2002-04-24" + (standards-version 1.0 + version "1.14" + author-version "3.061" + date "1999-03-03" + build-date "1999-03-05" maintainer "Michael Kifer " - distribution xemacs + distribution stable priority low - category "standard" + category "wp" dump nil description "VI emulation support." - filename "viper-1.34-pkg.tar.gz" - md5sum "c438c8c42dbedd5634c773623db5a4ff" - size 329580 - provides (viper-cmd viper-ex viper-init viper-keym viper-macs viper-mous viper-util viper) + filename "viper-1.14-pkg.tar.gz" + md5sum "0e118822906e195dc352f28c8efc01e0" + size 317899 + provides (viper) requires (xemacs-base) type regular )) @@ -1124,20 +640,20 @@ ;;;@@@ (package-get-update-base-entry (quote (tpu - (standards-version 1.1 - version "1.12" + (standards-version 1.0 + version "1.08" author-version "4.2X" - date "2000-10-05" - build-date "2001-01-15" + date "1998-07-23" + 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.12-pkg.tar.gz" - md5sum "8ee6ca98afc9c18a1df013065c430f5e" - size 58850 + filename "tpu-1.08-pkg.tar.gz" + md5sum "2306ac55a0a1ed23da02a85c91f881bb" + size 58804 provides (tpu) requires () type regular @@ -1146,20 +662,20 @@ ;;;@@@ (package-get-update-base-entry (quote (textools - (standards-version 1.1 - version "1.12" - author-version "21.1" - date "2000-10-05" - build-date "2001-01-15" + (standards-version 1.0 + version "1.08" + author-version "21.0b62" + date "1998-04-29" + 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.12-pkg.tar.gz" - md5sum "2ce1dc6eb29773d2ab6ce2e04463e54f" - size 79212 + filename "textools-1.08-pkg.tar.gz" + md5sum "22dd0e16433a96547fde5757c6793388" + size 79176 provides (bib-mode bibtex refer-to-bibtex) requires (xemacs-base) type single @@ -1168,20 +684,20 @@ ;;;@@@ (package-get-update-base-entry (quote (texinfo - (standards-version 1.1 - version "1.20" - author-version "21.1" - date "2000-03-18" - build-date "2001-01-15" + (standards-version 1.0 + version "1.14" + author-version "21.0b62" + date "1998-07-20" + 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.20-pkg.tar.gz" - md5sum "25a3261b1700f4b83d229dc1dcf633ae" - size 133067 + 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 @@ -1190,21 +706,21 @@ ;;;@@@ (package-get-update-base-entry (quote (reftex - (standards-version 1.1 - version "1.25" - author-version "4.16" - date "2002-03-25" - build-date "2002-03-25" - maintainer "Carsten Dominik " - distribution xemacs + (standards-version 1.0 + version "1.13" + author-version "3.43" + date "1999-04-06" + build-date "1999-05-13" + maintainer "Carsten Dominik " + distribution stable priority medium category "wp" dump nil description "Emacs support for LaTeX cross-references, citations.." - filename "reftex-1.25-pkg.tar.gz" - md5sum "e044e921fe940d63e20ac5185e4bf8ca" - size 330512 - provides (reftex-auc reftex-cite reftex-dcr reftex-vcr reftex-global reftex-index reftex-parse reftex-ref reftex-sel reftex-toc reftex-vars reftex) + filename "reftex-1.13-pkg.tar.gz" + md5sum "5e9196a6fdda2587bec1aff19d6322ec" + size 216008 + provides (reftex) requires (fsf-compat xemacs-base) type regular )) @@ -1212,20 +728,20 @@ ;;;@@@ (package-get-update-base-entry (quote (edt - (standards-version 1.1 - version "1.12" - author-version "21.5b1" - date "2001-07-14" - build-date "2001-07-15" + (standards-version 1.0 + version "1.07" + author-version "21.0b62" + date "1998-04-07" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low - category "standard" + category "wp" dump nil description "DEC EDIT/EDT emulation." - filename "edt-1.12-pkg.tar.gz" - md5sum "0d7649d0f65d9de732918d756f5cf48b" - size 62441 + filename "edt-1.07-pkg.tar.gz" + md5sum "6c48ceb9686c50058be3938288940bc5" + size 46131 provides (edt) requires (xemacs-base) type regular @@ -1234,20 +750,20 @@ ;;;@@@ (package-get-update-base-entry (quote (crisp - (standards-version 1.1 - version "1.12" + (standards-version 1.0 + version "1.09" author-version "1.34" date "1998-08-18" - build-date "2001-01-15" + 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.12-pkg.tar.gz" - md5sum "30308c6e5fb14f621d53046894c8c180" - size 10075 + filename "crisp-1.09-pkg.tar.gz" + md5sum "faa9b6f2868a7e5b212d1094039cf526" + size 10067 provides (crisp scroll-lock) requires () type regular @@ -1256,21 +772,21 @@ ;;;@@@ (package-get-update-base-entry (quote (auctex - (standards-version 1.1 - version "1.32" - author-version "10.0g" - date "2002-06-27" - build-date "2002-06-27" + (standards-version 1.0 + version "1.16" + author-version "9.7p" + date "1998-09-30" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium - category "standard" + category "wp" dump nil description "Basic TeX/LaTeX support." - filename "auctex-1.32-pkg.tar.gz" - md5sum "7d532a5a3d673f89f01c9dd3ed75ac80" - size 385505 - provides (auc-old auc-tex bib-cite font-latex latex multi-prompt tex-buf tex-info tex-jp tex-mik tex-site tex texmathp) + 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 )) @@ -1278,65 +794,65 @@ ;;;@@@ (package-get-update-base-entry (quote (vhdl - (standards-version 1.1 - version "1.15" - author-version "3.31.20" - date "2002-01-13" - build-date "2002-01-14" + (standards-version 1.0 + version "1.07" + author-version "2.74" + date "1998-01-24" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" + category "prog" dump nil description "Support for VHDL." - filename "vhdl-1.15-pkg.tar.gz" - md5sum "3670d96619d49ae091326134aa3efc2f" - size 272784 + filename "vhdl-1.07-pkg.tar.gz" + md5sum "0eae8d15cff7d7b6dd7e1d00029c0e3a" + size 65961 provides (vhdl-mode) - requires (xemacs-base edit-utils c-support speedbar ps-print os-utils) + requires () type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (vc - (standards-version 1.1 - version "1.33" - author-version "21.5b6" - date "2002-06-04" - build-date "2002-06-04" + (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 "standard" + category "prog" dump nil description "Version Control for Free systems." - filename "vc-1.33-pkg.tar.gz" - md5sum "f3b8db930389eb6288af946398286ab6" - size 91716 - provides (vc vc-hooks) - requires (dired xemacs-base vc mail-lib ediff) + filename "vc-1.17-pkg.tar.gz" + md5sum "4e80458c0e6d4cf2805ed6a46135e1c6" + size 84499 + provides (vc) + requires (dired xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (vc-cc - (standards-version 1.1 - version "1.21" - author-version "21.5b6" - date "2002-06-04" - build-date "2002-06-04" + (standards-version 1.0 + version "1.11" + author-version "21.0b62" + date "1998-12-09" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low - category "standard" + category "prog" dump nil description "Version Control for ClearCase (UnFree) systems." - filename "vc-cc-1.21-pkg.tar.gz" - md5sum "eb7ad3f9407b32509fa95fa272476b7d" - size 94556 - provides (vc-cc vc-cc-hooks) + filename "vc-cc-1.11-pkg.tar.gz" + md5sum "561ab60400e3fa6bfef8ad8567a3702d" + size 96544 + provides (vc) requires (dired xemacs-base) type regular )) @@ -1344,20 +860,20 @@ ;;;@@@ (package-get-update-base-entry (quote (sh-script - (standards-version 1.1 - version "1.15" + (standards-version 1.0 + version "1.08" author-version "2.0e" - date "2002-04-24" - build-date "2002-04-24" + date "1998-05-12" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" + category "prog" dump nil description "Support for editing shell scripts." - filename "sh-script-1.15-pkg.tar.gz" - md5sum "72214e735ea0fda9147c051fbc3b6965" - size 36163 + filename "sh-script-1.08-pkg.tar.gz" + md5sum "f2f584ab19761b1db14160d9d3cbc6f3" + size 33900 provides (sh-script executable) requires (xemacs-base) type regular @@ -1366,20 +882,20 @@ ;;;@@@ (package-get-update-base-entry (quote (scheme - (standards-version 1.1 - version "1.11" - author-version "21.1" - date "1999-06-15" - build-date "2001-01-15" + (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.11-pkg.tar.gz" - md5sum "8994fb43b37a55d4b9ad763af67a45ba" - size 36497 + filename "scheme-1.07-pkg.tar.gz" + md5sum "998d46aee749b32493cae61cac3888d2" + size 36292 provides (scheme xscheme cmuscheme cmuscheme48) requires (xemacs-base) type regular @@ -1388,64 +904,42 @@ ;;;@@@ (package-get-update-base-entry (quote (prog-modes - (standards-version 1.1 - version "1.60" - author-version "21.5b6" - date "2002-07-14" - build-date "2002-07-14" - maintainer "Ville Skyttä " - distribution xemacs + (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 stable priority medium - category "standard" + category "prog" dump nil description "Support for various programming languages." - filename "prog-modes-1.60-pkg.tar.gz" - md5sum "74909e13093afae889e3f43a1879e51c" - size 985711 - provides (autoconf-mode awk-mode c-mode cperl-mode cvs diff-mode eiffel-mode f90 fortran icon inf-ruby javascript-mode ksh-mode m4-mode makefile mode-compile mode-compile-kill modula2 p4 perl-mode php-mode postscript pydoc python-mode rexx-mode rpm-spec-mode ruby-mode simula-mode sql tcl teco verilog-mode) - requires (mail-lib xemacs-devel xemacs-base cc-mode ps-print fsf-compat edit-utils ediff emerge efs vc speedbar dired ilisp sh-script) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote -(idlwave - (standards-version 1.1 - version "1.25" - author-version "4.7" - date "2002-03-25" - build-date "2002-03-25" - maintainer "Carsten Dominik " - distribution xemacs - priority medium - category "standard" - dump nil - description "Editing and Shell mode for the Interactive Data Language" - filename "idlwave-1.25-pkg.tar.gz" - md5sum "e828f3c89e29306bb573b3f720582c50" - size 345055 - provides (idlw-rinfo idlwave-rinfo idlw-shell idlwave-shell idlw-toolbar idlwave-toolbar idlwave) - requires (fsf-compat xemacs-base) + 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 )) )) ;;;@@@ (package-get-update-base-entry (quote (emerge - (standards-version 1.1 - version "1.09" - author-version "21.1" - date "2000-10-05" - build-date "2001-01-15" + (standards-version 1.0 + version "1.05" + author-version "21.0b62" + date "1998-04-07" + 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.09-pkg.tar.gz" - md5sum "231c8120d60da2c9ddd856510da2491c" - size 61043 + filename "emerge-1.05-pkg.tar.gz" + md5sum "1f4d70d7f4e73290837b2dbd2189be99" + size 61009 provides (emerge) requires () type regular @@ -1453,44 +947,22 @@ )) ;;;@@@ (package-get-update-base-entry (quote -(ediff - (standards-version 1.1 - version "1.41" - author-version "2.75" - date "2002-04-30" - build-date "2002-04-30" - maintainer "Michael Kifer " - distribution xemacs - priority medium - category "standard" - dump nil - description "Interface over GNU patch." - filename "ediff-1.41-pkg.tar.gz" - md5sum "4a4b9435a99e5d1cb0ac2fc0843d92fa" - size 303663 - provides (ediff-diff ediff-help ediff-hook ediff-init ediff-merg ediff-mult ediff-ptch ediff-tbar ediff-util ediff-vers ediff-wind ediff) - requires (pcl-cvs elib dired xemacs-base edebug prog-modes) - type regular -)) -)) -;;;@@@ -(package-get-update-base-entry (quote (debug - (standards-version 1.1 - version "1.15" - author-version "21.5b6" - date "2002-05-01" - build-date "2002-05-01" + (standards-version 1.0 + version "1.09" + author-version "21.0" + date "1999-05-12" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low - category "standard" + category "prog" dump nil description "GUD, gdb, dbx debugging support." - filename "debug-1.15-pkg.tar.gz" - md5sum "2b44d4c660f4cda44d4a159b40a6f457" - size 107347 - provides (dbx debug-toolbar gdb-highlight gdb gdbsrc gud history) + filename "debug-1.09-pkg.tar.gz" + md5sum "24442a34f07cdd97ed52aa2c88c3de0b" + size 103161 + provides (dbx gdb-highlight gdb gdbsrc gud history) requires (xemacs-base) type regular )) @@ -1498,20 +970,20 @@ ;;;@@@ (package-get-update-base-entry (quote (c-support - (standards-version 1.1 - version "1.16" - author-version "21.1" - date "2000-10-05" - build-date "2001-01-15" + (standards-version 1.0 + version "1.12" + author-version "21.0b64" + date "1999-03-02" + 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.16-pkg.tar.gz" - md5sum "047accf51457a041bf920c9563de1bf6" - size 70393 + 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 @@ -1520,20 +992,20 @@ ;;;@@@ (package-get-update-base-entry (quote (ada - (standards-version 1.1 - version "1.10" + (standards-version 1.0 + version "1.06" author-version "2.27" - date "2000-10-05" - build-date "2001-01-15" + date "1998-01-24" + 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.10-pkg.tar.gz" - md5sum "6ba6ca52a345831e8fafa241119db39f" - size 54387 + filename "ada-1.06-pkg.tar.gz" + md5sum "0f3d2dc2ff33d40092b324a7a5a363d6" + size 54364 provides (ada-mode ada-stmt) requires () type regular @@ -1541,65 +1013,65 @@ )) ;;;@@@ (package-get-update-base-entry (quote -(cc-mode - (standards-version 1.1 - version "1.28" - author-version "5.28" - date "2002-05-09" - build-date "2002-05-10" - maintainer "Martin Stjernholm " - distribution xemacs - priority medium - category "standard" +(pcl-cvs + (standards-version 1.0 + version "1.38" + author-version "R-2_0-Beta_2" + date "1998-11-17" + build-date "1999-02-02" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "prog" dump nil - description "C, C++ and Java language support." - filename "cc-mode-1.28-pkg.tar.gz" - md5sum "d2c87709e503e11755c480f2aa50ea8c" - size 262921 - provides (cc-bytecomp cc-align cc-cmds cc-compat cc-defs cc-engine cc-guess cc-langs cc-lobotomy cc-menus cc-mode-19 cc-mode cc-styles cc-vars) - requires (xemacs-base mail-lib) + description "CVS frontend." + filename "pcl-cvs-1.38-pkg.tar.gz" + md5sum "a5ff4e61dffe3985c20385eb741d4783" + size 163524 + provides (pcl-cvs generic-sc) + requires (xemacs-base elib dired) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote -(semantic - (standards-version 1.1 - version "1.12" - author-version "1.4beta8" - date "2002-03-25" - build-date "2002-03-25" - maintainer "Eric M. Ludlam " - distribution xemacs - priority low - category "standard" +(cc-mode + (standards-version 1.0 + version "1.15" + author-version "5.25" + date "1998-12-30" + build-date "1999-02-02" + maintainer "Barry Warsaw " + distribution stable + priority medium + category "prog" dump nil - description "Semantic bovinator (Yacc/Lex for XEmacs). Includes Senator." - filename "semantic-1.12-pkg.tar.gz" - md5sum "45b5137c5a17528ede8a667c0219208d" - size 281805 - provides (document-vars document semantic-bnf semantic-c semantic-ctxt semantic-el semantic-imenu semantic-java semantic-load semantic-make semantic-sb semantic-scm semantic-texi semantic-util semantic semanticdb senator-isearch senator sformat working) - requires (eieio xemacs-base xemacs-devel edit-utils speedbar texinfo) + description "C, C++ and Java language support." + filename "cc-mode-1.15-pkg.tar.gz" + md5sum "ca73b190e79f96ab928eecd12af94222" + size 212611 + provides (cc-mode) + requires (xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (misc-games - (standards-version 1.1 - version "1.15" - author-version "21.1" - date "2000-11-18" - build-date "2001-01-15" + (standards-version 1.0 + version "1.11" + author-version "21.0b65" + date "1999-03-05" + 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.15-pkg.tar.gz" - md5sum "a77db688d2d276aaca5840a7c16615f0" - size 166336 + filename "misc-games-1.11-pkg.tar.gz" + md5sum "80149e00e5698d0a48945c918bd2d0ba" + size 166197 provides (decipher gomoku hanoi life morse rot13) requires (xemacs-base) type single @@ -1608,20 +1080,20 @@ ;;;@@@ (package-get-update-base-entry (quote (mine - (standards-version 1.1 - version "1.14" + (standards-version 1.0 + version "1.10" author-version "1.9" - date "2000-10-05" - build-date "2001-01-15" + date "1998-05-09" + 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.14-pkg.tar.gz" - md5sum "ebe471b68642906786db139d402002c7" - size 66727 + filename "mine-1.10-pkg.tar.gz" + md5sum "a2d4f93830fe86e4d4e2f081ec0517fb" + size 66679 provides (xmine) requires (xemacs-base) type regular @@ -1630,20 +1102,20 @@ ;;;@@@ (package-get-update-base-entry (quote (games - (standards-version 1.1 - version "1.13" + (standards-version 1.0 + version "1.09" author-version "1.04" - date "2000-03-23" - build-date "2001-01-15" + date "1998-06-04" + 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.13-pkg.tar.gz" - md5sum "4138cc59fd6a9316adbb14e7468af593" - size 32438 + filename "games-1.09-pkg.tar.gz" + md5sum "76a327a228745576538711180a9e444e" + size 32146 provides (gamegrid snake tetris sokoban) requires (xemacs-base) type regular @@ -1652,20 +1124,20 @@ ;;;@@@ (package-get-update-base-entry (quote (cookie - (standards-version 1.1 - version "1.14" - author-version "21.5b5" - date "2002-03-25" - build-date "2002-03-25" + (standards-version 1.0 + version "1.10" + author-version "21.0b62" + date "1998-04-07" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" + category "games" dump nil description "Spook and Yow (Zippy quotes)." - filename "cookie-1.14-pkg.tar.gz" - md5sum "50581960785fb3949faabaae49896c32" - size 34543 + filename "cookie-1.10-pkg.tar.gz" + md5sum "1c5599fa30e346af452c126d872121be" + size 34198 provides (cookie1 yow) requires (xemacs-base) type regular @@ -1674,43 +1146,43 @@ ;;;@@@ (package-get-update-base-entry (quote (bbdb - (standards-version 1.1 - version "1.21" - author-version "2.34" - date "2002-06-27" - build-date "2002-06-27" - maintainer "Ronan Waide " - distribution xemacs + (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 stable priority medium - category "standard" + category "comm" dump nil description "The Big Brother Data Base" - filename "bbdb-1.21-pkg.tar.gz" - md5sum "8b1d6fe03d444a4977a358a431f1430e" - size 373823 - provides (bbdb-com bbdb-ftp bbdb-gnus bbdb-gui bbdb-hooks bbdb-merge bbdb-mhe bbdb-migrate bbdb-print bbdb-reportmail bbdb-rmail bbdb-sc bbdb-snarf bbdb-srv bbdb-vm bbdb-w3 bbdb-whois bbdb-xemacs bbdb) - requires (bbdb edit-utils gnus mh-e rmail supercite vm tm apel mail-lib xemacs-base w3) + 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 )) )) ;;;@@@ (package-get-update-base-entry (quote (zenirc - (standards-version 1.1 - version "1.13" + (standards-version 1.0 + version "1.05" author-version "2.112" - date "2002-01-07" - build-date "2002-01-14" + date "1998-08-15" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium - category "standard" + category "comm" dump nil description "ZENIRC IRC Client." - filename "zenirc-1.13-pkg.tar.gz" - md5sum "38200c80672a32056426ed32c09473cf" - size 276760 - provides (zenirc-18 zenirc-8ball zenirc-away zenirc-bork zenirc-color zenirc-command-queue zenirc-complete zenirc-ctcp-flood zenirc-dcc zenirc-doto zenirc-fill zenirc-finnish zenirc-format zenirc-fortran zenirc-french zenirc-history zenirc-ignore zenirc-iwantop zenirc-klingon zenirc-latin zenirc-meditate zenirc-netsplit zenirc-notify zenirc-oink zenirc-ojnk zenirc-pjg zenirc-popup zenirc-random-away zenirc-random-nick zenirc-signal zenirc-stamp zenirc-swedish zenirc-trigger zenirc-yow-filter zenirc-yow zenirc) + filename "zenirc-1.05-pkg.tar.gz" + md5sum "df432e4987ddd0dd65e0124d7d910967" + size 276054 + provides (zenirc) requires (zenirc) type regular )) @@ -1718,87 +1190,87 @@ ;;;@@@ (package-get-update-base-entry (quote (mew - (standards-version 1.1 - version "1.17" - author-version "1.94.2" - date "2002-03-25" - build-date "2002-03-25" + (standards-version 1.0 + version "1.07" + author-version "1.93b38x1" + date "1998-12-09" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low - category "standard" + category "comm" dump nil description "Messaging in an Emacs World." - filename "mew-1.17-pkg.tar.gz" - md5sum "03fa0583b534322d0375901796d22ec5" - size 654737 - provides (mew-addrbook mew-attach mew-bq mew-cache mew-complete mew-decode mew-demo mew-draft mew-encode mew-env mew-ext mew-fib mew-func mew-header mew-highlight mew-lang-jp mew-mark mew-message mew-mime mew-minibuf mew-mule mew-mule0 mew-mule2 mew-mule3 mew-os2 mew-pgp mew-pick mew-refile mew-scan mew-sort mew-summary mew-syntax mew-temacs mew-unix mew-vars mew-virtual mew-win32 mew-xemacs mew) - requires (mew w3 efs mail-lib xemacs-base fsf-compat) + filename "mew-1.07-pkg.tar.gz" + md5sum "04ed302d5a3735169835e52dadc9e84d" + size 518432 + provides (mew) + requires (mew) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (tm - (standards-version 1.1 - version "1.34" - author-version "21.5b6" - date "2002-06-27" - build-date "2002-06-27" + (standards-version 1.0 + version "1.18" + author-version "21.0" + date "1999-02-06" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" + category "comm" dump nil - description "Emacs MIME support. Not needed for gnus >= 5.8.0" - filename "tm-1.34-pkg.tar.gz" - md5sum "80c9bf5cf48f9ba61b1b6395751c44e4" - size 189067 - provides (char-util cless gnus-art-mime gnus-charset gnus-mime gnus-sum-mime latex-math-symbol mel-b mel-g mel-q mel-u mel message-mime mime-setup mu-bbdb mu-cite range sc-setup signature texi-util tl-atype tl-list tl-misc tl-num tl-seq tl-str tm-bbdb tm-def tm-edit-mc tm-edit tm-ew-d tm-ew-e tm-file tm-ftp tm-html tm-image tm-latex tm-mail tm-mh-e tm-parse tm-partial tm-pgp tm-play tm-rmail tm-setup tm-tar tm-text tm-view tm-vm tmh-comp) - requires (gnus mh-e rmail vm mailcrypt mail-lib apel xemacs-base fsf-compat) + description "Emacs MIME support." + 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 )) )) ;;;@@@ (package-get-update-base-entry (quote (gnus - (standards-version 1.1 - version "1.62" - author-version "5.8.8" - date "2002-06-27" - build-date "2002-06-27" + (standards-version 1.0 + version "1.40" + author-version "5.6.45x1" + date "1999-03-12" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority medium - category "standard" + category "comm" dump nil description "The Gnus Newsreader and Mailreader." - filename "gnus-1.62-pkg.tar.gz" - md5sum "b84bb02eab349e7c36b84d5f6bd5f194" - size 2356932 - provides (binhex drums earcon flow-fill format-spec gnus-agent gnus-art gnus-async gnus-audio gnus-bcklg gnus-cache gnus-cite gnus-cus gnus-demon gnus-draft gnus-dup gnus-eform gnus-ems gnus-gl gnus-group gnus-int gnus-kill gnus-load gnus-logic gnus-mh gnus-ml gnus-mlspl gnus-move gnus-msg gnus-nocem gnus-picon gnus-range gnus-salt gnus-score gnus-setup gnus-soup gnus-spec gnus-srvr gnus-start gnus-sum gnus-topic gnus-undo gnus-util gnus-uu gnus-vm gnus-win gnus-xmas gnus ietf-drums imap lpath mail-parse mail-prsvr mail-source mailcap md5 message messagexmas messcompat mm-bodies mm-decode mm-encode mm-util mm-uu mm-view mml-smime mml nnagent nnbabyl nndb nndir nndoc nndraft nneething nnfolder nngateway nnheader nnheaderxm nnimap nnkiboze nnlistserv nnmail nnmbox nnmh nnml nnoo nnslashdot nnsoup nnspool nntp nnultimate nnvirtual nnwarchive nnweb nnwfm parse-time qp rfc1843 rfc2015 rfc2045 rfc2047 rfc2231 score-mode smiley smiley smime time-date utf7 uudecode vcard webmail) - requires (gnus w3 mh-e mailcrypt rmail eterm mail-lib xemacs-base fsf-compat) + 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 )) )) ;;;@@@ (package-get-update-base-entry (quote (rmail - (standards-version 1.1 - version "1.13" - author-version "21.5b4" - date "2002-01-13" - build-date "2002-01-14" + (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 contrib priority low - category "standard" + category "comm" dump nil description "An obsolete Emacs mailer." - filename "rmail-1.13-pkg.tar.gz" - md5sum "4da12b01ea3735412f95edeb2a2bd0bd" - size 96265 - provides (rmail-kill rmail-xemacs rmail rmailsort) + filename "rmail-1.08-pkg.tar.gz" + md5sum "90f98f9043e0c6f2180ffec9c6904eca" + size 96450 + provides (rmail rmailsum) requires (tm apel mail-lib xemacs-base) type regular )) @@ -1806,42 +1278,42 @@ ;;;@@@ (package-get-update-base-entry (quote (mailcrypt - (standards-version 1.1 - version "2.11" - author-version "3.5.6" - date "2002-01-07" - build-date "2002-01-14" + (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 "standard" + category "comm" dump nil description "Support for messaging encryption with PGP." - filename "mailcrypt-2.11-pkg.tar.gz" - md5sum "ae92827caef07632a64a9a9f8589f42d" - size 141467 - provides (expect mailcrypt) - requires (mail-lib fsf-compat xemacs-base cookie gnus mh-e rmail vm) + filename "mailcrypt-1.07-pkg.tar.gz" + md5sum "350dccab50ef0800b95d44ef62cca359" + size 86362 + provides (mailcrypt) + requires (gnus vm mail-lib xemacs-base) type regular )) )) ;;;@@@ (package-get-update-base-entry (quote (supercite - (standards-version 1.1 - version "1.19" + (standards-version 1.0 + version "1.12" author-version "3.55x3" - date "2002-01-07" - build-date "2002-01-14" + date "1999-04-06" + build-date "1999-05-13" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" + category "comm" dump nil description "An Emacs citation tool for News & Mail messages." - filename "supercite-1.19-pkg.tar.gz" - md5sum "8f6767ea4e03306d1e5553501ed7cd2e" - size 100881 + filename "supercite-1.12-pkg.tar.gz" + md5sum "7188738f17ec05c1561fe054fdf120dd" + size 99564 provides (supercite) requires (mail-lib xemacs-base) type regular @@ -1850,21 +1322,21 @@ ;;;@@@ (package-get-update-base-entry (quote (mh-e - (standards-version 1.1 - version "1.14" - author-version "21.5b4" - date "2002-01-13" - build-date "2002-01-14" + (standards-version 1.0 + version "1.09" + author-version "21.0b62" + date "1998-07-12" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution contrib priority low - category "standard" + category "comm" dump nil description "Front end support for MH." - filename "mh-e-1.14-pkg.tar.gz" - md5sum "fe842594b7e7c403b2f7e4ac1f37e040" - size 176937 - provides (mh-comp mh-e mh-funcs mh-mime mh-pick mh-seq mh-utils) + filename "mh-e-1.09-pkg.tar.gz" + md5sum "89e6f44e8dca03f6be10068391831262" + size 176469 + provides (mh-e) requires (mail-lib xemacs-base) type regular )) @@ -1872,20 +1344,20 @@ ;;;@@@ (package-get-update-base-entry (quote (gnats - (standards-version 1.1 - version "1.15" + (standards-version 1.0 + version "1.08" author-version "3.101" - date "2002-06-27" - build-date "2002-06-27" + date "1998-08-01" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority high - category "standard" + category "comm" dump nil description "XEmacs bug reports." - filename "gnats-1.15-pkg.tar.gz" - md5sum "9503a79e2e396eb13151aec7eadf561b" - size 189524 + filename "gnats-1.08-pkg.tar.gz" + md5sum "8c1e3100399aac86c63683b1836d4a61" + size 189265 provides (gnats gnats-admin send-pr) requires (mail-lib xemacs-base) type regular @@ -1894,21 +1366,21 @@ ;;;@@@ (package-get-update-base-entry (quote (footnote - (standards-version 1.1 - version "1.15" + (standards-version 1.0 + version "1.10" author-version "0.18x" - date "2002-04-24" - build-date "2002-04-24" + date "1999-03-11" + build-date "1999-05-13" maintainer "SL Baur " - distribution xemacs + distribution stable priority low - category "standard" + category "comm" dump nil description "Footnoting in mail message editing modes." - filename "footnote-1.15-pkg.tar.gz" - md5sum "1cbe1e587881611006d9a8fc82be3be1" - size 21917 - provides (footnote-cyrillic footnote-greek footnote-han footnote-hebrew footnote-kana footnote) + filename "footnote-1.10-pkg.tar.gz" + md5sum "124d7e58ba9905db7488ee142470249f" + size 18356 + provides (footnote) requires (mail-lib xemacs-base) type regular )) @@ -1916,43 +1388,43 @@ ;;;@@@ (package-get-update-base-entry (quote (eudc - (standards-version 1.1 - version "1.36" - author-version "1.32" - date "2002-02-13" - build-date "2002-02-23" - 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 "standard" + category "comm" dump nil description "Emacs Unified Directory Client (LDAP, PH)." - filename "eudc-1.36-pkg.tar.gz" - md5sum "899aaa20a136715c06f35b73f97cfa71" - size 79111 - provides (eudc eudc-vars eudc-hotlist eudc-export eudc-bob eudcb-ldap eudcb-ph eudcb-bbdb) - requires (fsf-compat xemacs-base bbdb mail-lib gnus) + 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 )) )) ;;;@@@ (package-get-update-base-entry (quote (net-utils - (standards-version 1.1 - version "1.27" - author-version "21.5b6" - date "2002-06-27" - build-date "2002-06-27" + (standards-version 1.0 + version "1.11" + author-version "21.0b62" + date "1998-07-01" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" + category "comm" dump nil description "Miscellaneous Networking Utilities." - filename "net-utils-1.27-pkg.tar.gz" - md5sum "45563ca39defd1328c9dabd933d9a0f5" - size 120333 - provides (ilisp-browse-cltl2 xemacsbug feedmail metamail net-utils rcompile shadowfile webjump webster-www) + 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 )) @@ -1960,21 +1432,21 @@ ;;;@@@ (package-get-update-base-entry (quote (w3 - (standards-version 1.1 - version "1.25" - author-version "4.0pre46" - date "2002-06-27" - build-date "2002-06-27" + (standards-version 1.0 + version "1.13" + author-version "4.0pre39x1" + date "1999-03-02" + build-date "1999-03-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution experimental priority high - category "standard" + category "comm" dump nil description "A Web browser." - filename "w3-1.25-pkg.tar.gz" - md5sum "5eef9e6136c651a922d5cc341c8c7b56" - size 689340 - provides (css devices w3-auto dsssl-flow dsssl font images md5 mm mule-sysdp socks ssl urlauth url-cache url-cookie url-file url-gopher url-gw url-http url-ldap url-mail url-misc url-news url-ns url-parse url-vars url w3-about w3-auto w3-cfg w3-cus w3-display w3-emacs19 w3-e19 w3-e20 w3-elisp w3-emulate w3-forms w3-hot w3-hotindex w3-imap w3-java w3-jscript w3-keyword w3-latex w3-menu w3-mouse w3-parse w3-print w3-props w3-script w3-structure w3-speak w3-style w3-sysdp w3-toolbar w3-vars w3-widget w3-xemacs w3-xemac w3) + filename "w3-1.13-pkg.tar.gz" + md5sum "8e9f70ef2c4b43090cfbf86974517c66" + size 682040 + provides (w3 url) requires (w3 mail-lib xemacs-base) type regular )) @@ -1982,21 +1454,21 @@ ;;;@@@ (package-get-update-base-entry (quote (vm - (standards-version 1.1 - version "7.07" - author-version "7.07" - date "2002-06-08" - build-date "2002-06-08" - maintainer "Kyle Jones " - distribution xemacs + (standards-version 1.0 + version "1.20" + author-version "6.71" + date "1999-05-13" + build-date "1999-05-13" + maintainer "XEmacs Development Team " + distribution stable priority medium - category "standard" + category "comm" dump nil description "An Emacs mailer." - filename "vm-7.07-pkg.tar.gz" - md5sum "ab2c67c7cda2fe8739a1fef49cfc0fc5" - size 718569 - provides (tapestry vm-byteopts vm-delete vm-digest vm-easymenu vm-edit vm-folder vm-imap vm-license vm-macro vm-mark vm-menu vm-message vm-mime vm-minibuf vm-misc vm-motion vm-mouse vm-page vm-pop vm-reply vm-save vm-search vm-sort vm-startup vm-summary vm-thread vm-toolbar vm-undo vm-user vm-vars vm vm-version vm-virtual vm-window) + filename "vm-1.20-pkg.tar.gz" + md5sum "120d25d3541fc7ef4bb34659a4aba89c" + size 614987 + provides (vm) requires (mail-lib xemacs-base) type regular )) @@ -2004,20 +1476,20 @@ ;;;@@@ (package-get-update-base-entry (quote (sounds-wav - (standards-version 1.1 - version "1.10" - author-version "21.1" - date "2000-05-23" - build-date "2001-01-15" + (standards-version 1.0 + version "1.07" + author-version "21.0b64" + date "1999-02-02" + 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.10-pkg.tar.gz" - md5sum "89dff9f3b8e1aaaa19f000035e3aa199" - size 149162 + filename "sounds-wav-1.07-pkg.tar.gz" + md5sum "60a70b85e8711fb1c9a1c7d0f4bf8ee0" + size 149045 provides () requires () type regular @@ -2026,20 +1498,20 @@ ;;;@@@ (package-get-update-base-entry (quote (sounds-au - (standards-version 1.1 - version "1.10" - author-version "21.1" - date "2000-05-23" - build-date "2001-01-15" + (standards-version 1.0 + version "1.07" + author-version "21.0b64" + date "1999-02-02" + 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.10-pkg.tar.gz" - md5sum "256e09c0570a19ae545350681bacaf3e" - size 126306 + filename "sounds-au-1.07-pkg.tar.gz" + md5sum "4b5acd296b50102e50565650d9d7ec0b" + size 126184 provides () requires () type regular @@ -2048,42 +1520,42 @@ ;;;@@@ (package-get-update-base-entry (quote (xemacs-devel - (standards-version 1.1 - version "1.47" - author-version "21.5b6" - date "2002-07-14" - build-date "2002-07-14" + (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 "standard" + category "libs" dump nil description "Emacs Lisp developer support." - filename "xemacs-devel-1.47-pkg.tar.gz" - md5sum "0386b19a469f684dd97e67fe5ce15a99" - size 228197 - provides (checkdoc docref eldoc elp eval-expr find-func hide-copyleft ielm patcher pp trace patch-keywords) - requires (xemacs-base ispell mail-lib gnus) + 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 )) )) ;;;@@@ (package-get-update-base-entry (quote (tooltalk - (standards-version 1.1 - version "1.13" - author-version "21.1" - date "2000-10-05" - build-date "2001-01-15" + (standards-version 1.0 + version "1.09" + author-version "21.0b62" + date "1998-07-25" + 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.13-pkg.tar.gz" - md5sum "3f01dab216a3bc318d11f362d22ea89c" - size 9301 + filename "tooltalk-1.09-pkg.tar.gz" + md5sum "368d6407bf82711bee9a01fa6908b576" + size 9271 provides () requires () type regular @@ -2092,20 +1564,20 @@ ;;;@@@ (package-get-update-base-entry (quote (elib - (standards-version 1.1 - version "1.10" + (standards-version 1.0 + version "1.04" author-version "1.0" - date "2002-01-07" - build-date "2002-01-14" + date "1998-10-01" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution mule priority high - category "standard" + category "libs" dump nil description "Portable Emacs Lisp utilities library." - filename "elib-1.10-pkg.tar.gz" - md5sum "01deb690554da8c3f7c97e0ae170ae69" - size 73309 + 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 @@ -2114,20 +1586,20 @@ ;;;@@@ (package-get-update-base-entry (quote (edebug - (standards-version 1.1 - version "1.14" - author-version "21.5b1" - date "2001-07-16" - build-date "2001-07-21" + (standards-version 1.0 + version "1.07" + author-version "21.0b62" + date "1998-03-12" + build-date "1999-02-02" maintainer "XEmacs Development Team " - distribution xemacs + distribution stable priority low - category "standard" + category "libs" dump nil description "An Emacs Lisp debugger." - filename "edebug-1.14-pkg.tar.gz" - md5sum "8cac8a4c9e7f01bc3199f395fc9d975b" - size 112374 + 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 @@ -2136,20 +1608,20 @@ ;;;@@@ (package-get-update-base-entry (quote (Sun - (standards-version 1.1 - version "1.13" - author-version "21.1" + (standards-version 1.0 + version "1.10" + author-version "21.0b62" date "1998-07-25" - build-date "2001-01-15" + 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.13-pkg.tar.gz" - md5sum "455b7e1c3564563687e36ab53352ba76" - size 63836 + 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 @@ -2158,20 +1630,20 @@ ;;;@@@ (package-get-update-base-entry (quote (apel - (standards-version 1.1 - version "1.25" - author-version "10.2" - date "2002-07-30" - build-date "2002-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 "standard" + category "libs" dump nil description "A Portable Emacs Library. Used by XEmacs MIME support." - filename "apel-1.25-pkg.tar.gz" - md5sum "532f6290f85b87e78eeb059eb8a3f673" - size 108216 + 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 @@ -2181,21 +1653,21 @@ (package-get-update-base-entry (quote (efs (standards-version 1.0 - version "1.29" - author-version "1.20" - date "2002-04-24" - build-date "2002-04-24" + version "1.14" + author-version "1.18" + date "1999-01-03" + build-date "1999-02-02" maintainer "Mike Sperber " distribution stable priority medium - category "standard" + category "libs" dump nil description "Treat files on remote systems the same as local files." - filename "efs-1.29-pkg.tar.gz" - md5sum "8c2c6c00cfbdc5f8d64ad54ddfb731df" - size 371905 + filename "efs-1.14-pkg.tar.gz" + md5sum "2b4128fec0dcb31834f404ef962f10ab" + size 369742 provides (efs) - requires (xemacs-base dired) + requires (xemacs-base vm dired) type regular )) )) @@ -2203,21 +1675,87 @@ (package-get-update-base-entry (quote (dired (standards-version 1.0 - version "1.12" - author-version "7.10" - date "2002-04-24" - build-date "2002-04-24" + version "1.05" + author-version "7.9" + date "1998-12-09" + build-date "1999-02-02" maintainer "Mike Sperber " distribution stable priority medium - category "standard" + category "libs" dump nil description "Manage file systems." - filename "dired-1.12-pkg.tar.gz" - md5sum "be9971fc8b39136a495a1a06110bc964" - size 195581 + filename "dired-1.05-pkg.tar.gz" + md5sum "392440b1472a2415b0b9b6779df93619" + size 187654 provides (diff dired) - requires (xemacs-base prog-modes) + requires (xemacs-base) + type regular +)) +)) +;;;@@@ +(package-get-update-base-entry (quote +(mail-lib + (standards-version 1.0 + version "1.23" + author-version "21.0" + date "1999-04-13" + build-date "1999-05-13" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "libs" + dump nil + description "Fundamental lisp files for providing email support." + 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 +)) +)) +;;;@@@ +(package-get-update-base-entry (quote +(fsf-compat + (standards-version 1.0 + version "1.05" + author-version "21.0b62" + date "1998-09-12" + build-date "1999-02-02" + maintainer "XEmacs Development Team " + distribution mule + priority high + category "libs" + dump nil + description "FSF Emacs compatibility files." + filename "fsf-compat-1.05-pkg.tar.gz" + md5sum "64cb1984a71974f3f40c0be1a971f441" + size 17347 + provides (overlay thingatpt timer x-popup-menu) + requires () + type single +)) +)) +;;;@@@ +(package-get-update-base-entry (quote +(xemacs-base + (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 mule + priority high + category "libs" + dump nil + description "Fundamental XEmacs support, you almost certainly need this." + 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 )) )) diff --git a/etc/photos/adrian.png b/etc/photos/adrian.png new file mode 100644 index 0000000..cec29b6 Binary files /dev/null and b/etc/photos/adrian.png differ diff --git a/etc/photos/adrianm.png b/etc/photos/adrianm.png new file mode 100644 index 0000000..a00b6de Binary files /dev/null and b/etc/photos/adrianm.png differ diff --git a/etc/photos/ben.png b/etc/photos/ben.png new file mode 100644 index 0000000..c56c44b Binary files /dev/null and b/etc/photos/ben.png differ diff --git a/etc/photos/benm.png b/etc/photos/benm.png new file mode 100644 index 0000000..2ff40b4 Binary files /dev/null and b/etc/photos/benm.png differ diff --git a/etc/photos/fabrice.png b/etc/photos/fabrice.png new file mode 100644 index 0000000..43db818 Binary files /dev/null and b/etc/photos/fabrice.png differ diff --git a/etc/photos/fabricem.png b/etc/photos/fabricem.png new file mode 100644 index 0000000..08cea62 Binary files /dev/null and b/etc/photos/fabricem.png differ diff --git a/etc/photos/jan.png b/etc/photos/jan.png new file mode 100644 index 0000000..95e972f Binary files /dev/null and b/etc/photos/jan.png differ diff --git a/etc/photos/jason.png b/etc/photos/jason.png new file mode 100644 index 0000000..afe324c Binary files /dev/null and b/etc/photos/jason.png differ diff --git a/etc/photos/jasonm.png b/etc/photos/jasonm.png new file mode 100644 index 0000000..afe324c Binary files /dev/null and b/etc/photos/jasonm.png differ diff --git a/etc/photos/juhp.png b/etc/photos/juhp.png new file mode 100644 index 0000000..1ccd961 Binary files /dev/null and b/etc/photos/juhp.png differ diff --git a/etc/photos/juhpm.png b/etc/photos/juhpm.png new file mode 100644 index 0000000..f4e14a6 Binary files /dev/null and b/etc/photos/juhpm.png differ diff --git a/etc/photos/wing.png b/etc/photos/wing.png new file mode 100644 index 0000000..c56c44b Binary files /dev/null and b/etc/photos/wing.png differ diff --git a/etc/photos/wingm.png b/etc/photos/wingm.png new file mode 100644 index 0000000..2ff40b4 Binary files /dev/null and b/etc/photos/wingm.png differ diff --git a/etc/photos/youngs.png b/etc/photos/youngs.png new file mode 100644 index 0000000..c32c5af Binary files /dev/null and b/etc/photos/youngs.png differ diff --git a/etc/photos/youngsm.png b/etc/photos/youngsm.png new file mode 100644 index 0000000..3cc01c6 Binary files /dev/null and b/etc/photos/youngsm.png differ diff --git a/etc/sample.emacs b/etc/sample.emacs new file mode 100644 index 0000000..3124457 --- /dev/null +++ b/etc/sample.emacs @@ -0,0 +1,660 @@ +;; -*- Mode: Emacs-Lisp -*- + +;;; This is a sample .emacs file. +;;; +;;; The .emacs file, which should reside in your home directory, allows you to +;;; customize the behavior of Emacs. In general, changes to your .emacs file +;;; will not take effect until the next time you start up Emacs. You can load +;;; it explicitly with `M-x load-file RET ~/.emacs RET'. +;;; +;;; There is a great deal of documentation on customization in the Emacs +;;; manual. You can read this manual with the online Info browser: type +;;; `C-h i' or select "Emacs Info" from the "Help" menu. + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Basic Customization ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Enable the command `narrow-to-region' ("C-x n n"), a useful +;; command, but possibly confusing to a new user, so it's disabled by +;; default. +(put 'narrow-to-region 'disabled nil) + +;;; Define a variable to indicate whether we're running XEmacs/Lucid Emacs. +;;; (You do not have to defvar a global variable before using it -- +;;; you can just call `setq' directly like we do for `emacs-major-version' +;;; below. It's clearer this way, though.) + +(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)) + +;; Make the sequence "C-x w" execute the `what-line' command, +;; which prints the current line number in the echo area. +(global-set-key "\C-xw" 'what-line) + +;; set up the function keys to do common tasks to reduce Emacs pinky +;; and such. + +;; Make F1 invoke help +(global-set-key [f1] 'help-command) +;; Make F2 be `undo' +(global-set-key [f2] 'undo) +;; Make F3 be `find-file' +;; Note: it does not currently work to say +;; (global-set-key 'f3 "\C-x\C-f") +;; The reason is that macros can't do interactive things properly. +;; This is an extremely longstanding bug in Emacs. Eventually, +;; it will be fixed. (Hopefully ..) +(global-set-key [f3] 'find-file) + +;; Make F4 be "mark", F5 be "copy", F6 be "paste" +;; Note that you can set a key sequence either to a command or to another +;; key sequence. +(global-set-key [f4] 'set-mark-command) +(global-set-key [f5] "\M-w") +(global-set-key [f6] "\C-y") + +;; Shift-F4 is "pop mark off of stack" +(global-set-key [(shift f4)] (lambda () (interactive) (set-mark-command t))) + +;; Make F7 be `save-buffer' +(global-set-key [f7] 'save-buffer) + +;; Make F8 be "start macro", F9 be "end macro", F10 be "execute macro" +(global-set-key [f8] 'start-kbd-macro) +(global-set-key [f9] 'end-kbd-macro) +(global-set-key [f10] 'call-last-kbd-macro) + +;; Here's an alternative binding if you don't use keyboard macros: +;; Make F8 be `save-buffer' followed by `delete-window'. +;;(global-set-key 'f8 "\C-x\C-s\C-x0") + +;; If you prefer delete to actually delete forward then you want to +;; uncomment the next line (or use `Customize' to customize this). +;; (setq delete-key-deletes-forward t) + + +(cond (running-xemacs + ;; + ;; Code for any version of XEmacs/Lucid Emacs goes here + ;; + + ;; Change the values of some variables. + ;; (t means true; nil means false.) + ;; + ;; Use the "Describe Variable..." option on the "Help" menu + ;; to find out what these variables mean. + (setq find-file-use-truenames nil + find-file-compare-truenames t + minibuffer-confirm-incomplete t + complex-buffers-menu-p t + next-line-add-newlines nil + mail-yank-prefix "> " + kill-whole-line t + ) + + ;; When running ispell, consider all 1-3 character words as correct. + (setq ispell-extra-args '("-W" "3")) + + (cond ((or (not (fboundp 'device-type)) + (equal (device-type) 'x) + (equal (device-type) 'mswindows)) + ;; Code which applies only when running emacs under X or + ;; MicroSoft Windows goes here. (We check whether the + ;; function `device-type' exists before using it. In + ;; versions before 19.12, there was no such function. + ;; If it doesn't exist, we simply assume we're running + ;; under X -- versions before 19.12 only supported X.) + + ;; Remove the binding of C-x C-c, which normally exits emacs. + ;; It's easy to hit this by mistake, and that can be annoying. + ;; Under X, you can always quit with the "Exit Emacs" option on + ;; the File menu. + (global-set-key "\C-x\C-c" nil) + + ;; Uncomment this to enable "sticky modifier keys" in 19.13 + ;; and up. With sticky modifier keys enabled, you can + ;; press and release a modifier key before pressing the + ;; key to be modified, like how the ESC key works always. + ;; If you hold the modifier key down, however, you still + ;; get the standard behavior. I personally think this + ;; is the best thing since sliced bread (and a *major* + ;; win when it comes to reducing Emacs pinky), but it's + ;; disorienting at first so I'm not enabling it here by + ;; default. + + ;;(setq modifier-keys-are-sticky t) + + ;; This changes the variable which controls the text that goes + ;; in the top window title bar. (However, it is not changed + ;; unless it currently has the default value, to avoid + ;; interfering with a -wn command line argument I may have + ;; started emacs with.) + (if (equal frame-title-format "%S: %b") + (setq frame-title-format + (concat "%S: " invocation-directory invocation-name + " [" emacs-version "]" + (if nil ; (getenv "NCD") + "" + " %b")))) + + ;; If we're running on display 0, load some nifty sounds that + ;; will replace the default beep. But if we're running on a + ;; display other than 0, which probably means my NCD X terminal, + ;; which can't play digitized sounds, do two things: reduce the + ;; beep volume a bit, and change the pitch of the sound that is + ;; made for "no completions." + ;; + ;; (Note that sampled sounds only work if XEmacs was compiled + ;; with sound support, and we're running on the console of a + ;; Sparc, HP, or SGI machine, or on a machine which has a + ;; NetAudio server; otherwise, you just get the standard beep.) + ;; + ;; (Note further that changing the pitch and duration of the + ;; standard beep only works with some X servers; many servers + ;; completely ignore those parameters.) + ;; + (cond ((or (and (getenv "DISPLAY") + (string-match ":0" (getenv "DISPLAY"))) + (and (eq (console-type) 'mswindows) + (device-sound-enabled-p))) + (load-default-sounds)) + (t + (setq bell-volume 40) + (setq sound-alist + (append sound-alist '((no-completion :pitch 500)))) + )) + + ;; Make `C-x C-m' and `C-x RET' be different (since I tend + ;; to type the latter by accident sometimes.) + (define-key global-map [(control x) return] nil) + + ;; Change the pointer used when the mouse is over a modeline + (set-glyph-image modeline-pointer-glyph "leftbutton") + + ;; Change the continuation glyph face so it stands out more + (and (fboundp 'make-face-bold) + (boundp 'continuation-glyph) + (make-face-bold (glyph-face continuation-glyph))) + + ;; Change the pointer used during garbage collection. + ;; + ;; Note that this pointer image is rather large as pointers go, + ;; and so it won't work on some X servers (such as the MIT + ;; R5 Sun server) because servers may have lamentably small + ;; upper limits on pointer size. + ;;(if (featurep 'xpm) + ;; (set-glyph-image gc-pointer-glyph + ;; (expand-file-name "trash.xpm" data-directory))) + + ;; Here's another way to do that: it first tries to load the + ;; pointer once and traps the error, just to see if it's + ;; possible to load that pointer on this system; if it is, + ;; then it sets gc-pointer-glyph, because we know that + ;; will work. Otherwise, it doesn't change that variable + ;; because we know it will just cause some error messages. + (if (featurep 'xpm) + (let ((file (expand-file-name "recycle.xpm" data-directory))) + (if (condition-case error + ;; check to make sure we can use the pointer. + (make-image-instance file nil + '(pointer)) + (error nil)) ; returns nil if an error occurred. + (set-glyph-image gc-pointer-glyph file)))) + + (when (featurep 'menubar) + ;; Add `dired' to the File menu + (add-menu-button '("File") ["Edit Directory" dired t]) + + ;; Here's a way to add scrollbar-like buttons to the menubar + (add-menu-button nil ["Top" beginning-of-buffer t]) + (add-menu-button nil ["<<<" scroll-down t]) + (add-menu-button nil [" . " recenter t]) + (add-menu-button nil [">>>" scroll-up t]) + (add-menu-button nil ["Bot" end-of-buffer t])) + + ;; Change the behavior of mouse button 2 (which is normally + ;; bound to `mouse-yank'), so that it inserts the selected text + ;; at point (where the text cursor is), instead of at the + ;; position clicked. + ;; + ;; Note that you can find out what a particular key sequence or + ;; mouse button does by using the "Describe Key..." option on + ;; the Help menu. + (setq mouse-yank-at-point t) + + ;; When editing C code (and Lisp code and the like), I often + ;; like to insert tabs into comments and such. It gets to be + ;; a pain to always have to use `C-q TAB', so I set up a more + ;; convenient binding. Note that this does not work in + ;; TTY frames, where tab and shift-tab are indistinguishable. + (define-key global-map '(shift tab) 'self-insert-command) + + ;; LISPM bindings of Control-Shift-C and Control-Shift-E. + ;; Note that "\C-C" means Control-C, not Control-Shift-C. + ;; To specify shifted control characters, you must use the + ;; more verbose syntax used here. + (define-key emacs-lisp-mode-map '(control C) 'compile-defun) + (define-key emacs-lisp-mode-map '(control E) 'eval-defun) + + ;; If you like the FSF Emacs binding of button3 (single-click + ;; extends the selection, double-click kills the selection), + ;; uncomment the following: + + ;; Under 19.13, the following is enough: + ;(define-key global-map 'button3 'mouse-track-adjust) + + ;; But under 19.12, you need this: + ;(define-key global-map 'button3 + ; (lambda (event) + ; (interactive "e") + ; (let ((default-mouse-track-adjust t)) + ; (mouse-track event)))) + + ;; Under both 19.12 and 19.13, you also need this: + ;(add-hook 'mouse-track-click-hook + ; (lambda (event count) + ; (if (or (/= (event-button event) 3) + ; (/= count 2)) + ; nil ;; do the normal operation + ; (kill-region (point) (mark)) + ; t ;; don't do the normal operations. + ; ))) + + )) + + )) + +;; Oh, and here's a cute hack you might want to put in the sample .emacs +;; file: it changes the color of the window if it's not on the local +;; machine, or if it's running as root: + +;; local emacs background: whitesmoke +;; remote emacs background: palegreen1 +;; root emacs background: coral2 +(cond + ((and (string-match "XEmacs" emacs-version) + (eq window-system 'x) + (boundp 'emacs-major-version) + (= emacs-major-version 19) + (>= emacs-minor-version 12)) + (let* ((root-p (eq 0 (user-uid))) + (dpy (or (getenv "DISPLAY") "")) + (remote-p (not + (or (string-match "^\\(\\|unix\\|localhost\\):" dpy) + (let ((s (system-name))) + (if (string-match "\\.\\(netscape\\|mcom\\)\\.com" s) + (setq s (substring s 0 (match-beginning 0)))) + (string-match (concat "^" (regexp-quote s)) dpy))))) + (bg (cond (root-p "coral2") + (remote-p "palegreen1") + (t nil)))) + (cond (bg + (let ((def (color-name (face-background 'default))) + (faces (face-list))) + (while faces + (let ((obg (face-background (car faces)))) + (if (and obg (equal def (color-name obg))) + (set-face-background (car faces) bg))) + (setq faces (cdr faces))))))))) + + +;;; Older versions of emacs did not have these variables +;;; (emacs-major-version and emacs-minor-version.) +;;; Let's define them if they're not around, since they make +;;; it much easier to conditionalize on the emacs version. + +(if (and (not (boundp 'emacs-major-version)) + (string-match "^[0-9]+" emacs-version)) + (setq emacs-major-version + (string-to-int (substring emacs-version + (match-beginning 0) (match-end 0))))) +(if (and (not (boundp 'emacs-minor-version)) + (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version)) + (setq emacs-minor-version + (string-to-int (substring emacs-version + (match-beginning 1) (match-end 1))))) + +;;; Define a function to make it easier to check which version we're +;;; running. + +(defun running-emacs-version-or-newer (major minor) + (or (> emacs-major-version major) + (and (= emacs-major-version major) + (>= emacs-minor-version minor)))) + +(cond ((and running-xemacs + (running-emacs-version-or-newer 19 6)) + ;; + ;; Code requiring XEmacs/Lucid Emacs version 19.6 or newer goes here + ;; + )) + +(cond ((>= emacs-major-version 19) + ;; + ;; Code for any vintage-19 emacs goes here + ;; + )) + +(cond ((and (not running-xemacs) + (>= emacs-major-version 19)) + ;; + ;; Code specific to FSF Emacs 19 (not XEmacs/Lucid Emacs) goes here + ;; + )) + +(cond ((< emacs-major-version 19) + ;; + ;; Code specific to emacs 18 goes here + ;; + )) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Customization of Specific Packages ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Load gnuserv, which will allow you to connect to XEmacs sessions +;;; using `gnuclient'. + +;; If you never run more than one XEmacs at a time, you might want to +;; always start gnuserv. Otherwise it is preferable to specify +;; `-f gnuserv-start' on the command line to one of the XEmacsen. +; (gnuserv-start) + + +;;; ******************** +;;; Load efs, which uses the FTP protocol as a pseudo-filesystem. +;;; When this is loaded, the pathname syntax /user@host:/remote/path +;;; refers to files accessible through ftp. +;;; +(require 'dired) +;; compatible ange-ftp/efs initialization derived from code +;; from John Turner +;; As of 19.15, efs is bundled instead of ange-ftp. +;; NB: doesn't handle 20.0 properly, efs didn't appear until 20.1. +;; +;; The environment variable EMAIL_ADDRESS is used as the password +;; for access to anonymous ftp sites, if it is set. If not, one is +;; constructed using the environment variables USER and DOMAINNAME +;; (e.g. turner@lanl.gov), if set. + +(if (and running-xemacs + (or (> emacs-major-version 20) + (and (= emacs-major-version 20) (>= emacs-minor-version 1)) + (and (= emacs-major-version 19) (>= emacs-minor-version 15)))) + (progn + (message "Loading and configuring bundled packages... efs") + (require 'efs-auto) + (if (getenv "USER") + (setq efs-default-user (getenv "USER"))) + (if (getenv "EMAIL_ADDRESS") + (setq efs-generate-anonymous-password (getenv "EMAIL_ADDRESS")) + (if (and (getenv "USER") + (getenv "DOMAINNAME")) + (setq efs-generate-anonymous-password + (concat (getenv "USER")"@"(getenv "DOMAINNAME"))))) + (setq efs-auto-save 1)) + (progn + (message "Loading and configuring bundled packages... ange-ftp") + (require 'ange-ftp) + (if (getenv "USER") + (setq ange-ftp-default-user (getenv "USER"))) + (if (getenv "EMAIL_ADDRESS") + (setq ange-ftp-generate-anonymous-password (getenv "EMAIL_ADDRESS")) + (if (and (getenv "USER") + (getenv "DOMAINNAME")) + (setq ange-ftp-generate-anonymous-password + (concat (getenv "USER")"@"(getenv "DOMAINNAME"))))) + (setq ange-ftp-auto-save 1) + ) + ) + +;;; ******************** +;;; Load the default-dir.el package which installs fancy handling +;;; of the initial contents in the minibuffer when reading +;;; file names. + +(if (and running-xemacs + (or (and (= emacs-major-version 20) (>= emacs-minor-version 1)) + (and (= emacs-major-version 19) (>= emacs-minor-version 15)))) + (require 'default-dir)) + +;;; ******************** +;;; Load the auto-save.el package, which lets you put all of your autosave +;;; files in one place, instead of scattering them around the file system. +;;; +(setq auto-save-directory (expand-file-name "~/autosave/") + auto-save-directory-fallback auto-save-directory + auto-save-hash-p nil + efs-auto-save t + efs-auto-save-remotely nil + ;; now that we have auto-save-timeout, let's crank this up + ;; for better interactive response. + auto-save-interval 2000 + ) +;; We load this afterwards because it checks to make sure the +;; auto-save-directory exists (creating it if not) when it's loaded. +(require 'auto-save) + +;; This adds additional extensions which indicate files normally +;; handled by cc-mode. +(setq auto-mode-alist + (append '(("\\.C$" . c++-mode) + ("\\.cc$" . c++-mode) + ("\\.hh$" . c++-mode) + ("\\.c$" . c-mode) + ("\\.h$" . c-mode)) + auto-mode-alist)) + + +;;; ******************** +;;; cc-mode (the mode you're in when editing C, C++, and Objective C files) + +;; Tell cc-mode not to check for old-style (K&R) function declarations. +;; This speeds up indenting a lot. +(setq c-recognize-knr-p nil) + +;; Change the indentation amount to 4 spaces instead of 2. +;; You have to do it in this complicated way because of the +;; strange way the cc-mode initializes the value of `c-basic-offset'. +(add-hook 'c-mode-hook (lambda () (setq c-basic-offset 4))) + + +;;; ******************** +;;; Load a partial-completion mechanism, which makes minibuffer completion +;;; search multiple words instead of just prefixes; for example, the command +;;; `M-x byte-compile-and-load-file RET' can be abbreviated as `M-x b-c-a RET' +;;; because there are no other commands whose first three words begin with +;;; the letters `b', `c', and `a' respectively. +;;; +(load-library "completer") + + +;;; ******************** +;;; Load crypt, which is a package for automatically decoding and reencoding +;;; files by various methods - for example, you can visit a .Z or .gz file, +;;; edit it, and have it automatically re-compressed when you save it again. +;;; +(setq crypt-encryption-type 'pgp ; default encryption mechanism + crypt-confirm-password t ; make sure new passwords are correct + ;crypt-never-ever-decrypt t ; if you don't encrypt anything, set this to + ; tell it not to assume that "binary" files + ; are encrypted and require a password. + ) +(require 'crypt) + + +;;; ******************** +;;; Edebug is a source-level debugger for emacs-lisp programs. +;;; +(define-key emacs-lisp-mode-map "\C-xx" 'edebug-defun) + + +;;; ******************** +;;; Font-Lock is a syntax-highlighting package. When it is enabled and you +;;; are editing a program, different parts of your program will appear in +;;; different fonts or colors. For example, with the code below, comments +;;; appear in red italics, function names in function definitions appear in +;;; blue bold, etc. The code below will cause font-lock to automatically be +;;; enabled when you edit C, C++, Emacs-Lisp, and many other kinds of +;;; programs. +;;; +;;; The "Options" menu has some commands for controlling this as well. +;;; +(cond (running-xemacs + + ;; If you want the default colors, you could do this: + ;; (setq font-lock-use-default-fonts nil) + ;; (setq font-lock-use-default-colors t) + ;; but I want to specify my own colors, so I turn off all + ;; default values. + (setq font-lock-use-default-fonts nil) + (setq font-lock-use-default-colors nil) + + (require 'font-lock) + + ;; Mess around with the faces a bit. Note that you have + ;; to change the font-lock-use-default-* variables *before* + ;; loading font-lock, and wait till *after* loading font-lock + ;; to customize the faces. + + ;; string face is green + (set-face-foreground 'font-lock-string-face "forest green") + + ;; comments are italic and red; doc strings are italic + ;; + ;; (I use copy-face instead of make-face-italic/make-face-bold + ;; because the startup code does intelligent things to the + ;; 'italic and 'bold faces to ensure that they are different + ;; from the default face. For example, if the default face + ;; is bold, then the 'bold face will be unbold.) + (copy-face 'italic 'font-lock-comment-face) + ;; Underlining comments looks terrible on tty's + (set-face-underline-p 'font-lock-comment-face nil 'global 'tty) + (set-face-highlight-p 'font-lock-comment-face t 'global 'tty) + (copy-face 'font-lock-comment-face 'font-lock-doc-string-face) + (set-face-foreground 'font-lock-comment-face "red") + + ;; function names are bold and blue + (copy-face 'bold 'font-lock-function-name-face) + (set-face-foreground 'font-lock-function-name-face "blue") + + ;; misc. faces + (and (find-face 'font-lock-preprocessor-face) ; 19.13 and above + (copy-face 'bold 'font-lock-preprocessor-face)) + (copy-face 'italic 'font-lock-type-face) + (copy-face 'bold 'font-lock-keyword-face) + )) + + +;;; ******************** +;;; fast-lock is a package which speeds up the highlighting of files +;;; by saving information about a font-locked buffer to a file and +;;; loading that information when the file is loaded again. This +;;; requires a little extra disk space be used. +;;; +;;; Normally fast-lock puts the cache file (the filename appended with +;;; .flc) in the same directory as the file it caches. You can +;;; specify an alternate directory to use by setting the variable +;;; fast-lock-cache-directories. + +;; Let's use lazy-lock instead. +;;(add-hook 'font-lock-mode-hook 'turn-on-fast-lock) +;;(setq fast-lock-cache-directories '("/foo/bar/baz")) + + +;;; ******************** +;;; lazy-lock is a package which speeds up the highlighting of files +;;; by doing it "on-the-fly" -- only the visible portion of the +;;; buffer is fontified. The results may not always be quite as +;;; accurate as using full font-lock or fast-lock, but it's *much* +;;; faster. No more annoying pauses when you load files. + +(add-hook 'font-lock-mode-hook 'turn-on-lazy-lock) +;; I personally don't like "stealth mode" (where lazy-lock starts +;; fontifying in the background if you're idle for 30 seconds) +;; because it takes too long to wake up again on my piddly Sparc 1+. +(setq lazy-lock-stealth-time nil) + + +;;; ******************** +;;; func-menu is a package that scans your source file for function +;;; definitions and makes a menubar entry that lets you jump to any +;;; particular function definition by selecting it from the menu. The +;;; following code turns this on for all of the recognized languages. +;;; Scanning the buffer takes some time, but not much. +;;; +;;; Send bug reports, enhancements etc to: +;;; David Hughes +;;; +(cond (running-xemacs + (require 'func-menu) + (define-key global-map 'f8 'function-menu) + (add-hook 'find-file-hooks 'fume-add-menubar-entry) + (define-key global-map "\C-cl" 'fume-list-functions) + (define-key global-map "\C-cg" 'fume-prompt-function-goto) + + ;; The Hyperbole information manager package uses (shift button2) and + ;; (shift button3) to provide context-sensitive mouse keys. If you + ;; use this next binding, it will conflict with Hyperbole's setup. + ;; Choose another mouse key if you use Hyperbole. + (define-key global-map '(shift button3) 'mouse-function-menu) + + ;; For descriptions of the following user-customizable variables, + ;; type C-h v + (setq fume-max-items 25 + fume-fn-window-position 3 + fume-auto-position-popup t + fume-display-in-modeline-p t + fume-menubar-menu-location "File" + fume-buffer-name "*Function List*" + fume-no-prompt-on-valid-default nil) + )) + + +;;; ******************** +;;; MH is a mail-reading system from the Rand Corporation that relies on a +;;; number of external filter programs (which do not come with emacs.) +;;; Emacs provides a nice front-end onto MH, called "mh-e". +;;; +;; Bindings that let you send or read mail using MH +;(global-set-key "\C-xm" 'mh-smail) +;(global-set-key "\C-x4m" 'mh-smail-other-window) +;(global-set-key "\C-cr" 'mh-rmail) + +;; Customization of MH behavior. +(setq mh-delete-yanked-msg-window t) +(setq mh-yank-from-start-of-msg 'body) +(setq mh-summary-height 11) + +;; Use lines like the following if your version of MH +;; is in a special place. +;(setq mh-progs "/usr/dist/pkgs/mh/bin.svr4/") +;(setq mh-lib "/usr/dist/pkgs/mh/lib.svr4/") + + +;;; ******************** +;;; resize-minibuffer-mode makes the minibuffer automatically +;;; resize as necessary when it's too big to hold its contents. + +(autoload 'resize-minibuffer-mode "rsz-minibuf" nil t) +(resize-minibuffer-mode) +(setq resize-minibuffer-window-exactly nil) + +;;; ******************** +;;; W3 is a browser for the World Wide Web, and takes advantage of the very +;;; latest redisplay features in XEmacs. You can access it simply by typing +;;; 'M-x w3'; however, if you're unlucky enough to be on a machine that is +;;; behind a firewall, you will have to do something like this first: + +;(setq w3-use-telnet t +; ;; +; ;; If the Telnet program you use to access the outside world is +; ;; not called "telnet", specify its name like this. +; w3-telnet-prog "itelnet" +; ;; +; ;; If your Telnet program adds lines of junk at the beginning +; ;; of the session, specify the number of lines here. +; w3-telnet-header-length 4 +; ) diff --git a/etc/sample.init.el b/etc/sample.init.el index 538308a..ef6ec7f 100644 --- a/etc/sample.init.el +++ b/etc/sample.init.el @@ -24,20 +24,16 @@ ;; Boston, MA 02111-1307, USA. ;; #### to do: -;; -- scan for #### markers and fix the problems noted there. -;; -- #### maybe the setqs in this file should be changed to defvars -;; to avoid tromping on customizations when custom.el is loaded -;; early (dv and sjt at least favor making this the default) -;; -- #### update documentation in (lispref)Starting Up XEmacs, in -;; (xemacs)Entering Emacs, and in (custom), then point to them -;; instead of going into detail here. - -;;; This is a sample init file. It can be used without modification -;;; as your init.el or .emacs. In older versions of XEmacs, this file -;;; was called .emacs and placed in your home directory. (Under MS -;;; Windows, that directory is controlled by the HOME environment -;;; variable and defaults to C:\. You can find out where XEmacs -;;; thinks your home directory is using +;; -- #### figure out how init.el and custom.el interact and put +;; documentation about it here. (perhaps it already exists +;; elsewhere?) + +;;; This is a sample init.el file. It can be used without +;;; modification as your init.el or .emacs. In older versions of +;;; XEmacs, this file was called .emacs and placed in your home +;;; directory. (Under MS Windows, that directory is controlled by the +;;; HOME environment variable and defaults to C:\. You can find out +;;; where XEmacs thinks your home directory is using ;;; ;;; ESC : (expand-file-name "~") ;;; @@ -56,9 +52,7 @@ ;;; The language that this file (and most other XEmacs init files) is ;;; written in is called "XEmacs Lisp" or more commonly "Elisp". -;;; Brief descriptions of how the init process works and how to -;;; accomplish many useful customizations are given below in this -;;; file. There are many sources of further information: +;;; There are many sources of further information: ;;; -- the XEmacs User's Manual (Access using the online Info browser: ;;; Use `Help->Info (Online Docs)->XEmacs User's Manual' (if @@ -127,130 +121,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Theory of Operation ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; XEmacs allows you to make persistent changes to editor behavior by -;;; saving code in files which are by default loaded at startup. - -;; These files are just Lisp libraries with names built in to XEmacs. -;; There are files for the use of the user (the init file and the -;; custom file), for the site administrator (default.el and -;; site-start.el), and for the XEmacs maintainers (auto-autoloads -;; files). See the Lispref for user and site files (node Starting Up -;; XEmacs, currently inaccurate (it doesn't describe the custom -;; file)). Interactions among the files are complex; see -;; lisp/startup.el for details. - -;; Briefly, after very basic initializations including processing a -;; special command line options (including GUI toolkit options), -;; setting up the terminal, and setting up `load-path', it executes -;; customization code as follows: - -;; 1. It runs the normal hook `before-init-hook'. -;; 2. It loads the library `site-start' (by default `site-start.el'). -;; 3. It loads the init file (by default `~/.xemacs/init.el'). -;; 4. It loads the custom file (by default `~/.xemacs/custom.el'). -;; 5. It loads the library `default' (by default `default.el'). -;; 6. It runs the normal hook `after-init-hook'. - -;; After this the *scratch* buffer is set up and the remaining command -;; line arguments (actions and file names) are processed. - -;; N.B. Switching the order of steps 3 and 4 is under discussion and -;; favored by several core developers. - -;; Step 2 is inhibited by the -no-site-file command line switch. -;; Steps 3 and 4 are inhibited (as a unit) by the -no-init-file -;; command line switch (-q is a convenient synonym). Step 5 is -;; inhibited by -no-init-file or a non-nil value of -;; `inhibit-default-init' (set it in the init file). From now on the -;; hooks and the site initialization files will be ignored. - -;; The custom file and the init file contain customizations managed by -;; XEmacs itself via the Custom subsystem and manual customizations, -;; respectively. Originally both were placed in the same file, -;; usually ~/.emacs, but occasionally XEmacs would trash user settings -;; when automatically changing options, and more frequently users -;; would trash the automatically generated code. So these functions -;; have been reallocated to separate files, usually named custom.el -;; and init.el, respectively. - -;; The Custom system is accessed most conveniently from the -;; Options->Advanced (Customize) menu (also, the Options->Fonts and -;; Options->Sizes menus are implicitly managed by Custom, and -;; Options->Edit Faces explicitly invokes Custom). You can also use -;; the suite of customize commands directly (cf C-h a customize RET). -;; Currently, Custom possesses specialized facilities for setting -;; ordinary variables of many types, and for customizing faces. As a -;; general rule, variable and face initialization should be done using -;; Custom, and other initializations should be done in the init file. - -;; A possible exception is a subsystem with its own complex init file, -;; eg, Gnus and .gnus. In these cases it is often preferable to keep -;; even simple variable initializations together, and you may wish to -;; maintain these configurations by hand. - -;; You should avoid editing the custom file by hand. The syntax used -;; is complex but concise, and it is easy to silently break the whole -;; file with a single error that happens to result in a valid Lisp -;; form. On the other hand, the init file is just a Lisp library that -;; is loaded before starting the read-eval-redisplay loop. - -;; The interactions between the custom file and other init files are -;; governed by a simple idea: - -;; Custom to User: ALL VARIABLES YOURS OURS NOW ARE. - -;; To be precise, Custom is pretty good about noticing and respecting -;; existing settings in interactive use. However, it is weak in -;; understanding advanced use of specifier variables (these are used -;; for customizations which depend on display characteristics and -;; configuration in complex ways), and can be quite brutal at -;; initialization. - -;; Normal practice for Custom at initialization is to (1) reset all -;; customized faces before applying customizations and (2) force all -;; variables to the values specified in custom.el. For this reason, -;; and because it is generally the case that the init file can -;; usefully depend on customized variables, but Custom pays no -;; attention to behavior of the init file, it is probably a good idea -;; to force custom.el to be loaded before the init file. (As -;; mentioned, this will probably become the default in future versions -;; of XEmacs.) - -;; To enable early loading of custom.el, uncomment the following line: -;(setq Init-inhibit-custom-file-p (not (assoc custom-file load-history))) - -;; Code to implement early loading where late loading is the default. -;; A crucial snippet of code must be the last thing in this file. - -;; defvars only initialize uninitialized variables; if the setq above -;; is active, the variable below is defined but the value will not be -;; altered. -(defvar Init-inhibit-custom-file-p nil - "Internal user init flag. Don't use this yourself. - -Non-nil if we need to inhibit XEmacs from loading custom.el after init.el.") - -(when Init-inhibit-custom-file-p - ;; This is the default custom-file. - (let ((file (expand-file-name "~/.xemacs/custom.el"))) - (add-one-shot-hook 'after-init-hook - `(lambda () (setq custom-file ,file))) - (cond ((file-readable-p file) - (load file)) - ((file-exists-p file) - (warn "Existing custom file \"%s\" is not readable!" file))) - (cond ((not (file-exists-p file)) - (display-warning ' resource - (format "Custom file \"%s\" not found." file) - 'info)) - ((not (file-writable-p file)) - (warn "Existing custom file \"%s\" is not writable!" file))))) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Basic Customization ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -356,14 +226,6 @@ argument are optional. Only the Non-nil arguments are used in the test." ; ;; ; )) -(defun Init-safe-require (feat) -"Try to REQUIRE the specified feature. Errors occurring are silenced. -\(Perhaps in the future there will be a way to get at the error.) -Returns t if the feature was successfully required." - (condition-case nil - (progn (require feat) t) - (error nil))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Key Definitions ;; @@ -411,12 +273,6 @@ Returns t if the feature was successfully required." ;; the line, but that messes up the common idiom `f8 move-cursor f4'. (defun Init-kill-entire-line (&optional arg) -"Kill the entire line. -With prefix argument, kill that many lines from point. Negative -arguments kill lines backward. - -When calling from a program, nil means \"no arg\", -a number counts as a prefix arg." (interactive "*P") (let ((kill-whole-line t)) (beginning-of-line) @@ -753,11 +609,14 @@ backward, and defaults to 1. Buffers whose name begins with a space ;; Make sure we get Windows-like shifted-motion key selection behavior ;; on recent XEmacs versions. -(cond ((boundp 'shifted-motion-keys-select-region) - (setq shifted-motion-keys-select-region t)) - ;; otherwise, try the pc-select package -- - ((Init-safe-require 'pc-select) - (pc-select-mode 1))) +(if (boundp 'shifted-motion-keys-select-region) + (setq shifted-motion-keys-select-region t) + ;; otherwise, try the pc-select package -- + (condition-case nil + (progn + (require 'pc-select) + (pc-select-mode 1)) + (error nil))) ;; The following commented-out code rearranges the keymap in an ;; unconventional but extremely useful way for programmers. Parens @@ -790,13 +649,6 @@ backward, and defaults to 1. Buffers whose name begins with a space ;; Useful programming-related keystrokes. (defun describe-foo-at-point () - "Show the documentation of the Elisp function and variable near point. -This checks in turn: - --- for a function name where point is --- for a variable name where point is --- for a surrounding function call -" (interactive) (let (sym) ;; sigh, function-at-point is too clever. we want only the first half. @@ -895,86 +747,42 @@ This lets you figure out where time is being spent when executing Lisp code." 'kill-current-buffer-and-window) (defun kill-current-buffer () - "Kill the current buffer (prompting if it is modified)." (interactive) (kill-buffer (current-buffer))) (defun kill-current-buffer-and-window () - "Kill the current buffer (prompting if it is modified) and its window." (interactive) (kill-buffer (current-buffer)) (delete-window)) -(defvar grep-all-files-history nil) - -(defvar grep-all-files-omitted-expressions - '("*~" "#*" ".#*" ",*" "*.elc" "*.obj" "*.o" "*.exe" "*.dll" "*.lib" "*.a" - "*.dvi" "*.class" "*.bin") - "List of expressions matching files to be omitted in `grep-all-files-...'. -Each entry should be a simple name or a shell wildcard expression.") - -(defvar grep-all-files-omitted-directories '("CVS" "RCS" "SCCS") - "List of directories not to recurse into in `grep-all-files-...'. -Each entry should be a simple name or a shell wildcard expression.") - -(defun construct-grep-all-files-command (find-segment grep-segment) - (let ((omit-annoying - (mapconcat #'(lambda (wildcard) - (concat "-name '" wildcard "' -or ")) - grep-all-files-omitted-expressions - ""))) - (cond ((eq grep-find-use-xargs 'gnu) - (format "find . %s %s -type f -print0 | xargs -0 -e %s" - find-segment omit-annoying grep-segment)) - (grep-find-use-xargs - (format "find . %s %s -type f -print | xargs %s" - find-segment omit-annoying grep-segment)) - (t - (format "find . %s %s -type f -exec %s {} /dev/null \\;" - find-segment omit-annoying grep-segment))))) - -(defun grep-all-files-in-current-directory (command) - "Run `grep' in all non-annoying files in the current directory. -`Non-annoying' excludes backup files, autosave files, CVS merge files, etc. -More specifically, this is controlled by `grep-all-files-omitted-expressions'. - -This function does not recurse into subdirectories. If you want this, -use \\[grep-all-files-in-current-directory-and-below]." - (interactive - (progn - (require 'compile) - (list (read-shell-command "Run grep (like this): " - grep-command 'grep-all-files-history)))) +(defun grep-c-files () + (interactive) (require 'compile) - (grep (construct-grep-all-files-command - "-name . -or -type d -prune -or" command))) - -(defun grep-all-files-in-current-directory-and-below (command) - "Run `grep' in all non-annoying files in the current directory and below. -`Non-annoying' excludes backup files, autosave files, CVS merge files, etc. -More specifically, this is controlled by `grep-all-files-omitted-expressions'. - -This function recurses into subdirectories. If you do not want this, -use \\[grep-all-files-in-current-directory]." - (interactive - (progn - (require 'compile) - (list (read-shell-command "Run grep (like this): " - grep-command 'grep-all-files-history)))) + (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))) + +(defun grep-lisp-files () + (interactive) (require 'compile) - (grep (construct-grep-all-files-command - ;; prune all specified directories. - (mapconcat #'(lambda (wildcard) - (concat "-name '" wildcard "' -prune -or ")) - grep-all-files-omitted-directories - "") - command))) + (let ((grep-command + (cons (concat grep-command " *.el" + ; i wanted to also use *.cc and *.hh. + ; see long comment below under Perl. + ) + (length grep-command)))) + (call-interactively 'grep))) + +;; This repeatedly selects larger and larger balanced expressions +;; around the cursor. Once you have such an expression marked, you +;; can expand to the end of the following expression with C-M-SPC and +;; to the beginning of the previous with M-left. (defun clear-select () - "Repeatedly select ever larger balanced expressions around the cursor. -Once you have such an expression marked, you can expand to the end of -the following expression with \\[mark-sexp] and to the beginning of the -previous with \\[backward-sexp]." (interactive "_") ;this means "preserve the active region after this command" (backward-up-list 1) (let ((end (save-excursion (forward-sexp) (point)))) @@ -984,8 +792,8 @@ previous with \\[backward-sexp]." ;; -- always reports as /. #### this should be fixable. (global-set-key 'kp-add 'query-replace) (global-set-key '(shift kp-add) 'query-replace-regexp) -(global-set-key '(control kp-add) 'grep-all-files-in-current-directory) -(global-set-key '(meta kp-add) 'grep-all-files-in-current-directory-and-below) +(global-set-key '(control kp-add) 'grep-c-files) +(global-set-key '(meta kp-add) 'grep-lisp-files) (global-set-key 'clear 'clear-select) ;; Note that you can use a "lambda" expression (an anonymous function) ;; in place of a function name. This function would be called @@ -995,7 +803,7 @@ previous with \\[backward-sexp]." ;; buffer, etc.). (global-set-key 'kp-enter (lambda () (interactive) (set-mark-command t))) (global-set-key '(shift kp-enter) 'repeat-complex-command) -(global-set-key 'pause 'repeat-complex-command) ;; useful on Windows-style kbds +(global-set-key 'pause 'repeat-complex-command) ;; useful on Windows-stlye kbds (global-set-key '(control kp-enter) 'eval-expression) ;;;;;;;;;;;;;;;;;;;;;;;; @@ -1064,8 +872,11 @@ previous with \\[backward-sexp]." ;;; rather than append -- standard behavior under all window systems ;;; nowadays. -(if (fboundp 'pending-delete-mode) - (pending-delete-mode 1)) +(pending-delete-mode 1) + +;;; enable region selection with shift+arrows (on by default in 21.5 +;;; and up) +(setq shifted-motion-keys-select-region t) ;;; NOTE: In this context, `windows-nt' actually refers to all MS ;;; Windows operating systems! @@ -1078,33 +889,15 @@ previous with \\[backward-sexp]." ;(setq user-full-name "Ben Wing") ;(setq smtpmail-smtp-server "pop.tcsn.uswest.net") - ;; Make Meta+accelerator traverse to the menu in new enough XEmacs + ;; Make Alt+accelerator traverse to the menu in new enough XEmacs ;; versions. Note that this only overrides Meta bindings that would - ;; actually invoke a menu, and the most common commands that are - ;; overridden have preferred alternative bindings using the arrow - ;; keys. You can always access the overridden ones using - ;; Shift+Meta+Key. (Note that "Alt" and "Meta" normally refer to the - ;; same key, except on some Sun keyboards [where "Meta" is actually - ;; labelled with a diamond] or if you have explicitly made them - ;; different under X Windows using `xmodmap'.) - ;; - ;; More specifically, the following bindings are overridden: - ;; - ;; M-f (use C-right or Sh-M-f instead) - ;; M-e (use M-C-right or Sh-M-e instead) - ;; M-v (use Prior aka PgUp or Sh-M-v instead) - ;; M-m (use Sh-M-m instead) - ;; M-t (use Sh-M-t instead) - ;; M-o (normally undefined) - ;; M-b (use C-left or Sh-M-b instead) - ;; M-h (use M-e h or Sh-M-h instead) - ;; in Lisp mode, M-l (use Sh-M-l instead) - ;; in C mode, M-c (use Sh-M-c instead) - + ;; actually invoke a menu, and that none of the most common commands + ;; are overridden. You can use ESC+key to access the overridden + ;; ones if necessary. (setq menu-accelerator-enabled 'menu-force) ;; Make Cygwin `make' work inside a shell buffer. - (if (boundp 'setenv) (setenv "MAKE_MODE" "UNIX"))) + (setenv "MAKE_MODE" "UNIX")) ;; This shows how to set up the XEmacs side of tags. (To create the ;; TAGS table, use the `etags' program found in the XEmacs bin @@ -1155,20 +948,16 @@ previous with \\[backward-sexp]." ;; has a NetAudio or ESD server, or on the console of a Linux, Sparc, ;; HP, or SGI machine. Otherwise, you just get the standard beep.) -(cond ((and (fboundp 'load-default-sounds) - (or (and (getenv "DISPLAY") - (string-match ":0" (getenv "DISPLAY"))) - (and (eq (console-type) 'mswindows) - (device-sound-enabled-p)))) - (condition-case nil - (progn - (load-default-sounds) - ;; On Windows, at least, the sound "quiet-beep", which is normally - ;; given the symbolic name `quiet' and is used for Quit and such, - ;; is just totally disgusting. So make this name correspond to a - ;; more innocuous sound. - (load-sound-file "drum-beep" 'quiet 80)) - (error nil))) +(cond ((or (and (getenv "DISPLAY") + (string-match ":0" (getenv "DISPLAY"))) + (and (eq (console-type) 'mswindows) + (device-sound-enabled-p))) + (load-default-sounds) + ;; On Windows, at least, the sound "quiet-beep", which is normally + ;; given the symbolic name `quiet' and is used for Quit and such, + ;; is just totally disgusting. So make this name correspond to a + ;; more innocuous sound. + (load-sound-file "drum-beep" 'quiet 80)) (t (setq bell-volume 40) (setq sound-alist @@ -1318,15 +1107,49 @@ previous with \\[backward-sexp]." ;;; When this is loaded, the pathname syntax /user@host:/remote/path ;;; refers to files accessible through ftp. ;;; -(Init-safe-require 'dired) +(require 'dired) +;; compatible ange-ftp/efs initialization derived from code +;; from John Turner +;; +;; The environment variable EMAIL_ADDRESS is used as the password +;; for access to anonymous ftp sites, if it is set. If not, one is +;; constructed using the environment variables USER and DOMAINNAME +;; (e.g. turner@lanl.gov), if set. + +(condition-case nil + (progn + (require 'efs-auto) + (if (getenv "USER") + (setq efs-default-user (getenv "USER"))) + (if (getenv "EMAIL_ADDRESS") + (setq efs-generate-anonymous-password (getenv "EMAIL_ADDRESS")) + (if (and (getenv "USER") + (getenv "DOMAINNAME")) + (setq efs-generate-anonymous-password + (concat (getenv "USER")"@"(getenv "DOMAINNAME"))))) + (setq efs-auto-save 1)) + (error + (require 'ange-ftp) + (if (getenv "USER") + (setq ange-ftp-default-user (getenv "USER"))) + (if (getenv "EMAIL_ADDRESS") + (setq ange-ftp-generate-anonymous-password (getenv "EMAIL_ADDRESS")) + (if (and (getenv "USER") + (getenv "DOMAINNAME")) + (setq ange-ftp-generate-anonymous-password + (concat (getenv "USER")"@"(getenv "DOMAINNAME"))))) + (setq ange-ftp-auto-save 1) + )) -(or (Init-safe-require 'efs-auto) (Init-safe-require 'ange-ftp)) ;;; ******************** ;;; Load the default-dir.el package which installs fancy handling of ;;; the initial contents in the minibuffer when reading file names. -;; #### but it seems to cause some breakage. -;(Init-safe-require 'default-dir)) + +;(condition-case nil +; (require 'default-dir) +; (error nil)) + ;;; ******************** ;;; Put all of your autosave files in one place, instead of scattering @@ -1337,9 +1160,9 @@ previous with \\[backward-sexp]." ;;; is fast fast fast!) ;;; ;;; Unfortunately, the code that implements this (auto-save.el) is -;;; broken on Windows prior to 21.4. +;;; broken on Windows in 21.4 and earlier. (unless (and (eq system-type 'windows-nt) - (not (emacs-version>= 21 4))) + (not (emacs-version>= 21 5))) (setq auto-save-directory (expand-file-name "~/.autosave/") auto-save-directory-fallback auto-save-directory auto-save-hash-p nil @@ -1349,6 +1172,9 @@ previous with \\[backward-sexp]." ;; for better interactive response. auto-save-interval 2000 ) + ;; We load this afterwards because it checks to make sure the + ;; auto-save-directory exists (creating it if not) when it's loaded. + (require 'auto-save) ) @@ -1372,7 +1198,7 @@ previous with \\[backward-sexp]." ;;; because there are no other commands whose first three words begin with ;;; the letters `b', `c', and `a' respectively. ;;; -(Init-safe-require 'completer) +(load-library "completer") ;;; ******************** @@ -1386,7 +1212,7 @@ previous with \\[backward-sexp]." ; tell it not to assume that "binary" files ; are encrypted and require a password. ) -(Init-safe-require 'crypt) +(require 'crypt) ;;; ******************** @@ -1394,11 +1220,9 @@ previous with \\[backward-sexp]." ;;; makes filling (e.g. using M-q) much much smarter about paragraphs ;;; that are indented and/or are set off with semicolons, dashes, etc. -(Init-safe-require 'filladapt) +(require 'filladapt) (setq-default filladapt-mode t) -(when (fboundp 'turn-off-filladapt-mode) - (add-hook 'c-mode-hook 'turn-off-filladapt-mode) - (add-hook 'outline-mode-hook 'turn-off-filladapt-mode)) +(add-hook 'c-mode-hook 'turn-off-filladapt-mode) ;;; ******************** @@ -1425,7 +1249,7 @@ previous with \\[backward-sexp]." ; (setq font-lock-use-default-fonts nil) ; (setq font-lock-use-default-colors nil) - (Init-safe-require 'font-lock) + (require 'font-lock) ; ;; Mess around with the faces a bit. Note that you have ; ;; to change the font-lock-use-default-* variables *before* @@ -1461,12 +1285,10 @@ previous with \\[backward-sexp]." ;;; accurate as using full font-lock or fast-lock, but it's *much* ;;; faster. No more annoying pauses when you load files. -(if (fboundp 'turn-on-lazy-lock) - (add-hook 'font-lock-mode-hook 'turn-on-lazy-lock)) - +(add-hook 'font-lock-mode-hook 'turn-on-lazy-lock) ;; I personally don't like "stealth mode" (where lazy-lock starts ;; fontifying in the background if you're idle for 30 seconds) -;; because it takes too long to wake up again. +;; because it takes too long to wake up again on my piddly Sparc 1+. (setq lazy-lock-stealth-time nil) @@ -1480,7 +1302,8 @@ previous with \\[backward-sexp]." ;;; Send bug reports, enhancements etc to: ;;; David Hughes ;;; -(cond ((and running-xemacs (Init-safe-require 'func-menu)) +(cond (running-xemacs + (require 'func-menu) (global-set-key '(shift f12) 'function-menu) (add-hook 'find-file-hooks 'fume-add-menubar-entry) (global-set-key "\C-cl" 'fume-list-functions) @@ -1529,18 +1352,18 @@ previous with \\[backward-sexp]." ;;; ******************** ;;; resize-minibuffer-mode makes the minibuffer automatically -;;; resize as necessary when it's too small to hold its contents. +;;; resize as necessary when it's too big to hold its contents. -(when (fboundp 'resize-minibuffer-mode) - (resize-minibuffer-mode) - (setq resize-minibuffer-window-exactly nil)) +(autoload 'resize-minibuffer-mode "rsz-minibuf" nil t) +(resize-minibuffer-mode) +(setq resize-minibuffer-window-exactly nil) ;;; ******************** ;;; scroll-in-place is a package that keeps the cursor on the same line (and in the same column) when scrolling by a page using PgUp/PgDn. -(if (Init-safe-require 'scroll-in-place) - (turn-on-scroll-in-place)) +(require 'scroll-in-place) +(turn-on-scroll-in-place) ;;; ******************** @@ -1559,11 +1382,3 @@ previous with \\[backward-sexp]." ; ;; of the session, specify the number of lines here. ; w3-telnet-header-length 4 ; ) - -;;; Inhibit loading of custom-file - -;; make-temp-name returns a name which does not refer to an existing file, -;; and thus the named file is unreadable. -(when Init-inhibit-custom-file-p - (setq custom-file (make-temp-name "/tmp/non-existent-"))) - diff --git a/info/cl.info b/info/cl.info index 2715500..06f1c56 100644 --- a/info/cl.info +++ b/info/cl.info @@ -1,4 +1,5 @@ -This is ../info/cl.info, produced by makeinfo version 4.0 from cl.texi. +This is Info file ../info/cl.info, produced by Makeinfo version 1.68 +from the input file cl.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -28,79 +29,79 @@ the original English.  Indirect: -cl.info-1: 1164 -cl.info-2: 46305 -cl.info-3: 89086 -cl.info-4: 137809 -cl.info-5: 175805 -cl.info-6: 218388 +cl.info-1: 1190 +cl.info-2: 46365 +cl.info-3: 89150 +cl.info-4: 138909 +cl.info-5: 176907 +cl.info-6: 219515  Tag Table: (Indirect) -Node: Top1164 -Node: Overview2716 -Node: Usage4995 -Node: Organization5645 -Node: Installation7468 -Node: Naming Conventions8621 -Node: Program Structure10748 -Node: Argument Lists11216 -Node: Time of Evaluation20999 -Node: Function Aliases26979 -Node: Predicates27563 -Node: Type Predicates27883 -Node: Equality Predicates32925 -Node: Control Structure35701 -Node: Assignment36505 -Node: Generalized Variables37746 -Node: Basic Setf39053 -Node: Modify Macros46305 -Node: Customizing Setf53514 -Node: Variable Bindings60803 -Node: Dynamic Bindings61384 -Node: Lexical Bindings62274 -Node: Function Bindings66378 -Node: Macro Bindings68765 -Node: Conditionals71688 -Node: Blocks and Exits74771 -Node: Iteration77827 -Node: Loop Facility83300 -Node: Loop Basics84227 -Node: Loop Examples86827 -Node: For Clauses89086 -Node: Iteration Clauses100963 -Node: Accumulation Clauses102804 -Node: Other Clauses105148 -Node: Multiple Values111217 -Node: Macros113110 -Node: Declarations116328 -Node: Symbols124814 -Node: Property Lists125095 -Node: Creating Symbols127286 -Node: Numbers129364 -Node: Predicates on Numbers129844 -Node: Numerical Functions130873 -Node: Random Numbers135100 -Node: Implementation Parameters137809 -Node: Sequences141381 -Node: Sequence Basics142054 -Node: Mapping over Sequences145632 -Node: Sequence Functions151486 -Node: Searching Sequences157661 -Node: Sorting Sequences160698 -Node: Lists163246 -Node: List Functions163671 -Node: Substitution of Expressions167934 -Node: Lists as Sets169820 -Node: Association Lists173882 -Node: Hash Tables175585 -Node: Structures175805 -Node: Assertions190588 -Node: Efficiency Concerns193511 -Node: Common Lisp Compatibility199838 -Node: Old CL Compatibility202994 -Node: Porting Common Lisp207377 -Node: Function Index218388 -Node: Variable Index229537 +Node: Top1190 +Node: Overview2742 +Node: Usage5021 +Node: Organization5671 +Node: Installation7494 +Node: Naming Conventions8647 +Node: Program Structure10786 +Node: Argument Lists11254 +Node: Time of Evaluation21039 +Node: Function Aliases27019 +Node: Predicates27603 +Node: Type Predicates27923 +Node: Equality Predicates32966 +Node: Control Structure35742 +Node: Assignment36546 +Node: Generalized Variables37788 +Node: Basic Setf39095 +Node: Modify Macros46365 +Node: Customizing Setf53575 +Node: Variable Bindings60865 +Node: Dynamic Bindings61446 +Node: Lexical Bindings62336 +Node: Function Bindings66440 +Node: Macro Bindings68827 +Node: Conditionals71751 +Node: Blocks and Exits74834 +Node: Iteration77890 +Node: Loop Facility83364 +Node: Loop Basics84291 +Node: Loop Examples86891 +Node: For Clauses89150 +Node: Iteration Clauses101028 +Node: Accumulation Clauses102869 +Node: Other Clauses105213 +Node: Multiple Values111282 +Node: Macros113175 +Node: Declarations116393 +Node: Symbols124885 +Node: Property Lists125185 +Node: Creating Symbols128386 +Node: Numbers130464 +Node: Predicates on Numbers130944 +Node: Numerical Functions131973 +Node: Random Numbers136200 +Node: Implementation Parameters138909 +Node: Sequences142481 +Node: Sequence Basics143154 +Node: Mapping over Sequences146733 +Node: Sequence Functions152587 +Node: Searching Sequences158762 +Node: Sorting Sequences161800 +Node: Lists164348 +Node: List Functions164773 +Node: Substitution of Expressions169036 +Node: Lists as Sets170922 +Node: Association Lists174984 +Node: Hash Tables176687 +Node: Structures176907 +Node: Assertions191690 +Node: Efficiency Concerns194633 +Node: Common Lisp Compatibility200960 +Node: Old CL Compatibility204118 +Node: Porting Common Lisp208501 +Node: Function Index219515 +Node: Variable Index230778  End Tag Table diff --git a/info/cl.info-1 b/info/cl.info-1 new file mode 100644 index 0000000..cc97278 --- /dev/null +++ b/info/cl.info-1 @@ -0,0 +1,1039 @@ +This is Info file ../info/cl.info, produced by Makeinfo version 1.68 +from the input file cl.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Common Lisp: (cl). GNU Emacs Common Lisp emulation package. +END-INFO-DIR-ENTRY + + This file documents the GNU Emacs Common Lisp emulation package. + + Copyright (C) 1993 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. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the author instead of in +the original English. + + +File: cl.info, Node: Top, Next: Overview, Up: (dir) + +Common Lisp Extensions +********************** + +This document describes a set of Emacs Lisp facilities borrowed from +Common Lisp. All the facilities are described here in detail; for more +discussion and examples, Guy L. Steele's `Common Lisp, the Language', +second edition, is the definitive book on Common Lisp. While this +document does not assume any prior knowledge of Common Lisp, it does +assume a basic familiarity with Emacs Lisp. + +* Menu: + +* Overview:: Installation, usage, etc. +* Program Structure:: Arglists, `eval-when', `defalias' +* Predicates:: `typep', `eql', and `equalp' +* Control Structure:: `setf', `when', `do', `loop', etc. +* Macros:: Destructuring, `define-compiler-macro' +* Declarations:: `proclaim', `declare', etc. +* Symbols:: Property lists, `gensym' +* Numbers:: Predicates, functions, random numbers +* Sequences:: Mapping, functions, searching, sorting +* Lists:: `cadr', `sublis', `member*', `assoc*', etc. +* Hash Tables:: `make-hash-table', `gethash', etc. +* Structures:: `defstruct' +* Assertions:: `check-type', `assert', `ignore-errors'. + +* Efficiency Concerns:: Hints and techniques +* Common Lisp Compatibility:: All known differences with Steele +* Old CL Compatibility:: All known differences with old cl.el +* Porting Common Lisp:: Hints for porting Common Lisp code + +* Function Index:: +* Variable Index:: + + +File: cl.info, Node: Overview, Next: Program Structure, Prev: Top, Up: Top + +Overview +******** + +Common Lisp is a huge language, and Common Lisp systems tend to be +massive and extremely complex. Emacs Lisp, by contrast, is rather +minimalist in the choice of Lisp features it offers the programmer. As +Emacs Lisp programmers have grown in number, and the applications they +write have grown more ambitious, it has become clear that Emacs Lisp +could benefit from many of the conveniences of Common Lisp. + + The "CL" package adds a number of Common Lisp functions and control +structures to Emacs Lisp. While not a 100% complete implementation of +Common Lisp, "CL" adds enough functionality to make Emacs Lisp +programming significantly more convenient. + + Some Common Lisp features have been omitted from this package for +various reasons: + + * Some features are too complex or bulky relative to their benefit + to Emacs Lisp programmers. CLOS and Common Lisp streams are fine + examples of this group. + + * Other features cannot be implemented without modification to the + Emacs Lisp interpreter itself, such as multiple return values, + lexical scoping, case-insensitive symbols, and complex numbers. + The "CL" package generally makes no attempt to emulate these + features. + + * Some features conflict with existing things in Emacs Lisp. For + example, Emacs' `assoc' function is incompatible with the Common + Lisp `assoc'. In such cases, this package usually adds the suffix + `*' to the function name of the Common Lisp version of the + function (e.g., `assoc*'). + + The package described here was written by Dave Gillespie, +`daveg@synaptics.com'. It is a total rewrite of the original 1986 +`cl.el' package by Cesar Quiroz. Most features of the Quiroz package +have been retained; any incompatibilities are noted in the descriptions +below. Care has been taken in this version to ensure that each +function is defined efficiently, concisely, and with minimal impact on +the rest of the Emacs environment. + +* Menu: + +* Usage:: How to use the CL package +* Organization:: The package's five component files +* Installation:: Compiling and installing CL +* Naming Conventions:: Notes on CL function names + + +File: cl.info, Node: Usage, Next: Organization, Prev: Overview, Up: Overview + +Usage +===== + +Lisp code that uses features from the "CL" package should include at +the beginning: + + (require 'cl) + +If you want to ensure that the new (Gillespie) version of "CL" is the +one that is present, add an additional `(require 'cl-19)' call: + + (require 'cl) + (require 'cl-19) + +The second call will fail (with "`cl-19.el' not found") if the old +`cl.el' package was in use. + + It is safe to arrange to load "CL" at all times, e.g., in your +`.emacs' file. But it's a good idea, for portability, to `(require +'cl)' in your code even if you do this. + + +File: cl.info, Node: Organization, Next: Installation, Prev: Usage, Up: Overview + +Organization +============ + +The Common Lisp package is organized into four files: + +`cl.el' + This is the "main" file, which contains basic functions and + information about the package. This file is relatively + compact--about 700 lines. + +`cl-extra.el' + This file contains the larger, more complex or unusual functions. + It is kept separate so that packages which only want to use Common + Lisp fundamentals like the `cadr' function won't need to pay the + overhead of loading the more advanced functions. + +`cl-seq.el' + This file contains most of the advanced functions for operating on + sequences or lists, such as `delete-if' and `assoc*'. + +`cl-macs.el' + This file contains the features of the packages which are macros + instead of functions. Macros expand when the caller is compiled, + not when it is run, so the macros generally only need to be + present when the byte-compiler is running (or when the macros are + used in uncompiled code such as a `.emacs' file). Most of the + macros of this package are isolated in `cl-macs.el' so that they + won't take up memory unless you are compiling. + + The file `cl.el' includes all necessary `autoload' commands for the +functions and macros in the other three files. All you have to do is +`(require 'cl)', and `cl.el' will take care of pulling in the other +files when they are needed. + + There is another file, `cl-compat.el', which defines some routines +from the older `cl.el' package that are no longer present in the new +package. This includes internal routines like `setelt' and +`zip-lists', deprecated features like `defkeyword', and an emulation of +the old-style multiple-values feature. *Note Old CL Compatibility::. + + +File: cl.info, Node: Installation, Next: Naming Conventions, Prev: Organization, Up: Overview + +Installation +============ + +Installation of the "CL" package is simple: Just put the byte-compiled +files `cl.elc', `cl-extra.elc', `cl-seq.elc', `cl-macs.elc', and +`cl-compat.elc' into a directory on your `load-path'. + + There are no special requirements to compile this package: The files +do not have to be loaded before they are compiled, nor do they need to +be compiled in any particular order. + + You may choose to put the files into your main `lisp/' directory, +replacing the original `cl.el' file there. Or, you could put them into +a directory that comes before `lisp/' on your `load-path' so that the +old `cl.el' is effectively hidden. + + Also, format the `cl.texinfo' file and put the resulting Info files +in the `info/' directory or another suitable place. + + You may instead wish to leave this package's components all in their +own directory, and then add this directory to your `load-path' and +(Emacs 19 only) `Info-directory-list'. Add the directory to the front +of the list so the old "CL" package and its documentation are hidden. + + +File: cl.info, Node: Naming Conventions, Prev: Installation, Up: Overview + +Naming Conventions +================== + +Except where noted, all functions defined by this package have the same +names and calling conventions as their Common Lisp counterparts. + + Following is a complete list of functions whose names were changed +from Common Lisp, usually to avoid conflicts with Emacs. In each case, +a `*' has been appended to the Common Lisp name to obtain the Emacs +name: + + defun* defsubst* defmacro* function* + member* assoc* rassoc* get* + remove* delete* mapcar* sort* + floor* ceiling* truncate* round* + mod* rem* random* + + Internal function and variable names in the package are prefixed by +`cl-'. Here is a complete list of functions *not* prefixed by `cl-' +which were not taken from Common Lisp: + + member delete remove remq + rassoc floatp-safe lexical-let lexical-let* + callf callf2 letf letf* + defsubst* defalias add-hook eval-when-compile + +(Most of these are Emacs 19 features provided to Emacs 18 users, or +introduced, like `remq', for reasons of symmetry with similar features.) + + The following simple functions and macros are defined in `cl.el'; +they do not cause other components like `cl-extra' to be loaded. + + eql floatp-safe abs endp + evenp oddp plusp minusp + last butlast nbutlast caar .. cddddr + list* ldiff rest first .. tenth + member [1] copy-list subst mapcar* [2] + adjoin [3] acons pairlis when + unless pop [4] push [4] pushnew [3,4] + incf [4] decf [4] proclaim declaim + add-hook + +[1] This is the Emacs 19-compatible function, not `member*'. + +[2] Only for one sequence argument or two list arguments. + +[3] Only if `:test' is `eq', `equal', or unspecified, and `:key' is not +used. + +[4] Only when PLACE is a plain variable name. + + +File: cl.info, Node: Program Structure, Next: Predicates, Prev: Overview, Up: Top + +Program Structure +***************** + +This section describes features of the "CL" package which have to do +with programs as a whole: advanced argument lists for functions, and +the `eval-when' construct. + +* Menu: + +* Argument Lists:: `&key', `&aux', `defun*', `defmacro*'. +* Time of Evaluation:: The `eval-when' construct. +* Function Aliases:: The `defalias' function. + + +File: cl.info, Node: Argument Lists, Next: Time of Evaluation, Prev: Program Structure, Up: Program Structure + +Argument Lists +============== + +Emacs Lisp's notation for argument lists of functions is a subset of +the Common Lisp notation. As well as the familiar `&optional' and +`&rest' markers, Common Lisp allows you to specify default values for +optional arguments, and it provides the additional markers `&key' and +`&aux'. + + Since argument parsing is built-in to Emacs, there is no way for +this package to implement Common Lisp argument lists seamlessly. +Instead, this package defines alternates for several Lisp forms which +you must use if you need Common Lisp argument lists. + + - Special Form: defun* NAME ARGLIST BODY... + This form is identical to the regular `defun' form, except that + ARGLIST is allowed to be a full Common Lisp argument list. Also, + the function body is enclosed in an implicit block called NAME; + *note Blocks and Exits::.. + + - Special Form: defsubst* NAME ARGLIST BODY... + This is just like `defun*', except that the function that is + defined is automatically proclaimed `inline', i.e., calls to it + may be expanded into in-line code by the byte compiler. This is + analogous to the `defsubst' form in Emacs 19; `defsubst*' uses a + different method (compiler macros) which works in all version of + Emacs, and also generates somewhat more efficient inline + expansions. In particular, `defsubst*' arranges for the + processing of keyword arguments, default values, etc., to be done + at compile-time whenever possible. + + - Special Form: defmacro* NAME ARGLIST BODY... + This is identical to the regular `defmacro' form, except that + ARGLIST is allowed to be a full Common Lisp argument list. The + `&environment' keyword is supported as described in Steele. The + `&whole' keyword is supported only within destructured lists (see + below); top-level `&whole' cannot be implemented with the current + Emacs Lisp interpreter. The macro expander body is enclosed in an + implicit block called NAME. + + - Special Form: function* SYMBOL-OR-LAMBDA + This is identical to the regular `function' form, except that if + the argument is a `lambda' form then that form may use a full + Common Lisp argument list. + + Also, all forms (such as `defsetf' and `flet') defined in this +package that include ARGLISTs in their syntax allow full Common Lisp +argument lists. + + Note that it is *not* necessary to use `defun*' in order to have +access to most "CL" features in your function. These features are +always present; `defun*''s only difference from `defun' is its more +flexible argument lists and its implicit block. + + The full form of a Common Lisp argument list is + + (VAR... + &optional (VAR INITFORM SVAR)... + &rest VAR + &key ((KEYWORD VAR) INITFORM SVAR)... + &aux (VAR INITFORM)...) + + Each of the five argument list sections is optional. The SVAR, +INITFORM, and KEYWORD parts are optional; if they are omitted, then +`(VAR)' may be written simply `VAR'. + + The first section consists of zero or more "required" arguments. +These arguments must always be specified in a call to the function; +there is no difference between Emacs Lisp and Common Lisp as far as +required arguments are concerned. + + The second section consists of "optional" arguments. These +arguments may be specified in the function call; if they are not, +INITFORM specifies the default value used for the argument. (No +INITFORM means to use `nil' as the default.) The INITFORM is evaluated +with the bindings for the preceding arguments already established; `(a +&optional (b (1+ a)))' matches one or two arguments, with the second +argument defaulting to one plus the first argument. If the SVAR is +specified, it is an auxiliary variable which is bound to `t' if the +optional argument was specified, or to `nil' if the argument was +omitted. If you don't use an SVAR, then there will be no way for your +function to tell whether it was called with no argument, or with the +default value passed explicitly as an argument. + + The third section consists of a single "rest" argument. If more +arguments were passed to the function than are accounted for by the +required and optional arguments, those extra arguments are collected +into a list and bound to the "rest" argument variable. Common Lisp's +`&rest' is equivalent to that of Emacs Lisp. Common Lisp accepts +`&body' as a synonym for `&rest' in macro contexts; this package +accepts it all the time. + + The fourth section consists of "keyword" arguments. These are +optional arguments which are specified by name rather than positionally +in the argument list. For example, + + (defun* foo (a &optional b &key c d (e 17))) + +defines a function which may be called with one, two, or more +arguments. The first two arguments are bound to `a' and `b' in the +usual way. The remaining arguments must be pairs of the form `:c', +`:d', or `:e' followed by the value to be bound to the corresponding +argument variable. (Symbols whose names begin with a colon are called +"keywords", and they are self-quoting in the same way as `nil' and `t'.) + + For example, the call `(foo 1 2 :d 3 :c 4)' sets the five arguments +to 1, 2, 4, 3, and 17, respectively. If the same keyword appears more +than once in the function call, the first occurrence takes precedence +over the later ones. Note that it is not possible to specify keyword +arguments without specifying the optional argument `b' as well, since +`(foo 1 :c 2)' would bind `b' to the keyword `:c', then signal an error +because `2' is not a valid keyword. + + If a KEYWORD symbol is explicitly specified in the argument list as +shown in the above diagram, then that keyword will be used instead of +just the variable name prefixed with a colon. You can specify a +KEYWORD symbol which does not begin with a colon at all, but such +symbols will not be self-quoting; you will have to quote them +explicitly with an apostrophe in the function call. + + Ordinarily it is an error to pass an unrecognized keyword to a +function, e.g., `(foo 1 2 :c 3 :goober 4)'. You can ask Lisp to ignore +unrecognized keywords, either by adding the marker `&allow-other-keys' +after the keyword section of the argument list, or by specifying an +`:allow-other-keys' argument in the call whose value is non-`nil'. If +the function uses both `&rest' and `&key' at the same time, the "rest" +argument is bound to the keyword list as it appears in the call. For +example: + + (defun* find-thing (thing &rest rest &key need &allow-other-keys) + (or (apply 'member* thing thing-list :allow-other-keys t rest) + (if need (error "Thing not found")))) + +This function takes a `:need' keyword argument, but also accepts other +keyword arguments which are passed on to the `member*' function. +`allow-other-keys' is used to keep both `find-thing' and `member*' from +complaining about each others' keywords in the arguments. + + As a (significant) performance optimization, this package implements +the scan for keyword arguments by calling `memq' to search for keywords +in a "rest" argument. Technically speaking, this is incorrect, since +`memq' looks at the odd-numbered values as well as the even-numbered +keywords. The net effect is that if you happen to pass a keyword symbol +as the *value* of another keyword argument, where that keyword symbol +happens to equal the name of a valid keyword argument of the same +function, then the keyword parser will become confused. This minor bug +can only affect you if you use keyword symbols as general-purpose data +in your program; this practice is strongly discouraged in Emacs Lisp. + + The fifth section of the argument list consists of "auxiliary +variables". These are not really arguments at all, but simply +variables which are bound to `nil' or to the specified INITFORMS during +execution of the function. There is no difference between the +following two functions, except for a matter of stylistic taste: + + (defun* foo (a b &aux (c (+ a b)) d) + BODY) + + (defun* foo (a b) + (let ((c (+ a b)) d) + BODY)) + + Argument lists support "destructuring". In Common Lisp, +destructuring is only allowed with `defmacro'; this package allows it +with `defun*' and other argument lists as well. In destructuring, any +argument variable (VAR in the above diagram) can be replaced by a list +of variables, or more generally, a recursive argument list. The +corresponding argument value must be a list whose elements match this +recursive argument list. For example: + + (defmacro* dolist ((var listform &optional resultform) + &rest body) + ...) + + This says that the first argument of `dolist' must be a list of two +or three items; if there are other arguments as well as this list, they +are stored in `body'. All features allowed in regular argument lists +are allowed in these recursive argument lists. In addition, the clause +`&whole VAR' is allowed at the front of a recursive argument list. It +binds VAR to the whole list being matched; thus `(&whole all a b)' +matches a list of two things, with `a' bound to the first thing, `b' +bound to the second thing, and `all' bound to the list itself. (Common +Lisp allows `&whole' in top-level `defmacro' argument lists as well, +but Emacs Lisp does not support this usage.) + + One last feature of destructuring is that the argument list may be +dotted, so that the argument list `(a b . c)' is functionally +equivalent to `(a b &rest c)'. + + If the optimization quality `safety' is set to 0 (*note +Declarations::.), error checking for wrong number of arguments and +invalid keyword arguments is disabled. By default, argument lists are +rigorously checked. + + +File: cl.info, Node: Time of Evaluation, Next: Function Aliases, Prev: Argument Lists, Up: Program Structure + +Time of Evaluation +================== + +Normally, the byte-compiler does not actually execute the forms in a +file it compiles. For example, if a file contains `(setq foo t)', the +act of compiling it will not actually set `foo' to `t'. This is true +even if the `setq' was a top-level form (i.e., not enclosed in a +`defun' or other form). Sometimes, though, you would like to have +certain top-level forms evaluated at compile-time. For example, the +compiler effectively evaluates `defmacro' forms at compile-time so that +later parts of the file can refer to the macros that are defined. + + - Special Form: eval-when (SITUATIONS...) FORMS... + This form controls when the body FORMS are evaluated. The + SITUATIONS list may contain any set of the symbols `compile', + `load', and `eval' (or their long-winded ANSI equivalents, + `:compile-toplevel', `:load-toplevel', and `:execute'). + + The `eval-when' form is handled differently depending on whether + or not it is being compiled as a top-level form. Specifically, it + gets special treatment if it is being compiled by a command such + as `byte-compile-file' which compiles files or buffers of code, + and it appears either literally at the top level of the file or + inside a top-level `progn'. + + For compiled top-level `eval-when's, the body FORMS are executed + at compile-time if `compile' is in the SITUATIONS list, and the + FORMS are written out to the file (to be executed at load-time) if + `load' is in the SITUATIONS list. + + For non-compiled-top-level forms, only the `eval' situation is + relevant. (This includes forms executed by the interpreter, forms + compiled with `byte-compile' rather than `byte-compile-file', and + non-top-level forms.) The `eval-when' acts like a `progn' if + `eval' is specified, and like `nil' (ignoring the body FORMS) if + not. + + The rules become more subtle when `eval-when's are nested; consult + Steele (second edition) for the gruesome details (and some + gruesome examples). + + Some simple examples: + + ;; Top-level forms in foo.el: + (eval-when (compile) (setq foo1 'bar)) + (eval-when (load) (setq foo2 'bar)) + (eval-when (compile load) (setq foo3 'bar)) + (eval-when (eval) (setq foo4 'bar)) + (eval-when (eval compile) (setq foo5 'bar)) + (eval-when (eval load) (setq foo6 'bar)) + (eval-when (eval compile load) (setq foo7 'bar)) + + When `foo.el' is compiled, these variables will be set during the + compilation itself: + + foo1 foo3 foo5 foo7 ; `compile' + + When `foo.elc' is loaded, these variables will be set: + + foo2 foo3 foo6 foo7 ; `load' + + And if `foo.el' is loaded uncompiled, these variables will be set: + + foo4 foo5 foo6 foo7 ; `eval' + + If these seven `eval-when's had been, say, inside a `defun', then + the first three would have been equivalent to `nil' and the last + four would have been equivalent to the corresponding `setq's. + + Note that `(eval-when (load eval) ...)' is equivalent to `(progn + ...)' in all contexts. The compiler treats certain top-level + forms, like `defmacro' (sort-of) and `require', as if they were + wrapped in `(eval-when (compile load eval) ...)'. + + Emacs 19 includes two special forms related to `eval-when'. One of +these, `eval-when-compile', is not quite equivalent to any `eval-when' +construct and is described below. This package defines a version of +`eval-when-compile' for the benefit of Emacs 18 users. + + The other form, `(eval-and-compile ...)', is exactly equivalent to +`(eval-when (compile load eval) ...)' and so is not itself defined by +this package. + + - Special Form: eval-when-compile FORMS... + The FORMS are evaluated at compile-time; at execution time, this + form acts like a quoted constant of the resulting value. Used at + top-level, `eval-when-compile' is just like `eval-when (compile + eval)'. In other contexts, `eval-when-compile' allows code to be + evaluated once at compile-time for efficiency or other reasons. + + This form is similar to the `#.' syntax of true Common Lisp. + + - Special Form: load-time-value FORM + The FORM is evaluated at load-time; at execution time, this form + acts like a quoted constant of the resulting value. + + Early Common Lisp had a `#,' syntax that was similar to this, but + ANSI Common Lisp replaced it with `load-time-value' and gave it + more well-defined semantics. + + In a compiled file, `load-time-value' arranges for FORM to be + evaluated when the `.elc' file is loaded and then used as if it + were a quoted constant. In code compiled by `byte-compile' rather + than `byte-compile-file', the effect is identical to + `eval-when-compile'. In uncompiled code, both `eval-when-compile' + and `load-time-value' act exactly like `progn'. + + (defun report () + (insert "This function was executed on: " + (current-time-string) + ", compiled on: " + (eval-when-compile (current-time-string)) + ;; or '#.(current-time-string) in real Common Lisp + ", and loaded on: " + (load-time-value (current-time-string)))) + + Byte-compiled, the above defun will result in the following code + (or its compiled equivalent, of course) in the `.elc' file: + + (setq --temp-- (current-time-string)) + (defun report () + (insert "This function was executed on: " + (current-time-string) + ", compiled on: " + '"Wed Jun 23 18:33:43 1993" + ", and loaded on: " + --temp--)) + + +File: cl.info, Node: Function Aliases, Prev: Time of Evaluation, Up: Program Structure + +Function Aliases +================ + +This section describes a feature from GNU Emacs 19 which this package +makes available in other versions of Emacs. + + - Function: defalias SYMBOL FUNCTION + This function sets SYMBOL's function cell to FUNCTION. It is + equivalent to `fset', except that in GNU Emacs 19 it also records + the setting in `load-history' so that it can be undone by a later + `unload-feature'. + + In other versions of Emacs, `defalias' is a synonym for `fset'. + + +File: cl.info, Node: Predicates, Next: Control Structure, Prev: Program Structure, Up: Top + +Predicates +********** + +This section describes functions for testing whether various facts are +true or false. + +* Menu: + +* Type Predicates:: `typep', `deftype', and `coerce' +* Equality Predicates:: `eql' and `equalp' + + +File: cl.info, Node: Type Predicates, Next: Equality Predicates, Prev: Predicates, Up: Predicates + +Type Predicates +=============== + +The "CL" package defines a version of the Common Lisp `typep' predicate. + + - Function: typep OBJECT TYPE + Check if OBJECT is of type TYPE, where TYPE is a (quoted) type + name of the sort used by Common Lisp. For example, `(typep foo + 'integer)' is equivalent to `(integerp foo)'. + + The TYPE argument to the above function is either a symbol or a list +beginning with a symbol. + + * If the type name is a symbol, Emacs appends `-p' to the symbol + name to form the name of a predicate function for testing the + type. (Built-in predicates whose names end in `p' rather than + `-p' are used when appropriate.) + + * The type symbol `t' stands for the union of all types. `(typep + OBJECT t)' is always true. Likewise, the type symbol `nil' stands + for nothing at all, and `(typep OBJECT nil)' is always false. + + * The type symbol `null' represents the symbol `nil'. Thus `(typep + OBJECT 'null)' is equivalent to `(null OBJECT)'. + + * The type symbol `real' is a synonym for `number', and `fixnum' is + a synonym for `integer'. + + * The type symbols `character' and `string-char' match characters. + In Emacs-19 and XEmacs-19, characters are the same thing as + integers in the range 0-255. In XEmacs-20, where characters are a + first-class data type, this checks for actual characters, and + `(typep 8BIT-INTEGER 'character)' will return `nil'. + + * The type symbol `float' uses the `floatp-safe' predicate defined + by this package rather than `floatp', so it will work correctly + even in Emacs versions without floating-point support. + + * The type list `(integer LOW HIGH)' represents all integers between + LOW and HIGH, inclusive. Either bound may be a list of a single + integer to specify an exclusive limit, or a `*' to specify no + limit. The type `(integer * *)' is thus equivalent to `integer'. + + * Likewise, lists beginning with `float', `real', or `number' + represent numbers of that type falling in a particular range. + + * Lists beginning with `and', `or', and `not' form combinations of + types. For example, `(or integer (float 0 *))' represents all + objects that are integers or non-negative floats. + + * Lists beginning with `member' or `member*' represent objects `eql' + to any of the following values. For example, `(member 1 2 3 4)' + is equivalent to `(integer 1 4)', and `(member nil)' is equivalent + to `null'. + + * Lists of the form `(satisfies PREDICATE)' represent all objects + for which PREDICATE returns true when called with that object as + an argument. + + The following function and macro (not technically predicates) are +related to `typep'. + + - Function: coerce OBJECT TYPE + This function attempts to convert OBJECT to the specified TYPE. + If OBJECT is already of that type as determined by `typep', it is + simply returned. Otherwise, certain types of conversions will be + made: If TYPE is any sequence type (`string', `list', etc.) then + OBJECT will be converted to that type if possible. If TYPE is + `character', then strings of length one and symbols with + one-character names can be coerced. If TYPE is `float', then + integers can be coerced in versions of Emacs that support floats. + In all other circumstances, `coerce' signals an error. + + - Special Form: deftype NAME ARGLIST FORMS... + This macro defines a new type called NAME. It is similar to + `defmacro' in many ways; when NAME is encountered as a type name, + the body FORMS are evaluated and should return a type specifier + that is equivalent to the type. The ARGLIST is a Common Lisp + argument list of the sort accepted by `defmacro*'. The type + specifier `(NAME ARGS...)' is expanded by calling the expander + with those arguments; the type symbol `NAME' is expanded by + calling the expander with no arguments. The ARGLIST is processed + the same as for `defmacro*' except that optional arguments without + explicit defaults use `*' instead of `nil' as the "default" + default. Some examples: + + (deftype null () '(satisfies null)) ; predefined + (deftype list () '(or null cons)) ; predefined + (deftype unsigned-byte (&optional bits) + (list 'integer 0 (if (eq bits '*) bits (1- (lsh 1 bits))))) + (unsigned-byte 8) == (integer 0 255) + (unsigned-byte) == (integer 0 *) + unsigned-byte == (integer 0 *) + + The last example shows how the Common Lisp `unsigned-byte' type + specifier could be implemented if desired; this package does not + implement `unsigned-byte' by default. + + The `typecase' and `check-type' macros also use type names. *Note +Conditionals::. *Note Assertions::. The `map', `concatenate', and +`merge' functions take type-name arguments to specify the type of +sequence to return. *Note Sequences::. + + +File: cl.info, Node: Equality Predicates, Prev: Type Predicates, Up: Predicates + +Equality Predicates +=================== + +This package defines two Common Lisp predicates, `eql' and `equalp'. + + - Function: eql A B + This function is almost the same as `eq', except that if A and B + are numbers of the same type, it compares them for numeric + equality (as if by `equal' instead of `eq'). This makes a + difference only for versions of Emacs that are compiled with + floating-point support, such as Emacs 19. Emacs floats are + allocated objects just like cons cells, which means that `(eq 3.0 + 3.0)' will not necessarily be true--if the two `3.0's were + allocated separately, the pointers will be different even though + the numbers are the same. But `(eql 3.0 3.0)' will always be true. + + The types of the arguments must match, so `(eql 3 3.0)' is still + false. + + Note that Emacs integers are "direct" rather than allocated, which + basically means `(eq 3 3)' will always be true. Thus `eq' and + `eql' behave differently only if floating-point numbers are + involved, and are indistinguishable on Emacs versions that don't + support floats. + + There is a slight inconsistency with Common Lisp in the treatment + of positive and negative zeros. Some machines, notably those with + IEEE standard arithmetic, represent `+0' and `-0' as distinct + values. Normally this doesn't matter because the standard + specifies that `(= 0.0 -0.0)' should always be true, and this is + indeed what Emacs Lisp and Common Lisp do. But the Common Lisp + standard states that `(eql 0.0 -0.0)' and `(equal 0.0 -0.0)' should + be false on IEEE-like machines; Emacs Lisp does not do this, and in + fact the only known way to distinguish between the two zeros in + Emacs Lisp is to `format' them and check for a minus sign. + + - Function: equalp A B + This function is a more flexible version of `equal'. In + particular, it compares strings and characters case-insensitively, + and it compares numbers without regard to type (so that `(equalp 3 + 3.0)' is true). Vectors and conses are compared recursively. All + other objects are compared as if by `equal'. + + This function differs from Common Lisp `equalp' in several + respects. In keeping with the idea that strings are less + vector-like in Emacs Lisp, this package's `equalp' also will not + compare strings against vectors of integers. + + Also note that the Common Lisp functions `member' and `assoc' use +`eql' to compare elements, whereas Emacs Lisp follows the MacLisp +tradition and uses `equal' for these two functions. In Emacs, use +`member*' and `assoc*' to get functions which use `eql' for comparisons. + + +File: cl.info, Node: Control Structure, Next: Macros, Prev: Predicates, Up: Top + +Control Structure +***************** + +The features described in the following sections implement various +advanced control structures, including the powerful `setf' facility and +a number of looping and conditional constructs. + +* Menu: + +* Assignment:: The `psetq' form +* Generalized Variables:: `setf', `incf', `push', etc. +* Variable Bindings:: `progv', `lexical-let', `flet', `macrolet' +* Conditionals:: `when', `unless', `case', `typecase' +* Blocks and Exits:: `block', `return', `return-from' +* Iteration:: `do', `dotimes', `dolist', `do-symbols' +* Loop Facility:: The Common Lisp `loop' macro +* Multiple Values:: `values', `multiple-value-bind', etc. + + +File: cl.info, Node: Assignment, Next: Generalized Variables, Prev: Control Structure, Up: Control Structure + +Assignment +========== + +The `psetq' form is just like `setq', except that multiple assignments +are done in parallel rather than sequentially. + + - Special Form: psetq [SYMBOL FORM]... + This special form (actually a macro) is used to assign to several + variables simultaneously. Given only one SYMBOL and FORM, it has + the same effect as `setq'. Given several SYMBOL and FORM pairs, + it evaluates all the FORMs in advance and then stores the + corresponding variables afterwards. + + (setq x 2 y 3) + (setq x (+ x y) y (* x y)) + x + => 5 + y ; `y' was computed after `x' was set. + => 15 + (setq x 2 y 3) + (psetq x (+ x y) y (* x y)) + x + => 5 + y ; `y' was computed before `x' was set. + => 6 + + The simplest use of `psetq' is `(psetq x y y x)', which exchanges + the values of two variables. (The `rotatef' form provides an even + more convenient way to swap two variables; *note Modify Macros::..) + + `psetq' always returns `nil'. + + +File: cl.info, Node: Generalized Variables, Next: Variable Bindings, Prev: Assignment, Up: Control Structure + +Generalized Variables +===================== + +A "generalized variable" or "place form" is one of the many places in +Lisp memory where values can be stored. The simplest place form is a +regular Lisp variable. But the cars and cdrs of lists, elements of +arrays, properties of symbols, and many other locations are also places +where Lisp values are stored. + + The `setf' form is like `setq', except that it accepts arbitrary +place forms on the left side rather than just symbols. For example, +`(setf (car a) b)' sets the car of `a' to `b', doing the same operation +as `(setcar a b)' but without having to remember two separate functions +for setting and accessing every type of place. + + Generalized variables are analogous to "lvalues" in the C language, +where `x = a[i]' gets an element from an array and `a[i] = x' stores an +element using the same notation. Just as certain forms like `a[i]' can +be lvalues in C, there is a set of forms that can be generalized +variables in Lisp. + +* Menu: + +* Basic Setf:: `setf' and place forms +* Modify Macros:: `incf', `push', `rotatef', `letf', `callf', etc. +* Customizing Setf:: `define-modify-macro', `defsetf', `define-setf-method' + + +File: cl.info, Node: Basic Setf, Next: Modify Macros, Prev: Generalized Variables, Up: Generalized Variables + +Basic Setf +---------- + +The `setf' macro is the most basic way to operate on generalized +variables. + + - Special Form: setf [PLACE FORM]... + This macro evaluates FORM and stores it in PLACE, which must be a + valid generalized variable form. If there are several PLACE and + FORM pairs, the assignments are done sequentially just as with + `setq'. `setf' returns the value of the last FORM. + + The following Lisp forms will work as generalized variables, and + so may legally appear in the PLACE argument of `setf': + + * A symbol naming a variable. In other words, `(setf x y)' is + exactly equivalent to `(setq x y)', and `setq' itself is + strictly speaking redundant now that `setf' exists. Many + programmers continue to prefer `setq' for setting simple + variables, though, purely for stylistic or historical reasons. + The macro `(setf x y)' actually expands to `(setq x y)', so + there is no performance penalty for using it in compiled code. + + * A call to any of the following Lisp functions: + + car cdr caar .. cddddr + nth rest first .. tenth + aref elt nthcdr + symbol-function symbol-value symbol-plist + get get* getf + gethash subseq + + Note that for `nthcdr' and `getf', the list argument of the + function must itself be a valid PLACE form. For example, + `(setf (nthcdr 0 foo) 7)' will set `foo' itself to 7. Note + that `push' and `pop' on an `nthcdr' place can be used to + insert or delete at any position in a list. The use of + `nthcdr' as a PLACE form is an extension to standard Common + Lisp. + + * The following Emacs-specific functions are also `setf'-able. + (Some of these are defined only in Emacs 19 or only in + XEmacs.) + + buffer-file-name marker-position + buffer-modified-p match-data + buffer-name mouse-position + buffer-string overlay-end + buffer-substring overlay-get + current-buffer overlay-start + current-case-table point + current-column point-marker + current-global-map point-max + current-input-mode point-min + current-local-map process-buffer + current-window-configuration process-filter + default-file-modes process-sentinel + default-value read-mouse-position + documentation-property screen-height + extent-data screen-menubar + extent-end-position screen-width + extent-start-position selected-window + face-background selected-screen + face-background-pixmap selected-frame + face-font standard-case-table + face-foreground syntax-table + face-underline-p window-buffer + file-modes window-dedicated-p + frame-height window-display-table + frame-parameters window-height + frame-visible-p window-hscroll + frame-width window-point + get-register window-start + getenv window-width + global-key-binding x-get-cut-buffer + keymap-parent x-get-cutbuffer + local-key-binding x-get-secondary-selection + mark x-get-selection + mark-marker + + Most of these have directly corresponding "set" functions, + like `use-local-map' for `current-local-map', or `goto-char' + for `point'. A few, like `point-min', expand to longer + sequences of code when they are `setf''d (`(narrow-to-region + x (point-max))' in this case). + + * A call of the form `(substring SUBPLACE N [M])', where + SUBPLACE is itself a legal generalized variable whose current + value is a string, and where the value stored is also a + string. The new string is spliced into the specified part of + the destination string. For example: + + (setq a (list "hello" "world")) + => ("hello" "world") + (cadr a) + => "world" + (substring (cadr a) 2 4) + => "rl" + (setf (substring (cadr a) 2 4) "o") + => "o" + (cadr a) + => "wood" + a + => ("hello" "wood") + + The generalized variable `buffer-substring', listed above, + also works in this way by replacing a portion of the current + buffer. + + * A call of the form `(apply 'FUNC ...)' or `(apply (function + FUNC) ...)', where FUNC is a `setf'-able function whose store + function is "suitable" in the sense described in Steele's + book; since none of the standard Emacs place functions are + suitable in this sense, this feature is only interesting when + used with places you define yourself with + `define-setf-method' or the long form of `defsetf'. + + * A macro call, in which case the macro is expanded and `setf' + is applied to the resulting form. + + * Any form for which a `defsetf' or `define-setf-method' has + been made. + + Using any forms other than these in the PLACE argument to `setf' + will signal an error. + + The `setf' macro takes care to evaluate all subforms in the proper + left-to-right order; for example, + + (setf (aref vec (incf i)) i) + + looks like it will evaluate `(incf i)' exactly once, before the + following access to `i'; the `setf' expander will insert temporary + variables as necessary to ensure that it does in fact work this + way no matter what setf-method is defined for `aref'. (In this + case, `aset' would be used and no such steps would be necessary + since `aset' takes its arguments in a convenient order.) + + However, if the PLACE form is a macro which explicitly evaluates + its arguments in an unusual order, this unusual order will be + preserved. Adapting an example from Steele, given + + (defmacro wrong-order (x y) (list 'aref y x)) + + the form `(setf (wrong-order A B) 17)' will evaluate B first, then + A, just as in an actual call to `wrong-order'. + diff --git a/info/cl.info-2 b/info/cl.info-2 new file mode 100644 index 0000000..cd1974e --- /dev/null +++ b/info/cl.info-2 @@ -0,0 +1,1031 @@ +This is Info file ../info/cl.info, produced by Makeinfo version 1.68 +from the input file cl.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Common Lisp: (cl). GNU Emacs Common Lisp emulation package. +END-INFO-DIR-ENTRY + + This file documents the GNU Emacs Common Lisp emulation package. + + Copyright (C) 1993 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. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the author instead of in +the original English. + + +File: cl.info, Node: Modify Macros, Next: Customizing Setf, Prev: Basic Setf, Up: Generalized Variables + +Modify Macros +------------- + +This package defines a number of other macros besides `setf' that +operate on generalized variables. Many are interesting and useful even +when the PLACE is just a variable name. + + - Special Form: psetf [PLACE FORM]... + This macro is to `setf' what `psetq' is to `setq': When several + PLACEs and FORMs are involved, the assignments take place in + parallel rather than sequentially. Specifically, all subforms are + evaluated from left to right, then all the assignments are done + (in an undefined order). + + - Special Form: incf PLACE &optional X + This macro increments the number stored in PLACE by one, or by X + if specified. The incremented value is returned. For example, + `(incf i)' is equivalent to `(setq i (1+ i))', and `(incf (car x) + 2)' is equivalent to `(setcar x (+ (car x) 2))'. + + Once again, care is taken to preserve the "apparent" order of + evaluation. For example, + + (incf (aref vec (incf i))) + + appears to increment `i' once, then increment the element of `vec' + addressed by `i'; this is indeed exactly what it does, which means + the above form is *not* equivalent to the "obvious" expansion, + + (setf (aref vec (incf i)) (1+ (aref vec (incf i)))) ; Wrong! + + but rather to something more like + + (let ((temp (incf i))) + (setf (aref vec temp) (1+ (aref vec temp)))) + + Again, all of this is taken care of automatically by `incf' and + the other generalized-variable macros. + + As a more Emacs-specific example of `incf', the expression `(incf + (point) N)' is essentially equivalent to `(forward-char N)'. + + - Special Form: decf PLACE &optional X + This macro decrements the number stored in PLACE by one, or by X + if specified. + + - Special Form: pop PLACE + This macro removes and returns the first element of the list stored + in PLACE. It is analogous to `(prog1 (car PLACE) (setf PLACE (cdr + PLACE)))', except that it takes care to evaluate all subforms only + once. + + - Special Form: push X PLACE + This macro inserts X at the front of the list stored in PLACE. It + is analogous to `(setf PLACE (cons X PLACE))', except for + evaluation of the subforms. + + - Special Form: pushnew X PLACE &key :test :test-not :key + This macro inserts X at the front of the list stored in PLACE, but + only if X was not `eql' to any existing element of the list. The + optional keyword arguments are interpreted in the same way as for + `adjoin'. *Note Lists as Sets::. + + - Special Form: shiftf PLACE... NEWVALUE + This macro shifts the PLACEs left by one, shifting in the value of + NEWVALUE (which may be any Lisp expression, not just a generalized + variable), and returning the value shifted out of the first PLACE. + Thus, `(shiftf A B C D)' is equivalent to + + (prog1 + A + (psetf A B + B C + C D)) + + except that the subforms of A, B, and C are actually evaluated + only once each and in the apparent order. + + - Special Form: rotatef PLACE... + This macro rotates the PLACEs left by one in circular fashion. + Thus, `(rotatef A B C D)' is equivalent to + + (psetf A B + B C + C D + D A) + + except for the evaluation of subforms. `rotatef' always returns + `nil'. Note that `(rotatef A B)' conveniently exchanges A and B. + + The following macros were invented for this package; they have no +analogues in Common Lisp. + + - Special Form: letf (BINDINGS...) FORMS... + This macro is analogous to `let', but for generalized variables + rather than just symbols. Each BINDING should be of the form + `(PLACE VALUE)'; the original contents of the PLACEs are saved, + the VALUEs are stored in them, and then the body FORMs are + executed. Afterwards, the PLACES are set back to their original + saved contents. This cleanup happens even if the FORMs exit + irregularly due to a `throw' or an error. + + For example, + + (letf (((point) (point-min)) + (a 17)) + ...) + + moves "point" in the current buffer to the beginning of the buffer, + and also binds `a' to 17 (as if by a normal `let', since `a' is + just a regular variable). After the body exits, `a' is set back + to its original value and point is moved back to its original + position. + + Note that `letf' on `(point)' is not quite like a + `save-excursion', as the latter effectively saves a marker which + tracks insertions and deletions in the buffer. Actually, a `letf' + of `(point-marker)' is much closer to this behavior. (`point' and + `point-marker' are equivalent as `setf' places; each will accept + either an integer or a marker as the stored value.) + + Since generalized variables look like lists, `let''s shorthand of + using `foo' for `(foo nil)' as a BINDING would be ambiguous in + `letf' and is not allowed. + + However, a BINDING specifier may be a one-element list `(PLACE)', + which is similar to `(PLACE PLACE)'. In other words, the PLACE is + not disturbed on entry to the body, and the only effect of the + `letf' is to restore the original value of PLACE afterwards. (The + redundant access-and-store suggested by the `(PLACE PLACE)' + example does not actually occur.) + + In most cases, the PLACE must have a well-defined value on entry + to the `letf' form. The only exceptions are plain variables and + calls to `symbol-value' and `symbol-function'. If the symbol is + not bound on entry, it is simply made unbound by `makunbound' or + `fmakunbound' on exit. + + - Special Form: letf* (BINDINGS...) FORMS... + This macro is to `letf' what `let*' is to `let': It does the + bindings in sequential rather than parallel order. + + - Special Form: callf FUNCTION PLACE ARGS... + This is the "generic" modify macro. It calls FUNCTION, which + should be an unquoted function name, macro name, or lambda. It + passes PLACE and ARGS as arguments, and assigns the result back to + PLACE. For example, `(incf PLACE N)' is the same as `(callf + + PLACE N)'. Some more examples: + + (callf abs my-number) + (callf concat (buffer-name) "<" (int-to-string n) ">") + (callf union happy-people (list joe bob) :test 'same-person) + + *Note Customizing Setf::, for `define-modify-macro', a way to + create even more concise notations for modify macros. Note again + that `callf' is an extension to standard Common Lisp. + + - Special Form: callf2 FUNCTION ARG1 PLACE ARGS... + This macro is like `callf', except that PLACE is the *second* + argument of FUNCTION rather than the first. For example, `(push X + PLACE)' is equivalent to `(callf2 cons X PLACE)'. + + The `callf' and `callf2' macros serve as building blocks for other +macros like `incf', `pushnew', and `define-modify-macro'. The `letf' +and `letf*' macros are used in the processing of symbol macros; *note +Macro Bindings::.. + + +File: cl.info, Node: Customizing Setf, Prev: Modify Macros, Up: Generalized Variables + +Customizing Setf +---------------- + +Common Lisp defines three macros, `define-modify-macro', `defsetf', and +`define-setf-method', that allow the user to extend generalized +variables in various ways. + + - Special Form: define-modify-macro NAME ARGLIST FUNCTION [DOC-STRING] + This macro defines a "read-modify-write" macro similar to `incf' + and `decf'. The macro NAME is defined to take a PLACE argument + followed by additional arguments described by ARGLIST. The call + + (NAME PLACE ARGS...) + + will be expanded to + + (callf FUNC PLACE ARGS...) + + which in turn is roughly equivalent to + + (setf PLACE (FUNC PLACE ARGS...)) + + For example: + + (define-modify-macro incf (&optional (n 1)) +) + (define-modify-macro concatf (&rest args) concat) + + Note that `&key' is not allowed in ARGLIST, but `&rest' is + sufficient to pass keywords on to the function. + + Most of the modify macros defined by Common Lisp do not exactly + follow the pattern of `define-modify-macro'. For example, `push' + takes its arguments in the wrong order, and `pop' is completely + irregular. You can define these macros "by hand" using + `get-setf-method', or consult the source file `cl-macs.el' to see + how to use the internal `setf' building blocks. + + - Special Form: defsetf ACCESS-FN UPDATE-FN + This is the simpler of two `defsetf' forms. Where ACCESS-FN is + the name of a function which accesses a place, this declares + UPDATE-FN to be the corresponding store function. From now on, + + (setf (ACCESS-FN ARG1 ARG2 ARG3) VALUE) + + will be expanded to + + (UPDATE-FN ARG1 ARG2 ARG3 VALUE) + + The UPDATE-FN is required to be either a true function, or a macro + which evaluates its arguments in a function-like way. Also, the + UPDATE-FN is expected to return VALUE as its result. Otherwise, + the above expansion would not obey the rules for the way `setf' is + supposed to behave. + + As a special (non-Common-Lisp) extension, a third argument of `t' + to `defsetf' says that the `update-fn''s return value is not + suitable, so that the above `setf' should be expanded to something + more like + + (let ((temp VALUE)) + (UPDATE-FN ARG1 ARG2 ARG3 temp) + temp) + + Some examples of the use of `defsetf', drawn from the standard + suite of setf methods, are: + + (defsetf car setcar) + (defsetf symbol-value set) + (defsetf buffer-name rename-buffer t) + + - Special Form: defsetf ACCESS-FN ARGLIST (STORE-VAR) FORMS... + This is the second, more complex, form of `defsetf'. It is rather + like `defmacro' except for the additional STORE-VAR argument. The + FORMS should return a Lisp form which stores the value of + STORE-VAR into the generalized variable formed by a call to + ACCESS-FN with arguments described by ARGLIST. The FORMS may + begin with a string which documents the `setf' method (analogous + to the doc string that appears at the front of a function). + + For example, the simple form of `defsetf' is shorthand for + + (defsetf ACCESS-FN (&rest args) (store) + (append '(UPDATE-FN) args (list store))) + + The Lisp form that is returned can access the arguments from + ARGLIST and STORE-VAR in an unrestricted fashion; macros like + `setf' and `incf' which invoke this setf-method will insert + temporary variables as needed to make sure the apparent order of + evaluation is preserved. + + Another example drawn from the standard package: + + (defsetf nth (n x) (store) + (list 'setcar (list 'nthcdr n x) store)) + + - Special Form: define-setf-method ACCESS-FN ARGLIST FORMS... + This is the most general way to create new place forms. When a + `setf' to ACCESS-FN with arguments described by ARGLIST is + expanded, the FORMS are evaluated and must return a list of five + items: + + 1. A list of "temporary variables". + + 2. A list of "value forms" corresponding to the temporary + variables above. The temporary variables will be bound to + these value forms as the first step of any operation on the + generalized variable. + + 3. A list of exactly one "store variable" (generally obtained + from a call to `gensym'). + + 4. A Lisp form which stores the contents of the store variable + into the generalized variable, assuming the temporaries have + been bound as described above. + + 5. A Lisp form which accesses the contents of the generalized + variable, assuming the temporaries have been bound. + + This is exactly like the Common Lisp macro of the same name, + except that the method returns a list of five values rather than + the five values themselves, since Emacs Lisp does not support + Common Lisp's notion of multiple return values. + + Once again, the FORMS may begin with a documentation string. + + A setf-method should be maximally conservative with regard to + temporary variables. In the setf-methods generated by `defsetf', + the second return value is simply the list of arguments in the + place form, and the first return value is a list of a + corresponding number of temporary variables generated by `gensym'. + Macros like `setf' and `incf' which use this setf-method will + optimize away most temporaries that turn out to be unnecessary, so + there is little reason for the setf-method itself to optimize. + + - Function: get-setf-method PLACE &optional ENV + This function returns the setf-method for PLACE, by invoking the + definition previously recorded by `defsetf' or + `define-setf-method'. The result is a list of five values as + described above. You can use this function to build your own + `incf'-like modify macros. (Actually, it is better to use the + internal functions `cl-setf-do-modify' and `cl-setf-do-store', + which are a bit easier to use and which also do a number of + optimizations; consult the source code for the `incf' function for + a simple example.) + + The argument ENV specifies the "environment" to be passed on to + `macroexpand' if `get-setf-method' should need to expand a macro + in PLACE. It should come from an `&environment' argument to the + macro or setf-method that called `get-setf-method'. + + See also the source code for the setf-methods for `apply' and + `substring', each of which works by calling `get-setf-method' on a + simpler case, then massaging the result in various ways. + + Modern Common Lisp defines a second, independent way to specify the +`setf' behavior of a function, namely "`setf' functions" whose names +are lists `(setf NAME)' rather than symbols. For example, `(defun +(setf foo) ...)' defines the function that is used when `setf' is +applied to `foo'. This package does not currently support `setf' +functions. In particular, it is a compile-time error to use `setf' on +a form which has not already been `defsetf''d or otherwise declared; in +newer Common Lisps, this would not be an error since the function +`(setf FUNC)' might be defined later. + + +File: cl.info, Node: Variable Bindings, Next: Conditionals, Prev: Generalized Variables, Up: Control Structure + +Variable Bindings +================= + +These Lisp forms make bindings to variables and function names, +analogous to Lisp's built-in `let' form. + + *Note Modify Macros::, for the `letf' and `letf*' forms which are +also related to variable bindings. + +* Menu: + +* Dynamic Bindings:: The `progv' form +* Lexical Bindings:: `lexical-let' and lexical closures +* Function Bindings:: `flet' and `labels' +* Macro Bindings:: `macrolet' and `symbol-macrolet' + + +File: cl.info, Node: Dynamic Bindings, Next: Lexical Bindings, Prev: Variable Bindings, Up: Variable Bindings + +Dynamic Bindings +---------------- + +The standard `let' form binds variables whose names are known at +compile-time. The `progv' form provides an easy way to bind variables +whose names are computed at run-time. + + - Special Form: progv SYMBOLS VALUES FORMS... + This form establishes `let'-style variable bindings on a set of + variables computed at run-time. The expressions SYMBOLS and + VALUES are evaluated, and must return lists of symbols and values, + respectively. The symbols are bound to the corresponding values + for the duration of the body FORMs. If VALUES is shorter than + SYMBOLS, the last few symbols are made unbound (as if by + `makunbound') inside the body. If SYMBOLS is shorter than VALUES, + the excess values are ignored. + + +File: cl.info, Node: Lexical Bindings, Next: Function Bindings, Prev: Dynamic Bindings, Up: Variable Bindings + +Lexical Bindings +---------------- + +The "CL" package defines the following macro which more closely follows +the Common Lisp `let' form: + + - Special Form: lexical-let (BINDINGS...) FORMS... + This form is exactly like `let' except that the bindings it + establishes are purely lexical. Lexical bindings are similar to + local variables in a language like C: Only the code physically + within the body of the `lexical-let' (after macro expansion) may + refer to the bound variables. + + (setq a 5) + (defun foo (b) (+ a b)) + (let ((a 2)) (foo a)) + => 4 + (lexical-let ((a 2)) (foo a)) + => 7 + + In this example, a regular `let' binding of `a' actually makes a + temporary change to the global variable `a', so `foo' is able to + see the binding of `a' to 2. But `lexical-let' actually creates a + distinct local variable `a' for use within its body, without any + effect on the global variable of the same name. + + The most important use of lexical bindings is to create "closures". + A closure is a function object that refers to an outside lexical + variable. For example: + + (defun make-adder (n) + (lexical-let ((n n)) + (function (lambda (m) (+ n m))))) + (setq add17 (make-adder 17)) + (funcall add17 4) + => 21 + + The call `(make-adder 17)' returns a function object which adds 17 + to its argument. If `let' had been used instead of `lexical-let', + the function object would have referred to the global `n', which + would have been bound to 17 only during the call to `make-adder' + itself. + + (defun make-counter () + (lexical-let ((n 0)) + (function* (lambda (&optional (m 1)) (incf n m))))) + (setq count-1 (make-counter)) + (funcall count-1 3) + => 3 + (funcall count-1 14) + => 17 + (setq count-2 (make-counter)) + (funcall count-2 5) + => 5 + (funcall count-1 2) + => 19 + (funcall count-2) + => 6 + + Here we see that each call to `make-counter' creates a distinct + local variable `n', which serves as a private counter for the + function object that is returned. + + Closed-over lexical variables persist until the last reference to + them goes away, just like all other Lisp objects. For example, + `count-2' refers to a function object which refers to an instance + of the variable `n'; this is the only reference to that variable, + so after `(setq count-2 nil)' the garbage collector would be able + to delete this instance of `n'. Of course, if a `lexical-let' + does not actually create any closures, then the lexical variables + are free as soon as the `lexical-let' returns. + + Many closures are used only during the extent of the bindings they + refer to; these are known as "downward funargs" in Lisp parlance. + When a closure is used in this way, regular Emacs Lisp dynamic + bindings suffice and will be more efficient than `lexical-let' + closures: + + (defun add-to-list (x list) + (mapcar (function (lambda (y) (+ x y))) list)) + (add-to-list 7 '(1 2 5)) + => (8 9 12) + + Since this lambda is only used while `x' is still bound, it is not + necessary to make a true closure out of it. + + You can use `defun' or `flet' inside a `lexical-let' to create a + named closure. If several closures are created in the body of a + single `lexical-let', they all close over the same instance of the + lexical variable. + + The `lexical-let' form is an extension to Common Lisp. In true + Common Lisp, all bindings are lexical unless declared otherwise. + + - Special Form: lexical-let* (BINDINGS...) FORMS... + This form is just like `lexical-let', except that the bindings are + made sequentially in the manner of `let*'. + + +File: cl.info, Node: Function Bindings, Next: Macro Bindings, Prev: Lexical Bindings, Up: Variable Bindings + +Function Bindings +----------------- + +These forms make `let'-like bindings to functions instead of variables. + + - Special Form: flet (BINDINGS...) FORMS... + This form establishes `let'-style bindings on the function cells + of symbols rather than on the value cells. Each BINDING must be a + list of the form `(NAME ARGLIST FORMS...)', which defines a + function exactly as if it were a `defun*' form. The function NAME + is defined accordingly for the duration of the body of the `flet'; + then the old function definition, or lack thereof, is restored. + + While `flet' in Common Lisp establishes a lexical binding of NAME, + Emacs Lisp `flet' makes a dynamic binding. The result is that + `flet' affects indirect calls to a function as well as calls + directly inside the `flet' form itself. + + You can use `flet' to disable or modify the behavior of a function + in a temporary fashion. This will even work on Emacs primitives, + although note that some calls to primitive functions internal to + Emacs are made without going through the symbol's function cell, + and so will not be affected by `flet'. For example, + + (flet ((message (&rest args) (push args saved-msgs))) + (do-something)) + + This code attempts to replace the built-in function `message' with + a function that simply saves the messages in a list rather than + displaying them. The original definition of `message' will be + restored after `do-something' exits. This code will work fine on + messages generated by other Lisp code, but messages generated + directly inside Emacs will not be caught since they make direct + C-language calls to the message routines rather than going through + the Lisp `message' function. + + Functions defined by `flet' may use the full Common Lisp argument + notation supported by `defun*'; also, the function body is + enclosed in an implicit block as if by `defun*'. *Note Program + Structure::. + + - Special Form: labels (BINDINGS...) FORMS... + The `labels' form is a synonym for `flet'. (In Common Lisp, + `labels' and `flet' differ in ways that depend on their lexical + scoping; these distinctions vanish in dynamically scoped Emacs + Lisp.) + + +File: cl.info, Node: Macro Bindings, Prev: Function Bindings, Up: Variable Bindings + +Macro Bindings +-------------- + +These forms create local macros and "symbol macros." + + - Special Form: macrolet (BINDINGS...) FORMS... + This form is analogous to `flet', but for macros instead of + functions. Each BINDING is a list of the same form as the + arguments to `defmacro*' (i.e., a macro name, argument list, and + macro-expander forms). The macro is defined accordingly for use + within the body of the `macrolet'. + + Because of the nature of macros, `macrolet' is lexically scoped + even in Emacs Lisp: The `macrolet' binding will affect only calls + that appear physically within the body FORMS, possibly after + expansion of other macros in the body. + + - Special Form: symbol-macrolet (BINDINGS...) FORMS... + This form creates "symbol macros", which are macros that look like + variable references rather than function calls. Each BINDING is a + list `(VAR EXPANSION)'; any reference to VAR within the body FORMS + is replaced by EXPANSION. + + (setq bar '(5 . 9)) + (symbol-macrolet ((foo (car bar))) + (incf foo)) + bar + => (6 . 9) + + A `setq' of a symbol macro is treated the same as a `setf'. I.e., + `(setq foo 4)' in the above would be equivalent to `(setf foo 4)', + which in turn expands to `(setf (car bar) 4)'. + + Likewise, a `let' or `let*' binding a symbol macro is treated like + a `letf' or `letf*'. This differs from true Common Lisp, where + the rules of lexical scoping cause a `let' binding to shadow a + `symbol-macrolet' binding. In this package, only `lexical-let' + and `lexical-let*' will shadow a symbol macro. + + There is no analogue of `defmacro' for symbol macros; all symbol + macros are local. A typical use of `symbol-macrolet' is in the + expansion of another macro: + + (defmacro* my-dolist ((x list) &rest body) + (let ((var (gensym))) + (list 'loop 'for var 'on list 'do + (list* 'symbol-macrolet (list (list x (list 'car var))) + body)))) + + (setq mylist '(1 2 3 4)) + (my-dolist (x mylist) (incf x)) + mylist + => (2 3 4 5) + + In this example, the `my-dolist' macro is similar to `dolist' + (*note Iteration::.) except that the variable `x' becomes a true + reference onto the elements of the list. The `my-dolist' call + shown here expands to + + (loop for G1234 on mylist do + (symbol-macrolet ((x (car G1234))) + (incf x))) + + which in turn expands to + + (loop for G1234 on mylist do (incf (car G1234))) + + *Note Loop Facility::, for a description of the `loop' macro. + This package defines a nonstandard `in-ref' loop clause that works + much like `my-dolist'. + + +File: cl.info, Node: Conditionals, Next: Blocks and Exits, Prev: Variable Bindings, Up: Control Structure + +Conditionals +============ + +These conditional forms augment Emacs Lisp's simple `if', `and', `or', +and `cond' forms. + + - Special Form: when TEST FORMS... + This is a variant of `if' where there are no "else" forms, and + possibly several "then" forms. In particular, + + (when TEST A B C) + + is entirely equivalent to + + (if TEST (progn A B C) nil) + + - Special Form: unless TEST FORMS... + This is a variant of `if' where there are no "then" forms, and + possibly several "else" forms: + + (unless TEST A B C) + + is entirely equivalent to + + (when (not TEST) A B C) + + - Special Form: case KEYFORM CLAUSE... + This macro evaluates KEYFORM, then compares it with the key values + listed in the various CLAUSEs. Whichever clause matches the key + is executed; comparison is done by `eql'. If no clause matches, + the `case' form returns `nil'. The clauses are of the form + + (KEYLIST BODY-FORMS...) + + where KEYLIST is a list of key values. If there is exactly one + value, and it is not a cons cell or the symbol `nil' or `t', then + it can be used by itself as a KEYLIST without being enclosed in a + list. All key values in the `case' form must be distinct. The + final clauses may use `t' in place of a KEYLIST to indicate a + default clause that should be taken if none of the other clauses + match. (The symbol `otherwise' is also recognized in place of + `t'. To make a clause that matches the actual symbol `t', `nil', + or `otherwise', enclose the symbol in a list.) + + For example, this expression reads a keystroke, then does one of + four things depending on whether it is an `a', a `b', a or + , or anything else. + + (case (read-char) + (?a (do-a-thing)) + (?b (do-b-thing)) + ((?\r ?\n) (do-ret-thing)) + (t (do-other-thing))) + + - Special Form: ecase KEYFORM CLAUSE... + This macro is just like `case', except that if the key does not + match any of the clauses, an error is signalled rather than simply + returning `nil'. + + - Special Form: typecase KEYFORM CLAUSE... + This macro is a version of `case' that checks for types rather + than values. Each CLAUSE is of the form `(TYPE BODY...)'. *Note + Type Predicates::, for a description of type specifiers. For + example, + + (typecase x + (integer (munch-integer x)) + (float (munch-float x)) + (string (munch-integer (string-to-int x))) + (t (munch-anything x))) + + The type specifier `t' matches any type of object; the word + `otherwise' is also allowed. To make one clause match any of + several types, use an `(or ...)' type specifier. + + - Special Form: etypecase KEYFORM CLAUSE... + This macro is just like `typecase', except that if the key does + not match any of the clauses, an error is signalled rather than + simply returning `nil'. + + +File: cl.info, Node: Blocks and Exits, Next: Iteration, Prev: Conditionals, Up: Control Structure + +Blocks and Exits +================ + +Common Lisp "blocks" provide a non-local exit mechanism very similar to +`catch' and `throw', but lexically rather than dynamically scoped. +This package actually implements `block' in terms of `catch'; however, +the lexical scoping allows the optimizing byte-compiler to omit the +costly `catch' step if the body of the block does not actually +`return-from' the block. + + - Special Form: block NAME FORMS... + The FORMS are evaluated as if by a `progn'. However, if any of + the FORMS execute `(return-from NAME)', they will jump out and + return directly from the `block' form. The `block' returns the + result of the last FORM unless a `return-from' occurs. + + The `block'/`return-from' mechanism is quite similar to the + `catch'/`throw' mechanism. The main differences are that block + NAMEs are unevaluated symbols, rather than forms (such as quoted + symbols) which evaluate to a tag at run-time; and also that blocks + are lexically scoped whereas `catch'/`throw' are dynamically + scoped. This means that functions called from the body of a + `catch' can also `throw' to the `catch', but the `return-from' + referring to a block name must appear physically within the FORMS + that make up the body of the block. They may not appear within + other called functions, although they may appear within macro + expansions or `lambda's in the body. Block names and `catch' + names form independent name-spaces. + + In true Common Lisp, `defun' and `defmacro' surround the function + or expander bodies with implicit blocks with the same name as the + function or macro. This does not occur in Emacs Lisp, but this + package provides `defun*' and `defmacro*' forms which do create + the implicit block. + + The Common Lisp looping constructs defined by this package, such + as `loop' and `dolist', also create implicit blocks just as in + Common Lisp. + + Because they are implemented in terms of Emacs Lisp `catch' and + `throw', blocks have the same overhead as actual `catch' + constructs (roughly two function calls). However, Zawinski and + Furuseth's optimizing byte compiler (standard in Emacs 19) will + optimize away the `catch' if the block does not in fact contain + any `return' or `return-from' calls that jump to it. This means + that `do' loops and `defun*' functions which don't use `return' + don't pay the overhead to support it. + + - Special Form: return-from NAME [RESULT] + This macro returns from the block named NAME, which must be an + (unevaluated) symbol. If a RESULT form is specified, it is + evaluated to produce the result returned from the `block'. + Otherwise, `nil' is returned. + + - Special Form: return [RESULT] + This macro is exactly like `(return-from nil RESULT)'. Common + Lisp loops like `do' and `dolist' implicitly enclose themselves in + `nil' blocks. + + +File: cl.info, Node: Iteration, Next: Loop Facility, Prev: Blocks and Exits, Up: Control Structure + +Iteration +========= + +The macros described here provide more sophisticated, high-level +looping constructs to complement Emacs Lisp's basic `while' loop. + + - Special Form: loop FORMS... + The "CL" package supports both the simple, old-style meaning of + `loop' and the extremely powerful and flexible feature known as + the "Loop Facility" or "Loop Macro". This more advanced facility + is discussed in the following section; *note Loop Facility::.. + The simple form of `loop' is described here. + + If `loop' is followed by zero or more Lisp expressions, then + `(loop EXPRS...)' simply creates an infinite loop executing the + expressions over and over. The loop is enclosed in an implicit + `nil' block. Thus, + + (loop (foo) (if (no-more) (return 72)) (bar)) + + is exactly equivalent to + + (block nil (while t (foo) (if (no-more) (return 72)) (bar))) + + If any of the expressions are plain symbols, the loop is instead + interpreted as a Loop Macro specification as described later. + (This is not a restriction in practice, since a plain symbol in + the above notation would simply access and throw away the value of + a variable.) + + - Special Form: do (SPEC...) (END-TEST [RESULT...]) FORMS... + This macro creates a general iterative loop. Each SPEC is of the + form + + (VAR [INIT [STEP]]) + + The loop works as follows: First, each VAR is bound to the + associated INIT value as if by a `let' form. Then, in each + iteration of the loop, the END-TEST is evaluated; if true, the + loop is finished. Otherwise, the body FORMS are evaluated, then + each VAR is set to the associated STEP expression (as if by a + `psetq' form) and the next iteration begins. Once the END-TEST + becomes true, the RESULT forms are evaluated (with the VARs still + bound to their values) to produce the result returned by `do'. + + The entire `do' loop is enclosed in an implicit `nil' block, so + that you can use `(return)' to break out of the loop at any time. + + If there are no RESULT forms, the loop returns `nil'. If a given + VAR has no STEP form, it is bound to its INIT value but not + otherwise modified during the `do' loop (unless the code + explicitly modifies it); this case is just a shorthand for putting + a `(let ((VAR INIT)) ...)' around the loop. If INIT is also + omitted it defaults to `nil', and in this case a plain `VAR' can + be used in place of `(VAR)', again following the analogy with + `let'. + + This example (from Steele) illustrates a loop which applies the + function `f' to successive pairs of values from the lists `foo' + and `bar'; it is equivalent to the call `(mapcar* 'f foo bar)'. + Note that this loop has no body FORMS at all, performing all its + work as side effects of the rest of the loop. + + (do ((x foo (cdr x)) + (y bar (cdr y)) + (z nil (cons (f (car x) (car y)) z))) + ((or (null x) (null y)) + (nreverse z))) + + - Special Form: do* (SPEC...) (END-TEST [RESULT...]) FORMS... + This is to `do' what `let*' is to `let'. In particular, the + initial values are bound as if by `let*' rather than `let', and + the steps are assigned as if by `setq' rather than `psetq'. + + Here is another way to write the above loop: + + (do* ((xp foo (cdr xp)) + (yp bar (cdr yp)) + (x (car xp) (car xp)) + (y (car yp) (car yp)) + z) + ((or (null xp) (null yp)) + (nreverse z)) + (push (f x y) z)) + + - Special Form: dolist (VAR LIST [RESULT]) FORMS... + This is a more specialized loop which iterates across the elements + of a list. LIST should evaluate to a list; the body FORMS are + executed with VAR bound to each element of the list in turn. + Finally, the RESULT form (or `nil') is evaluated with VAR bound to + `nil' to produce the result returned by the loop. The loop is + surrounded by an implicit `nil' block. + + - Special Form: dotimes (VAR COUNT [RESULT]) FORMS... + This is a more specialized loop which iterates a specified number + of times. The body is executed with VAR bound to the integers + from zero (inclusive) to COUNT (exclusive), in turn. Then the + `result' form is evaluated with VAR bound to the total number of + iterations that were done (i.e., `(max 0 COUNT)') to get the + return value for the loop form. The loop is surrounded by an + implicit `nil' block. + + - Special Form: do-symbols (VAR [OBARRAY [RESULT]]) FORMS... + This loop iterates over all interned symbols. If OBARRAY is + specified and is not `nil', it loops over all symbols in that + obarray. For each symbol, the body FORMS are evaluated with VAR + bound to that symbol. The symbols are visited in an unspecified + order. Afterward the RESULT form, if any, is evaluated (with VAR + bound to `nil') to get the return value. The loop is surrounded + by an implicit `nil' block. + + - Special Form: do-all-symbols (VAR [RESULT]) FORMS... + This is identical to `do-symbols' except that the OBARRAY argument + is omitted; it always iterates over the default obarray. + + *Note Mapping over Sequences::, for some more functions for +iterating over vectors or lists. + + +File: cl.info, Node: Loop Facility, Next: Multiple Values, Prev: Iteration, Up: Control Structure + +Loop Facility +============= + +A common complaint with Lisp's traditional looping constructs is that +they are either too simple and limited, such as Common Lisp's `dotimes' +or Emacs Lisp's `while', or too unreadable and obscure, like Common +Lisp's `do' loop. + + To remedy this, recent versions of Common Lisp have added a new +construct called the "Loop Facility" or "`loop' macro," with an +easy-to-use but very powerful and expressive syntax. + +* Menu: + +* Loop Basics:: `loop' macro, basic clause structure +* Loop Examples:: Working examples of `loop' macro +* For Clauses:: Clauses introduced by `for' or `as' +* Iteration Clauses:: `repeat', `while', `thereis', etc. +* Accumulation Clauses:: `collect', `sum', `maximize', etc. +* Other Clauses:: `with', `if', `initially', `finally' + + +File: cl.info, Node: Loop Basics, Next: Loop Examples, Prev: Loop Facility, Up: Loop Facility + +Loop Basics +----------- + +The `loop' macro essentially creates a mini-language within Lisp that +is specially tailored for describing loops. While this language is a +little strange-looking by the standards of regular Lisp, it turns out +to be very easy to learn and well-suited to its purpose. + + Since `loop' is a macro, all parsing of the loop language takes +place at byte-compile time; compiled `loop's are just as efficient as +the equivalent `while' loops written longhand. + + - Special Form: loop CLAUSES... + A loop construct consists of a series of CLAUSEs, each introduced + by a symbol like `for' or `do'. Clauses are simply strung + together in the argument list of `loop', with minimal extra + parentheses. The various types of clauses specify + initializations, such as the binding of temporary variables, + actions to be taken in the loop, stepping actions, and final + cleanup. + + Common Lisp specifies a certain general order of clauses in a loop: + + (loop NAME-CLAUSE + VAR-CLAUSES... + ACTION-CLAUSES...) + + The NAME-CLAUSE optionally gives a name to the implicit block that + surrounds the loop. By default, the implicit block is named + `nil'. The VAR-CLAUSES specify what variables should be bound + during the loop, and how they should be modified or iterated + throughout the course of the loop. The ACTION-CLAUSES are things + to be done during the loop, such as computing, collecting, and + returning values. + + The Emacs version of the `loop' macro is less restrictive about + the order of clauses, but things will behave most predictably if + you put the variable-binding clauses `with', `for', and `repeat' + before the action clauses. As in Common Lisp, `initially' and + `finally' clauses can go anywhere. + + Loops generally return `nil' by default, but you can cause them to + return a value by using an accumulation clause like `collect', an + end-test clause like `always', or an explicit `return' clause to + jump out of the implicit block. (Because the loop body is + enclosed in an implicit block, you can also use regular Lisp + `return' or `return-from' to break out of the loop.) + + The following sections give some examples of the Loop Macro in +action, and describe the particular loop clauses in great detail. +Consult the second edition of Steele's "Common Lisp, the Language", for +additional discussion and examples of the `loop' macro. + + +File: cl.info, Node: Loop Examples, Next: For Clauses, Prev: Loop Basics, Up: Loop Facility + +Loop Examples +------------- + +Before listing the full set of clauses that are allowed, let's look at +a few example loops just to get a feel for the `loop' language. + + (loop for buf in (buffer-list) + collect (buffer-file-name buf)) + +This loop iterates over all Emacs buffers, using the list returned by +`buffer-list'. For each buffer `buf', it calls `buffer-file-name' and +collects the results into a list, which is then returned from the +`loop' construct. The result is a list of the file names of all the +buffers in Emacs' memory. The words `for', `in', and `collect' are +reserved words in the `loop' language. + + (loop repeat 20 do (insert "Yowsa\n")) + +This loop inserts the phrase "Yowsa" twenty times in the current buffer. + + (loop until (eobp) do (munch-line) (forward-line 1)) + +This loop calls `munch-line' on every line until the end of the buffer. +If point is already at the end of the buffer, the loop exits +immediately. + + (loop do (munch-line) until (eobp) do (forward-line 1)) + +This loop is similar to the above one, except that `munch-line' is +always called at least once. + + (loop for x from 1 to 100 + for y = (* x x) + until (>= y 729) + finally return (list x (= y 729))) + +This more complicated loop searches for a number `x' whose square is +729. For safety's sake it only examines `x' values up to 100; dropping +the phrase `to 100' would cause the loop to count upwards with no +limit. The second `for' clause defines `y' to be the square of `x' +within the loop; the expression after the `=' sign is reevaluated each +time through the loop. The `until' clause gives a condition for +terminating the loop, and the `finally' clause says what to do when the +loop finishes. (This particular example was written less concisely +than it could have been, just for the sake of illustration.) + + Note that even though this loop contains three clauses (two `for's +and an `until') that would have been enough to define loops all by +themselves, it still creates a single loop rather than some sort of +triple-nested loop. You must explicitly nest your `loop' constructs if +you want nested loops. + diff --git a/info/cl.info-3 b/info/cl.info-3 new file mode 100644 index 0000000..40c734f --- /dev/null +++ b/info/cl.info-3 @@ -0,0 +1,1145 @@ +This is Info file ../info/cl.info, produced by Makeinfo version 1.68 +from the input file cl.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Common Lisp: (cl). GNU Emacs Common Lisp emulation package. +END-INFO-DIR-ENTRY + + This file documents the GNU Emacs Common Lisp emulation package. + + Copyright (C) 1993 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. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the author instead of in +the original English. + + +File: cl.info, Node: For Clauses, Next: Iteration Clauses, Prev: Loop Examples, Up: Loop Facility + +For Clauses +----------- + +Most loops are governed by one or more `for' clauses. A `for' clause +simultaneously describes variables to be bound, how those variables are +to be stepped during the loop, and usually an end condition based on +those variables. + + The word `as' is a synonym for the word `for'. This word is +followed by a variable name, then a word like `from' or `across' that +describes the kind of iteration desired. In Common Lisp, the phrase +`being the' sometimes precedes the type of iteration; in this package +both `being' and `the' are optional. The word `each' is a synonym for +`the', and the word that follows it may be singular or plural: `for x +being the elements of y' or `for x being each element of y'. Which +form you use is purely a matter of style. + + The variable is bound around the loop as if by `let': + + (setq i 'happy) + (loop for i from 1 to 10 do (do-something-with i)) + i + => happy + +`for VAR from EXPR1 to EXPR2 by EXPR3' + This type of `for' clause creates a counting loop. Each of the + three sub-terms is optional, though there must be at least one + term so that the clause is marked as a counting clause. + + The three expressions are the starting value, the ending value, and + the step value, respectively, of the variable. The loop counts + upwards by default (EXPR3 must be positive), from EXPR1 to EXPR2 + inclusively. If you omit the `from' term, the loop counts from + zero; if you omit the `to' term, the loop counts forever without + stopping (unless stopped by some other loop clause, of course); if + you omit the `by' term, the loop counts in steps of one. + + You can replace the word `from' with `upfrom' or `downfrom' to + indicate the direction of the loop. Likewise, you can replace + `to' with `upto' or `downto'. For example, `for x from 5 downto + 1' executes five times with `x' taking on the integers from 5 down + to 1 in turn. Also, you can replace `to' with `below' or `above', + which are like `upto' and `downto' respectively except that they + are exclusive rather than inclusive limits: + + (loop for x to 10 collect x) + => (0 1 2 3 4 5 6 7 8 9 10) + (loop for x below 10 collect x) + => (0 1 2 3 4 5 6 7 8 9) + + The `by' value is always positive, even for downward-counting + loops. Some sort of `from' value is required for downward loops; + `for x downto 5' is not a legal loop clause all by itself. + +`for VAR in LIST by FUNCTION' + This clause iterates VAR over all the elements of LIST, in turn. + If you specify the `by' term, then FUNCTION is used to traverse + the list instead of `cdr'; it must be a function taking one + argument. For example: + + (loop for x in '(1 2 3 4 5 6) collect (* x x)) + => (1 4 9 16 25 36) + (loop for x in '(1 2 3 4 5 6) by 'cddr collect (* x x)) + => (1 9 25) + +`for VAR on LIST by FUNCTION' + This clause iterates VAR over all the cons cells of LIST. + + (loop for x on '(1 2 3 4) collect x) + => ((1 2 3 4) (2 3 4) (3 4) (4)) + + With `by', there is no real reason that the `on' expression must + be a list. For example: + + (loop for x on first-animal by 'next-animal collect x) + + where `(next-animal x)' takes an "animal" X and returns the next + in the (assumed) sequence of animals, or `nil' if X was the last + animal in the sequence. + +`for VAR in-ref LIST by FUNCTION' + This is like a regular `in' clause, but VAR becomes a `setf'-able + "reference" onto the elements of the list rather than just a + temporary variable. For example, + + (loop for x in-ref my-list do (incf x)) + + increments every element of `my-list' in place. This clause is an + extension to standard Common Lisp. + +`for VAR across ARRAY' + This clause iterates VAR over all the elements of ARRAY, which may + be a vector or a string. + + (loop for x across "aeiou" + do (use-vowel (char-to-string x))) + +`for VAR across-ref ARRAY' + This clause iterates over an array, with VAR a `setf'-able + reference onto the elements; see `in-ref' above. + +`for VAR being the elements of SEQUENCE' + This clause iterates over the elements of SEQUENCE, which may be a + list, vector, or string. Since the type must be determined at + run-time, this is somewhat less efficient than `in' or `across'. + The clause may be followed by the additional term `using (index + VAR2)' to cause VAR2 to be bound to the successive indices + (starting at 0) of the elements. + + This clause type is taken from older versions of the `loop' macro, + and is not present in modern Common Lisp. The `using (sequence + ...)' term of the older macros is not supported. + +`for VAR being the elements of-ref SEQUENCE' + This clause iterates over a sequence, with VAR a `setf'-able + reference onto the elements; see `in-ref' above. + +`for VAR being the symbols [of OBARRAY]' + This clause iterates over symbols, either over all interned symbols + or over all symbols in OBARRAY. The loop is executed with VAR + bound to each symbol in turn. The symbols are visited in an + unspecified order. + + As an example, + + (loop for sym being the symbols + when (fboundp sym) + when (string-match "^map" (symbol-name sym)) + collect sym) + + returns a list of all the functions whose names begin with `map'. + + The Common Lisp words `external-symbols' and `present-symbols' are + also recognized but are equivalent to `symbols' in Emacs Lisp. + + Due to a minor implementation restriction, it will not work to have + more than one `for' clause iterating over symbols, hash tables, + keymaps, overlays, or intervals in a given `loop'. Fortunately, + it would rarely if ever be useful to do so. It *is* legal to mix + one of these types of clauses with other clauses like `for ... to' + or `while'. + +`for VAR being the hash-keys of HASH-TABLE' + This clause iterates over the entries in HASH-TABLE. For each + hash table entry, VAR is bound to the entry's key. If you write + `the hash-values' instead, VAR is bound to the values of the + entries. The clause may be followed by the additional term `using + (hash-values VAR2)' (where `hash-values' is the opposite word of + the word following `the') to cause VAR and VAR2 to be bound to the + two parts of each hash table entry. + +`for VAR being the key-codes of KEYMAP' + This clause iterates over the entries in KEYMAP. In GNU Emacs 18 + and 19, keymaps are either alists or vectors, and key-codes are + integers or symbols. In XEmacs, keymaps are a special new data + type, and key-codes are symbols or lists of symbols. The + iteration does not enter nested keymaps or inherited (parent) + keymaps. You can use `the key-bindings' to access the commands + bound to the keys rather than the key codes, and you can add a + `using' clause to access both the codes and the bindings together. + +`for VAR being the key-seqs of KEYMAP' + This clause iterates over all key sequences defined by KEYMAP and + its nested keymaps, where VAR takes on values which are strings in + Emacs 18 or vectors in Emacs 19. The strings or vectors are + reused for each iteration, so you must copy them if you wish to + keep them permanently. You can add a `using (key-bindings ...)' + clause to get the command bindings as well. + +`for VAR being the overlays [of BUFFER] ...' + This clause iterates over the Emacs 19 "overlays" or XEmacs + "extents" of a buffer (the clause `extents' is synonymous with + `overlays'). Under Emacs 18, this clause iterates zero times. If + the `of' term is omitted, the current buffer is used. This clause + also accepts optional `from POS' and `to POS' terms, limiting the + clause to overlays which overlap the specified region. + +`for VAR being the intervals [of BUFFER] ...' + This clause iterates over all intervals of a buffer with constant + text properties. The variable VAR will be bound to conses of + start and end positions, where one start position is always equal + to the previous end position. The clause allows `of', `from', + `to', and `property' terms, where the latter term restricts the + search to just the specified property. The `of' term may specify + either a buffer or a string. This clause is useful only in GNU + Emacs 19; in other versions, all buffers and strings consist of a + single interval. + +`for VAR being the frames' + This clause iterates over all frames, i.e., X window system windows + open on Emacs files. This clause works only under Emacs 19. The + clause `screens' is a synonym for `frames'. The frames are + visited in `next-frame' order starting from `selected-frame'. + +`for VAR being the windows [of FRAME]' + This clause iterates over the windows (in the Emacs sense) of the + current frame, or of the specified FRAME. (In Emacs 18 there is + only ever one frame, and the `of' term is not allowed there.) + +`for VAR being the buffers' + This clause iterates over all buffers in Emacs. It is equivalent + to `for VAR in (buffer-list)'. + +`for VAR = EXPR1 then EXPR2' + This clause does a general iteration. The first time through the + loop, VAR will be bound to EXPR1. On the second and successive + iterations it will be set by evaluating EXPR2 (which may refer to + the old value of VAR). For example, these two loops are + effectively the same: + + (loop for x on my-list by 'cddr do ...) + (loop for x = my-list then (cddr x) while x do ...) + + Note that this type of `for' clause does not imply any sort of + terminating condition; the above example combines it with a + `while' clause to tell when to end the loop. + + If you omit the `then' term, EXPR1 is used both for the initial + setting and for successive settings: + + (loop for x = (random) when (> x 0) return x) + + This loop keeps taking random numbers from the `(random)' function + until it gets a positive one, which it then returns. + + If you include several `for' clauses in a row, they are treated +sequentially (as if by `let*' and `setq'). You can instead use the +word `and' to link the clauses, in which case they are processed in +parallel (as if by `let' and `psetq'). + + (loop for x below 5 for y = nil then x collect (list x y)) + => ((0 nil) (1 1) (2 2) (3 3) (4 4)) + (loop for x below 5 and y = nil then x collect (list x y)) + => ((0 nil) (1 0) (2 1) (3 2) (4 3)) + +In the first loop, `y' is set based on the value of `x' that was just +set by the previous clause; in the second loop, `x' and `y' are set +simultaneously so `y' is set based on the value of `x' left over from +the previous time through the loop. + + Another feature of the `loop' macro is "destructuring", similar in +concept to the destructuring provided by `defmacro'. The VAR part of +any `for' clause can be given as a list of variables instead of a +single variable. The values produced during loop execution must be +lists; the values in the lists are stored in the corresponding +variables. + + (loop for (x y) in '((2 3) (4 5) (6 7)) collect (+ x y)) + => (5 9 13) + + In loop destructuring, if there are more values than variables the +trailing values are ignored, and if there are more variables than +values the trailing variables get the value `nil'. If `nil' is used as +a variable name, the corresponding values are ignored. Destructuring +may be nested, and dotted lists of variables like `(x . y)' are allowed. + + +File: cl.info, Node: Iteration Clauses, Next: Accumulation Clauses, Prev: For Clauses, Up: Loop Facility + +Iteration Clauses +----------------- + +Aside from `for' clauses, there are several other loop clauses that +control the way the loop operates. They might be used by themselves, +or in conjunction with one or more `for' clauses. + +`repeat INTEGER' + This clause simply counts up to the specified number using an + internal temporary variable. The loops + + (loop repeat n do ...) + (loop for temp to n do ...) + + are identical except that the second one forces you to choose a + name for a variable you aren't actually going to use. + +`while CONDITION' + This clause stops the loop when the specified condition (any Lisp + expression) becomes `nil'. For example, the following two loops + are equivalent, except for the implicit `nil' block that surrounds + the second one: + + (while COND FORMS...) + (loop while COND do FORMS...) + +`until CONDITION' + This clause stops the loop when the specified condition is true, + i.e., non-`nil'. + +`always CONDITION' + This clause stops the loop when the specified condition is `nil'. + Unlike `while', it stops the loop using `return nil' so that the + `finally' clauses are not executed. If all the conditions were + non-`nil', the loop returns `t': + + (if (loop for size in size-list always (> size 10)) + (some-big-sizes) + (no-big-sizes)) + +`never CONDITION' + This clause is like `always', except that the loop returns `t' if + any conditions were false, or `nil' otherwise. + +`thereis CONDITION' + This clause stops the loop when the specified form is non-`nil'; + in this case, it returns that non-`nil' value. If all the values + were `nil', the loop returns `nil'. + + +File: cl.info, Node: Accumulation Clauses, Next: Other Clauses, Prev: Iteration Clauses, Up: Loop Facility + +Accumulation Clauses +-------------------- + +These clauses cause the loop to accumulate information about the +specified Lisp FORM. The accumulated result is returned from the loop +unless overridden, say, by a `return' clause. + +`collect FORM' + This clause collects the values of FORM into a list. Several + examples of `collect' appear elsewhere in this manual. + + The word `collecting' is a synonym for `collect', and likewise for + the other accumulation clauses. + +`append FORM' + This clause collects lists of values into a result list using + `append'. + +`nconc FORM' + This clause collects lists of values into a result list by + destructively modifying the lists rather than copying them. + +`concat FORM' + This clause concatenates the values of the specified FORM into a + string. (It and the following clause are extensions to standard + Common Lisp.) + +`vconcat FORM' + This clause concatenates the values of the specified FORM into a + vector. + +`count FORM' + This clause counts the number of times the specified FORM + evaluates to a non-`nil' value. + +`sum FORM' + This clause accumulates the sum of the values of the specified + FORM, which must evaluate to a number. + +`maximize FORM' + This clause accumulates the maximum value of the specified FORM, + which must evaluate to a number. The return value is undefined if + `maximize' is executed zero times. + +`minimize FORM' + This clause accumulates the minimum value of the specified FORM. + + Accumulation clauses can be followed by `into VAR' to cause the data +to be collected into variable VAR (which is automatically `let'-bound +during the loop) rather than an unnamed temporary variable. Also, +`into' accumulations do not automatically imply a return value. The +loop must use some explicit mechanism, such as `finally return', to +return the accumulated result. + + It is legal for several accumulation clauses of the same type to +accumulate into the same place. From Steele: + + (loop for name in '(fred sue alice joe june) + for kids in '((bob ken) () () (kris sunshine) ()) + collect name + append kids) + => (fred bob ken sue alice joe kris sunshine june) + + +File: cl.info, Node: Other Clauses, Prev: Accumulation Clauses, Up: Loop Facility + +Other Clauses +------------- + +This section describes the remaining loop clauses. + +`with VAR = VALUE' + This clause binds a variable to a value around the loop, but + otherwise leaves the variable alone during the loop. The following + loops are basically equivalent: + + (loop with x = 17 do ...) + (let ((x 17)) (loop do ...)) + (loop for x = 17 then x do ...) + + Naturally, the variable VAR might be used for some purpose in the + rest of the loop. For example: + + (loop for x in my-list with res = nil do (push x res) + finally return res) + + This loop inserts the elements of `my-list' at the front of a new + list being accumulated in `res', then returns the list `res' at + the end of the loop. The effect is similar to that of a `collect' + clause, but the list gets reversed by virtue of the fact that + elements are being pushed onto the front of `res' rather than the + end. + + If you omit the `=' term, the variable is initialized to `nil'. + (Thus the `= nil' in the above example is unnecessary.) + + Bindings made by `with' are sequential by default, as if by + `let*'. Just like `for' clauses, `with' clauses can be linked + with `and' to cause the bindings to be made by `let' instead. + +`if CONDITION CLAUSE' + This clause executes the following loop clause only if the + specified condition is true. The following CLAUSE should be an + accumulation, `do', `return', `if', or `unless' clause. Several + clauses may be linked by separating them with `and'. These + clauses may be followed by `else' and a clause or clauses to + execute if the condition was false. The whole construct may + optionally be followed by the word `end' (which may be used to + disambiguate an `else' or `and' in a nested `if'). + + The actual non-`nil' value of the condition form is available by + the name `it' in the "then" part. For example: + + (setq funny-numbers '(6 13 -1)) + => (6 13 -1) + (loop for x below 10 + if (oddp x) + collect x into odds + and if (memq x funny-numbers) return (cdr it) end + else + collect x into evens + finally return (vector odds evens)) + => [(1 3 5 7 9) (0 2 4 6 8)] + (setq funny-numbers '(6 7 13 -1)) + => (6 7 13 -1) + (loop ) + => (13 -1) + + Note the use of `and' to put two clauses into the "then" part, one + of which is itself an `if' clause. Note also that `end', while + normally optional, was necessary here to make it clear that the + `else' refers to the outermost `if' clause. In the first case, + the loop returns a vector of lists of the odd and even values of + X. In the second case, the odd number 7 is one of the + `funny-numbers' so the loop returns early; the actual returned + value is based on the result of the `memq' call. + +`when CONDITION CLAUSE' + This clause is just a synonym for `if'. + +`unless CONDITION CLAUSE' + The `unless' clause is just like `if' except that the sense of the + condition is reversed. + +`named NAME' + This clause gives a name other than `nil' to the implicit block + surrounding the loop. The NAME is the symbol to be used as the + block name. + +`initially [do] FORMS...' + This keyword introduces one or more Lisp forms which will be + executed before the loop itself begins (but after any variables + requested by `for' or `with' have been bound to their initial + values). `initially' clauses can appear anywhere; if there are + several, they are executed in the order they appear in the loop. + The keyword `do' is optional. + +`finally [do] FORMS...' + This introduces Lisp forms which will be executed after the loop + finishes (say, on request of a `for' or `while'). `initially' and + `finally' clauses may appear anywhere in the loop construct, but + they are executed (in the specified order) at the beginning or + end, respectively, of the loop. + +`finally return FORM' + This says that FORM should be executed after the loop is done to + obtain a return value. (Without this, or some other clause like + `collect' or `return', the loop will simply return `nil'.) + Variables bound by `for', `with', or `into' will still contain + their final values when FORM is executed. + +`do FORMS...' + The word `do' may be followed by any number of Lisp expressions + which are executed as an implicit `progn' in the body of the loop. + Many of the examples in this section illustrate the use of `do'. + +`return FORM' + This clause causes the loop to return immediately. The following + Lisp form is evaluated to give the return value of the `loop' + form. The `finally' clauses, if any, are not executed. Of + course, `return' is generally used inside an `if' or `unless', as + its use in a top-level loop clause would mean the loop would never + get to "loop" more than once. + + The clause `return FORM' is equivalent to `do (return FORM)' (or + `return-from' if the loop was named). The `return' clause is + implemented a bit more efficiently, though. + + While there is no high-level way to add user extensions to `loop' +(comparable to `defsetf' for `setf', say), this package does offer two +properties called `cl-loop-handler' and `cl-loop-for-handler' which are +functions to be called when a given symbol is encountered as a +top-level loop clause or `for' clause, respectively. Consult the +source code in file `cl-macs.el' for details. + + This package's `loop' macro is compatible with that of Common Lisp, +except that a few features are not implemented: `loop-finish' and +data-type specifiers. Naturally, the `for' clauses which iterate over +keymaps, overlays, intervals, frames, windows, and buffers are +Emacs-specific extensions. + + +File: cl.info, Node: Multiple Values, Prev: Loop Facility, Up: Control Structure + +Multiple Values +=============== + +Common Lisp functions can return zero or more results. Emacs Lisp +functions, by contrast, always return exactly one result. This package +makes no attempt to emulate Common Lisp multiple return values; Emacs +versions of Common Lisp functions that return more than one value +either return just the first value (as in `compiler-macroexpand') or +return a list of values (as in `get-setf-method'). This package *does* +define placeholders for the Common Lisp functions that work with +multiple values, but in Emacs Lisp these functions simply operate on +lists instead. The `values' form, for example, is a synonym for `list' +in Emacs. + + - Special Form: multiple-value-bind (VAR...) VALUES-FORM FORMS... + This form evaluates VALUES-FORM, which must return a list of + values. It then binds the VARs to these respective values, as if + by `let', and then executes the body FORMS. If there are more + VARs than values, the extra VARs are bound to `nil'. If there are + fewer VARs than values, the excess values are ignored. + + - Special Form: multiple-value-setq (VAR...) FORM + This form evaluates FORM, which must return a list of values. It + then sets the VARs to these respective values, as if by `setq'. + Extra VARs or values are treated the same as in + `multiple-value-bind'. + + The older Quiroz package attempted a more faithful (but still +imperfect) emulation of Common Lisp multiple values. The old method +"usually" simulated true multiple values quite well, but under certain +circumstances would leave spurious return values in memory where a +later, unrelated `multiple-value-bind' form would see them. + + Since a perfect emulation is not feasible in Emacs Lisp, this +package opts to keep it as simple and predictable as possible. + + +File: cl.info, Node: Macros, Next: Declarations, Prev: Control Structure, Up: Top + +Macros +****** + +This package implements the various Common Lisp features of `defmacro', +such as destructuring, `&environment', and `&body'. Top-level `&whole' +is not implemented for `defmacro' due to technical difficulties. *Note +Argument Lists::. + + Destructuring is made available to the user by way of the following +macro: + + - Special Form: destructuring-bind ARGLIST EXPR FORMS... + This macro expands to code which executes FORMS, with the + variables in ARGLIST bound to the list of values returned by EXPR. + The ARGLIST can include all the features allowed for `defmacro' + argument lists, including destructuring. (The `&environment' + keyword is not allowed.) The macro expansion will signal an error + if EXPR returns a list of the wrong number of arguments or with + incorrect keyword arguments. + + This package also includes the Common Lisp `define-compiler-macro' +facility, which allows you to define compile-time expansions and +optimizations for your functions. + + - Special Form: define-compiler-macro NAME ARGLIST FORMS... + This form is similar to `defmacro', except that it only expands + calls to NAME at compile-time; calls processed by the Lisp + interpreter are not expanded, nor are they expanded by the + `macroexpand' function. + + The argument list may begin with a `&whole' keyword and a + variable. This variable is bound to the macro-call form itself, + i.e., to a list of the form `(NAME ARGS...)'. If the macro + expander returns this form unchanged, then the compiler treats it + as a normal function call. This allows compiler macros to work as + optimizers for special cases of a function, leaving complicated + cases alone. + + For example, here is a simplified version of a definition that + appears as a standard part of this package: + + (define-compiler-macro member* (&whole form a list &rest keys) + (if (and (null keys) + (eq (car-safe a) 'quote) + (not (floatp-safe (cadr a)))) + (list 'memq a list) + form)) + + This definition causes `(member* A LIST)' to change to a call to + the faster `memq' in the common case where A is a + non-floating-point constant; if A is anything else, or if there + are any keyword arguments in the call, then the original `member*' + call is left intact. (The actual compiler macro for `member*' + optimizes a number of other cases, including common `:test' + predicates.) + + - Function: compiler-macroexpand FORM + This function is analogous to `macroexpand', except that it + expands compiler macros rather than regular macros. It returns + FORM unchanged if it is not a call to a function for which a + compiler macro has been defined, or if that compiler macro decided + to punt by returning its `&whole' argument. Like `macroexpand', + it expands repeatedly until it reaches a form for which no further + expansion is possible. + + *Note Macro Bindings::, for descriptions of the `macrolet' and +`symbol-macrolet' forms for making "local" macro definitions. + + +File: cl.info, Node: Declarations, Next: Symbols, Prev: Macros, Up: Top + +Declarations +************ + +Common Lisp includes a complex and powerful "declaration" mechanism +that allows you to give the compiler special hints about the types of +data that will be stored in particular variables, and about the ways +those variables and functions will be used. This package defines +versions of all the Common Lisp declaration forms: `declare', +`locally', `proclaim', `declaim', and `the'. + + Most of the Common Lisp declarations are not currently useful in +Emacs Lisp, as the byte-code system provides little opportunity to +benefit from type information, and `special' declarations are redundant +in a fully dynamically-scoped Lisp. A few declarations are meaningful +when the optimizing Emacs 19 byte compiler is being used, however. +Under the earlier non-optimizing compiler, these declarations will +effectively be ignored. + + - Function: proclaim DECL-SPEC + This function records a "global" declaration specified by + DECL-SPEC. Since `proclaim' is a function, DECL-SPEC is evaluated + and thus should normally be quoted. + + - Special Form: declaim DECL-SPECS... + This macro is like `proclaim', except that it takes any number of + DECL-SPEC arguments, and the arguments are unevaluated and + unquoted. The `declaim' macro also puts an `(eval-when (compile + load eval) ...)' around the declarations so that they will be + registered at compile-time as well as at run-time. (This is vital, + since normally the declarations are meant to influence the way the + compiler treats the rest of the file that contains the `declaim' + form.) + + - Special Form: declare DECL-SPECS... + This macro is used to make declarations within functions and other + code. Common Lisp allows declarations in various locations, + generally at the beginning of any of the many "implicit `progn's" + throughout Lisp syntax, such as function bodies, `let' bodies, + etc. Currently the only declaration understood by `declare' is + `special'. + + - Special Form: locally DECLARATIONS... FORMS... + In this package, `locally' is no different from `progn'. + + - Special Form: the TYPE FORM + Type information provided by `the' is ignored in this package; in + other words, `(the TYPE FORM)' is equivalent to FORM. Future + versions of the optimizing byte-compiler may make use of this + information. + + For example, `mapcar' can map over both lists and arrays. It is + hard for the compiler to expand `mapcar' into an in-line loop + unless it knows whether the sequence will be a list or an array + ahead of time. With `(mapcar 'car (the vector foo))', a future + compiler would have enough information to expand the loop in-line. + For now, Emacs Lisp will treat the above code as exactly equivalent + to `(mapcar 'car foo)'. + + Each DECL-SPEC in a `proclaim', `declaim', or `declare' should be a +list beginning with a symbol that says what kind of declaration it is. +This package currently understands `special', `inline', `notinline', +`optimize', and `warn' declarations. (The `warn' declaration is an +extension of standard Common Lisp.) Other Common Lisp declarations, +such as `type' and `ftype', are silently ignored. + +`special' + Since all variables in Emacs Lisp are "special" (in the Common + Lisp sense), `special' declarations are only advisory. They + simply tell the optimizing byte compiler that the specified + variables are intentionally being referred to without being bound + in the body of the function. The compiler normally emits warnings + for such references, since they could be typographical errors for + references to local variables. + + The declaration `(declare (special VAR1 VAR2))' is equivalent to + `(defvar VAR1) (defvar VAR2)' in the optimizing compiler, or to + nothing at all in older compilers (which do not warn for non-local + references). + + In top-level contexts, it is generally better to write `(defvar + VAR)' than `(declaim (special VAR))', since `defvar' makes your + intentions clearer. But the older byte compilers can not handle + `defvar's appearing inside of functions, while `(declare (special + VAR))' takes care to work correctly with all compilers. + +`inline' + The `inline' DECL-SPEC lists one or more functions whose bodies + should be expanded "in-line" into calling functions whenever the + compiler is able to arrange for it. For example, the Common Lisp + function `cadr' is declared `inline' by this package so that the + form `(cadr X)' will expand directly into `(car (cdr X))' when it + is called in user functions, for a savings of one (relatively + expensive) function call. + + The following declarations are all equivalent. Note that the + `defsubst' form is a convenient way to define a function and + declare it inline all at once, but it is available only in Emacs + 19. + + (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 + + *Please note:* This declaration remains in effect after the + containing source file is done. It is correct to use it to + request that a function you have defined should be inlined, but it + is impolite to use it to request inlining of an external function. + + In Common Lisp, it is possible to use `(declare (inline ...))' + before a particular call to a function to cause just that call to + be inlined; the current byte compilers provide no way to implement + this, so `(declare (inline ...))' is currently ignored by this + package. + +`notinline' + The `notinline' declaration lists functions which should not be + inlined after all; it cancels a previous `inline' declaration. + +`optimize' + This declaration controls how much optimization is performed by + the compiler. Naturally, it is ignored by the earlier + non-optimizing compilers. + + The word `optimize' is followed by any number of lists like + `(speed 3)' or `(safety 2)'. Common Lisp defines several + optimization "qualities"; this package ignores all but `speed' and + `safety'. The value of a quality should be an integer from 0 to + 3, with 0 meaning "unimportant" and 3 meaning "very important." + The default level for both qualities is 1. + + In this package, with the Emacs 19 optimizing compiler, the + `speed' quality is tied to the `byte-compile-optimize' flag, which + is set to `nil' for `(speed 0)' and to `t' for higher settings; + and the `safety' quality is tied to the + `byte-compile-delete-errors' flag, which is set to `t' for + `(safety 3)' and to `nil' for all lower settings. (The latter + flag controls whether the compiler is allowed to optimize out code + whose only side-effect could be to signal an error, e.g., + rewriting `(progn foo bar)' to `bar' when it is not known whether + `foo' will be bound at run-time.) + + Note that even compiling with `(safety 0)', the Emacs byte-code + system provides sufficient checking to prevent real harm from + being done. For example, barring serious bugs in Emacs itself, + Emacs will not crash with a segmentation fault just because of an + error in a fully-optimized Lisp program. + + The `optimize' declaration is normally used in a top-level + `proclaim' or `declaim' in a file; Common Lisp allows it to be + used with `declare' to set the level of optimization locally for a + given form, but this will not work correctly with the current + version of the optimizing compiler. (The `declare' will set the + new optimization level, but that level will not automatically be + unset after the enclosing form is done.) + +`warn' + This declaration controls what sorts of warnings are generated by + the byte compiler. Again, only the optimizing compiler generates + warnings. The word `warn' is followed by any number of "warning + qualities," similar in form to optimization qualities. The + currently supported warning types are `redefine', `callargs', + `unresolved', and `free-vars'; in the current system, a value of 0 + will disable these warnings and any higher value will enable them. + See the documentation for the optimizing byte compiler for details. + + +File: cl.info, Node: Symbols, Next: Numbers, Prev: Declarations, Up: Top + +Symbols +******* + +This package defines several symbol-related features that were missing +from Emacs Lisp. + +* Menu: + +* Property Lists:: `get*', `remprop', `getf', `remf' +* Creating Symbols:: `gensym', `gentemp' + + +File: cl.info, Node: Property Lists, Next: Creating Symbols, Prev: Symbols, Up: Symbols + +Property Lists +============== + +These functions augment the standard Emacs Lisp functions `get' and +`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 symbols. + + - Function: get* SYMBOL PROPERTY &optional DEFAULT + This function is like `get', except that if the property is not + found, the DEFAULT argument provides the return value. (The Emacs + Lisp `get' function always uses `nil' as the default; this + package's `get*' is equivalent to Common Lisp's `get'.) + + The `get*' function is `setf'-able; when used in this fashion, the + DEFAULT argument is allowed but ignored. + + - Function: remprop SYMBOL PROPERTY + This function removes the entry for PROPERTY from the property + list of SYMBOL. It returns a true value if the property was + indeed found and removed, or `nil' if there was no such property. + (This function was probably omitted from Emacs originally because, + since `get' did not allow a DEFAULT, it was very difficult to + distinguish between a missing property and a property whose value + was `nil'; thus, setting a property to `nil' was close enough to + `remprop' for most purposes.) + + - Function: getf PLACE PROPERTY &optional DEFAULT + This function scans the list PLACE as if it were a property list, + i.e., a list of alternating property names and values. If an + even-numbered element of PLACE is found which is `eq' to PROPERTY, + the following odd-numbered element is returned. Otherwise, + DEFAULT is returned (or `nil' if no default is given). + + In particular, + + (get sym prop) == (getf (symbol-plist sym) prop) + + It is legal to use `getf' as a `setf' place, in which case its + PLACE argument must itself be a legal `setf' place. The DEFAULT + argument, if any, is ignored in this context. The effect is to + change (via `setcar') the value cell in the list that corresponds + to PROPERTY, or to cons a new property-value pair onto the list if + the property is not yet present. + + (put sym prop val) == (setf (getf (symbol-plist sym) prop) val) + + The `get' and `get*' functions are also `setf'-able. The fact + that `default' is ignored can sometimes be useful: + + (incf (get* 'foo 'usage-count 0)) + + Here, symbol `foo''s `usage-count' property is incremented if it + exists, or set to 1 (an incremented 0) otherwise. + + When not used as a `setf' form, `getf' is just a regular function + and its PLACE argument can actually be any Lisp expression. + + - Special Form: remf PLACE PROPERTY + This macro removes the property-value pair for PROPERTY from the + property list stored at PLACE, which is any `setf'-able place + expression. It returns true if the property was found. Note that + if PROPERTY happens to be first on the list, this will effectively + do a `(setf PLACE (cddr PLACE))', whereas if it occurs later, this + simply uses `setcdr' to splice out the property and value cells. + + +File: cl.info, Node: Creating Symbols, Prev: Property Lists, Up: Symbols + +Creating Symbols +================ + +These functions create unique symbols, typically for use as temporary +variables. + + - Function: gensym &optional X + This function creates a new, uninterned symbol (using + `make-symbol') with a unique name. (The name of an uninterned + symbol is relevant only if the symbol is printed.) By default, + the name is generated from an increasing sequence of numbers, + `G1000', `G1001', `G1002', etc. If the optional argument X is a + string, that string is used as a prefix instead of `G'. + Uninterned symbols are used in macro expansions for temporary + variables, to ensure that their names will not conflict with + "real" variables in the user's code. + + - Variable: *gensym-counter* + This variable holds the counter used to generate `gensym' names. + It is incremented after each use by `gensym'. In Common Lisp this + is initialized with 0, but this package initializes it with a + random (time-dependent) value to avoid trouble when two files that + each used `gensym' in their compilation are loaded together. + + *XEmacs note:* As of XEmacs 21.0, an uninterned symbol remains + uninterned even after being dumped to bytecode. Older versions of + Emacs didn't distinguish the printed representation of interned + and uninterned symbols, so their names had to be treated more + carefully. + + - Function: gentemp &optional X + This function is like `gensym', except that it produces a new + *interned* symbol. If the symbol that is generated already + exists, the function keeps incrementing the counter and trying + again until a new symbol is generated. + + The Quiroz `cl.el' package also defined a `defkeyword' form for +creating self-quoting keyword symbols. This package automatically +creates all keywords that are called for by `&key' argument specifiers, +and discourages the use of keywords as data unrelated to keyword +arguments, so the `defkeyword' form has been discontinued. + + +File: cl.info, Node: Numbers, Next: Sequences, Prev: Symbols, Up: Top + +Numbers +******* + +This section defines a few simple Common Lisp operations on numbers +which were left out of Emacs Lisp. + +* Menu: + +* Predicates on Numbers:: `plusp', `oddp', `floatp-safe', etc. +* Numerical Functions:: `abs', `expt', `floor*', etc. +* Random Numbers:: `random*', `make-random-state' +* Implementation Parameters:: `most-positive-fixnum', `most-positive-float' + + +File: cl.info, Node: Predicates on Numbers, Next: Numerical Functions, Prev: Numbers, Up: Numbers + +Predicates on Numbers +===================== + +These functions return `t' if the specified condition is true of the +numerical argument, or `nil' otherwise. + + - Function: plusp NUMBER + This predicate tests whether NUMBER is positive. It is an error + if the argument is not a number. + + - Function: minusp NUMBER + This predicate tests whether NUMBER is negative. It is an error + if the argument is not a number. + + - Function: oddp INTEGER + This predicate tests whether INTEGER is odd. It is an error if + the argument is not an integer. + + - Function: evenp INTEGER + This predicate tests whether INTEGER is even. It is an error if + the argument is not an integer. + + - Function: floatp-safe OBJECT + This predicate tests whether OBJECT is a floating-point number. + On systems that support floating-point, this is equivalent to + `floatp'. On other systems, this always returns `nil'. + + +File: cl.info, Node: Numerical Functions, Next: Random Numbers, Prev: Predicates on Numbers, Up: Numbers + +Numerical Functions +=================== + +These functions perform various arithmetic operations on numbers. + + - Function: abs NUMBER + This function returns the absolute value of NUMBER. (Newer + versions of Emacs provide this as a built-in function; this package + defines `abs' only for Emacs 18 versions which don't provide it as + a primitive.) + + - Function: expt BASE POWER + This function returns BASE raised to the power of NUMBER. (Newer + versions of Emacs provide this as a built-in function; this + package defines `expt' only for Emacs 18 versions which don't + provide it as a primitive.) + + - Function: gcd &rest INTEGERS + This function returns the Greatest Common Divisor of the arguments. + For one argument, it returns the absolute value of that argument. + For zero arguments, it returns zero. + + - Function: lcm &rest INTEGERS + This function returns the Least Common Multiple of the arguments. + For one argument, it returns the absolute value of that argument. + For zero arguments, it returns one. + + - Function: isqrt INTEGER + This function computes the "integer square root" of its integer + argument, i.e., the greatest integer less than or equal to the true + square root of the argument. + + - Function: floor* NUMBER &optional DIVISOR + This function implements the Common Lisp `floor' function. It is + called `floor*' to avoid name conflicts with the simpler `floor' + function built-in to Emacs 19. + + With one argument, `floor*' returns a list of two numbers: The + argument rounded down (toward minus infinity) to an integer, and + the "remainder" which would have to be added back to the first + return value to yield the argument again. If the argument is an + integer X, the result is always the list `(X 0)'. If the argument + is an Emacs 19 floating-point number, the first result is a Lisp + integer and the second is a Lisp float between 0 (inclusive) and 1 + (exclusive). + + With two arguments, `floor*' divides NUMBER by DIVISOR, and + returns the floor of the quotient and the corresponding remainder + as a list of two numbers. If `(floor* X Y)' returns `(Q R)', then + `Q*Y + R = X', with R between 0 (inclusive) and R (exclusive). + Also, note that `(floor* X)' is exactly equivalent to `(floor* X + 1)'. + + This function is entirely compatible with Common Lisp's `floor' + function, except that it returns the two results in a list since + Emacs Lisp does not support multiple-valued functions. + + - Function: ceiling* NUMBER &optional DIVISOR + This function implements the Common Lisp `ceiling' function, which + is analogous to `floor' except that it rounds the argument or + quotient of the arguments up toward plus infinity. The remainder + will be between 0 and minus R. + + - Function: truncate* NUMBER &optional DIVISOR + This function implements the Common Lisp `truncate' function, + which is analogous to `floor' except that it rounds the argument + or quotient of the arguments toward zero. Thus it is equivalent + to `floor*' if the argument or quotient is positive, or to + `ceiling*' otherwise. The remainder has the same sign as NUMBER. + + - Function: round* NUMBER &optional DIVISOR + This function implements the Common Lisp `round' function, which + is analogous to `floor' except that it rounds the argument or + quotient of the arguments to the nearest integer. In the case of + a tie (the argument or quotient is exactly halfway between two + integers), it rounds to the even integer. + + - Function: mod* NUMBER DIVISOR + This function returns the same value as the second return value of + `floor'. + + - Function: rem* NUMBER DIVISOR + This function returns the same value as the second return value of + `truncate'. + + These definitions are compatible with those in the Quiroz `cl.el' +package, except that this package appends `*' to certain function names +to avoid conflicts with existing Emacs 19 functions, and that the +mechanism for returning multiple values is different. + + +File: cl.info, Node: Random Numbers, Next: Implementation Parameters, Prev: Numerical Functions, Up: Numbers + +Random Numbers +============== + +This package also provides an implementation of the Common Lisp random +number generator. It uses its own additive-congruential algorithm, +which is much more likely to give statistically clean random numbers +than the simple generators supplied by many operating systems. + + - Function: random* NUMBER &optional STATE + This function returns a random nonnegative number less than + NUMBER, and of the same type (either integer or floating-point). + The STATE argument should be a `random-state' object which holds + the state of the random number generator. The function modifies + this state object as a side effect. If STATE is omitted, it + defaults to the variable `*random-state*', which contains a + pre-initialized `random-state' object. + + - Variable: *random-state* + This variable contains the system "default" `random-state' object, + used for calls to `random*' that do not specify an alternative + state object. Since any number of programs in the Emacs process + may be accessing `*random-state*' in interleaved fashion, the + sequence generated from this variable will be irreproducible for + all intents and purposes. + + - Function: make-random-state &optional STATE + This function creates or copies a `random-state' object. If STATE + is omitted or `nil', it returns a new copy of `*random-state*'. + This is a copy in the sense that future sequences of calls to + `(random* N)' and `(random* N S)' (where S is the new random-state + object) will return identical sequences of random numbers. + + If STATE is a `random-state' object, this function returns a copy + of that object. If STATE is `t', this function returns a new + `random-state' object seeded from the date and time. As an + extension to Common Lisp, STATE may also be an integer in which + case the new object is seeded from that integer; each different + integer seed will result in a completely different sequence of + random numbers. + + It is legal to print a `random-state' object to a buffer or file + and later read it back with `read'. If a program wishes to use a + sequence of pseudo-random numbers which can be reproduced later + for debugging, it can call `(make-random-state t)' to get a new + sequence, then print this sequence to a file. When the program is + later rerun, it can read the original run's random-state from the + file. + + - Function: random-state-p OBJECT + This predicate returns `t' if OBJECT is a `random-state' object, + or `nil' otherwise. + diff --git a/info/cl.info-4 b/info/cl.info-4 new file mode 100644 index 0000000..34e70ca --- /dev/null +++ b/info/cl.info-4 @@ -0,0 +1,852 @@ +This is Info file ../info/cl.info, produced by Makeinfo version 1.68 +from the input file cl.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Common Lisp: (cl). GNU Emacs Common Lisp emulation package. +END-INFO-DIR-ENTRY + + This file documents the GNU Emacs Common Lisp emulation package. + + Copyright (C) 1993 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. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the author instead of in +the original English. + + +File: cl.info, Node: Implementation Parameters, Prev: Random Numbers, Up: Numbers + +Implementation Parameters +========================= + +This package defines several useful constants having to with numbers. + + - Variable: most-positive-fixnum + This constant equals the largest value a Lisp integer can hold. + It is typically `2^23-1' or `2^25-1'. + + - Variable: most-negative-fixnum + This constant equals the smallest (most negative) value a Lisp + integer can hold. + + The following parameters have to do with floating-point numbers. +This package determines their values by exercising the computer's +floating-point arithmetic in various ways. Because this operation +might be slow, the code for initializing them is kept in a separate +function that must be called before the parameters can be used. + + - Function: cl-float-limits + This function makes sure that the Common Lisp floating-point + parameters like `most-positive-float' have been initialized. + Until it is called, these parameters will be `nil'. If this + version of Emacs does not support floats (e.g., most versions of + Emacs 18), the parameters will remain `nil'. If the parameters + have already been initialized, the function returns immediately. + + The algorithm makes assumptions that will be valid for most modern + machines, but will fail if the machine's arithmetic is extremely + unusual, e.g., decimal. + + Since true Common Lisp supports up to four different floating-point +precisions, it has families of constants like +`most-positive-single-float', `most-positive-double-float', +`most-positive-long-float', and so on. Emacs has only one +floating-point precision, so this package omits the precision word from +the constants' names. + + - Variable: most-positive-float + This constant equals the largest value a Lisp float can hold. For + those systems whose arithmetic supports infinities, this is the + largest *finite* value. For IEEE machines, the value is + approximately `1.79e+308'. + + - Variable: most-negative-float + This constant equals the most-negative value a Lisp float can hold. + (It is assumed to be equal to `(- most-positive-float)'.) + + - Variable: least-positive-float + This constant equals the smallest Lisp float value greater than + zero. For IEEE machines, it is about `4.94e-324' if denormals are + supported or `2.22e-308' if not. + + - Variable: least-positive-normalized-float + This constant equals the smallest *normalized* Lisp float greater + than zero, i.e., the smallest value for which IEEE denormalization + will not result in a loss of precision. For IEEE machines, this + value is about `2.22e-308'. For machines that do not support the + concept of denormalization and gradual underflow, this constant + will always equal `least-positive-float'. + + - Variable: least-negative-float + This constant is the negative counterpart of + `least-positive-float'. + + - Variable: least-negative-normalized-float + This constant is the negative counterpart of + `least-positive-normalized-float'. + + - Variable: float-epsilon + This constant is the smallest positive Lisp float that can be added + to 1.0 to produce a distinct value. Adding a smaller number to 1.0 + will yield 1.0 again due to roundoff. For IEEE machines, epsilon + is about `2.22e-16'. + + - Variable: float-negative-epsilon + This is the smallest positive value that can be subtracted from + 1.0 to produce a distinct value. For IEEE machines, it is about + `1.11e-16'. + + +File: cl.info, Node: Sequences, Next: Lists, Prev: Numbers, Up: Top + +Sequences +********* + +Common Lisp defines a number of functions that operate on "sequences", +which are either lists, strings, or vectors. Emacs Lisp includes a few +of these, notably `elt' and `length'; this package defines most of the +rest. + +* Menu: + +* Sequence Basics:: Arguments shared by all sequence functions +* Mapping over Sequences:: `mapcar*', `mapcan', `map', `every', etc. +* Sequence Functions:: `subseq', `remove*', `substitute', etc. +* Searching Sequences:: `find', `position', `count', `search', etc. +* Sorting Sequences:: `sort*', `stable-sort', `merge' + + +File: cl.info, Node: Sequence Basics, Next: Mapping over Sequences, Prev: Sequences, Up: Sequences + +Sequence Basics +=============== + +Many of the sequence functions take keyword arguments; *note Argument +Lists::.. All keyword arguments are optional and, if specified, may +appear in any order. + + The `:key' argument should be passed either `nil', or a function of +one argument. This key function is used as a filter through which the +elements of the sequence are seen; for example, `(find x y :key 'car)' +is similar to `(assoc* x y)': It searches for an element of the list +whose `car' equals `x', rather than for an element which equals `x' +itself. If `:key' is omitted or `nil', the filter is effectively the +identity function. + + The `:test' and `:test-not' arguments should be either `nil', or +functions of two arguments. The test function is used to compare two +sequence elements, or to compare a search value with sequence elements. +(The two values are passed to the test function in the same order as +the original sequence function arguments from which they are derived, +or, if they both come from the same sequence, in the same order as they +appear in that sequence.) The `:test' argument specifies a function +which must return true (non-`nil') to indicate a match; instead, you +may use `:test-not' to give a function which returns *false* to +indicate a match. The default test function is `:test 'eql'. + + Many functions which take ITEM and `:test' or `:test-not' arguments +also come in `-if' and `-if-not' varieties, where a PREDICATE function +is passed instead of ITEM, and sequence elements match if the predicate +returns true on them (or false in the case of `-if-not'). For example: + + (remove* 0 seq :test '=) == (remove-if 'zerop seq) + +to remove all zeros from sequence `seq'. + + Some operations can work on a subsequence of the argument sequence; +these function take `:start' and `:end' arguments which default to zero +and the length of the sequence, respectively. Only elements between +START (inclusive) and END (exclusive) are affected by the operation. +The END argument may be passed `nil' to signify the length of the +sequence; otherwise, both START and END must be integers, with `0 <= +START <= END <= (length SEQ)'. If the function takes two sequence +arguments, the limits are defined by keywords `:start1' and `:end1' for +the first, and `:start2' and `:end2' for the second. + + A few functions accept a `:from-end' argument, which, if non-`nil', +causes the operation to go from right-to-left through the sequence +instead of left-to-right, and a `:count' argument, which specifies an +integer maximum number of elements to be removed or otherwise processed. + + The sequence functions make no guarantees about the order in which +the `:test', `:test-not', and `:key' functions are called on various +elements. Therefore, it is a bad idea to depend on side effects of +these functions. For example, `:from-end' may cause the sequence to be +scanned actually in reverse, or it may be scanned forwards but +computing a result "as if" it were scanned backwards. (Some functions, +like `mapcar*' and `every', *do* specify exactly the order in which the +function is called so side effects are perfectly acceptable in those +cases.) + + Strings in GNU Emacs 19 may contain "text properties" as well as +character data. Except as noted, it is undefined whether or not text +properties are preserved by sequence functions. For example, `(remove* +?A STR)' may or may not preserve the properties of the characters +copied from STR into the result. + + +File: cl.info, Node: Mapping over Sequences, Next: Sequence Functions, Prev: Sequence Basics, Up: Sequences + +Mapping over Sequences +====================== + +These functions "map" the function you specify over the elements of +lists or arrays. They are all variations on the theme of the built-in +function `mapcar'. + + - Function: mapcar* FUNCTION SEQ &rest MORE-SEQS + This function calls FUNCTION on successive parallel sets of + elements from its argument sequences. Given a single SEQ argument + it is equivalent to `mapcar'; given N sequences, it calls the + function with the first elements of each of the sequences as the N + arguments to yield the first element of the result list, then with + the second elements, and so on. The mapping stops as soon as the + shortest sequence runs out. The argument sequences may be any + mixture of lists, strings, and vectors; the return sequence is + always a list. + + Common Lisp's `mapcar' accepts multiple arguments but works only + on lists; Emacs Lisp's `mapcar' accepts a single sequence + argument. This package's `mapcar*' works as a compatible superset + of both. + + - Function: map RESULT-TYPE FUNCTION SEQ &rest MORE-SEQS + This function maps FUNCTION over the argument sequences, just like + `mapcar*', but it returns a sequence of type RESULT-TYPE rather + than a list. RESULT-TYPE must be one of the following symbols: + `vector', `string', `list' (in which case the effect is the same + as for `mapcar*'), or `nil' (in which case the results are thrown + away and `map' returns `nil'). + + - Function: maplist FUNCTION LIST &rest MORE-LISTS + This function calls FUNCTION on each of its argument lists, then + on the `cdr's of those lists, and so on, until the shortest list + runs out. The results are returned in the form of a list. Thus, + `maplist' is like `mapcar*' except that it passes in the list + pointers themselves rather than the `car's of the advancing + pointers. + + - Function: mapc FUNCTION SEQ &rest MORE-SEQS + This function is like `mapcar*', except that the values returned + by FUNCTION are ignored and thrown away rather than being + collected into a list. The return value of `mapc' is SEQ, the + first sequence. + + - Function: mapl FUNCTION LIST &rest MORE-LISTS + This function is like `maplist', except that it throws away the + values returned by FUNCTION. + + - Function: mapcan FUNCTION SEQ &rest MORE-SEQS + This function is like `mapcar*', except that it concatenates the + return values (which must be lists) using `nconc', rather than + simply collecting them into a list. + + - Function: mapcon FUNCTION LIST &rest MORE-LISTS + This function is like `maplist', except that it concatenates the + return values using `nconc'. + + - Function: some PREDICATE SEQ &rest MORE-SEQS + This function calls PREDICATE on each element of SEQ in turn; if + PREDICATE returns a non-`nil' value, `some' returns that value, + otherwise it returns `nil'. Given several sequence arguments, it + steps through the sequences in parallel until the shortest one + runs out, just as in `mapcar*'. You can rely on the left-to-right + order in which the elements are visited, and on the fact that + mapping stops immediately as soon as PREDICATE returns non-`nil'. + + - Function: every PREDICATE SEQ &rest MORE-SEQS + This function calls PREDICATE on each element of the sequence(s) + in turn; it returns `nil' as soon as PREDICATE returns `nil' for + any element, or `t' if the predicate was true for all elements. + + - Function: notany PREDICATE SEQ &rest MORE-SEQS + This function calls PREDICATE on each element of the sequence(s) + in turn; it returns `nil' as soon as PREDICATE returns a non-`nil' + value for any element, or `t' if the predicate was `nil' for all + elements. + + - Function: notevery PREDICATE SEQ &rest MORE-SEQS + This function calls PREDICATE on each element of the sequence(s) + in turn; it returns a non-`nil' value as soon as PREDICATE returns + `nil' for any element, or `t' if the predicate was true for all + elements. + + - Function: reduce FUNCTION SEQ &key :from-end :start :end + :initial-value :key + This function combines the elements of SEQ using an associative + binary operation. Suppose FUNCTION is `*' and SEQ is the list `(2 + 3 4 5)'. The first two elements of the list are combined with `(* + 2 3) = 6'; this is combined with the next element, `(* 6 4) = 24', + and that is combined with the final element: `(* 24 5) = 120'. + Note that the `*' function happens to be self-reducing, so that + `(* 2 3 4 5)' has the same effect as an explicit call to `reduce'. + + If `:from-end' is true, the reduction is right-associative instead + of left-associative: + + (reduce '- '(1 2 3 4)) + == (- (- (- 1 2) 3) 4) => -8 + (reduce '- '(1 2 3 4) :from-end t) + == (- 1 (- 2 (- 3 4))) => -2 + + If `:key' is specified, it is a function of one argument which is + called on each of the sequence elements in turn. + + If `:initial-value' is specified, it is effectively added to the + front (or rear in the case of `:from-end') of the sequence. The + `:key' function is *not* applied to the initial value. + + If the sequence, including the initial value, has exactly one + element then that element is returned without ever calling + FUNCTION. If the sequence is empty (and there is no initial + value), then FUNCTION is called with no arguments to obtain the + return value. + + All of these mapping operations can be expressed conveniently in +terms of the `loop' macro. In compiled code, `loop' will be faster +since it generates the loop as in-line code with no function calls. + + +File: cl.info, Node: Sequence Functions, Next: Searching Sequences, Prev: Mapping over Sequences, Up: Sequences + +Sequence Functions +================== + +This section describes a number of Common Lisp functions for operating +on sequences. + + - Function: subseq SEQUENCE START &optional END + This function returns a given subsequence of the argument + SEQUENCE, which may be a list, string, or vector. The indices + START and END must be in range, and START must be no greater than + END. If END is omitted, it defaults to the length of the + sequence. The return value is always a copy; it does not share + structure with SEQUENCE. + + As an extension to Common Lisp, START and/or END may be negative, + in which case they represent a distance back from the end of the + sequence. This is for compatibility with Emacs' `substring' + function. Note that `subseq' is the *only* sequence function that + allows negative START and END. + + You can use `setf' on a `subseq' form to replace a specified range + of elements with elements from another sequence. The replacement + is done as if by `replace', described below. + + - Function: concatenate RESULT-TYPE &rest SEQS + This function concatenates the argument sequences together to form + a result sequence of type RESULT-TYPE, one of the symbols + `vector', `string', or `list'. The arguments are always copied, + even in cases such as `(concatenate 'list '(1 2 3))' where the + result is identical to an argument. + + - Function: fill SEQ ITEM &key :start :end + This function fills the elements of the sequence (or the specified + part of the sequence) with the value ITEM. + + - Function: replace SEQ1 SEQ2 &key :start1 :end1 :start2 :end2 + This function copies part of SEQ2 into part of SEQ1. The sequence + SEQ1 is not stretched or resized; the amount of data copied is + simply the shorter of the source and destination (sub)sequences. + The function returns SEQ1. + + If SEQ1 and SEQ2 are `eq', then the replacement will work + correctly even if the regions indicated by the start and end + arguments overlap. However, if SEQ1 and SEQ2 are lists which + share storage but are not `eq', and the start and end arguments + specify overlapping regions, the effect is undefined. + + - Function: remove* ITEM SEQ &key :test :test-not :key :count :start + :end :from-end + This returns a copy of SEQ with all elements matching ITEM + removed. The result may share storage with or be `eq' to SEQ in + some circumstances, but the original SEQ will not be modified. + The `:test', `:test-not', and `:key' arguments define the matching + test that is used; by default, elements `eql' to ITEM are removed. + The `:count' argument specifies the maximum number of matching + elements that can be removed (only the leftmost COUNT matches are + removed). The `:start' and `:end' arguments specify a region in + SEQ in which elements will be removed; elements outside that + region are not matched or removed. The `:from-end' argument, if + true, says that elements should be deleted from the end of the + sequence rather than the beginning (this matters only if COUNT was + also specified). + + - Function: delete* ITEM SEQ &key :test :test-not :key :count :start + :end :from-end + This deletes all elements of SEQ which match ITEM. It is a + destructive operation. Since Emacs Lisp does not support + stretchable strings or vectors, this is the same as `remove*' for + those sequence types. On lists, `remove*' will copy the list if + necessary to preserve the original list, whereas `delete*' will + splice out parts of the argument list. Compare `append' and + `nconc', which are analogous non-destructive and destructive list + operations in Emacs Lisp. + + The predicate-oriented functions `remove-if', `remove-if-not', +`delete-if', and `delete-if-not' are defined similarly. + + - Function: delete ITEM LIST + This MacLisp-compatible function deletes from LIST all elements + which are `equal' to ITEM. The `delete' function is built-in to + Emacs 19; this package defines it equivalently in Emacs 18. + + - Function: remove ITEM LIST + This function removes from LIST all elements which are `equal' to + ITEM. This package defines it for symmetry with `delete', even + though `remove' is not built-in to Emacs 19. + + - Function: remq ITEM LIST + This function removes from LIST all elements which are `eq' to + ITEM. This package defines it for symmetry with `delq', even + though `remq' is not built-in to Emacs 19. + + - Function: remove-duplicates SEQ &key :test :test-not :key :start + :end :from-end + This function returns a copy of SEQ with duplicate elements + removed. Specifically, if two elements from the sequence match + according to the `:test', `:test-not', and `:key' arguments, only + the rightmost one is retained. If `:from-end' is true, the + leftmost one is retained instead. If `:start' or `:end' is + specified, only elements within that subsequence are examined or + removed. + + - Function: delete-duplicates SEQ &key :test :test-not :key :start + :end :from-end + This function deletes duplicate elements from SEQ. It is a + destructive version of `remove-duplicates'. + + - Function: substitute NEW OLD SEQ &key :test :test-not :key :count + :start :end :from-end + This function returns a copy of SEQ, with all elements matching + OLD replaced with NEW. The `:count', `:start', `:end', and + `:from-end' arguments may be used to limit the number of + substitutions made. + + - Function: nsubstitute NEW OLD SEQ &key :test :test-not :key :count + :start :end :from-end + This is a destructive version of `substitute'; it performs the + substitution using `setcar' or `aset' rather than by returning a + changed copy of the sequence. + + The `substitute-if', `substitute-if-not', `nsubstitute-if', and +`nsubstitute-if-not' functions are defined similarly. For these, a +PREDICATE is given in place of the OLD argument. + + +File: cl.info, Node: Searching Sequences, Next: Sorting Sequences, Prev: Sequence Functions, Up: Sequences + +Searching Sequences +=================== + +These functions search for elements or subsequences in a sequence. +(See also `member*' and `assoc*'; *note Lists::..) + + - Function: find ITEM SEQ &key :test :test-not :key :start :end + :from-end + This function searches SEQ for an element matching ITEM. If it + finds a match, it returns the matching element. Otherwise, it + returns `nil'. It returns the leftmost match, unless `:from-end' + is true, in which case it returns the rightmost match. The + `:start' and `:end' arguments may be used to limit the range of + elements that are searched. + + - Function: position ITEM SEQ &key :test :test-not :key :start :end + :from-end + This function is like `find', except that it returns the integer + position in the sequence of the matching item rather than the item + itself. The position is relative to the start of the sequence as + a whole, even if `:start' is non-zero. The function returns `nil' + if no matching element was found. + + - Function: count ITEM SEQ &key :test :test-not :key :start :end + This function returns the number of elements of SEQ which match + ITEM. The result is always a nonnegative integer. + + The `find-if', `find-if-not', `position-if', `position-if-not', +`count-if', and `count-if-not' functions are defined similarly. + + - Function: mismatch SEQ1 SEQ2 &key :test :test-not :key :start1 :end1 + :start2 :end2 :from-end + This function compares the specified parts of SEQ1 and SEQ2. If + they are the same length and the corresponding elements match + (according to `:test', `:test-not', and `:key'), the function + returns `nil'. If there is a mismatch, the function returns the + index (relative to SEQ1) of the first mismatching element. This + will be the leftmost pair of elements which do not match, or the + position at which the shorter of the two otherwise-matching + sequences runs out. + + If `:from-end' is true, then the elements are compared from right + to left starting at `(1- END1)' and `(1- END2)'. If the sequences + differ, then one plus the index of the rightmost difference + (relative to SEQ1) is returned. + + An interesting example is `(mismatch str1 str2 :key 'upcase)', + which compares two strings case-insensitively. + + - Function: search SEQ1 SEQ2 &key :test :test-not :key :from-end + :start1 :end1 :start2 :end2 + This function searches SEQ2 for a subsequence that matches SEQ1 + (or part of it specified by `:start1' and `:end1'.) Only matches + which fall entirely within the region defined by `:start2' and + `:end2' will be considered. The return value is the index of the + leftmost element of the leftmost match, relative to the start of + SEQ2, or `nil' if no matches were found. If `:from-end' is true, + the function finds the *rightmost* matching subsequence. + + +File: cl.info, Node: Sorting Sequences, Prev: Searching Sequences, Up: Sequences + +Sorting Sequences +================= + + - Function: sort* SEQ PREDICATE &key :key + This function sorts SEQ into increasing order as determined by + using PREDICATE to compare pairs of elements. PREDICATE should + return true (non-`nil') if and only if its first argument is less + than (not equal to) its second argument. For example, `<' and + `string-lessp' are suitable predicate functions for sorting + numbers and strings, respectively; `>' would sort numbers into + decreasing rather than increasing order. + + This function differs from Emacs' built-in `sort' in that it can + operate on any type of sequence, not just lists. Also, it accepts + a `:key' argument which is used to preprocess data fed to the + PREDICATE function. For example, + + (setq data (sort data 'string-lessp :key 'downcase)) + + sorts DATA, a sequence of strings, into increasing alphabetical + order without regard to case. A `:key' function of `car' would be + useful for sorting association lists. + + The `sort*' function is destructive; it sorts lists by actually + rearranging the `cdr' pointers in suitable fashion. + + - Function: stable-sort SEQ PREDICATE &key :key + This function sorts SEQ "stably", meaning two elements which are + equal in terms of PREDICATE are guaranteed not to be rearranged + out of their original order by the sort. + + In practice, `sort*' and `stable-sort' are equivalent in Emacs + Lisp because the underlying `sort' function is stable by default. + However, this package reserves the right to use non-stable methods + for `sort*' in the future. + + - Function: merge TYPE SEQ1 SEQ2 PREDICATE &key :key + This function merges two sequences SEQ1 and SEQ2 by interleaving + their elements. The result sequence, of type TYPE (in the sense + of `concatenate'), has length equal to the sum of the lengths of + the two input sequences. The sequences may be modified + destructively. Order of elements within SEQ1 and SEQ2 is + preserved in the interleaving; elements of the two sequences are + compared by PREDICATE (in the sense of `sort') and the lesser + element goes first in the result. When elements are equal, those + from SEQ1 precede those from SEQ2 in the result. Thus, if SEQ1 + and SEQ2 are both sorted according to PREDICATE, then the result + will be a merged sequence which is (stably) sorted according to + PREDICATE. + + +File: cl.info, Node: Lists, Next: Hash Tables, Prev: Sequences, Up: Top + +Lists +***** + +The functions described here operate on lists. + +* Menu: + +* List Functions:: `caddr', `first', `last', `list*', etc. +* Substitution of Expressions:: `subst', `sublis', etc. +* Lists as Sets:: `member*', `adjoin', `union', etc. +* Association Lists:: `assoc*', `rassoc*', `acons', `pairlis' + + +File: cl.info, Node: List Functions, Next: Substitution of Expressions, Prev: Lists, Up: Lists + +List Functions +============== + +This section describes a number of simple operations on lists, i.e., +chains of cons cells. + + - Function: caddr X + This function is equivalent to `(car (cdr (cdr X)))'. Likewise, + this package defines all 28 `cXXXr' functions where XXX is up to + four `a's and/or `d's. All of these functions are `setf'-able, + and calls to them are expanded inline by the byte-compiler for + maximum efficiency. + + - Function: first X + This function is a synonym for `(car X)'. Likewise, the functions + `second', `third', ..., through `tenth' return the given element + of the list X. + + - Function: rest X + This function is a synonym for `(cdr X)'. + + - Function: endp X + Common Lisp defines this function to act like `null', but + signalling an error if `x' is neither a `nil' nor a cons cell. + This package simply defines `endp' as a synonym for `null'. + + - Function: list-length X + This function returns the length of list X, exactly like `(length + X)', except that if X is a circular list (where the cdr-chain + forms a loop rather than terminating with `nil'), this function + returns `nil'. (The regular `length' function would get stuck if + given a circular list.) + + - Function: last X &optional N + This function returns the last cons, or the Nth-to-last cons, of + the list X. If N is omitted it defaults to 1. The "last cons" + means the first cons cell of the list whose `cdr' is not another + cons cell. (For normal lists, the `cdr' of the last cons will be + `nil'.) This function returns `nil' if X is `nil' or shorter than + N. Note that the last *element* of the list is `(car (last X))'. + + - Function: butlast X &optional N + This function returns the list X with the last element, or the + last N elements, removed. If N is greater than zero it makes a + copy of the list so as not to damage the original list. In + general, `(append (butlast X N) (last X N))' will return a list + equal to X. + + - Function: nbutlast X &optional N + This is a version of `butlast' that works by destructively + modifying the `cdr' of the appropriate element, rather than making + a copy of the list. + + - Function: list* ARG &rest OTHERS + This function constructs a list of its arguments. The final + argument becomes the `cdr' of the last cell constructed. Thus, + `(list* A B C)' is equivalent to `(cons A (cons B C))', and + `(list* A B nil)' is equivalent to `(list A B)'. + + (Note that this function really is called `list*' in Common Lisp; + it is not a name invented for this package like `member*' or + `defun*'.) + + - Function: ldiff LIST SUBLIST + If SUBLIST is a sublist of LIST, i.e., is `eq' to one of the cons + cells of LIST, then this function returns a copy of the part of + LIST up to but not including SUBLIST. For example, `(ldiff x + (cddr x))' returns the first two elements of the list `x'. The + result is a copy; the original LIST is not modified. If SUBLIST + is not a sublist of LIST, a copy of the entire LIST is returned. + + - Function: copy-list LIST + This function returns a copy of the list LIST. It copies dotted + lists like `(1 2 . 3)' correctly. + + - Function: copy-tree X &optional VECP + This function returns a copy of the tree of cons cells X. Unlike + `copy-sequence' (and its alias `copy-list'), which copies only + along the `cdr' direction, this function copies (recursively) + along both the `car' and the `cdr' directions. If X is not a cons + cell, the function simply returns X unchanged. If the optional + VECP argument is true, this function copies vectors (recursively) + as well as cons cells. + + - Function: tree-equal X Y &key :test :test-not :key + This function compares two trees of cons cells. If X and Y are + both cons cells, their `car's and `cdr's are compared recursively. + If neither X nor Y is a cons cell, they are compared by `eql', or + according to the specified test. The `:key' function, if + specified, is applied to the elements of both trees. *Note + Sequences::. + + +File: cl.info, Node: Substitution of Expressions, Next: Lists as Sets, Prev: List Functions, Up: Lists + +Substitution of Expressions +=========================== + +These functions substitute elements throughout a tree of cons cells. +(*Note Sequence Functions::, for the `substitute' function, which works +on just the top-level elements of a list.) + + - Function: subst NEW OLD TREE &key :test :test-not :key + This function substitutes occurrences of OLD with NEW in TREE, a + tree of cons cells. It returns a substituted tree, which will be + a copy except that it may share storage with the argument TREE in + parts where no substitutions occurred. The original TREE is not + modified. This function recurses on, and compares against OLD, + both `car's and `cdr's of the component cons cells. If OLD is + itself a cons cell, then matching cells in the tree are + substituted as usual without recursively substituting in that + cell. Comparisons with OLD are done according to the specified + test (`eql' by default). The `:key' function is applied to the + elements of the tree but not to OLD. + + - Function: nsubst NEW OLD TREE &key :test :test-not :key + This function is like `subst', except that it works by destructive + modification (by `setcar' or `setcdr') rather than copying. + + The `subst-if', `subst-if-not', `nsubst-if', and `nsubst-if-not' +functions are defined similarly. + + - Function: sublis ALIST TREE &key :test :test-not :key + This function is like `subst', except that it takes an association + list ALIST of OLD-NEW pairs. Each element of the tree (after + applying the `:key' function, if any), is compared with the `car's + of ALIST; if it matches, it is replaced by the corresponding `cdr'. + + - Function: nsublis ALIST TREE &key :test :test-not :key + This is a destructive version of `sublis'. + + +File: cl.info, Node: Lists as Sets, Next: Association Lists, Prev: Substitution of Expressions, Up: Lists + +Lists as Sets +============= + +These functions perform operations on lists which represent sets of +elements. + + - Function: member ITEM LIST + This MacLisp-compatible function searches LIST for an element + which is `equal' to ITEM. The `member' function is built-in to + Emacs 19; this package defines it equivalently in Emacs 18. See + the following function for a Common-Lisp compatible version. + + - Function: member* ITEM LIST &key :test :test-not :key + This function searches LIST for an element matching ITEM. If a + match is found, it returns the cons cell whose `car' was the + matching element. Otherwise, it returns `nil'. Elements are + compared by `eql' by default; you can use the `:test', + `:test-not', and `:key' arguments to modify this behavior. *Note + Sequences::. + + Note that this function's name is suffixed by `*' to avoid the + incompatible `member' function defined in Emacs 19. (That + function uses `equal' for comparisons; it is equivalent to + `(member* ITEM LIST :test 'equal)'.) + + The `member-if' and `member-if-not' functions analogously search for +elements which satisfy a given predicate. + + - Function: tailp SUBLIST LIST + This function returns `t' if SUBLIST is a sublist of LIST, i.e., + if SUBLIST is `eql' to LIST or to any of its `cdr's. + + - Function: adjoin ITEM LIST &key :test :test-not :key + This function conses ITEM onto the front of LIST, like `(cons ITEM + LIST)', but only if ITEM is not already present on the list (as + determined by `member*'). If a `:key' argument is specified, it + is applied to ITEM as well as to the elements of LIST during the + search, on the reasoning that ITEM is "about" to become part of + the list. + + - Function: union LIST1 LIST2 &key :test :test-not :key + This function combines two lists which represent sets of items, + returning a list that represents the union of those two sets. The + result list will contain all items which appear in LIST1 or LIST2, + and no others. If an item appears in both LIST1 and LIST2 it will + be copied only once. If an item is duplicated in LIST1 or LIST2, + it is undefined whether or not that duplication will survive in the + result list. The order of elements in the result list is also + undefined. + + - Function: nunion LIST1 LIST2 &key :test :test-not :key + This is a destructive version of `union'; rather than copying, it + tries to reuse the storage of the argument lists if possible. + + - Function: intersection LIST1 LIST2 &key :test :test-not :key + This function computes the intersection of the sets represented by + LIST1 and LIST2. It returns the list of items which appear in + both LIST1 and LIST2. + + - Function: nintersection LIST1 LIST2 &key :test :test-not :key + This is a destructive version of `intersection'. It tries to + reuse storage of LIST1 rather than copying. It does *not* reuse + the storage of LIST2. + + - Function: set-difference LIST1 LIST2 &key :test :test-not :key + This function computes the "set difference" of LIST1 and LIST2, + i.e., the set of elements that appear in LIST1 but *not* in LIST2. + + - Function: nset-difference LIST1 LIST2 &key :test :test-not :key + This is a destructive `set-difference', which will try to reuse + LIST1 if possible. + + - Function: set-exclusive-or LIST1 LIST2 &key :test :test-not :key + This function computes the "set exclusive or" of LIST1 and LIST2, + i.e., the set of elements that appear in exactly one of LIST1 and + LIST2. + + - Function: nset-exclusive-or LIST1 LIST2 &key :test :test-not :key + This is a destructive `set-exclusive-or', which will try to reuse + LIST1 and LIST2 if possible. + + - Function: subsetp LIST1 LIST2 &key :test :test-not :key + This function checks whether LIST1 represents a subset of LIST2, + i.e., whether every element of LIST1 also appears in LIST2. + + +File: cl.info, Node: Association Lists, Prev: Lists as Sets, Up: Lists + +Association Lists +================= + +An "association list" is a list representing a mapping from one set of +values to another; any list whose elements are cons cells is an +association list. + + - Function: assoc* ITEM A-LIST &key :test :test-not :key + This function searches the association list A-LIST for an element + whose `car' matches (in the sense of `:test', `:test-not', and + `:key', or by comparison with `eql') a given ITEM. It returns the + matching element, if any, otherwise `nil'. It ignores elements of + A-LIST which are not cons cells. (This corresponds to the + behavior of `assq' and `assoc' in Emacs Lisp; Common Lisp's + `assoc' ignores `nil's but considers any other non-cons elements + of A-LIST to be an error.) + + - Function: rassoc* ITEM A-LIST &key :test :test-not :key + This function searches for an element whose `cdr' matches ITEM. + If A-LIST represents a mapping, this applies the inverse of the + mapping to ITEM. + + - Function: rassoc ITEM A-LIST + This function searches like `rassoc*' with a `:test' argument of + `equal'. It is analogous to Emacs Lisp's standard `assoc' + function, which derives from the MacLisp rather than the Common + Lisp tradition. + + The `assoc-if', `assoc-if-not', `rassoc-if', and `rassoc-if-not' +functions are defined similarly. + + Two simple functions for constructing association lists are: + + - Function: acons KEY VALUE ALIST + This is equivalent to `(cons (cons KEY VALUE) ALIST)'. + + - Function: pairlis KEYS VALUES &optional ALIST + This is equivalent to `(nconc (mapcar* 'cons KEYS VALUES) ALIST)'. + + +File: cl.info, Node: Hash Tables, Next: Structures, Prev: Lists, Up: Top + +Hash Tables +*********** + +Hash tables are now implemented directly in the C code and documented in +*Note Hash Tables: (lispref)Hash Tables. + diff --git a/info/cl.info-5 b/info/cl.info-5 new file mode 100644 index 0000000..6ea0a18 --- /dev/null +++ b/info/cl.info-5 @@ -0,0 +1,915 @@ +This is Info file ../info/cl.info, produced by Makeinfo version 1.68 +from the input file cl.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Common Lisp: (cl). GNU Emacs Common Lisp emulation package. +END-INFO-DIR-ENTRY + + This file documents the GNU Emacs Common Lisp emulation package. + + Copyright (C) 1993 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. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the author instead of in +the original English. + + +File: cl.info, Node: Structures, Next: Assertions, Prev: Hash Tables, Up: Top + +Structures +********** + +The Common Lisp "structure" mechanism provides a general way to define +data types similar to C's `struct' types. A structure is a Lisp object +containing some number of "slots", each of which can hold any Lisp data +object. Functions are provided for accessing and setting the slots, +creating or copying structure objects, and recognizing objects of a +particular structure type. + + In true Common Lisp, each structure type is a new type distinct from +all existing Lisp types. Since the underlying Emacs Lisp system +provides no way to create new distinct types, this package implements +structures as vectors (or lists upon request) with a special "tag" +symbol to identify them. + + - Special Form: defstruct NAME SLOTS... + The `defstruct' form defines a new structure type called NAME, + with the specified SLOTS. (The SLOTS may begin with a string + which documents the structure type.) In the simplest case, NAME + and each of the SLOTS are symbols. For example, + + (defstruct person name age sex) + + defines a struct type called `person' which contains three slots. + Given a `person' object P, you can access those slots by calling + `(person-name P)', `(person-age P)', and `(person-sex P)'. You + can also change these slots by using `setf' on any of these place + forms: + + (incf (person-age birthday-boy)) + + You can create a new `person' by calling `make-person', which + takes keyword arguments `:name', `:age', and `:sex' to specify the + initial values of these slots in the new object. (Omitting any of + these arguments leaves the corresponding slot "undefined," + according to the Common Lisp standard; in Emacs Lisp, such + uninitialized slots are filled with `nil'.) + + Given a `person', `(copy-person P)' makes a new object of the same + type whose slots are `eq' to those of P. + + Given any Lisp object X, `(person-p X)' returns true if X looks + like a `person', false otherwise. (Again, in Common Lisp this + predicate would be exact; in Emacs Lisp the best it can do is + verify that X is a vector of the correct length which starts with + the correct tag symbol.) + + Accessors like `person-name' normally check their arguments + (effectively using `person-p') and signal an error if the argument + is the wrong type. This check is affected by `(optimize (safety + ...))' declarations. Safety level 1, the default, uses a somewhat + optimized check that will detect all incorrect arguments, but may + use an uninformative error message (e.g., "expected a vector" + instead of "expected a `person'"). Safety level 0 omits all + checks except as provided by the underlying `aref' call; safety + levels 2 and 3 do rigorous checking that will always print a + descriptive error message for incorrect inputs. *Note + Declarations::. + + (setq dave (make-person :name "Dave" :sex 'male)) + => [cl-struct-person "Dave" nil male] + (setq other (copy-person dave)) + => [cl-struct-person "Dave" nil male] + (eq dave other) + => nil + (eq (person-name dave) (person-name other)) + => t + (person-p dave) + => t + (person-p [1 2 3 4]) + => nil + (person-p "Bogus") + => nil + (person-p '[cl-struct-person counterfeit person object]) + => t + + In general, NAME is either a name symbol or a list of a name + symbol followed by any number of "struct options"; each SLOT is + either a slot symbol or a list of the form `(SLOT-NAME + DEFAULT-VALUE SLOT-OPTIONS...)'. The DEFAULT-VALUE is a Lisp form + which is evaluated any time an instance of the structure type is + created without specifying that slot's value. + + Common Lisp defines several slot options, but the only one + implemented in this package is `:read-only'. A non-`nil' value + for this option means the slot should not be `setf'-able; the + slot's value is determined when the object is created and does not + change afterward. + + (defstruct person + (name nil :read-only t) + age + (sex 'unknown)) + + Any slot options other than `:read-only' are ignored. + + For obscure historical reasons, structure options take a different + form than slot options. A structure option is either a keyword + symbol, or a list beginning with a keyword symbol possibly followed + by arguments. (By contrast, slot options are key-value pairs not + enclosed in lists.) + + (defstruct (person (:constructor create-person) + (:type list) + :named) + name age sex) + + The following structure options are recognized. + + `:conc-name' + The argument is a symbol whose print name is used as the + prefix for the names of slot accessor functions. The default + is the name of the struct type followed by a hyphen. The + option `(:conc-name p-)' would change this prefix to `p-'. + Specifying `nil' as an argument means no prefix, so that the + slot names themselves are used to name the accessor functions. + + `:constructor' + In the simple case, this option takes one argument which is an + alternate name to use for the constructor function. The + default is `make-NAME', e.g., `make-person'. The above + example changes this to `create-person'. Specifying `nil' as + an argument means that no standard constructor should be + generated at all. + + In the full form of this option, the constructor name is + followed by an arbitrary argument list. *Note Program + Structure::, for a description of the format of Common Lisp + argument lists. All options, such as `&rest' and `&key', are + supported. The argument names should match the slot names; + each slot is initialized from the corresponding argument. + Slots whose names do not appear in the argument list are + initialized based on the DEFAULT-VALUE in their slot + descriptor. Also, `&optional' and `&key' arguments which + don't specify defaults take their defaults from the slot + descriptor. It is legal to include arguments which don't + correspond to slot names; these are useful if they are + referred to in the defaults for optional, keyword, or `&aux' + arguments which *do* correspond to slots. + + You can specify any number of full-format `:constructor' + options on a structure. The default constructor is still + generated as well unless you disable it with a simple-format + `:constructor' option. + + (defstruct + (person + (:constructor nil) ; no default constructor + (:constructor new-person (name sex &optional (age 0))) + (:constructor new-hound (&key (name "Rover") + (dog-years 0) + &aux (age (* 7 dog-years)) + (sex 'canine)))) + name age sex) + + The first constructor here takes its arguments positionally + rather than by keyword. (In official Common Lisp + terminology, constructors that work By Order of Arguments + instead of by keyword are called "BOA constructors." No, I'm + not making this up.) For example, `(new-person "Jane" + 'female)' generates a person whose slots are `"Jane"', 0, and + `female', respectively. + + The second constructor takes two keyword arguments, `:name', + which initializes the `name' slot and defaults to `"Rover"', + and `:dog-years', which does not itself correspond to a slot + but which is used to initialize the `age' slot. The `sex' + slot is forced to the symbol `canine' with no syntax for + overriding it. + + `:copier' + The argument is an alternate name for the copier function for + this type. The default is `copy-NAME'. `nil' means not to + generate a copier function. (In this implementation, all + copier functions are simply synonyms for `copy-sequence'.) + + `:predicate' + The argument is an alternate name for the predicate which + recognizes objects of this type. The default is `NAME-p'. + `nil' means not to generate a predicate function. (If the + `:type' option is used without the `:named' option, no + predicate is ever generated.) + + In true Common Lisp, `typep' is always able to recognize a + structure object even if `:predicate' was used. In this + package, `typep' simply looks for a function called + `TYPENAME-p', so it will work for structure types only if + they used the default predicate name. + + `:include' + This option implements a very limited form of C++-style + inheritance. The argument is the name of another structure + type previously created with `defstruct'. The effect is to + cause the new structure type to inherit all of the included + structure's slots (plus, of course, any new slots described + by this struct's slot descriptors). The new structure is + considered a "specialization" of the included one. In fact, + the predicate and slot accessors for the included type will + also accept objects of the new type. + + If there are extra arguments to the `:include' option after + the included-structure name, these options are treated as + replacement slot descriptors for slots in the included + structure, possibly with modified default values. Borrowing + an example from Steele: + + (defstruct person name (age 0) sex) + => person + (defstruct (astronaut (:include person (age 45))) + helmet-size + (favorite-beverage 'tang)) + => astronaut + + (setq joe (make-person :name "Joe")) + => [cl-struct-person "Joe" 0 nil] + (setq buzz (make-astronaut :name "Buzz")) + => [cl-struct-astronaut "Buzz" 45 nil nil tang] + + (list (person-p joe) (person-p buzz)) + => (t t) + (list (astronaut-p joe) (astronaut-p buzz)) + => (nil t) + + (person-name buzz) + => "Buzz" + (astronaut-name joe) + => error: "astronaut-name accessing a non-astronaut" + + Thus, if `astronaut' is a specialization of `person', then + every `astronaut' is also a `person' (but not the other way + around). Every `astronaut' includes all the slots of a + `person', plus extra slots that are specific to astronauts. + Operations that work on people (like `person-name') work on + astronauts just like other people. + + `:print-function' + In full Common Lisp, this option allows you to specify a + function which is called to print an instance of the + structure type. The Emacs Lisp system offers no hooks into + the Lisp printer which would allow for such a feature, so + this package simply ignores `:print-function'. + + `:type' + The argument should be one of the symbols `vector' or `list'. + This tells which underlying Lisp data type should be used to + implement the new structure type. Vectors are used by + default, but `(:type list)' will cause structure objects to + be stored as lists instead. + + The vector representation for structure objects has the + advantage that all structure slots can be accessed quickly, + although creating vectors is a bit slower in Emacs Lisp. + Lists are easier to create, but take a relatively long time + accessing the later slots. + + `:named' + This option, which takes no arguments, causes a + characteristic "tag" symbol to be stored at the front of the + structure object. Using `:type' without also using `:named' + will result in a structure type stored as plain vectors or + lists with no identifying features. + + The default, if you don't specify `:type' explicitly, is to + use named vectors. Therefore, `:named' is only useful in + conjunction with `:type'. + + (defstruct (person1) name age sex) + (defstruct (person2 (:type list) :named) name age sex) + (defstruct (person3 (:type list)) name age sex) + + (setq p1 (make-person1)) + => [cl-struct-person1 nil nil nil] + (setq p2 (make-person2)) + => (person2 nil nil nil) + (setq p3 (make-person3)) + => (nil nil nil) + + (person1-p p1) + => t + (person2-p p2) + => t + (person3-p p3) + => error: function person3-p undefined + + Since unnamed structures don't have tags, `defstruct' is not + able to make a useful predicate for recognizing them. Also, + accessors like `person3-name' will be generated but they will + not be able to do any type checking. The `person3-name' + function, for example, will simply be a synonym for `car' in + this case. By contrast, `person2-name' is able to verify + that its argument is indeed a `person2' object before + proceeding. + + `:initial-offset' + The argument must be a nonnegative integer. It specifies a + number of slots to be left "empty" at the front of the + structure. If the structure is named, the tag appears at the + specified position in the list or vector; otherwise, the first + slot appears at that position. Earlier positions are filled + with `nil' by the constructors and ignored otherwise. If the + type `:include's another type, then `:initial-offset' + specifies a number of slots to be skipped between the last + slot of the included type and the first new slot. + + Except as noted, the `defstruct' facility of this package is +entirely compatible with that of Common Lisp. + + +File: cl.info, Node: Assertions, Next: Efficiency Concerns, Prev: Structures, Up: Top + +Assertions and Errors +********************* + +This section describes two macros that test "assertions", i.e., +conditions which must be true if the program is operating correctly. +Assertions never add to the behavior of a Lisp program; they simply +make "sanity checks" to make sure everything is as it should be. + + If the optimization property `speed' has been set to 3, and `safety' +is less than 3, then the byte-compiler will optimize away the following +assertions. Because assertions might be optimized away, it is a bad +idea for them to include side-effects. + + - Special Form: assert TEST-FORM [SHOW-ARGS STRING ARGS...] + This form verifies that TEST-FORM is true (i.e., evaluates to a + non-`nil' value). If so, it returns `nil'. If the test is not + satisfied, `assert' signals an error. + + A default error message will be supplied which includes TEST-FORM. + You can specify a different error message by including a STRING + argument plus optional extra arguments. Those arguments are simply + passed to `error' to signal the error. + + If the optional second argument SHOW-ARGS is `t' instead of `nil', + then the error message (with or without STRING) will also include + all non-constant arguments of the top-level FORM. For example: + + (assert (> x 10) t "x is too small: %d") + + This usage of SHOW-ARGS is an extension to Common Lisp. In true + Common Lisp, the second argument gives a list of PLACES which can + be `setf''d by the user before continuing from the error. Since + Emacs Lisp does not support continuable errors, it makes no sense + to specify PLACES. + + - Special Form: check-type FORM TYPE [STRING] + This form verifies that FORM evaluates to a value of type TYPE. + If so, it returns `nil'. If not, `check-type' signals a + `wrong-type-argument' error. The default error message lists the + erroneous value along with TYPE and FORM themselves. If STRING is + specified, it is included in the error message in place of TYPE. + For example: + + (check-type x (integer 1 *) "a positive integer") + + *Note Type Predicates::, for a description of the type specifiers + that may be used for TYPE. + + Note that in Common Lisp, the first argument to `check-type' must + be a PLACE suitable for use by `setf', because `check-type' + signals a continuable error that allows the user to modify PLACE. + + The following error-related macro is also defined: + + - Special Form: ignore-errors FORMS... + This executes FORMS exactly like a `progn', except that errors are + ignored during the FORMS. More precisely, if an error is + signalled then `ignore-errors' immediately aborts execution of the + FORMS and returns `nil'. If the FORMS complete successfully, + `ignore-errors' returns the result of the last FORM. + + +File: cl.info, Node: Efficiency Concerns, Next: Common Lisp Compatibility, Prev: Assertions, Up: Top + +Efficiency Concerns +******************* + +Macros +====== + +Many of the advanced features of this package, such as `defun*', +`loop', and `setf', are implemented as Lisp macros. In byte-compiled +code, these complex notations will be expanded into equivalent Lisp +code which is simple and efficient. For example, the forms + + (incf i n) + (push x (car p)) + +are expanded at compile-time to the Lisp forms + + (setq i (+ i n)) + (setcar p (cons x (car p))) + +which are the most efficient ways of doing these respective operations +in Lisp. Thus, there is no performance penalty for using the more +readable `incf' and `push' forms in your compiled code. + + *Interpreted* code, on the other hand, must expand these macros +every time they are executed. For this reason it is strongly +recommended that code making heavy use of macros be compiled. (The +features labelled "Special Form" instead of "Function" in this manual +are macros.) A loop using `incf' a hundred times will execute +considerably faster if compiled, and will also garbage-collect less +because the macro expansion will not have to be generated, used, and +thrown away a hundred times. + + You can find out how a macro expands by using the `cl-prettyexpand' +function. + + - Function: cl-prettyexpand FORM &optional FULL + This function takes a single Lisp form as an argument and inserts + a nicely formatted copy of it in the current buffer (which must be + in Lisp mode so that indentation works properly). It also expands + all Lisp macros which appear in the form. The easiest way to use + this function is to go to the `*scratch*' buffer and type, say, + + (cl-prettyexpand '(loop for x below 10 collect x)) + + and type `C-x C-e' immediately after the closing parenthesis; the + expansion + + (block nil + (let* ((x 0) + (G1004 nil)) + (while (< x 10) + (setq G1004 (cons x G1004)) + (setq x (+ x 1))) + (nreverse G1004))) + + will be inserted into the buffer. (The `block' macro is expanded + differently in the interpreter and compiler, so `cl-prettyexpand' + just leaves it alone. The temporary variable `G1004' was created + by `gensym'.) + + If the optional argument FULL is true, then *all* macros are + expanded, including `block', `eval-when', and compiler macros. + Expansion is done as if FORM were a top-level form in a file being + compiled. For example, + + (cl-prettyexpand '(pushnew 'x list)) + -| (setq list (adjoin 'x list)) + (cl-prettyexpand '(pushnew 'x list) t) + -| (setq list (if (memq 'x list) list (cons 'x list))) + (cl-prettyexpand '(caddr (member* 'a list)) t) + -| (car (cdr (cdr (memq 'a list)))) + + Note that `adjoin', `caddr', and `member*' all have built-in + compiler macros to optimize them in common cases. + + +Error Checking +============== + +Common Lisp compliance has in general not been sacrificed for the sake +of efficiency. A few exceptions have been made for cases where +substantial gains were possible at the expense of marginal +incompatibility. One example is the use of `memq' (which is treated +very efficiently by the byte-compiler) to scan for keyword arguments; +this can become confused in rare cases when keyword symbols are used as +both keywords and data values at once. This is extremely unlikely to +occur in practical code, and the use of `memq' allows functions with +keyword arguments to be nearly as fast as functions that use +`&optional' arguments. + + The Common Lisp standard (as embodied in Steele's book) uses the +phrase "it is an error if" to indicate a situation which is not +supposed to arise in complying programs; implementations are strongly +encouraged but not required to signal an error in these situations. +This package sometimes omits such error checking in the interest of +compactness and efficiency. For example, `do' variable specifiers are +supposed to be lists of one, two, or three forms; extra forms are +ignored by this package rather than signalling a syntax error. The +`endp' function is simply a synonym for `null' in this package. +Functions taking keyword arguments will accept an odd number of +arguments, treating the trailing keyword as if it were followed by the +value `nil'. + + Argument lists (as processed by `defun*' and friends) *are* checked +rigorously except for the minor point just mentioned; in particular, +keyword arguments are checked for validity, and `&allow-other-keys' and +`:allow-other-keys' are fully implemented. Keyword validity checking +is slightly time consuming (though not too bad in byte-compiled code); +you can use `&allow-other-keys' to omit this check. Functions defined +in this package such as `find' and `member*' do check their keyword +arguments for validity. + + +Optimizing Compiler +=================== + +The byte-compiler that comes with Emacs 18 normally fails to expand +macros that appear in top-level positions in the file (i.e., outside of +`defun's or other enclosing forms). This would have disastrous +consequences to programs that used such top-level macros as `defun*', +`eval-when', and `defstruct'. To work around this problem, the "CL" +package patches the Emacs 18 compiler to expand top-level macros. This +patch will apply to your own macros, too, if they are used in a +top-level context. The patch will not harm versions of the Emacs 18 +compiler which have already had a similar patch applied, nor will it +affect the optimizing Emacs 19 byte-compiler written by Jamie Zawinski +and Hallvard Furuseth. The patch is applied to the byte compiler's +code in Emacs' memory, *not* to the `bytecomp.elc' file stored on disk. + + The Emacs 19 compiler (for Emacs 18) is available from various Emacs +Lisp archive sites such as `archive.cis.ohio-state.edu'. Its use is +highly recommended; many of the Common Lisp macros emit code which can +be improved by optimization. In particular, `block's (whether explicit +or implicit in constructs like `defun*' and `loop') carry a fair +run-time penalty; the optimizing compiler removes `block's which are +not actually referenced by `return' or `return-from' inside the block. + + +File: cl.info, Node: Common Lisp Compatibility, Next: Old CL Compatibility, Prev: Efficiency Concerns, Up: Top + +Common Lisp Compatibility +************************* + +Following is a list of all known incompatibilities between this package +and Common Lisp as documented in Steele (2nd edition). + + Certain function names, such as `member', `assoc', and `floor', were +already taken by (incompatible) Emacs Lisp functions; this package +appends `*' to the names of its Common Lisp versions of these functions. + + The word `defun*' is required instead of `defun' in order to use +extended Common Lisp argument lists in a function. Likewise, +`defmacro*' and `function*' are versions of those forms which +understand full-featured argument lists. The `&whole' keyword does not +work in `defmacro' argument lists (except inside recursive argument +lists). + + In order to allow an efficient implementation, keyword arguments use +a slightly cheesy parser which may be confused if a keyword symbol is +passed as the *value* of another keyword argument. (Specifically, +`(memq :KEYWORD REST-OF-ARGUMENTS)' is used to scan for `:KEYWORD' +among the supplied keyword arguments.) + + The `eql' and `equal' predicates do not distinguish between IEEE +floating-point plus and minus zero. The `equalp' predicate has several +differences with Common Lisp; *note Predicates::.. + + The `setf' mechanism is entirely compatible, except that +setf-methods return a list of five values rather than five values +directly. Also, the new "`setf' function" concept (typified by `(defun +(setf foo) ...)') is not implemented. + + The `do-all-symbols' form is the same as `do-symbols' with no +OBARRAY argument. In Common Lisp, this form would iterate over all +symbols in all packages. Since Emacs obarrays are not a first-class +package mechanism, there is no way for `do-all-symbols' to locate any +but the default obarray. + + The `loop' macro is complete except that `loop-finish' and type +specifiers are unimplemented. + + The multiple-value return facility treats lists as multiple values, +since Emacs Lisp cannot support multiple return values directly. The +macros will be compatible with Common Lisp if `values' or `values-list' +is always used to return to a `multiple-value-bind' or other +multiple-value receiver; if `values' is used without +`multiple-value-...' or vice-versa the effect will be different from +Common Lisp. + + Many Common Lisp declarations are ignored, and others match the +Common Lisp standard in concept but not in detail. For example, local +`special' declarations, which are purely advisory in Emacs Lisp, do not +rigorously obey the scoping rules set down in Steele's book. + + The variable `*gensym-counter*' starts out with a pseudo-random +value rather than with zero. This is to cope with the fact that +generated symbols become interned when they are written to and loaded +back from a file. + + The `defstruct' facility is compatible, except that structures are +of type `:type vector :named' by default rather than some special, +distinct type. Also, the `:type' slot option is ignored. + + The second argument of `check-type' is treated differently. + + +File: cl.info, Node: Old CL Compatibility, Next: Porting Common Lisp, Prev: Common Lisp Compatibility, Up: Top + +Old CL Compatibility +******************** + +Following is a list of all known incompatibilities between this package +and the older Quiroz `cl.el' package. + + This package's emulation of multiple return values in functions is +incompatible with that of the older package. That package attempted to +come as close as possible to true Common Lisp multiple return values; +unfortunately, it could not be 100% reliable and so was prone to +occasional surprises if used freely. This package uses a simpler +method, namely replacing multiple values with lists of values, which is +more predictable though more noticeably different from Common Lisp. + + The `defkeyword' form and `keywordp' function are not implemented in +this package. + + The `member', `floor', `ceiling', `truncate', `round', `mod', and +`rem' functions are suffixed by `*' in this package to avoid collision +with existing functions in Emacs 18 or Emacs 19. The older package +simply redefined these functions, overwriting the built-in meanings and +causing serious portability problems with Emacs 19. (Some more recent +versions of the Quiroz package changed the names to `cl-member', etc.; +this package defines the latter names as aliases for `member*', etc.) + + Certain functions in the old package which were buggy or inconsistent +with the Common Lisp standard are incompatible with the conforming +versions in this package. For example, `eql' and `member' were +synonyms for `eq' and `memq' in that package, `setf' failed to preserve +correct order of evaluation of its arguments, etc. + + Finally, unlike the older package, this package is careful to prefix +all of its internal names with `cl-'. Except for a few functions which +are explicitly defined as additional features (such as `floatp-safe' +and `letf'), this package does not export any non-`cl-' symbols which +are not also part of Common Lisp. + + +The `cl-compat' package +======================= + +The "CL" package includes emulations of some features of the old +`cl.el', in the form of a compatibility package `cl-compat'. To use +it, put `(require 'cl-compat)' in your program. + + The old package defined a number of internal routines without `cl-' +prefixes or other annotations. Call to these routines may have crept +into existing Lisp code. `cl-compat' provides emulations of the +following internal routines: `pair-with-newsyms', `zip-lists', +`unzip-lists', `reassemble-arglists', `duplicate-symbols-p', +`safe-idiv'. + + Some `setf' forms translated into calls to internal functions that +user code might call directly. The functions `setnth', `setnthcdr', +and `setelt' fall in this category; they are defined by `cl-compat', +but the best fix is to change to use `setf' properly. + + The `cl-compat' file defines the keyword functions `keywordp', +`keyword-of', and `defkeyword', which are not defined by the new "CL" +package because the use of keywords as data is discouraged. + + The `build-klist' mechanism for parsing keyword arguments is +emulated by `cl-compat'; the `with-keyword-args' macro is not, however, +and in any case it's best to change to use the more natural keyword +argument processing offered by `defun*'. + + Multiple return values are treated differently by the two Common +Lisp packages. The old package's method was more compatible with true +Common Lisp, though it used heuristics that caused it to report +spurious multiple return values in certain cases. The `cl-compat' +package defines a set of multiple-value macros that are compatible with +the old CL package; again, they are heuristic in nature, but they are +guaranteed to work in any case where the old package's macros worked. +To avoid name collision with the "official" multiple-value facilities, +the ones in `cl-compat' have capitalized names: `Values', +`Values-list', `Multiple-value-bind', etc. + + The functions `cl-floor', `cl-ceiling', `cl-truncate', and +`cl-round' are defined by `cl-compat' to use the old-style +multiple-value mechanism, just as they did in the old package. The +newer `floor*' and friends return their two results in a list rather +than as multiple values. Note that older versions of the old package +used the unadorned names `floor', `ceiling', etc.; `cl-compat' cannot +use these names because they conflict with Emacs 19 built-ins. + + +File: cl.info, Node: Porting Common Lisp, Next: Function Index, Prev: Old CL Compatibility, Up: Top + +Porting Common Lisp +******************* + +This package is meant to be used as an extension to Emacs Lisp, not as +an Emacs implementation of true Common Lisp. Some of the remaining +differences between Emacs Lisp and Common Lisp make it difficult to +port large Common Lisp applications to Emacs. For one, some of the +features in this package are not fully compliant with ANSI or Steele; +*note Common Lisp Compatibility::.. But there are also quite a few +features that this package does not provide at all. Here are some +major omissions that you will want watch out for when bringing Common +Lisp code into Emacs. + + * Case-insensitivity. Symbols in Common Lisp are case-insensitive + by default. Some programs refer to a function or variable as + `foo' in one place and `Foo' or `FOO' in another. Emacs Lisp will + treat these as three distinct symbols. + + Some Common Lisp code is written in all upper-case. While Emacs + is happy to let the program's own functions and variables use this + convention, calls to Lisp builtins like `if' and `defun' will have + to be changed to lower-case. + + * Lexical scoping. In Common Lisp, function arguments and `let' + bindings apply only to references physically within their bodies + (or within macro expansions in their bodies). Emacs Lisp, by + contrast, uses "dynamic scoping" wherein a binding to a variable + is visible even inside functions called from the body. + + Variables in Common Lisp can be made dynamically scoped by + declaring them `special' or using `defvar'. In Emacs Lisp it is + as if all variables were declared `special'. + + Often you can use code that was written for lexical scoping even + in a dynamically scoped Lisp, but not always. Here is an example + of a Common Lisp code fragment that would fail in Emacs Lisp: + + (defun map-odd-elements (func list) + (loop for x in list + for flag = t then (not flag) + collect (if flag x (funcall func x)))) + + (defun add-odd-elements (list x) + (map-odd-elements (function (lambda (a) (+ a x))) list)) + + In Common Lisp, the two functions' usages of `x' are completely + independent. In Emacs Lisp, the binding to `x' made by + `add-odd-elements' will have been hidden by the binding in + `map-odd-elements' by the time the `(+ a x)' function is called. + + (This package avoids such problems in its own mapping functions by + using names like `cl-x' instead of `x' internally; as long as you + don't use the `cl-' prefix for your own variables no collision can + occur.) + + *Note Lexical Bindings::, for a description of the `lexical-let' + form which establishes a Common Lisp-style lexical binding, and + some examples of how it differs from Emacs' regular `let'. + + * Common Lisp allows the shorthand `#'x' to stand for `(function + x)', just as `'x' stands for `(quote x)'. In Common Lisp, one + traditionally uses `#'' notation when referring to the name of a + function. In Emacs Lisp, it works just as well to use a regular + quote: + + (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 + + When `#'' introduces a `lambda' form, it is best to write out + `(function ...)' longhand in Emacs Lisp. You can use a regular + quote, but then the byte-compiler won't know that the `lambda' + expression is code that can be compiled. + + (mapcar #'(lambda (x) (* x 2)) list) ; Common Lisp + (mapcar (function (lambda (x) (* x 2))) list) ; Emacs Lisp + + XEmacs supports `#'' notation starting with version 19.8. + + * Reader macros. Common Lisp includes a second type of macro that + works at the level of individual characters. For example, Common + Lisp implements the quote notation by a reader macro called `'', + whereas Emacs Lisp's parser just treats quote as a special case. + Some Lisp packages use reader macros to create special syntaxes + for themselves, which the Emacs parser is incapable of reading. + + * Other syntactic features. Common Lisp provides a number of + notations beginning with `#' that the Emacs Lisp parser won't + understand. For example, `#| ... |#' is an alternate comment + notation, and `#+lucid (foo)' tells the parser to ignore the + `(foo)' except in Lucid Common Lisp. + + The number prefixes `#b', `#o', and `#x', however, are supported + by the Emacs Lisp parser to represent numbers in binary, octal, + and hexadecimal notation (or radix), just like in Common Lisp. + + * Packages. In Common Lisp, symbols are divided into "packages". + Symbols that are Lisp built-ins are typically stored in one + package; symbols that are vendor extensions are put in another, + and each application program would have a package for its own + symbols. Certain symbols are "exported" by a package and others + are internal; certain packages "use" or import the exported symbols + of other packages. To access symbols that would not normally be + visible due to this importing and exporting, Common Lisp provides + a syntax like `package:symbol' or `package::symbol'. + + Emacs Lisp has a single namespace for all interned symbols, and + then uses a naming convention of putting a prefix like `cl-' in + front of the name. Some Emacs packages adopt the Common Lisp-like + convention of using `cl:' or `cl::' as the prefix. However, the + Emacs parser does not understand colons and just treats them as + part of the symbol name. Thus, while `mapcar' and `lisp:mapcar' + may refer to the same symbol in Common Lisp, they are totally + distinct in Emacs Lisp. Common Lisp programs which refer to a + symbol by the full name sometimes and the short name other times + will not port cleanly to Emacs. + + Emacs Lisp does have a concept of "obarrays," which are + package-like collections of symbols, but this feature is not + strong enough to be used as a true package mechanism. + + * Keywords. The notation `:test-not' in Common Lisp really is a + shorthand for `keyword:test-not'; keywords are just symbols in a + built-in `keyword' package with the special property that all its + symbols are automatically self-evaluating. Common Lisp programs + often use keywords liberally to avoid having to use quotes. + + In Emacs Lisp a keyword is just a symbol whose name begins with a + colon; since the Emacs parser does not treat them specially, they + have to be explicitly made self-evaluating by a statement like + `(setq :test-not ':test-not)'. This package arranges to execute + such a statement whenever `defun*' or some other form sees a + keyword being used as an argument. Common Lisp code that assumes + that a symbol `:mumble' will be self-evaluating even though it was + never introduced by a `defun*' will have to be fixed. + + * The `format' function is quite different between Common Lisp and + Emacs Lisp. It takes an additional "destination" argument before + the format string. A destination of `nil' means to format to a + string as in Emacs Lisp; a destination of `t' means to write to + the terminal (similar to `message' in Emacs). Also, format + control strings are utterly different; `~' is used instead of `%' + to introduce format codes, and the set of available codes is much + richer. There are no notations like `\n' for string literals; + instead, `format' is used with the "newline" format code, `~%'. + More advanced formatting codes provide such features as paragraph + filling, case conversion, and even loops and conditionals. + + While it would have been possible to implement most of Common Lisp + `format' in this package (under the name `format*', of course), it + was not deemed worthwhile. It would have required a huge amount + of code to implement even a decent subset of `format*', yet the + functionality it would provide over Emacs Lisp's `format' would + rarely be useful. + + * Vector constants use square brackets in Emacs Lisp, but `#(a b c)' + notation in Common Lisp. To further complicate matters, Emacs 19 + introduces its own `#(' notation for something entirely + different--strings with properties. + + * Characters are distinct from integers in Common Lisp. The + notation for character constants is also different: `#\A' instead + of `?A'. Also, `string=' and `string-equal' are synonyms in Emacs + Lisp whereas the latter is case-insensitive in Common Lisp. + + * Data types. Some Common Lisp data types do not exist in Emacs + Lisp. Rational numbers and complex numbers are not present, nor + are large integers (all integers are "fixnums"). All arrays are + one-dimensional. There are no readtables or pathnames; streams + are a set of existing data types rather than a new data type of + their own. Hash tables, random-states, structures, and packages + (obarrays) are built from Lisp vectors or lists rather than being + distinct types. + + * The Common Lisp Object System (CLOS) is not implemented, nor is + the Common Lisp Condition System. + + * Common Lisp features that are completely redundant with Emacs Lisp + features of a different name generally have not been implemented. + For example, Common Lisp writes `defconstant' where Emacs Lisp + uses `defconst'. Similarly, `make-list' takes its arguments in + different ways in the two Lisps but does exactly the same thing, + so this package has not bothered to implement a Common Lisp-style + `make-list'. + + * A few more notable Common Lisp features not included in this + package: `compiler-let', `tagbody', `prog', `ldb/dpb', + `parse-integer', `cerror'. + + * Recursion. While recursion works in Emacs Lisp just like it does + in Common Lisp, various details of the Emacs Lisp system and + compiler make recursion much less efficient than it is in most + Lisps. Some schools of thought prefer to use recursion in Lisp + over other techniques; they would sum a list of numbers using + something like + + (defun sum-list (list) + (if list + (+ (car list) (sum-list (cdr list))) + 0)) + + where a more iteratively-minded programmer might write one of + these forms: + + (let ((total 0)) (dolist (x my-list) (incf total x)) total) + (loop for x in my-list sum x) + + While this would be mainly a stylistic choice in most Common Lisps, + in Emacs Lisp you should be aware that the iterative forms are + much faster than recursion. Also, Lisp programmers will want to + note that the current Emacs Lisp compiler does not optimize tail + recursion. + diff --git a/info/cl.info-6 b/info/cl.info-6 new file mode 100644 index 0000000..09892f7 --- /dev/null +++ b/info/cl.info-6 @@ -0,0 +1,248 @@ +This is Info file ../info/cl.info, produced by Makeinfo version 1.68 +from the input file cl.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Common Lisp: (cl). GNU Emacs Common Lisp emulation package. +END-INFO-DIR-ENTRY + + This file documents the GNU Emacs Common Lisp emulation package. + + Copyright (C) 1993 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. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the author instead of in +the original English. + + +File: cl.info, Node: Function Index, Next: Variable Index, Prev: Porting Common Lisp, Up: Top + +Function Index +************** + +* Menu: + +* abs: Numerical Functions. +* acons: Association Lists. +* adjoin: Lists as Sets. +* assert: Assertions. +* assoc*: Association Lists. +* assoc-if: Association Lists. +* assoc-if-not: Association Lists. +* block: Blocks and Exits. +* butlast: List Functions. +* caddr: List Functions. +* callf: Modify Macros. +* callf2: Modify Macros. +* case: Conditionals. +* ceiling*: Numerical Functions. +* check-type: Assertions. +* cl-float-limits: Implementation Parameters. +* cl-prettyexpand: Efficiency Concerns. +* coerce: Type Predicates. +* compiler-macroexpand: Macros. +* concatenate: Sequence Functions. +* copy-list: List Functions. +* copy-tree: List Functions. +* count: Searching Sequences. +* count-if: Searching Sequences. +* count-if-not: Searching Sequences. +* decf: Modify Macros. +* declaim: Declarations. +* declare: Declarations. +* defalias: Function Aliases. +* define-compiler-macro: Macros. +* define-modify-macro: Customizing Setf. +* define-setf-method: Customizing Setf. +* defmacro*: Argument Lists. +* defsetf: Customizing Setf. +* defstruct: Structures. +* defsubst*: Argument Lists. +* deftype: Type Predicates. +* defun*: Argument Lists. +* delete: Sequence Functions. +* delete*: Sequence Functions. +* delete-duplicates: Sequence Functions. +* delete-if: Sequence Functions. +* delete-if-not: Sequence Functions. +* destructuring-bind: Macros. +* do: Iteration. +* do*: Iteration. +* do-all-symbols: Iteration. +* do-symbols: Iteration. +* dolist: Iteration. +* dotimes: Iteration. +* ecase: Conditionals. +* endp: List Functions. +* eql: Equality Predicates. +* equalp: Equality Predicates. +* etypecase: Conditionals. +* eval-when: Time of Evaluation. +* eval-when-compile: Time of Evaluation. +* evenp: Predicates on Numbers. +* every: Mapping over Sequences. +* expt: Numerical Functions. +* fill: Sequence Functions. +* find: Searching Sequences. +* find-if: Searching Sequences. +* find-if-not: Searching Sequences. +* first: List Functions. +* flet: Function Bindings. +* floatp-safe: Predicates on Numbers. +* floor*: Numerical Functions. +* function*: Argument Lists. +* gcd: Numerical Functions. +* gensym: Creating Symbols. +* gentemp: Creating Symbols. +* get*: Property Lists. +* get-setf-method: Customizing Setf. +* getf: Property Lists. +* ignore-errors: Assertions. +* incf: Modify Macros. +* intersection: Lists as Sets. +* isqrt: Numerical Functions. +* labels: Function Bindings. +* last: List Functions. +* lcm: Numerical Functions. +* ldiff: List Functions. +* letf: Modify Macros. +* letf*: Modify Macros. +* lexical-let: Lexical Bindings. +* lexical-let*: Lexical Bindings. +* list*: List Functions. +* list-length: List Functions. +* load-time-value: Time of Evaluation. +* locally: Declarations. +* loop <1>: Iteration. +* loop: Loop Basics. +* macrolet: Macro Bindings. +* make-random-state: Random Numbers. +* map: Mapping over Sequences. +* mapc: Mapping over Sequences. +* mapcan: Mapping over Sequences. +* mapcar*: Mapping over Sequences. +* mapcon: Mapping over Sequences. +* mapl: Mapping over Sequences. +* maplist: Mapping over Sequences. +* member: Lists as Sets. +* member*: Lists as Sets. +* member-if: Lists as Sets. +* member-if-not: Lists as Sets. +* merge: Sorting Sequences. +* minusp: Predicates on Numbers. +* mismatch: Searching Sequences. +* mod*: Numerical Functions. +* multiple-value-bind: Multiple Values. +* multiple-value-setq: Multiple Values. +* nbutlast: List Functions. +* nintersection: Lists as Sets. +* notany: Mapping over Sequences. +* notevery: Mapping over Sequences. +* nset-difference: Lists as Sets. +* nset-exclusive-or: Lists as Sets. +* nsublis: Substitution of Expressions. +* nsubst: Substitution of Expressions. +* nsubst-if: Substitution of Expressions. +* nsubst-if-not: Substitution of Expressions. +* nsubstitute: Sequence Functions. +* nsubstitute-if: Sequence Functions. +* nsubstitute-if-not: Sequence Functions. +* nunion: Lists as Sets. +* oddp: Predicates on Numbers. +* pairlis: Association Lists. +* plusp: Predicates on Numbers. +* pop: Modify Macros. +* position: Searching Sequences. +* position-if: Searching Sequences. +* position-if-not: Searching Sequences. +* proclaim: Declarations. +* progv: Dynamic Bindings. +* psetf: Modify Macros. +* psetq: Assignment. +* push: Modify Macros. +* pushnew: Modify Macros. +* random*: Random Numbers. +* random-state-p: Random Numbers. +* rassoc: Association Lists. +* rassoc*: Association Lists. +* rassoc-if: Association Lists. +* rassoc-if-not: Association Lists. +* reduce: Mapping over Sequences. +* rem*: Numerical Functions. +* remf: Property Lists. +* remove: Sequence Functions. +* remove*: Sequence Functions. +* remove-duplicates: Sequence Functions. +* remove-if: Sequence Functions. +* remove-if-not: Sequence Functions. +* remprop: Property Lists. +* remq: Sequence Functions. +* replace: Sequence Functions. +* rest: List Functions. +* return: Blocks and Exits. +* return-from: Blocks and Exits. +* rotatef: Modify Macros. +* round*: Numerical Functions. +* search: Searching Sequences. +* set-difference: Lists as Sets. +* set-exclusive-or: Lists as Sets. +* setf: Basic Setf. +* shiftf: Modify Macros. +* some: Mapping over Sequences. +* sort*: Sorting Sequences. +* stable-sort: Sorting Sequences. +* sublis: Substitution of Expressions. +* subseq: Sequence Functions. +* subsetp: Lists as Sets. +* subst: Substitution of Expressions. +* subst-if: Substitution of Expressions. +* subst-if-not: Substitution of Expressions. +* substitute: Sequence Functions. +* substitute-if: Sequence Functions. +* substitute-if-not: Sequence Functions. +* symbol-macrolet: Macro Bindings. +* tailp: Lists as Sets. +* the: Declarations. +* tree-equal: List Functions. +* truncate*: Numerical Functions. +* typecase: Conditionals. +* typep: Type Predicates. +* union: Lists as Sets. +* unless: Conditionals. +* when: Conditionals. + + +File: cl.info, Node: Variable Index, Prev: Function Index, Up: Top + +Variable Index +************** + +* Menu: + +* *gensym-counter*: Creating Symbols. +* *random-state*: Random Numbers. +* float-epsilon: Implementation Parameters. +* float-negative-epsilon: Implementation Parameters. +* least-negative-float: Implementation Parameters. +* least-negative-normalized-float: Implementation Parameters. +* least-positive-float: Implementation Parameters. +* least-positive-normalized-float: Implementation Parameters. +* most-negative-fixnum: Implementation Parameters. +* most-negative-float: Implementation Parameters. +* most-positive-fixnum: Implementation Parameters. +* most-positive-float: Implementation Parameters. + + diff --git a/info/custom.info b/info/custom.info index 0a0b284..ccf40ba 100644 --- a/info/custom.info +++ b/info/custom.info @@ -1,5 +1,5 @@ -This is ../info/custom.info, produced by makeinfo version 4.0 from -custom.texi. +This is Info file ../info/custom.info, produced by Makeinfo version +1.68 from the input file custom.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -58,7 +58,7 @@ Declaring Groups Use `defgroup' to declare new customization groups. - - Function: defgroup symbol members doc [keyword value]... + - Function: defgroup SYMBOL MEMBERS DOC [KEYWORD VALUE]... Declare SYMBOL as a customization group containing MEMBERS. SYMBOL does not need to be quoted. @@ -89,7 +89,7 @@ Declaring Variables Use `defcustom' to declare user editable variables. - - Function: defcustom symbol value doc [keyword value]... + - Function: defcustom SYMBOL VALUE DOC [KEYWORD VALUE]... Declare SYMBOL as a customizable variable that defaults to VALUE. Neither SYMBOL nor VALUE needs to be quoted. If SYMBOL is not already bound, initialize it to VALUE. @@ -156,7 +156,7 @@ default value, `saved-value' for a value saved by the user, and Use `custom-add-option' to specify that a specific function is useful as an member of a hook. - - Function: custom-add-option symbol option + - Function: custom-add-option SYMBOL OPTION To the variable SYMBOL add OPTION. If SYMBOL is a hook variable, OPTION should be a hook member. For @@ -170,7 +170,7 @@ Declaring Faces Faces are declared with `defface'. - - Function: defface face spec doc [keyword value]... + - Function: defface FACE SPEC DOC [KEYWORD VALUE]... Declare FACE as a customizable face that defaults to SPEC. FACE does not need to be quoted. @@ -225,7 +225,7 @@ subgroups, with each subgroup being member of the top level group. The top level group for the package should itself be member of one or more of the standard customization groups. There exists a group for -each _finder_ keyword. Press `C-h p' to see a list of finder keywords, +each *finder* keyword. Press `C-h p' to see a list of finder keywords, and add you group to each of them, using the `:group' keyword.  @@ -240,18 +240,18 @@ Utilities Widget type for specifying the info manual entry for a customization option. It takes one argument, an info address. - - Function: custom-add-to-group group member widget + - Function: custom-add-to-group GROUP MEMBER WIDGET To existing GROUP add a new MEMBER of type WIDGET, If there already is an entry for that member, overwrite it. - - Function: custom-add-link symbol widget + - Function: custom-add-link SYMBOL WIDGET To the custom option SYMBOL add the link WIDGET. - - Function: custom-add-load symbol load + - Function: custom-add-load SYMBOL LOAD To the custom option SYMBOL add the dependency LOAD. LOAD should be either a library file name, or a feature name. - - Function: customize-menu-create symbol &optional name + - Function: customize-menu-create SYMBOL &optional NAME Create menu for customization group SYMBOL. If optional 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 @@ -378,16 +378,15 @@ Wishlist Add colors. -  Tag Table: -Node: Top204 -Node: Declaring Groups1625 -Node: Declaring Variables2726 -Node: Declaring Faces5817 -Node: Usage for Package Authors7515 -Node: Utilities8294 -Node: The Init File9378 -Node: Wishlist9830 +Node: Top230 +Node: Declaring Groups1651 +Node: Declaring Variables2752 +Node: Declaring Faces5843 +Node: Usage for Package Authors7541 +Node: Utilities8320 +Node: The Init File9404 +Node: Wishlist9856  End Tag Table diff --git a/info/emodules.info b/info/emodules.info index c527ed0..f81e90f 100644 --- a/info/emodules.info +++ b/info/emodules.info @@ -1,5 +1,5 @@ -This is ../info/emodules.info, produced by makeinfo version 4.0 from -emodules.texi. +This is Info file ../info/emodules.info, produced by Makeinfo version +1.68 from the input file emodules.texi. This file documents the module loading technology of XEmacs. @@ -41,20 +41,20 @@ support documentation. * Menu: * Introduction:: Introducing Emacs Modules -* Anatomy of a Module:: Basic module layout and technology +* Annatomy of a Module:: Basic module layout and technology * Using ellcc:: How to use the module compiler * Defining Functions:: Creating new Lisp primitives * Defining Variables:: Creating new Lisp variables * Index:: Concept Index - --- The Detailed Node Listing --- + -- The Detailed Node Listing -- -Anatomy of a Module +Annatomy of a Module * Required Header File:: Always include * Required Functions:: Functions you must always provide * Required Variables:: Variables whose values you must provide -* Loading other Modules:: How to load dependent modules +* Loading other Modules:: How to load dependant modules Using `ellcc' @@ -70,7 +70,7 @@ Defining Functions * Declaring Functions:: Declaring functions to the Lisp reader  -File: emodules.info, Node: Introduction, Next: Anatomy of a Module, Prev: Top, Up: Top +File: emodules.info, Node: Introduction, Next: Annatomy of a Module, Prev: Top, Up: Top Introduction ************ @@ -84,7 +84,7 @@ 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. @@ -95,8 +95,8 @@ suited to a wider range of applications, especially those that require low level access to a system or need to be as quick as possible. This manual describes a new way of extending XEmacs, by using dynamic -loadable modules (also known as dynamically loadable libraries (DLLs), -dynamic shared objects (DSOs) or just simply shared objects), which can +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 XEmacs at any time. I sometimes refer to this technology as "CEmacs", which is short for "C Extensible Emacs". @@ -121,7 +121,7 @@ perspective though, a lot more is provided. XEmacs. * CEmacs also makes all of the relevant XEmacs internal header - files available for module authors to use. This is often required + 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 `emodules.h'. Due to the nature of dynamic @@ -154,13 +154,13 @@ deal to look at the actual XEmacs source code to see how things are done.  -File: emodules.info, Node: Anatomy of a Module, Next: Using ellcc, Prev: Introduction, Up: Top +File: emodules.info, Node: Annatomy of a Module, Next: Using ellcc, Prev: Introduction, Up: Top -Anatomy of a Module -******************* +Annatomy of a Module +******************** - Each dynamically loadable XEmacs extension (hereafter referred to as -a module) has a certain compulsory format, and must contain several + Each dynamically loadable XEmacs 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 @@ -171,10 +171,10 @@ sample. The source for this sample can be found in the file * Required Header File:: Always include * Required Functions:: Functions you must always provide * Required Variables:: Variables whose values you must provide -* Loading other Modules:: How to load dependent modules +* Loading other Modules:: How to load dependant modules  -File: emodules.info, Node: Required Header File, Next: Required Functions, Prev: Anatomy of a Module, Up: Anatomy of a Module +File: emodules.info, Node: Required Header File, Next: Required Functions, Prev: Annatomy of a Module, Up: Annatomy of a Module Required Header File ==================== @@ -200,7 +200,7 @@ files included are: variable declarations. `sysdep.h' - All system dependent declarations and abstraction macros live + All system dependant declarations and abstraction macros live here. You should never call low level system functions directly. Rather, you should use the abstraction macros provided in this header file. @@ -223,14 +223,14 @@ files included are: manipulating XEmacs frames.  -File: emodules.info, Node: Required Functions, Next: Required Variables, Prev: Required Header File, Up: Anatomy of a Module +File: emodules.info, Node: Required Functions, Next: Required Variables, Prev: Required Header File, Up: Annatomy of a Module Required Functions ================== Every module requires several initialization functions. It is the -responsibility of these functions to load in any dependent modules, and -to declare all variables and functions which are to be made visible to +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 XEmacs Lisp reader. Each of these functions performs a very specific task, and they are executed in the correct order by XEmacs. All of these functions are `void' functions which take no arguments. @@ -244,7 +244,7 @@ place-holder, not an actual function name. `syms_of_module' This required function is responsible for introducing to the Lisp reader all functions that you have defined in your module using - `DEFUN()'. Note that _only_ functions are declared here, using + `DEFUN()'. Note that *only* functions are declared here, using the `DEFSUBR()' macro. No variables are declared. `vars_of_module' @@ -252,14 +252,7 @@ place-holder, not an actual function name. `DEFVAR_LISP()', `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 XEmacs source code. If the module is - intended to be usable statically linked into XEmacs, the actions - of this function are severely restricted. *Note General Coding - Rules: (internals)General Coding Rules. Also see the comments in - `src/emacs.c' (`main_1'). Modules which perform initializations - not permitted by these rules will probably work, but dual-use - (dynamic loading and static linking) modules will require very - careful, and possibly fragile, coding. + syntax used for all internal XEmacs source code. `modules_of_module' This optional function should be used to load in any modules which @@ -275,7 +268,7 @@ place-holder, not an actual function name. functions and variables declared in your module.  -File: emodules.info, Node: Required Variables, Next: Loading other Modules, Prev: Required Functions, Up: Anatomy of a Module +File: emodules.info, Node: Required Variables, Next: Loading other Modules, Prev: Required Functions, Up: Annatomy of a Module Required Variables ================== @@ -283,7 +276,7 @@ Required Variables Not only does a module need to declare the initialization functions mentioned above, it is also required to provide certain variables which the module loading code searches for in order to determine the viability -of a module. You are _not_ required to provide these variables in your +of a module. You are *not* required to provide these variables in your source files. They are automatically set up in the module initialization file by the `ellcc' compiler. These variables are discussed here simply for the sake of completeness. @@ -303,7 +296,7 @@ discussed here simply for the sake of completeness. This is a short (typically 10 characters or less) name for the module, and it is used as a suffix for all of the required functions. This is also the name by which the module is - recognized when loading dependent modules. The name does not + recognised when loading dependant modules. The name does not necessarily have to be the same as the physical file name, although keeping the two names in sync is a pretty good idea. The name must not be empty, and it must be a valid part of a C @@ -329,7 +322,7 @@ discussed here simply for the sake of completeness. module. The value is set by the `--mod-title' argument to `ellcc'.  -File: emodules.info, Node: Loading other Modules, Prev: Required Variables, Up: Anatomy of a Module +File: emodules.info, Node: Loading other Modules, Prev: Required Variables, Up: Annatomy of a Module Loading other Modules ===================== @@ -338,12 +331,12 @@ Loading other Modules function `modules_of_module' to load in any modules which the current module depends on. If the module is stand-alone, and does not depend on other modules, then this function can be left empty or even -undeclared. However, if it does have dependencies, it must call +undeclared. However, if it does have dependnacies, it must call `emodules_load': - int emodules_load (const char *module, - const char *modname, - const char *modver) + int emodules_load (CONST char *module, + CONST char *modname, + CONST char *modver) The first argument MODULE is the name of the actual shared object or DLL. You can omit the `.so', `.ell' or `.dll' extension of you wish. @@ -372,7 +365,7 @@ their parents will also fail to load. This does not include previous successful calls to `emodules_load' at the top level.  -File: emodules.info, Node: Using ellcc, Next: Defining Functions, Prev: Anatomy of a Module, Up: Top +File: emodules.info, Node: Using ellcc, Next: Defining Functions, Prev: Annatomy of a Module, Up: Top Using `ellcc' ************* @@ -469,8 +462,8 @@ trickery in the module loading code. This is all done using the The result of running `ellcc' in initialization mode is a C source file which you compile with (you guessed it) `ellcc' in compile mode. Initialization mode is where you set the module name, version, title -and gather together all of the documentation strings for the functions -and variables in your module. There are several options that you are +and gather together all of the documentaion strings for the functions +and vairables in your module. There are several options that you are required to pass `ellcc' in initialization mode, the first of which is the mode switch itself, `--mode=init'. @@ -549,7 +542,7 @@ option. This directory is treated the same way as the main module directory. Each sub-directory within it is searched for a given module when the user attempts to load it. The valid extensions that the loader attempts to use are `.so', `.ell' and `.dll'. You can use any -of these extensions, although `.ell' is the preferred extension. +of these extensions, although `.ell' is the prefered extension.  File: emodules.info, Node: Link Mode, Next: Other ellcc options, Prev: Initialization Mode, Up: Using ellcc @@ -558,10 +551,10 @@ Link Mode ========= Once all of your source code files have been compiled (including the -generated init file) you need to link them all together to create the +generated init file) you need to link them all together to created the loadable module. To do this, you invoke `ellcc' in link mode, by -passing the `--mode=link' option. You need to specify the final output -file using the `--mod-output=NAME' option, but other than that all +pasing the `--mode-link' command. You need to specify the final output +file using the `--mod-output=NAME' command, but other than that all other arguments are passed on directly to the system compiler or linker, along with any other required arguments to create the loadable module. @@ -606,8 +599,8 @@ variables. Here is the complete list of options that `ellcc' accepts. is displayed. `--mod-name=NAME' - Sets the short internal module NAME to the string specified, which - must consist only of valid C identifiers. Required during + Sets the short internaml module NAME to the string specified, + which must consist only of valid C identifiers. Required during initialization mode. `--mod-version=VERSION' @@ -636,8 +629,8 @@ variables. Here is the complete list of options that `ellcc' accepts. exit. `--mod-archdir' - Prints the name of the root of the architecture-dependent - directory that XEmacs searches for architecture-dependent files. + Prints the name of the root of the architecture-dependant + directory that XEmacs searches for architecture-dependant files. `--mod-config' Prints the name of the configuration for which XEmacs and `ellcc' @@ -654,7 +647,7 @@ flags that were determined at the time XEmacs 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 `ellcc' -recognizes. +recognises. `ELLCC' This is used to over-ride the name of the C compiler that is @@ -744,7 +737,7 @@ module. This is done using the `DEFUN' macro. Here is a small example: DEFUN ("my-function", Fmy_function, 1, 1, "FFile name: ", /* Sample Emacs primitive function. - The specified FILE is frobnicated before it is fnozzled. + The specified FILE is frobricated before it is fnozzled. */ (file)) { @@ -780,7 +773,7 @@ Declaring Functions =================== Simply writing the code for a function is not enough to make it -available to the Lisp reader. You have to, during module +availible to the Lisp reader. You have to, during module initialization, let the Lisp reader know about the new function. This is done by calling `DEFSUBR' with the name of the function. This is the sole purpose of the initialization function `syms_of_module'. @@ -812,7 +805,7 @@ Defining Variables Rarely will you write a module that only contains functions. It is common to also provide variables which can be used to control the -behavior of the function, or store the results of the function being +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 XEmacs primitives, and the declaration of the variables is identical. @@ -827,10 +820,10 @@ initialization function using special XEmacs macros such as how to use these macros is to look at existing source code, or read the internals manual. - One _very_ important difference between XEmacs variables and module + One *very* important difference between XEmacs variables and module variables is how you use pure space. Simply put, you *never* use pure space in XEmacs modules. The pure space storage is of a limited size, -and is initialized properly during the dumping of XEmacs. Because +and is initialized propperly during the dumping of XEmacs. Because variables are being added dynamically to an already running XEmacs when you load a module, you cannot use pure space. Be warned: *do not use pure space in modules. Repeat, do not use pure space in modules.* @@ -869,7 +862,7 @@ Index * Menu: -* anatomy: Anatomy of a Module. +* annatomy: Annatomy of a Module. * compiler: Introduction. * compiling: Compile Mode. * config.h: Required Header File. @@ -881,15 +874,15 @@ Index * DEFVAR_BOOL: Defining Variables. * DEFVAR_INT: Defining Variables. * DEFVAR_LISP: Defining Variables. -* dependencies: Loading other Modules. +* dependancies: Loading other Modules. * DLL: Introduction. * docs_of_module: Required Functions. * documentation <1>: Initialization Mode. * documentation: Introduction. * DSO: Introduction. +* ellcc <1>: Introduction. +* ellcc: Using ellcc. * ELLCC: Environment Variables. -* ellcc <1>: Using ellcc. -* ellcc: Introduction. * ELLCFLAGS: Environment Variables. * ELLDLLFLAGS: Environment Variables. * ELLLD: Environment Variables. @@ -900,7 +893,7 @@ Index * emodules.h: Required Header File. * emodules_load: Loading other Modules. * environment variables: Environment Variables. -* format, module: Anatomy of a Module. +* format, module: Annatomy of a Module. * functions, declaring: Declaring Functions. * functions, defining: Using DEFUN. * functions, Lisp: Using DEFUN. @@ -908,16 +901,16 @@ Index * header files: Introduction. * help: Introduction. * include files: Required Header File. -* initialization <1>: Initialization Mode. -* initialization <2>: Required Variables. +* initialization <1>: Required Variables. +* initialization <2>: Initialization Mode. * initialization: Required Functions. * linker: Introduction. * linking: Link Mode. * module compiler: Using ellcc. -* module format: Anatomy of a Module. -* module skeleton: Anatomy of a Module. -* modules_of_module <1>: Loading other Modules. -* modules_of_module: Required Functions. +* module format: Annatomy of a Module. +* module skeleton: Annatomy of a Module. +* modules_of_module <1>: Required Functions. +* modules_of_module: Loading other Modules. * objects, defining: Defining Variables. * objects, Lisp: Defining Variables. * paths: Other ellcc options. @@ -926,7 +919,7 @@ Index * required variables: Required Variables. * samples: Introduction. * shared object: Introduction. -* skeleton, module: Anatomy of a Module. +* skeleton, module: Annatomy of a Module. * subrs: Using DEFUN. * syms_of_module: Required Functions. * variables, defining: Defining Variables. @@ -937,23 +930,23 @@ Index  Tag Table: -Node: Top1536 -Node: Introduction2883 -Node: Anatomy of a Module7391 -Node: Required Header File8205 -Node: Required Functions10124 -Node: Required Variables12848 -Node: Loading other Modules15534 -Node: Using ellcc17591 -Node: Compile Mode19385 -Node: Initialization Mode20753 -Node: Link Mode25787 -Node: Other ellcc options26932 -Node: Environment Variables29511 -Node: Defining Functions31202 -Node: Using DEFUN33213 -Node: Declaring Functions34924 -Node: Defining Variables36267 -Node: Index38510 +Node: Top1562 +Node: Introduction2908 +Node: Annatomy of a Module7417 +Node: Required Header File8233 +Node: Required Functions10154 +Node: Required Variables12403 +Node: Loading other Modules15090 +Node: Using ellcc17148 +Node: Compile Mode18943 +Node: Initialization Mode20311 +Node: Link Mode25343 +Node: Other ellcc options26490 +Node: Environment Variables29070 +Node: Defining Functions30761 +Node: Using DEFUN32772 +Node: Declaring Functions34483 +Node: Defining Variables35826 +Node: Index38071  End Tag Table diff --git a/info/external-widget.info b/info/external-widget.info index e7ebc60..def4c1b 100644 --- a/info/external-widget.info +++ b/info/external-widget.info @@ -1,5 +1,5 @@ -This is ../info/external-widget.info, produced by makeinfo version 4.0 -from external-widget.texi. +This is Info file ../info/external-widget.info, produced by Makeinfo +version 1.68 from the input file external-widget.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -129,9 +129,9 @@ are not seen by Emacs.  Tag Table: -Node: Top232 -Node: Using an External Client Widget662 -Node: External Client Widget Resource Settings2377 -Node: Motif-Specific Info About the External Client Widget5120 +Node: Top258 +Node: Using an External Client Widget688 +Node: External Client Widget Resource Settings2403 +Node: Motif-Specific Info About the External Client Widget5146  End Tag Table diff --git a/info/info.info b/info/info.info index 9e504e6..ff9d60e 100644 --- a/info/info.info +++ b/info/info.info @@ -1,5 +1,5 @@ -This is ../info/info.info, produced by makeinfo version 4.0 from -info.texi. +This is Info file ../info/info.info, produced by Makeinfo version 1.68 +from the input file info.texi. INFO-DIR-SECTION Texinfo documentation system START-INFO-DIR-ENTRY @@ -9,7 +9,7 @@ END-INFO-DIR-ENTRY 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 are @@ -31,17 +31,20 @@ File: info.info, Node: Top, Next: Getting Started, Up: (dir) 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 `h' while using the Info -program. It brings you to a programmed instruction sequence. + To learn how to use Info, type the command `h'. It brings you to a +programmed instruction sequence. + + To learn advanced Info commands, type `n' twice. This brings you to +`Info for Experts', skipping over the `Getting Started' chapter. * 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).  File: info.info, Node: Getting Started, Next: Advanced Info, Prev: Top, Up: Top @@ -169,7 +172,7 @@ Another `n' command now would take you to the next node, `Help-^L'. you to the `Previous' node. When you get there, you can do an `n' again to return here. - This all probably seems insultingly simple so far, but _do not_ be + This all probably seems insultingly simple so far, but *do not* be led into skimming. Things will get more complicated soon. Also, do not try a new command until you are told it is time to. Otherwise, you may make Info skip past an important warning that was coming up. @@ -201,7 +204,7 @@ not anything above the top until you have typed some spaces). When you type the space, the two lines that were at the bottom of the screen appear at the top, followed by more lines. Delete takes the -two lines from the top and moves them to the bottom, _usually_, but if +two lines from the top and moves them to the bottom, *usually*, but if there are not a full screen's worth of lines above them they may not make it all the way to the bottom. @@ -295,8 +298,8 @@ actually visible in its node. If you cannot find a menu in a node by looking at it, then the node does not have a menu and the `m' command is not available. - The command to go to one of the subnodes is `m'--but _do not do it -yet!_ Before you use `m', you must understand the difference between + The command to go to one of the subnodes is `m'--but *do not do it +yet!* Before you use `m', you must understand the difference between commands and arguments. So far, you have learned several commands that do not need arguments. When you type one, Info processes it and is instantly ready for another command. The `m' command is different: it @@ -335,16 +338,16 @@ what you have entered. 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: + * Menu: The menu starts here. + + This menu gives you three ways of going to one place, Help-FOO. -* Foo: Help-FOO. A node you can visit for fun. + * 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 `m' and see what happens: +>> Now type just an `m' and see what happens: Now you are "inside" an `m' command. Commands cannot be used now; the next thing you will type must be the name of a subtopic. @@ -390,7 +393,7 @@ Menus move Down in the tree, and `Up' moves Up. `Previous', on the other hand, is usually used to "stay on the same level but go backwards" You can go back to the node `Help-M' by typing the command `u' for -"Up". That puts you at the _front_ of the node--to get back to where +"Up". That puts you at the *front* of the node--to get back to where you were reading you have to type some s. >> Now type `u' to move back up to `Help-M'. @@ -420,7 +423,7 @@ back to `Help-M'. Then follow directions again and you will end up back here. - Note the difference between `l' and `p': `l' moves to where _you_ + Note the difference between `l' and `p': `l' moves to where *you* last were, whereas `p' always moves to the node which the header says is the `Previous' node (from this node, to `Help-M'). @@ -429,7 +432,7 @@ node, which is the first one you saw when you entered Info, has a menu which leads (directly, or indirectly through other menus), to all the nodes that exist. - >> Try doing a `d', then do an `l' to return here (yes, _do_ + >> Try doing a `d', then do an `l' to return here (yes, *do* return). Sometimes, in Info documentation, you will see a cross reference. @@ -496,14 +499,14 @@ and Return, to get to the node about Info and see what other help is available.  -File: info.info, Node: Advanced Info, Next: Creating an Info File, Prev: Getting Started, Up: Top +File: info.info, Node: Advanced Info, Next: Create an Info File, Prev: Getting Started, Up: Top 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 _both_ to +cases, writing a Texinfo file is better, since you can use it *both* to generate an Info file and to make a printed manual. *Note Overview of Texinfo: (texinfo)Top.) @@ -559,10 +562,10 @@ short for the `m' command together with an argument. `1' goes through the first item in the current node's menu; `2' goes through the second item, etc. - If your display supports multiple fonts, and you are using Emacs' -Info mode to read Info files, the `*' for the fifth menu item is -underlined, and so is the `*' for the ninth item; these underlines make -it easy to see at a glance which number to use for an item. + If you display supports multiple fonts, and you are using Emacs' Info +mode to read Info files, the `*' for the fifth menu item is underlines, +and so is the `*' 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 actually count items, it is better to use `m' instead, and specify the @@ -584,7 +587,7 @@ Adding a new node to Info 2. Put that topic in the menu in the directory. *Note Menu: Menus. - Usually, the way to create the nodes is with Texinfo (*note Overview + Usually, the way to create the nodes is with Texinfo *note Overview of Texinfo: (texinfo)Top.); 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. @@ -594,8 +597,8 @@ one. It must have a <^_> character before it (invisible to the user; this node has one but you cannot see it), and it ends with either a <^_>, a <^L>, or the end of file. Note: If you put in a <^L> to end a new node, be sure that there is a <^_> after it to start the next one, -since <^L> cannot _start_ a node. Also, a nicer way to make a node -boundary be a page boundary as well is to put a <^L> _right after_ the +since <^L> cannot *start* a node. Also, a nicer way to make a node +boundary be a page boundary as well is to put a <^L> *right after* the <^_>. The <^_> starting a node must be followed by a newline or a <^L> @@ -631,10 +634,10 @@ make it possible to make old-fashioned, unstructured files into nodes of the tree. The `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 `Next', `Previous' and `Up' names may contain -them. In this node, since the `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 `Next', `Previous' and `Up' names may +contain them. In this node, since the `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 @@ -679,13 +682,13 @@ to see them all need not keep revisiting the Menu. The Info Directory is simply the menu of the node `(dir)Top'--that is, node `Top' in file `.../info/dir'. You can put new entries in that -menu just like any other menu. The Info Directory is _not_ the same as +menu just like any other menu. The Info Directory is *not* the same as the file directory called `info'. It happens that many of Info's files live on that file directory, but they do not have to; and files on that directory are not automatically listed in the Info Directory node. Also, although the Info node graph is claimed to be a "hierarchy", -in fact it can be _any_ directed graph. Shared structures and pointer +in fact it can be *any* directed graph. Shared structures and pointer cycles are perfectly possible, and can be used if they are appropriate to the meaning to be expressed. There is no need for all the nodes in a file to form a connected structure. In fact, this file has two @@ -704,7 +707,7 @@ Creating Cross References A cross reference can be placed anywhere in the text, unlike a menu item which must go at the front of a line. A cross reference looks like a menu item except that it has `*note' instead of `*'. It -_cannot_ be terminated by a `)', because `)''s are so often part of +*cannot* be terminated by a `)', because `)''s are so often part of node names. If you wish to enclose a cross reference in parentheses, terminate it with a period first. Here are two examples of cross references pointers: @@ -776,10 +779,10 @@ File: info.info, Node: Emacs Info Variables, Prev: Checking, Up: Advanced Inf Emacs Info-mode Variables ========================= - The following variables may modify the behavior of Info-mode in + 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 `~/.emacs' init file. *Note Examining and -Setting Variables: (xemacs)Examining. +Setting Variables: (emacs)Examining. `Info-enable-edit' Set to `nil', disables the `e' (`Info-edit') command. A non-`nil' @@ -799,42 +802,43 @@ Setting Variables: (xemacs)Examining. when the function `Info-directory' is called.  -File: info.info, Node: Creating an Info File, Prev: Advanced Info, Up: Top +File: info.info, Node: Create an Info File, Prev: Advanced Info, Up: Top -Creating an Info File -********************* +Creating an Info File from a Makeinfo file +****************************************** - *Note Overview of Texinfo: (texinfo)Top, to learn how to write a -Texinfo file. + `makeinfo' is a utility that converts a Texinfo file into an Info +file; `texinfo-format-region' and `texinfo-format-buffer' are GNU Emacs +functions that do the same. *Note Creating an Info File: (texinfo)Create an Info File, to learn how to create an Info file from a Texinfo file. - *Note Installing an Info File: (texinfo)Install an Info File, to -learn how to install an Info file after you have created one. + *Note Overview of Texinfo: (texinfo)Top, to learn how to write a +Texinfo file.  Tag Table: -Node: Top1067 -Node: Getting Started1612 -Node: Help-Small-Screen2360 -Node: Help4109 -Node: Help-P5139 -Node: Help-^L6001 -Node: Help-M8879 -Node: Help-FOO14859 -Node: Help-Adv15597 -Node: Help-Cross18272 -Node: Help-Q18918 -Node: Advanced Info19545 -Node: Expert20523 -Node: Add23037 -Node: Menus26397 -Node: Cross-refs29271 -Node: Tags29973 -Node: Checking31275 -Node: Emacs Info Variables32228 -Node: Creating an Info File33217 +Node: Top1085 +Node: Getting Started1770 +Node: Help-Small-Screen2518 +Node: Help4267 +Node: Help-P5297 +Node: Help-^L6159 +Node: Help-M9037 +Node: Help-FOO15047 +Node: Help-Adv15785 +Node: Help-Cross18460 +Node: Help-Q19106 +Node: Advanced Info19733 +Node: Expert20709 +Node: Add23222 +Node: Menus26581 +Node: Cross-refs29455 +Node: Tags30157 +Node: Checking31459 +Node: Emacs Info Variables32412 +Node: Create an Info File33401  End Tag Table diff --git a/info/internals.info b/info/internals.info index 028eea0..c7464dc 100644 --- a/info/internals.info +++ b/info/internals.info @@ -1,9 +1,9 @@ -This is ../info/internals.info, produced by makeinfo version 4.0 from -internals/internals.texi. +This is Info file ../../info/internals.info, produced by Makeinfo +version 1.68 from the input file internals.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY -* Internals: (internals). XEmacs Internals Manual. +* Internals: (internals). XEmacs Internals Manual. END-INFO-DIR-ENTRY Copyright (C) 1992 - 1996 Ben Wing. Copyright (C) 1996, 1997 Sun @@ -39,161 +39,141 @@ Foundation instead of in the original English.  Indirect: -internals.info-1: 1776 -internals.info-2: 51581 -internals.info-3: 100531 -internals.info-4: 150232 -internals.info-5: 192457 -internals.info-6: 241581 -internals.info-7: 288078 -internals.info-8: 335143 -internals.info-9: 384278 +internals.info-1: 1789 +internals.info-2: 45943 +internals.info-3: 93017 +internals.info-4: 141389 +internals.info-5: 183420 +internals.info-6: 232841 +internals.info-7: 281571 +internals.info-8: 330967  Tag Table: (Indirect) -Node: Top1776 -Node: A History of Emacs7052 -Node: Through Version 188577 -Node: Lucid Emacs11998 -Node: GNU Emacs 1916042 -Node: GNU Emacs 2018225 -Node: XEmacs18652 -Node: XEmacs From the Outside25764 -Node: The Lisp Language27531 -Node: XEmacs From the Perspective of Building37074 -Node: XEmacs From the Inside43199 -Node: The XEmacs Object System (Abstractly Speaking)51581 -Node: How Lisp Objects Are Represented in C65667 -Node: Rules When Writing New C Code70344 -Node: General Coding Rules71207 -Node: Writing Lisp Primitives76979 -Node: Writing Good Comments88141 -Node: Adding Global Lisp Variables91680 -Node: Proper Use of Unsigned Types95329 -Node: Coding for Mule96579 -Node: Character-Related Data Types97558 -Node: Working With Character and Byte Positions100531 -Node: Conversion to and from External Data104296 -Node: General Guidelines for Writing Mule-Aware Code110437 -Node: An Example of Mule-Aware Code113125 -Node: Techniques for XEmacs Developers115106 -Node: A Summary of the Various XEmacs Modules123053 -Node: Low-Level Modules123873 -Node: Basic Lisp Modules131286 -Node: Modules for Standard Editing Operations137880 -Node: Editor-Level Control Flow Modules143768 -Node: Modules for the Basic Displayable Lisp Objects147279 -Node: Modules for other Display-Related Lisp Objects150232 -Node: Modules for the Redisplay Mechanism151573 -Node: Modules for Interfacing with the File System153945 -Node: Modules for Other Aspects of the Lisp Interpreter and Object System157643 -Node: Modules for Interfacing with the Operating System163096 -Node: Modules for Interfacing with X Windows170652 -Node: Modules for Internationalization174135 -Node: Allocation of Objects in XEmacs Lisp176772 -Node: Introduction to Allocation177293 -Node: Garbage Collection180934 -Node: GCPROing182090 -Node: Garbage Collection - Step by Step189094 -Node: Invocation189486 -Node: garbage_collect_1192457 -Node: mark_object201939 -Node: gc_sweep203751 -Node: sweep_lcrecords_1208814 -Node: compact_string_chars209809 -Node: sweep_strings211989 -Node: sweep_bit_vectors_1212954 -Node: Integers and Characters213630 -Node: Allocation from Frob Blocks214382 -Node: lrecords215986 -Node: Low-level allocation228212 -Node: Cons232319 -Node: Vector233045 -Node: Bit Vector233622 -Node: Symbol234115 -Node: Marker234469 -Node: String235024 -Node: Compiled Function238637 -Node: Dumping238806 -Node: Overview241027 -Node: Data descriptions241581 -Node: Dumping phase243586 -Node: Object inventory243989 -Node: Address allocation246903 -Node: The header248292 -Node: Data dumping248737 -Node: Pointers dumping249398 -Node: Reloading phase250788 -Node: Remaining issues252342 -Node: Events and the Event Loop253303 -Node: Introduction to Events253753 -Node: Main Loop255668 -Node: Specifics of the Event Gathering Mechanism259243 -Node: Specifics About the Emacs Event271696 -Node: The Event Stream Callback Routines271951 -Node: Other Event Loop Functions272196 -Node: Converting Events273336 -Node: Dispatching Events; The Command Builder273945 -Node: Evaluation; Stack Frames; Bindings274180 -Node: Evaluation274522 -Node: Dynamic Binding; The specbinding Stack; Unwind-Protects281034 -Node: Simple Special Forms283418 -Node: Catch and Throw284201 -Node: Symbols and Variables286776 -Node: Introduction to Symbols287040 -Node: Obarrays288078 -Node: Symbol Values291611 -Node: Buffers and Textual Representation293899 -Node: Introduction to Buffers294557 -Node: The Text in a Buffer297220 -Node: Buffer Lists304370 -Node: Markers and Extents306321 -Node: Bufbytes and Emchars308586 -Node: The Buffer Object308801 -Node: MULE Character Sets and Encodings312281 -Node: Character Sets313343 -Node: Encodings316786 -Node: Japanese EUC (Extended Unix Code)317853 -Node: JIS7318667 -Node: Internal Mule Encodings320017 -Node: Internal String Encoding321847 -Node: Internal Character Encoding323960 -Node: CCL325684 -Node: The Lisp Reader and Compiler332437 -Node: Lstreams332650 -Node: Creating an Lstream333681 -Node: Lstream Types334891 -Node: Lstream Functions335143 -Node: Lstream Methods338709 -Node: Consoles; Devices; Frames; Windows341851 -Node: Introduction to Consoles; Devices; Frames; Windows342166 -Node: Point344656 -Node: Window Hierarchy345935 -Node: The Window Object350387 -Node: The Redisplay Mechanism353824 -Node: Critical Redisplay Sections354616 -Node: Line Start Cache355571 -Node: Redisplay Piece by Piece358807 -Node: Extents360844 -Node: Introduction to Extents361378 -Node: Extent Ordering362504 -Node: Format of the Extent Info363745 -Node: Zero-Length Extents365632 -Node: Mathematics of Extent Ordering367032 -Node: Extent Fragments371789 -Node: Faces372875 -Node: Glyphs372991 -Node: Specifiers379624 -Node: Menus379753 -Node: Subprocesses382011 -Node: Interface to the X Window System383997 -Node: Lucid Widget Library384278 -Node: Generic Widget Interface385569 -Node: Scrollbars389128 -Node: Menubars389271 -Node: Checkboxes and Radio Buttons389414 -Node: Progress Bars389600 -Node: Tab Controls389760 -Node: Index389881 +Node: Top1789 +Node: A History of Emacs6369 +Node: Through Version 187894 +Node: Lucid Emacs11315 +Node: GNU Emacs 1914333 +Node: GNU Emacs 2016516 +Node: XEmacs16943 +Node: XEmacs From the Outside20122 +Node: The Lisp Language21890 +Node: XEmacs From the Perspective of Building31435 +Node: XEmacs From the Inside37560 +Node: The XEmacs Object System (Abstractly Speaking)45943 +Node: How Lisp Objects Are Represented in C60031 +Node: Rules When Writing New C Code68593 +Node: General Coding Rules69397 +Node: Writing Lisp Primitives74557 +Node: Adding Global Lisp Variables85727 +Node: Coding for Mule89365 +Node: Character-Related Data Types90344 +Node: Working With Character and Byte Positions93017 +Node: Conversion to and from External Data96767 +Node: General Guidelines for Writing Mule-Aware Code101648 +Node: An Example of Mule-Aware Code103679 +Node: Techniques for XEmacs Developers105666 +Node: A Summary of the Various XEmacs Modules109437 +Node: Low-Level Modules110257 +Node: Basic Lisp Modules117779 +Node: Modules for Standard Editing Operations126103 +Node: Editor-Level Control Flow Modules131991 +Node: Modules for the Basic Displayable Lisp Objects135438 +Node: Modules for other Display-Related Lisp Objects137960 +Node: Modules for the Redisplay Mechanism139038 +Node: Modules for Interfacing with the File System141389 +Node: Modules for Other Aspects of the Lisp Interpreter and Object System145087 +Node: Modules for Interfacing with the Operating System150541 +Node: Modules for Interfacing with X Windows158202 +Node: Modules for Internationalization161638 +Node: Allocation of Objects in XEmacs Lisp164275 +Node: Introduction to Allocation164829 +Node: Garbage Collection170292 +Node: GCPROing173245 +Node: Garbage Collection - Step by Step180056 +Node: Invocation180448 +Node: garbage_collect_1183420 +Node: mark_object192900 +Node: gc_sweep194712 +Node: sweep_lcrecords_1199775 +Node: compact_string_chars200770 +Node: sweep_strings202950 +Node: sweep_bit_vectors_1203915 +Node: Integers and Characters204591 +Node: Allocation from Frob Blocks205343 +Node: lrecords206947 +Node: Low-level allocation219409 +Node: Pure Space223577 +Node: Cons223752 +Node: Vector224468 +Node: Bit Vector225045 +Node: Symbol225538 +Node: Marker226107 +Node: String226662 +Node: Compiled Function230277 +Node: Events and the Event Loop230446 +Node: Introduction to Events230925 +Node: Main Loop232841 +Node: Specifics of the Event Gathering Mechanism236417 +Node: Specifics About the Emacs Event248870 +Node: The Event Stream Callback Routines249125 +Node: Other Event Loop Functions249370 +Node: Converting Events250510 +Node: Dispatching Events; The Command Builder251119 +Node: Evaluation; Stack Frames; Bindings251354 +Node: Evaluation251696 +Node: Dynamic Binding; The specbinding Stack; Unwind-Protects258236 +Node: Simple Special Forms260620 +Node: Catch and Throw261402 +Node: Symbols and Variables263977 +Node: Introduction to Symbols264241 +Node: Obarrays265279 +Node: Symbol Values268812 +Node: Buffers and Textual Representation271100 +Node: Introduction to Buffers271758 +Node: The Text in a Buffer274421 +Node: Buffer Lists281571 +Node: Markers and Extents283522 +Node: Bufbytes and Emchars285787 +Node: The Buffer Object286002 +Node: MULE Character Sets and Encodings289482 +Node: Character Sets290544 +Node: Encodings293987 +Node: Japanese EUC (Extended Unix Code)295054 +Node: JIS7295868 +Node: Internal Mule Encodings297218 +Node: Internal String Encoding299048 +Node: Internal Character Encoding301161 +Node: CCL302885 +Node: The Lisp Reader and Compiler309637 +Node: Lstreams309850 +Node: Creating an Lstream310881 +Node: Lstream Types312091 +Node: Lstream Functions312343 +Node: Lstream Methods315865 +Node: Consoles; Devices; Frames; Windows318994 +Node: Introduction to Consoles; Devices; Frames; Windows319309 +Node: Point321801 +Node: Window Hierarchy323080 +Node: The Window Object327530 +Node: The Redisplay Mechanism330967 +Node: Critical Redisplay Sections331759 +Node: Line Start Cache332714 +Node: Redisplay Piece by Piece335951 +Node: Extents337987 +Node: Introduction to Extents338525 +Node: Extent Ordering339651 +Node: Format of the Extent Info340892 +Node: Zero-Length Extents342780 +Node: Mathematics of Extent Ordering344178 +Node: Extent Fragments348935 +Node: Faces350022 +Node: Glyphs350138 +Node: Specifiers353156 +Node: Menus353285 +Node: Subprocesses355543 +Node: Interface to X Windows357519 +Node: Index357690  End Tag Table diff --git a/info/internals.info-1 b/info/internals.info-1 index 7a33f6b..c43d904 100644 --- a/info/internals.info-1 +++ b/info/internals.info-1 @@ -1,9 +1,9 @@ -This is ../info/internals.info, produced by makeinfo version 4.0 from -internals/internals.texi. +This is Info file ../../info/internals.info, produced by Makeinfo +version 1.68 from the input file internals.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY -* Internals: (internals). XEmacs Internals Manual. +* Internals: (internals). XEmacs Internals Manual. END-INFO-DIR-ENTRY Copyright (C) 1992 - 1996 Ben Wing. Copyright (C) 1996, 1997 Sun @@ -40,8 +40,7 @@ Foundation instead of in the original English.  File: internals.info, Node: Top, Next: A History of Emacs, Prev: (dir), Up: (dir) - This Info file contains v1.4 of the XEmacs Internals Manual, March -2001. + This Info file contains v1.0 of the XEmacs Internals Manual. * Menu: @@ -55,7 +54,6 @@ File: internals.info, Node: Top, Next: A History of Emacs, Prev: (dir), Up: * 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:: @@ -71,18 +69,20 @@ File: internals.info, Node: Top, Next: A History of Emacs, Prev: (dir), Up: * Specifiers:: * Menus:: * Subprocesses:: -* Interface to the X Window System:: -* Index:: +* Interface to X Windows:: +* Index:: Index including concepts, functions, variables, + and other terms. + -- The Detailed Node Listing -- ---- 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 @@ -90,17 +90,8 @@ Rules When Writing New C Code * 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:: @@ -126,6 +117,7 @@ Allocation of Objects in XEmacs Lisp * Allocation from Frob Blocks:: * lrecords:: * Low-level allocation:: +* Pure Space:: * Cons:: * Vector:: * Bit Vector:: @@ -134,32 +126,6 @@ Allocation of Objects in XEmacs Lisp * 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:: @@ -198,7 +164,6 @@ MULE Character Sets and Encodings * Character Sets:: * Encodings:: * Internal Mule Encodings:: -* CCL:: Encodings @@ -210,25 +175,20 @@ Internal Mule Encodings * Internal String Encoding:: * Internal Character Encoding:: -Lstreams +The Lisp Reader and Compiler -* 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. +Lstreams 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 @@ -236,9 +196,21 @@ Extents * Extent Ordering:: How extents are ordered internally. * Format of the Extent Info:: The extent information in a buffer or string. * Zero-Length Extents:: A weird special case. -* Mathematics of Extent Ordering:: A rigorous foundation. +* Mathematics of Extent Ordering:: A rigorous foundation. * Extent Fragments:: Cached information useful for redisplay. +Faces + +Glyphs + +Specifiers + +Menus + +Subprocesses + +Interface to X Windows +  File: internals.info, Node: A History of Emacs, Next: XEmacs From the Outside, Prev: Top, Up: Top @@ -414,7 +386,7 @@ release their own version of Emacs, which became Lucid Emacs 19.0. Sexton, and Eric Benson, and the work was later taken over by Jamie Zawinski, who became "Mr. Lucid Emacs" for many releases. - A time line for Lucid Emacs is + A time line for Lucid Emacs/XEmacs is * version 19.0 shipped with Energize 1.0, April 1992. @@ -459,41 +431,7 @@ Zawinski, who became "Mr. Lucid Emacs" for many releases. * 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. - - * version 21.1.2 released May 14, 1999. (The version naming scheme - was changed at this point: [a] the second version number is odd - for stable versions, even for beta versions; [b] a third version - number is added, replacing the "beta xxx" ending for beta versions - and allowing for periodic maintenance releases for stable - versions. Therefore, 21.0 was never "officially" released; - similarly for 21.2, etc.) - - * version 21.1.3 released June 26, 1999. - - * version 21.1.4 released July 8, 1999. - - * version 21.1.6 released August 14, 1999. (There was no 21.1.5.) - - * version 21.1.7 released September 26, 1999. - - * version 21.1.8 released November 2, 1999. - - * version 21.1.9 released February 13, 2000. - - * version 21.1.10 released May 7, 2000. - - * version 21.1.10a released June 24, 2000. - - * version 21.1.11 released July 18, 2000. - - * version 21.1.12 released August 5, 2000. - - * version 21.1.13 released January 7, 2001. - - * version 21.1.14 released January 27, 2001. + November 30, 1997. version 20.4 released February 28, 1998.  File: internals.info, Node: GNU Emacs 19, Next: GNU Emacs 20, Prev: Lucid Emacs, Up: A History of Emacs @@ -643,155 +581,6 @@ have consistently failed. A more detailed history is contained in the XEmacs About page. - A time line for XEmacs is - - * 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. - - * version 21.0.60 released December 10, 1998. (The version naming - scheme was changed at this point: [a] the second version number is - odd for stable versions, even for beta versions; [b] a third - version number is added, replacing the "beta xxx" ending for beta - versions and allowing for periodic maintenance releases for stable - versions. Therefore, 21.0 was never "officially" released; - similarly for 21.2, etc.) - - * version 21.0.61 released January 4, 1999. - - * version 21.0.63 released February 3, 1999. - - * version 21.0.64 released March 1, 1999. - - * version 21.0.65 released March 5, 1999. - - * version 21.0.66 released March 12, 1999. - - * version 21.0.67 released March 25, 1999. - - * version 21.1.2 released May 14, 1999. (This is the followup to - 21.0.67. The second version number was bumped to indicate the - beginning of the "stable" series.) - - * version 21.1.3 released June 26, 1999. - - * version 21.1.4 released July 8, 1999. - - * version 21.1.6 released August 14, 1999. (There was no 21.1.5.) - - * version 21.1.7 released September 26, 1999. - - * version 21.1.8 released November 2, 1999. - - * version 21.1.9 released February 13, 2000. - - * version 21.1.10 released May 7, 2000. - - * version 21.1.10a released June 24, 2000. - - * version 21.1.11 released July 18, 2000. - - * version 21.1.12 released August 5, 2000. - - * version 21.1.13 released January 7, 2001. - - * version 21.1.14 released January 27, 2001. - - * version 21.2.9 released February 3, 1999. - - * version 21.2.10 released February 5, 1999. - - * version 21.2.11 released March 1, 1999. - - * version 21.2.12 released March 5, 1999. - - * version 21.2.13 released March 12, 1999. - - * version 21.2.14 released May 14, 1999. - - * version 21.2.15 released June 4, 1999. - - * version 21.2.16 released June 11, 1999. - - * version 21.2.17 released June 22, 1999. - - * version 21.2.18 released July 14, 1999. - - * version 21.2.19 released July 30, 1999. - - * version 21.2.20 released November 10, 1999. - - * version 21.2.21 released November 28, 1999. - - * version 21.2.22 released November 29, 1999. - - * version 21.2.23 released December 7, 1999. - - * version 21.2.24 released December 14, 1999. - - * version 21.2.25 released December 24, 1999. - - * version 21.2.26 released December 31, 1999. - - * version 21.2.27 released January 18, 2000. - - * version 21.2.28 released February 7, 2000. - - * version 21.2.29 released February 16, 2000. - - * version 21.2.30 released February 21, 2000. - - * version 21.2.31 released February 23, 2000. - - * version 21.2.32 released March 20, 2000. - - * version 21.2.33 released May 1, 2000. - - * version 21.2.34 released May 28, 2000. - - * version 21.2.35 released July 19, 2000. - - * version 21.2.36 released October 4, 2000. - - * version 21.2.37 released November 14, 2000. - - * version 21.2.38 released December 5, 2000. - - * version 21.2.39 released December 31, 2000. - - * version 21.2.40 released January 8, 2001. - - * version 21.2.41 released January 17, 2001. - - * version 21.2.42 released January 20, 2001. - - * version 21.2.43 released January 26, 2001. - - * version 21.2.44 released February 8, 2001. - - * version 21.2.45 released February 23, 2001. - - * version 21.2.46 released March 21, 2001. -  File: internals.info, Node: XEmacs From the Outside, Next: The Lisp Language, Prev: A History of Emacs, Up: Top @@ -806,8 +595,8 @@ Some of these objects (in particular windows and frames) have displayable representations, and XEmacs provides a function `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 "read-eval-print" loop--i.e. "read some Lisp code, execute it, and -print the results". XEmacs has a similar loop: +in a "read-eval-print" loop - i.e. "read some Lisp code, execute it, +and print the results". XEmacs has a similar loop: * read an event @@ -950,7 +739,7 @@ between C and Lisp: installed by the top-level event loop, is executed; this prints out the error and continues.) Routines can also specify cleanup code (called an "unwind-protect") that will be called when control - exits from a block of code, no matter how that exit occurs--i.e. + exits from a block of code, no matter how that exit occurs - i.e. even if a function deeply nested below it causes a non-local exit back to the top level. @@ -964,8 +753,8 @@ between C and Lisp: "see" the local variable 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 "lexically + still declare dynamically scoped variables if you want to - they + are sometimes useful - but variables by default are "lexically scoped" as in C.) For those familiar with Lisp, Emacs Lisp is modelled after MacLisp, @@ -1007,13 +796,13 @@ different from C): 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, 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 for infrastructure and industrial strength applications. If -I had my way, XEmacs would be friendly towards the Python, Scheme, C++, -ML, etc... communities. But there are serious technical difficulties to +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 +for infrastructure and industrial strength applications. If I had my +way, XEmacs would be friendly towards the Python, Scheme, C++, ML, +etc... communities. But there are serious technical difficulties to achieving that goal. The word "application" in the previous paragraph was used @@ -1097,7 +886,7 @@ for easy upgrading of parts of a system without upgrading the rest. It would be impossible to pre-determine and pre-specify the information for all possible configurations. - In fact, the `s/' and `m/' files are basically _evil_, since they + In fact, the `s/' and `m/' files are basically *evil*, since they contain unmaintainable platform-specific hard-coded information. XEmacs has been moving in the direction of having all system-specific information be determined dynamically by `configure'. Perhaps someday @@ -1108,7 +897,7 @@ we can `rm -rf src/s src/m'. features of your system) from template files. You then run `make', which compiles the auxiliary code and programs in `lib-src/' and `lwlib/' and the main XEmacs executable in `src/'. The result of -compiling and linking is an executable called `temacs', which is _not_ +compiling and linking is an executable called `temacs', which is *not* the final XEmacs executable. `temacs' by itself is not intended to function as an editor or even display any windows on the screen, and if you simply run it, it will exit immediately. The `Makefile' runs @@ -1253,7 +1042,7 @@ function by setting its name as the value of the Lisp variable When the Lisp initialization code is done, the C code enters the event loop, and stays there for the duration of the XEmacs process. -The code for the event loop is contained in `cmdloop.c', and is called +The code for the event loop is contained in `keyboard.c', and is called `Fcommand_loop_1()'. Note that this event loop could very well be written in Lisp, and in fact a Lisp version exists; but apparently, doing this makes XEmacs run noticeably slower. diff --git a/info/internals.info-2 b/info/internals.info-2 index 805e7ef..8d78cb4 100644 --- a/info/internals.info-2 +++ b/info/internals.info-2 @@ -1,9 +1,9 @@ -This is ../info/internals.info, produced by makeinfo version 4.0 from -internals/internals.texi. +This is Info file ../../info/internals.info, produced by Makeinfo +version 1.68 from the input file internals.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY -* Internals: (internals). XEmacs Internals Manual. +* Internals: (internals). XEmacs Internals Manual. END-INFO-DIR-ENTRY Copyright (C) 1992 - 1996 Ben Wing. Copyright (C) 1996, 1997 Sun @@ -71,18 +71,18 @@ internal operations.) 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, a Japanese Kanji character might be - encoded as `^[$(B#&^[(B' using the 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 primitives confuse chars and integers. The worst culprit is - `eq', which makes a special exception and considers a char to be - `eq' to its integer equivalent, even though in no other case are - objects of two different types `eq'. The reason for this - monstrosity is compatibility with existing code; the separation of - char from integer came fairly recently.) + encoding of it - for example, a Japanese Kanji character might be + encoded as `^[$(B#&^[(B' using the 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 primitives + confuse chars and integers. The worst culprit is `eq', which + makes a special exception and considers a char to be `eq' to its + integer equivalent, even though in no other case are objects of two + different types `eq'. The reason for this monstrosity is + compatibility with existing code; the separation of char from + integer came fairly recently.) `symbol' An object that contains Lisp objects and is referred to by name; @@ -286,7 +286,7 @@ but detached extents (extents not referring to any text, as happens to some extents when the text they are referring to is deleted) are temporary. Note that some permanent objects, such as faces and coding systems, cannot be deleted. Note also that windows are unique in that -they can be _undeleted_ after having previously been deleted. (This +they can be *undeleted* after having previously been deleted. (This happens as a result of restoring a window configuration.) Note that many types of objects have a "read syntax", i.e. a way of @@ -405,16 +405,24 @@ representation stuffs a pointer together with a tag, as follows: [ 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 - - 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 + + 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 +`Vobarray', the C equivalent of `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 `Lisp_Object', but the actual C type used for the Lisp object can vary. It can be either a simple type @@ -425,27 +433,99 @@ because it ensures that the compiler will actually use a 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 +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 `USE_UNION_TYPE' which is defined via the `--use-union-type' option to `configure'. - Various macros are used to convert between Lisp_Objects and the -corresponding C type. Macros of the form `XINT()', `XCHAR()', -`XSTRING()', `XSYMBOL()', do any required bit shifting and/or masking -and cast it to the appropriate type. `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 `ERROR_CHECK_TYPECHECK' is defined, the converter -macros become more complicated--they check the tag bits and/or the type -field in the first four bytes of a record type to ensure that the + 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 "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 +`DATA_SEG_BITS' in the corresponding `m/' or `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 *(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 `Lisp_Object', +invented by Kyle Jones, that is used when the `--use-minimal-tagbits' +option to `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. + + [ 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 + + 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: + + 1. 31 bits can be used for Lisp Integers. + + 2. *Any* pointer can be represented directly, and no bit masking + operations are necessary. + + The disadvantages are: + + 1. 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. + + 2. 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. + + Various macros are used to construct Lisp objects and extract the +components. Macros of the form `XINT()', `XCHAR()', `XSTRING()', +`XSYMBOL()', etc. mask out the pointer/integer field and cast it to the +appropriate type. All of the macros that construct pointers will `OR' +with `DATA_SEG_BITS' if necessary. `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 +`EXPLICIT_SIGN_EXTEND'. + + Note that when `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. @@ -453,24 +533,22 @@ unpredictable (and sometimes not easily traceable) results. These macros are of the form `XSETTYPE (LVALUE, 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 `make_int()', which constructs and _returns_ an integer Lisp -object. Note that the `XSETTYPE()' macros are also affected by +structure (but GCC does). Granted, this sometimes isn't too convenient; +for the case of integers, at least, you can use the function +`make_int()', which constructs and *returns* an integer Lisp object. +Note that the `XSETTYPE()' macros are also affected by `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 *guaranteeing* that a -Lisp_Object is the correct type before using the `XTYPE' macros. This -is especially important in the case of lists. Use `XCAR' and `XCDR' if -a Lisp_Object is certainly a cons cell, else use `Fcar()' and `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 `assert()'s and "unreachable" `abort()'s liberally about the -source code. Where performance is an issue, use `type_checking_assert', -`bufpos_checking_assert', and `gc_checking_assert', which do nothing -unless the corresponding configure error checking flag was specified. +Lisp_Object is is the correct type before using the `XTYPE' macros. +This is especially important in the case of lists. Use `XCAR' and +`XCDR' if a Lisp_Object is certainly a cons cell, else use `Fcar()' and +`Fcdr()'. Trust other C code, but not Lisp code. On the other hand, +if XEmacs has an internal logic error, it's better to crash +immediately, so sprinkle "unreachable" `abort()'s liberally about the +source code.  File: internals.info, Node: Rules When Writing New C Code, Next: A Summary of the Various XEmacs Modules, Prev: How Lisp Objects Are Represented in C, Up: Top @@ -489,9 +567,7 @@ situations, often in code far away from where the actual breakage is. * General Coding Rules:: * Writing Lisp Primitives:: -* Writing Good Comments:: * Adding Global Lisp Variables:: -* Proper Use of Unsigned Types:: * Coding for Mule:: * Techniques for XEmacs Developers:: @@ -509,38 +585,27 @@ been found by compiling with C++. The ability to use both C and C++ tools means that a greater variety of development tools are available to the developer. - Every module includes `' (angle brackets so that -`--srcdir' works correctly; `config.h' may or may not be in the same -directory as the C sources) and `lisp.h'. `config.h' must always be -included before any other header files (including system header files) -to ensure that certain tricks played by various `s/' and `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 `./configure' and another build in another directory -using `../work/configure'. There will be two different `config.h' -files. Which one will be used if you `#include "config.h"'? - Almost every module contains a `syms_of_*()' function and a `vars_of_*()' function. The former declares any Lisp primitives you have defined and defines any symbols you will be using. The latter declares any global Lisp variables you have added and initializes global -C variables in the module. *Important*: There are stringent -requirements on exactly what can go into these functions. See the -comment in `emacs.c'. The reason for this is to avoid obscure unwanted -interactions during initialization. If you don't follow these rules, -you'll be sorry! If you want to do anything that isn't allowed, create -a `complex_vars_of_*()' function for it. Doing this is tricky, though: -you have to make sure your function is called at the right time so that +C variables in the module. For each such function, declare it in +`symsinit.h' and make sure it's called in the appropriate place in +`emacs.c'. *Important*: There are stringent requirements on exactly +what can go into these functions. See the comment in `emacs.c'. The +reason for this is to avoid obscure unwanted interactions during +initialization. If you don't follow these rules, you'll be sorry! If +you want to do anything that isn't allowed, create a +`complex_vars_of_*()' function for it. Doing this is tricky, though: +You have to make sure your function is called at the right time so that all the initialization dependencies work out. - Declare each function of these kinds in `symsinit.h'. Make sure -it's called in the appropriate place in `emacs.c'. You never need to -include `symsinit.h' directly, because it is included by `lisp.h'. + Every module includes `' (angle brackets so that +`--srcdir' works correctly; `config.h' may or may not be in the same +directory as the C sources) and `lisp.h'. `config.h' must always be +included before any other header files (including system header files) +to ensure that certain tricks played by various `s/' and `m/' files +work out correctly. *All global and static variables that are to be modifiable must be declared uninitialized.* This means that you may not use the "declare @@ -550,7 +615,8 @@ dumping process: If possible, the initialized data 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 `temacs' phase. +data as possible into initialized variables (in particular, into what's +called the "pure space" - see below) during the `temacs' phase. *Please note:* This kludge only works on a few systems nowadays, and is rapidly becoming irrelevant because most modern operating systems @@ -579,10 +645,10 @@ them. This awful kludge has been removed in XEmacs because The C source code makes heavy use of C preprocessor macros. One popular macro style is: - #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) The `do {...} while (0)' is a standard trick to allow FOO to have @@ -594,9 +660,9 @@ copying a supplied argument into a local variable, so that Lisp lists are popular data structures in the C code as well as in Elisp. There are two sets of macros that iterate over lists. `EXTERNAL_LIST_LOOP_N' should be used when the list has been supplied -by the user, and cannot be trusted to be acyclic and `nil'-terminated. -A `malformed-list' or `circular-list' error will be generated if the -list being iterated over is not entirely kosher. `LIST_LOOP_N', on the +by the user, and cannot be trusted to be acyclic and nil-terminated. A +`malformed-list' or `circular-list' error will be generated if the list +being iterated over is not entirely kosher. `LIST_LOOP_N', on the other hand, is faster and less safe, and can be used only on trusted lists. @@ -607,7 +673,7 @@ macros `EXTERNAL_LIST_LOOP_DELETE_IF' and `LIST_LOOP_DELETE_IF' delete elements from a lisp list satisfying some predicate.  -File: internals.info, Node: Writing Lisp Primitives, Next: Writing Good Comments, Prev: General Coding Rules, Up: Rules When Writing New C Code +File: internals.info, Node: Writing Lisp Primitives, Next: Adding Global Lisp Variables, Prev: General Coding Rules, Up: Rules When Writing New C Code Writing Lisp Primitives ======================= @@ -804,7 +870,7 @@ call the C function. Defining the C function is not enough to make a Lisp primitive available; you must also create the Lisp symbol for the primitive (the -symbol is "interned"; *note Obarrays::) and store a suitable subr +symbol is "interned"; *note Obarrays::.) and store a suitable subr object in its function cell. (If you don't do this, the primitive won't be seen by Lisp code.) The code looks like this: @@ -837,70 +903,7 @@ arguments. They work by calling `Ffuncall'. contains the definitions for important macros and functions.  -File: internals.info, Node: Writing Good Comments, Next: Adding Global Lisp Variables, Prev: Writing Lisp Primitives, Up: Rules When Writing New C Code - -Writing Good Comments -===================== - - Comments are a lifeline for programmers trying to understand tricky -code. In general, the less obvious it is what you are doing, the more -you need a comment, and the more detailed it needs to be. You should -always be on guard when you're writing code for stuff that's tricky, and -should constantly be putting yourself in someone else's shoes and asking -if that person could figure out without much difficulty what's going -on. (Assume they are a competent programmer who understands the -essentials of how the XEmacs code is structured but doesn't know much -about the module you're working on or any algorithms you're using.) If -you're not sure whether they would be able to, add a comment. Always -err on the side of more comments, rather than less. - - Generally, when making comments, there is no need to attribute them -with your name or initials. This especially goes for small, -easy-to-understand, non-opinionated ones. Also, comments indicating -where, when, and by whom a file was changed are _strongly_ discouraged, -and in general will be removed as they are discovered. This is exactly -what `ChangeLogs' are there for. However, it can occasionally be -useful to mark exactly where (but not when or by whom) changes are -made, particularly when making small changes to a file imported from -elsewhere. These marks help when later on a newer version of the file -is imported and the changes need to be merged. (If everything were -always kept in CVS, there would be no need for this. But in practice, -this often doesn't happen, or the CVS repository is later on lost or -unavailable to the person doing the update.) - - When putting in an explicit opinion in a comment, you should -_always_ attribute it with your name, and optionally the date. This -also goes for long, complex comments explaining in detail the workings -of something - by putting your name there, you make it possible for -someone who has questions about how that thing works to determine who -wrote the comment so they can write to them. Preferably, use your -actual name and not your initials, unless your initials are generally -recognized (e.g. `jwz'). You can use only your first name if it's -obvious who you are; otherwise, give first and last name. If you're -not a regular contributor, you might consider putting your email -address in - it may be in the ChangeLog, but after awhile ChangeLogs -have a tendency of disappearing or getting muddled. (E.g. your comment -may get copied somewhere else or even into another program, and -tracking down the proper ChangeLog may be very difficult.) - - If you come across an opinion that is not or no longer valid, or you -come across any comment that no longer applies but you want to keep it -around, enclose it in `[[ ' and ` ]]' marks and add a comment -afterwards explaining why the preceding comment is no longer valid. Put -your name on this comment, as explained above. - - Just as comments are a lifeline to programmers, incorrect comments -are death. If you come across an incorrect comment, *immediately* -correct it or flag it as incorrect, as described in the previous -paragraph. Whenever you work on a section of code, _always_ make sure -to update any comments to be correct - or, at the very least, flag them -as incorrect. - - To indicate a "todo" or other problem, use four pound signs - i.e. -`####'. - - -File: internals.info, Node: Adding Global Lisp Variables, Next: Proper Use of Unsigned Types, Prev: Writing Good Comments, Up: Rules When Writing New C Code +File: internals.info, Node: Adding Global Lisp Variables, Next: Coding for Mule, Prev: Writing Lisp Primitives, Up: Rules When Writing New C Code Adding Global Lisp Variables ============================ @@ -953,7 +956,7 @@ variable gets changed. Whether or not you `DEFVAR_LISP()' a variable, you need to initialize it in the `vars_of_*()' function; otherwise it will end up -as all zeroes, which is the integer 0 (_not_ `nil'), and this is +as all zeroes, which is the integer 0 (*not* `nil'), and this is probably not what you want. Also, if the variable is not `DEFVAR_LISP()'ed, *you must call* `staticpro()' on the C variable in the `vars_of_*()' function. Otherwise, the garbage-collection @@ -963,36 +966,7 @@ and you will be the one who's unhappy when you can't figure out how your variable got overwritten.  -File: internals.info, Node: Proper Use of Unsigned Types, Next: Coding for Mule, Prev: Adding Global Lisp Variables, Up: Rules When Writing New C Code - -Proper Use of Unsigned Types -============================ - - Avoid using `unsigned int' and `unsigned long' whenever possible. -Unsigned types are viral - any arithmetic or comparisons involving -mixed signed and unsigned types are automatically converted to -unsigned, which is almost certainly not what you want. Many subtle and -hard-to-find bugs are created by careless use of unsigned types. In -general, you should almost _never_ use an unsigned type to hold a -regular quantity of any sort. The only exceptions are - - 1. When there's a reasonable possibility you will actually need all - 32 or 64 bits to store the quantity. - - 2. When calling existing API's that require unsigned types. In this - case, you should still do all manipulation using signed types, and - do the conversion at the very threshold of the API call. - - 3. In existing code that you don't want to modify because you don't - maintain it. - - 4. In bit-field structures. - - Other reasonable uses of `unsigned int' and `unsigned long' are -representing non-quantities - e.g. bit-oriented flags and such. - - -File: internals.info, Node: Coding for Mule, Next: Techniques for XEmacs Developers, Prev: Proper Use of Unsigned Types, Up: Rules When Writing New C Code +File: internals.info, Node: Coding for Mule, Next: Techniques for XEmacs Developers, Prev: Adding Global Lisp Variables, Up: Rules When Writing New C Code Coding for Mule =============== @@ -1043,32 +1017,27 @@ glance at the declaration can tell the intended use of the variable. The data representing the text in a buffer or string is logically a set of `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 + 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. `Bufbyte' (in fact `unsigned char') is the basic unit of XEmacs - internal buffers and strings format. A `Bufbyte *' is the type - that points at text encoded in the variable-width internal - encoding. + internal buffers and strings format. One character can correspond to one or more `Bufbyte's. In the - current Mule implementation, an ASCII character is represented by - the same `Bufbyte', and other characters are represented by a - sequence of two or more `Bufbyte's. + current implementation, an ASCII character is represented by the + same `Bufbyte', and extended characters are represented by a + sequence of `Bufbyte's. - Without Mule support, there are exactly 256 characters, implicitly - Latin-1, and each character is represented using one `Bufbyte', and - there is a one-to-one correspondence between `Bufbyte's and - `Emchar's. + Without Mule support, a `Bufbyte' is equivalent to an `Emchar'. `Bufpos' `Charcount' A `Bufpos' represents a character position in a buffer or string. A `Charcount' represents a number (count) of characters. Logically, subtracting two `Bufpos' values yields a `Charcount' - value. Although all of these are `typedef'ed to `EMACS_INT', we - use them in preference to `EMACS_INT' to make it clear what sort - of position is being used. + value. Although all of these are `typedef'ed to `int', we use + them in preference to `int' to make it clear what sort of position + is being used. `Bufpos' and `Charcount' values are the only ones that are ever visible to Lisp. @@ -1076,9 +1045,9 @@ glance at the declaration can tell the intended use of the variable. `Bytind' `Bytecount' A `Bytind' represents a byte position in a buffer or string. A - `Bytecount' represents the distance between two positions, in - bytes. The relationship between `Bytind' and `Bytecount' is the - same as the relationship between `Bufpos' and `Charcount'. + `Bytecount' represents the distance between two positions in bytes. + The relationship between `Bytind' and `Bytecount' is the same as + the relationship between `Bufpos' and `Charcount'. `Extbyte' `Extcount' diff --git a/info/internals.info-3 b/info/internals.info-3 new file mode 100644 index 0000000..b9844e5 --- /dev/null +++ b/info/internals.info-3 @@ -0,0 +1,1190 @@ +This is Info file ../../info/internals.info, produced by Makeinfo +version 1.68 from the input file internals.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Internals: (internals). XEmacs Internals Manual. +END-INFO-DIR-ENTRY + + Copyright (C) 1992 - 1996 Ben Wing. Copyright (C) 1996, 1997 Sun +Microsystems. Copyright (C) 1994 - 1998 Free Software Foundation. +Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: internals.info, Node: Working With Character and Byte Positions, Next: Conversion to and from External Data, Prev: Character-Related Data Types, Up: Coding for Mule + +Working With Character and Byte Positions +----------------------------------------- + + Now that we have defined the basic character-related types, we can +look at the macros and functions designed for work with them and for +conversion between them. Most of these macros are defined in +`buffer.h', and we don't discuss all of them here, but only the most +important ones. Examining the existing code is the best way to learn +about them. + +`MAX_EMCHAR_LEN' + This preprocessor constant is the maximum number of buffer bytes + per Emacs character, i.e. the byte length of an `Emchar'. It is + useful when allocating temporary strings to keep a known number of + characters. For instance: + + { + Charcount cclen; + ... + { + /* Allocate place for CCLEN characters. */ + Bufbyte *buf = (Bufbyte *)alloca (cclen * MAX_EMCHAR_LEN); + ... + + If you followed the previous section, you can guess that, + logically, multiplying a `Charcount' value with `MAX_EMCHAR_LEN' + produces a `Bytecount' value. + + In the current Mule implementation, `MAX_EMCHAR_LEN' equals 4. + Without Mule, it is 1. + +`charptr_emchar' +`set_charptr_emchar' + The `charptr_emchar' macro takes a `Bufbyte' pointer and returns + the `Emchar' stored at that position. If it were a function, its + prototype would be: + + Emchar charptr_emchar (Bufbyte *p); + + `set_charptr_emchar' stores an `Emchar' to the specified byte + position. It returns the number of bytes stored: + + Bytecount set_charptr_emchar (Bufbyte *p, Emchar c); + + It is important to note that `set_charptr_emchar' is safe only for + appending a character at the end of a buffer, not for overwriting a + character in the middle. This is because the width of characters + varies, and `set_charptr_emchar' cannot resize the string if it + writes, say, a two-byte character where a single-byte character + used to reside. + + A typical use of `set_charptr_emchar' can be demonstrated by this + example, which copies characters from buffer BUF to a temporary + string of Bufbytes. + + { + Bufpos pos; + for (pos = beg; pos < end; pos++) + { + Emchar c = BUF_FETCH_CHAR (buf, pos); + p += set_charptr_emchar (buf, c); + } + } + + Note how `set_charptr_emchar' is used to store the `Emchar' and + increment the counter, at the same time. + +`INC_CHARPTR' +`DEC_CHARPTR' + These two macros increment and decrement a `Bufbyte' pointer, + respectively. They will adjust the pointer by the appropriate + number of bytes according to the byte length of the character + stored there. Both macros assume that the memory address is + located at the beginning of a valid character. + + Without Mule support, `INC_CHARPTR (p)' and `DEC_CHARPTR (p)' + simply expand to `p++' and `p--', respectively. + +`bytecount_to_charcount' + Given a pointer to a text string and a length in bytes, return the + equivalent length in characters. + + Charcount bytecount_to_charcount (Bufbyte *p, Bytecount bc); + +`charcount_to_bytecount' + Given a pointer to a text string and a length in characters, + return the equivalent length in bytes. + + Bytecount charcount_to_bytecount (Bufbyte *p, Charcount cc); + +`charptr_n_addr' + Return a pointer to the beginning of the character offset CC (in + characters) from P. + + Bufbyte *charptr_n_addr (Bufbyte *p, Charcount cc); + + +File: internals.info, Node: Conversion to and from External Data, Next: General Guidelines for Writing Mule-Aware Code, Prev: Working With Character and Byte Positions, Up: Coding for Mule + +Conversion to and from External Data +------------------------------------ + + When an external function, such as a C library function, returns a +`char' pointer, you should almost never treat it as `Bufbyte'. This is +because these returned strings may contain 8bit characters which can be +misinterpreted by XEmacs, and cause a crash. Likewise, when exporting +a piece of internal text to the outside world, you should always +convert it to an appropriate external encoding, lest the internal stuff +(such as the infamous \201 characters) leak out. + + The interface to conversion between the internal and external +representations of text are the numerous conversion macros defined in +`buffer.h'. Before looking at them, we'll look at the external formats +supported by these macros. + + Currently meaningful formats are `FORMAT_BINARY', `FORMAT_FILENAME', +`FORMAT_OS', and `FORMAT_CTEXT'. Here is a description of these. + +`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 `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_FILENAME' + 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_OS' + 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_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. + + The macros to convert between these formats and the internal format, +and vice versa, follow. + +`GET_CHARPTR_INT_DATA_ALLOCA' +`GET_CHARPTR_EXT_DATA_ALLOCA' + These two are the most basic conversion macros. + `GET_CHARPTR_INT_DATA_ALLOCA' converts external data to internal + format, and `GET_CHARPTR_EXT_DATA_ALLOCA' converts the other way + around. The arguments each of these receives are PTR (pointer to + the text in external format), LEN (length of texts in bytes), FMT + (format of the external text), PTR_OUT (lvalue to which new text + should be copied), and 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 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 `INT' in their name convert text to + internal Emacs representation, whereas the `EXT' macros convert to + external representation. + +`GET_C_CHARPTR_INT_DATA_ALLOCA' +`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 LEN or LEN_OUT + parameters. + +`GET_STRING_EXT_DATA_ALLOCA' +`GET_C_STRING_EXT_DATA_ALLOCA' + These two macros convert a Lisp string into an external + representation. The difference between them is that + `GET_STRING_EXT_DATA_ALLOCA' stores its output to a generic + string, providing LEN_OUT, the length of the resulting external + string. On the other hand, `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. + +`GET_C_CHARPTR_EXT_BINARY_DATA_ALLOCA' +`GET_CHARPTR_EXT_BINARY_DATA_ALLOCA' +`GET_STRING_BINARY_DATA_ALLOCA' +`GET_C_STRING_BINARY_DATA_ALLOCA' +`GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA' +`...' + 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 `GET_STRING_...' and + `GET_C_STRING...' macros lack the `EXT' tag, because they only + make sense in that direction. + +`GET_C_CHARPTR_INT_BINARY_DATA_ALLOCA' +`GET_CHARPTR_INT_BINARY_DATA_ALLOCA' +`GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA' +`...' + 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. + + +File: internals.info, Node: General Guidelines for Writing Mule-Aware Code, Next: An Example of Mule-Aware Code, Prev: Conversion to and from External Data, Up: Coding for Mule + +General Guidelines for Writing Mule-Aware Code +---------------------------------------------- + + This section contains some general guidance on how to write +Mule-aware code, as well as some pitfalls you should avoid. + +*Never use `char' and `char *'.* + In XEmacs, the use of `char' and `char *' is almost always a + mistake. If you want to manipulate an Emacs character from "C", + use `Emchar'. If you want to examine a specific octet in the + internal format, use `Bufbyte'. If you want a Lisp-visible + character, use a `Lisp_Object' and `make_char'. If you want a + pointer to move through the internal text, use `Bufbyte *'. Also + note that you almost certainly do not need `Emchar *'. + +*Be careful not to confuse `Charcount', `Bytecount', and `Bufpos'.* + The whole point of using different types is to avoid confusion + about the use of certain variables. Lest this effect be + nullified, you need to be careful about using the right types. + +*Always convert external data* + It is extremely important to always convert external data, because + XEmacs can crash if unexpected 8bit sequences are copied to its + internal buffers literally. + + This means that when a system function, such as `readdir', returns + a string, you need to convert it using one of the conversion macros + described in the previous chapter, before passing it further to + Lisp. In the case of `readdir', you would use the + `GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA' macro. + + Also note that many internal functions, such as `make_string', + accept Bufbytes, which removes the need for them to convert the + data they receive. This increases efficiency because that way + external data needs to be decoded only once, when it is read. + After that, it is passed around in internal format. + + +File: internals.info, Node: An Example of Mule-Aware Code, Prev: General Guidelines for Writing Mule-Aware Code, Up: Coding for Mule + +An Example of Mule-Aware Code +----------------------------- + + As an example of Mule-aware code, we shall will analyze the `string' +function, which conses up a Lisp string from the character arguments it +receives. Here is the definition, pasted from `alloc.c': + + DEFUN ("string", Fstring, 0, MANY, 0, /* + Concatenate all the argument characters and make the result a string. + */ + (int nargs, Lisp_Object *args)) + { + Bufbyte *storage = alloca_array (Bufbyte, nargs * MAX_EMCHAR_LEN); + Bufbyte *p = storage; + + for (; nargs; nargs--, args++) + { + Lisp_Object lisp_char = *args; + CHECK_CHAR_COERCE_INT (lisp_char); + p += set_charptr_emchar (p, XCHAR (lisp_char)); + } + return make_string (storage, p - storage); + } + + Now we can analyze the source line by line. + + Obviously, string will be as long as there are arguments to the +function. This is why we allocate `MAX_EMCHAR_LEN' * NARGS bytes on +the stack, i.e. the worst-case number of bytes for NARGS `Emchar's to +fit in the string. + + Then, the loop checks that each element is a character, converting +integers in the process. Like many other functions in XEmacs, this +function silently accepts integers where characters are expected, for +historical and compatibility reasons. Unless you know what you are +doing, `CHECK_CHAR' will also suffice. `XCHAR (lisp_char)' extracts +the `Emchar' from the `Lisp_Object', and `set_charptr_emchar' stores it +to storage, increasing `p' in the process. + + Other instructive examples of correct coding under Mule can be found +all over the XEmacs code. For starters, I recommend +`Fnormalize_menu_item_name' in `menubar.c'. After you have understood +this section of the manual and studied the examples, you can proceed +writing new Mule-aware code. + + +File: internals.info, Node: Techniques for XEmacs Developers, Prev: Coding for Mule, Up: Rules When Writing New C Code + +Techniques for XEmacs Developers +================================ + + To make a quantified XEmacs, do: `make quantmacs'. + + You simply can't dump Quantified and Purified images. Run the image +like so: `quantmacs -batch -l loadup.el run-temacs 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 +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 +task. + + Also, if you're still willing to do some runs make sure you configure +with the `--quantify' flag. That will keep Quantify from starting to +record data until after the loadup is completed and will shut off +recording right before it shuts down (which generates enough bogus data +to throw most results off). It also enables three additional elisp +commands: `quantify-start-recording-data', +`quantify-stop-recording-data' and `quantify-clear-data'. + + If you want to make XEmacs faster, target your favorite slow +benchmark, run a profiler like Quantify, `gprof', or `tcov', and figure +out where the cycles are going. Specific projects: + + * Make the garbage collector faster. Figure out how to write an + incremental garbage collector. + + * Write a compiler that takes bytecode and spits out C code. + Unfortunately, you will then need a C compiler and a more fully + developed module system. + + * Speed up redisplay. + + * Speed up syntax highlighting. Maybe moving some of the syntax + highlighting capabilities into C would make a difference. + + * Implement tail recursion in Emacs Lisp (hard!). + + Unfortunately, Emacs Lisp is slow, and is going to stay slow. +Function calls in elisp are especially expensive. Iterating over a +long list is going to be 30 times faster implemented in C than in Elisp. + + To get started debugging XEmacs, take a look at the `gdbinit' and +`dbxrc' files in the `src' directory. *Note Q2.1.15 - How to Debug an +XEmacs problem with a debugger: (xemacs-faq)Q2.1.15 - How to Debug an +XEmacs problem with a debugger. + + After making source code changes, run `make check' to ensure that +you haven't introduced any regressions. If you're feeling ambitious, +you can try to improve the test suite in `tests/automated'. + + Here are things to know when you create a new source file: + + * All `.c' files should `#include ' first. Almost all + `.c' files should `#include "lisp.h"' second. + + * Generated header files should be included using the `#include + <...>' syntax, not the `#include "..."' syntax. The generated + headers are: + + `config.h puresize-adjust.h sheap-adjust.h paths.h Emacs.ad.h' + + The basic rule is that you should assume builds using `--srcdir' + and the `#include <...>' syntax needs to be used when the + to-be-included generated file is in a potentially different + directory *at compile time*. The non-obvious C rule is that + `#include "..."' means to search for the included file in the + same directory as the including file, *not* in the current + directory. + + * Header files should *not* include `' and `"lisp.h"'. It + is the responsibility of the `.c' files that use it to do so. + + * If the header uses `INLINE', either directly or through + `DECLARE_LRECORD', then it must be added to `inline.c''s includes. + + * Try compiling at least once with + + gcc --with-mule --with-union-type --error-checking=all + + * Did I mention that you should run the test suite? + make check + + +File: internals.info, Node: A Summary of the Various XEmacs Modules, Next: Allocation of Objects in XEmacs Lisp, Prev: Rules When Writing New C Code, Up: Top + +A Summary of the Various XEmacs Modules +*************************************** + + This is accurate as of XEmacs 20.0. + +* Menu: + +* Low-Level Modules:: +* Basic Lisp Modules:: +* Modules for Standard Editing Operations:: +* Editor-Level Control Flow Modules:: +* Modules for the Basic Displayable Lisp Objects:: +* Modules for other Display-Related Lisp Objects:: +* Modules for the Redisplay Mechanism:: +* Modules for Interfacing with the File System:: +* Modules for Other Aspects of the Lisp Interpreter and Object System:: +* Modules for Interfacing with the Operating System:: +* Modules for Interfacing with X Windows:: +* Modules for Internationalization:: + + +File: internals.info, Node: Low-Level Modules, Next: Basic Lisp Modules, Up: A Summary of the Various XEmacs Modules + +Low-Level Modules +================= + + config.h + + This is automatically generated from `config.h.in' based on the +results of configure tests and user-selected optional features and +contains preprocessor definitions specifying the nature of the +environment in which XEmacs is being compiled. + + paths.h + + This is automatically generated from `paths.h.in' based on supplied +configure values, and allows for non-standard installed configurations +of the XEmacs directories. It's currently broken, though. + + emacs.c + signal.c + + `emacs.c' contains `main()' and other code that performs the most +basic environment initializations and handles shutting down the XEmacs +process (this includes `kill-emacs', the normal way that XEmacs is +exited; `dump-emacs', which is used during the build process to write +out the XEmacs executable; `run-emacs-from-temacs', which can be used +to start XEmacs directly when temacs has finished loading all the Lisp +code; and emergency code to handle crashes [XEmacs tries to auto-save +all files before it crashes]). + + Low-level code that directly interacts with the Unix signal +mechanism, however, is in `signal.c'. Note that this code does not +handle system dependencies in interfacing to signals; that is handled +using the `syssignal.h' header file, described in section J below. + + unexaix.c + unexalpha.c + unexapollo.c + unexconvex.c + unexec.c + unexelf.c + unexelfsgi.c + unexencap.c + unexenix.c + unexfreebsd.c + unexfx2800.c + unexhp9k3.c + unexhp9k800.c + unexmips.c + unexnext.c + unexsol2.c + unexsunos4.c + + These modules contain code dumping out the XEmacs executable on +various different systems. (This process is highly machine-specific and +requires intimate knowledge of the executable format and the memory map +of the process.) Only one of these modules is actually used; this is +chosen by `configure'. + + crt0.c + lastfile.c + pre-crt0.c + + These modules are used in conjunction with the dump mechanism. On +some systems, an alternative version of the C startup code (the actual +code that receives control from the operating system when the process is +started, and which calls `main()') is required so that the dumping +process works properly; `crt0.c' provides this. + + `pre-crt0.c' and `lastfile.c' should be the very first and very last +file linked, respectively. (Actually, this is not really true. +`lastfile.c' should be after all Emacs modules whose initialized data +should be made constant, and before all other Emacs files and all +libraries. In particular, the allocation modules `gmalloc.c', +`alloca.c', etc. are normally placed past `lastfile.c', and all of the +files that implement Xt widget classes *must* be placed after +`lastfile.c' because they contain various structures that must be +statically initialized and into which Xt writes at various times.) +`pre-crt0.c' and `lastfile.c' contain exported symbols that are used to +determine the start and end of XEmacs' initialized data space when +dumping. + + alloca.c + free-hook.c + getpagesize.h + gmalloc.c + malloc.c + mem-limits.h + ralloc.c + vm-limit.c + + These handle basic C allocation of memory. `alloca.c' is an +emulation of the stack allocation function `alloca()' on machines that +lack this. (XEmacs makes extensive use of `alloca()' in its code.) + + `gmalloc.c' and `malloc.c' are two implementations of the standard C +functions `malloc()', `realloc()' and `free()'. They are often used in +place of the standard system-provided `malloc()' because they usually +provide a much faster implementation, at the expense of additional +memory use. `gmalloc.c' is a newer implementation that is much more +memory-efficient for large allocations than `malloc.c', and should +always be preferred if it works. (At one point, `gmalloc.c' didn't work +on some systems where `malloc.c' worked; but this should be fixed now.) + + `ralloc.c' is the "relocating allocator". It provides functions +similar to `malloc()', `realloc()' and `free()' that allocate memory +that can be dynamically relocated in memory. The advantage of this is +that allocated memory can be shuffled around to place all the free +memory at the end of the heap, and the heap can then be shrunk, +releasing the memory back to the operating system. The use of this can +be controlled with the configure option `--rel-alloc'; if enabled, +memory allocated for buffers will be relocatable, so that if a very +large file is visited and the buffer is later killed, the memory can be +released to the operating system. (The disadvantage of this mechanism +is that it can be very slow. On systems with the `mmap()' system call, +the XEmacs version of `ralloc.c' uses this to move memory around +without actually having to block-copy it, which can speed things up; +but it can still cause noticeable performance degradation.) + + `free-hook.c' contains some debugging functions for checking for +invalid arguments to `free()'. + + `vm-limit.c' contains some functions that warn the user when memory +is getting low. These are callback functions that are called by +`gmalloc.c' and `malloc.c' at appropriate times. + + `getpagesize.h' provides a uniform interface for retrieving the size +of a page in virtual memory. `mem-limits.h' provides a uniform +interface for retrieving the total amount of available virtual memory. +Both are similar in spirit to the `sys*.h' files described in section +J, below. + + blocktype.c + blocktype.h + dynarr.c + + These implement a couple of basic C data types to facilitate memory +allocation. The `Blocktype' type efficiently manages the allocation of +fixed-size blocks by minimizing the number of times that `malloc()' and +`free()' are called. It allocates memory in large chunks, subdivides +the chunks into blocks of the proper size, and returns the blocks as +requested. When blocks are freed, they are placed onto a linked list, +so they can be efficiently reused. This data type is not much used in +XEmacs currently, because it's a fairly new addition. + + The `Dynarr' type implements a "dynamic array", which is similar to +a standard C array but has no fixed limit on the number of elements it +can contain. Dynamic arrays can hold elements of any type, and when +you add a new element, the array automatically resizes itself if it +isn't big enough. Dynarrs are extensively used in the redisplay +mechanism. + + inline.c + + This module is used in connection with inline functions (available in +some compilers). Often, inline functions need to have a corresponding +non-inline function that does the same thing. This module is where they +reside. It contains no actual code, but defines some special flags that +cause inline functions defined in header files to be rendered as actual +functions. It then includes all header files that contain any inline +function definitions, so that each one gets a real function equivalent. + + debug.c + debug.h + + These functions provide a system for doing internal consistency +checks during code development. This system is not currently used; +instead the simpler `assert()' macro is used along with the various +checks provided by the `--error-check-*' configuration options. + + prefix-args.c + + This is actually the source for a small, self-contained program used +during building. + + universe.h + + This is not currently used. + + +File: internals.info, Node: Basic Lisp Modules, Next: Modules for Standard Editing Operations, Prev: Low-Level Modules, Up: A Summary of the Various XEmacs Modules + +Basic Lisp Modules +================== + + emacsfns.h + lisp-disunion.h + lisp-union.h + lisp.h + lrecord.h + symsinit.h + + These are the basic header files for all XEmacs modules. Each module +includes `lisp.h', which brings the other header files in. `lisp.h' +contains the definitions of the structures and extractor and +constructor macros for the basic Lisp objects and various other basic +definitions for the Lisp environment, as well as some general-purpose +definitions (e.g. `min()' and `max()'). `lisp.h' includes either +`lisp-disunion.h' or `lisp-union.h', depending on whether +`USE_UNION_TYPE' is defined. These files define the typedef of the +Lisp object itself (as described above) and the low-level macros that +hide the actual implementation of the Lisp object. All extractor and +constructor macros for particular types of Lisp objects are defined in +terms of these low-level macros. + + As a general rule, all typedefs should go into the typedefs section +of `lisp.h' rather than into a module-specific header file even if the +structure is defined elsewhere. This allows function prototypes that +use the typedef to be placed into other header files. Forward structure +declarations (i.e. a simple declaration like `struct foo;' where the +structure itself is defined elsewhere) should be placed into the +typedefs section as necessary. + + `lrecord.h' contains the basic structures and macros that implement +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. + + `lisp.h' contains prototypes for most of the exported functions in +the various modules. Lisp primitives defined using `DEFUN' that need +to be called by C code should be declared using `EXFUN'. Other +function prototypes should be placed either into the appropriate +section of `lisp.h', or into a module-specific header file, depending +on how general-purpose the function is and whether it has +special-purpose argument types requiring definitions not in `lisp.h'.) +All initialization functions are prototyped in `symsinit.h'. + + alloc.c + pure.c + puresize.h + + The large module `alloc.c' implements all of the basic allocation and +garbage collection for Lisp objects. The most commonly used Lisp +objects are allocated in chunks, similar to the Blocktype data type +described above; others are allocated in individually `malloc()'ed +blocks. This module provides the foundation on which all other aspects +of the Lisp environment sit, and is the first module initialized at +startup. + + Note that `alloc.c' provides a series of generic functions that are +not dependent on any particular object type, and interfaces to +particular types of objects using a standardized interface of +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 +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 +code, adding a new subtype within a subsystem will in general not +require changes to the generic subsystem code or affect any of the other +subtypes in the subsystem; this provides a great deal of robustness to +the XEmacs code. + + `pure.c' contains the declaration of the "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 `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. + + `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. + + eval.c + backtrace.h + + This module contains all of the functions to handle the flow of +control. This includes the mechanisms of defining functions, calling +functions, traversing stack frames, and binding variables; the control +primitives and other special forms such as `while', `if', `eval', +`let', `and', `or', `progn', etc.; handling of non-local exits, +unwind-protects, and exception handlers; entering the debugger; methods +for the subr Lisp object type; etc. It does *not* include the `read' +function, the `print' function, or the handling of symbols and obarrays. + + `backtrace.h' contains some structures related to stack frames and +the flow of control. + + lread.c + + This module implements the Lisp reader and the `read' function, +which converts text into Lisp objects, according to the read syntax of +the objects, as described above. This is similar to the parser that is +a part of all compilers. + + print.c + + This module implements the Lisp print mechanism and the `print' +function and related functions. This is the inverse of the Lisp reader +- it converts Lisp objects to a printed, textual representation. +(Hopefully something that can be read back in using `read' to get an +equivalent object.) + + general.c + symbols.c + symeval.h + + `symbols.c' implements the handling of symbols, obarrays, and +retrieving the values of symbols. Much of the code is devoted to +handling the special "symbol-value-magic" objects that define 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 `alloc.c'), because it is here +that the basic symbols `t' and `nil' are created, and those symbols are +used everywhere throughout XEmacs. + + `symeval.h' contains the definitions of symbol structures and the +`DEFVAR_LISP()' and related macros for declaring variables. + + data.c + floatfns.c + fns.c + + These modules implement the methods and standard Lisp primitives for +all the basic Lisp object types other than symbols (which are described +above). `data.c' contains all the predicates (primitives that return +whether an object is of a particular type); the integer arithmetic +functions; and the basic accessor and mutator primitives for the various +object types. `fns.c' contains all the standard predicates for working +with sequences (where, abstractly speaking, a sequence is an ordered set +of objects, and can be represented by a list, string, vector, or +bit-vector); it also contains `equal', perhaps on the grounds that bulk +of the operation of `equal' is comparing sequences. `floatfns.c' +contains methods and primitives for floats and floating-point +arithmetic. + + bytecode.c + bytecode.h + + `bytecode.c' implements the byte-code interpreter and +compiled-function objects, and `bytecode.h' contains associated +structures. Note that the byte-code *compiler* is written in Lisp. + + +File: internals.info, Node: Modules for Standard Editing Operations, Next: Editor-Level Control Flow Modules, Prev: Basic Lisp Modules, Up: A Summary of the Various XEmacs Modules + +Modules for Standard Editing Operations +======================================= + + buffer.c + buffer.h + bufslots.h + + `buffer.c' implements the "buffer" Lisp object type. This includes +functions that create and destroy buffers; retrieve buffers by name or +by other properties; manipulate lists of buffers (remember that buffers +are permanent objects and stored in various ordered lists); retrieve or +change buffer properties; etc. It also contains the definitions of all +the built-in buffer-local variables (which can be viewed as buffer +properties). It does *not* contain code to manipulate buffer-local +variables (that's in `symbols.c', described above); or code to +manipulate the text in a buffer. + + `buffer.h' defines the structures associated with a buffer and the +various macros for retrieving text from a buffer and special buffer +positions (e.g. `point', the default location for text insertion). It +also contains macros for working with buffer positions and converting +between their representations as character offsets and as byte offsets +(under MULE, they are different, because characters can be multi-byte). +It is one of the largest header files. + + `bufslots.h' defines the fields in the buffer structure that +correspond to the built-in buffer-local variables. It is its own +header file because it is included many times in `buffer.c', as a way +of iterating over all the built-in buffer-local variables. + + insdel.c + insdel.h + + `insdel.c' contains low-level functions for inserting and deleting +text in a buffer, keeping track of changed regions for use by +redisplay, and calling any before-change and after-change functions +that may have been registered for the buffer. It also contains the +actual functions that convert between byte offsets and character +offsets. + + `insdel.h' contains associated headers. + + marker.c + + This module implements the "marker" Lisp object type, which +conceptually is a pointer to a text position in a buffer that moves +around as text is inserted and deleted, so as to remain in the same +relative position. This module doesn't actually move the markers around +- that's handled in `insdel.c'. This module just creates them and +implements the primitives for working with them. As markers are simple +objects, this does not entail much. + + Note that the standard arithmetic primitives (e.g. `+') accept +markers in place of integers and automatically substitute the value of +`marker-position' for the marker, i.e. an integer describing the +current buffer position of the marker. + + extents.c + extents.h + + This module implements the "extent" Lisp object type, which is like +a marker that works over a range of text rather than a single position. +Extents are also much more complex and powerful than markers and have a +more efficient (and more algorithmically complex) implementation. The +implementation is described in detail in comments in `extents.c'. + + The code in `extents.c' works closely with `insdel.c' so that +extents are properly moved around as text is inserted and deleted. +There is also code in `extents.c' that provides information needed by +the redisplay mechanism for efficient operation. (Remember that extents +can have display properties that affect [sometimes drastically, as in +the `invisible' property] the display of the text they cover.) + + editfns.c + + `editfns.c' contains the standard Lisp primitives for working with a +buffer's text, and calls the low-level functions in `insdel.c'. It +also contains primitives for working with `point' (the default buffer +insertion location). + + `editfns.c' also contains functions for retrieving various +characteristics from the external environment: the current time, the +process ID of the running XEmacs process, the name of the user who ran +this XEmacs process, etc. It's not clear why this code is in +`editfns.c'. + + callint.c + cmds.c + commands.h + + These modules implement the basic "interactive" commands, i.e. +user-callable functions. Commands, as opposed to other functions, have +special ways of getting their parameters interactively (by querying the +user), as opposed to having them passed in a normal function +invocation. Many commands are not really meant to be called from other +Lisp functions, because they modify global state in a way that's often +undesired as part of other Lisp functions. + + `callint.c' implements the mechanism for querying the user for +parameters and calling interactive commands. The bulk of this module is +code that parses the interactive spec that is supplied with an +interactive command. + + `cmds.c' implements the basic, most commonly used editing commands: +commands to move around the current buffer and insert and delete +characters. These commands are implemented using the Lisp primitives +defined in `editfns.c'. + + `commands.h' contains associated structure definitions and +prototypes. + + regex.c + regex.h + search.c + + `search.c' implements the Lisp primitives for searching for text in +a buffer, and some of the low-level algorithms for doing this. In +particular, the fast fixed-string Boyer-Moore search algorithm is +implemented in `search.c'. The low-level algorithms for doing +regular-expression searching, however, are implemented in `regex.c' and +`regex.h'. These two modules are largely independent of XEmacs, and +are similar to (and based upon) the regular-expression routines used in +`grep' and other GNU utilities. + + doprnt.c + + `doprnt.c' implements formatted-string processing, similar to +`printf()' command in C. + + undo.c + + This module implements the undo mechanism for tracking buffer +changes. Most of this could be implemented in Lisp. + + +File: internals.info, Node: Editor-Level Control Flow Modules, Next: Modules for the Basic Displayable Lisp Objects, Prev: Modules for Standard Editing Operations, Up: A Summary of the Various XEmacs Modules + +Editor-Level Control Flow Modules +================================= + + event-Xt.c + event-stream.c + event-tty.c + events.c + events.h + + These implement the handling of events (user input and other system +notifications). + + `events.c' and `events.h' define the "event" Lisp object type and +primitives for manipulating it. + + `event-stream.c' implements the basic functions for working with +event queues, dispatching an event by looking it up in relevant keymaps +and such, and handling timeouts; this includes the primitives +`next-event' and `dispatch-event', as well as related primitives such +as `sit-for', `sleep-for', and `accept-process-output'. +(`event-stream.c' is one of the hairiest and trickiest modules in +XEmacs. Beware! You can easily mess things up here.) + + `event-Xt.c' and `event-tty.c' implement the low-level interfaces +onto retrieving events from Xt (the X toolkit) and from TTY's (using +`read()' and `select()'), respectively. The event interface enforces a +clean separation between the specific code for interfacing with the +operating system and the generic code for working with events, by +defining an API of basic, low-level event methods; `event-Xt.c' and +`event-tty.c' are two different implementations of this API. To add +support for a new operating system (e.g. NeXTstep), one merely needs to +provide another implementation of those API functions. + + Note that the choice of whether to use `event-Xt.c' or `event-tty.c' +is made at compile time! Or at the very latest, it is made at startup +time. `event-Xt.c' handles events for *both* X and TTY frames; +`event-tty.c' is only used when X support is not compiled into XEmacs. +The reason for this is that there is only one event loop in XEmacs: +thus, it needs to be able to receive events from all different kinds of +frames. + + keymap.c + keymap.h + + `keymap.c' and `keymap.h' define the "keymap" Lisp object type and +associated methods and primitives. (Remember that keymaps are objects +that associate event descriptions with functions to be called to +"execute" those events; `dispatch-event' looks up events in the +relevant keymaps.) + + keyboard.c + + `keyboard.c' contains functions that implement the actual editor +command loop - i.e. the event loop that cyclically retrieves and +dispatches events. This code is also rather tricky, just like +`event-stream.c'. + + macros.c + macros.h + + These two modules contain the basic code for defining keyboard +macros. These functions don't actually do much; most of the code that +handles keyboard macros is mixed in with the event-handling code in +`event-stream.c'. + + minibuf.c + + This contains some miscellaneous code related to the minibuffer +(most of the minibuffer code was moved into Lisp by Richard Mlynarik). +This includes the primitives for completion (although filename +completion is in `dired.c'), the lowest-level interface to the +minibuffer (if the command loop were cleaned up, this too could be in +Lisp), and code for dealing with the echo area (this, too, was mostly +moved into Lisp, and the only code remaining is code to call out to +Lisp or provide simple bootstrapping implementations early in temacs, +before the echo-area Lisp code is loaded). + + +File: internals.info, Node: Modules for the Basic Displayable Lisp Objects, Next: Modules for other Display-Related Lisp Objects, Prev: Editor-Level Control Flow Modules, Up: A Summary of the Various XEmacs Modules + +Modules for the Basic Displayable Lisp Objects +============================================== + + device-ns.h + device-stream.c + device-stream.h + device-tty.c + device-tty.h + device-x.c + device-x.h + device.c + device.h + + These modules implement the "device" Lisp object type. This +abstracts a particular screen or connection on which frames are +displayed. As with Lisp objects, event interfaces, and other +subsystems, the device code is separated into a generic component that +contains a standardized interface (in the form of a set of methods) onto +particular device types. + + The device subsystem defines all the methods and provides method +services for not only device operations but also for the frame, window, +menubar, scrollbar, toolbar, and other displayable-object subsystems. +The reason for this is that all of these subsystems have the same +subtypes (X, TTY, NeXTstep, Microsoft Windows, etc.) as devices do. + + frame-ns.h + frame-tty.c + frame-x.c + frame-x.h + frame.c + frame.h + + Each device contains one or more frames in which objects (e.g. text) +are displayed. A frame corresponds to a window in the window system; +usually this is a top-level window but it could potentially be one of a +number of overlapping child windows within a top-level window, using the +MDI (Multiple Document Interface) protocol in Microsoft Windows or a +similar scheme. + + The `frame-*' files implement the "frame" Lisp object type and +provide the generic and device-type-specific operations on frames (e.g. +raising, lowering, resizing, moving, etc.). + + window.c + window.h + + Each frame consists of one or more non-overlapping "windows" (better +known as "panes" in standard window-system terminology) in which a +buffer's text can be displayed. Windows can also have scrollbars +displayed around their edges. + + `window.c' and `window.h' implement the "window" Lisp object type +and provide code to manage windows. Since windows have no associated +resources in the window system (the window system knows only about the +frame; no child windows or anything are used for XEmacs windows), there +is no device-type-specific code here; all of that code is part of the +redisplay mechanism or the code for particular object types such as +scrollbars. + + +File: internals.info, Node: Modules for other Display-Related Lisp Objects, Next: Modules for the Redisplay Mechanism, Prev: Modules for the Basic Displayable Lisp Objects, Up: A Summary of the Various XEmacs Modules + +Modules for other Display-Related Lisp Objects +============================================== + + faces.c + faces.h + + bitmaps.h + glyphs-ns.h + glyphs-x.c + glyphs-x.h + glyphs.c + glyphs.h + + objects-ns.h + objects-tty.c + objects-tty.h + objects-x.c + objects-x.h + objects.c + objects.h + + menubar-x.c + menubar.c + + scrollbar-x.c + scrollbar-x.h + scrollbar.c + scrollbar.h + + toolbar-x.c + toolbar.c + toolbar.h + + font-lock.c + + 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. + + dgif_lib.c + gif_err.c + gif_lib.h + gifalloc.c + + These modules decode GIF-format image files, for use with glyphs. + + +File: internals.info, Node: Modules for the Redisplay Mechanism, Next: Modules for Interfacing with the File System, Prev: Modules for other Display-Related Lisp Objects, Up: A Summary of the Various XEmacs Modules + +Modules for the Redisplay Mechanism +=================================== + + redisplay-output.c + redisplay-tty.c + redisplay-x.c + redisplay.c + redisplay.h + + These files provide the redisplay mechanism. As with many other +subsystems in XEmacs, there is a clean separation between the general +and device-specific support. + + `redisplay.c' contains the bulk of the redisplay engine. These +functions update the redisplay structures (which describe how the screen +is to appear) to reflect any changes made to the state of any +displayable objects (buffer, frame, window, etc.) since the last time +that redisplay was called. These functions are highly optimized to +avoid doing more work than necessary (since redisplay is called +extremely often and is potentially a huge time sink), and depend heavily +on notifications from the objects themselves that changes have occurred, +so that redisplay doesn't explicitly have to check each possible object. +The redisplay mechanism also contains a great deal of caching to further +speed things up; some of this caching is contained within the various +displayable objects. + + `redisplay-output.c' goes through the redisplay structures and +converts them into calls to device-specific methods to actually output +the screen changes. + + `redisplay-x.c' and `redisplay-tty.c' are two implementations of +these redisplay output methods, for X frames and TTY frames, +respectively. + + indent.c + + This module contains various functions and Lisp primitives for +converting between buffer positions and screen positions. These +functions call the redisplay mechanism to do most of the work, and then +examine the redisplay structures to get the necessary information. This +module needs work. + + termcap.c + terminfo.c + tparam.c + + These files contain functions for working with the termcap +(BSD-style) and terminfo (System V style) databases of terminal +capabilities and escape sequences, used when XEmacs is displaying in a +TTY. + + cm.c + cm.h + + These files provide some miscellaneous TTY-output functions and +should probably be merged into `redisplay-tty.c'. + diff --git a/info/internals.info-4 b/info/internals.info-4 new file mode 100644 index 0000000..f32214c --- /dev/null +++ b/info/internals.info-4 @@ -0,0 +1,994 @@ +This is Info file ../../info/internals.info, produced by Makeinfo +version 1.68 from the input file internals.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Internals: (internals). XEmacs Internals Manual. +END-INFO-DIR-ENTRY + + Copyright (C) 1992 - 1996 Ben Wing. Copyright (C) 1996, 1997 Sun +Microsystems. Copyright (C) 1994 - 1998 Free Software Foundation. +Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: internals.info, Node: Modules for Interfacing with the File System, Next: Modules for Other Aspects of the Lisp Interpreter and Object System, Prev: Modules for the Redisplay Mechanism, Up: A Summary of the Various XEmacs Modules + +Modules for Interfacing with the File System +============================================ + + lstream.c + lstream.h + + These modules implement the "stream" Lisp object type. This is an +internal-only Lisp object that implements a generic buffering stream. +The idea is to provide a uniform interface onto all sources and sinks of +data, including file descriptors, stdio streams, chunks of memory, Lisp +buffers, Lisp strings, etc. That way, I/O functions can be written to +the stream interface and can transparently handle all possible sources +and sinks. (For example, the `read' function can read data from a +file, a string, a buffer, or even a function that is called repeatedly +to return data, without worrying about where the data is coming from or +what-size chunks it is returned in.) + + Note that in the C code, streams are called "lstreams" (for "Lisp +streams") to distinguish them from other kinds of streams, e.g. stdio +streams and C++ I/O streams. + + Similar to other subsystems in XEmacs, lstreams are separated into +generic functions and a set of methods for the different types of +lstreams. `lstream.c' provides implementations of many different types +of streams; others are provided, e.g., in `mule-coding.c'. + + fileio.c + + This implements the basic primitives for interfacing with the file +system. This includes primitives for reading files into buffers, +writing buffers into files, checking for the presence or accessibility +of files, canonicalizing file names, etc. Note that these primitives +are usually not invoked directly by the user: There is a great deal of +higher-level Lisp code that implements the user commands such as +`find-file' and `save-buffer'. This is similar to the distinction +between the lower-level primitives in `editfns.c' and the higher-level +user commands in `commands.c' and `simple.el'. + + filelock.c + + This file provides functions for detecting clashes between different +processes (e.g. XEmacs and some external process, or two different +XEmacs processes) modifying the same file. (XEmacs can optionally use +the `lock/' subdirectory to provide a form of "locking" between +different XEmacs processes.) This module is also used by the low-level +functions in `insdel.c' to ensure that, if the first modification is +being made to a buffer whose corresponding file has been externally +modified, the user is made aware of this so that the buffer can be +synched up with the external changes if necessary. + + filemode.c + + This file provides some miscellaneous functions that construct a +`rwxr-xr-x'-type permissions string (as might appear in an `ls'-style +directory listing) given the information returned by the `stat()' +system call. + + dired.c + ndir.h + + These files implement the XEmacs interface to directory searching. +This includes a number of primitives for determining the files in a +directory and for doing filename completion. (Remember that generic +completion is handled by a different mechanism, in `minibuf.c'.) + + `ndir.h' is a header file used for the directory-searching emulation +functions provided in `sysdep.c' (see section J below), for systems +that don't provide any directory-searching functions. (On those +systems, directories can be read directly as files, and parsed.) + + realpath.c + + This file provides an implementation of the `realpath()' function +for expanding symbolic links, on systems that don't implement it or have +a broken implementation. + + +File: internals.info, Node: Modules for Other Aspects of the Lisp Interpreter and Object System, Next: Modules for Interfacing with the Operating System, Prev: Modules for Interfacing with the File System, Up: A Summary of the Various XEmacs Modules + +Modules for Other Aspects of the Lisp Interpreter and Object System +=================================================================== + + elhash.c + elhash.h + hash.c + hash.h + + These files provide two implementations of hash tables. Files +`hash.c' and `hash.h' provide a generic C implementation of hash tables +which can stand independently of XEmacs. Files `elhash.c' and +`elhash.h' provide a separate implementation of hash tables that can +store only Lisp objects, and knows about Lispy things like garbage +collection, and implement the "hash-table" Lisp object type. + + specifier.c + specifier.h + + This module implements the "specifier" Lisp object type. This is +primarily used for displayable properties, and allows for values that +are specific to a particular buffer, window, frame, device, or device +class, as well as a default value existing. This is used, for example, +to control the height of the horizontal scrollbar or the appearance of +the `default', `bold', or other faces. The specifier object consists +of a number of specifications, each of which maps from a buffer, +window, etc. to a value. The function `specifier-instance' looks up a +value given a window (from which a buffer, frame, and device can be +derived). + + chartab.c + chartab.h + casetab.c + + `chartab.c' and `chartab.h' implement the "char table" Lisp object +type, which maps from characters or certain sorts of character ranges +to Lisp objects. The implementation of this object type is optimized +for the internal representation of characters. Char tables come in +different types, which affect the allowed object types to which a +character can be mapped and also dictate certain other properties of +the char table. + + `casetab.c' implements one sort of char table, the "case table", +which maps characters to other characters of possibly different case. +These are used by XEmacs to implement case-changing primitives and to +do case-insensitive searching. + + syntax.c + syntax.h + + This module implements "syntax tables", another sort of char table +that maps characters into syntax classes that define the syntax of these +characters (e.g. a parenthesis belongs to a class of `open' characters +that have corresponding `close' characters and can be nested). This +module also implements the Lisp "scanner", a set of primitives for +scanning over text based on syntax tables. This is used, for example, +to find the matching parenthesis in a command such as `forward-sexp', +and by `font-lock.c' to locate quoted strings, comments, etc. + + casefiddle.c + + This module implements various Lisp primitives for upcasing, +downcasing and capitalizing strings or regions of buffers. + + rangetab.c + + This module implements the "range table" Lisp object type, which +provides for a mapping from ranges of integers to arbitrary Lisp +objects. + + opaque.c + opaque.h + + This module implements the "opaque" Lisp object type, an +internal-only Lisp object that encapsulates an arbitrary block of memory +so that it can be managed by the Lisp allocation system. To create an +opaque object, you call `make_opaque()', passing a pointer to a block +of memory. An object is created that is big enough to hold the memory, +which is copied into the object's storage. The object will then stick +around as long as you keep pointers to it, after which it will be +automatically reclaimed. + + Opaque objects can also have an arbitrary "mark method" associated +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.) + + abbrev.c + + This function provides a few primitives for doing dynamic +abbreviation expansion. In XEmacs, most of the code for this has been +moved into Lisp. Some C code remains for speed and because the +primitive `self-insert-command' (which is executed for all +self-inserting characters) hooks into the abbrev mechanism. +(`self-insert-command' is itself in C only for speed.) + + doc.c + + This function provides primitives for retrieving the documentation +strings of functions and variables. These documentation strings contain +certain special markers that get dynamically expanded (e.g. a +reverse-lookup is performed on some named functions to retrieve their +current key bindings). Some documentation strings (in particular, for +the built-in primitives and pre-loaded Lisp functions) are stored +externally in a file `DOC' in the `lib-src/' directory and need to be +fetched from that file. (Part of the build stage involves building this +file, and another part involves constructing an index for this file and +embedding it into the executable, so that the functions in `doc.c' do +not have to search the entire `DOC' file to find the appropriate +documentation string.) + + md5.c + + This function provides a Lisp primitive that implements the MD5 +secure hashing scheme, used to create a large hash value of a string of +data such that the data cannot be derived from the hash value. This is +used for various security applications on the Internet. + + +File: internals.info, Node: Modules for Interfacing with the Operating System, Next: Modules for Interfacing with X Windows, Prev: Modules for Other Aspects of the Lisp Interpreter and Object System, Up: A Summary of the Various XEmacs Modules + +Modules for Interfacing with the Operating System +================================================= + + callproc.c + process.c + process.h + + These modules allow XEmacs to spawn and communicate with subprocesses +and network connections. + + `callproc.c' implements (through the `call-process' primitive) what +are called "synchronous subprocesses". This means that XEmacs runs a +program, waits till it's done, and retrieves its output. A typical +example might be calling the `ls' program to get a directory listing. + + `process.c' and `process.h' implement "asynchronous subprocesses". +This means that XEmacs starts a program and then continues normally, +not waiting for the process to finish. Data can be sent to the process +or retrieved from it as it's running. This is used for the `shell' +command (which provides a front end onto a shell program such as +`csh'), the mail and news readers implemented in XEmacs, etc. The +result of calling `start-process' to start a subprocess is a process +object, a particular kind of object used to communicate with the +subprocess. You can send data to the process by passing the process +object and the data to `send-process', and you can specify what happens +to data retrieved from the process by setting properties of the process +object. (When the process sends data, XEmacs receives a process event, +which says that there is data ready. When `dispatch-event' is called +on this event, it reads the data from the process and does something +with it, as specified by the process object's properties. Typically, +this means inserting the data into a buffer or calling a function.) +Another property of the process object is called the "sentinel", which +is a function that is called when the process terminates. + + Process objects are also used for network connections (connections +to a process running on another machine). Network connections are +started with `open-network-stream' but otherwise work just like +subprocesses. + + sysdep.c + sysdep.h + + These modules implement most of the low-level, messy operating-system +interface code. This includes various device control (ioctl) operations +for file descriptors, TTY's, pseudo-terminals, etc. (usually this stuff +is fairly system-dependent; thus the name of this module), and emulation +of standard library functions and system calls on systems that don't +provide them or have broken versions. + + sysdir.h + sysfile.h + sysfloat.h + sysproc.h + syspwd.h + syssignal.h + systime.h + systty.h + syswait.h + + These header files provide consistent interfaces onto +system-dependent header files and system calls. The idea is that, +instead of including a standard header file like `' (which +may or may not exist on various systems) or having to worry about +whether all system provide a particular preprocessor constant, or +having to deal with the four different paradigms for manipulating +signals, you just include the appropriate `sys*.h' header file, which +includes all the right system header files, defines and missing +preprocessor constants, provides a uniform interface onto system calls, +etc. + + `sysdir.h' provides a uniform interface onto directory-querying +functions. (In some cases, this is in conjunction with emulation +functions in `sysdep.c'.) + + `sysfile.h' includes all the necessary header files for standard +system calls (e.g. `read()'), ensures that all necessary `open()' and +`stat()' preprocessor constants are defined, and possibly (usually) +substitutes sugared versions of `read()', `write()', etc. that +automatically restart interrupted I/O operations. + + `sysfloat.h' includes the necessary header files for floating-point +operations. + + `sysproc.h' includes the necessary header files for calling +`select()', `fork()', `execve()', socket operations, and the like, and +ensures that the `FD_*()' macros for descriptor-set manipulations are +available. + + `syspwd.h' includes the necessary header files for obtaining +information from `/etc/passwd' (the functions are emulated under VMS). + + `syssignal.h' includes the necessary header files for +signal-handling and provides a uniform interface onto the different +signal-handling and signal-blocking paradigms. + + `systime.h' includes the necessary header files and provides uniform +interfaces for retrieving the time of day, setting file +access/modification times, getting the amount of time used by the XEmacs +process, etc. + + `systty.h' buffers against the infinitude of different ways of +controlling TTY's. + + `syswait.h' provides a uniform way of retrieving the exit status +from a `wait()'ed-on process (some systems use a union, others use an +int). + + hpplay.c + libsst.c + libsst.h + libst.h + linuxplay.c + nas.c + sgiplay.c + sound.c + sunplay.c + + These files implement the ability to play various sounds on some +types of computers. You have to configure your XEmacs with sound +support in order to get this capability. + + `sound.c' provides the generic interface. It implements various +Lisp primitives and variables that let you specify which sounds should +be played in certain conditions. (The conditions are identified by +symbols, which are passed to `ding' to make a sound. Various standard +functions call this function at certain times; if sound support does +not exist, a simple beep results. + + `sgiplay.c', `sunplay.c', `hpplay.c', and `linuxplay.c' interface to +the machine's speaker for various different kind of machines. This is +called "native" sound. + + `nas.c' interfaces to a computer somewhere else on the network using +the NAS (Network Audio Server) protocol, playing sounds on that +machine. This allows you to run XEmacs on a remote machine, with its +display set to your local machine, and have the sounds be made on your +local machine, provided that you have a NAS server running on your local +machine. + + `libsst.c', `libsst.h', and `libst.h' provide some additional +functions for playing sound on a Sun SPARC but are not currently in use. + + tooltalk.c + tooltalk.h + + These two modules implement an interface to the ToolTalk protocol, +which is an interprocess communication protocol implemented on some +versions of Unix. ToolTalk is a high-level protocol that allows +processes to register themselves as providers of particular services; +other processes can then request a service without knowing or caring +exactly who is providing the service. It is similar in spirit to the +DDE protocol provided under Microsoft Windows. ToolTalk is a part of +the new CDE (Common Desktop Environment) specification and is used to +connect the parts of the SPARCWorks development environment. + + getloadavg.c + + This module provides the ability to retrieve the system's current +load average. (The way to do this is highly system-specific, +unfortunately, and requires a lot of special-case code.) + + sunpro.c + + This module provides a small amount of code used internally at Sun to +keep statistics on the usage of XEmacs. + + broken-sun.h + strcmp.c + strcpy.c + sunOS-fix.c + + These files provide replacement functions and prototypes to fix +numerous bugs in early releases of SunOS 4.1. + + hftctl.c + + This module provides some terminal-control code necessary on +versions of AIX prior to 4.1. + + msdos.c + msdos.h + + These modules are used for MS-DOS support, which does not work in +XEmacs. + + +File: internals.info, Node: Modules for Interfacing with X Windows, Next: Modules for Internationalization, Prev: Modules for Interfacing with the Operating System, Up: A Summary of the Various XEmacs Modules + +Modules for Interfacing with X Windows +====================================== + + Emacs.ad.h + + A file generated from `Emacs.ad', which contains XEmacs-supplied +fallback resources (so that XEmacs has pretty defaults). + + EmacsFrame.c + EmacsFrame.h + EmacsFrameP.h + + These modules implement an Xt widget class that encapsulates a frame. +This is for ease in integrating with Xt. The EmacsFrame widget covers +the entire X window except for the menubar; the scrollbars are +positioned on top of the EmacsFrame widget. + + *Warning:* Abandon hope, all ye who enter here. This code took an +ungodly amount of time to get right, and is likely to fall apart +mercilessly at the slightest change. Such is life under Xt. + + EmacsManager.c + EmacsManager.h + EmacsManagerP.h + + These modules implement a simple Xt manager (i.e. composite) widget +class that simply lets its children set whatever geometry they want. +It's amazing that Xt doesn't provide this standardly, but on second +thought, it makes sense, considering how amazingly broken Xt is. + + EmacsShell-sub.c + EmacsShell.c + EmacsShell.h + EmacsShellP.h + + These modules implement two Xt widget classes that are subclasses of +the TopLevelShell and TransientShell classes. This is necessary to deal +with more brokenness that Xt has sadistically thrust onto the backs of +developers. + + xgccache.c + xgccache.h + + These modules provide functions for maintenance and caching of GC's +(graphics contexts) under the X Window System. This code is junky and +needs to be rewritten. + + xselect.c + + This module provides an interface to the X Window System's concept of +"selections", the standard way for X applications to communicate with +each other. + + xintrinsic.h + xintrinsicp.h + xmmanagerp.h + xmprimitivep.h + + These header files are similar in spirit to the `sys*.h' files and +buffer against different implementations of Xt and Motif. + + * `xintrinsic.h' should be included in place of `'. + + * `xintrinsicp.h' should be included in place of `'. + + * `xmmanagerp.h' should be included in place of `'. + + * `xmprimitivep.h' should be included in place of `'. + + xmu.c + xmu.h + + These files provide an emulation of the Xmu library for those systems +(i.e. HPUX) that don't provide it as a standard part of X. + + ExternalClient-Xlib.c + ExternalClient.c + ExternalClient.h + ExternalClientP.h + ExternalShell.c + ExternalShell.h + ExternalShellP.h + extw-Xlib.c + extw-Xlib.h + extw-Xt.c + extw-Xt.h + + These files provide the "external widget" interface, which allows an +XEmacs frame to appear as a widget in another application. To do this, +you have to configure with `--external-widget'. + + `ExternalShell*' provides the server (XEmacs) side of the connection. + + `ExternalClient*' provides the client (other application) side of +the connection. These files are not compiled into XEmacs but are +compiled into libraries that are then linked into your application. + + `extw-*' is common code that is used for both the client and server. + + Don't touch this code; something is liable to break if you do. + + +File: internals.info, Node: Modules for Internationalization, Prev: Modules for Interfacing with X Windows, Up: A Summary of the Various XEmacs Modules + +Modules for Internationalization +================================ + + mule-canna.c + mule-ccl.c + mule-charset.c + mule-charset.h + mule-coding.c + mule-coding.h + mule-mcpath.c + mule-mcpath.h + mule-wnnfns.c + mule.c + + These files implement the MULE (Asian-language) support. Note that +MULE actually provides a general interface for all sorts of languages, +not just Asian languages (although they are generally the most +complicated to support). This code is still in beta. + + `mule-charset.*' and `mule-coding.*' provide the heart of the XEmacs +MULE support. `mule-charset.*' implements the "charset" Lisp object +type, which encapsulates a character set (an ordered one- or +two-dimensional set of characters, such as US ASCII or JISX0208 Japanese +Kanji). + + `mule-coding.*' implements the "coding-system" Lisp object type, +which encapsulates a method of converting between different encodings. +An encoding is a representation of a stream of characters, possibly +from multiple character sets, using a stream of bytes or words, and +defines (e.g.) which escape sequences are used to specify particular +character sets, how the indices for a character are converted into bytes +(sometimes this involves setting the high bit; sometimes complicated +rearranging of the values takes place, as in the Shift-JIS encoding), +etc. + + `mule-ccl.c' provides the CCL (Code Conversion Language) +interpreter. CCL is similar in spirit to Lisp byte code and is used to +implement converters for custom encodings. + + `mule-canna.c' and `mule-wnnfns.c' implement interfaces to external +programs used to implement the Canna and WNN input methods, +respectively. This is currently in beta. + + `mule-mcpath.c' provides some functions to allow for pathnames +containing extended characters. This code is fragmentary, obsolete, and +completely non-working. Instead, PATHNAME-CODING-SYSTEM is used to +specify conversions of names of files and directories. The standard C +I/O functions like `open()' are wrapped so that conversion occurs +automatically. + + `mule.c' provides a few miscellaneous things that should probably be +elsewhere. + + intl.c + + This provides some miscellaneous internationalization code for +implementing message translation and interfacing to the Ximp input +method. None of this code is currently working. + + iso-wide.h + + This contains leftover code from an earlier implementation of +Asian-language support, and is not currently used. + + +File: internals.info, Node: Allocation of Objects in XEmacs Lisp, Next: Events and the Event Loop, Prev: A Summary of the Various XEmacs Modules, Up: Top + +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:: +* Symbol:: +* Marker:: +* String:: +* Compiled Function:: + + +File: internals.info, Node: Introduction to Allocation, Next: Garbage Collection, Up: Allocation of Objects in XEmacs Lisp + +Introduction to Allocation +========================== + + Emacs Lisp, like all Lisps, has garbage collection. This means that +the programmer never has to explicitly free (destroy) an object; it +happens automatically when the object becomes inaccessible. Most +experts agree that garbage collection is a necessity in a modern, +high-level language. Its omission from C stems from the fact that C was +originally designed to be a nice abstract layer on top of assembly +language, for writing kernels and basic system utilities rather than +large applications. + + Lisp objects can be created by any of a number of Lisp primitives. +Most object types have one or a small number of basic primitives for +creating objects. For conses, the basic primitive is `cons'; for +vectors, the primitives are `make-vector' and `vector'; for symbols, +the primitives are `make-symbol' and `intern'; etc. Some Lisp objects, +especially those that are primarily used internally, have no +corresponding Lisp primitives. Every Lisp object, though, has at least +one C primitive for creating it. + + Recall from section (VII) that a Lisp object, as stored in a 32-bit +or 64-bit word, has a mark bit, a few tag bits, and a "value" that +occupies the remainder of the bits. We can separate the different Lisp +object types into four broad categories: + + * (a) Those for whom the value directly represents the contents of + the Lisp object. Only two types are in this category: integers and + characters. No special allocation or garbage collection is + necessary for such objects. Lisp objects of these types do not + need to be `GCPRO'ed. + + In the remaining three categories, the value is a pointer to a +structure. + + * (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 "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 + `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 "string + chars blocks" and is relocated during garbage collection to + eliminate holes. + + In the remaining two categories, the type is stored in the object +itself. The tag for all such objects is the generic "lrecord" +(Lisp_Record) tag. The first four bytes (or eight, for 64-bit machines) +of the object's structure are a pointer to a structure that describes +the object's type, which includes method pointers and a pointer to a +string naming the type. Note that it's possible to save some space by +using a one- or two-byte tag, rather than a four- or eight-byte pointer +to store the type, but it's not clear it's worth making the change. + + * (c) Those lrecords that are allocated in frob blocks (see above). + This includes the objects that are most common and relatively + small, and includes floats, compiled functions, symbols (when not + in category (b)), extents, events, and markers. With the cleanup + of frob blocks done in 19.12, it's not terribly hard to add more + objects to this category, but it's a bit trickier than adding an + object type to type (d) (esp. if the 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.) + + * (d) Those lrecords that are individually `malloc()'ed. These are + called "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 Mlynarik), with the exception of the character type, + have been in this category. + + Note that bit vectors are a bit of a special case. They are simple +lrecords as in category (c), but are individually `malloc()'ed like +vectors. You can basically view them as exactly like vectors except +that their type is stored in lrecord fashion rather than in +directly-tagged fashion. + + Note that FSF Emacs redesigned their object system in 19.29 to follow +a similar scheme. However, given RMS's expressed dislike for data +abstraction, the FSF scheme is not nearly as clean or as easy to +extend. (FSF calls items of type (c) `Lisp_Misc' and items of type (d) +`Lisp_Vectorlike', with separate tags for each, although +`Lisp_Vectorlike' is also used for vectors.) + + +File: internals.info, Node: Garbage Collection, Next: GCPROing, Prev: Introduction to Allocation, Up: Allocation of Objects in XEmacs Lisp + +Garbage Collection +================== + + Garbage collection is simple in theory but tricky to implement. +Emacs Lisp uses the oldest garbage collection method, called "mark and +sweep". Garbage collection begins by starting with all accessible +locations (i.e. all variables and other slots where Lisp objects might +occur) and recursively traversing all objects accessible from those +slots, marking each one that is found. We then go through all of +memory and free each object that is not marked, and unmarking each +object that is marked. Note that "all of memory" means all currently +allocated objects. Traversing all these objects means traversing all +frob blocks, all vectors (which are chained in one big list), and all +lcrecords (which are likewise chained). + + Note that, when an object is marked, the mark has to occur inside of +the object's structure, rather than in the 32-bit `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: + + 1. For conses, the mark bit of the car is set. + + 2. For strings, the mark bit of the string's plist is set. + + 3. For symbols when not lrecords, the mark bit of the symbol's plist + is set. + + 4. For vectors, the length is negated after adding 1. + + 5. For lrecords, the pointer to the structure describing the type is + changed (see below). + + 6. Integers and characters do not need to be marked, since no + allocation occurs for them. + + The details of this are in the `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: + + Some object pointers may have their mark bit set. This will make + `FOOBARP()' predicates fail. Use `GC_FOOBARP()' to deal with this. + + * Even if you clear the mark bit, `FOOBARP()' will still fail for + lrecords because the implementation pointer has been changed (see + below). `GC_FOOBARP()' will correctly deal with this. + + * Vectors have their size field munged, so anything that looks at + this field will fail. + + * Note that `XFOOBAR()' macros *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. + + Finally, note that garbage collection can be invoked explicitly by +calling `garbage-collect' but is also called automatically by `eval', +once a certain amount of memory has been allocated since the last +garbage collection (according to `gc-cons-threshold'). + + +File: internals.info, Node: GCPROing, Next: Garbage Collection - Step by Step, Prev: Garbage Collection, Up: Allocation of Objects in XEmacs Lisp + +`GCPRO'ing +========== + + `GCPRO'ing is one of the ugliest and trickiest parts of Emacs +internals. The basic idea is that whenever garbage collection occurs, +all in-use objects must be reachable somehow or other from one of the +roots of accessibility. The roots of accessibility are: + + 1. All objects that have been `staticpro()'d. This is used for any + global C variables that hold Lisp objects. A call to + `staticpro()' happens implicitly as a result of any symbols + declared with `defsymbol()' and any variables declared with + `DEFVAR_FOO()'. You need to explicitly call `staticpro()' (in the + `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 `obarray' is one of the `staticpro()'d things. + Therefore, all functions and variables get marked through this. + + 2. Any shadowed bindings that are sitting on the `specpdl' stack. + + 3. Any objects sitting in currently active (Lisp) stack frames, + catches, and condition cases. + + 4. A couple of special-case places where active objects are located. + + 5. Anything currently marked with `GCPRO'. + + Marking with `GCPRO' is necessary because some C functions (quite a +lot, in fact), allocate objects during their operation. Quite +frequently, there will be no other pointer to the object while the +function is running, and if a garbage collection occurs and the object +needs to be referenced again, bad things will happen. The solution is +to mark those objects with `GCPRO'. Unfortunately this is easy to +forget, and there is basically no way around this problem. Here are +some rules, though: + + 1. For every `GCPRON', there have to be declarations of `struct gcpro + gcpro1, gcpro2', etc. + + 2. You *must* `UNGCPRO' anything that's `GCPRO'ed, and you *must not* + `UNGCPRO' if you haven't `GCPRO'ed. Getting either of these wrong + will lead to crashes, often in completely random places unrelated + to where the problem lies. + + 3. The way this actually works is that all currently active `GCPRO's + are chained through the `struct gcpro' local variables, with the + variable `gcprolist' pointing to the head of the list and the nth + local `gcpro' variable pointing to the first `gcpro' variable in + the next enclosing stack frame. Each `GCPRO'ed thing is an + lvalue, and the `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 `GCPRO's and `UNGCPRO's - you will end up with + `gcprolist's containing pointers to `struct gcpro's or local + `Lisp_Object' variables in no-longer-active stack frames. + + 4. It is actually possible for a single `struct gcpro' to protect a + contiguous array of any number of values, rather than just a + single lvalue. To effect this, call `GCPRON' as usual on the + first object in the array and then set `gcproN.nvars'. + + 5. *Strings are relocated.* What this means in practice is that the + pointer obtained using `XSTRING_DATA()' is liable to change at any + time, and you should never keep it around past any function call, + or pass it as an argument to any function that might cause a + garbage collection. This is why a number of functions accept + either a "non-relocatable" `char *' pointer or a relocatable Lisp + string, and only access the Lisp string's data at the very last + minute. In some cases, you may end up having to `alloca()' some + space and copy the string's data into it. + + 6. By convention, if you have to nest `GCPRO''s, use `NGCPRON' (along + with `struct gcpro ngcpro1, ngcpro2', etc.), `NNGCPRON', etc. + This avoids compiler warnings about shadowed locals. + + 7. It is *always* better to err on the side of extra `GCPRO's rather + than too few. The extra cycles spent on this are almost never + going to make a whit of difference in the speed of anything. + + 8. The general rule to follow is that caller, not callee, `GCPRO's. + That is, you should not have to explicitly `GCPRO' any Lisp objects + that are passed in as parameters. + + One exception from this rule is if you ever plan to change the + parameter value, and store a new object in it. In that case, you + *must* `GCPRO' the parameter, because otherwise the new object + will not be protected. + + So, if you create any Lisp objects (remember, this happens in all + sorts of circumstances, e.g. with `Fcons()', etc.), you are + responsible for `GCPRO'ing them, unless you are *absolutely sure* + that there's no possibility that a garbage-collection can occur + while you need to use the object. Even then, consider `GCPRO'ing. + + 9. A garbage collection can occur whenever anything calls `Feval', or + whenever a QUIT can occur where execution can continue past this. + (Remember, this is almost anywhere.) + + 10. If you have the *least smidgeon of doubt* about whether you need + to `GCPRO', you should `GCPRO'. + + 11. Beware of `GCPRO'ing something that is uninitialized. If you have + any shade of doubt about this, initialize all your variables to + `Qnil'. + + 12. Be careful of traps, like calling `Fcons()' in the argument to + another function. By the "caller protects" law, you should be + `GCPRO'ing the newly-created cons, but you aren't. A certain + number of functions that are commonly called on freshly created + stuff (e.g. `nconc2()', `Fsignal()'), break the "caller protects" + law and go ahead and `GCPRO' their arguments so as to simplify + things, but make sure and check if it's OK whenever doing + something like this. + + 13. Once again, remember to `GCPRO'! Bugs resulting from insufficient + `GCPRO'ing are intermittent and extremely difficult to track down, + often showing up in crashes inside of `garbage-collect' or in + weirdly corrupted objects or even in incorrect values in a totally + different section of code. + + Given the extremely error-prone nature of the `GCPRO' scheme, and +the difficulties in tracking down, it should be considered a deficiency +in the XEmacs code. A solution to this problem would involve +implementing so-called "conservative" garbage collection for the C +stack. That involves looking through all of stack memory and treating +anything that looks like a reference to an object as a reference. This +will result in a few objects not getting collected when they should, but +it obviates the need for `GCPRO'ing, and allows garbage collection to +happen at any point at all, such as during object allocation. + + +File: internals.info, Node: Garbage Collection - Step by Step, Next: Integers and Characters, Prev: GCPROing, Up: Allocation of Objects in XEmacs Lisp + +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:: + + +File: internals.info, Node: Invocation, Next: garbage_collect_1, Up: Garbage Collection - Step by Step + +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 *not* the case. Instead, we have the following +situation: + + The entry point of any process of garbage collection is an invocation +of the function `garbage_collect_1' in file `alloc.c'. The invocation +can occur *explicitly* by calling the function `Fgarbage_collect' (in +addition this function provides information about the freed memory), or +can occur *implicitly* in four different situations: + 1. In function `main_1' in file `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 `ERROR_CHECK_GC' is defined. + + 2. In function `disksave_object_finalization' in file `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 `Fdump_emacs' or by + `Fdump_emacs_data' respectively (both in `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. + + 3. In function `Feval / eval' in file `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 + `garbage_collect_1'. There exist three global variables, + `consing_since_gc' (counts the created cons-cells since the last + garbage collection), `gc_cons_threshold' (a specified threshold + after which a garbage collection occurs) and `always_gc'. If + `always_gc' is set or if the threshold is exceeded, the garbage + collection will start. + + 4. In function `Ffuncall / funcall' in file `eval.c'. This function + evaluates calls of elisp functions and works according to `Feval'. + + The upshot is that garbage collection can basically occur everywhere +`Feval', respectively `Ffuncall', is used - either directly or through +another function. Since calls to these two functions are hidden in +various other functions, many calls to `garabge_collect_1' are not +obviously foreseeable, and therefore unexpected. Instances where they +are used that are worth remembering are various elisp commands, as for +example `or', `and', `if', `cond', `while', `setq', etc., miscellaneous +`gui_item_...' functions, everything related to `eval' (`Feval_buffer', +`call0', ...) and inside `Fsignal'. The latter is used to handle +signals, as for example the ones raised by every `QUITE'-macro +triggered after pressing Ctrl-g. + diff --git a/info/internals.info-5 b/info/internals.info-5 new file mode 100644 index 0000000..cbb9a34 --- /dev/null +++ b/info/internals.info-5 @@ -0,0 +1,1006 @@ +This is Info file ../../info/internals.info, produced by Makeinfo +version 1.68 from the input file internals.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Internals: (internals). XEmacs Internals Manual. +END-INFO-DIR-ENTRY + + Copyright (C) 1992 - 1996 Ben Wing. Copyright (C) 1996, 1997 Sun +Microsystems. Copyright (C) 1994 - 1998 Free Software Foundation. +Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: internals.info, Node: garbage_collect_1, Next: mark_object, Prev: Invocation, Up: Garbage Collection - Step by Step + +`garbage_collect_1' +------------------- + + We can now describe exactly what happens after the invocation takes +place. + 1. There are several cases in which the garbage collector is left + immediately: when we are already garbage collecting + (`gc_in_progress'), when the garbage collection is somehow + forbidden (`gc_currently_forbidden'), when we are currently + displaying something (`in_display') or when we are preparing for + the armageddon of the whole system (`preparing_for_armageddon'). + + 2. 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 `pre_gc_curser' and `cursor_changed' take care of that. + + 3. The state of `gc_currently_forbidden' must be restored after the + garbage collection, no matter what happens during the process. We + accomplish this by `record_unwind_protect'ing the suitable function + `restore_gc_inhibit' together with the current value of + `gc_currently_forbidden'. + + 4. If we are concurrently running an interactive xemacs session, the + next step is simply to show the garbage collector's cursor/message. + + 5. The following steps are the intrinsic steps of the garbage + collector, therefore `gc_in_progress' is set. + + 6. For debugging purposes, it is possible to copy the current C stack + frame. However, this seems to be a currently unused feature. + + 7. Before actually starting to go over all live objects, references to + objects that are no longer used are pruned. We only have to do + this for events (`clear_event_resource') and for specifiers + (`cleanup_specifiers'). + + 8. 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 `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: + * all constant symbols and static variables that are registered + via `staticpro' in the array `staticvec'. *Note Adding + Global Lisp Variables::. + + * all Lisp objects that are created in C functions and that + must be protected from freeing them. They are registered in + the global list `gcprolist'. *Note GCPROing::. + + * all local variables (i.e. their name fields `symbol' and old + values `old_values') that are bound during the evaluation by + the Lisp engine. They are stored in `specbinding' structs + pushed on a stack called `specpdl'. *Note Dynamic Binding; + The specbinding Stack; Unwind-Protects::. + + * all catch blocks that the Lisp engine encounters during the + evaluation cause the creation of structs `catchtag' inserted + in the list `catchlist'. Their tag (`tag') and value (`val' + fields are freshly created objects and therefore have to be + marked. *Note Catch and Throw::. + + * every function application pushes new structs `backtrace' on + the call stack of the Lisp engine (`backtrace_list'). The + unique parts that have to be marked are the fields for each + function (`function') and all their arguments (`args'). + *Note Evaluation::. + + * all objects that are used by the redisplay engine that must + not be freed are marked by a special function called + `mark_redisplay' (in `redisplay.c'). + + * 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 + `mark_profiling_info' + + 9. 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 + `make-hash-table'. + + Because there are complicated dependency rules about when and what + to mark while processing weak hash tables, the standard `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 `finish_marking_weak_hash_tables'. This + function iterates over each hash table entry `hentries' for each + weak hash table in `Vall_weak_hash_tables'. Depending on the type + of a table, the appropriate action is performed. If a table is + acting as `HASH_TABLE_KEY_WEAK', and a key already marked, + everything reachable from the `value' component is marked. If it is + acting as a `HASH_TABLE_VALUE_WEAK' and the value component is + already marked, the marking starts beginning only from the `key' + component. If it is a `HASH_TABLE_KEY_CAR_WEAK' and the car of + the key entry is already marked, we mark both the `key' and + `value' components. Finally, if the table is of the type + `HASH_TABLE_VALUE_CAR_WEAK' and the car of the value components is + already marked, again both the `key' and the `value' components + get marked. + + Again, there are lists with comparable properties called weak + lists. There exist different peculiarities of their types called + `simple', `assoc', `key-assoc' and `value-assoc'. You can find + further details about them in the description to the function + `make-weak-list'. The scheme of their marking is similar: all weak + lists are listed in `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 `WEAK_LIST_SIMPLE' and the elem is + marked, we mark the `cons' part. If it is a `WEAK_LIST_ASSOC' and + not a pair or a pair with both marked car and cdr, we mark the + `cons' and the `elem'. If it is a `WEAK_LIST_KEY_ASSOC' and not a + pair or a pair with a marked car of the elem, we mark the `cons' + and the `elem'. Finally, if it is a `WEAK_LIST_VALUE_ASSOC' and + not a pair or a pair with a marked cdr of the elem, we mark both + the `cons' and the `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. + + 10. 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 `prune_weak_hash_tables' does the job for weak hash + tables. Totally unmarked hash tables are removed from the list + `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 `key' and `value' is unmarked. + + The same idea applies to the weak lists. It is accomplished by + `prune_weak_lists': An unmarked list is pruned from + `Vall_weak_lists' immediately. A marked list is treated more + carefully by going over it and removing just the unmarked pairs. + + 11. The function `prune_specifiers' checks all listed specifiers held + in `Vall_speficiers' and removes the ones from the lists that are + unmarked. + + 12. All syntax tables are stored in a list called + `Vall_syntax_tables'. The function `prune_syntax_tables' walks + through it and unlinks the tables that are unmarked. + + 13. Next, we will attack the complete sweeping - the function + `gc_sweep' which holds the predominance. + + 14. First, all the variables with respect to garbage collection are + reset. `consing_since_gc' - the counter of the created cells since + the last garbage collection - is set back to 0, and + `gc_in_progress' is not `true' anymore. + + 15. In case the session is interactive, the displayed cursor and + message are removed again. + + 16. The state of `gc_inhibit' is restored to the former value by + unwinding the stack. + + 17. A small memory reserve is always held back that can be reached by + `breathing_space'. If nothing more is left, we create a new reserve + and exit. + + +File: internals.info, Node: mark_object, Next: gc_sweep, Prev: garbage_collect_1, Up: Garbage Collection - Step by Step + +`mark_object' +------------- + + The first thing that is checked while marking an object is whether +the object is a real Lisp object `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. *Note 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 (`C_READONLY_RECORD_HEADER'). The object in question is +already marked, and need not be marked for the second time (checked by +`MARKED_RECORD_HEADER_P'). If it is a special, unmarkable object +(`UNMARKABLE_RECORD_HEADER_P', apparently, these are objects that sit +in some CONST space, and can therefore not be marked, see +`this_one_is_unmarkable' in `alloc.c'). + + Now, the actual marking is feasible. We do so by once using the macro +`MARK_RECORD_HEADER' to mark the object itself (actually the special +flag in the lrecord header), and calling its special marker "method" +`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 `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 `mark_object' process beginning with this next +object. + + +File: internals.info, Node: gc_sweep, Next: sweep_lcrecords_1, Prev: mark_object, Up: Garbage Collection - Step by Step + +`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. +*Note Introduction to Allocation::. + + We start with all objects stored through `lcrecords'. All bulkier +objects are allocated and handled using that scheme of `lcrecords'. +Each object is `malloc'ed separately instead of placing it in one of +the contiguous frob blocks. All types that are currently stored using +`lcrecords'´s `alloc_lcrecord' and `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 `sweep_lcrecords_1' as +described below is doing the whole job for us. For a description about +the internals: *Note 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 (`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. +*Note String::. This compacting phase is performed by the function +`compact_string_chars', the actual sweeping by the function +`sweep_strings' is described below. + + After that, the other types are swept step by step using functions +`sweep_conses', `sweep_bit_vectors_1', `sweep_compiled_functions', +`sweep_floats', `sweep_symbols', `sweep_extents', `sweep_markers' and +`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 `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 `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 `prev' and the +objects in `block[]'), a pointer to current block +(`current_..._block)') and its last index (`current_..._block_index'), +and a pointer to the free list that will be created. Also a macro +`FIXED_TYPE_FROM_BLOCK' plus some related macros exists that are used +to obtain a new object, either from the free list +`ALLOCATE_FIXED_TYPE_1' if there is an unused object of that type +stored or by allocating a completely new block using +`ALLOCATE_FIXED_TYPE_FROM_BLOCK'. + + The rest works as follows: all of them define a macro `UNMARK_...' +that is used to unmark the object. They define a macro +`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 +`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 `FREE_STRUCT_P' using the first pointer of the object), or if it is +set to read only (`C_READONLY_RECORD_HEADER_P', nothing must be done. +If it is unmarked (checked with `MARKED_RECORD_HEADER_P'), it is put in +the free list and set free (using the macro `FREE_FIXED_TYPE', +otherwise it stays in the block, but is unmarked (by `UNMARK_...'). +While going through one block, we note if the whole block is empty. If +so, the whole block is freed (using `xfree') and the free list state is +set to the state it had before handling this block. + + +File: internals.info, Node: sweep_lcrecords_1, Next: compact_string_chars, Prev: gc_sweep, Up: Garbage Collection - Step by Step + +`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 `all_lcrecords'. + + The first loop calls for each object its `finalizer' method, but only +in the case that it is not read only (`C_READONLY_RECORD_HEADER_P)', it +is not already marked (`MARKED_RECORD_HEADER_P'), it is not already in +a free list (list of freed objects, field `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 +`xfree'. During this loop, the lcrecord statistics are kept up to date +by calling `tick_lcrecord_stats' with the right arguments, + + +File: internals.info, Node: compact_string_chars, Next: sweep_strings, Prev: sweep_lcrecords_1, Up: Garbage Collection - Step by Step + +`compact_string_chars' +---------------------- + + The purpose of this function is to compact all the data parts of the +strings that are held in so-called `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 `string_chars_block's using two pointer/integer +pairs, namely `from_sb'/`from_pos' and `to_sb'/`to_pos'. They stand for +the actual positions, from where to where, to copy the actually handled +string. + + While going over all chained `string_char_block's and their held +strings, staring at `first_string_chars_block', both pointers are +advanced and eventually a string is copied from `from_sb' to `to_sb', +depending on the status of the pointed at strings. + + More precisely, we can distinguish between the following actions. + * The string at `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 + `FREE_STRUCT_P'. In this case, the `from_sb'/`from_pos' is + advanced to the next string, and nothing has to be copied. + + * Also, if a string object itself is unmarked, nothing has to be + copied. We likewise advance the `from_sb'/`from_pos' pair as + described above. + + * 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 `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 `memmove'. + + After compacting, the pointer to the current `string_chars_block', +sitting in `current_string_chars_block', is reset on the last block to +which we moved a string, i.e. `to_block', and all remaining blocks (we +know that they just carry garbage) are explicitly `xfree'd. + + +File: internals.info, Node: sweep_strings, Next: sweep_bit_vectors_1, Prev: compact_string_chars, Up: Garbage Collection - Step by Step + +`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 +`SWEEP_FIXED_SIZE_BLOCK' after defining the right macros +`UNMARK_string' and `ADDITIONAL_FREE_string'. These two definitions are +a little bit special compared to the ones used for the other fixed size +types. + + `UNMARK_string' is defined the same way except some additional code +used for updating the bookkeeping information. + + For strings, `ADDITIONAL_FREE_string' has to do something in +addition: in case, the string was not allocated in a +`string_chars_block' because it exceeded the maximal length, and +therefore it was `malloc'ed separately, we know also `xfree' it +explicitly. + + +File: internals.info, Node: sweep_bit_vectors_1, Prev: sweep_strings, Up: Garbage Collection - Step by Step + +`sweep_bit_vectors_1' +--------------------- + + Bit vectors are also one of the rare types that are `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 +`all_bit_vectors', all elements of that list are traversed, all +unmarked bit vectors are unlinked by calling `xfree' and all of them +become unmarked. In addition, the bookkeeping information used for +garbage collector's output purposes is updated. + + +File: internals.info, Node: Integers and Characters, Next: Allocation from Frob Blocks, Prev: Garbage Collection - Step by Step, Up: Allocation of Objects in XEmacs Lisp + +Integers and Characters +======================= + + Integer and character Lisp objects are created from integers using +the macros `XSETINT()' and `XSETCHAR()' or the equivalent functions +`make_int()' and `make_char()'. (These are actually macros on most +systems.) These functions basically just do some moving of bits +around, since the integral value of the object is stored directly in +the `Lisp_Object'. + + `XSETINT()' and the like will truncate values given to them that are +too big; i.e. you won't get the value you expected but the tag bits +will at least be correct. + + +File: internals.info, Node: Allocation from Frob Blocks, Next: lrecords, Prev: Integers and Characters, Up: Allocation of Objects in XEmacs Lisp + +Allocation from Frob Blocks +=========================== + + The uninitialized memory required by a `Lisp_Object' of a particular +type is allocated using `ALLOCATE_FIXED_TYPE()'. This only occurs +inside of the lowest-level object-creating functions in `alloc.c': +`Fcons()', `make_float()', `Fmake_byte_code()', `Fmake_symbol()', +`allocate_extent()', `allocate_event()', `Fmake_marker()', and +`make_uninit_string()'. The idea is that, for each type, there are a +number of frob blocks (each 2K in size); each frob block is divided up +into object-sized chunks. Each frob block will have some of these +chunks that are currently assigned to objects, and perhaps some that are +free. (If a frob block has nothing but free chunks, it is freed at the +end of the garbage collection cycle.) The free chunks are stored in a +free list, which is chained by storing a pointer in the first four bytes +of the chunk. (Except for the free chunks at the end of the last frob +block, which are handled using an index which points past the end of the +last-allocated chunk in the last frob block.) `ALLOCATE_FIXED_TYPE()' +first tries to retrieve a chunk from the free list; if that fails, it +calls `ALLOCATE_FIXED_TYPE_FROM_BLOCK()', which looks at the end of the +last frob block for space, and creates a new frob block if there is +none. (There are actually two versions of these macros, one of which is +more defensive but less efficient and is used for error-checking.) + + +File: internals.info, Node: lrecords, Next: Low-level allocation, Prev: Allocation from Frob Blocks, Up: Allocation of Objects in XEmacs Lisp + +lrecords +======== + + [see `lrecord.h'] + + All lrecords have at the beginning of their structure a `struct +lrecord_header'. This just contains a pointer to a `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 +`DEFINE_LRECORD_IMPLEMENTATION()' macro. (This macro actually declares +an array of two `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 "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 "marked-object" structure: the +finalize method is the special function `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 `struct +lrecord_header' at their beginning. lcrecords, however, actually have a +`struct lcrecord_header'. This, in turn, has a `struct lrecord_header' +at its beginning, so sanity is preserved; but it also has a pointer +used to chain all lcrecords together, and a special ID field used to +distinguish one lcrecord from another. (This field is used only for +debugging and could be removed, but the space gain is not significant.) + + Simple lrecords are created using `ALLOCATE_FIXED_TYPE()', just like +for other frob blocks. The only change is that the implementation +pointer must be initialized correctly. (The implementation structure for +an lrecord, or rather the pointer to it, is named `lrecord_float', +`lrecord_extent', `lrecord_buffer', etc.) + + lcrecords are created using `alloc_lcrecord()'. This takes a size +to allocate and an implementation pointer. (The size needs to be passed +because some lcrecords, such as window configurations, are of variable +size.) This basically just `malloc()'s the storage, initializes the +`struct lcrecord_header', and chains the lcrecord onto the head of the +list of all lcrecords, which is stored in the variable `all_lcrecords'. +The calls to `alloc_lcrecord()' generally occur in the lowest-level +allocation function for each lrecord type. + + Whenever you create an lrecord, you need to call either +`DEFINE_LRECORD_IMPLEMENTATION()' or +`DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION()'. This needs to be specified +in a C file, at the top level. What this actually does is define and +initialize the implementation structure for the lrecord. (And possibly +declares a function `error_check_foo()' that implements the `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 +`##' 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 `DEFINE_LRECORD_IMPLEMENTATION()' and +`DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION()' is that the former is used +for fixed-size object types and the latter is for variable-size object +types. Most object types are fixed-size; some complex types, however +(e.g. window configurations), are variable-size. Variable-size object +types have an extra method, which is called to determine the actual +size of a particular object of that type. (Currently this is only used +for keeping allocation statistics.) + + For the purpose of keeping allocation statistics, the allocation +engine keeps a list of all the different types that exist. Note that, +since `DEFINE_LRECORD_IMPLEMENTATION()' is a macro that is specified at +top-level, there is no way for it to add to the list of all existing +types. What happens instead is that each implementation structure +contains in it a dynamically assigned number that is particular to that +type. (Or rather, it contains a pointer to another structure that +contains this number. This evasiveness is done so that the +implementation structure can be declared const.) In the sweep stage of +garbage collection, each lrecord is examined to see if its +implementation structure has its dynamically-assigned number set. If +not, it must be a new type, and it is added to the list of known types +and a new number assigned. The number is used to index into an array +holding the number of objects of each type and the total memory +allocated for objects of that type. The statistics in this array are +also computed during the sweep stage. These statistics are returned by +the call to `garbage-collect' and are printed out at the end of the +loadup phase. + + Note that for every type defined with a `DEFINE_LRECORD_*()' macro, +there needs to be a `DECLARE_LRECORD_IMPLEMENTATION()' somewhere in a +`.h' file, and this `.h' file needs to be included by `inline.c'. + + Furthermore, there should generally be a set of `XFOOBAR()', +`FOOBARP()', etc. macros in a `.h' (or occasionally `.c') file. To +create one of these, copy an existing model and modify as necessary. + + The various methods in the lrecord implementation structure are: + + 1. A "mark" method. This is called during the marking stage and + passed a function pointer (usually the `mark_object()' function), + which is used to mark an object. All Lisp objects that are + contained within the object need to be marked by applying this + function to them. The mark method should also return a Lisp + object, which should be either nil or an object to mark. (This can + be used in lieu of calling `mark_object()' on the object, to + reduce the recursion depth, and consequently should be the most + heavily nested sub-object, such as a long list.) + + *Please note:* When the mark method is called, garbage collection + is in progress, and special precautions need to be taken when + accessing objects; see section (B) above. + + If your mark method does not need to do anything, it can be `NULL'. + + 2. A "print" method. This is called to create a printed + representation of the object, whenever `princ', `prin1', or the + like is called. It is passed the object, a stream to which the + output is to be directed, and an `escapeflag' which indicates + whether the object's printed representation should be "escaped" so + that it is readable. (This corresponds to the difference between + `princ' and `prin1'.) Basically, "escaped" means that strings will + have quotes around them and confusing characters in the strings + such as quotes, backslashes, and newlines will be backslashed; and + that special care will be taken to make symbols print in a + readable fashion (e.g. symbols that look like numbers will be + backslashed). Other readable objects should perhaps pass + `escapeflag' on when sub-objects are printed, so that readability + is preserved when necessary (or if not, always pass in a 1 for + `escapeflag'). Non-readable objects should in general ignore + `escapeflag', except that some use it as an indication that more + verbose output should be given. + + Sub-objects are printed using `print_internal()', which takes + exactly the same arguments as are passed to the print method. + + Literal C strings should be printed using `write_c_string()', or + `write_string_1()' for non-null-terminated strings. + + Functions that do not have a readable representation should check + the `print_readably' flag and signal an error if it is set. + + If you specify NULL for the print method, the + `default_object_printer()' will be used. + + 3. A "finalize" method. This is called at the beginning of the sweep + stage on lcrecords that are about to be freed, and should be used + to perform any extra object cleanup. This typically involves + freeing any extra `malloc()'ed memory associated with the object, + releasing any operating-system and window-system resources + associated with the object (e.g. pixmaps, fonts), etc. + + The finalize method can be NULL if nothing needs to be done. + + WARNING #1: The finalize method is also called at the end of the + dump phase; this time with the for_disksave parameter set to + non-zero. The object is *not* about to disappear, so you have to + make sure to *not* free any extra `malloc()'ed memory if you're + going to need it later. (Also, signal an error if there are any + operating-system and window-system resources here, because they + can't be dumped.) + + Finalize methods should, as a rule, set to zero any pointers after + they've been freed, and check to make sure pointers are not zero + before freeing. Although I'm pretty sure that finalize methods + are not called twice on the same object (except for the + `for_disksave' proviso), we've gotten nastily burned in some cases + by not doing this. + + WARNING #2: The finalize method is *only* called for lcrecords, + *not* for simply lrecords. If you need a finalize method for + simple lrecords, you have to stick it in the + `ADDITIONAL_FREE_foo()' macro in `alloc.c'. + + WARNING #3: Things are in an *extremely* bizarre state when + `ADDITIONAL_FREE_foo()' is called, so you have to be incredibly + careful when writing one of these functions. See the comment in + `gc_sweep()'. If you ever have to add one of these, consider + using an lcrecord or dealing with the problem in a different + fashion. + + 4. An "equal" method. This compares the two objects for similarity, + when `equal' is called. It should compare the contents of the + objects in some reasonable fashion. It is passed the two objects + and a "depth" value, which is used to catch circular objects. To + compare sub-Lisp-objects, call `internal_equal()' and bump the + depth value by one. If this value gets too high, a + `circular-object' error will be signaled. + + If this is NULL, objects are `equal' only when they are `eq', i.e. + identical. + + 5. A "hash" method. This is used to hash objects when they are to be + compared with `equal'. The rule here is that if two objects are + `equal', they *must* hash to the same value; i.e. your hash + function should use some subset of the sub-fields of the object + that are compared in the "equal" method. If you specify this + method as `NULL', the object's pointer will be used as the hash, + which will *fail* if the object has an `equal' method, so don't do + this. + + To hash a sub-Lisp-object, call `internal_hash()'. Bump the depth + by one, just like in the "equal" method. + + To convert a Lisp object directly into a hash value (using its + pointer), use `LISP_HASH()'. This is what happens when the hash + method is NULL. + + To hash two or more values together into a single value, use + `HASH2()', `HASH3()', `HASH4()', etc. + + 6. "getprop", "putprop", "remprop", and "plist" methods. These are + used for object types that have properties. I don't feel like + documenting them here. If you create one of these objects, you + have to use different macros to define them, i.e. + `DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS()' or + `DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS()'. + + 7. A "size_in_bytes" method, when the object is of variable-size. + (i.e. declared with a `_SEQUENCE_IMPLEMENTATION' macro.) This + should simply return the object's size in bytes, exactly as you + might expect. For an example, see the methods for window + configurations and opaques. + + +File: internals.info, Node: Low-level allocation, Next: Pure Space, Prev: lrecords, Up: Allocation of Objects in XEmacs Lisp + +Low-level allocation +==================== + + Memory that you want to allocate directly should be allocated using +`xmalloc()' rather than `malloc()'. This implements error-checking on +the return value, and once upon a time did some more vital stuff (i.e. +`BLOCK_INPUT', which is no longer necessary). Free using `xfree()', +and realloc using `xrealloc()'. Note that `xmalloc()' will do a +non-local exit if the memory can't be allocated. (Many functions, +however, do not expect this, and thus XEmacs will likely crash if this +happens. *This is a bug.* If you can, you should strive to make your +function handle this OK. However, it's difficult in the general +circumstance, perhaps requiring extra unwind-protects and such.) + + Note that XEmacs provides two separate replacements for the standard +`malloc()' library function. These are called "old GNU malloc" +(`malloc.c') and "new GNU malloc" (`gmalloc.c'), respectively. New GNU +malloc is better in pretty much every way than old GNU malloc, and +should be used if possible. (It used to be that on some systems, the +old one worked but the new one didn't. I think this was due +specifically to a bug in SunOS, which the new one now works around; so +I don't think the old one ever has to be used any more.) The primary +difference between both of these mallocs and the standard system malloc +is that they are much faster, at the expense of increased space. The +basic idea is that memory is allocated in fixed chunks of powers of +two. This allows for basically constant malloc time, since the various +chunks can just be kept on a number of free lists. (The standard system +malloc typically allocates arbitrary-sized chunks and has to spend some +time, sometimes a significant amount of time, walking the heap looking +for a free block to use and cleaning things up.) The new GNU malloc +improves on things by allocating large objects in chunks of 4096 bytes +rather than in ever larger powers of two, which results in ever larger +wastage. There is a slight speed loss here, but it's of doubtful +significance. + + NOTE: Apparently there is a third-generation GNU malloc that is +significantly better than the new GNU malloc, and should probably be +included in XEmacs. + + There is also the relocating allocator, `ralloc.c'. This actually +moves blocks of memory around so that the `sbrk()' pointer shrunk and +virtual memory released back to the system. On some systems, this is a +big win. On all systems, it causes a noticeable (and sometimes huge) +speed penalty, so I turn it off by default. `ralloc.c' only works with +the new GNU malloc in `gmalloc.c'. There are also two versions of +`ralloc.c', one that uses `mmap()' rather than block copies to move +data around. This purports to be faster, although that depends on the +amount of data that would have had to be block copied and the +system-call overhead for `mmap()'. I don't know exactly how this +works, except that the relocating-allocation routines are pretty much +used only for the memory allocated for a buffer, which is the biggest +consumer of space, esp. of space that may get freed later. + + Note that the GNU mallocs have some "memory warning" facilities. +XEmacs taps into them and issues a warning through the standard warning +system, when memory gets to 75%, 85%, and 95% full. (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 `allocate_lisp_storage()'. This calls `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 `memory_full()'. +`allocate_lisp_storage()' is called by `alloc_lcrecord()', +`ALLOCATE_FIXED_TYPE()', and the vector and bit-vector creation +routines. These routines also call `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. + + +File: internals.info, Node: Pure Space, Next: Cons, Prev: Low-level allocation, Up: Allocation of Objects in XEmacs Lisp + +Pure Space +========== + + Not yet documented. + + +File: internals.info, Node: Cons, Next: Vector, Prev: Pure Space, Up: Allocation of Objects in XEmacs Lisp + +Cons +==== + + Conses are allocated in standard frob blocks. The only thing to +note is that conses can be explicitly freed using `free_cons()' and +associated functions `free_list()' and `free_alist()'. This +immediately puts the conses onto the cons free list, and decrements the +statistics on memory allocation appropriately. This is used to good +effect by some extremely commonly-used code, to avoid generating extra +objects and thereby triggering GC sooner. However, you have to be +*extremely* careful when doing this. If you mess this up, you will get +BADLY BURNED, and it has happened before. + + +File: internals.info, Node: Vector, Next: Bit Vector, Prev: Cons, Up: Allocation of Objects in XEmacs Lisp + +Vector +====== + + As mentioned above, each vector is `malloc()'ed individually, and +all are threaded through the variable `all_vectors'. Vectors are +marked strangely during garbage collection, by kludging the size field. +Note that the `struct Lisp_Vector' is declared with its `contents' +field being a *stretchy* array of one element. It is actually +`malloc()'ed with the right size, however, and access to any element +through the `contents' array works fine. + + +File: internals.info, Node: Bit Vector, Next: Symbol, Prev: Vector, Up: Allocation of Objects in XEmacs Lisp + +Bit Vector +========== + + Bit vectors work exactly like vectors, except for more complicated +code to access an individual bit, and except for the fact that bit +vectors are lrecords while vectors are not. (The only difference here is +that there's an lrecord implementation pointer at the beginning and the +tag field in bit vector Lisp words is "lrecord" rather than "vector".) + + +File: internals.info, Node: Symbol, Next: Marker, Prev: Bit Vector, Up: Allocation of Objects in XEmacs Lisp + +Symbol +====== + + Symbols are also allocated in frob blocks. Note that the code +exists for symbols to be either lrecords (category (c) above) or simple +types (category (b) above), and are lrecords by default (I think), +although there is no good reason for this. + + Note that symbols in the awful horrible obarray structure are +chained through their `next' field. + + Remember that `intern' looks up a symbol in an obarray, creating one +if necessary. + + +File: internals.info, Node: Marker, Next: String, Prev: Symbol, Up: Allocation of Objects in XEmacs Lisp + +Marker +====== + + Markers are allocated in frob blocks, as usual. They are kept in a +buffer unordered, but in a doubly-linked list so that they can easily +be removed. (Formerly this was a singly-linked list, but in some cases +garbage collection took an extraordinarily long time due to the O(N^2) +time required to remove lots of markers from a buffer.) Markers are +removed from a buffer in the finalize stage, in +`ADDITIONAL_FREE_marker()'. + + +File: internals.info, Node: String, Next: Compiled Function, Prev: Marker, Up: Allocation of Objects in XEmacs Lisp + +String +====== + + As mentioned above, strings are a special case. A string is +logically two parts, a fixed-size object (containing the length, +property list, and a pointer to the actual data), and the actual data +in the string. The fixed-size object is a `struct Lisp_String' and is +allocated in frob blocks, as usual. The actual data is stored in +special "string-chars blocks", which are 8K blocks of memory. +Currently-allocated strings are simply laid end to end in these +string-chars blocks, with a pointer back to the `struct Lisp_String' +stored before each string in the string-chars block. When a new string +needs to be allocated, the remaining space at the end of the last +string-chars block is used if there's enough, and a new string-chars +block is created otherwise. + + There are never any holes in the string-chars blocks due to the +string compaction and relocation that happens at the end of garbage +collection. During the sweep stage of garbage collection, when objects +are reclaimed, the garbage collector goes through all string-chars +blocks, looking for unused strings. Each chunk of string data is +preceded by a pointer to the corresponding `struct Lisp_String', which +indicates both whether the string is used and how big the string is, +i.e. how to get to the next chunk of string data. Holes are compressed +by block-copying the next string into the empty space and relocating the +pointer stored in the corresponding `struct Lisp_String'. *This means +you have to be careful with strings in your code.* See the section +above on `GCPRO'ing. + + Note that there is one situation not handled: a string that is too +big to fit into a string-chars block. Such strings, called "big +strings", are all `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.) + + Note also that the string data in string-chars blocks is padded as +necessary so that proper alignment constraints on the `struct +Lisp_String' back pointers are maintained. + + Finally, strings can be resized. This happens in Mule when a +character is substituted with a different-length character, or during +modeline frobbing. (You could also export this to Lisp, but it's not +done so currently.) Resizing a string is a potentially tricky process. +If the change is small enough that the padding can absorb it, nothing +other than a simple memory move needs to be done. Keep in mind, +however, that the string can't shrink too much because the offset to the +next string in the string-chars block is computed by looking at the +length and rounding to the nearest multiple of four or eight. If the +string would shrink or expand beyond the correct padding, new string +data needs to be allocated at the end of the last string-chars block and +the data moved appropriately. This leaves some dead string data, which +is marked by putting a special marker of 0xFFFFFFFF in the `struct +Lisp_String' pointer before the data (there's no real `struct +Lisp_String' to point to and relocate), and storing the size of the dead +string data (which would normally be obtained from the now-non-existent +`struct Lisp_String') at the beginning of the dead string data gap. +The string compactor recognizes this special 0xFFFFFFFF marker and +handles it correctly. + + +File: internals.info, Node: Compiled Function, Prev: String, Up: Allocation of Objects in XEmacs Lisp + +Compiled Function +================= + + Not yet documented. + + +File: internals.info, Node: Events and the Event Loop, Next: Evaluation; Stack Frames; Bindings, Prev: Allocation of Objects in XEmacs Lisp, Up: Top + +Events and the Event Loop +************************* + +* Menu: + +* Introduction to Events:: +* Main Loop:: +* Specifics of the Event Gathering Mechanism:: +* Specifics About the Emacs Event:: +* The Event Stream Callback Routines:: +* Other Event Loop Functions:: +* Converting Events:: +* Dispatching Events; The Command Builder:: + + +File: internals.info, Node: Introduction to Events, Next: Main Loop, Up: Events and the Event Loop + +Introduction to Events +====================== + + An event is an object that encapsulates information about an +interesting occurrence in the operating system. Events are generated +either by user action, direct (e.g. typing on the keyboard or moving +the mouse) or indirect (moving another window, thereby generating an +expose event on an Emacs frame), or as a result of some other typically +asynchronous action happening, such as output from a subprocess being +ready or a timer expiring. Events come into the system in an +asynchronous fashion (typically through a callback being called) and +are converted into a synchronous event queue (first-in, first-out) in a +process that we will call "collection". + + Note that each application has its own event queue. (It is +immaterial whether the collection process directly puts the events in +the proper application's queue, or puts them into a single system +queue, which is later split up.) + + The most basic level of event collection is done by the operating +system or window system. Typically, XEmacs does its own event +collection as well. Often there are multiple layers of collection in +XEmacs, with events from various sources being collected into a queue, +which is then combined with other sources to go into another queue +(i.e. a second level of collection), with perhaps another level on top +of this, etc. + + XEmacs has its own types of events (called "Emacs events"), which +provides an abstract layer on top of the system-dependent 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 are documented in `events.h'; I'll discuss them later. + diff --git a/info/internals.info-6 b/info/internals.info-6 new file mode 100644 index 0000000..2692bef --- /dev/null +++ b/info/internals.info-6 @@ -0,0 +1,1019 @@ +This is Info file ../../info/internals.info, produced by Makeinfo +version 1.68 from the input file internals.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Internals: (internals). XEmacs Internals Manual. +END-INFO-DIR-ENTRY + + Copyright (C) 1992 - 1996 Ben Wing. Copyright (C) 1996, 1997 Sun +Microsystems. Copyright (C) 1994 - 1998 Free Software Foundation. +Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: internals.info, Node: Main Loop, Next: Specifics of the Event Gathering Mechanism, Prev: Introduction to Events, Up: Events and the Event Loop + +Main Loop +========= + + The "command loop" is the top-level loop that the editor is always +running. It loops endlessly, calling `next-event' to retrieve an event +and `dispatch-event' to execute it. `dispatch-event' does the +appropriate thing with non-user events (process, timeout, magic, eval, +mouse motion); this involves calling a Lisp handler function, redrawing +a newly-exposed part of a frame, reading subprocess output, etc. For +user events, `dispatch-event' looks up the event in relevant keymaps or +menubars; when a full key sequence or menubar selection is reached, the +appropriate function is executed. `dispatch-event' may have to keep +state across calls; this is done in the "command-builder" structure +associated with each console (remember, there's usually only one +console), and the engine that looks up keystrokes and constructs full +key sequences is called the "command builder". This is documented +elsewhere. + + The guts of the command loop are in `command_loop_1()'. This +function doesn't catch errors, though - that's the job of +`command_loop_2()', which is a condition-case (i.e. error-trapping) +wrapper around `command_loop_1()'. `command_loop_1()' never returns, +but may get thrown out of. + + When an error occurs, `cmd_error()' is called, which usually invokes +the Lisp error handler in `command-error'; however, a default error +handler is provided if `command-error' is `nil' (e.g. during startup). +The purpose of the error handler is simply to display the error message +and do associated cleanup; it does not need to throw anywhere. When +the error handler finishes, the condition-case in `command_loop_2()' +will finish and `command_loop_2()' will reinvoke `command_loop_1()'. + + `command_loop_2()' is invoked from three places: from +`initial_command_loop()' (called from `main()' at the end of internal +initialization), from the Lisp function `recursive-edit', and from +`call_command_loop()'. + + `call_command_loop()' is called when a macro is started and when the +minibuffer is entered; normal termination of the macro or minibuffer +causes a throw out of the recursive command loop. (To +`execute-kbd-macro' for macros and `exit' for minibuffers. Note also +that the low-level minibuffer-entering function, +`read-minibuffer-internal', provides its own error handling and does +not need `command_loop_2()''s error encapsulation; so it tells +`call_command_loop()' to invoke `command_loop_1()' directly.) + + Note that both read-minibuffer-internal and recursive-edit set up a +catch for `exit'; this is why `abort-recursive-edit', which throws to +this catch, exits out of either one. + + `initial_command_loop()', called from `main()', sets up a catch for +`top-level' when invoking `command_loop_2()', allowing functions to +throw all the way to the top level if they really need to. Before +invoking `command_loop_2()', `initial_command_loop()' calls +`top_level_1()', which handles all of the startup stuff (creating the +initial frame, handling the command-line options, loading the user's +`.emacs' file, etc.). The function that actually does this is in Lisp +and is pointed to by the variable `top-level'; normally this function is +`normal-top-level'. `top_level_1()' is just an error-handling wrapper +similar to `command_loop_2()'. Note also that `initial_command_loop()' +sets up a catch for `top-level' when invoking `top_level_1()', just +like when it invokes `command_loop_2()'. + + +File: internals.info, Node: Specifics of the Event Gathering Mechanism, Next: Specifics About the Emacs Event, Prev: Main Loop, Up: Events and the Event Loop + +Specifics of the Event Gathering Mechanism +========================================== + + Here is an approximate diagram of the collection processes at work +in XEmacs, under TTY's (TTY's are simpler than X so we'll look at this +first): + + asynch. asynch. asynch. asynch. [Collectors in + kbd events kbd events process process the OS] + | | output output + | | | | + | | | | SIGINT, [signal handlers + | | | | SIGQUIT, in XEmacs] + V V V V SIGWINCH, + file file file file SIGALRM + desc. desc. desc. desc. | + (TTY) (TTY) (pipe) (pipe) | + | | | | fake timeouts + | | | | file | + | | | | desc. | + | | | | (pipe) | + | | | | | | + | | | | | | + | | | | | | + V V V V V V + ------>-----------<----------------<---------------- + | + | + | [collected using select() in emacs_tty_next_event() + | and converted to the appropriate Emacs event] + | + | + V (above this line is TTY-specific) + Emacs ----------------------------------------------- + event (below this line is the generic event mechanism) + | + | + was there if not, call + a SIGINT? emacs_tty_next_event() + | | + | | + | | + V V + --->------<---- + | + | [collected in event_stream_next_event(); + | SIGINT is converted using maybe_read_quit_event()] + V + Emacs + event + | + \---->------>----- maybe_kbd_translate() ---->---\ + | + | + | + command event queue | + if not from command + (contains events that were event queue, call + read earlier but not processed, event_stream_next_event() + typically when waiting in a | + sit-for, sleep-for, etc. for | + a particular event to be received) | + | | + | | + V V + ---->------------------------------------<---- + | + | [collected in + | next_event_internal()] + | + unread- unread- event from | + command- command- keyboard else, call + events event macro next_event_internal() + | | | | + | | | | + | | | | + V V V V + --------->----------------------<------------ + | + | [collected in `next-event', which may loop + | more than once if the event it gets is on + | a dead frame, device, etc.] + | + | + V + feed into top-level event loop, + which repeatedly calls `next-event' + and then dispatches the event + using `dispatch-event' + + Notice the separation between TTY-specific and generic event +mechanism. When using the Xt-based event loop, the TTY-specific stuff +is replaced but the rest stays the same. + + It's also important to realize that only one different kind of +system-specific event loop can be operating at a time, and must be able +to receive all kinds of events simultaneously. For the two existing +event loops (implemented in `event-tty.c' and `event-Xt.c', +respectively), the TTY event loop *only* handles TTY consoles, while +the Xt event loop handles *both* TTY and X consoles. This situation is +different from all of the output handlers, where you simply have one +per console type. + + Here's the Xt Event Loop Diagram (notice that below a certain point, +it's the same as the above diagram): + + asynch. asynch. asynch. asynch. [Collectors in + kbd kbd process process the OS] + events events output output + | | | | + | | | | asynch. asynch. [Collectors in the + | | | | X X OS and X Window System] + | | | | events events + | | | | | | + | | | | | | + | | | | | | SIGINT, [signal handlers + | | | | | | SIGQUIT, in XEmacs] + | | | | | | SIGWINCH, + | | | | | | SIGALRM + | | | | | | | + | | | | | | | + | | | | | | | timeouts + | | | | | | | | + | | | | | | | | + | | | | | | V | + V V V V V V fake | + file file file file file file file | + desc. desc. desc. desc. desc. desc. desc. | + (TTY) (TTY) (pipe) (pipe) (socket) (socket) (pipe) | + | | | | | | | | + | | | | | | | | + | | | | | | | | + V V V V V V V V + --->----------------------------------------<---------<------ + | | | + | | |[collected using select() in + | | | _XtWaitForSomething(), called + | | | from XtAppProcessEvent(), called + | | | in emacs_Xt_next_event(); + | | | dispatched to various callbacks] + | | | + | | | + emacs_Xt_ p_s_callback(), | [popup_selection_callback] + event_handler() x_u_v_s_callback(),| [x_update_vertical_scrollbar_ + | x_u_h_s_callback(),| callback] + | search_callback() | [x_update_horizontal_scrollbar_ + | | | callback] + | | | + | | | + enqueue_Xt_ signal_special_ | + dispatch_event() Xt_user_event() | + [maybe multiple | | + times, maybe 0 | | + times] | | + | enqueue_Xt_ | + | dispatch_event() | + | | | + | | | + V V | + -->----------<-- | + | | + | | + dispatch Xt_what_callback() + event sets flags + queue | + | | + | | + | | + | | + ---->-----------<-------- + | + | + | [collected and converted as appropriate in + | emacs_Xt_next_event()] + | + | + V (above this line is Xt-specific) + Emacs ------------------------------------------------ + event (below this line is the generic event mechanism) + | + | + was there if not, call + a SIGINT? emacs_Xt_next_event() + | | + | | + | | + V V + --->-------<---- + | + | [collected in event_stream_next_event(); + | SIGINT is converted using maybe_read_quit_event()] + V + Emacs + event + | + \---->------>----- maybe_kbd_translate() -->-----\ + | + | + | + command event queue | + if not from command + (contains events that were event queue, call + read earlier but not processed, event_stream_next_event() + typically when waiting in a | + sit-for, sleep-for, etc. for | + a particular event to be received) | + | | + | | + V V + ---->----------------------------------<------ + | + | [collected in + | next_event_internal()] + | + unread- unread- event from | + command- command- keyboard else, call + events event macro next_event_internal() + | | | | + | | | | + | | | | + V V V V + --------->----------------------<------------ + | + | [collected in `next-event', which may loop + | more than once if the event it gets is on + | a dead frame, device, etc.] + | + | + V + feed into top-level event loop, + which repeatedly calls `next-event' + and then dispatches the event + using `dispatch-event' + + +File: internals.info, Node: Specifics About the Emacs Event, Next: The Event Stream Callback Routines, Prev: Specifics of the Event Gathering Mechanism, Up: Events and the Event Loop + +Specifics About the Emacs Event +=============================== + + +File: internals.info, Node: The Event Stream Callback Routines, Next: Other Event Loop Functions, Prev: Specifics About the Emacs Event, Up: Events and the Event Loop + +The Event Stream Callback Routines +================================== + + +File: internals.info, Node: Other Event Loop Functions, Next: Converting Events, Prev: The Event Stream Callback Routines, Up: Events and the Event Loop + +Other Event Loop Functions +========================== + + `detect_input_pending()' and `input-pending-p' look for input by +calling `event_stream->event_pending_p' and looking in +`[V]unread-command-event' and the `command_event_queue' (they do not +check for an executing keyboard macro, though). + + `discard-input' cancels any command events pending (and any keyboard +macros currently executing), and puts the others onto the +`command_event_queue'. There is a comment about a "race condition", +which is not a good sign. + + `next-command-event' and `read-char' are higher-level interfaces to +`next-event'. `next-command-event' gets the next "command" event (i.e. +keypress, mouse event, menu selection, or scrollbar action), calling +`dispatch-event' on any others. `read-char' calls `next-command-event' +and uses `event_to_character()' to return the character equivalent. +With the right kind of input method support, it is possible for +(read-char) to return a Kanji character. + + +File: internals.info, Node: Converting Events, Next: Dispatching Events; The Command Builder, Prev: Other Event Loop Functions, Up: Events and the Event Loop + +Converting Events +================= + + `character_to_event()', `event_to_character()', +`event-to-character', and `character-to-event' convert between +characters and keypress events corresponding to the characters. If the +event was not a keypress, `event_to_character()' returns -1 and +`event-to-character' returns `nil'. These functions convert between +character representation and the split-up event representation (keysym +plus mod keys). + + +File: internals.info, Node: Dispatching Events; The Command Builder, Prev: Converting Events, Up: Events and the Event Loop + +Dispatching Events; The Command Builder +======================================= + + Not yet documented. + + +File: internals.info, Node: Evaluation; Stack Frames; Bindings, Next: Symbols and Variables, Prev: Events and the Event Loop, Up: Top + +Evaluation; Stack Frames; Bindings +********************************** + +* Menu: + +* Evaluation:: +* Dynamic Binding; The specbinding Stack; Unwind-Protects:: +* Simple Special Forms:: +* Catch and Throw:: + + +File: internals.info, Node: Evaluation, Next: Dynamic Binding; The specbinding Stack; Unwind-Protects, Up: Evaluation; Stack Frames; Bindings + +Evaluation +========== + + `Feval()' evaluates the form (a Lisp object) that is passed to it. +Note that evaluation is only non-trivial for two types of objects: +symbols and conses. A symbol is evaluated simply by calling +`symbol-value' on it and returning the value. + + Evaluating a cons means calling a function. First, `eval' checks to +see if garbage-collection is necessary, and calls `garbage_collect_1()' +if so. It then increases the evaluation depth by 1 (`lisp_eval_depth', +which is always less than `max_lisp_eval_depth') and adds an element to +the linked list of `struct backtrace''s (`backtrace_list'). Each such +structure contains a pointer to the function being called plus a list +of the function's arguments. Originally these values are stored +unevalled, and as they are evaluated, the backtrace structure is +updated. Garbage collection pays attention to the objects pointed to +in the backtrace structures (garbage collection might happen while a +function is being called or while an argument is being evaluated, and +there could easily be no other references to the arguments in the +argument list; once an argument is evaluated, however, the unevalled +version is not needed by eval, and so the backtrace structure is +changed). + + At this point, the function to be called is determined by looking at +the car of the cons (if this is a symbol, its function definition is +retrieved and the process repeated). The function should then consist +of either a `Lisp_Subr' (built-in function written in C), a +`Lisp_Compiled_Function' object, or a cons whose car is one of the +symbols `autoload', `macro' or `lambda'. + + If the function is a `Lisp_Subr', the lisp object points to a +`struct Lisp_Subr' (created by `DEFUN()'), which contains a pointer to +the C function, a minimum and maximum number of arguments (or possibly +the special constants `MANY' or `UNEVALLED'), a pointer to the symbol +referring to that subr, and a couple of other things. If the subr +wants its arguments `UNEVALLED', they are passed raw as a list. +Otherwise, an array of evaluated arguments is created and put into the +backtrace structure, and either passed whole (`MANY') or each argument +is passed as a C argument. + + If the function is a `Lisp_Compiled_Function', +`funcall_compiled_function()' is called. If the function is a lambda +list, `funcall_lambda()' is called. If the function is a macro, [..... +fill in] is done. If the function is an autoload, `do_autoload()' is +called to load the definition and then eval starts over [explain this +more]. + + When `Feval()' exits, the evaluation depth is reduced by one, the +debugger is called if appropriate, and the current backtrace structure +is removed from the list. + + Both `funcall_compiled_function()' and `funcall_lambda()' need to go +through the list of formal parameters to the function and bind them to +the actual arguments, checking for `&rest' and `&optional' symbols in +the formal parameters and making sure the number of actual arguments is +correct. `funcall_compiled_function()' can do this a little more +efficiently, since the formal parameter list can be checked for sanity +when the compiled function object is created. + + `funcall_lambda()' simply calls `Fprogn' to execute the code in the +lambda list. + + `funcall_compiled_function()' calls the real byte-code interpreter +`execute_optimized_program()' on the byte-code instructions, which are +converted into an internal form for faster execution. + + When a compiled function is executed for the first time by +`funcall_compiled_function()', or when it is `Fpurecopy()'ed during the +dump phase of building XEmacs, the byte-code instructions are converted +from a `Lisp_String' (which is inefficient to access, especially in the +presence of MULE) into a `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 +`execute_optimized_program()' can really fly. + + Here are some of the optimizations performed by the internal +byte-code transformer: + 1. References to the `constants' array are checked for out-of-range + indices, so that the byte interpreter doesn't have to. + + 2. References to the `constants' array that will be used as a Lisp + variable are checked for being correct non-constant (i.e. not `t', + `nil', or `keywordp') symbols, so that the byte interpreter + doesn't have to. + + 3. The maxiumum number of variable bindings in the byte-code is + pre-computed, so that space on the `specpdl' stack can be + pre-reserved once for the whole function execution. + + 4. All byte-code jumps are relative to the current program counter + instead of the start of the program, thereby saving a register. + + 5. One-byte relative jumps are converted from the byte-code form of + unsigned chars offset by 127 to machine-friendly signed chars. + + Of course, this transformation of the `instructions' should not be +visible to the user, so `Fcompiled_function_instructions()' needs to +know how to convert the optimized opaque object back into a Lisp string +that is identical to the original string from the `.elc' file. +(Actually, the resulting string may (rarely) contain slightly +different, yet equivalent, byte code.) + + `Ffuncall()' implements Lisp `funcall'. `(funcall fun x1 x2 x3 +...)' is equivalent to `(eval (list fun (quote x1) (quote x2) (quote +x3) ...))'. `Ffuncall()' contains its own code to do the evaluation, +however, and is very similar to `Feval()'. + + From the performance point of view, it is worth knowing that most of +the time in Lisp evaluation is spent executing `Lisp_Subr' and +`Lisp_Compiled_Function' objects via `Ffuncall()' (not `Feval()'). + + `Fapply()' implements Lisp `apply', which is very similar to +`funcall' except that if the last argument is a list, the result is the +same as if each of the arguments in the list had been passed separately. +`Fapply()' does some business to expand the last argument if it's a +list, then calls `Ffuncall()' to do the work. + + `apply1()', `call0()', `call1()', `call2()', and `call3()' call a +function, passing it the argument(s) given (the arguments are given as +separate C arguments rather than being passed as an array). `apply1()' +uses `Fapply()' while the others use `Ffuncall()' to do the real work. + + +File: internals.info, Node: Dynamic Binding; The specbinding Stack; Unwind-Protects, Next: Simple Special Forms, Prev: Evaluation, Up: Evaluation; Stack Frames; Bindings + +Dynamic Binding; The specbinding Stack; Unwind-Protects +======================================================= + + struct specbinding + { + Lisp_Object symbol; + Lisp_Object old_value; + Lisp_Object (*func) (Lisp_Object); /* for unwind-protect */ + }; + + `struct specbinding' is used for local-variable bindings and +unwind-protects. `specpdl' holds an array of `struct specbinding''s, +`specpdl_ptr' points to the beginning of the free bindings in the +array, `specpdl_size' specifies the total number of binding slots in +the array, and `max_specpdl_size' specifies the maximum number of +bindings the array can be expanded to hold. `grow_specpdl()' increases +the size of the `specpdl' array, multiplying its size by 2 but never +exceeding `max_specpdl_size' (except that if this number is less than +400, it is first set to 400). + + `specbind()' binds a symbol to a value and is used for local +variables and `let' forms. The symbol and its old value (which might +be `Qunbound', indicating no prior value) are recorded in the specpdl +array, and `specpdl_size' is increased by 1. + + `record_unwind_protect()' implements an "unwind-protect", which, +when placed around a section of code, ensures that some specified +cleanup routine will be executed even if the code exits abnormally +(e.g. through a `throw' or quit). `record_unwind_protect()' simply +adds a new specbinding to the `specpdl' array and stores the +appropriate information in it. The cleanup routine can either be a C +function, which is stored in the `func' field, or a `progn' form, which +is stored in the `old_value' field. + + `unbind_to()' removes specbindings from the `specpdl' array until +the specified position is reached. Each specbinding can be one of +three types: + + 1. an unwind-protect with a C cleanup function (`func' is not 0, and + `old_value' holds an argument to be passed to the function); + + 2. an unwind-protect with a Lisp form (`func' is 0, `symbol' is + `nil', and `old_value' holds the form to be executed with + `Fprogn()'); or + + 3. a local-variable binding (`func' is 0, `symbol' is not `nil', and + `old_value' holds the old value, which is stored as the symbol's + value). + + +File: internals.info, Node: Simple Special Forms, Next: Catch and Throw, Prev: Dynamic Binding; The specbinding Stack; Unwind-Protects, Up: Evaluation; Stack Frames; Bindings + +Simple Special Forms +==================== + + `or', `and', `if', `cond', `progn', `prog1', `prog2', `setq', +`quote', `function', `let*', `let', `while' + + All of these are very simple and work as expected, calling `Feval()' +or `Fprogn()' as necessary and (in the case of `let' and `let*') using +`specbind()' to create bindings and `unbind_to()' to undo the bindings +when finished. + + Note that, with the exeption of `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. + + +File: internals.info, Node: Catch and Throw, Prev: Simple Special Forms, Up: Evaluation; Stack Frames; Bindings + +Catch and Throw +=============== + + struct catchtag + { + Lisp_Object tag; + Lisp_Object val; + struct catchtag *next; + struct gcpro *gcpro; + jmp_buf jmp; + struct backtrace *backlist; + int lisp_eval_depth; + int pdlcount; + }; + + `catch' is a Lisp function that places a catch around a body of +code. A catch is a means of non-local exit from the code. When a catch +is created, a tag is specified, and executing a `throw' to this tag +will exit from the body of code caught with this tag, and its value will +be the value given in the call to `throw'. If there is no such call, +the code will be executed normally. + + Information pertaining to a catch is held in a `struct catchtag', +which is placed at the head of a linked list pointed to by `catchlist'. +`internal_catch()' is passed a C function to call (`Fprogn()' when +Lisp `catch' is called) and arguments to give it, and places a catch +around the function. Each `struct catchtag' is held in the stack frame +of the `internal_catch()' instance that created the catch. + + `internal_catch()' is fairly straightforward. It stores into the +`struct catchtag' the tag name and the current values of +`backtrace_list', `lisp_eval_depth', `gcprolist', and the offset into +the `specpdl' array, sets a jump point with `_setjmp()' (storing the +jump point into the `struct catchtag'), and calls the function. +Control will return to `internal_catch()' either when the function +exits normally or through a `_longjmp()' to this jump point. In the +latter case, `throw' will store the value to be returned into the +`struct catchtag' before jumping. When it's done, `internal_catch()' +removes the `struct catchtag' from the catchlist and returns the proper +value. + + `Fthrow()' goes up through the catchlist until it finds one with a +matching tag. It then calls `unbind_catch()' to restore everything to +what it was when the appropriate catch was set, stores the return value +in the `struct catchtag', and jumps (with `_longjmp()') to its jump +point. + + `unbind_catch()' removes all catches from the catchlist until it +finds the correct one. Some of the catches might have been placed for +error-trapping, and if so, the appropriate entries on the handlerlist +must be removed (see "errors"). `unbind_catch()' also restores the +values of `gcprolist', `backtrace_list', and `lisp_eval', and calls +`unbind_to()' to undo any specbindings created since the catch. + + +File: internals.info, Node: Symbols and Variables, Next: Buffers and Textual Representation, Prev: Evaluation; Stack Frames; Bindings, Up: Top + +Symbols and Variables +********************* + +* Menu: + +* Introduction to Symbols:: +* Obarrays:: +* Symbol Values:: + + +File: internals.info, Node: Introduction to Symbols, Next: Obarrays, Up: Symbols and Variables + +Introduction to Symbols +======================= + + A symbol is basically just an object with four fields: a name (a +string), a value (some Lisp object), a function (some Lisp object), and +a property list (usually a list of alternating keyword/value pairs). +What makes symbols special is that there is usually only one symbol with +a given name, and the symbol is referred to by name. This makes a +symbol a convenient way of calling up data by name, i.e. of implementing +variables. (The variable's value is stored in the "value slot".) +Similarly, functions are referenced by name, and the definition of the +function is stored in a symbol's "function slot". This means that +there can be a distinct function and variable with the same name. The +property list is used as a more general mechanism of associating +additional values with particular names, and once again the namespace is +independent of the function and variable namespaces. + + +File: internals.info, Node: Obarrays, Next: Symbol Values, Prev: Introduction to Symbols, Up: Symbols and Variables + +Obarrays +======== + + The identity of symbols with their names is accomplished through a +structure called an obarray, which is just a poorly-implemented hash +table mapping from strings to symbols whose name is that string. (I say +"poorly implemented" because an obarray appears in Lisp as a vector +with some hidden fields rather than as its own opaque type. This is an +Emacs Lisp artifact that should be fixed.) + + Obarrays are implemented as a vector of some fixed size (which should +be a prime for best results), where each "bucket" of the vector +contains one or more symbols, threaded through a hidden `next' field in +the symbol. Lookup of a symbol in an obarray, and adding a symbol to +an obarray, is accomplished through standard hash-table techniques. + + The standard Lisp function for working with symbols and obarrays is +`intern'. This looks up a symbol in an obarray given its name; if it's +not found, a new symbol is automatically created with the specified +name, added to the obarray, and returned. This is what happens when the +Lisp reader encounters a symbol (or more precisely, encounters the name +of a symbol) in some text that it is reading. There is a standard +obarray called `obarray' that is used for this purpose, although the +Lisp programmer is free to create his own obarrays and `intern' symbols +in them. + + Note that, once a symbol is in an obarray, it stays there until +something is done about it, and the standard obarray `obarray' always +stays around, so once you use any particular variable name, a +corresponding symbol will stay around in `obarray' until you exit +XEmacs. + + Note that `obarray' itself is a variable, and as such there is a +symbol in `obarray' whose name is `"obarray"' and which contains +`obarray' as its value. + + Note also that this call to `intern' occurs only when in the Lisp +reader, not when the code is executed (at which point the symbol is +already around, stored as such in the definition of the function). + + You can create your own obarray using `make-vector' (this is +horrible but is an artifact) and intern symbols into that obarray. +Doing that will result in two or more symbols with the same name. +However, at most one of these symbols is in the standard `obarray': You +cannot have two symbols of the same name in any particular obarray. +Note that you cannot add a symbol to an obarray in any fashion other +than using `intern': i.e. you can't take an existing symbol and put it +in an existing obarray. Nor can you change the name of an existing +symbol. (Since obarrays are vectors, you can violate the consistency of +things by storing directly into the vector, but let's ignore that +possibility.) + + Usually symbols are created by `intern', but if you really want, you +can explicitly create a symbol using `make-symbol', giving it some +name. The resulting symbol is not in any obarray (i.e. it is +"uninterned"), and you can't add it to any obarray. Therefore its +primary purpose is as a symbol to use in macros to avoid namespace +pollution. It can also be used as a carrier of information, but cons +cells could probably be used just as well. + + You can also use `intern-soft' to look up a symbol but not create a +new one, and `unintern' to remove a symbol from an obarray. This +returns the removed symbol. (Remember: You can't put the symbol back +into any obarray.) Finally, `mapatoms' maps over all of the symbols in +an obarray. + + +File: internals.info, Node: Symbol Values, Prev: Obarrays, Up: Symbols and Variables + +Symbol Values +============= + + The value field of a symbol normally contains a Lisp object. +However, a symbol can be "unbound", meaning that it logically has no +value. This is internally indicated by storing a special Lisp object, +called "the unbound marker" and stored in the global variable +`Qunbound'. The unbound marker is of a special Lisp object type called +"symbol-value-magic". It is impossible for the Lisp programmer to +directly create or access any object of this type. + + *You must not let any "symbol-value-magic" object escape to the Lisp +level.* Printing any of these objects will cause the message `INTERNAL +EMACS BUG' to appear as part of the print representation. (You may see +this normally when you call `debug_print()' from the debugger on a Lisp +object.) If you let one of these objects escape to the Lisp level, you +will violate a number of assumptions contained in the C code and make +the unbound marker not function right. + + When a symbol is created, its value field (and function field) are +set to `Qunbound'. The Lisp programmer can restore these conditions +later using `makunbound' or `fmakunbound', and can query to see whether +the value of function fields are "bound" (i.e. have a value other than +`Qunbound') using `boundp' and `fboundp'. The fields are set to a +normal Lisp object using `set' (or `setq') and `fset'. + + Other symbol-value-magic objects are used as special markers to +indicate variables that have non-normal properties. This includes any +variables that are tied into C variables (setting the variable magically +sets some global variable in the C code, and likewise for retrieving the +variable's value), variables that magically tie into slots in the +current buffer, variables that are buffer-local, etc. The +symbol-value-magic object is stored in the value cell in place of a +normal object, and the code to retrieve a symbol's value (i.e. +`symbol-value') knows how to do special things with them. This means +that you should not just fetch the value cell directly if you want a +symbol's value. + + The exact workings of this are rather complex and involved and are +well-documented in comments in `buffer.c', `symbols.c', and `lisp.h'. + + +File: internals.info, Node: Buffers and Textual Representation, Next: MULE Character Sets and Encodings, Prev: Symbols and Variables, Up: Top + +Buffers and Textual Representation +********************************** + +* Menu: + +* Introduction to Buffers:: A buffer holds a block of text such as a file. +* The Text in a Buffer:: Representation of the text in a buffer. +* Buffer Lists:: Keeping track of all buffers. +* Markers and Extents:: Tagging locations within a buffer. +* Bufbytes and Emchars:: Representation of individual characters. +* The Buffer Object:: The Lisp object corresponding to a buffer. + + +File: internals.info, Node: Introduction to Buffers, Next: The Text in a Buffer, Up: Buffers and Textual Representation + +Introduction to Buffers +======================= + + A buffer is logically just a Lisp object that holds some text. In +this, it is like a string, but a buffer is optimized for frequent +insertion and deletion, while a string is not. Furthermore: + + 1. Buffers are "permanent" objects, i.e. once you create them, they + remain around, and need to be explicitly deleted before they go + away. + + 2. Each buffer has a unique name, which is a string. Buffers are + normally referred to by name. In this respect, they are like + symbols. + + 3. Buffers have a default insertion position, called "point". + Inserting text (unless you explicitly give a position) goes at + point, and moves point forward past the text. This is what is + going on when you type text into Emacs. + + 4. Buffers have lots of extra properties associated with them. + + 5. Buffers can be "displayed". What this means is that there exist a + number of "windows", which are objects that correspond to some + visible section of your display, and each window has an associated + buffer, and the current contents of the buffer are shown in that + section of the display. The redisplay mechanism (which takes care + of doing this) knows how to look at the text of a buffer and come + up with some reasonable way of displaying this. Many of the + properties of a buffer control how the buffer's text is displayed. + + 6. One buffer is distinguished and called the "current buffer". It is + stored in the variable `current_buffer'. Buffer operations operate + on this buffer by default. When you are typing text into a + buffer, the buffer you are typing into is always `current_buffer'. + Switching to a different window changes the current buffer. Note + that Lisp code can temporarily change the current buffer using + `set-buffer' (often enclosed in a `save-excursion' so that the + former current buffer gets restored when the code is finished). + However, calling `set-buffer' will NOT cause a permanent change in + the current buffer. The reason for this is that the top-level + event loop sets `current_buffer' to the buffer of the selected + window, each time it finishes executing a user command. + + Make sure you understand the distinction between "current buffer" +and "buffer of the selected window", and the distinction between +"point" of the current buffer and "window-point" of the selected +window. (This latter distinction is explained in detail in the section +on windows.) + + +File: internals.info, Node: The Text in a Buffer, Next: Buffer Lists, Prev: Introduction to Buffers, Up: Buffers and Textual Representation + +The Text in a Buffer +==================== + + The text in a buffer consists of a sequence of zero or more +characters. A "character" is an integer that logically represents a +letter, number, space, or other unit of text. Most of the characters +that you will typically encounter belong to the ASCII set of characters, +but there are also characters for various sorts of accented letters, +special symbols, Chinese and Japanese ideograms (i.e. Kanji, Katakana, +etc.), Cyrillic and Greek letters, etc. The actual number of possible +characters is quite large. + + For now, we can view a character as some non-negative integer that +has some shape that defines how it typically appears (e.g. as an +uppercase A). (The exact way in which a character appears depends on the +font used to display the character.) The internal type of characters in +the C code is an `Emchar'; this is just an `int', but using a symbolic +type makes the code clearer. + + Between every character in a buffer is a "buffer position" or +"character position". We can speak of the character before or after a +particular buffer position, and when you insert a character at a +particular position, all characters after that position end up at new +positions. When we speak of the character "at" a position, we really +mean the character after the position. (This schizophrenia between a +buffer position being "between" a character and "on" a character is +rampant in Emacs.) + + Buffer positions are numbered starting at 1. This means that +position 1 is before the first character, and position 0 is not valid. +If there are N characters in a buffer, then buffer position N+1 is +after the last one, and position N+2 is not valid. + + The internal makeup of the Emchar integer varies depending on whether +we have compiled with MULE support. If not, the Emchar integer is an +8-bit integer with possible values from 0 - 255. 0 - 127 are the +standard ASCII characters, while 128 - 255 are the characters from the +ISO-8859-1 character set. If we have compiled with MULE support, an +Emchar is a 19-bit integer, with the various bits having meanings +according to a complex scheme that will be detailed later. The +characters numbered 0 - 255 still have the same meanings as for the +non-MULE case, though. + + Internally, the text in a buffer is represented in a fairly simple +fashion: as a contiguous array of bytes, with a "gap" of some size in +the middle. Although the gap is of some substantial size in bytes, +there is no text contained within it: From the perspective of the text +in the buffer, it does not exist. The gap logically sits at some buffer +position, between two characters (or possibly at the beginning or end of +the buffer). Insertion of text in a buffer at a particular position is +always accomplished by first moving the gap to that position (i.e. +through some block moving of text), then writing the text into the +beginning of the gap, thereby shrinking the gap. If the gap shrinks +down to nothing, a new gap is created. (What actually happens is that a +new gap is "created" at the end of the buffer's text, which requires +nothing more than changing a couple of indices; then the gap is "moved" +to the position where the insertion needs to take place by moving up in +memory all the text after that position.) Similarly, deletion occurs +by moving the gap to the place where the text is to be deleted, and +then simply expanding the gap to include the deleted text. +("Expanding" and "shrinking" the gap as just described means just that +the internal indices that keep track of where the gap is located are +changed.) + + Note that the total amount of memory allocated for a buffer text +never decreases while the buffer is live. Therefore, if you load up a +20-megabyte file and then delete all but one character, there will be a +20-megabyte gap, which won't get any smaller (except by inserting +characters back again). Once the buffer is killed, the memory allocated +for the buffer text will be freed, but it will still be sitting on the +heap, taking up virtual memory, and will not be released back to the +operating system. (However, if you have compiled XEmacs with rel-alloc, +the situation is different. In this case, the space *will* be released +back to the operating system. However, this tends to result in a +noticeable speed penalty.) + + Astute readers may notice that the text in a buffer is represented as +an array of *bytes*, while (at least in the MULE case) an Emchar is a +19-bit integer, which clearly cannot fit in a byte. This means (of +course) that the text in a buffer uses a different representation from +an Emchar: specifically, the 19-bit Emchar becomes a series of one to +four bytes. The conversion between these two representations is complex +and will be described later. + + In the non-MULE case, everything is very simple: An Emchar is an +8-bit value, which fits neatly into one byte. + + If we are given a buffer position and want to retrieve the character +at that position, we need to follow these steps: + + 1. Pretend there's no gap, and convert the buffer position into a + "byte index" that indexes to the appropriate byte in the buffer's + stream of textual bytes. By convention, byte indices begin at 1, + just like buffer positions. In the non-MULE case, byte indices + and buffer positions are identical, since one character equals one + byte. + + 2. Convert the byte index into a "memory index", which takes the gap + into account. The memory index is a direct index into the block of + memory that stores the text of a buffer. This basically just + involves checking to see if the byte index is past the gap, and if + so, adding the size of the gap to it. By convention, memory + indices begin at 1, just like buffer positions and byte indices, + and when referring to the position that is "at" the gap, we always + use the memory position at the *beginning*, not at the end, of the + gap. + + 3. Fetch the appropriate bytes at the determined memory position. + + 4. Convert these bytes into an Emchar. + + In the non-Mule case, (3) and (4) boil down to a simple one-byte +memory access. + + Note that we have defined three types of positions in a buffer: + + 1. "buffer positions" or "character positions", typedef `Bufpos' + + 2. "byte indices", typedef `Bytind' + + 3. "memory indices", typedef `Memind' + + All three typedefs are just `int's, but defining them this way makes +things a lot clearer. + + Most code works with buffer positions. In particular, all Lisp code +that refers to text in a buffer uses buffer positions. Lisp code does +not know that byte indices or memory indices exist. + + Finally, we have a typedef for the bytes in a buffer. This is a +`Bufbyte', which is an unsigned char. Referring to them as Bufbytes +underscores the fact that we are working with a string of bytes in the +internal Emacs buffer representation rather than in one of a number of +possible alternative representations (e.g. EUC-encoded text, etc.). + diff --git a/info/internals.info-7 b/info/internals.info-7 new file mode 100644 index 0000000..79231c67 --- /dev/null +++ b/info/internals.info-7 @@ -0,0 +1,1214 @@ +This is Info file ../../info/internals.info, produced by Makeinfo +version 1.68 from the input file internals.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Internals: (internals). XEmacs Internals Manual. +END-INFO-DIR-ENTRY + + Copyright (C) 1992 - 1996 Ben Wing. Copyright (C) 1996, 1997 Sun +Microsystems. Copyright (C) 1994 - 1998 Free Software Foundation. +Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: internals.info, Node: Buffer Lists, Next: Markers and Extents, Prev: The Text in a Buffer, Up: Buffers and Textual Representation + +Buffer Lists +============ + + Recall earlier that buffers are "permanent" objects, i.e. that they +remain around until explicitly deleted. This entails that there is a +list of all the buffers in existence. This list is actually an +assoc-list (mapping from the buffer's name to the buffer) and is stored +in the global variable `Vbuffer_alist'. + + The order of the buffers in the list is important: the buffers are +ordered approximately from most-recently-used to least-recently-used. +Switching to a buffer using `switch-to-buffer', `pop-to-buffer', etc. +and switching windows using `other-window', etc. usually brings the +new current buffer to the front of the list. `switch-to-buffer', +`other-buffer', etc. look at the beginning of the list to find an +alternative buffer to suggest. You can also explicitly move a buffer +to the end of the list using `bury-buffer'. + + In addition to the global ordering in `Vbuffer_alist', each frame +has its own ordering of the list. These lists always contain the same +elements as in `Vbuffer_alist' although possibly in a different order. +`buffer-list' normally returns the list for the selected frame. This +allows you to work in separate frames without things interfering with +each other. + + The standard way to look up a buffer given a name is `get-buffer', +and the standard way to create a new buffer is `get-buffer-create', +which looks up a buffer with a given name, creating a new one if +necessary. These operations correspond exactly with the symbol +operations `intern-soft' and `intern', respectively. You can also +force a new buffer to be created using `generate-new-buffer', which +takes a name and (if necessary) makes a unique name from this by +appending a number, and then creates the buffer. This is basically +like the symbol operation `gensym'. + + +File: internals.info, Node: Markers and Extents, Next: Bufbytes and Emchars, Prev: Buffer Lists, Up: Buffers and Textual Representation + +Markers and Extents +=================== + + Among the things associated with a buffer are things that are +logically attached to certain buffer positions. This can be used to +keep track of a buffer position when text is inserted and deleted, so +that it remains at the same spot relative to the text around it; to +assign properties to particular sections of text; etc. There are two +such objects that are useful in this regard: they are "markers" and +"extents". + + A "marker" is simply a flag placed at a particular buffer position, +which is moved around as text is inserted and deleted. Markers are +used for all sorts of purposes, such as the `mark' that is the other +end of textual regions to be cut, copied, etc. + + An "extent" is similar to two markers plus some associated +properties, and is used to keep track of regions in a buffer as text is +inserted and deleted, and to add properties (e.g. fonts) to particular +regions of text. The external interface of extents is explained +elsewhere. + + The important thing here is that markers and extents simply contain +buffer positions in them as integers, and every time text is inserted or +deleted, these positions must be updated. In order to minimize the +amount of shuffling that needs to be done, the positions in markers and +extents (there's one per marker, two per extent) and stored in Meminds. +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 +adjusted. Look in `insdel.c' for the details of how this works. + + One other important distinction is that markers are "temporary" +while extents are "permanent". This means that markers disappear as +soon as there are no more pointers to them, and correspondingly, there +is no way to determine what markers are in a buffer if you are just +given the buffer. Extents remain in a buffer until they are detached +(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. + + +File: internals.info, Node: Bufbytes and Emchars, Next: The Buffer Object, Prev: Markers and Extents, Up: Buffers and Textual Representation + +Bufbytes and Emchars +==================== + + Not yet documented. + + +File: internals.info, Node: The Buffer Object, Prev: Bufbytes and Emchars, Up: Buffers and Textual Representation + +The Buffer Object +================= + + Buffers contain fields not directly accessible by the Lisp +programmer. We describe them here, naming them by the names used in +the C code. Many are accessible indirectly in Lisp programs via Lisp +primitives. + +`name' + The buffer name is a string that names the buffer. It is + guaranteed to be unique. *Note Buffer Names: (lispref)Buffer + Names. + +`save_modified' + This field contains the time when the buffer was last saved, as an + integer. *Note Buffer Modification: (lispref)Buffer Modification. + +`modtime' + This field contains the modification time of the visited file. It + is set when the file is written or read. Every time the buffer is + written to the file, this field is compared to the modification + time of the file. *Note Buffer Modification: (lispref)Buffer + Modification. + +`auto_save_modified' + This field contains the time when the buffer was last auto-saved. + +`last_window_start' + This field contains the `window-start' position in the buffer as of + the last time the buffer was displayed in a window. + +`undo_list' + This field points to the buffer's undo list. *Note Undo: + (lispref)Undo. + +`syntax_table_v' + This field contains the syntax table for the buffer. *Note Syntax + Tables: (lispref)Syntax Tables. + +`downcase_table' + This field contains the conversion table for converting text to + lower case. *Note Case Tables: (lispref)Case Tables. + +`upcase_table' + This field contains the conversion table for converting text to + upper case. *Note Case Tables: (lispref)Case Tables. + +`case_canon_table' + This field contains the conversion table for canonicalizing text + for case-folding search. *Note Case Tables: (lispref)Case Tables. + +`case_eqv_table' + This field contains the equivalence table for case-folding search. + *Note Case Tables: (lispref)Case Tables. + +`display_table' + This field contains the buffer's display table, or `nil' if it + doesn't have one. *Note Display Tables: (lispref)Display Tables. + +`markers' + This field contains the chain of all markers that currently point + into the buffer. Deletion of text in the buffer, and motion of + the buffer's gap, must check each of these markers and perhaps + update it. *Note Markers: (lispref)Markers. + +`backed_up' + This field is a flag that tells whether a backup file has been + made for the visited file of this buffer. + +`mark' + This field contains the mark for the buffer. The mark is a marker, + hence it is also included on the list `markers'. *Note The Mark: + (lispref)The Mark. + +`mark_active' + This field is non-`nil' if the buffer's mark is active. + +`local_var_alist' + This field contains the association list describing the variables + local in this buffer, and their values, with the exception of + local variables that have special slots in the buffer object. + (Those slots are omitted from this table.) *Note Buffer-Local + Variables: (lispref)Buffer-Local Variables. + +`modeline_format' + This field contains a Lisp object which controls how to display + the mode line for this buffer. *Note Modeline Format: + (lispref)Modeline Format. + +`base_buffer' + This field holds the buffer's base buffer (if it is an indirect + buffer), or `nil'. + + +File: internals.info, Node: MULE Character Sets and Encodings, Next: The Lisp Reader and Compiler, Prev: Buffers and Textual Representation, Up: Top + +MULE Character Sets and Encodings +********************************* + + Recall that there are two primary ways that text is represented in +XEmacs. The "buffer" representation sees the text as a series of bytes +(Bufbytes), with a variable number of bytes used per character. The +"character" representation sees the text as a series of integers +(Emchars), one per character. The character representation is a cleaner +representation from a theoretical standpoint, and is thus used in many +cases when lots of manipulations on a string need to be done. However, +the buffer representation is the standard representation used in both +Lisp strings and buffers, and because of this, it is the "default" +representation that text comes in. The reason for using this +representation is that it's compact and is compatible with ASCII. + +* Menu: + +* Character Sets:: +* Encodings:: +* Internal Mule Encodings:: +* CCL:: + + +File: internals.info, Node: Character Sets, Next: Encodings, Up: MULE Character Sets and Encodings + +Character Sets +============== + + A character set (or "charset") is an ordered set of characters. A +particular character in a charset is indexed using one or more +"position codes", which are non-negative integers. The number of +position codes needed to identify a particular character in a charset is +called the "dimension" of the charset. In XEmacs/Mule, all charsets +have dimension 1 or 2, and the size of all charsets (except for a few +special cases) is either 94, 96, 94 by 94, or 96 by 96. The range of +position codes used to index characters from any of these types of +character sets is as follows: + + Charset type Position code 1 Position code 2 + ------------------------------------------------------------ + 94 33 - 126 N/A + 96 32 - 127 N/A + 94x94 33 - 126 33 - 126 + 96x96 32 - 127 32 - 127 + + Note that in the above cases position codes do not start at an +expected value such as 0 or 1. The reason for this will become clear +later. + + For example, Latin-1 is a 96-character charset, and JISX0208 (the +Japanese national character set) is a 94x94-character charset. + + [Note that, although the ranges above define the *valid* position +codes for a charset, some of the slots in a particular charset may in +fact be empty. This is the case for JISX0208, for example, where (e.g.) +all the slots whose first position code is in the range 118 - 127 are +empty.] + + There are three charsets that do not follow the above rules. All of +them have one dimension, and have ranges of position codes as follows: + + Charset name Position code 1 + ------------------------------------ + ASCII 0 - 127 + Control-1 0 - 31 + Composite 0 - some large number + + (The upper bound of the position code for composite characters has +not yet been determined, but it will probably be at least 16,383). + + ASCII is the union of two subsidiary character sets: Printing-ASCII +(the printing ASCII character set, consisting of position codes 33 - +126, like for a standard 94-character charset) and Control-ASCII (the +non-printing characters that would appear in a binary file with codes 0 +- 32 and 127). + + Control-1 contains the non-printing characters that would appear in a +binary file with codes 128 - 159. + + Composite contains characters that are generated by overstriking one +or more characters from other charsets. + + Note that some characters in ASCII, and all characters in Control-1, +are "control" (non-printing) characters. These have no printed +representation but instead control some other function of the printing +(e.g. TAB or 8 moves the current character position to the next tab +stop). All other characters in all charsets are "graphic" (printing) +characters. + + When a binary file is read in, the bytes in the file are assigned to +character sets as follows: + + Bytes Character set Range + -------------------------------------------------- + 0 - 127 ASCII 0 - 127 + 128 - 159 Control-1 0 - 31 + 160 - 255 Latin-1 32 - 127 + + This is a bit ad-hoc but gets the job done. + + +File: internals.info, Node: Encodings, Next: Internal Mule Encodings, Prev: Character Sets, Up: MULE Character Sets and Encodings + +Encodings +========= + + An "encoding" is a way of numerically representing characters from +one or more character sets. If an encoding only encompasses one +character set, then the position codes for the characters in that +character set could be used directly. This is not possible, however, if +more than one character set is to be used in the encoding. + + For example, the conversion detailed above between bytes in a binary +file and characters is effectively an encoding that encompasses the +three character sets ASCII, Control-1, and Latin-1 in a stream of 8-bit +bytes. + + Thus, an encoding can be viewed as a way of encoding characters from +a specified group of character sets using a stream of bytes, each of +which contains a fixed number of bits (but not necessarily 8, as in the +common usage of "byte"). + + Here are descriptions of a couple of common encodings: + +* Menu: + +* Japanese EUC (Extended Unix Code):: +* JIS7:: + + +File: internals.info, Node: Japanese EUC (Extended Unix Code), Next: JIS7, Up: Encodings + +Japanese EUC (Extended Unix Code) +--------------------------------- + + This encompasses the character sets Printing-ASCII, +Japanese-JISX0201, and Japanese-JISX0208-Kana (half-width katakana, the +right half of JISX0201). It uses 8-bit bytes. + + Note that Printing-ASCII and Japanese-JISX0201-Kana are 94-character +charsets, while Japanese-JISX0208 is a 94x94-character charset. + + The encoding is as follows: + + Character set Representation (PC=position-code) + ------------- -------------- + Printing-ASCII PC1 + Japanese-JISX0201-Kana 0x8E | PC1 + 0x80 + Japanese-JISX0208 PC1 + 0x80 | PC2 + 0x80 + Japanese-JISX0212 PC1 + 0x80 | PC2 + 0x80 + + +File: internals.info, Node: JIS7, Prev: Japanese EUC (Extended Unix Code), Up: Encodings + +JIS7 +---- + + This encompasses the character sets Printing-ASCII, +Japanese-JISX0201-Roman (the left half of JISX0201; this character set +is very similar to Printing-ASCII and is a 94-character charset), +Japanese-JISX0208, and Japanese-JISX0201-Kana. It uses 7-bit bytes. + + Unlike Japanese EUC, this is a "modal" encoding, which means that +there are multiple states that the encoding can be in, which affect how +the bytes are to be interpreted. Special sequences of bytes (called +"escape sequences") are used to change states. + + The encoding is as follows: + + Character set Representation (PC=position-code) + ------------- -------------- + Printing-ASCII PC1 + Japanese-JISX0201-Roman PC1 + Japanese-JISX0201-Kana PC1 + Japanese-JISX0208 PC1 PC2 + + + Escape sequence ASCII equivalent Meaning + --------------- ---------------- ------- + 0x1B 0x28 0x4A ESC ( J invoke Japanese-JISX0201-Roman + 0x1B 0x28 0x49 ESC ( I invoke Japanese-JISX0201-Kana + 0x1B 0x24 0x42 ESC $ B invoke Japanese-JISX0208 + 0x1B 0x28 0x42 ESC ( B invoke Printing-ASCII + + Initially, Printing-ASCII is invoked. + + +File: internals.info, Node: Internal Mule Encodings, Next: CCL, Prev: Encodings, Up: MULE Character Sets and Encodings + +Internal Mule Encodings +======================= + + In XEmacs/Mule, each character set is assigned a unique number, +called a "leading byte". This is used in the encodings of a character. +Leading bytes are in the range 0x80 - 0xFF (except for ASCII, which has +a leading byte of 0), although some leading bytes are reserved. + + Charsets whose leading byte is in the range 0x80 - 0x9F are called +"official" and are used for built-in charsets. Other charsets are +called "private" and have leading bytes in the range 0xA0 - 0xFF; these +are user-defined charsets. + + More specifically: + + Character set Leading byte + ------------- ------------ + ASCII 0 + Composite 0x80 + Dimension-1 Official 0x81 - 0x8D + (0x8E is free) + Control-1 0x8F + Dimension-2 Official 0x90 - 0x99 + (0x9A - 0x9D are free; + 0x9E and 0x9F are reserved) + Dimension-1 Private 0xA0 - 0xEF + Dimension-2 Private 0xF0 - 0xFF + + There are two internal encodings for characters in XEmacs/Mule. One +is called "string encoding" and is an 8-bit encoding that is used for +representing characters in a buffer or string. It uses 1 to 4 bytes per +character. The other is called "character encoding" and is a 19-bit +encoding that is used for representing characters individually in a +variable. + + (In the following descriptions, we'll ignore composite characters for +the moment. We also give a general (structural) overview first, +followed later by the exact details.) + +* Menu: + +* Internal String Encoding:: +* Internal Character Encoding:: + + +File: internals.info, Node: Internal String Encoding, Next: Internal Character Encoding, Up: Internal Mule Encodings + +Internal String Encoding +------------------------ + + ASCII characters are encoded using their position code directly. +Other characters are encoded using their leading byte followed by their +position code(s) with the high bit set. Characters in private character +sets have their leading byte prefixed with a "leading byte prefix", +which is either 0x9E or 0x9F. (No character sets are ever assigned these +leading bytes.) Specifically: + + Character set Encoding (PC=position-code, LB=leading-byte) + ------------- -------- + ASCII PC-1 | + Control-1 LB | PC1 + 0xA0 | + Dimension-1 official LB | PC1 + 0x80 | + Dimension-1 private 0x9E | LB | PC1 + 0x80 | + Dimension-2 official LB | PC1 + 0x80 | PC2 + 0x80 | + Dimension-2 private 0x9F | LB | PC1 + 0x80 | PC2 + 0x80 + + The basic characteristic of this encoding is that the first byte of +all characters is in the range 0x00 - 0x9F, and the second and +following bytes of all characters is in the range 0xA0 - 0xFF. This +means that it is impossible to get out of sync, or more specifically: + + 1. Given any byte position, the beginning of the character it is + within can be determined in constant time. + + 2. Given any byte position at the beginning of a character, the + beginning of the next character can be determined in constant time. + + 3. Given any byte position at the beginning of a character, the + beginning of the previous character can be determined in constant + time. + + 4. Textual searches can simply treat encoded strings as if they were + encoded in a one-byte-per-character fashion rather than the actual + multi-byte encoding. + + None of the standard non-modal encodings meet all of these +conditions. For example, EUC satisfies only (2) and (3), while +Shift-JIS and Big5 (not yet described) satisfy only (2). (All non-modal +encodings must satisfy (2), in order to be unambiguous.) + + +File: internals.info, Node: Internal Character Encoding, Prev: Internal String Encoding, Up: Internal Mule Encodings + +Internal Character Encoding +--------------------------- + + One 19-bit word represents a single character. The word is +separated into three fields: + + Bit number: 18 17 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 + <------------> <------------------> <------------------> + Field: 1 2 3 + + Note that fields 2 and 3 hold 7 bits each, while field 1 holds 5 +bits. + + Character set Field 1 Field 2 Field 3 + ------------- ------- ------- ------- + ASCII 0 0 PC1 + range: (00 - 7F) + Control-1 0 1 PC1 + range: (00 - 1F) + Dimension-1 official 0 LB - 0x80 PC1 + range: (01 - 0D) (20 - 7F) + Dimension-1 private 0 LB - 0x80 PC1 + range: (20 - 6F) (20 - 7F) + Dimension-2 official LB - 0x8F PC1 PC2 + range: (01 - 0A) (20 - 7F) (20 - 7F) + Dimension-2 private LB - 0xE1 PC1 PC2 + range: (0F - 1E) (20 - 7F) (20 - 7F) + Composite 0x1F ? ? + + Note that character codes 0 - 255 are the same as the "binary +encoding" described above. + + +File: internals.info, Node: CCL, Prev: Internal Mule Encodings, Up: MULE Character Sets and Encodings + +CCL +=== + + CCL PROGRAM SYNTAX: + CCL_PROGRAM := (CCL_MAIN_BLOCK + [ CCL_EOF_BLOCK ]) + + CCL_MAIN_BLOCK := CCL_BLOCK + CCL_EOF_BLOCK := CCL_BLOCK + + CCL_BLOCK := STATEMENT | (STATEMENT [STATEMENT ...]) + STATEMENT := + SET | IF | BRANCH | LOOP | REPEAT | BREAK + | READ | WRITE + + SET := (REG = EXPRESSION) | (REG SELF_OP EXPRESSION) + | INT-OR-CHAR + + EXPRESSION := ARG | (EXPRESSION OP ARG) + + IF := (if EXPRESSION CCL_BLOCK CCL_BLOCK) + BRANCH := (branch EXPRESSION CCL_BLOCK [CCL_BLOCK ...]) + LOOP := (loop STATEMENT [STATEMENT ...]) + BREAK := (break) + REPEAT := (repeat) + | (write-repeat [REG | INT-OR-CHAR | string]) + | (write-read-repeat REG [INT-OR-CHAR | string | ARRAY]?) + READ := (read REG) | (read REG REG) + | (read-if REG ARITH_OP ARG CCL_BLOCK CCL_BLOCK) + | (read-branch REG CCL_BLOCK [CCL_BLOCK ...]) + WRITE := (write REG) | (write REG REG) + | (write INT-OR-CHAR) | (write STRING) | STRING + | (write REG ARRAY) + END := (end) + + REG := r0 | r1 | r2 | r3 | r4 | r5 | r6 | r7 + ARG := REG | INT-OR-CHAR + OP := + | - | * | / | % | & | '|' | ^ | << | >> | <8 | >8 | // + | < | > | == | <= | >= | != + SELF_OP := + += | -= | *= | /= | %= | &= | '|=' | ^= | <<= | >>= + ARRAY := '[' INT-OR-CHAR ... ']' + INT-OR-CHAR := INT | CHAR + + MACHINE CODE: + + The machine code consists of a vector of 32-bit words. + The first such word specifies the start of the EOF section of the code; + this is the code executed to handle any stuff that needs to be done + (e.g. designating back to ASCII and left-to-right mode) after all + other encoded/decoded data has been written out. This is not used for + charset CCL programs. + + REGISTER: 0..7 -- refered by RRR or rrr + + OPERATOR BIT FIELD (27-bit): XXXXXXXXXXXXXXX RRR TTTTT + TTTTT (5-bit): operator type + RRR (3-bit): register number + XXXXXXXXXXXXXXXX (15-bit): + CCCCCCCCCCCCCCC: constant or address + 000000000000rrr: register number + + AAAA: 00000 + + 00001 - + 00010 * + 00011 / + 00100 % + 00101 & + 00110 | + 00111 ~ + + 01000 << + 01001 >> + 01010 <8 + 01011 >8 + 01100 // + 01101 not used + 01110 not used + 01111 not used + + 10000 < + 10001 > + 10010 == + 10011 <= + 10100 >= + 10101 != + + OPERATORS: TTTTT RRR XX.. + + SetCS: 00000 RRR C...C RRR = C...C + SetCL: 00001 RRR ..... RRR = c...c + c.............c + SetR: 00010 RRR ..rrr RRR = rrr + SetA: 00011 RRR ..rrr RRR = array[rrr] + C.............C size of array = C...C + c.............c contents = c...c + + Jump: 00100 000 c...c jump to c...c + JumpCond: 00101 RRR c...c if (!RRR) jump to c...c + WriteJump: 00110 RRR c...c Write1 RRR, jump to c...c + WriteReadJump: 00111 RRR c...c Write1, Read1 RRR, jump to c...c + WriteCJump: 01000 000 c...c Write1 C...C, jump to c...c + C...C + WriteCReadJump: 01001 RRR c...c Write1 C...C, Read1 RRR, + C.............C and jump to c...c + WriteSJump: 01010 000 c...c WriteS, jump to c...c + C.............C + S.............S + ... + WriteSReadJump: 01011 RRR c...c WriteS, Read1 RRR, jump to c...c + C.............C + S.............S + ... + WriteAReadJump: 01100 RRR c...c WriteA, Read1 RRR, jump to c...c + C.............C size of array = C...C + c.............c contents = c...c + ... + Branch: 01101 RRR C...C if (RRR >= 0 && RRR < C..) + c.............c branch to (RRR+1)th address + Read1: 01110 RRR ... read 1-byte to RRR + Read2: 01111 RRR ..rrr read 2-byte to RRR and rrr + ReadBranch: 10000 RRR C...C Read1 and Branch + c.............c + ... + Write1: 10001 RRR ..... write 1-byte RRR + Write2: 10010 RRR ..rrr write 2-byte RRR and rrr + WriteC: 10011 000 ..... write 1-char C...CC + C.............C + WriteS: 10100 000 ..... write C..-byte of string + C.............C + S.............S + ... + WriteA: 10101 RRR ..... write array[RRR] + C.............C size of array = C...C + c.............c contents = c...c + ... + End: 10110 000 ..... terminate the execution + + SetSelfCS: 10111 RRR C...C RRR AAAAA= C...C + ..........AAAAA + SetSelfCL: 11000 RRR ..... RRR AAAAA= c...c + c.............c + ..........AAAAA + SetSelfR: 11001 RRR ..Rrr RRR AAAAA= rrr + ..........AAAAA + SetExprCL: 11010 RRR ..Rrr RRR = rrr AAAAA c...c + c.............c + ..........AAAAA + SetExprR: 11011 RRR ..rrr RRR = rrr AAAAA Rrr + ............Rrr + ..........AAAAA + JumpCondC: 11100 RRR c...c if !(RRR AAAAA C..) jump to c...c + C.............C + ..........AAAAA + JumpCondR: 11101 RRR c...c if !(RRR AAAAA rrr) jump to c...c + ............rrr + ..........AAAAA + ReadJumpCondC: 11110 RRR c...c Read1 and JumpCondC + C.............C + ..........AAAAA + ReadJumpCondR: 11111 RRR c...c Read1 and JumpCondR + ............rrr + ..........AAAAA + + +File: internals.info, Node: The Lisp Reader and Compiler, Next: Lstreams, Prev: MULE Character Sets and Encodings, Up: Top + +The Lisp Reader and Compiler +**************************** + + Not yet documented. + + +File: internals.info, Node: Lstreams, Next: Consoles; Devices; Frames; Windows, Prev: The Lisp Reader and Compiler, Up: Top + +Lstreams +******** + + An "lstream" is an internal Lisp object that provides a generic +buffering stream implementation. Conceptually, you send data to the +stream or read data from the stream, not caring what's on the other end +of the stream. The other end could be another stream, a file +descriptor, a stdio stream, a fixed block of memory, a reallocating +block of memory, etc. The main purpose of the stream is to provide a +standard interface and to do buffering. Macros are defined to read or +write characters, so the calling functions do not have to worry about +blocking data together in order to achieve efficiency. + +* Menu: + +* 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. + + +File: internals.info, Node: Creating an Lstream, Next: Lstream Types, Up: Lstreams + +Creating an Lstream +=================== + + Lstreams come in different types, depending on what is being +interfaced to. Although the primitive for creating new lstreams is +`Lstream_new()', generally you do not call this directly. Instead, you +call some type-specific creation function, which creates the lstream +and initializes it as appropriate for the particular type. + + All lstream creation functions take a MODE argument, specifying what +mode the lstream should be opened as. This controls whether the +lstream is for input and output, and optionally whether data should be +blocked up in units of MULE characters. Note that some types of +lstreams can only be opened for input; others only for output; and +others can be opened either way. #### Richard Mlynarik thinks that +there should be a strict separation between input and output streams, +and he's probably right. + + MODE is a string, one of + +`"r"' + Open for reading. + +`"w"' + Open for writing. + +`"rc"' + Open for reading, but "read" never returns partial MULE characters. + +`"wc"' + Open for writing, but never writes partial MULE characters. + + +File: internals.info, Node: Lstream Types, Next: Lstream Functions, Prev: Creating an Lstream, Up: Lstreams + +Lstream Types +============= + +stdio + +filedesc + +lisp-string + +fixed-buffer + +resizing-buffer + +dynarr + +lisp-buffer + +print + +decoding + +encoding + +File: internals.info, Node: Lstream Functions, Next: Lstream Methods, Prev: Lstream Types, Up: Lstreams + +Lstream Functions +================= + + - Function: 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 creates the stream + and does any other necessary creation stuff (e.g. opening a file). + + - Function: void Lstream_set_buffering (Lstream *LSTR, + Lstream_buffering BUFFERING, int BUFFERING_SIZE) + Change the buffering of a stream. See `lstream.h'. By default the + buffering is `STREAM_BLOCK_BUFFERED'. + + - Function: int Lstream_flush (Lstream *LSTR) + Flush out any pending unwritten data in the stream. Clear any + buffered input data. Returns 0 on success, -1 on error. + + - Macro: int Lstream_putc (Lstream *STREAM, int C) + Write out one byte to the stream. This is a macro and so it is + very efficient. The C argument is only evaluated once but the + STREAM argument is evaluated more than once. Returns 0 on + success, -1 on error. + + - Macro: int Lstream_getc (Lstream *STREAM) + Read one byte from the stream. This is a macro and so it is very + efficient. The STREAM argument is evaluated more than once. + Return value is -1 for EOF or error. + + - Macro: void Lstream_ungetc (Lstream *STREAM, int 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 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 C argument is only evaluated + once but the STREAM argument is evaluated more than once. + + - Function: int Lstream_fputc (Lstream *STREAM, int C) + - Function: int Lstream_fgetc (Lstream *STREAM) + - Function: void Lstream_fungetc (Lstream *STREAM, int C) + Function equivalents of the above macros. + + - Function: int Lstream_read (Lstream *STREAM, void *DATA, int 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. + + - Function: int Lstream_write (Lstream *STREAM, void *DATA, int 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. + + - Function: void Lstream_unread (Lstream *STREAM, void *DATA, int SIZE) + Push back SIZE bytes of DATA onto the input queue. The next call + to `Lstream_read()' with the same size will read the same bytes + back. Note that this will be the case even if there is other + pending unread data. + + - Function: int Lstream_close (Lstream *STREAM) + Close the stream. All data will be flushed out. + + - Function: void Lstream_reopen (Lstream *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 + necessary storage structures, for example. + + - Function: void Lstream_rewind (Lstream *STREAM) + Rewind the stream to the beginning. + + +File: internals.info, Node: Lstream Methods, Prev: Lstream Functions, Up: Lstreams + +Lstream Methods +=============== + + - Lstream Method: int reader (Lstream *STREAM, unsigned char *DATA, + int SIZE) + Read some data from the stream's end and store it into DATA, which + can hold SIZE bytes. Return the number of bytes read. A return + value of 0 means no bytes can be read at this time. This may be + because of an EOF, or because there is a granularity greater than + one byte that the stream imposes on the returned data, and SIZE is + less than this granularity. (This will happen frequently for + streams that need to return whole characters, because + `Lstream_read()' calls the reader function repeatedly until it has + the number of bytes it wants or until 0 is returned.) The lstream + functions do not treat a 0 return as EOF or do anything special; + however, the calling function will interpret any 0 it gets back as + EOF. This will normally not happen unless the caller calls + `Lstream_read()' with a very small size. + + This function can be `NULL' if the stream is output-only. + + - Lstream Method: int writer (Lstream *STREAM, CONST unsigned char + *DATA, int 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 that + case, the function will just be called again until there is no + data left or 0 is returned. A return value of 0 means that no + more data can be currently stored, but there is no error; the data + will be squirreled away until the writer can accept data. (This is + useful, e.g., if 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. + + - Lstream Method: int rewinder (Lstream *STREAM) + Rewind the stream. If this is `NULL', the stream is not seekable. + + - Lstream Method: int seekable_p (Lstream *STREAM) + 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. + + - Lstream Method: int flusher (Lstream *STREAM) + Perform any additional operations necessary to flush the data in + this stream. + + - Lstream Method: int pseudo_closer (Lstream *STREAM) + + - Lstream Method: int closer (Lstream *STREAM) + Perform any additional operations necessary to close this stream + down. May be `NULL'. This function is called when + `Lstream_close()' is called or when the stream is + garbage-collected. When this function is called, all pending data + in the stream will already have been written out. + + - Lstream Method: Lisp_Object marker (Lisp_Object LSTREAM, void + (*MARKFUN) (Lisp_Object)) + Mark this object for garbage collection. Same semantics as a + standard `Lisp_Object' marker. This function can be `NULL'. + + +File: internals.info, Node: Consoles; Devices; Frames; Windows, Next: The Redisplay Mechanism, Prev: Lstreams, Up: Top + +Consoles; Devices; Frames; Windows +********************************** + +* Menu: + +* Introduction to Consoles; Devices; Frames; Windows:: +* Point:: +* Window Hierarchy:: +* The Window Object:: + + +File: internals.info, Node: Introduction to Consoles; Devices; Frames; Windows, Next: Point, Up: Consoles; Devices; Frames; Windows + +Introduction to Consoles; Devices; Frames; Windows +================================================== + + A window-system window that you see on the screen is called a +"frame" in Emacs terminology. Each frame is subdivided into one or +more non-overlapping panes, called (confusingly) "windows". Each +window displays the text of a buffer in it. (See above on Buffers.) Note +that buffers and windows are independent entities: Two or more windows +can be displaying the same buffer (potentially in different locations), +and a buffer can be displayed in no windows. + + A single display screen that contains one or more frames is called a +"display". Under most circumstances, there is only one display. +However, more than one display can exist, for example if you have a +"multi-headed" console, i.e. one with a single keyboard but multiple +displays. (Typically in such a situation, the various displays act like +one large display, in that the mouse is only in one of them at a time, +and moving the mouse off of one moves it into another.) In some cases, +the different displays will have different characteristics, e.g. one +color and one mono. + + XEmacs can display frames on multiple displays. It can even deal +simultaneously with frames on multiple keyboards (called "consoles" in +XEmacs terminology). Here is one case where this might be useful: You +are using XEmacs on your workstation at work, and leave it running. +Then you go home and dial in on a TTY line, and you can use the +already-running XEmacs process to display another frame on your local +TTY. + + Thus, there is a hierarchy console -> display -> frame -> window. +There is a separate Lisp object type for each of these four concepts. +Furthermore, there is logically a "selected console", "selected +display", "selected frame", and "selected window". Each of these +objects is distinguished in various ways, such as being the default +object for various functions that act on objects of that type. Note +that every containing object rememembers the "selected" object 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. + + +File: internals.info, Node: Point, Next: Window Hierarchy, Prev: Introduction to Consoles; Devices; Frames; Windows, Up: Consoles; Devices; Frames; Windows + +Point +===== + + Recall that every buffer has a current insertion position, called +"point". Now, two or more windows may be displaying the same buffer, +and the text cursor in the two windows (i.e. `point') can be in two +different places. You may ask, how can that be, since each buffer has +only one value of `point'? The answer is that each window also has a +value of `point' that is squirreled away in it. There is only one +selected window, and the value of "point" in that buffer corresponds to +that window. When the selected window is changed from one window to +another displaying the same buffer, the old value of `point' is stored +into the old window's "point" and the value of `point' from the new +window is retrieved and made the value of `point' in the buffer. This +means that `window-point' for the selected window is potentially +inaccurate, and if you want to retrieve the correct value of `point' +for a window, you must special-case on the selected window and retrieve +the buffer's point instead. This is related to why +`save-window-excursion' does not save the selected window's value of +`point'. + + +File: internals.info, Node: Window Hierarchy, Next: The Window Object, Prev: Point, Up: Consoles; Devices; Frames; Windows + +Window Hierarchy +================ + + If a frame contains multiple windows (panes), they are always created +by splitting an existing window along the horizontal or vertical axis. +Terminology is a bit confusing here: to "split a window horizontally" +means to create two side-by-side windows, i.e. to make a *vertical* cut +in a window. Likewise, to "split a window vertically" means to create +two windows, one above the other, by making a *horizontal* cut. + + If you split a window and then split again along the same axis, you +will end up with a number of panes all arranged along the same axis. +The precise way in which the splits were made should not be important, +and this is reflected internally. Internally, all windows are arranged +in a tree, consisting of two types of windows, "combination" windows +(which have children, and are covered completely by those children) and +"leaf" windows, which have no children and are visible. Every +combination window has two or more children, all arranged along the same +axis. There are (logically) two subtypes of windows, depending on +whether their children are horizontally or vertically arrayed. There is +always one root window, which is either a leaf window (if the frame +contains only one window) or a combination window (if the frame contains +more than one window). In the latter case, the root window will have +two or more children, either horizontally or vertically arrayed, and +each of those children will be either a leaf window or another +combination window. + + Here are some rules: + + 1. Horizontal combination windows can never have children that are + horizontal combination windows; same for vertical. + + 2. Only leaf windows can be split (obviously) and this splitting does + one of two things: (a) turns the leaf window into a combination + window and creates two new leaf children, or (b) turns the leaf + window into one of the two new leaves and creates the other leaf. + Rule (1) dictates which of these two outcomes happens. + + 3. Every combination window must have at least two children. + + 4. Leaf windows can never become combination windows. They can be + deleted, however. If this results in a violation of (3), the + parent combination window also gets deleted. + + 5. All functions that accept windows must be prepared to accept + combination windows, and do something sane (e.g. signal an error + if so). Combination windows *do* escape to the Lisp level. + + 6. All windows have three fields governing their contents: these are + "hchild" (a list of horizontally-arrayed children), "vchild" (a + list of vertically-arrayed children), and "buffer" (the buffer + contained in a leaf window). Exactly one of these will be + non-nil. Remember that "horizontally-arrayed" means + "side-by-side" and "vertically-arrayed" means "one above the + other". + + 7. Leaf windows also have markers in their `start' (the first buffer + position displayed in the window) and `pointm' (the window's + stashed value of `point' - see above) fields, while combination + windows have nil in these fields. + + 8. The list of children for a window is threaded through the `next' + and `prev' fields of each child window. + + 9. *Deleted windows can be undeleted*. This happens as a result of + restoring a window configuration, and is unlike frames, displays, + and consoles, which, once deleted, can never be restored. + Deleting a window does nothing except set a special `dead' bit to + 1 and clear out the `next', `prev', `hchild', and `vchild' fields, + for GC purposes. + + 10. Most frames actually have two top-level windows - one for the + minibuffer and one (the "root") for everything else. The modeline + (if present) separates these two. The `next' field of the root + points to the minibuffer, and the `prev' field of the minibuffer + points to the root. The other `next' and `prev' fields are `nil', + and the frame points to both of these windows. Minibuffer-less + frames have no minibuffer window, and the `next' and `prev' of the + root window are `nil'. Minibuffer-only frames have no root + window, and the `next' of the minibuffer window is `nil' but the + `prev' points to itself. (#### This is an artifact that should be + fixed.) + + +File: internals.info, Node: The Window Object, Prev: Window Hierarchy, Up: Consoles; Devices; Frames; Windows + +The Window Object +================= + + Windows have the following accessible fields: + +`frame' + The frame that this window is on. + +`mini_p' + Non-`nil' if this window is a minibuffer window. + +`buffer' + The buffer that the window is displaying. This may change often + during the life of the window. + +`dedicated' + Non-`nil' if this window is dedicated to its buffer. + +`pointm' + This is the value of point in the current buffer when this window + is selected; when it is not selected, it retains its previous + value. + +`start' + The position in the buffer that is the first character to be + displayed in the window. + +`force_start' + If this flag is non-`nil', it says that the window has been + scrolled explicitly by the Lisp program. This affects what the + next redisplay does if point is off the screen: instead of + scrolling the window to show the text around point, it moves point + to a location that is on the screen. + +`last_modified' + The `modified' field of the window's buffer, as of the last time a + redisplay completed in this window. + +`last_point' + The buffer's value of point, as of the last time a redisplay + completed in this window. + +`left' + This is the left-hand edge of the window, measured in columns. + (The leftmost column on the screen is column 0.) + +`top' + This is the top edge of the window, measured in lines. (The top + line on the screen is line 0.) + +`height' + The height of the window, measured in lines. + +`width' + The width of the window, measured in columns. + +`next' + This is the window that is the next in the chain of siblings. It + is `nil' in a window that is the rightmost or bottommost of a + group of siblings. + +`prev' + This is the window that is the previous in the chain of siblings. + It is `nil' in a window that is the leftmost or topmost of a group + of siblings. + +`parent' + Internally, XEmacs arranges windows in a tree; each group of + siblings has a parent window whose area includes all the siblings. + This field points to a window's parent. + + Parent windows do not display buffers, and play little role in + display except to shape their child windows. Emacs Lisp programs + usually have no access to the parent windows; they operate on the + windows at the leaves of the tree, which actually display buffers. + +`hscroll' + This is the number of columns that the display in the window is + scrolled horizontally to the left. Normally, this is 0. + +`use_time' + This is the last time that the window was selected. The function + `get-lru-window' uses this field. + +`display_table' + The window's display table, or `nil' if none is specified for it. + +`update_mode_line' + Non-`nil' means this window's mode line needs to be updated. + +`base_line_number' + The line number of a certain position in the buffer, or `nil'. + This is used for displaying the line number of point in the mode + line. + +`base_line_pos' + The position in the buffer for which the line number is known, or + `nil' meaning none is known. + +`region_showing' + If the region (or part of it) is highlighted in this window, this + field holds the mark position that made one end of that region. + Otherwise, this field is `nil'. + diff --git a/info/internals.info-8 b/info/internals.info-8 new file mode 100644 index 0000000..1d5c420 --- /dev/null +++ b/info/internals.info-8 @@ -0,0 +1,871 @@ +This is Info file ../../info/internals.info, produced by Makeinfo +version 1.68 from the input file internals.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Internals: (internals). XEmacs Internals Manual. +END-INFO-DIR-ENTRY + + Copyright (C) 1992 - 1996 Ben Wing. Copyright (C) 1996, 1997 Sun +Microsystems. Copyright (C) 1994 - 1998 Free Software Foundation. +Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: internals.info, Node: The Redisplay Mechanism, Next: Extents, Prev: Consoles; Devices; Frames; Windows, Up: Top + +The Redisplay Mechanism +*********************** + + The redisplay mechanism is one of the most complicated sections of +XEmacs, especially from a conceptual standpoint. This is doubly so +because, unlike for the basic aspects of the Lisp interpreter, the +computer science theories of how to efficiently handle redisplay are not +well-developed. + + When working with the redisplay mechanism, remember the Golden Rules +of Redisplay: + + 1. It Is Better To Be Correct Than Fast. + + 2. Thou Shalt Not Run Elisp From Within Redisplay. + + 3. It Is Better To Be Fast Than Not To Be. + +* Menu: + +* Critical Redisplay Sections:: +* Line Start Cache:: +* Redisplay Piece by Piece:: + + +File: internals.info, Node: Critical Redisplay Sections, Next: Line Start Cache, Up: The Redisplay Mechanism + +Critical Redisplay Sections +=========================== + + Within this section, we are defenseless and assume that the +following cannot happen: + + 1. garbage collection + + 2. Lisp code evaluation + + 3. frame size changes + + We ensure (3) by calling `hold_frame_size_changes()', which will +cause any pending frame size changes to get put on hold till after the +end of the critical section. (1) follows automatically if (2) is met. +#### Unfortunately, there are some places where Lisp code can be called +within this section. We need to remove them. + + If `Fsignal()' is called during this critical section, we will +`abort()'. + + If garbage collection is called during this critical section, we +simply return. #### We should abort instead. + + #### If a frame-size change does occur we should probably actually +be preempting redisplay. + + +File: internals.info, Node: Line Start Cache, Next: Redisplay Piece by Piece, Prev: Critical Redisplay Sections, Up: The Redisplay Mechanism + +Line Start Cache +================ + + The traditional scrolling code in Emacs breaks in a variable height +world. It depends on the key assumption that the number of lines that +can be displayed at any given time is fixed. This led to a complete +separation of the scrolling code from the redisplay code. In order to +fully support variable height lines, the scrolling code must actually be +tightly integrated with redisplay. Only redisplay can determine how +many lines will be displayed on a screen for any given starting point. + + What is ideally wanted is a complete list of the starting buffer +position for every possible display line of a buffer along with the +height of that display line. Maintaining such a full list would be very +expensive. We settle for having it include information for all areas +which we happen to generate anyhow (i.e. the region currently being +displayed) and for those areas we need to work with. + + In order to ensure that the cache accurately represents what +redisplay would actually show, it is necessary to invalidate it in many +situations. If the buffer changes, the starting positions may no longer +be correct. If a face or an extent has changed then the line heights +may have altered. These events happen frequently enough that the cache +can end up being constantly disabled. With this potentially constant +invalidation when is the cache ever useful? + + Even if the cache is invalidated before every single usage, it is +necessary. Scrolling often requires knowledge about display lines which +are actually above or below the visible region. The cache provides a +convenient light-weight method of storing this information for multiple +display regions. This knowledge is necessary for the scrolling code to +always obey the First Golden Rule of Redisplay. + + If the cache already contains all of the information that the +scrolling routines happen to need so that it doesn't have to go +generate it, then we are able to obey the Third Golden Rule of +Redisplay. The first thing we do to help out the cache is to always +add the displayed region. This region had to be generated anyway, so +the cache ends up getting the information basically for free. In those +cases where a user is simply scrolling around viewing a buffer there is +a high probability that this 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: + + * Insertions at end-of-line which don't cause line-wraps do not + alter the starting positions of any display lines. These types of + buffer modifications should not invalidate the cache. This is + actually a large optimization for redisplay speed as well. + + * Buffer modifications frequently only affect the display of lines + at and below where they occur. In these situations we should only + invalidate the part of the cache starting at where the + modification occurs. + + In case you're wondering, the Second Golden Rule of Redisplay is not +applicable. + + +File: internals.info, Node: Redisplay Piece by Piece, Prev: Line Start Cache, Up: The Redisplay Mechanism + +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: + + 1. Determine desired display in area that needs redisplay. + Implemented by `redisplay.c' + + 2. Compare desired display with current display Implemented by + `redisplay-output.c' + + 3. Output changes Implemented by `redisplay-output.c', + `redisplay-x.c', `redisplay-msw.c' and `redisplay-tty.c' + + Steps 1 and 2 are device-independant and relatively complex. Step 3 +is mostly device-dependent. + + Determining the desired display + + Display attributes are stored in `display_line' structures. Each +`display_line' consists of a set of `display_block''s and each +`display_block' contains a number of `rune''s. Generally dynarr's of +`display_line''s are held by each window representing the current +display and the desired display. + + The `display_line' structures are tighly tied to buffers which +presents a problem for redisplay as this connection is bogus for the +modeline. Hence the `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 `display_line' generation are in `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 `create_text_block'. Instead we use +`create_text_string_block' which performs the same function as +`create_text_block' but for strings. Many of the complexities of +`create_text_block' to do with cursor handling and selective display +have been removed. + + +File: internals.info, Node: Extents, Next: Faces, Prev: The Redisplay Mechanism, Up: Top + +Extents +******* + +* Menu: + +* Introduction to Extents:: Extents are ranges over text, with properties. +* 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. +* Extent Fragments:: Cached information useful for redisplay. + + +File: internals.info, Node: Introduction to Extents, Next: Extent Ordering, Up: Extents + +Introduction to Extents +======================= + + Extents are regions over a buffer, with a start and an end position +denoting the region of the buffer included in the extent. In addition, +either end can be closed or open, meaning that the endpoint is or is +not logically included in the extent. Insertion of a character at a +closed endpoint causes the character to go inside the extent; insertion +at an open endpoint causes the character to go outside. + + Extent endpoints are stored using memory indices (see `insdel.c'), +to minimize the amount of adjusting that needs to be done when +characters are inserted or deleted. + + (Formerly, extent endpoints at the gap could be either before or +after the gap, depending on the open/closedness of the endpoint. The +intent of this was to make it so that insertions would automatically go +inside or out of extents as necessary with no further work needing to +be done. It didn't work out that way, however, and just ended up +complexifying and buggifying all the rest of the code.) + + +File: internals.info, Node: Extent Ordering, Next: Format of the Extent Info, Prev: Introduction to Extents, Up: Extents + +Extent Ordering +=============== + + Extents are compared using memory indices. There are two orderings +for extents and both orders are kept current at all times. The normal +or "display" order is as follows: + + Extent A is ``less than'' extent B, + that is, earlier in the display order, + if: A-start < B-start, + or if: A-start = B-start, and A-end > B-end + + So if two extents begin at the same position, the larger of them is +the earlier one in the display order (`EXTENT_LESS' is true). + + For the e-order, the same thing holds: + + Extent A is ``less than'' extent B in e-order, + that is, later in the buffer, + if: A-end < B-end, + or if: A-end = B-end, and A-start > B-start + + So if two extents end at the same position, the smaller of them is +the earlier one in the e-order (`EXTENT_E_LESS' is true). + + The display order and the e-order are complementary orders: any +theorem about the display order also applies to the e-order if you swap +all occurrences of "display order" and "e-order", "less than" and +"greater than", and "extent start" and "extent end". + + +File: internals.info, Node: Format of the Extent Info, Next: Zero-Length Extents, Prev: Extent Ordering, Up: Extents + +Format of the Extent Info +========================= + + An extent-info structure consists of a list of the buffer or string's +extents and a "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 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 calculated +at some prior point in time), it's easy to move the stack of extents to +the proper position. + + Given that the stack of extents is an optimization, and given that +it requires memory, a string's stack of extents is wiped out each time +a garbage collection occurs. Therefore, any time you retrieve the +stack of extents, it might not be there. If you need it to be there, +use the `_force' version. + + Similarly, a string may or may not have an extent_info structure. +(Generally it won't if there haven't been any extents added to the +string.) So use the `_force' version if you need the extent_info +structure to be there. + + A list of extents is maintained as a double gap array: one gap array +is ordered by start index (the "display order") and the other is +ordered by end index (the "e-order"). Note that positions in an extent +list should logically be conceived of as referring *to* a particular +extent (as is the norm in programs) rather than sitting between two +extents. Note also that callers of these functions should not be aware +of the fact that the extent list is implemented as an array, except for +the fact that positions are integers (this should be generalized to +handle integers and linked list equally well). + + +File: internals.info, Node: Zero-Length Extents, Next: Mathematics of Extent Ordering, Prev: Format of the Extent Info, Up: Extents + +Zero-Length Extents +=================== + + Extents can be zero-length, and will end up that way if their +endpoints are explicitly set that way or if their detachable property +is nil and all the text in the extent is deleted. (The exception is +open-open zero-length extents, which are barred from existing because +there is no sensible way to define their properties. Deletion of the +text in an open-open extent causes it to be converted into a closed-open +extent.) Zero-length extents are primarily used to represent +annotations, and behave as follows: + + 1. Insertion at the position of a zero-length extent expands the + extent if both endpoints are closed; goes after the extent if it + is closed-open; and goes before the extent if it is open-closed. + + 2. Deletion of a character on a side of a zero-length extent whose + corresponding endpoint is closed causes the extent to be detached + if it is detachable; if the extent is not detachable or the + corresponding endpoint is open, the extent remains in the buffer, + moving as necessary. + + Note that closed-open, non-detachable zero-length extents behave +exactly like markers and that open-closed, non-detachable zero-length +extents behave like the "point-type" marker in Mule. + + +File: internals.info, Node: Mathematics of Extent Ordering, Next: Extent Fragments, Prev: Zero-Length Extents, Up: Extents + +Mathematics of Extent Ordering +============================== + + The extents in a buffer are ordered by "display order" because that +is that order that the redisplay mechanism needs to process them in. +The e-order is an auxiliary ordering used to facilitate operations over +extents. The operations that can be performed on the ordered list of +extents in a buffer are + + 1. Locate where an extent would go if inserted into the list. + + 2. Insert an extent into the list. + + 3. Remove an extent from the list. + + 4. Map over all the extents that overlap a range. + + (4) requires being able to determine the first and last extents that +overlap a range. + + NOTE: "overlap" is used as follows: + + * two ranges overlap if they have at least one point in common. + Whether the endpoints are open or closed makes a difference here. + + * a point overlaps a range if the point is contained within the + range; this is equivalent to treating a point P as the range [P, + P]. + + * In the case of an *extent* overlapping a point or range, the extent + is normally treated as having closed endpoints. This applies + consistently in the discussion of stacks of extents and such below. + Note that this definition of overlap is not necessarily consistent + with the extents that `map-extents' maps over, since `map-extents' + sometimes pays attention to whether the endpoints of an extents + are open or closed. But for our purposes, it greatly simplifies + things to treat all extents as having closed endpoints. + + First, define >, <, <=, etc. as applied to extents to mean +comparison according to the display order. Comparison between an +extent E and an index I means comparison between E and the range [I, I]. + + Also define e>, e<, e<=, etc. to mean comparison according to the +e-order. + + For any range R, define R(0) to be the starting index of the range +and R(1) to be the ending index of the range. + + For any extent E, define E(next) to be the extent directly following +E, and E(prev) to be the extent directly preceding E. Assume E(next) +and E(prev) can be determined from E in constant time. (This is +because we store the extent list as a doubly linked list.) + + Similarly, define E(e-next) and E(e-prev) to be the extents directly +following and preceding E in the e-order. + + Now: + + Let R be a range. Let F be the first extent overlapping R. Let L +be the last extent overlapping R. + + Theorem 1: R(1) lies between L and L(next), i.e. L <= R(1) < L(next). + + This follows easily from the definition of display order. The basic +reason that this theorem applies is that the display order sorts by +increasing starting index. + + Therefore, we can determine L just by looking at where we would +insert R(1) into the list, and if we know F and are moving forward over +extents, we can easily determine when we've hit L by comparing the +extent we're at to R(1). + + Theorem 2: F(e-prev) e< [1, R(0)] e<= F. + + This is the analog of Theorem 1, and applies because the e-order +sorts by increasing ending index. + + Therefore, F can be found in the same amount of time as operation +(1), i.e. the time that it takes to locate where an extent would go if +inserted into the e-order list. + + If the lists were stored as balanced binary trees, then operation (1) +would take logarithmic time, which is usually quite fast. However, +currently they're stored as simple doubly-linked lists, and instead we +do some caching to try to speed things up. + + Define a "stack of extents" (or "SOE") as the set of extents +(ordered in the display order) that overlap an index I, together with +the SOE's "previous" extent, which is an extent that precedes I in the +e-order. (Hopefully there will not be very many extents between I and +the previous extent.) + + Now: + + Let I be an index, let S be the stack of extents on I, let F be the +first extent in S, and let P be S's previous extent. + + Theorem 3: The first extent in S is the first extent that overlaps +any range [I, J]. + + Proof: Any extent that overlaps [I, J] but does not include I must +have a start index > I, and thus be greater than any extent in S. + + Therefore, finding the first extent that overlaps a range R is the +same as finding the first extent that overlaps R(0). + + Theorem 4: Let I2 be an index such that I2 > I, and let F2 be the +first extent that overlaps I2. Then, either F2 is in S or F2 is +greater than any extent in S. + + Proof: If F2 does not include I then its start index is greater than +I and thus it is greater than any extent in S, including F. Otherwise, +F2 includes I and thus is in S, and thus F2 >= F. + + +File: internals.info, Node: Extent Fragments, Prev: Mathematics of Extent Ordering, Up: Extents + +Extent Fragments +================ + + Imagine that the buffer is divided up into contiguous, +non-overlapping "runs" of text such that no extent starts or ends +within a run (extents that abut the run don't count). + + 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 +beginning and end of the run, a list of all of the extents in that run, +the "merged face" that results from merging all of the faces +corresponding to those extents, the begin and end glyphs at the +beginning of the run, etc. This is the information that redisplay needs +in order to display this run. + + Extent fragments have to be very quick to update to a new buffer +position when moving linearly through the buffer. They rely on the +stack-of-extents code, which does the heavy-duty algorithmic work of +determining which extents overly a particular position. + + +File: internals.info, Node: Faces, Next: Glyphs, Prev: Extents, Up: Top + +Faces +***** + + Not yet documented. + + +File: internals.info, Node: Glyphs, Next: Specifiers, Prev: Faces, Up: Top + +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 `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 `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 occurrance 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. + +Widget-Glyphs in the MS-WIndows Environment +=========================================== + + To Do + +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 properrties 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. + + +File: internals.info, Node: Specifiers, Next: Menus, Prev: Glyphs, Up: Top + +Specifiers +********** + + Not yet documented. + + +File: internals.info, Node: Menus, Next: Subprocesses, Prev: Specifiers, Up: Top + +Menus +***** + + A menu is set by setting the value of the variable `current-menubar' +(which may be buffer-local) and then calling `set-menubar-dirty-flag' +to signal a change. This will cause the menu to be redrawn at the next +redisplay. The format of the data in `current-menubar' is described in +`menubar.c'. + + Internally the data in current-menubar is parsed into a tree of +`widget_value's' (defined in `lwlib.h'); this is accomplished by the +recursive function `menu_item_descriptor_to_widget_value()', called by +`compute_menubar_data()'. Such a tree is deallocated using +`free_widget_value()'. + + `update_screen_menubars()' is one of the external entry points. +This checks to see, for each screen, if that screen's menubar needs to +be updated. This is the case if + + 1. `set-menubar-dirty-flag' was called since the last redisplay. + (This function sets the C variable menubar_has_changed.) + + 2. The buffer displayed in the screen has changed. + + 3. The screen has no menubar currently displayed. + + `set_screen_menubar()' is called for each such screen. This +function calls `compute_menubar_data()' to create the tree of +widget_value's, then calls `lw_create_widget()', +`lw_modify_all_widgets()', and/or `lw_destroy_all_widgets()' to create +the X-Toolkit widget associated with the menu. + + `update_psheets()', the other external entry point, actually changes +the menus being displayed. It uses the widgets fixed by +`update_screen_menubars()' and calls various X functions to ensure that +the menus are displayed properly. + + The menubar widget is set up so that `pre_activate_callback()' is +called when the menu is first selected (i.e. mouse button goes down), +and `menubar_selection_callback()' is called when an item is selected. +`pre_activate_callback()' calls the function in activate-menubar-hook, +which can change the menubar (this is described in `menubar.c'). If +the menubar is changed, `set_screen_menubars()' is called. +`menubar_selection_callback()' enqueues a menu event, putting in it a +function to call (either `eval' or `call-interactively') and its +argument, which is the callback function or form given in the menu's +description. + + +File: internals.info, Node: Subprocesses, Next: Interface to X Windows, Prev: Menus, Up: Top + +Subprocesses +************ + + The fields of a process are: + +`name' + A string, the name of the process. + +`command' + A list containing the command arguments that were used to start + this process. + +`filter' + A function used to accept output from the process instead of a + buffer, or `nil'. + +`sentinel' + A function called whenever the process receives a signal, or `nil'. + +`buffer' + The associated buffer of the process. + +`pid' + An integer, the Unix process ID. + +`childp' + A flag, non-`nil' if this is really a child process. It is `nil' + for a network connection. + +`mark' + A marker indicating the position of the end of the last output + from this process inserted into the buffer. This is often but not + always the end of the buffer. + +`kill_without_query' + If this is non-`nil', killing XEmacs while this process is still + running does not ask for confirmation about killing the process. + +`raw_status_low' +`raw_status_high' + These two fields record 16 bits each of the process status + returned by the `wait' system call. + +`status' + The process status, as `process-status' should return it. + +`tick' +`update_tick' + If these two fields are not equal, a change in the status of the + process needs to be reported, either by running the sentinel or by + inserting a message in the process buffer. + +`pty_flag' + Non-`nil' if communication with the subprocess uses a PTY; `nil' + if it uses a pipe. + +`infd' + The file descriptor for input from the process. + +`outfd' + The file descriptor for output to the process. + +`subtty' + The file descriptor for the terminal that the subprocess is using. + (On some systems, there is no need to record this, so the value is + `-1'.) + +`tty_name' + The name of the terminal that the subprocess is using, or `nil' if + it is using pipes. + + +File: internals.info, Node: Interface to X Windows, Next: Index, Prev: Subprocesses, Up: Top + +Interface to X Windows +********************** + + Not yet documented. + + +File: internals.info, Node: Index, Prev: Interface to X Windows, Up: Top + +Index +***** + +* Menu: + +* Amdahl Corporation: XEmacs. +* Andreessen, Marc: XEmacs. +* asynchronous subprocesses: Modules for Interfacing with the Operating System. +* Baur, Steve: XEmacs. +* Benson, Eric: Lucid Emacs. +* bridge, playing: XEmacs From the Outside. +* Buchholz, Martin: XEmacs. +* Bufbyte: Character-Related Data Types. +* Bufpos: Character-Related Data Types. +* Bytecount: Character-Related Data Types. +* bytecount_to_charcount: Working With Character and Byte Positions. +* Bytind: Character-Related Data Types. +* C vs. Lisp: The Lisp Language. +* caller-protects (GCPRO rule): Writing Lisp Primitives. +* case table: Modules for Other Aspects of the Lisp Interpreter and Object System. +* Charcount: Character-Related Data Types. +* charcount_to_bytecount: Working With Character and Byte Positions. +* charptr_emchar: Working With Character and Byte Positions. +* charptr_n_addr: Working With Character and Byte Positions. +* closer: Lstream Methods. +* closure: The XEmacs Object System (Abstractly Speaking). +* Coding for Mule: Coding for Mule. +* Common Lisp: The Lisp Language. +* compact_string_chars: compact_string_chars. +* conservative garbage collection: GCPROing. +* copy-on-write: General Coding Rules. +* critical redisplay sections: Critical Redisplay Sections. +* DEC_CHARPTR: Working With Character and Byte Positions. +* Devin, Matthieu: Lucid Emacs. +* display order of extents: Mathematics of Extent Ordering. +* dynamic array: Low-Level Modules. +* dynamic scoping: The Lisp Language. +* dynamic types: The Lisp Language. +* Emchar: Character-Related Data Types. +* Energize: Lucid Emacs. +* Epoch <1>: XEmacs. +* Epoch: Lucid Emacs. +* Extbyte: Character-Related Data Types. +* Extcount: Character-Related Data Types. +* extent fragment: Extent Fragments. +* extent mathematics: Mathematics of Extent Ordering. +* extent ordering: Mathematics of Extent Ordering. +* extents, display order: Mathematics of Extent Ordering. +* external widget: Modules for Interfacing with X Windows. +* flusher: Lstream Methods. +* Free Software Foundation: A History of Emacs. +* frob block: Introduction to Allocation. +* FSF: A History of Emacs. +* FSF Emacs <1>: GNU Emacs 20. +* FSF Emacs: GNU Emacs 19. +* garbage collection: Garbage Collection. +* garbage collection protection: Writing Lisp Primitives. +* garbage collection step by step: Garbage Collection - Step by Step. +* garbage collection, conservative: GCPROing. +* garbage collection, invocation: Invocation. +* garbage_collect_1: garbage_collect_1. +* gc_sweep: gc_sweep. +* GNU Emacs 19: GNU Emacs 19. +* GNU Emacs 20: GNU Emacs 20. +* Gosling, James <1>: Through Version 18. +* Gosling, James: The Lisp Language. +* Great Usenet Renaming: Through Version 18. +* Hackers (Steven Levy): A History of Emacs. +* hierarchy of windows: Window Hierarchy. +* history of Emacs: A History of Emacs. +* Illinois, University of: XEmacs. +* INC_CHARPTR: Working With Character and Byte Positions. +* interactive: Modules for Standard Editing Operations. +* interning: The XEmacs Object System (Abstractly Speaking). +* ITS (Incompatible Timesharing System): A History of Emacs. +* Java: The Lisp Language. +* Java vs. Lisp: The Lisp Language. +* Jones, Kyle: XEmacs. +* Kaplan, Simon: XEmacs. +* Levy, Steven: A History of Emacs. +* line start cache: Line Start Cache. +* Lisp vs. C: The Lisp Language. +* Lisp vs. Java: The Lisp Language. +* lstream: Modules for Interfacing with the File System. +* Lstream_close: Lstream Functions. +* Lstream_fgetc: Lstream Functions. +* Lstream_flush: Lstream Functions. +* Lstream_fputc: Lstream Functions. +* Lstream_fungetc: Lstream Functions. +* Lstream_getc: Lstream Functions. +* Lstream_new: Lstream Functions. +* Lstream_putc: Lstream Functions. +* Lstream_read: Lstream Functions. +* Lstream_reopen: Lstream Functions. +* Lstream_rewind: Lstream Functions. +* Lstream_set_buffering: Lstream Functions. +* Lstream_ungetc: Lstream Functions. +* Lstream_unread: Lstream Functions. +* Lstream_write: Lstream Functions. +* Lucid Emacs: Lucid Emacs. +* Lucid Inc.: Lucid Emacs. +* mark and sweep: Garbage Collection. +* mark method <1>: lrecords. +* mark method: Modules for Other Aspects of the Lisp Interpreter and Object System. +* mark_object: mark_object. +* marker: Lstream Methods. +* mathematics of extents: Mathematics of Extent Ordering. +* MAX_EMCHAR_LEN: Working With Character and Byte Positions. +* merging attempts: XEmacs. +* MIT: A History of Emacs. +* Mlynarik, Richard: GNU Emacs 19. +* MULE merged XEmacs appears: XEmacs. +* NAS: Modules for Interfacing with the Operating System. +* native sound: Modules for Interfacing with the Operating System. +* network connections: Modules for Interfacing with the Operating System. +* network sound: Modules for Interfacing with the Operating System. +* Niksic, Hrvoje: XEmacs. +* pane: Modules for the Basic Displayable Lisp Objects. +* permanent objects: The XEmacs Object System (Abstractly Speaking). +* pi, calculating: XEmacs From the Outside. +* pseudo_closer: Lstream Methods. +* pure space: Basic Lisp Modules. +* read syntax: The XEmacs Object System (Abstractly Speaking). +* read-eval-print: XEmacs From the Outside. +* reader: Lstream Methods. +* record type: How Lisp Objects Are Represented in C. +* Redisplay Piece by Piece: Redisplay Piece by Piece. +* relocating allocator: Low-Level Modules. +* rename to XEmacs: XEmacs. +* rewinder: Lstream Methods. +* RMS: A History of Emacs. +* scanner: Modules for Other Aspects of the Lisp Interpreter and Object System. +* scoping, dynamic: The Lisp Language. +* seekable_p: Lstream Methods. +* selections: Modules for Interfacing with X Windows. +* set_charptr_emchar: Working With Character and Byte Positions. +* Sexton, Harlan: Lucid Emacs. +* sound, native: Modules for Interfacing with the Operating System. +* sound, network: Modules for Interfacing with the Operating System. +* SPARCWorks: XEmacs. +* Stallman, Richard: A History of Emacs. +* subprocesses, asynchronous: Modules for Interfacing with the Operating System. +* subprocesses, synchronous: Modules for Interfacing with the Operating System. +* Sun Microsystems: XEmacs. +* sweep_bit_vectors_1: sweep_bit_vectors_1. +* sweep_lcrecords_1: sweep_lcrecords_1. +* sweep_strings: sweep_strings. +* synchronous subprocesses: Modules for Interfacing with the Operating System. +* taxes, doing: XEmacs From the Outside. +* TECO: A History of Emacs. +* temporary objects: The XEmacs Object System (Abstractly Speaking). +* Thompson, Chuck: XEmacs. +* types, dynamic: The Lisp Language. +* University of Illinois: XEmacs. +* Win-Emacs: XEmacs. +* window (in Emacs): Modules for the Basic Displayable Lisp Objects. +* window hierarchy: Window Hierarchy. +* window point internals: The Window Object. +* Wing, Ben: XEmacs. +* writer: Lstream Methods. +* XEmacs: XEmacs. +* XEmacs goes it alone: XEmacs. +* Zawinski, Jamie: Lucid Emacs. + + diff --git a/info/internals.info-9 b/info/internals.info-9 new file mode 100644 index 0000000..368640b --- /dev/null +++ b/info/internals.info-9 @@ -0,0 +1,207 @@ +This is ../info/internals.info, produced by makeinfo version 4.0 from +internals/internals.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Internals: (internals). XEmacs Internals Manual. +END-INFO-DIR-ENTRY + + Copyright (C) 1992 - 1996 Ben Wing. Copyright (C) 1996, 1997 Sun +Microsystems. Copyright (C) 1994 - 1998 Free Software Foundation. +Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: internals.info, Node: Index, Prev: Interface to X Windows, Up: Top + +Index +***** + +* Menu: + +* Amdahl Corporation: XEmacs. +* Andreessen, Marc: XEmacs. +* asynchronous subprocesses: Modules for Interfacing with the Operating System. +* Baur, Steve: XEmacs. +* Benson, Eric: Lucid Emacs. +* bridge, playing: XEmacs From the Outside. +* Buchholz, Martin: XEmacs. +* Bufbyte: Character-Related Data Types. +* Bufpos: Character-Related Data Types. +* Bytecount: Character-Related Data Types. +* bytecount_to_charcount: Working With Character and Byte Positions. +* Bytind: Character-Related Data Types. +* C vs. Lisp: The Lisp Language. +* caller-protects (GCPRO rule): Writing Lisp Primitives. +* case table: Modules for Other Aspects of the Lisp Interpreter and Object System. +* Charcount: Character-Related Data Types. +* charcount_to_bytecount: Working With Character and Byte Positions. +* charptr_emchar: Working With Character and Byte Positions. +* charptr_n_addr: Working With Character and Byte Positions. +* closer: Lstream Methods. +* closure: The XEmacs Object System (Abstractly Speaking). +* Coding for Mule: Coding for Mule. +* Common Lisp: The Lisp Language. +* compact_string_chars: compact_string_chars. +* conservative garbage collection: GCPROing. +* copy-on-write: General Coding Rules. +* critical redisplay sections: Critical Redisplay Sections. +* DEC_CHARPTR: Working With Character and Byte Positions. +* Devin, Matthieu: Lucid Emacs. +* display order of extents: Mathematics of Extent Ordering. +* dynamic array: Low-Level Modules. +* dynamic scoping: The Lisp Language. +* dynamic types: The Lisp Language. +* Emchar: Character-Related Data Types. +* Energize: Lucid Emacs. +* Epoch <1>: XEmacs. +* Epoch: Lucid Emacs. +* Extbyte: Character-Related Data Types. +* Extcount: Character-Related Data Types. +* extent fragment: Extent Fragments. +* extent mathematics: Mathematics of Extent Ordering. +* extent ordering: Mathematics of Extent Ordering. +* extents, display order: Mathematics of Extent Ordering. +* external widget: Modules for Interfacing with X Windows. +* flusher: Lstream Methods. +* Free Software Foundation: A History of Emacs. +* frob block: Introduction to Allocation. +* FSF: A History of Emacs. +* FSF Emacs <1>: GNU Emacs 20. +* FSF Emacs: GNU Emacs 19. +* garbage collection: Garbage Collection. +* garbage collection protection: Writing Lisp Primitives. +* garbage collection step by step: Garbage Collection - Step by Step. +* garbage collection, conservative: GCPROing. +* garbage collection, invocation: Invocation. +* garbage_collect_1: garbage_collect_1. +* gc_sweep: gc_sweep. +* GNU Emacs 19: GNU Emacs 19. +* GNU Emacs 20: GNU Emacs 20. +* Gosling, James <1>: The Lisp Language. +* Gosling, James: Through Version 18. +* Great Usenet Renaming: Through Version 18. +* Hackers (Steven Levy): A History of Emacs. +* hierarchy of windows: Window Hierarchy. +* history of Emacs: A History of Emacs. +* Illinois, University of: XEmacs. +* INC_CHARPTR: Working With Character and Byte Positions. +* interactive: Modules for Standard Editing Operations. +* interning: The XEmacs Object System (Abstractly Speaking). +* ITS (Incompatible Timesharing System): A History of Emacs. +* Java: The Lisp Language. +* Java vs. Lisp: The Lisp Language. +* Jones, Kyle: XEmacs. +* Kaplan, Simon: XEmacs. +* Levy, Steven: A History of Emacs. +* line start cache: Line Start Cache. +* Lisp vs. C: The Lisp Language. +* Lisp vs. Java: The Lisp Language. +* lstream: Modules for Interfacing with the File System. +* Lstream_close: Lstream Functions. +* Lstream_fgetc: Lstream Functions. +* Lstream_flush: Lstream Functions. +* Lstream_fputc: Lstream Functions. +* Lstream_fungetc: Lstream Functions. +* Lstream_getc: Lstream Functions. +* Lstream_new: Lstream Functions. +* Lstream_putc: Lstream Functions. +* Lstream_read: Lstream Functions. +* Lstream_reopen: Lstream Functions. +* Lstream_rewind: Lstream Functions. +* Lstream_set_buffering: Lstream Functions. +* Lstream_ungetc: Lstream Functions. +* Lstream_unread: Lstream Functions. +* Lstream_write: Lstream Functions. +* Lucid Emacs: Lucid Emacs. +* Lucid Inc.: Lucid Emacs. +* mark and sweep: Garbage Collection. +* mark method <1>: lrecords. +* mark method: Modules for Other Aspects of the Lisp Interpreter and Object System. +* mark_object: mark_object. +* marker: Lstream Methods. +* mathematics of extents: Mathematics of Extent Ordering. +* MAX_EMCHAR_LEN: Working With Character and Byte Positions. +* merging attempts: XEmacs. +* MIT: A History of Emacs. +* Mlynarik, Richard: GNU Emacs 19. +* MULE merged XEmacs appears: XEmacs. +* NAS: Modules for Interfacing with the Operating System. +* native sound: Modules for Interfacing with the Operating System. +* network connections: Modules for Interfacing with the Operating System. +* network sound: Modules for Interfacing with the Operating System. +* Niksic, Hrvoje: XEmacs. +* pane: Modules for the Basic Displayable Lisp Objects. +* permanent objects: The XEmacs Object System (Abstractly Speaking). +* pi, calculating: XEmacs From the Outside. +* pseudo_closer: Lstream Methods. +* pure space: Basic Lisp Modules. +* read syntax: The XEmacs Object System (Abstractly Speaking). +* read-eval-print: XEmacs From the Outside. +* reader: Lstream Methods. +* record type: How Lisp Objects Are Represented in C. +* Redisplay Piece by Piece: Redisplay Piece by Piece. +* relocating allocator: Low-Level Modules. +* rename to XEmacs: XEmacs. +* rewinder: Lstream Methods. +* RMS: A History of Emacs. +* scanner: Modules for Other Aspects of the Lisp Interpreter and Object System. +* scoping, dynamic: The Lisp Language. +* seekable_p: Lstream Methods. +* selections: Modules for Interfacing with X Windows. +* set_charptr_emchar: Working With Character and Byte Positions. +* Sexton, Harlan: Lucid Emacs. +* sound, native: Modules for Interfacing with the Operating System. +* sound, network: Modules for Interfacing with the Operating System. +* SPARCWorks: XEmacs. +* Stallman, Richard: A History of Emacs. +* subprocesses, asynchronous: Modules for Interfacing with the Operating System. +* subprocesses, synchronous: Modules for Interfacing with the Operating System. +* Sun Microsystems: XEmacs. +* sweep_bit_vectors_1: sweep_bit_vectors_1. +* sweep_lcrecords_1: sweep_lcrecords_1. +* sweep_strings: sweep_strings. +* synchronous subprocesses: Modules for Interfacing with the Operating System. +* taxes, doing: XEmacs From the Outside. +* TECO: A History of Emacs. +* temporary objects: The XEmacs Object System (Abstractly Speaking). +* Thompson, Chuck: XEmacs. +* types, dynamic: The Lisp Language. +* University of Illinois: XEmacs. +* Win-Emacs: XEmacs. +* window (in Emacs): Modules for the Basic Displayable Lisp Objects. +* window hierarchy: Window Hierarchy. +* window point internals: The Window Object. +* Wing, Ben: XEmacs. +* writer: Lstream Methods. +* XEmacs: XEmacs. +* XEmacs goes it alone: XEmacs. +* Zawinski, Jamie: Lucid Emacs. + + diff --git a/info/lispref.info b/info/lispref.info index afa0020..b7c31a9 100644 --- a/info/lispref.info +++ b/info/lispref.info @@ -1,5 +1,5 @@ -This is ../info/lispref.info, produced by makeinfo version 4.0 from -lispref/lispref.texi. +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -51,869 +51,836 @@ Foundation instead of in the original English.  Indirect: -lispref.info-1: 2366 -lispref.info-2: 49116 -lispref.info-3: 97603 -lispref.info-4: 147443 -lispref.info-5: 197182 -lispref.info-6: 245536 -lispref.info-7: 293943 -lispref.info-8: 342609 -lispref.info-9: 387691 -lispref.info-10: 436623 -lispref.info-11: 485480 -lispref.info-12: 534011 -lispref.info-13: 581563 -lispref.info-14: 629421 -lispref.info-15: 678836 -lispref.info-16: 726831 -lispref.info-17: 772168 -lispref.info-18: 819638 -lispref.info-19: 867196 -lispref.info-20: 914822 -lispref.info-21: 962849 -lispref.info-22: 1011771 -lispref.info-23: 1058034 -lispref.info-24: 1104498 -lispref.info-25: 1154158 -lispref.info-26: 1202849 -lispref.info-27: 1251704 -lispref.info-28: 1300371 -lispref.info-29: 1350322 -lispref.info-30: 1398471 -lispref.info-31: 1444126 -lispref.info-32: 1494115 -lispref.info-33: 1542685 -lispref.info-34: 1589890 -lispref.info-35: 1639716 -lispref.info-36: 1688392 -lispref.info-37: 1734125 -lispref.info-38: 1783264 -lispref.info-39: 1830706 -lispref.info-40: 1879259 -lispref.info-41: 1925812 -lispref.info-42: 1974507 -lispref.info-43: 2018882 -lispref.info-44: 2063267 -lispref.info-45: 2109761 -lispref.info-46: 2150603 -lispref.info-47: 2199821 -lispref.info-48: 2213690 +lispref.info-1: 2387 +lispref.info-2: 48394 +lispref.info-3: 96933 +lispref.info-4: 146792 +lispref.info-5: 195517 +lispref.info-6: 243211 +lispref.info-7: 291472 +lispref.info-8: 340630 +lispref.info-9: 387982 +lispref.info-10: 436629 +lispref.info-11: 484512 +lispref.info-12: 531109 +lispref.info-13: 579014 +lispref.info-14: 627229 +lispref.info-15: 675480 +lispref.info-16: 724640 +lispref.info-17: 771866 +lispref.info-18: 818656 +lispref.info-19: 865712 +lispref.info-20: 914446 +lispref.info-21: 963810 +lispref.info-22: 1010651 +lispref.info-23: 1057664 +lispref.info-24: 1107066 +lispref.info-25: 1156744 +lispref.info-26: 1206642 +lispref.info-27: 1255865 +lispref.info-28: 1304640 +lispref.info-29: 1353618 +lispref.info-30: 1394929 +lispref.info-31: 1444081 +lispref.info-32: 1493295 +lispref.info-33: 1542879 +lispref.info-34: 1591063 +lispref.info-35: 1636699 +lispref.info-36: 1678018 +lispref.info-37: 1722965 +lispref.info-38: 1772661 +lispref.info-39: 1821723 +lispref.info-40: 1871108 +lispref.info-41: 1921004 +lispref.info-42: 1969995 +lispref.info-43: 2014504 +lispref.info-44: 2052883  Tag Table: (Indirect) -Node: Top2366 -Node: Copying49116 -Node: Introduction68274 -Node: Caveats69865 -Node: Lisp History71544 -Node: Conventions72800 -Node: Some Terms73615 -Node: nil and t74336 -Node: Evaluation Notation76013 -Node: Printing Notation76926 -Node: Error Messages77800 -Node: Buffer Text Notation78241 -Node: Format of Descriptions79116 -Node: A Sample Function Description79970 -Node: A Sample Variable Description83956 -Node: Acknowledgements84864 -Node: Lisp Data Types86842 -Node: Printed Representation89397 -Node: Comments91439 -Node: Primitive Types92336 -Node: Programming Types93995 -Node: Integer Type95947 -Node: Floating Point Type96984 -Node: Character Type97603 -Node: Symbol Type105507 -Node: Sequence Type108202 -Node: Cons Cell Type109721 -Node: Dotted Pair Notation114205 -Node: Association List Type116326 -Node: Array Type117209 -Node: String Type118675 -Node: Vector Type121356 -Node: Bit Vector Type122128 -Node: Function Type122990 -Node: Macro Type124103 -Node: Primitive Function Type124800 -Node: Compiled-Function Type126326 -Node: Autoload Type126880 -Node: Char Table Type127894 -Node: Hash Table Type128068 -Node: Range Table Type129223 -Node: Weak List Type130076 -Node: Editing Types130226 -Node: Buffer Type131853 -Node: Marker Type133880 -Node: Extent Type134604 -Node: Window Type135872 -Node: Frame Type137283 -Node: Device Type138078 -Node: Console Type138904 -Node: Window Configuration Type140105 -Node: Event Type140803 -Node: Process Type140967 -Node: Stream Type142002 -Node: Keymap Type143125 -Node: Syntax Table Type143663 -Node: Display Table Type144686 -Node: Database Type145125 -Node: Charset Type145291 -Node: Coding System Type145455 -Node: ToolTalk Message Type145639 -Node: ToolTalk Pattern Type145838 -Node: Window-System Types146010 -Node: Face Type147156 -Node: Glyph Type147287 -Node: Specifier Type147443 -Node: Font Instance Type147616 -Node: Color Instance Type147806 -Node: Image Instance Type148003 -Node: Toolbar Button Type148201 -Node: Subwindow Type148394 -Node: X Resource Type148573 -Node: Type Predicates148726 -Node: Equality Predicates157855 -Node: Numbers162666 -Node: Integer Basics164121 -Node: Float Basics166470 -Node: Predicates on Numbers168212 -Node: Comparison of Numbers169845 -Node: Numeric Conversions173666 -Node: Arithmetic Operations175132 -Node: Rounding Operations181271 -Node: Bitwise Operations182384 -Node: Math Functions191430 -Node: Random Numbers193963 -Node: Strings and Characters195729 -Node: String Basics197182 -Node: Predicates for Strings199600 -Node: Creating Strings200363 -Node: Predicates for Characters205704 -Node: Character Codes206775 -Node: Text Comparison208195 -Node: String Conversion211640 -Node: Modifying Strings215310 -Node: String Properties215951 -Node: Formatting Strings216596 -Node: Character Case226214 -Node: Case Tables229768 -Node: Char Tables233739 -Node: Char Table Types235131 -Node: Working With Char Tables236716 -Node: Lists238733 -Node: Cons Cells239856 -Node: Lists as Boxes241192 -Node: List-related Predicates243834 -Node: List Elements245536 -Node: Building Lists250565 -Node: Modifying Lists256557 -Node: Setcar257369 -Node: Setcdr259800 -Node: Rearrangement262321 -Node: Sets And Lists267907 -Node: Association Lists272135 -Ref: Association Lists-Footnote-1281426 -Node: Property Lists281631 -Node: Working With Normal Plists283179 -Node: Working With Lax Plists285516 -Node: Converting Plists To/From Alists287796 -Node: Weak Lists289144 -Node: Sequences Arrays Vectors291307 -Node: Sequence Functions293943 -Node: Arrays297602 -Node: Array Functions300666 -Node: Vectors303199 -Node: Vector Functions304697 -Node: Bit Vectors307268 -Node: Bit Vector Functions308113 -Node: Symbols310412 -Node: Symbol Components311461 -Node: Definitions315644 -Node: Creating Symbols317869 -Node: Symbol Properties324903 -Node: Plists and Alists326430 -Node: Object Plists328179 -Node: Other Plists330939 -Node: Evaluation332738 -Node: Intro Eval333543 -Ref: Intro Eval-Footnote-1336896 -Node: Eval337031 -Node: Forms341450 -Node: Self-Evaluating Forms342609 -Node: Symbol Forms344122 -Node: Classifying Lists345039 -Node: Function Indirection345795 -Node: Function Forms348894 -Node: Macro Forms349891 -Node: Special Forms351491 -Node: Autoloading353800 -Node: Quoting354298 -Node: Control Structures355659 -Node: Sequencing357279 -Node: Conditionals360144 -Node: Combining Conditions363567 -Node: Iteration366837 -Node: Nonlocal Exits368616 -Node: Catch and Throw369318 -Node: Examples of Catch373157 -Node: Errors375176 -Node: Signaling Errors376665 -Node: Processing of Errors385412 -Node: Handling Errors387691 -Node: Error Symbols394932 -Node: Cleanups398888 -Node: Variables402666 -Node: Global Variables404435 -Node: Constant Variables405511 -Node: Local Variables406137 -Node: Void Variables411075 -Node: Defining Variables414591 -Node: Accessing Variables421755 -Node: Setting Variables423180 -Node: Variable Scoping427699 -Node: Scope429298 -Node: Extent430823 -Node: Impl of Scope432302 -Node: Using Scoping434265 -Node: Buffer-Local Variables435787 -Node: Intro to Buffer-Local436623 -Node: Creating Buffer-Local439166 -Node: Default Value445065 -Node: Variable Aliases448208 -Node: Functions450059 -Node: What Is a Function451153 -Node: Lambda Expressions455199 -Node: Lambda Components456109 -Node: Simple Lambda457941 -Node: Argument List459598 -Node: Function Documentation463326 -Node: Function Names465268 -Node: Defining Functions467841 -Node: Calling Functions470881 -Node: Mapping Functions474729 -Node: Anonymous Functions477417 -Node: Function Cells480662 -Node: Inline Functions485480 -Node: Related Topics487290 -Node: Macros488343 -Node: Simple Macro489627 -Node: Expansion490362 -Node: Compiling Macros493366 -Node: Defining Macros495202 -Node: Backquote496519 -Node: Problems with Macros498916 -Node: Argument Evaluation499611 -Node: Surprising Local Vars502526 -Node: Eval During Expansion504594 -Node: Repeated Expansion506287 -Node: Customization508203 -Node: Common Keywords508672 -Node: Group Definitions511517 -Node: Variable Definitions513709 -Node: Customization Types518699 -Node: Simple Types520134 -Node: Composite Types522291 -Node: Splicing into Lists526981 -Node: Type Keywords528816 -Node: Loading532336 -Node: How Programs Do Loading534011 -Node: Autoload543137 -Node: Repeated Loading549207 -Node: Named Features551320 -Node: Unloading557750 -Node: Hooks for Loading559906 -Node: Byte Compilation560623 -Node: Speed of Byte-Code562616 -Node: Compilation Functions563823 -Node: Docs and Compilation570480 -Node: Dynamic Loading573133 -Node: Eval During Compile575497 -Node: Compiled-Function Objects576762 -Node: Disassembly581563 -Node: Different Behavior588844 -Node: Debugging590189 -Node: Debugger591601 -Node: Error Debugging592746 -Node: Infinite Loops595499 -Node: Function Debugging596743 -Node: Explicit Debug599543 -Node: Using Debugger600314 -Node: Debugger Commands602176 -Node: Invoking the Debugger606493 -Node: Internals of Debugger610408 -Node: Syntax Errors615295 -Node: Excess Open616543 -Node: Excess Close618418 -Node: Compilation Errors619839 -Node: Edebug621127 -Node: Using Edebug623235 -Node: Instrumenting625932 -Node: Edebug Execution Modes629421 -Node: Jumping632531 -Node: Edebug Misc634874 -Node: Breakpoints636263 -Node: Global Break Condition639069 -Node: Embedded Breakpoints640024 -Node: Trapping Errors640979 -Node: Edebug Views643055 -Node: Edebug Eval645020 -Node: Eval List646197 -Node: Reading in Edebug649582 -Node: Printing in Edebug650381 -Node: Tracing652096 -Node: Coverage Testing653984 -Node: The Outside Context656025 -Node: Checking Whether to Stop656974 -Node: Edebug Display Update657621 -Node: Edebug Recursive Edit659644 -Node: Instrumenting Macro Calls661299 -Node: Specification List663781 -Node: Backtracking673192 -Node: Debugging Backquote675130 -Node: Specification Examples678836 -Node: Edebug Options680903 -Node: Read and Print686242 -Node: Streams Intro687219 -Node: Input Streams689237 -Node: Input Functions694138 -Node: Output Streams696198 -Node: Output Functions700249 -Node: Output Variables704549 -Node: Minibuffers709350 -Node: Intro to Minibuffers710502 -Node: Text from Minibuffer712690 -Node: Object from Minibuffer717784 -Node: Minibuffer History721877 -Node: Completion724856 -Node: Basic Completion726831 -Node: Minibuffer Completion731714 -Node: Completion Commands735291 -Node: High-Level Completion739948 -Node: Reading File Names744697 -Node: Programmed Completion748389 -Node: Yes-or-No Queries750771 -Node: Multiple Queries756508 -Node: Reading a Password760575 -Node: Minibuffer Misc761918 -Node: Command Loop766798 -Node: Command Overview768142 -Node: Defining Commands771420 -Node: Using Interactive772168 -Node: Interactive Codes776941 -Node: Interactive Examples782733 -Node: Interactive Call784047 -Node: Command Loop Info789462 -Node: Events794441 -Node: Event Types795902 -Node: Event Contents797825 -Node: Event Predicates802301 -Node: Accessing Mouse Event Positions803619 -Node: Frame-Level Event Position Info804318 -Node: Window-Level Event Position Info805358 -Node: Event Text Position Info807122 -Node: Event Glyph Position Info809614 -Node: Event Toolbar Position Info810937 -Node: Other Event Position Info811608 -Node: Accessing Other Event Info812017 -Node: Working With Events813637 -Node: Converting Events819638 -Node: Reading Input823037 -Node: Key Sequence Input824039 -Node: Reading One Event826674 -Node: Dispatching an Event829498 -Node: Quoted Character Input829949 -Node: Peeking and Discarding831297 -Node: Waiting835201 -Node: Quitting837515 -Node: Prefix Command Arguments841923 -Node: Recursive Editing847010 -Node: Disabling Commands851805 -Node: Command History853873 -Node: Keyboard Macros855610 -Node: Keymaps857827 -Node: Keymap Terminology859404 -Node: Format of Keymaps862333 -Node: Creating Keymaps862744 -Node: Inheritance and Keymaps864824 -Node: Key Sequences867196 -Node: Prefix Keys871992 -Node: Active Keymaps875577 -Node: Key Lookup884948 -Node: Functions for Key Lookup890111 -Node: Changing Key Bindings895812 -Node: Key Binding Commands902974 -Node: Scanning Keymaps905039 -Node: Other Keymap Functions913608 -Node: Menus914230 -Node: Menu Format914822 -Node: Menubar Format923468 -Node: Menubar924093 -Node: Modifying Menus927206 -Node: Menu Filters932550 -Node: Pop-Up Menus934446 -Node: Menu Accelerators936774 -Node: Creating Menu Accelerators937530 -Node: Keyboard Menu Traversal938890 -Node: Menu Accelerator Functions939617 -Node: Buffers Menu942693 -Node: Dialog Boxes943987 -Node: Dialog Box Format944154 -Node: Dialog Box Functions945579 -Node: Toolbar945976 -Node: Toolbar Intro946411 -Node: Creating Toolbar948811 -Node: Toolbar Descriptor Format949728 -Node: Specifying the Toolbar954225 -Node: Other Toolbar Variables957832 -Node: Gutter962260 -Node: Gutter Intro962849 -Node: Creating Gutter964852 -Node: Gutter Descriptor Format967739 -Node: Specifying a Gutter972196 -Node: Other Gutter Variables975731 -Node: Common Gutter Widgets980118 -Node: Buffer Tabs981110 -Node: Progress Bars981251 -Node: Scrollbars981396 -Node: Drag and Drop981531 -Node: Supported Protocols982607 -Node: OffiX DND983110 -Node: CDE dt984117 -Node: MSWindows OLE984708 -Node: Loose ends984879 -Node: Drop Interface985271 -Node: Drag Interface986293 -Node: Modes986467 -Node: Major Modes987418 -Node: Major Mode Conventions990333 -Node: Example Major Modes996288 -Node: Auto Major Mode1004321 -Node: Mode Help1011771 -Node: Derived Modes1012872 -Node: Minor Modes1015063 -Node: Minor Mode Conventions1016365 -Node: Keymaps and Minor Modes1019228 -Node: Modeline Format1020063 -Node: Modeline Data1021831 -Node: Modeline Variables1026984 -Node: %-Constructs1031700 -Node: Hooks1034687 -Node: Documentation1041447 -Node: Documentation Basics1042870 -Node: Accessing Documentation1045921 -Node: Keys in Documentation1052202 -Node: Describing Characters1055685 -Node: Help Functions1058034 -Node: Obsoleteness1064484 -Node: Files1067476 -Node: Visiting Files1069401 -Node: Visiting Functions1070906 -Node: Subroutines of Visiting1076064 -Node: Saving Buffers1078137 -Node: Reading from Files1084230 -Node: Writing to Files1086391 -Node: File Locks1089108 -Node: Information about Files1092175 -Node: Testing Accessibility1092936 -Node: Kinds of Files1096676 -Node: Truenames1098357 -Node: File Attributes1099359 -Node: Changing File Attributes1104498 -Node: File Names1109920 -Node: File Name Components1111493 -Node: Directory Names1113938 -Node: Relative File Names1117168 -Node: File Name Expansion1118138 -Node: Unique File Names1121892 -Node: File Name Completion1123507 -Node: User Name Completion1126775 -Node: Contents of Directories1128182 -Node: Create/Delete Dirs1131495 -Node: Magic File Names1132601 -Node: Partial Files1138249 -Node: Intro to Partial Files1138477 -Node: Creating a Partial File1139717 -Node: Detached Partial Files1140653 -Node: Format Conversion1141775 -Node: Files and MS-DOS1147273 -Node: Backups and Auto-Saving1149337 -Node: Backup Files1150012 -Node: Making Backups1151409 -Node: Rename or Copy1154158 -Node: Numbered Backups1156651 -Node: Backup Names1158886 -Node: Auto-Saving1162178 -Node: Reverting1170340 -Node: Buffers1173676 -Node: Buffer Basics1175092 -Node: Current Buffer1177145 -Node: Buffer Names1181849 -Node: Buffer File Name1185056 -Node: Buffer Modification1189175 -Node: Modification Time1191418 -Node: Read Only Buffers1194793 -Node: The Buffer List1198032 -Node: Creating Buffers1202849 -Node: Killing Buffers1204995 -Node: Indirect Buffers1208827 -Node: Windows1211401 -Node: Basic Windows1212879 -Node: Splitting Windows1215977 -Node: Deleting Windows1221303 -Node: Selecting Windows1225221 -Node: Cyclic Window Ordering1229444 -Node: Buffers and Windows1234599 -Node: Displaying Buffers1236377 -Node: Choosing Window1241716 -Node: Window Point1249634 -Node: Window Start1251704 -Node: Vertical Scrolling1256503 -Node: Horizontal Scrolling1262701 -Node: Size of Window1266230 -Node: Position of Window1270948 -Node: Resizing Windows1273201 -Node: Window Configurations1278639 -Node: Frames1282136 -Node: Creating Frames1284477 -Node: Frame Properties1285817 -Node: Property Access1286633 -Node: Initial Properties1287540 -Node: X Frame Properties1290026 -Node: Size and Position1294660 -Node: Frame Name1296658 -Node: Frame Titles1297572 -Node: Deleting Frames1299396 -Node: Finding All Frames1300371 -Node: Frames and Windows1303599 -Node: Minibuffers and Frames1306381 -Node: Input Focus1307299 -Node: Visibility of Frames1310404 -Node: Raising and Lowering1312394 -Node: Frame Configurations1314770 -Node: Frame Hooks1315827 -Node: Consoles and Devices1317632 -Node: Basic Console Functions1320375 -Node: Basic Device Functions1320798 -Node: Console Types and Device Classes1321644 -Node: Connecting to a Console or Device1323911 -Node: The Selected Console and Device1326095 -Node: Console and Device I/O1327121 -Node: Positions1327885 -Node: Point1328854 -Node: Motion1331944 -Node: Character Motion1332711 -Node: Word Motion1334948 -Node: Buffer End Motion1336338 -Node: Text Lines1337875 -Node: Screen Lines1342776 -Node: List Motion1346839 -Node: Skipping Characters1350322 -Node: Excursions1352541 -Node: Narrowing1355581 -Node: Markers1360912 -Node: Overview of Markers1361818 -Node: Predicates on Markers1366510 -Node: Creating Markers1367756 -Node: Information from Markers1371956 -Node: Changing Markers1373054 -Node: The Mark1374582 -Node: The Region1383085 -Node: Text1388771 -Node: Near Point1391470 -Node: Buffer Contents1395657 -Node: Comparing Text1397063 -Node: Insertion1398471 -Node: Commands for Insertion1402381 -Node: Deletion1405275 -Node: User-Level Deletion1408925 -Node: The Kill Ring1413085 -Node: Kill Ring Concepts1415259 -Node: Kill Functions1416313 -Node: Yank Commands1418236 -Node: Low-Level Kill Ring1420107 -Node: Internals of Kill Ring1423193 -Node: Undo1425973 -Node: Maintaining Undo1430310 -Node: Filling1432928 -Node: Margins1438922 -Node: Auto Filling1442945 -Node: Sorting1444126 -Node: Columns1453440 -Node: Indentation1456521 -Node: Primitive Indent1457300 -Node: Mode-Specific Indent1458625 -Node: Region Indent1461157 -Node: Relative Indent1464104 -Node: Indent Tabs1466486 -Node: Motion by Indent1467807 -Node: Case Changes1468586 -Node: Text Properties1471939 -Node: Examining Properties1473752 -Node: Changing Properties1475635 -Node: Property Search1479226 -Node: Special Properties1483945 -Node: Saving Properties1484226 -Node: Substitution1487368 -Node: Registers1490638 -Node: Transposition1493221 -Node: Change Hooks1494115 -Node: Transformations1496155 -Node: Searching and Matching1501259 -Node: String Search1502390 -Node: Regular Expressions1507371 -Node: Syntax of Regexps1508738 -Node: Regexp Example1523341 -Node: Regexp Search1525511 -Node: POSIX Regexps1531848 -Node: Search and Replace1533925 -Node: Match Data1537290 -Node: Simple Match Data1538420 -Node: Replacing Match1542685 -Node: Entire Match Data1545366 -Node: Saving Match Data1547604 -Node: Searching and Case1548992 -Node: Standard Regexps1551026 -Node: Syntax Tables1553224 -Node: Syntax Basics1554338 -Node: Syntax Descriptors1557310 -Node: Syntax Class Table1559160 -Node: Syntax Flags1565198 -Node: Syntax Table Functions1568415 -Node: Motion and Syntax1572703 -Node: Parsing Expressions1574155 -Node: Standard Syntax Tables1580253 -Node: Syntax Table Internals1581097 -Node: Abbrevs1582123 -Node: Abbrev Mode1583927 -Node: Abbrev Tables1584647 -Node: Defining Abbrevs1586186 -Node: Abbrev Files1588107 -Node: Abbrev Expansion1589890 -Node: Standard Abbrev Tables1594521 -Node: Extents1595680 -Node: Intro to Extents1596923 -Node: Creating and Modifying Extents1600915 -Node: Extent Endpoints1602496 -Node: Finding Extents1605759 -Node: Mapping Over Extents1609881 -Node: Extent Properties1616004 -Node: Detached Extents1626165 -Node: Extent Parents1628024 -Node: Duplicable Extents1629718 -Node: Extents and Events1632939 -Node: Atomic Extents1634846 -Node: Specifiers1635293 -Node: Introduction to Specifiers1637406 -Node: Specifiers In-Depth1639716 -Node: Specifier Instancing1644628 -Node: Specifier Types1647890 -Node: Adding Specifications1652964 -Node: Retrieving Specifications1662385 -Node: Specifier Tag Functions1666130 -Node: Specifier Instancing Functions1669364 -Node: Specifier Example1672771 -Node: Creating Specifiers1675927 -Node: Specifier Validation Functions1680244 -Node: Other Specification Functions1682630 -Node: Faces and Window-System Objects1686451 -Node: Faces1686775 -Node: Merging Faces1688392 -Node: Basic Face Functions1690353 -Node: Face Properties1692501 -Node: Face Convenience Functions1702774 -Node: Other Face Display Functions1705994 -Node: Fonts1706806 -Node: Font Specifiers1707507 -Node: Font Instances1708692 -Node: Font Instance Names1709659 -Node: Font Instance Size1710500 -Node: Font Instance Characteristics1711786 -Node: Font Convenience Functions1712964 -Node: Colors1714254 -Node: Color Specifiers1714694 -Node: Color Instances1717054 -Node: Color Instance Properties1717798 -Node: Color Convenience Functions1718424 -Node: Glyphs1719477 -Node: Glyph Functions1721078 -Node: Creating Glyphs1721485 -Node: Glyph Properties1734125 -Node: Glyph Convenience Functions1743292 -Node: Glyph Dimensions1747239 -Node: Images1748319 -Node: Image Specifiers1748768 -Node: Image Instantiator Conversion1764259 -Node: Image Instances1765624 -Node: Image Instance Types1766375 -Node: Image Instance Functions1769140 -Node: Glyph Types1776197 -Node: Mouse Pointer1777969 -Node: Redisplay Glyphs1780972 -Node: Subwindows1782005 -Node: Annotations1782248 -Node: Annotation Basics1783264 -Node: Annotation Primitives1787202 -Node: Annotation Properties1788541 -Node: Locating Annotations1791581 -Node: Margin Primitives1792418 -Node: Annotation Hooks1794312 -Node: Display1794972 -Node: Refresh Screen1795950 -Node: Truncation1798144 -Node: The Echo Area1800669 -Node: Warnings1807112 -Node: Invisible Text1811548 -Node: Selective Display1814127 -Node: Overlay Arrow1818253 -Node: Temporary Displays1819606 -Node: Blinking1823727 -Node: Usual Display1825911 -Node: Display Tables1828460 -Node: Display Table Format1829264 -Node: Active Display Table1830706 -Node: Character Descriptors1834701 -Node: Beeping1835458 -Node: Hash Tables1840224 -Node: Introduction to Hash Tables1840832 -Node: Working With Hash Tables1847391 -Node: Weak Hash Tables1848508 -Node: Range Tables1850525 -Node: Introduction to Range Tables1851214 -Node: Working With Range Tables1851660 -Node: Databases1852619 -Node: Connecting to a Database1852918 -Node: Working With a Database1854025 -Node: Other Database Functions1854899 -Node: Processes1855468 -Node: Subprocess Creation1857692 -Node: Synchronous Processes1861143 -Node: MS-DOS Subprocesses1867865 -Node: Asynchronous Processes1868939 -Node: Deleting Processes1873296 -Node: Process Information1875167 -Node: Input to Processes1879259 -Node: Signals to Processes1881954 -Node: Output from Processes1886769 -Node: Process Buffers1887581 -Node: Filter Functions1890460 -Node: Accepting Output1896051 -Node: Sentinels1897578 -Node: Process Window Size1901068 -Node: Transaction Queues1901417 -Node: Network1903115 -Node: System Interface1905749 -Node: Starting Up1907019 -Node: Start-up Summary1907613 -Node: Init File1911167 -Node: Terminal-Specific1913548 -Node: Command Line Arguments1916707 -Node: Getting Out1920196 -Node: Killing XEmacs1920765 -Node: Suspending XEmacs1922433 -Node: System Environment1925812 -Node: User Identification1931993 -Node: Time of Day1935522 -Node: Time Conversion1938309 -Node: Timers1943551 -Node: Terminal Input1945724 -Node: Input Modes1946227 -Node: Translating Input1948686 -Node: Recording Input1952851 -Node: Terminal Output1954951 -Node: Flow Control1958572 -Node: Batch Mode1962534 -Node: X-Windows1963916 -Node: X Selections1964787 -Node: X Server1967538 -Node: Resources1967989 -Node: Server Data1973300 -Node: Grabs1974507 -Node: X Miscellaneous1976087 -Node: ToolTalk Support1978472 -Node: XEmacs ToolTalk API Summary1978689 -Node: Sending Messages1979989 -Node: Example of Sending Messages1980240 -Node: Elisp Interface for Sending Messages1981302 -Node: Receiving Messages1987898 -Node: Example of Receiving Messages1988121 -Node: Elisp Interface for Receiving Messages1988957 -Node: LDAP Support1992814 -Node: Building XEmacs with LDAP support1993308 -Node: XEmacs LDAP API1994285 -Node: LDAP Variables1995337 -Node: The High-Level LDAP API1997937 -Node: The Low-Level LDAP API2001410 -Node: The LDAP Lisp Object2002241 -Node: Opening and Closing a LDAP Connection2002796 -Node: Low-level Operations on a LDAP Server2004602 -Node: LDAP Internationalization2007326 -Node: LDAP Internationalization Variables2008231 -Node: Encoder/Decoder Functions2009962 -Node: Syntax of Search Filters2010999 -Node: PostgreSQL Support2012297 -Node: Building XEmacs with PostgreSQL support2012692 -Node: XEmacs PostgreSQL libpq API2014039 -Node: libpq Lisp Variables2015918 -Node: libpq Lisp Symbols and DataTypes2018882 -Node: Synchronous Interface Functions2032138 -Node: Asynchronous Interface Functions2036629 -Node: Large Object Support2040134 -Node: Other libpq Functions2040761 -Node: Unimplemented libpq Functions2043796 -Node: XEmacs PostgreSQL libpq Examples2049115 -Node: Internationalization2055206 -Node: I18N Levels 1 and 22055549 -Node: I18N Level 32056255 -Node: Level 3 Basics2056536 -Node: Level 3 Primitives2057369 -Node: Dynamic Messaging2058975 -Node: Domain Specification2059438 -Node: Documentation String Extraction2061108 -Node: I18N Level 42062026 -Node: MULE2062218 -Node: Internationalization Terminology2063267 -Node: Charsets2075466 -Node: Charset Properties2076162 -Node: Basic Charset Functions2080877 -Node: Charset Property Functions2083058 -Node: Predefined Charsets2085128 -Node: MULE Characters2088048 -Node: Composite Characters2088923 -Node: Coding Systems2090190 -Node: Coding System Types2092330 -Node: ISO 20222096314 -Node: EOL Conversion2108589 -Node: Coding System Properties2109761 -Node: Basic Coding System Functions2114084 -Node: Coding System Property Functions2116118 -Node: Encoding and Decoding Text2116676 -Node: Detection of Textual Encoding2117812 -Node: Big5 and Shift-JIS Functions2119348 -Node: Predefined Coding Systems2120500 -Node: CCL2132594 -Node: CCL Syntax2135698 -Node: CCL Statements2137274 -Node: CCL Expressions2141922 -Node: Calling CCL2144461 -Node: CCL Examples2147466 -Node: Category Tables2147603 -Node: Tips2149962 -Node: Style Tips2150603 -Node: Compilation Tips2160122 -Node: Documentation Tips2162036 -Node: Comment Tips2167545 -Node: Library Headers2170548 -Node: Building XEmacs and Object Allocation2174520 -Node: Building XEmacs2175403 -Node: Pure Storage2181981 -Node: Garbage Collection2184769 -Node: Standard Errors2195612 -Node: Standard Buffer-Local Variables2199821 -Node: Standard Keymaps2202456 -Node: Standard Hooks2206190 -Node: Index2213690 +Node: Top2387 +Node: Copying48394 +Node: Introduction67552 +Node: Caveats69143 +Node: Lisp History70872 +Node: Conventions72128 +Node: Some Terms72943 +Node: nil and t73664 +Node: Evaluation Notation75341 +Node: Printing Notation76254 +Node: Error Messages77128 +Node: Buffer Text Notation77569 +Node: Format of Descriptions78444 +Node: A Sample Function Description79298 +Node: A Sample Variable Description83284 +Node: Acknowledgements84192 +Node: Lisp Data Types86170 +Node: Printed Representation88725 +Node: Comments90768 +Node: Primitive Types91666 +Node: Programming Types93325 +Node: Integer Type95277 +Node: Floating Point Type96314 +Node: Character Type96933 +Node: Symbol Type104839 +Node: Sequence Type107534 +Node: Cons Cell Type109055 +Node: Dotted Pair Notation113538 +Node: Association List Type115659 +Node: Array Type116542 +Node: String Type118008 +Node: Vector Type120689 +Node: Bit Vector Type121461 +Node: Function Type122323 +Node: Macro Type123439 +Node: Primitive Function Type124136 +Node: Compiled-Function Type125663 +Node: Autoload Type126217 +Node: Char Table Type127231 +Node: Hash Table Type127405 +Node: Range Table Type128560 +Node: Weak List Type129413 +Node: Editing Types129563 +Node: Buffer Type131190 +Node: Marker Type133226 +Node: Extent Type133950 +Node: Window Type135218 +Node: Frame Type136629 +Node: Device Type137424 +Node: Console Type138250 +Node: Window Configuration Type139451 +Node: Event Type140149 +Node: Process Type140313 +Node: Stream Type141348 +Node: Keymap Type142473 +Node: Syntax Table Type143011 +Node: Display Table Type144035 +Node: Database Type144474 +Node: Charset Type144640 +Node: Coding System Type144804 +Node: ToolTalk Message Type144988 +Node: ToolTalk Pattern Type145187 +Node: Window-System Types145359 +Node: Face Type146505 +Node: Glyph Type146636 +Node: Specifier Type146792 +Node: Font Instance Type146965 +Node: Color Instance Type147155 +Node: Image Instance Type147352 +Node: Toolbar Button Type147550 +Node: Subwindow Type147743 +Node: X Resource Type147922 +Node: Type Predicates148075 +Node: Equality Predicates157205 +Node: Numbers162010 +Node: Integer Basics163465 +Node: Float Basics165815 +Node: Predicates on Numbers167557 +Node: Comparison of Numbers169190 +Node: Numeric Conversions173011 +Node: Arithmetic Operations174477 +Node: Rounding Operations179942 +Node: Bitwise Operations181047 +Node: Math Functions189982 +Node: Random Numbers192298 +Node: Strings and Characters194064 +Node: String Basics195517 +Node: Predicates for Strings197939 +Node: Creating Strings198702 +Node: Predicates for Characters204030 +Node: Character Codes205101 +Node: Text Comparison206514 +Node: String Conversion209876 +Node: Modifying Strings213554 +Node: String Properties214195 +Node: Formatting Strings214838 +Node: Character Case224446 +Node: Case Tables227593 +Node: Char Tables231492 +Node: Char Table Types232884 +Node: Working With Char Tables234459 +Node: Lists236408 +Node: Cons Cells237531 +Node: Lists as Boxes238867 +Node: List-related Predicates241509 +Node: List Elements243211 +Node: Building Lists248240 +Node: Modifying Lists254235 +Node: Setcar255047 +Node: Setcdr257468 +Node: Rearrangement259978 +Node: Sets And Lists265537 +Node: Association Lists269766 +Node: Property Lists279267 +Node: Working With Normal Plists280815 +Node: Working With Lax Plists283083 +Node: Converting Plists To/From Alists285323 +Node: Weak Lists286671 +Node: Sequences Arrays Vectors288836 +Node: Sequence Functions291472 +Node: Arrays295133 +Node: Array Functions298198 +Node: Vectors300731 +Node: Vector Functions302229 +Node: Bit Vectors304803 +Node: Bit Vector Functions305648 +Node: Symbols307899 +Node: Symbol Components308948 +Node: Definitions313127 +Node: Creating Symbols315352 +Node: Symbol Properties322390 +Node: Plists and Alists323906 +Node: Symbol Plists325656 +Node: Other Plists327466 +Node: Evaluation329244 +Node: Intro Eval330049 +Node: Eval333540 +Node: Forms337960 +Node: Self-Evaluating Forms339117 +Node: Symbol Forms340630 +Node: Classifying Lists341547 +Node: Function Indirection342303 +Node: Function Forms345418 +Node: Macro Forms346417 +Node: Special Forms348017 +Node: Autoloading350351 +Node: Quoting350849 +Node: Control Structures352212 +Node: Sequencing353834 +Node: Conditionals356699 +Node: Combining Conditions360122 +Node: Iteration363392 +Node: Nonlocal Exits365177 +Node: Catch and Throw365879 +Node: Examples of Catch369723 +Node: Errors371742 +Node: Signaling Errors373231 +Node: Processing of Errors376299 +Node: Handling Errors377629 +Node: Error Symbols384535 +Node: Cleanups387982 +Node: Variables391762 +Node: Global Variables393531 +Node: Constant Variables394607 +Node: Local Variables395233 +Node: Void Variables400177 +Node: Defining Variables403688 +Node: Accessing Variables410853 +Node: Setting Variables412279 +Node: Variable Scoping416798 +Node: Scope418397 +Node: Extent419922 +Node: Impl of Scope421401 +Node: Using Scoping423364 +Node: Buffer-Local Variables424886 +Node: Intro to Buffer-Local425722 +Node: Creating Buffer-Local428265 +Node: Default Value433485 +Node: Variable Aliases436629 +Node: Functions438415 +Node: What Is a Function439509 +Node: Lambda Expressions443556 +Node: Lambda Components444466 +Node: Simple Lambda446298 +Node: Argument List447957 +Node: Function Documentation451685 +Node: Function Names453627 +Node: Defining Functions456201 +Node: Calling Functions459243 +Node: Mapping Functions463092 +Node: Anonymous Functions465445 +Node: Function Cells468690 +Node: Inline Functions473500 +Node: Related Topics475310 +Node: Macros476363 +Node: Simple Macro477647 +Node: Expansion478382 +Node: Compiling Macros481356 +Node: Defining Macros483194 +Node: Backquote484512 +Node: Problems with Macros486910 +Node: Argument Evaluation487605 +Node: Surprising Local Vars490506 +Node: Eval During Expansion492574 +Node: Repeated Expansion494268 +Node: Customization496179 +Node: Common Keywords496648 +Node: Group Definitions499493 +Node: Variable Definitions501686 +Node: Customization Types506669 +Node: Simple Types508105 +Node: Composite Types510262 +Node: Splicing into Lists514952 +Node: Type Keywords516787 +Node: Loading520307 +Node: How Programs Do Loading521980 +Node: Autoload531109 +Node: Repeated Loading537189 +Node: Named Features539303 +Node: Unloading545736 +Node: Hooks for Loading547892 +Node: Byte Compilation548609 +Node: Speed of Byte-Code550526 +Node: Compilation Functions551733 +Node: Docs and Compilation558122 +Node: Dynamic Loading560775 +Node: Eval During Compile563139 +Node: Compiled-Function Objects564404 +Node: Disassembly569203 +Node: Debugging576457 +Node: Debugger577869 +Node: Error Debugging579014 +Node: Infinite Loops581767 +Node: Function Debugging583011 +Node: Explicit Debug585801 +Node: Using Debugger586573 +Node: Debugger Commands588437 +Node: Invoking the Debugger592754 +Node: Internals of Debugger596669 +Node: Syntax Errors601546 +Node: Excess Open602794 +Node: Excess Close604669 +Node: Compilation Errors606090 +Node: Edebug607378 +Node: Using Edebug609485 +Node: Instrumenting612182 +Node: Edebug Execution Modes615671 +Node: Jumping618781 +Node: Edebug Misc621124 +Node: Breakpoints622513 +Node: Global Break Condition625319 +Node: Embedded Breakpoints626274 +Node: Trapping Errors627229 +Node: Edebug Views629305 +Node: Edebug Eval631270 +Node: Eval List632447 +Node: Reading in Edebug635832 +Node: Printing in Edebug636631 +Node: Tracing638346 +Node: Coverage Testing640232 +Node: The Outside Context642273 +Node: Checking Whether to Stop643222 +Node: Edebug Display Update643868 +Node: Edebug Recursive Edit645890 +Node: Instrumenting Macro Calls647544 +Node: Specification List650026 +Node: Backtracking659437 +Node: Debugging Backquote661375 +Node: Specification Examples665081 +Node: Edebug Options667148 +Node: Read and Print672485 +Node: Streams Intro673462 +Node: Input Streams675480 +Node: Input Functions680381 +Node: Output Streams682441 +Node: Output Functions686493 +Node: Output Variables690793 +Node: Minibuffers695592 +Node: Intro to Minibuffers696677 +Node: Text from Minibuffer699005 +Node: Object from Minibuffer703668 +Node: Minibuffer History706865 +Node: Completion709775 +Node: Basic Completion711750 +Node: Minibuffer Completion716757 +Node: Completion Commands719992 +Node: High-Level Completion724640 +Node: Reading File Names728664 +Node: Programmed Completion732353 +Node: Yes-or-No Queries734563 +Node: Multiple Queries740259 +Node: Minibuffer Misc744324 +Node: Command Loop749193 +Node: Command Overview750539 +Node: Defining Commands753823 +Node: Using Interactive754571 +Node: Interactive Codes759345 +Node: Interactive Examples765149 +Node: Interactive Call766463 +Node: Command Loop Info771866 +Node: Events776845 +Node: Event Types778305 +Node: Event Contents780228 +Node: Event Predicates784704 +Node: Accessing Mouse Event Positions786029 +Node: Frame-Level Event Position Info786728 +Node: Window-Level Event Position Info787768 +Node: Event Text Position Info789532 +Node: Event Glyph Position Info792024 +Node: Event Toolbar Position Info793347 +Node: Other Event Position Info794018 +Node: Accessing Other Event Info794427 +Node: Working With Events796047 +Node: Converting Events801975 +Node: Reading Input804928 +Node: Key Sequence Input805930 +Node: Reading One Event807884 +Node: Dispatching an Event810645 +Node: Quoted Character Input811096 +Node: Peeking and Discarding812444 +Node: Waiting816348 +Node: Quitting818656 +Node: Prefix Command Arguments823064 +Node: Recursive Editing828151 +Node: Disabling Commands832948 +Node: Command History835016 +Node: Keyboard Macros836755 +Node: Keymaps838973 +Node: Keymap Terminology840550 +Node: Format of Keymaps843480 +Node: Creating Keymaps843891 +Node: Inheritance and Keymaps845970 +Node: Key Sequences848342 +Node: Prefix Keys852912 +Node: Active Keymaps856497 +Node: Key Lookup865712 +Node: Functions for Key Lookup870876 +Node: Changing Key Bindings876579 +Node: Key Binding Commands883466 +Node: Scanning Keymaps885532 +Node: Other Keymap Functions894044 +Node: Menus894666 +Node: Menu Format895208 +Node: Menubar Format903793 +Node: Menubar904418 +Node: Modifying Menus907532 +Node: Menu Filters912550 +Node: Pop-Up Menus914446 +Node: Menu Accelerators916652 +Node: Creating Menu Accelerators917374 +Node: Keyboard Menu Traversal918692 +Node: Menu Accelerator Functions919419 +Node: Buffers Menu922454 +Node: Dialog Boxes923748 +Node: Dialog Box Format923915 +Node: Dialog Box Functions925285 +Node: Toolbar925683 +Node: Toolbar Intro926008 +Node: Toolbar Descriptor Format928419 +Node: Specifying the Toolbar932913 +Node: Other Toolbar Variables936521 +Node: Scrollbars940948 +Node: Drag and Drop941084 +Node: Supported Protocols942160 +Node: OffiX DND942663 +Node: CDE dt943670 +Node: MSWindows OLE944261 +Node: Loose ends944432 +Node: Drop Interface944824 +Node: Drag Interface945846 +Node: Modes946020 +Node: Major Modes946971 +Node: Major Mode Conventions949887 +Node: Example Major Modes955842 +Node: Auto Major Mode963810 +Node: Mode Help971260 +Node: Derived Modes972361 +Node: Minor Modes974552 +Node: Minor Mode Conventions975854 +Node: Keymaps and Minor Modes978718 +Node: Modeline Format979553 +Node: Modeline Data981322 +Node: Modeline Variables985594 +Node: %-Constructs990310 +Node: Hooks993221 +Node: Documentation999985 +Node: Documentation Basics1001408 +Node: Accessing Documentation1004460 +Node: Keys in Documentation1010651 +Node: Describing Characters1014114 +Node: Help Functions1016468 +Node: Obsoleteness1022911 +Node: Files1025905 +Node: Visiting Files1027830 +Node: Visiting Functions1029335 +Node: Subroutines of Visiting1034383 +Node: Saving Buffers1036459 +Node: Reading from Files1042552 +Node: Writing to Files1044709 +Node: File Locks1047426 +Node: Information about Files1050479 +Node: Testing Accessibility1051240 +Node: Kinds of Files1054980 +Node: Truenames1056661 +Node: File Attributes1057664 +Node: Changing File Attributes1062804 +Node: File Names1068210 +Node: File Name Components1069819 +Node: Directory Names1072920 +Node: Relative File Names1076373 +Node: File Name Expansion1077451 +Node: Unique File Names1081358 +Node: File Name Completion1082973 +Node: User Name Completion1085634 +Node: Contents of Directories1086974 +Node: Create/Delete Dirs1090287 +Node: Magic File Names1091393 +Node: Partial Files1097023 +Node: Intro to Partial Files1097251 +Node: Creating a Partial File1098491 +Node: Detached Partial Files1099426 +Node: Format Conversion1100548 +Node: Files and MS-DOS1107066 +Node: Backups and Auto-Saving1109130 +Node: Backup Files1109805 +Node: Making Backups1111202 +Node: Rename or Copy1113951 +Node: Numbered Backups1116444 +Node: Backup Names1118689 +Node: Auto-Saving1121972 +Node: Reverting1130114 +Node: Buffers1133272 +Node: Buffer Basics1134687 +Node: Current Buffer1136740 +Node: Buffer Names1141430 +Node: Buffer File Name1144635 +Node: Buffer Modification1148755 +Node: Modification Time1150951 +Node: Read Only Buffers1154326 +Node: The Buffer List1156744 +Node: Creating Buffers1161574 +Node: Killing Buffers1163723 +Node: Indirect Buffers1167454 +Node: Windows1170026 +Node: Basic Windows1171504 +Node: Splitting Windows1174602 +Node: Deleting Windows1181473 +Node: Selecting Windows1184154 +Node: Cyclic Window Ordering1187283 +Node: Buffers and Windows1191907 +Node: Displaying Buffers1193748 +Node: Choosing Window1198926 +Node: Window Point1206642 +Node: Window Start1208688 +Node: Vertical Scrolling1213178 +Node: Horizontal Scrolling1219315 +Node: Size of Window1222824 +Node: Position of Window1227542 +Node: Resizing Windows1229782 +Node: Window Configurations1235211 +Node: Frames1238636 +Node: Creating Frames1240405 +Node: Frame Properties1241746 +Node: Property Access1242562 +Node: Initial Properties1243411 +Node: X Frame Properties1245897 +Node: Size and Position1250531 +Node: Frame Name1252527 +Node: Frame Titles1253441 +Node: Deleting Frames1255265 +Node: Finding All Frames1255865 +Node: Frames and Windows1257859 +Node: Minibuffers and Frames1259564 +Node: Input Focus1260483 +Node: Visibility of Frames1263561 +Node: Raising and Lowering1265480 +Node: Frame Configurations1267857 +Node: Frame Hooks1268451 +Node: Consoles and Devices1270258 +Node: Basic Console Functions1273002 +Node: Basic Device Functions1273425 +Node: Console Types and Device Classes1274141 +Node: Connecting to a Console or Device1276338 +Node: The Selected Console and Device1278501 +Node: Console and Device I/O1279527 +Node: Positions1280291 +Node: Point1281260 +Node: Motion1284353 +Node: Character Motion1285120 +Node: Word Motion1287357 +Node: Buffer End Motion1288858 +Node: Text Lines1290355 +Node: Screen Lines1294950 +Node: List Motion1299013 +Node: Skipping Characters1302421 +Node: Excursions1304640 +Node: Narrowing1307675 +Node: Markers1313002 +Node: Overview of Markers1313904 +Node: Predicates on Markers1318597 +Node: Creating Markers1319843 +Node: Information from Markers1323880 +Node: Changing Markers1324978 +Node: The Mark1326356 +Node: The Region1334850 +Node: Text1340537 +Node: Near Point1343239 +Node: Buffer Contents1346961 +Node: Comparing Text1348367 +Node: Insertion1349775 +Node: Commands for Insertion1353618 +Node: Deletion1356576 +Node: User-Level Deletion1360173 +Node: The Kill Ring1364303 +Node: Kill Ring Concepts1366477 +Node: Kill Functions1367531 +Node: Yank Commands1369436 +Node: Low-Level Kill Ring1371307 +Node: Internals of Kill Ring1374093 +Node: Undo1376873 +Node: Maintaining Undo1381202 +Node: Filling1383822 +Node: Margins1389818 +Node: Auto Filling1393748 +Node: Sorting1394929 +Node: Columns1404230 +Node: Indentation1406746 +Node: Primitive Indent1407525 +Node: Mode-Specific Indent1408769 +Node: Region Indent1411280 +Node: Relative Indent1414228 +Node: Indent Tabs1416610 +Node: Motion by Indent1417932 +Node: Case Changes1418711 +Node: Text Properties1421962 +Node: Examining Properties1423777 +Node: Changing Properties1425644 +Node: Property Search1429239 +Node: Special Properties1433950 +Node: Saving Properties1434231 +Node: Substitution1437373 +Node: Registers1440644 +Node: Transposition1443187 +Node: Change Hooks1444081 +Node: Transformations1446121 +Node: Searching and Matching1450506 +Node: String Search1451637 +Node: Regular Expressions1456361 +Node: Syntax of Regexps1457728 +Node: Regexp Example1472108 +Node: Regexp Search1474278 +Node: POSIX Regexps1480366 +Node: Search and Replace1482201 +Node: Match Data1485566 +Node: Simple Match Data1486696 +Node: Replacing Match1490961 +Node: Entire Match Data1493295 +Node: Saving Match Data1495286 +Node: Searching and Case1496669 +Node: Standard Regexps1498703 +Node: Syntax Tables1500901 +Node: Syntax Basics1502017 +Node: Syntax Descriptors1504992 +Node: Syntax Class Table1506842 +Node: Syntax Flags1512880 +Node: Syntax Table Functions1516097 +Node: Motion and Syntax1519961 +Node: Parsing Expressions1521413 +Node: Standard Syntax Tables1527482 +Node: Syntax Table Internals1528326 +Node: Abbrevs1529353 +Node: Abbrev Mode1531157 +Node: Abbrev Tables1531877 +Node: Defining Abbrevs1533410 +Node: Abbrev Files1535315 +Node: Abbrev Expansion1537089 +Node: Standard Abbrev Tables1541720 +Node: Extents1542879 +Node: Intro to Extents1544122 +Node: Creating and Modifying Extents1548116 +Node: Extent Endpoints1549625 +Node: Finding Extents1552890 +Node: Mapping Over Extents1556641 +Node: Extent Properties1562759 +Node: Detached Extents1572903 +Node: Extent Parents1574762 +Node: Duplicable Extents1576457 +Node: Extents and Events1579680 +Node: Atomic Extents1581588 +Node: Specifiers1582035 +Node: Introduction to Specifiers1583838 +Node: Specifiers In-Depth1586148 +Node: Specifier Instancing1591063 +Node: Specifier Types1594325 +Node: Adding Specifications1599399 +Node: Retrieving Specifications1608762 +Node: Specifier Tag Functions1612497 +Node: Specifier Instancing Functions1615731 +Node: Specifier Example1619138 +Node: Creating Specifiers1622244 +Node: Specifier Validation Functions1624493 +Node: Other Specification Functions1626877 +Node: Faces and Window-System Objects1630696 +Node: Faces1631020 +Node: Merging Faces1632639 +Node: Basic Face Functions1634600 +Node: Face Properties1636699 +Node: Face Convenience Functions1646258 +Node: Other Face Display Functions1649391 +Node: Fonts1650204 +Node: Font Specifiers1650905 +Node: Font Instances1651146 +Node: Font Instance Names1652113 +Node: Font Instance Size1652954 +Node: Font Instance Characteristics1654240 +Node: Font Convenience Functions1655409 +Node: Colors1656699 +Node: Color Specifiers1657139 +Node: Color Instances1657366 +Node: Color Instance Properties1658110 +Node: Color Convenience Functions1658736 +Node: Glyphs1659789 +Node: Glyph Functions1661381 +Node: Creating Glyphs1661788 +Node: Glyph Properties1663375 +Node: Glyph Convenience Functions1672542 +Node: Glyph Dimensions1676489 +Node: Images1677569 +Node: Image Specifiers1678018 +Node: Image Instantiator Conversion1689442 +Node: Image Instances1690807 +Node: Image Instance Types1691558 +Node: Image Instance Functions1694213 +Node: Glyph Types1698783 +Node: Mouse Pointer1700555 +Node: Redisplay Glyphs1703558 +Node: Subwindows1704591 +Node: Annotations1704834 +Node: Annotation Basics1705851 +Node: Annotation Primitives1709789 +Node: Annotation Properties1711118 +Node: Locating Annotations1714158 +Node: Margin Primitives1714995 +Node: Annotation Hooks1716889 +Node: Display1717549 +Node: Refresh Screen1718527 +Node: Truncation1720438 +Node: The Echo Area1722965 +Node: Warnings1729401 +Node: Invisible Text1733837 +Node: Selective Display1736417 +Node: Overlay Arrow1740544 +Node: Temporary Displays1741898 +Node: Blinking1746019 +Node: Usual Display1748203 +Node: Display Tables1750753 +Node: Display Table Format1751557 +Node: Active Display Table1753001 +Node: Character Descriptors1754193 +Node: Beeping1754951 +Node: Hash Tables1759717 +Node: Introduction to Hash Tables1760325 +Node: Working With Hash Tables1766350 +Node: Weak Hash Tables1767467 +Node: Range Tables1769266 +Node: Introduction to Range Tables1769955 +Node: Working With Range Tables1770386 +Node: Databases1771271 +Node: Connecting to a Database1771570 +Node: Working With a Database1772661 +Node: Other Database Functions1773519 +Node: Processes1774093 +Node: Subprocess Creation1776317 +Node: Synchronous Processes1779610 +Node: MS-DOS Subprocesses1786308 +Node: Asynchronous Processes1787382 +Node: Deleting Processes1791086 +Node: Process Information1792957 +Node: Input to Processes1796885 +Node: Signals to Processes1799154 +Node: Output from Processes1803574 +Node: Process Buffers1804386 +Node: Filter Functions1807255 +Node: Accepting Output1812822 +Node: Sentinels1814349 +Node: Process Window Size1817842 +Node: Transaction Queues1818191 +Node: Network1819889 +Node: System Interface1821723 +Node: Starting Up1822993 +Node: Start-up Summary1823587 +Node: Init File1827141 +Node: Terminal-Specific1829525 +Node: Command Line Arguments1832684 +Node: Getting Out1836173 +Node: Killing XEmacs1836742 +Node: Suspending XEmacs1838411 +Node: System Environment1841727 +Node: User Identification1848392 +Node: Time of Day1851922 +Node: Time Conversion1854711 +Node: Timers1859753 +Node: Terminal Input1861926 +Node: Input Modes1862429 +Node: Translating Input1864842 +Node: Recording Input1869007 +Node: Terminal Output1871108 +Node: Flow Control1874731 +Node: Batch Mode1878524 +Node: X-Windows1879906 +Node: X Selections1880718 +Node: X Server1882928 +Node: Resources1883329 +Node: Server Data1888470 +Node: Grabs1889677 +Node: X Miscellaneous1891258 +Node: ToolTalk Support1893643 +Node: XEmacs ToolTalk API Summary1893860 +Node: Sending Messages1895160 +Node: Example of Sending Messages1895411 +Node: Elisp Interface for Sending Messages1896473 +Node: Receiving Messages1902866 +Node: Example of Receiving Messages1903089 +Node: Elisp Interface for Receiving Messages1903925 +Node: LDAP Support1907750 +Node: Building XEmacs with LDAP support1908246 +Node: XEmacs LDAP API1909224 +Node: LDAP Variables1909954 +Node: The High-Level LDAP API1912431 +Node: The Low-Level LDAP API1913544 +Node: The LDAP Lisp Object1913818 +Node: Opening and Closing a LDAP Connection1914371 +Node: Searching on a LDAP Server (Low-level)1916154 +Node: Syntax of Search Filters1917549 +Node: Internationalization1918847 +Node: I18N Levels 1 and 21919184 +Node: I18N Level 31919890 +Node: Level 3 Basics1920171 +Node: Level 3 Primitives1921004 +Node: Dynamic Messaging1922610 +Node: Domain Specification1923073 +Node: Documentation String Extraction1924976 +Node: I18N Level 41925894 +Node: MULE1926086 +Node: Internationalization Terminology1927197 +Node: Charsets1935736 +Node: Charset Properties1936432 +Node: Basic Charset Functions1941118 +Node: Charset Property Functions1943299 +Node: Predefined Charsets1945342 +Node: MULE Characters1948262 +Node: Composite Characters1949109 +Node: ISO 20221950363 +Node: Coding Systems1956085 +Node: Coding System Types1958007 +Node: EOL Conversion1959826 +Node: Coding System Properties1961009 +Node: Basic Coding System Functions1964861 +Node: Coding System Property Functions1966765 +Node: Encoding and Decoding Text1967323 +Node: Detection of Textual Encoding1968459 +Node: Big5 and Shift-JIS Functions1969995 +Node: CCL1971083 +Node: CCL Syntax1974187 +Node: CCL Statements1975775 +Node: CCL Expressions1980423 +Node: Calling CCL1983575 +Node: CCL Examples1986565 +Node: Category Tables1986702 +Node: Tips1989061 +Node: Style Tips1989702 +Node: Compilation Tips1999222 +Node: Documentation Tips2001138 +Node: Comment Tips2006647 +Node: Library Headers2009649 +Node: Building XEmacs and Object Allocation2013621 +Node: Building XEmacs2014504 +Node: Pure Storage2020839 +Node: Garbage Collection2023627 +Node: Standard Errors2034766 +Node: Standard Buffer-Local Variables2038975 +Node: Standard Keymaps2041651 +Node: Standard Hooks2045383 +Node: Index2052883  End Tag Table diff --git a/info/lispref.info-1 b/info/lispref.info-1 index a440030..097bf97 100644 --- a/info/lispref.info-1 +++ b/info/lispref.info-1 @@ -1,5 +1,5 @@ -This is ../info/lispref.info, produced by makeinfo version 4.0 from -lispref/lispref.texi. +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -89,7 +89,6 @@ Reference Manual, corresponding to XEmacs version 21.0. * 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. @@ -135,7 +134,6 @@ Reference Manual, corresponding to XEmacs version 21.0. * 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. @@ -153,7 +151,7 @@ Appendices * Index:: Index including concepts, functions, variables, and other terms. - --- The Detailed Node Listing --- + -- 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: @@ -219,7 +217,7 @@ Editing Types * 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. @@ -240,7 +238,7 @@ Numbers 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. @@ -305,7 +303,7 @@ Kinds of Forms * Classifying Lists:: How to distinguish various sorts of list forms. * Function Forms:: Forms that call functions. * Macro Forms:: Forms that call macros. -* Special Forms:: ``Special forms'' are idiosyncratic primitives, +* Special Forms:: "Special forms" are idiosyncratic primitives, most of them extremely important. * Autoloading:: Functions set up to load files containing their real definitions. @@ -403,14 +401,8 @@ Loading Byte Compilation -* Speed of Byte-Code:: An example of speedup from byte compilation. -* Compilation Functions:: Byte compilation functions. -* Docs and Compilation:: Dynamic loading of documentation strings. -* Dynamic Loading:: Dynamic loading of individual functions. -* Eval During Compile:: Code to be evaluated when you compile. -* Compiled-Function Objects:: The data type used for byte-compiled functions. -* Disassembly:: Disassembling byte-code; how to read byte-code. -* Different Behavior:: When compiled code gives different results. +* Compilation Functions:: Byte compilation functions. +* Disassembly:: Disassembling byte-code; how to read byte-code. Debugging Lisp Programs @@ -474,7 +466,7 @@ Command Loop * Events:: What input looks like when you read it. * Reading Input:: How to read input events from the keyboard or mouse. * Waiting:: Waiting for user input or elapsed time. -* Quitting:: How C-g works. How to catch or defer quitting. +* Quitting:: How `C-g' works. How to catch or defer quitting. * Prefix Command Arguments:: How the commands to set prefix args work. * Recursive Editing:: Entering a recursive edit, and why you usually shouldn't. @@ -561,8 +553,6 @@ Toolbar * Specifying the Toolbar:: Setting a toolbar. * Other Toolbar Variables:: Controlling the size of toolbars. -Gutter - Scrollbars Major and Minor Modes @@ -661,7 +651,7 @@ Buffers is visited. * Buffer Modification:: A buffer is "modified" if it needs to be saved. * Modification Time:: Determining whether the visited file was changed - ``behind XEmacs's back''. + "behind XEmacs's back". * Read Only Buffers:: Modifying text is not allowed in a read-only buffer. * The Buffer List:: How to look at all the existing buffers. @@ -730,8 +720,8 @@ Markers * Information from Markers:: Finding the marker's buffer or character position. * Changing Markers:: Moving the marker to a new buffer or position. -* The Mark:: How ``the mark'' is implemented with a marker. -* The Region:: How to access ``the region''. +* The Mark:: How "the mark" is implemented with a marker. +* The Region:: How to access "the region". Text @@ -838,10 +828,10 @@ Specifiers (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 +* 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'' +* 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. @@ -1035,18 +1025,12 @@ XEmacs LDAP API * 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 diff --git a/info/lispref.info-10 b/info/lispref.info-10 new file mode 100644 index 0000000..74ab646 --- /dev/null +++ b/info/lispref.info-10 @@ -0,0 +1,1223 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Variable Aliases, Prev: Buffer-Local Variables, Up: Variables + +Variable Aliases +================ + + You can define a variable as an "alias" for another. Any time you +reference the former variable, the current value of the latter is +returned. Any time you change the value of the former variable, the +value of the latter is actually changed. This is useful in cases where +you want to rename a variable but still make old code work (*note +Obsoleteness::.). + + - Function: defvaralias VARIABLE ALIAS + This function defines VARIABLE as an alias for ALIAS. + Thenceforth, any operations performed on VARIABLE will actually be + performed on ALIAS. Both VARIABLE and ALIAS should be symbols. + If ALIAS is `nil', remove any aliases for VARIABLE. ALIAS can + itself be aliased, and the chain of variable aliases will be + followed appropriately. If VARIABLE already has a value, this + value will be shadowed until the alias is removed, at which point + it will be restored. Currently VARIABLE cannot be a built-in + variable, a variable that has a buffer-local value in any buffer, + or the symbols `nil' or `t'. + + - Function: variable-alias VARIABLE + If VARIABLE is aliased to another variable, this function returns + that variable. VARIABLE should be a symbol. If VARIABLE is not + aliased, this function returns `nil'. + + - Function: indirect-variable OBJECT + This function returns the variable at the end of OBJECT's + variable-alias chain. If OBJECT is a symbol, follow all variable + aliases and return the final (non-aliased) symbol. If OBJECT is + not a symbol, just return it. Signal a + `cyclic-variable-indirection' error if there is a loop in the + variable chain of symbols. + + +File: lispref.info, Node: Functions, Next: Macros, Prev: Variables, Up: Top + +Functions +********* + + A Lisp program is composed mainly of Lisp functions. This chapter +explains what functions are, how they accept arguments, and how to +define them. + +* Menu: + +* What Is a Function:: Lisp functions vs. primitives; terminology. +* Lambda Expressions:: How functions are expressed as Lisp objects. +* Function Names:: A symbol can serve as the name of a function. +* Defining Functions:: Lisp expressions for defining functions. +* Calling Functions:: How to use an existing function. +* Mapping Functions:: Applying a function to each element of a list, etc. +* Anonymous Functions:: Lambda expressions are functions with no names. +* Function Cells:: Accessing or setting the function definition + of a symbol. +* Inline Functions:: Defining functions that the compiler will open code. +* Related Topics:: Cross-references to specific Lisp primitives + that have a special bearing on how functions work. + + +File: lispref.info, Node: What Is a Function, Next: Lambda Expressions, Up: Functions + +What Is a Function? +=================== + + In a general sense, a function is a rule for carrying on a +computation given several values called "arguments". The result of the +computation is called the value of the function. The computation can +also have side effects: lasting changes in the values of variables or +the contents of data structures. + + Here are important terms for functions in XEmacs Lisp and for other +function-like objects. + +"function" + In XEmacs Lisp, a "function" is anything that can be applied to + arguments in a Lisp program. In some cases, we use it more + specifically to mean a function written in Lisp. Special forms and + macros are not functions. + +"primitive" + A "primitive" is a function callable from Lisp that is written in + C, such as `car' or `append'. These functions are also called + "built-in" functions or "subrs". (Special forms are also + considered primitives.) + + Usually the reason that a function is a primitives is because it is + fundamental, because it provides a low-level interface to operating + system services, or because it needs to run fast. Primitives can + be modified or added only by changing the C sources and + recompiling the editor. See *Note Writing Lisp Primitives: + (internals)Writing Lisp Primitives. + +"lambda expression" + A "lambda expression" is a function written in Lisp. These are + described in the following section. *Note Lambda Expressions::. + +"special form" + A "special form" is a primitive that is like a function but does + not evaluate all of its arguments in the usual way. It may + evaluate only some of the arguments, or may evaluate them in an + unusual order, or several times. Many special forms are described + in *Note Control Structures::. + +"macro" + A "macro" is a construct defined in Lisp by the programmer. It + differs from a function in that it translates a Lisp expression + that you write into an equivalent expression to be evaluated + instead of the original expression. Macros enable Lisp + programmers to do the sorts of things that special forms can do. + *Note Macros::, for how to define and use macros. + +"command" + A "command" is an object that `command-execute' can invoke; it is + a possible definition for a key sequence. Some functions are + commands; a function written in Lisp is a command if it contains an + interactive declaration (*note Defining Commands::.). Such a + function can be called from Lisp expressions like other functions; + in this case, the fact that the function is a command makes no + difference. + + Keyboard macros (strings and vectors) are commands also, even + though they are not functions. A symbol is a command if its + function definition is a command; such symbols can be invoked with + `M-x'. The symbol is a function as well if the definition is a + function. *Note Command Overview::. + +"keystroke command" + A "keystroke command" is a command that is bound to a key sequence + (typically one to three keystrokes). The distinction is made here + merely to avoid confusion with the meaning of "command" in + non-Emacs editors; for Lisp programs, the distinction is normally + unimportant. + +"compiled function" + A "compiled function" is a function that has been compiled by the + byte compiler. *Note Compiled-Function Type::. + + - Function: subrp OBJECT + This function returns `t' if OBJECT is a built-in function (i.e., + a Lisp primitive). + + (subrp 'message) ; `message' is a symbol, + => nil ; not a subr object. + (subrp (symbol-function 'message)) + => t + + - Function: compiled-function-p OBJECT + This function returns `t' if OBJECT is a compiled function. For + example: + + (compiled-function-p (symbol-function 'next-line)) + => t + + +File: lispref.info, Node: Lambda Expressions, Next: Function Names, Prev: What Is a Function, Up: Functions + +Lambda Expressions +================== + + A function written in Lisp is a list that looks like this: + + (lambda (ARG-VARIABLES...) + [DOCUMENTATION-STRING] + [INTERACTIVE-DECLARATION] + BODY-FORMS...) + +Such a list is called a "lambda expression". In XEmacs Lisp, it +actually is valid as an expression--it evaluates to itself. In some +other Lisp dialects, a lambda expression is not a valid expression at +all. In either case, its main use is not to be evaluated as an +expression, but to be called as a function. + +* Menu: + +* Lambda Components:: The parts of a lambda expression. +* Simple Lambda:: A simple example. +* Argument List:: Details and special features of argument lists. +* Function Documentation:: How to put documentation in a function. + + +File: lispref.info, Node: Lambda Components, Next: Simple Lambda, Up: Lambda Expressions + +Components of a Lambda Expression +--------------------------------- + + A function written in Lisp (a "lambda expression") is a list that +looks like this: + + (lambda (ARG-VARIABLES...) + [DOCUMENTATION-STRING] + [INTERACTIVE-DECLARATION] + BODY-FORMS...) + + The first element of a lambda expression is always the symbol +`lambda'. This indicates that the list represents a function. The +reason functions are defined to start with `lambda' is so that other +lists, intended for other uses, will not accidentally be valid as +functions. + + The second element is a list of symbols-the argument variable names. +This is called the "lambda list". When a Lisp function is called, the +argument values are matched up against the variables in the lambda +list, which are given local bindings with the values provided. *Note +Local Variables::. + + The documentation string is a Lisp string object placed within the +function definition to describe the function for the XEmacs help +facilities. *Note Function Documentation::. + + The interactive declaration is a list of the form `(interactive +CODE-STRING)'. This declares how to provide arguments if the function +is used interactively. Functions with this declaration are called +"commands"; they can be called using `M-x' or bound to a key. +Functions not intended to be called in this way should not have +interactive declarations. *Note Defining Commands::, for how to write +an interactive declaration. + + The rest of the elements are the "body" of the function: the Lisp +code to do the work of the function (or, as a Lisp programmer would say, +"a list of Lisp forms to evaluate"). The value returned by the +function is the value returned by the last element of the body. + + +File: lispref.info, Node: Simple Lambda, Next: Argument List, Prev: Lambda Components, Up: Lambda Expressions + +A Simple Lambda-Expression Example +---------------------------------- + + Consider for example the following function: + + (lambda (a b c) (+ a b c)) + +We can call this function by writing it as the CAR of an expression, +like this: + + ((lambda (a b c) (+ a b c)) + 1 2 3) + +This call evaluates the body of the lambda expression with the variable +`a' bound to 1, `b' bound to 2, and `c' bound to 3. Evaluation of the +body adds these three numbers, producing the result 6; therefore, this +call to the function returns the value 6. + + Note that the arguments can be the results of other function calls, +as in this example: + + ((lambda (a b c) (+ a b c)) + 1 (* 2 3) (- 5 4)) + +This evaluates the arguments `1', `(* 2 3)', and `(- 5 4)' from left to +right. Then it applies the lambda expression to the argument values 1, +6 and 1 to produce the value 8. + + It is not often useful to write a lambda expression as the CAR of a +form in this way. You can get the same result, of making local +variables and giving them values, using the special form `let' (*note +Local Variables::.). And `let' is clearer and easier to use. In +practice, lambda expressions are either stored as the function +definitions of symbols, to produce named functions, or passed as +arguments to other functions (*note Anonymous Functions::.). + + However, calls to explicit lambda expressions were very useful in the +old days of Lisp, before the special form `let' was invented. At that +time, they were the only way to bind and initialize local variables. + + +File: lispref.info, Node: Argument List, Next: Function Documentation, Prev: Simple Lambda, Up: Lambda Expressions + +Advanced Features of Argument Lists +----------------------------------- + + Our simple sample function, `(lambda (a b c) (+ a b c))', specifies +three argument variables, so it must be called with three arguments: if +you try to call it with only two arguments or four arguments, you get a +`wrong-number-of-arguments' error. + + It is often convenient to write a function that allows certain +arguments to be omitted. For example, the function `substring' accepts +three arguments--a string, the start index and the end index--but the +third argument defaults to the LENGTH of the string if you omit it. It +is also convenient for certain functions to accept an indefinite number +of arguments, as the functions `list' and `+' do. + + To specify optional arguments that may be omitted when a function is +called, simply include the keyword `&optional' before the optional +arguments. To specify a list of zero or more extra arguments, include +the keyword `&rest' before one final argument. + + Thus, the complete syntax for an argument list is as follows: + + (REQUIRED-VARS... + [&optional OPTIONAL-VARS...] + [&rest REST-VAR]) + +The square brackets indicate that the `&optional' and `&rest' clauses, +and the variables that follow them, are optional. + + A call to the function requires one actual argument for each of the +REQUIRED-VARS. There may be actual arguments for zero or more of the +OPTIONAL-VARS, and there cannot be any actual arguments beyond that +unless the lambda list uses `&rest'. In that case, there may be any +number of extra actual arguments. + + If actual arguments for the optional and rest variables are omitted, +then they always default to `nil'. There is no way for the function to +distinguish between an explicit argument of `nil' and an omitted +argument. However, the body of the function is free to consider `nil' +an abbreviation for some other meaningful value. This is what +`substring' does; `nil' as the third argument to `substring' means to +use the length of the string supplied. + + Common Lisp note: Common Lisp allows the function to specify what + default value to use when an optional argument is omitted; XEmacs + Lisp always uses `nil'. + + For example, an argument list that looks like this: + + (a b &optional c d &rest e) + +binds `a' and `b' to the first two actual arguments, which are +required. If one or two more arguments are provided, `c' and `d' are +bound to them respectively; any arguments after the first four are +collected into a list and `e' is bound to that list. If there are only +two arguments, `c' is `nil'; if two or three arguments, `d' is `nil'; +if four arguments or fewer, `e' is `nil'. + + There is no way to have required arguments following optional +ones--it would not make sense. To see why this must be so, suppose +that `c' in the example were optional and `d' were required. Suppose +three actual arguments are given; which variable would the third +argument be for? Similarly, it makes no sense to have any more +arguments (either required or optional) after a `&rest' argument. + + Here are some examples of argument lists and proper calls: + + ((lambda (n) (1+ n)) ; One required: + 1) ; requires exactly one argument. + => 2 + ((lambda (n &optional n1) ; One required and one optional: + (if n1 (+ n n1) (1+ n))) ; 1 or 2 arguments. + 1 2) + => 3 + ((lambda (n &rest ns) ; One required and one rest: + (+ n (apply '+ ns))) ; 1 or more arguments. + 1 2 3 4 5) + => 15 + + +File: lispref.info, Node: Function Documentation, Prev: Argument List, Up: Lambda Expressions + +Documentation Strings of Functions +---------------------------------- + + A lambda expression may optionally have a "documentation string" just +after the lambda list. This string does not affect execution of the +function; it is a kind of comment, but a systematized comment which +actually appears inside the Lisp world and can be used by the XEmacs +help facilities. *Note Documentation::, for how the +DOCUMENTATION-STRING is accessed. + + It is a good idea to provide documentation strings for all the +functions in your program, even those that are only called from within +your program. Documentation strings are like comments, except that they +are easier to access. + + The first line of the documentation string should stand on its own, +because `apropos' displays just this first line. It should consist of +one or two complete sentences that summarize the function's purpose. + + The start of the documentation string is usually indented in the +source file, but since these spaces come before the starting +double-quote, they are not part of the string. Some people make a +practice of indenting any additional lines of the string so that the +text lines up in the program source. *This is a mistake.* The +indentation of the following lines is inside the string; what looks +nice in the source code will look ugly when displayed by the help +commands. + + You may wonder how the documentation string could be optional, since +there are required components of the function that follow it (the body). +Since evaluation of a string returns that string, without any side +effects, it has no effect if it is not the last form in the body. +Thus, in practice, there is no confusion between the first form of the +body and the documentation string; if the only body form is a string +then it serves both as the return value and as the documentation. + + +File: lispref.info, Node: Function Names, Next: Defining Functions, Prev: Lambda Expressions, Up: Functions + +Naming a Function +================= + + In most computer languages, every function has a name; the idea of a +function without a name is nonsensical. In Lisp, a function in the +strictest sense has no name. It is simply a list whose first element is +`lambda', or a primitive subr-object. + + However, a symbol can serve as the name of a function. This happens +when you put the function in the symbol's "function cell" (*note Symbol +Components::.). Then the symbol itself becomes a valid, callable +function, equivalent to the list or subr-object that its function cell +refers to. The contents of the function cell are also called the +symbol's "function definition". The procedure of using a symbol's +function definition in place of the symbol is called "symbol function +indirection"; see *Note Function Indirection::. + + In practice, nearly all functions are given names in this way and +referred to through their names. For example, the symbol `car' works +as a function and does what it does because the primitive subr-object +`#' is stored in its function cell. + + We give functions names because it is convenient to refer to them by +their names in Lisp expressions. For primitive subr-objects such as +`#', names are the only way you can refer to them: there is +no read syntax for such objects. For functions written in Lisp, the +name is more convenient to use in a call than an explicit lambda +expression. Also, a function with a name can refer to itself--it can +be recursive. Writing the function's name in its own definition is much +more convenient than making the function definition point to itself +(something that is not impossible but that has various disadvantages in +practice). + + We often identify functions with the symbols used to name them. For +example, we often speak of "the function `car'", not distinguishing +between the symbol `car' and the primitive subr-object that is its +function definition. For most purposes, there is no need to +distinguish. + + Even so, keep in mind that a function need not have a unique name. +While a given function object *usually* appears in the function cell of +only one symbol, this is just a matter of convenience. It is easy to +store it in several symbols using `fset'; then each of the symbols is +equally well a name for the same function. + + A symbol used as a function name may also be used as a variable; +these two uses of a symbol are independent and do not conflict. + + +File: lispref.info, Node: Defining Functions, Next: Calling Functions, Prev: Function Names, Up: Functions + +Defining Functions +================== + + We usually give a name to a function when it is first created. This +is called "defining a function", and it is done with the `defun' +special form. + + - Special Form: defun NAME ARGUMENT-LIST BODY-FORMS + `defun' is the usual way to define new Lisp functions. It defines + the symbol NAME as a function that looks like this: + + (lambda ARGUMENT-LIST . BODY-FORMS) + + `defun' stores this lambda expression in the function cell of + NAME. It returns the value NAME, but usually we ignore this value. + + As described previously (*note Lambda Expressions::.), + ARGUMENT-LIST is a list of argument names and may include the + keywords `&optional' and `&rest'. Also, the first two forms in + BODY-FORMS may be a documentation string and an interactive + declaration. + + There is no conflict if the same symbol NAME is also used as a + variable, since the symbol's value cell is independent of the + function cell. *Note Symbol Components::. + + Here are some examples: + + (defun foo () 5) + => foo + (foo) + => 5 + + (defun bar (a &optional b &rest c) + (list a b c)) + => bar + (bar 1 2 3 4 5) + => (1 2 (3 4 5)) + (bar 1) + => (1 nil nil) + (bar) + error--> Wrong number of arguments. + + (defun capitalize-backwards () + "Upcase the last letter of a word." + (interactive) + (backward-word 1) + (forward-word 1) + (backward-char 1) + (capitalize-word 1)) + => capitalize-backwards + + Be careful not to redefine existing functions unintentionally. + `defun' redefines even primitive functions such as `car' without + any hesitation or notification. Redefining a function already + defined is often done deliberately, and there is no way to + distinguish deliberate redefinition from unintentional + redefinition. + + - Function: define-function NAME DEFINITION + - Function: defalias NAME DEFINITION + These equivalent special forms define the symbol NAME as a + function, with definition DEFINITION (which can be any valid Lisp + function). + + The proper place to use `define-function' or `defalias' is where a + specific function name is being defined--especially where that + name appears explicitly in the source file being loaded. This is + because `define-function' and `defalias' record which file defined + the function, just like `defun'. (*note Unloading::.). + + By contrast, in programs that manipulate function definitions for + other purposes, it is better to use `fset', which does not keep + such records. + + See also `defsubst', which defines a function like `defun' and tells +the Lisp compiler to open-code it. *Note Inline Functions::. + + +File: lispref.info, Node: Calling Functions, Next: Mapping Functions, Prev: Defining Functions, Up: Functions + +Calling Functions +================= + + Defining functions is only half the battle. Functions don't do +anything until you "call" them, i.e., tell them to run. Calling a +function is also known as "invocation". + + The most common way of invoking a function is by evaluating a list. +For example, evaluating the list `(concat "a" "b")' calls the function +`concat' with arguments `"a"' and `"b"'. *Note Evaluation::, for a +description of evaluation. + + When you write a list as an expression in your program, the function +name is part of the program. This means that you choose which function +to call, and how many arguments to give it, when you write the program. +Usually that's just what you want. Occasionally you need to decide at +run time which function to call. To do that, use the functions +`funcall' and `apply'. + + - Function: funcall FUNCTION &rest ARGUMENTS + `funcall' calls FUNCTION with ARGUMENTS, and returns whatever + FUNCTION returns. + + Since `funcall' is a function, all of its arguments, including + FUNCTION, are evaluated before `funcall' is called. This means + that you can use any expression to obtain the function to be + called. It also means that `funcall' does not see the expressions + you write for the ARGUMENTS, only their values. These values are + *not* evaluated a second time in the act of calling FUNCTION; + `funcall' enters the normal procedure for calling a function at the + place where the arguments have already been evaluated. + + The argument FUNCTION must be either a Lisp function or a + primitive function. Special forms and macros are not allowed, + because they make sense only when given the "unevaluated" argument + expressions. `funcall' cannot provide these because, as we saw + above, it never knows them in the first place. + + (setq f 'list) + => list + (funcall f 'x 'y 'z) + => (x y z) + (funcall f 'x 'y '(z)) + => (x y (z)) + (funcall 'and t nil) + error--> Invalid function: # + + Compare these example with the examples of `apply'. + + - Function: apply FUNCTION &rest ARGUMENTS + `apply' calls FUNCTION with ARGUMENTS, just like `funcall' but + with one difference: the last of ARGUMENTS is a list of arguments + to give to FUNCTION, rather than a single argument. We also say + that `apply' "spreads" this list so that each individual element + becomes an argument. + + `apply' returns the result of calling FUNCTION. As with + `funcall', FUNCTION must either be a Lisp function or a primitive + function; special forms and macros do not make sense in `apply'. + + (setq f 'list) + => list + (apply f 'x 'y 'z) + error--> Wrong type argument: listp, z + (apply '+ 1 2 '(3 4)) + => 10 + (apply '+ '(1 2 3 4)) + => 10 + + (apply 'append '((a b c) nil (x y z) nil)) + => (a b c x y z) + + For an interesting example of using `apply', see the description of + `mapcar', in *Note Mapping Functions::. + + It is common for Lisp functions to accept functions as arguments or +find them in data structures (especially in hook variables and property +lists) and call them using `funcall' or `apply'. Functions that accept +function arguments are often called "functionals". + + Sometimes, when you call a functional, it is useful to supply a no-op +function as the argument. Here are two different kinds of no-op +function: + + - Function: identity ARG + This function returns ARG and has no side effects. + + - Function: ignore &rest ARGS + This function ignores any arguments and returns `nil'. + + +File: lispref.info, Node: Mapping Functions, Next: Anonymous Functions, Prev: Calling Functions, Up: Functions + +Mapping Functions +================= + + A "mapping function" applies a given function to each element of a +list or other collection. XEmacs Lisp has three such functions; +`mapcar' and `mapconcat', which scan a list, are described here. For +the third mapping function, `mapatoms', see *Note Creating Symbols::. + + - Function: mapcar FUNCTION SEQUENCE + `mapcar' applies FUNCTION to each element of SEQUENCE in turn, and + returns a list of the results. + + The argument 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 SEQUENCE. + + For example: + + (mapcar 'car '((a b) (c d) (e f))) + => (a c e) + (mapcar '1+ [1 2 3]) + => (2 3 4) + (mapcar 'char-to-string "abc") + => ("a" "b" "c") + + ;; Call each function in `my-hooks'. + (mapcar 'funcall my-hooks) + + (defun mapcar* (f &rest args) + "Apply FUNCTION to successive cars of all ARGS. + Return the list of results." + ;; If no list is exhausted, + (if (not (memq 'nil args)) + ;; apply function to CARs. + (cons (apply f (mapcar 'car args)) + (apply 'mapcar* f + ;; Recurse for rest of elements. + (mapcar 'cdr args))))) + + (mapcar* 'cons '(a b c) '(1 2 3 4)) + => ((a . 1) (b . 2) (c . 3)) + + - Function: mapconcat FUNCTION SEQUENCE SEPARATOR + `mapconcat' applies FUNCTION to each element of SEQUENCE: the + results, which must be strings, are concatenated. Between each + pair of result strings, `mapconcat' inserts the string SEPARATOR. + Usually SEPARATOR contains a space or comma or other suitable + punctuation. + + The argument FUNCTION must be a function that can take one + argument and return a string. + + (mapconcat 'symbol-name + '(The cat in the hat) + " ") + => "The cat in the hat" + + (mapconcat (function (lambda (x) (format "%c" (1+ x)))) + "HAL-8000" + "") + => "IBM.9111" + + +File: lispref.info, Node: Anonymous Functions, Next: Function Cells, Prev: Mapping Functions, Up: Functions + +Anonymous Functions +=================== + + In Lisp, a function is a list that starts with `lambda', a byte-code +function compiled from such a list, or alternatively a primitive +subr-object; names are "extra". Although usually functions are defined +with `defun' and given names at the same time, it is occasionally more +concise to use an explicit lambda expression--an anonymous function. +Such a list is valid wherever a function name is. + + Any method of creating such a list makes a valid function. Even +this: + + (setq silly (append '(lambda (x)) (list (list '+ (* 3 4) 'x)))) + => (lambda (x) (+ 12 x)) + +This computes a list that looks like `(lambda (x) (+ 12 x))' and makes +it the value (*not* the function definition!) of `silly'. + + Here is how we might call this function: + + (funcall silly 1) + => 13 + +(It does *not* work to write `(silly 1)', because this function is not +the *function definition* of `silly'. We have not given `silly' any +function definition, just a value as a variable.) + + Most of the time, anonymous functions are constants that appear in +your program. For example, you might want to pass one as an argument +to the function `mapcar', which applies any given function to each +element of a list. Here we pass an anonymous function that multiplies +a number by two: + + (defun double-each (list) + (mapcar '(lambda (x) (* 2 x)) list)) + => double-each + (double-each '(2 11)) + => (4 22) + +In such cases, we usually use the special form `function' instead of +simple quotation to quote the anonymous function. + + - Special Form: function FUNCTION-OBJECT + This special form returns FUNCTION-OBJECT without evaluating it. + In this, it is equivalent to `quote'. However, it serves as a + note to the XEmacs Lisp compiler that FUNCTION-OBJECT is intended + to be used only as a function, and therefore can safely be + compiled. Contrast this with `quote', in *Note Quoting::. + + Using `function' instead of `quote' makes a difference inside a +function or macro that you are going to compile. For example: + + (defun double-each (list) + (mapcar (function (lambda (x) (* 2 x))) list)) + => double-each + (double-each '(2 11)) + => (4 22) + +If this definition of `double-each' is compiled, the anonymous function +is compiled as well. By contrast, in the previous definition where +ordinary `quote' is used, the argument passed to `mapcar' is the +precise list shown: + + (lambda (x) (* x 2)) + +The Lisp compiler cannot assume this list is a function, even though it +looks like one, since it does not know what `mapcar' does with the +list. Perhaps `mapcar' will check that the CAR of the third element is +the symbol `*'! The advantage of `function' is that it tells the +compiler to go ahead and compile the constant function. + + We sometimes write `function' instead of `quote' when quoting the +name of a function, but this usage is just a sort of comment. + + (function SYMBOL) == (quote SYMBOL) == 'SYMBOL + + See `documentation' in *Note Accessing Documentation::, for a +realistic example using `function' and an anonymous function. + + +File: lispref.info, Node: Function Cells, Next: Inline Functions, Prev: Anonymous Functions, Up: Functions + +Accessing Function Cell Contents +================================ + + The "function definition" of a symbol is the object stored in the +function cell of the symbol. The functions described here access, test, +and set the function cell of symbols. + + See also the function `indirect-function' in *Note Function +Indirection::. + + - Function: symbol-function SYMBOL + This returns the object in the function cell of SYMBOL. If the + symbol's function cell is void, a `void-function' error is + signaled. + + This function does not check that the returned object is a + legitimate function. + + (defun bar (n) (+ n 2)) + => bar + (symbol-function 'bar) + => (lambda (n) (+ n 2)) + (fset 'baz 'bar) + => bar + (symbol-function 'baz) + => bar + + If you have never given a symbol any function definition, we say that +that symbol's function cell is "void". In other words, the function +cell does not have any Lisp object in it. If you try to call such a +symbol as a function, it signals a `void-function' error. + + Note that void is not the same as `nil' or the symbol `void'. The +symbols `nil' and `void' are Lisp objects, and can be stored into a +function cell just as any other object can be (and they can be valid +functions if you define them in turn with `defun'). A void function +cell contains no object whatsoever. + + You can test the voidness of a symbol's function definition with +`fboundp'. After you have given a symbol a function definition, you +can make it void once more using `fmakunbound'. + + - Function: fboundp SYMBOL + This function returns `t' if the symbol has an object in its + function cell, `nil' otherwise. It does not check that the object + is a legitimate function. + + - Function: fmakunbound SYMBOL + This function makes SYMBOL's function cell void, so that a + subsequent attempt to access this cell will cause a `void-function' + error. (See also `makunbound', in *Note Local Variables::.) + + (defun foo (x) x) + => x + (foo 1) + =>1 + (fmakunbound 'foo) + => x + (foo 1) + error--> Symbol's function definition is void: foo + + - Function: fset SYMBOL OBJECT + This function stores OBJECT in the function cell of SYMBOL. The + result is OBJECT. Normally OBJECT should be a function or the + name of a function, but this is not checked. + + There are three normal uses of this function: + + * Copying one symbol's function definition to another. (In + other words, making an alternate name for a function.) + + * Giving a symbol a function definition that is not a list and + therefore cannot be made with `defun'. For example, you can + use `fset' to give a symbol `s1' a function definition which + is another symbol `s2'; then `s1' serves as an alias for + whatever definition `s2' presently has. + + * In constructs for defining or altering functions. If `defun' + were not a primitive, it could be written in Lisp (as a + macro) using `fset'. + + Here are examples of the first two uses: + + ;; Give `first' the same definition `car' has. + (fset 'first (symbol-function 'car)) + => # + (first '(1 2 3)) + => 1 + + ;; Make the symbol `car' the function definition of `xfirst'. + (fset 'xfirst 'car) + => car + (xfirst '(1 2 3)) + => 1 + (symbol-function 'xfirst) + => car + (symbol-function (symbol-function 'xfirst)) + => # + + ;; Define a named keyboard macro. + (fset 'kill-two-lines "\^u2\^k") + => "\^u2\^k" + + See also the related functions `define-function' and `defalias', + in *Note Defining Functions::. + + When writing a function that extends a previously defined function, +the following idiom is sometimes used: + + (fset 'old-foo (symbol-function 'foo)) + (defun foo () + "Just like old-foo, except more so." + (old-foo) + (more-so)) + +This does not work properly if `foo' has been defined to autoload. In +such a case, when `foo' calls `old-foo', Lisp attempts to define +`old-foo' by loading a file. Since this presumably defines `foo' +rather than `old-foo', it does not produce the proper results. The +only way to avoid this problem is to make sure the file is loaded +before moving aside the old definition of `foo'. + + But it is unmodular and unclean, in any case, for a Lisp file to +redefine a function defined elsewhere. + + +File: lispref.info, Node: Inline Functions, Next: Related Topics, Prev: Function Cells, Up: Functions + +Inline Functions +================ + + You can define an "inline function" by using `defsubst' instead of +`defun'. An inline function works just like an ordinary function +except for one thing: when you compile a call to the function, the +function's definition is open-coded into the caller. + + Making a function inline makes explicit calls run faster. But it +also has disadvantages. For one thing, it reduces flexibility; if you +change the definition of the function, calls already inlined still use +the old definition until you recompile them. Since the flexibility of +redefining functions is an important feature of XEmacs, you should not +make a function inline unless its speed is really crucial. + + Another disadvantage is that making a large function inline can +increase the size of compiled code both in files and in memory. Since +the speed advantage of inline functions is greatest for small +functions, you generally should not make large functions inline. + + It's possible to define a macro to expand into the same code that an +inline function would execute. But the macro would have a limitation: +you can use it only explicitly--a macro cannot be called with `apply', +`mapcar' and so on. Also, it takes some work to convert an ordinary +function into a macro. (*Note Macros::.) To convert it into an inline +function is very easy; simply replace `defun' with `defsubst'. Since +each argument of an inline function is evaluated exactly once, you +needn't worry about how many times the body uses the arguments, as you +do for macros. (*Note Argument Evaluation::.) + + Inline functions can be used and open-coded later on in the same +file, following the definition, just like macros. + + +File: lispref.info, Node: Related Topics, Prev: Inline Functions, Up: Functions + +Other Topics Related to Functions +================================= + + Here is a table of several functions that do things related to +function calling and function definitions. They are documented +elsewhere, but we provide cross references here. + +`apply' + See *Note Calling Functions::. + +`autoload' + See *Note Autoload::. + +`call-interactively' + See *Note Interactive Call::. + +`commandp' + See *Note Interactive Call::. + +`documentation' + See *Note Accessing Documentation::. + +`eval' + See *Note Eval::. + +`funcall' + See *Note Calling Functions::. + +`ignore' + See *Note Calling Functions::. + +`indirect-function' + See *Note Function Indirection::. + +`interactive' + See *Note Using Interactive::. + +`interactive-p' + See *Note Interactive Call::. + +`mapatoms' + See *Note Creating Symbols::. + +`mapcar' + See *Note Mapping Functions::. + +`mapconcat' + See *Note Mapping Functions::. + +`undefined' + See *Note Key Lookup::. + + +File: lispref.info, Node: Macros, Next: Loading, Prev: Functions, Up: Top + +Macros +****** + + "Macros" enable you to define new control constructs and other +language features. A macro is defined much like a function, but instead +of telling how to compute a value, it tells how to compute another Lisp +expression which will in turn compute the value. We call this +expression the "expansion" of the macro. + + Macros can do this because they operate on the unevaluated +expressions for the arguments, not on the argument values as functions +do. They can therefore construct an expansion containing these +argument expressions or parts of them. + + If you are using a macro to do something an ordinary function could +do, just for the sake of speed, consider using an inline function +instead. *Note Inline Functions::. + +* Menu: + +* Simple Macro:: A basic example. +* Expansion:: How, when and why macros are expanded. +* Compiling Macros:: How macros are expanded by the compiler. +* Defining Macros:: How to write a macro definition. +* Backquote:: Easier construction of list structure. +* Problems with Macros:: Don't evaluate the macro arguments too many times. + Don't hide the user's variables. + + +File: lispref.info, Node: Simple Macro, Next: Expansion, Up: Macros + +A Simple Example of a Macro +=========================== + + Suppose we would like to define a Lisp construct to increment a +variable value, much like the `++' operator in C. We would like to +write `(inc x)' and have the effect of `(setq x (1+ x))'. Here's a +macro definition that does the job: + + (defmacro inc (var) + (list 'setq var (list '1+ var))) + + When this is called with `(inc x)', the argument `var' has the value +`x'--*not* the *value* of `x'. The body of the macro uses this to +construct the expansion, which is `(setq x (1+ x))'. Once the macro +definition returns this expansion, Lisp proceeds to evaluate it, thus +incrementing `x'. + + +File: lispref.info, Node: Expansion, Next: Compiling Macros, Prev: Simple Macro, Up: Macros + +Expansion of a Macro Call +========================= + + A macro call looks just like a function call in that it is a list +which starts with the name of the macro. The rest of the elements of +the list are the arguments of the macro. + + Evaluation of the macro call begins like evaluation of a function +call except for one crucial difference: the macro arguments are the +actual expressions appearing in the macro call. They are not evaluated +before they are given to the macro definition. By contrast, the +arguments of a function are results of evaluating the elements of the +function call list. + + Having obtained the arguments, Lisp invokes the macro definition just +as a function is invoked. The argument variables of the macro are bound +to the argument values from the macro call, or to a list of them in the +case of a `&rest' argument. And the macro body executes and returns +its value just as a function body does. + + The second crucial difference between macros and functions is that +the value returned by the macro body is not the value of the macro call. +Instead, it is an alternate expression for computing that value, also +known as the "expansion" of the macro. The Lisp interpreter proceeds +to evaluate the expansion as soon as it comes back from the macro. + + Since the expansion is evaluated in the normal manner, it may contain +calls to other macros. It may even be a call to the same macro, though +this is unusual. + + You can see the expansion of a given macro call by calling +`macroexpand'. + + - Function: macroexpand FORM &optional ENVIRONMENT + This function expands FORM, if it is a macro call. If the result + is another macro call, it is expanded in turn, until something + which is not a macro call results. That is the value returned by + `macroexpand'. If FORM is not a macro call to begin with, it is + returned as given. + + Note that `macroexpand' does not look at the subexpressions of + FORM (although some macro definitions may do so). Even if they + are macro calls themselves, `macroexpand' does not expand them. + + The function `macroexpand' does not expand calls to inline + functions. Normally there is no need for that, since a call to an + inline function is no harder to understand than a call to an + ordinary function. + + If ENVIRONMENT is provided, it specifies an alist of macro + definitions that shadow the currently defined macros. Byte + compilation uses this feature. + + (defmacro inc (var) + (list 'setq var (list '1+ var))) + => inc + + (macroexpand '(inc r)) + => (setq r (1+ r)) + + (defmacro inc2 (var1 var2) + (list 'progn (list 'inc var1) (list 'inc var2))) + => inc2 + + (macroexpand '(inc2 r s)) + => (progn (inc r) (inc s)) ; `inc' not expanded here. + + +File: lispref.info, Node: Compiling Macros, Next: Defining Macros, Prev: Expansion, Up: Macros + +Macros and Byte Compilation +=========================== + + You might ask why we take the trouble to compute an expansion for a +macro and then evaluate the expansion. Why not have the macro body +produce the desired results directly? The reason has to do with +compilation. + + When a macro call appears in a Lisp program being compiled, the Lisp +compiler calls the macro definition just as the interpreter would, and +receives an expansion. But instead of evaluating this expansion, it +compiles the expansion as if it had appeared directly in the program. +As a result, the compiled code produces the value and side effects +intended for the macro, but executes at full compiled speed. This would +not work if the macro body computed the value and side effects +itself--they would be computed at compile time, which is not useful. + + In order for compilation of macro calls to work, the macros must be +defined in Lisp when the calls to them are compiled. The compiler has a +special feature to help you do this: if a file being compiled contains a +`defmacro' form, the macro is defined temporarily for the rest of the +compilation of that file. To use this feature, you must define the +macro in the same file where it is used and before its first use. + + Byte-compiling a file executes any `require' calls at top-level in +the file. This is in case the file needs the required packages for +proper compilation. One way to ensure that necessary macro definitions +are available during compilation is to require the files that define +them (*note Named Features::.). To avoid loading the macro definition +files when someone *runs* the compiled program, write +`eval-when-compile' around the `require' calls (*note Eval During +Compile::.). + + +File: lispref.info, Node: Defining Macros, Next: Backquote, Prev: Compiling Macros, Up: Macros + +Defining Macros +=============== + + A Lisp macro is a list whose CAR is `macro'. Its CDR should be a +function; expansion of the macro works by applying the function (with +`apply') to the list of unevaluated argument-expressions from the macro +call. + + It is possible to use an anonymous Lisp macro just like an anonymous +function, but this is never done, because it does not make sense to pass +an anonymous macro to functionals such as `mapcar'. In practice, all +Lisp macros have names, and they are usually defined with the special +form `defmacro'. + + - Special Form: defmacro NAME ARGUMENT-LIST BODY-FORMS... + `defmacro' defines the symbol NAME as a macro that looks like this: + + (macro lambda ARGUMENT-LIST . BODY-FORMS) + + This macro object is stored in the function cell of NAME. The + value returned by evaluating the `defmacro' form is NAME, but + usually we ignore this value. + + The shape and meaning of ARGUMENT-LIST is the same as in a + function, and the keywords `&rest' and `&optional' may be used + (*note Argument List::.). Macros may have a documentation string, + but any `interactive' declaration is ignored since macros cannot be + called interactively. + diff --git a/info/lispref.info-11 b/info/lispref.info-11 new file mode 100644 index 0000000..9369659 --- /dev/null +++ b/info/lispref.info-11 @@ -0,0 +1,1202 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Backquote, Next: Problems with Macros, Prev: Defining Macros, Up: Macros + +Backquote +========= + + Macros often need to construct large list structures from a mixture +of constants and nonconstant parts. To make this easier, use the macro +``' (often called "backquote"). + + Backquote allows you to quote a list, but selectively evaluate +elements of that list. In the simplest case, it is identical to the +special form `quote' (*note Quoting::.). For example, these two forms +yield identical results: + + `(a list of (+ 2 3) elements) + => (a list of (+ 2 3) elements) + '(a list of (+ 2 3) elements) + => (a list of (+ 2 3) elements) + + The special marker `,' inside of the argument to backquote indicates +a value that isn't constant. Backquote evaluates the argument of `,' +and puts the value in the list structure: + + (list 'a 'list 'of (+ 2 3) 'elements) + => (a list of 5 elements) + `(a list of ,(+ 2 3) elements) + => (a list of 5 elements) + + You can also "splice" an evaluated value into the resulting list, +using the special marker `,@'. The elements of the spliced list become +elements at the same level as the other elements of the resulting list. +The equivalent code without using ``' is often unreadable. Here are +some examples: + + (setq some-list '(2 3)) + => (2 3) + (cons 1 (append some-list '(4) some-list)) + => (1 2 3 4 2 3) + `(1 ,@some-list 4 ,@some-list) + => (1 2 3 4 2 3) + + (setq list '(hack foo bar)) + => (hack foo bar) + (cons 'use + (cons 'the + (cons 'words (append (cdr list) '(as elements))))) + => (use the words foo bar as elements) + `(use the words ,@(cdr list) as elements) + => (use the words foo bar as elements) + + In older versions of Emacs (before XEmacs 19.12 or FSF Emacs + version 19.29), ``' used a different syntax which required an + extra level of parentheses around the entire backquote construct. + Likewise, each `,' or `,@' substitution required an extra level of + parentheses surrounding both the `,' or `,@' and the following + expression. The old syntax required whitespace between the ``', + `,' or `,@' and the following expression. + + This syntax is still accepted, but no longer recommended except for + compatibility with old Emacs versions. + + +File: lispref.info, Node: Problems with Macros, Prev: Backquote, Up: Macros + +Common Problems Using Macros +============================ + + The basic facts of macro expansion have counterintuitive +consequences. This section describes some important consequences that +can lead to trouble, and rules to follow to avoid trouble. + +* Menu: + +* Argument Evaluation:: The expansion should evaluate each macro arg once. +* Surprising Local Vars:: Local variable bindings in the expansion + require special care. +* Eval During Expansion:: Don't evaluate them; put them in the expansion. +* Repeated Expansion:: Avoid depending on how many times expansion is done. + + +File: lispref.info, Node: Argument Evaluation, Next: Surprising Local Vars, Up: Problems with Macros + +Evaluating Macro Arguments Repeatedly +------------------------------------- + + When defining a macro you must pay attention to the number of times +the arguments will be evaluated when the expansion is executed. The +following macro (used to facilitate iteration) illustrates the problem. +This macro allows us to write a simple "for" loop such as one might +find in Pascal. + + (defmacro for (var from init to final do &rest body) + "Execute a simple \"for\" loop. + For example, (for i from 1 to 10 do (print i))." + (list 'let (list (list var init)) + (cons 'while (cons (list '<= var final) + (append body (list (list 'inc var))))))) + => for + (for i from 1 to 3 do + (setq square (* i i)) + (princ (format "\n%d %d" i square))) + ==> + + (let ((i 1)) + (while (<= i 3) + (setq square (* i i)) + (princ (format "%d %d" i square)) + (inc i))) + + + -|1 1 + -|2 4 + -|3 9 + => nil + +(The arguments `from', `to', and `do' in this macro are "syntactic +sugar"; they are entirely ignored. The idea is that you will write +noise words (such as `from', `to', and `do') in those positions in the +macro call.) + + Here's an equivalent definition simplified through use of backquote: + + (defmacro for (var from init to final do &rest body) + "Execute a simple \"for\" loop. + For example, (for i from 1 to 10 do (print i))." + `(let ((,var ,init)) + (while (<= ,var ,final) + ,@body + (inc ,var)))) + + Both forms of this definition (with backquote and without) suffer +from the defect that FINAL is evaluated on every iteration. If FINAL +is a constant, this is not a problem. If it is a more complex form, +say `(long-complex-calculation x)', this can slow down the execution +significantly. If FINAL has side effects, executing it more than once +is probably incorrect. + + A well-designed macro definition takes steps to avoid this problem by +producing an expansion that evaluates the argument expressions exactly +once unless repeated evaluation is part of the intended purpose of the +macro. Here is a correct expansion for the `for' macro: + + (let ((i 1) + (max 3)) + (while (<= i max) + (setq square (* i i)) + (princ (format "%d %d" i square)) + (inc i))) + + Here is a macro definition that creates this expansion: + + (defmacro for (var from init to final do &rest body) + "Execute a simple for loop: (for i from 1 to 10 do (print i))." + `(let ((,var ,init) + (max ,final)) + (while (<= ,var max) + ,@body + (inc ,var)))) + + Unfortunately, this introduces another problem. Proceed to the +following node. + + +File: lispref.info, Node: Surprising Local Vars, Next: Eval During Expansion, Prev: Argument Evaluation, Up: Problems with Macros + +Local Variables in Macro Expansions +----------------------------------- + + In the previous section, the definition of `for' was fixed as +follows to make the expansion evaluate the macro arguments the proper +number of times: + + (defmacro for (var from init to final do &rest body) + "Execute a simple for loop: (for i from 1 to 10 do (print i))." + + `(let ((,var ,init) + (max ,final)) + (while (<= ,var max) + ,@body + (inc ,var)))) + + The new definition of `for' has a new problem: it introduces a local +variable named `max' which the user does not expect. This causes +trouble in examples such as the following: + + (let ((max 0)) + (for x from 0 to 10 do + (let ((this (frob x))) + (if (< max this) + (setq max this))))) + +The references to `max' inside the body of the `for', which are +supposed to refer to the user's binding of `max', really access the +binding made by `for'. + + The way to correct this is to use an uninterned symbol instead of +`max' (*note Creating Symbols::.). The uninterned symbol can be bound +and referred to just like any other symbol, but since it is created by +`for', we know that it cannot already appear in the user's program. +Since it is not interned, there is no way the user can put it into the +program later. It will never appear anywhere except where put by +`for'. Here is a definition of `for' that works this way: + + (defmacro for (var from init to final do &rest body) + "Execute a simple for loop: (for i from 1 to 10 do (print i))." + (let ((tempvar (make-symbol "max"))) + `(let ((,var ,init) + (,tempvar ,final)) + (while (<= ,var ,tempvar) + ,@body + (inc ,var))))) + +This creates an uninterned symbol named `max' and puts it in the +expansion instead of the usual interned symbol `max' that appears in +expressions ordinarily. + + +File: lispref.info, Node: Eval During Expansion, Next: Repeated Expansion, Prev: Surprising Local Vars, Up: Problems with Macros + +Evaluating Macro Arguments in Expansion +--------------------------------------- + + Another problem can happen if you evaluate any of the macro argument +expressions during the computation of the expansion, such as by calling +`eval' (*note Eval::.). If the argument is supposed to refer to the +user's variables, you may have trouble if the user happens to use a +variable with the same name as one of the macro arguments. Inside the +macro body, the macro argument binding is the most local binding of this +variable, so any references inside the form being evaluated do refer to +it. Here is an example: + + (defmacro foo (a) + (list 'setq (eval a) t)) + => foo + (setq x 'b) + (foo x) ==> (setq b t) + => t ; and `b' has been set. + ;; but + (setq a 'c) + (foo a) ==> (setq a t) + => t ; but this set `a', not `c'. + + It makes a difference whether the user's variable is named `a' or +`x', because `a' conflicts with the macro argument variable `a'. + + Another reason not to call `eval' in a macro definition is that it +probably won't do what you intend in a compiled program. The +byte-compiler runs macro definitions while compiling the program, when +the program's own computations (which you might have wished to access +with `eval') don't occur and its local variable bindings don't exist. + + The safe way to work with the run-time value of an expression is to +put the expression into the macro expansion, so that its value is +computed as part of executing the expansion. + + +File: lispref.info, Node: Repeated Expansion, Prev: Eval During Expansion, Up: Problems with Macros + +How Many Times is the Macro Expanded? +------------------------------------- + + Occasionally problems result from the fact that a macro call is +expanded each time it is evaluated in an interpreted function, but is +expanded only once (during compilation) for a compiled function. If the +macro definition has side effects, they will work differently depending +on how many times the macro is expanded. + + In particular, constructing objects is a kind of side effect. If the +macro is called once, then the objects are constructed only once. In +other words, the same structure of objects is used each time the macro +call is executed. In interpreted operation, the macro is reexpanded +each time, producing a fresh collection of objects each time. Usually +this does not matter--the objects have the same contents whether they +are shared or not. But if the surrounding program does side effects on +the objects, it makes a difference whether they are shared. Here is an +example: + + (defmacro empty-object () + (list 'quote (cons nil nil))) + + (defun initialize (condition) + (let ((object (empty-object))) + (if condition + (setcar object condition)) + object)) + +If `initialize' is interpreted, a new list `(nil)' is constructed each +time `initialize' is called. Thus, no side effect survives between +calls. If `initialize' is compiled, then the macro `empty-object' is +expanded during compilation, producing a single "constant" `(nil)' that +is reused and altered each time `initialize' is called. + + One way to avoid pathological cases like this is to think of +`empty-object' as a funny kind of constant, not as a memory allocation +construct. You wouldn't use `setcar' on a constant such as `'(nil)', +so naturally you won't use it on `(empty-object)' either. + + +File: lispref.info, Node: Customization, Up: Top + +Writing Customization Definitions +********************************* + + This chapter describes how to declare user options for customization, +and also customization groups for classifying them. We use the term +"customization item" to include both kinds of customization +definitions--as well as face definitions. + +* Menu: + +* Common Keywords:: +* Group Definitions:: +* Variable Definitions:: +* Customization Types:: + + +File: lispref.info, Node: Common Keywords, Next: Group Definitions, Up: Customization + +Common Keywords for All Kinds of Items +====================================== + + All kinds of customization declarations (for variables and groups, +and for faces) accept keyword arguments for specifying various +information. This section describes some keywords that apply to all +kinds. + + All of these keywords, except `:tag', can be used more than once in +a given item. Each use of the keyword has an independent effect. The +keyword `:tag' is an exception because any given item can only display +one name. + +`:tag NAME' + Use NAME, a string, instead of the item's name, to label the item + in customization menus and buffers. + +`:group GROUP' + Put this customization item in group GROUP. When you use `:group' + in a `defgroup', it makes the new group a subgroup of GROUP. + + If you use this keyword more than once, you can put a single item + into more than one group. Displaying any of those groups will + show this item. Be careful not to overdo this! + +`:link LINK-DATA' + Include an external link after the documentation string for this + item. This is a sentence containing an active field which + references some other documentation. + + There are three alternatives you can use for LINK-DATA: + + `(custom-manual INFO-NODE)' + Link to an Info node; INFO-NODE is a string which specifies + the node name, as in `"(emacs)Top"'. The link appears as + `[manual]' in the customization buffer. + + `(info-link INFO-NODE)' + Like `custom-manual' except that the link appears in the + customization buffer with the Info node name. + + `(url-link URL)' + Link to a web page; URL is a string which specifies the URL. + The link appears in the customization buffer as URL. + + You can specify the text to use in the customization buffer by + adding `:tag NAME' after the first element of the LINK-DATA; for + example, `(info-link :tag "foo" "(emacs)Top")' makes a link to the + Emacs manual which appears in the buffer as `foo'. + + An item can have more than one external link; however, most items + have none at all. + +`:load FILE' + Load file FILE (a string) before displaying this customization + item. Loading is done with `load-library', and only if the file is + not already loaded. + +`:require FEATURE' + Require feature FEATURE (a symbol) when installing a value for + this item (an option or a face) that was saved using the + customization feature. This is done by calling `require'. + + The most common reason to use `:require' is when a variable enables + a feature such as a minor mode, and just setting the variable + won't have any effect unless the code which implements the mode is + loaded. + + +File: lispref.info, Node: Group Definitions, Next: Variable Definitions, Prev: Common Keywords, Up: Customization + +Defining Custom Groups +====================== + + Each Emacs Lisp package should have one main customization group +which contains all the options, faces and other groups in the package. +If the package has a small number of options and faces, use just one +group and put everything in it. When there are more than twelve or so +options and faces, then you should structure them into subgroups, and +put the subgroups under the package's main customization group. It is +OK to put some of the options and faces in the package's main group +alongside the subgroups. + + The package's main or only group should be a member of one or more of +the standard customization groups. (To display the full list of them, +use `M-x customize'.) Choose one or more of them (but not too many), +and add your group to each of them using the `:group' keyword. + + The way to declare new customization groups is with `defgroup'. + + - Macro: defgroup GROUP MEMBERS DOC [KEYWORD VALUE]... + Declare GROUP as a customization group containing MEMBERS. Do not + quote the symbol GROUP. The argument DOC specifies the + documentation string for the group. + + The argument MEMBERS is a list specifying an initial set of + customization items to be members of the group. However, most + often MEMBERS is `nil', and you specify the group's members by + using the `:group' keyword when defining those members. + + If you want to specify group members through MEMBERS, each element + should have the form `(NAME WIDGET)'. Here NAME is a symbol, and + WIDGET is a widget type for editing that symbol. Useful widgets + are `custom-variable' for a variable, `custom-face' for a face, + and `custom-group' for a group. + + In addition to the common keywords (*note Common Keywords::.), you + can use this keyword in `defgroup': + + `:prefix PREFIX' + If the name of an item in the group starts with PREFIX, then + the tag for that item is constructed (by default) by omitting + PREFIX. + + One group can have any number of prefixes. + + +File: lispref.info, Node: Variable Definitions, Next: Customization Types, Prev: Group Definitions, Up: Customization + +Defining Customization Variables +================================ + + Use `defcustom' to declare user-editable variables. + + - Macro: defcustom OPTION DEFAULT DOC [KEYWORD VALUE]... + Declare OPTION as a customizable user option variable. Do not + quote OPTION. The argument DOC specifies the documentation string + for the variable. + + If OPTION is void, `defcustom' initializes it to DEFAULT. DEFAULT + should be an expression to compute the value; be careful in + writing it, because it can be evaluated on more than one occasion. + + The following additional keywords are defined: + + `:type TYPE' + Use TYPE as the data type for this option. It specifies which + values are legitimate, and how to display the value. *Note + Customization Types::, for more information. + + `:options LIST' + Specify LIST as the list of reasonable values for use in this + option. + + Currently this is meaningful only when the type is `hook'. + In that case, the elements of LIST should be functions that + are useful as elements of the hook value. The user is not + restricted to using only these functions, but they are + offered as convenient alternatives. + + `:version VERSION' + This option specifies that the variable was first introduced, + or its default value was changed, in Emacs version VERSION. + The value VERSION must be a string. For example, + + (defcustom foo-max 34 + "*Maximum number of foo's allowed." + :type 'integer + :group 'foo + :version "20.3") + + `:set SETFUNCTION' + Specify SETFUNCTION as the way to change the value of this + option. The function SETFUNCTION should take two arguments, + a symbol and the new value, and should do whatever is + necessary to update the value properly for this option (which + may not mean simply setting the option as a Lisp variable). + The default for SETFUNCTION is `set-default'. + + `:get GETFUNCTION' + Specify GETFUNCTION as the way to extract the value of this + option. The function GETFUNCTION should take one argument, a + symbol, and should return the "current value" for that symbol + (which need not be the symbol's Lisp value). The default is + `default-value'. + + `:initialize FUNCTION' + FUNCTION should be a function used to initialize the variable + when the `defcustom' is evaluated. It should take two + arguments, the symbol and value. Here are some predefined + functions meant for use in this way: + + `custom-initialize-set' + Use the variable's `:set' function to initialize the + variable, but do not reinitialize it if it is already + non-void. This is the default `:initialize' function. + + `custom-initialize-default' + Like `custom-initialize-set', but use the function + `set-default' to set the variable, instead of the + variable's `:set' function. This is the usual choice + for a variable whose `:set' function enables or disables + a minor mode; with this choice, defining the variable + will not call the minor mode function, but customizing + the variable will do so. + + `custom-initialize-reset' + Always use the `:set' function to initialize the + variable. If the variable is already non-void, reset it + by calling the `:set' function using the current value + (returned by the `:get' method). + + `custom-initialize-changed' + Use the `:set' function to initialize the variable, if + it is already set or has been customized; otherwise, + just use `set-default'. + + The `:require' option is useful for an option that turns on the +operation of a certain feature. Assuming that the package is coded to +check the value of the option, you still need to arrange for the package +to be loaded. You can do that with `:require'. *Note Common +Keywords::. Here is an example, from the library `paren.el': + + (defcustom show-paren-mode nil + "Toggle Show Paren mode...." + :set (lambda (symbol value) + (show-paren-mode (or value 0))) + :initialize 'custom-initialize-default + :type 'boolean + :group 'paren-showing + :require 'paren) + + Internally, `defcustom' uses the symbol property `standard-value' to +record the expression for the default value, and `saved-value' to +record the value saved by the user with the customization buffer. The +`saved-value' property is actually a list whose car is an expression +which evaluates to the value. + + +File: lispref.info, Node: Customization Types, Prev: Variable Definitions, Up: Customization + +Customization Types +=================== + + When you define a user option with `defcustom', you must specify its +"customization type". That is a Lisp object which describes (1) which +values are legitimate and (2) how to display the value in the +customization buffer for editing. + + You specify the customization type in `defcustom' with the `:type' +keyword. The argument of `:type' is evaluated; since types that vary +at run time are rarely useful, normally you use a quoted constant. For +example: + + (defcustom diff-command "diff" + "*The command to use to run diff." + :type '(string) + :group 'diff) + + In general, a customization type is a list whose first element is a +symbol, one of the customization type names defined in the following +sections. After this symbol come a number of arguments, depending on +the symbol. Between the type symbol and its arguments, you can +optionally write keyword-value pairs (*note Type Keywords::.). + + Some of the type symbols do not use any arguments; those are called +"simple types". For a simple type, if you do not use any keyword-value +pairs, you can omit the parentheses around the type symbol. For +example just `string' as a customization type is equivalent to +`(string)'. + +* Menu: + +* Simple Types:: +* Composite Types:: +* Splicing into Lists:: +* Type Keywords:: + + +File: lispref.info, Node: Simple Types, Next: Composite Types, Up: Customization Types + +Simple Types +------------ + + This section describes all the simple customization types. + +`sexp' + The value may be any Lisp object that can be printed and read + back. You can use `sexp' as a fall-back for any option, if you + don't want to take the time to work out a more specific type to + use. + +`integer' + The value must be an integer, and is represented textually in the + customization buffer. + +`number' + The value must be a number, and is represented textually in the + customization buffer. + +`string' + The value must be a string, and the customization buffer shows + just the contents, with no delimiting `"' characters and no + quoting with `\'. + +`regexp' + Like `string' except that the string must be a valid regular + expression. + +`character' + The value must be a character code. A character code is actually + an integer, but this type shows the value by inserting the + character in the buffer, rather than by showing the number. + +`file' + The value must be a file name, and you can do completion with + `M-'. + +`(file :must-match t)' + The value must be a file name for an existing file, and you can do + completion with `M-'. + +`directory' + The value must be a directory name, and you can do completion with + `M-'. + +`symbol' + The value must be a symbol. It appears in the customization + buffer as the name of the symbol. + +`function' + The value must be either a lambda expression or a function name. + When it is a function name, you can do completion with `M-'. + +`variable' + The value must be a variable name, and you can do completion with + `M-'. + +`face' + The value must be a symbol which is a face name. + +`boolean' + The value is boolean--either `nil' or `t'. Note that by using + `choice' and `const' together (see the next section), you can + specify that the value must be `nil' or `t', but also specify the + text to describe each value in a way that fits the specific + meaning of the alternative. + + +File: lispref.info, Node: Composite Types, Next: Splicing into Lists, Prev: Simple Types, Up: Customization Types + +Composite Types +--------------- + + When none of the simple types is appropriate, you can use composite +types, which build new types from other types. Here are several ways of +doing that: + +`(restricted-sexp :match-alternatives CRITERIA)' + The value may be any Lisp object that satisfies one of CRITERIA. + CRITERIA should be a list, and each elements should be one of + these possibilities: + + * A predicate--that is, a function of one argument that returns + non-`nil' if the argument fits a certain type. This means + that objects of that type are acceptable. + + * A quoted constant--that is, `'OBJECT'. This means that + OBJECT itself is an acceptable value. + + For example, + + (restricted-sexp :match-alternatives (integerp 't 'nil)) + + allows integers, `t' and `nil' as legitimate values. + + The customization buffer shows all legitimate values using their + read syntax, and the user edits them textually. + +`(cons CAR-TYPE CDR-TYPE)' + The value must be a cons cell, its CAR must fit CAR-TYPE, and its + CDR must fit CDR-TYPE. For example, `(cons string symbol)' is a + customization type which matches values such as `("foo" . foo)'. + + In the customization buffer, the CAR and the CDR are displayed and + edited separately, each according to the type that you specify for + it. + +`(list ELEMENT-TYPES...)' + The value must be a list with exactly as many elements as the + ELEMENT-TYPES you have specified; and each element must fit the + corresponding ELEMENT-TYPE. + + For example, `(list integer string function)' describes a list of + three elements; the first element must be an integer, the second a + string, and the third a function. + + In the customization buffer, the each element is displayed and + edited separately, according to the type specified for it. + +`(vector ELEMENT-TYPES...)' + Like `list' except that the value must be a vector instead of a + list. The elements work the same as in `list'. + +`(choice ALTERNATIVE-TYPES...)' + The value must fit at least one of ALTERNATIVE-TYPES. For + example, `(choice integer string)' allows either an integer or a + string. + + In the customization buffer, the user selects one of the + alternatives using a menu, and can then edit the value in the + usual way for that alternative. + + Normally the strings in this menu are determined automatically + from the choices; however, you can specify different strings for + the menu by including the `:tag' keyword in the alternatives. For + example, if an integer stands for a number of spaces, while a + string is text to use verbatim, you might write the customization + type this way, + + (choice (integer :tag "Number of spaces") + (string :tag "Literal text")) + + so that the menu offers `Number of spaces' and `Literal Text'. + + In any alternative for which `nil' is not a valid value, other than + a `const', you should specify a valid default for that alternative + using the `:value' keyword. *Note Type Keywords::. + +`(const VALUE)' + The value must be VALUE--nothing else is allowed. + + The main use of `const' is inside of `choice'. For example, + `(choice integer (const nil))' allows either an integer or `nil'. + + `:tag' is often used with `const', inside of `choice'. For + example, + + (choice (const :tag "Yes" t) + (const :tag "No" nil) + (const :tag "Ask" foo)) + +`(function-item FUNCTION)' + Like `const', but used for values which are functions. This + displays the documentation string as well as the function name. + The documentation string is either the one you specify with + `:doc', or FUNCTION's own documentation string. + +`(variable-item VARIABLE)' + Like `const', but used for values which are variable names. This + displays the documentation string as well as the variable name. + The documentation string is either the one you specify with + `:doc', or VARIABLE's own documentation string. + +`(set ELEMENTS...)' + The value must be a list and each element of the list must be one + of the ELEMENTS specified. This appears in the customization + buffer as a checklist. + +`(repeat ELEMENT-TYPE)' + The value must be a list and each element of the list must fit the + type ELEMENT-TYPE. This appears in the customization buffer as a + list of elements, with `[INS]' and `[DEL]' buttons for adding more + elements or removing elements. + + +File: lispref.info, Node: Splicing into Lists, Next: Type Keywords, Prev: Composite Types, Up: Customization Types + +Splicing into Lists +------------------- + + The `:inline' feature lets you splice a variable number of elements +into the middle of a list or vector. You use it in a `set', `choice' +or `repeat' type which appears among the element-types of a `list' or +`vector'. + + Normally, each of the element-types in a `list' or `vector' +describes one and only one element of the list or vector. Thus, if an +element-type is a `repeat', that specifies a list of unspecified length +which appears as one element. + + But when the element-type uses `:inline', the value it matches is +merged directly into the containing sequence. For example, if it +matches a list with three elements, those become three elements of the +overall sequence. This is analogous to using `,@' in the backquote +construct. + + For example, to specify a list whose first element must be `t' and +whose remaining arguments should be zero or more of `foo' and `bar', +use this customization type: + + (list (const t) (set :inline t foo bar)) + +This matches values such as `(t)', `(t foo)', `(t bar)' and `(t foo +bar)'. + + When the element-type is a `choice', you use `:inline' not in the +`choice' itself, but in (some of) the alternatives of the `choice'. +For example, to match a list which must start with a file name, +followed either by the symbol `t' or two strings, use this +customization type: + + (list file + (choice (const t) + (list :inline t string string))) + +If the user chooses the first alternative in the choice, then the +overall list has two elements and the second element is `t'. If the +user chooses the second alternative, then the overall list has three +elements and the second and third must be strings. + + +File: lispref.info, Node: Type Keywords, Prev: Splicing into Lists, Up: Customization Types + +Type Keywords +------------- + + You can specify keyword-argument pairs in a customization type after +the type name symbol. Here are the keywords you can use, and their +meanings: + +`:value DEFAULT' + This is used for a type that appears as an alternative inside of + `choice'; it specifies the default value to use, at first, if and + when the user selects this alternative with the menu in the + customization buffer. + + Of course, if the actual value of the option fits this + alternative, it will appear showing the actual value, not DEFAULT. + + If `nil' is not a valid value for the alternative, then it is + essential to specify a valid default with `:value'. + +`:format FORMAT-STRING' + This string will be inserted in the buffer to represent the value + corresponding to the type. The following `%' escapes are available + for use in FORMAT-STRING: + + `%[BUTTON%]' + Display the text BUTTON marked as a button. The `:action' + attribute specifies what the button will do if the user + invokes it; its value is a function which takes two + arguments--the widget which the button appears in, and the + event. + + There is no way to specify two different buttons with + different actions. + + `%{SAMPLE%}' + Show SAMPLE in a special face specified by `:sample-face'. + + `%v' + Substitute the item's value. How the value is represented + depends on the kind of item, and (for variables) on the + customization type. + + `%d' + Substitute the item's documentation string. + + `%h' + Like `%d', but if the documentation string is more than one + line, add an active field to control whether to show all of + it or just the first line. + + `%t' + Substitute the tag here. You specify the tag with the `:tag' + keyword. + + `%%' + Display a literal `%'. + +`:action ACTION' + Perform ACTION if the user clicks on a button. + +`:button-face FACE' + Use the face FACE (a face name or a list of face names) for button + text displayed with `%[...%]'. + +`:button-prefix PREFIX' +`:button-suffix SUFFIX' + These specify the text to display before and after a button. Each + can be: + + `nil' + No text is inserted. + + a string + The string is inserted literally. + + a symbol + The symbol's value is used. + +`:tag TAG' + Use TAG (a string) as the tag for the value (or part of the value) + that corresponds to this type. + +`:doc DOC' + Use DOC as the documentation string for this value (or part of the + value) that corresponds to this type. In order for this to work, + you must specify a value for `:format', and use `%d' or `%h' in + that value. + + The usual reason to specify a documentation string for a type is to + provide more information about the meanings of alternatives inside + a `:choice' type or the parts of some other composite type. + +`:help-echo MOTION-DOC' + When you move to this item with `widget-forward' or + `widget-backward', it will display the string MOTION-DOC in the + echo area. + +`:match FUNCTION' + Specify how to decide whether a value matches the type. The + corresponding value, FUNCTION, should be a function that accepts + two arguments, a widget and a value; it should return non-`nil' if + the value is acceptable. + + +File: lispref.info, Node: Loading, Next: Byte Compilation, Prev: Macros, Up: Top + +Loading +******* + + Loading a file of Lisp code means bringing its contents into the Lisp +environment in the form of Lisp objects. XEmacs finds and opens the +file, reads the text, evaluates each form, and then closes the file. + + The load functions evaluate all the expressions in a file just as +the `eval-current-buffer' function evaluates all the expressions in a +buffer. The difference is that the load functions read and evaluate +the text in the file as found on disk, not the text in an Emacs buffer. + + The loaded file must contain Lisp expressions, either as source code +or as byte-compiled code. Each form in the file is called a "top-level +form". There is no special format for the forms in a loadable file; +any form in a file may equally well be typed directly into a buffer and +evaluated there. (Indeed, most code is tested this way.) Most often, +the forms are function definitions and variable definitions. + + A file containing Lisp code is often called a "library". Thus, the +"Rmail library" is a file containing code for Rmail mode. Similarly, a +"Lisp library directory" is a directory of files containing Lisp code. + +* Menu: + +* How Programs Do Loading:: The `load' function and others. +* Autoload:: Setting up a function to autoload. +* Repeated Loading:: Precautions about loading a file twice. +* Named Features:: Loading a library if it isn't already loaded. +* Unloading:: How to "unload" a library that was loaded. +* Hooks for Loading:: Providing code to be run when + particular libraries are loaded. + + +File: lispref.info, Node: How Programs Do Loading, Next: Autoload, Up: Loading + +How Programs Do Loading +======================= + + XEmacs Lisp has several interfaces for loading. For example, +`autoload' creates a placeholder object for a function in a file; +trying to call the autoloading function loads the file to get the +function's real definition (*note Autoload::.). `require' loads a file +if it isn't already loaded (*note Named Features::.). Ultimately, all +these facilities call the `load' function to do the work. + + - Function: load FILENAME &optional MISSING-OK NOMESSAGE NOSUFFIX + This function finds and opens a file of Lisp code, evaluates all + the forms in it, and closes the file. + + To find the file, `load' first looks for a file named + `FILENAME.elc', that is, for a file whose name is FILENAME with + `.elc' appended. If such a file exists, it is loaded. If there + is no file by that name, then `load' looks for a file named + `FILENAME.el'. If that file exists, it is loaded. Finally, if + neither of those names is found, `load' looks for a file named + FILENAME with nothing appended, and loads it if it exists. (The + `load' function is not clever about looking at FILENAME. In the + perverse case of a file named `foo.el.el', evaluation of `(load + "foo.el")' will indeed find it.) + + If the optional argument NOSUFFIX is non-`nil', then the suffixes + `.elc' and `.el' are not tried. In this case, you must specify + the precise file name you want. + + If FILENAME is a relative file name, such as `foo' or + `baz/foo.bar', `load' searches for the file using the variable + `load-path'. It appends FILENAME to each of the directories + listed in `load-path', and loads the first file it finds whose name + matches. The current default directory is tried only if it is + specified in `load-path', where `nil' stands for the default + directory. `load' tries all three possible suffixes in the first + directory in `load-path', then all three suffixes in the second + directory, and so on. + + If you get a warning that `foo.elc' is older than `foo.el', it + means you should consider recompiling `foo.el'. *Note Byte + Compilation::. + + Messages like `Loading foo...' and `Loading foo...done' appear in + the echo area during loading unless NOMESSAGE is non-`nil'. + + Any unhandled errors while loading a file terminate loading. If + the load was done for the sake of `autoload', any function + definitions made during the loading are undone. + + If `load' can't find the file to load, then normally it signals the + error `file-error' (with `Cannot open load file FILENAME'). But + if MISSING-OK is non-`nil', then `load' just returns `nil'. + + You can use the variable `load-read-function' to specify a function + for `load' to use instead of `read' for reading expressions. See + below. + + `load' returns `t' if the file loads successfully. + + - User Option: load-path + The value of this variable is a list of directories to search when + loading files with `load'. Each element is a string (which must be + a directory name) or `nil' (which stands for the current working + directory). The value of `load-path' is initialized from the + environment variable `EMACSLOADPATH', if that exists; otherwise its + default value is specified in `emacs/src/paths.h' when XEmacs is + built. + + The syntax of `EMACSLOADPATH' is the same as used for `PATH'; `:' + (or `;', according to the operating system) separates directory + names, and `.' is used for the current default directory. Here is + an example of how to set your `EMACSLOADPATH' variable from a + `csh' `.login' file: + + setenv EMACSLOADPATH .:/user/bil/emacs:/usr/lib/emacs/lisp + + Here is how to set it using `sh': + + export EMACSLOADPATH + EMACSLOADPATH=.:/user/bil/emacs:/usr/local/lib/emacs/lisp + + Here is an example of code you can place in a `.emacs' file to add + several directories to the front of your default `load-path': + + (setq load-path + (append (list nil "/user/bil/emacs" + "/usr/local/lisplib" + "~/emacs") + load-path)) + + In this example, the path searches the current working directory + first, followed then by the `/user/bil/emacs' directory, the + `/usr/local/lisplib' directory, and the `~/emacs' directory, which + are then followed by the standard directories for Lisp code. + + The command line options `-l' or `-load' specify a Lisp library to + load as part of Emacs startup. Since this file might be in the + current directory, Emacs 18 temporarily adds the current directory + to the front of `load-path' so the file can be found there. Newer + Emacs versions also find such files in the current directory, but + without altering `load-path'. + + Dumping Emacs uses a special value of `load-path'. If the value of + `load-path' at the end of dumping is unchanged (that is, still the + same special value), the dumped Emacs switches to the ordinary + `load-path' value when it starts up, as described above. But if + `load-path' has any other value at the end of dumping, that value + is used for execution of the dumped Emacs also. + + Therefore, if you want to change `load-path' temporarily for + loading a few libraries in `site-init.el' or `site-load.el', you + should bind `load-path' locally with `let' around the calls to + `load'. + + - Function: locate-file FILENAME PATH-LIST &optional SUFFIXES MODE + This function searches for a file in the same way that `load' does, + and returns the file found (if any). (In fact, `load' uses this + function to search through `load-path'.) It searches for FILENAME + through PATH-LIST, expanded by one of the optional SUFFIXES + (string of suffixes separated by `:'s), checking for access MODE + (0|1|2|4 = exists|executable|writeable|readable), default readable. + + `locate-file' keeps hash tables of the directories it searches + through, in order to speed things up. It tries valiantly to not + get confused in the face of a changing and unpredictable + environment, but can occasionally get tripped up. In this case, + you will have to call `locate-file-clear-hashing' to get it back + on track. See that function for details. + + - Function: locate-file-clear-hashing PATH + This function clears the hash records for the specified list of + directories. `locate-file' uses a hashing scheme to speed lookup, + and will correctly track the following environmental changes: + + * changes of any sort to the list of directories to be searched. + + * addition and deletion of non-shadowing files (see below) from + the directories in the list. + + * byte-compilation of a .el file into a .elc file. + + `locate-file' will primarily get confused if you add a file that + shadows (i.e. has the same name as) another file further down in + the directory list. In this case, you must call + `locate-file-clear-hashing'. + + - Variable: load-in-progress + This variable is non-`nil' if Emacs is in the process of loading a + file, and it is `nil' otherwise. + + - Variable: load-read-function + This variable specifies an alternate expression-reading function + for `load' and `eval-region' to use instead of `read'. The + function should accept one argument, just as `read' does. + + Normally, the variable's value is `nil', which means those + functions should use `read'. + + - User Option: load-warn-when-source-newer + This variable specifies whether `load' should check whether the + source is newer than the binary. If this variable is true, then + when a `.elc' file is being loaded and the corresponding `.el' is + newer, a warning message will be printed. The default is `nil', + but it is bound to `t' during the initial loadup. + + - User Option: load-warn-when-source-only + This variable specifies whether `load' should warn when loading a + `.el' file instead of an `.elc'. If this variable is true, then + when `load' is called with a filename without an extension, and + the `.elc' version doesn't exist but the `.el' version does, then + a message will be printed. If an explicit extension is passed to + `load', no warning will be printed. The default is `nil', but it + is bound to `t' during the initial loadup. + + - User Option: load-ignore-elc-files + This variable specifies whether `load' should ignore `.elc' files + when a suffix is not given. This is normally used only to + bootstrap the `.elc' files when building XEmacs, when you use the + command `make all-elc'. (This forces the `.el' versions to be + loaded in the process of compiling those same files, so that + existing out-of-date `.elc' files do not make it mess things up.) + + To learn how `load' is used to build XEmacs, see *Note Building +XEmacs::. + diff --git a/info/lispref.info-12 b/info/lispref.info-12 new file mode 100644 index 0000000..994bfc1 --- /dev/null +++ b/info/lispref.info-12 @@ -0,0 +1,1179 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Autoload, Next: Repeated Loading, Prev: How Programs Do Loading, Up: Loading + +Autoload +======== + + The "autoload" facility allows you to make a function or macro known +in Lisp, but put off loading the file that defines it. The first call +to the function automatically reads the proper file to install the real +definition and other associated code, then runs the real definition as +if it had been loaded all along. + + There are two ways to set up an autoloaded function: by calling +`autoload', and by writing a special "magic" comment in the source +before the real definition. `autoload' is the low-level primitive for +autoloading; any Lisp program can call `autoload' at any time. Magic +comments do nothing on their own; they serve as a guide for the command +`update-file-autoloads', which constructs calls to `autoload' and +arranges to execute them when Emacs is built. Magic comments are the +most convenient way to make a function autoload, but only for packages +installed along with Emacs. + + - Function: autoload FUNCTION FILENAME &optional DOCSTRING INTERACTIVE + TYPE + This function defines the function (or macro) named FUNCTION so as + to load automatically from FILENAME. The string FILENAME + specifies the file to load to get the real definition of FUNCTION. + + The argument DOCSTRING is the documentation string for the + function. Normally, this is the identical to the documentation + string in the function definition itself. Specifying the + documentation string in the call to `autoload' makes it possible + to look at the documentation without loading the function's real + definition. + + If INTERACTIVE is non-`nil', then the function can be called + interactively. This lets completion in `M-x' work without loading + the function's real definition. The complete interactive + specification need not be given here; it's not needed unless the + user actually calls FUNCTION, and when that happens, it's time to + load the real definition. + + You can autoload macros and keymaps as well as ordinary functions. + Specify TYPE as `macro' if FUNCTION is really a macro. Specify + TYPE as `keymap' if FUNCTION is really a keymap. Various parts of + Emacs need to know this information without loading the real + definition. + + An autoloaded keymap loads automatically during key lookup when a + prefix key's binding is the symbol FUNCTION. Autoloading does not + occur for other kinds of access to the keymap. In particular, it + does not happen when a Lisp program gets the keymap from the value + of a variable and calls `define-key'; not even if the variable + name is the same symbol FUNCTION. + + If FUNCTION already has a non-void function definition that is not + an autoload object, `autoload' does nothing and returns `nil'. If + the function cell of FUNCTION is void, or is already an autoload + object, then it is defined as an autoload object like this: + + (autoload FILENAME DOCSTRING INTERACTIVE TYPE) + + For example, + + (symbol-function 'run-prolog) + => (autoload "prolog" 169681 t nil) + + In this case, `"prolog"' is the name of the file to load, 169681 + refers to the documentation string in the `DOC' file (*note + Documentation Basics::.), `t' means the function is interactive, + and `nil' that it is not a macro or a keymap. + + The autoloaded file usually contains other definitions and may +require or provide one or more features. If the file is not completely +loaded (due to an error in the evaluation of its contents), any function +definitions or `provide' calls that occurred during the load are +undone. This is to ensure that the next attempt to call any function +autoloading from this file will try again to load the file. If not for +this, then some of the functions in the file might appear defined, but +they might fail to work properly for the lack of certain subroutines +defined later in the file and not loaded successfully. + + XEmacs as distributed comes with many autoloaded functions. The +calls to `autoload' are in the file `loaddefs.el'. There is a +convenient way of updating them automatically. + + If the autoloaded file fails to define the desired Lisp function or +macro, then an error is signaled with data `"Autoloading failed to +define function FUNCTION-NAME"'. + + A magic autoload comment looks like `;;;###autoload', on a line by +itself, just before the real definition of the function in its +autoloadable source file. The command `M-x update-file-autoloads' +writes a corresponding `autoload' call into `loaddefs.el'. Building +Emacs loads `loaddefs.el' and thus calls `autoload'. `M-x +update-directory-autoloads' is even more powerful; it updates autoloads +for all files in the current directory. + + The same magic comment can copy any kind of form into `loaddefs.el'. +If the form following the magic comment is not a function definition, +it is copied verbatim. You can also use a magic comment to execute a +form at build time *without* executing it when the file itself is +loaded. To do this, write the form "on the same line" as the magic +comment. Since it is in a comment, it does nothing when you load the +source file; but `update-file-autoloads' copies it to `loaddefs.el', +where it is executed while building Emacs. + + The following example shows how `doctor' is prepared for autoloading +with a magic comment: + + ;;;###autoload + (defun doctor () + "Switch to *doctor* buffer and start giving psychotherapy." + (interactive) + (switch-to-buffer "*doctor*") + (doctor-mode)) + +Here's what that produces in `loaddefs.el': + + (autoload 'doctor "doctor" + "\ + Switch to *doctor* buffer and start giving psychotherapy." + t) + +The backslash and newline immediately following the double-quote are a +convention used only in the preloaded Lisp files such as `loaddefs.el'; +they tell `make-docfile' to put the documentation string in the `DOC' +file. *Note Building XEmacs::. + + +File: lispref.info, Node: Repeated Loading, Next: Named Features, Prev: Autoload, Up: Loading + +Repeated Loading +================ + + You may load one file more than once in an Emacs session. For +example, after you have rewritten and reinstalled a function definition +by editing it in a buffer, you may wish to return to the original +version; you can do this by reloading the file it came from. + + When you load or reload files, bear in mind that the `load' and +`load-library' functions automatically load a byte-compiled file rather +than a non-compiled file of similar name. If you rewrite a file that +you intend to save and reinstall, remember to byte-compile it if +necessary; otherwise you may find yourself inadvertently reloading the +older, byte-compiled file instead of your newer, non-compiled file! + + When writing the forms in a Lisp library file, keep in mind that the +file might be loaded more than once. For example, the choice of +`defvar' vs. `defconst' for defining a variable depends on whether it +is desirable to reinitialize the variable if the library is reloaded: +`defconst' does so, and `defvar' does not. (*Note Defining +Variables::.) + + The simplest way to add an element to an alist is like this: + + (setq minor-mode-alist + (cons '(leif-mode " Leif") minor-mode-alist)) + +But this would add multiple elements if the library is reloaded. To +avoid the problem, write this: + + (or (assq 'leif-mode minor-mode-alist) + (setq minor-mode-alist + (cons '(leif-mode " Leif") minor-mode-alist))) + + To add an element to a list just once, use `add-to-list' (*note +Setting Variables::.). + + Occasionally you will want to test explicitly whether a library has +already been loaded. Here's one way to test, in a library, whether it +has been loaded before: + + (defvar foo-was-loaded) + + (if (not (boundp 'foo-was-loaded)) + EXECUTE-FIRST-TIME-ONLY) + + (setq foo-was-loaded t) + +If the library uses `provide' to provide a named feature, you can use +`featurep' to test whether the library has been loaded. *Note Named +Features::. + + +File: lispref.info, Node: Named Features, Next: Unloading, Prev: Repeated Loading, Up: Loading + +Features +======== + + `provide' and `require' are an alternative to `autoload' for loading +files automatically. They work in terms of named "features". +Autoloading is triggered by calling a specific function, but a feature +is loaded the first time another program asks for it by name. + + A feature name is a symbol that stands for a collection of functions, +variables, etc. The file that defines them should "provide" the +feature. Another program that uses them may ensure they are defined by +"requiring" the feature. This loads the file of definitions if it +hasn't been loaded already. + + To require the presence of a feature, call `require' with the +feature name as argument. `require' looks in the global variable +`features' to see whether the desired feature has been provided +already. If not, it loads the feature from the appropriate file. This +file should call `provide' at the top level to add the feature to +`features'; if it fails to do so, `require' signals an error. + + Features are normally named after the files that provide them, so +that `require' need not be given the file name. + + For example, in `emacs/lisp/prolog.el', the definition for +`run-prolog' includes the following code: + + (defun run-prolog () + "Run an inferior Prolog process, input and output via buffer *prolog*." + (interactive) + (require 'comint) + (switch-to-buffer (make-comint "prolog" prolog-program-name)) + (inferior-prolog-mode)) + +The expression `(require 'comint)' loads the file `comint.el' if it has +not yet been loaded. This ensures that `make-comint' is defined. + + The `comint.el' file contains the following top-level expression: + + (provide 'comint) + +This adds `comint' to the global `features' list, so that `(require +'comint)' will henceforth know that nothing needs to be done. + + When `require' is used at top level in a file, it takes effect when +you byte-compile that file (*note Byte Compilation::.) as well as when +you load it. This is in case the required package contains macros that +the byte compiler must know about. + + Although top-level calls to `require' are evaluated during byte +compilation, `provide' calls are not. Therefore, you can ensure that a +file of definitions is loaded before it is byte-compiled by including a +`provide' followed by a `require' for the same feature, as in the +following example. + + (provide 'my-feature) ; Ignored by byte compiler, + ; evaluated by `load'. + (require 'my-feature) ; Evaluated by byte compiler. + +The compiler ignores the `provide', then processes the `require' by +loading the file in question. Loading the file does execute the +`provide' call, so the subsequent `require' call does nothing while +loading. + + - Function: provide FEATURE + This function announces that FEATURE is now loaded, or being + loaded, into the current XEmacs session. This means that the + facilities associated with FEATURE are or will be available for + other Lisp programs. + + The direct effect of calling `provide' is to add FEATURE to the + front of the list `features' if it is not already in the list. + The argument FEATURE must be a symbol. `provide' returns FEATURE. + + features + => (bar bish) + + (provide 'foo) + => foo + features + => (foo bar bish) + + When a file is loaded to satisfy an autoload, and it stops due to + an error in the evaluating its contents, any function definitions + or `provide' calls that occurred during the load are undone. + *Note Autoload::. + + - Function: require FEATURE &optional FILENAME + This function checks whether FEATURE is present in the current + XEmacs session (using `(featurep FEATURE)'; see below). If it is + not, then `require' loads FILENAME with `load'. If FILENAME is + not supplied, then the name of the symbol FEATURE is used as the + file name to load. + + If loading the file fails to provide FEATURE, `require' signals an + error, `Required feature FEATURE was not provided'. + + - Function: featurep FEXP + This function returns `t' if feature FEXP is present in this + Emacs. Use this to conditionalize execution of lisp code based on + the presence or absence of emacs or environment extensions. + + FEXP can be a symbol, a number, or a list. + + If FEXP is a symbol, it is looked up in the `features' variable, + and `t' is returned if it is found, `nil' otherwise. + + If FEXP is a number, the function returns `t' if this Emacs has an + equal or greater number than `fexp', `nil' otherwise. Note that + minor Emacs version is expected to be 2 decimal places wide, so + `(featurep 20.4)' will return `nil' on XEmacs 20.4--you must write + `(featurep 20.04)', unless you wish to match for XEmacs 20.40. + + If FEXP is a list whose car is the symbol `and', the function + returns `t' if all the features in its cdr are present, `nil' + otherwise. + + If FEXP is a list whose car is the symbol `or', the function + returns `t' if any the features in its cdr are present, `nil' + otherwise. + + If FEXP is a list whose car is the symbol `not', the function + returns `t' if the feature is not present, `nil' otherwise. + + Examples: + + (featurep 'xemacs) + => ; t on XEmacs. + + (featurep '(and xemacs gnus)) + => ; t on XEmacs with Gnus loaded. + + (featurep '(or tty-frames (and emacs 19.30))) + => ; t if this Emacs supports TTY frames. + + (featurep '(or (and xemacs 19.15) (and emacs 19.34))) + => ; t on XEmacs 19.15 and later, or on + ; FSF Emacs 19.34 and later. + + *Please 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 `'. + + - Variable: features + The value of this variable is a list of symbols that are the + features loaded in the current XEmacs session. Each symbol was + put in this list with a call to `provide'. The order of the + elements in the `features' list is not significant. + + +File: lispref.info, Node: Unloading, Next: Hooks for Loading, Prev: Named Features, Up: Loading + +Unloading +========= + + You can discard the functions and variables loaded by a library to +reclaim memory for other Lisp objects. To do this, use the function +`unload-feature': + + - Command: unload-feature FEATURE &optional FORCE + This command unloads the library that provided feature FEATURE. + It undefines all functions, macros, and variables defined in that + library with `defconst', `defvar', `defun', `defmacro', + `defsubst', `definf-function' and `defalias'. It then restores + any autoloads formerly associated with those symbols. (Loading + saves these in the `autoload' property of the symbol.) + + Ordinarily, `unload-feature' refuses to unload a library on which + other loaded libraries depend. (A library A depends on library B + if A contains a `require' for B.) If the optional argument FORCE + is non-`nil', dependencies are ignored and you can unload any + library. + + The `unload-feature' function is written in Lisp; its actions are +based on the variable `load-history'. + + - Variable: load-history + This variable's value is an alist connecting library names with the + names of functions and variables they define, the features they + provide, and the features they require. + + Each element is a list and describes one library. The CAR of the + list is the name of the library, as a string. The rest of the + list is composed of these kinds of objects: + + * Symbols that were defined by this library. + + * Lists of the form `(require . FEATURE)' indicating features + that were required. + + * Lists of the form `(provide . FEATURE)' indicating features + that were provided. + + The value of `load-history' may have one element whose CAR is + `nil'. This element describes definitions made with `eval-buffer' + on a buffer that is not visiting a file. + + The command `eval-region' updates `load-history', but does so by +adding the symbols defined to the element for the file being visited, +rather than replacing that element. + + +File: lispref.info, Node: Hooks for Loading, Prev: Unloading, Up: Loading + +Hooks for Loading +================= + + - Variable: after-load-alist + An alist of expressions to evaluate if and when particular + libraries are loaded. Each element looks like this: + + (FILENAME FORMS...) + + When `load' is run and the file-name argument is FILENAME, the + FORMS in the corresponding element are executed at the end of + loading. + + FILENAME must match exactly! Normally FILENAME is the name of a + library, with no directory specified, since that is how `load' is + normally called. An error in FORMS does not undo the load, but + does prevent execution of the rest of the FORMS. + + + +File: lispref.info, Node: Byte Compilation, Next: Debugging, Prev: Loading, Up: Top + +Byte Compilation +**************** + + XEmacs Lisp has a "compiler" that translates functions written in +Lisp into a special representation called "byte-code" that can be +executed more efficiently. The compiler replaces Lisp function +definitions with byte-code. When a byte-coded function is called, its +definition is evaluated by the "byte-code interpreter". + + Because the byte-compiled code is evaluated by the byte-code +interpreter, instead of being executed directly by the machine's +hardware (as true compiled code is), byte-code is completely +transportable from machine to machine without recompilation. It is not, +however, as fast as true compiled code. + + In general, any version of Emacs can run byte-compiled code produced +by recent earlier versions of Emacs, but the reverse is not true. In +particular, if you compile a program with XEmacs 20, the compiled code +may not run in earlier versions. + + The first time a compiled-function object is executed, the byte-code +instructions are validated and the byte-code is further optimized. An +`invalid-byte-code' error is signaled if the byte-code is invalid, for +example if it contains invalid opcodes. This usually means a bug in +the byte compiler. + + *Note Compilation Errors::, for how to investigate errors occurring +in byte compilation. + +* Menu: + +* Speed of Byte-Code:: An example of speedup from byte compilation. +* Compilation Functions:: Byte compilation functions. +* Docs and Compilation:: Dynamic loading of documentation strings. +* Dynamic Loading:: Dynamic loading of individual functions. +* Eval During Compile:: Code to be evaluated when you compile. +* Compiled-Function Objects:: The data type used for byte-compiled functions. +* Disassembly:: Disassembling byte-code; how to read byte-code. + + +File: lispref.info, Node: Speed of Byte-Code, Next: Compilation Functions, Up: Byte Compilation + +Performance of Byte-Compiled Code +================================= + + A byte-compiled function is not as efficient as a primitive function +written in C, but runs much faster than the version written in Lisp. +Here is an example: + + (defun silly-loop (n) + "Return time before and after N iterations of a loop." + (let ((t1 (current-time-string))) + (while (> (setq n (1- n)) + 0)) + (list t1 (current-time-string)))) + => silly-loop + + (silly-loop 5000000) + => ("Mon Sep 14 15:51:49 1998" + "Mon Sep 14 15:52:07 1998") ; 18 seconds + + (byte-compile 'silly-loop) + => # + + (silly-loop 5000000) + => ("Mon Sep 14 15:53:43 1998" + "Mon Sep 14 15:53:49 1998") ; 6 seconds + + In this example, the interpreted code required 18 seconds to run, +whereas the byte-compiled code required 6 seconds. These results are +representative, but actual results will vary greatly. + + +File: lispref.info, Node: Compilation Functions, Next: Docs and Compilation, Prev: Speed of Byte-Code, Up: Byte Compilation + +The Compilation Functions +========================= + + You can byte-compile an individual function or macro definition with +the `byte-compile' function. You can compile a whole file with +`byte-compile-file', or several files with `byte-recompile-directory' +or `batch-byte-compile'. + + When you run the byte compiler, you may get warnings in a buffer +called `*Compile-Log*'. These report things in your program that +suggest a problem but are not necessarily erroneous. + + Be careful when byte-compiling code that uses macros. Macro calls +are expanded when they are compiled, so the macros must already be +defined for proper compilation. For more details, see *Note Compiling +Macros::. + + Normally, compiling a file does not evaluate the file's contents or +load the file. But it does execute any `require' calls at top level in +the file. One way to ensure that necessary macro definitions are +available during compilation is to `require' the file that defines them +(*note Named Features::.). To avoid loading the macro definition files +when someone *runs* the compiled program, write `eval-when-compile' +around the `require' calls (*note Eval During Compile::.). + + - Function: byte-compile SYMBOL + This function byte-compiles the function definition of SYMBOL, + replacing the previous definition with the compiled one. The + function definition of SYMBOL must be the actual code for the + function; i.e., the compiler does not follow indirection to + another symbol. `byte-compile' returns the new, compiled + definition of SYMBOL. + + If SYMBOL's definition is a compiled-function object, + `byte-compile' does nothing and returns `nil'. Lisp records only + one function definition for any symbol, and if that is already + compiled, non-compiled code is not available anywhere. So there + is no way to "compile the same definition again." + + (defun factorial (integer) + "Compute factorial of INTEGER." + (if (= 1 integer) 1 + (* integer (factorial (1- integer))))) + => factorial + + (byte-compile 'factorial) + => # + + The result is a compiled-function object. The string it contains + is the actual byte-code; each character in it is an instruction or + an operand of an instruction. The vector contains all the + constants, variable names and function names used by the function, + except for certain primitives that are coded as special + instructions. + + - Command: compile-defun &optional ARG + This command reads the defun containing point, compiles it, and + evaluates the result. If you use this on a defun that is actually + a function definition, the effect is to install a compiled version + of that function. + + If ARG is non-`nil', the result is inserted in the current buffer + after the form; otherwise, it is printed in the minibuffer. + + - Command: byte-compile-file FILENAME &optional LOAD + This function compiles a file of Lisp code named FILENAME into a + file of byte-code. The output file's name is made by appending + `c' to the end of FILENAME. + + If `load' is non-`nil', the file is loaded after having been + compiled. + + Compilation works by reading the input file one form at a time. + If it is a definition of a function or macro, the compiled + function or macro definition is written out. Other forms are + batched together, then each batch is compiled, and written so that + its compiled code will be executed when the file is read. All + comments are discarded when the input file is read. + + This command returns `t'. When called interactively, it prompts + for the file name. + + % ls -l push* + -rw-r--r-- 1 lewis 791 Oct 5 20:31 push.el + + (byte-compile-file "~/emacs/push.el") + => t + + % ls -l push* + -rw-r--r-- 1 lewis 791 Oct 5 20:31 push.el + -rw-r--r-- 1 lewis 638 Oct 8 20:25 push.elc + + - Command: byte-recompile-directory DIRECTORY &optional FLAG + This function recompiles every `.el' file in DIRECTORY that needs + recompilation. A file needs recompilation if a `.elc' file exists + but is older than the `.el' file. + + When a `.el' file has no corresponding `.elc' file, then FLAG says + what to do. If it is `nil', these files are ignored. If it is + non-`nil', the user is asked whether to compile each such file. + + The return value of this command is unpredictable. + + - Function: batch-byte-compile + This function runs `byte-compile-file' on files specified on the + command line. This function must be used only in a batch + execution of Emacs, as it kills Emacs on completion. An error in + one file does not prevent processing of subsequent files. (The + file that gets the error will not, of course, produce any compiled + code.) + + % emacs -batch -f batch-byte-compile *.el + + - Function: batch-byte-recompile-directory + This function is similar to `batch-byte-compile' but runs the + command `byte-recompile-directory' on the files remaining on the + command line. + + - Variable: byte-recompile-directory-ignore-errors-p + If non-`nil', this specifies that `byte-recompile-directory' will + continue compiling even when an error occurs in a file. This is + normally `nil', but is bound to `t' by + `batch-byte-recompile-directory'. + + - Function: byte-code INSTRUCTIONS CONSTANTS STACK-SIZE + This function actually interprets byte-code. Don't call this + function yourself. Only the byte compiler knows how to generate + valid calls to this function. + + In newer Emacs versions (19 and up), byte code is usually executed + as part of a compiled-function object, and only rarely due to an + explicit call to `byte-code'. A byte-compiled function was once + actually defined with a body that calls `byte-code', but in recent + versions of Emacs `byte-code' is only used to run isolated + fragments of lisp code without an associated argument list. + + +File: lispref.info, Node: Docs and Compilation, Next: Dynamic Loading, Prev: Compilation Functions, Up: Byte Compilation + +Documentation Strings and Compilation +===================================== + + Functions and variables loaded from a byte-compiled file access their +documentation strings dynamically from the file whenever needed. This +saves space within Emacs, and makes loading faster because the +documentation strings themselves need not be processed while loading the +file. Actual access to the documentation strings becomes slower as a +result, but normally not enough to bother users. + + Dynamic access to documentation strings does have drawbacks: + + * If you delete or move the compiled file after loading it, Emacs + can no longer access the documentation strings for the functions + and variables in the file. + + * If you alter the compiled file (such as by compiling a new + version), then further access to documentation strings in this + file will give nonsense results. + + If your site installs Emacs following the usual procedures, these +problems will never normally occur. Installing a new version uses a new +directory with a different name; as long as the old version remains +installed, its files will remain unmodified in the places where they are +expected to be. + + However, if you have built Emacs yourself and use it from the +directory where you built it, you will experience this problem +occasionally if you edit and recompile Lisp files. When it happens, you +can cure the problem by reloading the file after recompiling it. + + Versions of Emacs up to and including XEmacs 19.14 and FSF Emacs +19.28 do not support the dynamic docstrings feature, and so will not be +able to load bytecode created by more recent Emacs versions. You can +turn off the dynamic docstring feature by setting +`byte-compile-dynamic-docstrings' to `nil'. Once this is done, you can +compile files that will load into older Emacs versions. You can do +this globally, or for one source file by specifying a file-local +binding for the variable. Here's one way to do that: + + -*-byte-compile-dynamic-docstrings: nil;-*- + + - Variable: byte-compile-dynamic-docstrings + If this is non-`nil', the byte compiler generates compiled files + that are set up for dynamic loading of documentation strings. + + The dynamic documentation string feature writes compiled files that +use a special Lisp reader construct, `#@COUNT'. This construct skips +the next COUNT characters. It also uses the `#$' construct, which +stands for "the name of this file, as a string." It is best not to use +these constructs in Lisp source files. + + +File: lispref.info, Node: Dynamic Loading, Next: Eval During Compile, Prev: Docs and Compilation, Up: Byte Compilation + +Dynamic Loading of Individual Functions +======================================= + + When you compile a file, you can optionally enable the "dynamic +function loading" feature (also known as "lazy loading"). With dynamic +function loading, loading the file doesn't fully read the function +definitions in the file. Instead, each function definition contains a +place-holder which refers to the file. The first time each function is +called, it reads the full definition from the file, to replace the +place-holder. + + The advantage of dynamic function loading is that loading the file +becomes much faster. This is a good thing for a file which contains +many separate commands, provided that using one of them does not imply +you will soon (or ever) use the rest. A specialized mode which provides +many keyboard commands often has that usage pattern: a user may invoke +the mode, but use only a few of the commands it provides. + + The dynamic loading feature has certain disadvantages: + + * If you delete or move the compiled file after loading it, Emacs + can no longer load the remaining function definitions not already + loaded. + + * If you alter the compiled file (such as by compiling a new + version), then trying to load any function not already loaded will + get nonsense results. + + If you compile a new version of the file, the best thing to do is +immediately load the new compiled file. That will prevent any future +problems. + + The byte compiler uses the dynamic function loading feature if the +variable `byte-compile-dynamic' is non-`nil' at compilation time. Do +not set this variable globally, since dynamic loading is desirable only +for certain files. Instead, enable the feature for specific source +files with file-local variable bindings, like this: + + -*-byte-compile-dynamic: t;-*- + + - Variable: byte-compile-dynamic + If this is non-`nil', the byte compiler generates compiled files + that are set up for dynamic function loading. + + - Function: fetch-bytecode FUNCTION + This immediately finishes loading the definition of FUNCTION from + its byte-compiled file, if it is not fully loaded already. The + argument FUNCTION may be a compiled-function object or a function + name. + + +File: lispref.info, Node: Eval During Compile, Next: Compiled-Function Objects, Prev: Dynamic Loading, Up: Byte Compilation + +Evaluation During Compilation +============================= + + These features permit you to write code to be evaluated during +compilation of a program. + + - Special Form: eval-and-compile BODY + This form marks BODY to be evaluated both when you compile the + containing code and when you run it (whether compiled or not). + + You can get a similar result by putting BODY in a separate file + and referring to that file with `require'. Using `require' is + preferable if there is a substantial amount of code to be executed + in this way. + + - Special Form: eval-when-compile BODY + This form marks BODY to be evaluated at compile time and not when + the compiled program is loaded. The result of evaluation by the + compiler becomes a constant which appears in the compiled program. + When the program is interpreted, not compiled at all, BODY is + evaluated normally. + + At top level, this is analogous to the Common Lisp idiom + `(eval-when (compile eval) ...)'. Elsewhere, the Common Lisp `#.' + reader macro (but not when interpreting) is closer to what + `eval-when-compile' does. + + +File: lispref.info, Node: Compiled-Function Objects, Next: Disassembly, Prev: Eval During Compile, Up: Byte Compilation + +Compiled-Function Objects +========================= + + Byte-compiled functions have a special data type: they are +"compiled-function objects". The evaluator handles this data type +specially when it appears as a function to be called. + + The printed representation for a compiled-function object normally +begins with `#'. However, if the +variable `print-readably' is non-`nil', the object is printed beginning +with `#[' and ending with `]'. This representation can be read +directly by the Lisp reader, and is used in byte-compiled files (those +ending in `.elc'). + + In Emacs version 18, there was no compiled-function object data type; +compiled functions used the function `byte-code' to run the byte code. + + A compiled-function object has a number of different attributes. +They are: + +ARGLIST + The list of argument symbols. + +INSTRUCTIONS + The string containing the byte-code instructions. + +CONSTANTS + The vector of Lisp objects referenced by the byte code. These + include symbols used as function names and variable names. + +STACK-SIZE + The maximum stack size this function needs. + +DOC-STRING + The documentation string (if any); otherwise, `nil'. The value may + be a number or a list, in case the documentation string is stored + in a file. Use the function `documentation' to get the real + documentation string (*note Accessing Documentation::.). + +INTERACTIVE + The interactive spec (if any). This can be a string or a Lisp + expression. It is `nil' for a function that isn't interactive. + +DOMAIN + The domain (if any). This is only meaningful if I18N3 + (message-translation) support was compiled into XEmacs. This is a + string defining which domain to find the translation for the + documentation string and interactive prompt. *Note Domain + Specification::. + + Here's an example of a compiled-function object, in printed +representation. It is the definition of the command `backward-sexp'. + + (symbol-function 'backward-sexp) + => # + + The primitive way to create a compiled-function object is with +`make-byte-code': + + - Function: make-byte-code ARGLIST INSTRUCTIONS CONSTANTS STACK-SIZE + &optional DOC-STRING INTERACTIVE + This function constructs and returns a compiled-function object + with the specified attributes. + + *Please note:* Unlike all other Emacs-lisp functions, calling this + with five arguments is *not* the same as calling it with six + arguments, the last of which is `nil'. If the INTERACTIVE arg is + specified as `nil', then that means that this function was defined + with `(interactive)'. If the arg is not specified, then that means + the function is not interactive. This is terrible behavior which + is retained for compatibility with old `.elc' files which expected + these semantics. + + You should not try to come up with the elements for a +compiled-function object yourself, because if they are inconsistent, +XEmacs may crash when you call the function. Always leave it to the +byte compiler to create these objects; it makes the elements consistent +(we hope). + + The following primitives are provided for accessing the elements of +a compiled-function object. + + - Function: compiled-function-arglist FUNCTION + This function returns the argument list of compiled-function object + FUNCTION. + + - Function: compiled-function-instructions FUNCTION + This function returns a string describing the byte-code + instructions of compiled-function object FUNCTION. + + - Function: compiled-function-constants FUNCTION + This function returns the vector of Lisp objects referenced by + compiled-function object FUNCTION. + + - Function: compiled-function-stack-size FUNCTION + This function returns the maximum stack size needed by + compiled-function object FUNCTION. + + - Function: compiled-function-doc-string FUNCTION + This function returns the doc string of compiled-function object + FUNCTION, if available. + + - Function: compiled-function-interactive FUNCTION + This function returns the interactive spec of compiled-function + object FUNCTION, if any. The return value is `nil' or a + two-element list, the first element of which is the symbol + `interactive' and the second element is the interactive spec (a + string or Lisp form). + + - Function: compiled-function-domain FUNCTION + This function returns the domain of compiled-function object + FUNCTION, if any. The result will be a string or `nil'. *Note + Domain Specification::. + + +File: lispref.info, Node: Disassembly, Prev: Compiled-Function Objects, Up: Byte Compilation + +Disassembled Byte-Code +====================== + + People do not write byte-code; that job is left to the byte compiler. +But we provide a disassembler to satisfy a cat-like curiosity. The +disassembler converts the byte-compiled code into humanly readable form. + + The byte-code interpreter is implemented as a simple stack machine. +It pushes values onto a stack of its own, then pops them off to use them +in calculations whose results are themselves pushed back on the stack. +When a byte-code function returns, it pops a value off the stack and +returns it as the value of the function. + + In addition to the stack, byte-code functions can use, bind, and set +ordinary Lisp variables, by transferring values between variables and +the stack. + + - Command: disassemble OBJECT &optional STREAM + This function prints the disassembled code for OBJECT. If STREAM + is supplied, then output goes there. Otherwise, the disassembled + code is printed to the stream `standard-output'. The argument + OBJECT can be a function name or a lambda expression. + + As a special exception, if this function is used interactively, it + outputs to a buffer named `*Disassemble*'. + + Here are two examples of using the `disassemble' function. We have +added explanatory comments to help you relate the byte-code to the Lisp +source; these do not appear in the output of `disassemble'. + + (defun factorial (integer) + "Compute factorial of an integer." + (if (= 1 integer) 1 + (* integer (factorial (1- integer))))) + => factorial + + (factorial 4) + => 24 + + (disassemble 'factorial) + -| byte-code for factorial: + doc: Compute factorial of an integer. + args: (integer) + + 0 varref integer ; Get value of `integer' + ; from the environment + ; and push the value + ; onto the stack. + + 1 constant 1 ; Push 1 onto stack. + + 2 eqlsign ; Pop top two values off stack, + ; compare them, + ; and push result onto stack. + + 3 goto-if-nil 1 ; Pop and test top of stack; + ; if `nil', + ; go to label 1 (which is also byte 7), + ; else continue. + + 5 constant 1 ; Push 1 onto top of stack. + + 6 return ; Return the top element + ; of the stack. + + 7:1 varref integer ; Push value of `integer' onto stack. + + 8 constant factorial ; Push `factorial' onto stack. + + 9 varref integer ; Push value of `integer' onto stack. + + 10 sub1 ; Pop `integer', decrement value, + ; push new value onto stack. + + ; Stack now contains: + ; - decremented value of `integer' + ; - `factorial' + ; - value of `integer' + + 15 call 1 ; Call function `factorial' using + ; the first (i.e., the top) element + ; of the stack as the argument; + ; push returned value onto stack. + + ; Stack now contains: + ; - result of recursive + ; call to `factorial' + ; - value of `integer' + + 12 mult ; Pop top two values off the stack, + ; multiply them, + ; pushing the result onto the stack. + + 13 return ; Return the top element + ; of the stack. + => nil + + The `silly-loop' function is somewhat more complex: + + (defun silly-loop (n) + "Return time before and after N iterations of a loop." + (let ((t1 (current-time-string))) + (while (> (setq n (1- n)) + 0)) + (list t1 (current-time-string)))) + => silly-loop + + (disassemble 'silly-loop) + -| byte-code for silly-loop: + doc: Return time before and after N iterations of a loop. + args: (n) + + 0 constant current-time-string ; Push + ; `current-time-string' + ; onto top of stack. + + 1 call 0 ; Call `current-time-string' + ; with no argument, + ; pushing result onto stack. + + 2 varbind t1 ; Pop stack and bind `t1' + ; to popped value. + + 3:1 varref n ; Get value of `n' from + ; the environment and push + ; the value onto the stack. + + 4 sub1 ; Subtract 1 from top of stack. + + 5 dup ; Duplicate the top of the stack; + ; i.e., copy the top of + ; the stack and push the + ; copy onto the stack. + + 6 varset n ; Pop the top of the stack, + ; and set `n' to the value. + + ; In effect, the sequence `dup varset' + ; copies the top of the stack + ; into the value of `n' + ; without popping it. + + 7 constant 0 ; Push 0 onto stack. + + 8 gtr ; Pop top two values off stack, + ; test if N is greater than 0 + ; and push result onto stack. + + 9 goto-if-not-nil 1 ; Goto label 1 (byte 3) if `n' <= 0 + ; (this exits the while loop). + ; else pop top of stack + ; and continue + + 11 varref t1 ; Push value of `t1' onto stack. + + 12 constant current-time-string ; Push + ; `current-time-string' + ; onto top of stack. + + 13 call 0 ; Call `current-time-string' again. + + 14 unbind 1 ; Unbind `t1' in local environment. + + 15 list2 ; Pop top two elements off stack, + ; create a list of them, + ; and push list onto stack. + + 16 return ; Return the top element of the stack. + + => nil + + +File: lispref.info, Node: Debugging, Next: Read and Print, Prev: Byte Compilation, Up: Top + +Debugging Lisp Programs +*********************** + + There are three ways to investigate a problem in an XEmacs Lisp +program, depending on what you are doing with the program when the +problem appears. + + * If the problem occurs when you run the program, you can use a Lisp + debugger (either the default debugger or Edebug) to investigate + what is happening during execution. + + * If the problem is syntactic, so that Lisp cannot even read the + program, you can use the XEmacs facilities for editing Lisp to + localize it. + + * If the problem occurs when trying to compile the program with the + byte compiler, you need to know how to examine the compiler's + input buffer. + +* Menu: + +* Debugger:: How the XEmacs Lisp debugger is implemented. +* Syntax Errors:: How to find syntax errors. +* Compilation Errors:: How to find errors that show up in byte compilation. +* Edebug:: A source-level XEmacs Lisp debugger. + + Another useful debugging tool is the dribble file. When a dribble +file is open, XEmacs copies all keyboard input characters to that file. +Afterward, you can examine the file to find out what input was used. +*Note Terminal Input::. + + For debugging problems in terminal descriptions, the +`open-termscript' function can be useful. *Note Terminal Output::. + + +File: lispref.info, Node: Debugger, Next: Syntax Errors, Up: Debugging + +The Lisp Debugger +================= + + The "Lisp debugger" provides the ability to suspend evaluation of a +form. While evaluation is suspended (a state that is commonly known as +a "break"), you may examine the run time stack, examine the values of +local or global variables, or change those values. Since a break is a +recursive edit, all the usual editing facilities of XEmacs are +available; you can even run programs that will enter the debugger +recursively. *Note Recursive Editing::. + +* Menu: + +* Error Debugging:: Entering the debugger when an error happens. +* Infinite Loops:: Stopping and debugging a program that doesn't exit. +* Function Debugging:: Entering it when a certain function is called. +* Explicit Debug:: Entering it at a certain point in the program. +* Using Debugger:: What the debugger does; what you see while in it. +* Debugger Commands:: Commands used while in the debugger. +* Invoking the Debugger:: How to call the function `debug'. +* Internals of Debugger:: Subroutines of the debugger, and global variables. + diff --git a/info/lispref.info-13 b/info/lispref.info-13 new file mode 100644 index 0000000..c94556d --- /dev/null +++ b/info/lispref.info-13 @@ -0,0 +1,1181 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Error Debugging, Next: Infinite Loops, Up: Debugger + +Entering the Debugger on an Error +--------------------------------- + + The most important time to enter the debugger is when a Lisp error +happens. This allows you to investigate the immediate causes of the +error. + + However, entry to the debugger is not a normal consequence of an +error. Many commands frequently get Lisp errors when invoked in +inappropriate contexts (such as `C-f' at the end of the buffer) and +during ordinary editing it would be very unpleasant to enter the +debugger each time this happens. If you want errors to enter the +debugger, set the variable `debug-on-error' to non-`nil'. + + - User Option: debug-on-error + This variable determines whether the debugger is called when an + error is signaled and not handled. If `debug-on-error' is `t', all + errors call the debugger. If it is `nil', none call the debugger. + + The value can also be a list of error conditions that should call + the debugger. For example, if you set it to the list + `(void-variable)', then only errors about a variable that has no + value invoke the debugger. + + When this variable is non-`nil', Emacs does not catch errors that + happen in process filter functions and sentinels. Therefore, these + errors also can invoke the debugger. *Note Processes::. + + - User Option: 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 regular expressions. If the error has any of those + condition symbols, or if the error message matches any of the + regular expressions, then that error does not enter the debugger, + regardless of the value of `debug-on-error'. + + The normal value of this variable lists several errors that happen + often during editing but rarely result from bugs in Lisp programs. + + To debug an error that happens during loading of the `.emacs' file, +use the option `-debug-init', which binds `debug-on-error' to `t' while +`.emacs' is loaded and inhibits use of `condition-case' to catch init +file errors. + + If your `.emacs' file sets `debug-on-error', the effect may not last +past the end of loading `.emacs'. (This is an undesirable byproduct of +the code that implements the `-debug-init' command line option.) The +best way to make `.emacs' set `debug-on-error' permanently is with +`after-init-hook', like this: + + (add-hook 'after-init-hook + '(lambda () (setq debug-on-error t))) + + - User Option: debug-on-signal + This variable is similar to `debug-on-error' but breaks whenever + an error is signalled, regardless of whether it would be handled. + + +File: lispref.info, Node: Infinite Loops, Next: Function Debugging, Prev: Error Debugging, Up: Debugger + +Debugging Infinite Loops +------------------------ + + When a program loops infinitely and fails to return, your first +problem is to stop the loop. On most operating systems, you can do this +with `C-g', which causes quit. + + Ordinary quitting gives no information about why the program was +looping. To get more information, you can set the variable +`debug-on-quit' to non-`nil'. Quitting with `C-g' is not considered an +error, and `debug-on-error' has no effect on the handling of `C-g'. +Likewise, `debug-on-quit' has no effect on errors. + + Once you have the debugger running in the middle of the infinite +loop, you can proceed from the debugger using the stepping commands. +If you step through the entire loop, you will probably get enough +information to solve the problem. + + - User Option: debug-on-quit + This variable determines whether the debugger is called when `quit' + is signaled and not handled. If `debug-on-quit' is non-`nil', + then the debugger is called whenever you quit (that is, type + `C-g'). If `debug-on-quit' is `nil', then the debugger is not + called when you quit. *Note Quitting::. + + +File: lispref.info, Node: Function Debugging, Next: Explicit Debug, Prev: Infinite Loops, Up: Debugger + +Entering the Debugger on a Function Call +---------------------------------------- + + To investigate a problem that happens in the middle of a program, one +useful technique is to enter the debugger whenever a certain function is +called. You can do this to the function in which the problem occurs, +and then step through the function, or you can do this to a function +called shortly before the problem, step quickly over the call to that +function, and then step through its caller. + + - Command: debug-on-entry FUNCTION-NAME + This function requests FUNCTION-NAME to invoke the debugger each + time it is called. It works by inserting the form `(debug + 'debug)' into the function definition as the first form. + + Any function defined as Lisp code may be set to break on entry, + regardless of whether it is interpreted code or compiled code. If + the function is a command, it will enter the debugger when called + from Lisp and when called interactively (after the reading of the + arguments). You can't debug primitive functions (i.e., those + written in C) this way. + + When `debug-on-entry' is called interactively, it prompts for + FUNCTION-NAME in the minibuffer. + + If the function is already set up to invoke the debugger on entry, + `debug-on-entry' does nothing. + + *Please note:* if you redefine a function after using + `debug-on-entry' on it, the code to enter the debugger is lost. + + `debug-on-entry' returns FUNCTION-NAME. + + (defun fact (n) + (if (zerop n) 1 + (* n (fact (1- n))))) + => fact + (debug-on-entry 'fact) + => fact + (fact 3) + + ------ Buffer: *Backtrace* ------ + Entering: + * fact(3) + eval-region(4870 4878 t) + byte-code("...") + eval-last-sexp(nil) + (let ...) + eval-insert-last-sexp(nil) + * call-interactively(eval-insert-last-sexp) + ------ Buffer: *Backtrace* ------ + + (symbol-function 'fact) + => (lambda (n) + (debug (quote debug)) + (if (zerop n) 1 (* n (fact (1- n))))) + + - Command: cancel-debug-on-entry FUNCTION-NAME + This function undoes the effect of `debug-on-entry' on + FUNCTION-NAME. When called interactively, it prompts for + FUNCTION-NAME in the minibuffer. If FUNCTION-NAME is `nil' or the + empty string, it cancels debugging for all functions. + + If `cancel-debug-on-entry' is called more than once on the same + function, the second call does nothing. `cancel-debug-on-entry' + returns FUNCTION-NAME. + + +File: lispref.info, Node: Explicit Debug, Next: Using Debugger, Prev: Function Debugging, Up: Debugger + +Explicit Entry to the Debugger +------------------------------ + + You can cause the debugger to be called at a certain point in your +program by writing the expression `(debug)' at that point. To do this, +visit the source file, insert the text `(debug)' at the proper place, +and type `C-M-x'. Be sure to undo this insertion before you save the +file! + + The place where you insert `(debug)' must be a place where an +additional form can be evaluated and its value ignored. (If the value +of `(debug)' isn't ignored, it will alter the execution of the +program!) The most common suitable places are inside a `progn' or an +implicit `progn' (*note Sequencing::.). + + +File: lispref.info, Node: Using Debugger, Next: Debugger Commands, Prev: Explicit Debug, Up: Debugger + +Using the Debugger +------------------ + + When the debugger is entered, it displays the previously selected +buffer in one window and a buffer named `*Backtrace*' in another +window. The backtrace buffer contains one line for each level of Lisp +function execution currently going on. At the beginning of this buffer +is a message describing the reason that the debugger was invoked (such +as the error message and associated data, if it was invoked due to an +error). + + The backtrace buffer is read-only and uses a special major mode, +Debugger mode, in which letters are defined as debugger commands. The +usual XEmacs editing commands are available; thus, you can switch +windows to examine the buffer that was being edited at the time of the +error, switch buffers, visit files, or do any other sort of editing. +However, the debugger is a recursive editing level (*note Recursive +Editing::.) and it is wise to go back to the backtrace buffer and exit +the debugger (with the `q' command) when you are finished with it. +Exiting the debugger gets out of the recursive edit and kills the +backtrace buffer. + + The backtrace buffer shows you the functions that are executing and +their argument values. It also allows you to specify a stack frame by +moving point to the line describing that frame. (A stack frame is the +place where the Lisp interpreter records information about a particular +invocation of a function.) The frame whose line point is on is +considered the "current frame". Some of the debugger commands operate +on the current frame. + + The debugger itself must be run byte-compiled, since it makes +assumptions about how many stack frames are used for the debugger +itself. These assumptions are false if the debugger is running +interpreted. + + +File: lispref.info, Node: Debugger Commands, Next: Invoking the Debugger, Prev: Using Debugger, Up: Debugger + +Debugger Commands +----------------- + + Inside the debugger (in Debugger mode), these special commands are +available in addition to the usual cursor motion commands. (Keep in +mind that all the usual facilities of XEmacs, such as switching windows +or buffers, are still available.) + + The most important use of debugger commands is for stepping through +code, so that you can see how control flows. The debugger can step +through the control structures of an interpreted function, but cannot do +so in a byte-compiled function. If you would like to step through a +byte-compiled function, replace it with an interpreted definition of the +same function. (To do this, visit the source file for the function and +type `C-M-x' on its definition.) + + Here is a list of Debugger mode commands: + +`c' + Exit the debugger and continue execution. This resumes execution + of the program as if the debugger had never been entered (aside + from the effect of any variables or data structures you may have + changed while inside the debugger). + + Continuing when an error or quit was signalled will cause the + normal action of the signalling to take place. If you do not want + this to happen, but instead want the program execution to continue + as if the call to `signal' did not occur, use the `r' command. + +`d' + Continue execution, but enter the debugger the next time any Lisp + function is called. This allows you to step through the + subexpressions of an expression, seeing what values the + subexpressions compute, and what else they do. + + The stack frame made for the function call which enters the + debugger in this way will be flagged automatically so that the + debugger will be called again when the frame is exited. You can + use the `u' command to cancel this flag. + +`b' + Flag the current frame so that the debugger will be entered when + the frame is exited. Frames flagged in this way are marked with + stars in the backtrace buffer. + +`u' + Don't enter the debugger when the current frame is exited. This + cancels a `b' command on that frame. + +`e' + Read a Lisp expression in the minibuffer, evaluate it, and print + the value in the echo area. The debugger alters certain important + variables, and the current buffer, as part of its operation; `e' + temporarily restores their outside-the-debugger values so you can + examine them. This makes the debugger more transparent. By + contrast, `M-:' does nothing special in the debugger; it shows you + the variable values within the debugger. + +`q' + Terminate the program being debugged; return to top-level XEmacs + command execution. + + If the debugger was entered due to a `C-g' but you really want to + quit, and not debug, use the `q' command. + +`r' + Return a value from the debugger. The value is computed by + reading an expression with the minibuffer and evaluating it. + + The `r' command is useful when the debugger was invoked due to exit + from a Lisp call frame (as requested with `b'); then the value + specified in the `r' command is used as the value of that frame. + It is also useful if you call `debug' and use its return value. + + If the debugger was entered at the beginning of a function call, + `r' has the same effect as `c', and the specified return value + does not matter. + + If the debugger was entered through a call to `signal' (i.e. as a + result of an error or quit), then returning a value will cause the + call to `signal' itself to return, rather than throwing to + top-level or invoking a handler, as is normal. This allows you to + correct an error (e.g. the type of an argument was wrong) or + continue from a `debug-on-quit' as if it never happened. + + Note that some errors (e.g. any error signalled using the `error' + function, and many errors signalled from a primitive function) are + not continuable. If you return a value from them and continue + execution, then the error will immediately be signalled again. + Other errors (e.g. wrong-type-argument errors) will be continually + resignalled until the problem is corrected. + + +File: lispref.info, Node: Invoking the Debugger, Next: Internals of Debugger, Prev: Debugger Commands, Up: Debugger + +Invoking the Debugger +--------------------- + + Here we describe fully the function used to invoke the debugger. + + - Function: debug &rest DEBUGGER-ARGS + This function enters the debugger. It switches buffers to a buffer + named `*Backtrace*' (or `*Backtrace*<2>' if it is the second + recursive entry to the debugger, etc.), and fills it with + information about the stack of Lisp function calls. It then + enters a recursive edit, showing the backtrace buffer in Debugger + mode. + + The Debugger mode `c' and `r' commands exit the recursive edit; + then `debug' switches back to the previous buffer and returns to + whatever called `debug'. This is the only way the function + `debug' can return to its caller. + + If the first of the DEBUGGER-ARGS passed to `debug' is `nil' (or + if it is not one of the special values in the table below), then + `debug' displays the rest of its arguments at the top of the + `*Backtrace*' buffer. This mechanism is used to display a message + to the user. + + However, if the first argument passed to `debug' is one of the + following special values, then it has special significance. + Normally, these values are passed to `debug' only by the internals + of XEmacs and the debugger, and not by programmers calling `debug'. + + The special values are: + + `lambda' + A first argument of `lambda' means `debug' was called because + of entry to a function when `debug-on-next-call' was + non-`nil'. The debugger displays `Entering:' as a line of + text at the top of the buffer. + + `debug' + `debug' as first argument indicates a call to `debug' because + of entry to a function that was set to debug on entry. The + debugger displays `Entering:', just as in the `lambda' case. + It also marks the stack frame for that function so that it + will invoke the debugger when exited. + + `t' + When the first argument is `t', this indicates a call to + `debug' due to evaluation of a list form when + `debug-on-next-call' is non-`nil'. The debugger displays the + following as the top line in the buffer: + + Beginning evaluation of function call form: + + `exit' + When the first argument is `exit', it indicates the exit of a + stack frame previously marked to invoke the debugger on exit. + The second argument given to `debug' in this case is the + value being returned from the frame. The debugger displays + `Return value:' on the top line of the buffer, followed by + the value being returned. + + `error' + When the first argument is `error', the debugger indicates + that it is being entered because an error or `quit' was + signaled and not handled, by displaying `Signaling:' followed + by the error signaled and any arguments to `signal'. For + example, + + (let ((debug-on-error t)) + (/ 1 0)) + + ------ Buffer: *Backtrace* ------ + Signaling: (arith-error) + /(1 0) + ... + ------ Buffer: *Backtrace* ------ + + If an error was signaled, presumably the variable + `debug-on-error' is non-`nil'. If `quit' was signaled, then + presumably the variable `debug-on-quit' is non-`nil'. + + `nil' + Use `nil' as the first of the DEBUGGER-ARGS when you want to + enter the debugger explicitly. The rest of the DEBUGGER-ARGS + are printed on the top line of the buffer. You can use this + feature to display messages--for example, to remind yourself + of the conditions under which `debug' is called. + + +File: lispref.info, Node: Internals of Debugger, Prev: Invoking the Debugger, Up: Debugger + +Internals of the Debugger +------------------------- + + This section describes functions and variables used internally by the +debugger. + + - Variable: debugger + The value of this variable is the function to call to invoke the + debugger. Its value must be a function of any number of arguments + (or, more typically, the name of a function). Presumably this + function will enter some kind of debugger. The default value of + the variable is `debug'. + + The first argument that Lisp hands to the function indicates why it + was called. The convention for arguments is detailed in the + description of `debug'. + + - Command: backtrace &optional STREAM DETAILED + This function prints a trace of Lisp function calls currently + active. This is the function used by `debug' to fill up the + `*Backtrace*' buffer. It is written in C, since it must have + access to the stack to determine which function calls are active. + The return value is always `nil'. + + The backtrace is normally printed to `standard-output', but this + can be changed by specifying a value for STREAM. If DETAILED is + non-`nil', the backtrace also shows places where currently active + variable bindings, catches, condition-cases, and unwind-protects + were made as well as function calls. + + In the following example, a Lisp expression calls `backtrace' + explicitly. This prints the backtrace to the stream + `standard-output': in this case, to the buffer `backtrace-output'. + Each line of the backtrace represents one function call. The + line shows the values of the function's arguments if they are all + known. If they are still being computed, the line says so. The + arguments of special forms are elided. + + (with-output-to-temp-buffer "backtrace-output" + (let ((var 1)) + (save-excursion + (setq var (eval '(progn + (1+ var) + (list 'testing (backtrace)))))))) + + => nil + + ----------- Buffer: backtrace-output ------------ + backtrace() + (list ...computing arguments...) + (progn ...) + eval((progn (1+ var) (list (quote testing) (backtrace)))) + (setq ...) + (save-excursion ...) + (let ...) + (with-output-to-temp-buffer ...) + eval-region(1973 2142 #) + byte-code("... for eval-print-last-sexp ...") + eval-print-last-sexp(nil) + * call-interactively(eval-print-last-sexp) + ----------- Buffer: backtrace-output ------------ + + The character `*' indicates a frame whose debug-on-exit flag is + set. + + - Variable: debug-on-next-call + If this variable is non-`nil', it says to call the debugger before + the next `eval', `apply' or `funcall'. Entering the debugger sets + `debug-on-next-call' to `nil'. + + The `d' command in the debugger works by setting this variable. + + - Function: backtrace-debug LEVEL FLAG + This function sets the debug-on-exit flag of the stack frame LEVEL + levels down the stack, giving it the value FLAG. If FLAG is + non-`nil', this will cause the debugger to be entered when that + frame later exits. Even a nonlocal exit through that frame will + enter the debugger. + + This function is used only by the debugger. + + - Variable: command-debug-status + This variable records the debugging status of the current + interactive command. Each time a command is called interactively, + this variable is bound to `nil'. The debugger can set this + variable to leave information for future debugger invocations + during the same command. + + The advantage, for the debugger, of using this variable rather than + another global variable is that the data will never carry over to a + subsequent command invocation. + + - Function: backtrace-frame FRAME-NUMBER + The function `backtrace-frame' is intended for use in Lisp + debuggers. It returns information about what computation is + happening in the stack frame FRAME-NUMBER levels down. + + If that frame has not evaluated the arguments yet (or is a special + form), the value is `(nil FUNCTION ARG-FORMS...)'. + + If that frame has evaluated its arguments and called its function + already, the value is `(t FUNCTION ARG-VALUES...)'. + + In the return value, FUNCTION is whatever was supplied as the CAR + of the evaluated list, or a `lambda' expression in the case of a + macro call. If the function has a `&rest' argument, that is + represented as the tail of the list ARG-VALUES. + + If FRAME-NUMBER is out of range, `backtrace-frame' returns `nil'. + + +File: lispref.info, Node: Syntax Errors, Next: Compilation Errors, Prev: Debugger, Up: Debugging + +Debugging Invalid Lisp Syntax +============================= + + The Lisp reader reports invalid syntax, but cannot say where the real +problem is. For example, the error "End of file during parsing" in +evaluating an expression indicates an excess of open parentheses (or +square brackets). The reader detects this imbalance at the end of the +file, but it cannot figure out where the close parenthesis should have +been. Likewise, "Invalid read syntax: ")"" indicates an excess close +parenthesis or missing open parenthesis, but does not say where the +missing parenthesis belongs. How, then, to find what to change? + + If the problem is not simply an imbalance of parentheses, a useful +technique is to try `C-M-e' at the beginning of each defun, and see if +it goes to the place where that defun appears to end. If it does not, +there is a problem in that defun. + + However, unmatched parentheses are the most common syntax errors in +Lisp, and we can give further advice for those cases. + +* Menu: + +* Excess Open:: How to find a spurious open paren or missing close. +* Excess Close:: How to find a spurious close paren or missing open. + + +File: lispref.info, Node: Excess Open, Next: Excess Close, Up: Syntax Errors + +Excess Open Parentheses +----------------------- + + The first step is to find the defun that is unbalanced. If there is +an excess open parenthesis, the way to do this is to insert a close +parenthesis at the end of the file and type `C-M-b' (`backward-sexp'). +This will move you to the beginning of the defun that is unbalanced. +(Then type `C- C-_ C-u C-' to set the mark there, undo the +insertion of the close parenthesis, and finally return to the mark.) + + The next step is to determine precisely what is wrong. There is no +way to be sure of this except to study the program, but often the +existing indentation is a clue to where the parentheses should have +been. The easiest way to use this clue is to reindent with `C-M-q' and +see what moves. + + Before you do this, make sure the defun has enough close parentheses. +Otherwise, `C-M-q' will get an error, or will reindent all the rest of +the file until the end. So move to the end of the defun and insert a +close parenthesis there. Don't use `C-M-e' to move there, since that +too will fail to work until the defun is balanced. + + Now you can go to the beginning of the defun and type `C-M-q'. +Usually all the lines from a certain point to the end of the function +will shift to the right. There is probably a missing close parenthesis, +or a superfluous open parenthesis, near that point. (However, don't +assume this is true; study the code to make sure.) Once you have found +the discrepancy, undo the `C-M-q' with `C-_', since the old indentation +is probably appropriate to the intended parentheses. + + After you think you have fixed the problem, use `C-M-q' again. If +the old indentation actually fit the intended nesting of parentheses, +and you have put back those parentheses, `C-M-q' should not change +anything. + + +File: lispref.info, Node: Excess Close, Prev: Excess Open, Up: Syntax Errors + +Excess Close Parentheses +------------------------ + + To deal with an excess close parenthesis, first insert an open +parenthesis at the beginning of the file, back up over it, and type +`C-M-f' to find the end of the unbalanced defun. (Then type `C- +C-_ C-u C-' to set the mark there, undo the insertion of the open +parenthesis, and finally return to the mark.) + + Then find the actual matching close parenthesis by typing `C-M-f' at +the beginning of the defun. This will leave you somewhere short of the +place where the defun ought to end. It is possible that you will find +a spurious close parenthesis in that vicinity. + + If you don't see a problem at that point, the next thing to do is to +type `C-M-q' at the beginning of the defun. A range of lines will +probably shift left; if so, the missing open parenthesis or spurious +close parenthesis is probably near the first of those lines. (However, +don't assume this is true; study the code to make sure.) Once you have +found the discrepancy, undo the `C-M-q' with `C-_', since the old +indentation is probably appropriate to the intended parentheses. + + After you think you have fixed the problem, use `C-M-q' again. If +the old indentation actually fit the intended nesting of parentheses, +and you have put back those parentheses, `C-M-q' should not change +anything. + + +File: lispref.info, Node: Compilation Errors, Next: Edebug, Prev: Syntax Errors, Up: Debugging + +Debugging Problems in Compilation +================================= + + When an error happens during byte compilation, it is normally due to +invalid syntax in the program you are compiling. The compiler prints a +suitable error message in the `*Compile-Log*' buffer, and then stops. +The message may state a function name in which the error was found, or +it may not. Either way, here is how to find out where in the file the +error occurred. + + What you should do is switch to the buffer ` *Compiler Input*'. +(Note that the buffer name starts with a space, so it does not show up +in `M-x list-buffers'.) This buffer contains the program being +compiled, and point shows how far the byte compiler was able to read. + + If the error was due to invalid Lisp syntax, point shows exactly +where the invalid syntax was *detected*. The cause of the error is not +necessarily near by! Use the techniques in the previous section to find +the error. + + If the error was detected while compiling a form that had been read +successfully, then point is located at the end of the form. In this +case, this technique can't localize the error precisely, but can still +show you which function to check. + + +File: lispref.info, Node: Edebug, Prev: Compilation Errors, Up: Top + +Edebug +====== + + Edebug is a source-level debugger for XEmacs Lisp programs that +provides the following features: + + * Step through evaluation, stopping before and after each expression. + + * Set conditional or unconditional breakpoints, install embedded + breakpoints, or a global break event. + + * Trace slow or fast stopping briefly at each stop point, or each + breakpoint. + + * Display expression results and evaluate expressions as if outside + of Edebug. Interface with the custom printing package for + printing circular structures. + + * Automatically reevaluate a list of expressions and display their + results each time Edebug updates the display. + + * Output trace info on function enter and exit. + + * Errors stop before the source causing the error. + + * Display backtrace without Edebug calls. + + * Allow specification of argument evaluation for macros and defining + forms. + + * Provide rudimentary coverage testing and display of frequency + counts. + + The first three sections should tell you enough about Edebug to +enable you to use it. + +* Menu: + +* Using Edebug:: Introduction to use of Edebug. +* Instrumenting:: You must first instrument code. +* Edebug Execution Modes:: Execution modes, stopping more or less often. +* Jumping:: Commands to jump to a specified place. +* Edebug Misc:: Miscellaneous commands. +* Breakpoints:: Setting breakpoints to make the program stop. +* Trapping Errors:: trapping errors with Edebug. +* Edebug Views:: Views inside and outside of Edebug. +* Edebug Eval:: Evaluating expressions within Edebug. +* Eval List:: Automatic expression evaluation. +* Reading in Edebug:: Customization of reading. +* Printing in Edebug:: Customization of printing. +* Tracing:: How to produce tracing output. +* Coverage Testing:: How to test evaluation coverage. +* The Outside Context:: Data that Edebug saves and restores. +* Instrumenting Macro Calls:: Specifying how to handle macro calls. +* Edebug Options:: Option variables for customizing Edebug. + + +File: lispref.info, Node: Using Edebug, Next: Instrumenting, Up: Edebug + +Using Edebug +------------ + + To debug an XEmacs Lisp program with Edebug, you must first +"instrument" the Lisp code that you want to debug. If you want to just +try it now, load `edebug.el', move point into a definition and do `C-u +C-M-x' (`eval-defun' with a prefix argument). See *Note +Instrumenting:: for alternative ways to instrument code. + + Once a function is instrumented, any call to the function activates +Edebug. Activating Edebug may stop execution and let you step through +the function, or it may update the display and continue execution while +checking for debugging commands, depending on the selected Edebug +execution mode. The initial execution mode is `step', by default, +which does stop execution. *Note Edebug Execution Modes::. + + Within Edebug, you normally view an XEmacs buffer showing the source +of the Lisp function you are debugging. This is referred to as the +"source code buffer"--but note that it is not always the same buffer +depending on which function is currently being executed. + + An arrow at the left margin indicates the line where the function is +executing. Point initially shows where within the line the function is +executing, but you can move point yourself. + + If you instrument the definition of `fac' (shown below) and then +execute `(fac 3)', here is what you normally see. Point is at the +open-parenthesis before `if'. + + (defun fac (n) + =>-!-(if (< 0 n) + (* n (fac (1- n))) + 1)) + + The places within a function where Edebug can stop execution are +called "stop points". These occur both before and after each +subexpression that is a list, and also after each variable reference. +Here we show with periods the stop points found in the function `fac': + + (defun fac (n) + .(if .(< 0 n.). + .(* n. .(fac (1- n.).).). + 1).) + + While the source code buffer is selected, the special commands of +Edebug are available in it, in addition to the commands of XEmacs Lisp +mode. (The buffer is temporarily made read-only, however.) For +example, you can type the Edebug command to execute until the +next stop point. If you type once after entry to `fac', here is +the display you will see: + + (defun fac (n) + =>(if -!-(< 0 n) + (* n (fac (1- n))) + 1)) + + When Edebug stops execution after an expression, it displays the +expression's value in the echo area. + + Other frequently used commands are `b' to set a breakpoint at a stop +point, `g' to execute until a breakpoint is reached, and `q' to exit to +the top-level command loop. Type `?' to display a list of all Edebug +commands. + + +File: lispref.info, Node: Instrumenting, Next: Edebug Execution Modes, Prev: Using Edebug, Up: Edebug + +Instrumenting for Edebug +------------------------ + + In order to use Edebug to debug Lisp code, you must first +"instrument" the code. Instrumenting a form inserts additional code +into it which invokes Edebug at the proper places. Furthermore, if +Edebug detects a syntax error while instrumenting, point is left at the +erroneous code and an `invalid-read-syntax' error is signaled. + + Once you have loaded Edebug, the command `C-M-x' (`eval-defun') is +redefined so that when invoked with a prefix argument on a definition, +it instruments the definition before evaluating it. (The source code +itself is not modified.) If the variable `edebug-all-defs' is +non-`nil', that inverts the meaning of the prefix argument: then +`C-M-x' instruments the definition *unless* it has a prefix argument. +The default value of `edebug-all-defs' is `nil'. The command `M-x +edebug-all-defs' toggles the value of the variable `edebug-all-defs'. + + If `edebug-all-defs' is non-`nil', then the commands `eval-region', +`eval-current-buffer', and `eval-buffer' also instrument any +definitions they evaluate. Similarly, `edebug-all-forms' controls +whether `eval-region' should instrument *any* form, even non-defining +forms. This doesn't apply to loading or evaluations in the minibuffer. +The command `M-x edebug-all-forms' toggles this option. + + Another command, `M-x edebug-eval-top-level-form', is available to +instrument any top-level form regardless of the value of +`edebug-all-defs' or `edebug-all-forms'. + + Just before Edebug instruments any code, it calls any functions in +the variable `edebug-setup-hook' and resets its value to `nil'. You +could use this to load up Edebug specifications associated with a +package you are using but only when you also use Edebug. For example, +`my-specs.el' may be loaded automatically when you use `my-package' +with Edebug by including the following code in `my-package.el'. + + (add-hook 'edebug-setup-hook + (function (lambda () (require 'my-specs)))) + + While Edebug is active, the command `I' (`edebug-instrument-callee') +instruments the definition of the function or macro called by the list +form after point, if is not already instrumented. If the location of +the definition is not known to Edebug, this command cannot be used. +After loading Edebug, `eval-region' records the position of every +definition it evaluates, even if not instrumenting it. Also see the +command `i' (*Note Jumping::) which steps into the callee. + + Edebug knows how to instrument all the standard special forms, an +interactive form with an expression argument, anonymous lambda +expressions, and other defining forms. (Specifications for macros +defined by `cl.el' (version 2.03) are provided in `cl-specs.el'.) +Edebug cannot know what a user-defined macro will do with the arguments +of a macro call so you must tell it. See *Note Instrumenting Macro +Calls:: for the details. + + Note that a couple ways remain to evaluate expressions without +instrumenting them. Loading a file via the `load' subroutine does not +instrument expressions for Edebug. Evaluations in the minibuffer via +`eval-expression' (`M-ESC') are not instrumented. + + To remove instrumentation from a definition, simply reevaluate it +with one of the non-instrumenting commands, or reload the file. + + See *Note Edebug Eval:: for other evaluation functions available +inside of Edebug. + + +File: lispref.info, Node: Edebug Execution Modes, Next: Jumping, Prev: Instrumenting, Up: Edebug + +Edebug Execution Modes +---------------------- + + Edebug supports several execution modes for running the program you +are debugging. We call these alternatives "Edebug execution modes"; do +not confuse them with major or minor modes. The current Edebug +execution mode determines how Edebug displays the progress of the +evaluation, whether it stops at each stop point, or continues to the +next breakpoint, for example. + + Normally, you specify the Edebug execution mode by typing a command +to continue the program in a certain mode. Here is a table of these +commands. All except for `S' resume execution of the program, at least +for a certain distance. + +`S' + Stop: don't execute any more of the program for now, just wait for + more Edebug commands (`edebug-stop'). + +`' + Step: stop at the next stop point encountered (`edebug-step-mode'). + +`n' + Next: stop at the next stop point encountered after an expression + (`edebug-next-mode'). Also see `edebug-forward-sexp' in *Note + Edebug Misc::. + +`t' + Trace: pause one second at each Edebug stop point + (`edebug-trace-mode'). + +`T' + Rapid trace: update at each stop point, but don't actually pause + (`edebug-Trace-fast-mode'). + +`g' + Go: run until the next breakpoint (`edebug-go-mode'). *Note + Breakpoints::. + +`c' + Continue: pause for one second at each breakpoint, but don't stop + (`edebug-continue-mode'). + +`C' + Rapid continue: update at each breakpoint, but don't actually pause + (`edebug-Continue-fast-mode'). + +`G' + Go non-stop: ignore breakpoints (`edebug-Go-nonstop-mode'). You + can still stop the program by hitting any key. + + In general, the execution modes earlier in the above list run the +program more slowly or stop sooner. + + When you enter a new Edebug level, the initial execution mode comes +from the value of the variable `edebug-initial-mode'. By default, this +specifies `step' mode. Note that you may reenter the same Edebug level +several times if, for example, an instrumented function is called +several times from one command. + + While executing or tracing, you can interrupt the execution by typing +any Edebug command. Edebug stops the program at the next stop point and +then executes the command that you typed. For example, typing `t' +during execution switches to trace mode at the next stop point. You can +use `S' to stop execution without doing anything else. + + If your function happens to read input, a character you hit +intending to interrupt execution may be read by the function instead. +You can avoid such unintended results by paying attention to when your +program wants input. + + Keyboard macros containing Edebug commands do not work; when you exit +from Edebug, to resume the program, whether you are defining or +executing a keyboard macro is forgotten. Also, defining or executing a +keyboard macro outside of Edebug does not affect the command loop inside +Edebug. This is usually an advantage. But see +`edebug-continue-kbd-macro'. + + +File: lispref.info, Node: Jumping, Next: Edebug Misc, Prev: Edebug Execution Modes, Up: Edebug + +Jumping +------- + + Commands described here let you jump to a specified location. All, +except `i', use temporary breakpoints to establish the stop point and +then switch to `go' mode. Any other breakpoint reached before the +intended stop point will also stop execution. See *Note Breakpoints:: +for the details on breakpoints. + +`f' + Run the program forward over one expression + (`edebug-forward-sexp'). More precisely, set a temporary + breakpoint at the position that `C-M-f' would reach, then execute + in `go' mode so that the program will stop at breakpoints. + + With a prefix argument N, the temporary breakpoint is placed N + sexps beyond point. If the containing list ends before N more + elements, then the place to stop is after the containing + expression. + + Be careful that the position `C-M-f' finds is a place that the + program will really get to; this may not be true in a `cond', for + example. + + This command does `forward-sexp' starting at point rather than the + stop point. If you want to execute one expression from the + current stop point, type `w' first, to move point there. + +`o' + Continue "out of" an expression (`edebug-step-out'). It places a + temporary breakpoint at the end of the sexp containing point. + + If the containing sexp is a function definition itself, it + continues until just before the last sexp in the definition. If + that is where you are now, it returns from the function and then + stops. In other words, this command does not exit the currently + executing function unless you are positioned after the last sexp. + +`I' + Step into the function or macro after point after first ensuring + that it is instrumented. It does this by calling + `edebug-on-entry' and then switching to `go' mode. + + Although the automatic instrumentation is convenient, it is not + later automatically uninstrumented. + +`h' + Proceed to the stop point near where point is using a temporary + breakpoint (`edebug-goto-here'). + + All the commands in this section may fail to work as expected in case +of nonlocal exit, because a nonlocal exit can bypass the temporary +breakpoint where you expected the program to stop. + + +File: lispref.info, Node: Edebug Misc, Next: Breakpoints, Prev: Jumping, Up: Edebug + +Miscellaneous +------------- + + Some miscellaneous commands are described here. + +`?' + Display the help message for Edebug (`edebug-help'). + +`C-]' + Abort one level back to the previous command level + (`abort-recursive-edit'). + +`q' + Return to the top level editor command loop (`top-level'). This + exits all recursive editing levels, including all levels of Edebug + activity. However, instrumented code protected with + `unwind-protect' or `condition-case' forms may resume debugging. + +`Q' + Like `q' but don't stop even for protected code + (`top-level-nonstop'). + +`r' + Redisplay the most recently known expression result in the echo + area (`edebug-previous-result'). + +`d' + Display a backtrace, excluding Edebug's own functions for clarity + (`edebug-backtrace'). + + You cannot use debugger commands in the backtrace buffer in Edebug + as you would in the standard debugger. + + The backtrace buffer is killed automatically when you continue + execution. + + From the Edebug recursive edit, you may invoke commands that activate +Edebug again recursively. Any time Edebug is active, you can quit to +the top level with `q' or abort one recursive edit level with `C-]'. +You can display a backtrace of all the pending evaluations with `d'. + + +File: lispref.info, Node: Breakpoints, Next: Trapping Errors, Prev: Edebug Misc, Up: Edebug + +Breakpoints +----------- + + There are three more ways to stop execution once it has started: +breakpoints, the global break condition, and embedded breakpoints. + + While using Edebug, you can specify "breakpoints" in the program you +are testing: points where execution should stop. You can set a +breakpoint at any stop point, as defined in *Note Using Edebug::. For +setting and unsetting breakpoints, the stop point that is affected is +the first one at or after point in the source code buffer. Here are the +Edebug commands for breakpoints: + +`b' + Set a breakpoint at the stop point at or after point + (`edebug-set-breakpoint'). If you use a prefix argument, the + breakpoint is temporary (it turns off the first time it stops the + program). + +`u' + Unset the breakpoint (if any) at the stop point at or after the + current point (`edebug-unset-breakpoint'). + +`x CONDITION ' + Set a conditional breakpoint which stops the program only if + CONDITION evaluates to a non-`nil' value + (`edebug-set-conditional-breakpoint'). If you use a prefix + argument, the breakpoint is temporary (it turns off the first time + it stops the program). + +`B' + Move point to the next breakpoint in the definition + (`edebug-next-breakpoint'). + + While in Edebug, you can set a breakpoint with `b' and unset one +with `u'. First you must move point to a position at or before the +desired Edebug stop point, then hit the key to change the breakpoint. +Unsetting a breakpoint that has not been set does nothing. + + Reevaluating or reinstrumenting a definition clears all its +breakpoints. + + A "conditional breakpoint" tests a condition each time the program +gets there. To set a conditional breakpoint, use `x', and specify the +condition expression in the minibuffer. Setting a conditional +breakpoint at a stop point that already has a conditional breakpoint +puts the current condition expression in the minibuffer so you can edit +it. + + You can make both conditional and unconditional breakpoints +"temporary" by using a prefix arg to the command to set the breakpoint. +After breaking at a temporary breakpoint, it is automatically cleared. + + Edebug always stops or pauses at a breakpoint except when the Edebug +mode is `Go-nonstop'. In that mode, it ignores breakpoints entirely. + + To find out where your breakpoints are, use `B', which moves point +to the next breakpoint in the definition following point, or to the +first breakpoint if there are no following breakpoints. This command +does not continue execution--it just moves point in the buffer. + +* Menu: + +* Global Break Condition:: Breaking on an event. +* Embedded Breakpoints:: Embedding breakpoints in code. + + +File: lispref.info, Node: Global Break Condition, Next: Embedded Breakpoints, Up: Breakpoints + +Global Break Condition +...................... + + In contrast to breaking when execution reaches specified locations, +you can also cause a break when a certain event occurs. The "global +break condition" is a condition that is repeatedly evaluated at every +stop point. If it evaluates to a non-`nil' value, then execution is +stopped or paused depending on the execution mode, just like a +breakpoint. Any errors that might occur as a result of evaluating the +condition are ignored, as if the result were `nil'. + + You can set or edit the condition expression, stored in +`edebug-global-break-condition', using `X' +(`edebug-set-global-break-condition'). + + Using the global break condition is perhaps the fastest way to find +where in your code some event occurs, but since it is rather expensive +you should reset the condition to `nil' when not in use. + + +File: lispref.info, Node: Embedded Breakpoints, Prev: Global Break Condition, Up: Breakpoints + +Embedded Breakpoints +.................... + + Since all breakpoints in a definition are cleared each time you +reinstrument it, you might rather create an "embedded breakpoint" which +is simply a call to the function `edebug'. You can, of course, make +such a call conditional. For example, in the `fac' function, insert +the first line as shown below to stop when the argument reaches zero: + + (defun fac (n) + (if (= n 0) (edebug)) + (if (< 0 n) + (* n (fac (1- n))) + 1)) + + When the `fac' definition is instrumented and the function is +called, Edebug will stop before the call to `edebug'. Depending on the +execution mode, Edebug will stop or pause. + + However, if no instrumented code is being executed, calling `edebug' +will instead invoke `debug'. Calling `debug' will always invoke the +standard backtrace debugger. + diff --git a/info/lispref.info-14 b/info/lispref.info-14 new file mode 100644 index 0000000..fb2b043 --- /dev/null +++ b/info/lispref.info-14 @@ -0,0 +1,1177 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Trapping Errors, Next: Edebug Views, Prev: Breakpoints, Up: Edebug + +Trapping Errors +--------------- + + An error may be signaled by subroutines or XEmacs Lisp code. If a +signal is not handled by a `condition-case', this indicates an +unrecognized situation has occurred. If Edebug is not active when an +unhandled error is signaled, `debug' is run normally (if +`debug-on-error' is non-`nil'). But while Edebug is active, +`debug-on-error' and `debug-on-quit' are bound to `edebug-on-error' and +`edebug-on-quit', which are both `t' by default. Actually, if +`debug-on-error' already has a non-`nil' value, that value is still +used. + + It is best to change the values of `edebug-on-error' or +`edebug-on-quit' when Edebug is not active since their values won't be +used until the next time Edebug is invoked at a deeper command level. +If you only change `debug-on-error' or `debug-on-quit' while Edebug is +active, these changes will be forgotten when Edebug becomes inactive. +Furthermore, during Edebug's recursive edit, these variables are bound +to the values they had outside of Edebug. + + Edebug shows you the last stop point that it knew about before the +error was signaled. This may be the location of a call to a function +which was not instrumented, within which the error actually occurred. +For an unbound variable error, the last known stop point might be quite +distant from the offending variable. If the cause of the error is not +obvious at first, note that you can also get a full backtrace inside of +Edebug (see *Note Edebug Misc::). + + Edebug can also trap signals even if they are handled. If +`debug-on-error' is a list of signal names, Edebug will stop when any +of these errors are signaled. Edebug shows you the last known stop +point just as for unhandled errors. After you continue execution, the +error is signaled again (but without being caught by Edebug). Edebug +can only trap errors that are handled if they are signaled in Lisp code +(not subroutines) since it does so by temporarily replacing the +`signal' function. + + +File: lispref.info, Node: Edebug Views, Next: Edebug Eval, Prev: Trapping Errors, Up: Edebug + +Edebug Views +------------ + + The following Edebug commands let you view aspects of the buffer and +window status that obtained before entry to Edebug. + +`v' + View the outside window configuration (`edebug-view-outside'). + +`p' + Temporarily display the outside current buffer with point at its + outside position (`edebug-bounce-point'). If prefix arg is + supplied, sit for that many seconds instead. + +`w' + Move point back to the current stop point (`edebug-where') in the + source code buffer. Also, if you use this command in another + window displaying the same buffer, this window will be used + instead to display the buffer in the future. + +`W' + Toggle the `edebug-save-windows' variable which indicates whether + the outside window configuration is saved and restored + (`edebug-toggle-save-windows'). Also, each time it is toggled on, + make the outside window configuration the same as the current + window configuration. + + With a prefix argument, `edebug-toggle-save-windows' only toggles + saving and restoring of the selected window. To specify a window + that is not displaying the source code buffer, you must use + `C-xXW' from the global keymap. + + You can view the outside window configuration with `v' or just +bounce to the current point in the current buffer with `p', even if it +is not normally displayed. After moving point, you may wish to pop +back to the stop point with `w' from a source code buffer. + + By using `W' twice, Edebug again saves and restores the outside +window configuration, but to the current configuration. This is a +convenient way to, for example, add another buffer to be displayed +whenever Edebug is active. However, the automatic redisplay of +`*edebug*' and `*edebug-trace*' may conflict with the buffers you wish +to see unless you have enough windows open. + + +File: lispref.info, Node: Edebug Eval, Next: Eval List, Prev: Edebug Views, Up: Edebug + +Evaluation +---------- + + While within Edebug, you can evaluate expressions "as if" Edebug were +not running. Edebug tries to be invisible to the expression's +evaluation and printing. Evaluation of expressions that cause side +effects will work as expected except for things that Edebug explicitly +saves and restores. See *Note The Outside Context:: for details on this +process. Also see *Note Reading in Edebug:: and *Note Printing in +Edebug:: for topics related to evaluation. + +`e EXP ' + Evaluate expression EXP in the context outside of Edebug + (`edebug-eval-expression'). In other words, Edebug tries to avoid + altering the effect of EXP. + +`M- EXP ' + Evaluate expression EXP in the context of Edebug itself. + +`C-x C-e' + Evaluate the expression before point, in the context outside of + Edebug (`edebug-eval-last-sexp'). + + Edebug supports evaluation of expressions containing references to +lexically bound symbols created by the following constructs in `cl.el' +(version 2.03 or later): `lexical-let', `macrolet', and +`symbol-macrolet'. + + +File: lispref.info, Node: Eval List, Next: Reading in Edebug, Prev: Edebug Eval, Up: Edebug + +Evaluation List Buffer +---------------------- + + You can use the "evaluation list buffer", called `*edebug*', to +evaluate expressions interactively. You can also set up the +"evaluation list" of expressions to be evaluated automatically each +time Edebug updates the display. + +`E' + Switch to the evaluation list buffer `*edebug*' + (`edebug-visit-eval-list'). + + In the `*edebug*' buffer you can use the commands of Lisp +Interaction as well as these special commands: + +`LFD' + Evaluate the expression before point, in the outside context, and + insert the value in the buffer (`edebug-eval-print-last-sexp'). + +`C-x C-e' + Evaluate the expression before point, in the context outside of + Edebug (`edebug-eval-last-sexp'). + +`C-c C-u' + Build a new evaluation list from the first expression of each + group, reevaluate and redisplay (`edebug-update-eval-list'). + Groups are separated by comment lines. + +`C-c C-d' + Delete the evaluation list group that point is in + (`edebug-delete-eval-item'). + +`C-c C-w' + Switch back to the source code buffer at the current stop point + (`edebug-where'). + + You can evaluate expressions in the evaluation list window with +`LFD' or `C-x C-e', just as you would in `*scratch*'; but they are +evaluated in the context outside of Edebug. + + The expressions you enter interactively (and their results) are lost +when you continue execution unless you add them to the evaluation list +with `C-c C-u'. This command builds a new list from the first +expression of each "evaluation list group". Groups are separated by +comment lines. Be careful not to add expressions that execute +instrumented code otherwise an infinite loop will result. + + When the evaluation list is redisplayed, each expression is displayed +followed by the result of evaluating it, and a comment line. If an +error occurs during an evaluation, the error message is displayed in a +string as if it were the result. Therefore expressions that, for +example, use variables not currently valid do not interrupt your +debugging. + + Here is an example of what the evaluation list window looks like +after several expressions have been added to it: + + (current-buffer) + # + ;--------------------------------------------------------------- + (selected-window) + # + ;--------------------------------------------------------------- + (point) + 196 + ;--------------------------------------------------------------- + bad-var + "Symbol's value as variable is void: bad-var" + ;--------------------------------------------------------------- + (recursion-depth) + 0 + ;--------------------------------------------------------------- + this-command + eval-last-sexp + ;--------------------------------------------------------------- + + To delete a group, move point into it and type `C-c C-d', or simply +delete the text for the group and update the evaluation list with `C-c +C-u'. When you add a new group, be sure it is separated from its +neighbors by a comment line. + + After selecting `*edebug*', you can return to the source code buffer +with `C-c C-w'. The `*edebug*' buffer is killed when you continue +execution, and recreated next time it is needed. + + +File: lispref.info, Node: Reading in Edebug, Next: Printing in Edebug, Prev: Eval List, Up: Edebug + +Reading in Edebug +----------------- + + To instrument a form, Edebug first reads the whole form. Edebug +replaces the standard Lisp Reader with its own reader that remembers the +positions of expressions. This reader is used by the Edebug +replacements for `eval-region', `eval-defun', `eval-buffer', and +`eval-current-buffer'. + + Another package, `cl-read.el', replaces the standard reader with one +that understands Common Lisp reader macros. If you use that package, +Edebug will automatically load `edebug-cl-read.el' to provide +corresponding reader macros that remember positions of expressions. If +you define new reader macros, you will have to define similar reader +macros for Edebug. + + +File: lispref.info, Node: Printing in Edebug, Next: Tracing, Prev: Reading in Edebug, Up: Edebug + +Printing in Edebug +------------------ + + If the result of an expression in your program contains a circular +reference, you may get an error when Edebug attempts to print it. You +can set `print-length' to a non-zero value to limit the print length of +lists (the number of cdrs), and in Emacs 19, set `print-level' to a +non-zero value to limit the print depth of lists. But you can print +such circular structures and structures that share elements more +informatively by using the `cust-print' package. + + To load `cust-print' and activate custom printing only for Edebug, +simply use the command `M-x edebug-install-custom-print'. To restore +the standard print functions, use `M-x edebug-uninstall-custom-print'. +You can also activate custom printing for printing in any Lisp code; +see the package for details. + + Here is an example of code that creates a circular structure: + + (progn + (edebug-install-custom-print) + (setq a '(x y)) + (setcar a a)) + + Edebug will print the result of the `setcar' as `Result: #1=(#1# +y)'. The `#1=' notation names the structure that follows it, and the +`#1#' notation references the previously named structure. This +notation is used for any shared elements of lists or vectors. + + Independent of whether `cust-print' is active, while printing +results Edebug binds `print-length', `print-level', and `print-circle' +to `edebug-print-length' (`50'), `edebug-print-level' (`50'), and +`edebug-print-circle' (`t') respectively, if these values are +non-`nil'. Also, `print-readably' is bound to `nil' since some objects +simply cannot be printed readably. + + +File: lispref.info, Node: Tracing, Next: Coverage Testing, Prev: Printing in Edebug, Up: Edebug + +Tracing +------- + + In addition to automatic stepping through source code, which is also +called *tracing* (see *Note Edebug Execution Modes::), Edebug can +produce a traditional trace listing of execution in a separate buffer, +`*edebug-trace*'. + + If the variable `edebug-trace' is non-nil, each function entry and +exit adds lines to the trace buffer. On function entry, Edebug prints +`::::{' followed by the function name and argument values. On function +exit, Edebug prints `::::}' followed by the function name and result of +the function. The number of `:'s is computed from the recursion depth. +The balanced braces in the trace buffer can be used to find the +matching beginning or end of function calls. These displays may be +customized by replacing the functions `edebug-print-trace-before' and +`edebug-print-trace-after', which take an arbitrary message string to +print. + + The macro `edebug-tracing' provides tracing similar to function +enter and exit tracing, but for arbitrary expressions. This macro +should be explicitly inserted by you around expressions you wish to +trace the execution of. The first argument is a message string +(evaluated), and the rest are expressions to evaluate. The result of +the last expression is returned. + + Finally, you can insert arbitrary strings into the trace buffer with +explicit calls to `edebug-trace'. The arguments of this function are +the same as for `message', but a newline is always inserted after each +string printed in this way. + + `edebug-tracing' and `edebug-trace' insert lines in the trace buffer +even if Edebug is not active. Every time the trace buffer is added to, +the window is scrolled to show the last lines inserted. (There may be +some display problems if you use tracing along with the evaluation +list.) + + +File: lispref.info, Node: Coverage Testing, Next: The Outside Context, Prev: Tracing, Up: Edebug + +Coverage Testing +---------------- + + Edebug provides a rudimentary coverage tester and display of +execution frequency. Frequency counts are always accumulated, both +before and after evaluation of each instrumented expression, even if +the execution mode is `Go-nonstop'. Coverage testing is only done if +the option `edebug-test-coverage' is non-`nil' because this is +relatively expensive. Both data sets are displayed by `M-x +edebug-display-freq-count'. + + - Command: edebug-display-freq-count + Display the frequency count data for each line of the current + definition. The frequency counts are inserted as comment lines + after each line, and you can undo all insertions with one `undo' + command. The counts are inserted starting under the `(' before an + expression or the `)' after an expression, or on the last char of + a symbol. The counts are only displayed when they differ from + previous counts on the same line. + + If coverage is being tested, whenever all known results of an + expression are `eq', the char `=' will be appended after the count + for that expression. Note that this is always the case for an + expression only evaluated once. + + To clear the frequency count and coverage data for a definition, + reinstrument it. + + + For example, after evaluating `(fac 5)' with an embedded breakpoint, +and setting `edebug-test-coverage' to `t', when the breakpoint is +reached, the frequency data is looks like this: + + (defun fac (n) + (if (= n 0) (edebug)) + ;#6 1 0 =5 + (if (< 0 n) + ;#5 = + (* n (fac (1- n))) + ;# 5 0 + 1)) + ;# 0 + + The comment lines show that `fac' has been called 6 times. The +first `if' statement has returned 5 times with the same result each +time, and the same is true for the condition on the second `if'. The +recursive call of `fac' has not returned at all. + + +File: lispref.info, Node: The Outside Context, Next: Instrumenting Macro Calls, Prev: Coverage Testing, Up: Edebug + +The Outside Context +------------------- + + Edebug tries to be transparent to the program you are debugging. In +addition, most evaluations you do within Edebug (see *Note Edebug +Eval::) occur in the same outside context which is temporarily restored +for the evaluation. But Edebug is not completely successful and this +section explains precisely how it fails. Edebug operation unavoidably +alters some data in XEmacs, and this can interfere with debugging +certain programs. Also notice that Edebug's protection against change +of outside data means that any side effects *intended* by the user in +the course of debugging will be defeated. + +* Menu: + +* Checking Whether to Stop:: When Edebug decides what to do. +* Edebug Display Update:: When Edebug updates the display. +* Edebug Recursive Edit:: When Edebug stops execution. + + +File: lispref.info, Node: Checking Whether to Stop, Next: Edebug Display Update, Up: The Outside Context + +Checking Whether to Stop +........................ + + Whenever Edebug is entered just to think about whether to take some +action, it needs to save and restore certain data. + + * `max-lisp-eval-depth' and `max-specpdl-size' are both incremented + one time to reduce Edebug's impact on the stack. You could, + however, still run out of stack space when using Edebug. + + * The state of keyboard macro execution is saved and restored. While + Edebug is active, `executing-macro' is bound to + `edebug-continue-kbd-macro'. + + +File: lispref.info, Node: Edebug Display Update, Next: Edebug Recursive Edit, Prev: Checking Whether to Stop, Up: The Outside Context + +Edebug Display Update +..................... + + When Edebug needs to display something (e.g., in trace mode), it +saves the current window configuration from "outside" Edebug. When you +exit Edebug (by continuing the program), it restores the previous window +configuration. + + XEmacs redisplays only when it pauses. Usually, when you continue +execution, the program comes back into Edebug at a breakpoint or after +stepping without pausing or reading input in between. In such cases, +XEmacs never gets a chance to redisplay the "outside" configuration. +What you see is the same window configuration as the last time Edebug +was active, with no interruption. + + Entry to Edebug for displaying something also saves and restores the +following data, but some of these are deliberately not restored if an +error or quit signal occurs. + + * Which buffer is current, and where point and mark are in the + current buffer are saved and restored. + + * The Edebug Display Update, is saved and restored if + `edebug-save-windows' is non-`nil'. It is not restored on error + or quit, but the outside selected window *is* reselected even on + error or quit in case a `save-excursion' is active. If the value + of `edebug-save-windows' is a list, only the listed windows are + saved and restored. + + The window start and horizontal scrolling of the source code + buffer are not restored, however, so that the display remains + coherent. + + * The value of point in each displayed buffer is saved and restored + if `edebug-save-displayed-buffer-points' is non-`nil'. + + * The variables `overlay-arrow-position' and `overlay-arrow-string' + are saved and restored. So you can safely invoke Edebug from the + recursive edit elsewhere in the same buffer. + + * `cursor-in-echo-area' is locally bound to `nil' so that the cursor + shows up in the window. + + +File: lispref.info, Node: Edebug Recursive Edit, Prev: Edebug Display Update, Up: The Outside Context + +Edebug Recursive Edit +..................... + + When Edebug is entered and actually reads commands from the user, it +saves (and later restores) these additional data: + + * The current match data, for whichever buffer was current. + + * `last-command', `this-command', `last-command-char', + `last-input-char', `last-input-event', `last-command-event', + `last-event-frame', `last-nonmenu-event', and `track-mouse' . + Commands used within Edebug do not affect these variables outside + of Edebug. + + The key sequence returned by `this-command-keys' is changed by + executing commands within Edebug and there is no way to reset the + key sequence from Lisp. + + For Emacs 18, Edebug cannot save and restore the value of + `unread-command-char'. Entering Edebug while this variable has a + nontrivial value can interfere with execution of the program you + are debugging. + + * Complex commands executed while in Edebug are added to the variable + `command-history'. In rare cases this can alter execution. + + * Within Edebug, the recursion depth appears one deeper than the + recursion depth outside Edebug. This is not true of the + automatically updated evaluation list window. + + * `standard-output' and `standard-input' are bound to `nil' by the + `recursive-edit', but Edebug temporarily restores them during + evaluations. + + * The state of keyboard macro definition is saved and restored. + While Edebug is active, `defining-kbd-macro' is bound to + `edebug-continue-kbd-macro'. + + +File: lispref.info, Node: Instrumenting Macro Calls, Next: Edebug Options, Prev: The Outside Context, Up: Edebug + +Instrumenting Macro Calls +------------------------- + + When Edebug instruments an expression that calls a Lisp macro, it +needs additional advice to do the job properly. This is because there +is no way to tell which subexpressions of the macro call may be +evaluated. (Evaluation may occur explicitly in the macro body, or when +the resulting expansion is evaluated, or any time later.) You must +explain the format of macro call arguments by using `def-edebug-spec' to +define an "Edebug specification" for each macro. + + - Macro: def-edebug-spec MACRO SPECIFICATION + Specify which expressions of a call to macro MACRO are forms to be + evaluated. For simple macros, the SPECIFICATION often looks very + similar to the formal argument list of the macro definition, but + specifications are much more general than macro arguments. + + The MACRO argument may actually be any symbol, not just a macro + name. + + Unless you are using Emacs 19 or XEmacs, this macro is only defined + in Edebug, so you may want to use the following which is + equivalent: `(put 'MACRO 'edebug-form-spec 'SPECIFICATION)' + + Here is a simple example that defines the specification for the +`for' macro described in the XEmacs Lisp Reference Manual, followed by +an alternative, equivalent specification. + + (def-edebug-spec for + (symbolp "from" form "to" form "do" &rest form)) + + (def-edebug-spec for + (symbolp ['from form] ['to form] ['do body])) + + Here is a table of the possibilities for SPECIFICATION and how each +directs processing of arguments. + +*`t' + All arguments are instrumented for evaluation. + +*`0' + None of the arguments is instrumented. + +*a symbol + The symbol must have an Edebug specification which is used instead. + This indirection is repeated until another kind of specification is + found. This allows you to inherit the specification for another + macro. + +*a list + The elements of the list describe the types of the arguments of a + calling form. The possible elements of a specification list are + described in the following sections. + +* Menu: + +* Specification List:: How to specify complex patterns of evaluation. +* Backtracking:: What Edebug does when matching fails. +* Debugging Backquote:: Debugging Backquote +* Specification Examples:: To help understand specifications. + + +File: lispref.info, Node: Specification List, Next: Backtracking, Up: Instrumenting Macro Calls + +Specification List +.................. + + A "specification list" is required for an Edebug specification if +some arguments of a macro call are evaluated while others are not. Some +elements in a specification list match one or more arguments, but others +modify the processing of all following elements. The latter, called +"keyword specifications", are symbols beginning with ``&'' (e.g. +`&optional'). + + A specification list may contain sublists which match arguments that +are themselves lists, or it may contain vectors used for grouping. +Sublists and groups thus subdivide the specification list into a +hierarchy of levels. Keyword specifications only apply to the +remainder of the sublist or group they are contained in and there is an +implicit grouping around a keyword specification and all following +elements in the sublist or group. + + If a specification list fails at some level, then backtracking may +be invoked to find some alternative at a higher level, or if no +alternatives remain, an error will be signaled. See *Note +Backtracking:: for more details. + + Edebug specifications provide at least the power of regular +expression matching. Some context-free constructs are also supported: +the matching of sublists with balanced parentheses, recursive +processing of forms, and recursion via indirect specifications. + + Each element of a specification list may be one of the following, +with the corresponding type of argument: + +`sexp' + A single unevaluated expression. + +`form' + A single evaluated expression, which is instrumented. + +`place' + A place as in the Common Lisp `setf' place argument. It will be + instrumented just like a form, but the macro is expected to strip + the instrumentation. Two functions, `edebug-unwrap' and + `edebug-unwrap*', are provided to strip the instrumentation one + level or recursively at all levels. + +`body' + Short for `&rest form'. See `&rest' below. + +`function-form' + A function form: either a quoted function symbol, a quoted lambda + expression, or a form (that should evaluate to a function symbol + or lambda expression). This is useful when function arguments + might be quoted with `quote' rather than `function' since the body + of a lambda expression will be instrumented either way. + +`lambda-expr' + An unquoted anonymous lambda expression. + +`&optional' + All following elements in the specification list are optional; as + soon as one does not match, Edebug stops matching at this level. + + To make just a few elements optional followed by non-optional + elements, use `[&optional SPECS...]'. To specify that several + elements should all succeed together, use `&optional [SPECS...]'. + See the `defun' example below. + +`&rest' + All following elements in the specification list are repeated zero + or more times. All the elements need not match in the last + repetition, however. + + To repeat only a few elements, use `[&rest SPECS...]'. To specify + all elements must match on every repetition, use `&rest + [SPECS...]'. + +`&or' + Each of the following elements in the specification list is an + alternative, processed left to right until one matches. One of the + alternatives must match otherwise the `&or' specification fails. + + Each list element following `&or' is a single alternative even if + it is a keyword specification. (This breaks the implicit grouping + rule.) To group two or more list elements as a single + alternative, enclose them in `[...]'. + +`¬' + Each of the following elements is matched as alternatives as if by + using `&or', but if any of them match, the specification fails. + If none of them match, nothing is matched, but the `¬' + specification succeeds. + +`&define' + Indicates that the specification is for a defining form. The + defining form itself is not instrumented (i.e. Edebug does not + stop before and after the defining form), but forms inside it + typically will be instrumented. The `&define' keyword should be + the first element in a list specification. + + Additional specifications that may only appear after `&define' are + described here. See the `defun' example below. + + `name' + The argument, a symbol, is the name of the defining form. + But a defining form need not be named at all, in which case a + unique name will be created for it. + + The `name' specification may be used more than once in the + specification and each subsequent use will append the + corresponding symbol argument to the previous name with ``@'' + between them. This is useful for generating unique but + meaningful names for definitions such as `defadvice' and + `defmethod'. + + `:name' + The element following `:name' should be a symbol; it is used + as an additional name component for the definition. This is + useful to add a unique, static component to the name of the + definition. It may be used more than once. No argument is + matched. + + `arg' + The argument, a symbol, is the name of an argument of the + defining form. However, lambda list keywords (symbols + starting with ``&'') are not allowed. See `lambda-list' and + the example below. + + `lambda-list' + This matches the whole argument list of an XEmacs Lisp lambda + expression, which is a list of symbols and the keywords + `&optional' and `&rest' + + `def-body' + The argument is the body of code in a definition. This is + like `body', described above, but a definition body must be + instrumented with a different Edebug call that looks up + information associated with the definition. Use `def-body' + for the highest level list of forms within the definition. + + `def-form' + The argument is a single, highest-level form in a definition. + This is like `def-body', except use this to match a single + form rather than a list of forms. As a special case, + `def-form' also means that tracing information is not output + when the form is executed. See the `interactive' example + below. + +`nil' + This is successful when there are no more arguments to match at the + current argument list level; otherwise it fails. See sublist + specifications and the backquote example below. + +`gate' + No argument is matched but backtracking through the gate is + disabled while matching the remainder of the specifications at + this level. This is primarily used to generate more specific + syntax error messages. See *Note Backtracking:: for more details. + Also see the `let' example below. + +`OTHER-SYMBOL' + Any other symbol in a specification list may be a predicate or an + indirect specification. + + If the symbol has an Edebug specification, this "indirect + specification" should be either a list specification that is used + in place of the symbol, or a function that is called to process the + arguments. The specification may be defined with `def-edebug-spec' + just as for macros. See the `defun' example below. + + Otherwise, the symbol should be a predicate. The predicate is + called with the argument and the specification fails if the + predicate fails. The argument is not instrumented. + + Predicates that may be used include: `symbolp', `integerp', + `stringp', `vectorp', `atom' (which matches a number, string, + symbol, or vector), `keywordp', and `lambda-list-keywordp'. The + last two, defined in `edebug.el', test whether the argument is a + symbol starting with ``:'' and ``&'' respectively. + +`[ELEMENTS...]' + Rather than matching a vector argument, a vector treats the + ELEMENTS as a single "group specification". + +`"STRING"' + The argument should be a symbol named STRING. This specification + is equivalent to the quoted symbol, `'SYMBOL', where the name of + SYMBOL is the STRING, but the string form is preferred. + +`'SYMBOL or (quote SYMBOL)' + The argument should be the symbol SYMBOL. But use a string + specification instead. + +`(vector ELEMENTS...)' + The argument should be a vector whose elements must match the + ELEMENTS in the specification. See the backquote example below. + +`(ELEMENTS...)' + Any other list is a "sublist specification" and the argument must + be a list whose elements match the specification ELEMENTS. + + A sublist specification may be a dotted list and the corresponding + list argument may then be a dotted list. Alternatively, the last + cdr of a dotted list specification may be another sublist + specification (via a grouping or an indirect specification, e.g. + `(spec . [(more specs...)])') whose elements match the non-dotted + list arguments. This is useful in recursive specifications such + as in the backquote example below. Also see the description of a + `nil' specification above for terminating such recursion. + + Note that a sublist specification of the form `(specs . nil)' + means the same as `(specs)', and `(specs . + (sublist-elements...))' means the same as `(specs + sublist-elements...)'. + + +File: lispref.info, Node: Backtracking, Next: Debugging Backquote, Prev: Specification List, Up: Instrumenting Macro Calls + +Backtracking +............ + + If a specification fails to match at some point, this does not +necessarily mean a syntax error will be signaled; instead, +"backtracking" will take place until all alternatives have been +exhausted. Eventually every element of the argument list must be +matched by some element in the specification, and every required element +in the specification must match some argument. + + Backtracking is disabled for the remainder of a sublist or group when +certain conditions occur, described below. Backtracking is reenabled +when a new alternative is established by `&optional', `&rest', or +`&or'. It is also reenabled initially when processing a sublist or +group specification or an indirect specification. + + You might want to disable backtracking to commit to some alternative +so that Edebug can provide a more specific syntax error message. +Normally, if no alternative matches, Edebug reports that none matched, +but if one alternative is committed to, Edebug can report how it failed +to match. + + First, backtracking is disabled while matching any of the form +specifications (i.e. `form', `body', `def-form', and `def-body'). +These specifications will match any form so any error must be in the +form itself rather than at a higher level. + + Second, backtracking is disabled after successfully matching a quoted +symbol or string specification, since this usually indicates a +recognized construct. If you have a set of alternative constructs that +all begin with the same symbol, you can usually work around this +constraint by factoring the symbol out of the alternatives, e.g., +`["foo" &or [first case] [second case] ...]'. + + Third, backtracking may be explicitly disabled by using the `gate' +specification. This is useful when you know that no higher +alternatives may apply. + + +File: lispref.info, Node: Debugging Backquote, Next: Specification Examples, Prev: Backtracking, Up: Instrumenting Macro Calls + +Debugging Backquote +................... + + Backquote (``') is a macro that results in an expression that may or +may not be evaluated. It is often used to simplify the definition of a +macro to return an expression that is evaluated, but Edebug does not +know when this is the case. However, the forms inside unquotes (`,' and +`,@') are evaluated and Edebug instruments them. + + Nested backquotes are supported by Edebug, but there is a limit on +the support of quotes inside of backquotes. Quoted forms (with `'') +are not normally evaluated, but if the quoted form appears immediately +within `,' and `,@' forms, Edebug treats this as a backquoted form at +the next higher level (even if there is not a next higher level - this +is difficult to fix). + + If the backquoted forms happen to be code intended to be evaluated, +you can have Edebug instrument them by using `edebug-`' instead of the +regular ``'. Unquoted forms can always appear inside `edebug-`' +anywhere a form is normally allowed. But `(, FORM)' may be used in two +other places specially recognized by Edebug: wherever a predicate +specification would match, and at the head of a list form in place of a +function name or lambda expression. The FORM inside a spliced unquote, +`(,@ FORM)', will be wrapped, but the unquote form itself will not be +wrapped since this would interfere with the splicing. + + There is one other complication with using `edebug-`'. If the +`edebug-`' call is in a macro and the macro may be called from code +that is also instrumented, and if unquoted forms contain any macro +arguments bound to instrumented forms, then you should modify the +specification for the macro as follows: the specifications for those +arguments must use `def-form' instead of `form'. (This is to +reestablish the Edebugging context for those external forms.) + + For example, the `for' macro (*note Problems with Macros: ()Problems +with Macros.) is shown here but with `edebug-`' substituted for regular +``'. + + (defmacro inc (var) + (list 'setq var (list '1+ var))) + + (defmacro for (var from init to final do &rest body) + (let ((tempvar (make-symbol "max"))) + (edebug-` (let (((, var) (, init)) + ((, tempvar) (, final))) + (while (<= (, var) (, tempvar)) + (, body) + (inc (, var))))))) + + Here is the corresponding modified Edebug specification and some code +that calls the macro: + + (def-edebug-spec for + (symbolp "from" def-form "to" def-form "do" &rest def-form)) + + (let ((n 5)) + (for i from n to (* n (+ n 1)) do + (message "%s" i))) + + After instrumenting the `for' macro and the macro call, Edebug first +steps to the beginning of the macro call, then into the macro body, +then through each of the unquoted expressions in the backquote showing +the expressions that will be embedded in the backquote form. Then when +the macro expansion is evaluated, Edebug will step through the `let' +form and each time it gets to an unquoted form, it will jump back to an +argument of the macro call to step through that expression. Finally +stepping will continue after the macro call. Even more convoluted +execution paths may result when using anonymous functions. + + When the result of an expression is an instrumented expression, it is +difficult to see the expression inside the instrumentation. So you may +want to set the option `edebug-unwrap-results' to a non-`nil' value +while debugging such expressions, but it would slow Edebug down to +always do this. + + +File: lispref.info, Node: Specification Examples, Prev: Debugging Backquote, Up: Instrumenting Macro Calls + +Specification Examples +...................... + + Here we provide several examples of Edebug specifications to show +many of its capabilities. + + A `let' special form has a sequence of bindings and a body. Each of +the bindings is either a symbol or a sublist with a symbol and optional +value. In the specification below, notice the `gate' inside of the +sublist to prevent backtracking. + + (def-edebug-spec let + ((&rest + &or symbolp (gate symbolp &optional form)) + body)) + + Edebug uses the following specifications for `defun' and `defmacro' +and the associated argument list and `interactive' specifications. It +is necessary to handle the expression argument of an interactive form +specially since it is actually evaluated outside of the function body. + + (def-edebug-spec defmacro defun) ; Indirect ref to `defun' spec + (def-edebug-spec defun + (&define name lambda-list + [&optional stringp] ; Match the doc string, if present. + [&optional ("interactive" interactive)] + def-body)) + + (def-edebug-spec lambda-list + (([&rest arg] + [&optional ["&optional" arg &rest arg]] + &optional ["&rest" arg] + ))) + + (def-edebug-spec interactive + (&optional &or stringp def-form)) ; Notice: `def-form' + + The specification for backquote below illustrates how to match +dotted lists and use `nil' to terminate recursion. It also illustrates +how components of a vector may be matched. (The actual specification +provided by Edebug does not support dotted lists because doing so +causes very deep recursion that could fail.) + + (def-edebug-spec ` (backquote-form)) ;; alias just for clarity + + (def-edebug-spec backquote-form + (&or ([&or "," ",@"] &or ("quote" backquote-form) form) + (backquote-form . [&or nil backquote-form]) + (vector &rest backquote-form) + sexp)) + + +File: lispref.info, Node: Edebug Options, Prev: Instrumenting Macro Calls, Up: Edebug + +Edebug Options +-------------- + + These options affect the behavior of Edebug: + + - User Option: edebug-setup-hook + Functions to call before Edebug is used. Each time it is set to a + new value, Edebug will call those functions once and then + `edebug-setup-hook' is reset to `nil'. You could use this to load + up Edebug specifications associated with a package you are using + but only when you also use Edebug. See *Note Instrumenting::. + + - User Option: edebug-all-defs + If non-`nil', normal evaluation of any defining forms (e.g. + `defun' and `defmacro') will instrument them for Edebug. This + applies to `eval-defun', `eval-region', and `eval-current-buffer'. + + Use the command `M-x edebug-all-defs' to toggle the value of this + variable. You may want to make this variable local to each buffer + by calling `(make-local-variable 'edebug-all-defs)' in your + `emacs-lisp-mode-hook'. See *Note Instrumenting::. + + - User Option: edebug-all-forms + If non-`nil', normal evaluation of any forms by `eval-defun', + `eval-region', and `eval-current-buffer' will instrument them for + Edebug. + + Use the command `M-x edebug-all-forms' to toggle the value of this + option. See *Note Instrumenting::. + + - User Option: edebug-save-windows + If non-`nil', save and restore window configuration on Edebug + calls. It takes some time to do this, so if your program does not + care what happens to data about windows, you may want to set this + variable to `nil'. + + If the value is a list, only the listed windows are saved and + restored. + + `M-x edebug-toggle-save-windows' may be used to change this + variable. This command is bound to `W' in source code buffers. + See *Note Edebug Display Update::. + + - User Option: edebug-save-displayed-buffer-points + If non-`nil', save and restore point in all displayed buffers. + This is necessary if you are debugging code that changes the point + of a buffer which is displayed in a non-selected window. If + Edebug or the user then selects the window, the buffer's point + will be changed to the window's point. + + This is an expensive operation since it visits each window and + therefore each displayed buffer twice for each Edebug activation, + so it is best to avoid it if you can. See *Note Edebug Display + Update::. + + - User Option: edebug-initial-mode + If this variable is non-`nil', it specifies the initial execution + mode for Edebug when it is first activated. Possible values are + `step', `next', `go', `Go-nonstop', `trace', `Trace-fast', + `continue', and `Continue-fast'. + + The default value is `step'. See *Note Edebug Execution Modes::. + + - User Option: edebug-trace + Non-`nil' means display a trace of function entry and exit. + Tracing output is displayed in a buffer named `*edebug-trace*', one + function entry or exit per line, indented by the recursion level. + + The default value is `nil'. + + Also see `edebug-tracing'. See *Note Tracing::. + + - User Option: edebug-test-coverage + If non-`nil', Edebug tests coverage of all expressions debugged. + This is done by comparing the result of each expression with the + previous result. Coverage is considered OK if two different + results are found. So to sufficiently test the coverage of your + code, try to execute it under conditions that evaluate all + expressions more than once, and produce different results for each + expression. + + Use `M-x edebug-display-freq-count' to display the frequency count + and coverage information for a definition. See *Note Coverage + Testing::. + + - User Option: edebug-continue-kbd-macro + If non-`nil', continue defining or executing any keyboard macro + that is executing outside of Edebug. Use this with caution since + it is not debugged. See *Note Edebug Execution Modes::. + + - User Option: edebug-print-length + If non-`nil', bind `print-length' to this while printing results + in Edebug. The default value is `50'. See *Note Printing in + Edebug::. + + - User Option: edebug-print-level + If non-`nil', bind `print-level' to this while printing results in + Edebug. The default value is `50'. + + - User Option: edebug-print-circle + If non-`nil', bind `print-circle' to this while printing results + in Edebug. The default value is `nil'. + + - User Option: edebug-on-error + `debug-on-error' is bound to this while Edebug is active. See + *Note Trapping Errors::. + + - User Option: edebug-on-quit + `debug-on-quit' is bound to this while Edebug is active. See + *Note Trapping Errors::. + + - User Option: edebug-unwrap-results + Non-`nil' if Edebug should unwrap results of expressions. This is + useful when debugging macros where the results of expressions are + instrumented expressions. But don't do this when results might be + circular or an infinite loop will result. See *Note Debugging + Backquote::. + + - User Option: edebug-global-break-condition + If non-`nil', an expression to test for at every stop point. If + the result is non-nil, then break. Errors are ignored. See *Note + Global Break Condition::. + + +File: lispref.info, Node: Read and Print, Next: Minibuffers, Prev: Debugging, Up: Top + +Reading and Printing Lisp Objects +********************************* + + "Printing" and "reading" are the operations of converting Lisp +objects to textual form and vice versa. They use the printed +representations and read syntax described in *Note Lisp Data Types::. + + This chapter describes the Lisp functions for reading and printing. +It also describes "streams", which specify where to get the text (if +reading) or where to put it (if printing). + +* Menu: + +* Streams Intro:: Overview of streams, reading and printing. +* Input Streams:: Various data types that can be used as input streams. +* Input Functions:: Functions to read Lisp objects from text. +* Output Streams:: Various data types that can be used as output streams. +* Output Functions:: Functions to print Lisp objects as text. +* Output Variables:: Variables that control what the printing functions do. + + +File: lispref.info, Node: Streams Intro, Next: Input Streams, Up: Read and Print + +Introduction to Reading and Printing +==================================== + + "Reading" a Lisp object means parsing a Lisp expression in textual +form and producing a corresponding Lisp object. This is how Lisp +programs get into Lisp from files of Lisp code. We call the text the +"read syntax" of the object. For example, the text `(a . 5)' is the +read syntax for a cons cell whose CAR is `a' and whose CDR is the +number 5. + + "Printing" a Lisp object means producing text that represents that +object--converting the object to its printed representation. Printing +the cons cell described above produces the text `(a . 5)'. + + Reading and printing are more or less inverse operations: printing +the object that results from reading a given piece of text often +produces the same text, and reading the text that results from printing +an object usually produces a similar-looking object. For example, +printing the symbol `foo' produces the text `foo', and reading that text +returns the symbol `foo'. Printing a list whose elements are `a' and +`b' produces the text `(a b)', and reading that text produces a list +(but not the same list) with elements `a' and `b'. + + However, these two operations are not precisely inverses. There are +three kinds of exceptions: + + * Printing can produce text that cannot be read. For example, + buffers, windows, frames, subprocesses and markers print into text + that starts with `#'; if you try to read this text, you get an + error. There is no way to read those data types. + + * One object can have multiple textual representations. For example, + `1' and `01' represent the same integer, and `(a b)' and `(a . + (b))' represent the same list. Reading will accept any of the + alternatives, but printing must choose one of them. + + * Comments can appear at certain points in the middle of an object's + read sequence without affecting the result of reading it. + diff --git a/info/lispref.info-15 b/info/lispref.info-15 new file mode 100644 index 0000000..ce05ae6 --- /dev/null +++ b/info/lispref.info-15 @@ -0,0 +1,1289 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Input Streams, Next: Input Functions, Prev: Streams Intro, Up: Read and Print + +Input Streams +============= + + Most of the Lisp functions for reading text take an "input stream" +as an argument. The input stream specifies where or how to get the +characters of the text to be read. Here are the possible types of input +stream: + +BUFFER + The input characters are read from BUFFER, starting with the + character directly after point. Point advances as characters are + read. + +MARKER + The input characters are read from the buffer that MARKER is in, + starting with the character directly after the marker. The marker + position advances as characters are read. The value of point in + the buffer has no effect when the stream is a marker. + +STRING + The input characters are taken from STRING, starting at the first + character in the string and using as many characters as required. + +FUNCTION + The input characters are generated by FUNCTION, one character per + call. Normally FUNCTION is called with no arguments, and should + return a character. + + Occasionally FUNCTION is called with one argument (always a + character). When that happens, FUNCTION should save the argument + and arrange to return it on the next call. This is called + "unreading" the character; it happens when the Lisp reader reads + one character too many and wants to "put it back where it came + from". + +`t' + `t' used as a stream means that the input is read from the + minibuffer. In fact, the minibuffer is invoked once and the text + given by the user is made into a string that is then used as the + input stream. + +`nil' + `nil' supplied as an input stream means to use the value of + `standard-input' instead; that value is the "default input + stream", and must be a non-`nil' input stream. + +SYMBOL + A symbol as input stream is equivalent to the symbol's function + definition (if any). + + Here is an example of reading from a stream that is a buffer, showing +where point is located before and after: + + ---------- Buffer: foo ---------- + This-!- is the contents of foo. + ---------- Buffer: foo ---------- + + (read (get-buffer "foo")) + => is + (read (get-buffer "foo")) + => the + + ---------- Buffer: foo ---------- + This is the-!- contents of foo. + ---------- Buffer: foo ---------- + +Note that the first read skips a space. Reading skips any amount of +whitespace preceding the significant text. + + In Emacs 18, reading a symbol discarded the delimiter terminating the +symbol. Thus, point would end up at the beginning of `contents' rather +than after `the'. The Emacs 19 behavior is superior because it +correctly handles input such as `bar(foo)', where the open-parenthesis +that ends one object is needed as the beginning of another object. + + Here is an example of reading from a stream that is a marker, +initially positioned at the beginning of the buffer shown. The value +read is the symbol `This'. + + + ---------- Buffer: foo ---------- + This is the contents of foo. + ---------- Buffer: foo ---------- + + (setq m (set-marker (make-marker) 1 (get-buffer "foo"))) + => # + (read m) + => This + m + => # ;; Before the first space. + + Here we read from the contents of a string: + + (read "(When in) the course") + => (When in) + + The following example reads from the minibuffer. The prompt is: +`Lisp expression: '. (That is always the prompt used when you read +from the stream `t'.) The user's input is shown following the prompt. + + (read t) + => 23 + ---------- Buffer: Minibuffer ---------- + Lisp expression: 23 + ---------- Buffer: Minibuffer ---------- + + Finally, here is an example of a stream that is a function, named +`useless-stream'. Before we use the stream, we initialize the variable +`useless-list' to a list of characters. Then each call to the function +`useless-stream' obtains the next character in the list or unreads a +character by adding it to the front of the list. + + (setq useless-list (append "XY()" nil)) + => (88 89 40 41) + + (defun useless-stream (&optional unread) + (if unread + (setq useless-list (cons unread useless-list)) + (prog1 (car useless-list) + (setq useless-list (cdr useless-list))))) + => useless-stream + +Now we read using the stream thus constructed: + + (read 'useless-stream) + => XY + + useless-list + => (40 41) + +Note that the open and close parentheses remains in the list. The Lisp +reader encountered the open parenthesis, decided that it ended the +input, and unread it. Another attempt to read from the stream at this +point would read `()' and return `nil'. + + +File: lispref.info, Node: Input Functions, Next: Output Streams, Prev: Input Streams, Up: Read and Print + +Input Functions +=============== + + This section describes the Lisp functions and variables that pertain +to reading. + + In the functions below, STREAM stands for an input stream (see the +previous section). If STREAM is `nil' or omitted, it defaults to the +value of `standard-input'. + + An `end-of-file' error is signaled if reading encounters an +unterminated list, vector, or string. + + - Function: read &optional STREAM + This function reads one textual Lisp expression from STREAM, + returning it as a Lisp object. This is the basic Lisp input + function. + + - Function: read-from-string STRING &optional START END + This function reads the first textual Lisp expression from the + text in STRING. It returns a cons cell whose CAR is that + expression, and whose CDR is an integer giving the position of the + next remaining character in the string (i.e., the first one not + read). + + If START is supplied, then reading begins at index START in the + string (where the first character is at index 0). If END is also + supplied, then reading stops just before that index, as if the rest + of the string were not there. + + For example: + + (read-from-string "(setq x 55) (setq y 5)") + => ((setq x 55) . 11) + (read-from-string "\"A short string\"") + => ("A short string" . 16) + + ;; Read starting at the first character. + (read-from-string "(list 112)" 0) + => ((list 112) . 10) + ;; Read starting at the second character. + (read-from-string "(list 112)" 1) + => (list . 5) + ;; Read starting at the seventh character, + ;; and stopping at the ninth. + (read-from-string "(list 112)" 6 8) + => (11 . 8) + + - Variable: standard-input + This variable holds the default input stream--the stream that + `read' uses when the STREAM argument is `nil'. + + +File: lispref.info, Node: Output Streams, Next: Output Functions, Prev: Input Functions, Up: Read and Print + +Output Streams +============== + + An output stream specifies what to do with the characters produced +by printing. Most print functions accept an output stream as an +optional argument. Here are the possible types of output stream: + +BUFFER + The output characters are inserted into BUFFER at point. Point + advances as characters are inserted. + +MARKER + The output characters are inserted into the buffer that MARKER + points into, at the marker position. The marker position advances + as characters are inserted. The value of point in the buffer has + no effect on printing when the stream is a marker. + +FUNCTION + The output characters are passed to FUNCTION, which is responsible + for storing them away. It is called with a single character as + argument, as many times as there are characters to be output, and + is free to do anything at all with the characters it receives. + +`t' + The output characters are displayed in the echo area. + +`nil' + `nil' specified as an output stream means to the value of + `standard-output' instead; that value is the "default output + stream", and must be a non-`nil' output stream. + +SYMBOL + A symbol as output stream is equivalent to the symbol's function + definition (if any). + + Many of the valid output streams are also valid as input streams. +The difference between input and output streams is therefore mostly one +of how you use a Lisp object, not a distinction of types of object. + + Here is an example of a buffer used as an output stream. Point is +initially located as shown immediately before the `h' in `the'. At the +end, point is located directly before that same `h'. + + ---------- Buffer: foo ---------- + This is t-!-he contents of foo. + ---------- Buffer: foo ---------- + + (print "This is the output" (get-buffer "foo")) + => "This is the output" + + ---------- Buffer: foo ---------- + This is t + "This is the output" + -!-he contents of foo. + ---------- Buffer: foo ---------- + + Now we show a use of a marker as an output stream. Initially, the +marker is in buffer `foo', between the `t' and the `h' in the word +`the'. At the end, the marker has advanced over the inserted text so +that it remains positioned before the same `h'. Note that the location +of point, shown in the usual fashion, has no effect. + + ---------- Buffer: foo ---------- + "This is the -!-output" + ---------- Buffer: foo ---------- + + m + => # + + (print "More output for foo." m) + => "More output for foo." + + ---------- Buffer: foo ---------- + "This is t + "More output for foo." + he -!-output" + ---------- Buffer: foo ---------- + + m + => # + + The following example shows output to the echo area: + + (print "Echo Area output" t) + => "Echo Area output" + ---------- Echo Area ---------- + "Echo Area output" + ---------- Echo Area ---------- + + Finally, we show the use of a function as an output stream. The +function `eat-output' takes each character that it is given and conses +it onto the front of the list `last-output' (*note Building Lists::.). +At the end, the list contains all the characters output, but in reverse +order. + + (setq last-output nil) + => nil + + (defun eat-output (c) + (setq last-output (cons c last-output))) + => eat-output + + (print "This is the output" 'eat-output) + => "This is the output" + + last-output + => (?\n ?\" ?t ?u ?p ?t ?u ?o ?\ ?e ?h ?t + ?\ ?s ?i ?\ ?s ?i ?h ?T ?\" ?\n) + +Now we can put the output in the proper order by reversing the list: + + (concat (nreverse last-output)) + => " + \"This is the output\" + " + +Calling `concat' converts the list to a string so you can see its +contents more clearly. + + +File: lispref.info, Node: Output Functions, Next: Output Variables, Prev: Output Streams, Up: Read and Print + +Output Functions +================ + + This section describes the Lisp functions for printing Lisp objects. + + Some of the XEmacs printing functions add quoting characters to the +output when necessary so that it can be read properly. The quoting +characters used are `"' and `\'; they distinguish strings from symbols, +and prevent punctuation characters in strings and symbols from being +taken as delimiters when reading. *Note Printed Representation::, for +full details. You specify quoting or no quoting by the choice of +printing function. + + If the text is to be read back into Lisp, then it is best to print +with quoting characters to avoid ambiguity. Likewise, if the purpose is +to describe a Lisp object clearly for a Lisp programmer. However, if +the purpose of the output is to look nice for humans, then it is better +to print without quoting. + + Printing a self-referent Lisp object requires an infinite amount of +text. In certain cases, trying to produce this text leads to a stack +overflow. XEmacs detects such recursion and prints `#LEVEL' instead of +recursively printing an object already being printed. For example, +here `#0' indicates a recursive reference to the object at level 0 of +the current print operation: + + (setq foo (list nil)) + => (nil) + (setcar foo foo) + => (#0) + + In the functions below, STREAM stands for an output stream. (See +the previous section for a description of output streams.) If STREAM +is `nil' or omitted, it defaults to the value of `standard-output'. + + - Function: print OBJECT &optional STREAM + The `print' function is a convenient way of printing. It outputs + the printed representation of OBJECT to STREAM, printing in + addition one newline before OBJECT and another after it. Quoting + characters are used. `print' returns OBJECT. For example: + + (progn (print 'The\ cat\ in) + (print "the hat") + (print " came back")) + -| + -| The\ cat\ in + -| + -| "the hat" + -| + -| " came back" + -| + => " came back" + + - Function: prin1 OBJECT &optional STREAM + This function outputs the printed representation of OBJECT to + STREAM. It does not print newlines to separate output as `print' + does, but it does use quoting characters just like `print'. It + returns OBJECT. + + (progn (prin1 'The\ cat\ in) + (prin1 "the hat") + (prin1 " came back")) + -| The\ cat\ in"the hat"" came back" + => " came back" + + - Function: princ OBJECT &optional STREAM + This function outputs the printed representation of OBJECT to + STREAM. It returns OBJECT. + + This function is intended to produce output that is readable by + people, not by `read', so it doesn't insert quoting characters and + doesn't put double-quotes around the contents of strings. It does + not add any spacing between calls. + + (progn + (princ 'The\ cat) + (princ " in the \"hat\"")) + -| The cat in the "hat" + => " in the \"hat\"" + + - Function: terpri &optional STREAM + This function outputs a newline to STREAM. The name stands for + "terminate print". + + - Function: write-char CHARACTER &optional STREAM + This function outputs CHARACTER to STREAM. It returns CHARACTER. + + - Function: prin1-to-string OBJECT &optional NOESCAPE + This function returns a string containing the text that `prin1' + would have printed for the same argument. + + (prin1-to-string 'foo) + => "foo" + (prin1-to-string (mark-marker)) + => "#" + + If NOESCAPE is non-`nil', that inhibits use of quoting characters + in the output. (This argument is supported in Emacs versions 19 + and later.) + + (prin1-to-string "foo") + => "\"foo\"" + (prin1-to-string "foo" t) + => "foo" + + See `format', in *Note String Conversion::, for other ways to + obtain the printed representation of a Lisp object as a string. + + +File: lispref.info, Node: Output Variables, Prev: Output Functions, Up: Read and Print + +Variables Affecting Output +========================== + + - Variable: standard-output + The value of this variable is the default output stream--the stream + that print functions use when the STREAM argument is `nil'. + + - Variable: print-escape-newlines + If this variable is non-`nil', then newline characters in strings + are printed as `\n' and formfeeds are printed as `\f'. Normally + these characters are printed as actual newlines and formfeeds. + + This variable affects the print functions `prin1' and `print', as + well as everything that uses them. It does not affect `princ'. + Here is an example using `prin1': + + (prin1 "a\nb") + -| "a + -| b" + => "a + b" + + (let ((print-escape-newlines t)) + (prin1 "a\nb")) + -| "a\nb" + => "a + b" + + In the second expression, the local binding of + `print-escape-newlines' is in effect during the call to `prin1', + but not during the printing of the result. + + - Variable: print-readably + If non-`nil', then all objects will be printed in a readable form. + If an object has no readable representation, then an error is + signalled. When `print-readably' is true, compiled-function + objects will be written in `#[...]' form instead of in + `#' form, and two-element lists of the + form `(quote object)' will be written as the equivalent `'object'. + Do not *set* this variable; bind it instead. + + - Variable: print-length + The value of this variable is the maximum number of elements of a + list that will be printed. If a list being printed has more than + this many elements, it is abbreviated with an ellipsis. + + If the value is `nil' (the default), then there is no limit. + + (setq print-length 2) + => 2 + (print '(1 2 3 4 5)) + -| (1 2 ...) + => (1 2 ...) + + - Variable: print-level + The value of this variable is the maximum depth of nesting of + parentheses and brackets when printed. Any list or vector at a + depth exceeding this limit is abbreviated with an ellipsis. A + value of `nil' (which is the default) means no limit. + + This variable exists in version 19 and later versions. + + - Variable: print-string-length + The value of this variable is the maximum number of characters of + a string that will be printed. If a string being printed has more + than this many characters, it is abbreviated with an ellipsis. + + - Variable: print-gensym + If non-`nil', then uninterned symbols will be printed specially. + Uninterned symbols are those which are not present in `obarray', + that is, those which were made with `make-symbol' or by calling + `intern' with a second argument. + + When `print-gensym' is true, such symbols will be preceded by + `#:', which causes the reader to create a new symbol instead of + interning and returning an existing one. Beware: The `#:' syntax + creates a new symbol each time it is seen, so if you print an + object which contains two pointers to the same uninterned symbol, + `read' will not duplicate that structure. + + Also, since XEmacs has no real notion of packages, there is no way + for the printer to distinguish between symbols interned in no + obarray, and symbols interned in an alternate obarray. + + - Variable: float-output-format + This variable holds the format descriptor string that Lisp uses to + print floats. This is a `%'-spec like those accepted by `printf' + in C, but with some restrictions. It must start with the two + characters `%.'. After that comes an integer precision + specification, and then a letter which controls the format. The + letters allowed are `e', `f' and `g'. + + * Use `e' for exponential notation `DIG.DIGITSeEXPT'. + + * Use `f' for decimal point notation `DIGITS.DIGITS'. + + * Use `g' to choose the shorter of those two formats for the + number at hand. + + The precision in any of these cases is the number of digits + following the decimal point. With `f', a precision of 0 means to + omit the decimal point. 0 is not allowed with `f' or `g'. + + A value of nil means to use `%.16g'. + + Regardless of the value of `float-output-format', a floating point + number will never be printed in such a way that it is ambiguous + with an integer; that is, a floating-point number will always be + printed with a decimal point and/or an exponent, even if the + digits following the decimal point are all zero. This is to + preserve read-equivalence. + + +File: lispref.info, Node: Minibuffers, Next: Command Loop, Prev: Read and Print, Up: Top + +Minibuffers +*********** + + A "minibuffer" is a special buffer that XEmacs commands use to read +arguments more complicated than the single numeric prefix argument. +These arguments include file names, buffer names, and command names (as +in `M-x'). The minibuffer is displayed on the bottom line of the +frame, in the same place as the echo area, but only while it is in use +for reading an argument. + +* Menu: + +* Intro to Minibuffers:: Basic information about minibuffers. +* Text from Minibuffer:: How to read a straight text string. +* Object from Minibuffer:: How to read a Lisp object or expression. +* Minibuffer History:: Recording previous minibuffer inputs + so the user can reuse them. +* 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. +* Minibuffer Misc:: Various customization hooks and variables. + + +File: lispref.info, Node: Intro to Minibuffers, Next: Text from Minibuffer, Up: Minibuffers + +Introduction to Minibuffers +=========================== + + In most ways, a minibuffer is a normal XEmacs buffer. Most +operations *within* a buffer, such as editing commands, work normally +in a minibuffer. However, many operations for managing buffers do not +apply to minibuffers. The name of a minibuffer always has the form +` *Minibuf-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. (Sometime frames have +no minibuffer window, and sometimes a special kind of frame contains +nothing but a minibuffer window; see *Note Minibuffers and Frames::.) + + The minibuffer's window is normally a single line. You can resize it +temporarily with the window sizing commands; it reverts to its normal +size when the minibuffer is exited. You can resize it permanently by +using the window sizing commands in the frame's other window, when the +minibuffer is not active. If the frame contains just a minibuffer, you +can change the minibuffer's size by changing the frame's size. + + If a command uses a minibuffer while there is an active minibuffer, +this is called a "recursive minibuffer". The first minibuffer is named +` *Minibuf-0*'. Recursive minibuffers are named by incrementing the +number at the end of the name. (The names begin with a space so that +they won't show up in normal buffer lists.) Of several recursive +minibuffers, the innermost (or most recently entered) is the active +minibuffer. We usually call this "the" minibuffer. You can permit or +forbid recursive minibuffers by setting the variable +`enable-recursive-minibuffers'. + + Like other buffers, a minibuffer may use any of several local keymaps +(*note Keymaps::.); these contain various exit commands and in some +cases completion commands (*note Completion::.). + + * `minibuffer-local-map' is for ordinary input (no completion). + + * `minibuffer-local-ns-map' is similar, except that exits just + like . This is used mainly for Mocklisp compatibility. + + * `minibuffer-local-completion-map' is for permissive completion. + + * `minibuffer-local-must-match-map' is for strict completion and for + cautious completion. + + +File: lispref.info, Node: Text from Minibuffer, Next: Object from Minibuffer, Prev: Intro to Minibuffers, Up: Minibuffers + +Reading Text Strings with the Minibuffer +======================================== + + Most often, the minibuffer is used to read text as a string. It can +also be used to read a Lisp object in textual form. The most basic +primitive for minibuffer input is `read-from-minibuffer'; it can do +either one. + + In most cases, you should not call minibuffer input functions in the +middle of a Lisp function. Instead, do all minibuffer input as part of +reading the arguments for a command, in the `interactive' spec. *Note +Defining Commands::. + + - Function: 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 READ is non-`nil', then it uses `read' to + convert the text into a Lisp object (*note Input Functions::.). + + The first thing this function does is to activate a minibuffer and + display it with PROMPT-STRING as the prompt. This value must be a + string. + + Then, if INITIAL-CONTENTS is a string, `read-from-minibuffer' + inserts it into the minibuffer, leaving point at the end. The + minibuffer appears with this text as its contents. + + The value of INITIAL-CONTENTS may also be a cons cell of the form + `(STRING . POSITION)'. This means to insert STRING in the + minibuffer but put point POSITION characters from the beginning, + rather than at the end. + + If KEYMAP is non-`nil', that keymap is the local keymap to use in + the minibuffer. If KEYMAP is omitted or `nil', the value of + `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 HIST specifies which history list variable to use for + saving the input and for history commands used in the minibuffer. + It defaults to `minibuffer-history'. *Note Minibuffer History::. + + When the user types a command to exit the minibuffer, + `read-from-minibuffer' uses the text in the minibuffer to produce + its return value. Normally it simply makes a string containing + that text. However, if READ is non-`nil', `read-from-minibuffer' + reads the text and returns the resulting Lisp object, unevaluated. + (*Note Input Functions::, for information about reading.) + + - Function: read-string PROMPT &optional INITIAL + This function reads a string from the minibuffer and returns it. + The arguments PROMPT and INITIAL are used as in + `read-from-minibuffer'. The keymap used is `minibuffer-local-map'. + + This is a simplified interface to the `read-from-minibuffer' + function: + + (read-string PROMPT INITIAL) + == + (read-from-minibuffer PROMPT INITIAL nil nil nil) + + - Variable: minibuffer-local-map + This is the default local keymap for reading from the minibuffer. + By default, it makes the following bindings: + + + `exit-minibuffer' + + + `exit-minibuffer' + + `C-g' + `abort-recursive-edit' + + `M-n' + `next-history-element' + + `M-p' + `previous-history-element' + + `M-r' + `next-matching-history-element' + + `M-s' + `previous-matching-history-element' + + - Function: 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 PROMPT and INITIAL + are used as in `read-from-minibuffer'. + + This is a simplified interface to the `read-from-minibuffer' + function, and passes the value of the `minibuffer-local-ns-map' + keymap as the KEYMAP argument for that function. Since the keymap + `minibuffer-local-ns-map' does not rebind `C-q', it *is* possible + to put a space into the string, by quoting it. + + (read-no-blanks-input PROMPT INITIAL) + == + (read-from-minibuffer PROMPT INITIAL minibuffer-local-ns-map) + + - Variable: minibuffer-local-ns-map + This built-in variable is the keymap used as the minibuffer local + keymap in the function `read-no-blanks-input'. By default, it + makes the following bindings, in addition to those of + `minibuffer-local-map': + + + `exit-minibuffer' + + + `exit-minibuffer' + + `?' + `self-insert-and-exit' + + +File: lispref.info, Node: Object from Minibuffer, Next: Minibuffer History, Prev: Text from Minibuffer, Up: Minibuffers + +Reading Lisp Objects with the Minibuffer +======================================== + + This section describes functions for reading Lisp objects with the +minibuffer. + + - Function: read-minibuffer PROMPT &optional INITIAL + This function reads a Lisp object in the minibuffer and returns it, + without evaluating it. The arguments PROMPT and INITIAL are used + as in `read-from-minibuffer'. + + This is a simplified interface to the `read-from-minibuffer' + function: + + (read-minibuffer PROMPT INITIAL) + == + (read-from-minibuffer PROMPT INITIAL nil t) + + Here is an example in which we supply the string `"(testing)"' as + initial input: + + (read-minibuffer + "Enter an expression: " (format "%s" '(testing))) + + ;; Here is how the minibuffer is displayed: + + ---------- Buffer: Minibuffer ---------- + Enter an expression: (testing)-!- + ---------- Buffer: Minibuffer ---------- + + The user can type immediately to use the initial input as a + default, or can edit the input. + + - Function: eval-minibuffer PROMPT &optional INITIAL + This function reads a Lisp expression in the minibuffer, evaluates + it, then returns the result. The arguments PROMPT and INITIAL are + used as in `read-from-minibuffer'. + + This function simply evaluates the result of a call to + `read-minibuffer': + + (eval-minibuffer PROMPT INITIAL) + == + (eval (read-minibuffer PROMPT INITIAL)) + + - Function: 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 + `eval-minibuffer' is that here the initial 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 + `prin1', so if it is a string, double-quote characters (`"') + appear in the initial text. *Note Output Functions::. + + The first thing `edit-and-eval-command' does is to activate the + minibuffer with PROMPT as the prompt. Then it inserts the printed + representation of FORM in the minibuffer, and lets the user edit. + When the user exits the minibuffer, the edited text is read with + `read' and then evaluated. The resulting value becomes the value + of `edit-and-eval-command'. + + In the following example, we offer the user an expression with + initial text which is a valid form already: + + (edit-and-eval-command "Please edit: " '(forward-word 1)) + + ;; After evaluation of the preceding expression, + ;; the following appears in the minibuffer: + + ---------- Buffer: Minibuffer ---------- + Please edit: (forward-word 1)-!- + ---------- Buffer: Minibuffer ---------- + + Typing right away would exit the minibuffer and evaluate the + expression, thus moving point forward one word. + `edit-and-eval-command' returns `t' in this example. + + +File: lispref.info, Node: Minibuffer History, Next: Completion, Prev: Object from Minibuffer, Up: Minibuffers + +Minibuffer History +================== + + A "minibuffer history list" records previous minibuffer inputs so +the user can reuse them conveniently. A history list is actually a +symbol, not a list; it is a variable whose value is a list of strings +(previous inputs), most recent first. + + There are many separate history lists, used for different kinds of +inputs. It's the Lisp programmer's job to specify the right history +list for each use of the minibuffer. + + The basic minibuffer input functions `read-from-minibuffer' and +`completing-read' both accept an optional argument named HIST which is +how you specify the history list. Here are the possible values: + +VARIABLE + Use VARIABLE (a symbol) as the history list. + +(VARIABLE . STARTPOS) + Use VARIABLE (a symbol) as the history list, and assume that the + initial history position is STARTPOS (an integer, counting from + zero which specifies the most recent element of the history). + + If you specify STARTPOS, then you should also specify that element + of the history as the initial minibuffer contents, for consistency. + + If you don't specify HIST, then the default history list +`minibuffer-history' is used. For other standard history lists, see +below. You can also create your own history list variable; just +initialize it to `nil' before the first use. + + Both `read-from-minibuffer' and `completing-read' add new elements +to the history list automatically, and provide commands to allow the +user to reuse items on the list. The only thing your program needs to +do to use a history list is to initialize it and to pass its 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. + + - Variable: minibuffer-history + The default history list for minibuffer history input. + + - Variable: query-replace-history + A history list for arguments to `query-replace' (and similar + arguments to other commands). + + - Variable: file-name-history + A history list for file name arguments. + + - Variable: regexp-history + A history list for regular expression arguments. + + - Variable: extended-command-history + A history list for arguments that are names of extended commands. + + - Variable: shell-command-history + A history list for arguments that are shell commands. + + - Variable: read-expression-history + A history list for arguments that are Lisp expressions to evaluate. + + - Variable: Info-minibuffer-history + A history list for Info mode's minibuffer. + + - Variable: Manual-page-minibuffer-history + A history list for `manual-entry'. + + There are many other minibuffer history lists, defined by various +libraries. An `M-x apropos' search for `history' should prove fruitful +in discovering them. + + +File: lispref.info, Node: Completion, Next: Yes-or-No Queries, Prev: Minibuffer History, Up: Minibuffers + +Completion +========== + + "Completion" is a feature that fills in the rest of a name starting +from an abbreviation for it. Completion works by comparing the user's +input against a list of valid names and determining how much of the +name is determined uniquely by what the user has typed. For example, +when you type `C-x b' (`switch-to-buffer') and then type the first few +letters of the name of the buffer to which you wish to switch, and then +type (`minibuffer-complete'), Emacs extends the name as far as it +can. + + Standard XEmacs commands offer completion for names of symbols, +files, buffers, and processes; with the functions in this section, you +can implement completion for other kinds of names. + + The `try-completion' function is the basic primitive for completion: +it returns the longest determined completion of a given initial string, +with a given set of strings to match against. + + The function `completing-read' provides a higher-level interface for +completion. A call to `completing-read' specifies how to determine the +list of valid names. The function then activates the minibuffer with a +local keymap that binds a few keys to commands useful for completion. +Other functions provide convenient simple interfaces for reading +certain kinds of names with completion. + +* Menu: + +* Basic Completion:: Low-level functions for completing strings. + (These are too low level to use the minibuffer.) +* Minibuffer Completion:: Invoking the minibuffer with completion. +* Completion Commands:: Minibuffer commands that do completion. +* High-Level Completion:: Convenient special cases of completion + (reading buffer name, file name, etc.) +* Reading File Names:: Using completion to read file names. +* Programmed Completion:: Finding the completions for a given file name. + + +File: lispref.info, Node: Basic Completion, Next: Minibuffer Completion, Up: Completion + +Basic Completion Functions +-------------------------- + + The two functions `try-completion' and `all-completions' have +nothing in themselves to do with minibuffers. We describe them in this +chapter so as to keep them near the higher-level completion features +that do use the minibuffer. + + - Function: try-completion STRING COLLECTION &optional PREDICATE + This function returns the longest common substring of all possible + completions of STRING in COLLECTION. The value of COLLECTION must + be an alist, an obarray, or a function that implements a virtual + set of strings (see below). + + Completion compares STRING against each of the permissible + completions specified by COLLECTION; if the beginning of the + permissible completion equals STRING, it matches. If no + permissible completions match, `try-completion' returns `nil'. If + only one permissible completion matches, and the match is exact, + then `try-completion' returns `t'. Otherwise, the value is the + longest initial sequence common to all the permissible completions + that match. + + If COLLECTION is an alist (*note Association Lists::.), the CARs + of the alist elements form the set of permissible completions. + + If COLLECTION is an obarray (*note Creating Symbols::.), the names + of all symbols in the obarray form the set of permissible + completions. The global variable `obarray' holds an obarray + containing the names of all interned Lisp symbols. + + Note that the only valid way to make a new obarray is to create it + empty and then add symbols to it one by one using `intern'. Also, + you cannot intern a given symbol in more than one obarray. + + If the argument PREDICATE is non-`nil', then it must be a function + of one argument. It is used to test each possible match, and the + match is accepted only if PREDICATE returns non-`nil'. The + argument given to PREDICATE is either a cons cell from the alist + (the CAR of which is a string) or else it is a symbol (*not* a + symbol name) from the obarray. + + You can also use a symbol that is a function as COLLECTION. Then + the function is solely responsible for performing completion; + `try-completion' returns whatever this function returns. The + function is called with three arguments: STRING, PREDICATE and + `nil'. (The reason for the third argument is so that the same + function can be used in `all-completions' and do the appropriate + thing in either case.) *Note Programmed Completion::. + + In the first of the following examples, the string `foo' is + matched by three of the alist CARs. All of the matches begin with + the characters `fooba', so that is the result. In the second + example, there is only one possible match, and it is exact, so the + value is `t'. + + (try-completion + "foo" + '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4))) + => "fooba" + + (try-completion "foo" '(("barfoo" 2) ("foo" 3))) + => t + + In the following example, numerous symbols begin with the + characters `forw', and all of them begin with the word `forward'. + In most of the symbols, this is followed with a `-', but not in + all, so no more than `forward' can be completed. + + (try-completion "forw" obarray) + => "forward" + + Finally, in the following example, only two of the three possible + matches pass the predicate `test' (the string `foobaz' is too + short). Both of those begin with the string `foobar'. + + (defun test (s) + (> (length (car s)) 6)) + => test + + (try-completion + "foo" + '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4)) + 'test) + => "foobar" + + - Function: all-completions STRING COLLECTION &optional PREDICATE + NOSPACE + This function returns a list of all possible completions of + STRING. The parameters to this function are the same as to + `try-completion'. + + If COLLECTION is a function, it is called with three arguments: + STRING, PREDICATE and `t'; then `all-completions' returns whatever + the function returns. *Note Programmed Completion::. + + If NOSPACE is non-`nil', completions that start with a space are + ignored unless STRING also starts with a space. + + Here is an example, using the function `test' shown in the example + for `try-completion': + + (defun test (s) + (> (length (car s)) 6)) + => test + + (all-completions + "foo" + '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4)) + 'test) + => ("foobar1" "foobar2") + + - Variable: completion-ignore-case + If the value of this variable is non-`nil', XEmacs does not + consider case significant in completion. + + +File: lispref.info, Node: Minibuffer Completion, Next: Completion Commands, Prev: Basic Completion, Up: Completion + +Completion and the Minibuffer +----------------------------- + + This section describes the basic interface for reading from the +minibuffer with completion. + + - Function: 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 + PROMPT, which must be a string. If INITIAL is non-`nil', + `completing-read' inserts it into the minibuffer as part of the + input. Then it allows the user to edit the input, providing + several commands to attempt completion. + + The actual completion is done by passing COLLECTION and PREDICATE + to the function `try-completion'. This happens in certain + commands bound in the local keymaps used for completion. + + If REQUIRE-MATCH is `t', the usual minibuffer exit commands won't + exit unless the input completes to an element of COLLECTION. If + REQUIRE-MATCH is neither `nil' nor `t', then the exit commands + won't exit unless the input typed is itself an element of + COLLECTION. If REQUIRE-MATCH is `nil', the exit commands work + regardless of the input in the minibuffer. + + The user can exit with null input by typing with an empty + minibuffer. Then `completing-read' returns `nil'. This is how + the user requests whatever default the command uses for the value + being read. The user can return using in this way regardless + of the value of REQUIRE-MATCH. + + The function `completing-read' works by calling `read-minibuffer'. + It uses `minibuffer-local-completion-map' as the keymap if + REQUIRE-MATCH is `nil', and uses `minibuffer-local-must-match-map' + if REQUIRE-MATCH is non-`nil'. *Note Completion Commands::. + + The argument HIST specifies which history list variable to use for + saving the input and for minibuffer history commands. It defaults + to `minibuffer-history'. *Note Minibuffer History::. + + Completion ignores case when comparing the input against the + possible matches, if the built-in variable + `completion-ignore-case' is non-`nil'. *Note Basic Completion::. + + Here's an example of using `completing-read': + + (completing-read + "Complete a foo: " + '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4)) + nil t "fo") + + ;; After evaluation of the preceding expression, + ;; the following appears in the minibuffer: + + ---------- Buffer: Minibuffer ---------- + Complete a foo: fo-!- + ---------- Buffer: Minibuffer ---------- + + If the user then types ` b ', `completing-read' + returns `barfoo'. + + The `completing-read' function binds three variables to pass + information to the commands that actually do completion. These + variables are `minibuffer-completion-table', + `minibuffer-completion-predicate' and + `minibuffer-completion-confirm'. For more information about them, + see *Note Completion Commands::. + + +File: lispref.info, Node: Completion Commands, Next: High-Level Completion, Prev: Minibuffer Completion, Up: Completion + +Minibuffer Commands That Do Completion +-------------------------------------- + + This section describes the keymaps, commands and user options used in +the minibuffer to do completion. + + - Variable: minibuffer-local-completion-map + `completing-read' uses this value as the local keymap when an + exact match of one of the completions is not required. By + default, this keymap makes the following bindings: + + `?' + `minibuffer-completion-help' + + + `minibuffer-complete-word' + + + `minibuffer-complete' + + with other characters bound as in `minibuffer-local-map' (*note + Text from Minibuffer::.). + + - Variable: minibuffer-local-must-match-map + `completing-read' uses this value as the local keymap when an + exact match of one of the completions is required. Therefore, no + keys are bound to `exit-minibuffer', the command that exits the + minibuffer unconditionally. By default, this keymap makes the + following bindings: + + `?' + `minibuffer-completion-help' + + + `minibuffer-complete-word' + + + `minibuffer-complete' + + + `minibuffer-complete-and-exit' + + + `minibuffer-complete-and-exit' + + with other characters bound as in `minibuffer-local-map'. + + - Variable: minibuffer-completion-table + The value of this variable is the alist or obarray used for + completion in the minibuffer. This is the global variable that + contains what `completing-read' passes to `try-completion'. It is + used by minibuffer completion commands such as + `minibuffer-complete-word'. + + - Variable: minibuffer-completion-predicate + This variable's value is the predicate that `completing-read' + passes to `try-completion'. The variable is also used by the other + minibuffer completion functions. + + - Command: minibuffer-complete-word + This function completes the minibuffer contents by at most a single + word. Even if the minibuffer contents have only one completion, + `minibuffer-complete-word' does not add any characters beyond the + first character that is not a word constituent. *Note Syntax + Tables::. + + - Command: minibuffer-complete + This function completes the minibuffer contents as far as possible. + + - Command: minibuffer-complete-and-exit + This function completes the minibuffer contents, and exits if + confirmation is not required, i.e., if + `minibuffer-completion-confirm' is non-`nil'. If confirmation + *is* required, it is given by repeating this command + immediately--the command is programmed to work without confirmation + when run twice in succession. + + - Variable: minibuffer-completion-confirm + When the value of this variable is non-`nil', XEmacs asks for + confirmation of a completion before exiting the minibuffer. The + function `minibuffer-complete-and-exit' checks the value of this + variable before it exits. + + - Command: minibuffer-completion-help + This function creates a list of the possible completions of the + current minibuffer contents. It works by calling `all-completions' + using the value of the variable `minibuffer-completion-table' as + the COLLECTION argument, and the value of + `minibuffer-completion-predicate' as the PREDICATE argument. The + list of completions is displayed as text in a buffer named + `*Completions*'. + + - Function: display-completion-list COMPLETIONS + This function displays COMPLETIONS to the stream in + `standard-output', usually a buffer. (*Note Read and Print::, for + more information about streams.) The argument COMPLETIONS is + normally a list of completions just returned by `all-completions', + but it does not have to be. Each element may be a symbol or a + string, either of which is simply printed, or a list of two + strings, which is printed as if the strings were concatenated. + + This function is called by `minibuffer-completion-help'. The most + common way to use it is together with + `with-output-to-temp-buffer', like this: + + (with-output-to-temp-buffer "*Completions*" + (display-completion-list + (all-completions (buffer-string) my-alist))) + + - User Option: completion-auto-help + If this variable is non-`nil', the completion commands + automatically display a list of possible completions whenever + nothing can be completed because the next character is not + uniquely determined. + diff --git a/info/lispref.info-16 b/info/lispref.info-16 new file mode 100644 index 0000000..b61a7d9 --- /dev/null +++ b/info/lispref.info-16 @@ -0,0 +1,1174 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: High-Level Completion, Next: Reading File Names, Prev: Completion Commands, Up: Completion + +High-Level Completion Functions +-------------------------------- + + This section describes the higher-level convenient functions for +reading certain sorts of names with completion. + + In most cases, you should not call these functions in the middle of a +Lisp function. When possible, do all minibuffer input as part of +reading the arguments for a command, in the `interactive' spec. *Note +Defining Commands::. + + - Function: read-buffer PROMPT &optional DEFAULT EXISTING + This function reads the name of a buffer and returns it as a + string. The argument DEFAULT is the default name to use, the + value to return if the user exits with an empty minibuffer. If + non-`nil', it should be a string or a buffer. It is mentioned in + the prompt, but is not inserted in the minibuffer as initial input. + + If EXISTING is non-`nil', then the name specified must be that of + an existing buffer. The usual commands to exit the minibuffer do + not exit if the text is not valid, and does completion to + attempt to find a valid name. (However, DEFAULT is not checked + for validity; it is returned, whatever it is, if the user exits + with the minibuffer empty.) + + In the following example, the user enters `minibuffer.t', and then + types . The argument EXISTING is `t', and the only buffer + name starting with the given input is `minibuffer.texi', so that + name is the value. + + (read-buffer "Buffer name? " "foo" t) + ;; After evaluation of the preceding expression, + ;; the following prompt appears, + ;; with an empty minibuffer: + + ---------- Buffer: Minibuffer ---------- + Buffer name? (default foo) -!- + ---------- Buffer: Minibuffer ---------- + + ;; The user types `minibuffer.t '. + => "minibuffer.texi" + + - Function: read-command PROMPT + This function reads the name of a command and returns it as a Lisp + symbol. The argument PROMPT is used as in `read-from-minibuffer'. + Recall that a command is anything for which `commandp' returns + `t', and a command name is a symbol for which `commandp' returns + `t'. *Note Interactive Call::. + + (read-command "Command name? ") + + ;; After evaluation of the preceding expression, + ;; the following prompt appears with an empty minibuffer: + + ---------- Buffer: Minibuffer ---------- + Command name? + ---------- Buffer: Minibuffer ---------- + + If the user types `forward-c ', then this function returns + `forward-char'. + + The `read-command' function is a simplified interface to the + function `completing-read'. It uses the variable `obarray' so as + to complete in the set of extant Lisp symbols, and it uses the + `commandp' predicate so as to accept only command names: + + (read-command PROMPT) + == + (intern (completing-read PROMPT obarray + 'commandp t nil)) + + - Function: read-variable PROMPT + This function reads the name of a user variable and returns it as a + symbol. + + (read-variable "Variable name? ") + + ;; After evaluation of the preceding expression, + ;; the following prompt appears, + ;; with an empty minibuffer: + + ---------- Buffer: Minibuffer ---------- + Variable name? -!- + ---------- Buffer: Minibuffer ---------- + + If the user then types `fill-p ', `read-variable' returns + `fill-prefix'. + + This function is similar to `read-command', but uses the predicate + `user-variable-p' instead of `commandp': + + (read-variable PROMPT) + == + (intern + (completing-read PROMPT obarray + 'user-variable-p t nil)) + + +File: lispref.info, Node: Reading File Names, Next: Programmed Completion, Prev: High-Level Completion, Up: Completion + +Reading File Names +------------------ + + Here is another high-level completion function, designed for reading +a file name. It provides special features including automatic insertion +of the default directory. + + - Function: read-file-name PROMPT &optional DIRECTORY DEFAULT EXISTING + INITIAL + This function reads a file name in the minibuffer, prompting with + PROMPT and providing completion. If DEFAULT is non-`nil', then + the function returns DEFAULT if the user just types . + DEFAULT is not checked for validity; it is returned, whatever it + is, if the user exits with the minibuffer empty. + + If EXISTING is non-`nil', then the user must specify the name of + an existing file; performs completion to make the name valid + if possible, and then refuses to exit if it is not valid. If the + value of EXISTING is neither `nil' nor `t', then also + requires confirmation after completion. If EXISTING is `nil', + then the name of a nonexistent file is acceptable. + + The argument DIRECTORY specifies the directory to use for + completion of relative file names. If `insert-default-directory' + is non-`nil', DIRECTORY is also inserted in the minibuffer as + initial input. It defaults to the current buffer's value of + `default-directory'. + + If you specify INITIAL, that is an initial file name to insert in + the buffer (after with DIRECTORY, if that is inserted). In this + case, point goes at the beginning of INITIAL. The default for + INITIAL is `nil'--don't insert any file name. To see what INITIAL + does, try the command `C-x C-v'. + + Here is an example: + + (read-file-name "The file is ") + + ;; After evaluation of the preceding expression, + ;; the following appears in the minibuffer: + + ---------- Buffer: Minibuffer ---------- + The file is /gp/gnu/elisp/-!- + ---------- Buffer: Minibuffer ---------- + + Typing `manual ' results in the following: + + ---------- Buffer: Minibuffer ---------- + The file is /gp/gnu/elisp/manual.texi-!- + ---------- Buffer: Minibuffer ---------- + + If the user types , `read-file-name' returns the file name as + the string `"/gp/gnu/elisp/manual.texi"'. + + - User Option: insert-default-directory + This variable is used by `read-file-name'. Its value controls + whether `read-file-name' starts by placing the name of the default + directory in the minibuffer, plus the initial file name if any. + If the value of this variable is `nil', then `read-file-name' does + not place any initial input in the minibuffer (unless you specify + initial input with the INITIAL argument). In that case, the + default directory is still used for completion of relative file + names, but is not displayed. + + For example: + + ;; Here the minibuffer starts out with the default directory. + (let ((insert-default-directory t)) + (read-file-name "The file is ")) + + ---------- Buffer: Minibuffer ---------- + The file is ~lewis/manual/-!- + ---------- Buffer: Minibuffer ---------- + + ;; Here the minibuffer is empty and only the prompt + ;; appears on its line. + (let ((insert-default-directory nil)) + (read-file-name "The file is ")) + + ---------- Buffer: Minibuffer ---------- + The file is -!- + ---------- Buffer: Minibuffer ---------- + + +File: lispref.info, Node: Programmed Completion, Prev: Reading File Names, Up: Completion + +Programmed Completion +--------------------- + + Sometimes it is not possible to create an alist or an obarray +containing all the intended possible completions. In such a case, you +can supply your own function to compute the completion of a given +string. This is called "programmed completion". + + To use this feature, pass a symbol with a function definition as the +COLLECTION argument to `completing-read'. The function +`completing-read' arranges to pass your completion function along to +`try-completion' and `all-completions', which will then let your +function do all the work. + + The completion function should accept three arguments: + + * The string to be completed. + + * The predicate function to filter possible matches, or `nil' if + none. Your function should call the predicate for each possible + match, and ignore the possible match if the predicate returns + `nil'. + + * A flag specifying the type of operation. + + There are three flag values for three operations: + + * `nil' specifies `try-completion'. The completion function should + return the completion of the specified string, or `t' if the + string is an exact match already, or `nil' if the string matches no + possibility. + + * `t' specifies `all-completions'. The completion function should + return a list of all possible completions of the specified string. + + * `lambda' specifies a test for an exact match. The completion + function should return `t' if the specified string is an exact + match for some possibility; `nil' otherwise. + + It would be consistent and clean for completion functions to allow +lambda expressions (lists that are functions) as well as function +symbols as COLLECTION, but this is impossible. Lists as completion +tables are already assigned another meaning--as alists. It would be +unreliable to fail to handle an alist normally because it is also a +possible function. So you must arrange for any function you wish to +use for completion to be encapsulated in a symbol. + + Emacs uses programmed completion when completing file names. *Note +File Name Completion::. + + +File: lispref.info, Node: Yes-or-No Queries, Next: Multiple Queries, Prev: Completion, Up: Minibuffers + +Yes-or-No Queries +================= + + This section describes functions used to ask the user a yes-or-no +question. The function `y-or-n-p' can be answered with a single +character; it is useful for questions where an inadvertent wrong answer +will not have serious consequences. `yes-or-no-p' is suitable for more +momentous questions, since it requires three or four characters to +answer. Variations of these functions can be used to ask a yes-or-no +question using a dialog box, or optionally using one. + + If either of these functions is called in a command that was invoked +using the mouse, then it uses a dialog box or pop-up menu to ask the +question. Otherwise, it uses keyboard input. + + Strictly speaking, `yes-or-no-p' uses the minibuffer and `y-or-n-p' +does not; but it seems best to describe them together. + + - Function: y-or-n-p PROMPT + This function asks the user a question, expecting input in the echo + area. It returns `t' if the user types `y', `nil' if the user + types `n'. This function also accepts to mean yes and + to mean no. It accepts `C-]' to mean "quit", like `C-g', because + the question might look like a minibuffer and for that reason the + user might try to use `C-]' to get out. The answer is a single + character, with no needed to terminate it. Upper and lower + case are equivalent. + + "Asking the question" means printing PROMPT in the echo area, + followed by the string `(y or n) '. If the input is not one of + the expected answers (`y', `n', `', `', or something + that quits), the function responds `Please answer y or n.', and + repeats the request. + + This function does not actually use the minibuffer, since it does + not allow editing of the answer. It actually uses the echo area + (*note The Echo Area::.), which uses the same screen space as the + minibuffer. The cursor moves to the echo area while the question + is being asked. + + The answers and their meanings, even `y' and `n', are not + hardwired. The keymap `query-replace-map' specifies them. *Note + Search and Replace::. + + In the following example, the user first types `q', which is + invalid. At the next prompt the user types `y'. + + (y-or-n-p "Do you need a lift? ") + + ;; After evaluation of the preceding expression, + ;; the following prompt appears in the echo area: + + ---------- Echo area ---------- + Do you need a lift? (y or n) + ---------- Echo area ---------- + + ;; If the user then types `q', the following appears: + ---------- Echo area ---------- + Please answer y or n. Do you need a lift? (y or n) + ---------- Echo area ---------- + + ;; When the user types a valid answer, + ;; it is displayed after the question: + ---------- Echo area ---------- + Do you need a lift? (y or n) y + ---------- Echo area ---------- + + We show successive lines of echo area messages, but only one + actually appears on the screen at a time. + + - Function: yes-or-no-p PROMPT + This function asks the user a question, expecting input in the + minibuffer. It returns `t' if the user enters `yes', `nil' if the + user types `no'. The user must type to finalize the + response. Upper and lower case are equivalent. + + `yes-or-no-p' starts by displaying PROMPT in the echo area, + followed by `(yes or no) '. The user must type one of the + expected responses; otherwise, the function responds `Please answer + yes or no.', waits about two seconds and repeats the request. + + `yes-or-no-p' requires more work from the user than `y-or-n-p' and + is appropriate for more crucial decisions. + + Here is an example: + + (yes-or-no-p "Do you really want to remove everything? ") + + ;; After evaluation of the preceding expression, + ;; the following prompt appears, + ;; with an empty minibuffer: + + ---------- Buffer: minibuffer ---------- + Do you really want to remove everything? (yes or no) + ---------- Buffer: minibuffer ---------- + + If the user first types `y ', which is invalid because this + function demands the entire word `yes', it responds by displaying + these prompts, with a brief pause between them: + + ---------- Buffer: minibuffer ---------- + Please answer yes or no. + Do you really want to remove everything? (yes or no) + ---------- Buffer: minibuffer ---------- + + - Function: yes-or-no-p-dialog-box PROMPT + This function asks the user a "y or n" question with a popup dialog + box. It returns `t' if the answer is "yes". PROMPT is the string + to display to ask the question. + + The following functions ask a question either in the minibuffer or a +dialog box, depending on whether the last user event (which presumably +invoked this command) was a keyboard or mouse event. When XEmacs is +running on a window system, the functions `y-or-n-p' and `yes-or-no-p' +are replaced with the following functions, so that menu items bring up +dialog boxes instead of minibuffer questions. + + - Function: y-or-n-p-maybe-dialog-box PROMPT + This function asks user a "y or n" question, using either a dialog + box or the minibuffer, as appropriate. + + - Function: yes-or-no-p-maybe-dialog-box PROMPT + This function asks user a "yes or no" question, using either a + dialog box or the minibuffer, as appropriate. + + +File: lispref.info, Node: Multiple Queries, Next: Minibuffer Misc, Prev: Yes-or-No Queries, Up: Minibuffers + +Asking Multiple Y-or-N Questions +================================ + + When you have a series of similar questions to ask, such as "Do you +want to save this buffer" for each buffer in turn, you should use +`map-y-or-n-p' to ask the collection of questions, rather than asking +each question individually. This gives the user certain convenient +facilities such as the ability to answer the whole series at once. + + - Function: map-y-or-n-p PROMPTER ACTOR LIST &optional HELP + ACTION-ALIST + This function, new in Emacs 19, asks the user a series of + questions, reading a single-character answer in the echo area for + each one. + + The value of LIST specifies the objects to ask questions about. + It should be either a list of objects or a generator function. If + it is a function, it should expect no arguments, and should return + either the next object to ask about, or `nil' meaning stop asking + questions. + + The argument PROMPTER specifies how to ask each question. If + PROMPTER is a string, the question text is computed like this: + + (format PROMPTER OBJECT) + + where OBJECT is the next object to ask about (as obtained from + LIST). + + If not a string, PROMPTER should be a function of one argument + (the next object to ask about) and should return the question + text. If the value is a string, that is the question to ask the + user. The function can also return `t' meaning do act on this + object (and don't ask the user), or `nil' meaning ignore this + object (and don't ask the user). + + The argument ACTOR says how to act on the answers that the user + gives. It should be a function of one argument, and it is called + with each object that the user says yes for. Its argument is + always an object obtained from LIST. + + If the argument HELP is given, it should be a list of this form: + + (SINGULAR PLURAL ACTION) + + where SINGULAR is a string containing a singular noun that + describes the objects conceptually being acted on, PLURAL is the + corresponding plural noun, and ACTION is a transitive verb + describing what ACTOR does. + + If you don't specify HELP, the default is `("object" "objects" + "act on")'. + + Each time a question is asked, the user may enter `y', `Y', or + to act on that object; `n', `N', or to skip that + object; `!' to act on all following objects; or `q' to exit + (skip all following objects); `.' (period) to act on the current + object and then exit; or `C-h' to get help. These are the same + answers that `query-replace' accepts. The keymap + `query-replace-map' defines their meaning for `map-y-or-n-p' as + well as for `query-replace'; see *Note Search and Replace::. + + You can use ACTION-ALIST to specify additional possible answers + and what they mean. It is an alist of elements of the form `(CHAR + FUNCTION HELP)', each of which defines one additional answer. In + this element, CHAR is a character (the answer); FUNCTION is a + function of one argument (an object from LIST); HELP is a string. + + When the user responds with CHAR, `map-y-or-n-p' calls FUNCTION. + If it returns non-`nil', the object is considered "acted upon", + and `map-y-or-n-p' advances to the next object in LIST. If it + returns `nil', the prompt is repeated for the same object. + + If `map-y-or-n-p' is called in a command that was invoked using the + mouse--more precisely, if `last-nonmenu-event' (*note Command Loop + Info::.) is either `nil' or a list--then it uses a dialog box or + pop-up menu to ask the question. In this case, it does not use + keyboard input or the echo area. You can force use of the mouse + or use of keyboard input by binding `last-nonmenu-event' to a + suitable value around the call. + + The return value of `map-y-or-n-p' is the number of objects acted + on. + + +File: lispref.info, Node: Minibuffer Misc, Prev: Multiple Queries, Up: Minibuffers + +Minibuffer Miscellany +===================== + + This section describes some basic functions and variables related to +minibuffers. + + - Command: exit-minibuffer + This command exits the active minibuffer. It is normally bound to + keys in minibuffer local keymaps. + + - Command: self-insert-and-exit + This command exits the active minibuffer after inserting the last + character typed on the keyboard (found in `last-command-char'; + *note Command Loop Info::.). + + - Command: previous-history-element N + This command replaces the minibuffer contents with the value of the + Nth previous (older) history element. + + - Command: next-history-element N + This command replaces the minibuffer contents with the value of the + Nth more recent history element. + + - Command: previous-matching-history-element PATTERN + This command replaces the minibuffer contents with the value of the + previous (older) history element that matches PATTERN (a regular + expression). + + - Command: next-matching-history-element PATTERN + This command replaces the minibuffer contents with the value of + the next (newer) history element that matches PATTERN (a regular + expression). + + - Function: minibuffer-prompt + This function returns the prompt string of the currently active + minibuffer. If no minibuffer is active, it returns `nil'. + + - Function: minibuffer-prompt-width + This function returns the display width of the prompt string of the + currently active minibuffer. If no minibuffer is active, it + returns 0. + + - Variable: minibuffer-setup-hook + This is a normal hook that is run whenever the minibuffer is + entered. *Note Hooks::. + + - Variable: minibuffer-exit-hook + This is a normal hook that is run whenever the minibuffer is + exited. *Note Hooks::. + + - Variable: minibuffer-help-form + The current value of this variable is used to rebind `help-form' + locally inside the minibuffer (*note Help Functions::.). + + - Function: active-minibuffer-window + This function returns the currently active minibuffer window, or + `nil' if none is currently active. + + - Function: minibuffer-window &optional FRAME + This function returns the minibuffer window used for frame FRAME. + If FRAME is `nil', that stands for the current frame. Note that + the minibuffer window used by a frame need not be part of that + frame--a frame that has no minibuffer of its own necessarily uses + some other frame's minibuffer window. + + - Function: window-minibuffer-p WINDOW + This function returns non-`nil' if WINDOW is a minibuffer window. + + It is not correct to determine whether a given window is a +minibuffer by comparing it with the result of `(minibuffer-window)', +because there can be more than one minibuffer window if there is more +than one frame. + + - Function: minibuffer-window-active-p WINDOW + This function returns non-`nil' if WINDOW, assumed to be a + minibuffer window, is currently active. + + - Variable: minibuffer-scroll-window + If the value of this variable is non-`nil', it should be a window + object. When the function `scroll-other-window' is called in the + minibuffer, it scrolls this window. + + Finally, some functions and variables deal with recursive minibuffers +(*note Recursive Editing::.): + + - Function: minibuffer-depth + This function returns the current depth of activations of the + minibuffer, a nonnegative integer. If no minibuffers are active, + it returns zero. + + - User Option: enable-recursive-minibuffers + If this variable is non-`nil', you can invoke commands (such as + `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. + + This variable only affects invoking the minibuffer while the + minibuffer window is selected. If you switch windows while in the + minibuffer, you can always invoke minibuffer commands while some + other window is selected. + + In FSF Emacs 19, if a command name has a property +`enable-recursive-minibuffers' that is non-`nil', then the command can +use the minibuffer to read arguments even if it is invoked from the +minibuffer. The minibuffer command `next-matching-history-element' +(normally `M-s' in the minibuffer) uses this feature. + + This is not implemented in XEmacs because it is a kludge. If you +want to explicitly set the value of `enable-recursive-minibuffers' in +this fashion, just use an evaluated interactive spec and bind +`enable-recursive-minibuffers' while reading from the minibuffer. See +the definition of `next-matching-history-element' in +`lisp/prim/minibuf.el'. + + +File: lispref.info, Node: Command Loop, Next: Keymaps, Prev: Minibuffers, Up: Top + +Command Loop +************ + + When you run XEmacs, it enters the "editor command loop" almost +immediately. This loop reads events, executes their definitions, and +displays the results. In this chapter, we describe how these things +are done, and the subroutines that allow Lisp programs to do them. + +* Menu: + +* Command Overview:: How the command loop reads commands. +* Defining Commands:: Specifying how a function should read arguments. +* Interactive Call:: Calling a command, so that it will read arguments. +* Command Loop Info:: Variables set by the command loop for you to examine. +* Events:: What input looks like when you read it. +* Reading Input:: How to read input events from the keyboard or mouse. +* Waiting:: Waiting for user input or elapsed time. +* Quitting:: How `C-g' works. How to catch or defer quitting. +* Prefix Command Arguments:: How the commands to set prefix args work. +* Recursive Editing:: Entering a recursive edit, + and why you usually shouldn't. +* Disabling Commands:: How the command loop handles disabled commands. +* Command History:: How the command history is set up, and how accessed. +* Keyboard Macros:: How keyboard macros are implemented. + + +File: lispref.info, Node: Command Overview, Next: Defining Commands, Up: Command Loop + +Command Loop Overview +===================== + + The command loop in XEmacs is a standard event loop, reading events +one at a time with `next-event' and handling them with +`dispatch-event'. An event is typically a single user action, such as +a keypress, mouse movement, or menu selection; but they can also be +notifications from the window system, informing XEmacs that (for +example) part of its window was just uncovered and needs to be redrawn. +*Note Events::. Pending events are held in a first-in, first-out list +called the "event queue": events are read from the head of the list, +and newly arriving events are added to the tail. In this way, events +are always processed in the order in which they arrive. + + `dispatch-event' does most of the work of handling user actions. +The first thing it must do is put the events together into a key +sequence, which is a sequence of events that translates into a command. +It does this by consulting the active keymaps, which specify what the +valid key sequences are and how to translate them into commands. *Note +Key Lookup::, for information on how this is done. The result of the +translation should be a keyboard macro or an interactively callable +function. If the key is `M-x', then it reads the name of another +command, which it then calls. This is done by the command +`execute-extended-command' (*note Interactive Call::.). + + To execute a command requires first reading the arguments for it. +This is done by calling `command-execute' (*note Interactive Call::.). +For commands written in Lisp, the `interactive' specification says how +to read the arguments. This may use the prefix argument (*note Prefix +Command Arguments::.) or may read with prompting in the minibuffer +(*note Minibuffers::.). For example, the command `find-file' has an +`interactive' specification which says to read a file name using the +minibuffer. The command's function body does not use the minibuffer; +if you call this command from Lisp code as a function, you must supply +the file name string as an ordinary Lisp function argument. + + If the command is a string or vector (i.e., a keyboard macro) then +`execute-kbd-macro' is used to execute it. You can call this function +yourself (*note Keyboard Macros::.). + + To terminate the execution of a running command, type `C-g'. This +character causes "quitting" (*note Quitting::.). + + - Variable: pre-command-hook + The editor command loop runs this normal hook before each command. + At that time, `this-command' contains the command that is about to + run, and `last-command' describes the previous command. *Note + Hooks::. + + - Variable: post-command-hook + The editor command loop runs this normal hook after each command. + (In FSF Emacs, it is also run when the command loop is entered, or + reentered after an error or quit.) At that time, `this-command' + describes the command that just ran, and `last-command' describes + the command before that. *Note Hooks::. + + Quitting is suppressed while running `pre-command-hook' and +`post-command-hook'. If an error happens while executing one of these +hooks, it terminates execution of the hook, but that is all it does. + + +File: lispref.info, Node: Defining Commands, Next: Interactive Call, Prev: Command Overview, Up: Command Loop + +Defining Commands +================= + + A Lisp function becomes a command when its body contains, at top +level, a form that calls the special form `interactive'. This form +does nothing when actually executed, but its presence serves as a flag +to indicate that interactive calling is permitted. Its argument +controls the reading of arguments for an interactive call. + +* Menu: + +* Using Interactive:: General rules for `interactive'. +* Interactive Codes:: The standard letter-codes for reading arguments + in various ways. +* Interactive Examples:: Examples of how to read interactive arguments. + + +File: lispref.info, Node: Using Interactive, Next: Interactive Codes, Up: Defining Commands + +Using `interactive' +------------------- + + This section describes how to write the `interactive' form that +makes a Lisp function an interactively-callable command. + + - Special Form: interactive ARG-DESCRIPTOR + This special form declares that the function in which it appears + is a command, and that it may therefore be called interactively + (via `M-x' or by entering a key sequence bound to it). The + argument ARG-DESCRIPTOR declares how to compute the arguments to + the command when the command is called interactively. + + A command may be called from Lisp programs like any other + function, but then the caller supplies the arguments and + ARG-DESCRIPTOR has no effect. + + The `interactive' form has its effect because the command loop + (actually, its subroutine `call-interactively') scans through the + function definition looking for it, before calling the function. + Once the function is called, all its body forms including the + `interactive' form are executed, but at this time `interactive' + simply returns `nil' without even evaluating its argument. + + There are three possibilities for the argument ARG-DESCRIPTOR: + + * It may be omitted or `nil'; then the command is called with no + arguments. This leads quickly to an error if the command requires + one or more arguments. + + * It may be a Lisp expression that is not a string; then it should + be a form that is evaluated to get a list of arguments to pass to + the command. + + If this expression reads keyboard input (this includes using the + minibuffer), keep in mind that the integer value of point or the + mark before reading input may be incorrect after reading input. + This is because the current buffer may be receiving subprocess + output; if subprocess output arrives while the command is waiting + for input, it could relocate point and the mark. + + Here's an example of what *not* to do: + + (interactive + (list (region-beginning) (region-end) + (read-string "Foo: " nil 'my-history))) + + Here's how to avoid the problem, by examining point and the mark + only after reading the keyboard input: + + (interactive + (let ((string (read-string "Foo: " nil 'my-history))) + (list (region-beginning) (region-end) string))) + + * It may be a string; then its contents should consist of a code + character followed by a prompt (which some code characters use and + some ignore). The prompt ends either with the end of the string + or with a newline. Here is a simple example: + + (interactive "bFrobnicate buffer: ") + + The code letter `b' says to read the name of an existing buffer, + with completion. The buffer name is the sole argument passed to + the command. The rest of the string is a prompt. + + If there is a newline character in the string, it terminates the + prompt. If the string does not end there, then the rest of the + string should contain another code character and prompt, + specifying another argument. You can specify any number of + arguments in this way. + + The prompt string can use `%' to include previous argument values + (starting with the first argument) in the prompt. This is done + using `format' (*note Formatting Strings::.). For example, here + is how you could read the name of an existing buffer followed by a + new name to give to that buffer: + + (interactive "bBuffer to rename: \nsRename buffer %s to: ") + + If the first character in the string is `*', then an error is + signaled if the buffer is read-only. + + If the first character in the string is `@', and if the key + sequence used to invoke the command includes any mouse events, then + the window associated with the first of those events is selected + before the command is run. + + If the first character in the string is `_', then this command will + not cause the region to be deactivated when it completes; that is, + `zmacs-region-stays' will be set to `t' when the command exits + successfully. + + You can use `*', `@', and `_' together; the order does not matter. + Actual reading of arguments is controlled by the rest of the + prompt string (starting with the first character that is not `*', + `@', or `_'). + + - Function: function-interactive FUNCTION + This function retrieves the interactive specification of FUNCTION, + which may be any funcallable object. The specification will be + returned as the list of the symbol `interactive' and the specs. If + FUNCTION is not interactive, `nil' will be returned. + + +File: lispref.info, Node: Interactive Codes, Next: Interactive Examples, Prev: Using Interactive, Up: Defining Commands + +Code Characters for `interactive' +--------------------------------- + + The code character descriptions below contain a number of key words, +defined here as follows: + +Completion + Provide completion. , , and perform name + completion because the argument is read using `completing-read' + (*note Completion::.). `?' displays a list of possible + completions. + +Existing + Require the name of an existing object. An invalid name is not + accepted; the commands to exit the minibuffer do not exit if the + current input is not valid. + +Default + A default value of some sort is used if the user enters no text in + the minibuffer. The default depends on the code character. + +No I/O + This code letter computes an argument without reading any input. + Therefore, it does not use a prompt string, and any prompt string + you supply is ignored. + + Even though the code letter doesn't use a prompt string, you must + follow it with a newline if it is not the last code character in + the string. + +Prompt + A prompt immediately follows the code character. The prompt ends + either with the end of the string or with a newline. + +Special + This code character is meaningful only at the beginning of the + interactive string, and it does not look for a prompt or a newline. + It is a single, isolated character. + + Here are the code character descriptions for use with `interactive': + +`*' + Signal an error if the current buffer is read-only. Special. + +`@' + Select the window mentioned in the first mouse event in the key + sequence that invoked this command. Special. + +`_' + Do not cause the region to be deactivated when this command + completes. Special. + +`a' + A function name (i.e., a symbol satisfying `fboundp'). Existing, + Completion, Prompt. + +`b' + The name of an existing buffer. By default, uses the name of the + current buffer (*note Buffers::.). Existing, Completion, Default, + Prompt. + +`B' + A buffer name. The buffer need not exist. By default, uses the + name of a recently used buffer other than the current buffer. + Completion, Default, Prompt. + +`c' + A character. The cursor does not move into the echo area. Prompt. + +`C' + A command name (i.e., a symbol satisfying `commandp'). Existing, + Completion, Prompt. + +`d' + The position of point, as an integer (*note Point::.). No I/O. + +`D' + A directory name. The default is the current default directory of + the current buffer, `default-directory' (*note System + Environment::.). Existing, Completion, Default, Prompt. + +`e' + The last mouse-button or misc-user event in the key sequence that + invoked the command. No I/O. + + You can use `e' more than once in a single command's interactive + specification. If the key sequence that invoked the command has N + mouse-button or misc-user events, the Nth `e' provides the Nth + such event. + +`f' + A file name of an existing file (*note File Names::.). The default + directory is `default-directory'. Existing, Completion, Default, + Prompt. + +`F' + A file name. The file need not exist. Completion, Default, + Prompt. + +`k' + A key sequence (*note Keymap Terminology::.). This keeps reading + events until a command (or undefined command) is found in the + current key maps. The key sequence argument is represented as a + vector of events. The cursor does not move into the echo area. + Prompt. + + This kind of input is used by commands such as `describe-key' and + `global-set-key'. + +`K' + A key sequence, whose definition you intend to change. This works + like `k', except that it suppresses, for the last input event in + the key sequence, the conversions that are normally used (when + necessary) to convert an undefined key into a defined one. + +`m' + The position of the mark, as an integer. No I/O. + +`n' + A number read with the minibuffer. If the input is not a number, + the user is asked to try again. The prefix argument, if any, is + not used. Prompt. + +`N' + The raw prefix argument. If the prefix argument is `nil', then + read a number as with `n'. Requires a number. *Note Prefix + Command Arguments::. Prompt. + +`p' + The numeric prefix argument. (Note that this `p' is lower case.) + No I/O. + +`P' + The raw prefix argument. (Note that this `P' is upper case.) No + I/O. + +`r' + Point and the mark, as two numeric arguments, smallest first. + This is the only code letter that specifies two successive + arguments rather than one. No I/O. + +`s' + Arbitrary text, read in the minibuffer and returned as a string + (*note Text from Minibuffer::.). Terminate the input with either + or . (`C-q' may be used to include either of these + characters in the input.) Prompt. + +`S' + An interned symbol whose name is read in the minibuffer. Any + whitespace character terminates the input. (Use `C-q' to include + whitespace in the string.) Other characters that normally + terminate a symbol (e.g., parentheses and brackets) do not do so + here. Prompt. + +`v' + A variable declared to be a user option (i.e., satisfying the + predicate `user-variable-p'). *Note High-Level Completion::. + Existing, Completion, Prompt. + +`x' + A Lisp object, specified with its read syntax, terminated with a + or . The object is not evaluated. *Note Object from + Minibuffer::. Prompt. + +`X' + A Lisp form is read as with `x', but then evaluated so that its + value becomes the argument for the command. Prompt. + + +File: lispref.info, Node: Interactive Examples, Prev: Interactive Codes, Up: Defining Commands + +Examples of Using `interactive' +------------------------------- + + Here are some examples of `interactive': + + (defun foo1 () ; `foo1' takes no arguments, + (interactive) ; just moves forward two words. + (forward-word 2)) + => foo1 + + (defun foo2 (n) ; `foo2' takes one argument, + (interactive "p") ; which is the numeric prefix. + (forward-word (* 2 n))) + => foo2 + + (defun foo3 (n) ; `foo3' takes one argument, + (interactive "nCount:") ; which is read with the Minibuffer. + (forward-word (* 2 n))) + => foo3 + + (defun three-b (b1 b2 b3) + "Select three existing buffers. + Put them into three windows, selecting the last one." + (interactive "bBuffer1:\nbBuffer2:\nbBuffer3:") + (delete-other-windows) + (split-window (selected-window) 8) + (switch-to-buffer b1) + (other-window 1) + (split-window (selected-window) 8) + (switch-to-buffer b2) + (other-window 1) + (switch-to-buffer b3)) + => three-b + (three-b "*scratch*" "declarations.texi" "*mail*") + => nil + + +File: lispref.info, Node: Interactive Call, Next: Command Loop Info, Prev: Defining Commands, Up: Command Loop + +Interactive Call +================ + + After the command loop has translated a key sequence into a +definition, it invokes that definition using the function +`command-execute'. If the definition is a function that is a command, +`command-execute' calls `call-interactively', which reads the arguments +and calls the command. You can also call these functions yourself. + + - Function: commandp OBJECT + Returns `t' if OBJECT is suitable for calling interactively; that + is, if OBJECT is a command. Otherwise, returns `nil'. + + The interactively callable objects include strings and vectors + (treated as keyboard macros), lambda expressions that contain a + top-level call to `interactive', compiled-function objects made + from such lambda expressions, autoload objects that are declared + as interactive (non-`nil' fourth argument to `autoload'), and some + of the primitive functions. + + A symbol is `commandp' if its function definition is `commandp'. + + Keys and keymaps are not commands. Rather, they are used to look + up commands (*note Keymaps::.). + + See `documentation' in *Note Accessing Documentation::, for a + realistic example of using `commandp'. + + - Function: call-interactively COMMAND &optional RECORD-FLAG + This function calls the interactively callable function COMMAND, + reading arguments according to its interactive calling + specifications. An error is signaled if COMMAND is not a function + or if it cannot be called interactively (i.e., is not a command). + Note that keyboard macros (strings and vectors) are not accepted, + even though they are considered commands, because they are not + functions. + + If RECORD-FLAG is the symbol `lambda', the interactive calling + arguments for `command' are read and returned as a list, but the + function is not called on them. + + If RECORD-FLAG is `t', then this command and its arguments are + unconditionally added to the list `command-history'. Otherwise, + the command is added only if it uses the minibuffer to read an + argument. *Note Command History::. + + - Function: command-execute COMMAND &optional RECORD-FLAG + This function executes COMMAND as an editing command. The + argument COMMAND must satisfy the `commandp' predicate; i.e., it + must be an interactively callable function or a keyboard macro. + + A string or vector as COMMAND is executed with + `execute-kbd-macro'. A function is passed to + `call-interactively', along with the optional RECORD-FLAG. + + A symbol is handled by using its function definition in its place. + A symbol with an `autoload' definition counts as a command if it + was declared to stand for an interactively callable function. + Such a definition is handled by loading the specified library and + then rechecking the definition of the symbol. + + - Command: execute-extended-command PREFIX-ARGUMENT + This function reads a command name from the minibuffer using + `completing-read' (*note Completion::.). Then it uses + `command-execute' to call the specified command. Whatever that + command returns becomes the value of `execute-extended-command'. + + If the command asks for a prefix argument, it receives the value + PREFIX-ARGUMENT. If `execute-extended-command' is called + interactively, the current raw prefix argument is used for + PREFIX-ARGUMENT, and thus passed on to whatever command is run. + + `execute-extended-command' is the normal definition of `M-x', so + it uses the string `M-x ' as a prompt. (It would be better to + take the prompt from the events used to invoke + `execute-extended-command', but that is painful to implement.) A + description of the value of the prefix argument, if any, also + becomes part of the prompt. + + (execute-extended-command 1) + ---------- Buffer: Minibuffer ---------- + 1 M-x forward-word RET + ---------- Buffer: Minibuffer ---------- + => t + + - Function: interactive-p + This function returns `t' if the containing function (the one that + called `interactive-p') was called interactively, with the function + `call-interactively'. (It makes no difference whether + `call-interactively' was called from Lisp or directly from the + editor command loop.) If the containing function was called by + Lisp evaluation (or with `apply' or `funcall'), then it was not + called interactively. + + The most common use of `interactive-p' is for deciding whether to + print an informative message. As a special exception, + `interactive-p' returns `nil' whenever a keyboard macro is being + run. This is to suppress the informative messages and speed + execution of the macro. + + For example: + + (defun foo () + (interactive) + (and (interactive-p) + (message "foo"))) + => foo + + (defun bar () + (interactive) + (setq foobar (list (foo) (interactive-p)))) + => bar + + ;; Type `M-x foo'. + -| foo + + ;; Type `M-x bar'. + ;; This does not print anything. + + foobar + => (nil t) + diff --git a/info/lispref.info-17 b/info/lispref.info-17 new file mode 100644 index 0000000..15f004a --- /dev/null +++ b/info/lispref.info-17 @@ -0,0 +1,1238 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Command Loop Info, Next: Events, Prev: Interactive Call, Up: Command Loop + +Information from the Command Loop +================================= + + The editor command loop sets several Lisp variables to keep status +records for itself and for commands that are run. + + - Variable: last-command + This variable records the name of the previous command executed by + the command loop (the one before the current command). Normally + the value is a symbol with a function definition, but this is not + guaranteed. + + The value is copied from `this-command' when a command returns to + the command loop, except when the command specifies a prefix + argument for the following command. + + - Variable: this-command + This variable records the name of the command now being executed by + the editor command loop. Like `last-command', it is normally a + symbol with a function definition. + + The command loop sets this variable just before running a command, + and copies its value into `last-command' when the command finishes + (unless the command specifies a prefix argument for the following + command). + + Some commands set this variable during their execution, as a flag + for whatever command runs next. In particular, the functions for + killing text set `this-command' to `kill-region' so that any kill + commands immediately following will know to append the killed text + to the previous kill. + + If you do not want a particular command to be recognized as the +previous command in the case where it got an error, you must code that +command to prevent this. One way is to set `this-command' to `t' at the +beginning of the command, and set `this-command' back to its proper +value at the end, like this: + + (defun foo (args...) + (interactive ...) + (let ((old-this-command this-command)) + (setq this-command t) + ...do the work... + (setq this-command old-this-command))) + + - Function: this-command-keys + This function returns a vector containing the key and mouse events + that invoked the present command, plus any previous commands that + generated the prefix argument for this command. (Note: this is not + the same as in FSF Emacs, which can return a string.) *Note + Events::. + + This function copies the vector and the events; it is safe to keep + and modify them. + + (this-command-keys) + ;; Now use `C-u C-x C-e' to evaluate that. + => [# # #] + + - Variable: last-command-event + This variable is set to the last input event that was read by the + command loop as part of a command. The principal use of this + variable is in `self-insert-command', which uses it to decide which + character to insert. + + This variable is off limits: you may not set its value or modify + the event that is its value, as it is destructively modified by + `read-key-sequence'. If you want to keep a pointer to this value, + you must use `copy-event'. + + Note that this variable is an alias for `last-command-char' in FSF + Emacs. + + last-command-event + ;; Now type `C-u C-x C-e'. + => # + + - Variable: last-command-char + If the value of `last-command-event' is a keyboard event, then this + is the nearest character equivalent to it (or `nil' if there is no + character equivalent). `last-command-char' is the character that + `self-insert-command' will insert in the buffer. Remember that + there is *not* a one-to-one mapping between keyboard events and + XEmacs characters: many keyboard events have no corresponding + character, and when the Mule feature is available, most characters + can not be input on standard keyboards, except possibly with help + from an input method. 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 characters. + + This variable exists for compatibility with Emacs version 18. + + last-command-char + ;; Now use `C-u C-x C-e' to evaluate that. + => ?\^E + + + - Variable: current-mouse-event + This variable holds the mouse-button event which invoked this + command, or `nil'. This is what `(interactive "e")' returns. + + - Variable: echo-keystrokes + This variable determines how much time should elapse before command + characters echo. Its value must be an integer, which specifies the + number of seconds to wait before echoing. If the user types a + prefix key (say `C-x') and then delays this many seconds before + continuing, the key `C-x' is echoed in the echo area. Any + subsequent characters in the same command will be echoed as well. + + If the value is zero, then command input is not echoed. + + +File: lispref.info, Node: Events, Next: Reading Input, Prev: Command Loop Info, Up: Command Loop + +Events +====== + + The XEmacs command loop reads a sequence of "events" that represent +keyboard or mouse activity. Unlike in Emacs 18 and in FSF Emacs, +events are a primitive Lisp type that must be manipulated using their +own accessor and settor primitives. This section describes the +representation and meaning of input events in detail. + + A key sequence that starts with a mouse event is read using the +keymaps of the buffer in the window that the mouse was in, not the +current buffer. This does not imply that clicking in a window selects +that window or its buffer--that is entirely under the control of the +command binding of the key sequence. + + For information about how exactly the XEmacs command loop works, +*Note Reading Input::. + + - Function: eventp OBJECT + This function returns non-`nil' if EVENT is an input event. + +* Menu: + +* Event Types:: Events come in different types. +* Event Contents:: What the contents of each event type are. +* Event Predicates:: Querying whether an event is of a + particular type. +* Accessing Mouse Event Positions:: + Determining where a mouse event occurred, + and over what. +* Accessing Other Event Info:: Accessing non-positional event info. +* Working With Events:: Creating, copying, and destroying events. +* Converting Events:: Converting between events, keys, and + characters. + + +File: lispref.info, Node: Event Types, Next: Event Contents, Up: Events + +Event Types +----------- + + Events represent keyboard or mouse activity or status changes of +various sorts, such as process input being available or a timeout being +triggered. The different event types are as follows: + +key-press event + A key was pressed. Note that modifier keys such as "control", + "shift", and "alt" do not generate events; instead, they are + tracked internally by XEmacs, and non-modifier key presses + generate events that specify both the key pressed and the + modifiers that were held down at the time. + +button-press event +button-release event + A button was pressed or released. Along with the button that was + pressed or released, button events specify the modifier keys that + were held down at the time and the position of the pointer at the + time. + +motion event + The pointer was moved. Along with the position of the pointer, + these events also specify the modifier keys that were held down at + the time. + +misc-user event + A menu item was selected, the scrollbar was used, or a drag or a + drop occurred. + +process event + Input is available on a process. + +timeout event + A timeout has triggered. + +magic event + Some window-system-specific action (such as a frame being resized + or a portion of a frame needing to be redrawn) has occurred. The + contents of this event are not accessible at the E-Lisp level, but + `dispatch-event' knows what to do with an event of this type. + +eval event + This is a special kind of event specifying that a particular + function needs to be called when this event is dispatched. An + event of this type is sometimes placed in the event queue when a + magic event is processed. This kind of event should generally + just be passed off to `dispatch-event'. *Note Dispatching an + Event::. + + +File: lispref.info, Node: Event Contents, Next: Event Predicates, Prev: Event Types, Up: Events + +Contents of the Different Types of Events +----------------------------------------- + + Every event, no matter what type it is, contains a timestamp (which +is typically an offset in milliseconds from when the X server was +started) indicating when the event occurred. In addition, many events +contain a "channel", which specifies which frame the event occurred on, +and/or a value indicating which modifier keys (shift, control, etc.) +were held down at the time of the event. + + The contents of each event are as follows: + +key-press event + + channel + + timestamp + + key + Which key was pressed. This is an integer (in the printing + ASCII range: >32 and <127) or a symbol such as `left' or + `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" key is treated as either "a" or + "A" depending on the state of the shift key, and the "1" key + is similarly treated as either "1" or "!" on most keyboards. + In such cases, the shift key does not show up in the modifier + list. For other keys, such as `backspace', the shift key + shows up as a regular modifier. + + modifiers + Which modifier keys were pressed. As mentioned above, the + shift key is not treated as a modifier for many keys and will + not show up in this list in such cases. + +button-press event +button-release event + + channel + + timestamp + + button + What button went down or up. Buttons are numbered starting + at 1. + + modifiers + Which modifier keys were pressed. The special business + mentioned above for the shift key does *not* apply to mouse + events. + + x + y + The position of the pointer (in pixels) at the time of the + event. + +pointer-motion event + + channel + + timestamp + + x + y + The position of the pointer (in pixels) after it moved. + + modifiers + Which modifier keys were pressed. The special business + mentioned above for the shift key does *not* apply to mouse + events. + +misc-user event + + timestamp + + function + The E-Lisp function to call for this event. This is normally + either `eval' or `call-interactively'. + + object + The object to pass to the function. This is normally the + callback that was specified in the menu description. + + button + What button went down or up. Buttons are numbered starting + at 1. + + modifiers + Which modifier keys were pressed. The special business + mentioned above for the shift key does *not* apply to mouse + events. + + x + y + The position of the pointer (in pixels) at the time of the + event. + +process_event + + timestamp + + process + The Emacs "process" object in question. + +timeout event + + timestamp + + function + The E-Lisp function to call for this timeout. It is called + with one argument, the event. + + object + Some Lisp object associated with this timeout, to make it + easier to tell them apart. The function and object for this + event were specified when the timeout was set. + +magic event + + timestamp + (The rest of the information in this event is not user-accessible.) + +eval event + + timestamp + + function + An E-Lisp function to call when this event is dispatched. + + object + The object to pass to the function. The function and object + are set when the event is created. + + - Function: event-type EVENT + Return the type of EVENT. + + This will be a symbol; one of + + `key-press' + A key was pressed. + + `button-press' + A mouse button was pressed. + + `button-release' + A mouse button was released. + + `motion' + The mouse moved. + + `misc-user' + Some other user action happened; typically, this is a menu + selection, scrollbar action, or drag and drop action. + + `process' + Input is available from a subprocess. + + `timeout' + A timeout has expired. + + `eval' + This causes a specified action to occur when dispatched. + + `magic' + Some window-system-specific event has occurred. + + +File: lispref.info, Node: Event Predicates, Next: Accessing Mouse Event Positions, Prev: Event Contents, Up: Events + +Event Predicates +---------------- + + The following predicates return whether an object is an event of a +particular type. + + - Function: key-press-event-p OBJECT + This is true if OBJECT is a key-press event. + + - Function: button-event-p OBJECT OBJECT + This is true if OBJECT is a mouse button-press or button-release + event. + + - Function: button-press-event-p OBJECT + This is true if OBJECT is a mouse button-press event. + + - Function: button-release-event-p OBJECT + This is true if OBJECT is a mouse button-release event. + + - Function: motion-event-p OBJECT + This is true if OBJECT is a mouse motion event. + + - Function: mouse-event-p OBJECT + This is true if OBJECT is a mouse button-press, button-release or + motion event. + + - Function: eval-event-p OBJECT + This is true if OBJECT is an eval event. + + - Function: misc-user-event-p OBJECT + This is true if OBJECT is a misc-user event. + + - Function: process-event-p OBJECT + This is true if OBJECT is a process event. + + - Function: timeout-event-p OBJECT + This is true if OBJECT is a timeout event. + + - Function: event-live-p OBJECT + This is true if OBJECT is any event that has not been deallocated. + + +File: lispref.info, Node: Accessing Mouse Event Positions, Next: Accessing Other Event Info, Prev: Event Predicates, Up: Events + +Accessing the Position of a Mouse Event +--------------------------------------- + + Unlike other events, mouse events (i.e. motion, button-press, +button-release, and drag or drop type misc-user events) occur in a +particular location on the screen. Many primitives are provided for +determining exactly where the event occurred and what is under that +location. + +* Menu: + +* Frame-Level Event Position Info:: +* Window-Level Event Position Info:: +* Event Text Position Info:: +* Event Glyph Position Info:: +* Event Toolbar Position Info:: +* Other Event Position Info:: + + +File: lispref.info, Node: Frame-Level Event Position Info, Next: Window-Level Event Position Info, Up: Accessing Mouse Event Positions + +Frame-Level Event Position Info +............................... + + The following functions return frame-level information about where a +mouse event occurred. + + - Function: event-frame EVENT + This function returns the "channel" or frame that the given mouse + motion, button press, button release, or misc-user event occurred + in. This will be `nil' for non-mouse events. + + - Function: event-x-pixel EVENT + This function returns the X position in pixels of the given mouse + event. The value returned is relative to the frame the event + occurred in. This will signal an error if the event is not a + mouse event. + + - Function: event-y-pixel EVENT + This function returns the Y position in pixels of the given mouse + event. The value returned is relative to the frame the event + occurred in. This will signal an error if the event is not a + mouse event. + + +File: lispref.info, Node: Window-Level Event Position Info, Next: Event Text Position Info, Prev: Frame-Level Event Position Info, Up: Accessing Mouse Event Positions + +Window-Level Event Position Info +................................ + + The following functions return window-level information about where +a mouse event occurred. + + - Function: event-window EVENT + Given a mouse motion, button press, button release, or misc-user + event, compute and return the window on which that event occurred. + This may be `nil' if the event occurred in the border or over a + toolbar. The modeline is considered to be within the window it + describes. + + - Function: event-buffer EVENT + Given a mouse motion, button press, button release, or misc-user + event, compute and return the buffer of the window on which that + event occurred. This may be `nil' if the event occurred in the + border or over a toolbar. The modeline is considered to be within + the window it describes. This is equivalent to calling + `event-window' and then calling `window-buffer' on the result if + it is a window. + + - Function: event-window-x-pixel EVENT + This function returns the X position in pixels of the given mouse + event. The value returned is relative to the window the event + occurred in. This will signal an error if the event is not a + mouse-motion, button-press, button-release, or misc-user event. + + - Function: event-window-y-pixel EVENT + This function returns the Y position in pixels of the given mouse + event. The value returned is relative to the window the event + occurred in. This will signal an error if the event is not a + mouse-motion, button-press, button-release, or misc-user event. + + +File: lispref.info, Node: Event Text Position Info, Next: Event Glyph Position Info, Prev: Window-Level Event Position Info, Up: Accessing Mouse Event Positions + +Event Text Position Info +........................ + + The following functions return information about the text (including +the modeline) that a mouse event occurred over or near. + + - Function: event-over-text-area-p EVENT + Given a mouse-motion, button-press, button-release, or misc-user + event, this function returns `t' if the event is over the text + area of a window. Otherwise, `nil' is returned. The modeline is + not considered to be part of the text area. + + - Function: event-over-modeline-p EVENT + Given a mouse-motion, button-press, button-release, or misc-user + event, this function returns `t' if the event is over the modeline + of a window. Otherwise, `nil' is returned. + + - Function: event-x EVENT + This function returns the X position of the given mouse-motion, + button-press, button-release, or misc-user event in characters. + This is relative to the window the event occurred over. + + - Function: event-y EVENT + This function returns the Y position of the given mouse-motion, + button-press, button-release, or misc-user event in characters. + This is relative to the window the event occurred over. + + - Function: event-point EVENT + This function returns the character position of the given + mouse-motion, button-press, button-release, or misc-user event. + If the event did not occur over a window, or did not occur over + text, then this returns `nil'. Otherwise, it returns an index + into the buffer visible in the event's window. + + - Function: event-closest-point EVENT + This function returns the character position of the given + mouse-motion, button-press, button-release, or misc-user event. + If the event did not occur over a window or over text, it returns + the closest point to the location of the event. If the Y pixel + position overlaps a window and the X pixel position is to the left + of that window, the closest point is the beginning of the line + containing the Y position. If the Y pixel position overlaps a + window and the X pixel position is to the right of that window, + the closest point is the end of the line containing the Y + position. If the Y pixel position is above a window, 0 is + returned. If it is below a window, the value of `(window-end)' is + returned. + + +File: lispref.info, Node: Event Glyph Position Info, Next: Event Toolbar Position Info, Prev: Event Text Position Info, Up: Accessing Mouse Event Positions + +Event Glyph Position Info +......................... + + The following functions return information about the glyph (if any) +that a mouse event occurred over. + + - Function: event-over-glyph-p EVENT + Given a mouse-motion, button-press, button-release, or misc-user + event, this function returns `t' if the event is over a glyph. + Otherwise, `nil' is returned. + + - Function: event-glyph-extent EVENT + If the given mouse-motion, button-press, button-release, or + misc-user event happened on top of a glyph, this returns its + extent; else `nil' is returned. + + - Function: event-glyph-x-pixel EVENT + Given a mouse-motion, button-press, button-release, or misc-user + event over a glyph, this function returns the X position of the + pointer relative to the upper left of the glyph. If the event is + not over a glyph, it returns `nil'. + + - Function: event-glyph-y-pixel EVENT + Given a mouse-motion, button-press, button-release, or misc-user + event over a glyph, this function returns the Y position of the + pointer relative to the upper left of the glyph. If the event is + not over a glyph, it returns `nil'. + + +File: lispref.info, Node: Event Toolbar Position Info, Next: Other Event Position Info, Prev: Event Glyph Position Info, Up: Accessing Mouse Event Positions + +Event Toolbar Position Info +........................... + + - Function: event-over-toolbar-p EVENT + Given a mouse-motion, button-press, button-release, or misc-user + event, this function returns `t' if the event is over a toolbar. + Otherwise, `nil' is returned. + + - Function: event-toolbar-button EVENT + If the given mouse-motion, button-press, button-release, or + misc-user event happened on top of a toolbar button, this function + returns the button. Otherwise, `nil' is returned. + + +File: lispref.info, Node: Other Event Position Info, Prev: Event Toolbar Position Info, Up: Accessing Mouse Event Positions + +Other Event Position Info +......................... + + - Function: event-over-border-p EVENT + Given a mouse-motion, button-press, button-release, or misc-user + event, this function returns `t' if the event is over an internal + toolbar. Otherwise, `nil' is returned. + + +File: lispref.info, Node: Accessing Other Event Info, Next: Working With Events, Prev: Accessing Mouse Event Positions, Up: Events + +Accessing the Other Contents of Events +-------------------------------------- + + The following functions allow access to the contents of events other +than the position info described in the previous section. + + - Function: event-timestamp EVENT + This function returns the timestamp of the given event object. + + - Function: event-device EVENT + This function returns the device that the given event occurred on. + + - Function: event-key EVENT + This function returns the Keysym of the given key-press event. + This will be the ASCII code of a printing character, or a symbol. + + - Function: event-button EVENT + This function returns the button-number of the given button-press + or button-release event. + + - Function: event-modifiers EVENT + This function returns a list of symbols, the names of the modifier + keys which were down when the given mouse or keyboard event was + produced. + + - Function: event-modifier-bits EVENT + This function returns a number representing the modifier keys + which were down when the given mouse or keyboard event was + produced. + + - Function: event-function EVENT + This function returns the callback function of the given timeout, + misc-user, or eval event. + + - Function: event-object EVENT + This function returns the callback function argument of the given + timeout, misc-user, or eval event. + + - Function: event-process EVENT + This function returns the process of the given process event. + + +File: lispref.info, Node: Working With Events, Next: Converting Events, Prev: Accessing Other Event Info, Up: Events + +Working With Events +------------------- + + XEmacs provides primitives for creating, copying, and destroying +event objects. Many functions that return events take an event object +as an argument and fill in the fields of this event; or they make accept +either an event object or `nil', creating the event object first in the +latter case. + + - Function: make-event &optional TYPE PLIST + This function creates a new event structure. If no arguments are + specified, the created event will be empty. To specify the event + type, use the TYPE argument. The allowed types are `empty', + `key-press', `button-press', `button-release', `motion', or + `misc-user'. + + PLIST is a property list, the properties being compatible to those + returned by `event-properties'. For events other than `empty', it + is mandatory to specify certain properties. For `empty' events, + PLIST must be `nil'. The list is "canonicalized", which means + that if a property keyword is present more than once, only the + first instance is taken into account. Specifying an unknown or + illegal property signals an error. + + The following properties are allowed: + + `channel' + The event channel. This is a frame or a console. For mouse + events (of type `button-press', `button-release' and + `motion'), this must be a frame. For key-press events, it + must be a console. If channel is unspecified by PLIST, it + will be set to the selected frame or selected console, as + appropriate. + + `key' + The event key. This is either a symbol or a character. It + is allowed (and required) only for key-press events. + + `button' + The event button. This an integer, either 1, 2 or 3. It is + allowed only for button-press and button-release events. + + `modifiers' + The event modifiers. This is a list of modifier symbols. It + is allowed for key-press, button-press, button-release and + motion events. + + `x' + The event X coordinate. This is an integer. It is relative + to the channel's root window, and is allowed for + button-press, button-release and motion events. + + `y' + The event Y coordinate. This is an integer. It is relative + to the channel's root window, and is allowed for + button-press, button-release and motion events. This means + that, for instance, to access the toolbar, the `y' property + will have to be negative. + + `timestamp' + The event timestamp, a non-negative integer. Allowed for all + types of events. + + *WARNING*: the event object returned by this function may be a + reused one; see the function `deallocate-event'. + + The events created by `make-event' can be used as non-interactive + arguments to the functions with an `(interactive "e")' + specification. + + Here are some basic examples of usage: + + ;; Create an empty event. + (make-event) + => # + + ;; Try creating a key-press event. + (make-event 'key-press) + error--> Undefined key for keypress event + + ;; Creating a key-press event, try 2 + (make-event 'key-press '(key home)) + => # + + ;; Create a key-press event of dubious fame. + (make-event 'key-press '(key escape modifiers (meta alt control shift))) + => # + + ;; Create a M-button1 event at coordinates defined by variables + ;; X and Y. + (make-event 'button-press `(button 1 modifiers (meta) x ,x y ,y)) + => # + + ;; Create a similar button-release event. + (make-event 'button-release `(button 1 modifiers (meta) x ,x y ,x)) + => # + + ;; Create a mouse-motion event. + (make-event 'motion '(x 20 y 30)) + => # + + (event-properties (make-event 'motion '(x 20 y 30))) + => (channel # x 20 y 30 + modifiers nil timestamp 0) + + In conjunction with `event-properties', you can use `make-event' + to create modified copies of existing events. For instance, the + following code will return an `equal' copy of EVENT: + + (make-event (event-type EVENT) + (event-properties EVENT)) + + Note, however, that you cannot use `make-event' as the generic + replacement for `copy-event', because it does not allow creating + all of the event types. + + To create a modified copy of an event, you can use the + canonicalization feature of PLIST. The following example creates + a copy of EVENT, but with `modifiers' reset to `nil'. + + (make-event (event-type EVENT) + (append '(modifiers nil) + (event-properties EVENT))) + + - Function: copy-event EVENT1 &optional EVENT2 + This function makes 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. + + - Function: deallocate-event EVENT + This function allows the given event structure to be reused. You + *MUST NOT* use this event object after calling this function with + it. You will lose. It is not necessary to call this function, as + event objects are garbage-collected like all other objects; + however, it may be more efficient to explicitly deallocate events + when you are sure that that is safe. + + +File: lispref.info, Node: Converting Events, Prev: Working With Events, Up: Events + +Converting Events +----------------- + + XEmacs provides some auxiliary functions for converting between +events and other ways of representing keys. These are useful when +working with ASCII strings and with keymaps. + + - Function: character-to-event CH &optional EVENT DEVICE + This function converts a numeric ASCII value to an event structure, + replete with modifier bits. CH is the character to convert, and + EVENT is the event object to fill in. This function contains + knowledge about what the codes "mean" - for example, the number 9 + is converted to the character , not the distinct character + . + + Note that CH does not have to be a numeric value, but can be a + symbol such as `clear' or a list such as `(control backspace)'. + + If `event' is not `nil', it is modified; otherwise, a new event + object is created. In both cases, the event is returned. + + Optional third arg DEVICE is the device to store in the event; + this also affects whether the high bit is interpreted as a meta + key. A value of `nil' means use the selected device but always + treat the high bit as meta. + + Beware that `character-to-event' and `event-to-character' are not + strictly inverse functions, since events contain much more + information than the ASCII character set can encode. + + - Function: event-to-character EVENT &optional ALLOW-EXTRA-MODIFIERS + ALLOW-META ALLOW-NON-ASCII + This function returns the closest ASCII approximation to EVENT. + If the event isn't a keypress, this returns `nil'. + + If ALLOW-EXTRA-MODIFIERS is non-`nil', then this is lenient in its + translation; it will ignore modifier keys other than and + , and will ignore the modifier on those characters + which have no shifted ASCII equivalent ( for + example, will be mapped to the same ASCII code as ). + + If ALLOW-META is non-`nil', then the modifier will be + represented by turning on the high bit of the byte returned; + otherwise, `nil' will be returned for events containing the + modifier. + + If ALLOW-NON-ASCII is non-`nil', then characters which are present + in the prevailing character set (*note variable + `character-set-property': Keymaps.) will be returned as their code + in that character set, instead of the return value being + restricted to ASCII. + + Note that specifying both ALLOW-META and ALLOW-NON-ASCII is + ambiguous, as both use the high bit; and will be + indistinguishable. + + - Function: 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 ASCII range). + Optional arg NO-MICE means that button events are not allowed. + + +File: lispref.info, Node: Reading Input, Next: Waiting, Prev: Events, Up: Command Loop + +Reading Input +============= + + The editor command loop reads keyboard input using the function +`next-event' and constructs key sequences out of the events using +`dispatch-event'. Lisp programs can also use the function +`read-key-sequence', which reads input a key sequence at a time. See +also `momentary-string-display' in *Note Temporary Displays::, and +`sit-for' in *Note Waiting::. *Note Terminal Input::, for functions +and variables for controlling terminal input modes and debugging +terminal input. + + For higher-level input facilities, see *Note Minibuffers::. + +* Menu: + +* Key Sequence Input:: How to read one key sequence. +* Reading One Event:: How to read just one event. +* Dispatching an Event:: What to do with an event once it has been read. +* Quoted Character Input:: Asking the user to specify a character. +* Peeking and Discarding:: How to reread or throw away input events. + + +File: lispref.info, Node: Key Sequence Input, Next: Reading One Event, Up: Reading Input + +Key Sequence Input +------------------ + + Lisp programs can read input a key sequence at a time by calling +`read-key-sequence'; for example, `describe-key' uses it to read the +key to describe. + + - Function: read-key-sequence PROMPT + This function reads a sequence of keystrokes or mouse clicks and + returns it as a vector of events. It keeps reading events until + it has accumulated a full key sequence; that is, enough to specify + a non-prefix command using the currently active keymaps. + + The vector and the event objects it contains are freshly created, + and will not be side-effected by subsequent calls to this function. + + The function `read-key-sequence' suppresses quitting: `C-g' typed + while reading with this function works like any other character, + and does not set `quit-flag'. *Note Quitting::. + + The argument PROMPT is either a string to be displayed in the echo + area as a prompt, or `nil', meaning not to display a prompt. + + If the user selects a menu item while we are prompting for a key + sequence, the returned value will be a vector of a single + menu-selection event (a misc-user event). An error will be + signalled if you pass this value to `lookup-key' or a related + function. + + In the example below, the prompt `?' is displayed in the echo area, + and the user types `C-x C-f'. + + (read-key-sequence "?") + + ---------- Echo Area ---------- + ?C-x C-f + ---------- Echo Area ---------- + + => [# #] + + If an input character is an upper-case letter and has no key binding, +but its lower-case equivalent has one, then `read-key-sequence' +converts the character to lower case. Note that `lookup-key' does not +perform case conversion in this way. + + +File: lispref.info, Node: Reading One Event, Next: Dispatching an Event, Prev: Key Sequence Input, Up: Reading Input + +Reading One Event +----------------- + + The lowest level functions for command input are those which read a +single event. These functions often make a distinction between +"command events", which are user actions (keystrokes and mouse +actions), and other events, which serve as communication between XEmacs +and the window system. + + - Function: next-event &optional EVENT PROMPT + This function reads and returns the next available event from the + window system or terminal driver, waiting if necessary until an + event is available. Pass this object to `dispatch-event' to + handle it. If an event object is supplied, it is filled in and + returned; otherwise a new event object will be created. + + Events can come directly from the user, from a keyboard macro, or + from `unread-command-events'. + + In most cases, the function `next-command-event' is more + appropriate. + + - Function: next-command-event &optional EVENT + This function returns the next available "user" event from the + window system or terminal driver. Pass this object to + `dispatch-event' to handle it. If an event object is supplied, it + is filled in and returned, otherwise a new event object will be + created. + + The event returned will be a keyboard, mouse press, or mouse + release event. If there are non-command events available (mouse + motion, sub-process output, etc) then these will be executed (with + `dispatch-event') and discarded. This function is provided as a + convenience; it is equivalent to the Lisp code + + (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)) + + Here is what happens if you call `next-command-event' and then + press the right-arrow function key: + + (next-command-event) + => # + + - Function: 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 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 `next-command-event' instead. + + - Function: enqueue-eval-event FUNCTION OBJECT + This function adds an eval event to the back of the queue. The + eval event will be the next event read after all pending events. + + +File: lispref.info, Node: Dispatching an Event, Next: Quoted Character Input, Prev: Reading One Event, Up: Reading Input + +Dispatching an Event +-------------------- + + - Function: dispatch-event EVENT + Given an event object returned by `next-event', this function + executes it. This is the basic function that makes XEmacs respond + to user input; it also deals with notifications from the window + system (such as Expose events). + + +File: lispref.info, Node: Quoted Character Input, Next: Peeking and Discarding, Prev: Dispatching an Event, Up: Reading Input + +Quoted Character Input +---------------------- + + You can use the function `read-quoted-char' to ask the user to +specify a character, and allow the user to specify a control or meta +character conveniently, either literally or as an octal character code. +The command `quoted-insert' uses this function. + + - Function: read-quoted-char &optional PROMPT + This function is like `read-char', except that if the first + character read is an octal digit (0-7), it reads up to two more + octal digits (but stopping if a non-octal digit is found) and + returns the character represented by those digits in octal. + + Quitting is suppressed when the first character is read, so that + the user can enter a `C-g'. *Note Quitting::. + + If PROMPT is supplied, it specifies a string for prompting the + user. The prompt string is always displayed in the echo area, + followed by a single `-'. + + In the following example, the user types in the octal number 177 + (which is 127 in decimal). + + (read-quoted-char "What character") + + ---------- Echo Area ---------- + What character-177 + ---------- Echo Area ---------- + + => 127 + + +File: lispref.info, Node: Peeking and Discarding, Prev: Quoted Character Input, Up: Reading Input + +Miscellaneous Event Input Features +---------------------------------- + + This section describes how to "peek ahead" at events without using +them up, how to check for pending input, and how to discard pending +input. + + See also the variables `last-command-event' and `last-command-char' +(*Note Command Loop Info::). + + - Variable: unread-command-events + This variable holds a list of events waiting to be read as command + input. The events are used in the order they appear in the list, + and removed one by one as they are used. + + The variable is needed because in some cases a function reads a + event and then decides not to use it. Storing the event in this + variable causes it to be processed normally, by the command loop + or by the functions to read command input. + + For example, the function that implements numeric prefix arguments + reads any number of digits. When it finds a non-digit event, it + must unread the event so that it can be read normally by the + command loop. Likewise, incremental search uses this feature to + unread events with no special meaning in a search, because these + events should exit the search and then execute normally. + + + - Variable: unread-command-event + This variable holds a single event to be read as command input. + + This variable is mostly obsolete now that you can use + `unread-command-events' instead; it exists only to support programs + written for versions of XEmacs prior to 19.12. + + - Function: input-pending-p + This function determines whether any command input is currently + available to be read. It returns immediately, with value `t' if + there is available input, `nil' otherwise. On rare occasions it + may return `t' when no input is available. + + - Variable: last-input-event + This variable is set to the last keyboard or mouse button event + received. + + This variable is off limits: you may not set its value or modify + the event that is its value, as it is destructively modified by + `read-key-sequence'. If you want to keep a pointer to this value, + you must use `copy-event'. + + Note that this variable is an alias for `last-input-char' in FSF + Emacs. + + In the example below, a character is read (the character `1'). It + becomes the value of `last-input-event', while `C-e' (from the + `C-x C-e' command used to evaluate this expression) remains the + value of `last-command-event'. + + (progn (print (next-command-event)) + (print last-command-event) + last-input-event) + -| # + -| # + => # + + - Variable: last-input-char + If the value of `last-input-event' is a keyboard event, then this + is the nearest ASCII equivalent to it. Remember that there is + *not* a 1:1 mapping between keyboard events and 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 characters. + + This function exists for compatibility with Emacs version 18. + + - Function: discard-input + This function discards the contents of the terminal input buffer + and cancels any keyboard macro that might be in the process of + definition. It returns `nil'. + + In the following example, the user may type a number of characters + right after starting the evaluation of the form. After the + `sleep-for' finishes sleeping, `discard-input' discards any + characters typed during the sleep. + + (progn (sleep-for 2) + (discard-input)) + => nil + + +File: lispref.info, Node: Waiting, Next: Quitting, Prev: Reading Input, Up: Command Loop + +Waiting for Elapsed Time or Input +================================= + + The wait functions are designed to wait for a certain amount of time +to pass or until there is input. For example, you may wish to pause in +the middle of a computation to allow the user time to view the display. +`sit-for' pauses and updates the screen, and returns immediately if +input comes in, while `sleep-for' pauses without updating the screen. + + Note that in FSF Emacs, the commands `sit-for' and `sleep-for' take +two arguments to specify the time (one integer and one float value), +instead of a single argument that can be either an integer or a float. + + - Function: sit-for SECONDS &optional NODISP + This function performs redisplay (provided there is no pending + input from the user), then waits SECONDS seconds, or until input is + available. The result is `t' if `sit-for' waited the full time + with no input arriving (see `input-pending-p' in *Note Peeking and + Discarding::). Otherwise, the value is `nil'. + + The argument SECONDS need not be an integer. If it is a floating + point number, `sit-for' waits for a fractional number of seconds. + + Redisplay is normally preempted if input arrives, and does not + happen at all if input is available before it starts. (You can + force screen updating in such a case by using `force-redisplay'. + *Note Refresh Screen::.) If there is no input pending, you can + force an update with no delay by using `(sit-for 0)'. + + If NODISP is non-`nil', then `sit-for' does not redisplay, but it + still returns as soon as input is available (or when the timeout + elapses). + + The usual purpose of `sit-for' is to give the user time to read + text that you display. + + - Function: sleep-for SECONDS + This function simply pauses for SECONDS seconds without updating + the display. This function pays no attention to available input. + It returns `nil'. + + The argument SECONDS need not be an integer. If it is a floating + point number, `sleep-for' waits for a fractional number of seconds. + + Use `sleep-for' when you wish to guarantee a delay. + + *Note Time of Day::, for functions to get the current time. + diff --git a/info/lispref.info-18 b/info/lispref.info-18 new file mode 100644 index 0000000..937c3df --- /dev/null +++ b/info/lispref.info-18 @@ -0,0 +1,1116 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Quitting, Next: Prefix Command Arguments, Prev: Waiting, Up: Command Loop + +Quitting +======== + + Typing `C-g' while a Lisp function is running causes XEmacs to +"quit" whatever it is doing. This means that control returns to the +innermost active command loop. + + Typing `C-g' while the command loop is waiting for keyboard input +does not cause a quit; it acts as an ordinary input character. In the +simplest case, you cannot tell the difference, because `C-g' normally +runs the command `keyboard-quit', whose effect is to quit. However, +when `C-g' follows a prefix key, the result is an undefined key. The +effect is to cancel the prefix key as well as any prefix argument. + + In the minibuffer, `C-g' has a different definition: it aborts out +of the minibuffer. This means, in effect, that it exits the minibuffer +and then quits. (Simply quitting would return to the command loop +*within* the minibuffer.) The reason why `C-g' does not quit directly +when the command reader is reading input is so that its meaning can be +redefined in the minibuffer in this way. `C-g' following a prefix key +is not redefined in the minibuffer, and it has its normal effect of +canceling the prefix key and prefix argument. This too would not be +possible if `C-g' always quit directly. + + When `C-g' does directly quit, it does so by setting the variable +`quit-flag' to `t'. XEmacs checks this variable at appropriate times +and quits if it is not `nil'. Setting `quit-flag' non-`nil' in any way +thus causes a quit. + + At the level of C code, quitting cannot happen just anywhere; only +at the special places that check `quit-flag'. The reason for this is +that quitting at other places might leave an inconsistency in XEmacs's +internal state. Because quitting is delayed until a safe place, +quitting cannot make XEmacs crash. + + Certain functions such as `read-key-sequence' or `read-quoted-char' +prevent quitting entirely even though they wait for input. Instead of +quitting, `C-g' serves as the requested input. In the case of +`read-key-sequence', this serves to bring about the special behavior of +`C-g' in the command loop. In the case of `read-quoted-char', this is +so that `C-q' can be used to quote a `C-g'. + + You can prevent quitting for a portion of a Lisp function by binding +the variable `inhibit-quit' to a non-`nil' value. Then, although `C-g' +still sets `quit-flag' to `t' as usual, the usual result of this--a +quit--is prevented. Eventually, `inhibit-quit' will become `nil' +again, such as when its binding is unwound at the end of a `let' form. +At that time, if `quit-flag' is still non-`nil', the requested quit +happens immediately. This behavior is ideal when you wish to make sure +that quitting does not happen within a "critical section" of the +program. + + In some functions (such as `read-quoted-char'), `C-g' is handled in +a special way that does not involve quitting. This is done by reading +the input with `inhibit-quit' bound to `t', and setting `quit-flag' to +`nil' before `inhibit-quit' becomes `nil' again. This excerpt from the +definition of `read-quoted-char' shows how this is done; it also shows +that normal quitting is permitted after the first character of input. + + (defun read-quoted-char (&optional prompt) + "...DOCUMENTATION..." + (let ((count 0) (code 0) char) + (while (< count 3) + (let ((inhibit-quit (zerop count)) + (help-form nil)) + (and prompt (message "%s-" prompt)) + (setq char (read-char)) + (if inhibit-quit (setq quit-flag nil))) + ...) + (logand 255 code))) + + - Variable: quit-flag + If this variable is non-`nil', then XEmacs quits immediately, + unless `inhibit-quit' is non-`nil'. Typing `C-g' ordinarily sets + `quit-flag' non-`nil', regardless of `inhibit-quit'. + + - Variable: inhibit-quit + This variable determines whether XEmacs should quit when + `quit-flag' is set to a value other than `nil'. If `inhibit-quit' + is non-`nil', then `quit-flag' has no special effect. + + - Command: keyboard-quit + This function signals the `quit' condition with `(signal 'quit + nil)'. This is the same thing that quitting does. (See `signal' + in *Note Errors::.) + + You can specify a character other than `C-g' to use for quitting. +See the function `set-input-mode' in *Note Terminal Input::. + + +File: lispref.info, Node: Prefix Command Arguments, Next: Recursive Editing, Prev: Quitting, Up: Command Loop + +Prefix Command Arguments +======================== + + Most XEmacs commands can use a "prefix argument", a number specified +before the command itself. (Don't confuse prefix arguments with prefix +keys.) The prefix argument is at all times represented by a value, +which may be `nil', meaning there is currently no prefix argument. +Each command may use the prefix argument or ignore it. + + There are two representations of the prefix argument: "raw" and +"numeric". The editor command loop uses the raw representation +internally, and so do the Lisp variables that store the information, but +commands can request either representation. + + Here are the possible values of a raw prefix argument: + + * `nil', meaning there is no prefix argument. Its numeric value is + 1, but numerous commands make a distinction between `nil' and the + integer 1. + + * An integer, which stands for itself. + + * A list of one element, which is an integer. This form of prefix + argument results from one or a succession of `C-u''s with no + digits. The numeric value is the integer in the list, but some + commands make a distinction between such a list and an integer + alone. + + * The symbol `-'. This indicates that `M--' or `C-u -' was typed, + without following digits. The equivalent numeric value is -1, but + some commands make a distinction between the integer -1 and the + symbol `-'. + + We illustrate these possibilities by calling the following function +with various prefixes: + + (defun display-prefix (arg) + "Display the value of the raw prefix arg." + (interactive "P") + (message "%s" arg)) + +Here are the results of calling `display-prefix' with various raw +prefix arguments: + + M-x display-prefix -| nil + + C-u M-x display-prefix -| (4) + + C-u C-u M-x display-prefix -| (16) + + C-u 3 M-x display-prefix -| 3 + + M-3 M-x display-prefix -| 3 ; (Same as `C-u 3'.) + + C-3 M-x display-prefix -| 3 ; (Same as `C-u 3'.) + + C-u - M-x display-prefix -| - + + M-- M-x display-prefix -| - ; (Same as `C-u -'.) + + C-- M-x display-prefix -| - ; (Same as `C-u -'.) + + C-u - 7 M-x display-prefix -| -7 + + M-- 7 M-x display-prefix -| -7 ; (Same as `C-u -7'.) + + C-- 7 M-x display-prefix -| -7 ; (Same as `C-u -7'.) + + XEmacs uses two variables to store the prefix argument: `prefix-arg' +and `current-prefix-arg'. Commands such as `universal-argument' that +set up prefix arguments for other commands store them in `prefix-arg'. +In contrast, `current-prefix-arg' conveys the prefix argument to the +current command, so setting it has no effect on the prefix arguments +for future commands. + + Normally, commands specify which representation to use for the prefix +argument, either numeric or raw, in the `interactive' declaration. +(*Note Using Interactive::.) Alternatively, functions may look at the +value of the prefix argument directly in the variable +`current-prefix-arg', but this is less clean. + + - Function: prefix-numeric-value ARG + This function returns the numeric meaning of a valid raw prefix + argument value, ARG. The argument may be a symbol, a number, or a + list. If it is `nil', the value 1 is returned; if it is `-', the + value -1 is returned; if it is a number, that number is returned; + if it is a list, the CAR of that list (which should be a number) is + returned. + + - Variable: current-prefix-arg + This variable holds the raw prefix argument for the *current* + command. Commands may examine it directly, but the usual way to + access it is with `(interactive "P")'. + + - Variable: prefix-arg + The value of this variable is the raw prefix argument for the + *next* editing command. Commands that specify prefix arguments for + the following command work by setting this variable. + + Do not call the functions `universal-argument', `digit-argument', or +`negative-argument' unless you intend to let the user enter the prefix +argument for the *next* command. + + - Command: universal-argument + This command reads input and specifies a prefix argument for the + following command. Don't call this command yourself unless you + know what you are doing. + + - Command: digit-argument ARG + This command adds to the prefix argument for the following + command. The argument ARG is the raw prefix argument as it was + before this command; it is used to compute the updated prefix + argument. Don't call this command yourself unless you know what + you are doing. + + - Command: negative-argument ARG + This command adds to the numeric argument for the next command. + The argument ARG is the raw prefix argument as it was before this + command; its value is negated to form the new prefix argument. + Don't call this command yourself unless you know what you are + doing. + + +File: lispref.info, Node: Recursive Editing, Next: Disabling Commands, Prev: Prefix Command Arguments, Up: Command Loop + +Recursive Editing +================= + + The XEmacs command loop is entered automatically when XEmacs starts +up. This top-level invocation of the command loop never exits; it keeps +running as long as XEmacs does. Lisp programs can also invoke the +command loop. Since this makes more than one activation of the command +loop, we call it "recursive editing". A recursive editing level has +the effect of suspending whatever command invoked it and permitting the +user to do arbitrary editing before resuming that command. + + The commands available during recursive editing are the same ones +available in the top-level editing loop and defined in the keymaps. +Only a few special commands exit the recursive editing level; the others +return to the recursive editing level when they finish. (The special +commands for exiting are always available, but they do nothing when +recursive editing is not in progress.) + + All command loops, including recursive ones, set up all-purpose error +handlers so that an error in a command run from the command loop will +not exit the loop. + + Minibuffer input is a special kind of recursive editing. It has a +few special wrinkles, such as enabling display of the minibuffer and the +minibuffer window, but fewer than you might suppose. Certain keys +behave differently in the minibuffer, but that is only because of the +minibuffer's local map; if you switch windows, you get the usual XEmacs +commands. + + To invoke a recursive editing level, call the function +`recursive-edit'. This function contains the command loop; it also +contains a call to `catch' with tag `exit', which makes it possible to +exit the recursive editing level by throwing to `exit' (*note Catch and +Throw::.). If you throw a value other than `t', then `recursive-edit' +returns normally to the function that called it. The command `C-M-c' +(`exit-recursive-edit') does this. Throwing a `t' value causes +`recursive-edit' to quit, so that control returns to the command loop +one level up. This is called "aborting", and is done by `C-]' +(`abort-recursive-edit'). + + Most applications should not use recursive editing, except as part of +using the minibuffer. Usually it is more convenient for the user if you +change the major mode of the current buffer temporarily to a special +major mode, which should have a command to go back to the previous mode. +(The `e' command in Rmail uses this technique.) Or, if you wish to +give the user different text to edit "recursively", create and select a +new buffer in a special mode. In this mode, define a command to +complete the processing and go back to the previous buffer. (The `m' +command in Rmail does this.) + + Recursive edits are useful in debugging. You can insert a call to +`debug' into a function definition as a sort of breakpoint, so that you +can look around when the function gets there. `debug' invokes a +recursive edit but also provides the other features of the debugger. + + Recursive editing levels are also used when you type `C-r' in +`query-replace' or use `C-x q' (`kbd-macro-query'). + + - Function: recursive-edit + This function invokes the editor command loop. It is called + automatically by the initialization of XEmacs, to let the user + begin editing. When called from a Lisp program, it enters a + recursive editing level. + + In the following example, the function `simple-rec' first advances + point one word, then enters a recursive edit, printing out a + message in the echo area. The user can then do any editing + desired, and then type `C-M-c' to exit and continue executing + `simple-rec'. + + (defun simple-rec () + (forward-word 1) + (message "Recursive edit in progress") + (recursive-edit) + (forward-word 1)) + => simple-rec + (simple-rec) + => nil + + - Command: exit-recursive-edit + This function exits from the innermost recursive edit (including + minibuffer input). Its definition is effectively `(throw 'exit + nil)'. + + - Command: abort-recursive-edit + This function aborts the command that requested the innermost + recursive edit (including minibuffer input), by signaling `quit' + after exiting the recursive edit. Its definition is effectively + `(throw 'exit t)'. *Note Quitting::. + + - Command: top-level + This function exits all recursive editing levels; it does not + return a value, as it jumps completely out of any computation + directly back to the main command loop. + + - Function: recursion-depth + This function returns the current depth of recursive edits. When + no recursive edit is active, it returns 0. + + +File: lispref.info, Node: Disabling Commands, Next: Command History, Prev: Recursive Editing, Up: Command Loop + +Disabling Commands +================== + + "Disabling a command" marks the command as requiring user +confirmation before it can be executed. Disabling is used for commands +which might be confusing to beginning users, to prevent them from using +the commands by accident. + + The low-level mechanism for disabling a command is to put a +non-`nil' `disabled' property on the Lisp symbol for the command. +These properties are normally set up by the user's `.emacs' file with +Lisp expressions such as this: + + (put 'upcase-region 'disabled t) + +For a few commands, these properties are present by default and may be +removed by the `.emacs' file. + + If the value of the `disabled' property is a string, the message +saying the command is disabled includes that string. For example: + + (put 'delete-region 'disabled + "Text deleted this way cannot be yanked back!\n") + + *Note Disabling: (xemacs)Disabling, for the details on what happens +when a disabled command is invoked interactively. Disabling a command +has no effect on calling it as a function from Lisp programs. + + - Command: enable-command COMMAND + Allow COMMAND to be executed without special confirmation from now + on, and (if the user confirms) alter the user's `.emacs' file so + that this will apply to future sessions. + + - Command: disable-command COMMAND + Require special confirmation to execute COMMAND from now on, and + (if the user confirms) alter the user's `.emacs' file so that this + will apply to future sessions. + + - Variable: disabled-command-hook + This normal hook is run instead of a disabled command, when the + user invokes the disabled command interactively. The hook + functions can use `this-command-keys' to determine what the user + typed to run the command, and thus find the command itself. *Note + Hooks::. + + By default, `disabled-command-hook' contains a function that asks + the user whether to proceed. + + +File: lispref.info, Node: Command History, Next: Keyboard Macros, Prev: Disabling Commands, Up: Command Loop + +Command History +=============== + + The command loop keeps a history of the complex commands that have +been executed, to make it convenient to repeat these commands. A +"complex command" is one for which the interactive argument reading +uses the minibuffer. This includes any `M-x' command, any `M-:' +command, and any command whose `interactive' specification reads an +argument from the minibuffer. Explicit use of the minibuffer during +the execution of the command itself does not cause the command to be +considered complex. + + - Variable: command-history + This variable's value is a list of recent complex commands, each + represented as a form to evaluate. It continues to accumulate all + complex commands for the duration of the editing session, but all + but the first (most recent) thirty elements are deleted when a + garbage collection takes place (*note Garbage Collection::.). + + command-history + => ((switch-to-buffer "chistory.texi") + (describe-key "^X^[") + (visit-tags-table "~/emacs/src/") + (find-tag "repeat-complex-command")) + + This history list is actually a special case of minibuffer history +(*note Minibuffer History::.), with one special twist: the elements are +expressions rather than strings. + + There are a number of commands devoted to the editing and recall of +previous commands. The commands `repeat-complex-command', and +`list-command-history' are described in the user manual (*note +Repetition: (xemacs)Repetition.). Within the minibuffer, the history +commands used are the same ones available in any minibuffer. + + +File: lispref.info, Node: Keyboard Macros, Prev: Command History, Up: Command Loop + +Keyboard Macros +=============== + + A "keyboard macro" is a canned sequence of input events that can be +considered a command and made the definition of a key. The Lisp +representation of a keyboard macro is a string or vector containing the +events. Don't confuse keyboard macros with Lisp macros (*note +Macros::.). + + - Function: execute-kbd-macro MACRO &optional COUNT + This function executes MACRO as a sequence of events. If MACRO is + a string or vector, then the events in it are executed exactly as + if they had been input by the user. The sequence is *not* + expected to be a single key sequence; normally a keyboard macro + definition consists of several key sequences concatenated. + + If MACRO is a symbol, then its function definition is used in + place of MACRO. If that is another symbol, this process repeats. + Eventually the result should be a string or vector. If the result + is not a symbol, string, or vector, an error is signaled. + + The argument COUNT is a repeat count; MACRO is executed that many + times. If COUNT is omitted or `nil', MACRO is executed once. If + it is 0, MACRO is executed over and over until it encounters an + error or a failing search. + + - Variable: executing-macro + This variable contains the string or vector that defines the + keyboard macro that is currently executing. It is `nil' if no + macro is currently executing. A command can test this variable to + behave differently when run from an executing macro. Do not set + this variable yourself. + + - Variable: defining-kbd-macro + This variable indicates whether a keyboard macro is being defined. + A command can test this variable to behave differently while a + macro is being defined. The commands `start-kbd-macro' and + `end-kbd-macro' set this variable--do not set it yourself. + + - Variable: last-kbd-macro + This variable is the definition of the most recently defined + keyboard macro. Its value is a string or vector, or `nil'. + + The commands are described in the user's manual (*note Keyboard +Macros: (xemacs)Keyboard Macros.). + + +File: lispref.info, Node: Keymaps, Next: Menus, Prev: Command Loop, Up: Top + +Keymaps +******* + + The bindings between input events and commands are recorded in data +structures called "keymaps". Each binding in a keymap associates (or +"binds") an individual event type either with another keymap or with a +command. When an event is bound to a keymap, that keymap is used to +look up the next input event; this continues until a command is found. +The whole process is called "key lookup". + +* Menu: + +* Keymap Terminology:: Definitions of terms pertaining to keymaps. +* Format of Keymaps:: What a keymap looks like as a Lisp object. +* Creating Keymaps:: Functions to create and copy keymaps. +* Inheritance and Keymaps:: How one keymap can inherit the bindings + of another keymap. +* Key Sequences:: How to specify key sequences. +* Prefix Keys:: Defining a key with a keymap as its definition. +* Active Keymaps:: Each buffer has a local keymap + to override the standard (global) bindings. + A minor mode can also override them. +* Key Lookup:: How extracting elements from keymaps works. +* Functions for Key Lookup:: How to request key lookup. +* Changing Key Bindings:: Redefining a key in a keymap. +* Key Binding Commands:: Interactive interfaces for redefining keys. +* Scanning Keymaps:: Looking through all keymaps, for printing help. +* Other Keymap Functions:: Miscellaneous keymap functions. + + +File: lispref.info, Node: Keymap Terminology, Next: Format of Keymaps, Up: Keymaps + +Keymap Terminology +================== + + A "keymap" is a table mapping event types to definitions (which can +be any Lisp objects, though only certain types are meaningful for +execution by the command loop). Given an event (or an event type) and a +keymap, XEmacs can get the event's definition. Events mapped in keymaps +include keypresses, button presses, and button releases (*note +Events::.). + + A sequence of input events that form a unit is called a "key +sequence", or "key" for short. A sequence of one event is always a key +sequence, and so are some multi-event sequences. + + A keymap determines a binding or definition for any key sequence. If +the key sequence is a single event, its binding is the definition of the +event in the keymap. The binding of a key sequence of more than one +event is found by an iterative process: the binding of the first event +is found, and must be a keymap; then the second event's binding is found +in that keymap, and so on until all the events in the key sequence are +used up. + + If the binding of a key sequence is a keymap, we call the key +sequence a "prefix key". Otherwise, we call it a "complete key" +(because no more events can be added to it). If the binding is `nil', +we call the key "undefined". Examples of prefix keys are `C-c', `C-x', +and `C-x 4'. Examples of defined complete keys are `X', , and +`C-x 4 C-f'. Examples of undefined complete keys are `C-x C-g', and +`C-c 3'. *Note Prefix Keys::, for more details. + + The rule for finding the binding of a key sequence assumes that the +intermediate bindings (found for the events before the last) are all +keymaps; if this is not so, the sequence of events does not form a +unit--it is not really a key sequence. In other words, removing one or +more events from the end of any valid key must always yield a prefix +key. For example, `C-f C-n' is not a key; `C-f' is not a prefix key, +so a longer sequence starting with `C-f' cannot be a key. + + Note that the set of possible multi-event key sequences depends on +the bindings for prefix keys; therefore, it can be different for +different keymaps, and can change when bindings are changed. However, +a one-event sequence is always a key sequence, because it does not +depend on any prefix keys for its well-formedness. + + At any time, several primary keymaps are "active"--that is, in use +for finding key bindings. These are the "global map", which is shared +by all buffers; the "local keymap", which is usually associated with a +specific major mode; and zero or more "minor mode keymaps", which +belong to currently enabled minor modes. (Not all minor modes have +keymaps.) The local keymap bindings shadow (i.e., take precedence +over) the corresponding global bindings. The minor mode keymaps shadow +both local and global keymaps. *Note Active Keymaps::, for details. + + +File: lispref.info, Node: Format of Keymaps, Next: Creating Keymaps, Prev: Keymap Terminology, Up: Keymaps + +Format of Keymaps +================= + + A keymap is a primitive type that associates events with their +bindings. Note that this is different from Emacs 18 and FSF Emacs, +where keymaps are lists. + + - Function: keymapp OBJECT + This function returns `t' if OBJECT is a keymap, `nil' otherwise. + + +File: lispref.info, Node: Creating Keymaps, Next: Inheritance and Keymaps, Prev: Format of Keymaps, Up: Keymaps + +Creating Keymaps +================ + + Here we describe the functions for creating keymaps. + + - Function: make-keymap &optional NAME + This function constructs and returns a new keymap object. All + entries in it are `nil', meaning "command undefined". + + Optional argument NAME specifies a name to assign to the keymap, + as in `set-keymap-name'. This name is only a debugging + convenience; it is not used except when printing the keymap. + + - Function: make-sparse-keymap &optional NAME + This function constructs and returns a new keymap object. All + entries in it are `nil', meaning "command undefined". The only + difference between this function and `make-keymap' is that this + function returns a "smaller" keymap (one that is expected to + contain fewer entries). As keymaps dynamically resize, the + distinction is not great. + + Optional argument NAME specifies a name to assign to the keymap, + as in `set-keymap-name'. This name is only a debugging + convenience; it is not used except when printing the keymap. + + - Function: set-keymap-name KEYMAP NEW-NAME + This function assigns a "name" to a keymap. The name is only a + debugging convenience; it is not used except when printing the + keymap. + + - Function: keymap-name KEYMAP + This function returns the "name" of a keymap, as assigned using + `set-keymap-name'. + + - Function: copy-keymap KEYMAP + This function returns a copy of KEYMAP. Any keymaps that appear + directly as bindings in KEYMAP are also copied recursively, and so + on to any number of levels. However, recursive copying does not + take place when the definition of a character is a symbol whose + function definition is a keymap; the same symbol appears in the + new copy. + + (setq map (copy-keymap (current-local-map))) + => # + + (eq map (current-local-map)) + => nil + + +File: lispref.info, Node: Inheritance and Keymaps, Next: Key Sequences, Prev: Creating Keymaps, Up: Keymaps + +Inheritance and Keymaps +======================= + + A keymap can inherit the bindings of other keymaps. The other +keymaps are called the keymap's "parents", and are set with +`set-keymap-parents'. When searching for a binding for a key sequence +in a particular keymap, that keymap itself will first be searched; +then, if no binding was found in the map and it has parents, the first +parent keymap will be searched; then that keymap's parent will be +searched, and so on, until either a binding for the key sequence is +found, or a keymap without a parent is encountered. At this point, the +search will continue with the next parent of the most recently +encountered keymap that has another parent, etc. Essentially, a +depth-first search of all the ancestors of the keymap is conducted. + + `(current-global-map)' is the default parent of all keymaps. + + - Function: set-keymap-parents KEYMAP PARENTS + This function sets the parent keymaps of KEYMAP to the list + PARENTS. + + If you change the bindings in one of the keymaps in PARENTS using + `define-key' or other key-binding functions, these changes are + visible in KEYMAP unless shadowed by bindings in that map or in + earlier-searched ancestors. The converse is not true: if you use + `define-key' to change KEYMAP, that affects the bindings in that + map, but has no effect on any of the keymaps in PARENTS. + + - Function: keymap-parents KEYMAP + This function returns the list of parent keymaps of KEYMAP, or + `nil' if KEYMAP has no parents. + + As an alternative to specifying a parent, you can also specify a +"default binding" that is used whenever a key is not otherwise bound in +the keymap. This is useful for terminal emulators, for example, which +may want to trap all keystrokes and pass them on in some modified +format. Note that if you specify a default binding for a keymap, +neither the keymap's parents nor the current global map are searched for +key bindings. + + - Function: set-keymap-default-binding KEYMAP COMMAND + This function sets the default binding of KEYMAP to COMMAND, or + `nil' if no default is desired. + + - Function: keymap-default-binding KEYMAP + This function returns the default binding of KEYMAP, or `nil' if + it has none. + + +File: lispref.info, Node: Key Sequences, Next: Prefix Keys, Prev: Inheritance and Keymaps, Up: Keymaps + +Key Sequences +============= + + Contrary to popular belief, the world is not ASCII. When running +under a window manager, XEmacs can tell the difference between, for +example, the keystrokes `control-h', `control-shift-h', and +`backspace'. You can, in fact, bind different commands to each of +these. + + A "key sequence" is a set of keystrokes. A "keystroke" is a keysym +and some set of modifiers (such as and ). A "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 ASCII character in the range 32 - 255) by a character +or its equivalent ASCII code. The `A' key may be represented by the +symbol `A', the character `?A', or by the number 65. The `break' key +may be represented only by the symbol `break'. + + A keystroke may be represented by a list: the last element of the +list is the key (a symbol, character, or number, as above) and the +preceding elements are the symbolic names of modifier keys (, +, , , , and ). Thus, the sequence +`control-b' is represented by the forms `(control b)', `(control ?b)', +and `(control 98)'. A keystroke may also be represented by an event +object, as returned by the `next-command-event' and `read-key-sequence' +functions. + + Note that in this context, the keystroke `control-b' is *not* +represented by the number 2 (the ASCII code for `^B') or the character +`?\^B'. See below. + + The modifier is somewhat of a special case. You should not +(and cannot) use `(meta shift a)' to mean `(meta A)', since for +characters that have ASCII equivalents, the state of the shift key is +implicit in the keysym (`a' vs. `A'). You also cannot say `(shift =)' +to mean `+', as that sort of thing varies from keyboard to keyboard. +The modifier is for use only with characters that do not have a +second keysym on the same key, such as `backspace' and `tab'. + + A key sequence is a vector of keystrokes. As a degenerate case, +elements of this vector may also be keysyms if they have no modifiers. +That is, the `A' keystroke is represented by all of these forms: + + A ?A 65 (A) (?A) (65) + [A] [?A] [65] [(A)] [(?A)] [(65)] + + the `control-a' keystroke is represented by these forms: + + (control A) (control ?A) (control 65) + [(control A)] [(control ?A)] [(control 65)] + + the key sequence `control-c control-a' is represented by these forms: + + [(control c) (control a)] [(control ?c) (control ?a)] + [(control 99) (control 65)] etc. + + Mouse button clicks work just like keypresses: `(control button1)' +means pressing the left mouse button while holding down the control +key. `[(control c) (shift button3)]' means `control-c', hold , +click right. + + Commands may be bound to the mouse-button up-stroke rather than the +down-stroke as well. `button1' means the down-stroke, and `button1up' +means the up-stroke. Different commands may be bound to the up and +down strokes, though that is probably not what you want, so be careful. + + 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 ASCII characters in a purely ASCII world. For +example, a string containing the ASCII backspace character, `"\^H"', +would represent two key sequences: `(control h)' and `backspace'. +Binding a command to this will actually bind both of those key +sequences. Likewise for the following pairs: + + control h backspace + control i tab + control m return + control j linefeed + control [ escape + control @ control space + + After binding a command to two key sequences with a form like + + (define-key global-map "\^X\^I" 'command-1) + +it is possible to redefine only one of those sequences like so: + + (define-key global-map [(control x) (control i)] 'command-2) + (define-key global-map [(control x) tab] 'command-3) + + Of course, all of this applies only when running under a window +system. If you're talking to XEmacs through a TTY connection, you +don't get any of these features. + + - Function: event-matches-key-specifier-p EVENT KEY-SPECIFIER + This function returns non-`nil' if EVENT matches KEY-SPECIFIER, + which can be any valid form representing a key sequence. This can + be useful, e.g., to determine if the user pressed `help-char' or + `quit-char'. + + +File: lispref.info, Node: Prefix Keys, Next: Active Keymaps, Prev: Key Sequences, Up: Keymaps + +Prefix Keys +=========== + + A "prefix key" has an associated keymap that defines what to do with +key sequences that start with the prefix key. For example, `C-x' is a +prefix key, and it uses a keymap that is also stored in the variable +`ctl-x-map'. Here is a list of the standard prefix keys of XEmacs and +their keymaps: + + * `help-map' is used for events that follow `C-h'. + + * `mode-specific-map' is for events that follow `C-c'. This map is + not actually mode specific; its name was chosen to be informative + for the user in `C-h b' (`display-bindings'), where it describes + the main use of the `C-c' prefix key. + + * `ctl-x-map' is the map used for events that follow `C-x'. This + map is also the function definition of `Control-X-prefix'. + + * `ctl-x-4-map' is used for events that follow `C-x 4'. + + * `ctl-x-5-map' is used for events that follow `C-x 5'. + + * The prefix keys `C-x n', `C-x r' and `C-x a' use keymaps that have + no special name. + + * `esc-map' is an evil hack that is present for compatibility + purposes with Emacs 18. Defining a key in `esc-map' is equivalent + to defining the same key in `global-map' but with the + prefix added. You should *not* use this in your code. (This map is + also the function definition of `ESC-prefix'.) + + The binding of a prefix key is the keymap to use for looking up the +events that follow the prefix key. (It may instead be a symbol whose +function definition is a keymap. The effect is the same, but the symbol +serves as a name for the prefix key.) Thus, the binding of `C-x' is +the symbol `Control-X-prefix', whose function definition is the keymap +for `C-x' commands. (The same keymap is also the value of `ctl-x-map'.) + + Prefix key definitions can appear in any active keymap. The +definitions of `C-c', `C-x', `C-h' and as prefix keys appear in +the global map, so these prefix keys are always available. Major and +minor modes can redefine a key as a prefix by putting a prefix key +definition for it in the local map or the minor mode's map. *Note +Active Keymaps::. + + If a key is defined as a prefix in more than one active map, then its +various definitions are in effect merged: the commands defined in the +minor mode keymaps come first, followed by those in the local map's +prefix definition, and then by those from the global map. + + In the following example, we make `C-p' a prefix key in the local +keymap, in such a way that `C-p' is identical to `C-x'. Then the +binding for `C-p C-f' is the function `find-file', just like `C-x C-f'. +The key sequence `C-p 6' is not found in any active keymap. + + (use-local-map (make-sparse-keymap)) + => nil + (local-set-key "\C-p" ctl-x-map) + => nil + (key-binding "\C-p\C-f") + => find-file + + (key-binding "\C-p6") + => nil + + - Function: define-prefix-command SYMBOL &optional MAPVAR + This function defines SYMBOL as a prefix command: it creates a + keymap and stores it as SYMBOL's function definition. Storing the + symbol as the binding of a key makes the key a prefix key that has + a name. If optional argument MAPVAR is not specified, it also + sets SYMBOL as a variable, to have the keymap as its value. (If + MAPVAR is given and is not `t', its value is stored as the value + of SYMBOL.) The function returns SYMBOL. + + In Emacs version 18, only the function definition of SYMBOL was + set, not the value as a variable. + + +File: lispref.info, Node: Active Keymaps, Next: Key Lookup, Prev: Prefix Keys, Up: Keymaps + +Active Keymaps +============== + + XEmacs normally contains many keymaps; at any given time, just a few +of them are "active" in that they participate in the interpretation of +user input. These are the global keymap, the current buffer's local +keymap, and the keymaps of any enabled minor modes. + + The "global keymap" holds the bindings of keys that are defined +regardless of the current buffer, such as `C-f'. The variable +`global-map' holds this keymap, which is always active. + + Each buffer may have another keymap, its "local keymap", which may +contain new or overriding definitions for keys. The current buffer's +local keymap is always active except when `overriding-local-map' or +`overriding-terminal-local-map' overrides it. Extents and text +properties can specify an alternative local map for certain parts of the +buffer; see *Note Extents and Events::. + + Each minor mode may have a keymap; if it does, the keymap is active +when the minor mode is enabled. + + The variable `overriding-local-map' and +`overriding-terminal-local-map', if non-`nil', specify other local +keymaps that override the buffer's local map and all the minor mode +keymaps. + + All the active keymaps are used together to determine what command to +execute when a key is entered. XEmacs searches these maps one by one, +in order of decreasing precedence, until it finds a binding in one of +the maps. + + More specifically: + + For key-presses, the order of keymaps searched is: + + * the `keymap' property of any extent(s) or text properties at point; + + * any applicable minor-mode maps; + + * the current local map of the current buffer; + + * the current global map. + + For mouse-clicks, the order of keymaps searched is: + + * the current local map of the `mouse-grabbed-buffer' if any; + + * the `keymap' property of any extent(s) at the position of the click + (this includes modeline extents); + + * the `modeline-map' of the buffer corresponding to the modeline + under the mouse (if the click happened over a modeline); + + * the value of `toolbar-map' in the current buffer (if the click + happened over a toolbar); + + * the current local map of the buffer under the mouse (does not + apply to toolbar clicks); + + * any applicable minor-mode maps; + + * the current global map. + + Note that if `overriding-local-map' or +`overriding-terminal-local-map' is non-`nil', *only* those two maps and +the current global map are searched. + + The procedure for searching a single keymap is called "key lookup"; +see *Note Key Lookup::. + + Since every buffer that uses the same major mode normally uses the +same local keymap, you can think of the keymap as local to the mode. A +change to the local keymap of a buffer (using `local-set-key', for +example) is seen also in the other buffers that share that keymap. + + The local keymaps that are used for Lisp mode, C mode, and several +other major modes exist even if they have not yet been used. These +local maps are the values of the variables `lisp-mode-map', +`c-mode-map', and so on. For most other modes, which are less +frequently used, the local keymap is constructed only when the mode is +used for the first time in a session. + + The minibuffer has local keymaps, too; they contain various +completion and exit commands. *Note Intro to Minibuffers::. + + *Note Standard Keymaps::, for a list of standard keymaps. + + - Function: current-keymaps &optional EVENT-OR-KEYS + This function returns a list of the current keymaps that will be + searched for bindings. This lists keymaps such as the current + local map and the minor-mode maps, but does not list the parents + of those keymaps. EVENT-OR-KEYS controls which keymaps will be + listed. If EVENT-OR-KEYS is a mouse event (or a vector whose last + element is a mouse event), the keymaps for that mouse event will + be listed. Otherwise, the keymaps for key presses will be listed. + + - Variable: global-map + This variable contains the default global keymap that maps XEmacs + keyboard input to commands. The global keymap is normally this + keymap. The default global keymap is a full keymap that binds + `self-insert-command' to all of the printing characters. + + It is normal practice to change the bindings in the global map, + but you should not assign this variable any value other than the + keymap it starts out with. + + - Function: current-global-map + This function returns the current global keymap. This is the same + as the value of `global-map' unless you change one or the other. + + (current-global-map) + => # + + - Function: current-local-map + This function returns the current buffer's local keymap, or `nil' + if it has none. In the following example, the keymap for the + `*scratch*' buffer (using Lisp Interaction mode) has a number of + entries, including one prefix key, `C-x'. + + (current-local-map) + => # + (describe-bindings-internal (current-local-map)) + => ; 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 + + C-x x edebug-defun + + - Function: current-minor-mode-maps + This function returns a list of the keymaps of currently enabled + minor modes. + + - Function: use-global-map KEYMAP + This function makes KEYMAP the new current global keymap. It + returns `nil'. + + It is very unusual to change the global keymap. + + - Function: use-local-map KEYMAP &optional BUFFER + This function makes KEYMAP the new local keymap of BUFFER. BUFFER + defaults to the current buffer. If KEYMAP is `nil', then the + buffer has no local keymap. `use-local-map' returns `nil'. Most + major mode commands use this function. + + - Variable: minor-mode-map-alist + This variable is an alist describing keymaps that may or may not be + active according to the values of certain variables. Its elements + look like this: + + (VARIABLE . KEYMAP) + + The keymap KEYMAP is active whenever VARIABLE has a non-`nil' + value. Typically VARIABLE is the variable that enables or + disables a minor mode. *Note Keymaps and Minor Modes::. + + Note that elements of `minor-mode-map-alist' do not have the same + structure as elements of `minor-mode-alist'. The map must be the + CDR of the element; a list with the map as the second element will + not do. + + What's more, the keymap itself must appear in the CDR. It does not + work to store a variable in the CDR and make the map the value of + that variable. + + When more than one minor mode keymap is active, their order of + priority is the order of `minor-mode-map-alist'. But you should + design minor modes so that they don't interfere with each other. + If you do this properly, the order will not matter. + + See also `minor-mode-key-binding', above. See *Note Keymaps and + Minor Modes::, for more information about minor modes. + + - Variable: modeline-map + This variable holds the keymap consulted for mouse-clicks on the + modeline of a window. This variable may be buffer-local; its + value will be looked up in the buffer of the window whose modeline + was clicked upon. + + - Variable: toolbar-map + This variable holds the keymap consulted for mouse-clicks over a + toolbar. + + - Variable: mouse-grabbed-buffer + If non-`nil', a buffer which should be consulted first for all + mouse activity. When a mouse-click is processed, it will first be + looked up in the local-map of this buffer, and then through the + normal mechanism if there is no binding for that click. This + buffer's value of `mode-motion-hook' will be consulted instead of + the `mode-motion-hook' of the buffer of the window under the mouse. + You should *bind* this, not set it. + + - Variable: overriding-local-map + If non-`nil', this variable holds a keymap to use instead of the + buffer's local keymap and instead of all the minor mode keymaps. + This keymap, if any, overrides all other maps that would have been + active, except for the current global map. + + - Variable: overriding-terminal-local-map + If non-`nil', this variable holds a keymap to use instead of the + buffer's local keymap and instead of all the minor mode keymaps, + but for the selected console only. (In other words, this variable + is always console-local; putting a keymap here only applies to + keystrokes coming from the selected console. *Note Consoles and + Devices::.) This keymap, if any, overrides all other maps that + would have been active, except for the current global map. + diff --git a/info/lispref.info-19 b/info/lispref.info-19 new file mode 100644 index 0000000..6a53c4d --- /dev/null +++ b/info/lispref.info-19 @@ -0,0 +1,1245 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Key Lookup, Next: Functions for Key Lookup, Prev: Active Keymaps, Up: Keymaps + +Key Lookup +========== + + "Key lookup" is the process of finding the binding of a key sequence +from a given keymap. Actual execution of the binding is not part of +key lookup. + + Key lookup uses just the event type of each event in the key +sequence; the rest of the event is ignored. In fact, a key sequence +used for key lookup may designate mouse events with just their types +(symbols) instead of with entire mouse events (lists). *Note Events::. +Such a pseudo-key-sequence is insufficient for `command-execute', but +it is sufficient for looking up or rebinding a key. + + When the key sequence consists of multiple events, key lookup +processes the events sequentially: the binding of the first event is +found, and must be a keymap; then the second event's binding is found in +that keymap, and so on until all the events in the key sequence are used +up. (The binding thus found for the last event may or may not be a +keymap.) Thus, the process of key lookup is defined in terms of a +simpler process for looking up a single event in a keymap. How that is +done depends on the type of object associated with the event in that +keymap. + + Let's use the term "keymap entry" to describe the value found by +looking up an event type in a keymap. (This doesn't include the item +string and other extra elements in menu key bindings because +`lookup-key' and other key lookup functions don't include them in the +returned value.) While any Lisp object may be stored in a keymap as a +keymap entry, not all make sense for key lookup. Here is a list of the +meaningful kinds of keymap entries: + +`nil' + `nil' means that the events used so far in the lookup form an + undefined key. When a keymap fails to mention an event type at + all, and has no default binding, that is equivalent to a binding + of `nil' for that event type. + +KEYMAP + The events used so far in the lookup form a prefix key. The next + event of the key sequence is looked up in KEYMAP. + +COMMAND + The events used so far in the lookup form a complete key, and + COMMAND is its binding. *Note What Is a Function::. + +ARRAY + The array (either a string or a vector) is a keyboard macro. The + events used so far in the lookup form a complete key, and the + array is its binding. See *Note Keyboard Macros::, for more + information. (Note that you cannot use a shortened form of a key + sequence here, such as `(control y)'; you must use the full form + `[(control y)]'. *Note Key Sequences::.) + +LIST + The meaning of a list depends on the types of the elements of the + list. + + * If the CAR of LIST is `lambda', then the list is a lambda + expression. This is presumed to be a command, and is treated + as such (see above). + + * If the CAR of LIST is a keymap and the CDR is an event type, + then this is an "indirect entry": + + (OTHERMAP . OTHERTYPE) + + When key lookup encounters an indirect entry, it looks up + instead the binding of OTHERTYPE in OTHERMAP and uses that. + + This feature permits you to define one key as an alias for + another key. For example, an entry whose CAR is the keymap + called `esc-map' and whose CDR is 32 (the code for ) + means, "Use the global binding of `Meta-', whatever that + may be." + +SYMBOL + The function definition of SYMBOL is used in place of SYMBOL. If + that too is a symbol, then this process is repeated, any number of + times. Ultimately this should lead to an object that is a keymap, + a command or a keyboard macro. A list is allowed if it is a + keymap or a command, but indirect entries are not understood when + found via symbols. + + Note that keymaps and keyboard macros (strings and vectors) are not + valid functions, so a symbol with a keymap, string, or vector as + its function definition is invalid as a function. It is, however, + valid as a key binding. If the definition is a keyboard macro, + then the symbol is also valid as an argument to `command-execute' + (*note Interactive Call::.). + + The symbol `undefined' is worth special mention: it means to treat + the key as undefined. Strictly speaking, the key is defined, and + its binding is the command `undefined'; but that command does the + same thing that is done automatically for an undefined key: it + rings the bell (by calling `ding') but does not signal an error. + + `undefined' is used in local keymaps to override a global key + binding and make the key "undefined" locally. A local binding of + `nil' would fail to do this because it would not override the + global binding. + +ANYTHING ELSE + If any other type of object is found, the events used so far in the + lookup form a complete key, and the object is its binding, but the + binding is not executable as a command. + + In short, a keymap entry may be a keymap, a command, a keyboard +macro, a symbol that leads to one of them, or an indirection or `nil'. + + +File: lispref.info, Node: Functions for Key Lookup, Next: Changing Key Bindings, Prev: Key Lookup, Up: Keymaps + +Functions for Key Lookup +======================== + + Here are the functions and variables pertaining to key lookup. + + - Function: lookup-key KEYMAP KEY &optional ACCEPT-DEFAULTS + This function returns the definition of KEY in KEYMAP. If the + string or vector KEY is not a valid key sequence according to the + prefix keys specified in KEYMAP (which means it is "too long" and + has extra events at the end), then the value is a number, the + number of events at the front of KEY that compose a complete key. + + If ACCEPT-DEFAULTS is non-`nil', then `lookup-key' considers + default bindings as well as bindings for the specific events in + KEY. Otherwise, `lookup-key' reports only bindings for the + specific sequence KEY, ignoring default bindings except when you + explicitly ask about them. + + All the other functions described in this chapter that look up + keys use `lookup-key'. + + (lookup-key (current-global-map) "\C-x\C-f") + => find-file + (lookup-key (current-global-map) "\C-x\C-f12345") + => 2 + + If KEY begins with the character whose value is contained in + `meta-prefix-char', that character is implicitly removed and the + modifier added to the key. Thus, the first example below is + handled by conversion into the second example. + + (lookup-key (current-global-map) "\ef") + => forward-word + (lookup-key (current-global-map) "\M-f") + => forward-word + + Unlike `read-key-sequence', this function does not modify the + specified events in ways that discard information (*note Key + Sequence Input::.). In particular, it does not convert letters to + lower case. + + - Command: undefined + Used in keymaps to undefine keys. If a key sequence is defined to + this, invoking this key sequence causes a "key undefined" error, + just as if the key sequence had no binding. + + - Function: key-binding KEY &optional ACCEPT-DEFAULTS + This function returns the binding for KEY in the current keymaps, + trying all the active keymaps. The result is `nil' if KEY is + undefined in the keymaps. + + The argument ACCEPT-DEFAULTS controls checking for default + bindings, as in `lookup-key' (above). + + (key-binding "\C-x\C-f") + => find-file + (key-binding '(control home)) + => beginning-of-buffer + (key-binding [escape escape escape]) + => keyboard-escape-quit + + - Function: local-key-binding KEY &optional ACCEPT-DEFAULTS + This function returns the binding for KEY in the current local + keymap, or `nil' if it is undefined there. + + The argument ACCEPT-DEFAULTS controls checking for default + bindings, as in `lookup-key' (above). + + - Function: global-key-binding KEY &optional ACCEPT-DEFAULTS + This function returns the binding for command KEY in the current + global keymap, or `nil' if it is undefined there. + + The argument ACCEPT-DEFAULTS controls checking for default + bindings, as in `lookup-key' (above). + + - Function: minor-mode-key-binding KEY &optional ACCEPT-DEFAULTS + This function returns a list of all the active minor mode bindings + of KEY. More precisely, it returns an alist of pairs `(MODENAME . + BINDING)', where MODENAME is the variable that enables the minor + mode, and BINDING is KEY's binding in that mode. If KEY has no + minor-mode bindings, the value is `nil'. + + If the first binding is not a prefix command, all subsequent + bindings from other minor modes are omitted, since they would be + completely shadowed. Similarly, the list omits non-prefix + bindings that follow prefix bindings. + + The argument ACCEPT-DEFAULTS controls checking for default + bindings, as in `lookup-key' (above). + + - Variable: meta-prefix-char + This variable is the meta-prefix character code. It is used when + 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 (*note Prefix Keys::.). The default value is + `?\^[' (integer 27), which is the ASCII character usually produced + by the key. + + As long as the value of `meta-prefix-char' remains `?\^[', key + lookup translates ` b' into `M-b', which is normally defined + as the `backward-word' command. However, if you set + `meta-prefix-char' to `?\^X' (i.e. the keystroke `C-x') or its + equivalent ASCII code `24', then XEmacs will translate `C-x b' + (whose standard binding is the `switch-to-buffer' command) into + `M-b'. + + meta-prefix-char ; The default value. + => ?\^[ ; Under XEmacs 20. + => 27 ; Under XEmacs 19. + + (key-binding "\eb") + => backward-word + + ?\C-x ; The print representation + ; of a character. + => ?\^X ; Under XEmacs 20. + => 24 ; Under XEmacs 19. + + (setq meta-prefix-char 24) + => 24 + + (key-binding "\C-xb") + => backward-word ; Now, typing `C-x b' is + ; like typing `M-b'. + + (setq meta-prefix-char ?\e) ; Avoid confusion! + ; Restore the default value! + => ?\^[ ; Under XEmacs 20. + => 27 ; Under XEmacs 19. + + +File: lispref.info, Node: Changing Key Bindings, Next: Key Binding Commands, Prev: Functions for Key Lookup, Up: Keymaps + +Changing Key Bindings +===================== + + The way to rebind a key is to change its entry in a keymap. If you +change a binding in the global keymap, the change is effective in all +buffers (though it has no direct effect in buffers that shadow the +global binding with a local one). If you change the current buffer's +local map, that usually affects all buffers using the same major mode. +The `global-set-key' and `local-set-key' functions are convenient +interfaces for these operations (*note Key Binding Commands::.). You +can also use `define-key', a more general function; then you must +specify explicitly the map to change. + + The way to specify the key sequence that you want to rebind is +described above (*note Key Sequences::.). + + For the functions below, an error is signaled if KEYMAP is not a +keymap or if KEY is not a string or vector representing a key sequence. +You can use event types (symbols) as shorthand for events that are +lists. + + - Function: define-key KEYMAP KEY BINDING + This function sets the binding for KEY in KEYMAP. (If KEY is more + than one event long, the change is actually made in another keymap + reached from KEYMAP.) The argument BINDING can be any Lisp + object, but only certain types are meaningful. (For a list of + meaningful types, see *Note Key Lookup::.) The value returned by + `define-key' is BINDING. + + Every prefix of KEY must be a prefix key (i.e., bound to a keymap) + or undefined; otherwise an error is signaled. + + If some prefix of KEY is undefined, then `define-key' defines it + as a prefix key so that the rest of KEY may be defined as + specified. + + Here is an example that creates a sparse keymap and makes a number of +bindings in it: + + (setq map (make-sparse-keymap)) + => # + + (define-key map "\C-f" 'forward-char) + => forward-char + + map + => # + (describe-bindings-internal map) + => ; (Inserted in buffer) + C-f forward-char + + ;; Build sparse submap for `C-x' and bind `f' in that. + (define-key map "\C-xf" 'forward-word) + => forward-word + + map + => # + (describe-bindings-internal map) + => ; (Inserted in buffer) + C-f forward-char + C-x << Prefix Command >> + + C-x f forward-word + + ;; Bind `C-p' to the `ctl-x-map'. + (define-key map "\C-p" ctl-x-map) + ;; `ctl-x-map' + => # + + ;; Bind `C-f' to `foo' in the `ctl-x-map'. + (define-key map "\C-p\C-f" 'foo) + => foo + + map + => # + (describe-bindings-internal map) + => ; (Inserted in buffer) + C-f forward-char + C-p << Prefix command Control-X-prefix >> + C-x << Prefix Command >> + + C-p tab indent-rigidly + C-p $ set-selective-display + C-p ' expand-abbrev + C-p ( start-kbd-macro + C-p ) end-kbd-macro + ... + C-p C-x exchange-point-and-mark + C-p C-z suspend-or-iconify-emacs + C-p M-escape repeat-complex-command + C-p M-C-[ repeat-complex-command + + C-x f forward-word + + C-p 4 . find-tag-other-window + ... + C-p 4 C-o display-buffer + + C-p 5 0 delete-frame + ... + C-p 5 C-f find-file-other-frame + + ... + + C-p a i g inverse-add-global-abbrev + C-p a i l inverse-add-mode-abbrev + +Note that storing a new binding for `C-p C-f' actually works by +changing an entry in `ctl-x-map', and this has the effect of changing +the bindings of both `C-p C-f' and `C-x C-f' in the default global map. + + - Function: substitute-key-definition OLDDEF NEWDEF KEYMAP &optional + OLDMAP + This function replaces OLDDEF with NEWDEF for any keys in KEYMAP + that were bound to OLDDEF. In other words, OLDDEF is replaced + with NEWDEF wherever it appears. The function returns `nil'. + + For example, this redefines `C-x C-f', if you do it in an XEmacs + with standard bindings: + + (substitute-key-definition + 'find-file 'find-file-read-only (current-global-map)) + + If OLDMAP is non-`nil', then its bindings determine which keys to + rebind. The rebindings still happen in NEWMAP, not in OLDMAP. + Thus, you can change one map under the control of the bindings in + another. For example, + + (substitute-key-definition + 'delete-backward-char 'my-funny-delete + my-map global-map) + + puts the special deletion command in `my-map' for whichever keys + are globally bound to the standard deletion command. + + + - Function: suppress-keymap KEYMAP &optional NODIGITS + This function changes the contents of the full keymap KEYMAP by + making all the printing characters undefined. More precisely, it + binds them to the command `undefined'. This makes ordinary + insertion of text impossible. `suppress-keymap' returns `nil'. + + If NODIGITS is `nil', then `suppress-keymap' defines digits to run + `digit-argument', and `-' to run `negative-argument'. Otherwise + it makes them undefined like the rest of the printing characters. + + The `suppress-keymap' function does not make it impossible to + modify a buffer, as it does not suppress commands such as `yank' + and `quoted-insert'. To prevent any modification of a buffer, make + it read-only (*note Read Only Buffers::.). + + Since this function modifies KEYMAP, you would normally use it on + a newly created keymap. Operating on an existing keymap that is + used for some other purpose is likely to cause trouble; for + example, suppressing `global-map' would make it impossible to use + most of XEmacs. + + Most often, `suppress-keymap' is used to initialize local keymaps + of modes such as Rmail and Dired where insertion of text is not + desirable and the buffer is read-only. Here is an example taken + from the file `emacs/lisp/dired.el', showing how the local keymap + for Dired mode is set up: + + ... + (setq dired-mode-map (make-keymap)) + (suppress-keymap dired-mode-map) + (define-key dired-mode-map "r" 'dired-rename-file) + (define-key dired-mode-map "\C-d" 'dired-flag-file-deleted) + (define-key dired-mode-map "d" 'dired-flag-file-deleted) + (define-key dired-mode-map "v" 'dired-view-file) + (define-key dired-mode-map "e" 'dired-find-file) + (define-key dired-mode-map "f" 'dired-find-file) + ... + + +File: lispref.info, Node: Key Binding Commands, Next: Scanning Keymaps, Prev: Changing Key Bindings, Up: Keymaps + +Commands for Binding Keys +========================= + + This section describes some convenient interactive interfaces for +changing key bindings. They work by calling `define-key'. + + People often use `global-set-key' in their `.emacs' file for simple +customization. For example, + + (global-set-key "\C-x\C-\\" 'next-line) + +or + + (global-set-key [(control ?x) (control ?\\)] 'next-line) + +or + + (global-set-key [?\C-x ?\C-\\] 'next-line) + +redefines `C-x C-\' to move down a line. + + (global-set-key [(meta button1)] 'mouse-set-point) + +redefines the first (leftmost) mouse button, typed with the Meta key, to +set point where you click. + + - Command: global-set-key KEY DEFINITION + This function sets the binding of KEY in the current global map to + DEFINITION. + + (global-set-key KEY DEFINITION) + == + (define-key (current-global-map) KEY DEFINITION) + + - Command: global-unset-key KEY + This function removes the binding of KEY from the current global + map. + + One use of this function is in preparation for defining a longer + key that uses KEY as a prefix--which would not be allowed if KEY + has a non-prefix binding. For example: + + (global-unset-key "\C-l") + => nil + + (global-set-key "\C-l\C-l" 'redraw-display) + => nil + + This function is implemented simply using `define-key': + + (global-unset-key KEY) + == + (define-key (current-global-map) KEY nil) + + - Command: local-set-key KEY DEFINITION + This function sets the binding of KEY in the current local keymap + to DEFINITION. + + (local-set-key KEY DEFINITION) + == + (define-key (current-local-map) KEY DEFINITION) + + - Command: local-unset-key KEY + This function removes the binding of KEY from the current local + map. + + (local-unset-key KEY) + == + (define-key (current-local-map) KEY nil) + + +File: lispref.info, Node: Scanning Keymaps, Next: Other Keymap Functions, Prev: Key Binding Commands, Up: Keymaps + +Scanning Keymaps +================ + + This section describes functions used to scan all the current +keymaps, or all keys within a keymap, for the sake of printing help +information. + + - Function: accessible-keymaps KEYMAP &optional PREFIX + This function returns a list of all the keymaps that can be + accessed (via prefix keys) from KEYMAP. The value is an + association list with elements of the form `(KEY . MAP)', where + KEY is a prefix key whose definition in KEYMAP is MAP. + + The elements of the alist are ordered so that the KEY increases in + length. The first element is always `([] . KEYMAP)', because the + specified keymap is accessible from itself with a prefix of no + events. + + If PREFIX is given, it should be a prefix key sequence; then + `accessible-keymaps' includes only the submaps whose prefixes start + with PREFIX. These elements look just as they do in the value of + `(accessible-keymaps)'; the only difference is that some elements + are omitted. + + In the example below, the returned alist indicates that the key + `C-x', which is displayed as `[(control x)]', is a prefix key + whose definition is the keymap `#) 1 entry 0x8a2>'. (The strange + notation for the keymap's name indicates that this is an internal + submap of `emacs-lisp-mode-map'. This is because + `lisp-interaction-mode-map' has set up `emacs-lisp-mode-map' as + its parent, and `lisp-interaction-mode-map' defines no key + sequences beginning with `C-x'.) + + (current-local-map) + => # + (accessible-keymaps (current-local-map)) + =>(([] . #) + ([(control x)] . + #) + 1 entry 0x8a2>)) + + The following example shows the results of calling + `accessible-keymaps' on a large, complex keymap. Notice how some + keymaps were given explicit names using `set-keymap-name'; those + submaps without explicit names are given descriptive names + indicating their relationship to their enclosing keymap. + + (accessible-keymaps (current-global-map)) + => (([] . #) + ([(control c)] . #) + ([(control h)] . #) + ([(control x)] . #) + ([(meta escape)] . + #) + 3 entries 0x3e0>) + ([(meta control \[)] . + #) + 3 entries 0x3e0>) + ([f1] . #) + ([(control x) \4] . #) + ([(control x) \5] . #) + ([(control x) \6] . #) + ([(control x) a] . + #) + 8 entries 0x3ef>) + ([(control x) n] . #) + ([(control x) r] . #) + ([(control x) v] . #) + ([(control x) a i] . + #) + 8 entries 0x3ef>) + 2 entries 0x3f5>)) + + - Function: map-keymap FUNCTION KEYMAP &optional SORT-FIRST + This function applies FUNCTION to each element of `KEYMAP'. + FUNCTION will be called with two arguments: a key-description + list, and the binding. The order in which the elements of the + keymap are passed to the function is unspecified. If the function + inserts new elements into the keymap, it may or may not be called + with them later. No element of the keymap will ever be passed to + the function more than once. + + The function will not be called on elements of this keymap's + parents (*note Inheritance and Keymaps::.) or upon keymaps which + are contained within this keymap (multi-character definitions). + It will be called on characters since they are not really + two-character sequences. + + If the optional third argument SORT-FIRST is non-`nil', then the + elements of the keymap will be passed to the mapper function in a + canonical order. Otherwise, they will be passed in hash (that is, + random) order, which is faster. + + - Function: keymap-fullness KEYMAP + This function returns the number of bindings in the keymap. + + - Function: where-is-internal DEFINITION &optional KEYMAPS FIRSTONLY + NOINDIRECT EVENT-OR-KEYS + This function returns a list of key sequences (of any length) that + are bound to DEFINITION in a set of keymaps. + + The argument DEFINITION can be any object; it is compared with all + keymap entries using `eq'. + + KEYMAPS can be either a keymap (meaning search in that keymap and + the current global keymap) or a list of keymaps (meaning search in + exactly those keymaps and no others). If KEYMAPS is nil, search + in the currently applicable maps for EVENT-OR-KEYS. + + If KEYMAP is a keymap, then the maps searched are KEYMAP and the + global keymap. If KEYMAP is a list of keymaps, then the maps + searched are exactly those keymaps, and no others. If KEYMAP is + `nil', then the maps used are the current active keymaps for + EVENT-OR-KEYS (this is equivalent to specifying `(current-keymaps + EVENT-OR-KEYS)' as the argument to KEYMAPS). + + If FIRSTONLY is non-`nil', then the value is a single vector + representing the first key sequence found, rather than a list of + all possible key sequences. + + If NOINDIRECT is non-`nil', `where-is-internal' doesn't follow + indirect keymap bindings. This makes it possible to search for an + indirect definition itself. + + This function is used by `where-is' (*note Help: (emacs)Help.). + + (where-is-internal 'describe-function) + => ([(control h) d] [(control h) f] [f1 d] [f1 f]) + + - Function: describe-bindings-internal MAP &optional ALL SHADOW PREFIX + MOUSE-ONLY-P + This function inserts (into the current buffer) a list of all + defined keys and their definitions in MAP. Optional second + argument ALL says whether to include even "uninteresting" + definitions, i.e. symbols with a non-`nil' `suppress-keymap' + property. Third argument SHADOW is a list of keymaps whose + bindings shadow those of map; if a binding is present in any + shadowing map, it is not printed. Fourth argument PREFIX, if + non-`nil', should be a key sequence; only bindings which start + with that key sequence will be printed. Fifth argument + MOUSE-ONLY-P says to only print bindings for mouse clicks. + + `describe-bindings-internal' is used to implement the help command +`describe-bindings'. + + - Command: describe-bindings PREFIX MOUSE-ONLY-P + This function creates a listing of all defined keys and their + definitions. It writes the listing in a buffer named `*Help*' and + displays it in a window. + + If PREFIX is non-`nil', it should be a prefix key; then the + listing includes only keys that start with PREFIX. + + When several characters with consecutive ASCII codes have the same + definition, they are shown together, as `FIRSTCHAR..LASTCHAR'. In + this instance, you need to know the ASCII codes to understand + which characters this means. For example, in the default global + map, the characters ` .. ~' are described by a single line. + is ASCII 32, `~' is 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 + `self-insert-command'. + + If the second argument (prefix arg, interactively) is non-`nil' + then only the mouse bindings are displayed. + + +File: lispref.info, Node: Other Keymap Functions, Prev: Scanning Keymaps, Up: Keymaps + +Other Keymap Functions +====================== + + - Function: set-keymap-prompt KEYMAP NEW-PROMPT + This function sets the "prompt" of KEYMAP to string NEW-PROMPT, or + `nil' if no prompt is desired. The prompt is shown in the + echo-area when reading a key-sequence to be looked-up in this + keymap. + + - Function: keymap-prompt KEYMAP &optional USE-INHERITED + This function returns the "prompt" of the given keymap. If + USE-INHERITED is non-`nil', any parent keymaps will also be + searched for a prompt. + + +File: lispref.info, Node: Menus, Next: Dialog Boxes, Prev: Keymaps, Up: Top + +Menus +***** + +* 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. + + +File: lispref.info, Node: Menu Format, Next: Menubar Format, Up: Menus + +Format of Menus +=============== + + A menu is described using a "menu description", which is a list of +menu items, keyword-value pairs, strings, and submenus. The menu +description specifies which items are present in the menu, what function +each item invokes, and whether the item is selectable or not. Pop-up +menus are directly described with a menu description, while menubars are +described slightly differently (see below). + + The first element of a menu must be a string, which is the name of +the menu. This is the string that will be displayed in the parent menu +or menubar, if any. This string is not displayed in the menu itself, +except in the case of the top level pop-up menu, where there is no +parent. In this case, the string will be displayed at the top of the +menu if `popup-menu-titles' is non-`nil'. + + Immediately following the first element there may optionally be up +to four keyword-value pairs, as follows: + +`:included FORM' + This can be used to control the visibility of a menu. The form is + evaluated and the menu will be omitted if the result is `nil'. + +`:config SYMBOL' + This is an efficient shorthand for `:included (memq SYMBOL + menubar-configuration)'. See the variable `menubar-configuration'. + +`:filter FUNCTION' + A menu filter 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. + +`:accelerator KEY' + A menu accelerator is a keystroke which can be pressed while the + menu is visible which will immediately activate the item. KEY + must be a char or the symbol name of a key. *Note Menu + Accelerators::. + + The rest of the menu consists of elements as follows: + + * A "menu item", which is a vector in the following form: + + `[ NAME CALLBACK :KEYWORD VALUE :KEYWORD VALUE ... ]' + + NAME is a string, the name of the menu item; it 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. + + CALLBACK is a form that will be invoked when the menu item is + selected. 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'. + + The valid keywords and their meanings are described below. + + Note that for compatibility purposes, the form + + `[ NAME CALLBACK ACTIVE-P ]' + + is also accepted and is equivalent to + + `[ NAME CALLBACK :active ACTIVE-P ]' + + and the form + + `[ NAME CALLBACK ACTIVE-P SUFFIX]' + + is accepted and is equivalent to + + `[ NAME CALLBACK :active ACTIVE-P :suffix SUFFIX]' + + However, these older forms are deprecated and should generally not + be used. + + * If an element of a menu is a string, then that string will be + presented in the menu as unselectable text. + + * 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 `--:', then a + particular sort of horizontal line will be displayed, as follows: + + `"--:singleLine"' + A solid horizontal line. This is equivalent to a string + consisting solely of hyphens. + + `"--:doubleLine"' + A solid double horizontal line. + + `"--:singleDashedLine"' + A dashed horizontal line. + + `"--:doubleDashedLine"' + A dashed double horizontal line. + + `"--:noLine"' + No line (but a small space is left). + + `"--:shadowEtchedIn"' + A solid horizontal line with a 3-d recessed appearance. + + `"--:shadowEtchedOut"' + A solid horizontal line with a 3-d pushed-out appearance. + + `"--:shadowDoubleEtchedIn"' + A solid double horizontal line with a 3-d recessed appearance. + + `"--:shadowDoubleEtchedOut"' + A solid double horizontal line with a 3-d pushed-out + appearance. + + `"--:shadowEtchedInDash"' + A dashed horizontal line with a 3-d recessed appearance. + + `"--:shadowEtchedOutDash"' + A dashed horizontal line with a 3-d pushed-out appearance. + + `"--:shadowDoubleEtchedInDash"' + A dashed double horizontal line with a 3-d recessed + appearance. + + `"--:shadowDoubleEtchedOutDash"' + A dashed double horizontal line with a 3-d pushed-out + appearance. + + * 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. + + The possible keywords are as follows: + +:active FORM + FORM will be evaluated when the menu that this item is a part of + is about to be displayed, and the item will be selectable only if + the result is non-`nil'. If the item is unselectable, it will + usually be displayed grayed-out to indicate this. + +:suffix FORM + FORM will be evaluated when the menu that this item is a part of + is about to be displayed, and the resulting string is appended to + the displayed name. This provides 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. This can be used to + specify keys for more complex menu items. It is passed through + `substitute-command-keys' first. + +:style STYLE + Specifies what kind of object this menu item is. STYLE be one of + the symbols + + `nil' + A normal menu item. + + `toggle' + A toggle button. + + `radio' + A radio button. + + `button' + A menubar button. + + The only difference between toggle and radio buttons is how they + are displayed. But for consistency, a toggle button should be + used when there is one option whose value can be turned on or off, + and radio buttons should be used when there is a set of mutually + exclusive options. When using a group of radio buttons, you + should arrange for no more than one to be marked as selected at a + time. + +:selected FORM + Meaningful only when STYLE is `toggle', `radio' or `button'. This + specifies whether the button will be in the selected or unselected + state. FORM is evaluated, as for `:active'. + +:included FORM + This can be used to control the visibility of a menu item. The + form is evaluated and the menu item is only displayed if the + result is non-`nil'. Note that this is different from `:active': + If `:active' evaluates to `nil', the item will be displayed grayed + out, while if `:included' evaluates to `nil', the item will be + omitted entirely. + +:config SYMBOL + This is an efficient shorthand for `:included (memq SYMBOL + menubar-configuration)'. See the variable `menubar-configuration'. + +:accelerator KEY + A menu accelerator is a keystroke which can be pressed while the + menu is visible which will immediately activate the item. KEY + must be a char or the symbol name of a key. *Note Menu + Accelerators::. + + - Variable: menubar-configuration + This variable holds a list of symbols, against which the value of + the `:config' tag for each menubar item will be compared. If a + menubar item has a `:config' tag, then it is omitted from the + menubar if that tag is not a member of the `menubar-configuration' + list. + + For 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 + [ "Save As..." write-file] + [ "Revert Buffer" revert-buffer :active (buffer-modified-p) ] + [ "Read Only" toggle-read-only :style toggle :selected buffer-read-only ] + ) + + +File: lispref.info, Node: Menubar Format, Next: Menubar, Prev: Menu Format, Up: Menus + +Format of the Menubar +===================== + + A menubar is a list of menus, menu items, and strings. The format is +similar to that of a menu, except: + + * The first item need not be a string, and is not treated specially. + + * A string consisting solely of hyphens is not treated specially. + + * If an element of a menubar is `nil', then it is used to represent + the division between the set of menubar items which are flush-left + and those which are flush-right. (Note: this isn't completely + implemented yet.) + + +File: lispref.info, Node: Menubar, Next: Modifying Menus, Prev: Menubar Format, Up: Menus + +Menubar +======= + + - Variable: current-menubar + This variable holds the description of the current menubar. This + may be buffer-local. When the menubar is changed, the function + `set-menubar-dirty-flag' has to be called in order for the menubar + to be updated on the screen. + + - Constant: default-menubar + This variable holds the menubar description of the menubar that is + visible at startup. This is the value that `current-menubar' has + at startup. + + - Function: set-menubar-dirty-flag + This function tells XEmacs that the menubar widget has to be + updated. Changes to the menubar will generally not be visible + until this function is called. + + The following convenience functions are provided for setting the +menubar. They are equivalent to doing the appropriate action to change +`current-menubar', and then calling `set-menubar-dirty-flag'. Note +that these functions copy their argument using `copy-sequence'. + + - Function: set-menubar MENUBAR + This function sets the default menubar to be MENUBAR (*note Menu + Format::.). This is the menubar that will be visible in buffers + that have not defined their own, buffer-local menubar. + + - Function: set-buffer-menubar MENUBAR + This function sets the buffer-local menubar to be MENUBAR. This + does not change the menubar in any buffers other than the current + one. + + Miscellaneous: + + - Variable: menubar-show-keybindings + If true, the menubar will display keyboard equivalents. If false, + only the command names will be displayed. + + - Variable: activate-menubar-hook + Function or functions called before a menubar menu is pulled down. + These functions are called with no arguments, and should + interrogate and modify the value of `current-menubar' as desired. + + The functions on this hook are invoked after the mouse goes down, + but before the menu is mapped, and may be used to activate, + deactivate, add, or delete items from the menus. However, using a + filter (with the `:filter' keyword in a menu description) is + generally a more efficient way of accomplishing the same thing, + because the filter is invoked only when the actual menu goes down. + With a complex menu, there can be a quite noticeable and + sometimes aggravating delay if all menu modification is + implemented using the `activate-menubar-hook'. See above. + + These functions may return the symbol `t' to assert that they have + made no changes to the menubar. If any other value is returned, + the menubar is recomputed. If `t' is returned but the menubar has + been changed, then the changes may not show up right away. + Returning `nil' when the menubar has not changed is not so bad; + more computation will be done, but redisplay of the menubar will + still be performed optimally. + + - Variable: menu-no-selection-hook + Function or functions to call when a menu or dialog box is + dismissed without a selection having been made. + + +File: lispref.info, Node: Modifying Menus, Next: Pop-Up Menus, Prev: Menubar, Up: Menus + +Modifying Menus +=============== + + The following functions are provided to modify the menubar of one of +its submenus. Note that these functions modify the menu in-place, +rather than copying it and making a new menu. + + Some of these functions take a "menu path", which is a list of +strings identifying the menu to be modified. For example, `("File")' +names the top-level "File" menu. `("File" "Foo")' names a hypothetical +submenu of "File". + + Others take a "menu item path", which is similar to a menu path but +also specifies a particular item to be modified. For example, `("File" +"Save")' means the menu item called "Save" under the top-level "File" +menu. `("Menu" "Foo" "Item")' means the menu item called "Item" under +the "Foo" submenu of "Menu". + + - Function: add-submenu MENU-PATH SUBMENU &optional BEFORE + This function adds a menu to the menubar or one of its submenus. + If the named menu exists already, it is changed. + + MENU-PATH identifies the menu under which the new menu should be + inserted. If MENU-PATH is `nil', then the menu will be added to + the menubar itself. + + SUBMENU is the new menu to add (*note Menu Format::.). + + BEFORE, if provided, is the name of a menu before which this menu + should be added, if this menu is not on its parent already. If + the menu is already present, it will not be moved. + + - Function: add-menu-button MENU-PATH MENU-LEAF &optional BEFORE + This function adds a menu item to some menu, creating the menu + first if necessary. If the named item exists already, it is + changed. + + MENU-PATH identifies the menu under which the new menu item should + be inserted. + + MENU-LEAF is a menubar leaf node (*note Menu Format::.). + + BEFORE, if provided, is the name of a menu before which this item + should be added, if this item is not on the menu already. If the + item is already present, it will not be moved. + + - Function: delete-menu-item MENU-ITEM-PATH + This function removes the menu item specified by MENU-ITEM-PATH + from the menu hierarchy. + + - Function: enable-menu-item MENU-ITEM-PATH + This function makes the menu item specified by MENU-ITEM-PATH be + selectable. + + - Function: disable-menu-item MENU-ITEM-PATH + This function makes the menu item specified by MENU-ITEM-PATH be + unselectable. + + - Function: relabel-menu-item MENU-ITEM-PATH NEW-NAME + This function changes the string of the menu item specified by + MENU-ITEM-PATH. NEW-NAME is the string that the menu item will be + printed as from now on. + + The following function can be used to search for a particular item in +a menubar specification, given a path to the item. + + - Function: find-menu-item MENUBAR MENU-ITEM-PATH &optional PARENT + This function searches MENUBAR for the item given by + MENU-ITEM-PATH starting from PARENT (`nil' means start at the top + of MENUBAR). This function returns `(ITEM . PARENT)', where + PARENT is the immediate parent of the item found (a menu + description), and ITEM is either a vector, list, or string, + depending on the nature of the menu item. + + This function signals an error if the item is not found. + + The following deprecated functions are also documented, so that +existing code can be understood. You should not use these functions in +new code. + + - Function: add-menu MENU-PATH MENU-NAME MENU-ITEMS &optional BEFORE + This function adds a menu to the menubar or one of its submenus. + If the named menu exists already, it is changed. This is + obsolete; use `add-submenu' instead. + + MENU-PATH identifies the menu under which the new menu should be + inserted. If MENU-PATH is `nil', then the menu will be added to + the menubar itself. + + MENU-NAME is the string naming the menu to be added; MENU-ITEMS is + a list of menu items, strings, and submenus. These two arguments + are the same as the first and following elements of a menu + description (*note Menu Format::.). + + BEFORE, if provided, is the name of a menu before which this menu + should be added, if this menu is not on its parent already. If the + menu is already present, it will not be moved. + + - Function: add-menu-item MENU-PATH ITEM-NAME FUNCTION ENABLED-P + &optional BEFORE + This function adds a menu item to some menu, creating the menu + first if necessary. If the named item exists already, it is + changed. This is obsolete; use `add-menu-button' instead. + + MENU-PATH identifies the menu under which the new menu item should + be inserted. ITEM-NAME, FUNCTION, and ENABLED-P are the first, + second, and third elements of a menu item vector (*note Menu + Format::.). + + BEFORE, if provided, is the name of a menu item before which this + item should be added, if this item is not on the menu already. If + the item is already present, it will not be moved. + + +File: lispref.info, Node: Menu Filters, Next: Menu Accelerators, Prev: Pop-Up Menus, Up: Menus + +Menu Filters +============ + + The following filter functions are provided for use in +`default-menubar'. You may want to use them in your own menubar +description. + + - Function: file-menu-filter MENU-ITEMS + This function changes the arguments and sensitivity of these File + menu items: + + `Delete Buffer' + Has the name of the current buffer appended to it. + + `Print Buffer' + Has the name of the current buffer appended to it. + + `Pretty-Print Buffer' + Has the name of the current buffer appended to it. + + `Save Buffer' + Has the name of the current buffer appended to it, and is + sensitive only when the current buffer is modified. + + `Revert Buffer' + Has the name of the current buffer appended to it, and is + sensitive only when the current buffer has a file. + + `Delete Frame' + Sensitive only when there is more than one visible frame. + + - Function: edit-menu-filter MENU-ITEMS + This function changes the arguments and sensitivity of these Edit + menu items: + + `Cut' + Sensitive only when XEmacs owns the primary X Selection (if + `zmacs-regions' is `t', this is equivalent to saying that + there is a region selected). + + `Copy' + Sensitive only when XEmacs owns the primary X Selection. + + `Clear' + Sensitive only when XEmacs owns the primary X Selection. + + `Paste' + Sensitive only when there is an owner for the X Clipboard + Selection. + + `Undo' + Sensitive only when there is undo information. While in the + midst of an undo, this is changed to `Undo More'. + + - Function: buffers-menu-filter MENU-ITEMS + This function sets up the Buffers menu. *Note Buffers Menu::, for + more information. + diff --git a/info/lispref.info-2 b/info/lispref.info-2 index 9d40b0e..291dd3e 100644 --- a/info/lispref.info-2 +++ b/info/lispref.info-2 @@ -1,5 +1,5 @@ -This is ../info/lispref.info, produced by makeinfo version 4.0 from -lispref/lispref.texi. +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -460,7 +460,7 @@ but not flawless. There are a few topics that are not covered, either because we consider them secondary (such as most of the individual modes) or because they are yet to be written. Because we are not able to deal with them completely, we have left out several parts -intentionally. +intentionally. This includes most information about usage on VMS. The manual should be fully correct in what it does cover, and it is therefore open to criticism on anything it says--from specific examples @@ -477,7 +477,7 @@ function or variable name, as appropriate. Also state the number of the edition which you are criticizing. 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 +by 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 @@ -667,7 +667,7 @@ and "after" versions of the text. These examples show the contents of the buffer in question between two lines of dashes containing the buffer name. In addition, `-!-' indicates the location of point. (The symbol for point, of course, is not part of the text in the buffer; it -indicates the place _between_ two characters where point is located.) +indicates the place *between* two characters where point is located.) ---------- Buffer: foo ---------- This is the -!-contents of foo. @@ -723,7 +723,7 @@ Do not write `&rest' when you call the function. Here is a description of an imaginary function `foo': - - Function: foo integer1 &optional integer2 &rest integers + - Function: foo INTEGER1 &optional INTEGER2 &rest INTEGERS The function `foo' subtracts INTEGER1 from INTEGER2, then adds all the rest of the arguments to the result. If INTEGER2 is not supplied, then the number 19 is used by default. @@ -939,7 +939,7 @@ signals the error `invalid-read-syntax' whenever it encounters `#<'. When you evaluate an expression interactively, the Lisp interpreter first reads the textual representation of it, producing a Lisp object, -and then evaluates that object (*note Evaluation::). However, +and then evaluates that object (*note Evaluation::.). However, evaluation and reading are separate activities. Reading returns the Lisp object represented by the text that is read; the object may or may not be evaluated later. *Note Input Functions::, for a description of @@ -962,7 +962,7 @@ system. The `#@COUNT' construct, which skips the next COUNT characters, is useful for program-generated comments containing binary data. The XEmacs Lisp byte compiler uses this in its output files (*note Byte -Compilation::). It isn't meant for source files, however. +Compilation::.). It isn't meant for source files, however. *Note Comment Tips::, for conventions for formatting comments. @@ -1138,7 +1138,7 @@ Integer Type machines, in particular 64-bit machines such as the DEC Alpha, may provide a wider range.) It is important to note that the XEmacs Lisp arithmetic functions do not check for overflow. Thus `(1+ 134217727)' -is -134217728 on most machines. (However, you _will_ get an error if +is -134217728 on most machines. (However, you *will* get an error if you attempt to read an out-of-range number using the Lisp reader.) The read syntax for integers is a sequence of (base ten) digits with diff --git a/info/lispref.info-20 b/info/lispref.info-20 new file mode 100644 index 0000000..b30dff0 --- /dev/null +++ b/info/lispref.info-20 @@ -0,0 +1,1214 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Pop-Up Menus, Next: Menu Filters, Prev: Modifying Menus, Up: Menus + +Pop-Up Menus +============ + + - Function: popup-menu MENU-DESC + This function pops up a menu specified by MENU-DESC, which is a + menu description (*note Menu Format::.). The menu is displayed at + the current mouse position. + + - Function: popup-menu-up-p + This function returns `t' if a pop-up menu is up, `nil' otherwise. + + - Variable: popup-menu-titles + If true (the default), pop-up menus will have title bars at the + top. + + Some machinery is provided that attempts to provide a higher-level +mechanism onto pop-up menus. This only works if you do not redefine +the binding for button3. + + - Command: popup-mode-menu + This function pops up a menu of global and mode-specific commands. + The menu is computed by combining `global-popup-menu' and + `mode-popup-menu'. This is the default binding for button3. You + should generally not change this binding. + + - Variable: global-popup-menu + This holds the global popup menu. This is present in all modes. + (This is `nil' by default.) + + - Variable: mode-popup-menu + The mode-specific popup menu. Automatically buffer local. This + is appended to the default items in `global-popup-menu'. + + - Constant: default-popup-menu + This holds the default value of `mode-popup-menu'. + + - Variable: activate-popup-menu-hook + Function or functions run before a mode-specific popup menu is made + visible. These functions are called with no arguments, and should + interrogate and modify the value of `global-popup-menu' or + `mode-popup-menu' as desired. Note: this hook is only run if you + use `popup-mode-menu' for activating the global and mode-specific + commands; if you have your own binding for button3, this hook + won't be run. + + The following convenience functions are provided for displaying +pop-up menus. + + - Function: popup-buffer-menu EVENT + This function pops up a copy of the `Buffers' menu (from the + menubar) where the mouse is clicked. + + - Function: popup-menubar-menu EVENT + This function pops up a copy of menu that also appears in the + menubar. + + +File: lispref.info, Node: Menu Accelerators, Next: Buffers Menu, Prev: Menu Filters, Up: Menus + +Menu Accelerators +================= + + Menu accelerators are keyboard shortcuts for accessing the menubar. +Accelerator keys can be specified for menus as well as for menu items. +An accelerator key for a menu is used to activate that menu when it +appears as a submenu of another menu. An accelerator key for a menu +item is used to 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. + + +File: lispref.info, Node: Creating Menu Accelerators, Next: Keyboard Menu Traversal, Up: Menu Accelerators + +Creating Menu Accelerators +-------------------------- + + Menu accelerators are specified as part of the menubar format using +the :accelerator tag to specify a key or by placing "%_" in the menu or +menu item name prior to the letter which is to be used as the +accelerator key. The advantage of the second method is that the menu +rendering code then knows to draw an underline under that character, +which is the canonical way of indicating an accelerator key to a user. + + For example, the command + + (add-submenu nil '("%_Test" + ["One" (insert "1") :accelerator ?1 :active t] + ["%_Two" (insert "2")] + ["%_3" (insert "3")])) + + will add a new menu to the top level menubar. The new menu can be +reached by pressing "t" while the top level menubar is active. When +the menu is active, pressing "1" will activate the first item and +insert the character "1" into the buffer. Pressing "2" will activate +the second item and insert the character "2" into the buffer. Pressing +"3" will activate the third item and insert the character "3" into the +buffer. + + It is possible to activate the top level menubar itself using +accelerator keys. *Note Menu Accelerator Functions::. + + +File: lispref.info, Node: Keyboard Menu Traversal, Next: Menu Accelerator Functions, Prev: Creating Menu Accelerators, Up: Menu Accelerators + +Keyboard Menu Traversal +----------------------- + + In addition to immediately activating a menu or menu item, the +keyboard can be used to traverse the menus without activating items. +The keyboard arrow keys, the return key and the escape key are defined +to traverse the menus in a way that should be familiar to users of any +of a certain family of popular PC operating systems. + + This behavior can be changed by modifying the bindings in +menu-accelerator-map. At this point, the online help is your best bet +for more information about how to modify the menu traversal keys. + + +File: lispref.info, Node: Menu Accelerator Functions, Prev: Keyboard Menu Traversal, Up: Menu Accelerators + +Menu Accelerator Functions +-------------------------- + + - Function: accelerate-menu + Make the menubar immediately active and place the cursor on the + left most entry in the top level menu. Menu items can be selected + as usual. + + - Variable: menu-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. + + The default value is `nil'. + + See also MENU-ACCELERATOR-MODIFIERS and MENU-ACCELERATOR-PREFIX. + + - Variable: menu-accelerator-map + Keymap consulted to determine the commands to run in response to + keypresses occurring while the menubar is active. *Note Keyboard + Menu Traversal::. + + - Variable: menu-accelerator-modifiers + A list of modifier keys which must be pressed in addition to a + valid menu accelerator in order for the top level menu to be + activated in response to a keystroke. The default value of + `(meta)' mirrors the usage of the alt key as a menu accelerator in + popular PC operating systems. + + The modifier keys in MENU-ACCELERATOR-MODIFIERS must match exactly + the modifiers present in the keypress. The only exception is that + the shift modifier is accepted in conjunction with alphabetic keys + even if it is not a menu accelerator modifier. + + See also MENU-ACCELERATOR-ENABLED and MENU-ACCELERATOR-PREFIX. + + - Variable: menu-accelerator-prefix + Prefix key(s) that must be typed before menu accelerators will be + activated. Must be a valid key descriptor. + + The default value is `nil'. + + (setq menu-accelerator-prefix ?\C-x) + (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")])) + + will add the menu "Test" to the top level menubar. Pressing C-x +followed by C-M-T will activate the menubar and display the "Test" +menu. Pressing C-M-T by itself will not activate the menubar. Neither +will pressing C-x followed by anything else. + + +File: lispref.info, Node: Buffers Menu, Prev: Menu Accelerators, Up: Menus + +Buffers Menu +============ + + The following options control how the `Buffers' menu is displayed. +This is a list of all (or a subset of) the buffers currently in +existence, and is updated dynamically. + + - User Option: buffers-menu-max-size + This user option holds the 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 shown. If this is `nil', + then all buffers will be shown. Setting this to a large number or + `nil' will slow down menu responsiveness. + + - Function: format-buffers-menu-line BUFFER + This function returns a string to represent BUFFER in the + `Buffers' menu. `nil' means the buffer shouldn't be listed. You + can redefine this. + + - User Option: complex-buffers-menu-p + If true, the `Buffers' menu will contain several commands, as + submenus of each buffer line. If this is false, then there will + be only one command: select that buffer. + + - User Option: buffers-menu-switch-to-buffer-function + This user option holds the function to call to select a buffer + from the `Buffers' menu. `switch-to-buffer' is a good choice, as + is `pop-to-buffer'. + + +File: lispref.info, Node: Dialog Boxes, Next: Toolbar, Prev: Menus, Up: Top + +Dialog Boxes +************ + +* Menu: + +* Dialog Box Format:: +* Dialog Box Functions:: + + +File: lispref.info, Node: Dialog Box Format, Next: Dialog Box Functions, Up: Dialog Boxes + +Dialog Box Format +================= + + A dialog box description is a list. + + * The first element of the list is a string to display in the dialog + box. + + * The rest of the elements are descriptions of the dialog box's + buttons. Each one is a vector of three elements: + - The first element is the text of the button. + + - The second element is the "callback". + + - The third element is `t' or `nil', whether this button is + selectable. + + If the callback of a button is a symbol, then it must name a command. +It will be invoked with `call-interactively'. If it is a list, then it +is evaluated with `eval'. + + One (and only one) of the buttons may be `nil'. This marker means +that all following buttons should be flushright instead of flushleft. + + The syntax, more precisely: + + form := + command := + callback := command | form + active-p := + name := + partition := 'nil' + button := '[' name callback active-p ']' + dialog := '(' name [ button ]+ [ partition [ button ]+ ] ')' + + +File: lispref.info, Node: Dialog Box Functions, Prev: Dialog Box Format, Up: Dialog Boxes + +Dialog Box Functions +==================== + + - Function: popup-dialog-box DBOX-DESC + This function pops up a dialog box. DBOX-DESC describes how the + dialog box will appear (*note Dialog Box Format::.). + + *Note Yes-or-No Queries::, for functions to ask a yes/no question +using a dialog box. + + +File: lispref.info, Node: Toolbar, Next: Scrollbars, Prev: Dialog Boxes, Up: Top + +Toolbar +******* + +* Menu: + +* Toolbar Intro:: An introduction. +* Toolbar Descriptor Format:: How to create a toolbar. +* Specifying the Toolbar:: Setting a toolbar's contents. +* Other Toolbar Variables:: Controlling the size of toolbars. + + +File: lispref.info, Node: Toolbar Intro, Next: Toolbar Descriptor Format, Up: Toolbar + +Toolbar Intro +============= + + A "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 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 "help-echo") describing what an +icon in the toolbar (called a "toolbar button") does, is displayed in +the minibuffer when the mouse is over the button. + + In XEmacs, a toolbar can be displayed along any of the four edges of +the frame, and two or more different edges can be displaying toolbars +simultaneously. The contents, thickness, and visibility of the +toolbars can be controlled separately, and the values can be +per-buffer, per-frame, etc., using specifiers (*note Specifiers::.). + + Normally, there is one toolbar displayed in a frame. Usually, this +is the standard toolbar, but certain modes will override this and +substitute their own toolbar. In some cases (e.g. the VM package), a +package will supply its own toolbar along a different edge from the +standard toolbar, so that both can be visible at once. This standard +toolbar is usually positioned along the top of the frame, but this can +be changed using `set-default-toolbar-position'. + + Note that, for each of the toolbar properties (contents, thickness, +and visibility), there is a separate specifier for each of the four +toolbar positions (top, bottom, left, and right), and an additional +specifier for the "default" toolbar, i.e. the toolbar whose position is +controlled by `set-default-toolbar-position'. The way this works is +that `set-default-toolbar-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 toolbar, you just change the default +specifiers, and everything works. A package such as VM that wants to +put its own toolbar in a different location from the default just sets +the position-specific specifiers, and if the user sets the default +toolbar to the same position, it will just not be visible. + + +File: lispref.info, Node: Toolbar Descriptor Format, Next: Specifying the Toolbar, Prev: Toolbar Intro, Up: Toolbar + +Toolbar Descriptor Format +========================= + + The contents of a toolbar are specified using a "toolbar descriptor". +The format of a toolbar descriptor is a list of "toolbar button +descriptors". Each toolbar button descriptor is a vector in one of the +following formats: + + * `[GLYPH-LIST FUNCTION ENABLED-P HELP]' + + * `[:style 2D-OR-3D]' + + * `[:style 2D-OR-3D :size WIDTH-OR-HEIGHT]' + + * `[:size WIDTH-OR-HEIGHT :style 2D-OR-3D]' + + Optionally, one of the toolbar button descriptors may be `nil' +instead of a vector; this signifies the division between the toolbar +buttons that are to be displayed flush-left, and the buttons to be +displayed flush-right. + + The first vector format above specifies a normal toolbar button; the +others specify blank areas in the toolbar. + + For the first vector format: + + * GLYPH-LIST should be a list of one to six glyphs (as created by + `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 + toolbar 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 + toolbar buttons (using `toolbar-buttons-captioned-p'). The + function `toolbar-make-button-list' is useful in creating these + glyph lists. + + * 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. + + * If some of the toolbar glyphs are not provided, they inherit as + follows: + + 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 + + * The second element FUNCTION is a function to be called when the + toolbar button is activated (i.e. when the mouse is released over + the toolbar button, if the press occurred in the toolbar). It can + be any form accepted by `call-interactively', since this is how it + is invoked. + + * The third element ENABLED-P specifies whether the toolbar 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. + + * The fourth element HELP, if non-`nil', should be a string. This + string is displayed in the echo area when the mouse passes over the + toolbar button. + + For the other vector formats (specifying blank areas of the toolbar): + + * 2D-OR-3D should be one of the symbols `2d' or `3d', indicating + whether the area is displayed with shadows (giving it a raised, + 3-d appearance) or without shadows (giving it a flat appearance). + + * 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). + + - Function: toolbar-make-button-list UP &optional DOWN DISABLED CAP-UP + CAP-DOWN CAP-DISABLED + This function calls `make-glyph' on each arg and returns a list of + the results. This is useful for setting the first argument of a + toolbar button descriptor (typically, the result of this function + is assigned to a symbol, which is specified as the first argument + of the toolbar button descriptor). + + - Function: check-toolbar-button-syntax BUTTON &optional NOERROR + Verify the syntax of entry BUTTON in a toolbar description list. + If you want to verify the syntax of a toolbar description list as a + whole, use `check-valid-instantiator' with a specifier type of + `toolbar'. + + +File: lispref.info, Node: Specifying the Toolbar, Next: Other Toolbar Variables, Prev: Toolbar Descriptor Format, Up: Toolbar + +Specifying the Toolbar +====================== + + In order to specify the contents of a toolbar, set one of the +specifier variables `default-toolbar', `top-toolbar', `bottom-toolbar', +`left-toolbar', or `right-toolbar'. These are specifiers, which means +you set them with `set-specifier' and query them with `specifier-specs' +or `specifier-instance'. You will get an error if you try to set them +using `setq'. The valid instantiators for these specifiers are toolbar +descriptors, as described above. *Note Specifiers::, for more +information. + + Most of the time, you will set `default-toolbar', which allows the +user to choose where the toolbar should go. + + - Specifier: default-toolbar + The position of this toolbar is specified in the function + `default-toolbar-position'. If the corresponding + position-specific toolbar (e.g. `top-toolbar' if + `default-toolbar-position' is `top') does not specify a toolbar in + a particular domain, then the value of `default-toolbar' in that + domain, of any, will be used instead. + + Note that the toolbar 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 `top-toolbar-height', +`bottom-toolbar-height', `left-toolbar-width', and +`right-toolbar-width', and the visibility status is controlled by the +specifiers `top-toolbar-visible-p', `bottom-toolbar-visible-p', +`left-toolbar-visible-p', and `right-toolbar-visible-p' (*note Other +Toolbar Variables::.). + + - Function: set-default-toolbar-position POSITION + This function sets the position that the `default-toolbar' will be + displayed at. Valid positions are the symbols `top', `bottom', + `left' and `right'. What this actually does is set the fallback + specifier for the position-specific specifier corresponding to the + given position to `default-toolbar', and set the fallbacks for the + other position-specific specifiers to `nil'. It also does the + same thing for the position-specific thickness and visibility + specifiers, which inherit from one of `default-toolbar-height' or + `default-toolbar-width', and from `default-toolbar-visible-p', + respectively (*note Other Toolbar Variables::.). + + - Function: default-toolbar-position + This function returns the position that the `default-toolbar' will + be displayed at. + + You can also explicitly set a toolbar 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 +toolbar. If that does not yield a toolbar descriptor, the +`default-toolbar' is consulted if `default-toolbar-position' indicates +this position. + + - Specifier: top-toolbar + Specifier for the toolbar at the top of the frame. + + - Specifier: bottom-toolbar + Specifier for the toolbar at the bottom of the frame. + + - Specifier: left-toolbar + Specifier for the toolbar at the left edge of the frame. + + - Specifier: right-toolbar + Specifier for the toolbar at the right edge of the frame. + + - Function: toolbar-specifier-p OBJECT + This function returns non-nil if OBJECT is a toolbar specifier. + Toolbar specifiers are the actual objects contained in the toolbar + variables described above, and their valid instantiators are + toolbar descriptors (*note Toolbar Descriptor Format::.). + + +File: lispref.info, Node: Other Toolbar Variables, Prev: Specifying the Toolbar, Up: Toolbar + +Other Toolbar Variables +======================= + + The variables to control the toolbar thickness, visibility status, +and captioned status are all specifiers. *Note Specifiers::. + + - Specifier: default-toolbar-height + This specifies the height of the default toolbar, if it's oriented + horizontally. The position of the default toolbar is specified by + the function `set-default-toolbar-position'. If the corresponding + position-specific toolbar thickness specifier (e.g. + `top-toolbar-height' if `default-toolbar-position' is `top') does + not specify a thickness in a particular domain (a window or a + frame), then the value of `default-toolbar-height' or + `default-toolbar-width' (depending on the toolbar orientation) in + that domain, if any, will be used instead. + + - Specifier: default-toolbar-width + This specifies the width of the default toolbar, if it's oriented + vertically. This behaves like `default-toolbar-height'. + + Note that `default-toolbar-height' is only used when +`default-toolbar-position' is `top' or `bottom', and +`default-toolbar-width' is only used when `default-toolbar-position' is +`left' or `right'. + + - Specifier: top-toolbar-height + This specifies the height of the top toolbar. + + - Specifier: bottom-toolbar-height + This specifies the height of the bottom toolbar. + + - Specifier: left-toolbar-width + This specifies the width of the left toolbar. + + - Specifier: right-toolbar-width + This specifies the width of the right toolbar. + + Note that all of the position-specific toolbar thickness specifiers +have a fallback value of zero when they do not correspond to the +default toolbar. Therefore, you will have to set a non-zero thickness +value if you want a position-specific toolbar to be displayed. + + - Specifier: default-toolbar-visible-p + This specifies whether the default toolbar is visible. The + position of the default toolbar is specified by the function + `set-default-toolbar-position'. If the corresponding + position-specific toolbar visibility specifier (e.g. + `top-toolbar-visible-p' if `default-toolbar-position' is `top') + does not specify a visible-p value in a particular domain (a + window or a frame), then the value of `default-toolbar-visible-p' + in that domain, if any, will be used instead. + + - Specifier: top-toolbar-visible-p + This specifies whether the top toolbar is visible. + + - Specifier: bottom-toolbar-visible-p + This specifies whether the bottom toolbar is visible. + + - Specifier: left-toolbar-visible-p + This specifies whether the left toolbar is visible. + + - Specifier: right-toolbar-visible-p + This specifies whether the right toolbar is visible. + + `default-toolbar-visible-p' and all of the position-specific toolbar +visibility specifiers have a fallback value of true. + + Internally, toolbar 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 toolbar thickness or visibility that you will see in that frame. +The value in the domain of a frame itself specifies the toolbar +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 toolbar width for that frame to 68 pixels, then the frame will +be sized to fit 80 characters plus a 68-pixel left toolbar. If you then +set the left toolbar width to 0 for a particular buffer (or if that +buffer does not specify a left toolbar or has a nil value specified for +`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 +selected window specifies that the left toolbar is not visible, so it is +expanded to take up the slack. + + - Specifier: toolbar-buttons-captioned-p + Whether toolbar buttons are captioned. This affects which glyphs + from a toolbar button descriptor are chosen. *Note Toolbar + Descriptor Format::. + + You can also reset the toolbar to what it was when XEmacs started up. + + - Constant: initial-toolbar-spec + The toolbar descriptor used to initialize `default-toolbar' at + startup. + + +File: lispref.info, Node: Scrollbars, Next: Drag and Drop, Prev: Toolbar, Up: Top + +scrollbars +********** + + Not yet documented. + + +File: lispref.info, Node: Drag and Drop, Next: Modes, Prev: Scrollbars, Up: Top + +Drag and Drop +************* + + *WARNING*: the Drag'n'Drop API is still under development and the +interface may change! The current implementation is considered +experimental. + + Drag'n'drop is a way to transfer information between multiple +applications. To do this several GUIs define their own protocols. +Examples are OffiX, CDE, Motif, KDE, MSWindows, GNOME, and many more. +To catch all these protocols, XEmacs provides a generic API. + + One prime idea behind the API is to use a data interface that is +transparent for all systems. The author thinks that this is best +archived by using URL and MIME data, cause any internet enabled system +must support these for email already. XEmacs also already provides +powerful interfaces to support these types of data (tm and w3). + +* Menu: + +* Supported Protocols:: Which low-level protocols are supported. +* Drop Interface:: How XEmacs handles a drop from another application. +* Drag Interface:: Calls to initiate a drag from XEmacs. + + +File: lispref.info, Node: Supported Protocols, Next: Drop Interface, Up: Drag and Drop + +Supported Protocols +=================== + + The current release of XEmacs only support a small set of Drag'n'drop +protocols. Some of these only support limited options available in the +API. + +* Menu: + +* OffiX DND:: A generic X based protocol. +* CDE dt:: Common Desktop Environment used on suns. +* MSWindows OLE:: Mr. Gates way of live. +* Loose ends:: The other protocols. + + +File: lispref.info, Node: OffiX DND, Next: CDE dt, Up: Supported Protocols + +OffiX DND +--------- + + *WARNING*: If you compile in OffiX, you may not be able to use +multiple X displays successfully. If the two servers are from +different vendors, the results may be unpredictable. + + The OffiX Drag'n'Drop protocol is part of a X API/Widget library +created by Cesar Crusius. It is based on X-Atoms and ClientMessage +events, and works with any X platform supporting them. + + OffiX is supported if 'offix is member of the variable +dragdrop-protocols, or the feature 'offix is defined. + + Unfortunately it uses it's own data types. Examples are: File, Files, +Exe, Link, URL, MIME. The API tries to choose the right type for the +data that is dragged from XEmacs (well, not yet...). + + XEmacs supports both MIME and URL drags and drops using this API. No +application interaction is possible while dragging is in progress. + + For information about the OffiX project have a look at +http://leb.net/~offix/ + + +File: lispref.info, Node: CDE dt, Next: MSWindows OLE, Prev: OffiX DND, Up: Supported Protocols + +CDE dt +------ + + CDE stands for Common Desktop Environment. It is based on the Motif +widget library. It's drag'n'drop protocol is also an abstraction of the +Motif protocol (so it might be possible, that XEmacs will also support +the Motif protocol soon). + + CDE has three different types: file, buffer, and text. XEmacs only +uses file and buffer drags. The API will disallow full URL drags, only +file method URLs are passed through. + + Buffer drags are always converted to plain text. + + +File: lispref.info, Node: MSWindows OLE, Next: Loose ends, Prev: CDE dt, Up: Supported Protocols + +MSWindows OLE +------------- + + Only allows file drags and drops. + + +File: lispref.info, Node: Loose ends, Prev: MSWindows OLE, Up: Supported Protocols + +Loose ends +---------- + + The following protocols will be supported soon: Xdnd, Motif, Xde (if +I get some specs), KDE OffiX (if KDE can find XEmacs windows). + + In particular Xdnd will be one of the protocols that can benefit from +the XEmacs API, cause it also uses MIME types to encode dragged data. + + +File: lispref.info, Node: Drop Interface, Next: Drag Interface, Prev: Supported Protocols, Up: Drag and Drop + +Drop Interface +============== + + For each activated low-level protocol, a internal routine will catch +incoming drops and convert them to a dragdrop-drop type misc-user-event. + + This misc-user-event has its function argument set to +`dragdrop-drop-dispatch' and the object contains the data of the drop +(converted to URL/MIME specific data). This function will search the +variable `experimental-dragdrop-drop-functions' for a function that can +handle the dropped data. + + To modify the drop behavior, the user can modify the variable +`experimental-dragdrop-drop-functions'. Each element of this list +specifies a possible handler for dropped data. The first one that can +handle the data will return `t' and exit. Another possibility is to set +a extent-property with the same name. Extents are checked prior to the +variable. + + The customization group `drag-n-drop' shows all variables of user +interest. + + +File: lispref.info, Node: Drag Interface, Prev: Drop Interface, Up: Drag and Drop + +Drag Interface +============== + + This describes the drag API (not implemented yet). + + +File: lispref.info, Node: Modes, Next: Documentation, Prev: Drag and Drop, Up: Top + +Major and Minor Modes +********************* + + A "mode" is a set of definitions that customize XEmacs and can be +turned on and off while you edit. There are two varieties of modes: +"major modes", which are mutually exclusive and used for editing +particular kinds of text, and "minor modes", which provide features +that users can enable individually. + + This chapter describes how to write both major and minor modes, how +to indicate them in the modeline, and how they run hooks supplied by the +user. For related topics such as keymaps and syntax tables, see *Note +Keymaps::, and *Note Syntax Tables::. + +* Menu: + +* Major Modes:: Defining major modes. +* Minor Modes:: Defining minor modes. +* Modeline Format:: Customizing the text that appears in the modeline. +* Hooks:: How to use hooks; how to write code that provides hooks. + + +File: lispref.info, Node: Major Modes, Next: Minor Modes, Up: Modes + +Major Modes +=========== + + Major modes specialize XEmacs for editing particular kinds of text. +Each buffer has only one major mode at a time. + + The least specialized major mode is called "Fundamental mode". This +mode has no mode-specific definitions or variable settings, so each +XEmacs command behaves in its default manner, and each option is in its +default state. All other major modes redefine various keys and options. +For example, Lisp Interaction mode provides special key bindings for + (`eval-print-last-sexp'), (`lisp-indent-line'), and other +keys. + + When you need to write several editing commands to help you perform a +specialized editing task, creating a new major mode is usually a good +idea. In practice, writing a major mode is easy (in contrast to +writing a minor mode, which is often difficult). + + If the new mode is similar to an old one, it is often unwise to +modify the old one to serve two purposes, since it may become harder to +use and maintain. Instead, copy and rename an existing major mode +definition and alter the copy--or define a "derived mode" (*note +Derived Modes::.). For example, Rmail Edit mode, which is in +`emacs/lisp/rmailedit.el', is a major mode that is very similar to Text +mode except that it provides three additional commands. Its definition +is distinct from that of Text mode, but was derived from it. + + Rmail Edit mode is an example of a case where one piece of text is +put temporarily into a different major mode so it can be edited in a +different way (with ordinary XEmacs commands rather than Rmail). In +such cases, the temporary major mode usually has a command to switch +back to the buffer's usual mode (Rmail mode, in this case). You might +be tempted to present the temporary redefinitions inside a recursive +edit and restore the usual ones when the user exits; but this is a bad +idea because it constrains the user's options when it is done in more +than one buffer: recursive edits must be exited most-recently-entered +first. Using alternative major modes avoids this limitation. *Note +Recursive Editing::. + + The standard XEmacs Lisp library directory contains the code for +several major modes, in files including `text-mode.el', `texinfo.el', +`lisp-mode.el', `c-mode.el', and `rmail.el'. You can look at these +libraries to see how modes are written. Text mode is perhaps the +simplest major mode aside from Fundamental mode. Rmail mode is a +complicated and specialized mode. + +* Menu: + +* Major Mode Conventions:: Coding conventions for keymaps, etc. +* Example Major Modes:: Text mode and Lisp modes. +* Auto Major Mode:: How XEmacs chooses the major mode automatically. +* Mode Help:: Finding out how to use a mode. +* Derived Modes:: Defining a new major mode based on another major + mode. + + +File: lispref.info, Node: Major Mode Conventions, Next: Example Major Modes, Up: Major Modes + +Major Mode Conventions +---------------------- + + The code for existing major modes follows various coding conventions, +including conventions for local keymap and syntax table initialization, +global names, and hooks. Please follow these conventions when you +define a new major mode: + + * Define a command whose name ends in `-mode', with no arguments, + that switches to the new mode in the current buffer. This command + should set up the keymap, syntax table, and local variables in an + existing buffer without changing the buffer's text. + + * Write a documentation string for this command that describes the + special commands available in this mode. `C-h m' + (`describe-mode') in your mode will display this string. + + The documentation string may include the special documentation + substrings, `\[COMMAND]', `\{KEYMAP}', and `\', that + enable the documentation to adapt automatically to the user's own + key bindings. *Note Keys in Documentation::. + + * The major mode command should start by calling + `kill-all-local-variables'. This is what gets rid of the local + variables of the major mode previously in effect. + + * The major mode command should set the variable `major-mode' to the + major mode command symbol. This is how `describe-mode' discovers + which documentation to print. + + * The major mode command should set the variable `mode-name' to the + "pretty" name of the mode, as a string. This appears in the mode + line. + + * Since all global names are in the same name space, all the global + variables, constants, and functions that are part of the mode + should have names that start with the major mode name (or with an + abbreviation of it if the name is long). *Note Style Tips::. + + * The major mode should usually have its own keymap, which is used + as the local keymap in all buffers in that mode. The major mode + function should call `use-local-map' to install this local map. + *Note Active Keymaps::, for more information. + + This keymap should be kept in a global variable named + `MODENAME-mode-map'. Normally the library that defines the mode + sets this variable. + + * The mode may have its own syntax table or may share one with other + related modes. If it has its own syntax table, it should store + this in a variable named `MODENAME-mode-syntax-table'. *Note + Syntax Tables::. + + * The mode may have its own abbrev table or may share one with other + related modes. If it has its own abbrev table, it should store + this in a variable named `MODENAME-mode-abbrev-table'. *Note + Abbrev Tables::. + + * Use `defvar' to set mode-related variables, so that they are not + reinitialized if they already have a value. (Such reinitialization + could discard customizations made by the user.) + + * To make a buffer-local binding for an Emacs customization + variable, use `make-local-variable' in the major mode command, not + `make-variable-buffer-local'. The latter function would make the + variable local to every buffer in which it is subsequently set, + which would affect buffers that do not use this mode. It is + undesirable for a mode to have such global effects. *Note + Buffer-Local Variables::. + + It's ok to use `make-variable-buffer-local', if you wish, for a + variable used only within a single Lisp package. + + * Each major mode should have a "mode hook" named + `MODENAME-mode-hook'. The major mode command should run that + hook, with `run-hooks', as the very last thing it does. *Note + Hooks::. + + * The major mode command may also run the hooks of some more basic + modes. For example, `indented-text-mode' runs `text-mode-hook' as + well as `indented-text-mode-hook'. It may run these other hooks + immediately before the mode's own hook (that is, after everything + else), or it may run them earlier. + + * If something special should be done if the user switches a buffer + from this mode to any other major mode, the mode can set a local + value for `change-major-mode-hook'. + + * If this mode is appropriate only for specially-prepared text, then + the major mode command symbol should have a property named + `mode-class' with value `special', put on as follows: + + (put 'funny-mode 'mode-class 'special) + + This tells XEmacs that new buffers created while the current + buffer has Funny mode should not inherit Funny mode. Modes such + as Dired, Rmail, and Buffer List use this feature. + + * If you want to make the new mode the default for files with certain + recognizable names, add an element to `auto-mode-alist' to select + the mode for those file names. If you define the mode command to + autoload, you should add this element in the same file that calls + `autoload'. Otherwise, it is sufficient to add the element in the + file that contains the mode definition. *Note Auto Major Mode::. + + * In the documentation, you should provide a sample `autoload' form + and an example of how to add to `auto-mode-alist', that users can + include in their `.emacs' files. + + * The top-level forms in the file defining the mode should be + written so that they may be evaluated more than once without + adverse consequences. Even if you never load the file more than + once, someone else will. + + - Variable: change-major-mode-hook + This normal hook is run by `kill-all-local-variables' before it + does anything else. This gives major modes a way to arrange for + something special to be done if the user switches to a different + major mode. For best results, make this variable buffer-local, so + that it will disappear after doing its job and will not interfere + with the subsequent major mode. *Note Hooks::. + + +File: lispref.info, Node: Example Major Modes, Next: Auto Major Mode, Prev: Major Mode Conventions, Up: Major Modes + +Major Mode Examples +------------------- + + Text mode is perhaps the simplest mode besides Fundamental mode. +Here are excerpts from `text-mode.el' that illustrate many of the +conventions listed above: + + ;; Create mode-specific tables. + (defvar text-mode-syntax-table nil + "Syntax table used while in text mode.") + + (if text-mode-syntax-table + () ; Do not change the table if it is already set up. + (setq text-mode-syntax-table (make-syntax-table)) + (modify-syntax-entry ?\" ". " text-mode-syntax-table) + (modify-syntax-entry ?\\ ". " text-mode-syntax-table) + (modify-syntax-entry ?' "w " text-mode-syntax-table)) + + (defvar text-mode-abbrev-table nil + "Abbrev table used while in text mode.") + (define-abbrev-table 'text-mode-abbrev-table ()) + + (defvar text-mode-map nil) ; Create a mode-specific keymap. + + (if text-mode-map + () ; Do not change the keymap if it is already set up. + (setq text-mode-map (make-sparse-keymap)) + (define-key text-mode-map "\t" 'tab-to-tab-stop) + (define-key text-mode-map "\es" 'center-line) + (define-key text-mode-map "\eS" 'center-paragraph)) + + Here is the complete major mode function definition for Text mode: + + (defun text-mode () + "Major mode for editing text intended for humans to read. + Special commands: \\{text-mode-map} + + Turning on text-mode runs the hook `text-mode-hook'." + (interactive) + (kill-all-local-variables) + + (use-local-map text-mode-map) ; This provides the local keymap. + (setq mode-name "Text") ; This name goes into the modeline. + (setq major-mode 'text-mode) ; This is how `describe-mode' + ; finds the doc string to print. + (setq local-abbrev-table text-mode-abbrev-table) + (set-syntax-table text-mode-syntax-table) + (run-hooks 'text-mode-hook)) ; Finally, this permits the user to + ; customize the mode with a hook. + + The three Lisp modes (Lisp mode, Emacs Lisp mode, and Lisp +Interaction mode) have more features than Text mode and the code is +correspondingly more complicated. Here are excerpts from +`lisp-mode.el' that illustrate how these modes are written. + + ;; Create mode-specific table variables. + (defvar lisp-mode-syntax-table nil "") + (defvar emacs-lisp-mode-syntax-table nil "") + (defvar lisp-mode-abbrev-table nil "") + + (if (not emacs-lisp-mode-syntax-table) ; Do not change the table + ; if it is already set. + (let ((i 0)) + (setq emacs-lisp-mode-syntax-table (make-syntax-table)) + + ;; Set syntax of chars up to 0 to class of chars that are + ;; part of symbol names but not words. + ;; (The number 0 is `48' in the ASCII character set.) + (while (< i ?0) + (modify-syntax-entry i "_ " emacs-lisp-mode-syntax-table) + (setq i (1+ i))) + ... + + ;; Set the syntax for other characters. + (modify-syntax-entry ? " " emacs-lisp-mode-syntax-table) + (modify-syntax-entry ?\t " " emacs-lisp-mode-syntax-table) + ... + + (modify-syntax-entry ?\( "() " emacs-lisp-mode-syntax-table) + (modify-syntax-entry ?\) ")( " emacs-lisp-mode-syntax-table) + ...)) + ;; Create an abbrev table for lisp-mode. + (define-abbrev-table 'lisp-mode-abbrev-table ()) + + Much code is shared among the three Lisp modes. The following +function sets various variables; it is called by each of the major Lisp +mode functions: + + (defun lisp-mode-variables (lisp-syntax) + ;; The `lisp-syntax' argument is `nil' in Emacs Lisp mode, + ;; and `t' in the other two Lisp modes. + (cond (lisp-syntax + (if (not lisp-mode-syntax-table) + ;; The Emacs Lisp mode syntax table always exists, but + ;; the Lisp Mode syntax table is created the first time a + ;; mode that needs it is called. This is to save space. + + (progn (setq lisp-mode-syntax-table + (copy-syntax-table emacs-lisp-mode-syntax-table)) + ;; Change some entries for Lisp mode. + (modify-syntax-entry ?\| "\" " + lisp-mode-syntax-table) + (modify-syntax-entry ?\[ "_ " + lisp-mode-syntax-table) + (modify-syntax-entry ?\] "_ " + lisp-mode-syntax-table))) + + (set-syntax-table lisp-mode-syntax-table))) + (setq local-abbrev-table lisp-mode-abbrev-table) + ...) + + Functions such as `forward-paragraph' use the value of the +`paragraph-start' variable. Since Lisp code is different from ordinary +text, the `paragraph-start' variable needs to be set specially to +handle Lisp. Also, comments are indented in a special fashion in Lisp +and the Lisp modes need their own mode-specific +`comment-indent-function'. The code to set these variables is the rest +of `lisp-mode-variables'. + + (make-local-variable 'paragraph-start) + ;; Having `^' is not clean, but `page-delimiter' + ;; has them too, and removing those is a pain. + (setq paragraph-start (concat "^$\\|" page-delimiter)) + ... + + (make-local-variable 'comment-indent-function) + (setq comment-indent-function 'lisp-comment-indent)) + + Each of the different Lisp modes has a slightly different keymap. +For example, Lisp mode binds `C-c C-l' to `run-lisp', but the other +Lisp modes do not. However, all Lisp modes have some commands in +common. The following function adds these common commands to a given +keymap. + + (defun lisp-mode-commands (map) + (define-key map "\e\C-q" 'indent-sexp) + (define-key map "\177" 'backward-delete-char-untabify) + (define-key map "\t" 'lisp-indent-line)) + + Here is an example of using `lisp-mode-commands' to initialize a +keymap, as part of the code for Emacs Lisp mode. First we declare a +variable with `defvar' to hold the mode-specific keymap. When this +`defvar' executes, it sets the variable to `nil' if it was void. Then +we set up the keymap if the variable is `nil'. + + This code avoids changing the keymap or the variable if it is already +set up. This lets the user customize the keymap. + + (defvar emacs-lisp-mode-map () "") + (if emacs-lisp-mode-map + () + (setq emacs-lisp-mode-map (make-sparse-keymap)) + (define-key emacs-lisp-mode-map "\e\C-x" 'eval-defun) + (lisp-mode-commands emacs-lisp-mode-map)) + + Finally, here is the complete major mode function definition for +Emacs Lisp mode. + + (defun emacs-lisp-mode () + "Major mode for editing Lisp code to run in XEmacs. + Commands: + Delete converts tabs to spaces as it moves back. + Blank lines separate paragraphs. Semicolons start comments. + \\{emacs-lisp-mode-map} + + Entry to this mode runs the hook `emacs-lisp-mode-hook'." + (interactive) + (kill-all-local-variables) + (use-local-map emacs-lisp-mode-map) ; This provides the local keymap. + (set-syntax-table emacs-lisp-mode-syntax-table) + + (setq major-mode 'emacs-lisp-mode) ; This is how `describe-mode' + ; finds out what to describe. + (setq mode-name "Emacs-Lisp") ; This goes into the modeline. + (lisp-mode-variables nil) ; This defines various variables. + (run-hooks 'emacs-lisp-mode-hook)) ; This permits the user to use a + ; hook to customize the mode. + diff --git a/info/lispref.info-21 b/info/lispref.info-21 new file mode 100644 index 0000000..e5391ea --- /dev/null +++ b/info/lispref.info-21 @@ -0,0 +1,1159 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Auto Major Mode, Next: Mode Help, Prev: Example Major Modes, Up: Major Modes + +How XEmacs Chooses a Major Mode +------------------------------- + + Based on information in the file name or in the file itself, XEmacs +automatically selects a major mode for the new buffer when a file is +visited. + + - Command: fundamental-mode + Fundamental mode is a major mode that is not specialized for + anything in particular. Other major modes are defined in effect + by comparison with this one--their definitions say what to change, + starting from Fundamental mode. The `fundamental-mode' function + does *not* run any hooks; you're not supposed to customize it. + (If you want Emacs to behave differently in Fundamental mode, + change the *global* state of Emacs.) + + - Command: normal-mode &optional FIND-FILE + This function establishes the proper major mode and local variable + bindings for the current buffer. First it calls `set-auto-mode', + then it runs `hack-local-variables' to parse, and bind or evaluate + as appropriate, any local variables. + + If the FIND-FILE argument to `normal-mode' is non-`nil', + `normal-mode' assumes that the `find-file' function is calling it. + In this case, it may process a local variables list at the end of + the file and in the `-*-' line. The variable + `enable-local-variables' controls whether to do so. + + If you run `normal-mode' interactively, the argument FIND-FILE is + normally `nil'. In this case, `normal-mode' unconditionally + processes any local variables list. *Note Local Variables in + Files: (emacs)File variables, for the syntax of the local + variables section of a file. + + `normal-mode' uses `condition-case' around the call to the major + mode function, so errors are caught and reported as a `File mode + specification error', followed by the original error message. + + - User Option: enable-local-variables + This variable controls processing of local variables lists in files + being visited. A value of `t' means process the local variables + lists unconditionally; `nil' means ignore them; anything else means + ask the user what to do for each file. The default value is `t'. + + - Variable: ignored-local-variables + This variable holds a list of variables that should not be set by + a local variables list. Any value specified for one of these + variables is ignored. + + In addition to this list, any variable whose name has a non-`nil' +`risky-local-variable' property is also ignored. + + - User Option: enable-local-eval + This variable controls processing of `Eval:' in local variables + lists in files being visited. A value of `t' means process them + unconditionally; `nil' means ignore them; anything else means ask + the user what to do for each file. The default value is `maybe'. + + - Function: set-auto-mode + This function selects the major mode that is appropriate for the + current buffer. It may base its decision on the value of the `-*-' + line, on the visited file name (using `auto-mode-alist'), or on the + value of a local variable. However, this function does not look + for the `mode:' local variable near the end of a file; the + `hack-local-variables' function does that. *Note How Major Modes + are Chosen: (emacs)Choosing Modes. + + - User Option: default-major-mode + This variable holds the default major mode for new buffers. The + standard value is `fundamental-mode'. + + If the value of `default-major-mode' is `nil', XEmacs uses the + (previously) current buffer's major mode for the major mode of a + new buffer. However, if the major mode symbol has a `mode-class' + property with value `special', then it is not used for new buffers; + Fundamental mode is used instead. The modes that have this + property are those such as Dired and Rmail that are useful only + with text that has been specially prepared. + + - Function: set-buffer-major-mode BUFFER + This function sets the major mode of BUFFER to the value of + `default-major-mode'. If that variable is `nil', it uses the + current buffer's major mode (if that is suitable). + + The low-level primitives for creating buffers do not use this + function, but medium-level commands such as `switch-to-buffer' and + `find-file-noselect' use it whenever they create buffers. + + - Variable: initial-major-mode + The value of this variable determines the major mode of the initial + `*scratch*' buffer. The value should be a symbol that is a major + mode command name. The default value is `lisp-interaction-mode'. + + - Variable: auto-mode-alist + This variable contains an association list of file name patterns + (regular expressions; *note Regular Expressions::.) and + corresponding major mode functions. Usually, the file name + patterns test for suffixes, such as `.el' and `.c', but this need + not be the case. An ordinary element of the alist looks like + `(REGEXP . MODE-FUNCTION)'. + + For example, + + (("^/tmp/fol/" . text-mode) + ("\\.texinfo\\'" . texinfo-mode) + ("\\.texi\\'" . texinfo-mode) + + ("\\.el\\'" . emacs-lisp-mode) + ("\\.c\\'" . c-mode) + ("\\.h\\'" . c-mode) + ...) + + When you visit a file whose expanded file name (*note File Name + Expansion::.) matches a REGEXP, `set-auto-mode' calls the + corresponding MODE-FUNCTION. This feature enables XEmacs to select + the proper major mode for most files. + + If an element of `auto-mode-alist' has the form `(REGEXP FUNCTION + t)', then after calling FUNCTION, XEmacs searches + `auto-mode-alist' again for a match against the portion of the file + name that did not match before. + + This match-again feature is useful for uncompression packages: an + entry of the form `("\\.gz\\'" . FUNCTION)' can uncompress the file + and then put the uncompressed file in the proper mode according to + the name sans `.gz'. + + Here is an example of how to prepend several pattern pairs to + `auto-mode-alist'. (You might use this sort of expression in your + `.emacs' file.) + + (setq auto-mode-alist + (append + ;; File name starts with a dot. + '(("/\\.[^/]*\\'" . fundamental-mode) + ;; File name has no dot. + ("[^\\./]*\\'" . fundamental-mode) + ;; File name ends in `.C'. + ("\\.C\\'" . c++-mode)) + auto-mode-alist)) + + - Variable: interpreter-mode-alist + This variable specifies major modes to use for scripts that + specify a command interpreter in an `#!' line. Its value is a + list of elements of the form `(INTERPRETER . MODE)'; for example, + `("perl" . perl-mode)' is one element present by default. The + element says to use mode MODE if the file specifies INTERPRETER. + + This variable is applicable only when the `auto-mode-alist' does + not indicate which major mode to use. + + - Function: hack-local-variables &optional FORCE + This function parses, and binds or evaluates as appropriate, any + local variables for the current buffer. + + The handling of `enable-local-variables' documented for + `normal-mode' actually takes place here. The argument FORCE + usually comes from the argument FIND-FILE given to `normal-mode'. + + +File: lispref.info, Node: Mode Help, Next: Derived Modes, Prev: Auto Major Mode, Up: Major Modes + +Getting Help about a Major Mode +------------------------------- + + The `describe-mode' function is used to provide information about +major modes. It is normally called with `C-h m'. The `describe-mode' +function uses the value of `major-mode', which is why every major mode +function needs to set the `major-mode' variable. + + - Command: describe-mode + This function displays the documentation of the current major mode. + + The `describe-mode' function calls the `documentation' function + using the value of `major-mode' as an argument. Thus, it displays + the documentation string of the major mode function. (*Note + Accessing Documentation::.) + + - Variable: major-mode + This variable holds the symbol for the current buffer's major mode. + This symbol should have a function definition that is the command + to switch to that major mode. The `describe-mode' function uses + the documentation string of the function as the documentation of + the major mode. + + +File: lispref.info, Node: Derived Modes, Prev: Mode Help, Up: Major Modes + +Defining Derived Modes +---------------------- + + It's often useful to define a new major mode in terms of an existing +one. An easy way to do this is to use `define-derived-mode'. + + - Macro: define-derived-mode VARIANT PARENT NAME DOCSTRING BODY... + This construct defines VARIANT as a major mode command, using NAME + as the string form of the mode name. + + The new command VARIANT is defined to call the function PARENT, + then override certain aspects of that parent mode: + + * The new mode has its own keymap, named `VARIANT-map'. + `define-derived-mode' initializes this map to inherit from + `PARENT-map', if it is not already set. + + * The new mode has its own syntax table, kept in the variable + `VARIANT-syntax-table'. `define-derived-mode' initializes + this variable by copying `PARENT-syntax-table', if it is not + already set. + + * The new mode has its own abbrev table, kept in the variable + `VARIANT-abbrev-table'. `define-derived-mode' initializes + this variable by copying `PARENT-abbrev-table', if it is not + already set. + + * The new mode has its own mode hook, `VARIANT-hook', which it + runs in standard fashion as the very last thing that it does. + (The new mode also runs the mode hook of PARENT as part of + calling PARENT.) + + In addition, you can specify how to override other aspects of + PARENT with BODY. The command VARIANT evaluates the forms in BODY + after setting up all its usual overrides, just before running + `VARIANT-hook'. + + The argument DOCSTRING specifies the documentation string for the + new mode. If you omit DOCSTRING, `define-derived-mode' generates + a documentation string. + + Here is a hypothetical example: + + (define-derived-mode hypertext-mode + text-mode "Hypertext" + "Major mode for hypertext. + \\{hypertext-mode-map}" + (setq case-fold-search nil)) + + (define-key hypertext-mode-map + [down-mouse-3] 'do-hyper-link) + + +File: lispref.info, Node: Minor Modes, Next: Modeline Format, Prev: Major Modes, Up: Modes + +Minor Modes +=========== + + A "minor mode" provides features that users may enable or disable +independently of the choice of major mode. Minor modes can be enabled +individually or in combination. Minor modes would be better named +"Generally available, optional feature modes" except that such a name is +unwieldy. + + A minor mode is not usually a modification of single major mode. For +example, Auto Fill mode may be used in any major mode that permits text +insertion. To be general, a minor mode must be effectively independent +of the things major modes do. + + A minor mode is often much more difficult to implement than a major +mode. One reason is that you should be able to activate and deactivate +minor modes in any order. A minor mode should be able to have its +desired effect regardless of the major mode and regardless of the other +minor modes in effect. + + Often the biggest problem in implementing a minor mode is finding a +way to insert the necessary hook into the rest of XEmacs. Minor mode +keymaps make this easier than it used to be. + +* Menu: + +* Minor Mode Conventions:: Tips for writing a minor mode. +* Keymaps and Minor Modes:: How a minor mode can have its own keymap. + + +File: lispref.info, Node: Minor Mode Conventions, Next: Keymaps and Minor Modes, Up: Minor Modes + +Conventions for Writing Minor Modes +----------------------------------- + + There are conventions for writing minor modes just as there are for +major modes. Several of the major mode conventions apply to minor +modes as well: those regarding the name of the mode initialization +function, the names of global symbols, and the use of keymaps and other +tables. + + In addition, there are several conventions that are specific to +minor modes. + + * Make a variable whose name ends in `-mode' to represent the minor + mode. Its value should enable or disable the mode (`nil' to + disable; anything else to enable.) We call this the "mode + variable". + + This variable is used in conjunction with the `minor-mode-alist' to + display the minor mode name in the modeline. It can also enable + or disable a minor mode keymap. Individual commands or hooks can + also check the variable's value. + + If you want the minor mode to be enabled separately in each buffer, + make the variable buffer-local. + + * Define a command whose name is the same as the mode variable. Its + job is to enable and disable the mode by setting the variable. + + The command should accept one optional argument. If the argument + is `nil', it should toggle the mode (turn it on if it is off, and + off if it is on). Otherwise, it should turn the mode on if the + argument is a positive integer, a symbol other than `nil' or `-', + or a list whose CAR is such an integer or symbol; it should turn + the mode off otherwise. + + Here is an example taken from the definition of + `transient-mark-mode'. It shows the use of `transient-mark-mode' + as a variable that enables or disables the mode's behavior, and + also shows the proper way to toggle, enable or disable the minor + mode based on the raw prefix argument value. + + (setq transient-mark-mode + (if (null arg) (not transient-mark-mode) + (> (prefix-numeric-value arg) 0))) + + * Add an element to `minor-mode-alist' for each minor mode (*note + Modeline Variables::.). This element should be a list of the + following form: + + (MODE-VARIABLE STRING) + + Here MODE-VARIABLE is the variable that controls enabling of the + minor mode, and STRING is a short string, starting with a space, + to represent the mode in the modeline. These strings must be + short so that there is room for several of them at once. + + When you add an element to `minor-mode-alist', use `assq' to check + for an existing element, to avoid duplication. For example: + + (or (assq 'leif-mode minor-mode-alist) + (setq minor-mode-alist + (cons '(leif-mode " Leif") minor-mode-alist))) + + +File: lispref.info, Node: Keymaps and Minor Modes, Prev: Minor Mode Conventions, Up: Minor Modes + +Keymaps and Minor Modes +----------------------- + + Each minor mode can have its own keymap, which is active when the +mode is enabled. To set up a keymap for a minor mode, add an element +to the alist `minor-mode-map-alist'. *Note Active Keymaps::. + + One use of minor mode keymaps is to modify the behavior of certain +self-inserting characters so that they do something else as well as +self-insert. In general, this is the only way to do that, since the +facilities for customizing `self-insert-command' are limited to special +cases (designed for abbrevs and Auto Fill mode). (Do not try +substituting your own definition of `self-insert-command' for the +standard one. The editor command loop handles this function specially.) + + +File: lispref.info, Node: Modeline Format, Next: Hooks, Prev: Minor Modes, Up: Modes + +Modeline Format +=============== + + Each Emacs window (aside from minibuffer windows) includes a +modeline, which displays status information about the buffer displayed +in the window. The modeline contains information about the buffer, +such as its name, associated file, depth of recursive editing, and the +major and minor modes. + + This section describes how the contents of the modeline are +controlled. It is in the chapter on modes because much of the +information displayed in the modeline relates to the enabled major and +minor modes. + + `modeline-format' is a buffer-local variable that holds a template +used to display the modeline of the current buffer. All windows for +the same buffer use the same `modeline-format' and their modelines +appear the same (except for scrolling percentages and line numbers). + + The modeline of a window is normally updated whenever a different +buffer is shown in the window, or when the buffer's modified-status +changes from `nil' to `t' or vice-versa. If you modify any of the +variables referenced by `modeline-format' (*note Modeline +Variables::.), you may want to force an update of the modeline so as to +display the new information. + + - Function: redraw-modeline &optional ALL + Force redisplay of the current buffer's modeline. If ALL is + non-`nil', then force redisplay of all modelines. + + The modeline is usually displayed in inverse video. This is +controlled using the `modeline' face. *Note Faces::. + +* Menu: + +* Modeline Data:: The data structure that controls the modeline. +* Modeline Variables:: Variables used in that data structure. +* %-Constructs:: Putting information into a modeline. + + +File: lispref.info, Node: Modeline Data, Next: Modeline Variables, Up: Modeline Format + +The Data Structure of the Modeline +---------------------------------- + + The modeline contents are controlled by a data structure of lists, +strings, symbols, and numbers kept in the buffer-local variable +`mode-line-format'. The data structure is called a "modeline +construct", and it is built in recursive fashion out of simpler modeline +constructs. The same data structure is used for constructing frame +titles (*note Frame Titles::.). + + - Variable: modeline-format + The value of this variable is a modeline construct with overall + responsibility for the modeline format. The value of this variable + controls which other variables are used to form the modeline text, + and where they appear. + + A modeline construct may be as simple as a fixed string of text, but +it usually specifies how to use other variables to construct the text. +Many of these variables are themselves defined to have modeline +constructs as their values. + + The default value of `modeline-format' incorporates the values of +variables such as `mode-name' and `minor-mode-alist'. Because of this, +very few modes need to alter `modeline-format'. For most purposes, it +is sufficient to alter the variables referenced by `modeline-format'. + + A modeline construct may be a list, a symbol, or a string. If the +value is a list, each element may be a list, a symbol, or a string. + +`STRING' + A string as a modeline construct is displayed verbatim in the mode + line except for "`%'-constructs". Decimal digits after the `%' + specify the field width for space filling on the right (i.e., the + data is left justified). *Note %-Constructs::. + +`SYMBOL' + A symbol as a modeline construct stands for its value. The value + of SYMBOL is used as a modeline construct, in place of SYMBOL. + However, the symbols `t' and `nil' are ignored; so is any symbol + whose value is void. + + There is one exception: if the value of SYMBOL is a string, it is + displayed verbatim: the `%'-constructs are not recognized. + +`(STRING REST...) or (LIST REST...)' + 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 common form of mode line construct. + +`(SYMBOL THEN ELSE)' + A list whose first element is a symbol is a conditional. Its + meaning depends on the value of SYMBOL. If the value is non-`nil', + the second element, THEN, is processed recursively as a modeline + element. But if the value of SYMBOL is `nil', the third element, + ELSE, is processed recursively. You may omit ELSE; then the mode + line element displays nothing if the value of SYMBOL is `nil'. + +`(WIDTH REST...)' + A list whose first element is an integer specifies truncation or + padding of the results of REST. The remaining elements REST are + processed recursively as modeline constructs and concatenated + together. Then the result is space filled (if WIDTH is positive) + or truncated (to -WIDTH columns, if WIDTH is negative) on the + right. + + 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: `(-3 + "%p")'. + + If you do alter `modeline-format' itself, the new value should use +the same variables that appear in the default value (*note Modeline +Variables::.), rather than duplicating their contents or displaying the +information in another fashion. This way, customizations made by the +user or by Lisp programs (such as `display-time' and major modes) via +changes to those variables remain effective. + + Here is an example of a `modeline-format' that might be useful for +`shell-mode', since it contains the hostname and default directory. + + (setq modeline-format + (list "" + 'modeline-modified + "%b--" + (getenv "HOST") ; One element is not constant. + ":" + 'default-directory + " " + 'global-mode-string + " %[(" + 'mode-name + 'modeline-process + 'minor-mode-alist + "%n" + ")%]----" + '(line-number-mode "L%l--") + '(-3 . "%p") + "-%-")) + + +File: lispref.info, Node: Modeline Variables, Next: %-Constructs, Prev: Modeline Data, Up: Modeline Format + +Variables Used in the Modeline +------------------------------ + + This section describes variables incorporated by the standard value +of `modeline-format' into the text of the mode line. There is nothing +inherently special about these variables; any other variables could +have the same effects on the modeline if `modeline-format' were changed +to use them. + + - Variable: modeline-modified + This variable holds the value of the modeline construct that + displays whether the current buffer is modified. + + The default value of `modeline-modified' is `("--%1*%1+-")'. This + means that the modeline displays `--**-' if the buffer is + modified, `-----' if the buffer is not modified, `--%%-' if the + buffer is read only, and `--%*--' if the buffer is read only and + modified. + + Changing this variable does not force an update of the modeline. + + - Variable: modeline-buffer-identification + This variable identifies the buffer being displayed in the window. + Its default value is `("%F: %17b")', which means that it usually + displays `Emacs:' followed by seventeen characters of the buffer + name. (In a terminal frame, it displays the frame name instead of + `Emacs'; this has the effect of showing the frame number.) You may + want to change this in modes such as Rmail that do not behave like + a "normal" XEmacs. + + - Variable: global-mode-string + This variable holds a modeline spec that appears in the mode line + by default, just after the buffer name. The command `display-time' + sets `global-mode-string' to refer to the variable + `display-time-string', which holds a string containing the time and + load information. + + The `%M' construct substitutes the value of `global-mode-string', + but this is obsolete, since the variable is included directly in + the modeline. + + - Variable: mode-name + This buffer-local variable holds the "pretty" name of the current + buffer's major mode. Each major mode should set this variable so + that the mode name will appear in the modeline. + + - Variable: minor-mode-alist + This variable holds an association list whose elements specify how + the modeline should indicate that a minor mode is active. Each + element of the `minor-mode-alist' should be a two-element list: + + (MINOR-MODE-VARIABLE MODELINE-STRING) + + More generally, MODELINE-STRING can be any mode line spec. It + appears in the mode line when the value of MINOR-MODE-VARIABLE is + non-`nil', and not otherwise. These strings should begin with + spaces so that they don't run together. Conventionally, the + MINOR-MODE-VARIABLE for a specific mode is set to a non-`nil' + value when that minor mode is activated. + + The default value of `minor-mode-alist' is: + + minor-mode-alist + => ((vc-mode vc-mode) + (abbrev-mode " Abbrev") + (overwrite-mode overwrite-mode) + (auto-fill-function " Fill") + (defining-kbd-macro " Def") + (isearch-mode isearch-mode)) + + `minor-mode-alist' is not buffer-local. The variables mentioned + in the alist should be buffer-local if the minor mode can be + enabled separately in each buffer. + + - Variable: modeline-process + This buffer-local variable contains the modeline information on + process status in modes used for communicating with subprocesses. + It is displayed immediately following the major mode name, with no + intervening space. For example, its value in the `*shell*' buffer + is `(": %s")', which allows the shell to display its status along + with the major mode as: `(Shell: run)'. Normally this variable is + `nil'. + + - Variable: default-modeline-format + This variable holds the default `modeline-format' for buffers that + do not override it. This is the same as `(default-value + 'modeline-format)'. + + The default value of `default-modeline-format' is: + + ("" + modeline-modified + modeline-buffer-identification + " " + global-mode-string + " %[(" + mode-name + modeline-process + minor-mode-alist + "%n" + ")%]----" + (line-number-mode "L%l--") + (-3 . "%p") + "-%-") + + - Variable: vc-mode + The variable `vc-mode', local in each buffer, records whether the + buffer's visited file is maintained with version control, and, if + so, which kind. Its value is `nil' for no version control, or a + string that appears in the mode line. + + +File: lispref.info, Node: %-Constructs, Prev: Modeline Variables, Up: Modeline Format + +`%'-Constructs in the ModeLine +------------------------------ + + The following table lists the recognized `%'-constructs and what +they mean. In any construct except `%%', you can add a decimal integer +after the `%' to specify how many characters to display. + +`%b' + The current buffer name, obtained with the `buffer-name' function. + *Note Buffer Names::. + +`%f' + The visited file name, obtained with the `buffer-file-name' + function. *Note Buffer File Name::. + +`%F' + The name of the selected frame. + +`%c' + The current column number of point. + +`%l' + The current line number of point. + +`%*' + `%' if the buffer is read only (see `buffer-read-only'); + `*' if the buffer is modified (see `buffer-modified-p'); + `-' otherwise. *Note Buffer Modification::. + +`%+' + `*' if the buffer is modified (see `buffer-modified-p'); + `%' if the buffer is read only (see `buffer-read-only'); + `-' otherwise. This differs from `%*' only for a modified + read-only buffer. *Note Buffer Modification::. + +`%&' + `*' if the buffer is modified, and `-' otherwise. + +`%s' + The status of the subprocess belonging to the current buffer, + obtained with `process-status'. *Note Process Information::. + +`%l' + the current line number. + +`%S' + the name of the selected frame; this is only meaningful under the + X Window System. *Note Frame Name::. + +`%t' + Whether the visited file is a text file or a binary file. (This + is a meaningful distinction only on certain operating systems.) + +`%p' + The percentage of the buffer text above the *top* of window, or + `Top', `Bottom' or `All'. + +`%P' + The percentage of the buffer text that is above the *bottom* of + the window (which includes the text visible in the window, as well + as the text above the top), plus `Top' if the top of the buffer is + visible on screen; or `Bottom' or `All'. + +`%n' + `Narrow' when narrowing is in effect; nothing otherwise (see + `narrow-to-region' in *Note Narrowing::). + +`%[' + An indication of the depth of recursive editing levels (not + counting minibuffer levels): one `[' for each editing level. + *Note Recursive Editing::. + +`%]' + One `]' for each recursive editing level (not counting minibuffer + levels). + +`%%' + The character `%'--this is how to include a literal `%' in a + string in which `%'-constructs are allowed. + +`%-' + Dashes sufficient to fill the remainder of the modeline. + + The following two `%'-constructs are still supported, but they are +obsolete, since you can get the same results with the variables +`mode-name' and `global-mode-string'. + +`%m' + The value of `mode-name'. + +`%M' + The value of `global-mode-string'. Currently, only `display-time' + modifies the value of `global-mode-string'. + + +File: lispref.info, Node: Hooks, Prev: Modeline Format, Up: Modes + +Hooks +===== + + A "hook" is a variable where you can store a function or functions +to be called on a particular occasion by an existing program. XEmacs +provides hooks for the sake of customization. Most often, hooks are set +up in the `.emacs' file, but Lisp programs can set them also. *Note +Standard Hooks::, for a list of standard hook variables. + + Most of the hooks in XEmacs are "normal hooks". These variables +contain lists of functions to be called with no arguments. The reason +most hooks are normal hooks is so that you can use them in a uniform +way. You can usually tell when a hook is a normal hook, because its +name ends in `-hook'. + + The recommended way to add a hook function to a normal hook is by +calling `add-hook' (see below). The hook functions may be any of the +valid kinds of functions that `funcall' accepts (*note What Is a +Function::.). Most normal hook variables are initially void; +`add-hook' knows how to deal with this. + + As for abnormal hooks, those whose names end in `-function' have a +value that is a single function. Those whose names end in `-hooks' +have a value that is a list of functions. Any hook that is abnormal is +abnormal because a normal hook won't do the job; either the functions +are called with arguments, or their values are meaningful. The name +shows you that the hook is abnormal and that you should look at its +documentation string to see how to use it properly. + + Major mode functions are supposed to run a hook called the "mode +hook" as the last step of initialization. This makes it easy for a user +to customize the behavior of the mode, by overriding the local variable +assignments already made by the mode. But hooks are used in other +contexts too. For example, the hook `suspend-hook' runs just before +XEmacs suspends itself (*note Suspending XEmacs::.). + + Here's an expression that uses a mode hook to turn on Auto Fill mode +when in Lisp Interaction mode: + + (add-hook 'lisp-interaction-mode-hook 'turn-on-auto-fill) + + The next example shows how to use a hook to customize the way XEmacs +formats C code. (People often have strong personal preferences for one +format or another.) Here the hook function is an anonymous lambda +expression. + + (add-hook 'c-mode-hook + (function (lambda () + (setq c-indent-level 4 + c-argdecl-indent 0 + c-label-offset -4 + c-continued-statement-indent 0 + c-brace-offset 0 + comment-column 40)))) + + (setq c++-mode-hook c-mode-hook) + + The final example shows how the appearance of the modeline can be +modified for a particular class of buffers only. + + (add-hook 'text-mode-hook + (function (lambda () + (setq modeline-format + '(modeline-modified + "Emacs: %14b" + " " + default-directory + " " + global-mode-string + "%[(" + mode-name + minor-mode-alist + "%n" + modeline-process + ") %]---" + (-3 . "%p") + "-%-"))))) + + At the appropriate time, XEmacs uses the `run-hooks' function to run +particular hooks. This function calls the hook functions you have +added with `add-hooks'. + + - Function: run-hooks &rest HOOKVAR + This function takes one or more hook variable names as arguments, + and runs each hook in turn. Each HOOKVAR argument should be a + symbol that is a hook variable. These arguments are processed in + the order specified. + + If a hook variable has a non-`nil' value, that value may be a + function or a list of functions. If the value is a function + (either a lambda expression or a symbol with a function + definition), it is called. If it is a list, the elements are + called, in order. The hook functions are called with no arguments. + + For example, here's how `emacs-lisp-mode' runs its mode hook: + + (run-hooks 'emacs-lisp-mode-hook) + + - Function: add-hook HOOK FUNCTION &optional APPEND LOCAL + This function is the handy way to add function FUNCTION to hook + variable HOOK. The argument FUNCTION may be any valid Lisp + function with the proper number of arguments. For example, + + (add-hook 'text-mode-hook 'my-text-hook-function) + + adds `my-text-hook-function' to the hook called `text-mode-hook'. + + You can use `add-hook' for abnormal hooks as well as for normal + hooks. + + It is best to design your hook functions so that the order in + which they are executed does not matter. Any dependence on the + order is "asking for trouble." However, the order is predictable: + normally, FUNCTION goes at the front of the hook list, so it will + be executed first (barring another `add-hook' call). + + If the optional argument APPEND is non-`nil', the new hook + function goes at the end of the hook list and will be executed + last. + + If LOCAL is non-`nil', that says to make the new hook function + local to the current buffer. Before you can do this, you must + make the hook itself buffer-local by calling `make-local-hook' + (*not* `make-local-variable'). If the hook itself is not + buffer-local, then the value of LOCAL makes no difference--the + hook function is always global. + + - Function: remove-hook HOOK FUNCTION &optional LOCAL + This function removes FUNCTION from the hook variable HOOK. + + If LOCAL is non-`nil', that says to remove FUNCTION from the local + hook list instead of from the global hook list. If the hook + itself is not buffer-local, then the value of LOCAL makes no + difference. + + - Function: make-local-hook HOOK + This function makes the hook variable `hook' local to the current + buffer. When a hook variable is local, it can have local and + global hook functions, and `run-hooks' runs all of them. + + This function works by making `t' an element of the buffer-local + value. That serves as a flag to use the hook functions in the + default value of the hook variable as well as those in the local + value. Since `run-hooks' understands this flag, `make-local-hook' + works with all normal hooks. It works for only some non-normal + hooks--those whose callers have been updated to understand this + meaning of `t'. + + Do not use `make-local-variable' directly for hook variables; it is + not sufficient. + + +File: lispref.info, Node: Documentation, Next: Files, Prev: Modes, Up: Top + +Documentation +************* + + XEmacs Lisp has convenient on-line help facilities, most of which +derive their information from the documentation strings associated with +functions and variables. This chapter describes how to write good +documentation strings for your Lisp programs, as well as how to write +programs to access documentation. + + Note that the documentation strings for XEmacs are not the same thing +as the XEmacs manual. Manuals have their own source files, written in +the Texinfo language; documentation strings are specified in the +definitions of the functions and variables they apply to. A collection +of documentation strings is not sufficient as a manual because a good +manual is not organized in that fashion; it is organized in terms of +topics of discussion. + +* Menu: + +* Documentation Basics:: Good style for doc strings. + Where to put them. How XEmacs stores them. +* Accessing Documentation:: How Lisp programs can access doc strings. +* Keys in Documentation:: Substituting current key bindings. +* Describing Characters:: Making printable descriptions of + non-printing characters and key sequences. +* Help Functions:: Subroutines used by XEmacs help facilities. +* Obsoleteness:: Upgrading Lisp functionality over time. + + +File: lispref.info, Node: Documentation Basics, Next: Accessing Documentation, Up: Documentation + +Documentation Basics +==================== + + A documentation string is written using the Lisp syntax for strings, +with double-quote characters surrounding the text of the string. This +is because it really is a Lisp string object. The string serves as +documentation when it is written in the proper place in the definition +of a function or variable. In a function definition, the documentation +string follows the argument list. In a variable definition, the +documentation string follows the initial value of the variable. + + When you write a documentation string, make the first line a complete +sentence (or two complete sentences) since some commands, such as +`apropos', show only the first line of a multi-line documentation +string. Also, you should not indent the second line of a documentation +string, if you have one, because that looks odd when you use `C-h f' +(`describe-function') or `C-h v' (`describe-variable'). *Note +Documentation Tips::. + + Documentation strings may contain several special substrings, which +stand for key bindings to be looked up in the current keymaps when the +documentation is displayed. This allows documentation strings to refer +to the keys for related commands and be accurate even when a user +rearranges the key bindings. (*Note Accessing Documentation::.) + + Within the Lisp world, a documentation string is accessible through +the function or variable that it describes: + + * The documentation for a function is stored in the function + definition itself (*note Lambda Expressions::.). The function + `documentation' knows how to extract it. + + * The documentation for a variable is stored in the variable's + property list under the property name `variable-documentation'. + The function `documentation-property' knows how to extract it. + + To save space, the documentation for preloaded functions and +variables (including primitive functions and autoloaded functions) is +stored in the "internal doc file" `DOC'. The documentation for +functions and variables loaded during the XEmacs session from +byte-compiled files is stored in those very same byte-compiled files +(*note Docs and Compilation::.). + + XEmacs does not keep documentation strings in memory unless +necessary. Instead, XEmacs maintains, for preloaded symbols, an +integer offset into the internal doc file, and for symbols loaded from +byte-compiled files, a list containing the filename of the +byte-compiled file and an integer offset, in place of the documentation +string. The functions `documentation' and `documentation-property' use +that information to read the documentation from the appropriate file; +this is transparent to the user. + + For information on the uses of documentation strings, see *Note +Help: (emacs)Help. + + The `emacs/lib-src' directory contains two utilities that you can +use to print nice-looking hardcopy for the file +`emacs/etc/DOC-VERSION'. These are `sorted-doc.c' and `digest-doc.c'. + + +File: lispref.info, Node: Accessing Documentation, Next: Keys in Documentation, Prev: Documentation Basics, Up: Documentation + +Access to Documentation Strings +=============================== + + - Function: documentation-property SYMBOL PROPERTY &optional VERBATIM + This function returns the documentation string that is recorded in + SYMBOL's property list under property PROPERTY. It retrieves the + text from a file if necessary, and runs `substitute-command-keys' + to substitute actual key bindings. (This substitution is not done + if VERBATIM is non-`nil'; the VERBATIM argument exists only as of + Emacs 19.) + + (documentation-property 'command-line-processed + 'variable-documentation) + => "t once command line has been processed" + + (symbol-plist 'command-line-processed) + => (variable-documentation 188902) + + - Function: documentation FUNCTION &optional VERBATIM + This function returns the documentation string of FUNCTION. It + reads the text from a file if necessary. Then (unless VERBATIM is + non-`nil') it calls `substitute-command-keys', to return a value + containing the actual (current) key bindings. + + The function `documentation' signals a `void-function' error if + FUNCTION has no function definition. However, it is ok if the + function definition has no documentation string. In that case, + `documentation' returns `nil'. + + Here is an example of using the two functions, `documentation' and +`documentation-property', to display the documentation strings for +several symbols in a `*Help*' buffer. + + (defun describe-symbols (pattern) + "Describe the XEmacs Lisp symbols matching PATTERN. + All symbols that have PATTERN in their name are described + in the `*Help*' buffer." + (interactive "sDescribe symbols matching: ") + (let ((describe-func + (function + (lambda (s) + + ;; Print description of symbol. + (if (fboundp s) ; It is a function. + (princ + (format "%s\t%s\n%s\n\n" s + (if (commandp s) + (let ((keys (where-is-internal s))) + (if keys + (concat + "Keys: " + (mapconcat 'key-description + keys " ")) + "Keys: none")) + "Function") + + (or (documentation s) + "not documented")))) + + (if (boundp s) ; It is a variable. + + (princ + (format "%s\t%s\n%s\n\n" s + (if (user-variable-p s) + "Option " "Variable") + + (or (documentation-property + s 'variable-documentation) + "not documented"))))))) + sym-list) + + ;; Build a list of symbols that match pattern. + (mapatoms (function + (lambda (sym) + (if (string-match pattern (symbol-name sym)) + (setq sym-list (cons sym sym-list)))))) + + ;; Display the data. + (with-output-to-temp-buffer "*Help*" + (mapcar describe-func (sort sym-list 'string<)) + (print-help-return-message)))) + + The `describe-symbols' function works like `apropos', but provides +more information. + + (describe-symbols "goal") + + ---------- Buffer: *Help* ---------- + goal-column Option + *Semipermanent goal column for vertical motion, as set by C-x C-n, or nil. + + set-goal-column Command: C-x C-n + Set the current horizontal position as a goal for C-n and C-p. + + Those commands will move to this position in the line moved to + rather than trying to keep the same horizontal position. + With a non-nil argument, clears out the goal column + so that C-n and C-p resume vertical motion. + The goal column is stored in the variable `goal-column'. + + temporary-goal-column Variable + Current goal column for vertical motion. + It is the column where point was + at the start of current run of vertical motion commands. + When the `track-eol' feature is doing its job, the value is 9999. + ---------- Buffer: *Help* ---------- + + - Function: Snarf-documentation FILENAME + This function is used only during XEmacs initialization, just + before the runnable XEmacs is dumped. It finds the file offsets + of the documentation strings stored in the file FILENAME, and + records them in the in-core function definitions and variable + property lists in place of the actual strings. *Note Building + XEmacs::. + + XEmacs finds the file FILENAME in the `lib-src' directory. When + the dumped XEmacs is later executed, the same file is found in the + directory `doc-directory'. The usual value for FILENAME is `DOC', + but this can be changed by modifying the variable + `internal-doc-file-name'. + + - Variable: internal-doc-file-name + This variable holds the name of the file containing documentation + strings of built-in symbols, usually `DOC'. The full pathname of + the internal doc file is `(concat doc-directory + internal-doc-file-name)'. + + - Variable: doc-directory + This variable holds the name of the directory which contains the + "internal doc file" that contains documentation strings for + built-in and preloaded functions and variables. + + In most cases, this is the same as `exec-directory'. They may be + different when you run XEmacs from the directory where you built + it, without actually installing it. See `exec-directory' in *Note + Help Functions::. + + In older Emacs versions, `exec-directory' was used for this. + + - Variable: data-directory + This variable holds the name of the directory in which XEmacs finds + certain system independent documentation and text files that come + with XEmacs. In older Emacs versions, `exec-directory' was used + for this. + diff --git a/info/lispref.info-22 b/info/lispref.info-22 new file mode 100644 index 0000000..4204679 --- /dev/null +++ b/info/lispref.info-22 @@ -0,0 +1,1115 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Keys in Documentation, Next: Describing Characters, Prev: Accessing Documentation, Up: Documentation + +Substituting Key Bindings in Documentation +========================================== + + When documentation strings refer to key sequences, they should use +the current, actual key bindings. They can do so using certain special +text sequences described below. Accessing documentation strings in the +usual way substitutes current key binding information for these special +sequences. This works by calling `substitute-command-keys'. You can +also call that function yourself. + + Here is a list of the special sequences and what they mean: + +`\[COMMAND]' + stands for a key sequence that will invoke COMMAND, or `M-x + COMMAND' if COMMAND has no key bindings. + +`\{MAPVAR}' + stands for a summary of the value of MAPVAR, which should be a + keymap. The summary is made by `describe-bindings'. + +`\' + stands for no text itself. It is used for a side effect: it + specifies MAPVAR as the keymap for any following `\[COMMAND]' + sequences in this documentation string. + +`\=' + quotes the following character and is discarded; this `\=\=' puts + `\=' into the output, and `\=\[' puts `\[' into the output. + + *Please note:* Each `\' must be doubled when written in a string in +XEmacs Lisp. + + - Function: substitute-command-keys STRING + This function scans STRING for the above special sequences and + replaces them by what they stand for, returning the result as a + string. This permits display of documentation that refers + accurately to the user's own customized key bindings. + + Here are examples of the special sequences: + + (substitute-command-keys + "To abort recursive edit, type: \\[abort-recursive-edit]") + => "To abort recursive edit, type: C-]" + + (substitute-command-keys + "The keys that are defined for the minibuffer here are: + \\{minibuffer-local-must-match-map}") + => "The keys that are defined for the minibuffer here are: + + ? minibuffer-completion-help + SPC minibuffer-complete-word + TAB minibuffer-complete + LFD minibuffer-complete-and-exit + RET minibuffer-complete-and-exit + C-g abort-recursive-edit + " + (substitute-command-keys + "To abort a recursive edit from the minibuffer, type\ + \\\\[abort-recursive-edit].") + => "To abort a recursive edit from the minibuffer, type C-g." + + (substitute-command-keys + "Substrings of the form \\=\\{MAPVAR} are replaced by summaries + \(made by describe-bindings) of the value of MAPVAR, taken as a keymap. + Substrings of the form \\=\\ specify to use the value of MAPVAR + as the keymap for future \\=\\[COMMAND] substrings. + \\=\\= quotes the following character and is discarded; + thus, \\=\\=\\=\\= puts \\=\\= into the output, + and \\=\\=\\=\\[ puts \\=\\[ into the output.") + => "Substrings of the form \{MAPVAR} are replaced by summaries + (made by describe-bindings) of the value of MAPVAR, taken as a keymap. + Substrings of the form \ specify to use the value of MAPVAR + as the keymap for future \[COMMAND] substrings. + \= quotes the following character and is discarded; + thus, \=\= puts \= into the output, + and \=\[ puts \[ into the output." + + +File: lispref.info, Node: Describing Characters, Next: Help Functions, Prev: Keys in Documentation, Up: Documentation + +Describing Characters for Help Messages +======================================= + + These functions convert events, key sequences or characters to +textual descriptions. These descriptions are useful for including +arbitrary text characters or key sequences in messages, because they +convert non-printing and whitespace characters to sequences of printing +characters. The description of a non-whitespace printing character is +the character itself. + + - Function: key-description SEQUENCE + This function returns a string containing the XEmacs standard + notation for the input events in SEQUENCE. The argument SEQUENCE + may be a string, vector or list. *Note Events::, for more + information about valid events. See also the examples for + `single-key-description', below. + + - Function: single-key-description KEY + This function returns a string describing KEY in the standard + XEmacs notation for keyboard input. A normal printing character + appears as itself, but a control character turns into a string + starting with `C-', a meta character turns into a string starting + with `M-', and space, linefeed, etc. appear as `SPC', `LFD', etc. + A symbol appears as the name of the symbol. An event that is a + list appears as the name of the symbol in the CAR of the list. + + (single-key-description ?\C-x) + => "C-x" + + (key-description "\C-x \M-y \n \t \r \f123") + => "C-x SPC M-y SPC LFD SPC TAB SPC RET SPC C-l 1 2 3" + + (single-key-description 'kp_next) + => "kp_next" + + (single-key-description '(shift button1)) + => "Sh-button1" + + - Function: text-char-description CHARACTER + This function returns a string describing CHARACTER in the + standard XEmacs notation for characters that appear in text--like + `single-key-description', except that control characters are + represented with a leading caret (which is how control characters + in XEmacs buffers are usually displayed). + + (text-char-description ?\C-c) + => "^C" + + (text-char-description ?\M-m) + => "M-m" + + (text-char-description ?\C-\M-m) + => "M-^M" + + +File: lispref.info, Node: Help Functions, Next: Obsoleteness, Prev: Describing Characters, Up: Documentation + +Help Functions +============== + + XEmacs provides a variety of on-line help functions, all accessible +to the user as subcommands of the prefix `C-h', or on some keyboards, +`help'. For more information about them, see *Note Help: (emacs)Help. +Here we describe some program-level interfaces to the same information. + + - Command: apropos REGEXP &optional DO-ALL PREDICATE + This function finds all symbols whose names contain a match for the + regular expression REGEXP, and returns a list of them (*note + Regular Expressions::.). It also displays the symbols in a buffer + named `*Help*', each with a one-line description. + + If DO-ALL is non-`nil', then `apropos' also shows key bindings for + the functions that are found. + + If PREDICATE is non-`nil', it should be a function to be called on + each symbol that has matched REGEXP. Only symbols for which + PREDICATE returns a non-`nil' value are listed or displayed. + + In the first of the following examples, `apropos' finds all the + symbols with names containing `exec'. In the second example, it + finds and returns only those symbols that are also commands. (We + don't show the output that results in the `*Help*' buffer.) + + (apropos "exec") + => (Buffer-menu-execute command-execute exec-directory + exec-path execute-extended-command execute-kbd-macro + executing-kbd-macro executing-macro) + + (apropos "exec" nil 'commandp) + => (Buffer-menu-execute execute-extended-command) + + `apropos' is used by various user-level commands, such as `C-h a' + (`hyper-apropos'), a graphical front-end to `apropos'; and `C-h A' + (`command-apropos'), which does an apropos over only those + functions which are user commands. `command-apropos' calls + `apropos', specifying a PREDICATE to restrict the output to + symbols that are commands. The call to `apropos' looks like this: + + (apropos string t 'commandp) + + - Variable: help-map + The value of this variable is a local keymap for characters + following the Help key, `C-h'. + + - Prefix Command: help-command + This symbol is not a function; its function definition is actually + the keymap known as `help-map'. It is defined in `help.el' as + follows: + + (define-key global-map "\C-h" 'help-command) + (fset 'help-command help-map) + + - Function: print-help-return-message &optional FUNCTION + This function builds a string that explains how to restore the + previous state of the windows after a help command. After + building the message, it applies FUNCTION to it if FUNCTION is + non-`nil'. Otherwise it calls `message' to display it in the echo + area. + + This function expects to be called inside a + `with-output-to-temp-buffer' special form, and expects + `standard-output' to have the value bound by that special form. + For an example of its use, see the long example in *Note Accessing + Documentation::. + + - Variable: help-char + The value of this variable is the help character--the character + that XEmacs recognizes as meaning Help. By default, it is the + character `?\^H' (ASCII 8), which is `C-h'. When XEmacs reads this + character, if `help-form' is non-`nil' Lisp expression, it + evaluates that expression, and displays the result in a window if + it is a string. + + `help-char' can be a character or a key description such as `help' + or `(meta h)'. + + Usually the value of `help-form''s value is `nil'. Then the help + character has no special meaning at the level of command input, and + it becomes part of a key sequence in the normal way. The standard + key binding of `C-h' is a prefix key for several general-purpose + help features. + + The help character is special after prefix keys, too. If it has no + binding as a subcommand of the prefix key, it runs + `describe-prefix-bindings', which displays a list of all the + subcommands of the prefix key. + + - Variable: help-form + If this variable is non-`nil', its value is a form to evaluate + whenever the character `help-char' is read. If evaluating the form + produces a string, that string is displayed. + + A command that calls `next-command-event' or `next-event' probably + should bind `help-form' to a non-`nil' expression while it does + input. (The exception is when `C-h' is meaningful input.) + Evaluating this expression should result in a string that explains + what the input is for and how to enter it properly. + + Entry to the minibuffer binds this variable to the value of + `minibuffer-help-form' (*note Minibuffer Misc::.). + + - Variable: prefix-help-command + This variable holds a function to print help for a prefix + character. The function is called when the user types a prefix + key followed by the help character, and the help character has no + binding after that prefix. The variable's default value is + `describe-prefix-bindings'. + + - Function: describe-prefix-bindings + This function calls `describe-bindings' to display a list of all + the subcommands of the prefix key of the most recent key sequence. + The prefix described consists of all but the last event of that + key sequence. (The last event is, presumably, the help character.) + + The following two functions are found in the library `helper'. They +are for modes that want to provide help without relinquishing control, +such as the "electric" modes. You must load that library with +`(require 'helper)' in order to use them. Their names begin with +`Helper' to distinguish them from the ordinary help functions. + + - Command: Helper-describe-bindings + This command pops up a window displaying a help buffer containing a + listing of all of the key bindings from both the local and global + keymaps. It works by calling `describe-bindings'. + + - Command: Helper-help + This command provides help for the current mode. It prompts the + user in the minibuffer with the message `Help (Type ? for further + options)', and then provides assistance in finding out what the key + bindings are, and what the mode is intended for. It returns `nil'. + + This can be customized by changing the map `Helper-help-map'. + + +File: lispref.info, Node: Obsoleteness, Prev: Help Functions, Up: Documentation + +Obsoleteness +============ + + As you add functionality to a package, you may at times want to +replace an older function with a new one. To preserve compatibility +with existing code, the older function needs to still exist; but users +of that function should be told to use the newer one instead. XEmacs +Lisp lets you mark a function or variable as "obsolete", and indicate +what should be used instead. + + - Function: make-obsolete FUNCTION NEW + This function indicates that FUNCTION is an obsolete function, and + the function NEW should be used instead. The byte compiler will + issue a warning to this effect when it encounters a usage of the + older function, and the help system will also note this in the + function's documentation. NEW can also be a string (if there is + not a single function with the same functionality any more), and + should be a descriptive statement, such as "use FOO or BAR + instead" or "this function is unnecessary". + + - Function: make-obsolete-variable VARIABLE NEW + This is like `make-obsolete' but is for variables instead of + functions. + + - Function: define-obsolete-function-alias OLDFUN NEWFUN + This function combines `make-obsolete' and `define-function', + declaring OLDFUN to be an obsolete variant of NEWFUN and defining + OLDFUN as an alias for NEWFUN. + + - Function: define-obsolete-variable-alias OLDVAR NEWVAR + This is like `define-obsolete-function-alias' but for variables. + + Note that you should not normally put obsoleteness information +explicitly in a function or variable's doc string. The obsoleteness +information that you specify using the above functions will be displayed +whenever the doc string is displayed, and by adding it explicitly the +result is redundancy. + + Also, if an obsolete function is substantially the same as a newer +one but is not actually an alias, you should consider omitting the doc +string entirely (use a null string `""' as the doc string). That way, +the user is told about the obsoleteness and is forced to look at the +documentation of the new function, making it more likely that he will +use the new function. + + - Function: function-obsoleteness-doc FUNCTION + If FUNCTION is obsolete, this function returns a string describing + this. This is the message that is printed out during byte + compilation or in the function's documentation. If FUNCTION is + not obsolete, `nil' is returned. + + - Function: variable-obsoleteness-doc VARIABLE + This is like `function-obsoleteness-doc' but for variables. + + The obsoleteness information is stored internally by putting a +property `byte-obsolete-info' (for functions) or +`byte-obsolete-variable' (for variables) on the symbol that specifies +the obsolete function or variable. For more information, see the +implementation of `make-obsolete' and `make-obsolete-variable' in +`lisp/bytecomp/bytecomp-runtime.el'. + + +File: lispref.info, Node: Files, Next: Backups and Auto-Saving, Prev: Documentation, Up: Top + +Files +***** + + In XEmacs, you can find, create, view, save, and otherwise work with +files and file directories. This chapter describes most of the +file-related functions of XEmacs Lisp, but a few others are described in +*Note Buffers::, and those related to backups and auto-saving are +described in *Note Backups and Auto-Saving::. + + Many of the file functions take one or more arguments that are file +names. A file name is actually a string. Most of these functions +expand file name arguments using `expand-file-name', so that `~' is +handled correctly, as are relative file names (including `../'). These +functions don't recognize environment variable substitutions such as +`$HOME'. *Note File Name Expansion::. + +* Menu: + +* Visiting Files:: Reading files into Emacs buffers for editing. +* Saving Buffers:: Writing changed buffers back into files. +* Reading from Files:: Reading files into buffers without visiting. +* Writing to Files:: Writing new files from parts of buffers. +* File Locks:: Locking and unlocking files, to prevent + simultaneous editing by two people. +* Information about Files:: Testing existence, accessibility, size of files. +* Changing File Attributes:: Renaming files, changing protection, etc. +* File Names:: Decomposing and expanding file names. +* Contents of Directories:: Getting a list of the files in a directory. +* Create/Delete Dirs:: Creating and Deleting Directories. +* Magic File Names:: Defining "magic" special handling + for certain file names. +* Partial Files:: Treating a section of a buffer as a file. +* Format Conversion:: Conversion to and from various file formats. +* Files and MS-DOS:: Distinguishing text and binary files on MS-DOS. + + +File: lispref.info, Node: Visiting Files, Next: Saving Buffers, Up: Files + +Visiting Files +============== + + Visiting a file means reading a file into a buffer. Once this is +done, we say that the buffer is "visiting" that file, and call the file +"the visited file" of the buffer. + + A file and a buffer are two different things. A file is information +recorded permanently in the computer (unless you delete it). A buffer, +on the other hand, is information inside of XEmacs that will vanish at +the end of the editing session (or when you kill the buffer). Usually, +a buffer contains information that you have copied from a file; then we +say the buffer is visiting that file. The copy in the buffer is what +you modify with editing commands. Such changes to the buffer do not +change the file; therefore, to make the changes permanent, you must +"save" the buffer, which means copying the altered buffer contents back +into the file. + + In spite of the distinction between files and buffers, people often +refer to a file when they mean a buffer and vice-versa. Indeed, we say, +"I am editing a file," rather than, "I am editing a buffer that I will +soon save as a file of the same name." Humans do not usually need to +make the distinction explicit. When dealing with a computer program, +however, it is good to keep the distinction in mind. + +* Menu: + +* Visiting Functions:: The usual interface functions for visiting. +* Subroutines of Visiting:: Lower-level subroutines that they use. + + +File: lispref.info, Node: Visiting Functions, Next: Subroutines of Visiting, Up: Visiting Files + +Functions for Visiting Files +---------------------------- + + This section describes the functions normally used to visit files. +For historical reasons, these functions have names starting with +`find-' rather than `visit-'. *Note Buffer File Name::, for functions +and variables that access the visited file name of a buffer or that +find an existing buffer by its visited file name. + + In a Lisp program, if you want to look at the contents of a file but +not alter it, the fastest way is to use `insert-file-contents' in a +temporary buffer. Visiting the file is not necessary and takes longer. +*Note Reading from Files::. + + - Command: find-file FILENAME + This command selects a buffer visiting the file FILENAME, using an + existing buffer if there is one, and otherwise creating a new + buffer and reading the file into it. It also returns that buffer. + + The body of the `find-file' function is very simple and looks like + this: + + (switch-to-buffer (find-file-noselect filename)) + + (See `switch-to-buffer' in *Note Displaying Buffers::.) + + When `find-file' is called interactively, it prompts for FILENAME + in the minibuffer. + + - Function: find-file-noselect FILENAME &optional NOWARN + This function is the guts of all the file-visiting functions. It + finds or creates a buffer visiting the file FILENAME, and returns + it. It uses an existing buffer if there is one, and otherwise + creates a new buffer and reads the file into it. You may make the + buffer current or display it in a window if you wish, but this + function does not do so. + + When `find-file-noselect' uses an existing buffer, it first + verifies that the file has not changed since it was last visited or + saved in that buffer. If the file has changed, then this function + asks the user whether to reread the changed file. If the user says + `yes', any changes previously made in the buffer are lost. + + If `find-file-noselect' needs to create a buffer, and there is no + file named FILENAME, it displays the message `New file' in the + echo area, and leaves the buffer empty. + + If NO-WARN is non-`nil', various warnings that XEmacs normally + gives (e.g. if another buffer is already visiting FILENAME but + FILENAME has been removed from disk since that buffer was created) + are suppressed. + + The `find-file-noselect' function calls `after-find-file' after + reading the file (*note Subroutines of Visiting::.). That function + sets the buffer major mode, parses local variables, warns the user + if there exists an auto-save file more recent than the file just + visited, and finishes by running the functions in + `find-file-hooks'. + + The `find-file-noselect' function returns the buffer that is + visiting the file FILENAME. + + (find-file-noselect "/etc/fstab") + => # + + - Command: find-file-other-window FILENAME + This command selects a buffer visiting the file FILENAME, but does + so in a window other than the selected window. It may use another + existing window or split a window; see *Note Displaying Buffers::. + + When this command is called interactively, it prompts for FILENAME. + + - Command: find-file-read-only FILENAME + This command selects a buffer visiting the file FILENAME, like + `find-file', but it marks the buffer as read-only. *Note Read + Only Buffers::, for related functions and variables. + + When this command is called interactively, it prompts for FILENAME. + + - Command: view-file FILENAME + This command visits FILENAME in View mode, and displays it in a + recursive edit, returning to the previous buffer when done. View + mode is a mode that allows you to skim rapidly through the file + but does not let you modify it. Entering View mode runs the + normal hook `view-mode-hook'. *Note Hooks::. + + When `view-file' is called interactively, it prompts for FILENAME. + + - Variable: find-file-hooks + The value of this variable is a list of functions to be called + after a file is visited. The file's local-variables specification + (if any) will have been processed before the hooks are run. The + buffer visiting the file is current when the hook functions are + run. + + This variable works just like a normal hook, but we think that + renaming it would not be advisable. + + - Variable: find-file-not-found-hooks + The value of this variable is a list of functions to be called when + `find-file' or `find-file-noselect' is passed a nonexistent file + name. `find-file-noselect' calls these functions as soon as it + detects a nonexistent file. It calls them in the order of the + list, until one of them returns non-`nil'. `buffer-file-name' is + already set up. + + This is not a normal hook because the values of the functions are + used and they may not all be called. + + +File: lispref.info, Node: Subroutines of Visiting, Prev: Visiting Functions, Up: Visiting Files + +Subroutines of Visiting +----------------------- + + The `find-file-noselect' function uses the `create-file-buffer' and +`after-find-file' functions as subroutines. Sometimes it is useful to +call them directly. + + - Function: create-file-buffer FILENAME + This function creates a suitably named buffer for visiting + FILENAME, and returns it. It uses FILENAME (sans directory) as + the name if that name is free; otherwise, it appends a string such + as `<2>' to get an unused name. See also *Note Creating Buffers::. + + *Please note:* `create-file-buffer' does *not* associate the new + buffer with a file and does not select the buffer. It also does + not use the default major mode. + + (create-file-buffer "foo") + => # + (create-file-buffer "foo") + => #> + (create-file-buffer "foo") + => #> + + This function is used by `find-file-noselect'. It uses + `generate-new-buffer' (*note Creating Buffers::.). + + - Function: after-find-file &optional ERROR WARN NOAUTO + This function sets the buffer major mode, and parses local + variables (*note Auto Major Mode::.). It is called by + `find-file-noselect' and by the default revert function (*note + Reverting::.). + + If reading the file got an error because the file does not exist, + but its directory does exist, the caller should pass a non-`nil' + value for ERROR. In that case, `after-find-file' issues a warning: + `(New File)'. For more serious errors, the caller should usually + not call `after-find-file'. + + If WARN is non-`nil', then this function issues a warning if an + auto-save file exists and is more recent than the visited file. + + If NOAUTO is non-`nil', then this function does not turn on + auto-save mode; otherwise, it does. + + The last thing `after-find-file' does is call all the functions in + `find-file-hooks'. + + +File: lispref.info, Node: Saving Buffers, Next: Reading from Files, Prev: Visiting Files, Up: Files + +Saving Buffers +============== + + When you edit a file in XEmacs, you are actually working on a buffer +that is visiting that file--that is, the contents of the file are +copied into the buffer and the copy is what you edit. Changes to the +buffer do not change the file until you "save" the buffer, which means +copying the contents of the buffer into the file. + + - Command: save-buffer &optional BACKUP-OPTION + This function saves the contents of the current buffer in its + visited file if the buffer has been modified since it was last + visited or saved. Otherwise it does nothing. + + `save-buffer' is responsible for making backup files. Normally, + BACKUP-OPTION is `nil', and `save-buffer' makes a backup file only + if this is the first save since visiting the file. Other values + for BACKUP-OPTION request the making of backup files in other + circumstances: + + * With an argument of 4 or 64, reflecting 1 or 3 `C-u''s, the + `save-buffer' function marks this version of the file to be + backed up when the buffer is next saved. + + * With an argument of 16 or 64, reflecting 2 or 3 `C-u''s, the + `save-buffer' function unconditionally backs up the previous + version of the file before saving it. + + - Command: save-some-buffers &optional SAVE-SILENTLY-P EXITING + This command saves some modified file-visiting buffers. Normally + it asks the user about each buffer. But if SAVE-SILENTLY-P is + non-`nil', it saves all the file-visiting buffers without querying + the user. + + The optional EXITING argument, if non-`nil', requests this + function to offer also to save certain other buffers that are not + visiting files. These are buffers that have a non-`nil' local + value of `buffer-offer-save'. (A user who says yes to saving one + of these is asked to specify a file name to use.) The + `save-buffers-kill-emacs' function passes a non-`nil' value for + this argument. + + - Variable: buffer-offer-save + When this variable is non-`nil' in a buffer, XEmacs offers to save + the buffer on exit even if the buffer is not visiting a file. The + variable is automatically local in all buffers. Normally, Mail + mode (used for editing outgoing mail) sets this to `t'. + + - Command: write-file FILENAME + This function writes the current buffer into file FILENAME, makes + the buffer visit that file, and marks it not modified. Then it + renames the buffer based on FILENAME, appending a string like `<2>' + if necessary to make a unique buffer name. It does most of this + work by calling `set-visited-file-name' and `save-buffer'. + + - Variable: write-file-hooks + The value of this variable is a list of functions to be called + before writing out a buffer to its visited file. If one of them + returns non-`nil', the file is considered already written and the + rest of the functions are not called, nor is the usual code for + writing the file executed. + + If a function in `write-file-hooks' returns non-`nil', it is + responsible for making a backup file (if that is appropriate). To + do so, execute the following code: + + (or buffer-backed-up (backup-buffer)) + + You might wish to save the file modes value returned by + `backup-buffer' and use that to set the mode bits of the file that + you write. This is what `save-buffer' normally does. + + Even though this is not a normal hook, you can use `add-hook' and + `remove-hook' to manipulate the list. *Note Hooks::. + + - Variable: local-write-file-hooks + This works just like `write-file-hooks', but it is intended to be + made local to particular buffers. It's not a good idea to make + `write-file-hooks' local to a buffer--use this variable instead. + + The variable is marked as a permanent local, so that changing the + major mode does not alter a buffer-local value. This is + convenient for packages that read "file" contents in special ways, + and set up hooks to save the data in a corresponding way. + + - Variable: write-contents-hooks + This works just like `write-file-hooks', but it is intended for + hooks that pertain to the contents of the file, as opposed to + hooks that pertain to where the file came from. Such hooks are + usually set up by major modes, as buffer-local bindings for this + variable. Switching to a new major mode always resets this + variable. + + - Variable: after-save-hook + This normal hook runs after a buffer has been saved in its visited + file. + + - Variable: file-precious-flag + If this variable is non-`nil', then `save-buffer' protects against + I/O errors while saving by writing the new file to a temporary + name instead of the name it is supposed to have, and then renaming + it to the intended name after it is clear there are no errors. + This procedure prevents problems such as a lack of disk space from + resulting in an invalid file. + + As a side effect, backups are necessarily made by copying. *Note + Rename or Copy::. Yet, at the same time, saving a precious file + always breaks all hard links between the file you save and other + file names. + + Some modes set this variable non-`nil' locally in particular + buffers. + + - User Option: require-final-newline + This variable determines whether files may be written out that do + *not* end with a newline. If the value of the variable is `t', + then `save-buffer' silently adds a newline at the end of the file + whenever the buffer being saved does not already end in one. If + the value of the variable is non-`nil', but not `t', then + `save-buffer' asks the user whether to add a newline each time the + case arises. + + If the value of the variable is `nil', then `save-buffer' doesn't + add newlines at all. `nil' is the default value, but a few major + modes set it to `t' in particular buffers. + + +File: lispref.info, Node: Reading from Files, Next: Writing to Files, Prev: Saving Buffers, Up: Files + +Reading from Files +================== + + You can copy a file from the disk and insert it into a buffer using +the `insert-file-contents' function. Don't use the user-level command +`insert-file' in a Lisp program, as that sets the mark. + + - Function: insert-file-contents FILENAME &optional VISIT BEG END + REPLACE + This function inserts the contents of file FILENAME into the + current buffer after point. It returns a list of the absolute + file name and the length of the data inserted. An error is + signaled if FILENAME is not the name of a file that can be read. + + The function `insert-file-contents' checks the file contents + against the defined file formats, and converts the file contents if + appropriate. *Note Format Conversion::. It also calls the + functions in the list `after-insert-file-functions'; see *Note + Saving Properties::. + + If VISIT is non-`nil', this function additionally marks the buffer + as unmodified and sets up various fields in the buffer so that it + is visiting the file FILENAME: these include the buffer's visited + file name and its last save file modtime. This feature is used by + `find-file-noselect' and you probably should not use it yourself. + + If BEG and END are non-`nil', they should be integers specifying + the portion of the file to insert. In this case, VISIT must be + `nil'. For example, + + (insert-file-contents filename nil 0 500) + + inserts the first 500 characters of a file. + + If the argument REPLACE is non-`nil', it means to replace the + contents of the buffer (actually, just the accessible portion) + with the contents of the file. This is better than simply + deleting the buffer contents and inserting the whole file, because + (1) it preserves some marker positions and (2) it puts less data + in the undo list. + + If you want to pass a file name to another process so that another +program can read the file, use the function `file-local-copy'; see +*Note Magic File Names::. + + +File: lispref.info, Node: Writing to Files, Next: File Locks, Prev: Reading from Files, Up: Files + +Writing to Files +================ + + You can write the contents of a buffer, or part of a buffer, directly +to a file on disk using the `append-to-file' and `write-region' +functions. Don't use these functions to write to files that are being +visited; that could cause confusion in the mechanisms for visiting. + + - Command: append-to-file START END FILENAME + This function appends the contents of the region delimited by + START and END in the current buffer to the end of file FILENAME. + If that file does not exist, it is created. If that file exists + it is overwritten. This function returns `nil'. + + An error is signaled if FILENAME specifies a nonwritable file, or + a nonexistent file in a directory where files cannot be created. + + - Command: write-region START END FILENAME &optional APPEND VISIT + This function writes the region delimited by START and END in the + current buffer into the file specified by FILENAME. + + If START is a string, then `write-region' writes or appends that + string, rather than text from the buffer. + + If APPEND is non-`nil', then the specified text is appended to the + existing file contents (if any). + + If VISIT is `t', then XEmacs establishes an association between + the buffer and the file: the buffer is then visiting that file. + It also sets the last file modification time for the current + buffer to FILENAME's modtime, and marks the buffer as not + modified. This feature is used by `save-buffer', but you probably + should not use it yourself. + + If VISIT is a string, it specifies the file name to visit. This + way, you can write the data to one file (FILENAME) while recording + the buffer as visiting another file (VISIT). The argument VISIT + is used in the echo area message and also for file locking; VISIT + is stored in `buffer-file-name'. This feature is used to + implement `file-precious-flag'; don't use it yourself unless you + really know what you're doing. + + The function `write-region' converts the data which it writes to + the appropriate file formats specified by `buffer-file-format'. + *Note Format Conversion::. It also calls the functions in the list + `write-region-annotate-functions'; see *Note Saving Properties::. + + Normally, `write-region' displays a message `Wrote file FILENAME' + in the echo area. If VISIT is neither `t' nor `nil' nor a string, + then this message is inhibited. This feature is useful for + programs that use files for internal purposes, files that the user + does not need to know about. + + +File: lispref.info, Node: File Locks, Next: Information about Files, Prev: Writing to Files, Up: Files + +File Locks +========== + + When two users edit the same file at the same time, they are likely +to interfere with each other. XEmacs tries to prevent this situation +from arising by recording a "file lock" when a file is being modified. +XEmacs can then detect the first attempt to modify a buffer visiting a +file that is locked by another XEmacs process, and ask the user what to +do. + + File locks do not work properly when multiple machines can share +file systems, such as with NFS. Perhaps a better file locking system +will be implemented in the future. When file locks do not work, it is +possible for two users to make changes simultaneously, but XEmacs can +still warn the user who saves second. Also, the detection of +modification of a buffer visiting a file changed on disk catches some +cases of simultaneous editing; see *Note Modification Time::. + + - Function: file-locked-p &optional FILENAME + This function returns `nil' if the file FILENAME is not locked by + this XEmacs process. It returns `t' if it is locked by this + XEmacs, and it returns the name of the user who has locked it if it + is locked by someone else. + + (file-locked-p "foo") + => nil + + - Function: lock-buffer &optional FILENAME + This function locks the file FILENAME, if the current buffer is + modified. The argument FILENAME defaults to the current buffer's + visited file. Nothing is done if the current buffer is not + visiting a file, or is not modified. + + - Function: unlock-buffer + This function unlocks the file being visited in the current buffer, + if the buffer is modified. If the buffer is not modified, then + the file should not be locked, so this function does nothing. It + also does nothing if the current buffer is not visiting a file. + + - Function: ask-user-about-lock FILE OTHER-USER + This function is called when the user tries to modify FILE, but it + is locked by another user named OTHER-USER. The value it returns + determines what happens next: + + * A value of `t' says to grab the lock on the file. Then this + user may edit the file and OTHER-USER loses the lock. + + * A value of `nil' says to ignore the lock and let this user + edit the file anyway. + + * This function may instead signal a `file-locked' error, in + which case the change that the user was about to make does + not take place. + + The error message for this error looks like this: + + error--> File is locked: FILE OTHER-USER + + where `file' is the name of the file and OTHER-USER is the + name of the user who has locked the file. + + The default definition of this function asks the user to choose + what to do. If you wish, you can replace the `ask-user-about-lock' + function with your own version that decides in another way. The + code for its usual definition is in `userlock.el'. + + +File: lispref.info, Node: Information about Files, Next: Changing File Attributes, Prev: File Locks, Up: Files + +Information about Files +======================= + + The functions described in this section all operate on strings that +designate file names. All the functions have names that begin with the +word `file'. These functions all return information about actual files +or directories, so their arguments must all exist as actual files or +directories unless otherwise noted. + +* Menu: + +* Testing Accessibility:: Is a given file readable? Writable? +* Kinds of Files:: Is it a directory? A symbolic link? +* Truenames:: Eliminating symbolic links from a file name. +* File Attributes:: How large is it? Any other names? Etc. + + +File: lispref.info, Node: Testing Accessibility, Next: Kinds of Files, Up: Information about Files + +Testing Accessibility +--------------------- + + These functions test for permission to access a file in specific +ways. + + - Function: file-exists-p FILENAME + This function returns `t' if a file named FILENAME appears to + exist. This does not mean you can necessarily read the file, only + that you can find out its attributes. (On Unix, this is true if + the file exists and you have execute permission on the containing + directories, regardless of the protection of the file itself.) + + If the file does not exist, or if fascist access control policies + prevent you from finding the attributes of the file, this function + returns `nil'. + + - Function: file-readable-p FILENAME + This function returns `t' if a file named FILENAME exists and you + can read it. It returns `nil' otherwise. + + (file-readable-p "files.texi") + => t + (file-exists-p "/usr/spool/mqueue") + => t + (file-readable-p "/usr/spool/mqueue") + => nil + + - Function: file-executable-p FILENAME + This function returns `t' if a file named FILENAME exists and you + can execute it. It returns `nil' otherwise. If the file is a + directory, execute permission means you can check the existence and + attributes of files inside the directory, and open those files if + their modes permit. + + - Function: file-writable-p FILENAME + This function returns `t' if the file FILENAME can be written or + created by you, and `nil' otherwise. A file is writable if the + file exists and you can write it. It is creatable if it does not + exist, but the specified directory does exist and you can write in + that directory. + + In the third example below, `foo' is not writable because the + parent directory does not exist, even though the user could create + such a directory. + + (file-writable-p "~/foo") + => t + (file-writable-p "/foo") + => nil + (file-writable-p "~/no-such-dir/foo") + => nil + + - Function: file-accessible-directory-p DIRNAME + This function returns `t' if you have permission to open existing + files in the directory whose name as a file is DIRNAME; otherwise + (or if there is no such directory), it returns `nil'. The value + of DIRNAME may be either a directory name or the file name of a + directory. + + Example: after the following, + + (file-accessible-directory-p "/foo") + => nil + + we can deduce that any attempt to read a file in `/foo/' will give + an error. + + - Function: file-ownership-preserved-p FILENAME + This function returns `t' if deleting the file FILENAME and then + creating it anew would keep the file's owner unchanged. + + - Function: file-newer-than-file-p FILENAME1 FILENAME2 + This function returns `t' if the file FILENAME1 is newer than file + FILENAME2. If FILENAME1 does not exist, it returns `nil'. If + FILENAME2 does not exist, it returns `t'. + + In the following example, assume that the file `aug-19' was written + on the 19th, `aug-20' was written on the 20th, and the file + `no-file' doesn't exist at all. + + (file-newer-than-file-p "aug-19" "aug-20") + => nil + (file-newer-than-file-p "aug-20" "aug-19") + => t + (file-newer-than-file-p "aug-19" "no-file") + => t + (file-newer-than-file-p "no-file" "aug-19") + => nil + + You can use `file-attributes' to get a file's last modification + time as a list of two numbers. *Note File Attributes::. + + +File: lispref.info, Node: Kinds of Files, Next: Truenames, Prev: Testing Accessibility, Up: Information about Files + +Distinguishing Kinds of Files +----------------------------- + + This section describes how to distinguish various kinds of files, +such as directories, symbolic links, and ordinary files. + + - Function: file-symlink-p FILENAME + If the file FILENAME is a symbolic link, the `file-symlink-p' + function returns the file name to which it is linked. This may be + the name of a text file, a directory, or even another symbolic + link, or it may be a nonexistent file name. + + If the file FILENAME is not a symbolic link (or there is no such + file), `file-symlink-p' returns `nil'. + + (file-symlink-p "foo") + => nil + (file-symlink-p "sym-link") + => "foo" + (file-symlink-p "sym-link2") + => "sym-link" + (file-symlink-p "/bin") + => "/pub/bin" + + + - Function: file-directory-p FILENAME + This function returns `t' if FILENAME is the name of an existing + directory, `nil' otherwise. + + (file-directory-p "~rms") + => t + (file-directory-p "~rms/lewis/files.texi") + => nil + (file-directory-p "~rms/lewis/no-such-file") + => nil + (file-directory-p "$HOME") + => nil + (file-directory-p + (substitute-in-file-name "$HOME")) + => t + + - Function: file-regular-p FILENAME + This function returns `t' if the file FILENAME exists and is a + regular file (not a directory, symbolic link, named pipe, + terminal, or other I/O device). + + +File: lispref.info, Node: Truenames, Next: File Attributes, Prev: Kinds of Files, Up: Information about Files + +Truenames +--------- + + The "truename" of a file is the name that you get by following +symbolic links until none remain, then expanding to get rid of `.' and +`..' as components. Strictly speaking, a file need not have a unique +truename; the number of distinct truenames a file has is equal to the +number of hard links to the file. However, truenames are useful +because they eliminate symbolic links as a cause of name variation. + + - Function: file-truename FILENAME &optional DEFAULT + The function `file-truename' returns the true name of the file + FILENAME. This is the name that you get by following symbolic + links until none remain. + + If the filename is relative, DEFAULT is the directory to start + with. If DEFAULT is `nil' or missing, the current buffer's value + of `default-directory' is used. + + *Note Buffer File Name::, for related information. + diff --git a/info/lispref.info-23 b/info/lispref.info-23 new file mode 100644 index 0000000..cb2dcee --- /dev/null +++ b/info/lispref.info-23 @@ -0,0 +1,1258 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: File Attributes, Prev: Truenames, Up: Information about Files + +Other Information about Files +----------------------------- + + This section describes the functions for getting detailed information +about a file, other than its contents. This information includes the +mode bits that control access permission, the owner and group numbers, +the number of names, the inode number, the size, and the times of access +and modification. + + - Function: file-modes FILENAME + This function returns the mode bits of FILENAME, as an integer. + The mode bits are also called the file permissions, and they + specify access control in the usual Unix fashion. If the + low-order bit is 1, then the file is executable by all users, if + the second-lowest-order bit is 1, then the file is writable by all + users, etc. + + The highest value returnable is 4095 (7777 octal), meaning that + everyone has read, write, and execute permission, that the SUID bit + is set for both others and group, and that the sticky bit is set. + + (file-modes "~/junk/diffs") + => 492 ; Decimal integer. + (format "%o" 492) + => "754" ; Convert to octal. + + (set-file-modes "~/junk/diffs" 438) + => nil + + (format "%o" 438) + => "666" ; Convert to octal. + + % ls -l diffs + -rw-rw-rw- 1 lewis 0 3063 Oct 30 16:00 diffs + + - Function: file-nlinks FILENAME + This functions returns the number of names (i.e., hard links) that + file FILENAME has. If the file does not exist, then this function + returns `nil'. Note that symbolic links have no effect on this + function, because they are not considered to be names of the files + they link to. + + % ls -l foo* + -rw-rw-rw- 2 rms 4 Aug 19 01:27 foo + -rw-rw-rw- 2 rms 4 Aug 19 01:27 foo1 + + (file-nlinks "foo") + => 2 + (file-nlinks "doesnt-exist") + => nil + + - Function: file-attributes FILENAME + This function returns a list of attributes of file FILENAME. If + the specified file cannot be opened, it returns `nil'. + + The elements of the list, in order, are: + + 0. `t' for a directory, a string for a symbolic link (the name + linked to), or `nil' for a text file. + + 1. The number of names the file has. Alternate names, also + known as hard links, can be created by using the + `add-name-to-file' function (*note Changing File + Attributes::.). + + 2. The file's UID. + + 3. The file's GID. + + 4. The time of last access, as a list of two integers. The + first integer has the high-order 16 bits of time, the second + has the low 16 bits. (This is similar to the value of + `current-time'; see *Note Time of Day::.) + + 5. The time of last modification as a list of two integers (as + above). + + 6. The time of last status change as a list of two integers (as + above). + + 7. The size of the file in bytes. + + 8. The file's modes, as a string of ten letters or dashes, as in + `ls -l'. + + 9. `t' if the file's GID would change if file were deleted and + recreated; `nil' otherwise. + + 10. The file's inode number. + + 11. The file system number of the file system that the file is + in. This element and the file's inode number together give + enough information to distinguish any two files on the + system--no two files can have the same values for both of + these numbers. + + For example, here are the file attributes for `files.texi': + + (file-attributes "files.texi") + => (nil + 1 + 2235 + 75 + (8489 20284) + (8489 20284) + (8489 20285) + 14906 + "-rw-rw-rw-" + nil + 129500 + -32252) + + and here is how the result is interpreted: + + `nil' + is neither a directory nor a symbolic link. + + `1' + has only one name (the name `files.texi' in the current + default directory). + + `2235' + is owned by the user with UID 2235. + + `75' + is in the group with GID 75. + + `(8489 20284)' + was last accessed on Aug 19 00:09. Use `format-time-string' to + ! convert this number into a time string. *Note Time + Conversion::. + + `(8489 20284)' + was last modified on Aug 19 00:09. + + `(8489 20285)' + last had its inode changed on Aug 19 00:09. + + `14906' + is 14906 characters long. + + `"-rw-rw-rw-"' + has a mode of read and write access for the owner, group, and + world. + + `nil' + would retain the same GID if it were recreated. + + `129500' + has an inode number of 129500. + + `-32252' + is on file system number -32252. + + +File: lispref.info, Node: Changing File Attributes, Next: File Names, Prev: Information about Files, Up: Files + +Changing File Names and Attributes +================================== + + The functions in this section rename, copy, delete, link, and set the +modes of files. + + In the functions that have an argument NEWNAME, if a file by the +name of NEWNAME already exists, the actions taken depend on the value +of the argument OK-IF-ALREADY-EXISTS: + + * Signal a `file-already-exists' error if OK-IF-ALREADY-EXISTS is + `nil'. + + * Request confirmation if OK-IF-ALREADY-EXISTS is a number. + + * Replace the old file without confirmation if OK-IF-ALREADY-EXISTS + is any other value. + + - Command: add-name-to-file OLDNAME NEWNAME &optional + OK-IF-ALREADY-EXISTS + This function gives the file named OLDNAME the additional name + NEWNAME. This means that NEWNAME becomes a new "hard link" to + OLDNAME. + + In the first part of the following example, we list two files, + `foo' and `foo3'. + + % ls -l fo* + -rw-rw-rw- 1 rms 29 Aug 18 20:32 foo + -rw-rw-rw- 1 rms 24 Aug 18 20:31 foo3 + + Then we evaluate the form `(add-name-to-file "~/lewis/foo" + "~/lewis/foo2")'. Again we list the files. This shows two names, + `foo' and `foo2'. + + (add-name-to-file "~/lewis/foo1" "~/lewis/foo2") + => nil + + % ls -l fo* + -rw-rw-rw- 2 rms 29 Aug 18 20:32 foo + -rw-rw-rw- 2 rms 29 Aug 18 20:32 foo2 + -rw-rw-rw- 1 rms 24 Aug 18 20:31 foo3 + + Finally, we evaluate the following: + + (add-name-to-file "~/lewis/foo" "~/lewis/foo3" t) + + and list the files again. Now there are three names for one file: + `foo', `foo2', and `foo3'. The old contents of `foo3' are lost. + + (add-name-to-file "~/lewis/foo1" "~/lewis/foo3") + => nil + + % ls -l fo* + -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo + -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo2 + -rw-rw-rw- 3 rms 29 Aug 18 20:32 foo3 + + This function is meaningless on VMS, where multiple names for one + file are not allowed. + + See also `file-nlinks' in *Note File Attributes::. + + - Command: rename-file FILENAME NEWNAME &optional OK-IF-ALREADY-EXISTS + This command renames the file FILENAME as NEWNAME. + + If FILENAME has additional names aside from FILENAME, it continues + to have those names. In fact, adding the name NEWNAME with + `add-name-to-file' and then deleting FILENAME has the same effect + as renaming, aside from momentary intermediate states. + + In an interactive call, this function prompts for FILENAME and + NEWNAME in the minibuffer; also, it requests confirmation if + NEWNAME already exists. + + - Command: copy-file OLDNAME NEWNAME &optional OK-IF-EXISTS TIME + This command copies the file OLDNAME to NEWNAME. An error is + signaled if OLDNAME does not exist. + + If TIME is non-`nil', then this functions gives the new file the + same last-modified time that the old one has. (This works on only + some operating systems.) + + In an interactive call, this function prompts for FILENAME and + NEWNAME in the minibuffer; also, it requests confirmation if + NEWNAME already exists. + + - Command: delete-file FILENAME + This command deletes the file FILENAME, like the shell command `rm + FILENAME'. If the file has multiple names, it continues to exist + under the other names. + + A suitable kind of `file-error' error is signaled if the file does + not exist, or is not deletable. (On Unix, a file is deletable if + its directory is writable.) + + See also `delete-directory' in *Note Create/Delete Dirs::. + + - Command: make-symbolic-link FILENAME NEWNAME &optional OK-IF-EXISTS + This command makes a symbolic link to FILENAME, named NEWNAME. + This is like the shell command `ln -s FILENAME NEWNAME'. + + In an interactive call, this function prompts for FILENAME and + NEWNAME in the minibuffer; also, it requests confirmation if + NEWNAME already exists. + + - Function: define-logical-name VARNAME STRING + This function defines the logical name NAME to have the value + STRING. It is available only on VMS. + + - Function: set-file-modes FILENAME MODE + This function sets mode bits of FILENAME to MODE (which must be an + integer). Only the low 12 bits of MODE are used. + + - Function: set-default-file-modes MODE + This function sets the default file protection for new files + created by XEmacs and its subprocesses. Every file created with + XEmacs initially has this protection. On Unix, the default + protection is the bitwise complement of the "umask" value. + + The argument MODE must be an integer. Only the low 9 bits of MODE + are used. + + Saving a modified version of an existing file does not count as + creating the file; it does not change the file's mode, and does + not use the default file protection. + + - Function: default-file-modes + This function returns the current default protection value. + + On MS-DOS, there is no such thing as an "executable" file mode bit. +So Emacs considers a file executable if its name ends in `.com', `.bat' +or `.exe'. This is reflected in the values returned by `file-modes' +and `file-attributes'. + + +File: lispref.info, Node: File Names, Next: Contents of Directories, Prev: Changing File Attributes, Up: Files + +File Names +========== + + Files are generally referred to by their names, in XEmacs as +elsewhere. File names in XEmacs are represented as strings. The +functions that operate on a file all expect a file name argument. + + In addition to operating on files themselves, XEmacs Lisp programs +often need to operate on the names; i.e., to take them apart and to use +part of a name to construct related file names. This section describes +how to manipulate file names. + + The functions in this section do not actually access files, so they +can operate on file names that do not refer to an existing file or +directory. + + On VMS, all these functions understand both VMS file-name syntax and +Unix syntax. This is so that all the standard Lisp libraries can +specify file names in Unix syntax and work properly on VMS without +change. On MS-DOS, these functions understand MS-DOS file-name syntax +as well as Unix syntax. + +* Menu: + +* File Name Components:: The directory part of a file name, and the rest. +* Directory Names:: A directory's name as a directory + is different from its name as a file. +* Relative File Names:: Some file names are relative to a current directory. +* File Name Expansion:: Converting relative file names to absolute ones. +* Unique File Names:: Generating names for temporary files. +* File Name Completion:: Finding the completions for a given file name. +* User Name Completion:: Finding the completions for a given user name. + + +File: lispref.info, Node: File Name Components, Next: Directory Names, Up: File Names + +File Name Components +-------------------- + + The operating system groups files into directories. To specify a +file, you must specify the directory and the file's name within that +directory. Therefore, XEmacs considers a file name as having two main +parts: the "directory name" part, and the "nondirectory" part (or "file +name within the directory"). Either part may be empty. Concatenating +these two parts reproduces the original file name. + + On Unix, the directory part is everything up to and including the +last slash; the nondirectory part is the rest. The rules in VMS syntax +are complicated. + + For some purposes, the nondirectory part is further subdivided into +the name proper and the "version number". On Unix, only backup files +have version numbers in their names; on VMS, every file has a version +number, but most of the time the file name actually used in XEmacs +omits the version number. Version numbers are found mostly in +directory lists. + + - Function: file-name-directory FILENAME + This function returns the directory part of FILENAME (or `nil' if + FILENAME does not include a directory part). On Unix, the + function returns a string ending in a slash. On VMS, it returns a + string ending in one of the three characters `:', `]', or `>'. + + (file-name-directory "lewis/foo") ; Unix example + => "lewis/" + (file-name-directory "foo") ; Unix example + => nil + (file-name-directory "[X]FOO.TMP") ; VMS example + => "[X]" + + - Function: file-name-nondirectory FILENAME + This function returns the nondirectory part of FILENAME. + + (file-name-nondirectory "lewis/foo") + => "foo" + (file-name-nondirectory "foo") + => "foo" + ;; The following example is accurate only on VMS. + (file-name-nondirectory "[X]FOO.TMP") + => "FOO.TMP" + + - Function: file-name-sans-versions FILENAME &optional + KEEP-BACKUP-VERSION + This function returns FILENAME without any file version numbers, + backup version numbers, or trailing tildes. + + If KEEP-BACKUP-VERSION is non-`nil', we do not remove backup + version numbers, only true file version numbers. + + (file-name-sans-versions "~rms/foo.~1~") + => "~rms/foo" + (file-name-sans-versions "~rms/foo~") + => "~rms/foo" + (file-name-sans-versions "~rms/foo") + => "~rms/foo" + ;; The following example applies to VMS only. + (file-name-sans-versions "foo;23") + => "foo" + + - Function: file-name-sans-extension FILENAME + This function returns FILENAME minus its "extension," if any. The + extension, in a file name, is the part that starts with the last + `.' in the last name component. For example, + + (file-name-sans-extension "foo.lose.c") + => "foo.lose" + (file-name-sans-extension "big.hack/foo") + => "big.hack/foo" + + +File: lispref.info, Node: Directory Names, Next: Relative File Names, Prev: File Name Components, Up: File Names + +Directory Names +--------------- + + A "directory name" is the name of a directory. A directory is a +kind of file, and it has a file name, which is related to the directory +name but not identical to it. (This is not quite the same as the usual +Unix terminology.) These two different names for the same entity are +related by a syntactic transformation. On Unix, this is simple: a +directory name ends in a slash, whereas the directory's name as a file +lacks that slash. On VMS, the relationship is more complicated. + + The difference between a directory name and its name as a file is +subtle but crucial. When an XEmacs variable or function argument is +described as being a directory name, a file name of a directory is not +acceptable. + + The following two functions convert between directory names and file +names. They do nothing special with environment variable substitutions +such as `$HOME', and the constructs `~', and `..'. + + - Function: file-name-as-directory FILENAME + This function returns a string representing FILENAME in a form + that the operating system will interpret as the name of a + directory. In Unix, this means appending a slash to the string. + On VMS, the function converts a string of the form `[X]Y.DIR.1' to + the form `[X.Y]'. + + (file-name-as-directory "~rms/lewis") + => "~rms/lewis/" + + - Function: directory-file-name DIRNAME + This function returns a string representing DIRNAME in a form that + the operating system will interpret as the name of a file. On + Unix, this means removing a final slash from the string. On VMS, + the function converts a string of the form `[X.Y]' to `[X]Y.DIR.1'. + + (directory-file-name "~lewis/") + => "~lewis" + + Directory name abbreviations are useful for directories that are +normally accessed through symbolic links. Sometimes the users recognize +primarily the link's name as "the name" of the directory, and find it +annoying to see the directory's "real" name. If you define the link +name as an abbreviation for the "real" name, XEmacs shows users the +abbreviation instead. + + If you wish to convert a directory name to its abbreviation, use this +function: + + - Function: abbreviate-file-name DIRNAME &optional HACK-HOMEDIR + This function applies abbreviations from `directory-abbrev-alist' + to its argument, and substitutes `~' for the user's home directory. + + If HACK-HOMEDIR is non-`nil', then this also substitutes `~' for + the user's home directory. + + + - Variable: directory-abbrev-alist + The variable `directory-abbrev-alist' contains an alist of + abbreviations to use for file directories. Each element has the + form `(FROM . TO)', and says to replace FROM with TO when it + appears in a directory name. The FROM string is actually a + regular expression; it should always start with `^'. The function + `abbreviate-file-name' performs these substitutions. + + You can set this variable in `site-init.el' to describe the + abbreviations appropriate for your site. + + Here's an example, from a system on which file system `/home/fsf' + and so on are normally accessed through symbolic links named `/fsf' + and so on. + + (("^/home/fsf" . "/fsf") + ("^/home/gp" . "/gp") + ("^/home/gd" . "/gd")) + + +File: lispref.info, Node: Relative File Names, Next: File Name Expansion, Prev: Directory Names, Up: File Names + +Absolute and Relative File Names +-------------------------------- + + All the directories in the file system form a tree starting at the +root directory. A file name can specify all the directory names +starting from the root of the tree; then it is called an "absolute" +file name. Or it can specify the position of the file in the tree +relative to a default directory; then it is called a "relative" file +name. On Unix, an absolute file name starts with a slash or a tilde +(`~'), and a relative one does not. The rules on VMS are complicated. + + - Function: file-name-absolute-p FILENAME + This function returns `t' if file FILENAME is an absolute file + name, `nil' otherwise. On VMS, this function understands both + Unix syntax and VMS syntax. + + (file-name-absolute-p "~rms/foo") + => t + (file-name-absolute-p "rms/foo") + => nil + (file-name-absolute-p "/user/rms/foo") + => t + + +File: lispref.info, Node: File Name Expansion, Next: Unique File Names, Prev: Relative File Names, Up: File Names + +Functions that Expand Filenames +------------------------------- + + "Expansion" of a file name means converting a relative file name to +an absolute one. Since this is done relative to a default directory, +you must specify the default directory name as well as the file name to +be expanded. Expansion also simplifies file names by eliminating +redundancies such as `./' and `NAME/../'. + + - Function: expand-file-name FILENAME &optional DIRECTORY + This function converts FILENAME to an absolute file name. If + DIRECTORY is supplied, it is the directory to start with if + FILENAME is relative. (The value of DIRECTORY should itself be an + absolute directory name; it may start with `~'.) Otherwise, the + current buffer's value of `default-directory' is used. For + example: + + (expand-file-name "foo") + => "/xcssun/users/rms/lewis/foo" + (expand-file-name "../foo") + => "/xcssun/users/rms/foo" + (expand-file-name "foo" "/usr/spool/") + => "/usr/spool/foo" + (expand-file-name "$HOME/foo") + => "/xcssun/users/rms/lewis/$HOME/foo" + + Filenames containing `.' or `..' are simplified to their canonical + form: + + (expand-file-name "bar/../foo") + => "/xcssun/users/rms/lewis/foo" + + `~/' at the beginning is expanded into the user's home directory. + A `/' or `~' following a `/'. + + Note that `expand-file-name' does *not* expand environment + variables; only `substitute-in-file-name' does that. + + - Function: file-relative-name FILENAME &optional DIRECTORY + This function does the inverse of expansion--it tries to return a + relative name that is equivalent to FILENAME when interpreted + relative to DIRECTORY. + + If DIRECTORY is `nil' or omitted, the value of `default-directory' + is used. + + (file-relative-name "/foo/bar" "/foo/") + => "bar") + (file-relative-name "/foo/bar" "/hack/") + => "../foo/bar") + + - Variable: default-directory + The value of this buffer-local variable is the default directory + for the current buffer. It should be an absolute directory name; + it may start with `~'. This variable is local in every buffer. + + `expand-file-name' uses the default directory when its second + argument is `nil'. + + On Unix systems, the value is always a string ending with a slash. + + default-directory + => "/user/lewis/manual/" + + - Function: substitute-in-file-name FILENAME + This function replaces environment variable references in FILENAME + with the environment variable values. Following standard Unix + shell syntax, `$' is the prefix to substitute an environment + variable value. + + The environment variable name is the series of alphanumeric + characters (including underscores) that follow the `$'. If the + character following the `$' is a `{', then the variable name is + everything up to the matching `}'. + + Here we assume that the environment variable `HOME', which holds + the user's home directory name, has value `/xcssun/users/rms'. + + (substitute-in-file-name "$HOME/foo") + => "/xcssun/users/rms/foo" + + After substitution, a `/' or `~' following a `/' is taken to be + the start of an absolute file name that overrides what precedes + it, so everything before that `/' or `~' is deleted. For example: + + (substitute-in-file-name "bar/~/foo") + => "~/foo" + (substitute-in-file-name "/usr/local/$HOME/foo") + => "/xcssun/users/rms/foo" + + On VMS, `$' substitution is not done, so this function does nothing + on VMS except discard superfluous initial components as shown + above. + + +File: lispref.info, Node: Unique File Names, Next: File Name Completion, Prev: File Name Expansion, Up: File Names + +Generating Unique File Names +---------------------------- + + Some programs need to write temporary files. Here is the usual way +to construct a name for such a file: + + (make-temp-name (expand-file-name NAME-OF-APPLICATION (temp-directory))) + +Here we use `(temp-directory)' to specify a directory for temporary +files--under Unix, it will normally evaluate to `"/tmp/"'. The job of +`make-temp-name' is to prevent two different users or two different +processes from trying to use the same name. + + - Function: temp-directory + This function returns the name of the directory to use for + temporary files. Under Unix, this will be the value of `TMPDIR', + defaulting to `/tmp'. On Windows, this will be obtained from the + `TEMP' or `TMP' environment variables, defaulting to `/'. + + Note that the `temp-directory' function does not exist under FSF + Emacs. + + - Function: make-temp-name PREFIX + This function generates a temporary file name starting with + PREFIX. The Emacs process number forms part of the result, so + there is no danger of generating a name being used by another + process. + + (make-temp-name "/tmp/foo") + => "/tmp/fooGaAQjC" + + In addition, this function makes an attempt to choose a name that + does not specify an existing file. To make this work, PREFIX + should be an absolute file name. + + To avoid confusion, each Lisp application should preferably use a + unique PREFIX to `make-temp-name'. + + +File: lispref.info, Node: File Name Completion, Next: User Name Completion, Prev: Unique File Names, Up: File Names + +File Name Completion +-------------------- + + This section describes low-level subroutines for completing a file +name. For other completion functions, see *Note Completion::. + + - Function: file-name-all-completions PARTIAL-FILENAME DIRECTORY + This function returns a list of all possible completions for a file + whose name starts with PARTIAL-FILENAME in directory DIRECTORY. + The order of the completions is the order of the files in the + directory, which is unpredictable and conveys no useful + information. + + The argument PARTIAL-FILENAME must be a file name containing no + directory part and no slash. The current buffer's default + directory is prepended to DIRECTORY, if DIRECTORY is not absolute. + + In the following example, suppose that the current default + directory, `~rms/lewis', has five files whose names begin with `f': + `foo', `file~', `file.c', `file.c.~1~', and `file.c.~2~'. + + (file-name-all-completions "f" "") + => ("foo" "file~" "file.c.~2~" + "file.c.~1~" "file.c") + + (file-name-all-completions "fo" "") + => ("foo") + + - Function: file-name-completion FILENAME DIRECTORY + This function completes the file name FILENAME in directory + DIRECTORY. It returns the longest prefix common to all file names + in directory DIRECTORY that start with FILENAME. + + If only one match exists and FILENAME matches it exactly, the + function returns `t'. The function returns `nil' if directory + DIRECTORY contains no name starting with FILENAME. + + In the following example, suppose that the current default + directory has five files whose names begin with `f': `foo', + `file~', `file.c', `file.c.~1~', and `file.c.~2~'. + + (file-name-completion "fi" "") + => "file" + + (file-name-completion "file.c.~1" "") + => "file.c.~1~" + + (file-name-completion "file.c.~1~" "") + => t + + (file-name-completion "file.c.~3" "") + => nil + + - User Option: completion-ignored-extensions + `file-name-completion' usually ignores file names that end in any + string in this list. It does not ignore them when all the possible + completions end in one of these suffixes or when a buffer showing + all possible completions is displayed. + + A typical value might look like this: + + completion-ignored-extensions + => (".o" ".elc" "~" ".dvi") + + +File: lispref.info, Node: User Name Completion, Prev: File Name Completion, Up: File Names + +User Name Completion +-------------------- + + This section describes low-level subroutines for completing a user +name. For other completion functions, see *Note Completion::. + + - Function: user-name-all-completions PARTIAL-USERNAME + This function returns a list of all possible completions for a user + whose name starts with PARTIAL-USERNAME. The order of the + completions is unpredictable and conveys no useful information. + + The argument PARTIAL-USERNAME must be a partial user name + containing no tilde character and no slash. + + - Function: user-name-completion USERNAME + This function completes the user name USERNAME. It returns the + longest prefix common to all user names that start with USERNAME. + + If only one match exists and USERNAME matches it exactly, the + function returns `t'. The function returns `nil' if no user name + starting with USERNAME exists. + + - Function: user-name-completion-1 USERNAME + This function completes the user name USERNAME, like + `user-name-completion', differing only in the return value. This + function returns the cons of the completion returned by + `user-name-completion', and a boolean indicating whether that + completion was unique. + + +File: lispref.info, Node: Contents of Directories, Next: Create/Delete Dirs, Prev: File Names, Up: Files + +Contents of Directories +======================= + + A directory is a kind of file that contains other files entered under +various names. Directories are a feature of the file system. + + XEmacs can list the names of the files in a directory as a Lisp list, +or display the names in a buffer using the `ls' shell command. In the +latter case, it can optionally display information about each file, +depending on the value of switches passed to the `ls' command. + + - Function: directory-files DIRECTORY &optional FULL-NAME MATCH-REGEXP + NOSORT FILES-ONLY + This function returns a list of the names of the files in the + directory DIRECTORY. By default, the list is in alphabetical + order. + + If FULL-NAME is non-`nil', the function returns the files' + absolute file names. Otherwise, it returns just the names + relative to the specified directory. + + If MATCH-REGEXP is non-`nil', this function returns only those + file names that contain that regular expression--the other file + names are discarded from the list. + + If NOSORT is non-`nil', `directory-files' does not sort the list, + so you get the file names in no particular order. Use this if you + want the utmost possible speed and don't care what order the files + are processed in. If the order of processing is visible to the + user, then the user will probably be happier if you do sort the + names. + + If FILES-ONLY is the symbol `t', then only the "files" in the + directory will be returned; subdirectories will be excluded. If + FILES-ONLY is not `nil' and not `t', then only the subdirectories + will be returned. Otherwise, if FILES-ONLY is `nil' (the default) + then both files and subdirectories will be returned. + + (directory-files "~lewis") + => ("#foo#" "#foo.el#" "." ".." + "dired-mods.el" "files.texi" + "files.texi.~1~") + + An error is signaled if DIRECTORY is not the name of a directory + that can be read. + + - Function: insert-directory FILE SWITCHES &optional WILDCARD + FULL-DIRECTORY-P + This function inserts (in the current buffer) a directory listing + for directory FILE, formatted with `ls' according to SWITCHES. It + leaves point after the inserted text. + + The argument FILE may be either a directory name or a file + specification including wildcard characters. If WILDCARD is + non-`nil', that means treat FILE as a file specification with + wildcards. + + If FULL-DIRECTORY-P is non-`nil', that means FILE is a directory + and switches do not contain `-d', so that the listing should show + the full contents of the directory. (The `-d' option to `ls' says + to describe a directory itself rather than its contents.) + + This function works by running a directory listing program whose + name is in the variable `insert-directory-program'. If WILDCARD is + non-`nil', it also runs the shell specified by `shell-file-name', + to expand the wildcards. + + - Variable: insert-directory-program + This variable's value is the program to run to generate a + directory listing for the function `insert-directory'. + + +File: lispref.info, Node: Create/Delete Dirs, Next: Magic File Names, Prev: Contents of Directories, Up: Files + +Creating and Deleting Directories +================================= + + Most XEmacs Lisp file-manipulation functions get errors when used on +files that are directories. For example, you cannot delete a directory +with `delete-file'. These special functions exist to create and delete +directories. + + - Command: make-directory DIRNAME &optional PARENTS + This function creates a directory named DIRNAME. Interactively, + the default choice of directory to create is the current default + directory for file names. That is useful when you have visited a + file in a nonexistent directory. + + Non-interactively, optional argument PARENTS says whether to + create parent directories if they don't exist. (Interactively, this + always happens.) + + - Command: delete-directory DIRNAME + This function deletes the directory named DIRNAME. The function + `delete-file' does not work for files that are directories; you + must use `delete-directory' in that case. + + +File: lispref.info, Node: Magic File Names, Next: Partial Files, Prev: Create/Delete Dirs, Up: Files + +Making Certain File Names "Magic" +================================= + + You can implement special handling for certain file names. This is +called making those names "magic". You must supply a regular +expression to define the class of names (all those that match the +regular expression), plus a handler that implements all the primitive +XEmacs file operations for file names that do match. + + The variable `file-name-handler-alist' holds a list of handlers, +together with regular expressions that determine when to apply each +handler. Each element has this form: + + (REGEXP . HANDLER) + +All the XEmacs primitives for file access and file name transformation +check the given file name against `file-name-handler-alist'. If the +file name matches REGEXP, the primitives handle that file by calling +HANDLER. + + The first argument given to HANDLER is the name of the primitive; +the remaining arguments are the arguments that were passed to that +operation. (The first of these arguments is typically the file name +itself.) For example, if you do this: + + (file-exists-p FILENAME) + +and FILENAME has handler HANDLER, then HANDLER is called like this: + + (funcall HANDLER 'file-exists-p FILENAME) + + Here are the operations that a magic file name handler gets to +handle: + +`add-name-to-file', `copy-file', `delete-directory', `delete-file', +`diff-latest-backup-file', `directory-file-name', `directory-files', +`dired-compress-file', `dired-uncache', `expand-file-name', +`file-accessible-directory-p', `file-attributes', `file-directory-p', +`file-executable-p', `file-exists-p', `file-local-copy', `file-modes', +`file-name-all-completions', `file-name-as-directory', +`file-name-completion', `file-name-directory', `file-name-nondirectory', +`file-name-sans-versions', `file-newer-than-file-p', `file-readable-p', +`file-regular-p', `file-symlink-p', `file-truename', `file-writable-p', +`get-file-buffer', `insert-directory', `insert-file-contents', `load', +`make-directory', `make-symbolic-link', `rename-file', `set-file-modes', +`set-visited-file-modtime', `unhandled-file-name-directory', +`verify-visited-file-modtime', `write-region'. + + Handlers for `insert-file-contents' typically need to clear the +buffer's modified flag, with `(set-buffer-modified-p nil)', if the +VISIT argument is non-`nil'. This also has the effect of unlocking the +buffer if it is locked. + + The handler function must handle all of the above operations, and +possibly others to be added in the future. It need not implement all +these operations itself--when it has nothing special to do for a +certain operation, it can reinvoke the primitive, to handle the +operation "in the usual way". It should always reinvoke the primitive +for an operation it does not recognize. Here's one way to do this: + + (defun my-file-handler (operation &rest args) + ;; First check for the specific operations + ;; that we have special handling for. + (cond ((eq operation 'insert-file-contents) ...) + ((eq operation 'write-region) ...) + ... + ;; Handle any operation we don't know about. + (t (let ((inhibit-file-name-handlers + (cons 'my-file-handler + (and (eq inhibit-file-name-operation operation) + inhibit-file-name-handlers))) + (inhibit-file-name-operation operation)) + (apply operation args))))) + + When a handler function decides to call the ordinary Emacs primitive +for the operation at hand, it needs to prevent the primitive from +calling the same handler once again, thus leading to an infinite +recursion. The example above shows how to do this, with the variables +`inhibit-file-name-handlers' and `inhibit-file-name-operation'. Be +careful to use them exactly as shown above; the details are crucial for +proper behavior in the case of multiple handlers, and for operations +that have two file names that may each have handlers. + + - Variable: inhibit-file-name-handlers + This variable holds a list of handlers whose use is presently + inhibited for a certain operation. + + - Variable: inhibit-file-name-operation + The operation for which certain handlers are presently inhibited. + + - Function: find-file-name-handler FILE OPERATION + This function returns the handler function for file name FILE, or + `nil' if there is none. The argument OPERATION should be the + operation to be performed on the file--the value you will pass to + the handler as its first argument when you call it. The operation + is needed for comparison with `inhibit-file-name-operation'. + + - Function: file-local-copy FILENAME + This function copies file FILENAME to an ordinary non-magic file, + if it isn't one already. + + If FILENAME specifies a "magic" file name, which programs outside + Emacs cannot directly read or write, this copies the contents to + an ordinary file and returns that file's name. + + If FILENAME is an ordinary file name, not magic, then this function + does nothing and returns `nil'. + + - Function: unhandled-file-name-directory FILENAME + This function returns the name of a directory that is not magic. + It uses the directory part of FILENAME if that is not magic. + Otherwise, it asks the handler what to do. + + This is useful for running a subprocess; every subprocess must + have a non-magic directory to serve as its current directory, and + this function is a good way to come up with one. + + +File: lispref.info, Node: Partial Files, Next: Format Conversion, Prev: Magic File Names, Up: Files + +Partial Files +============= + +* Menu: + +* Intro to Partial Files:: +* Creating a Partial File:: +* Detached Partial Files:: + + +File: lispref.info, Node: Intro to Partial Files, Next: Creating a Partial File, Up: Partial Files + +Intro to Partial Files +---------------------- + + A "partial file" is a section of a buffer (called the "master +buffer") that is placed in its own buffer and treated as its own file. +Changes made to the partial file are not reflected in the master buffer +until the partial file is "saved" using the standard buffer save +commands. Partial files can be "reverted" (from the master buffer) +just like normal files. When a file part is active on a master buffer, +that section of the master buffer is marked as read-only. Two file +parts on the same master buffer are not allowed to overlap. Partial +file buffers are indicated by the words `File Part' in the modeline. + + The master buffer knows about all the partial files that are active +on it, and thus killing or reverting the master buffer will be handled +properly. When the master buffer is saved, if there are any unsaved +partial files active on it then the user will be given the opportunity +to first save these files. + + When a partial file buffer is first modified, the master buffer is +automatically marked as modified so that saving the master buffer will +work correctly. + + +File: lispref.info, Node: Creating a Partial File, Next: Detached Partial Files, Prev: Intro to Partial Files, Up: Partial Files + +Creating a Partial File +----------------------- + + - Function: make-file-part &optional START END NAME BUFFER + Make a file part on buffer BUFFER out of the region. Call it + NAME. This command creates a new buffer containing the contents + of the region and marks the buffer as referring to the specified + buffer, called the "master buffer". When the file-part buffer is + saved, its changes are integrated back into the master buffer. + When the master buffer is deleted, all file parts are deleted with + it. + + When called from a function, expects four arguments, START, END, + NAME, and BUFFER, all of which are optional and default to the + beginning of BUFFER, the end of BUFFER, a name generated from + BUFFER name, and the current buffer, respectively. + + +File: lispref.info, Node: Detached Partial Files, Prev: Creating a Partial File, Up: Partial Files + +Detached Partial Files +---------------------- + + Every partial file has an extent in the master buffer associated +with it (called the "master extent"), marking where in the master +buffer the partial file begins and ends. If the text in master buffer +that is contained by the extent is deleted, then the extent becomes +"detached", meaning that it no longer refers to a specific region of +the master buffer. This can happen either when the text is deleted +directly or when the master buffer is reverted. Neither of these should +happen in normal usage because the master buffer should generally not be +edited directly. + + Before doing any operation that references a partial file's master +extent, XEmacs checks to make sure that the extent is not detached. If +this is the case, XEmacs warns the user of this and the master extent is +deleted out of the master buffer, disconnecting the file part. The file +part's filename is cleared and thus must be explicitly specified if the +detached file part is to be saved. + + +File: lispref.info, Node: Format Conversion, Next: Files and MS-DOS, Prev: Partial Files, Up: Files + +File Format Conversion +====================== + + The variable `format-alist' defines a list of "file formats", which +describe textual representations used in files for the data (text, +text-properties, and possibly other information) in an Emacs buffer. +Emacs performs format conversion if appropriate when reading and writing +files. + + - Variable: format-alist + This list contains one format definition for each defined file + format. + + Each format definition is a list of this form: + + (NAME DOC-STRING REGEXP FROM-FN TO-FN MODIFY MODE-FN) + + Here is what the elements in a format definition mean: + +NAME + The name of this format. + +DOC-STRING + A documentation string for the format. + +REGEXP + A regular expression which is used to recognize files represented + in this format. + +FROM-FN + A function to call to decode data in this format (to convert file + data into the usual Emacs data representation). + + The FROM-FN is called with two args, BEGIN and END, which specify + the part of the buffer it should convert. It should convert the + text by editing it in place. Since this can change the length of + the text, FROM-FN should return the modified end position. + + One responsibility of FROM-FN is to make sure that the beginning + of the file no longer matches REGEXP. Otherwise it is likely to + get called again. + +TO-FN + A function to call to encode data in this format (to convert the + usual Emacs data representation into this format). + + The TO-FN is called with two args, BEGIN and END, which specify + the part of the buffer it should convert. There are two ways it + can do the conversion: + + * By editing the buffer in place. In this case, TO-FN should + return the end-position of the range of text, as modified. + + * By returning a list of annotations. This is a list of + elements of the form `(POSITION . STRING)', where POSITION is + an integer specifying the relative position in the text to be + written, and STRING is the annotation to add there. The list + must be sorted in order of position when TO-FN returns it. + + When `write-region' actually writes the text from the buffer + to the file, it intermixes the specified annotations at the + corresponding positions. All this takes place without + modifying the buffer. + +MODIFY + A flag, `t' if the encoding function modifies the buffer, and + `nil' if it works by returning a list of annotations. + +MODE + A mode function to call after visiting a file converted from this + format. + + The function `insert-file-contents' automatically recognizes file +formats when it reads the specified file. It checks the text of the +beginning of the file against the regular expressions of the format +definitions, and if it finds a match, it calls the decoding function for +that format. Then it checks all the known formats over again. It +keeps checking them until none of them is applicable. + + Visiting a file, with `find-file-noselect' or the commands that use +it, performs conversion likewise (because it calls +`insert-file-contents'); it also calls the mode function for each +format that it decodes. It stores a list of the format names in the +buffer-local variable `buffer-file-format'. + + - Variable: buffer-file-format + This variable states the format of the visited file. More + precisely, this is a list of the file format names that were + decoded in the course of visiting the current buffer's file. It + is always local in all buffers. + + When `write-region' writes data into a file, it first calls the +encoding functions for the formats listed in `buffer-file-format', in +the order of appearance in the list. + + - Function: format-write-file FILE FORMAT + This command writes the current buffer contents into the file FILE + in format FORMAT, and makes that format the default for future + saves of the buffer. The argument FORMAT is a list of format + names. + + - Function: format-find-file FILE FORMAT + This command finds the file FILE, converting it according to + format FORMAT. It also makes FORMAT the default if the buffer is + saved later. + + The argument FORMAT is a list of format names. If FORMAT is + `nil', no conversion takes place. Interactively, typing just + for FORMAT specifies `nil'. + + - Function: format-insert-file FILE FORMAT &optional BEG END + This command inserts the contents of file FILE, converting it + according to format FORMAT. If BEG and END are non-`nil', they + specify which part of the file to read, as in + `insert-file-contents' (*note Reading from Files::.). + + The return value is like what `insert-file-contents' returns: a + list of the absolute file name and the length of the data inserted + (after conversion). + + The argument FORMAT is a list of format names. If FORMAT is + `nil', no conversion takes place. Interactively, typing just + for FORMAT specifies `nil'. + + - Function: format-find-file FILE FORMAT + This command finds the file FILE, converting it according to + format FORMAT. It also makes FORMAT the default if the buffer is + saved later. + + The argument FORMAT is a list of format names. If FORMAT is + `nil', no conversion takes place. Interactively, typing just + for FORMAT specifies `nil'. + + - Function: format-insert-file FILE FORMAT &optional BEG END + This command inserts the contents of file FILE, converting it + according to format FORMAT. If BEG and END are non-`nil', they + specify which part of the file to read, as in + `insert-file-contents' (*note Reading from Files::.). + + The return value is like what `insert-file-contents' returns: a + list of the absolute file name and the length of the data inserted + (after conversion). + + The argument FORMAT is a list of format names. If FORMAT is + `nil', no conversion takes place. Interactively, typing just + for FORMAT specifies `nil'. + + - Variable: auto-save-file-format + This variable specifies the format to use for auto-saving. Its + value is a list of format names, just like the value of + `buffer-file-format'; but it is used instead of + `buffer-file-format' for writing auto-save files. This variable + is always local in all buffers. + diff --git a/info/lispref.info-24 b/info/lispref.info-24 new file mode 100644 index 0000000..1233bf9 --- /dev/null +++ b/info/lispref.info-24 @@ -0,0 +1,1186 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Files and MS-DOS, Prev: Format Conversion, Up: Files + +Files and MS-DOS +================ + + Emacs on MS-DOS makes a distinction between text files and binary +files. This is necessary because ordinary text files on MS-DOS use a +two character sequence between lines: carriage-return and linefeed +(CRLF). Emacs expects just a newline character (a linefeed) between +lines. When Emacs reads or writes a text file on MS-DOS, it needs to +convert the line separators. This means it needs to know which files +are text files and which are binary. It makes this decision when +visiting a file, and records the decision in the variable +`buffer-file-type' for use when the file is saved. + + *Note MS-DOS Subprocesses::, for a related feature for subprocesses. + + - Variable: buffer-file-type + This variable, automatically local in each buffer, records the + file type of the buffer's visited file. The value is `nil' for + text, `t' for binary. + + - Function: find-buffer-file-type FILENAME + This function determines whether file FILENAME is a text file or a + binary file. It returns `nil' for text, `t' for binary. + + - User Option: file-name-buffer-file-type-alist + This variable holds an alist for distinguishing text files from + binary files. Each element has the form (REGEXP . TYPE), where + REGEXP is matched against the file name, and TYPE may be is `nil' + for text, `t' for binary, or a function to call to compute which. + If it is a function, then it is called with a single argument (the + file name) and should return `t' or `nil'. + + - User Option: default-buffer-file-type + This variable specifies the default file type for files whose names + don't indicate anything in particular. Its value should be `nil' + for text, or `t' for binary. + + - Command: find-file-text FILENAME + Like `find-file', but treat the file as text regardless of its + name. + + - Command: find-file-binary FILENAME + Like `find-file', but treat the file as binary regardless of its + name. + + +File: lispref.info, Node: Backups and Auto-Saving, Next: Buffers, Prev: Files, Up: Top + +Backups and Auto-Saving +*********************** + + Backup files and auto-save files are two methods by which XEmacs +tries to protect the user from the consequences of crashes or of the +user's own errors. Auto-saving preserves the text from earlier in the +current editing session; backup files preserve file contents prior to +the current session. + +* Menu: + +* Backup Files:: How backup files are made; how their names are chosen. +* Auto-Saving:: How auto-save files are made; how their names are chosen. +* Reverting:: `revert-buffer', and how to customize what it does. + + +File: lispref.info, Node: Backup Files, Next: Auto-Saving, Up: Backups and Auto-Saving + +Backup Files +============ + + A "backup file" is a copy of the old contents of a file you are +editing. XEmacs makes a backup file the first time you save a buffer +into its visited file. Normally, this means that the backup file +contains the contents of the file as it was before the current editing +session. The contents of the backup file normally remain unchanged once +it exists. + + Backups are usually made by renaming the visited file to a new name. +Optionally, you can specify that backup files should be made by copying +the visited file. This choice makes a difference for files with +multiple names; it also can affect whether the edited file remains owned +by the original owner or becomes owned by the user editing it. + + By default, XEmacs makes a single backup file for each file edited. +You can alternatively request numbered backups; then each new backup +file gets a new name. You can delete old numbered backups when you +don't want them any more, or XEmacs can delete them automatically. + +* Menu: + +* Making Backups:: How XEmacs makes backup files, and when. +* Rename or Copy:: Two alternatives: renaming the old file or copying it. +* Numbered Backups:: Keeping multiple backups for each source file. +* Backup Names:: How backup file names are computed; customization. + + +File: lispref.info, Node: Making Backups, Next: Rename or Copy, Up: Backup Files + +Making Backup Files +------------------- + + - Function: backup-buffer + This function makes a backup of the file visited by the current + buffer, if appropriate. It is called by `save-buffer' before + saving the buffer the first time. + + - Variable: buffer-backed-up + This buffer-local variable indicates whether this buffer's file has + been backed up on account of this buffer. If it is non-`nil', then + the backup file has been written. Otherwise, the file should be + backed up when it is next saved (if backups are enabled). This is + a permanent local; `kill-local-variables' does not alter it. + + - User Option: make-backup-files + This variable determines whether or not to make backup files. If + it is non-`nil', then XEmacs creates a backup of each file when it + is saved for the first time--provided that `backup-inhibited' is + `nil' (see below). + + The following example shows how to change the `make-backup-files' + variable only in the `RMAIL' buffer and not elsewhere. Setting it + `nil' stops XEmacs from making backups of the `RMAIL' file, which + may save disk space. (You would put this code in your `.emacs' + file.) + + (add-hook 'rmail-mode-hook + (function (lambda () + (make-local-variable + 'make-backup-files) + (setq make-backup-files nil)))) + + - Variable: backup-enable-predicate + This variable's value is a function to be called on certain + occasions to decide whether a file should have backup files. The + function receives one argument, a file name to consider. If the + function returns `nil', backups are disabled for that file. + Otherwise, the other variables in this section say whether and how + to make backups. + + The default value is this: + + (lambda (name) + (or (< (length name) 5) + (not (string-equal "/tmp/" + (substring name 0 5))))) + + - Variable: backup-inhibited + If this variable is non-`nil', backups are inhibited. It records + the result of testing `backup-enable-predicate' on the visited file + name. It can also coherently be used by other mechanisms that + inhibit backups based on which file is visited. For example, VC + sets this variable non-`nil' to prevent making backups for files + managed with a version control system. + + This is a permanent local, so that changing the major mode does + not lose its value. Major modes should not set this + variable--they should set `make-backup-files' instead. + + +File: lispref.info, Node: Rename or Copy, Next: Numbered Backups, Prev: Making Backups, Up: Backup Files + +Backup by Renaming or by Copying? +--------------------------------- + + There are two ways that XEmacs can make a backup file: + + * XEmacs can rename the original file so that it becomes a backup + file, and then write the buffer being saved into a new file. + After this procedure, any other names (i.e., hard links) of the + original file now refer to the backup file. The new file is owned + by the user doing the editing, and its group is the default for + new files written by the user in that directory. + + * XEmacs can copy the original file into a backup file, and then + overwrite the original file with new contents. After this + procedure, any other names (i.e., hard links) of the original file + still refer to the current version of the file. The file's owner + and group will be unchanged. + + The first method, renaming, is the default. + + The variable `backup-by-copying', if non-`nil', says to use the +second method, which is to copy the original file and overwrite it with +the new buffer contents. The variable `file-precious-flag', if +non-`nil', also has this effect (as a sideline of its main +significance). *Note Saving Buffers::. + + - Variable: backup-by-copying + If this variable is non-`nil', XEmacs always makes backup files by + copying. + + The following two variables, when non-`nil', cause the second method +to be used in certain special cases. They have no effect on the +treatment of files that don't fall into the special cases. + + - Variable: backup-by-copying-when-linked + If this variable is non-`nil', XEmacs makes backups by copying for + files with multiple names (hard links). + + This variable is significant only if `backup-by-copying' is `nil', + since copying is always used when that variable is non-`nil'. + + - Variable: backup-by-copying-when-mismatch + If this variable is non-`nil', XEmacs makes backups by copying in + cases where renaming would change either the owner or the group of + the file. + + The value has no effect when renaming would not alter the owner or + group of the file; that is, for files which are owned by the user + and whose group matches the default for a new file created there + by the user. + + This variable is significant only if `backup-by-copying' is `nil', + since copying is always used when that variable is non-`nil'. + + +File: lispref.info, Node: Numbered Backups, Next: Backup Names, Prev: Rename or Copy, Up: Backup Files + +Making and Deleting Numbered Backup Files +----------------------------------------- + + If a file's name is `foo', the names of its numbered backup versions +are `foo.~V~', for various integers V, like this: `foo.~1~', `foo.~2~', +`foo.~3~', ..., `foo.~259~', and so on. + + - User Option: version-control + This variable controls whether to make a single non-numbered backup + file or multiple numbered backups. + + `nil' + Make numbered backups if the visited file already has + numbered backups; otherwise, do not. + + `never' + Do not make numbered backups. + + ANYTHING ELSE + Make numbered backups. + + The use of numbered backups ultimately leads to a large number of +backup versions, which must then be deleted. XEmacs can do this +automatically or it can ask the user whether to delete them. + + - User Option: kept-new-versions + The value of this variable is the number of newest versions to keep + when a new numbered backup is made. The newly made backup is + included in the count. The default value is 2. + + - User Option: kept-old-versions + The value of this variable is the number of oldest versions to keep + when a new numbered backup is made. The default value is 2. + + If there are backups numbered 1, 2, 3, 5, and 7, and both of these +variables have the value 2, then the backups numbered 1 and 2 are kept +as old versions and those numbered 5 and 7 are kept as new versions; +backup version 3 is excess. The function `find-backup-file-name' +(*note Backup Names::.) is responsible for determining which backup +versions to delete, but does not delete them itself. + + - User Option: trim-versions-without-asking + If this variable is non-`nil', then saving a file deletes excess + backup versions silently. Otherwise, it asks the user whether to + delete them. + + - User Option: dired-kept-versions + This variable specifies how many of the newest backup versions to + keep in the Dired command `.' (`dired-clean-directory'). That's + the same thing `kept-new-versions' specifies when you make a new + backup file. The default value is 2. + + +File: lispref.info, Node: Backup Names, Prev: Numbered Backups, Up: Backup Files + +Naming Backup Files +------------------- + + The functions in this section are documented mainly because you can +customize the naming conventions for backup files by redefining them. +If you change one, you probably need to change the rest. + + - Function: backup-file-name-p FILENAME + This function returns a non-`nil' value if FILENAME is a possible + name for a backup file. A file with the name FILENAME need not + exist; the function just checks the name. + + (backup-file-name-p "foo") + => nil + + (backup-file-name-p "foo~") + => 3 + + The standard definition of this function is as follows: + + (defun backup-file-name-p (file) + "Return non-nil if FILE is a backup file \ + name (numeric or not)..." + (string-match "~$" file)) + + Thus, the function returns a non-`nil' value if the file name ends + with a `~'. (We use a backslash to split the documentation + string's first line into two lines in the text, but produce just + one line in the string itself.) + + This simple expression is placed in a separate function to make it + easy to redefine for customization. + + - Function: make-backup-file-name FILENAME + This function returns a string that is the name to use for a + non-numbered backup file for file FILENAME. On Unix, this is just + FILENAME with a tilde appended. + + The standard definition of this function is as follows: + + (defun make-backup-file-name (file) + "Create the non-numeric backup file name for FILE. + ..." + (concat file "~")) + + You can change the backup-file naming convention by redefining this + function. The following example redefines `make-backup-file-name' + to prepend a `.' in addition to appending a tilde: + + (defun make-backup-file-name (filename) + (concat "." filename "~")) + + (make-backup-file-name "backups.texi") + => ".backups.texi~" + + - Function: find-backup-file-name FILENAME + This function computes the file name for a new backup file for + FILENAME. It may also propose certain existing backup files for + deletion. `find-backup-file-name' returns a list whose CAR is the + name for the new backup file and whose CDR is a list of backup + files whose deletion is proposed. + + Two variables, `kept-old-versions' and `kept-new-versions', + determine which backup versions should be kept. This function + keeps those versions by excluding them from the CDR of the value. + *Note Numbered Backups::. + + In this example, the value says that `~rms/foo.~5~' is the name to + use for the new backup file, and `~rms/foo.~3~' is an "excess" + version that the caller should consider deleting now. + + (find-backup-file-name "~rms/foo") + => ("~rms/foo.~5~" "~rms/foo.~3~") + + - Function: file-newest-backup FILENAME + This function returns the name of the most recent backup file for + FILENAME, or `nil' if that file has no backup files. + + Some file comparison commands use this function so that they can + automatically compare a file with its most recent backup. + + +File: lispref.info, Node: Auto-Saving, Next: Reverting, Prev: Backup Files, Up: Backups and Auto-Saving + +Auto-Saving +=========== + + XEmacs periodically saves all files that you are visiting; this is +called "auto-saving". Auto-saving prevents you from losing more than a +limited amount of work if the system crashes. By default, auto-saves +happen every 300 keystrokes, or after around 30 seconds of idle time. +*Note Auto-Save: (emacs)Auto-Save, for information on auto-save for +users. Here we describe the functions used to implement auto-saving +and the variables that control them. + + - Variable: buffer-auto-save-file-name + This buffer-local variable is the name of the file used for + auto-saving the current buffer. It is `nil' if the buffer should + not be auto-saved. + + buffer-auto-save-file-name + => "/xcssun/users/rms/lewis/#files.texi#" + + - Command: auto-save-mode ARG + When used interactively without an argument, this command is a + toggle switch: it turns on auto-saving of the current buffer if it + is off, and vice-versa. With an argument ARG, the command turns + auto-saving on if the value of ARG is `t', a nonempty list, or a + positive integer. Otherwise, it turns auto-saving off. + + - Function: auto-save-file-name-p FILENAME + This function returns a non-`nil' value if FILENAME is a string + that could be the name of an auto-save file. It works based on + knowledge of the naming convention for auto-save files: a name that + begins and ends with hash marks (`#') is a possible auto-save file + name. The argument FILENAME should not contain a directory part. + + (make-auto-save-file-name) + => "/xcssun/users/rms/lewis/#files.texi#" + (auto-save-file-name-p "#files.texi#") + => 0 + (auto-save-file-name-p "files.texi") + => nil + + The standard definition of this function is as follows: + + (defun auto-save-file-name-p (filename) + "Return non-nil if FILENAME can be yielded by..." + (string-match "^#.*#$" filename)) + + This function exists so that you can customize it if you wish to + change the naming convention for auto-save files. If you redefine + it, be sure to redefine the function `make-auto-save-file-name' + correspondingly. + + - Function: make-auto-save-file-name + This function returns the file name to use for auto-saving the + current buffer. This is just the file name with hash marks (`#') + appended and prepended to it. This function does not look at the + variable `auto-save-visited-file-name' (described below); you + should check that before calling this function. + + (make-auto-save-file-name) + => "/xcssun/users/rms/lewis/#backup.texi#" + + The standard definition of this function is as follows: + + (defun make-auto-save-file-name () + "Return file name to use for auto-saves \ + of current buffer. + ..." + (if buffer-file-name + (concat + (file-name-directory buffer-file-name) + "#" + (file-name-nondirectory buffer-file-name) + "#") + (expand-file-name + (concat "#%" (buffer-name) "#")))) + + This exists as a separate function so that you can redefine it to + customize the naming convention for auto-save files. Be sure to + change `auto-save-file-name-p' in a corresponding way. + + - Variable: auto-save-visited-file-name + If this variable is non-`nil', XEmacs auto-saves buffers in the + files they are visiting. That is, the auto-save is done in the + same file that you are editing. Normally, this variable is `nil', + so auto-save files have distinct names that are created by + `make-auto-save-file-name'. + + When you change the value of this variable, the value does not take + effect until the next time auto-save mode is reenabled in any given + buffer. If auto-save mode is already enabled, auto-saves continue + to go in the same file name until `auto-save-mode' is called again. + + - Function: recent-auto-save-p + This function returns `t' if the current buffer has been + auto-saved since the last time it was read in or saved. + + - Function: set-buffer-auto-saved + This function marks the current buffer as auto-saved. The buffer + will not be auto-saved again until the buffer text is changed + again. The function returns `nil'. + + - User Option: auto-save-interval + The value of this variable is the number of characters that XEmacs + reads from the keyboard between auto-saves. Each time this many + more characters are read, auto-saving is done for all buffers in + which it is enabled. + + - User Option: auto-save-timeout + The value of this variable is the number of seconds of idle time + that should cause auto-saving. Each time the user pauses for this + long, XEmacs auto-saves any buffers that need it. (Actually, the + specified timeout is multiplied by a factor depending on the size + of the current buffer.) + + - Variable: auto-save-hook + This normal hook is run whenever an auto-save is about to happen. + + - User Option: auto-save-default + If this variable is non-`nil', buffers that are visiting files + have auto-saving enabled by default. Otherwise, they do not. + + - Command: do-auto-save &optional NO-MESSAGE CURRENT-ONLY + This function auto-saves all buffers that need to be auto-saved. + It saves all buffers for which auto-saving is enabled and that + have been changed since the previous auto-save. + + Normally, if any buffers are auto-saved, a message that says + `Auto-saving...' is displayed in the echo area while auto-saving is + going on. However, if NO-MESSAGE is non-`nil', the message is + inhibited. + + If CURRENT-ONLY is non-`nil', only the current buffer is + auto-saved. + + - Function: delete-auto-save-file-if-necessary + This function deletes the current buffer's auto-save file if + `delete-auto-save-files' is non-`nil'. It is called every time a + buffer is saved. + + - Variable: delete-auto-save-files + This variable is used by the function + `delete-auto-save-file-if-necessary'. If it is non-`nil', Emacs + deletes auto-save files when a true save is done (in the visited + file). This saves disk space and unclutters your directory. + + - Function: rename-auto-save-file + This function adjusts the current buffer's auto-save file name if + the visited file name has changed. It also renames an existing + auto-save file. If the visited file name has not changed, this + function does nothing. + + - Variable: buffer-saved-size + The value of this buffer-local variable is the length of the + current buffer as of the last time it was read in, saved, or + auto-saved. This is used to detect a substantial decrease in + size, and turn off auto-saving in response. + + If it is -1, that means auto-saving is temporarily shut off in this + buffer due to a substantial deletion. Explicitly saving the buffer + stores a positive value in this variable, thus reenabling + auto-saving. Turning auto-save mode off or on also alters this + variable. + + - Variable: auto-save-list-file-name + This variable (if non-`nil') specifies a file for recording the + names of all the auto-save files. Each time XEmacs does + auto-saving, it writes two lines into this file for each buffer + that has auto-saving enabled. The first line gives the name of + the visited file (it's empty if the buffer has none), and the + second gives the name of the auto-save file. + + If XEmacs exits normally, it deletes this file. If XEmacs + crashes, you can look in the file to find all the auto-save files + that might contain work that was otherwise lost. The + `recover-session' command uses these files. + + The default name for this file is in your home directory and + starts with `.saves-'. It also contains the XEmacs process ID and + the host name. + + +File: lispref.info, Node: Reverting, Prev: Auto-Saving, Up: Backups and Auto-Saving + +Reverting +========= + + If you have made extensive changes to a file and then change your +mind about them, you can get rid of them by reading in the previous +version of the file with the `revert-buffer' command. *Note Reverting +a Buffer: (emacs)Reverting. + + - Command: revert-buffer &optional CHECK-AUTO-SAVE NOCONFIRM + This command replaces the buffer text with the text of the visited + file on disk. This action undoes all changes since the file was + visited or saved. + + If the argument CHECK-AUTO-SAVE is non-`nil', and the latest + auto-save file is more recent than the visited file, + `revert-buffer' asks the user whether to use that instead. + Otherwise, it always uses the text of the visited file itself. + Interactively, CHECK-AUTO-SAVE is set if there is a numeric prefix + argument. + + Normally, `revert-buffer' asks for confirmation before it changes + the buffer; but if the argument NOCONFIRM is non-`nil', + `revert-buffer' does not ask for confirmation. + + Reverting tries to preserve marker positions in the buffer by + using the replacement feature of `insert-file-contents'. If the + buffer contents and the file contents are identical before the + revert operation, reverting preserves all the markers. If they + are not identical, reverting does change the buffer; then it + preserves the markers in the unchanged text (if any) at the + beginning and end of the buffer. Preserving any additional + markers would be problematical. + + You can customize how `revert-buffer' does its work by setting these +variables--typically, as buffer-local variables. + + - Variable: revert-buffer-function + The value of this variable is the function to use to revert this + buffer. If non-`nil', it is called as a function with no + arguments to do the work of reverting. If the value is `nil', + reverting works the usual way. + + Modes such as Dired mode, in which the text being edited does not + consist of a file's contents but can be regenerated in some other + fashion, give this variable a buffer-local value that is a + function to regenerate the contents. + + - Variable: revert-buffer-insert-file-contents-function + The value of this variable, if non-`nil', is the function to use to + insert the updated contents when reverting this buffer. The + function receives two arguments: first the file name to use; + second, `t' if the user has asked to read the auto-save file. + + - Variable: before-revert-hook + This normal hook is run by `revert-buffer' before actually + inserting the modified contents--but only if + `revert-buffer-function' is `nil'. + + Font Lock mode uses this hook to record that the buffer contents + are no longer fontified. + + - Variable: after-revert-hook + This normal hook is run by `revert-buffer' after actually inserting + the modified contents--but only if `revert-buffer-function' is + `nil'. + + Font Lock mode uses this hook to recompute the fonts for the + updated buffer contents. + + +File: lispref.info, Node: Buffers, Next: Windows, Prev: Backups and Auto-Saving, Up: Top + +Buffers +******* + + A "buffer" is a Lisp object containing text to be edited. Buffers +are used to hold the contents of files that are being visited; there may +also be buffers that are not visiting files. While several buffers may +exist at one time, exactly one buffer is designated the "current +buffer" at any time. Most editing commands act on the contents of the +current buffer. Each buffer, including the current buffer, may or may +not be displayed in any windows. + +* Menu: + +* Buffer Basics:: What is a buffer? +* Current Buffer:: Designating a buffer as current + so primitives will access its contents. +* Buffer Names:: Accessing and changing buffer names. +* Buffer File Name:: The buffer file name indicates which file is visited. +* Buffer Modification:: A buffer is "modified" if it needs to be saved. +* Modification Time:: Determining whether the visited file was changed + "behind XEmacs's back". +* Read Only Buffers:: Modifying text is not allowed in a read-only buffer. +* The Buffer List:: How to look at all the existing buffers. +* Creating Buffers:: Functions that create buffers. +* Killing Buffers:: Buffers exist until explicitly killed. +* Indirect Buffers:: An indirect buffer shares text with some other buffer. + + +File: lispref.info, Node: Buffer Basics, Next: Current Buffer, Up: Buffers + +Buffer Basics +============= + + A "buffer" is a Lisp object containing text to be edited. Buffers +are used to hold the contents of files that are being visited; there may +also be buffers that are not visiting files. While several buffers may +exist at one time, exactly one buffer is designated the "current +buffer" at any time. Most editing commands act on the contents of the +current buffer. Each buffer, including the current buffer, may or may +not be displayed in any windows. + + Buffers in Emacs editing are objects that have distinct names and +hold text that can be edited. Buffers appear to Lisp programs as a +special data type. You can think of the contents of a buffer as an +extendable string; insertions and deletions may occur in any part of +the buffer. *Note Text::. + + A Lisp buffer object contains numerous pieces of information. Some +of this information is directly accessible to the programmer through +variables, while other information is accessible only through +special-purpose functions. For example, the visited file name is +directly accessible through a variable, while the value of point is +accessible only through a primitive function. + + Buffer-specific information that is directly accessible is stored in +"buffer-local" variable bindings, which are variable values that are +effective only in a particular buffer. This feature allows each buffer +to override the values of certain variables. Most major modes override +variables such as `fill-column' or `comment-column' in this way. For +more information about buffer-local variables and functions related to +them, see *Note Buffer-Local Variables::. + + For functions and variables related to visiting files in buffers, see +*Note Visiting Files:: and *Note Saving Buffers::. For functions and +variables related to the display of buffers in windows, see *Note +Buffers and Windows::. + + - Function: bufferp OBJECT + This function returns `t' if OBJECT is a buffer, `nil' otherwise. + + +File: lispref.info, Node: Current Buffer, Next: Buffer Names, Prev: Buffer Basics, Up: Buffers + +The Current Buffer +================== + + There are, in general, many buffers in an Emacs session. At any +time, one of them is designated as the "current buffer". This is the +buffer in which most editing takes place, because most of the primitives +for examining or changing text in a buffer operate implicitly on the +current buffer (*note Text::.). Normally the buffer that is displayed +on the screen in the selected window is the current buffer, but this is +not always so: a Lisp program can designate any buffer as current +temporarily in order to operate on its contents, without changing what +is displayed on the screen. + + The way to designate a current buffer in a Lisp program is by calling +`set-buffer'. The specified buffer remains current until a new one is +designated. + + When an editing command returns to the editor command loop, the +command loop designates the buffer displayed in the selected window as +current, to prevent confusion: the buffer that the cursor is in when +Emacs reads a command is the buffer that the command will apply to. +(*Note Command Loop::.) Therefore, `set-buffer' is not the way to +switch visibly to a different buffer so that the user can edit it. For +this, you must use the functions described in *Note Displaying +Buffers::. + + However, Lisp functions that change to a different current buffer +should not depend on the command loop to set it back afterwards. +Editing commands written in XEmacs Lisp can be called from other +programs as well as from the command loop. It is convenient for the +caller if the subroutine does not change which buffer is current +(unless, of course, that is the subroutine's purpose). Therefore, you +should normally use `set-buffer' within a `save-excursion' that will +restore the current buffer when your function is done (*note +Excursions::.). Here is an example, the code for the command +`append-to-buffer' (with the documentation string abridged): + + (defun append-to-buffer (buffer start end) + "Append to specified buffer the text of the region. + ..." + (interactive "BAppend to buffer: \nr") + (let ((oldbuf (current-buffer))) + (save-excursion + (set-buffer (get-buffer-create buffer)) + (insert-buffer-substring oldbuf start end)))) + +This function binds a local variable to the current buffer, and then +`save-excursion' records the values of point, the mark, and the +original buffer. Next, `set-buffer' makes another buffer current. +Finally, `insert-buffer-substring' copies the string from the original +current buffer to the new current buffer. + + If the buffer appended to happens to be displayed in some window, +the next redisplay will show how its text has changed. Otherwise, you +will not see the change immediately on the screen. The buffer becomes +current temporarily during the execution of the command, but this does +not cause it to be displayed. + + If you make local bindings (with `let' or function arguments) for a +variable that may also have buffer-local bindings, make sure that the +same buffer is current at the beginning and at the end of the local +binding's scope. Otherwise you might bind it in one buffer and unbind +it in another! There are two ways to do this. In simple cases, you may +see that nothing ever changes the current buffer within the scope of the +binding. Otherwise, use `save-excursion' to make sure that the buffer +current at the beginning is current again whenever the variable is +unbound. + + It is not reliable to change the current buffer back with +`set-buffer', because that won't do the job if a quit happens while the +wrong buffer is current. Here is what *not* to do: + + (let (buffer-read-only + (obuf (current-buffer))) + (set-buffer ...) + ... + (set-buffer obuf)) + +Using `save-excursion', as shown below, handles quitting, errors, and +`throw', as well as ordinary evaluation. + + (let (buffer-read-only) + (save-excursion + (set-buffer ...) + ...)) + + - Function: current-buffer + This function returns the current buffer. + + (current-buffer) + => # + + - Function: set-buffer BUFFER-OR-NAME + This function makes BUFFER-OR-NAME the current buffer. It does + not display the buffer in the currently selected window or in any + other window, so the user cannot necessarily see the buffer. But + Lisp programs can in any case work on it. + + This function returns the buffer identified by BUFFER-OR-NAME. An + error is signaled if BUFFER-OR-NAME does not identify an existing + buffer. + + +File: lispref.info, Node: Buffer Names, Next: Buffer File Name, Prev: Current Buffer, Up: Buffers + +Buffer Names +============ + + Each buffer has a unique name, which is a string. Many of the +functions that work on buffers accept either a buffer or a buffer name +as an argument. Any argument called BUFFER-OR-NAME is of this sort, +and an error is signaled if it is neither a string nor a buffer. Any +argument called BUFFER must be an actual buffer object, not a name. + + Buffers that are ephemeral and generally uninteresting to the user +have names starting with a space, so that the `list-buffers' and +`buffer-menu' commands don't mention them. A name starting with space +also initially disables recording undo information; see *Note Undo::. + + - Function: buffer-name &optional BUFFER + This function returns the name of BUFFER as a string. If BUFFER + is not supplied, it defaults to the current buffer. + + If `buffer-name' returns `nil', it means that BUFFER has been + killed. *Note Killing Buffers::. + + (buffer-name) + => "buffers.texi" + + (setq foo (get-buffer "temp")) + => # + (kill-buffer foo) + => nil + (buffer-name foo) + => nil + foo + => # + + - Command: rename-buffer NEWNAME &optional UNIQUE + This function renames the current buffer to NEWNAME. An error is + signaled if NEWNAME is not a string, or if there is already a + buffer with that name. The function returns `nil'. + + Ordinarily, `rename-buffer' signals an error if NEWNAME is already + in use. However, if UNIQUE is non-`nil', it modifies NEWNAME to + make a name that is not in use. Interactively, you can make + UNIQUE non-`nil' with a numeric prefix argument. + + One application of this command is to rename the `*shell*' buffer + to some other name, thus making it possible to create a second + shell buffer under the name `*shell*'. + + - Function: get-buffer BUFFER-OR-NAME + This function returns the buffer specified by BUFFER-OR-NAME. If + BUFFER-OR-NAME is a string and there is no buffer with that name, + the value is `nil'. If BUFFER-OR-NAME is a buffer, it is returned + as given. (That is not very useful, so the argument is usually a + name.) For example: + + (setq b (get-buffer "lewis")) + => # + (get-buffer b) + => # + (get-buffer "Frazzle-nots") + => nil + + See also the function `get-buffer-create' in *Note Creating + Buffers::. + + - Function: generate-new-buffer-name STARTING-NAME &optional IGNORE + This function returns a name that would be unique for a new + buffer--but does not create the buffer. It starts with + STARTING-NAME, and produces a name not currently in use for any + buffer by appending a number inside of `<...>'. + + If IGNORE is given, it specifies a name that is okay to use (if it + is in the sequence to be tried), even if a buffer with that name + exists. + + See the related function `generate-new-buffer' in *Note Creating + Buffers::. + + +File: lispref.info, Node: Buffer File Name, Next: Buffer Modification, Prev: Buffer Names, Up: Buffers + +Buffer File Name +================ + + The "buffer file name" is the name of the file that is visited in +that buffer. When a buffer is not visiting a file, its buffer file name +is `nil'. Most of the time, the buffer name is the same as the +nondirectory part of the buffer file name, but the buffer file name and +the buffer name are distinct and can be set independently. *Note +Visiting Files::. + + - Function: buffer-file-name &optional BUFFER + This function returns the absolute file name of the file that + BUFFER is visiting. If BUFFER is not visiting any file, + `buffer-file-name' returns `nil'. If BUFFER is not supplied, it + defaults to the current buffer. + + (buffer-file-name (other-buffer)) + => "/usr/user/lewis/manual/files.texi" + + - Variable: buffer-file-name + This buffer-local variable contains the name of the file being + visited in the current buffer, or `nil' if it is not visiting a + file. It is a permanent local, unaffected by + `kill-local-variables'. + + buffer-file-name + => "/usr/user/lewis/manual/buffers.texi" + + It is risky to change this variable's value without doing various + other things. See the definition of `set-visited-file-name' in + `files.el'; some of the things done there, such as changing the + buffer name, are not strictly necessary, but others are essential + to avoid confusing XEmacs. + + - Variable: buffer-file-truename + This buffer-local variable holds the truename of the file visited + in the current buffer, or `nil' if no file is visited. It is a + permanent local, unaffected by `kill-local-variables'. *Note + Truenames::. + + - Variable: buffer-file-number + This buffer-local variable holds the file number and directory + device number of the file visited in the current buffer, or `nil' + if no file or a nonexistent file is visited. It is a permanent + local, unaffected by `kill-local-variables'. *Note Truenames::. + + The value is normally a list of the form `(FILENUM DEVNUM)'. This + pair of numbers uniquely identifies the file among all files + accessible on the system. See the function `file-attributes', in + *Note File Attributes::, for more information about them. + + - Function: get-file-buffer FILENAME + This function returns the buffer visiting file FILENAME. If there + is no such buffer, it returns `nil'. The argument FILENAME, which + must be a string, is expanded (*note File Name Expansion::.), then + compared against the visited file names of all live buffers. + + (get-file-buffer "buffers.texi") + => # + + In unusual circumstances, there can be more than one buffer + visiting the same file name. In such cases, this function returns + the first such buffer in the buffer list. + + - Command: set-visited-file-name FILENAME + If FILENAME is a non-empty string, this function changes the name + of the file visited in current buffer to FILENAME. (If the buffer + had no visited file, this gives it one.) The *next time* the + buffer is saved it will go in the newly-specified file. This + command marks the buffer as modified, since it does not (as far as + XEmacs knows) match the contents of FILENAME, even if it matched + the former visited file. + + If FILENAME is `nil' or the empty string, that stands for "no + visited file". In this case, `set-visited-file-name' marks the + buffer as having no visited file. + + When the function `set-visited-file-name' is called interactively, + it prompts for FILENAME in the minibuffer. + + See also `clear-visited-file-modtime' and + `verify-visited-file-modtime' in *Note Buffer Modification::. + + - Variable: list-buffers-directory + This buffer-local variable records a string to display in a buffer + listing in place of the visited file name, for buffers that don't + have a visited file name. Dired buffers use this variable. + + +File: lispref.info, Node: Buffer Modification, Next: Modification Time, Prev: Buffer File Name, Up: Buffers + +Buffer Modification +=================== + + XEmacs keeps a flag called the "modified flag" for each buffer, to +record whether you have changed the text of the buffer. This flag is +set to `t' whenever you alter the contents of the buffer, and cleared +to `nil' when you save it. Thus, the flag shows whether there are +unsaved changes. The flag value is normally shown in the modeline +(*note Modeline Variables::.), and controls saving (*note Saving +Buffers::.) and auto-saving (*note Auto-Saving::.). + + Some Lisp programs set the flag explicitly. For example, the +function `set-visited-file-name' sets the flag to `t', because the text +does not match the newly-visited file, even if it is unchanged from the +file formerly visited. + + The functions that modify the contents of buffers are described in +*Note Text::. + + - Function: buffer-modified-p &optional BUFFER + This function returns `t' if the buffer BUFFER has been modified + since it was last read in from a file or saved, or `nil' + otherwise. If BUFFER is not supplied, the current buffer is + tested. + + - Function: set-buffer-modified-p FLAG + This function marks the current buffer as modified if FLAG is + non-`nil', or as unmodified if the flag is `nil'. + + Another effect of calling this function is to cause unconditional + redisplay of the modeline for the current buffer. In fact, the + function `redraw-modeline' works by doing this: + + (set-buffer-modified-p (buffer-modified-p)) + + - Command: not-modified &optional ARG + This command marks the current buffer as unmodified, and not + needing to be saved. (If ARG is non-`nil', the buffer is instead + marked as modified.) Don't use this function in programs, since it + prints a message in the echo area; use `set-buffer-modified-p' + (above) instead. + + - Function: buffer-modified-tick &optional BUFFER + This function returns BUFFER`s modification-count. This is a + counter that increments every time the buffer is modified. If + BUFFER is `nil' (or omitted), the current buffer is used. + + +File: lispref.info, Node: Modification Time, Next: Read Only Buffers, Prev: Buffer Modification, Up: Buffers + +Comparison of Modification Time +=============================== + + Suppose that you visit a file and make changes in its buffer, and +meanwhile the file itself is changed on disk. At this point, saving the +buffer would overwrite the changes in the file. Occasionally this may +be what you want, but usually it would lose valuable information. +XEmacs therefore checks the file's modification time using the functions +described below before saving the file. + + - Function: verify-visited-file-modtime BUFFER + This function compares what BUFFER has recorded for the + modification time of its visited file against the actual + modification time of the file as recorded by the operating system. + The two should be the same unless some other process has written + the file since XEmacs visited or saved it. + + The function returns `t' if the last actual modification time and + XEmacs's recorded modification time are the same, `nil' otherwise. + + - Function: clear-visited-file-modtime + This function clears out the record of the last modification time + of the file being visited by the current buffer. As a result, the + next attempt to save this buffer will not complain of a + discrepancy in file modification times. + + This function is called in `set-visited-file-name' and other + exceptional places where the usual test to avoid overwriting a + changed file should not be done. + + - Function: visited-file-modtime + This function returns the buffer's recorded last file modification + time, as a list of the form `(HIGH . LOW)'. (This is the same + format that `file-attributes' uses to return time values; see + *Note File Attributes::.) + + - Function: set-visited-file-modtime &optional TIME + This function updates the buffer's record of the last modification + time of the visited file, to the value specified by TIME if TIME + is not `nil', and otherwise to the last modification time of the + visited file. + + If TIME is not `nil', it should have the form `(HIGH . LOW)' or + `(HIGH LOW)', in either case containing two integers, each of + which holds 16 bits of the time. + + This function is useful if the buffer was not read from the file + normally, or if the file itself has been changed for some known + benign reason. + + - Function: ask-user-about-supersession-threat FILENAME + This function is used to ask a user how to proceed after an + attempt to modify an obsolete buffer visiting file FILENAME. An + "obsolete buffer" is an unmodified buffer for which the associated + file on disk is newer than the last save-time of the buffer. This + means some other program has probably altered the file. + + Depending on the user's answer, the function may return normally, + in which case the modification of the buffer proceeds, or it may + signal a `file-supersession' error with data `(FILENAME)', in which + case the proposed buffer modification is not allowed. + + This function is called automatically by XEmacs on the proper + occasions. It exists so you can customize XEmacs by redefining it. + See the file `userlock.el' for the standard definition. + + See also the file locking mechanism in *Note File Locks::. + + +File: lispref.info, Node: Read Only Buffers, Next: The Buffer List, Prev: Modification Time, Up: Buffers + +Read-Only Buffers +================= + + If a buffer is "read-only", then you cannot change its contents, +although you may change your view of the contents by scrolling and +narrowing. + + Read-only buffers are used in two kinds of situations: + + * A buffer visiting a write-protected file is normally read-only. + + Here, the purpose is to show the user that editing the buffer with + the aim of saving it in the file may be futile or undesirable. + The user who wants to change the buffer text despite this can do + so after clearing the read-only flag with `C-x C-q'. + + * Modes such as Dired and Rmail make buffers read-only when altering + the contents with the usual editing commands is probably a mistake. + + The special commands of these modes bind `buffer-read-only' to + `nil' (with `let') or bind `inhibit-read-only' to `t' around the + places where they change the text. + + - Variable: buffer-read-only + This buffer-local variable specifies whether the buffer is + read-only. The buffer is read-only if this variable is non-`nil'. + + - Variable: inhibit-read-only + If this variable is non-`nil', then read-only buffers and read-only + characters may be modified. Read-only characters in a buffer are + those that have non-`nil' `read-only' properties (either text + properties or extent properties). *Note Extent Properties::, for + more information about text properties and extent properties. + + If `inhibit-read-only' is `t', all `read-only' character + properties have no effect. If `inhibit-read-only' is a list, then + `read-only' character properties have no effect if they are members + of the list (comparison is done with `eq'). + + - Command: toggle-read-only + This command changes whether the current buffer is read-only. It + is intended for interactive use; don't use it in programs. At any + given point in a program, you should know whether you want the + read-only flag on or off; so you can set `buffer-read-only' + explicitly to the proper value, `t' or `nil'. + + - Function: barf-if-buffer-read-only + This function signals a `buffer-read-only' error if the current + buffer is read-only. *Note Interactive Call::, for another way to + signal an error if the current buffer is read-only. + diff --git a/info/lispref.info-25 b/info/lispref.info-25 new file mode 100644 index 0000000..42513cf --- /dev/null +++ b/info/lispref.info-25 @@ -0,0 +1,1219 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: The Buffer List, Next: Creating Buffers, Prev: Read Only Buffers, Up: Buffers + +The Buffer List +=============== + + The "buffer list" is a list of all live buffers. Creating a buffer +adds it to this list, and killing a buffer deletes it. The order of +the buffers in the list is based primarily on how recently each buffer +has been displayed in the selected window. Buffers move to the front +of the list when they are selected and to the end when they are buried. +Several functions, notably `other-buffer', use this ordering. A +buffer list displayed for the user also follows this order. + + Every frame has its own order for the buffer list. Switching to a +new buffer inside of a particular frame changes the buffer list order +for that frame, but does not affect the buffer list order of any other +frames. In addition, there is a global, non-frame buffer list order +that is independent of the buffer list orders for any particular frame. + + Note that the different buffer lists all contain the same elements. +It is only the order of those elements that is different. + + - Function: buffer-list &optional FRAME + This function returns a list of all buffers, including those whose + names begin with a space. The elements are actual buffers, not + their names. The order of the list is specific to FRAME, which + defaults to the current frame. If FRAME is `t', the global, + non-frame ordering is returned instead. + + (buffer-list) + => (# + # # + # #) + + ;; Note that the name of the minibuffer + ;; begins with a space! + (mapcar (function buffer-name) (buffer-list)) + => ("buffers.texi" " *Minibuf-1*" + "buffer.c" "*Help*" "TAGS") + + Buffers appear earlier in the list if they were current more + recently. + + This list is a copy of a list used inside XEmacs; modifying it has + no effect on the buffers. + + - Function: other-buffer &optional BUFFER-OR-NAME FRAME VISIBLE-OK + This function returns the first buffer in the buffer list other + than BUFFER-OR-NAME, in FRAME's ordering for the buffer list. + (FRAME defaults to the current frame. If FRAME is `t', then the + global, non-frame ordering is used.) Usually this is the buffer + most recently shown in the selected window, aside from + BUFFER-OR-NAME. Buffers are moved to the front of the list when + they are selected and to the end when they are buried. Buffers + whose names start with a space are not considered. + + If BUFFER-OR-NAME is not supplied (or if it is not a buffer), then + `other-buffer' returns the first buffer on the buffer list that is + not visible in any window in a visible frame. + + If the selected frame has a non-`nil' `buffer-predicate' property, + then `other-buffer' uses that predicate to decide which buffers to + consider. It calls the predicate once for each buffer, and if the + value is `nil', that buffer is ignored. *Note X Frame + Properties::. + + If VISIBLE-OK is `nil', `other-buffer' avoids returning a buffer + visible in any window on any visible frame, except as a last + resort. If VISIBLE-OK is non-`nil', then it does not matter + whether a buffer is displayed somewhere or not. + + If no suitable buffer exists, the buffer `*scratch*' is returned + (and created, if necessary). + + Note that in FSF Emacs 19, there is no FRAME argument, and + VISIBLE-OK is the second argument instead of the third. FSF Emacs + 19. + + - Command: list-buffers &optional FILES-ONLY + This function displays a listing of the names of existing buffers. + It clears the buffer `*Buffer List*', then inserts the listing + into that buffer and displays it in a window. `list-buffers' is + intended for interactive use, and is described fully in `The XEmacs + Reference Manual'. It returns `nil'. + + - Command: bury-buffer &optional BUFFER-OR-NAME + This function puts BUFFER-OR-NAME at the end of the buffer list + without changing the order of any of the other buffers on the list. + This buffer therefore becomes the least desirable candidate for + `other-buffer' to return. + + If BUFFER-OR-NAME is `nil' or omitted, this means to bury the + current buffer. In addition, if the buffer is displayed in the + selected window, this switches to some other buffer (obtained using + `other-buffer') in the selected window. But if the buffer is + displayed in some other window, it remains displayed there. + + If you wish to replace a buffer in all the windows that display + it, use `replace-buffer-in-windows'. *Note Buffers and Windows::. + + +File: lispref.info, Node: Creating Buffers, Next: Killing Buffers, Prev: The Buffer List, Up: Buffers + +Creating Buffers +================ + + This section describes the two primitives for creating buffers. +`get-buffer-create' creates a buffer if it finds no existing buffer +with the specified name; `generate-new-buffer' always creates a new +buffer and gives it a unique name. + + Other functions you can use to create buffers include +`with-output-to-temp-buffer' (*note Temporary Displays::.) and +`create-file-buffer' (*note Visiting Files::.). Starting a subprocess +can also create a buffer (*note Processes::.). + + - Function: get-buffer-create NAME + This function returns a buffer named NAME. It returns an existing + buffer with that name, if one exists; otherwise, it creates a new + buffer. The buffer does not become the current buffer--this + function does not change which buffer is current. + + An error is signaled if NAME is not a string. + + (get-buffer-create "foo") + => # + + The major mode for the new buffer is set to Fundamental mode. The + variable `default-major-mode' is handled at a higher level. *Note + Auto Major Mode::. + + - Function: generate-new-buffer NAME + This function returns a newly created, empty buffer, but does not + make it current. If there is no buffer named NAME, then that is + the name of the new buffer. If that name is in use, this function + adds suffixes of the form `' to NAME, where N is an integer. + It tries successive integers starting with 2 until it finds an + available name. + + An error is signaled if NAME is not a string. + + (generate-new-buffer "bar") + => # + (generate-new-buffer "bar") + => #> + (generate-new-buffer "bar") + => #> + + The major mode for the new buffer is set to Fundamental mode. The + variable `default-major-mode' is handled at a higher level. *Note + Auto Major Mode::. + + See the related function `generate-new-buffer-name' in *Note + Buffer Names::. + + +File: lispref.info, Node: Killing Buffers, Next: Indirect Buffers, Prev: Creating Buffers, Up: Buffers + +Killing Buffers +=============== + + "Killing a buffer" makes its name unknown to XEmacs and makes its +text space available for other use. + + The buffer object for the buffer that has been killed remains in +existence as long as anything refers to it, but it is specially marked +so that you cannot make it current or display it. Killed buffers retain +their identity, however; two distinct buffers, when killed, remain +distinct according to `eq'. + + If you kill a buffer that is current or displayed in a window, XEmacs +automatically selects or displays some other buffer instead. This means +that killing a buffer can in general change the current buffer. +Therefore, when you kill a buffer, you should also take the precautions +associated with changing the current buffer (unless you happen to know +that the buffer being killed isn't current). *Note Current Buffer::. + + If you kill a buffer that is the base buffer of one or more indirect +buffers, the indirect buffers are automatically killed as well. + + The `buffer-name' of a killed buffer is `nil'. To test whether a +buffer has been killed, you can either use this feature or the function +`buffer-live-p'. + + - Function: buffer-live-p BUFFER + This function returns `nil' if BUFFER is deleted, and `t' + otherwise. + + - Command: kill-buffer BUFFER-OR-NAME + This function kills the buffer BUFFER-OR-NAME, freeing all its + memory for use as space for other buffers. (Emacs version 18 and + older was unable to return the memory to the operating system.) + It returns `nil'. + + Any processes that have this buffer as the `process-buffer' are + sent the `SIGHUP' signal, which normally causes them to terminate. + (The basic meaning of `SIGHUP' is that a dialup line has been + disconnected.) *Note Deleting Processes::. + + If the buffer is visiting a file and contains unsaved changes, + `kill-buffer' asks the user to confirm before the buffer is killed. + It does this even if not called interactively. To prevent the + request for confirmation, clear the modified flag before calling + `kill-buffer'. *Note Buffer Modification::. + + Killing a buffer that is already dead has no effect. + + (kill-buffer "foo.unchanged") + => nil + (kill-buffer "foo.changed") + + ---------- Buffer: Minibuffer ---------- + Buffer foo.changed modified; kill anyway? (yes or no) yes + ---------- Buffer: Minibuffer ---------- + + => nil + + - Variable: kill-buffer-query-functions + After confirming unsaved changes, `kill-buffer' calls the functions + in the list `kill-buffer-query-functions', in order of appearance, + with no arguments. The buffer being killed is the current buffer + when they are called. The idea is that these functions ask for + confirmation from the user for various nonstandard reasons. If + any of them returns `nil', `kill-buffer' spares the buffer's life. + + - Variable: kill-buffer-hook + This is a normal hook run by `kill-buffer' after asking all the + questions it is going to ask, just before actually killing the + buffer. The buffer to be killed is current when the hook + functions run. *Note Hooks::. + + - Variable: buffer-offer-save + This variable, if non-`nil' in a particular buffer, tells + `save-buffers-kill-emacs' and `save-some-buffers' to offer to save + that buffer, just as they offer to save file-visiting buffers. The + variable `buffer-offer-save' automatically becomes buffer-local + when set for any reason. *Note Buffer-Local Variables::. + + +File: lispref.info, Node: Indirect Buffers, Prev: Killing Buffers, Up: Buffers + +Indirect Buffers +================ + + An "indirect buffer" shares the text of some other buffer, which is +called the "base buffer" of the indirect buffer. In some ways it is +the analogue, for buffers, of a symbolic link among files. The base +buffer may not itself be an indirect buffer. One base buffer may have +several "indirect children". + + The text of the indirect buffer is always identical to the text of +its base buffer; changes made by editing either one are visible +immediately in the other. + + But in all other respects, the indirect buffer and its base buffer +are completely separate. They have different names, different values of +point and mark, different narrowing, different markers and extents +(though inserting or deleting text in either buffer relocates the +markers and extents for both), different major modes, and different +local variables. Unlike in FSF Emacs, XEmacs indirect buffers do not +automatically share text properties among themselves and their base +buffer. + + An indirect buffer cannot visit a file, but its base buffer can. If +you try to save the indirect buffer, that actually works by saving the +base buffer. + + Killing an indirect buffer has no effect on its base buffer. Killing +the base buffer kills all its indirect children. + + - Command: make-indirect-buffer BASE-BUFFER NAME + This creates an indirect buffer named NAME whose base buffer is + BASE-BUFFER. The argument BASE-BUFFER may be a buffer or a string. + + If BASE-BUFFER is an indirect buffer, its base buffer is used as + the base for the new buffer. + + (make-indirect-buffer "*scratch*" "indirect") + => # + + - Function: buffer-base-buffer &optional BUFFER + This function returns the base buffer of BUFFER. If BUFFER is not + indirect, the value is `nil'. Otherwise, the value is another + buffer, which is never an indirect buffer. If BUFFER is not + supplied, it defaults to the current buffer. + + (buffer-base-buffer (get-buffer "indirect")) + => # + + - Function: buffer-indirect-children &optional BUFFER + This function returns a list of all indirect buffers whose base + buffer is BUFFER. If BUFFER is indirect, the return value will + always be nil; see `make-indirect-buffer'. If BUFFER is not + supplied, it defaults to the current buffer. + + (buffer-indirect-children (get-buffer "*scratch*")) + => (#) + + +File: lispref.info, Node: Windows, Next: Frames, Prev: Buffers, Up: Top + +Windows +******* + + This chapter describes most of the functions and variables related to +Emacs windows. See *Note Display::, for information on how text is +displayed in windows. + +* Menu: + +* Basic Windows:: Basic information on using windows. +* Splitting Windows:: Splitting one window into two windows. +* Deleting Windows:: Deleting a window gives its space to other windows. +* Selecting Windows:: The selected window is the one that you edit in. +* Cyclic Window Ordering:: Moving around the existing windows. +* Buffers and Windows:: Each window displays the contents of a buffer. +* Displaying Buffers:: Higher-lever functions for displaying a buffer + and choosing a window for it. +* Choosing Window:: How to choose a window for displaying a buffer. +* Window Point:: Each window has its own location of point. +* Window Start:: The display-start position controls which text + is on-screen in the window. +* Vertical Scrolling:: Moving text up and down in the window. +* Horizontal Scrolling:: Moving text sideways on the window. +* Size of Window:: Accessing the size of a window. +* Position of Window:: Accessing the position of a window. +* Resizing Windows:: Changing the size of a window. +* Window Configurations:: Saving and restoring the state of the screen. + + +File: lispref.info, Node: Basic Windows, Next: Splitting Windows, Up: Windows + +Basic Concepts of Emacs Windows +=============================== + + A "window" in XEmacs is the physical area of the screen in which a +buffer is displayed. The term is also used to refer to a Lisp object +that represents that screen area in XEmacs Lisp. It should be clear +from the context which is meant. + + XEmacs groups windows into frames. A frame represents an area of +screen available for XEmacs to use. Each frame always contains at least +one window, but you can subdivide it vertically or horizontally into +multiple nonoverlapping Emacs windows. + + In each frame, at any time, one and only one window is designated as +"selected within the frame". The frame's cursor appears in that +window. At ant time, one frame is the selected frame; and the window +selected within that frame is "the selected window". The selected +window's buffer is usually the current buffer (except when `set-buffer' +has been used). *Note Current Buffer::. + + For practical purposes, a window exists only while it is displayed in +a frame. Once removed from the frame, the window is effectively deleted +and should not be used, *even though there may still be references to +it* from other Lisp objects. Restoring a saved window configuration is +the only way for a window no longer on the screen to come back to life. +(*Note Deleting Windows::.) + + Each window has the following attributes: + + * containing frame + + * window height + + * window width + + * window edges with respect to the frame or screen + + * the buffer it displays + + * position within the buffer at the upper left of the window + + * amount of horizontal scrolling, in columns + + * point + + * the mark + + * how recently the window was selected + + Users create multiple windows so they can look at several buffers at +once. Lisp libraries use multiple windows for a variety of reasons, but +most often to display related information. In Rmail, for example, you +can move through a summary buffer in one window while the other window +shows messages one at a time as they are reached. + + The meaning of "window" in XEmacs is similar to what it means in the +context of general-purpose window systems such as X, but not identical. +The X Window System places X windows on the screen; XEmacs uses one or +more X windows as frames, and subdivides them into Emacs windows. When +you use XEmacs on a character-only terminal, XEmacs treats the whole +terminal screen as one frame. + + Most window systems support arbitrarily located overlapping windows. +In contrast, Emacs windows are "tiled"; they never overlap, and +together they fill the whole screen or frame. Because of the way in +which XEmacs creates new windows and resizes them, you can't create +every conceivable tiling of windows on an Emacs frame. *Note Splitting +Windows::, and *Note Size of Window::. + + *Note Display::, for information on how the contents of the window's +buffer are displayed in the window. + + - Function: windowp OBJECT + This function returns `t' if OBJECT is a window. + + +File: lispref.info, Node: Splitting Windows, Next: Deleting Windows, Prev: Basic Windows, Up: Windows + +Splitting Windows +================= + + The functions described here are the primitives used to split a +window into two windows. Two higher level functions sometimes split a +window, but not always: `pop-to-buffer' and `display-buffer' (*note +Displaying Buffers::.). + + The functions described here do not accept a buffer as an argument. +The two "halves" of the split window initially display the same buffer +previously visible in the window that was split. + + - Function: one-window-p &optional NO-MINI ALL-FRAMES + This function returns non-`nil' if there is only one window. The + argument NO-MINI, if non-`nil', means don't count the minibuffer + even if it is active; otherwise, the minibuffer window is + included, if active, in the total number of windows which is + compared against one. + + The argument ALL-FRAME controls which set of windows are counted. + * If it is `nil' or omitted, then count only the selected + frame, plus the minibuffer it uses (which may be on another + frame). + + * If it is `t', then windows on all frames that currently exist + (including invisible and iconified frames) are counted. + + * If it is the symbol `visible', then windows on all visible + frames are counted. + + * If it is the number 0, then windows on all visible and + iconified frames are counted. + + * If it is any other value, then precisely the windows in + WINDOW's frame are counted, excluding the minibuffer in use + if it lies in some other frame. + + - Command: split-window &optional WINDOW SIZE HORIZONTAL + This function splits WINDOW into two windows. The original window + WINDOW remains the selected window, but occupies only part of its + former screen area. The rest is occupied by a newly created + window which is returned as the value of this function. + + If HORIZONTAL is non-`nil', then WINDOW splits into two side by + side windows. The original window WINDOW keeps the leftmost SIZE + columns, and gives the rest of the columns to the new window. + Otherwise, it splits into windows one above the other, and WINDOW + keeps the upper SIZE lines and gives the rest of the lines to the + new window. The original window is therefore the left-hand or + upper of the two, and the new window is the right-hand or lower. + + If WINDOW is omitted or `nil', then the selected window is split. + If SIZE is omitted or `nil', then WINDOW is divided evenly into + two parts. (If there is an odd line, it is allocated to the new + window.) When `split-window' is called interactively, all its + arguments are `nil'. + + The following example starts with one window on a frame that is 50 + lines high by 80 columns wide; then the window is split. + + (setq w (selected-window)) + => # + (window-edges) ; Edges in order: + => (0 0 80 50) ; left-top-right-bottom + + ;; Returns window created + (setq w2 (split-window w 15)) + => # + + (window-edges w2) + => (0 15 80 50) ; Bottom window; + ; top is line 15 + + (window-edges w) + => (0 0 80 15) ; Top window + + The frame looks like this: + + __________ + | | line 0 + | w | + |__________| + | | line 15 + | w2 | + |__________| + line 50 + column 0 column 80 + + Next, the top window is split horizontally: + + (setq w3 (split-window w 35 t)) + => # + + (window-edges w3) + => (35 0 80 15) ; Left edge at column 35 + + (window-edges w) + => (0 0 35 15) ; Right edge at column 35 + + (window-edges w2) + => (0 15 80 50) ; Bottom window unchanged + + Now, the screen looks like this: + + column 35 + __________ + | | | line 0 + | w | w3 | + |___|______| + | | line 15 + | w2 | + |__________| + line 50 + column 0 column 80 + + Normally, Emacs indicates the border between two side-by-side + windows with a scroll bar (*note Scroll Bars: X Frame Properties.) + or `|' characters. The display table can specify alternative + border characters; see *Note Display Tables::. + + - Command: split-window-vertically &optional SIZE + This function splits the selected window into two windows, one + above the other, leaving the selected window with SIZE lines. + + This function is simply an interface to `split-windows'. Here is + the complete function definition for it: + + (defun split-window-vertically (&optional arg) + "Split current window into two windows, one above the other." + (interactive "P") + (split-window nil (and arg (prefix-numeric-value arg)))) + + - Command: split-window-horizontally &optional SIZE + This function splits the selected window into two windows + side-by-side, leaving the selected window with SIZE columns. + + This function is simply an interface to `split-windows'. Here is + the complete definition for `split-window-horizontally' (except for + part of the documentation string): + + (defun split-window-horizontally (&optional arg) + "Split selected window into two windows, side by side..." + (interactive "P") + (split-window nil (and arg (prefix-numeric-value arg)) t)) + + - Function: one-window-p &optional NO-MINI ALL-FRAMES + This function returns non-`nil' if there is only one window. The + argument NO-MINI, if non-`nil', means don't count the minibuffer + even if it is active; otherwise, the minibuffer window is + included, if active, in the total number of windows, which is + compared against one. + + The argument ALL-FRAMES specifies which frames to consider. Here + are the possible values and their meanings: + + `nil' + Count the windows in the selected frame, plus the minibuffer + used by that frame even if it lies in some other frame. + + `t' + Count all windows in all existing frames. + + `visible' + Count all windows in all visible frames. + + 0 + Count all windows in all visible or iconified frames. + + anything else + Count precisely the windows in the selected frame, and no + others. + + +File: lispref.info, Node: Deleting Windows, Next: Selecting Windows, Prev: Splitting Windows, Up: Windows + +Deleting Windows +================ + + A window remains visible on its frame unless you "delete" it by +calling certain functions that delete windows. A deleted window cannot +appear on the screen, but continues to exist as a Lisp object until +there are no references to it. There is no way to cancel the deletion +of a window aside from restoring a saved window configuration (*note +Window Configurations::.). Restoring a window configuration also +deletes any windows that aren't part of that configuration. + + When you delete a window, the space it took up is given to one +adjacent sibling. (In Emacs version 18, the space was divided evenly +among all the siblings.) + + - Function: window-live-p WINDOW + This function returns `nil' if WINDOW is deleted, and `t' + otherwise. + + *Warning:* Erroneous information or fatal errors may result from + using a deleted window as if it were live. + + - Command: delete-window &optional WINDOW + This function removes WINDOW from the display. If WINDOW is + omitted, then the selected window is deleted. An error is signaled + if there is only one window when `delete-window' is called. + + This function returns `nil'. + + When `delete-window' is called interactively, WINDOW defaults to + the selected window. + + - Command: delete-other-windows &optional WINDOW + This function makes WINDOW the only window on its frame, by + deleting the other windows in that frame. If WINDOW is omitted or + `nil', then the selected window is used by default. + + The result is `nil'. + + - Command: delete-windows-on BUFFER &optional FRAME + This function deletes all windows showing BUFFER. If there are no + windows showing BUFFER, it does nothing. + + `delete-windows-on' operates frame by frame. If a frame has + several windows showing different buffers, then those showing + BUFFER are removed, and the others expand to fill the space. If + all windows in some frame are showing BUFFER (including the case + where there is only one window), then the frame reverts to having a + single window showing another buffer chosen with `other-buffer'. + *Note The Buffer List::. + + The argument FRAME controls which frames to operate on: + + * If it is `nil', operate on the selected frame. + + * If it is `t', operate on all frames. + + * If it is `visible', operate on all visible frames. + + * 0 If it is 0, operate on all visible or iconified frames. + + * If it is a frame, operate on that frame. + + This function always returns `nil'. + + +File: lispref.info, Node: Selecting Windows, Next: Cyclic Window Ordering, Prev: Deleting Windows, Up: Windows + +Selecting Windows +================= + + When a window is selected, the buffer in the window becomes the +current buffer, and the cursor will appear in it. + + - Function: selected-window &optional DEVICE + This function returns the selected window. This is the window in + which the cursor appears and to which many commands apply. Each + separate device can have its own selected window, which is + remembered as focus changes from device to device. Optional + argument DEVICE specifies which device to return the selected + window for, and defaults to the selected device. + + - Function: select-window WINDOW &optional NORECORD + This function makes WINDOW the selected window. The cursor then + appears in WINDOW (on redisplay). The buffer being displayed in + WINDOW is immediately designated the current buffer. + + If optional argument NORECORD is non-`nil' then the global and + per-frame buffer orderings are not modified, as by the function + `record-buffer'. + + The return value is WINDOW. + + (setq w (next-window)) + (select-window w) + => # + + - Macro: save-selected-window FORMS... + This macro records the selected window, executes FORMS in + sequence, then restores the earlier selected window. It does not + save or restore anything about the sizes, arrangement or contents + of windows; therefore, if the FORMS change them, the changes are + permanent. + + The following functions choose one of the windows on the screen, +offering various criteria for the choice. + + - Function: get-lru-window &optional FRAME + This function returns the window least recently "used" (that is, + selected). The selected window is always the most recently used + window. + + The selected window can be the least recently used window if it is + the only window. A newly created window becomes the least + recently used window until it is selected. A minibuffer window is + never a candidate. + + The argument FRAME controls which windows are considered. + + * If it is `nil', consider windows on the selected frame. + + * If it is `t', consider windows on all frames. + + * If it is `visible', consider windows on all visible frames. + + * If it is 0, consider windows on all visible or iconified + frames. + + * If it is a frame, consider windows on that frame. + + - Function: get-largest-window &optional FRAME + This function returns the window with the largest area (height + times width). If there are no side-by-side windows, then this is + the window with the most lines. A minibuffer window is never a + candidate. + + If there are two windows of the same size, then the function + returns the window that is first in the cyclic ordering of windows + (see following section), starting from the selected window. + + The argument FRAME controls which set of windows are considered. + See `get-lru-window', above. + + +File: lispref.info, Node: Cyclic Window Ordering, Next: Buffers and Windows, Prev: Selecting Windows, Up: Windows + +Cyclic Ordering of Windows +========================== + + When you use the command `C-x o' (`other-window') to select the next +window, it moves through all the windows on the screen in a specific +cyclic order. For any given configuration of windows, this order never +varies. It is called the "cyclic ordering of windows". + + This ordering generally goes from top to bottom, and from left to +right. But it may go down first or go right first, depending on the +order in which the windows were split. + + If the first split was vertical (into windows one above each other), +and then the subwindows were split horizontally, then the ordering is +left to right in the top of the frame, and then left to right in the +next lower part of the frame, and so on. If the first split was +horizontal, the ordering is top to bottom in the left part, and so on. +In general, within each set of siblings at any level in the window tree, +the order is left to right, or top to bottom. + + - Function: next-window &optional WINDOW MINIBUF ALL-FRAMES + This function returns the window following WINDOW in the cyclic + ordering of windows. This is the window that `C-x o' would select + if typed when WINDOW is selected. If WINDOW is the only window + visible, then this function returns WINDOW. If omitted, WINDOW + defaults to the selected window. + + The value of the argument MINIBUF determines whether the + minibuffer is included in the window order. Normally, when + MINIBUF is `nil', the minibuffer is included if it is currently + active; this is the behavior of `C-x o'. (The minibuffer window + is active while the minibuffer is in use. *Note Minibuffers::.) + + If MINIBUF is `t', then the cyclic ordering includes the + minibuffer window even if it is not active. + + If MINIBUF is neither `t' nor `nil', then the minibuffer window is + not included even if it is active. + + The argument ALL-FRAMES specifies which frames to consider. Here + are the possible values and their meanings: + + `nil' + Consider all the windows in WINDOW's frame, plus the + minibuffer used by that frame even if it lies in some other + frame. + + `t' + Consider all windows in all existing frames. + + `visible' + Consider all windows in all visible frames. (To get useful + results, you must ensure WINDOW is in a visible frame.) + + 0 + Consider all windows in all visible or iconified frames. + + anything else + Consider precisely the windows in WINDOW's frame, and no + others. + + This example assumes there are two windows, both displaying the + buffer `windows.texi': + + (selected-window) + => # + (next-window (selected-window)) + => # + (next-window (next-window (selected-window))) + => # + + - Function: previous-window &optional WINDOW MINIBUF ALL-FRAMES + This function returns the window preceding WINDOW in the cyclic + ordering of windows. The other arguments specify which windows to + include in the cycle, as in `next-window'. + + - Command: other-window COUNT &optional FRAME + This function selects the COUNTth following window in the cyclic + order. If count is negative, then it selects the -COUNTth + preceding window. It returns `nil'. + + In an interactive call, COUNT is the numeric prefix argument. + + The argument FRAME controls which set of windows are considered. + * If it is `nil' or omitted, then windows on the selected frame + are considered. + + * If it is a frame, then windows on that frame are considered. + + * If it is `t', then windows on all frames that currently exist + (including invisible and iconified frames) are considered. + + * If it is the symbol `visible', then windows on all visible + frames are considered. + + * If it is the number 0, then windows on all visible and + iconified frames are considered. + + * If it is any other value, then the behavior is undefined. + + - Function: walk-windows PROC &optional MINIBUF ALL-FRAMES + This function cycles through all windows, calling `proc' once for + each window with the window as its sole argument. + + The optional arguments MINIBUF and ALL-FRAMES specify the set of + windows to include in the scan. See `next-window', above, for + details. + + +File: lispref.info, Node: Buffers and Windows, Next: Displaying Buffers, Prev: Cyclic Window Ordering, Up: Windows + +Buffers and Windows +=================== + + This section describes low-level functions to examine windows or to +display buffers in windows in a precisely controlled fashion. *Note +Displaying Buffers::, for related functions that find a window to use +and specify a buffer for it. The functions described there are easier +to use than these, but they employ heuristics in choosing or creating a +window; use these functions when you need complete control. + + - Function: set-window-buffer WINDOW BUFFER-OR-NAME + This function makes WINDOW display BUFFER-OR-NAME as its contents. + It returns `nil'. + + (set-window-buffer (selected-window) "foo") + => nil + + - Function: window-buffer &optional WINDOW + This function returns the buffer that WINDOW is displaying. If + WINDOW is omitted, this function returns the buffer for the + selected window. + + (window-buffer) + => # + + - Function: get-buffer-window BUFFER-OR-NAME &optional FRAME + This function returns a window currently displaying + BUFFER-OR-NAME, or `nil' if there is none. If there are several + such windows, then the function returns the first one in the + cyclic ordering of windows, starting from the selected window. + *Note Cyclic Window Ordering::. + + The argument ALL-FRAMES controls which windows to consider. + + * If it is `nil', consider windows on the selected frame. + + * If it is `t', consider windows on all frames. + + * If it is `visible', consider windows on all visible frames. + + * If it is 0, consider windows on all visible or iconified + frames. + + * If it is a frame, consider windows on that frame. + + +File: lispref.info, Node: Displaying Buffers, Next: Choosing Window, Prev: Buffers and Windows, Up: Windows + +Displaying Buffers in Windows +============================= + + In this section we describe convenient functions that choose a window +automatically and use it to display a specified buffer. These functions +can also split an existing window in certain circumstances. We also +describe variables that parameterize the heuristics used for choosing a +window. *Note Buffers and Windows::, for low-level functions that give +you more precise control. + + Do not use the functions in this section in order to make a buffer +current so that a Lisp program can access or modify it; they are too +drastic for that purpose, since they change the display of buffers in +windows, which is gratuitous and will surprise the user. Instead, use +`set-buffer' (*note Current Buffer::.) and `save-excursion' (*note +Excursions::.), which designate buffers as current for programmed +access without affecting the display of buffers in windows. + + - Command: switch-to-buffer BUFFER-OR-NAME &optional NORECORD + This function makes BUFFER-OR-NAME the current buffer, and also + displays the buffer in the selected window. This means that a + human can see the buffer and subsequent keyboard commands will + apply to it. Contrast this with `set-buffer', which makes + BUFFER-OR-NAME the current buffer but does not display it in the + selected window. *Note Current Buffer::. + + If BUFFER-OR-NAME does not identify an existing buffer, then a new + buffer by that name is created. The major mode for the new buffer + is set according to the variable `default-major-mode'. *Note Auto + Major Mode::. + + Normally the specified buffer is put at the front of the buffer + list. This affects the operation of `other-buffer'. However, if + NORECORD is non-`nil', this is not done. *Note The Buffer List::. + + The `switch-to-buffer' function is often used interactively, as + the binding of `C-x b'. It is also used frequently in programs. + It always returns `nil'. + + - Command: switch-to-buffer-other-window BUFFER-OR-NAME + This function makes BUFFER-OR-NAME the current buffer and displays + it in a window not currently selected. It then selects that + window. The handling of the buffer is the same as in + `switch-to-buffer'. + + The currently selected window is absolutely never used to do the + job. If it is the only window, then it is split to make a + distinct window for this purpose. If the selected window is + already displaying the buffer, then it continues to do so, but + another window is nonetheless found to display it in as well. + + - Function: pop-to-buffer BUFFER-OR-NAME &optional OTHER-WINDOW + ON-FRAME + This function makes BUFFER-OR-NAME the current buffer and switches + to it in some window, preferably not the window previously + selected. The "popped-to" window becomes the selected window + within its frame. + + If the variable `pop-up-frames' is non-`nil', `pop-to-buffer' + looks for a window in any visible frame already displaying the + buffer; if there is one, it returns that window and makes it be + selected within its frame. If there is none, it creates a new + frame and displays the buffer in it. + + If `pop-up-frames' is `nil', then `pop-to-buffer' operates + entirely within the selected frame. (If the selected frame has + just a minibuffer, `pop-to-buffer' operates within the most + recently selected frame that was not just a minibuffer.) + + If the variable `pop-up-windows' is non-`nil', windows may be + split to create a new window that is different from the original + window. For details, see *Note Choosing Window::. + + If OTHER-WINDOW is non-`nil', `pop-to-buffer' finds or creates + another window even if BUFFER-OR-NAME is already visible in the + selected window. Thus BUFFER-OR-NAME could end up displayed in + two windows. On the other hand, if BUFFER-OR-NAME is already + displayed in the selected window and OTHER-WINDOW is `nil', then + the selected window is considered sufficient display for + BUFFER-OR-NAME, so that nothing needs to be done. + + All the variables that affect `display-buffer' affect + `pop-to-buffer' as well. *Note Choosing Window::. + + If BUFFER-OR-NAME is a string that does not name an existing + buffer, a buffer by that name is created. The major mode for the + new buffer is set according to the variable `default-major-mode'. + *Note Auto Major Mode::. + + If ON-FRAME is non-`nil', it is the frame to pop to this buffer on. + + An example use of this function is found at the end of *Note + Filter Functions::. + + - Command: replace-buffer-in-windows BUFFER + This function replaces BUFFER with some other buffer in all + windows displaying it. The other buffer used is chosen with + `other-buffer'. In the usual applications of this function, you + don't care which other buffer is used; you just want to make sure + that BUFFER is no longer displayed. + + This function returns `nil'. + + +File: lispref.info, Node: Choosing Window, Next: Window Point, Prev: Displaying Buffers, Up: Windows + +Choosing a Window for Display +============================= + + This section describes the basic facility that chooses a window to +display a buffer in--`display-buffer'. All the higher-level functions +and commands use this subroutine. Here we describe how to use +`display-buffer' and how to customize it. + + - Command: display-buffer BUFFER-OR-NAME &optional NOT-THIS-WINDOW + This command makes BUFFER-OR-NAME appear in some window, like + `pop-to-buffer', but it does not select that window and does not + make the buffer current. The identity of the selected window is + unaltered by this function. + + If NOT-THIS-WINDOW is non-`nil', it means to display the specified + buffer in a window other than the selected one, even if it is + already on display in the selected window. This can cause the + buffer to appear in two windows at once. Otherwise, if + BUFFER-OR-NAME is already being displayed in any window, that is + good enough, so this function does nothing. + + `display-buffer' returns the window chosen to display + BUFFER-OR-NAME. + + Precisely how `display-buffer' finds or creates a window depends on + the variables described below. + + A window can be marked as "dedicated" to a particular buffer. Then +XEmacs will not automatically change which buffer appears in the +window, such as `display-buffer' might normally do. + + - Function: window-dedicated-p WINDOW + This function returns WINDOW's dedicated object, usually `t' or + `nil'. + + - Function: set-window-buffer-dedicated WINDOW BUFFER + This function makes WINDOW display BUFFER and be dedicated to that + buffer. Then XEmacs will not automatically change which buffer + appears in WINDOW. If BUFFER is `nil', this function makes WINDOW + not be dedicated (but doesn't change which buffer appears in it + currently). + + - User Option: pop-up-windows + This variable controls whether `display-buffer' makes new windows. + If it is non-`nil' and there is only one window, then that window + is split. If it is `nil', then `display-buffer' does not split + the single window, but uses it whole. + + - User Option: split-height-threshold + This variable determines when `display-buffer' may split a window, + if there are multiple windows. `display-buffer' always splits the + largest window if it has at least this many lines. If the largest + window is not this tall, it is split only if it is the sole window + and `pop-up-windows' is non-`nil'. + + - User Option: pop-up-frames + This variable controls whether `display-buffer' makes new frames. + If it is non-`nil', `display-buffer' looks for an existing window + already displaying the desired buffer, on any visible frame. If + it finds one, it returns that window. Otherwise it makes a new + frame. The variables `pop-up-windows' and + `split-height-threshold' do not matter if `pop-up-frames' is + non-`nil'. + + If `pop-up-frames' is `nil', then `display-buffer' either splits a + window or reuses one. + + *Note Frames::, for more information. + + - Variable: pop-up-frame-function + This variable specifies how to make a new frame if `pop-up-frames' + is non-`nil'. + + Its value should be a function of no arguments. When + `display-buffer' makes a new frame, it does so by calling that + function, which should return a frame. The default value of the + variable is a function that creates a frame using properties from + `pop-up-frame-plist'. + + - Variable: pop-up-frame-plist + This variable holds a plist specifying frame properties used when + `display-buffer' makes a new frame. *Note Frame Properties::, for + more information about frame properties. + + - Variable: special-display-buffer-names + A list of buffer names for buffers that should be displayed + specially. If the buffer's name is in this list, `display-buffer' + handles the buffer specially. + + By default, special display means to give the buffer a dedicated + frame. + + If an element is a list, instead of a string, then the CAR of the + list is the buffer name, and the rest of the list says how to + create the frame. There are two possibilities for the rest of the + list. It can be a plist, specifying frame properties, or it can + contain a function and arguments to give to it. (The function's + first argument is always the buffer to be displayed; the arguments + from the list come after that.) + + - Variable: special-display-regexps + A list of regular expressions that specify buffers that should be + displayed specially. If the buffer's name matches any of the + regular expressions in this list, `display-buffer' handles the + buffer specially. + + By default, special display means to give the buffer a dedicated + frame. + + If an element is a list, instead of a string, then the CAR of the + list is the regular expression, and the rest of the list says how + to create the frame. See above, under + `special-display-buffer-names'. + + - Variable: special-display-function + This variable holds the function to call to display a buffer + specially. It receives the buffer as an argument, and should + return the window in which it is displayed. + + The default value of this variable is + `special-display-popup-frame'. + + - Function: special-display-popup-frame BUFFER + This function makes BUFFER visible in a frame of its own. If + BUFFER is already displayed in a window in some frame, it makes + the frame visible and raises it, to use that window. Otherwise, it + creates a frame that will be dedicated to BUFFER. + + This function uses an existing window displaying BUFFER whether or + not it is in a frame of its own; but if you set up the above + variables in your init file, before BUFFER was created, then + presumably the window was previously made by this function. + + - User Option: special-display-frame-plist + This variable holds frame properties for + `special-display-popup-frame' to use when it creates a frame. + + - Variable: same-window-buffer-names + A list of buffer names for buffers that should be displayed in the + selected window. If the buffer's name is in this list, + `display-buffer' handles the buffer by switching to it in the + selected window. + + - Variable: same-window-regexps + A list of regular expressions that specify buffers that should be + displayed in the selected window. If the buffer's name matches + any of the regular expressions in this list, `display-buffer' + handles the buffer by switching to it in the selected window. + + - Variable: display-buffer-function + This variable is the most flexible way to customize the behavior of + `display-buffer'. If it is non-`nil', it should be a function + that `display-buffer' calls to do the work. The function should + accept two arguments, the same two arguments that `display-buffer' + received. It should choose or create a window, display the + specified buffer, and then return the window. + + This hook takes precedence over all the other options and hooks + described above. + + A window can be marked as "dedicated" to its buffer. Then +`display-buffer' does not try to use that window. + + - Function: window-dedicated-p WINDOW + This function returns `t' if WINDOW is marked as dedicated; + otherwise `nil'. + + - Function: set-window-dedicated-p WINDOW FLAG + This function marks WINDOW as dedicated if FLAG is non-`nil', and + nondedicated otherwise. + diff --git a/info/lispref.info-26 b/info/lispref.info-26 new file mode 100644 index 0000000..544c951 --- /dev/null +++ b/info/lispref.info-26 @@ -0,0 +1,1198 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Window Point, Next: Window Start, Prev: Choosing Window, Up: Windows + +Windows and Point +================= + + Each window has its own value of point, independent of the value of +point in other windows displaying the same buffer. This makes it useful +to have multiple windows showing one buffer. + + * The window point is established when a window is first created; it + is initialized from the buffer's point, or from the window point + of another window opened on the buffer if such a window exists. + + * Selecting a window sets the value of point in its buffer to the + window's value of point. Conversely, deselecting a window sets + the window's value of point from that of the buffer. Thus, when + you switch between windows that display a given buffer, the point + value for the selected window is in effect in the buffer, while + the point values for the other windows are stored in those windows. + + * As long as the selected window displays the current buffer, the + window's point and the buffer's point always move together; they + remain equal. + + * *Note Positions::, for more details on buffer positions. + + As far as the user is concerned, point is where the cursor is, and +when the user switches to another buffer, the cursor jumps to the +position of point in that buffer. + + - Function: window-point WINDOW + This function returns the current position of point in WINDOW. + For a nonselected window, this is the value point would have (in + that window's buffer) if that window were selected. + + When WINDOW is the selected window and its buffer is also the + current buffer, the value returned is the same as point in that + buffer. + + Strictly speaking, it would be more correct to return the + "top-level" value of point, outside of any `save-excursion' forms. + But that value is hard to find. + + - Function: set-window-point WINDOW POSITION + This function positions point in WINDOW at position POSITION in + WINDOW's buffer. + + +File: lispref.info, Node: Window Start, Next: Vertical Scrolling, Prev: Window Point, Up: Windows + +The Window Start Position +========================= + + Each window contains a marker used to keep track of a buffer position +that specifies where in the buffer display should start. This position +is called the "display-start" position of the window (or just the +"start"). The character after this position is the one that appears at +the upper left corner of the window. It is usually, but not +inevitably, at the beginning of a text line. + + - Function: window-start &optional WINDOW + This function returns the display-start position of window WINDOW. + If WINDOW is `nil', the selected window is used. For example, + + (window-start) + => 7058 + + When you create a window, or display a different buffer in it, the + display-start position is set to a display-start position recently + used for the same buffer, or 1 if the buffer doesn't have any. + + For a realistic example, see the description of `count-lines' in + *Note Text Lines::. + + - Function: window-end &optional WINDOW + This function returns the position of the end of the display in + window WINDOW. If WINDOW is `nil', the selected window is used. + + Simply changing the buffer text or moving point does not update the + value that `window-end' returns. The value is updated only when + Emacs redisplays and redisplay actually finishes. + + If the last redisplay of WINDOW was preempted, and did not finish, + Emacs does not know the position of the end of display in that + window. In that case, this function returns a value that is not + correct. In a future version, `window-end' will return `nil' in + that case. + + - Function: set-window-start WINDOW POSITION &optional NOFORCE + This function sets the display-start position of WINDOW to + POSITION in WINDOW's buffer. It returns POSITION. + + The display routines insist that the position of point be visible + when a buffer is displayed. Normally, they change the + display-start position (that is, scroll the window) whenever + necessary to make point visible. However, if you specify the + start position with this function using `nil' for NOFORCE, it + means you want display to start at POSITION even if that would put + the location of point off the screen. If this does place point + off screen, the display routines move point to the left margin on + the middle line in the window. + + For example, if point is 1 and you set the start of the window + to 2, then point would be "above" the top of the window. The + display routines will automatically move point if it is still 1 + when redisplay occurs. Here is an example: + + ;; Here is what `foo' looks like before executing + ;; the `set-window-start' expression. + + ---------- Buffer: foo ---------- + -!-This is the contents of buffer foo. + 2 + 3 + 4 + 5 + 6 + ---------- Buffer: foo ---------- + + (set-window-start + (selected-window) + (1+ (window-start))) + => 2 + + ;; Here is what `foo' looks like after executing + ;; the `set-window-start' expression. + ---------- Buffer: foo ---------- + his is the contents of buffer foo. + 2 + 3 + -!-4 + 5 + 6 + ---------- Buffer: foo ---------- + + If NOFORCE is non-`nil', and POSITION would place point off screen + at the next redisplay, then redisplay computes a new window-start + position that works well with point, and thus POSITION is not used. + + - Function: pos-visible-in-window-p &optional POSITION WINDOW + This function returns `t' if POSITION is within the range of text + currently visible on the screen in WINDOW. It returns `nil' if + POSITION is scrolled vertically out of view. The argument + POSITION defaults to the current position of point; WINDOW, to the + selected window. Here is an example: + + (or (pos-visible-in-window-p + (point) (selected-window)) + (recenter 0)) + + The `pos-visible-in-window-p' function considers only vertical + scrolling. If POSITION is out of view only because WINDOW has + been scrolled horizontally, `pos-visible-in-window-p' returns `t'. + *Note Horizontal Scrolling::. + + +File: lispref.info, Node: Vertical Scrolling, Next: Horizontal Scrolling, Prev: Window Start, Up: Windows + +Vertical Scrolling +================== + + Vertical scrolling means moving the text up or down in a window. It +works by changing the value of the window's display-start location. It +may also change the value of `window-point' to keep it on the screen. + + In the commands `scroll-up' and `scroll-down', the directions "up" +and "down" refer to the motion of the text in the buffer at which you +are looking through the window. Imagine that the text is written on a +long roll of paper and that the scrolling commands move the paper up +and down. Thus, if you are looking at text in the middle of a buffer +and repeatedly call `scroll-down', you will eventually see the +beginning of the buffer. + + Some people have urged that the opposite convention be used: they +imagine that the window moves over text that remains in place. Then +"down" commands would take you to the end of the buffer. This view is +more consistent with the actual relationship between windows and the +text in the buffer, but it is less like what the user sees. The +position of a window on the terminal does not move, and short scrolling +commands clearly move the text up or down on the screen. We have chosen +names that fit the user's point of view. + + The scrolling functions (aside from `scroll-other-window') have +unpredictable results if the current buffer is different from the buffer +that is displayed in the selected window. *Note Current Buffer::. + + - Command: scroll-up &optional COUNT + This function scrolls the text in the selected window upward COUNT + lines. If COUNT is negative, scrolling is actually downward. + + If COUNT is `nil' (or omitted), then the length of scroll is + `next-screen-context-lines' lines less than the usable height of + the window (not counting its modeline). + + `scroll-up' returns `nil'. + + - Command: scroll-down &optional COUNT + This function scrolls the text in the selected window downward + COUNT lines. If COUNT is negative, scrolling is actually upward. + + If COUNT is omitted or `nil', then the length of the scroll is + `next-screen-context-lines' lines less than the usable height of + the window (not counting its mode line). + + `scroll-down' returns `nil'. + + - Command: scroll-other-window &optional COUNT + This function scrolls the text in another window upward COUNT + lines. Negative values of COUNT, or `nil', are handled as in + `scroll-up'. + + You can specify a buffer to scroll with the variable + `other-window-scroll-buffer'. When the selected window is the + minibuffer, the next window is normally the one at the top left + corner. You can specify a different window to scroll with the + variable `minibuffer-scroll-window'. This variable has no effect + when any other window is selected. *Note Minibuffer Misc::. + + When the minibuffer is active, it is the next window if the + selected window is the one at the bottom right corner. In this + case, `scroll-other-window' attempts to scroll the minibuffer. If + the minibuffer contains just one line, it has nowhere to scroll + to, so the line reappears after the echo area momentarily displays + the message "Beginning of buffer". + + - Variable: other-window-scroll-buffer + If this variable is non-`nil', it tells `scroll-other-window' + which buffer to scroll. + + - User Option: scroll-step + This variable controls how scrolling is done automatically when + point moves off the screen. If the value is zero, then redisplay + scrolls the text to center point vertically in the window. If the + value is a positive integer N, then redisplay brings point back on + screen by scrolling N lines in either direction, if possible; + otherwise, it centers point. The default value is zero. + + - User Option: scroll-conservatively + This variable controls how many lines Emacs tries to scroll before + recentering. If you set it to a small number, then when you move + point a short distance off the screen, XEmacs will scroll the + screen just far enough to bring point back on screen, provided + that does not exceed `scroll-conservatively' lines. This variable + overrides the redisplay preemption. + + - User Option: next-screen-context-lines + The value of this variable is the number of lines of continuity to + retain when scrolling by full screens. For example, `scroll-up' + with an argument of `nil' scrolls so that this many lines at the + bottom of the window appear instead at the top. The default value + is `2'. + + - Command: recenter &optional COUNT + This function scrolls the selected window to put the text where + point is located at a specified vertical position within the + window. + + If COUNT is a nonnegative number, it puts the line containing + point COUNT lines down from the top of the window. If COUNT is a + negative number, then it counts upward from the bottom of the + window, so that -1 stands for the last usable line in the window. + If COUNT is a non-`nil' list, then it stands for the line in the + middle of the window. + + If COUNT is `nil', `recenter' puts the line containing point in + the middle of the window, then clears and redisplays the entire + selected frame. + + When `recenter' is called interactively, COUNT is the raw prefix + argument. Thus, typing `C-u' as the prefix sets the COUNT to a + non-`nil' list, while typing `C-u 4' sets COUNT to 4, which + positions the current line four lines from the top. + + With an argument of zero, `recenter' positions the current line at + the top of the window. This action is so handy that some people + make a separate key binding to do this. For example, + + (defun line-to-top-of-window () + "Scroll current line to top of window. + Replaces three keystroke sequence C-u 0 C-l." + (interactive) + (recenter 0)) + + (global-set-key [kp-multiply] 'line-to-top-of-window) + + +File: lispref.info, Node: Horizontal Scrolling, Next: Size of Window, Prev: Vertical Scrolling, Up: Windows + +Horizontal Scrolling +==================== + + Because we read English first from top to bottom and second from left +to right, horizontal scrolling is not like vertical scrolling. Vertical +scrolling involves selection of a contiguous portion of text to display. +Horizontal scrolling causes part of each line to go off screen. The +amount of horizontal scrolling is therefore specified as a number of +columns rather than as a position in the buffer. It has nothing to do +with the display-start position returned by `window-start'. + + Usually, no horizontal scrolling is in effect; then the leftmost +column is at the left edge of the window. In this state, scrolling to +the right is meaningless, since there is no data to the left of the +screen to be revealed by it; so this is not allowed. Scrolling to the +left is allowed; it scrolls the first columns of text off the edge of +the window and can reveal additional columns on the right that were +truncated before. Once a window has a nonzero amount of leftward +horizontal scrolling, you can scroll it back to the right, but only so +far as to reduce the net horizontal scroll to zero. There is no limit +to how far left you can scroll, but eventually all the text will +disappear off the left edge. + + - Command: scroll-left COUNT + This function scrolls the selected window COUNT columns to the + left (or to the right if COUNT is negative). The return value is + the total amount of leftward horizontal scrolling in effect after + the change--just like the value returned by `window-hscroll' + (below). + + - Command: scroll-right COUNT + This function scrolls the selected window COUNT columns to the + right (or to the left if COUNT is negative). The return value is + the total amount of leftward horizontal scrolling in effect after + the change--just like the value returned by `window-hscroll' + (below). + + Once you scroll a window as far right as it can go, back to its + normal position where the total leftward scrolling is zero, + attempts to scroll any farther right have no effect. + + - Function: window-hscroll &optional WINDOW + This function returns the total leftward horizontal scrolling of + WINDOW--the number of columns by which the text in WINDOW is + scrolled left past the left margin. + + The value is never negative. It is zero when no horizontal + scrolling has been done in WINDOW (which is usually the case). + + If WINDOW is `nil', the selected window is used. + + (window-hscroll) + => 0 + (scroll-left 5) + => 5 + (window-hscroll) + => 5 + + - Function: set-window-hscroll WINDOW COLUMNS + This function sets the number of columns from the left margin that + WINDOW is scrolled to the value of COLUMNS. The argument COLUMNS + should be zero or positive; if not, it is taken as zero. + + The value returned is COLUMNS. + + (set-window-hscroll (selected-window) 10) + => 10 + + Here is how you can determine whether a given position POSITION is +off the screen due to horizontal scrolling: + + (defun hscroll-on-screen (window position) + (save-excursion + (goto-char position) + (and + (>= (- (current-column) (window-hscroll window)) 0) + (< (- (current-column) (window-hscroll window)) + (window-width window))))) + + +File: lispref.info, Node: Size of Window, Next: Position of Window, Prev: Horizontal Scrolling, Up: Windows + +The Size of a Window +==================== + + An Emacs window is rectangular, and its size information consists of +the height (in lines or pixels) and the width (in character positions +or pixels). The modeline is included in the height. The pixel width +and height values include scrollbars and margins, while the +line/character-position values do not. + + Note that the height in lines, and the width in characters, are +determined by dividing the corresponding pixel value by the height or +width of the default font in that window (if this is a variable-width +font, the average width is used). The resulting values may or may not +represent the actual number of lines in the window, or the actual number +of character positions in any particular line, esp. if there are pixmaps +or various different fonts in the window. + + The following functions return size information about a window: + + - Function: window-height &optional WINDOW + This function returns the number of lines in WINDOW, including its + modeline but not including the horizontal scrollbar, if any (this + is different from `window-pixel-height'). If WINDOW is `nil', the + function uses the selected window. + + (window-height) + => 40 + (split-window-vertically) + => # + (window-height) + => 20 + + - Function: window-width &optional WINDOW + This function returns the number of columns in WINDOW, not + including any left margin, right margin, or vertical scrollbar + (this is different from `window-pixel-width'). If WINDOW is + `nil', the function uses the selected window. + + (window-width) + => 80 + (window-height) + => 40 + (split-window-horizontally) + => # + (window-width) + => 39 + + Note that after splitting the window into two side-by-side windows, +the width of each window is less the half the width of the original +window because a vertical scrollbar appeared between the windows, +occupying two columns worth of space. Also, the height shrunk by one +because horizontal scrollbars appeared that weren't there before. +(Horizontal scrollbars appear only when lines are truncated, not when +they wrap. This is usually the case for horizontally split windows but +not for full-frame windows. You can change this using the variables +`truncate-lines' and `truncate-partial-width-windows'.) + + - Function: window-pixel-height &optional WINDOW + This function returns the height of WINDOW in pixels, including + its modeline and horizontal scrollbar, if any. If WINDOW is + `nil', the function uses the selected window. + + (window-pixel-height) + => 600 + (split-window-vertically) + => # + (window-pixel-height) + => 300 + + - Function: window-pixel-width &optional WINDOW + This function returns the width of WINDOW in pixels, including any + left margin, right margin, or vertical scrollbar that may be + displayed alongside it. If WINDOW is `nil', the function uses the + selected window. + + (window-pixel-width) + => 735 + (window-pixel-height) + => 600 + (split-window-horizontally) + => # + (window-pixel-width) + => 367 + (window-pixel-height) + => 600 + + - Function: window-text-area-pixel-height &optional WINDOW + This function returns the height in pixels of the text displaying + portion of WINDOW, which defaults to the selected window. Unlike + `window-pixel-height', the space occupied by the modeline and + horizontal scrollbar, if any, is not counted. + + - Function: window-text-area-pixel-width &optional WINDOW + This function returns the width in pixels of the text displaying + portion of WINDOW, which defaults to the selected window. Unlike + `window-pixel-width', the space occupied by the vertical scrollbar + and divider, if any, is not counted. + + - Function: window-displayed-text-pixel-height &optional WINDOW + NOCLIPPED + This function returns the height in pixels of the text displayed in + WINDOW, which defaults to the selected window. Unlike + `window-text-area-pixel-height', any blank space below the end of + the buffer is not included. If optional argument NOCLIPPED is + non-`nil', any space occupied by clipped lines will not be + included. + + +File: lispref.info, Node: Position of Window, Next: Resizing Windows, Prev: Size of Window, Up: Windows + +The Position of a Window +======================== + + XEmacs provides functions to determine the absolute location of +windows within a frame, and the relative location of a window in +comparison to other windows in the same frame. + + - Function: window-pixel-edges &optional WINDOW + This function returns a list of the pixel edge coordinates of + WINDOW. If WINDOW is `nil', the selected window is used. + + The order of the list is `(LEFT TOP RIGHT BOTTOM)', all elements + relative to 0, 0 at the top left corner of the frame. The element + RIGHT of the value is one more than the rightmost pixel used by + WINDOW (including any left margin, right margin, or vertical + scrollbar displayed alongside it), and BOTTOM is one more than the + bottommost pixel used by WINDOW (including any modeline or + horizontal scrollbar displayed above or below it). The frame area + does not include any frame menubars or toolbars that may be + displayed; thus, for example, if there is only one window on the + frame, the values for LEFT and TOP will always be 0. + + If WINDOW is at the upper left corner of its frame, RIGHT and + BOTTOM are the same as the values returned by + `(window-pixel-width)' and `(window-pixel-height)' respectively, + and TOP and BOTTOM are zero. + + There is no longer a function `window-edges' because it does not +make sense in a world with variable-width and variable-height lines, as +are allowed in XEmacs. + + - Function: window-highest-p WINDOW + This function returns non-`nil' if WINDOW is along the top of its + frame. + + - Function: window-lowest-p WINDOW + This function returns non-`nil' if WINDOW is along the bottom of + its frame. + + - Function: window-text-area-pixel-edges &optional WINDOW + This function allows one to determine the location of the + text-displaying portion of WINDOW, which defaults to the selected + window, with respect to the top left corner of the window. It + returns a list of integer pixel positions `(left top right + bottom)', all relative to `(0,0)' at the top left corner of the + window. + + +File: lispref.info, Node: Resizing Windows, Next: Window Configurations, Prev: Position of Window, Up: Windows + +Changing the Size of a Window +============================= + + The window size functions fall into two classes: high-level commands +that change the size of windows and low-level functions that access +window size. XEmacs does not permit overlapping windows or gaps between +windows, so resizing one window affects other windows. + + - Command: enlarge-window SIZE &optional HORIZONTAL WINDOW + This function makes the selected window SIZE lines taller, + stealing lines from neighboring windows. It takes the lines from + one window at a time until that window is used up, then takes from + another. If a window from which lines are stolen shrinks below + `window-min-height' lines, that window disappears. + + If HORIZONTAL is non-`nil', this function makes WINDOW wider by + SIZE columns, stealing columns instead of lines. If a window from + which columns are stolen shrinks below `window-min-width' columns, + that window disappears. + + If the requested size would exceed that of the window's frame, + then the function makes the window occupy the entire height (or + width) of the frame. + + If SIZE is negative, this function shrinks the window by -SIZE + lines or columns. If that makes the window smaller than the + minimum size (`window-min-height' and `window-min-width'), + `enlarge-window' deletes the window. + + If WINDOW is non-`nil', it specifies a window to change instead of + the selected window. + + `enlarge-window' returns `nil'. + + - Command: enlarge-window-horizontally COLUMNS + This function makes the selected window COLUMNS wider. It could + be defined as follows: + + (defun enlarge-window-horizontally (columns) + (enlarge-window columns t)) + + - Command: enlarge-window-pixels COUNT &optional SIDE WINDOW + This function makes the selected window COUNT pixels larger. When + called from Lisp, optional second argument SIDE non-`nil' means to + grow sideways COUNT pixels, and optional third argument WINDOW + specifies the window to change instead of the selected window. + + - Command: shrink-window SIZE &optional HORIZONTAL WINDOW + This function is like `enlarge-window' but negates the argument + SIZE, making the selected window smaller by giving lines (or + columns) to the other windows. If the window shrinks below + `window-min-height' or `window-min-width', then it disappears. + + If SIZE is negative, the window is enlarged by -SIZE lines or + columns. + + If WINDOW is non-`nil', it specifies a window to change instead of + the selected window. + + - Command: shrink-window-horizontally COLUMNS + This function makes the selected window COLUMNS narrower. It + could be defined as follows: + + (defun shrink-window-horizontally (columns) + (shrink-window columns t)) + + - Command: shrink-window-pixels COUNT &optional SIDE WINDOW + This function makes the selected window COUNT pixels smaller. + When called from Lisp, optional second argument SIDE non-`nil' + means to shrink sideways COUNT pixels, and optional third argument + WINDOW specifies the window to change instead of the selected + window. + + The following two variables constrain the window-size-changing +functions to a minimum height and width. + + - User Option: window-min-height + The value of this variable determines how short a window may become + before it is automatically deleted. Making a window smaller than + `window-min-height' automatically deletes it, and no window may be + created shorter than this. The absolute minimum height is two + (allowing one line for the mode line, and one line for the buffer + display). Actions that change window sizes reset this variable to + two if it is less than two. The default value is 4. + + - User Option: window-min-width + The value of this variable determines how narrow a window may + become before it automatically deleted. Making a window smaller + than `window-min-width' automatically deletes it, and no window + may be created narrower than this. The absolute minimum width is + one; any value below that is ignored. The default value is 10. + + - Variable: window-size-change-functions + This variable holds a list of functions to be called if the size + of any window changes for any reason. The functions are called + just once per redisplay, and just once for each frame on which + size changes have occurred. + + Each function receives the frame as its sole argument. There is no + direct way to find out which windows changed size, or precisely + how; however, if your size-change function keeps track, after each + change, of the windows that interest you, you can figure out what + has changed by comparing the old size data with the new. + + Creating or deleting windows counts as a size change, and therefore + causes these functions to be called. Changing the frame size also + counts, because it changes the sizes of the existing windows. + + It is not a good idea to use `save-window-excursion' in these + functions, because that always counts as a size change, and it + would cause these functions to be called over and over. In most + cases, `save-selected-window' is what you need here. + + +File: lispref.info, Node: Window Configurations, Prev: Resizing Windows, Up: Windows + +Window Configurations +===================== + + A "window configuration" records the entire layout of a frame--all +windows, their sizes, which buffers they contain, what part of each +buffer is displayed, and the values of point and the mark. You can +bring back an entire previous layout by restoring a window +configuration previously saved. + + If you want to record all frames instead of just one, use a frame +configuration instead of a window configuration. *Note Frame +Configurations::. + + - Function: current-window-configuration + This function returns a new object representing XEmacs's current + window configuration, namely the number of windows, their sizes + and current buffers, which window is the selected window, and for + each window the displayed buffer, the display-start position, and + the positions of point and the mark. An exception is made for + point in the current buffer, whose value is not saved. + + - Function: set-window-configuration CONFIGURATION + This function restores the configuration of XEmacs's windows and + buffers to the state specified by CONFIGURATION. The argument + CONFIGURATION must be a value that was previously returned by + `current-window-configuration'. + + This function always counts as a window size change and triggers + execution of the `window-size-change-functions'. (It doesn't know + how to tell whether the new configuration actually differs from + the old one.) + + Here is a way of using this function to get the same effect as + `save-window-excursion': + + (let ((config (current-window-configuration))) + (unwind-protect + (progn (split-window-vertically nil) + ...) + (set-window-configuration config))) + + - Special Form: save-window-excursion FORMS... + This special form records the window configuration, executes FORMS + in sequence, then restores the earlier window configuration. The + window configuration includes the value of point and the portion + of the buffer that is visible. It also includes the choice of + selected window. However, it does not include the value of point + in the current buffer; use `save-excursion' if you wish to + preserve that. + + Don't use this construct when `save-selected-window' is all you + need. + + Exit from `save-window-excursion' always triggers execution of the + `window-size-change-functions'. (It doesn't know how to tell + whether the restored configuration actually differs from the one in + effect at the end of the FORMS.) + + The return value is the value of the final form in FORMS. For + example: + + (split-window) + => # + (setq w (selected-window)) + => # + (save-window-excursion + (delete-other-windows w) + (switch-to-buffer "foo") + 'do-something) + => do-something + ;; The frame is now split again. + + - Function: window-configuration-p OBJECT + This function returns `t' if OBJECT is a window configuration. + + Primitives to look inside of window configurations would make sense, +but none are implemented. It is not clear they are useful enough to be +worth implementing. + + +File: lispref.info, Node: Frames, Next: Consoles and Devices, Prev: Windows, Up: Top + +Frames +****** + + A FRAME is a rectangle on the screen that contains one or more +XEmacs windows. A frame initially contains a single main window (plus +perhaps a minibuffer window), which you can subdivide vertically or +horizontally into smaller windows. + + When XEmacs runs on a text-only terminal, it starts with one "TTY +frame". If you create additional ones, XEmacs displays one and only +one at any given time--on the terminal screen, of course. + + When XEmacs communicates directly with an X server, it does not have +a TTY frame; instead, it starts with a single "X window frame". It can +display multiple X window frames at the same time, each in its own X +window. + + - Function: framep OBJECT + This predicate returns `t' if OBJECT is a frame, and `nil' + otherwise. + +* Menu: + +* Creating Frames:: Creating additional frames. +* Frame Properties:: Controlling frame size, position, font, etc. +* Frame Titles:: Automatic updating of frame titles. +* Deleting Frames:: Frames last until explicitly deleted. +* Finding All Frames:: How to examine all existing frames. +* Frames and Windows:: A frame contains windows; + display of text always works through windows. +* Minibuffers and Frames:: How a frame finds the minibuffer to use. +* Input Focus:: Specifying the selected frame. +* Visibility of Frames:: Frames may be visible or invisible, or icons. +* Raising and Lowering:: Raising a frame makes it hide other X windows; + lowering it makes the others hide them. +* Frame Configurations:: Saving the state of all frames. +* Frame Hooks:: Hooks for customizing frame behavior. + + *Note Display::, for related information. + + +File: lispref.info, Node: Creating Frames, Next: Frame Properties, Up: Frames + +Creating Frames +=============== + + To create a new frame, call the function `make-frame'. + + - Function: make-frame &optional PROPS DEVICE + This function creates a new frame on DEVICE, if DEVICE permits + creation of frames. (An X server does; an ordinary terminal does + not (yet).) DEVICE defaults to the selected device if omitted. + *Note Consoles and Devices::. + + The argument PROPS is a property list (a list of alternating + keyword-value specifications) of properties for the new frame. (An + alist is accepted for backward compatibility but should not be + passed in.) Any properties not mentioned in PROPS default + according to the value of the variable `default-frame-plist'. For + X devices, properties not specified in `default-frame-plist' + default in turn from `default-x-frame-plist' and, if not specified + there, from the X resources. For TTY devices, + `default-tty-frame-plist' is consulted as well as + `default-frame-plist'. + + The set of possible properties depends in principle on what kind of + window system XEmacs uses to display its frames. *Note X Frame + Properties::, for documentation of individual properties you can + specify when creating an X window frame. + + +File: lispref.info, Node: Frame Properties, Next: Frame Titles, Prev: Creating Frames, Up: Frames + +Frame Properties +================ + + A frame has many properties that control its appearance and behavior. +Just what properties a frame has depends on which display mechanism it +uses. + + Frame properties exist for the sake of window systems. A terminal +frame has few properties, mostly for compatibility's sake; only the +height, width and `buffer-predicate' properties really do something. + +* Menu: + +* Property Access:: How to change a frame's properties. +* Initial Properties:: Specifying frame properties when you make a frame. +* X Frame Properties:: List of frame properties. +* Size and Position:: Changing the size and position of a frame. +* Frame Name:: The name of a frame (as opposed to its title). + + +File: lispref.info, Node: Property Access, Next: Initial Properties, Up: Frame Properties + +Access to Frame Properties +-------------------------- + + These functions let you read and change the properties of a frame. + + - Function: frame-properties &optional FRAME + This function returns a plist listing all the properties of FRAME + and their values. + + - Function: frame-property FRAME PROPERTY &optional DEFAULT + This function returns FRAME's value for the property PROPERTY. + + - Function: set-frame-properties FRAME PLIST + This function alters the properties of frame FRAME based on the + elements of property list PLIST. If you don't mention a property + in PLIST, its value doesn't change. + + - Function: set-frame-property FRAME PROP VAL + This function sets the property PROP of frame FRAME to the value + VAL. + + +File: lispref.info, Node: Initial Properties, Next: X Frame Properties, Prev: Property Access, Up: Frame Properties + +Initial Frame Properties +------------------------ + + You can specify the properties for the initial startup frame by +setting `initial-frame-plist' in your `.emacs' file. + + - Variable: initial-frame-plist + This variable's value is a plist of alternating property-value + pairs used when creating the initial X window frame. + + XEmacs creates the initial frame before it reads your `~/.emacs' + file. After reading that file, XEmacs checks + `initial-frame-plist', and applies the property settings in the + altered value to the already created initial frame. + + If these settings affect the frame geometry and appearance, you'll + see the frame appear with the wrong ones and then change to the + specified ones. If that bothers you, you can specify the same + geometry and appearance with X resources; those do take affect + before the frame is created. *Note X Resources: (xemacs)Resources + X. + + X resource settings typically apply to all frames. If you want to + specify some X resources solely for the sake of the initial frame, + and you don't want them to apply to subsequent frames, here's how + to achieve this: specify properties in `default-frame-plist' to + override the X resources for subsequent frames; then, to prevent + these from affecting the initial frame, specify the same + properties in `initial-frame-plist' with values that match the X + resources. + + If these properties specify a separate minibuffer-only frame via a +`minibuffer' property of `nil', and you have not yet created one, +XEmacs creates one for you. + + - Variable: minibuffer-frame-plist + This variable's value is a plist of properties used when creating + an initial minibuffer-only frame--if such a frame is needed, + according to the properties for the main initial frame. + + - Variable: default-frame-plist + This is a plist specifying default values of frame properties for + subsequent XEmacs frames (not the initial ones). + + See also `special-display-frame-plist', in *Note Choosing Window::. + + If you use options that specify window appearance when you invoke +XEmacs, they take effect by adding elements to `default-frame-plist'. +One exception is `-geometry', which adds the specified position to +`initial-frame-plist' instead. *Note Command Arguments: +(xemacs)Command Arguments. + + +File: lispref.info, Node: X Frame Properties, Next: Size and Position, Prev: Initial Properties, Up: Frame Properties + +X Window Frame Properties +------------------------- + + Just what properties a frame has depends on what display mechanism it +uses. Here is a table of the properties of an X window frame; of these, +`name', `height', `width', and `buffer-predicate' provide meaningful +information in non-X frames. + +`name' + The name of the frame. Most window managers display the frame's + name in the frame's border, at the top of the frame. If you don't + specify a name, and you have more than one frame, XEmacs sets the + frame name based on the buffer displayed in the frame's selected + window. + + If you specify the frame name explicitly when you create the + frame, the name is also used (instead of the name of the XEmacs + executable) when looking up X resources for the frame. + +`display' + The display on which to open this frame. It should be a string of + the form `"HOST:DPY.SCREEN"', just like the `DISPLAY' environment + variable. + +`left' + The screen position of the left edge, in pixels, with respect to + the left edge of the screen. The value may be a positive number + POS, or a list of the form `(+ POS)' which permits specifying a + negative POS value. + + A negative number -POS, or a list of the form `(- POS)', actually + specifies the position of the right edge of the window with + respect to the right edge of the screen. A positive value of POS + counts toward the left. If the property is a negative integer + -POS then POS is positive! + +`top' + The screen position of the top edge, in pixels, with respect to the + top edge of the screen. The value may be a positive number POS, + or a list of the form `(+ POS)' which permits specifying a + negative POS value. + + A negative number -POS, or a list of the form `(- POS)', actually + specifies the position of the bottom edge of the window with + respect to the bottom edge of the screen. A positive value of POS + counts toward the top. If the property is a negative integer -POS + then POS is positive! + +`icon-left' + The screen position of the left edge *of the frame's icon*, in + pixels, counting from the left edge of the screen. This takes + effect if and when the frame is iconified. + +`icon-top' + The screen position of the top edge *of the frame's icon*, in + pixels, counting from the top edge of the screen. This takes + effect if and when the frame is iconified. + +`user-position' + Non-`nil' if the screen position of the frame was explicitly + requested by the user (for example, with the `-geometry' option). + Nothing automatically makes this property non-`nil'; it is up to + Lisp programs that call `make-frame' to specify this property as + well as specifying the `left' and `top' properties. + +`height' + The height of the frame contents, in characters. (To get the + height in pixels, call `frame-pixel-height'; see *Note Size and + Position::.) + +`width' + The width of the frame contents, in characters. (To get the + height in pixels, call `frame-pixel-width'; see *Note Size and + Position::.) + +`window-id' + The number of the X window for the frame. + +`minibuffer' + Whether this frame has its own minibuffer. The value `t' means + yes, `nil' means no, `only' means this frame is just a minibuffer. + If the value is a minibuffer window (in some other frame), the + new frame uses that minibuffer. (Minibuffer-only and + minibuffer-less frames are not yet implemented in XEmacs.) + +`buffer-predicate' + The buffer-predicate function for this frame. The function + `other-buffer' uses this predicate (from the selected frame) to + decide which buffers it should consider, if the predicate is not + `nil'. It calls the predicate with one arg, a buffer, once for + each buffer; if the predicate returns a non-`nil' value, it + considers that buffer. + +`scroll-bar-width' + The width of the vertical scroll bar, in pixels. + +`cursor-color' + The color for the cursor that shows point. + +`border-color' + The color for the border of the frame. + +`border-width' + The width in pixels of the window border. + +`internal-border-width' + The distance in pixels between text and border. + +`unsplittable' + If non-`nil', this frame's window is never split automatically. + +`inter-line-space' + The space in pixels between adjacent lines of text. (Not currently + implemented.) + +`modeline' + Whether the frame has a modeline. + + +File: lispref.info, Node: Size and Position, Next: Frame Name, Prev: X Frame Properties, Up: Frame Properties + +Frame Size And Position +----------------------- + + You can read or change the size and position of a frame using the +frame properties `left', `top', `height', and `width'. Whatever +geometry properties you don't specify are chosen by the window manager +in its usual fashion. + + Here are some special features for working with sizes and positions: + + - Function: set-frame-position FRAME LEFT TOP + This function sets the position of the top left corner of FRAME to + LEFT and TOP. These arguments are measured in pixels, and count + from the top left corner of the screen. Negative property values + count up or rightward from the top left corner of the screen. + + - Function: frame-height &optional FRAME + - Function: frame-width &optional FRAME + These functions return the height and width of FRAME, measured in + lines and columns. If you don't supply FRAME, they use the + selected frame. + + - Function: frame-pixel-height &optional FRAME + - Function: frame-pixel-width &optional FRAME + These functions return the height and width of FRAME, measured in + pixels. If you don't supply FRAME, they use the selected frame. + + - Function: set-frame-size FRAME COLS ROWS &optional PRETEND + This function sets the size of FRAME, measured in characters; COLS + and ROWS specify the new width and height. (If PRETEND is + non-nil, it means that redisplay should act as if the frame's size + is COLS by ROWS, but the actual size of the frame should not be + changed. You should not normally use this option.) + + You can also use the functions `set-frame-height' and +`set-frame-width' to set the height and width individually. The frame +is the first argument and the size (in rows or columns) is the second. +(There is an optional third argument, PRETEND, which has the same +purpose as the corresponding argument in `set-frame-size'.) + + +File: lispref.info, Node: Frame Name, Prev: Size and Position, Up: Frame Properties + +The Name of a Frame (As Opposed to Its Title) +--------------------------------------------- + + Under X, every frame has a name, which is not the same as the title +of the frame. A frame's name is used to look up its resources and does +not normally change over the lifetime of a frame. It is perfectly +allowable, and quite common, for multiple frames to have the same name. + + - Function: frame-name &optional FRAME + This function returns the name of FRAME, which defaults to the + selected frame if not specified. The name of a frame can also be + obtained from the frame's properties. *Note Frame Properties::. + + - Variable: default-frame-name + This variable holds the default name to assign to newly-created + frames. This can be overridden by arguments to `make-frame'. This + must be a string. + + +File: lispref.info, Node: Frame Titles, Next: Deleting Frames, Prev: Frame Properties, Up: Frames + +Frame Titles +============ + + Every frame has a title; most window managers display the frame +title at the top of the frame. You can specify an explicit title with +the `name' frame property. But normally you don't specify this +explicitly, and XEmacs computes the title automatically. + + XEmacs computes the frame title based on a template stored in the +variable `frame-title-format'. + + - Variable: frame-title-format + This variable specifies how to compute a title for a frame when + you have not explicitly specified one. + + The variable's value is actually a modeline construct, just like + `modeline-format'. *Note Modeline Data::. + + - Variable: frame-icon-title-format + This variable specifies how to compute the title for an iconified + frame, when you have not explicitly specified the frame title. + This title appears in the icon itself. + + - Function: x-set-frame-icon-pixmap FRAME PIXMAP &optional MASK + This function sets the icon of the given frame to the given image + instance, which should be an image instance object (as returned by + `make-image-instance'), a glyph object (as returned by + `make-glyph'), or `nil'. If a glyph object is given, the glyph + will be instantiated on the frame to produce an image instance + object. + + If the given image instance has a mask, that will be used as the + icon mask; however, not all window managers support this. + + The window manager is also not required to support color pixmaps, + only bitmaps (one plane deep). + + If the image instance does not have a mask, then the optional + third argument may be the image instance to use as the mask (it + must be one plane deep). *Note Glyphs::. + + +File: lispref.info, Node: Deleting Frames, Next: Finding All Frames, Prev: Frame Titles, Up: Frames + +Deleting Frames +=============== + + Frames remain potentially visible until you explicitly "delete" +them. A deleted frame cannot appear on the screen, but continues to +exist as a Lisp object until there are no references to it. + + - Command: delete-frame &optional FRAME + This function deletes the frame FRAME. By default, FRAME is the + selected frame. + + - Function: frame-live-p FRAME + The function `frame-live-p' returns non-`nil' if the frame FRAME + has not been deleted. + diff --git a/info/lispref.info-27 b/info/lispref.info-27 new file mode 100644 index 0000000..fc1d7cc --- /dev/null +++ b/info/lispref.info-27 @@ -0,0 +1,1213 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Finding All Frames, Next: Frames and Windows, Prev: Deleting Frames, Up: Frames + +Finding All Frames +================== + + - Function: frame-list + The function `frame-list' returns a list of all the frames that + have not been deleted. It is analogous to `buffer-list' for + buffers. The list that you get is newly created, so modifying the + list doesn't have any effect on the internals of XEmacs. + + - Function: device-frame-list &optional DEVICE + This function returns a list of all frames on DEVICE. If DEVICE + is `nil', the selected device will be used. + + - Function: visible-frame-list &optional DEVICE + This function returns a list of just the currently visible frames. + If DEVICE is specified only frames on that device will be returned. + *Note Visibility of Frames::. (TTY frames always count as + "visible", even though only the selected one is actually + displayed.) + + - Function: next-frame &optional FRAME MINIBUF + The function `next-frame' lets you cycle conveniently through all + the frames from an arbitrary starting point. It returns the "next" + frame after FRAME in the cycle. If FRAME is omitted or `nil', it + defaults to the selected frame. + + The second argument, MINIBUF, says which frames to consider: + + `nil' + Exclude minibuffer-only frames. + + `visible' + Consider all visible frames. + + 0 + Consider all visible or iconified frames. + + a window + Consider only the frames using that particular window as their + minibuffer. + + the symbol `visible' + Include all visible frames. + + `0' + Include all visible and iconified frames. + + anything else + Consider all frames. + + - Function: previous-frame &optional FRAME MINIBUF + Like `next-frame', but cycles through all frames in the opposite + direction. + + See also `next-window' and `previous-window', in *Note Cyclic Window +Ordering::. + + +File: lispref.info, Node: Frames and Windows, Next: Minibuffers and Frames, Prev: Finding All Frames, Up: Frames + +Frames and Windows +================== + + Each window is part of one and only one frame; you can get the frame +with `window-frame'. + + - Function: frame-root-window &optional FRAME + This returns the root window of frame FRAME. FRAME defaults to + the selected frame if not specified. + + - Function: window-frame &optional WINDOW + This function returns the frame that WINDOW is on. WINDOW + defaults to the selected window if omitted. + + All the non-minibuffer windows in a frame are arranged in a cyclic +order. The order runs from the frame's top window, which is at the +upper left corner, down and to the right, until it reaches the window at +the lower right corner (always the minibuffer window, if the frame has +one), and then it moves back to the top. + + - Function: frame-top-window FRAME + This returns the topmost, leftmost window of frame FRAME. + + At any time, exactly one window on any frame is "selected within the +frame". The significance of this designation is that selecting the +frame also selects this window. You can get the frame's current +selected window with `frame-selected-window'. + + - Function: frame-selected-window &optional FRAME + This function returns the window on FRAME that is selected within + FRAME. FRAME defaults to the selected frame if not specified. + + Conversely, selecting a window for XEmacs with `select-window' also +makes that window selected within its frame. *Note Selecting Windows::. + + Another function that (usually) returns one of the windows in a +frame is `minibuffer-window'. *Note Minibuffer Misc::. + + +File: lispref.info, Node: Minibuffers and Frames, Next: Input Focus, Prev: Frames and Windows, Up: Frames + +Minibuffers and Frames +====================== + + Normally, each frame has its own minibuffer window at the bottom, +which is used whenever that frame is selected. If the frame has a +minibuffer, you can get it with `minibuffer-window' (*note Minibuffer +Misc::.). + + However, you can also create a frame with no minibuffer. Such a +frame must use the minibuffer window of some other frame. When you +create the frame, you can specify explicitly the minibuffer window to +use (in some other frame). If you don't, then the minibuffer is found +in the frame which is the value of the variable +`default-minibuffer-frame'. Its value should be a frame which does +have a minibuffer. + + - Variable: default-minibuffer-frame + This variable specifies the frame to use for the minibuffer + window, by default. + + +File: lispref.info, Node: Input Focus, Next: Visibility of Frames, Prev: Minibuffers and Frames, Up: Frames + +Input Focus +=========== + + At any time, one frame in XEmacs is the "selected frame". The +selected window always resides on the selected frame. As the focus +moves from device to device, the selected frame on each device is +remembered and restored when the focus moves back to that device. + + - Function: selected-frame &optional DEVICE + This function returns the selected frame on DEVICE. If DEVICE is + not specified, the selected device will be used. If no frames + exist on the device, `nil' is returned. + + The X server normally directs keyboard input to the X window that the +mouse is in. Some window managers use mouse clicks or keyboard events +to "shift the focus" to various X windows, overriding the normal +behavior of the server. + + Lisp programs can switch frames "temporarily" by calling the +function `select-frame'. This does not override the window manager; +rather, it escapes from the window manager's control until that control +is somehow reasserted. + + When using a text-only terminal, there is no window manager; +therefore, `select-frame' is the only way to switch frames, and the +effect lasts until overridden by a subsequent call to `select-frame'. +Only the selected terminal frame is actually displayed on the terminal. +Each terminal screen except for the initial one has a number, and the +number of the selected frame appears in the mode line after the word +`XEmacs' (*note Modeline Variables::.). + + - Function: select-frame FRAME + This function selects frame FRAME, temporarily disregarding the + focus of the X server if any. The selection of FRAME lasts until + the next time the user does something to select a different frame, + or until the next time this function is called. + + Note that `select-frame' does not actually cause the window-system + focus to be set to this frame, or the `select-frame-hook' or + `deselect-frame-hook' to be run, until the next time that XEmacs is + waiting for an event. + + Also note that when the variable `focus-follows-mouse' is + non-`nil', the frame selection is temporary and is reverted when + the current command terminates, much like the buffer selected by + `set-buffer'. In order to effect a permanent focus change use + `focus-frame'. + + - Function: focus-frame FRAME + This function selects FRAME and gives it the window system focus. + The operation of `focus-frame' is not affected by the value of + `focus-follows-mouse'. + + - Macro: save-selected-frame FORMS... + This macro records the selected frame, executes FORMS in sequence, + then restores the earlier selected frame. The value returned is + the value of the last form. + + - Macro: with-selected-frame FRAME FORMS... + This macro records the selected frame, then selects FRAME and + executes FORMS in sequence. After the last form is finished, the + earlier selected frame is restored. The value returned is the + value of the last form. + + +File: lispref.info, Node: Visibility of Frames, Next: Raising and Lowering, Prev: Input Focus, Up: Frames + +Visibility of Frames +==================== + + An X window frame may be "visible", "invisible", or "iconified". If +it is visible, you can see its contents. If it is iconified, the +frame's contents do not appear on the screen, but an icon does. If the +frame is invisible, it doesn't show on the screen, not even as an icon. + + Visibility is meaningless for TTY frames, since only the selected +one is actually displayed in any case. + + - Command: make-frame-visible &optional FRAME + This function makes frame FRAME visible. If you omit FRAME, it + makes the selected frame visible. + + - Command: make-frame-invisible &optional FRAME + This function makes frame FRAME invisible. + + - Command: iconify-frame &optional FRAME + This function iconifies frame FRAME. + + - Command: deiconify-frame &optional FRAME + This function de-iconifies frame FRAME. Under X, this is + equivalent to `make-frame-visible'. + + - Function: frame-visible-p FRAME + This returns whether FRAME is currently "visible" (actually in use + for display). A frame that is not visible is not updated, and, if + it works through a window system, may not show at all. + + - Function: frame-iconified-p FRAME + This returns whether FRAME is iconified. Not all window managers + use icons; some merely unmap the window, so this function is not + the inverse of `frame-visible-p'. It is possible for a frame to + not be visible and not be iconified either. However, if the frame + is iconified, it will not be visible. (Under FSF Emacs, the + functionality of this function is obtained through + `frame-visible-p'.) + + - Function: frame-totally-visible-p FRAME + This returns whether FRAME is not obscured by any other X windows. + On TTY frames, this is the same as `frame-visible-p'. + + +File: lispref.info, Node: Raising and Lowering, Next: Frame Configurations, Prev: Visibility of Frames, Up: Frames + +Raising and Lowering Frames +=========================== + + The X Window System uses a desktop metaphor. Part of this metaphor +is the idea that windows are stacked in a notional third dimension +perpendicular to the screen surface, and thus ordered from "highest" to +"lowest". Where two windows overlap, the one higher up covers the one +underneath. Even a window at the bottom of the stack can be seen if no +other window overlaps it. + + A window's place in this ordering is not fixed; in fact, users tend +to change the order frequently. "Raising" a window means moving it +"up", to the top of the stack. "Lowering" a window means moving it to +the bottom of the stack. This motion is in the notional third +dimension only, and does not change the position of the window on the +screen. + + You can raise and lower XEmacs's X windows with these functions: + + - Command: raise-frame &optional FRAME + This function raises frame FRAME. + + - Command: lower-frame &optional FRAME + This function lowers frame FRAME. + + You can also specify auto-raise (raising automatically when a frame +is selected) or auto-lower (lowering automatically when it is +deselected). Under X, most ICCCM-compliant window managers will have +an option to do this for you, but the following variables are provided +in case you're using a broken WM. (Under FSF Emacs, the same +functionality is provided through the `auto-raise' and `auto-lower' +frame properties.) + + - Variable: auto-raise-frame + This variable's value is `t' if frames will be raised to the top + when selected. + + - Variable: auto-lower-frame + This variable's value is `t' if frames will be lowered to the + bottom when no longer selected. + + Auto-raising and auto-lowering is implemented through functions +attached to `select-frame-hook' and `deselect-frame-hook' (*note Frame +Hooks::.). Under normal circumstances, you should not call these +functions directly. + + - Function: default-select-frame-hook + This hook function implements the `auto-raise-frame' variable; it + is for use as the value of `select-frame-hook'. + + - Function: default-deselect-frame-hook + This hook function implements the `auto-lower-frame' variable; it + is for use as the value of `deselect-frame-hook'. + + +File: lispref.info, Node: Frame Configurations, Next: Frame Hooks, Prev: Raising and Lowering, Up: Frames + +Frame Configurations +==================== + + A "frame configuration" records the current arrangement of frames, +all their properties, and the window configuration of each one. + + - Function: current-frame-configuration + This function returns a frame configuration list that describes + the current arrangement of frames and their contents. + + - Function: set-frame-configuration CONFIGURATION + This function restores the state of frames described in + CONFIGURATION. + + +File: lispref.info, Node: Frame Hooks, Prev: Frame Configurations, Up: Frames + +Hooks for Customizing Frame Behavior +==================================== + + XEmacs provides many hooks that are called at various times during a +frame's lifetime. *Note Hooks::. + + - Variable: create-frame-hook + This hook is called each time a frame is created. The functions + are called with one argument, the newly-created frame. + + - Variable: delete-frame-hook + This hook is called each time a frame is deleted. The functions + are called with one argument, the about-to-be-deleted frame. + + - Variable: select-frame-hook + This is a normal hook that is run just after a frame is selected. + The function `default-select-frame-hook', which implements + auto-raising (*note Raising and Lowering::.), is normally attached + to this hook. + + Note that calling `select-frame' does not necessarily set the + focus: The actual window-system focus will not be changed until + the next time that XEmacs is waiting for an event, and even then, + the window manager may refuse the focus-change request. + + - Variable: deselect-frame-hook + This is a normal hook that is run just before a frame is deselected + (and another frame is selected). The function + `default-deselect-frame-hook', which implements auto-lowering + (*note Raising and Lowering::.), is normally attached to this hook. + + - Variable: map-frame-hook + This hook is called each time a frame is mapped (i.e. made + visible). The functions are called with one argument, the newly + mapped frame. + + - Variable: unmap-frame-hook + This hook is called each time a frame is unmapped (i.e. made + invisible or iconified). The functions are called with one + argument, the newly unmapped frame. + + +File: lispref.info, Node: Consoles and Devices, Next: Positions, Prev: Frames, Up: Top + +Consoles and Devices +******************** + + A "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 X +display and a TTY connection). Normally, there is only one console in +existence. + + A "device" is an object representing a single output device, such as +a particular screen on an X display. (Usually there is exactly one +device per X console connection, but there may be more than one if you +have a multi-headed X display. For TTY connections, there is always +exactly one device per console.) + + Each device has one or more "frames" in which text can be displayed. +For X displays and the like, a frame corresponds to the normal +window-system concept of a window. Frames can overlap, be displayed at +various locations within the display, be resized, etc. For TTY, only +one frame can be displayed at a time, and it occupies the entire TTY +display area. + + However, you can still define multiple frames and switch between +them. Their contents are entirely separate from each other. These +sorts of frames resemble the "virtual console" capability provided +under Linux or the multiple screens provided by the multiplexing program +`screen' under Unix. + + When you start up XEmacs, an initial console and device are created +to receive input and display frames on. This will either be an X +display or a TTY connection, depending on what mode you started XEmacs +in (this is determined by the `DISPLAY' environment variable, the +`-nw', `-t' and `-display' command-line options, etc.). + + You can connect to other X displays and TTY connections by creating +new console objects, and to other X screens on an existing display by +creating new device objects, as described below. Many functions (for +example the frame-creation functions) take an optional device argument +specifying which device the function pertains to. If the argument is +omitted, it defaults to the selected device (see below). + + - Function: consolep OBJECT + This returns non-`nil' if OBJECT is a console. + + - Function: devicep OBJECT + This returns non-`nil' if OBJECT is a device. + +* Menu: + +* Basic Console Functions:: Functions for working with consoles. +* Basic Device Functions:: Functions for working with devices. +* Console Types and Device Classes:: + I/O and color characteristics. +* Connecting to a Console or Device:: +* The Selected Console and Device:: +* Console and Device I/O:: Controlling input and output. + + +File: lispref.info, Node: Basic Console Functions, Next: Basic Device Functions, Up: Consoles and Devices + +Basic Console Functions +======================= + + - Function: console-list + This function returns a list of all existing consoles. + + - Function: console-device-list &optional CONSOLE + This function returns a list of all devices on CONSOLE. If + CONSOLE is `nil', the selected console will be used. + + +File: lispref.info, Node: Basic Device Functions, Next: Console Types and Device Classes, Prev: Basic Console Functions, Up: Consoles and Devices + +Basic Device Functions +====================== + + - Function: device-list + This function returns a list of all existing devices. + + - Function: device-or-frame-p OBJECT + This function returns non-`nil' if OBJECT is a device or frame. + This function is useful because devices and frames are similar in + many respects and many functions can operate on either one. + + - Function: device-frame-list DEVICE + This function returns a list of all frames on DEVICE. + + - Function: frame-device FRAME + This function returns the device that FRAME is on. + + +File: lispref.info, Node: Console Types and Device Classes, Next: Connecting to a Console or Device, Prev: Basic Device Functions, Up: Consoles and Devices + +Console Types and Device Classes +================================ + + Every device is of a particular "type", which describes how the +connection to that device is made and how the device operates, and a +particular "class", which describes other characteristics of the device +(currently, the color capabilities of the device). + + The currently-defined device types are + +`x' + A connection to an X display (such as `willow:0'). + +`tty' + A connection to a tty (such as `/dev/ttyp3'). + +`stream' + A stdio connection. This describes a device for which input and + output is only possible in a stream-like fashion, such as when + XEmacs in running in batch mode. The very first device created by + XEmacs is a terminal device and is used to print out messages of + various sorts (for example, the help message when you use the + `-help' command-line option). + + The currently-defined device classes are +`color' + A color device. + +`grayscale' + A grayscale device (a device that can display multiple shades of + gray, but no color). + +`mono' + A device that can only display two colors (e.g. black and white). + + - Function: device-type DEVICE + This function returns the type of DEVICE. This is a symbol whose + name is one of the device types mentioned above. + + - Function: device-or-frame-type DEVICE-OR-FRAME + This function returns the type of DEVICE-OR-FRAME. + + - Function: device-class DEVICE + This function returns the class (color behavior) of DEVICE. This + is a symbol whose name is one of the device classes mentioned + above. + + - Function: valid-device-type-p DEVICE-TYPE + This function returns whether DEVICE-TYPE (which should be a + symbol) species a valid device type. + + - Function: valid-device-class-p DEVICE-CLASS + This function returns whether DEVICE-CLASS (which should be a + symbol) species a valid device class. + + - Variable: terminal-device + This variable holds the initial terminal device object, which + represents XEmacs's stdout. + + +File: lispref.info, Node: Connecting to a Console or Device, Next: The Selected Console and Device, Prev: Console Types and Device Classes, Up: Consoles and Devices + +Connecting to a Console or Device +================================= + + - Function: make-device &optional TYPE DEVICE-DATA + This function creates a new device. + + The following two functions create devices of specific types and are +written in terms of `make-device'. + + - Function: make-tty-device &optional TTY TERMINAL-TYPE + This function creates a new tty device on TTY. This also creates + the tty's first frame. TTY should be a string giving the name of + a tty device file (e.g. `/dev/ttyp3' under SunOS et al.), as + returned by the `tty' command issued from the Unix shell. A value + of `nil' means use the stdin and stdout as passed to XEmacs from + the shell. If TERMINAL-TYPE is non-`nil', it should be a string + specifying the type of the terminal attached to the specified tty. + If it is `nil', the terminal type will be inferred from the + `TERM' environment variable. + + - Function: make-x-device &optional DISPLAY ARGV-LIST + This function creates a new device connected to DISPLAY. Optional + argument ARGV-LIST is a list of strings describing command line + options. + + - Function: delete-device DEVICE + This function deletes DEVICE, permanently eliminating it from use. + This disconnects XEmacs's connection to the device. + + - Variable: create-device-hook + This variable, if non-`nil', should contain a list of functions, + which are called when a device is created. + + - Variable: delete-device-hook + This variable, if non-`nil', should contain a list of functions, + which are called when a device is deleted. + + - Function: console-live-p OBJECT + This function returns non-`nil' if OBJECT is a console that has + not been deleted. + + - Function: device-live-p OBJECT + This function returns non-`nil' if OBJECT is a device that has not + been deleted. + + - Function: device-x-display DEVICE + This function returns the X display which DEVICE is connected to, + if DEVICE is an X device. + + +File: lispref.info, Node: The Selected Console and Device, Next: Console and Device I/O, Prev: Connecting to a Console or Device, Up: Consoles and Devices + +The Selected Console and Device +=============================== + + - Function: select-console CONSOLE + This function selects the console CONSOLE. Subsequent editing + commands apply to its selected device, selected frame, and selected + window. The selection of CONSOLE lasts until the next time the + user does something to select a different console, or until the + next time this function is called. + + - Function: selected-console + This function returns the console which is currently active. + + - Function: select-device DEVICE + This function selects the device DEVICE. + + - Function: selected-device &optional CONSOLE + This function returns the device which is currently active. If + optional CONSOLE is non-`nil', this function returns the device + that would be currently active if CONSOLE were the selected + console. + + +File: lispref.info, Node: Console and Device I/O, Prev: The Selected Console and Device, Up: Consoles and Devices + +Console and Device I/O +====================== + + - Function: console-disable-input CONSOLE + This function disables input on console CONSOLE. + + - Function: console-enable-input CONSOLE + This function enables input on console CONSOLE. + + Each device has a "baud rate" value associated with it. On most +systems, changing this value will affect the amount of padding and +other strategic decisions made during redisplay. + + - Function: device-baud-rate &optional DEVICE + This function returns the output baud rate of DEVICE. + + - Function: set-device-baud-rate DEVICE RATE + This function sets the output baud rate of DEVICE to RATE. + + +File: lispref.info, Node: Positions, Next: Markers, Prev: Consoles and Devices, Up: Top + +Positions +********* + + A "position" is the index of a character in the text of a buffer. +More precisely, a position identifies the place between two characters +(or before the first character, or after the last character), so we can +speak of the character before or after a given position. However, we +often speak of the character "at" a position, meaning the character +after that position. + + Positions are usually represented as integers starting from 1, but +can also be represented as "markers"--special objects that relocate +automatically when text is inserted or deleted so they stay with the +surrounding characters. *Note Markers::. + +* Menu: + +* Point:: The special position where editing takes place. +* Motion:: Changing point. +* Excursions:: Temporary motion and buffer changes. +* Narrowing:: Restricting editing to a portion of the buffer. + + +File: lispref.info, Node: Point, Next: Motion, Up: Positions + +Point +===== + + "Point" is a special buffer position used by many editing commands, +including the self-inserting typed characters and text insertion +functions. Other commands move point through the text to allow editing +and insertion at different places. + + Like other positions, point designates a place between two characters +(or before the first character, or after the last character), rather +than a particular character. Usually terminals display the cursor over +the character that immediately follows point; point is actually before +the character on which the cursor sits. + + The value of point is a number between 1 and the buffer size plus 1. +If narrowing is in effect (*note Narrowing::.), then point is +constrained to fall within the accessible portion of the buffer +(possibly at one end of it). + + Each buffer has its own value of point, which is independent of the +value of point in other buffers. Each window also has a value of point, +which is independent of the value of point in other windows on the same +buffer. This is why point can have different values in various windows +that display the same buffer. When a buffer appears in only one window, +the buffer's point and the window's point normally have the same value, +so the distinction is rarely important. *Note Window Point::, for more +details. + + - Function: point &optional BUFFER + This function returns the value of point in BUFFER, as an integer. + BUFFER defaults to the current buffer if omitted. + + (point) + => 175 + + - Function: point-min &optional BUFFER + This function returns the minimum accessible value of point in + BUFFER. This is normally 1, but if narrowing is in effect, it is + the position of the start of the region that you narrowed to. + (*Note Narrowing::.) BUFFER defaults to the current buffer if + omitted. + + - Function: point-max &optional BUFFER + This function returns the maximum accessible value of point in + BUFFER. This is `(1+ (buffer-size buffer))', unless narrowing is + in effect, in which case it is the position of the end of the + region that you narrowed to. (*note Narrowing::.). BUFFER + defaults to the current buffer if omitted. + + - Function: buffer-end FLAG &optional BUFFER + This function returns `(point-min buffer)' if FLAG is less than 1, + `(point-max buffer)' otherwise. The argument FLAG must be a + number. BUFFER defaults to the current buffer if omitted. + + - Function: buffer-size &optional BUFFER + This function returns the total number of characters in BUFFER. + In the absence of any narrowing (*note Narrowing::.), `point-max' + returns a value one larger than this. BUFFER defaults to the + current buffer if omitted. + + (buffer-size) + => 35 + (point-max) + => 36 + + - Variable: buffer-saved-size + The value of this buffer-local variable is the former length of the + current buffer, as of the last time it was read in, saved or + auto-saved. + + +File: lispref.info, Node: Motion, Next: Excursions, Prev: Point, Up: Positions + +Motion +====== + + Motion functions change the value of point, either relative to the +current value of point, relative to the beginning or end of the buffer, +or relative to the edges of the selected window. *Note Point::. + +* Menu: + +* Character Motion:: Moving in terms of characters. +* Word Motion:: Moving in terms of words. +* Buffer End Motion:: Moving to the beginning or end of the buffer. +* Text Lines:: Moving in terms of lines of text. +* Screen Lines:: Moving in terms of lines as displayed. +* List Motion:: Moving by parsing lists and sexps. +* Skipping Characters:: Skipping characters belonging to a certain set. + + +File: lispref.info, Node: Character Motion, Next: Word Motion, Up: Motion + +Motion by Characters +-------------------- + + These functions move point based on a count of characters. +`goto-char' is the fundamental primitive; the other functions use that. + + - Command: goto-char POSITION &optional BUFFER + This function sets point in `buffer' to the value POSITION. If + POSITION is less than 1, it moves point to the beginning of the + buffer. If POSITION is greater than the length of the buffer, it + moves point to the end. BUFFER defaults to the current buffer if + omitted. + + If narrowing is in effect, POSITION still counts from the + beginning of the buffer, but point cannot go outside the accessible + portion. If POSITION is out of range, `goto-char' moves point to + the beginning or the end of the accessible portion. + + When this function is called interactively, POSITION is the + numeric prefix argument, if provided; otherwise it is read from the + minibuffer. + + `goto-char' returns POSITION. + + - Command: forward-char &optional COUNT BUFFER + This function moves point COUNT characters forward, towards the + end of the buffer (or backward, towards the beginning of the + buffer, if COUNT is negative). If the function attempts to move + point past the beginning or end of the buffer (or the limits of + the accessible portion, when narrowing is in effect), an error is + signaled with error code `beginning-of-buffer' or `end-of-buffer'. + BUFFER defaults to the current buffer if omitted. + + In an interactive call, COUNT is the numeric prefix argument. + + - Command: backward-char &optional COUNT BUFFER + This function moves point COUNT characters backward, towards the + beginning of the buffer (or forward, towards the end of the + buffer, if COUNT is negative). If the function attempts to move + point past the beginning or end of the buffer (or the limits of + the accessible portion, when narrowing is in effect), an error is + signaled with error code `beginning-of-buffer' or `end-of-buffer'. + BUFFER defaults to the current buffer if omitted. + + In an interactive call, COUNT is the numeric prefix argument. + + +File: lispref.info, Node: Word Motion, Next: Buffer End Motion, Prev: Character Motion, Up: Motion + +Motion by Words +--------------- + + These functions for parsing words use the syntax table to decide +whether a given character is part of a word. *Note Syntax Tables::. + + - Command: forward-word COUNT &optional BUFFER + This function moves point forward COUNT words (or backward if + COUNT is negative). Normally it returns `t'. If this motion + encounters the beginning or end of the buffer, or the limits of the + accessible portion when narrowing is in effect, point stops there + and the value is `nil'. BUFFER defaults to the current buffer if + omitted. + + In an interactive call, COUNT is set to the numeric prefix + argument. + + - Command: backward-word COUNT &optional BUFFER + This function is just like `forward-word', except that it moves + backward until encountering the front of a word, rather than + forward. BUFFER defaults to the current buffer if omitted. + + In an interactive call, COUNT is set to the numeric prefix + argument. + + This function is rarely used in programs, as it is more efficient + to call `forward-word' with a negative argument. + + - Variable: words-include-escapes + This variable affects the behavior of `forward-word' and everything + that uses it. If it is non-`nil', then characters in the "escape" + and "character quote" syntax classes count as part of words. + Otherwise, they do not. + + +File: lispref.info, Node: Buffer End Motion, Next: Text Lines, Prev: Word Motion, Up: Motion + +Motion to an End of the Buffer +------------------------------ + + To move point to the beginning of the buffer, write: + + (goto-char (point-min)) + +Likewise, to move to the end of the buffer, use: + + (goto-char (point-max)) + + Here are two commands that users use to do these things. They are +documented here to warn you not to use them in Lisp programs, because +they set the mark and display messages in the echo area. + + - Command: beginning-of-buffer &optional N + This function moves point to the beginning of the buffer (or the + limits of the accessible portion, when narrowing is in effect), + setting the mark at the previous position. If N is non-`nil', + then it puts point N tenths of the way from the beginning of the + buffer. + + In an interactive call, N is the numeric prefix argument, if + provided; otherwise N defaults to `nil'. + + Don't use this function in Lisp programs! + + - Command: end-of-buffer &optional N + This function moves point to the end of the buffer (or the limits + of the accessible portion, when narrowing is in effect), setting + the mark at the previous position. If N is non-`nil', then it puts + point N tenths of the way from the end of the buffer. + + In an interactive call, N is the numeric prefix argument, if + provided; otherwise N defaults to `nil'. + + Don't use this function in Lisp programs! + + +File: lispref.info, Node: Text Lines, Next: Screen Lines, Prev: Buffer End Motion, Up: Motion + +Motion by Text Lines +-------------------- + + Text lines are portions of the buffer delimited by newline +characters, which are regarded as part of the previous line. The first +text line begins at the beginning of the buffer, and the last text line +ends at the end of the buffer whether or not the last character is a +newline. The division of the buffer into text lines is not affected by +the width of the window, by line continuation in display, or by how +tabs and control characters are displayed. + + - Command: goto-line LINE + This function moves point to the front of the LINEth line, + counting from line 1 at beginning of the buffer. If LINE is less + than 1, it moves point to the beginning of the buffer. If LINE is + greater than the number of lines in the buffer, it moves point to + the end of the buffer--that is, the *end of the last line* of the + buffer. This is the only case in which `goto-line' does not + necessarily move to the beginning of a line. + + If narrowing is in effect, then LINE still counts from the + beginning of the buffer, but point cannot go outside the accessible + portion. So `goto-line' moves point to the beginning or end of the + accessible portion, if the line number specifies an inaccessible + position. + + The return value of `goto-line' is the difference between LINE and + the line number of the line to which point actually was able to + move (in the full buffer, before taking account of narrowing). + Thus, the value is positive if the scan encounters the real end of + the buffer. The value is zero if scan encounters the end of the + accessible portion but not the real end of the buffer. + + In an interactive call, LINE is the numeric prefix argument if one + has been provided. Otherwise LINE is read in the minibuffer. + + - Command: beginning-of-line &optional COUNT BUFFER + This function moves point to the beginning of the current line. + With an argument COUNT not `nil' or 1, it moves forward COUNT-1 + lines and then to the beginning of the line. BUFFER defaults to + the current buffer if omitted. + + If this function reaches the end of the buffer (or of the + accessible portion, if narrowing is in effect), it positions point + there. No error is signaled. + + - Command: end-of-line &optional COUNT BUFFER + This function moves point to the end of the current line. With an + argument COUNT not `nil' or 1, it moves forward COUNT-1 lines and + then to the end of the line. BUFFER defaults to the current + buffer if omitted. + + If this function reaches the end of the buffer (or of the + accessible portion, if narrowing is in effect), it positions point + there. No error is signaled. + + - Command: forward-line &optional COUNT BUFFER + This function moves point forward COUNT lines, to the beginning of + the line. If COUNT is negative, it moves point -COUNT lines + backward, to the beginning of a line. If COUNT is zero, it moves + point to the beginning of the current line. BUFFER defaults to + the current buffer if omitted. + + If `forward-line' encounters the beginning or end of the buffer (or + of the accessible portion) before finding that many lines, it sets + point there. No error is signaled. + + `forward-line' returns the difference between COUNT and the number + of lines actually moved. If you attempt to move down five lines + from the beginning of a buffer that has only three lines, point + stops at the end of the last line, and the value will be 2. + + In an interactive call, COUNT is the numeric prefix argument. + + - Function: count-lines START END + This function returns the number of lines between the positions + START and END in the current buffer. If START and END are equal, + then it returns 0. Otherwise it returns at least 1, even if START + and END are on the same line. This is because the text between + them, considered in isolation, must contain at least one line + unless it is empty. + + Here is an example of using `count-lines': + + (defun current-line () + "Return the vertical position of point..." + (+ (count-lines (window-start) (point)) + (if (= (current-column) 0) 1 0) + -1)) + + Also see the functions `bolp' and `eolp' in *Note Near Point::. +These functions do not move point, but test whether it is already at the +beginning or end of a line. + + +File: lispref.info, Node: Screen Lines, Next: List Motion, Prev: Text Lines, Up: Motion + +Motion by Screen Lines +---------------------- + + The line functions in the previous section count text lines, +delimited only by newline characters. By contrast, these functions +count screen lines, which are defined by the way the text appears on +the screen. A text line is a single screen line if it is short enough +to fit the width of the selected window, but otherwise it may occupy +several screen lines. + + In some cases, text lines are truncated on the screen rather than +continued onto additional screen lines. In these cases, +`vertical-motion' moves point much like `forward-line'. *Note +Truncation::. + + Because the width of a given string depends on the flags that control +the appearance of certain characters, `vertical-motion' behaves +differently, for a given piece of text, depending on the buffer it is +in, and even on the selected window (because the width, the truncation +flag, and display table may vary between windows). *Note Usual +Display::. + + These functions scan text to determine where screen lines break, and +thus take time proportional to the distance scanned. If you intend to +use them heavily, Emacs provides caches which may improve the +performance of your code. *Note cache-long-line-scans: Text Lines. + + - Function: vertical-motion COUNT &optional WINDOW PIXELS + This function moves point to the start of the frame line COUNT + frame lines down from the frame line containing point. If COUNT + is negative, it moves up instead. The optional second argument + WINDOW may be used to specify a window other than the selected + window in which to perform the motion. + + Normally, `vertical-motion' returns the number of lines moved. The + value may be less in absolute value than COUNT if the beginning or + end of the buffer was reached. If the optional third argument, + PIXELS is non-`nil', the vertical pixel height of the motion which + took place is returned instead of the actual number of lines + moved. A motion of zero lines returns the height of the current + line. + + Note that `vertical-motion' sets WINDOW's buffer's point, not + WINDOW's point. (This differs from FSF Emacs, which buggily always + sets current buffer's point, regardless of WINDOW.) + + - Function: vertical-motion-pixels COUNT &optional WINDOW HOW + This function moves point to the start of the frame line PIXELS + vertical pixels down from the frame line containing point, or up if + PIXELS is negative. The optional second argument WINDOW is the + window to move in, and defaults to the selected window. The + optional third argument HOW specifies the stopping condition. A + negative integer indicates that the motion should be no more than + PIXELS. A positive value indicates that the motion should be at + least PIXELS. Any other value indicates that the motion should be + as close as possible to PIXELS. + + - Command: move-to-window-line COUNT &optional WINDOW + This function moves point with respect to the text currently + displayed in WINDOW, which defaults to the selected window. It + moves point to the beginning of the screen line COUNT screen lines + from the top of the window. If COUNT is negative, that specifies a + position -COUNT lines from the bottom (or the last line of the + buffer, if the buffer ends above the specified screen position). + + If COUNT is `nil', then point moves to the beginning of the line + in the middle of the window. If the absolute value of COUNT is + greater than the size of the window, then point moves to the place + that would appear on that screen line if the window were tall + enough. This will probably cause the next redisplay to scroll to + bring that location onto the screen. + + In an interactive call, COUNT is the numeric prefix argument. + + The value returned is the window line number point has moved to, + with the top line in the window numbered 0. + + +File: lispref.info, Node: List Motion, Next: Skipping Characters, Prev: Screen Lines, Up: Motion + +Moving over Balanced Expressions +-------------------------------- + + Here are several functions concerned with balanced-parenthesis +expressions (also called "sexps" in connection with moving across them +in XEmacs). The syntax table controls how these functions interpret +various characters; see *Note Syntax Tables::. *Note Parsing +Expressions::, for lower-level primitives for scanning sexps or parts of +sexps. For user-level commands, see *Note Lists and Sexps: +(emacs)Lists and Sexps. + + - Command: forward-list &optional ARG + This function moves forward across ARG balanced groups of + parentheses. (Other syntactic entities such as words or paired + string quotes are ignored.) ARG defaults to 1 if omitted. If ARG + is negative, move backward across that many groups of parentheses. + + - Command: backward-list &optional ARG + This function moves backward across ARG balanced groups of + parentheses. (Other syntactic entities such as words or paired + string quotes are ignored.) ARG defaults to 1 if omitted. If ARG + is negative, move forward across that many groups of parentheses. + + - Command: up-list ARG + This function moves forward out of ARG levels of parentheses. A + negative argument means move backward but still to a less deep + spot. + + - Command: down-list ARG + This function moves forward into ARG levels of parentheses. A + negative argument means move backward but still go deeper in + parentheses (-ARG levels). + + - Command: forward-sexp &optional ARG + This function moves forward across ARG balanced expressions. + Balanced expressions include both those delimited by parentheses + and other kinds, such as words and string constants. ARG defaults + to 1 if omitted. If ARG is negative, move backward across that + many balanced expressions. For example, + + ---------- Buffer: foo ---------- + (concat-!- "foo " (car x) y z) + ---------- Buffer: foo ---------- + + (forward-sexp 3) + => nil + + ---------- Buffer: foo ---------- + (concat "foo " (car x) y-!- z) + ---------- Buffer: foo ---------- + + - Command: backward-sexp &optional ARG + This function moves backward across ARG balanced expressions. ARG + defaults to 1 if omitted. If ARG is negative, move forward across + that many balanced expressions. + + - Command: beginning-of-defun &optional ARG + This function moves back to the ARGth beginning of a defun. If + ARG is negative, this actually moves forward, but it still moves + to the beginning of a defun, not to the end of one. ARG defaults + to 1 if omitted. + + - Command: end-of-defun &optional ARG + This function moves forward to the ARGth end of a defun. If ARG + is negative, this actually moves backward, but it still moves to + the end of a defun, not to the beginning of one. ARG defaults to + 1 if omitted. + + - User Option: defun-prompt-regexp + If non-`nil', this variable holds a regular expression that + specifies what text can appear before the open-parenthesis that + starts a defun. That is to say, a defun begins on a line that + starts with a match for this regular expression, followed by a + character with open-parenthesis syntax. + + +File: lispref.info, Node: Skipping Characters, Prev: List Motion, Up: Motion + +Skipping Characters +------------------- + + The following two functions move point over a specified set of +characters. For example, they are often used to skip whitespace. For +related functions, see *Note Motion and Syntax::. + + - Function: skip-chars-forward CHARACTER-SET &optional LIMIT BUFFER + This function moves point in BUFFER forward, skipping over a given + set of characters. It examines the character following point, + then advances point if the character matches CHARACTER-SET. This + continues until it reaches a character that does not match. The + function returns `nil'. BUFFER defaults to the current buffer if + omitted. + + The argument CHARACTER-SET is like the inside of a `[...]' in a + regular expression except that `]' is never special and `\' quotes + `^', `-' or `\'. Thus, `"a-zA-Z"' skips over all letters, + stopping before the first non-letter, and `"^a-zA-Z'" skips + non-letters stopping before the first letter. *Note Regular + Expressions::. + + If LIMIT is supplied (it must be a number or a marker), it + specifies the maximum position in the buffer that point can be + skipped to. Point will stop at or before LIMIT. + + In the following example, point is initially located directly + before the `T'. After the form is evaluated, point is located at + the end of that line (between the `t' of `hat' and the newline). + The function skips all letters and spaces, but not newlines. + + ---------- Buffer: foo ---------- + I read "-!-The cat in the hat + comes back" twice. + ---------- Buffer: foo ---------- + + (skip-chars-forward "a-zA-Z ") + => nil + + ---------- Buffer: foo ---------- + I read "The cat in the hat-!- + comes back" twice. + ---------- Buffer: foo ---------- + + - Function: skip-chars-backward CHARACTER-SET &optional LIMIT BUFFER + This function moves point backward, skipping characters that match + CHARACTER-SET, until LIMIT. It just like `skip-chars-forward' + except for the direction of motion. + diff --git a/info/lispref.info-28 b/info/lispref.info-28 new file mode 100644 index 0000000..5fb9228 --- /dev/null +++ b/info/lispref.info-28 @@ -0,0 +1,1179 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Excursions, Next: Narrowing, Prev: Motion, Up: Positions + +Excursions +========== + + It is often useful to move point "temporarily" within a localized +portion of the program, or to switch buffers temporarily. This is +called an "excursion", and it is done with the `save-excursion' special +form. This construct saves the current buffer and its values of point +and the mark so they can be restored after the completion of the +excursion. + + The forms for saving and restoring the configuration of windows are +described elsewhere (see *Note Window Configurations:: and *note Frame +Configurations::.). + + - Special Form: save-excursion FORMS... + The `save-excursion' special form saves the identity of the current + buffer and the values of point and the mark in it, evaluates + FORMS, and finally restores the buffer and its saved values of + point and the mark. All three saved values are restored even in + case of an abnormal exit via `throw' or error (*note Nonlocal + Exits::.). + + The `save-excursion' special form is the standard way to switch + buffers or move point within one part of a program and avoid + affecting the rest of the program. It is used more than 500 times + in the Lisp sources of XEmacs. + + `save-excursion' does not save the values of point and the mark for + other buffers, so changes in other buffers remain in effect after + `save-excursion' exits. + + Likewise, `save-excursion' does not restore window-buffer + correspondences altered by functions such as `switch-to-buffer'. + One way to restore these correspondences, and the selected window, + is to use `save-window-excursion' inside `save-excursion' (*note + Window Configurations::.). + + The value returned by `save-excursion' is the result of the last of + FORMS, or `nil' if no FORMS are given. + + (save-excursion + FORMS) + == + (let ((old-buf (current-buffer)) + (old-pnt (point-marker)) + (old-mark (copy-marker (mark-marker)))) + (unwind-protect + (progn FORMS) + (set-buffer old-buf) + (goto-char old-pnt) + (set-marker (mark-marker) old-mark))) + + - Special Form: save-current-buffer FORMS... + This special form is similar to `save-excursion' but it only saves + and restores the current buffer. Beginning with XEmacs 20.3, + `save-current-buffer' is a primitive. + + - Special Form: with-current-buffer BUFFER FORMS... + This special form evaluates FORMS with BUFFER as the current + buffer. It returns the value of the last form. + + - Special Form: with-temp-file FILE FORMS... + This special form creates a new buffer, evaluates FORMS there, and + writes the buffer to FILE. It returns the value of the last form + evaluated. + + - Special Form: save-selected-window FORMS... + This special form is similar to `save-excursion' but it saves and + restores the selected window and nothing else. + + +File: lispref.info, Node: Narrowing, Prev: Excursions, Up: Positions + +Narrowing +========= + + "Narrowing" means limiting the text addressable by XEmacs editing +commands to a limited range of characters in a buffer. The text that +remains addressable is called the "accessible portion" of the buffer. + + Narrowing is specified with two buffer positions which become the +beginning and end of the accessible portion. For most editing commands +and most Emacs primitives, these positions replace the values of the +beginning and end of the buffer. While narrowing is in effect, no text +outside the accessible portion is displayed, and point cannot move +outside the accessible portion. + + Values such as positions or line numbers, which usually count from +the beginning of the buffer, do so despite narrowing, but the functions +which use them refuse to operate on text that is inaccessible. + + The commands for saving buffers are unaffected by narrowing; they +save the entire buffer regardless of any narrowing. + + - Command: narrow-to-region START END &optional BUFFER + This function sets the accessible portion of BUFFER to start at + START and end at END. Both arguments should be character + positions. BUFFER defaults to the current buffer if omitted. + + In an interactive call, START and END are set to the bounds of the + current region (point and the mark, with the smallest first). + + - Command: narrow-to-page &optional MOVE-COUNT + This function sets the accessible portion of the current buffer to + include just the current page. An optional first argument + MOVE-COUNT non-`nil' means to move forward or backward by + MOVE-COUNT pages and then narrow. The variable `page-delimiter' + specifies where pages start and end (*note Standard Regexps::.). + + In an interactive call, MOVE-COUNT is set to the numeric prefix + argument. + + - Command: widen &optional BUFFER + This function cancels any narrowing in BUFFER, so that the entire + contents are accessible. This is called "widening". It is + equivalent to the following expression: + + (narrow-to-region 1 (1+ (buffer-size))) + + BUFFER defaults to the current buffer if omitted. + + - Special Form: save-restriction BODY... + This special form saves the current bounds of the accessible + portion, evaluates the BODY forms, and finally restores the saved + bounds, thus restoring the same state of narrowing (or absence + thereof) formerly in effect. The state of narrowing is restored + even in the event of an abnormal exit via `throw' or error (*note + Nonlocal Exits::.). Therefore, this construct is a clean way to + narrow a buffer temporarily. + + The value returned by `save-restriction' is that returned by the + last form in BODY, or `nil' if no body forms were given. + + *Caution:* it is easy to make a mistake when using the + `save-restriction' construct. Read the entire description here + before you try it. + + If BODY changes the current buffer, `save-restriction' still + restores the restrictions on the original buffer (the buffer whose + restrictions it saved from), but it does not restore the identity + of the current buffer. + + `save-restriction' does *not* restore point and the mark; use + `save-excursion' for that. If you use both `save-restriction' and + `save-excursion' together, `save-excursion' should come first (on + the outside). Otherwise, the old point value would be restored + with temporary narrowing still in effect. If the old point value + were outside the limits of the temporary narrowing, this would + fail to restore it accurately. + + The `save-restriction' special form records the values of the + beginning and end of the accessible portion as distances from the + beginning and end of the buffer. In other words, it records the + amount of inaccessible text before and after the accessible + portion. + + This method yields correct results if BODY does further narrowing. + However, `save-restriction' can become confused if the body widens + and then make changes outside the range of the saved narrowing. + When this is what you want to do, `save-restriction' is not the + right tool for the job. Here is what you must use instead: + + (let ((beg (point-min-marker)) + (end (point-max-marker))) + (unwind-protect + (progn BODY) + (save-excursion + (set-buffer (marker-buffer beg)) + (narrow-to-region beg end)))) + + Here is a simple example of correct use of `save-restriction': + + ---------- Buffer: foo ---------- + This is the contents of foo + This is the contents of foo + This is the contents of foo-!- + ---------- Buffer: foo ---------- + + (save-excursion + (save-restriction + (goto-char 1) + (forward-line 2) + (narrow-to-region 1 (point)) + (goto-char (point-min)) + (replace-string "foo" "bar"))) + + ---------- Buffer: foo ---------- + This is the contents of bar + This is the contents of bar + This is the contents of foo-!- + ---------- Buffer: foo ---------- + + +File: lispref.info, Node: Markers, Next: Text, Prev: Positions, Up: Top + +Markers +******* + + A "marker" is a Lisp object used to specify a position in a buffer +relative to the surrounding text. A marker changes its offset from the +beginning of the buffer automatically whenever text is inserted or +deleted, so that it stays with the two characters on either side of it. + +* Menu: + +* Overview of Markers:: The components of a marker, and how it relocates. +* Predicates on Markers:: Testing whether an object is a marker. +* Creating Markers:: Making empty markers or markers at certain places. +* Information from Markers:: Finding the marker's buffer or character position. +* Changing Markers:: Moving the marker to a new buffer or position. +* The Mark:: How "the mark" is implemented with a marker. +* The Region:: How to access "the region". + + +File: lispref.info, Node: Overview of Markers, Next: Predicates on Markers, Up: Markers + +Overview of Markers +=================== + + A marker specifies a buffer and a position in that buffer. The +marker can be used to represent a position in the functions that +require one, just as an integer could be used. *Note Positions::, for +a complete description of positions. + + A marker has two attributes: the marker position, and the marker +buffer. The marker position is an integer that is equivalent (at a +given time) to the marker as a position in that buffer. But the +marker's position value can change often during the life of the marker. +Insertion and deletion of text in the buffer relocate the marker. The +idea is that a marker positioned between two characters remains between +those two characters despite insertion and deletion elsewhere in the +buffer. Relocation changes the integer equivalent of the marker. + + Deleting text around a marker's position leaves the marker between +the characters immediately before and after the deleted text. Inserting +text at the position of a marker normally leaves the marker in front of +the new text--unless it is inserted with `insert-before-markers' (*note +Insertion::.). + + Insertion and deletion in a buffer must check all the markers and +relocate them if necessary. This slows processing in a buffer with a +large number of markers. For this reason, it is a good idea to make a +marker point nowhere if you are sure you don't need it any more. +Unreferenced markers are garbage collected eventually, but until then +will continue to use time if they do point somewhere. + + Because it is common to perform arithmetic operations on a marker +position, most of the arithmetic operations (including `+' and `-') +accept markers as arguments. In such cases, the marker stands for its +current position. + + Note that you can use extents to achieve the same functionality, and +more, as markers. (Markers were defined before extents, which is why +they both continue to exist.) A zero-length extent with the +`detachable' property removed is almost identical to a marker. (*Note +Extent Endpoints::, for more information on zero-length extents.) + + In particular: + + * In order to get marker-like behavior in a zero-length extent, the + `detachable' property must be removed (otherwise, the extent will + disappear when text near it is deleted) and exactly one endpoint + must be closed (if both endpoints are closed, the extent will + expand to contain text inserted where it is located). + + * If a zero-length extent has the `end-open' property but not the + `start-open' property (this is the default), text inserted at the + extent's location causes the extent to move forward, just like a + marker. + + * If a zero-length extent has the `start-open' property but not the + `end-open' property, text inserted at the extent's location causes + the extent to remain before the text, like what happens to markers + when `insert-before-markers' is used. + + * Markers end up after or before inserted text depending on whether + `insert' or `insert-before-markers' was called. These functions + do not affect zero-length extents differently; instead, the + presence or absence of the `start-open' and `end-open' extent + properties determines this, as just described. + + * Markers are automatically removed from a buffer when they are no + longer in use. Extents remain around until explicitly removed + from a buffer. + + * Many functions are provided for listing the extents in a buffer or + in a region of a buffer. No such functions exist for markers. + + Here are examples of creating markers, setting markers, and moving +point to markers: + + ;; Make a new marker that initially does not point anywhere: + (setq m1 (make-marker)) + => # + + ;; Set `m1' to point between the 99th and 100th characters + ;; in the current buffer: + (set-marker m1 100) + => # + + ;; Now insert one character at the beginning of the buffer: + (goto-char (point-min)) + => 1 + (insert "Q") + => nil + + ;; `m1' is updated appropriately. + m1 + => # + + ;; Two markers that point to the same position + ;; are not `eq', but they are `equal'. + (setq m2 (copy-marker m1)) + => # + (eq m1 m2) + => nil + (equal m1 m2) + => t + + ;; When you are finished using a marker, make it point nowhere. + (set-marker m1 nil) + => # + + +File: lispref.info, Node: Predicates on Markers, Next: Creating Markers, Prev: Overview of Markers, Up: Markers + +Predicates on Markers +===================== + + You can test an object to see whether it is a marker, or whether it +is either an integer or a marker or either an integer, a character, or a +marker. The latter tests are useful in connection with the arithmetic +functions that work with any of markers, integers, or characters. + + - Function: markerp OBJECT + This function returns `t' if OBJECT is a marker, `nil' otherwise. + Note that integers are not markers, even though many functions + will accept either a marker or an integer. + + - Function: integer-or-marker-p OBJECT + This function returns `t' if OBJECT is an integer or a marker, + `nil' otherwise. + + - Function: integer-char-or-marker-p OBJECT + This function returns `t' if OBJECT is an integer, a character, or + a marker, `nil' otherwise. + + - Function: number-or-marker-p OBJECT + This function returns `t' if OBJECT is a number (either kind) or a + marker, `nil' otherwise. + + - Function: number-char-or-marker-p OBJECT + This function returns `t' if OBJECT is a number (either kind), a + character, or a marker, `nil' otherwise. + + +File: lispref.info, Node: Creating Markers, Next: Information from Markers, Prev: Predicates on Markers, Up: Markers + +Functions That Create Markers +============================= + + When you create a new marker, you can make it point nowhere, or point +to the present position of point, or to the beginning or end of the +accessible portion of the buffer, or to the same place as another given +marker. + + - Function: make-marker + This functions returns a newly created marker that does not point + anywhere. + + (make-marker) + => # + + - Function: point-marker &optional DONT-COPY-P BUFFER + This function returns a marker that points to the present position + of point in BUFFER, which defaults to the current buffer. *Note + Point::. For an example, see `copy-marker', below. + + Internally, a marker corresponding to point is always maintained. + Normally the marker returned by `point-marker' is a copy; you may + modify it with reckless abandon. However, if optional argument + DONT-COPY-P is non-`nil', then the real point-marker is returned; + modifying the position of this marker will move point. It is + illegal to change the buffer of it, or make it point nowhere. + + - Function: point-min-marker &optional BUFFER + This function returns a new marker that points to the beginning of + the accessible portion of BUFFER, which defaults to the current + buffer. This will be the beginning of the buffer unless narrowing + is in effect. *Note Narrowing::. + + - Function: point-max-marker &optional BUFFER + This function returns a new marker that points to the end of the + accessible portion of BUFFER, which defaults to the current + buffer. This will be the end of the buffer unless narrowing is in + effect. *Note Narrowing::. + + Here are examples of this function and `point-min-marker', shown in + a buffer containing a version of the source file for the text of + this chapter. + + (point-min-marker) + => # + (point-max-marker) + => # + + (narrow-to-region 100 200) + => nil + (point-min-marker) + => # + (point-max-marker) + => # + + - Function: copy-marker MARKER-OR-INTEGER + If passed a marker as its argument, `copy-marker' returns a new + marker that points to the same place and the same buffer as does + MARKER-OR-INTEGER. If passed an integer as its argument, + `copy-marker' returns a new marker that points to position + MARKER-OR-INTEGER in the current buffer. + + If passed an integer argument less than 1, `copy-marker' returns a + new marker that points to the beginning of the current buffer. If + passed an integer argument greater than the length of the buffer, + `copy-marker' returns a new marker that points to the end of the + buffer. + + An error is signaled if MARKER is neither a marker nor an integer. + + (setq p (point-marker)) + => # + + (setq q (copy-marker p)) + => # + + (eq p q) + => nil + + (equal p q) + => t + + (point) + => 2139 + + (set-marker p 3000) + => # + + (point) + => 2139 + + (setq p (point-marker t)) + => # + + (set-marker p 3000) + => # + + (point) + => 3000 + + (copy-marker 0) + => # + + (copy-marker 20000) + => # + + +File: lispref.info, Node: Information from Markers, Next: Changing Markers, Prev: Creating Markers, Up: Markers + +Information from Markers +======================== + + This section describes the functions for accessing the components of +a marker object. + + - Function: marker-position MARKER + This function returns the position that MARKER points to, or `nil' + if it points nowhere. + + - Function: marker-buffer MARKER + This function returns the buffer that MARKER points into, or `nil' + if it points nowhere. + + (setq m (make-marker)) + => # + (marker-position m) + => nil + (marker-buffer m) + => nil + + (set-marker m 3770 (current-buffer)) + => # + (marker-buffer m) + => # + (marker-position m) + => 3770 + + Two distinct markers are considered `equal' (even though not `eq') +to each other if they have the same position and buffer, or if they +both point nowhere. + + +File: lispref.info, Node: Changing Markers, Next: The Mark, Prev: Information from Markers, Up: Markers + +Changing Marker Positions +========================= + + This section describes how to change the position of an existing +marker. When you do this, be sure you know whether the marker is used +outside of your program, and, if so, what effects will result from +moving it--otherwise, confusing things may happen in other parts of +Emacs. + + - Function: set-marker MARKER POSITION &optional BUFFER + This function moves MARKER to POSITION in BUFFER. If BUFFER is + not provided, it defaults to the current buffer. + + If POSITION is less than 1, `set-marker' moves MARKER to the + beginning of the buffer. If POSITION is greater than the size of + the buffer, `set-marker' moves marker to the end of the buffer. + If POSITION is `nil' or a marker that points nowhere, then MARKER + is set to point nowhere. + + The value returned is MARKER. + + (setq m (point-marker)) + => # + (set-marker m 55) + => # + (setq b (get-buffer "foo")) + => # + (set-marker m 0 b) + => # + + - Function: move-marker MARKER POSITION &optional BUFFER + This is another name for `set-marker'. + + +File: lispref.info, Node: The Mark, Next: The Region, Prev: Changing Markers, Up: Markers + +The Mark +======== + + One special marker in each buffer is designated "the mark". It +records a position for the user for the sake of commands such as `C-w' +and `C-x '. Lisp programs should set the mark only to values that +have a potential use to the user, and never for their own internal +purposes. For example, the `replace-regexp' command sets the mark to +the value of point before doing any replacements, because this enables +the user to move back there conveniently after the replace is finished. + + Once the mark "exists" in a buffer, it normally never ceases to +exist. However, it may become "inactive", and usually does so after +each command (other than simple motion commands and some commands that +explicitly activate the mark). When the mark is active, the region +between point and the mark is called the "active region" and is +highlighted specially. + + Many commands are designed so that when called interactively they +operate on the text between point and the mark. Such commands work +only when an active region exists, i.e. when the mark is active. (The +reason for this is to prevent you from accidentally deleting or +changing large chunks of your text.) If you are writing such a command, +don't examine the mark directly; instead, use `interactive' with the +`r' specification. This provides the values of point and the mark as +arguments to the command in an interactive call, but permits other Lisp +programs to specify arguments explicitly, and automatically signals an +error if the command is called interactively when no active region +exists. *Note Interactive Codes::. + + Each buffer has its own value of the mark that is independent of the +value of the mark in other buffers. (When a buffer is created, the mark +exists but does not point anywhere. We consider this state as "the +absence of a mark in that buffer.") However, only one active region can +exist at a time. Activating the mark in one buffer automatically +deactivates an active mark in any other buffer. Note that the user can +explicitly activate a mark at any time by using the command +`activate-region' (normally bound to `M-C-z') or by using the command +`exchange-point-and-mark' (normally bound to `C-x C-x'), which has the +side effect of activating the mark. + + Some people do not like active regions, so they disable this behavior +by setting the variable `zmacs-regions' to `nil'. This makes the mark +always active (except when a buffer is just created and the mark points +nowhere), and turns off the highlighting of the region between point +and the mark. Commands that explicitly retrieve the value of the mark +should make sure that they behave correctly and consistently +irrespective of the setting of `zmacs-regions'; some primitives are +provided to ensure this behavior. + + In addition to the mark, each buffer has a "mark ring" which is a +list of markers containing previous values of the mark. When editing +commands change the mark, they should normally save the old value of the +mark on the mark ring. The variable `mark-ring-max' specifies the +maximum number of entries in the mark ring; once the list becomes this +long, adding a new element deletes the last element. + + - Function: mark &optional FORCE BUFFER + This function returns BUFFER's mark position as an integer. + BUFFER defaults to the current buffer if omitted. + + If the mark is inactive, `mark' normally returns `nil'. However, + if FORCE is non-`nil', then `mark' returns the mark position + anyway--or `nil', if the mark is not yet set for the buffer. + + (Remember that if ZMACS-REGIONS is `nil', the mark is always + active as long as it exists, and the FORCE argument will have no + effect.) + + If you are using this in an editing command, you are most likely + making a mistake; see the documentation of `set-mark' below. + + - Function: mark-marker INACTIVE-P BUFFER + This function returns BUFFER's mark. BUFFER defaults to the + current buffer if omitted. This is the very marker that records + the mark location inside XEmacs, not a copy. Therefore, changing + this marker's position will directly affect the position of the + mark. Don't do it unless that is the effect you want. + + If the mark is inactive, `mark-marker' normally returns `nil'. + However, if FORCE is non-`nil', then `mark-marker' returns the + mark anyway. + (setq m (mark-marker)) + => # + (set-marker m 100) + => # + (mark-marker) + => # + + Like any marker, this marker can be set to point at any buffer you + like. We don't recommend that you make it point at any buffer + other than the one of which it is the mark. If you do, it will + yield perfectly consistent, but rather odd, results. + + - Function: set-mark POSITION &optional BUFFER + This function sets `buffer''s mark to POSITION, and activates the + mark. BUFFER defaults to the current buffer if omitted. The old + value of the mark is *not* pushed onto the mark ring. + + *Please note:* Use this function only if you want the user to see + that the mark has moved, and you want the previous mark position to + be lost. Normally, when a new mark is set, the old one should go + on the `mark-ring'. For this reason, most applications should use + `push-mark' and `pop-mark', not `set-mark'. + + Novice XEmacs Lisp programmers often try to use the mark for the + wrong purposes. The mark saves a location for the user's + convenience. An editing command should not alter the mark unless + altering the mark is part of the user-level functionality of the + command. (And, in that case, this effect should be documented.) + To remember a location for internal use in the Lisp program, store + it in a Lisp variable. For example: + + (let ((beg (point))) + (forward-line 1) + (delete-region beg (point))). + + - Command: exchange-point-and-mark &optional DONT-ACTIVATE-REGION + This function exchanges the positions of point and the mark. It + is intended for interactive use. The mark is also activated + unless DONT-ACTIVATE-REGION is non-`nil'. + + - Function: push-mark &optional POSITION NOMSG ACTIVATE BUFFER + This function sets BUFFER's mark to POSITION, and pushes a copy of + the previous mark onto `mark-ring'. BUFFER defaults to the + current buffer if omitted. If POSITION is `nil', then the value + of point is used. `push-mark' returns `nil'. + + If the last global mark pushed was not in BUFFER, also push + POSITION on the global mark ring (see below). + + The function `push-mark' normally *does not* activate the mark. + To do that, specify `t' for the argument ACTIVATE. + + A `Mark set' message is displayed unless NOMSG is non-`nil'. + + - Function: pop-mark + This function pops off the top element of `mark-ring' and makes + that mark become the buffer's actual mark. This does not move + point in the buffer, and it does nothing if `mark-ring' is empty. + It deactivates the mark. + + The return value is not meaningful. + + - Variable: mark-ring + The value of this buffer-local variable is the list of saved former + marks of the current buffer, most recent first. + + mark-ring + => (# + # + ...) + + - User Option: mark-ring-max + The value of this variable is the maximum size of `mark-ring'. If + more marks than this are pushed onto the `mark-ring', `push-mark' + discards an old mark when it adds a new one. + + In additional to a per-buffer mark ring, there is a "global mark +ring". Marks are pushed onto the global mark ring the first time you +set a mark after switching buffers. + + - Variable: global-mark-ring + The value of this variable is the list of saved former global + marks, most recent first. + + - User Option: mark-ring-max + The value of this variable is the maximum size of + `global-mark-ring'. If more marks than this are pushed onto the + `global-mark-ring', `push-mark' discards an old mark when it adds + a new one. + + - Command: pop-global-mark + This function pops a mark off the global mark ring and jumps to + that location. + + +File: lispref.info, Node: The Region, Prev: The Mark, Up: Markers + +The Region +========== + + The text between point and the mark is known as "the region". +Various functions operate on text delimited by point and the mark, but +only those functions specifically related to the region itself are +described here. + + When `zmacs-regions' is non-`nil' (this is the default), the concept +of an "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. +*Note The Mark::, for more information about active regions. + + - User Option: zmacs-regions + If non-`nil' (the default), active regions are used. *Note The + Mark::, for a detailed explanation of what this means. + + A number of functions are provided for explicitly determining the +bounds of the region and whether it is active. Few programs need to use +these functions, however. A command designed to operate on a region +should normally use `interactive' with the `r' specification to find +the beginning and end of the region. This lets other Lisp programs +specify the bounds explicitly as arguments and automatically respects +the user's setting for ZMACS-REGIONS. (*Note Interactive Codes::.) + + - Function: region-beginning &optional BUFFER + This function returns the position of the beginning of BUFFER's + region (as an integer). This is the position of either point or + the mark, whichever is smaller. BUFFER defaults to the current + buffer if omitted. + + If the mark does not point anywhere, an error is signaled. Note + that this function ignores whether the region is active. + + - Function: region-end &optional BUFFER + This function returns the position of the end of BUFFER's region + (as an integer). This is the position of either point or the mark, + whichever is larger. BUFFER defaults to the current buffer if + omitted. + + If the mark does not point anywhere, an error is signaled. Note + that this function ignores whether the region is active. + + - Function: region-exists-p + This function is non-`nil' 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. If this function + returns `nil', a function that uses the `r' interactive + specification will cause an error when called interactively. + + - Function: region-active-p + If `zmacs-regions' is true, this is equivalent to + `region-exists-p'. Otherwise, this function always returns false. + This function is used by commands such as + `fill-paragraph-or-region' and `capitalize-region-or-word', which + operate either on the active region or on something else (e.g. the + word or paragraph at point). + + - Variable: zmacs-region-stays + If a command sets this variable to true, the currently active + region will remain activated when the command finishes. (Normally + the region is deactivated when each command terminates.) If + ZMACS-REGIONS is false, however, this has no effect. Under normal + circumstances, you do not need to set this; use the interactive + specification `_' instead, if you want the region to remain active. + + - Function: zmacs-activate-region + This function activates the region in the current buffer (this is + equivalent to activating the current buffer's mark). This will + normally also highlight the text in the active region and set + ZMACS-REGION-STAYS to `t'. (If ZMACS-REGIONS is false, however, + this function has no effect.) + + - Function: zmacs-deactivate-region + This function deactivates the region in the current buffer (this is + equivalent to deactivating the current buffer's mark). This will + normally also unhighlight the text in the active region and set + ZMACS-REGION-STAYS to `nil'. (If ZMACS-REGIONS is false, however, + this function has no effect.) + + - Function: zmacs-update-region + This function updates the active region, if it's currently active. + (If there is no active region, this function does nothing.) This + has the effect of updating the highlighting on the text in the + region; but you should never need to call this except under rather + strange circumstances. The command loop automatically calls it + when appropriate. Calling this function will call the hook + `zmacs-update-region-hook', if the region is active. + + - Variable: zmacs-activate-region-hook + This normal hook is called when a region becomes active. (Usually + this happens as a result of a command that activates the region, + such as `set-mark-command', `activate-region', or + `exchange-point-and-mark'.) Note that calling + `zmacs-activate-region' will call this hook, even if the region is + already active. If ZMACS-REGIONS is false, however, this hook + will never get called under any circumstances. + + - Variable: zmacs-deactivate-region-hook + This normal hook is called when an active region becomes inactive. + (Calling `zmacs-deactivate-region' when the region is inactive will + *not* cause this hook to be called.) If ZMACS-REGIONS is false, + this hook will never get called. + + - Variable: zmacs-update-region-hook + This normal hook is called when an active region is "updated" by + `zmacs-update-region'. This normally gets called at the end of + each command that sets ZMACS-REGION-STAYS to `t', indicating that + the region should remain activated. The motion commands do this. + + +File: lispref.info, Node: Text, Next: Searching and Matching, Prev: Markers, Up: Top + +Text +**** + + This chapter describes the functions that deal with the text in a +buffer. Most examine, insert, or delete text in the current buffer, +often in the vicinity of point. Many are interactive. All the +functions that change the text provide for undoing the changes (*note +Undo::.). + + Many text-related functions operate on a region of text defined by +two buffer positions passed in arguments named START and END. These +arguments should be either markers (*note Markers::.) or numeric +character positions (*note Positions::.). The order of these arguments +does not matter; it is all right for START to be the end of the region +and END the beginning. For example, `(delete-region 1 10)' and +`(delete-region 10 1)' are equivalent. An `args-out-of-range' error is +signaled if either START or END is outside the accessible portion of +the buffer. In an interactive call, point and the mark are used for +these arguments. + + Throughout this chapter, "text" refers to the characters in the +buffer, together with their properties (when relevant). + +* Menu: + +* Near Point:: Examining text in the vicinity of point. +* Buffer Contents:: Examining text in a general fashion. +* Comparing Text:: Comparing substrings of buffers. +* Insertion:: Adding new text to a buffer. +* Commands for Insertion:: User-level commands to insert text. +* Deletion:: Removing text from a buffer. +* User-Level Deletion:: User-level commands to delete text. +* The Kill Ring:: Where removed text sometimes is saved for later use. +* Undo:: Undoing changes to the text of a buffer. +* Maintaining Undo:: How to enable and disable undo information. + How to control how much information is kept. +* Filling:: Functions for explicit filling. +* Margins:: How to specify margins for filling commands. +* Auto Filling:: How auto-fill mode is implemented to break lines. +* Sorting:: Functions for sorting parts of the buffer. +* Columns:: Computing horizontal positions, and using them. +* Indentation:: Functions to insert or adjust indentation. +* Case Changes:: Case conversion of parts of the buffer. +* Text Properties:: Assigning Lisp property lists to text characters. +* Substitution:: Replacing a given character wherever it appears. +* Registers:: How registers are implemented. Accessing the text or + position stored in a register. +* Transposition:: Swapping two portions of a buffer. +* Change Hooks:: Supplying functions to be run when text is changed. +* Transformations:: MD5 and base64 support. + + +File: lispref.info, Node: Near Point, Next: Buffer Contents, Up: Text + +Examining Text Near Point +========================= + + Many functions are provided to look at the characters around point. +Several simple functions are described here. See also `looking-at' in +*Note Regexp Search::. + + Many of these functions take an optional BUFFER argument. In all +such cases, the current buffer will be used if this argument is +omitted. (In FSF Emacs, and earlier versions of XEmacs, these functions +usually did not have these optional BUFFER arguments and always +operated on the current buffer.) + + - Function: char-after POSITION &optional BUFFER + This function returns the character in the buffer at (i.e., + immediately after) position POSITION. If 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 `nil'. If optional argument + BUFFER is `nil', the current buffer is assumed. + + In the following example, assume that the first character in the + buffer is `@': + + (char-to-string (char-after 1)) + => "@" + + - Function: following-char &optional BUFFER + This function returns the character following point in the buffer. + This is similar to `(char-after (point))'. However, if point is at + the end of the buffer, then the result of `following-char' is 0. + If optional argument BUFFER is `nil', the current buffer is + assumed. + + Remember that point is always between characters, and the terminal + cursor normally appears over the character following point. + Therefore, the character returned by `following-char' is the + character the cursor is over. + + In this example, point is between the `a' and the `c'. + + ---------- Buffer: foo ---------- + Gentlemen may cry ``Pea-!-ce! Peace!,'' + but there is no peace. + ---------- Buffer: foo ---------- + + (char-to-string (preceding-char)) + => "a" + (char-to-string (following-char)) + => "c" + + - Function: preceding-char &optional BUFFER + This function returns the character preceding point in the buffer. + See above, under `following-char', for an example. If point is at + the beginning of the buffer, `preceding-char' returns 0. If + optional argument BUFFER is `nil', the current buffer is assumed. + + - Function: bobp &optional BUFFER + This function returns `t' if point is at the beginning of the + buffer. If narrowing is in effect, this means the beginning of the + accessible portion of the text. If optional argument BUFFER is + `nil', the current buffer is assumed. See also `point-min' in + *Note Point::. + + - Function: eobp &optional BUFFER + This function returns `t' if point is at the end of the buffer. + If narrowing is in effect, this means the end of accessible + portion of the text. If optional argument BUFFER is `nil', the + current buffer is assumed. See also `point-max' in *Note Point::. + + - Function: bolp &optional BUFFER + This function returns `t' if point is at the beginning of a line. + If optional argument BUFFER is `nil', the current buffer is + assumed. *Note Text Lines::. The beginning of the buffer (or its + accessible portion) always counts as the beginning of a line. + + - Function: eolp &optional BUFFER + This function returns `t' if point is at the end of a line. The + end of the buffer is always considered the end of a line. If + optional argument BUFFER is `nil', the current buffer is assumed. + The end of the buffer (or of its accessible portion) is always + considered the end of a line. + + +File: lispref.info, Node: Buffer Contents, Next: Comparing Text, Prev: Near Point, Up: Text + +Examining Buffer Contents +========================= + + This section describes two functions that allow a Lisp program to +convert any portion of the text in the buffer into a string. + + - Function: buffer-substring START END &optional BUFFER + - Function: buffer-string START END &optional BUFFER + These functions are equivalent and return a string containing a + copy of the text of the region defined by positions START and END + in the buffer. If the arguments are not positions in the + accessible portion of the buffer, `buffer-substring' signals an + `args-out-of-range' error. If optional argument BUFFER is `nil', + the current buffer is assumed. + + If the region delineated by START and END contains duplicable + extents, they will be remembered in the string. *Note Duplicable + Extents::. + + It is not necessary for START to be less than END; the arguments + can be given in either order. But most often the smaller argument + is written first. + + ---------- Buffer: foo ---------- + This is the contents of buffer foo + + ---------- Buffer: foo ---------- + + (buffer-substring 1 10) + => "This is t" + (buffer-substring (point-max) 10) + => "he contents of buffer foo + " + + +File: lispref.info, Node: Comparing Text, Next: Insertion, Prev: Buffer Contents, Up: Text + +Comparing Text +============== + + This function lets you compare portions of the text in a buffer, +without copying them into strings first. + + - Function: compare-buffer-substrings BUFFER1 START1 END1 BUFFER2 + START2 END2 + This function lets you compare two substrings of the same buffer + or two different buffers. The first three arguments specify one + substring, giving a buffer and two positions within the buffer. + The last three arguments specify the other substring in the same + way. You can use `nil' for BUFFER1, BUFFER2, or both to stand for + the current buffer. + + The value is negative if the first substring is less, positive if + the first is greater, and zero if they are equal. The absolute + value of the result is one plus the index of the first differing + characters within the substrings. + + This function ignores case when comparing characters if + `case-fold-search' is non-`nil'. It always ignores text + properties. + + Suppose the current buffer contains the text `foobarbar + haha!rara!'; then in this example the two substrings are `rbar ' + and `rara!'. The value is 2 because the first substring is greater + at the second character. + + (compare-buffer-substring nil 6 11 nil 16 21) + => 2 + + +File: lispref.info, Node: Insertion, Next: Commands for Insertion, Prev: Comparing Text, Up: Text + +Inserting Text +============== + + "Insertion" means adding new text to a buffer. The inserted text +goes at point--between the character before point and the character +after point. + + Insertion relocates markers that point at positions after the +insertion point, so that they stay with the surrounding text (*note +Markers::.). When a marker points at the place of insertion, insertion +normally doesn't relocate the marker, so that it points to the +beginning of the inserted text; however, certain special functions such +as `insert-before-markers' relocate such markers to point after the +inserted text. + + Some insertion functions leave point before the inserted text, while +other functions leave it after. We call the former insertion "after +point" and the latter insertion "before point". + + If a string with non-`nil' extent data is inserted, the remembered +extents will also be inserted. *Note Duplicable Extents::. + + Insertion functions signal an error if the current buffer is +read-only. + + These functions copy text characters from strings and buffers along +with their properties. The inserted characters have exactly the same +properties as the characters they were copied from. By contrast, +characters specified as separate arguments, not part of a string or +buffer, inherit their text properties from the neighboring text. + + - Function: insert &rest ARGS + This function inserts the strings and/or characters ARGS into the + current buffer, at point, moving point forward. In other words, it + inserts the text before point. An error is signaled unless all + ARGS are either strings or characters. The value is `nil'. + + - Function: insert-before-markers &rest ARGS + This function inserts the strings and/or characters ARGS into the + current buffer, at point, moving point forward. An error is + signaled unless all ARGS are either strings or characters. The + value is `nil'. + + This function is unlike the other insertion functions in that it + relocates markers initially pointing at the insertion point, to + point after the inserted text. + + - Function: insert-string STRING &optional BUFFER + This function inserts STRING into BUFFER before point. BUFFER + defaults to the current buffer if omitted. This function is + chiefly useful if you want to insert a string in a buffer other + than the current one (otherwise you could just use `insert'). + + - Function: insert-char CHARACTER COUNT &optional BUFFER + This function inserts COUNT instances of CHARACTER into BUFFER + before point. COUNT must be a number, and CHARACTER must be a + character. The value is `nil'. If optional argument BUFFER is + `nil', the current buffer is assumed. (In FSF Emacs, the third + argument is called INHERIT and refers to text properties.) + + - Function: insert-buffer-substring FROM-BUFFER-OR-NAME &optional + START END + This function inserts a portion of buffer FROM-BUFFER-OR-NAME + (which must already exist) into the current buffer before point. + The text inserted is the region from START and END. (These + arguments default to the beginning and end of the accessible + portion of that buffer.) This function returns `nil'. + + In this example, the form is executed with buffer `bar' as the + current buffer. We assume that buffer `bar' is initially empty. + + ---------- Buffer: foo ---------- + We hold these truths to be self-evident, that all + ---------- Buffer: foo ---------- + + (insert-buffer-substring "foo" 1 20) + => nil + + ---------- Buffer: bar ---------- + We hold these truth-!- + ---------- Buffer: bar ---------- + diff --git a/info/lispref.info-29 b/info/lispref.info-29 new file mode 100644 index 0000000..257c44c --- /dev/null +++ b/info/lispref.info-29 @@ -0,0 +1,995 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Commands for Insertion, Next: Deletion, Prev: Insertion, Up: Text + +User-Level Insertion Commands +============================= + + This section describes higher-level commands for inserting text, +commands intended primarily for the user but useful also in Lisp +programs. + + - Command: insert-buffer FROM-BUFFER-OR-NAME + This command inserts the entire contents of FROM-BUFFER-OR-NAME + (which must exist) into the current buffer after point. It leaves + the mark after the inserted text. The value is `nil'. + + - Command: self-insert-command COUNT + This command inserts the last character typed; it does so COUNT + times, before point, and returns `nil'. Most printing characters + are bound to this command. In routine use, `self-insert-command' + is the most frequently called function in XEmacs, but programs + rarely use it except to install it on a keymap. + + In an interactive call, COUNT is the numeric prefix argument. + + This command calls `auto-fill-function' whenever that is non-`nil' + and the character inserted is a space or a newline (*note Auto + Filling::.). + + This command performs abbrev expansion if Abbrev mode is enabled + and the inserted character does not have word-constituent syntax. + (*Note Abbrevs::, and *Note Syntax Class Table::.) + + This is also responsible for calling `blink-paren-function' when + the inserted character has close parenthesis syntax (*note + Blinking::.). + + - Command: newline &optional NUMBER-OF-NEWLINES + This command inserts newlines into the current buffer before point. + If NUMBER-OF-NEWLINES is supplied, that many newline characters + are inserted. + + This function calls `auto-fill-function' if the current column + number is greater than the value of `fill-column' and + NUMBER-OF-NEWLINES is `nil'. Typically what `auto-fill-function' + does is insert a newline; thus, the overall result in this case is + to insert two newlines at different places: one at point, and + another earlier in the line. `newline' does not auto-fill if + NUMBER-OF-NEWLINES is non-`nil'. + + This command indents to the left margin if that is not zero. + *Note Margins::. + + The value returned is `nil'. In an interactive call, COUNT is the + numeric prefix argument. + + - Command: split-line + This command splits the current line, moving the portion of the + line after point down vertically so that it is on the next line + directly below where it was before. Whitespace is inserted as + needed at the beginning of the lower line, using the `indent-to' + function. `split-line' returns the position of point. + + Programs hardly ever use this function. + + - Variable: overwrite-mode + This variable controls whether overwrite mode is in effect: a + non-`nil' value enables the mode. It is automatically made + buffer-local when set in any fashion. + + +File: lispref.info, Node: Deletion, Next: User-Level Deletion, Prev: Commands for Insertion, Up: Text + +Deleting Text +============= + + Deletion means removing part of the text in a buffer, without saving +it in the kill ring (*note The Kill Ring::.). Deleted text can't be +yanked, but can be reinserted using the undo mechanism (*note Undo::.). +Some deletion functions do save text in the kill ring in some special +cases. + + All of the deletion functions operate on the current buffer, and all +return a value of `nil'. + + - Function: erase-buffer &optional BUFFER + This function deletes the entire text of BUFFER, leaving it empty. + If the buffer is read-only, it signals a `buffer-read-only' + error. Otherwise, it deletes the text without asking for any + confirmation. It returns `nil'. BUFFER defaults to the current + buffer if omitted. + + Normally, deleting a large amount of text from a buffer inhibits + further auto-saving of that buffer "because it has shrunk". + However, `erase-buffer' does not do this, the idea being that the + future text is not really related to the former text, and its size + should not be compared with that of the former text. + + - Command: delete-region START END &optional BUFFER + This command deletes the text in BUFFER in the region defined by + START and END. The value is `nil'. If optional argument BUFFER + is `nil', the current buffer is assumed. + + - Command: delete-char COUNT &optional KILLP + This command deletes COUNT characters directly after point, or + before point if COUNT is negative. If KILLP is non-`nil', then it + saves the deleted characters in the kill ring. + + In an interactive call, COUNT is the numeric prefix argument, and + KILLP is the unprocessed prefix argument. Therefore, if a prefix + argument is supplied, the text is saved in the kill ring. If no + prefix argument is supplied, then one character is deleted, but + not saved in the kill ring. + + The value returned is always `nil'. + + - Command: delete-backward-char COUNT &optional KILLP + This command deletes COUNT characters directly before point, or + after point if COUNT is negative. If KILLP is non-`nil', then it + saves the deleted characters in the kill ring. + + In an interactive call, COUNT is the numeric prefix argument, and + KILLP is the unprocessed prefix argument. Therefore, if a prefix + argument is supplied, the text is saved in the kill ring. If no + prefix argument is supplied, then one character is deleted, but + not saved in the kill ring. + + The value returned is always `nil'. + + - Command: backward-delete-char-untabify COUNT &optional KILLP + This command deletes COUNT characters backward, changing tabs into + spaces. When the next character to be deleted is a tab, it is + first replaced with the proper number of spaces to preserve + alignment and then one of those spaces is deleted instead of the + tab. If KILLP is non-`nil', then the command saves the deleted + characters in the kill ring. + + Conversion of tabs to spaces happens only if COUNT is positive. + If it is negative, exactly -COUNT characters after point are + deleted. + + In an interactive call, COUNT is the numeric prefix argument, and + KILLP is the unprocessed prefix argument. Therefore, if a prefix + argument is supplied, the text is saved in the kill ring. If no + prefix argument is supplied, then one character is deleted, but + not saved in the kill ring. + + The value returned is always `nil'. + + +File: lispref.info, Node: User-Level Deletion, Next: The Kill Ring, Prev: Deletion, Up: Text + +User-Level Deletion Commands +============================ + + This section describes higher-level commands for deleting text, +commands intended primarily for the user but useful also in Lisp +programs. + + - Command: delete-horizontal-space + This function deletes all spaces and tabs around point. It returns + `nil'. + + In the following examples, we call `delete-horizontal-space' four + times, once on each line, with point between the second and third + characters on the line each time. + + ---------- Buffer: foo ---------- + I -!-thought + I -!- thought + We-!- thought + Yo-!-u thought + ---------- Buffer: foo ---------- + + (delete-horizontal-space) ; Four times. + => nil + + ---------- Buffer: foo ---------- + Ithought + Ithought + Wethought + You thought + ---------- Buffer: foo ---------- + + - Command: delete-indentation &optional JOIN-FOLLOWING-P + This function joins the line point is on to the previous line, + deleting any whitespace at the join and in some cases replacing it + with one space. If JOIN-FOLLOWING-P is non-`nil', + `delete-indentation' joins this line to the following line + instead. The value is `nil'. + + If there is a fill prefix, and the second of the lines being joined + starts with the prefix, then `delete-indentation' deletes the fill + prefix before joining the lines. *Note Margins::. + + In the example below, point is located on the line starting + `events', and it makes no difference if there are trailing spaces + in the preceding line. + + ---------- Buffer: foo ---------- + When in the course of human + -!- events, it becomes necessary + ---------- Buffer: foo ---------- + + (delete-indentation) + => nil + ---------- Buffer: foo ---------- + When in the course of human-!- events, it becomes necessary + ---------- Buffer: foo ---------- + + After the lines are joined, the function `fixup-whitespace' is + responsible for deciding whether to leave a space at the junction. + + - Function: fixup-whitespace + This function replaces all the white space surrounding point with + either one space or no space, according to the context. It + returns `nil'. + + At the beginning or end of a line, the appropriate amount of space + is none. Before a character with close parenthesis syntax, or + after a character with open parenthesis or expression-prefix + syntax, no space is also appropriate. Otherwise, one space is + appropriate. *Note Syntax Class Table::. + + In the example below, `fixup-whitespace' is called the first time + with point before the word `spaces' in the first line. For the + second invocation, point is directly after the `('. + + ---------- Buffer: foo ---------- + This has too many -!-spaces + This has too many spaces at the start of (-!- this list) + ---------- Buffer: foo ---------- + + (fixup-whitespace) + => nil + (fixup-whitespace) + => nil + + ---------- Buffer: foo ---------- + This has too many spaces + This has too many spaces at the start of (this list) + ---------- Buffer: foo ---------- + + - Command: just-one-space + This command replaces any spaces and tabs around point with a + single space. It returns `nil'. + + - Command: delete-blank-lines + This function deletes blank lines surrounding point. If point is + on a blank line with one or more blank lines before or after it, + then all but one of them are deleted. If point is on an isolated + blank line, then it is deleted. If point is on a nonblank line, + the command deletes all blank lines following it. + + A blank line is defined as a line containing only tabs and spaces. + + `delete-blank-lines' returns `nil'. + + +File: lispref.info, Node: The Kill Ring, Next: Undo, Prev: User-Level Deletion, Up: Text + +The Kill Ring +============= + + "Kill" functions delete text like the deletion functions, but save +it so that the user can reinsert it by "yanking". Most of these +functions have `kill-' in their name. By contrast, the functions whose +names start with `delete-' normally do not save text for yanking +(though they can still be undone); these are "deletion" functions. + + Most of the kill commands are primarily for interactive use, and are +not described here. What we do describe are the functions provided for +use in writing such commands. You can use these functions to write +commands for killing text. When you need to delete text for internal +purposes within a Lisp function, you should normally use deletion +functions, so as not to disturb the kill ring contents. *Note +Deletion::. + + Killed text is saved for later yanking in the "kill ring". This is +a list that holds a number of recent kills, not just the last text +kill. We call this a "ring" because yanking treats it as having +elements in a cyclic order. The list is kept in the variable +`kill-ring', and can be operated on with the usual functions for lists; +there are also specialized functions, described in this section, that +treat it as a ring. + + Some people think this use of the word "kill" is unfortunate, since +it refers to operations that specifically *do not* destroy the entities +"killed". This is in sharp contrast to ordinary life, in which death +is permanent and "killed" entities do not come back to life. +Therefore, other metaphors have been proposed. For example, the term +"cut ring" makes sense to people who, in pre-computer days, used +scissors and paste to cut up and rearrange manuscripts. However, it +would be difficult to change the terminology now. + +* Menu: + +* Kill Ring Concepts:: What text looks like in the kill ring. +* Kill Functions:: Functions that kill text. +* Yank Commands:: Commands that access the kill ring. +* Low-Level Kill Ring:: Functions and variables for kill ring access. +* Internals of Kill Ring:: Variables that hold kill-ring data. + + +File: lispref.info, Node: Kill Ring Concepts, Next: Kill Functions, Up: The Kill Ring + +Kill Ring Concepts +------------------ + + The kill ring records killed text as strings in a list, most recent +first. A short kill ring, for example, might look like this: + + ("some text" "a different piece of text" "even older text") + +When the list reaches `kill-ring-max' entries in length, adding a new +entry automatically deletes the last entry. + + When kill commands are interwoven with other commands, each kill +command makes a new entry in the kill ring. Multiple kill commands in +succession build up a single entry in the kill ring, which would be +yanked as a unit; the second and subsequent consecutive kill commands +add text to the entry made by the first one. + + For yanking, one entry in the kill ring is designated the "front" of +the ring. Some yank commands "rotate" the ring by designating a +different element as the "front." But this virtual rotation doesn't +change the list itself--the most recent entry always comes first in the +list. + + +File: lispref.info, Node: Kill Functions, Next: Yank Commands, Prev: Kill Ring Concepts, Up: The Kill Ring + +Functions for Killing +--------------------- + + `kill-region' is the usual subroutine for killing text. Any command +that calls this function is a "kill command" (and should probably have +`kill' in its name). `kill-region' puts the newly killed text in a new +element at the beginning of the kill ring or adds it to the most recent +element. It uses the `last-command' variable to determine whether the +previous command was a kill command, and if so appends the killed text +to the most recent entry. + + - Command: kill-region START END + This function kills the text in the region defined by START and + END. The text is deleted but saved in the kill ring, along with + its text properties. The value is always `nil'. + + In an interactive call, START and END are point and the mark. + + If the buffer is read-only, `kill-region' modifies the kill ring + just the same, then signals an error without modifying the buffer. + This is convenient because it lets the user use all the kill + commands to copy text into the kill ring from a read-only buffer. + + - Command: copy-region-as-kill START END + This command saves the region defined by START and END on the kill + ring (including text properties), but does not delete the text + from the buffer. It returns `nil'. It also indicates the extent + of the text copied by moving the cursor momentarily, or by + displaying a message in the echo area. + + The command does not set `this-command' to `kill-region', so a + subsequent kill command does not append to the same kill ring + entry. + + Don't call `copy-region-as-kill' in Lisp programs unless you aim to + support Emacs 18. For Emacs 19, it is better to use `kill-new' or + `kill-append' instead. *Note Low-Level Kill Ring::. + + +File: lispref.info, Node: Yank Commands, Next: Low-Level Kill Ring, Prev: Kill Functions, Up: The Kill Ring + +Functions for Yanking +--------------------- + + "Yanking" means reinserting an entry of previously killed text from +the kill ring. The text properties are copied too. + + - Command: yank &optional ARG + This command inserts before point the text in the first entry in + the kill ring. It positions the mark at the beginning of that + text, and point at the end. + + If ARG is a list (which occurs interactively when the user types + `C-u' with no digits), then `yank' inserts the text as described + above, but puts point before the yanked text and puts the mark + after it. + + If ARG is a number, then `yank' inserts the ARGth most recently + killed text--the ARGth element of the kill ring list. + + `yank' does not alter the contents of the kill ring or rotate it. + It returns `nil'. + + - Command: yank-pop ARG + This command replaces the just-yanked entry from the kill ring + with a different entry from the kill ring. + + This is allowed only immediately after a `yank' or another + `yank-pop'. At such a time, the region contains text that was just + inserted by yanking. `yank-pop' deletes that text and inserts in + its place a different piece of killed text. It does not add the + deleted text to the kill ring, since it is already in the kill + ring somewhere. + + If ARG is `nil', then the replacement text is the previous element + of the kill ring. If ARG is numeric, the replacement is the ARGth + previous kill. If ARG is negative, a more recent kill is the + replacement. + + The sequence of kills in the kill ring wraps around, so that after + the oldest one comes the newest one, and before the newest one + goes the oldest. + + The value is always `nil'. + + +File: lispref.info, Node: Low-Level Kill Ring, Next: Internals of Kill Ring, Prev: Yank Commands, Up: The Kill Ring + +Low-Level Kill Ring +------------------- + + These functions and variables provide access to the kill ring at a +lower level, but still convenient for use in Lisp programs. They take +care of interaction with X Window selections. They do not exist in +Emacs version 18. + + - Function: current-kill N &optional DO-NOT-MOVE + The function `current-kill' rotates the yanking pointer which + designates the "front" of the kill ring by N places (from newer + kills to older ones), and returns the text at that place in the + ring. + + If the optional second argument DO-NOT-MOVE is non-`nil', then + `current-kill' doesn't alter the yanking pointer; it just returns + the Nth kill, counting from the current yanking pointer. + + If N is zero, indicating a request for the latest kill, + `current-kill' calls the value of `interprogram-paste-function' + (documented below) before consulting the kill ring. + + - Function: kill-new STRING + This function puts the text STRING into the kill ring as a new + entry at the front of the ring. It discards the oldest entry if + appropriate. It also invokes the value of + `interprogram-cut-function' (see below). + + - Function: kill-append STRING BEFORE-P + This function appends the text STRING to the first entry in the + kill ring. Normally STRING goes at the end of the entry, but if + BEFORE-P is non-`nil', it goes at the beginning. This function + also invokes the value of `interprogram-cut-function' (see below). + + - Variable: interprogram-paste-function + This variable provides a way of transferring killed text from other + programs, when you are using a window system. Its value should be + `nil' or a function of no arguments. + + If the value is a function, `current-kill' calls it to get the + "most recent kill". If the function returns a non-`nil' value, + then that value is used as the "most recent kill". If it returns + `nil', then the first element of `kill-ring' is used. + + The normal use of this hook is to get the X server's primary + selection as the most recent kill, even if the selection belongs + to another X client. *Note X Selections::. + + - Variable: interprogram-cut-function + This variable provides a way of communicating killed text to other + programs, when you are using a window system. Its value should be + `nil' or a function of one argument. + + If the value is a function, `kill-new' and `kill-append' call it + with the new first element of the kill ring as an argument. + + The normal use of this hook is to set the X server's primary + selection to the newly killed text. + + +File: lispref.info, Node: Internals of Kill Ring, Prev: Low-Level Kill Ring, Up: The Kill Ring + +Internals of the Kill Ring +-------------------------- + + The variable `kill-ring' holds the kill ring contents, in the form +of a list of strings. The most recent kill is always at the front of +the list. + + The `kill-ring-yank-pointer' variable points to a link in the kill +ring list, whose CAR is the text to yank next. We say it identifies +the "front" of the ring. Moving `kill-ring-yank-pointer' to a +different link is called "rotating the kill ring". We call the kill +ring a "ring" because the functions that move the yank pointer wrap +around from the end of the list to the beginning, or vice-versa. +Rotation of the kill ring is virtual; it does not change the value of +`kill-ring'. + + Both `kill-ring' and `kill-ring-yank-pointer' are Lisp variables +whose values are normally lists. The word "pointer" in the name of the +`kill-ring-yank-pointer' indicates that the variable's purpose is to +identify one element of the list for use by the next yank command. + + The value of `kill-ring-yank-pointer' is always `eq' to one of the +links in the kill ring list. The element it identifies is the CAR of +that link. Kill commands, which change the kill ring, also set this +variable to the value of `kill-ring'. The effect is to rotate the ring +so that the newly killed text is at the front. + + Here is a diagram that shows the variable `kill-ring-yank-pointer' +pointing to the second entry in the kill ring `("some text" "a +different piece of text" "yet older text")'. + + kill-ring kill-ring-yank-pointer + | | + | ___ ___ ---> ___ ___ ___ ___ + --> |___|___|------> |___|___|--> |___|___|--> nil + | | | + | | | + | | -->"yet older text" + | | + | --> "a different piece of text" + | + --> "some text" + +This state of affairs might occur after `C-y' (`yank') immediately +followed by `M-y' (`yank-pop'). + + - Variable: kill-ring + This variable holds the list of killed text sequences, most + recently killed first. + + - Variable: kill-ring-yank-pointer + This variable's value indicates which element of the kill ring is + at the "front" of the ring for yanking. More precisely, the value + is a tail of the value of `kill-ring', and its CAR is the kill + string that `C-y' should yank. + + - User Option: kill-ring-max + The value of this variable is the maximum length to which the kill + ring can grow, before elements are thrown away at the end. The + default value for `kill-ring-max' is 30. + + +File: lispref.info, Node: Undo, Next: Maintaining Undo, Prev: The Kill Ring, Up: Text + +Undo +==== + + Most buffers have an "undo list", which records all changes made to +the buffer's text so that they can be undone. (The buffers that don't +have one are usually special-purpose buffers for which XEmacs assumes +that undoing is not useful.) All the primitives that modify the text +in the buffer automatically add elements to the front of the undo list, +which is in the variable `buffer-undo-list'. + + - Variable: buffer-undo-list + This variable's value is the undo list of the current buffer. A + value of `t' disables the recording of undo information. + + Here are the kinds of elements an undo list can have: + +`INTEGER' + This kind of element records a previous value of point. Ordinary + cursor motion does not get any sort of undo record, but deletion + commands use these entries to record where point was before the + command. + +`(BEG . END)' + This kind of element indicates how to delete text that was + inserted. Upon insertion, the text occupied the range BEG-END in + the buffer. + +`(TEXT . POSITION)' + This kind of element indicates how to reinsert text that was + deleted. The deleted text itself is the string TEXT. The place to + reinsert it is `(abs POSITION)'. + +`(t HIGH . LOW)' + This kind of element indicates that an unmodified buffer became + modified. The elements HIGH and LOW are two integers, each + recording 16 bits of the visited file's modification time as of + when it was previously visited or saved. `primitive-undo' uses + those values to determine whether to mark the buffer as unmodified + once again; it does so only if the file's modification time + matches those numbers. + +`(nil PROPERTY VALUE BEG . END)' + This kind of element records a change in a text property. Here's + how you might undo the change: + + (put-text-property BEG END PROPERTY VALUE) + +`POSITION' + This element indicates where point was at an earlier time. + Undoing this element sets point to POSITION. Deletion normally + creates an element of this kind as well as a reinsertion element. + +`nil' + This element is a boundary. The elements between two boundaries + are called a "change group"; normally, each change group + corresponds to one keyboard command, and undo commands normally + undo an entire group as a unit. + + - Function: undo-boundary + This function places a boundary element in the undo list. The undo + command stops at such a boundary, and successive undo commands undo + to earlier and earlier boundaries. This function returns `nil'. + + The editor command loop automatically creates an undo boundary + before each key sequence is executed. Thus, each undo normally + undoes the effects of one command. Self-inserting input + characters are an exception. The command loop makes a boundary + for the first such character; the next 19 consecutive + self-inserting input characters do not make boundaries, and then + the 20th does, and so on as long as self-inserting characters + continue. + + All buffer modifications add a boundary whenever the previous + undoable change was made in some other buffer. This way, a + command that modifies several buffers makes a boundary in each + buffer it changes. + + Calling this function explicitly is useful for splitting the + effects of a command into more than one unit. For example, + `query-replace' calls `undo-boundary' after each replacement, so + that the user can undo individual replacements one by one. + + - Function: primitive-undo COUNT LIST + This is the basic function for undoing elements of an undo list. + It undoes the first COUNT elements of LIST, returning the rest of + LIST. You could write this function in Lisp, but it is convenient + to have it in C. + + `primitive-undo' adds elements to the buffer's undo list when it + changes the buffer. Undo commands avoid confusion by saving the + undo list value at the beginning of a sequence of undo operations. + Then the undo operations use and update the saved value. The new + elements added by undoing are not part of this saved value, so + they don't interfere with continuing to undo. + + +File: lispref.info, Node: Maintaining Undo, Next: Filling, Prev: Undo, Up: Text + +Maintaining Undo Lists +====================== + + This section describes how to enable and disable undo information for +a given buffer. It also explains how the undo list is truncated +automatically so it doesn't get too big. + + Recording of undo information in a newly created buffer is normally +enabled to start with; but if the buffer name starts with a space, the +undo recording is initially disabled. You can explicitly enable or +disable undo recording with the following two functions, or by setting +`buffer-undo-list' yourself. + + - Command: buffer-enable-undo &optional BUFFER-OR-NAME + This command enables recording undo information for buffer + BUFFER-OR-NAME, so that subsequent changes can be undone. If no + argument is supplied, then the current buffer is used. This + function does nothing if undo recording is already enabled in the + buffer. It returns `nil'. + + In an interactive call, BUFFER-OR-NAME is the current buffer. You + cannot specify any other buffer. + + - Function: buffer-disable-undo &optional BUFFER + - Function: buffer-flush-undo &optional BUFFER + This function discards the undo list of BUFFER, and disables + further recording of undo information. As a result, it is no + longer possible to undo either previous changes or any subsequent + changes. If the undo list of BUFFER is already disabled, this + function has no effect. + + This function returns `nil'. It cannot be called interactively. + + The name `buffer-flush-undo' is not considered obsolete, but the + preferred name `buffer-disable-undo' is new as of Emacs versions + 19. + + As editing continues, undo lists get longer and longer. To prevent +them from using up all available memory space, garbage collection trims +them back to size limits you can set. (For this purpose, the "size" of +an undo list measures the cons cells that make up the list, plus the +strings of deleted text.) Two variables control the range of acceptable +sizes: `undo-limit' and `undo-strong-limit'. + + - Variable: undo-limit + This is the soft limit for the acceptable size of an undo list. + The change group at which this size is exceeded is the last one + kept. + + - Variable: undo-strong-limit + This is the upper limit for the acceptable size of an undo list. + The change group at which this size is exceeded is discarded + itself (along with all older change groups). There is one + exception: the very latest change group is never discarded no + matter how big it is. + + +File: lispref.info, Node: Filling, Next: Margins, Prev: Maintaining Undo, Up: Text + +Filling +======= + + "Filling" means adjusting the lengths of lines (by moving the line +breaks) so that they are nearly (but no greater than) a specified +maximum width. Additionally, lines can be "justified", which means +inserting spaces to make the left and/or right margins line up +precisely. The width is controlled by the variable `fill-column'. For +ease of reading, lines should be no longer than 70 or so columns. + + You can use Auto Fill mode (*note Auto Filling::.) to fill text +automatically as you insert it, but changes to existing text may leave +it improperly filled. Then you must fill the text explicitly. + + Most of the commands in this section return values that are not +meaningful. All the functions that do filling take note of the current +left margin, current right margin, and current justification style +(*note Margins::.). If the current justification style is `none', the +filling functions don't actually do anything. + + Several of the filling functions have an argument JUSTIFY. If it is +non-`nil', that requests some kind of justification. It can be `left', +`right', `full', or `center', to request a specific style of +justification. If it is `t', that means to use the current +justification style for this part of the text (see +`current-justification', below). + + When you call the filling functions interactively, using a prefix +argument implies the value `full' for JUSTIFY. + + - Command: fill-paragraph JUSTIFY + This command fills the paragraph at or after point. If JUSTIFY is + non-`nil', each line is justified as well. It uses the ordinary + paragraph motion commands to find paragraph boundaries. *Note + Paragraphs: (xemacs)Paragraphs. + + - Command: fill-region START END &optional JUSTIFY + This command fills each of the paragraphs in the region from START + to END. It justifies as well if JUSTIFY is non-`nil'. + + The variable `paragraph-separate' controls how to distinguish + paragraphs. *Note Standard Regexps::. + + - Command: fill-individual-paragraphs START END &optional JUSTIFY + MAIL-FLAG + This command fills each paragraph in the region according to its + individual fill prefix. Thus, if the lines of a paragraph were + indented with spaces, the filled paragraph will remain indented in + the same fashion. + + The first two arguments, START and END, are the beginning and end + of the region to be filled. The third and fourth arguments, + JUSTIFY and MAIL-FLAG, are optional. If JUSTIFY is non-`nil', the + paragraphs are justified as well as filled. If MAIL-FLAG is + non-`nil', it means the function is operating on a mail message + and therefore should not fill the header lines. + + Ordinarily, `fill-individual-paragraphs' regards each change in + indentation as starting a new paragraph. If + `fill-individual-varying-indent' is non-`nil', then only separator + lines separate paragraphs. That mode can handle indented + paragraphs with additional indentation on the first line. + + - User Option: fill-individual-varying-indent + This variable alters the action of `fill-individual-paragraphs' as + described above. + + - Command: fill-region-as-paragraph START END &optional JUSTIFY + This command considers a region of text as a paragraph and fills + it. If the region was made up of many paragraphs, the blank lines + between paragraphs are removed. This function justifies as well + as filling when JUSTIFY is non-`nil'. + + In an interactive call, any prefix argument requests justification. + + In Adaptive Fill mode, which is enabled by default, + `fill-region-as-paragraph' on an indented paragraph when there is + no fill prefix uses the indentation of the second line of the + paragraph as the fill prefix. + + - Command: justify-current-line HOW EOP NOSQUEEZE + This command inserts spaces between the words of the current line + so that the line ends exactly at `fill-column'. It returns `nil'. + + The argument HOW, if non-`nil' specifies explicitly the style of + justification. It can be `left', `right', `full', `center', or + `none'. If it is `t', that means to do follow specified + justification style (see `current-justification', below). `nil' + means to do full justification. + + If EOP is non-`nil', that means do left-justification when + `current-justification' specifies full justification. This is used + for the last line of a paragraph; even if the paragraph as a whole + is fully justified, the last line should not be. + + If NOSQUEEZE is non-`nil', that means do not change interior + whitespace. + + - User Option: default-justification + This variable's value specifies the style of justification to use + for text that doesn't specify a style with a text property. The + possible values are `left', `right', `full', `center', or `none'. + The default value is `left'. + + - Function: current-justification + This function returns the proper justification style to use for + filling the text around point. + + - Variable: fill-paragraph-function + This variable provides a way for major modes to override the + filling of paragraphs. If the value is non-`nil', + `fill-paragraph' calls this function to do the work. If the + function returns a non-`nil' value, `fill-paragraph' assumes the + job is done, and immediately returns that value. + + The usual use of this feature is to fill comments in programming + language modes. If the function needs to fill a paragraph in the + usual way, it can do so as follows: + + (let ((fill-paragraph-function nil)) + (fill-paragraph arg)) + + - Variable: use-hard-newlines + If this variable is non-`nil', the filling functions do not delete + newlines that have the `hard' text property. These "hard + newlines" act as paragraph separators. + + +File: lispref.info, Node: Margins, Next: Auto Filling, Prev: Filling, Up: Text + +Margins for Filling +=================== + + - User Option: fill-prefix + This variable specifies a string of text that appears at the + beginning of normal text lines and should be disregarded when + filling them. Any line that fails to start with the fill prefix + is considered the start of a paragraph; so is any line that starts + with the fill prefix followed by additional whitespace. Lines + that start with the fill prefix but no additional whitespace are + ordinary text lines that can be filled together. The resulting + filled lines also start with the fill prefix. + + The fill prefix follows the left margin whitespace, if any. + + - User Option: fill-column + This buffer-local variable specifies the maximum width of filled + lines. Its value should be an integer, which is a number of + columns. All the filling, justification and centering commands + are affected by this variable, including Auto Fill mode (*note + Auto Filling::.). + + As a practical matter, if you are writing text for other people to + read, you should set `fill-column' to no more than 70. Otherwise + the line will be too long for people to read comfortably, and this + can make the text seem clumsy. + + - Variable: default-fill-column + The value of this variable is the default value for `fill-column' + in buffers that do not override it. This is the same as + `(default-value 'fill-column)'. + + The default value for `default-fill-column' is 70. + + - Command: set-left-margin FROM TO MARGIN + This sets the `left-margin' property on the text from FROM to TO + to the value MARGIN. If Auto Fill mode is enabled, this command + also refills the region to fit the new margin. + + - Command: set-right-margin FROM TO MARGIN + This sets the `right-margin' property on the text from FROM to TO + to the value MARGIN. If Auto Fill mode is enabled, this command + also refills the region to fit the new margin. + + - Function: current-left-margin + This function returns the proper left margin value to use for + filling the text around point. The value is the sum of the + `left-margin' property of the character at the start of the + current line (or zero if none), and the value of the variable + `left-margin'. + + - Function: current-fill-column + This function returns the proper fill column value to use for + filling the text around point. The value is the value of the + `fill-column' variable, minus the value of the `right-margin' + property of the character after point. + + - Command: move-to-left-margin &optional N FORCE + This function moves point to the left margin of the current line. + The column moved to is determined by calling the function + `current-left-margin'. If the argument N is non-`nil', + `move-to-left-margin' moves forward N-1 lines first. + + If FORCE is non-`nil', that says to fix the line's indentation if + that doesn't match the left margin value. + + - Function: delete-to-left-margin FROM TO + This function removes left margin indentation from the text + between FROM and TO. The amount of indentation to delete is + determined by calling `current-left-margin'. In no case does this + function delete non-whitespace. + + - Function: indent-to-left-margin + This is the default `indent-line-function', used in Fundamental + mode, Text mode, etc. Its effect is to adjust the indentation at + the beginning of the current line to the value specified by the + variable `left-margin'. This may involve either inserting or + deleting whitespace. + + - Variable: left-margin + This variable specifies the base left margin column. In + Fundamental mode, indents to this column. This variable + automatically becomes buffer-local when set in any fashion. + + +File: lispref.info, Node: Auto Filling, Next: Sorting, Prev: Margins, Up: Text + +Auto Filling +============ + + Auto Fill mode is a minor mode that fills lines automatically as text +is inserted. This section describes the hook used by Auto Fill mode. +For a description of functions that you can call explicitly to fill and +justify existing text, see *Note Filling::. + + Auto Fill mode also enables the functions that change the margins and +justification style to refill portions of the text. *Note Margins::. + + - Variable: auto-fill-function + The value of this variable should be a function (of no arguments) + to be called after self-inserting a space or a newline. It may be + `nil', in which case nothing special is done in that case. + + The value of `auto-fill-function' is `do-auto-fill' when Auto-Fill + mode is enabled. That is a function whose sole purpose is to + implement the usual strategy for breaking a line. + + In older Emacs versions, this variable was named + `auto-fill-hook', but since it is not called with the + standard convention for hooks, it was renamed to + `auto-fill-function' in version 19. + diff --git a/info/lispref.info-3 b/info/lispref.info-3 index 837bb60..d59669d 100644 --- a/info/lispref.info-3 +++ b/info/lispref.info-3 @@ -1,5 +1,5 @@ -This is ../info/lispref.info, produced by makeinfo version 4.0 from -lispref/lispref.texi. +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -71,7 +71,7 @@ confoundance disease". In particular, many functions such as `eq', `old-memq', etc.) that pretend like characters are integers are the same. Byte code compiled under any version 19 Emacs will have all such functions mapped to their `old-' equivalents when the byte code is read -into XEmacs 20. This is to preserve compatibility--Emacs 19 converts +into XEmacs 20. This is to preserve compatibility - Emacs 19 converts all constant characters to the equivalent integer during byte-compilation, and thus there is no other way to preserve byte-code compatibility even if the code has specifically been written with the @@ -81,9 +81,9 @@ distinction between characters and integers in mind. code". For example, the character `A' is represented as the integer 65, following the standard ASCII representation of characters. If XEmacs was not compiled with MULE support, the range of this integer -will always be 0 to 255--eight bits, or one byte. (Integers outside +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 _not_ rely on this, because it will not work under +most decidedly *not* rely on this, because it will not work under XEmacs with MULE support.) When MULE support is present, the range of character codes is much larger. (Currently, 19 bits are used.) @@ -94,7 +94,7 @@ that does not distinguish between ASCII keys and other keys), so you will never find character codes above 255 in a non-MULE XEmacs. Individual characters are not often used in programs. It is far more -common to work with _strings_, which are sequences composed of +common to work with *strings*, which are sequences composed of characters. *Note String Type::. The read syntax for characters begins with a question mark, followed @@ -104,7 +104,7 @@ print representation. In XEmacs 19, however, where characters are really integers, the printed representation of a character is a decimal number. This is also a possible read syntax for a character, but writing characters that way in Lisp programs is a very bad idea. You -should _always_ use the special read syntax formats that XEmacs Lisp +should *always* use the special read syntax formats that XEmacs Lisp provides for characters. The usual read syntax for alphanumeric characters is a question mark @@ -122,7 +122,7 @@ the character `B', and `?a' for the character `a'. You can use the same syntax for punctuation characters, but it is often a good idea to add a `\' so that the Emacs commands for editing Lisp code don't get confused. For example, `?\ ' is the way to write -the space character. If the character is `\', you _must_ use a second +the space character. If the character is `\', you *must* use a second `\' to quote it: `?\\'. XEmacs 20 always prints punctuation characters with a `\' in front of them, to avoid confusion. @@ -177,7 +177,7 @@ example, both `?\^I' and `?\^i' are valid read syntax for the character There is also a character read syntax beginning with `\M-'. This sets the high bit of the character code (same as adding 128 to the character code). For example, `?\M-A' stands for the character with -character code 193, or 128 plus 65. You should _not_ use this syntax +character code 193, or 128 plus 65. You should *not* use this 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 set, thus the `M'; however, it conflicts with the @@ -276,8 +276,8 @@ considered a sequence. Arrays are further subdivided into strings, vectors, and bit vectors. Vectors can hold elements of any type, but string elements must be characters, and bit vector elements must be either 0 or 1. However, the -characters in a string can have extents (*note Extents::) and text -properties (*note Text Properties::) like characters in a buffer; +characters in a string can have extents (*note Extents::.) and text +properties (*note Text Properties::.) like characters in a buffer; vectors do not support extents or text properties even when their elements happen to be characters. @@ -357,7 +357,7 @@ cell refers to `nil'. Here is another diagram of the same list, `(rose violet buttercup)', sketched in a different manner: - --------------- ---------------- ------------------- + --------------- ---------------- ------------------- | car | cdr | | car | cdr | | car | cdr | | rose | o-------->| violet | o-------->| buttercup | nil | | | | | | | | | | @@ -614,13 +614,13 @@ Function Type functions in Lisp are primarily Lisp objects, and only secondarily the text which represents them. These Lisp objects are lambda expressions: lists whose first element is the symbol `lambda' (*note Lambda -Expressions::). +Expressions::.). In most programming languages, it is impossible to have a function without a name. In Lisp, a function has no intrinsic name. A lambda expression is also called an "anonymous function" (*note Anonymous -Functions::). A named function in Lisp is actually a symbol with a -valid function in its function cell (*note Defining Functions::). +Functions::.). A named function in Lisp is actually a symbol with a +valid function in its function cell (*note Defining Functions::.). Most of the time, functions are called when their names are written in Lisp expressions in Lisp programs. However, you can construct or @@ -655,7 +655,7 @@ in the C programming language. Primitive functions are also called "subrs" or "built-in functions". (The word "subr" is derived from "subroutine".) Most primitive functions evaluate all their arguments when they are called. A primitive function that does not evaluate all -its arguments is called a "special form" (*note Special Forms::). +its arguments is called a "special form" (*note Special Forms::.). It does not matter to the caller of a function whether the function is primitive. However, this does matter if you try to substitute a @@ -825,10 +825,10 @@ Buffer Type ----------- A "buffer" is an object that holds text that can be edited (*note -Buffers::). Most buffers hold the contents of a disk file (*note -Files::) so they can be edited, but some are used for other purposes. +Buffers::.). Most buffers hold the contents of a disk file (*note +Files::.) so they can be edited, but some are used for other purposes. Most buffers are also meant to be seen by the user, and therefore -displayed, at some time, in a window (*note Windows::). But a buffer +displayed, at some time, in a window (*note Windows::.). But a buffer need not be displayed in any window. The contents of a buffer are much like a string, but buffers are not @@ -839,21 +839,21 @@ concatenating substrings, and the result is an entirely new string object. Each buffer has a designated position called "point" (*note -Positions::). At any time, one buffer is the "current buffer". Most +Positions::.). At any time, one buffer is the "current buffer". Most editing commands act on the contents of the current buffer in the neighborhood of point. Many of the standard Emacs functions manipulate or test the characters in the current buffer; a whole chapter in this -manual is devoted to describing these functions (*note Text::). +manual is devoted to describing these functions (*note Text::.). Several other data structures are associated with each buffer: - * a local syntax table (*note Syntax Tables::); + * a local syntax table (*note Syntax Tables::.); - * a local keymap (*note Keymaps::); + * a local keymap (*note Keymaps::.); - * a local variable binding list (*note Buffer-Local Variables::); + * a local variable binding list (*note Buffer-Local Variables::.); - * a list of extents (*note Extents::); + * a list of extents (*note Extents::.); * and various other related properties. @@ -1104,8 +1104,8 @@ streams (character sinks) send characters to a buffer, such as a The object `nil', in addition to its other meanings, may be used as a stream. It stands for the value of the variable `standard-input' or `standard-output'. Also, the object `t' as a stream specifies input -using the minibuffer (*note Minibuffers::) or output in the echo area -(*note The Echo Area::). +using the minibuffer (*note Minibuffers::.) or output in the echo area +(*note The Echo Area::.). Streams have no special printed representation or read syntax, and print as whatever primitive type they are. @@ -1137,7 +1137,7 @@ Syntax Table Type Under XEmacs 20, a "syntax table" is a particular type of char table. Under XEmacs 19, a syntax table a vector of 256 integers. In both cases, each element defines how one character is interpreted when -it appears in a buffer. For example, in C mode (*note Major Modes::), +it appears in a buffer. For example, in C mode (*note Major Modes::.), the `+' character is punctuation, but in Lisp mode it is a valid character in a symbol. These modes specify different interpretations by changing the syntax table entry for `+'. diff --git a/info/lispref.info-30 b/info/lispref.info-30 new file mode 100644 index 0000000..1d25d6a --- /dev/null +++ b/info/lispref.info-30 @@ -0,0 +1,1175 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Sorting, Next: Columns, Prev: Auto Filling, Up: Text + +Sorting Text +============ + + The sorting functions described in this section all rearrange text in +a buffer. This is in contrast to the function `sort', which rearranges +the order of the elements of a list (*note Rearrangement::.). The +values returned by these functions are not meaningful. + + - Function: sort-subr REVERSE NEXTRECFUN ENDRECFUN &optional + STARTKEYFUN ENDKEYFUN + This function is the general text-sorting routine that divides a + buffer into records and sorts them. Most of the commands in this + section use this function. + + To understand how `sort-subr' works, consider the whole accessible + portion of the buffer as being divided into disjoint pieces called + "sort records". The records may or may not be contiguous; they may + not overlap. A portion of each sort record (perhaps all of it) is + designated as the sort key. Sorting rearranges the records in + order by their sort keys. + + Usually, the records are rearranged in order of ascending sort key. + If the first argument to the `sort-subr' function, REVERSE, is + non-`nil', the sort records are rearranged in order of descending + sort key. + + The next four arguments to `sort-subr' are functions that are + called to move point across a sort record. They are called many + times from within `sort-subr'. + + 1. NEXTRECFUN is called with point at the end of a record. This + function moves point to the start of the next record. The + first record is assumed to start at the position of point + when `sort-subr' is called. Therefore, you should usually + move point to the beginning of the buffer before calling + `sort-subr'. + + This function can indicate there are no more sort records by + leaving point at the end of the buffer. + + 2. ENDRECFUN is called with point within a record. It moves + point to the end of the record. + + 3. STARTKEYFUN is called to move point from the start of a + record to the start of the sort key. This argument is + optional; if it is omitted, the whole record is the sort key. + If supplied, the function should either return a non-`nil' + value to be used as the sort key, or return `nil' to indicate + that the sort key is in the buffer starting at point. In the + latter case, ENDKEYFUN is called to find the end of the sort + key. + + 4. ENDKEYFUN is called to move point from the start of the sort + key to the end of the sort key. This argument is optional. + If STARTKEYFUN returns `nil' and this argument is omitted (or + `nil'), then the sort key extends to the end of the record. + There is no need for ENDKEYFUN if STARTKEYFUN returns a + non-`nil' value. + + As an example of `sort-subr', here is the complete function + definition for `sort-lines': + + ;; Note that the first two lines of doc string + ;; are effectively one line when viewed by a user. + (defun sort-lines (reverse beg end) + "Sort lines in region alphabetically. + Called from a program, there are three arguments: + REVERSE (non-nil means reverse order), + and BEG and END (the region to sort)." + (interactive "P\nr") + (save-restriction + (narrow-to-region beg end) + (goto-char (point-min)) + (sort-subr reverse + 'forward-line + 'end-of-line))) + + Here `forward-line' moves point to the start of the next record, + and `end-of-line' moves point to the end of record. We do not pass + the arguments STARTKEYFUN and ENDKEYFUN, because the entire record + is used as the sort key. + + The `sort-paragraphs' function is very much the same, except that + its `sort-subr' call looks like this: + + (sort-subr reverse + (function + (lambda () + (skip-chars-forward "\n \t\f"))) + 'forward-paragraph) + + - Command: sort-regexp-fields REVERSE RECORD-REGEXP KEY-REGEXP START + END + This command sorts the region between START and END alphabetically + as specified by RECORD-REGEXP and KEY-REGEXP. If REVERSE is a + negative integer, then sorting is in reverse order. + + Alphabetical sorting means that two sort keys are compared by + comparing the first characters of each, the second characters of + each, 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 ASCII character set, the ordering in that set + determines alphabetical order. + + The value of the RECORD-REGEXP argument specifies how to divide + the buffer into sort records. At the end of each record, a search + is done for this regular expression, and the text that matches it + is the next record. For example, the regular expression `^.+$', + which matches lines with at least one character besides a newline, + would make each such line into a sort record. *Note Regular + Expressions::, for a description of the syntax and meaning of + regular expressions. + + The value of the KEY-REGEXP argument specifies what part of each + record is the sort key. The KEY-REGEXP could match the whole + record, or only a part. In the latter case, the rest of the + record has no effect on the sorted order of records, but it is + carried along when the record moves to its new position. + + The KEY-REGEXP argument can refer to the text matched by a + subexpression of RECORD-REGEXP, or it can be a regular expression + on its own. + + If KEY-REGEXP is: + + `\DIGIT' + then the text matched by the DIGITth `\(...\)' parenthesis + grouping in RECORD-REGEXP is the sort key. + + `\&' + then the whole record is the sort key. + + a regular expression + then `sort-regexp-fields' searches for a match for the regular + expression within the record. If such a match is found, it + is the sort key. If there is no match for KEY-REGEXP within + a record then that record is ignored, which means its + position in the buffer is not changed. (The other records + may move around it.) + + For example, if you plan to sort all the lines in the region by the + first word on each line starting with the letter `f', you should + set RECORD-REGEXP to `^.*$' and set KEY-REGEXP to `\'. The + resulting expression looks like this: + + (sort-regexp-fields nil "^.*$" "\\" + (region-beginning) + (region-end)) + + If you call `sort-regexp-fields' interactively, it prompts for + RECORD-REGEXP and KEY-REGEXP in the minibuffer. + + - Command: sort-lines REVERSE START END + This command alphabetically sorts lines in the region between + START and END. If REVERSE is non-`nil', the sort is in reverse + order. + + - Command: sort-paragraphs REVERSE START END + This command alphabetically sorts paragraphs in the region between + START and END. If REVERSE is non-`nil', the sort is in reverse + order. + + - Command: sort-pages REVERSE START END + This command alphabetically sorts pages in the region between + START and END. If REVERSE is non-`nil', the sort is in reverse + order. + + - Command: sort-fields FIELD START END + This command sorts lines in the region between START and END, + comparing them alphabetically by the FIELDth field of each line. + Fields are separated by whitespace and numbered starting from 1. + If FIELD is negative, sorting is by the -FIELDth field from the + end of the line. This command is useful for sorting tables. + + - Command: sort-numeric-fields FIELD START END + This command sorts lines in the region between START and END, + comparing them numerically by the FIELDth field of each line. The + specified field must contain a number in each line of the region. + Fields are separated by whitespace and numbered starting from 1. + If FIELD is negative, sorting is by the -FIELDth field from the + end of the line. This command is useful for sorting tables. + + - Command: sort-columns REVERSE &optional BEG END + This command sorts the lines in the region between BEG and END, + comparing them alphabetically by a certain range of columns. The + column positions of BEG and END bound the range of columns to sort + on. + + If REVERSE is non-`nil', the sort is in reverse order. + + One unusual thing about this command is that the entire line + containing position BEG, and the entire line containing position + END, are included in the region sorted. + + Note that `sort-columns' uses the `sort' utility program, and so + cannot work properly on text containing tab characters. Use `M-x + `untabify'' to convert tabs to spaces before sorting. + + +File: lispref.info, Node: Columns, Next: Indentation, Prev: Sorting, Up: Text + +Counting Columns +================ + + The column functions convert between a character position (counting +characters from the beginning of the buffer) and a column position +(counting screen characters from the beginning of a line). + + A character counts according to the number of columns it occupies on +the screen. This means control characters count as occupying 2 or 4 +columns, depending upon the value of `ctl-arrow', and tabs count as +occupying a number of columns that depends on the value of `tab-width' +and on the column where the tab begins. *Note Usual Display::. + + Column number computations ignore the width of the window and the +amount of horizontal scrolling. Consequently, a column value can be +arbitrarily high. The first (or leftmost) column is numbered 0. + + - Function: current-column + This function returns the horizontal position of point, measured in + columns, counting from 0 at the left margin. The column position + is the sum of the widths of all the displayed representations of + the characters between the start of the current line and point. + + For an example of using `current-column', see the description of + `count-lines' in *Note Text Lines::. + + - Function: move-to-column COLUMN &optional FORCE + This function moves point to COLUMN in the current line. The + calculation of COLUMN takes into account the widths of the + displayed representations of the characters between the start of + the line and point. + + If column COLUMN is beyond the end of the line, point moves to the + end of the line. If COLUMN is negative, point moves to the + beginning of the line. + + If it is impossible to move to column COLUMN because that is in + the middle of a multicolumn character such as a tab, point moves + to the end of that character. However, if FORCE is non-`nil', and + COLUMN is in the middle of a tab, then `move-to-column' converts + the tab into spaces so that it can move precisely to column + COLUMN. Other multicolumn characters can cause anomalies despite + FORCE, since there is no way to split them. + + The argument FORCE also has an effect if the line isn't long + enough to reach column COLUMN; in that case, it says to add + whitespace at the end of the line to reach that column. + + If COLUMN is not an integer, an error is signaled. + + The return value is the column number actually moved to. + + +File: lispref.info, Node: Indentation, Next: Case Changes, Prev: Columns, Up: Text + +Indentation +=========== + + The indentation functions are used to examine, move to, and change +whitespace that is at the beginning of a line. Some of the functions +can also change whitespace elsewhere on a line. Columns and indentation +count from zero at the left margin. + +* Menu: + +* Primitive Indent:: Functions used to count and insert indentation. +* Mode-Specific Indent:: Customize indentation for different modes. +* Region Indent:: Indent all the lines in a region. +* Relative Indent:: Indent the current line based on previous lines. +* Indent Tabs:: Adjustable, typewriter-like tab stops. +* Motion by Indent:: Move to first non-blank character. + + +File: lispref.info, Node: Primitive Indent, Next: Mode-Specific Indent, Up: Indentation + +Indentation Primitives +---------------------- + + This section describes the primitive functions used to count and +insert indentation. The functions in the following sections use these +primitives. + + - Function: current-indentation + This function returns the indentation of the current line, which is + the horizontal position of the first nonblank character. If the + contents are entirely blank, then this is the horizontal position + of the end of the line. + + - Command: indent-to COLUMN &optional MINIMUM + This function indents from point with tabs and spaces until COLUMN + is reached. If MINIMUM is specified and non-`nil', then at least + that many spaces are inserted even if this requires going beyond + COLUMN. Otherwise the function does nothing if point is already + beyond COLUMN. The value is the column at which the inserted + indentation ends. + + - User Option: indent-tabs-mode + If this variable is non-`nil', indentation functions can insert + tabs as well as spaces. Otherwise, they insert only spaces. + Setting this variable automatically makes it local to the current + buffer. + + +File: lispref.info, Node: Mode-Specific Indent, Next: Region Indent, Prev: Primitive Indent, Up: Indentation + +Indentation Controlled by Major Mode +------------------------------------ + + An important function of each major mode is to customize the +key to indent properly for the language being edited. This section +describes the mechanism of the key and how to control it. The +functions in this section return unpredictable values. + + - Variable: indent-line-function + This variable's value is the function to be used by (and + various commands) to indent the current line. The command + `indent-according-to-mode' does no more than call this function. + + In Lisp mode, the value is the symbol `lisp-indent-line'; in C + mode, `c-indent-line'; in Fortran mode, `fortran-indent-line'. In + Fundamental mode, Text mode, and many other modes with no standard + for indentation, the value is `indent-to-left-margin' (which is the + default value). + + - Command: indent-according-to-mode + This command calls the function in `indent-line-function' to + indent the current line in a way appropriate for the current major + mode. + + - Command: indent-for-tab-command + This command calls the function in `indent-line-function' to indent + the current line; except that if that function is + `indent-to-left-margin', it calls `insert-tab' instead. (That is + a trivial command that inserts a tab character.) + + - Command: newline-and-indent + This function inserts a newline, then indents the new line (the one + following the newline just inserted) according to the major mode. + + It does indentation by calling the current `indent-line-function'. + In programming language modes, this is the same thing does, + but in some text modes, where inserts a tab, + `newline-and-indent' indents to the column specified by + `left-margin'. + + - Command: reindent-then-newline-and-indent + This command reindents the current line, inserts a newline at + point, and then reindents the new line (the one following the + newline just inserted). + + This command does indentation on both lines according to the + current major mode, by calling the current value of + `indent-line-function'. In programming language modes, this is + the same thing does, but in some text modes, where + inserts a tab, `reindent-then-newline-and-indent' indents to the + column specified by `left-margin'. + + +File: lispref.info, Node: Region Indent, Next: Relative Indent, Prev: Mode-Specific Indent, Up: Indentation + +Indenting an Entire Region +-------------------------- + + This section describes commands that indent all the lines in the +region. They return unpredictable values. + + - Command: indent-region START END TO-COLUMN + This command indents each nonblank line starting between START + (inclusive) and END (exclusive). If TO-COLUMN is `nil', + `indent-region' indents each nonblank line by calling the current + mode's indentation function, the value of `indent-line-function'. + + If TO-COLUMN is non-`nil', it should be an integer specifying the + number of columns of indentation; then this function gives each + line exactly that much indentation, by either adding or deleting + whitespace. + + If there is a fill prefix, `indent-region' indents each line by + making it start with the fill prefix. + + - Variable: indent-region-function + The value of this variable is a function that can be used by + `indent-region' as a short cut. You should design the function so + that it will produce the same results as indenting the lines of the + region one by one, but presumably faster. + + If the value is `nil', there is no short cut, and `indent-region' + actually works line by line. + + A short-cut function is useful in modes such as C mode and Lisp + mode, where the `indent-line-function' must scan from the + beginning of the function definition: applying it to each line + would be quadratic in time. The short cut can update the scan + information as it moves through the lines indenting them; this + takes linear time. In a mode where indenting a line individually + is fast, there is no need for a short cut. + + `indent-region' with a non-`nil' argument TO-COLUMN has a + different meaning and does not use this variable. + + - Command: indent-rigidly START END COUNT + This command indents all lines starting between START (inclusive) + and END (exclusive) sideways by COUNT columns. This "preserves + the shape" of the affected region, moving it as a rigid unit. + Consequently, this command is useful not only for indenting + regions of unindented text, but also for indenting regions of + formatted code. + + For example, if COUNT is 3, this command adds 3 columns of + indentation to each of the lines beginning in the region specified. + + In Mail mode, `C-c C-y' (`mail-yank-original') uses + `indent-rigidly' to indent the text copied from the message being + replied to. + + - Function: indent-code-rigidly START END COLUMNS &optional + NOCHANGE-REGEXP + This is like `indent-rigidly', except that it doesn't alter lines + that start within strings or comments. + + In addition, it doesn't alter a line if NOCHANGE-REGEXP matches at + the beginning of the line (if NOCHANGE-REGEXP is non-`nil'). + + +File: lispref.info, Node: Relative Indent, Next: Indent Tabs, Prev: Region Indent, Up: Indentation + +Indentation Relative to Previous Lines +-------------------------------------- + + This section describes two commands that indent the current line +based on the contents of previous lines. + + - Command: indent-relative &optional UNINDENTED-OK + This command inserts whitespace at point, extending to the same + column as the next "indent point" of the previous nonblank line. + An indent point is a non-whitespace character following + whitespace. The next indent point is the first one at a column + greater than the current column of point. For example, if point + is underneath and to the left of the first non-blank character of + a line of text, it moves to that column by inserting whitespace. + + If the previous nonblank line has no next indent point (i.e., none + at a great enough column position), `indent-relative' either does + nothing (if UNINDENTED-OK is non-`nil') or calls + `tab-to-tab-stop'. Thus, if point is underneath and to the right + of the last column of a short line of text, this command ordinarily + moves point to the next tab stop by inserting whitespace. + + The return value of `indent-relative' is unpredictable. + + In the following example, point is at the beginning of the second + line: + + This line is indented twelve spaces. + -!-The quick brown fox jumped. + + Evaluation of the expression `(indent-relative nil)' produces the + following: + + This line is indented twelve spaces. + -!-The quick brown fox jumped. + + In this example, point is between the `m' and `p' of `jumped': + + This line is indented twelve spaces. + The quick brown fox jum-!-ped. + + Evaluation of the expression `(indent-relative nil)' produces the + following: + + This line is indented twelve spaces. + The quick brown fox jum -!-ped. + + - Command: indent-relative-maybe + This command indents the current line like the previous nonblank + line. It calls `indent-relative' with `t' as the UNINDENTED-OK + argument. The return value is unpredictable. + + If the previous nonblank line has no indent points beyond the + current column, this command does nothing. + + +File: lispref.info, Node: Indent Tabs, Next: Motion by Indent, Prev: Relative Indent, Up: Indentation + +Adjustable "Tab Stops" +---------------------- + + This section explains the mechanism for user-specified "tab stops" +and the mechanisms that use and set them. The name "tab stops" is used +because the feature is similar to that of the tab stops on a +typewriter. The feature works by inserting an appropriate number of +spaces and tab characters to reach the next tab stop column; it does not +affect the display of tab characters in the buffer (*note Usual +Display::.). Note that the character as input uses this tab stop +feature only in a few major modes, such as Text mode. + + - Command: tab-to-tab-stop + This command inserts spaces or tabs up to the next tab stop column + defined by `tab-stop-list'. It searches the list for an element + greater than the current column number, and uses that element as + the column to indent to. It does nothing if no such element is + found. + + - User Option: tab-stop-list + This variable is the list of tab stop columns used by + `tab-to-tab-stops'. The elements should be integers in increasing + order. The tab stop columns need not be evenly spaced. + + Use `M-x edit-tab-stops' to edit the location of tab stops + interactively. + + +File: lispref.info, Node: Motion by Indent, Prev: Indent Tabs, Up: Indentation + +Indentation-Based Motion Commands +--------------------------------- + + These commands, primarily for interactive use, act based on the +indentation in the text. + + - Command: back-to-indentation + This command moves point to the first non-whitespace character in + the current line (which is the line in which point is located). + It returns `nil'. + + - Command: backward-to-indentation ARG + This command moves point backward ARG lines and then to the first + nonblank character on that line. It returns `nil'. + + - Command: forward-to-indentation ARG + This command moves point forward ARG lines and then to the first + nonblank character on that line. It returns `nil'. + + +File: lispref.info, Node: Case Changes, Next: Text Properties, Prev: Indentation, Up: Text + +Case Changes +============ + + The case change commands described here work on text in the current +buffer. *Note Character Case::, for case conversion commands that work +on strings and characters. *Note Case Tables::, for how to customize +which characters are upper or lower case and how to convert them. + + - Command: capitalize-region START END + This function capitalizes all words in the region defined by START + and END. To capitalize means to convert each word's first + character to upper case and convert the rest of each word to lower + case. The function returns `nil'. + + If one end of the region is in the middle of a word, the part of + the word within the region is treated as an entire word. + + When `capitalize-region' is called interactively, START and END + are point and the mark, with the smallest first. + + ---------- Buffer: foo ---------- + This is the contents of the 5th foo. + ---------- Buffer: foo ---------- + + (capitalize-region 1 44) + => nil + + ---------- Buffer: foo ---------- + This Is The Contents Of The 5th Foo. + ---------- Buffer: foo ---------- + + - Command: downcase-region START END + This function converts all of the letters in the region defined by + START and END to lower case. The function returns `nil'. + + When `downcase-region' is called interactively, START and END are + point and the mark, with the smallest first. + + - Command: upcase-region START END + This function converts all of the letters in the region defined by + START and END to upper case. The function returns `nil'. + + When `upcase-region' is called interactively, START and END are + point and the mark, with the smallest first. + + - Command: capitalize-word COUNT + This function capitalizes COUNT words after point, moving point + over as it does. To capitalize means to convert each word's first + character to upper case and convert the rest of each word to lower + case. If COUNT is negative, the function capitalizes the -COUNT + previous words but does not move point. The value is `nil'. + + If point is in the middle of a word, the part of the word before + point is ignored when moving forward. The rest is treated as an + entire word. + + When `capitalize-word' is called interactively, COUNT is set to + the numeric prefix argument. + + - Command: downcase-word COUNT + This function converts the COUNT words after point to all lower + case, moving point over as it does. If COUNT is negative, it + converts the -COUNT previous words but does not move point. The + value is `nil'. + + When `downcase-word' is called interactively, COUNT is set to the + numeric prefix argument. + + - Command: upcase-word COUNT + This function converts the COUNT words after point to all upper + case, moving point over as it does. If COUNT is negative, it + converts the -COUNT previous words but does not move point. The + value is `nil'. + + When `upcase-word' is called interactively, COUNT is set to the + numeric prefix argument. + + +File: lispref.info, Node: Text Properties, Next: Substitution, Prev: Case Changes, Up: Text + +Text Properties +=============== + + Text properties are an alternative interface to extents (*note +Extents::.), and are built on top of them. They are useful when you +want to view textual properties as being attached to the characters +themselves rather than to intervals of characters. The text property +interface is compatible with FSF Emacs. + + Each character position in a buffer or a string can have a "text +property list", much like the property list of a symbol (*note Property +Lists::.). The properties belong to a particular character at a +particular place, such as, the letter `T' at the beginning of this +sentence or the first `o' in `foo'--if the same character occurs in two +different places, the two occurrences generally have different +properties. + + Each property has a name and a value. Both of these can be any Lisp +object, but the name is normally a symbol. The usual way to access the +property list is to specify a name and ask what value corresponds to it. + + Note that FSF Emacs also looks at the `category' property to find +defaults for text properties. We consider this too bogus to implement. + + Copying text between strings and buffers preserves the properties +along with the characters; this includes such diverse functions as +`substring', `insert', and `buffer-substring'. + +* Menu: + +* Examining Properties:: Looking at the properties of one character. +* Changing Properties:: Setting the properties of a range of text. +* Property Search:: Searching for where a property changes value. +* Special Properties:: Particular properties with special meanings. +* Saving Properties:: Saving text properties in files, and reading + them back. + + +File: lispref.info, Node: Examining Properties, Next: Changing Properties, Up: Text Properties + +Examining Text Properties +------------------------- + + The simplest way to examine text properties is to ask for the value +of a particular property of a particular character. For that, use +`get-text-property'. Use `text-properties-at' to get the entire +property list of a character. *Note Property Search::, for functions +to examine the properties of a number of characters at once. + + These functions handle both strings and buffers. (Keep in mind that +positions in a string start from 0, whereas positions in a buffer start +from 1.) + + - Function: get-text-property POS PROP &optional OBJECT + This function returns the value of the PROP property of the + character after position POS in OBJECT (a buffer or string). The + argument OBJECT is optional and defaults to the current buffer. + + - Function: get-char-property POS PROP &optional OBJECT + This function is like `get-text-property', except that it checks + all extents, not just text-property extents. + + + - Function: text-properties-at POSITION &optional OBJECT + This function returns the entire property list of the character at + POSITION in the string or buffer OBJECT. If OBJECT is `nil', it + defaults to the current buffer. + + - Variable: default-text-properties + This variable holds a property list giving default values for text + properties. Whenever a character does not specify a value for a + property, the value stored in this list is used instead. Here is + an example: + + (setq default-text-properties '(foo 69)) + ;; Make sure character 1 has no properties of its own. + (set-text-properties 1 2 nil) + ;; What we get, when we ask, is the default value. + (get-text-property 1 'foo) + => 69 + + +File: lispref.info, Node: Changing Properties, Next: Property Search, Prev: Examining Properties, Up: Text Properties + +Changing Text Properties +------------------------ + + The primitives for changing properties apply to a specified range of +text. The function `set-text-properties' (see end of section) sets the +entire property list of the text in that range; more often, it is +useful to add, change, or delete just certain properties specified by +name. + + Since text properties are considered part of the buffer's contents, +and can affect how the buffer looks on the screen, any change in the +text properties is considered a buffer modification. Buffer text +property changes are undoable (*note Undo::.). + + - Function: put-text-property START END PROP VALUE &optional OBJECT + This function sets the PROP property to VALUE for the text between + START and END in the string or buffer OBJECT. If OBJECT is `nil', + it defaults to the current buffer. + + - Function: add-text-properties START END PROPS &optional OBJECT + This function modifies the text properties for the text between + START and END in the string or buffer OBJECT. If OBJECT is `nil', + it defaults to the current buffer. + + The argument PROPS specifies which properties to change. It + should have the form of a property list (*note Property Lists::.): + a list whose elements include the property names followed + alternately by the corresponding values. + + The return value is `t' if the function actually changed some + property's value; `nil' otherwise (if PROPS is `nil' or its values + agree with those in the text). + + For example, here is how to set the `comment' and `face' + properties of a range of text: + + (add-text-properties START END + '(comment t face highlight)) + + - Function: remove-text-properties START END PROPS &optional OBJECT + This function deletes specified text properties from the text + between START and END in the string or buffer OBJECT. If OBJECT + is `nil', it defaults to the current buffer. + + The argument PROPS specifies which properties to delete. It + should have the form of a property list (*note Property Lists::.): + a list whose elements are property names alternating with + corresponding values. But only the names matter--the values that + accompany them are ignored. For example, here's how to remove the + `face' property. + + (remove-text-properties START END '(face nil)) + + The return value is `t' if the function actually changed some + property's value; `nil' otherwise (if PROPS is `nil' or if no + character in the specified text had any of those properties). + + - Function: set-text-properties START END PROPS &optional OBJECT + This function completely replaces the text property list for the + text between START and END in the string or buffer OBJECT. If + OBJECT is `nil', it defaults to the current buffer. + + The argument PROPS is the new property list. It should be a list + whose elements are property names alternating with corresponding + values. + + After `set-text-properties' returns, all the characters in the + specified range have identical properties. + + If PROPS is `nil', the effect is to get rid of all properties from + the specified range of text. Here's an example: + + (set-text-properties START END nil) + + See also the function `buffer-substring-without-properties' (*note +Buffer Contents::.) which copies text from the buffer but does not copy +its properties. + + +File: lispref.info, Node: Property Search, Next: Special Properties, Prev: Changing Properties, Up: Text Properties + +Property Search Functions +------------------------- + + In typical use of text properties, most of the time several or many +consecutive characters have the same value for a property. Rather than +writing your programs to examine characters one by one, it is much +faster to process chunks of text that have the same property value. + + Here are functions you can use to do this. They use `eq' for +comparing property values. In all cases, OBJECT defaults to the +current buffer. + + For high performance, it's very important to use the LIMIT argument +to these functions, especially the ones that search for a single +property--otherwise, they may spend a long time scanning to the end of +the buffer, if the property you are interested in does not change. + + Remember that a position is always between two characters; the +position returned by these functions is between two characters with +different properties. + + - Function: next-property-change POS &optional OBJECT LIMIT + The function scans the text forward from position POS in the + string or buffer OBJECT till it finds a change in some text + property, then returns the position of the change. In other + words, it returns the position of the first character beyond POS + whose properties are not identical to those of the character just + after POS. + + If LIMIT is non-`nil', then the scan ends at position LIMIT. If + there is no property change before that point, + `next-property-change' returns LIMIT. + + The value is `nil' if the properties remain unchanged all the way + to the end of OBJECT and LIMIT is `nil'. If the value is + non-`nil', it is a position greater than or equal to POS. The + value equals POS only when LIMIT equals POS. + + Here is an example of how to scan the buffer by chunks of text + within which all properties are constant: + + (while (not (eobp)) + (let ((plist (text-properties-at (point))) + (next-change + (or (next-property-change (point) (current-buffer)) + (point-max)))) + Process text from point to NEXT-CHANGE... + (goto-char next-change))) + + - Function: next-single-property-change POS PROP &optional OBJECT LIMIT + The function scans the text forward from position POS in the + string or buffer OBJECT till it finds a change in the PROP + property, then returns the position of the change. In other + words, it returns the position of the first character beyond POS + whose PROP property differs from that of the character just after + POS. + + If LIMIT is non-`nil', then the scan ends at position LIMIT. If + there is no property change before that point, + `next-single-property-change' returns LIMIT. + + The value is `nil' if the property remains unchanged all the way to + the end of OBJECT and LIMIT is `nil'. If the value is non-`nil', + it is a position greater than or equal to POS; it equals POS only + if LIMIT equals POS. + + - Function: previous-property-change POS &optional OBJECT LIMIT + This is like `next-property-change', but scans back from POS + instead of forward. If the value is non-`nil', it is a position + less than or equal to POS; it equals POS only if LIMIT equals POS. + + - Function: previous-single-property-change POS PROP &optional OBJECT + LIMIT + This is like `next-single-property-change', but scans back from + POS instead of forward. If the value is non-`nil', it is a + position less than or equal to POS; it equals POS only if LIMIT + equals POS. + + - Function: text-property-any START END PROP VALUE &optional OBJECT + This function returns non-`nil' if at least one character between + START and END has a property PROP whose value is VALUE. More + precisely, it returns the position of the first such character. + Otherwise, it returns `nil'. + + The optional fifth argument, OBJECT, specifies the string or + buffer to scan. Positions are relative to OBJECT. The default + for OBJECT is the current buffer. + + - Function: text-property-not-all START END PROP VALUE &optional OBJECT + This function returns non-`nil' if at least one character between + START and END has a property PROP whose value differs from VALUE. + More precisely, it returns the position of the first such + character. Otherwise, it returns `nil'. + + The optional fifth argument, OBJECT, specifies the string or + buffer to scan. Positions are relative to OBJECT. The default + for OBJECT is the current buffer. + + +File: lispref.info, Node: Special Properties, Next: Saving Properties, Prev: Property Search, Up: Text Properties + +Properties with Special Meanings +-------------------------------- + + The predefined properties are the same as those for extents. *Note +Extent Properties::. + + +File: lispref.info, Node: Saving Properties, Prev: Special Properties, Up: Text Properties + +Saving Text Properties in Files +------------------------------- + + You can save text properties in files, and restore text properties +when inserting the files, using these two hooks: + + - Variable: write-region-annotate-functions + This variable's value is a list of functions for `write-region' to + run to encode text properties in some fashion as annotations to + the text being written in the file. *Note Writing to Files::. + + Each function in the list is called with two arguments: the start + and end of the region to be written. These functions should not + alter the contents of the buffer. Instead, they should return + lists indicating annotations to write in the file in addition to + the text in the buffer. + + Each function should return a list of elements of the form + `(POSITION . STRING)', where POSITION is an integer specifying the + relative position in the text to be written, and STRING is the + annotation to add there. + + Each list returned by one of these functions must be already + sorted in increasing order by POSITION. If there is more than one + function, `write-region' merges the lists destructively into one + sorted list. + + When `write-region' actually writes the text from the buffer to the + file, it intermixes the specified annotations at the corresponding + positions. All this takes place without modifying the buffer. + + - Variable: after-insert-file-functions + This variable holds a list of functions for `insert-file-contents' + to call after inserting a file's contents. These functions should + scan the inserted text for annotations, and convert them to the + text properties they stand for. + + Each function receives one argument, the length of the inserted + text; point indicates the start of that text. The function should + scan that text for annotations, delete them, and create the text + properties that the annotations specify. The function should + return the updated length of the inserted text, as it stands after + those changes. The value returned by one function becomes the + argument to the next function. + + These functions should always return with point at the beginning of + the inserted text. + + The intended use of `after-insert-file-functions' is for converting + some sort of textual annotations into actual text properties. But + other uses may be possible. + + We invite users to write Lisp programs to store and retrieve text +properties in files, using these hooks, and thus to experiment with +various data formats and find good ones. Eventually we hope users will +produce good, general extensions we can install in Emacs. + + We suggest not trying to handle arbitrary Lisp objects as property +names or property values--because a program that general is probably +difficult to write, and slow. Instead, choose a set of possible data +types that are reasonably flexible, and not too hard to encode. + + *Note Format Conversion::, for a related feature. + + +File: lispref.info, Node: Substitution, Next: Registers, Prev: Text Properties, Up: Text + +Substituting for a Character Code +================================= + + The following functions replace characters within a specified region +based on their character codes. + + - Function: subst-char-in-region START END OLD-CHAR NEW-CHAR &optional + NOUNDO + This function replaces all occurrences of the character OLD-CHAR + with the character NEW-CHAR in the region of the current buffer + defined by START and END. + + If NOUNDO is non-`nil', then `subst-char-in-region' does not + record the change for undo and does not mark the buffer as + modified. This feature is used for controlling selective display + (*note Selective Display::.). + + `subst-char-in-region' does not move point and returns `nil'. + + ---------- Buffer: foo ---------- + This is the contents of the buffer before. + ---------- Buffer: foo ---------- + + (subst-char-in-region 1 20 ?i ?X) + => nil + + ---------- Buffer: foo ---------- + ThXs Xs the contents of the buffer before. + ---------- Buffer: foo ---------- + + - Function: translate-region START END TABLE + This function applies a translation table to the characters in the + buffer between positions START and END. The translation table + TABLE can be either a string, a vector, or a char-table. + + If TABLE is a string, its Nth element is the mapping for the + character with code N. + + If TABLE is a vector, its Nth element is the mapping for character + with code N. Legal mappings are characters, strings, or `nil' + (meaning don't replace.) + + If TABLE is a char-table, its elements describe the mapping + between characters and their replacements. The char-table should + be of type `char' or `generic'. + + When the 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 TABLE are not altered by the + translation. + + The return value of `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. + + *NOTE*: Prior to XEmacs 21.2, the 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 + `translate-region', which translates character `a' to `the letter + a', removes character `b', and translates character `c' to newline. + + ---------- Buffer: foo ---------- + Here is a sentence in the buffer. + ---------- Buffer: foo ---------- + + (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)) + => 3 + + ---------- Buffer: foo ---------- + Here is the letter a senten + e in the uffer. + ---------- Buffer: foo ---------- + + +File: lispref.info, Node: Registers, Next: Transposition, Prev: Substitution, Up: Text + +Registers +========= + + A register is a sort of variable used in XEmacs editing that can +hold a marker, a string, a rectangle, a window configuration (of one +frame), or a frame configuration (of all frames). Each register is +named by a single character. All characters, including control and +meta characters (but with the exception of `C-g'), can be used to name +registers. Thus, there are 255 possible registers. A register is +designated in Emacs Lisp by a character that is its name. + + The functions in this section return unpredictable values unless +otherwise stated. + + - Variable: register-alist + This variable is an alist of elements of the form `(NAME . + CONTENTS)'. Normally, there is one element for each XEmacs + register that has been used. + + The object NAME is a character (an integer) identifying the + register. The object CONTENTS is a string, marker, or list + representing the register contents. A string represents text + stored in the register. A marker represents a position. A list + represents a rectangle; its elements are strings, one per line of + the rectangle. + + - Function: get-register REG + This function returns the contents of the register REG, or `nil' + if it has no contents. + + - Function: set-register REG VALUE + This function sets the contents of register REG to VALUE. A + register can be set to any value, but the other register functions + expect only certain data types. The return value is VALUE. + + - Command: view-register REG + This command displays what is contained in register REG. + + - Command: insert-register REG &optional BEFOREP + This command inserts contents of register REG into the current + buffer. + + Normally, this command puts point before the inserted text, and the + mark after it. However, if the optional second argument BEFOREP + is non-`nil', it puts the mark before and point after. You can + pass a non-`nil' second argument BEFOREP to this function + interactively by supplying any prefix argument. + + If the register contains a rectangle, then the rectangle is + inserted with its upper left corner at point. This means that + text is inserted in the current line and underneath it on + successive lines. + + If the register contains something other than saved text (a + string) or a rectangle (a list), currently useless things happen. + This may be changed in the future. + + +File: lispref.info, Node: Transposition, Next: Change Hooks, Prev: Registers, Up: Text + +Transposition of Text +===================== + + This subroutine is used by the transposition commands. + + - Function: transpose-regions START1 END1 START2 END2 &optional + LEAVE-MARKERS + This function exchanges two nonoverlapping portions of the buffer. + Arguments START1 and END1 specify the bounds of one portion and + arguments START2 and END2 specify the bounds of the other portion. + + Normally, `transpose-regions' relocates markers with the transposed + text; a marker previously positioned within one of the two + transposed portions moves along with that portion, thus remaining + between the same two characters in their new position. However, + if LEAVE-MARKERS is non-`nil', `transpose-regions' does not do + this--it leaves all markers unrelocated. + diff --git a/info/lispref.info-31 b/info/lispref.info-31 new file mode 100644 index 0000000..fdf8edd --- /dev/null +++ b/info/lispref.info-31 @@ -0,0 +1,1211 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Change Hooks, Next: Transformations, Prev: Transposition, Up: Text + +Change Hooks +============ + + These hook variables let you arrange to take notice of all changes in +all buffers (or in a particular buffer, if you make them buffer-local). + + The functions you use in these hooks should save and restore the +match data if they do anything that uses regular expressions; +otherwise, they will interfere in bizarre ways with the editing +operations that call them. + + Buffer changes made while executing the following hooks don't +themselves cause any change hooks to be invoked. + + - Variable: before-change-functions + This variable holds a list of a functions to call before any buffer + modification. Each function gets two arguments, the beginning and + end of the region that is about to change, represented as + integers. The buffer that is about to change is always the + current buffer. + + - Variable: after-change-functions + This variable holds a list of a functions to call after any buffer + modification. Each function receives three arguments: the + beginning and end of the region just changed, and the length of + the text that existed before the change. (To get the current + length, subtract the region beginning from the region end.) All + three arguments are integers. The buffer that's about to change + is always the current buffer. + + - Variable: before-change-function + This obsolete variable holds one function to call before any buffer + modification (or `nil' for no function). It is called just like + the functions in `before-change-functions'. + + - Variable: after-change-function + This obsolete variable holds one function to call after any buffer + modification (or `nil' for no function). It is called just like + the functions in `after-change-functions'. + + - Variable: first-change-hook + This variable is a normal hook that is run whenever a buffer is + changed that was previously in the unmodified state. + + +File: lispref.info, Node: Transformations, Prev: Change Hooks, Up: Text + +Textual transformations--MD5 and base64 support +=============================================== + + Some textual operations inherently require examining each character +in turn, and performing arithmetic operations on them. Such operations +can, of course, be implemented in Emacs Lisp, but tend to be very slow +for large portions of text or data. This is why some of them are +implemented in C, with an appropriate interface for Lisp programmers. +Examples of algorithms thus provided are MD5 and base64 support. + + MD5 is an algorithm for calculating message digests, as described in +rfc1321. Given a message of arbitrary length, MD5 produces an 128-bit +"fingerprint" ("message digest") corresponding to that message. It is +considered computationally infeasible to produce two messages having +the same MD5 digest, or to produce a message having a prespecified +target digest. MD5 is used heavily by various authentication schemes. + + Emacs Lisp interface to MD5 consists of a single function `md5': + + - Function: md5 OBJECT &optional START END + This function returns the MD5 message digest of OBJECT, a buffer + or string. + + Optional arguments START and END denote positions for computing + the digest of a portion of OBJECT. + + Some examples of usage: + + ;; Calculate the digest of the entire buffer + (md5 (current-buffer)) + => "8842b04362899b1cda8d2d126dc11712" + + ;; Calculate the digest of the current line + (md5 (current-buffer) (point-at-bol) (point-at-eol)) + => "60614d21e9dee27dfdb01fa4e30d6d00" + + ;; Calculate the digest of your name and email address + (md5 (concat (format "%s <%s>" (user-full-name) user-mail-address))) + => "0a2188c40fd38922d941fe6032fce516" + + Base64 is a portable encoding for arbitrary sequences of octets, in a +form that need not be readable by humans. It uses a 65-character subset +of US-ASCII, as described in rfc2045. Base64 is used by MIME to encode +binary bodies, and to encode binary characters in message headers. + + The Lisp interface to base64 consists of four functions: + + - Function: base64-encode-region BEG END &optional NO-LINE-BREAK + This function encodes the region between BEG and END of the + current buffer to base64 format. This means that the original + region is deleted, and replaced with its base64 equivalent. + + Normally, encoded base64 output is multi-line, with 76-character + lines. If NO-LINE-BREAK is non-`nil', newlines will not be + inserted, resulting in single-line output. + + Mule note: you should make sure that you convert the multibyte + characters (those that do not fit into 0-255 range) to something + else, because they cannot be meaningfully converted to base64. If + the `base64-encode-region' encounters such characters, it will + signal an error. + + `base64-encode-region' returns the length of the encoded text. + + ;; Encode the whole buffer in base64 + (base64-encode-region (point-min) (point-max)) + + The function can also be used interactively, in which case it + works on the currently active region. + + - Function: base64-encode-string STRING + This function encodes STRING to base64, and returns the encoded + string. + + For Mule, the same considerations apply as for + `base64-encode-region'. + + (base64-encode-string "fubar") + => "ZnViYXI=" + + - Function: base64-decode-region BEG END + This function decodes the region between BEG and END of the + current buffer. The region should be in base64 encoding. + + If the region was decoded correctly, `base64-decode-region' returns + the length of the decoded region. If the decoding failed, `nil' is + returned. + + ;; Decode a base64 buffer, and replace it with the decoded version + (base64-decode-region (point-min) (point-max)) + + - Function: base64-decode-string STRING + This function decodes STRING to base64, and returns the decoded + string. STRING should be valid base64-encoded text. + + If encoding was not possible, `nil' is returned. + + (base64-decode-string "ZnViYXI=") + => "fubar" + + (base64-decode-string "totally bogus") + => nil + + +File: lispref.info, Node: Searching and Matching, Next: Syntax Tables, Prev: Text, Up: Top + +Searching and Matching +********************** + + XEmacs provides two ways to search through a buffer for specified +text: exact string searches and regular expression searches. After a +regular expression search, you can examine the "match data" to +determine which text matched the whole regular expression or various +portions of it. + +* Menu: + +* String Search:: Search for an exact match. +* Regular Expressions:: Describing classes of strings. +* Regexp Search:: Searching for a match for a regexp. +* POSIX Regexps:: Searching POSIX-style for the longest match. +* Search and Replace:: Internals of `query-replace'. +* Match Data:: Finding out which part of the text matched + various parts of a regexp, after regexp search. +* Searching and Case:: Case-independent or case-significant searching. +* Standard Regexps:: Useful regexps for finding sentences, pages,... + + The `skip-chars...' functions also perform a kind of searching. +*Note Skipping Characters::. + + +File: lispref.info, Node: String Search, Next: Regular Expressions, Up: Searching and Matching + +Searching for Strings +===================== + + These are the primitive functions for searching through the text in a +buffer. They are meant for use in programs, but you may call them +interactively. If you do so, they prompt for the search string; LIMIT +and NOERROR are set to `nil', and REPEAT is set to 1. + + - Command: search-forward STRING &optional LIMIT NOERROR REPEAT + This function searches forward from point for an exact match for + STRING. If successful, it sets point to the end of the occurrence + found, and returns the new value of point. If no match is found, + the value and side effects depend on NOERROR (see below). + + In the following example, point is initially at the beginning of + the line. Then `(search-forward "fox")' moves point after the last + letter of `fox': + + ---------- Buffer: foo ---------- + -!-The quick brown fox jumped over the lazy dog. + ---------- Buffer: foo ---------- + + (search-forward "fox") + => 20 + + ---------- Buffer: foo ---------- + The quick brown fox-!- jumped over the lazy dog. + ---------- Buffer: foo ---------- + + The argument LIMIT specifies the upper bound to the search. (It + must be a position in the current buffer.) No match extending + after that position is accepted. If LIMIT is omitted or `nil', it + defaults to the end of the accessible portion of the buffer. + + What happens when the search fails depends on the value of + NOERROR. If NOERROR is `nil', a `search-failed' error is + signaled. If NOERROR is `t', `search-forward' returns `nil' and + does nothing. If NOERROR is neither `nil' nor `t', then + `search-forward' moves point to the upper bound and returns `nil'. + (It would be more consistent now to return the new position of + point in that case, but some programs may depend on a value of + `nil'.) + + If REPEAT is supplied (it must be a positive number), then the + search is repeated that many times (each time starting at the end + of the previous time's match). If these successive searches + succeed, the function succeeds, moving point and returning its new + value. Otherwise the search fails. + + - Command: search-backward STRING &optional LIMIT NOERROR REPEAT + This function searches backward from point for STRING. It is just + like `search-forward' except that it searches backwards and leaves + point at the beginning of the match. + + - Command: word-search-forward STRING &optional LIMIT NOERROR REPEAT + This function searches forward from point for a "word" match for + STRING. If it finds a match, it sets point to the end of the + match found, and returns the new value of point. + + Word matching regards STRING as a sequence of words, disregarding + punctuation that separates them. It searches the buffer for the + same sequence of words. Each word must be distinct in the buffer + (searching for the word `ball' does not match the word `balls'), + but the details of punctuation and spacing are ignored (searching + for `ball boy' does match `ball. Boy!'). + + In this example, point is initially at the beginning of the + buffer; the search leaves it between the `y' and the `!'. + + ---------- Buffer: foo ---------- + -!-He said "Please! Find + the ball boy!" + ---------- Buffer: foo ---------- + + (word-search-forward "Please find the ball, boy.") + => 35 + + ---------- Buffer: foo ---------- + He said "Please! Find + the ball boy-!-!" + ---------- Buffer: foo ---------- + + If LIMIT is non-`nil' (it must be a position in the current + buffer), then it is the upper bound to the search. The match + found must not extend after that position. + + If NOERROR is `nil', then `word-search-forward' signals an error + if the search fails. If NOERROR is `t', then it returns `nil' + instead of signaling an error. If NOERROR is neither `nil' nor + `t', it moves point to LIMIT (or the end of the buffer) and + returns `nil'. + + If REPEAT is non-`nil', then the search is repeated that many + times. Point is positioned at the end of the last match. + + - Command: word-search-backward STRING &optional LIMIT NOERROR REPEAT + This function searches backward from point for a word match to + STRING. This function is just like `word-search-forward' except + that it searches backward and normally leaves point at the + beginning of the match. + + +File: lispref.info, Node: Regular Expressions, Next: Regexp Search, Prev: String Search, Up: Searching and Matching + +Regular Expressions +=================== + + A "regular expression" ("regexp", for short) is a pattern that +denotes a (possibly infinite) set of strings. Searching for matches for +a regexp is a very powerful operation. This section explains how to +write regexps; the following section says how to search for them. + + To gain a thorough understanding of regular expressions and how to +use them to best advantage, we recommend that you study `Mastering +Regular Expressions, by Jeffrey E.F. Friedl, O'Reilly and Associates, +1997'. (It's known as the "Hip Owls" book, because of the picture on its +cover.) You might also read the manuals to *Note (gawk)Top::, *Note +(ed)Top::, `sed', `grep', *Note (perl)Top::, *Note (regex)Top::, *Note +(rx)Top::, `pcre', and *Note (flex)Top::, which also make good use of +regular expressions. + + The XEmacs regular expression syntax most closely resembles that of +`ed', or `grep', the GNU versions of which all utilize the GNU `regex' +library. XEmacs' version of `regex' has recently been extended with +some Perl-like capabilities, described in the next section. + +* Menu: + +* Syntax of Regexps:: Rules for writing regular expressions. +* Regexp Example:: Illustrates regular expression syntax. + + +File: lispref.info, Node: Syntax of Regexps, Next: Regexp Example, Up: Regular Expressions + +Syntax of Regular Expressions +----------------------------- + + Regular expressions have a syntax in which a few characters are +special constructs and the rest are "ordinary". An ordinary character +is a simple regular expression that matches that character and nothing +else. The special characters are `.', `*', `+', `?', `[', `]', `^', +`$', and `\'; no new special characters will be defined in the future. +Any other character appearing in a regular expression is ordinary, +unless a `\' precedes it. + + For example, `f' is not a special character, so it is ordinary, and +therefore `f' is a regular expression that matches the string `f' and +no other string. (It does *not* match the string `ff'.) Likewise, `o' +is a regular expression that matches only `o'. + + Any two regular expressions A and B can be concatenated. The result +is a regular expression that matches a string if A matches some amount +of the beginning of that string and B matches the rest of the string. + + As a simple example, we can concatenate the regular expressions `f' +and `o' to get the regular expression `fo', which matches only the +string `fo'. Still trivial. To do something more powerful, you need +to use one of the special characters. Here is a list of them: + +`. (Period)' + is a special character that matches any single character except a + newline. Using concatenation, we can make regular expressions + like `a.b', which matches any three-character string that begins + with `a' and ends with `b'. + +`*' + is not a construct by itself; it is a quantifying suffix operator + that means to repeat the preceding regular expression as many + times as possible. In `fo*', the `*' applies to the `o', so `fo*' + matches one `f' followed by any number of `o's. The case of zero + `o's is allowed: `fo*' does match `f'. + + `*' always applies to the *smallest* possible preceding + expression. Thus, `fo*' has a repeating `o', not a repeating `fo'. + + The matcher processes a `*' construct by matching, immediately, as + many repetitions as can be found; it is "greedy". Then it + continues with the rest of the pattern. If that fails, + backtracking occurs, discarding some of the matches of the + `*'-modified construct in case that makes it possible to match the + rest of the pattern. For example, in matching `ca*ar' against the + string `caaar', the `a*' first tries to match all three `a's; but + the rest of the pattern is `ar' and there is only `r' left to + match, so this try fails. The next alternative is for `a*' to + match only two `a's. With this choice, the rest of the regexp + matches successfully. + + Nested repetition operators can be extremely slow if they specify + backtracking loops. For example, it could take hours for the + regular expression `\(x+y*\)*a' to match the sequence + `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz'. The slowness is because + Emacs must try each imaginable way of grouping the 35 `x''s before + concluding that none of them can work. To make sure your regular + expressions run fast, check nested repetitions carefully. + +`+' + is a quantifying suffix operator similar to `*' except that the + preceding expression must match at least once. It is also + "greedy". So, for example, `ca+r' matches the strings `car' and + `caaaar' but not the string `cr', whereas `ca*r' matches all three + strings. + +`?' + is a quantifying suffix operator similar to `*', except that the + preceding expression can match either once or not at all. For + example, `ca?r' matches `car' or `cr', but does not match anything + else. + +`*?' + works just like `*', except that rather than matching the longest + match, it matches the shortest match. `*?' is known as a + "non-greedy" quantifier, a regexp construct borrowed from Perl. + + This construct very useful for when you want to match the text + inside a pair of delimiters. For instance, `/\*.*?\*/' will match + C comments in a string. This could not be achieved without the + use of greedy quantifier. + + This construct has not been available prior to XEmacs 20.4. It is + not available in FSF Emacs. + +`+?' + is the `+' analog to `*?'. + +`\{n,m\}' + serves as an interval quantifier, analogous to `*' or `+', but + specifies that the expression must match at least N times, but no + more than M times. This syntax is supported by most Unix regexp + utilities, and has been introduced to XEmacs for the version 20.3. + +`[ ... ]' + `[' begins a "character set", which is terminated by a `]'. In + the simplest case, the characters between the two brackets form + the set. Thus, `[ad]' matches either one `a' or one `d', and + `[ad]*' matches any string composed of just `a's and `d's + (including the empty string), from which it follows that `c[ad]*r' + matches `cr', `car', `cdr', `caddaar', etc. + + The usual regular expression special characters are not special + inside a character set. A completely different set of special + characters exists inside character sets: `]', `-' and `^'. + + `-' is used for ranges of characters. To write a range, write two + characters with a `-' between them. Thus, `[a-z]' matches any + lower case letter. Ranges may be intermixed freely with individual + characters, as in `[a-z$%.]', which matches any lower case letter + or `$', `%', or a period. + + To include a `]' in a character set, make it the first character. + For example, `[]a]' matches `]' or `a'. To include a `-', write + `-' as the first character in the set, or put it immediately after + a range. (You can replace one individual character C with the + range `C-C' to make a place to put the `-'.) There is no way to + write a set containing just `-' and `]'. + + To include `^' in a set, put it anywhere but at the beginning of + the set. + +`[^ ... ]' + `[^' begins a "complement character set", which matches any + character except the ones specified. Thus, `[^a-z0-9A-Z]' matches + all characters *except* letters and digits. + + `^' is not special in a character set unless it is the first + character. The character following the `^' is treated as if it + were first (thus, `-' and `]' are not special there). + + Note that a complement character set can match a newline, unless + newline is mentioned as one of the characters not to match. + +`^' + is a special character that matches the empty string, but only at + the beginning of a line in the text being matched. Otherwise it + fails to match anything. Thus, `^foo' matches a `foo' that occurs + at the beginning of a line. + + When matching a string instead of a buffer, `^' matches at the + beginning of the string or after a newline character `\n'. + +`$' + is similar to `^' but matches only at the end of a line. Thus, + `x+$' matches a string of one `x' or more at the end of a line. + + When matching a string instead of a buffer, `$' matches at the end + of the string or before a newline character `\n'. + +`\' + has two functions: it quotes the special characters (including + `\'), and it introduces additional special constructs. + + Because `\' quotes special characters, `\$' is a regular + expression that matches only `$', and `\[' is a regular expression + that matches only `[', and so on. + + Note that `\' also has special meaning in the read syntax of Lisp + strings (*note String Type::.), and must be quoted with `\'. For + example, the regular expression that matches the `\' character is + `\\'. To write a Lisp string that contains the characters `\\', + Lisp syntax requires you to quote each `\' with another `\'. + Therefore, the read syntax for a regular expression matching `\' + is `"\\\\"'. + + *Please note:* For historical compatibility, special characters are +treated as ordinary ones if they are in contexts where their special +meanings make no sense. For example, `*foo' treats `*' as ordinary +since there is no preceding expression on which the `*' can act. It is +poor practice to depend on this behavior; quote the special character +anyway, regardless of where it appears. + + For the most part, `\' followed by any character matches only that +character. However, there are several exceptions: characters that, +when preceded by `\', are special constructs. Such characters are +always ordinary when encountered on their own. Here is a table of `\' +constructs: + +`\|' + specifies an alternative. Two regular expressions A and B with + `\|' in between form an expression that matches anything that + either A or B matches. + + Thus, `foo\|bar' matches either `foo' or `bar' but no other string. + + `\|' applies to the largest possible surrounding expressions. + Only a surrounding `\( ... \)' grouping can limit the grouping + power of `\|'. + + Full backtracking capability exists to handle multiple uses of + `\|'. + +`\( ... \)' + is a grouping construct that serves three purposes: + + 1. To enclose a set of `\|' alternatives for other operations. + Thus, `\(foo\|bar\)x' matches either `foox' or `barx'. + + 2. To enclose an expression for a suffix operator such as `*' to + act on. Thus, `ba\(na\)*' matches `bananana', etc., with any + (zero or more) number of `na' strings. + + 3. To record a matched substring for future reference. + + This last application is not a consequence of the idea of a + parenthetical grouping; it is a separate feature that happens to be + assigned as a second meaning to the same `\( ... \)' construct + because there is no conflict in practice between the two meanings. + Here is an explanation of this feature: + +`\DIGIT' + matches the same text that matched the DIGITth occurrence of a `\( + ... \)' construct. + + In other words, after the end of a `\( ... \)' construct. the + matcher remembers the beginning and end of the text matched by that + construct. Then, later on in the regular expression, you can use + `\' followed by DIGIT to match that same text, whatever it may + have been. + + The strings matching the first nine `\( ... \)' constructs + appearing in a regular expression are assigned numbers 1 through 9 + in the order that the open parentheses appear in the regular + expression. So you can use `\1' through `\9' to refer to the text + matched by the corresponding `\( ... \)' constructs. + + For example, `\(.*\)\1' matches any newline-free string that is + composed of two identical halves. The `\(.*\)' matches the first + half, which may be anything, but the `\1' that follows must match + the same exact text. + +`\(?: ... \)' + is called a "shy" grouping operator, and it is used just like `\( + ... \)', except that it does not cause the matched substring to be + recorded for future reference. + + This is useful when you need a lot of grouping `\( ... \)' + constructs, but only want to remember one or two. Then you can use + not want to remember them for later use with `match-string'. + + Using `\(?: ... \)' rather than `\( ... \)' when you don't need + the captured substrings ought to speed up your programs some, + since it shortens the code path followed by the regular expression + engine, as well as the amount of memory allocation and string + copying it must do. The actual performance gain to be observed + has not been measured or quantified as of this writing. + + The shy grouping operator has been borrowed from Perl, and has not + been available prior to XEmacs 20.3, nor is it available in FSF + Emacs. + +`\w' + matches any word-constituent character. The editor syntax table + determines which characters these are. *Note Syntax Tables::. + +`\W' + matches any character that is not a word constituent. + +`\sCODE' + matches any character whose syntax is CODE. Here CODE is a + character that represents a syntax code: thus, `w' for word + constituent, `-' for whitespace, `(' for open parenthesis, etc. + *Note Syntax Tables::, for a list of syntax codes and the + characters that stand for them. + +`\SCODE' + matches any character whose syntax is not CODE. + + The following regular expression constructs match the empty +string--that is, they don't use up any characters--but whether they +match depends on the context. + +`\`' + matches the empty string, but only at the beginning of the buffer + or string being matched against. + +`\'' + matches the empty string, but only at the end of the buffer or + string being matched against. + +`\=' + matches the empty string, but only at point. (This construct is + not defined when matching against a string.) + +`\b' + matches the empty string, but only at the beginning or end of a + word. Thus, `\bfoo\b' matches any occurrence of `foo' as a + separate word. `\bballs?\b' matches `ball' or `balls' as a + separate word. + +`\B' + matches the empty string, but *not* at the beginning or end of a + word. + +`\<' + matches the empty string, but only at the beginning of a word. + +`\>' + matches the empty string, but only at the end of a word. + + Not every string is a valid regular expression. For example, a +string with unbalanced square brackets is invalid (with a few +exceptions, such as `[]]'), and so is a string that ends with a single +`\'. If an invalid regular expression is passed to any of the search +functions, an `invalid-regexp' error is signaled. + + - Function: regexp-quote STRING + This function returns a regular expression string that matches + exactly STRING and nothing else. This allows you to request an + exact string match when calling a function that wants a regular + expression. + + (regexp-quote "^The cat$") + => "\\^The cat\\$" + + One use of `regexp-quote' is to combine an exact string match with + context described as a regular expression. For example, this + searches for the string that is the value of `string', surrounded + by whitespace: + + (re-search-forward + (concat "\\s-" (regexp-quote string) "\\s-")) + + +File: lispref.info, Node: Regexp Example, Prev: Syntax of Regexps, Up: Regular Expressions + +Complex Regexp Example +---------------------- + + Here is a complicated regexp, used by XEmacs to recognize the end of +a sentence together with any whitespace that follows. It is the value +of the variable `sentence-end'. + + First, we show the regexp as a string in Lisp syntax to distinguish +spaces from tab characters. The string constant begins and ends with a +double-quote. `\"' stands for a double-quote as part of the string, +`\\' for a backslash as part of the string, `\t' for a tab and `\n' for +a newline. + + "[.?!][]\"')}]*\\($\\| $\\|\t\\| \\)[ \t\n]*" + + In contrast, if you evaluate the variable `sentence-end', you will +see the following: + + sentence-end + => + "[.?!][]\"')}]*\\($\\| $\\| \\| \\)[ + ]*" + +In this output, tab and newline appear as themselves. + + This regular expression contains four parts in succession and can be +deciphered as follows: + +`[.?!]' + The first part of the pattern is a character set that matches any + one of three characters: period, question mark, and exclamation + mark. The match must begin with one of these three characters. + +`[]\"')}]*' + The second part of the pattern matches any closing braces and + quotation marks, zero or more of them, that may follow the period, + question mark or exclamation mark. The `\"' is Lisp syntax for a + double-quote in a string. The `*' at the end indicates that the + immediately preceding regular expression (a character set, in this + case) may be repeated zero or more times. + +`\\($\\| $\\|\t\\| \\)' + The third part of the pattern matches the whitespace that follows + the end of a sentence: the end of a line, or a tab, or two spaces. + The double backslashes mark the parentheses and vertical bars as + regular expression syntax; the parentheses delimit a group and the + vertical bars separate alternatives. The dollar sign is used to + match the end of a line. + +`[ \t\n]*' + Finally, the last part of the pattern matches any additional + whitespace beyond the minimum needed to end a sentence. + + +File: lispref.info, Node: Regexp Search, Next: POSIX Regexps, Prev: Regular Expressions, Up: Searching and Matching + +Regular Expression Searching +============================ + + In XEmacs, you can search for the next match for a regexp either +incrementally or not. Incremental search commands are described in the +`The XEmacs Reference Manual'. *Note Regular Expression Search: +(emacs)Regexp Search. Here we describe only the search functions +useful in programs. The principal one is `re-search-forward'. + + - Command: re-search-forward REGEXP &optional LIMIT NOERROR REPEAT + This function searches forward in the current buffer for a string + of text that is matched by the regular expression REGEXP. The + function skips over any amount of text that is not matched by + REGEXP, and leaves point at the end of the first match found. It + returns the new value of point. + + If LIMIT is non-`nil' (it must be a position in the current + buffer), then it is the upper bound to the search. No match + extending after that position is accepted. + + What happens when the search fails depends on the value of + NOERROR. If NOERROR is `nil', a `search-failed' error is + signaled. If NOERROR is `t', `re-search-forward' does nothing and + returns `nil'. If NOERROR is neither `nil' nor `t', then + `re-search-forward' moves point to LIMIT (or the end of the + buffer) and returns `nil'. + + If REPEAT is supplied (it must be a positive number), then the + search is repeated that many times (each time starting at the end + of the previous time's match). If these successive searches + succeed, the function succeeds, moving point and returning its new + value. Otherwise the search fails. + + In the following example, point is initially before the `T'. + Evaluating the search call moves point to the end of that line + (between the `t' of `hat' and the newline). + + ---------- Buffer: foo ---------- + I read "-!-The cat in the hat + comes back" twice. + ---------- Buffer: foo ---------- + + (re-search-forward "[a-z]+" nil t 5) + => 27 + + ---------- Buffer: foo ---------- + I read "The cat in the hat-!- + comes back" twice. + ---------- Buffer: foo ---------- + + - Command: re-search-backward REGEXP &optional LIMIT NOERROR REPEAT + This function searches backward in the current buffer for a string + of text that is matched by the regular expression REGEXP, leaving + point at the beginning of the first text found. + + This function is analogous to `re-search-forward', but they are not + simple mirror images. `re-search-forward' finds the match whose + beginning is as close as possible to the starting point. If + `re-search-backward' were a perfect mirror image, it would find the + match whose end is as close as possible. However, in fact it + finds the match whose beginning is as close as possible. The + reason is that matching a regular expression at a given spot + always works from beginning to end, and starts at a specified + beginning position. + + A true mirror-image of `re-search-forward' would require a special + feature for matching regexps from end to beginning. It's not + worth the trouble of implementing that. + + - Function: string-match REGEXP STRING &optional START + This function returns the index of the start of the first match for + the regular expression REGEXP in STRING, or `nil' if there is no + match. If START is non-`nil', the search starts at that index in + STRING. + + For example, + + (string-match + "quick" "The quick brown fox jumped quickly.") + => 4 + (string-match + "quick" "The quick brown fox jumped quickly." 8) + => 27 + + The index of the first character of the string is 0, the index of + the second character is 1, and so on. + + After this function returns, the index of the first character + beyond the match is available as `(match-end 0)'. *Note Match + Data::. + + (string-match + "quick" "The quick brown fox jumped quickly." 8) + => 27 + + (match-end 0) + => 32 + + - Function: split-string STRING &optional PATTERN + This function splits STRING to substrings delimited by PATTERN, + and returns a list of substrings. If PATTERN is omitted, it + defaults to `[ \f\t\n\r\v]+', which means that it splits STRING by + white-space. + + (split-string "foo bar") + => ("foo" "bar") + + (split-string "something") + => ("something") + + (split-string "a:b:c" ":") + => ("a" "b" "c") + + (split-string ":a::b:c" ":") + => ("" "a" "" "b" "c") + + - Function: split-path PATH + This function splits a search path into a list of strings. The + path components are separated with the characters specified with + `path-separator'. Under Unix, `path-separator' will normally be + `:', while under Windows, it will be `;'. + + - Function: looking-at REGEXP + This function determines whether the text in the current buffer + directly following point matches the regular expression REGEXP. + "Directly following" means precisely that: the search is + "anchored" and it can succeed only starting with the first + character following point. The result is `t' if so, `nil' + otherwise. + + This function does not move point, but it updates the match data, + which you can access using `match-beginning' and `match-end'. + *Note Match Data::. + + In this example, point is located directly before the `T'. If it + were anywhere else, the result would be `nil'. + + ---------- Buffer: foo ---------- + I read "-!-The cat in the hat + comes back" twice. + ---------- Buffer: foo ---------- + + (looking-at "The cat in the hat$") + => t + + +File: lispref.info, Node: POSIX Regexps, Next: Search and Replace, Prev: Regexp Search, Up: Searching and Matching + +POSIX Regular Expression Searching +================================== + + The usual regular expression functions do backtracking when necessary +to handle the `\|' and repetition constructs, but they continue this +only until they find *some* match. Then they succeed and report the +first match found. + + This section describes alternative search functions which perform the +full backtracking specified by the POSIX standard for regular expression +matching. They continue backtracking until they have tried all +possibilities and found all matches, so they can report the longest +match, as required by POSIX. This is much slower, so use these +functions only when you really need the longest match. + + In Emacs versions prior to 19.29, these functions did not exist, and +the functions described above implemented full POSIX backtracking. + + - Function: posix-search-forward REGEXP &optional LIMIT NOERROR REPEAT + This is like `re-search-forward' except that it performs the full + backtracking specified by the POSIX standard for regular expression + matching. + + - Function: posix-search-backward REGEXP &optional LIMIT NOERROR REPEAT + This is like `re-search-backward' except that it performs the full + backtracking specified by the POSIX standard for regular expression + matching. + + - Function: posix-looking-at REGEXP + This is like `looking-at' except that it performs the full + backtracking specified by the POSIX standard for regular expression + matching. + + - Function: posix-string-match REGEXP STRING &optional START + This is like `string-match' except that it performs the full + backtracking specified by the POSIX standard for regular expression + matching. + + +File: lispref.info, Node: Search and Replace, Next: Match Data, Prev: POSIX Regexps, Up: Searching and Matching + +Search and Replace +================== + + - Function: perform-replace FROM-STRING REPLACEMENTS QUERY-FLAG + REGEXP-FLAG DELIMITED-FLAG &optional REPEAT-COUNT MAP + This function is the guts of `query-replace' and related commands. + It searches for occurrences of FROM-STRING and replaces some or + all of them. If QUERY-FLAG is `nil', it replaces all occurrences; + otherwise, it asks the user what to do about each one. + + If REGEXP-FLAG is non-`nil', then FROM-STRING is considered a + regular expression; otherwise, it must match literally. If + DELIMITED-FLAG is non-`nil', then only replacements surrounded by + word boundaries are considered. + + The argument REPLACEMENTS specifies what to replace occurrences + with. If it is a string, that string is used. It can also be a + list of strings, to be used in cyclic order. + + If REPEAT-COUNT is non-`nil', it should be an integer. Then it + specifies how many times to use each of the strings in the + REPLACEMENTS list before advancing cyclicly to the next one. + + Normally, the keymap `query-replace-map' defines the possible user + responses for queries. The argument MAP, if non-`nil', is a + keymap to use instead of `query-replace-map'. + + - Variable: query-replace-map + This variable holds a special keymap that defines the valid user + responses for `query-replace' and related functions, as well as + `y-or-n-p' and `map-y-or-n-p'. It is unusual in two ways: + + * The "key bindings" are not commands, just symbols that are + meaningful to the functions that use this map. + + * Prefix keys are not supported; each key binding must be for a + single event key sequence. This is because the functions + don't use read key sequence to get the input; instead, they + read a single event and look it up "by hand." + + Here are the meaningful "bindings" for `query-replace-map'. Several +of them are meaningful only for `query-replace' and friends. + +`act' + Do take the action being considered--in other words, "yes." + +`skip' + Do not take action for this question--in other words, "no." + +`exit' + Answer this question "no," and give up on the entire series of + questions, assuming that the answers will be "no." + +`act-and-exit' + Answer this question "yes," and give up on the entire series of + questions, assuming that subsequent answers will be "no." + +`act-and-show' + Answer this question "yes," but show the results--don't advance yet + to the next question. + +`automatic' + Answer this question and all subsequent questions in the series + with "yes," without further user interaction. + +`backup' + Move back to the previous place that a question was asked about. + +`edit' + Enter a recursive edit to deal with this question--instead of any + other action that would normally be taken. + +`delete-and-edit' + Delete the text being considered, then enter a recursive edit to + replace it. + +`recenter' + Redisplay and center the window, then ask the same question again. + +`quit' + Perform a quit right away. Only `y-or-n-p' and related functions + use this answer. + +`help' + Display some help, then ask again. + + +File: lispref.info, Node: Match Data, Next: Searching and Case, Prev: Search and Replace, Up: Searching and Matching + +The Match Data +============== + + XEmacs keeps track of the positions of the start and end of segments +of text found during a regular expression search. This means, for +example, that you can search for a complex pattern, such as a date in +an Rmail message, and then extract parts of the match under control of +the pattern. + + Because the match data normally describe the most recent search only, +you must be careful not to do another search inadvertently between the +search you wish to refer back to and the use of the match data. If you +can't avoid another intervening search, you must save and restore the +match data around it, to prevent it from being overwritten. + +* Menu: + +* Simple Match Data:: Accessing single items of match data, + such as where a particular subexpression started. +* Replacing Match:: Replacing a substring that was matched. +* Entire Match Data:: Accessing the entire match data at once, as a list. +* Saving Match Data:: Saving and restoring the match data. + + +File: lispref.info, Node: Simple Match Data, Next: Replacing Match, Up: Match Data + +Simple Match Data Access +------------------------ + + This section explains how to use the match data to find out what was +matched by the last search or match operation. + + You can ask about the entire matching text, or about a particular +parenthetical subexpression of a regular expression. The COUNT +argument in the functions below specifies which. If COUNT is zero, you +are asking about the entire match. If COUNT is positive, it specifies +which subexpression you want. + + Recall that the subexpressions of a regular expression are those +expressions grouped with escaped parentheses, `\(...\)'. The COUNTth +subexpression is found by counting occurrences of `\(' from the +beginning of the whole regular expression. The first subexpression is +numbered 1, the second 2, and so on. Only regular expressions can have +subexpressions--after a simple string search, the only information +available is about the entire match. + + - Function: match-string COUNT &optional IN-STRING + This function returns, as a string, the text matched in the last + search or match operation. It returns the entire text if COUNT is + zero, or just the portion corresponding to the COUNTth + parenthetical subexpression, if COUNT is positive. If COUNT is + out of range, or if that subexpression didn't match anything, the + value is `nil'. + + If the last such operation was done against a string with + `string-match', then you should pass the same string as the + argument IN-STRING. Otherwise, after a buffer search or match, + you should omit IN-STRING or pass `nil' for it; but you should + make sure that the current buffer when you call `match-string' is + the one in which you did the searching or matching. + + - Function: match-beginning COUNT + This function returns the position of the start of text matched by + the last regular expression searched for, or a subexpression of it. + + If COUNT is zero, then the value is the position of the start of + the entire match. Otherwise, COUNT specifies a subexpression in + the regular expression, and the value of the function is the + starting position of the match for that subexpression. + + The value is `nil' for a subexpression inside a `\|' alternative + that wasn't used in the match. + + - Function: match-end COUNT + This function is like `match-beginning' except that it returns the + position of the end of the match, rather than the position of the + beginning. + + Here is an example of using the match data, with a comment showing +the positions within the text: + + (string-match "\\(qu\\)\\(ick\\)" + "The quick fox jumped quickly.") + ;0123456789 + => 4 + + (match-string 0 "The quick fox jumped quickly.") + => "quick" + (match-string 1 "The quick fox jumped quickly.") + => "qu" + (match-string 2 "The quick fox jumped quickly.") + => "ick" + + (match-beginning 1) ; The beginning of the match + => 4 ; with `qu' is at index 4. + + (match-beginning 2) ; The beginning of the match + => 6 ; with `ick' is at index 6. + + (match-end 1) ; The end of the match + => 6 ; with `qu' is at index 6. + + (match-end 2) ; The end of the match + => 9 ; with `ick' is at index 9. + + Here is another example. Point is initially located at the beginning +of the line. Searching moves point to between the space and the word +`in'. The beginning of the entire match is at the 9th character of the +buffer (`T'), and the beginning of the match for the first +subexpression is at the 13th character (`c'). + + (list + (re-search-forward "The \\(cat \\)") + (match-beginning 0) + (match-beginning 1)) + => (9 9 13) + + ---------- Buffer: foo ---------- + I read "The cat -!-in the hat comes back" twice. + ^ ^ + 9 13 + ---------- Buffer: foo ---------- + +(In this case, the index returned is a buffer position; the first +character of the buffer counts as 1.) + + +File: lispref.info, Node: Replacing Match, Next: Entire Match Data, Prev: Simple Match Data, Up: Match Data + +Replacing the Text That Matched +------------------------------- + + This function replaces the text matched by the last search with +REPLACEMENT. + + - Function: replace-match REPLACEMENT &optional FIXEDCASE LITERAL + STRING + This function replaces the text in the buffer (or in STRING) that + was matched by the last search. It replaces that text with + REPLACEMENT. + + If you did the last search in a buffer, you should specify `nil' + for STRING. Then `replace-match' does the replacement by editing + the buffer; it leaves point at the end of the replacement text, + and returns `t'. + + If you did the search in a string, pass the same string as STRING. + Then `replace-match' does the replacement by constructing and + returning a new string. + + If FIXEDCASE is non-`nil', then the case of the replacement text + is not changed; otherwise, the replacement text is converted to a + different case depending upon the capitalization of the text to be + replaced. If the original text is all upper case, the replacement + text is converted to upper case. If the first word of the + original text is capitalized, then the first word of the + replacement text is capitalized. If the original text contains + just one word, and that word is a capital letter, `replace-match' + considers this a capitalized first word rather than all upper case. + + If `case-replace' is `nil', then case conversion is not done, + regardless of the value of FIXED-CASE. *Note Searching and Case::. + + If LITERAL is non-`nil', then REPLACEMENT is inserted exactly as + it is, the only alterations being case changes as needed. If it + is `nil' (the default), then the character `\' is treated + specially. If a `\' appears in REPLACEMENT, then it must be part + of one of the following sequences: + + `\&' + `\&' stands for the entire text being replaced. + + `\N' + `\N', where N is a digit, stands for the text that matched + the Nth subexpression in the original regexp. Subexpressions + are those expressions grouped inside `\(...\)'. + + `\\' + `\\' stands for a single `\' in the replacement text. + diff --git a/info/lispref.info-32 b/info/lispref.info-32 new file mode 100644 index 0000000..78abfe7 --- /dev/null +++ b/info/lispref.info-32 @@ -0,0 +1,1233 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Entire Match Data, Next: Saving Match Data, Prev: Replacing Match, Up: Match Data + +Accessing the Entire Match Data +------------------------------- + + The functions `match-data' and `set-match-data' read or write the +entire match data, all at once. + + - Function: match-data + This function returns a newly constructed list containing all the + information on what text the last search matched. Element zero is + the position of the beginning of the match for the whole + expression; element one is the position of the end of the match + for the expression. The next two elements are the positions of + the beginning and end of the match for the first subexpression, + and so on. In general, element number 2N corresponds to + `(match-beginning N)'; and element number 2N + 1 corresponds to + `(match-end N)'. + + All the elements are markers or `nil' if matching was done on a + buffer, and all are integers or `nil' if matching was done on a + string with `string-match'. (In Emacs 18 and earlier versions, + markers were used even for matching on a string, except in the case + of the integer 0.) + + As always, there must be no possibility of intervening searches + between the call to a search function and the call to `match-data' + that is intended to access the match data for that search. + + (match-data) + => (# + # + # + #) + + - Function: set-match-data MATCH-LIST + This function sets the match data from the elements of MATCH-LIST, + which should be a list that was the value of a previous call to + `match-data'. + + If MATCH-LIST refers to a buffer that doesn't exist, you don't get + an error; that sets the match data in a meaningless but harmless + way. + + `store-match-data' is an alias for `set-match-data'. + + +File: lispref.info, Node: Saving Match Data, Prev: Entire Match Data, Up: Match Data + +Saving and Restoring the Match Data +----------------------------------- + + When you call a function that may do a search, you may need to save +and restore the match data around that call, if you want to preserve the +match data from an earlier search for later use. Here is an example +that shows the problem that arises if you fail to save the match data: + + (re-search-forward "The \\(cat \\)") + => 48 + (foo) ; Perhaps `foo' does + ; more searching. + (match-end 0) + => 61 ; Unexpected result--not 48! + + You can save and restore the match data with `save-match-data': + + - Macro: save-match-data BODY... + This special form executes BODY, saving and restoring the match + data around it. + + You can use `set-match-data' together with `match-data' to imitate +the effect of the special form `save-match-data'. This is useful for +writing code that can run in Emacs 18. Here is how: + + (let ((data (match-data))) + (unwind-protect + ... ; May change the original match data. + (set-match-data data))) + + Emacs automatically saves and restores the match data when it runs +process filter functions (*note Filter Functions::.) and process +sentinels (*note Sentinels::.). + + +File: lispref.info, Node: Searching and Case, Next: Standard Regexps, Prev: Match Data, Up: Searching and Matching + +Searching and Case +================== + + By default, searches in Emacs ignore the case of the text they are +searching through; if you specify searching for `FOO', then `Foo' or +`foo' is also considered a match. Regexps, and in particular character +sets, are included: thus, `[aB]' would match `a' or `A' or `b' or `B'. + + If you do not want this feature, set the variable `case-fold-search' +to `nil'. Then all letters must match exactly, including case. This +is a buffer-local variable; altering the variable affects only the +current buffer. (*Note Intro to Buffer-Local::.) Alternatively, you +may change the value of `default-case-fold-search', which is the +default value of `case-fold-search' for buffers that do not override it. + + Note that the user-level incremental search feature handles case +distinctions differently. When given a lower case letter, it looks for +a match of either case, but when given an upper case letter, it looks +for an upper case letter only. But this has nothing to do with the +searching functions Lisp functions use. + + - User Option: case-replace + This variable determines whether the replacement functions should + preserve case. If the variable is `nil', that means to use the + replacement text verbatim. A non-`nil' value means to convert the + case of the replacement text according to the text being replaced. + + The function `replace-match' is where this variable actually has + its effect. *Note Replacing Match::. + + - User Option: case-fold-search + This buffer-local variable determines whether searches should + ignore case. If the variable is `nil' they do not ignore case; + otherwise they do ignore case. + + - Variable: default-case-fold-search + The value of this variable is the default value for + `case-fold-search' in buffers that do not override it. This is the + same as `(default-value 'case-fold-search)'. + + +File: lispref.info, Node: Standard Regexps, Prev: Searching and Case, Up: Searching and Matching + +Standard Regular Expressions Used in Editing +============================================ + + This section describes some variables that hold regular expressions +used for certain purposes in editing: + + - Variable: page-delimiter + This is the regexp describing line-beginnings that separate pages. + The default value is `"^\014"' (i.e., `"^^L"' or `"^\C-l"'); this + matches a line that starts with a formfeed character. + + The following two regular expressions should *not* assume the match +always starts at the beginning of a line; they should not use `^' to +anchor the match. Most often, the paragraph commands do check for a +match only at the beginning of a line, which means that `^' would be +superfluous. When there is a nonzero left margin, they accept matches +that start after the left margin. In that case, a `^' would be +incorrect. However, a `^' is harmless in modes where a left margin is +never used. + + - Variable: paragraph-separate + This is the regular expression for recognizing the beginning of a + line that separates paragraphs. (If you change this, you may have + to change `paragraph-start' also.) The default value is + `"[ \t\f]*$"', which matches a line that consists entirely of + spaces, tabs, and form feeds (after its left margin). + + - Variable: paragraph-start + This is the regular expression for recognizing the beginning of a + line that starts *or* separates paragraphs. The default value is + `"[ \t\n\f]"', which matches a line starting with a space, tab, + newline, or form feed (after its left margin). + + - Variable: sentence-end + This is the regular expression describing the end of a sentence. + (All paragraph boundaries also end sentences, regardless.) The + default value is: + + "[.?!][]\"')}]*\\($\\| $\\|\t\\| \\)[ \t\n]*" + + This means a period, question mark or exclamation mark, followed + optionally by a closing parenthetical character, followed by tabs, + spaces or new lines. + + For a detailed explanation of this regular expression, see *Note + Regexp Example::. + + +File: lispref.info, Node: Syntax Tables, Next: Abbrevs, Prev: Searching and Matching, Up: Top + +Syntax Tables +************* + + A "syntax table" specifies the syntactic textual function of each +character. This information is used by the parsing commands, the +complex movement commands, and others to determine where words, symbols, +and other syntactic constructs begin and end. The current syntax table +controls the meaning of the word motion functions (*note Word Motion::.) +and the list motion functions (*note List Motion::.) as well as the +functions in this chapter. + +* Menu: + +* Basics: Syntax Basics. Basic concepts of syntax tables. +* Desc: Syntax Descriptors. How characters are classified. +* Syntax Table Functions:: How to create, examine and alter syntax tables. +* Motion and Syntax:: Moving over characters with certain syntaxes. +* Parsing Expressions:: Parsing balanced expressions + using the syntax table. +* Standard Syntax Tables:: Syntax tables used by various major modes. +* Syntax Table Internals:: How syntax table information is stored. + + +File: lispref.info, Node: Syntax Basics, Next: Syntax Descriptors, Up: Syntax Tables + +Syntax Table Concepts +===================== + + A "syntax table" provides Emacs with the information that determines +the syntactic use of each character in a buffer. This information is +used by the parsing commands, the complex movement commands, and others +to determine where words, symbols, and other syntactic constructs begin +and end. The current syntax table controls the meaning of the word +motion functions (*note Word Motion::.) and the list motion functions +(*note List Motion::.) as well as the functions in this chapter. + + Under XEmacs 20, a syntax table is a particular subtype of the +primitive char table type (*note Char Tables::.), and each element of +the char table is an integer that encodes the syntax of the character in +question, or a cons of such an integer and a matching character (for +characters with parenthesis syntax). + + Under XEmacs 19, a syntax table is a vector of 256 elements; it +contains one entry for each of the 256 possible characters in an 8-bit +byte. Each element is an integer that encodes the syntax of the +character in question. (The matching character, if any, is embedded in +the bits of this integer.) + + Syntax tables are used only for moving across text, not for the Emacs +Lisp reader. XEmacs Lisp uses built-in syntactic rules when reading +Lisp expressions, and these rules cannot be changed. + + Each buffer has its own major mode, and each major mode has its own +idea of the syntactic class of various characters. For example, in Lisp +mode, the character `;' begins a comment, but in C mode, it terminates +a statement. To support these variations, XEmacs makes the choice of +syntax table local to each buffer. Typically, each major mode has its +own syntax table and installs that table in each buffer that uses that +mode. Changing this table alters the syntax in all those buffers as +well as in any buffers subsequently put in that mode. Occasionally +several similar modes share one syntax table. *Note Example Major +Modes::, for an example of how to set up a syntax table. + + A syntax table can inherit the data for some characters from the +standard syntax table, while specifying other characters itself. The +"inherit" syntax class means "inherit this character's syntax from the +standard syntax table." Most major modes' syntax tables inherit the +syntax of character codes 0 through 31 and 128 through 255. This is +useful with character sets such as ISO Latin-1 that have additional +alphabetic characters in the range 128 to 255. Just changing the +standard syntax for these characters affects all major modes. + + - Function: syntax-table-p OBJECT + This function returns `t' if OBJECT is a vector of length 256 + elements. This means that the vector may be a syntax table. + However, according to this test, any vector of length 256 is + considered to be a syntax table, no matter what its contents. + + +File: lispref.info, Node: Syntax Descriptors, Next: Syntax Table Functions, Prev: Syntax Basics, Up: Syntax Tables + +Syntax Descriptors +================== + + This section describes the syntax classes and flags that denote the +syntax of a character, and how they are represented as a "syntax +descriptor", which is a Lisp string that you pass to +`modify-syntax-entry' to specify the desired syntax. + + XEmacs defines a number of "syntax classes". Each syntax table puts +each character into one class. There is no necessary relationship +between the class of a character in one syntax table and its class in +any other table. + + Each class is designated by a mnemonic character, which serves as the +name of the class when you need to specify a class. Usually the +designator character is one that is frequently in that class; however, +its meaning as a designator is unvarying and independent of what syntax +that character currently has. + + A syntax descriptor is a Lisp string that specifies a syntax class, a +matching character (used only for the parenthesis classes) and flags. +The first character is the designator for a syntax class. The second +character is the character to match; if it is unused, put a space there. +Then come the characters for any desired flags. If no matching +character or flags are needed, one character is sufficient. + + For example, the descriptor for the character `*' in C mode is +`. 23' (i.e., punctuation, matching character slot unused, second +character of a comment-starter, first character of an comment-ender), +and the entry for `/' is `. 14' (i.e., punctuation, matching character +slot unused, first character of a comment-starter, second character of +a comment-ender). + +* Menu: + +* Syntax Class Table:: Table of syntax classes. +* Syntax Flags:: Additional flags each character can have. + + +File: lispref.info, Node: Syntax Class Table, Next: Syntax Flags, Up: Syntax Descriptors + +Table of Syntax Classes +----------------------- + + Here is a table of syntax classes, the characters that stand for +them, their meanings, and examples of their use. + + - Syntax class: whitespace character + "Whitespace characters" (designated with ` ' or `-') separate + symbols and words from each other. Typically, whitespace + characters have no other syntactic significance, and multiple + whitespace characters are syntactically equivalent to a single + one. Space, tab, newline and formfeed are almost always + classified as whitespace. + + - Syntax class: word constituent + "Word constituents" (designated with `w') are parts of normal + English words and are typically used in variable and command names + in programs. All upper- and lower-case letters, and the digits, + are typically word constituents. + + - Syntax class: symbol constituent + "Symbol constituents" (designated with `_') are the extra + characters that are used in variable and command names along with + word constituents. For example, the symbol constituents class is + used in Lisp mode to indicate that certain characters may be part + of symbol names even though they are not part of English words. + These characters are `$&*+-_<>'. In standard C, the only + non-word-constituent character that is valid in symbols is + underscore (`_'). + + - Syntax class: punctuation character + "Punctuation characters" (`.') are those characters that are used + as punctuation in English, or are used in some way in a programming + language to separate symbols from one another. Most programming + language modes, including Emacs Lisp mode, have no characters in + this class since the few characters that are not symbol or word + constituents all have other uses. + + - Syntax class: open parenthesis character + - Syntax class: close parenthesis character + Open and close "parenthesis characters" are characters used in + dissimilar pairs to surround sentences or expressions. Such a + grouping is begun with an open parenthesis character and + terminated with a close. Each open parenthesis character matches + a particular close parenthesis character, and vice versa. + Normally, XEmacs indicates momentarily the matching open + parenthesis when you insert a close parenthesis. *Note Blinking::. + + The class of open parentheses is designated with `(', and that of + close parentheses with `)'. + + In English text, and in C code, the parenthesis pairs are `()', + `[]', and `{}'. In XEmacs Lisp, the delimiters for lists and + vectors (`()' and `[]') are classified as parenthesis characters. + + - Syntax class: string quote + "String quote characters" (designated with `"') are used in many + languages, including Lisp and C, to delimit string constants. The + same string quote character appears at the beginning and the end + of a string. Such quoted strings do not nest. + + The parsing facilities of XEmacs consider a string as a single + token. The usual syntactic meanings of the characters in the + string are suppressed. + + The Lisp modes have two string quote characters: double-quote (`"') + and vertical bar (`|'). `|' is not used in XEmacs Lisp, but it is + used in Common Lisp. C also has two string quote characters: + double-quote for strings, and single-quote (`'') for character + constants. + + English text has no string quote characters because English is not + a programming language. Although quotation marks are used in + English, we do not want them to turn off the usual syntactic + properties of other characters in the quotation. + + - Syntax class: escape + An "escape character" (designated with `\') starts an escape + sequence such as is used in C string and character constants. The + character `\' belongs to this class in both C and Lisp. (In C, it + is used thus only inside strings, but it turns out to cause no + trouble to treat it this way throughout C code.) + + Characters in this class count as part of words if + `words-include-escapes' is non-`nil'. *Note Word Motion::. + + - Syntax class: character quote + A "character quote character" (designated with `/') quotes the + following character so that it loses its normal syntactic meaning. + This differs from an escape character in that only the character + immediately following is ever affected. + + Characters in this class count as part of words if + `words-include-escapes' is non-`nil'. *Note Word Motion::. + + This class is used for backslash in TeX mode. + + - Syntax class: paired delimiter + "Paired delimiter characters" (designated with `$') are like + string quote characters except that the syntactic properties of the + characters between the delimiters are not suppressed. Only TeX + mode uses a paired delimiter presently--the `$' that both enters + and leaves math mode. + + - Syntax class: expression prefix + An "expression prefix operator" (designated with `'') is used for + syntactic operators that are part of an expression if they appear + next to one. These characters in Lisp include the apostrophe, `'' + (used for quoting), the comma, `,' (used in macros), and `#' (used + in the read syntax for certain data types). + + - Syntax class: comment starter + - Syntax class: comment ender + The "comment starter" and "comment ender" characters are used in + various languages to delimit comments. These classes are + designated with `<' and `>', respectively. + + English text has no comment characters. In Lisp, the semicolon + (`;') starts a comment and a newline or formfeed ends one. + + - Syntax class: inherit + This syntax class does not specify a syntax. It says to look in + the standard syntax table to find the syntax of this character. + The designator for this syntax code is `@'. + + +File: lispref.info, Node: Syntax Flags, Prev: Syntax Class Table, Up: Syntax Descriptors + +Syntax Flags +------------ + + In addition to the classes, entries for characters in a syntax table +can include flags. There are six possible flags, represented by the +characters `1', `2', `3', `4', `b' and `p'. + + All the flags except `p' are used to describe multi-character +comment delimiters. The digit flags indicate that a character can +*also* be part of a comment sequence, in addition to the syntactic +properties associated with its character class. The flags are +independent of the class and each other for the sake of characters such +as `*' in C mode, which is a punctuation character, *and* the second +character of a start-of-comment sequence (`/*'), *and* the first +character of an end-of-comment sequence (`*/'). + + The flags for a character C are: + + * `1' means C is the start of a two-character comment-start sequence. + + * `2' means C is the second character of such a sequence. + + * `3' means C is the start of a two-character comment-end sequence. + + * `4' means C is the second character of such a sequence. + + * `b' means that C as a comment delimiter belongs to the alternative + "b" comment style. + + Emacs supports two comment styles simultaneously in any one syntax + table. This is for the sake of C++. Each style of comment syntax + has its own comment-start sequence and its own comment-end + sequence. Each comment must stick to one style or the other; + thus, if it starts with the comment-start sequence of style "b", + it must also end with the comment-end sequence of style "b". + + The two comment-start sequences must begin with the same + character; only the second character may differ. Mark the second + character of the "b"-style comment-start sequence with the `b' + flag. + + A comment-end sequence (one or two characters) applies to the "b" + style if its first character has the `b' flag set; otherwise, it + applies to the "a" style. + + The appropriate comment syntax settings for C++ are as follows: + + `/' + `124b' + + `*' + `23' + + newline + `>b' + + This defines four comment-delimiting sequences: + + `/*' + This is a comment-start sequence for "a" style because the + second character, `*', does not have the `b' flag. + + `//' + This is a comment-start sequence for "b" style because the + second character, `/', does have the `b' flag. + + `*/' + This is a comment-end sequence for "a" style because the first + character, `*', does not have the `b' flag + + newline + This is a comment-end sequence for "b" style, because the + newline character has the `b' flag. + + * `p' identifies an additional "prefix character" for Lisp syntax. + These characters are treated as whitespace when they appear between + expressions. When they appear within an expression, they are + handled according to their usual syntax codes. + + The function `backward-prefix-chars' moves back over these + characters, as well as over characters whose primary syntax class + is prefix (`''). *Note Motion and Syntax::. + + +File: lispref.info, Node: Syntax Table Functions, Next: Motion and Syntax, Prev: Syntax Descriptors, Up: Syntax Tables + +Syntax Table Functions +====================== + + In this section we describe functions for creating, accessing and +altering syntax tables. + + - Function: make-syntax-table &optional TABLE + This function creates a new syntax table. Character codes 0 + through 31 and 128 through 255 are set up to inherit from the + standard syntax table. The other character codes are set up by + copying what the standard syntax table says about them. + + Most major mode syntax tables are created in this way. + + - Function: copy-syntax-table &optional TABLE + This function constructs a copy of TABLE and returns it. If TABLE + is not supplied (or is `nil'), it returns a copy of the current + syntax table. Otherwise, an error is signaled if TABLE is not a + syntax table. + + - Command: modify-syntax-entry CHAR SYNTAX-DESCRIPTOR &optional TABLE + This function sets the syntax entry for CHAR according to + SYNTAX-DESCRIPTOR. The syntax is changed only for TABLE, which + defaults to the current buffer's syntax table, and not in any + other syntax table. The argument SYNTAX-DESCRIPTOR specifies the + desired syntax; this is a string beginning with a class designator + character, and optionally containing a matching character and + flags as well. *Note Syntax Descriptors::. + + This function always returns `nil'. The old syntax information in + the table for this character is discarded. + + An error is signaled if the first character of the syntax + descriptor is not one of the twelve syntax class designator + characters. An error is also signaled if CHAR is not a character. + + Examples: + + ;; Put the space character in class whitespace. + (modify-syntax-entry ?\ " ") + => nil + + ;; Make `$' an open parenthesis character, + ;; with `^' as its matching close. + (modify-syntax-entry ?$ "(^") + => nil + + ;; Make `^' a close parenthesis character, + ;; with `$' as its matching open. + (modify-syntax-entry ?^ ")$") + => nil + + ;; Make `/' a punctuation character, + ;; the first character of a start-comment sequence, + ;; and the second character of an end-comment sequence. + ;; This is used in C mode. + (modify-syntax-entry ?/ ". 14") + => nil + + - Function: char-syntax CHARACTER + This function returns the syntax class of CHARACTER, represented + by its mnemonic designator character. This *only* returns the + class, not any matching parenthesis or flags. + + An error is signaled if CHAR is not a character. + + The following examples apply to C mode. The first example shows + that the syntax class of space is whitespace (represented by a + space). The second example shows that the syntax of `/' is + punctuation. This does not show the fact that it is also part of + comment-start and -end sequences. The third example shows that + open parenthesis is in the class of open parentheses. This does + not show the fact that it has a matching character, `)'. + + (char-to-string (char-syntax ?\ )) + => " " + + (char-to-string (char-syntax ?/)) + => "." + + (char-to-string (char-syntax ?\()) + => "(" + + - Function: set-syntax-table TABLE &optional BUFFER + This function makes TABLE the syntax table for BUFFER, which + defaults to the current buffer if omitted. It returns TABLE. + + - Function: syntax-table &optional BUFFER + This function returns the syntax table for BUFFER, which defaults + to the current buffer if omitted. + + +File: lispref.info, Node: Motion and Syntax, Next: Parsing Expressions, Prev: Syntax Table Functions, Up: Syntax Tables + +Motion and Syntax +================= + + This section describes functions for moving across characters in +certain syntax classes. None of these functions exists in Emacs +version 18 or earlier. + + - Function: skip-syntax-forward SYNTAXES &optional LIMIT BUFFER + This function moves point forward across characters having syntax + classes mentioned in SYNTAXES. It stops when it encounters the + end of the buffer, or position LIMIT (if specified), or a + character it is not supposed to skip. Optional argument BUFFER + defaults to the current buffer if omitted. + + - Function: skip-syntax-backward SYNTAXES &optional LIMIT BUFFER + This function moves point backward across characters whose syntax + classes are mentioned in SYNTAXES. It stops when it encounters + the beginning of the buffer, or position LIMIT (if specified), or a + character it is not supposed to skip. Optional argument BUFFER + defaults to the current buffer if omitted. + + + - Function: backward-prefix-chars &optional BUFFER + This function moves point backward over any number of characters + with expression prefix syntax. This includes both characters in + the expression prefix syntax class, and characters with the `p' + flag. Optional argument BUFFER defaults to the current buffer if + omitted. + + +File: lispref.info, Node: Parsing Expressions, Next: Standard Syntax Tables, Prev: Motion and Syntax, Up: Syntax Tables + +Parsing Balanced Expressions +============================ + + Here are several functions for parsing and scanning balanced +expressions, also known as "sexps", in which parentheses match in +pairs. The syntax table controls the interpretation of characters, so +these functions can be used for Lisp expressions when in Lisp mode and +for C expressions when in C mode. *Note List Motion::, for convenient +higher-level functions for moving over balanced expressions. + + - Function: parse-partial-sexp START LIMIT &optional TARGET-DEPTH + STOP-BEFORE STATE STOP-COMMENT BUFFER + This function parses a sexp in the current buffer starting at + START, not scanning past LIMIT. It stops at position LIMIT or + when certain criteria described below are met, and sets point to + the location where parsing stops. It returns a value describing + the status of the parse at the point where it stops. + + If STATE is `nil', START is assumed to be at the top level of + parenthesis structure, such as the beginning of a function + definition. Alternatively, you might wish to resume parsing in the + middle of the structure. To do this, you must provide a STATE + argument that describes the initial status of parsing. + + If the third argument TARGET-DEPTH is non-`nil', parsing stops if + the depth in parentheses becomes equal to TARGET-DEPTH. The depth + starts at 0, or at whatever is given in STATE. + + If the fourth argument STOP-BEFORE is non-`nil', parsing stops + when it comes to any character that starts a sexp. If + STOP-COMMENT is non-`nil', parsing stops when it comes to the + start of a comment. + + The fifth argument STATE is an eight-element list of the same form + as the value of this function, described below. The return value + of one call may be used to initialize the state of the parse on + another call to `parse-partial-sexp'. + + The result is a list of eight elements describing the final state + of the parse: + + 0. The depth in parentheses, counting from 0. + + 1. The character position of the start of the innermost + parenthetical grouping containing the stopping point; `nil' + if none. + + 2. The character position of the start of the last complete + subexpression terminated; `nil' if none. + + 3. Non-`nil' if inside a string. More precisely, this is the + character that will terminate the string. + + 4. `t' if inside a comment (of either style). + + 5. `t' if point is just after a quote character. + + 6. The minimum parenthesis depth encountered during this scan. + + 7. `t' if inside a comment of style "b". + + Elements 0, 3, 4, 5 and 7 are significant in the argument STATE. + + This function is most often used to compute indentation for + languages that have nested parentheses. + + - Function: scan-lists FROM COUNT DEPTH &optional BUFFER NOERROR + This function scans forward COUNT balanced parenthetical groupings + from character number FROM. It returns the character position + where the scan stops. + + If DEPTH is nonzero, parenthesis depth counting begins from that + value. The only candidates for stopping are places where the + depth in parentheses becomes zero; `scan-lists' counts COUNT such + places and then stops. Thus, a positive value for DEPTH means go + out DEPTH levels of parenthesis. + + Scanning ignores comments if `parse-sexp-ignore-comments' is + non-`nil'. + + If the scan reaches the beginning or end of the buffer (or its + accessible portion), and the depth is not zero, an error is + signaled. If the depth is zero but the count is not used up, + `nil' is returned. + + If optional arg BUFFER is non-`nil', scanning occurs in that + buffer instead of in the current buffer. + + If optional arg NOERROR is non-`nil', `scan-lists' will return + `nil' instead of signalling an error. + + - Function: scan-sexps FROM COUNT &optional BUFFER NOERROR + This function scans forward COUNT sexps from character position + FROM. It returns the character position where the scan stops. + + Scanning ignores comments if `parse-sexp-ignore-comments' is + non-`nil'. + + If the scan reaches the beginning or end of (the accessible part + of) the buffer in the middle of a parenthetical grouping, an error + is signaled. If it reaches the beginning or end between groupings + but before count is used up, `nil' is returned. + + If optional arg BUFFER is non-`nil', scanning occurs in that + buffer instead of in the current buffer. + + If optional arg NOERROR is non-`nil', `scan-sexps' will return nil + instead of signalling an error. + + - Variable: parse-sexp-ignore-comments + If the value is non-`nil', then comments are treated as whitespace + by the functions in this section and by `forward-sexp'. + + In older Emacs versions, this feature worked only when the comment + terminator is something like `*/', and appears only to end a + comment. In languages where newlines terminate comments, it was + necessary make this variable `nil', since not every newline is the + end of a comment. This limitation no longer exists. + + You can use `forward-comment' to move forward or backward over one +comment or several comments. + + - Function: forward-comment COUNT &optional BUFFER + This function moves point forward across COUNT comments (backward, + if COUNT is negative). If it finds anything other than a comment + or whitespace, it stops, leaving point at the place where it + stopped. It also stops after satisfying COUNT. + + Optional argument BUFFER defaults to the current buffer. + + To move forward over all comments and whitespace following point, use +`(forward-comment (buffer-size))'. `(buffer-size)' is a good argument +to use, because the number of comments in the buffer cannot exceed that +many. + + +File: lispref.info, Node: Standard Syntax Tables, Next: Syntax Table Internals, Prev: Parsing Expressions, Up: Syntax Tables + +Some Standard Syntax Tables +=========================== + + Most of the major modes in XEmacs have their own syntax tables. Here +are several of them: + + - Function: standard-syntax-table + This function returns the standard syntax table, which is the + syntax table used in Fundamental mode. + + - Variable: text-mode-syntax-table + The value of this variable is the syntax table used in Text mode. + + - Variable: c-mode-syntax-table + The value of this variable is the syntax table for C-mode buffers. + + - Variable: emacs-lisp-mode-syntax-table + The value of this variable is the syntax table used in Emacs Lisp + mode by editing commands. (It has no effect on the Lisp `read' + function.) + + +File: lispref.info, Node: Syntax Table Internals, Prev: Standard Syntax Tables, Up: Syntax Tables + +Syntax Table Internals +====================== + + Each element of a syntax table is an integer that encodes the syntax +of one character: the syntax class, possible matching character, and +flags. Lisp programs don't usually work with the elements directly; the +Lisp-level syntax table functions usually work with syntax descriptors +(*note Syntax Descriptors::.). + + The low 8 bits of each element of a syntax table indicate the syntax +class. + +Integer + Class + +0 + whitespace + +1 + punctuation + +2 + word + +3 + symbol + +4 + open parenthesis + +5 + close parenthesis + +6 + expression prefix + +7 + string quote + +8 + paired delimiter + +9 + escape + +10 + character quote + +11 + comment-start + +12 + comment-end + +13 + inherit + + The next 8 bits are the matching opposite parenthesis (if the +character has parenthesis syntax); otherwise, they are not meaningful. +The next 6 bits are the flags. + + +File: lispref.info, Node: Abbrevs, Next: Extents, Prev: Syntax Tables, Up: Top + +Abbrevs And Abbrev Expansion +**************************** + + An abbreviation or "abbrev" is a string of characters that may be +expanded to a longer string. The user can insert the abbrev string and +find it replaced automatically with the expansion of the abbrev. This +saves typing. + + The set of abbrevs currently in effect is recorded in an "abbrev +table". Each buffer has a local abbrev table, but normally all buffers +in the same major mode share one abbrev table. There is also a global +abbrev table. Normally both are used. + + An abbrev table is represented as an obarray containing a symbol for +each abbreviation. The symbol's name is the abbreviation; its value is +the expansion; its function definition is the hook function to do the +expansion (*note Defining Abbrevs::.); its property list cell contains +the use count, the number of times the abbreviation has been expanded. +Because these symbols are not interned in the usual obarray, they will +never appear as the result of reading a Lisp expression; in fact, +normally they are never used except by the code that handles abbrevs. +Therefore, it is safe to use them in an extremely nonstandard way. +*Note Creating Symbols::. + + For the user-level commands for abbrevs, see *Note Abbrev Mode: +(emacs)Abbrevs. + +* Menu: + +* Abbrev Mode:: Setting up XEmacs for abbreviation. +* Tables: Abbrev Tables. Creating and working with abbrev tables. +* Defining Abbrevs:: Specifying abbreviations and their expansions. +* Files: Abbrev Files. Saving abbrevs in files. +* Expansion: Abbrev Expansion. Controlling expansion; expansion subroutines. +* Standard Abbrev Tables:: Abbrev tables used by various major modes. + + +File: lispref.info, Node: Abbrev Mode, Next: Abbrev Tables, Up: Abbrevs + +Setting Up Abbrev Mode +====================== + + Abbrev mode is a minor mode controlled by the value of the variable +`abbrev-mode'. + + - Variable: abbrev-mode + A non-`nil' value of this variable turns on the automatic expansion + of abbrevs when their abbreviations are inserted into a buffer. + If the value is `nil', abbrevs may be defined, but they are not + expanded automatically. + + This variable automatically becomes local when set in any fashion. + + - Variable: default-abbrev-mode + This is the value of `abbrev-mode' for buffers that do not + override it. This is the same as `(default-value 'abbrev-mode)'. + + +File: lispref.info, Node: Abbrev Tables, Next: Defining Abbrevs, Prev: Abbrev Mode, Up: Abbrevs + +Abbrev Tables +============= + + This section describes how to create and manipulate abbrev tables. + + - Function: make-abbrev-table + This function creates and returns a new, empty abbrev table--an + obarray containing no symbols. It is a vector filled with zeros. + + - Function: clear-abbrev-table TABLE + This function undefines all the abbrevs in abbrev table TABLE, + leaving it empty. The function returns `nil'. + + - Function: define-abbrev-table TABNAME DEFINITIONS + This function defines TABNAME (a symbol) as an abbrev table name, + i.e., as a variable whose value is an abbrev table. It defines + abbrevs in the table according to DEFINITIONS, a list of elements + of the form `(ABBREVNAME EXPANSION HOOK USECOUNT)'. The value is + always `nil'. + + - Variable: abbrev-table-name-list + This is a list of symbols whose values are abbrev tables. + `define-abbrev-table' adds the new abbrev table name to this list. + + - Function: insert-abbrev-table-description NAME &optional HUMAN + This function inserts before point a description of the abbrev + table named NAME. The argument NAME is a symbol whose value is an + abbrev table. The value is always `nil'. + + If HUMAN is non-`nil', the description is human-oriented. + Otherwise the description is a Lisp expression--a call to + `define-abbrev-table' that would define NAME exactly as it is + currently defined. + + +File: lispref.info, Node: Defining Abbrevs, Next: Abbrev Files, Prev: Abbrev Tables, Up: Abbrevs + +Defining Abbrevs +================ + + These functions define an abbrev in a specified abbrev table. +`define-abbrev' is the low-level basic function, while `add-abbrev' is +used by commands that ask for information from the user. + + - Function: add-abbrev TABLE TYPE ARG + This function adds an abbreviation to abbrev table TABLE based on + information from the user. The argument TYPE is a string + describing in English the kind of abbrev this will be (typically, + `"global"' or `"mode-specific"'); this is used in prompting the + user. The argument ARG is the number of words in the expansion. + + The return value is the symbol that internally represents the new + abbrev, or `nil' if the user declines to confirm redefining an + existing abbrev. + + - Function: define-abbrev TABLE NAME EXPANSION HOOK + This function defines an abbrev in TABLE named NAME, to expand to + EXPANSION, and call HOOK. The return value is an uninterned + symbol that represents the abbrev inside XEmacs; its name is NAME. + + The argument NAME should be a string. The argument EXPANSION + should be a string, or `nil' to undefine the abbrev. + + The argument HOOK is a function or `nil'. If HOOK is non-`nil', + then it is called with no arguments after the abbrev is replaced + with EXPANSION; point is located at the end of EXPANSION when HOOK + is called. + + The use count of the abbrev is initialized to zero. + + - User Option: only-global-abbrevs + If this variable is non-`nil', it means that the user plans to use + global abbrevs only. This tells the commands that define + mode-specific abbrevs to define global ones instead. This + variable does not alter the behavior of the functions in this + section; it is examined by their callers. + + +File: lispref.info, Node: Abbrev Files, Next: Abbrev Expansion, Prev: Defining Abbrevs, Up: Abbrevs + +Saving Abbrevs in Files +======================= + + A file of saved abbrev definitions is actually a file of Lisp code. +The abbrevs are saved in the form of a Lisp program to define the same +abbrev tables with the same contents. Therefore, you can load the file +with `load' (*note How Programs Do Loading::.). However, the function +`quietly-read-abbrev-file' is provided as a more convenient interface. + + User-level facilities such as `save-some-buffers' can save abbrevs +in a file automatically, under the control of variables described here. + + - User Option: abbrev-file-name + This is the default file name for reading and saving abbrevs. + + - Function: quietly-read-abbrev-file FILENAME + This function reads abbrev definitions from a file named FILENAME, + previously written with `write-abbrev-file'. If FILENAME is + `nil', the file specified in `abbrev-file-name' is used. + `save-abbrevs' is set to `t' so that changes will be saved. + + This function does not display any messages. It returns `nil'. + + - User Option: save-abbrevs + A non-`nil' value for `save-abbrev' means that XEmacs should save + abbrevs when files are saved. `abbrev-file-name' specifies the + file to save the abbrevs in. + + - Variable: abbrevs-changed + This variable is set non-`nil' by defining or altering any + abbrevs. This serves as a flag for various XEmacs commands to + offer to save your abbrevs. + + - Command: write-abbrev-file FILENAME + Save all abbrev definitions, in all abbrev tables, in the file + FILENAME, in the form of a Lisp program that when loaded will + define the same abbrevs. This function returns `nil'. + + +File: lispref.info, Node: Abbrev Expansion, Next: Standard Abbrev Tables, Prev: Abbrev Files, Up: Abbrevs + +Looking Up and Expanding Abbreviations +====================================== + + Abbrevs are usually expanded by commands for interactive use, +including `self-insert-command'. This section describes the +subroutines used in writing such functions, as well as the variables +they use for communication. + + - Function: abbrev-symbol ABBREV &optional TABLE + This function returns the symbol representing the abbrev named + ABBREV. The value returned is `nil' if that abbrev is not + defined. The optional second argument TABLE is the abbrev table + to look it up in. If TABLE is `nil', this function tries first + the current buffer's local abbrev table, and second the global + abbrev table. + + - Function: abbrev-expansion ABBREV &optional TABLE + This function returns the string that ABBREV would expand into (as + defined by the abbrev tables used for the current buffer). The + optional argument TABLE specifies the abbrev table to use, as in + `abbrev-symbol'. + + - Command: expand-abbrev + This command expands the abbrev before point, if any. If point + does not follow an abbrev, this command does nothing. The command + returns `t' if it did expansion, `nil' otherwise. + + - Command: abbrev-prefix-mark &optional ARG + Mark current point as the beginning of an abbrev. The next call to + `expand-abbrev' will use the text from here to point (where it is + then) as the abbrev to expand, rather than using the previous word + as usual. + + - User Option: abbrev-all-caps + When this is set non-`nil', an abbrev entered entirely in upper + case is expanded using all upper case. Otherwise, an abbrev + entered entirely in upper case is expanded by capitalizing each + word of the expansion. + + - Variable: abbrev-start-location + This is the buffer position for `expand-abbrev' to use as the start + of the next abbrev to be expanded. (`nil' means use the word + before point instead.) `abbrev-start-location' is set to `nil' + each time `expand-abbrev' is called. This variable is also set by + `abbrev-prefix-mark'. + + - Variable: abbrev-start-location-buffer + The value of this variable is the buffer for which + `abbrev-start-location' has been set. Trying to expand an abbrev + in any other buffer clears `abbrev-start-location'. This variable + is set by `abbrev-prefix-mark'. + + - Variable: last-abbrev + This is the `abbrev-symbol' of the last abbrev expanded. This + information is left by `expand-abbrev' for the sake of the + `unexpand-abbrev' command. + + - Variable: last-abbrev-location + This is the location of the last abbrev expanded. This contains + information left by `expand-abbrev' for the sake of the + `unexpand-abbrev' command. + + - Variable: last-abbrev-text + This is the exact expansion text of the last abbrev expanded, + after case conversion (if any). Its value is `nil' if the abbrev + has already been unexpanded. This contains information left by + `expand-abbrev' for the sake of the `unexpand-abbrev' command. + + - Variable: pre-abbrev-expand-hook + This is a normal hook whose functions are executed, in sequence, + just before any expansion of an abbrev. *Note Hooks::. Since it + is a normal hook, the hook functions receive no arguments. + However, they can find the abbrev to be expanded by looking in the + buffer before point. + + The following sample code shows a simple use of +`pre-abbrev-expand-hook'. If the user terminates an abbrev with a +punctuation character, the hook function asks for confirmation. Thus, +this hook allows the user to decide whether to expand the abbrev, and +aborts expansion if it is not confirmed. + + (add-hook 'pre-abbrev-expand-hook 'query-if-not-space) + + ;; This is the function invoked by `pre-abbrev-expand-hook'. + + ;; If the user terminated the abbrev with a space, the function does + ;; nothing (that is, it returns so that the abbrev can expand). If the + ;; user entered some other character, this function asks whether + ;; expansion should continue. + + ;; If the user answers the prompt with `y', the function returns + ;; `nil' (because of the `not' function), but that is + ;; acceptable; the return value has no effect on expansion. + + (defun query-if-not-space () + (if (/= ?\ (preceding-char)) + (if (not (y-or-n-p "Do you want to expand this abbrev? ")) + (error "Not expanding this abbrev")))) + + +File: lispref.info, Node: Standard Abbrev Tables, Prev: Abbrev Expansion, Up: Abbrevs + +Standard Abbrev Tables +====================== + + Here we list the variables that hold the abbrev tables for the +preloaded major modes of XEmacs. + + - Variable: global-abbrev-table + This is the abbrev table for mode-independent abbrevs. The abbrevs + defined in it apply to all buffers. Each buffer may also have a + local abbrev table, whose abbrev definitions take precedence over + those in the global table. + + - Variable: local-abbrev-table + The value of this buffer-local variable is the (mode-specific) + abbreviation table of the current buffer. + + - Variable: fundamental-mode-abbrev-table + This is the local abbrev table used in Fundamental mode; in other + words, it is the local abbrev table in all buffers in Fundamental + mode. + + - Variable: text-mode-abbrev-table + This is the local abbrev table used in Text mode. + + - Variable: c-mode-abbrev-table + This is the local abbrev table used in C mode. + + - Variable: lisp-mode-abbrev-table + This is the local abbrev table used in Lisp mode and Emacs Lisp + mode. + diff --git a/info/lispref.info-33 b/info/lispref.info-33 new file mode 100644 index 0000000..a4d32e0 --- /dev/null +++ b/info/lispref.info-33 @@ -0,0 +1,1095 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Extents, Next: Specifiers, Prev: Abbrevs, Up: Top + +Extents +******* + + An "extent" is a region of text (a start position and an end +position) that is displayed in a particular face and can have certain +other properties such as being read-only. Extents can overlap each +other. XEmacs efficiently handles buffers with large numbers of +extents in them. + + - Function: extentp OBJECT + This returns `t' if OBJECT is an extent. + +* Menu: + +* Intro to Extents:: Extents are regions over a buffer or string. +* Creating and Modifying Extents:: + Basic extent functions. +* Extent Endpoints:: Accessing and setting the bounds of an extent. +* Finding Extents:: Determining which extents are in an object. +* Mapping Over Extents:: More sophisticated functions for extent scanning. +* Extent Properties:: Extents have built-in and user-definable properties. +* Detached Extents:: Extents that are not in a buffer. +* Extent Parents:: Inheriting properties from another extent. +* Duplicable Extents:: Extents can be marked to be copied into strings. +* Extents and Events:: Extents can interact with the keyboard and mouse. +* Atomic Extents:: Treating a block of text as a single entity. + + +File: lispref.info, Node: Intro to Extents, Next: Creating and Modifying Extents, Up: Extents + +Introduction to Extents +======================= + + An extent is a region of text within a buffer or string that has +certain properties associated with it. The properties of an extent +primarily affect the way the text contained in the extent is displayed. +Extents can freely overlap each other in a buffer or string. Extents +are invisible to functions that merely examine the text of a buffer or +string. + + *Please note:* An alternative way to add properties to a buffer or +string is to use text properties. *Note Text Properties::. + + An extent is logically a Lisp object consisting of a start position, +an end position, a buffer or string to which these positions refer, and +a property list. As text is inserted into a buffer, the start and end +positions of the extent are automatically adjusted as necessary to keep +the extent referring to the same text in the buffer. If text is +inserted at the boundary of an extent, the extent's `start-open' and +`end-open' properties control whether the text is included as part of +the extent. If the text bounded by an extent is deleted, the extent +becomes "detached"; its start and end positions are no longer +meaningful, but it maintains all its other properties and can later be +reinserted into a buffer. (None of these considerations apply to +strings, because text cannot be inserted into or deleted from a string.) + + Each extent has a face or list of faces associated with it, which +controls the way in which the text bounded by the extent is displayed. +If an extent's face is `nil' or its properties are partially undefined, +the corresponding properties from the default face for the frame is +used. If two or more extents overlap, or if a list of more than one +face is specified for a particular extent, the corresponding faces are +merged to determine the text's displayed properties. Every extent has +a "priority" that determines which face takes precedence if the faces +conflict. (If two extents have the same priority, the one that comes +later in the display order takes precedence. *Note display order: +Extent Endpoints.) Higher-numbered priority values correspond to a +higher priority, and priority values can be negative. Every extent is +created with a priority of 0, but this can be changed with +`set-extent-priority'. Within a single extent with a list of faces, +faces earlier in the list have a higher priority than faces later in +the list. + + Extents can be set to respond specially to key and mouse events +within the extent. An extent's `keymap' property controls the effect of +key and mouse strokes within the extent's text, and the `mouse-face' +property controls whether the extent is highlighted when the mouse moves +over it. *Note Extents and Events::. + + An extent can optionally have a "begin-glyph" or "end-glyph" +associated with it. A begin-glyph or end-glyph is a pixmap or string +that will be displayed either at the start or end of an extent or in the +margin of the line that the start or end of the extent lies in, +depending on the extent's layout policy. Begin-glyphs and end-glyphs +are used to implement annotations, and you should use the annotation API +functions in preference to the lower-level extent functions. For more +information, *Note Annotations::. + + If an extent has its `detachable' property set, it will become +"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 +it the same place in the buffer. By default, the `detachable' property +is set on newly-created extents. *Note Detached Extents::. + + If an extent has its `duplicable' property set, it will be +remembered when a string is created from text bounded by the extent. +When the string is re-inserted into a buffer, the extent will also be +re-inserted. This mechanism is used in the kill, yank, and undo +commands. *Note Duplicable Extents::. + + +File: lispref.info, Node: Creating and Modifying Extents, Next: Extent Endpoints, Prev: Intro to Extents, Up: Extents + +Creating and Modifying Extents +============================== + + - Function: make-extent FROM TO &optional OBJECT + This function makes an extent for the range [FROM, TO) in OBJECT + (a buffer or string). OBJECT defaults to the current buffer. + Insertions at point TO will be outside of the extent; insertions + at FROM will be inside the extent, causing the extent to grow + (*note Extent Endpoints::.). This is the same way that markers + behave. The extent is initially detached if both FROM and TO are + `nil', and in this case OBJECT defaults to `nil', meaning the + extent is in no buffer or string (*note Detached Extents::.). + + - Function: delete-extent EXTENT + This function removes EXTENT from its buffer and destroys it. + This does not modify the buffer's text, only its display + properties. The extent cannot be used thereafter. To remove an + extent in such a way that it can be re-inserted later, use + `detach-extent'. *Note Detached Extents::. + + - Function: extent-object EXTENT + This function returns the buffer or string that EXTENT is in. If + the return value is `nil', this means that the extent is detached; + however, a detached extent will not necessarily return a value of + `nil'. + + - Function: extent-live-p EXTENT + This function returns `nil' if EXTENT is deleted, and `t' + otherwise. + + +File: lispref.info, Node: Extent Endpoints, Next: Finding Extents, Prev: Creating and Modifying Extents, Up: Extents + +Extent Endpoints +================ + + Every extent has a start position and an end position, and logically +affects the characters between those positions. Normally the start and +end positions must both be valid positions in the extent's buffer or +string. However, both endpoints can be `nil', meaning the extent is +detached. *Note Detached Extents::. + + Whether the extent overlaps its endpoints is governed by its +`start-open' and `end-open' properties. Insertion of a character at a +closed endpoint will expand the extent to include that character; +insertion at an open endpoint will not. Similarly, functions such as +`extent-at' that scan over all extents overlapping a particular +position will include extents with a closed endpoint at that position, +but not extents with an open endpoint. + + Note that the `start-closed' and `end-closed' properties are +equivalent to `start-open' and `end-open' with the opposite sense. + + Both endpoints can be equal, in which case the extent includes no +characters but still exists in the buffer or string. Zero-length +extents are used to represent annotations (*note Annotations::.) and can +be used as a more powerful form of a marker. Deletion of all the +characters in an extent may or may not result in a zero-length extent; +this depends on the `detachable' property (*note Detached Extents::.). +Insertion at the position of a zero-length extent expands the extent if +both endpoints are closed; goes before the extent if it has the +`start-open' property; and goes after the extent if it has the +`end-open' property. Zero-length extents with both the `start-open' +and `end-open' properties are treated as if their starting point were +closed. Deletion of a character on a side of a zero-length extent +whose corresponding endpoint is closed causes the extent to be detached +if its `detachable' property is set; if the corresponding endpoint is +open, the extent remains in the buffer, moving as necessary. + + Extents are ordered within a buffer or string by increasing start +position, and then by decreasing end position (this is called the +"display order"). + + - Function: extent-start-position EXTENT + This function returns the start position of EXTENT. + + - Function: extent-end-position EXTENT + This function returns the end position of EXTENT. + + - Function: extent-length EXTENT + This function returns the length of EXTENT in characters. If the + extent is detached, this returns `0'. If the extent is not + detached, this is equivalent to + (- (extent-end-position EXTENT) (extent-start-position EXTENT)) + + - Function: set-extent-endpoints EXTENT START END &optional + BUFFER-OR-STRING + This function sets the start and end position of EXTENT to START + and END. If both are `nil', this is equivalent to `detach-extent'. + + BUFFER-OR-STRING specifies the new buffer or string that the + extent should be in, and defaults to EXTENT's buffer or string. + (If `nil', and EXTENT is in no buffer and no string, it defaults + to the current buffer.) + + See documentation on `detach-extent' for a discussion of undo + recording. + + +File: lispref.info, Node: Finding Extents, Next: Mapping Over Extents, Prev: Extent Endpoints, Up: Extents + +Finding Extents +=============== + + The following functions provide a simple way of determining the +extents in a buffer or string. A number of more sophisticated +primitives for mapping over the extents in a range of a buffer or string +are also provided (*note Mapping Over Extents::.). When reading through +this section, keep in mind the way that extents are ordered (*note +Extent Endpoints::.). + + - Function: extent-list &optional BUFFER-OR-STRING FROM TO FLAGS + This function returns a list of the extents in BUFFER-OR-STRING. + BUFFER-OR-STRING defaults to the current buffer if omitted. FROM + and TO can be used to limit the range over which extents are + returned; if omitted, all extents in the buffer or string are + returned. + + More specifically, if a range is specified using FROM and TO, only + extents that overlap the range (i.e. begin or end inside of the + range) are included in the list. FROM and TO default to the + beginning and end of BUFFER-OR-STRING, respectively. + + FLAGS controls how end cases are treated. For a discussion of + this, and exactly what "overlap" means, see `map-extents'. + + Functions that create extents must be prepared for the possibility +that there are other extents in the same area, created by other +functions. To deal with this, functions typically mark their own +extents by setting a particular property on them. The following +function makes it easier to locate those extents. + + - Function: extent-at POS &optional OBJECT PROPERTY BEFORE AT-FLAG + This function finds the "smallest" extent (i.e., the last one in + the display order) at (i.e., overlapping) POS in OBJECT (a buffer + or string) having PROPERTY set. OBJECT defaults to the current + buffer. PROPERTY defaults to `nil', meaning that any extent will + do. Returns `nil' if there is no matching extent at POS. If the + fourth argument BEFORE is not `nil', it must be an extent; any + returned extent will precede that extent. This feature allows + `extent-at' to be used by a loop over extents. + + AT-FLAG controls how end cases are handled (i.e. what "at" really + means), and should be one of: + + `nil' + + `after' + An extent is at POS if it covers the character after POS. + This is consistent with the way that text properties work. + + `before' + An extent is at POS if it covers the character before POS. + + `at' + An extent is at POS if it overlaps or abuts POS. This + includes all zero-length extents at POS. + + Note that in all cases, the start-openness and end-openness of the + extents considered is ignored. If you want to pay attention to + those properties, you should use `map-extents', which gives you + more control. + + 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 +operation, you should probably use `mapcar-extents' or `map-extents', +or loop using the BEFORE argument to `extent-at', rather than creating +a loop using `next-extent'. + + - Function: next-extent EXTENT + Given an extent EXTENT, this function returns the next extent in + the buffer or string's display order. If EXTENT is a buffer or + string, this returns the first extent in the buffer or string. + + - Function: previous-extent EXTENT + Given an extent EXTENT, this function returns the previous extent + in the buffer or string's display order. If EXTENT is a buffer or + string, this returns the last extent in the buffer or string. + + +File: lispref.info, Node: Mapping Over Extents, Next: Extent Properties, Prev: Finding Extents, Up: Extents + +Mapping Over Extents +==================== + + The most basic and general function for mapping over extents is +called `map-extents'. You should read through the definition of this +function to familiarize yourself with the concepts and optional +arguments involved. However, in practice you may find it more +convenient to use the function `mapcar-extents' or to create a loop +using the `before' argument to `extent-at' (*note Finding Extents::.). + + - Function: map-extents FUNCTION &optional OBJECT FROM TO MAPARG FLAGS + PROPERTY VALUE + This function maps FUNCTION over the extents which overlap a + region in OBJECT. OBJECT is normally a buffer or string but could + be an extent (see below). The region is normally bounded by + [FROM, TO) (i.e. the beginning of the region is closed and the end + of the region is open), but this can be changed with the FLAGS + argument (see below for a complete discussion). + + FUNCTION is called with the arguments (extent, MAPARG). The + arguments OBJECT, FROM, TO, MAPARG, and FLAGS are all optional and + default to the current buffer, the beginning of OBJECT, the end of + OBJECT, NIL, and NIL, respectively. `map-extents' returns the + first non-`nil' result produced by FUNCTION, and no more calls to + FUNCTION are made after it returns non-`nil'. + + If OBJECT is an extent, FROM and TO default to the extent's + endpoints, and the mapping omits that extent and its predecessors. + This feature supports restarting a loop based on `map-extents'. + Note: OBJECT must be attached to a buffer or string, and the + mapping is done over that buffer or string. + + An extent overlaps the region if there is any point in the extent + that is also in the region. (For the purpose of overlap, + zero-length extents and regions are treated as closed on both ends + regardless of their endpoints' specified open/closedness.) Note + that the endpoints of an extent or region are considered to be in + that extent or region if and only if the corresponding end is + closed. For example, the extent [5,7] overlaps the region [2,5] + because 5 is in both the extent and the region. However, (5,7] + does not overlap [2,5] because 5 is not in the extent, and neither + [5,7] nor (5,7] overlaps the region [2,5) because 5 is not in the + region. + + The optional FLAGS can be a symbol or a list of one or more + symbols, modifying the behavior of `map-extents'. Allowed symbols + are: + + `end-closed' + The region's end is closed. + + `start-open' + The region's start is open. + + `all-extents-closed' + Treat all extents as closed on both ends for the purpose of + determining whether they overlap the region, irrespective of + their actual open- or closedness. + + `all-extents-open' + Treat all extents as open on both ends. + + `all-extents-closed-open' + Treat all extents as start-closed, end-open. + + `all-extents-open-closed' + Treat all extents as start-open, end-closed. + + `start-in-region' + In addition to the above conditions for extent overlap, the + extent's start position must lie within the specified region. + Note that, for this condition, open start positions are + treated as if 0.5 was added to the endpoint's value, and open + end positions are treated as if 0.5 was subtracted from the + endpoint's value. + + `end-in-region' + The extent's end position must lie within the region. + + `start-and-end-in-region' + Both the extent's start and end positions must lie within the + region. + + `start-or-end-in-region' + Either the extent's start or end position must lie within the + region. + + `negate-in-region' + The condition specified by a `*-in-region' flag must *not* + hold for the extent to be considered. + + At most one of `all-extents-closed', `all-extents-open', + `all-extents-closed-open', and `all-extents-open-closed' may be + specified. + + At most one of `start-in-region', `end-in-region', + `start-and-end-in-region', and `start-or-end-in-region' may be + specified. + + If optional arg PROPERTY is non-`nil', only extents with that + property set on them will be visited. If optional arg VALUE is + non-`nil', only extents whose value for that property is `eq' to + VALUE will be visited. + + If you want to map over extents and accumulate a list of results, +the following function may be more convenient than `map-extents'. + + - Function: mapcar-extents FUNCTION &optional PREDICATE + BUFFER-OR-STRING FROM TO FLAGS PROPERTY VALUE + This function applies FUNCTION to all extents which overlap a + region in BUFFER-OR-STRING. The region is delimited by FROM and + TO. FUNCTION is called with one argument, the extent. A list of + the values returned by FUNCTION is returned. An optional + PREDICATE may be used to further limit the extents over which + FUNCTION is mapped. The optional arguments FLAGS, PROPERTY, and + VALUE may also be used to control the extents passed to PREDICATE + or FUNCTION, and have the same meaning as in `map-extents'. + + - Function: map-extent-children FUNCTION &optional OBJECT FROM TO + MAPARG FLAGS PROPERTY VALUE + This function is similar to `map-extents', but differs in that: + + * It only visits extents which start in the given region. + + * After visiting an extent E, it skips all other extents which + start inside E but end before E's end. + + Thus, this function may be used to walk a tree of extents in a + buffer: + (defun walk-extents (buffer &optional ignore) + (map-extent-children 'walk-extents buffer)) + + - Function: extent-in-region-p EXTENT &optional FROM TO FLAGS + This function returns T if `map-extents' would visit EXTENT if + called with the given arguments. + + +File: lispref.info, Node: Extent Properties, Next: Detached Extents, Prev: Mapping Over Extents, Up: Extents + +Properties of Extents +===================== + + Each extent has a property list associating property names with +values. Some property names have predefined meanings, and can usually +only assume particular values. Assigning other values to such a +property either cause the value to be converted into a legal value +(e.g., assigning anything but `nil' to a Boolean property will cause +the value of `t' to be assigned to the property) or will cause an +error. Property names without predefined meanings can be assigned any +value. An undefined property is equivalent to a property with a value +of `nil', or with a particular default value in the case of properties +with predefined meanings. Note that, when an extent is created, the +`end-open' and `detachable' properties are set on it. + + If an extent has a parent, all of its properties actually derive +from that parent (or from the root ancestor if the parent in turn has a +parent), and setting a property of the extent actually sets that +property on the parent. *Note Extent Parents::. + + - Function: extent-property EXTENT PROPERTY + This function returns the value of PROPERTY in EXTENT. If + PROPERTY is undefined, `nil' is returned. + + - Function: extent-properties EXTENT + This function returns a list of all of EXTENT's properties that do + not have the value of `nil' (or the default value, for properties + with predefined meanings). + + - Function: set-extent-property EXTENT PROPERTY VALUE + This function sets PROPERTY to VALUE in EXTENT. (If PROPERTY has a + predefined meaning, only certain values are allowed, and some + values may be converted to others before being stored.) + + - Function: set-extent-properties EXTENT PLIST + Change some properties of EXTENT. PLIST is a property list. This + is useful to change many extent properties at once. + + The following table lists the properties with predefined meanings, +along with their allowable values. + +`detached' + (Boolean) Whether the extent is detached. Setting this is the + same as calling `detach-extent'. *Note Detached Extents::. + +`destroyed' + (Boolean) Whether the extent has been deleted. Setting this is + the same as calling `delete-extent'. + +`priority' + (integer) The extent's redisplay priority. Defaults to 0. *Note + priority: Intro to Extents. This property can also be set with + `set-extent-priority' and accessed with `extent-priority'. + +`start-open' + (Boolean) Whether the start position of the extent is open, + meaning that characters inserted at that position go outside of + the extent. *Note Extent Endpoints::. + +`start-closed' + (Boolean) Same as `start-open' but with the opposite sense. + Setting this property clears `start-open' and vice-versa. + +`end-open' + (Boolean) Whether the end position of the extent is open, meaning + that characters inserted at that position go outside of the + extent. This is `t' by default. *Note Extent Endpoints::. + +`end-closed' + (Boolean) Same as `end-open' but with the opposite sense. Setting + this property clears `end-open' and vice-versa. + +`read-only' + (Boolean) Whether text within this extent will be unmodifiable. + +`face' + (face, face name, list of faces or face names, or `nil') The face + in which to display the extent's text. This property can also be + set with `set-extent-face' and accessed with `extent-face'. Note + that if a list of faces is specified, the faces are merged + together, with faces earlier in the list having priority over + faces later in the list. + +`mouse-face' + (face, face name, list of faces or face names, or `nil') The face + used to display the extent when the mouse moves over it. This + property can also be set with `set-extent-mouse-face' and accessed + with `extent-mouse-face'. Note that if a list of faces is + specified, the faces are merged together, with faces earlier in + the list having priority over faces later in the list. *Note + Extents and Events::. + +`pointer' + (pointer glyph) The glyph used as the pointer when the mouse + moves over the extent. This takes precedence over the + `text-pointer-glyph' and `nontext-pointer-glyph' variables. If + for any reason this glyph is an invalid pointer, the standard + glyphs will be used as fallbacks. *Note Mouse Pointer::. + +`detachable' + (Boolean) Whether this extent becomes detached when all of the + text it covers is deleted. This is `t' by default. *Note + Detached Extents::. + +`duplicable' + (Boolean) Whether this extent should be copied into strings, so + that kill, yank, and undo commands will restore or copy it. *Note + Duplicable Extents::. + +`unique' + (Boolean) Meaningful only in conjunction with `duplicable'. When + this is set, there may be only one instance of this extent + attached at a time. *Note Duplicable Extents::. + +`invisible' + (Boolean) If `t', text under this extent will not be displayed - + it will look as if the text is not there at all. + +`keymap' + (keymap or `nil') This keymap is consulted for mouse clicks on this + extent or keypresses made while `point' is within the extent. + *Note Extents and Events::. + +`copy-function' + This is a hook that is run when a duplicable extent is about to be + copied from a buffer to a string (or the kill ring). *Note + Duplicable Extents::. + +`paste-function' + This is a hook that is run when a duplicable extent is about to be + copied from a string (or the kill ring) into a buffer. *Note + Duplicable Extents::. + +`begin-glyph' + (glyph or `nil') This extent's begin glyph. *Note Annotations::. + +`end-glyph' + (glyph or `nil') This extent's end glyph. *Note Annotations::. + +`begin-glyph-layout' + (`text', `whitespace', `inside-margin', or `outside-margin') The + layout policy for this extent's begin glyph. Defaults to `text'. + *Note Annotations::. + +`end-glyph-layout' + (`text', `whitespace', `inside-margin', or `outside-margin') The + layout policy for this extent's end glyph. Defaults to `text'. + *Note Annotations::. + +`initial-redisplay-function' + (any funcallable object) The function to be called the first time + (a part of) the extent is redisplayed. It will be called with the + extent as its argument. + + This is used by `lazy-shot' to implement lazy font-locking. The + functionality is still experimental, and may change without further + notice. + + The following convenience functions are provided for accessing +particular properties of an extent. + + - Function: extent-face EXTENT + This function returns the `face' property of EXTENT. This might + also return a list of face names. Do not modify this list + directly! Instead, use `set-extent-face'. + + Note that you can use `eq' to compare lists of faces as returned + by `extent-face'. In other words, if you set the face of two + different extents to two lists that are `equal' but not `eq', then + the return value of `extent-face' on the two extents will return + the identical list. + + - Function: extent-mouse-face EXTENT + This function returns the `mouse-face' property of EXTENT. This + might also return a list of face names. Do not modify this list + directly! Instead, use `set-extent-mouse-face'. + + Note that you can use `eq' to compare lists of faces as returned + by `extent-mouse-face', just like for `extent-face'. + + - Function: extent-priority EXTENT + This function returns the `priority' property of EXTENT. + + - Function: extent-keymap EXTENT + This function returns the `keymap' property of EXTENT. + + - Function: extent-begin-glyph-layout EXTENT + This function returns the `begin-glyph-layout' property of EXTENT, + i.e. the layout policy associated with the EXTENT's begin glyph. + + - Function: extent-end-glyph-layout EXTENT + This function returns the `end-glyph-layout' property of EXTENT, + i.e. the layout policy associated with the EXTENT's end glyph. + + - Function: extent-begin-glyph EXTENT + This function returns the `begin-glyph' property of EXTENT, i.e. + the glyph object displayed at the beginning of EXTENT. If there + is none, `nil' is returned. + + - Function: extent-end-glyph EXTENT + This function returns the `end-glyph' property of EXTENT, i.e. the + glyph object displayed at the end of EXTENT. If there is none, + `nil' is returned. + + The following convenience functions are provided for setting +particular properties of an extent. + + - Function: set-extent-priority EXTENT PRI + This function sets the `priority' property of EXTENT to PRI. + + - Function: set-extent-face EXTENT FACE + This function sets the `face' property of EXTENT to FACE. + + - Function: set-extent-mouse-face EXTENT FACE + This function sets the `mouse-face' property of EXTENT to FACE. + + - Function: set-extent-keymap EXTENT KEYMAP + This function sets the `keymap' property of EXTENT to KEYMAP. + KEYMAP must be either a keymap object, or `nil'. + + - Function: set-extent-begin-glyph-layout EXTENT LAYOUT + This function sets the `begin-glyph-layout' property of EXTENT to + LAYOUT. + + - Function: set-extent-end-glyph-layout EXTENT LAYOUT + This function sets the `end-glyph-layout' property of EXTENT to + LAYOUT. + + - Function: set-extent-begin-glyph EXTENT BEGIN-GLYPH &optional LAYOUT + This function sets the `begin-glyph' and `glyph-layout' properties + of EXTENT to BEGIN-GLYPH and LAYOUT, respectively. (LAYOUT + defaults to `text' if not specified.) + + - Function: set-extent-end-glyph EXTENT END-GLYPH &optional LAYOUT + This function sets the `end-glyph' and `glyph-layout' properties + of EXTENT to END-GLYPH and LAYOUT, respectively. (LAYOUT defaults + to `text' if not specified.) + + - Function: set-extent-initial-redisplay-function EXTENT FUNCTION + This function sets the `initial-redisplay-function' property of the + extent to FUNCTION. + + +File: lispref.info, Node: Detached Extents, Next: Extent Parents, Prev: Extent Properties, Up: Extents + +Detached Extents +================ + + A detached extent is an extent that is not attached to a buffer or +string but can be re-inserted. Detached extents have a start position +and end position of `nil'. Extents can be explicitly detached using +`detach-extent'. An extent is also detached when all of its characters +are all killed by a deletion, if its `detachable' property is set; if +this property is not set, the extent becomes a zero-length extent. +(Zero-length extents with the `detachable' property set behave +specially. *Note zero-length extents: Extent Endpoints.) + + - Function: detach-extent EXTENT + This function detaches EXTENT from its buffer or string. If + EXTENT has the `duplicable' property, its detachment is tracked by + the undo mechanism. *Note Duplicable Extents::. + + - Function: extent-detached-p EXTENT + This function returns `nil' if EXTENT is detached, and `t' + otherwise. + + - Function: copy-extent EXTENT &optional OBJECT + This function makes a copy of EXTENT. It is initially detached. + Optional argument OBJECT defaults to EXTENT's object (normally a + buffer or string, but could be `nil'). + + - Function: insert-extent EXTENT &optional START END NO-HOOKS OBJECT + This function inserts EXTENT from START to END in OBJECT (a buffer + or string). If EXTENT is detached from a different buffer or + string, or in most cases when EXTENT is already attached, the + extent will first be copied as if with `copy-extent'. This + function operates the same as if `insert' were called on a string + whose extent data calls for EXTENT to be inserted, except that if + NO-HOOKS is non-`nil', EXTENT's `paste-function' will not be + invoked. *Note Duplicable Extents::. + + +File: lispref.info, Node: Extent Parents, Next: Duplicable Extents, Prev: Detached Extents, Up: Extents + +Extent Parents +============== + + An extent can have a parent extent set for it. If this is the case, +the extent derives all its properties from that extent and has no +properties of its own. The only "properties" that the extent keeps are +the buffer or string it refers to and the start and end points. (More +correctly, the extent's own properties are shadowed. If you later +change the extent to have no parent, its own properties will become +visible again.) + + 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 disallowed. + + Parent extents are used to implement the extents over the modeline. + + - Function: set-extent-parent EXTENT PARENT + This function sets the parent of EXTENT to PARENT. If PARENT is + `nil', the extent is set to have no parent. + + - Function: extent-parent EXTENT + This function return the parents (if any) of EXTENT, or `nil'. + + - Function: extent-children EXTENT + This function returns a list of the children (if any) of EXTENT. + The children of an extent are all those extents whose parent is + that extent. This function does not recursively trace children of + children. + + - Function: extent-descendants EXTENT + This function returns a list of all descendants of EXTENT, + including EXTENT. This recursively applies `extent-children' to + any children of EXTENT, until no more children can be found. + + +File: lispref.info, Node: Duplicable Extents, Next: Extents and Events, Prev: Extent Parents, Up: Extents + +Duplicable Extents +================== + + If an extent has the `duplicable' property, it will be copied into +strings, so that kill, yank, and undo commands will restore or copy it. + + Specifically: + + * When a string is created using `buffer-substring' or + `buffer-string', any duplicable extents in the region corresponding + to the string will be copied into the string (*note Buffer + Contents::.). When the string in inserted into a buffer using + `insert', `insert-before-markers', `insert-buffer' or + `insert-buffer-substring', the extents in the string will be copied + back into the buffer (*note Insertion::.). The extents in a + string can, of course, be retrieved explicitly using the standard + extent primitives over the string. + + * Similarly, when text is copied or cut into the kill ring, any + duplicable extents will be remembered and reinserted later when + the text is pasted back into a buffer. + + * When `concat' is called on strings, the extents in the strings are + copied into the resulting string. + + * When `substring' is called on a string, the relevant extents are + copied into the resulting string. + + * When a duplicable extent is detached by `detach-extent' or string + deletion, or inserted by `insert-extent' or string insertion, the + action is recorded by the undo mechanism so that it can be undone + later. Note that if an extent gets detached and then a later undo + causes the extent to get reinserted, the new extent will not be + `eq' to the original extent. + + * Extent motion, face changes, and attachment via `make-extent' are + not recorded by the undo mechanism. This means that extent changes + which are to be undo-able must be performed by character editing, + or by insertion and detachment of duplicable extents. + + * A duplicable extent's `copy-function' property, if non-`nil', + should be a function, and will be run when a duplicable extent is + about to be copied from a buffer to a string (or the kill ring). + It is called with three arguments: the extent and the buffer + positions within it which are being copied. If this function + returns `nil', then the extent will not be copied; otherwise it + will. + + * A duplicable extent's `paste-function' property, if non-`nil', + should be a function, and will be run when a duplicable extent is + about to be copied from a string (or the kill ring) into a buffer. + It is called with three arguments: the original extent and the + buffer positions which the copied extent will occupy. (This hook + is run after the corresponding text has already been inserted into + the buffer.) Note that the extent argument may be detached when + this function is run. If this function returns `nil', no extent + will be inserted. Otherwise, there will be an extent covering the + range in question. + + Note: if the extent to be copied is already attached to the buffer + and overlaps the new range, the extent will simply be extended and + the `paste-function' will not be called. + + +File: lispref.info, Node: Extents and Events, Next: Atomic Extents, Prev: Duplicable Extents, Up: Extents + +Interaction of Extents with Keyboard and Mouse Events +===================================================== + + If an extent has the `mouse-face' property set, it will be +highlighted when the mouse passes over it. Highlighting is accomplished +by merging the extent's face with the face or faces specified by the +`mouse-face' property. The effect is as if a pseudo-extent with the +`mouse-face' face were inserted after the extent in the display order +(*note Extent Endpoints::., display order). + + - Variable: mouse-highlight-priority + This variable holds the priority to use when merging in the + highlighting pseudo-extent. The default is 1000. This is + purposely set very high so that the highlighting pseudo-extent + shows up even if there are other extents with various priorities + at the same location. + + You can also explicitly cause an extent to be highlighted. Only one +extent at a time can be highlighted in this fashion, and any other +highlighted extent will be de-highlighted. + + - Function: highlight-extent EXTENT &optional HIGHLIGHT-P + This function highlights (if HIGHLIGHT-P is non-`nil') or + de-highlights (if HIGHLIGHT-P is `nil') EXTENT, if EXTENT has the + `mouse-face' property. (Nothing happens if EXTENT does not have + the `mouse-face' property.) + + - Function: force-highlight-extent EXTENT &optional HIGHLIGHT-P + This function is similar to `highlight-extent' but highlights or + de-highlights the extent regardless of whether it has the + `mouse-face' property. + + If an extent has a `keymap' property, this keymap will be consulted +for mouse clicks on the extent and keypresses made while `point' is +within the extent. The behavior of mouse clicks and keystrokes not +defined in the keymap is as normal for the buffer. + + +File: lispref.info, Node: Atomic Extents, Prev: Extents and Events, Up: Extents + +Atomic Extents +============== + + If the Lisp file `atomic-extents' is loaded, then the atomic extent +facility is available. An "atomic extent" is an extent for which +`point' cannot be positioned anywhere within it. This ensures that +when selecting text, either all or none of the extent is selected. + + To make an extent atomic, set its `atomic' property. + + +File: lispref.info, Node: Specifiers, Next: Faces and Window-System Objects, Prev: Extents, Up: Top + +Specifiers +********** + + A specifier is an object used to keep track of a property whose value +may vary depending on the particular situation (e.g. particular buffer +displayed in a particular window) that it is used in. The value of many +built-in properties, such as the font, foreground, background, and such +properties of a face and variables such as `modeline-shadow-thickness' +and `top-toolbar-height', is actually a specifier object. The +specifier object, in turn, is "instanced" in a particular situation to +yield the real value of the property in that situation. + + - Function: specifierp OBJECT + This function returns non-`nil' if OBJECT is a specifier. + +* 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. +* Specifier Instancing Functions:: + 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. +* Other Specification Functions:: + Other ways of working with specifications. + + +File: lispref.info, Node: Introduction to Specifiers, Next: Specifiers In-Depth, Up: Specifiers + +Introduction to Specifiers +========================== + + Sometimes you may want the value of a property to vary depending on +the context the property is used in. A simple example of this in XEmacs +is buffer-local variables. For example, the variable +`modeline-format', which controls the format of the modeline, can have +different values depending on the particular buffer being edited. The +variable has a default value which most modes will use, but a +specialized package such as Calendar might change the variable so as to +tailor the modeline to its own purposes. + + Other properties (such as those that can be changed by the +`modify-frame-parameters' function, for example the color of the text +cursor) can have frame-local values, although it might also make sense +for them to have buffer-local values. In other cases, you might want +the property to vary depending on the particular window within the +frame that applies (e.g. the top or bottom window in a split frame), the +device type that that frame appears on (X or tty), etc. Perhaps you can +envision some more complicated scenario where you want a particular +value in a specified buffer, another value in all other buffers +displayed on a particular frame, another value in all other buffers +displayed in all other frames on any mono (two-color, e.g. black and +white only) displays, and a default value in all other circumstances. + + A "specifier" is a generalization of this, allowing a great deal of +flexibility in controlling exactly what value a property has in which +circumstances. It is most commonly used for display properties, such as +an image or the foreground color of a face. As a simple example, you +can specify that the foreground of the default face be + + * blue for a particular buffer + + * green for all other buffers + + As a more complicated example, you could specify that the foreground +of the default face be + + * forest green for all buffers displayed in a particular Emacs + window, or green if the X server doesn't recognize the color + `forest green' + + * blue for all buffers displayed in a particular frame + + * red for all other buffers displayed on a color device + + * white for all other buffers + + +File: lispref.info, Node: Specifiers In-Depth, Next: Specifier Instancing, Prev: Introduction to Specifiers, Up: Specifiers + +In-Depth Overview of a Specifier +================================ + + A specifier object encapsulates a set of "specifications", each of +which says what its value should be if a particular condition applies. +For example, one specification might be "The value should be +darkseagreen2 on X devices" another might be "The value should be blue +in the *Help* buffer". In specifier terminology, these conditions are +called "locales" and the values are called "instantiators". Given a +specifier, a logical question is "What is its value in a particular +situation?" This involves looking through the specifications to see +which ones apply to this particular situation, and perhaps preferring +one over another if more than one applies. In specifier terminology, a +"particular situation" is called a "domain", and determining its value +in a particular domain is called "instancing". Most of the time, a +domain is identified by a particular window. For example, if the +redisplay engine is drawing text in the default face in a particular +window, it retrieves the specifier for the foreground color of the +default face and "instances" it in the domain given by that window; in +other words, it asks the specifier, "What is your value in this +window?". + + More specifically, a specifier contains a set of "specifications", +each of which associates a "locale" (a window object, a buffer object, +a frame object, a device object, or the symbol `global') with an +"inst-list", which is a list of one or more "inst-pairs". (For each +possible locale, there can be at most one specification containing that +locale.) Each inst-pair is a cons of a "tag set" (an unordered list of +zero or more symbols, or "tags") and an "instantiator" (the allowed +form of this varies depending on the type of specifier). In a given +specification, there may be more than one inst-pair with the same tag +set; this is unlike for locales. + + The tag set is used to restrict the sorts of devices over which the +instantiator is valid and to uniquely identify instantiators added by a +particular application, so that different applications can work on the +same specifier and not interfere with each other. Each tag can have a +"predicate" associated with it, which is a function of one argument (a +device) that specifies whether the tag matches that particular device. +(If a tag does not have a predicate, it matches all devices.) All tags +in a tag set must match a device for the associated inst-pair to be +instantiable over that device. (A null tag set is perfectly valid.) + + The valid device types (normally `x', `tty', and `stream') and +device classes (normally `color', `grayscale', and `mono') can always +be used as tags, and match devices of the associated type or class +(*note Consoles and Devices::.). 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 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. + + When a specifier is instanced in a domain, both the locale and the +tag set can be viewed as specifying necessary conditions that must +apply in that domain for an instantiator to be considered as a possible +result of the instancing. More specific locales always override more +general locales (thus, there is no particular ordering of the +specifications in a specifier); however, the tag sets are simply +considered in the order that the inst-pairs occur in the +specification's inst-list. + + Note also that the actual object that results from the instancing +(called an "instance object") may not be the same as the instantiator +from which it was derived. For some specifier types (such as integer +specifiers and boolean specifiers), the instantiator will be returned +directly as the instance object. For other types, however, this is not +the case. For example, for font specifiers, the instantiator is a +font-description string and the instance object is a font-instance +object, which describes how the font is displayed on a particular +device. A font-instance object encapsulates such things as the actual +font name used to display the font on that device (a font-description +string under X is usually a wildcard specification that may resolve to +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 "instantiation") +might fail - a font or color might not exist on a particular device, +for example. + diff --git a/info/lispref.info-34 b/info/lispref.info-34 new file mode 100644 index 0000000..bda5825 --- /dev/null +++ b/info/lispref.info-34 @@ -0,0 +1,1048 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Specifier Instancing, Next: Specifier Types, Prev: Specifiers In-Depth, Up: Specifiers + +How a Specifier Is Instanced +============================ + + Instancing of a specifier in a particular window domain proceeds as +follows: + + * First, XEmacs searches for a specification whose locale is the + same as the window. If that fails, the search is repeated, + looking for a locale that is the same as the window's buffer. If + that fails, the search is repeated using the window's frame, then + using the device that frame is on. Finally, the specification + whose locale is the symbol `global' (if there is such a + specification) is considered. + + * The inst-pairs contained in the specification that was found are + considered in their order in the inst-list, looking for one whose + tag set matches the device that is derived from the window domain. + (The tag set is an unordered list of zero or more tag symbols. + For all tags that have predicates associated with them, the + predicate must match the device.) + + * If a matching tag set is found, the corresponding instantiator is + passed to the specifier's instantiation method, which is specific + to the type of the specifier. If it succeeds, the resulting + instance object is returned as the result of the instancing and + the instancing is done. Otherwise, the operation continues, + looking for another matching inst-pair in the current + specification. + + * When there are no more inst-pairs to be considered in the current + specification, the search starts over, looking for another + specification as in the first step above. + + * If all specifications are exhausted and no instance object can be + derived, the instancing fails. (Actually, this is not completely + true. Some specifier objects for built-in properties have a + "fallback" value, which is either an inst-list or another + specifier object, that is consulted if the instancing is about to + fail. If it is an inst-list, the searching proceeds using the + inst-pairs in that list. If it is a specifier, the entire + instancing starts over using that specifier instead of the given + one. Fallback values are set by the C code and cannot be + modified, except perhaps indirectly, using any Lisp functions. + The purpose of them is to supply some values to make sure that + instancing of built-in properties can't fail and to implement some + basic specifier inheritance, such as the fact that faces inherit + their properties from the `default' face.) + + It is also possible to instance a specifier over a frame domain or +device domain instead of over a window domain. The C code, for example, +instances the `top-toolbar-height' variable over a frame domain in +order to determine the height of a frame's top toolbar. Instancing over +a frame or device is similar to instancing over a window except that +specifications for locales that cannot be derived from the domain are +ignored. Specifically, instancing over a frame looks first for frame +locales, then device locales, then the `global' locale. Instancing +over a device domain looks only for device locales and the `global' +locale. + + +File: lispref.info, Node: Specifier Types, Next: Adding Specifications, Prev: Specifier Instancing, Up: Specifiers + +Specifier Types +=============== + + There are various different types of specifiers. The type of a +specifier controls what sorts of instantiators are valid, how an +instantiator is instantiated, etc. Here is a list of built-in specifier +types: + +`boolean' + The valid instantiators are the symbols `t' and `nil'. Instance + objects are the same as instantiators so no special instantiation + function is needed. + +`integer' + The valid instantiators are integers. Instance objects are the + same as instantiators so no special instantiation function is + needed. `modeline-shadow-thickness' is an example of an integer + specifier (negative thicknesses indicate that the shadow is drawn + recessed instead of raised). + +`natnum' + The valid instantiators are natnums (non-negative integers). + Instance objects are the same as instantiators so no special + instantiation function is needed. Natnum specifiers are used for + dimension variables such as `top-toolbar-height'. + +`generic' + All Lisp objects are valid instantiators. Instance objects are + the same as instantiators so no special instantiation function is + needed. + +`font' + The valid instantiators are strings describing fonts or vectors + indicating inheritance from the font of some face. Instance + objects are font-instance objects, which are specific to a + particular device. The instantiation method for font specifiers + can fail, unlike for integer, natnum, boolean, and generic + specifiers. + +`color' + The valid instantiators are strings describing colors or vectors + indicating inheritance from the foreground or background of some + face. Instance objects are color-instance objects, which are + specific to a particular device. The instantiation method for + color specifiers can fail, as for font specifiers. + +`image' + Images are perhaps the most complicated type of built-in + specifier. The valid instantiators are strings (a filename, + inline data for a pixmap, or text to be displayed in a text glyph) + or vectors describing inline data of various sorts or indicating + inheritance from the background-pixmap property of some face. + Instance objects are either strings (for text images), + image-instance objects (for pixmap images), or subwindow objects + (for subwindow images). The instantiation method for image + specifiers can fail, as for font and color specifiers. + +`face-boolean' + The valid instantiators are the symbols `t' and `nil' and vectors + indicating inheritance from a boolean property of some face. + Specifiers of this sort are used for all of the built-in boolean + properties of faces. Instance objects are either the symbol `t' + or the symbol `nil'. + +`toolbar' + The valid instantiators are toolbar descriptors, which are lists + of toolbar-button descriptors (each of which is a vector of two or + four elements). *Note Toolbar::, for more information. + + Color and font instance objects can also be used in turn as +instantiators for a new color or font instance object. Since these +instance objects are device-specific, the instantiator can be used +directly as the new instance object, but only if they are of the same +device. If the devices differ, the base color or font of the +instantiating object is effectively used instead as the instantiator. + + *Note Faces and Window-System Objects::, for more information on +fonts, colors, and face-boolean specifiers. *Note Glyphs::, for more +information about image specifiers. *Note Toolbar::, for more +information on toolbar specifiers. + + - Function: specifier-type SPECIFIER + This function returns the type of SPECIFIER. The returned value + will be a symbol: one of `integer', `boolean', etc., as listed in + the above table. + + Functions are also provided to query whether an object is a +particular kind of specifier: + + - Function: boolean-specifier-p OBJECT + This function returns non-`nil' if OBJECT is a boolean specifier. + + - Function: integer-specifier-p OBJECT + This function returns non-`nil' if OBJECT is an integer specifier. + + - Function: natnum-specifier-p OBJECT + This function returns non-`nil' if OBJECT is a natnum specifier. + + - Function: generic-specifier-p OBJECT + This function returns non-`nil' if OBJECT is a generic specifier. + + - Function: face-boolean-specifier-p OBJECT + This function returns non-`nil' if OBJECT is a face-boolean + specifier. + + - Function: toolbar-specifier-p OBJECT + This function returns non-`nil' if OBJECT is a toolbar specifier. + + - Function: font-specifier-p OBJECT + This function returns non-`nil' if OBJECT is a font specifier. + + - Function: color-specifier-p OBJECT + This function returns non-`nil' if OBJECT is a color specifier. + + - Function: image-specifier-p OBJECT + This function returns non-`nil' if OBJECT is an image specifier. + + +File: lispref.info, Node: Adding Specifications, Next: Retrieving Specifications, Prev: Specifier Types, Up: Specifiers + +Adding specifications to a Specifier +==================================== + + - Function: add-spec-to-specifier SPECIFIER INSTANTIATOR &optional + LOCALE TAG-SET HOW-TO-ADD + This function adds a specification to SPECIFIER. The + specification maps from LOCALE (which should be a window, buffer, + frame, device, or the symbol `global', and defaults to `global') + to INSTANTIATOR, whose allowed values depend on the type of the + specifier. Optional argument TAG-SET limits the instantiator to + apply only to the specified tag set, which should be a list of + tags all of which must match the device being instantiated over + (tags are a device type, a device class, or tags defined with + `define-specifier-tag'). Specifying a single symbol for TAG-SET + is equivalent to specifying a one-element list containing that + symbol. Optional argument HOW-TO-ADD specifies what to do if + there are already specifications in the specifier. It should be + one of + + `prepend' + Put at the beginning of the current list of instantiators for + LOCALE. + + `append' + Add to the end of the current list of instantiators for + LOCALE. + + `remove-tag-set-prepend' + This is the default. Remove any existing instantiators whose + tag set is the same as TAG-SET; then put the new instantiator + at the beginning of the current list. + + `remove-tag-set-append' + Remove any existing instantiators whose tag set is the same as + TAG-SET; then put the new instantiator at the end of the + current list. + + `remove-locale' + Remove all previous instantiators for this locale before + adding the new spec. + + `remove-locale-type' + Remove all specifications for all locales of the same type as + LOCALE (this includes LOCALE itself) before adding the new + spec. + + `remove-all' + Remove all specifications from the specifier before adding + the new spec. + + `remove-tag-set-prepend' is the default. + + You can retrieve the specifications for a particular locale or + locale type with the function `specifier-spec-list' or + `specifier-specs'. + + - Function: add-spec-list-to-specifier SPECIFIER SPEC-LIST &optional + HOW-TO-ADD + This function adds a "spec-list" (a list of specifications) to + SPECIFIER. The format of a spec-list is + + `((LOCALE (TAG-SET . INSTANTIATOR) ...) ...)' + + where + + * LOCALE := a window, a buffer, a frame, a device, or `global' + + * TAG-SET := an unordered list of zero or more TAGS, each of + which is a symbol + + * TAG := a device class (*note Consoles and Devices::.), a + device type, or a tag defined with `define-specifier-tag' + + * INSTANTIATOR := format determined by the type of specifier + + The pair `(TAG-SET . INSTANTIATOR)' is called an "inst-pair". A + list of inst-pairs is called an "inst-list". The pair `(LOCALE . + INST-LIST)' is called a "specification". A spec-list, then, can + be viewed as a list of specifications. + + HOW-TO-ADD specifies how to combine the new specifications with + the existing ones, and has the same semantics as for + `add-spec-to-specifier'. + + In many circumstances, the higher-level function `set-specifier' is + more convenient and should be used instead. + + - Macro: let-specifier SPECIFIER-LIST &rest BODY + This special form temporarily adds specifications to specifiers, + evaluates forms in BODY and restores the specifiers to their + previous states. The specifiers and their temporary + specifications are listed in SPECIFIER-LIST. + + The format of SPECIFIER-LIST is + + ((SPECIFIER VALUE &optional LOCALE TAG-SET HOW-TO-ADD) ...) + + SPECIFIER is the specifier to be temporarily modified. VALUE is + the instantiator to be temporarily added to specifier in LOCALE. + LOCALE, TAG-SET and HOW-TO-ADD have the same meaning as in + `add-spec-to-specifier'. + + This special form is implemented as a macro; the code resulting + from macro expansion will add specifications to specifiers using + `add-spec-to-specifier'. After forms in BODY are evaluated, the + temporary specifications are removed and old specifier spec-lists + are restored. + + LOCALE, TAG-SET and HOW-TO-ADD may be omitted, and default to + `nil'. The value of the last form in BODY is returned. + + NOTE: If you want the specifier's instance to change in all + circumstances, use `(selected-window)' as the LOCALE. If LOCALE + is `nil' or omitted, it defaults to `global'. + + The following example removes the 3D modeline effect in the + currently selected window for the duration of a second: + + (let-specifier ((modeline-shadow-thickness 0 (selected-window))) + (sit-for 1)) + + - Function: set-specifier SPECIFIER VALUE &optional HOW-TO-ADD + This function adds some specifications to SPECIFIER. VALUE can be + a single instantiator or tagged instantiator (added as a global + specification), a list of tagged and/or untagged instantiators + (added as a global specification), a cons of a locale and + instantiator or locale and instantiator list, a list of such + conses, or nearly any other reasonable form. More specifically, + VALUE can be anything accepted by `canonicalize-spec-list'. + + HOW-TO-ADD is the same as in `add-spec-to-specifier'. + + Note that `set-specifier' is exactly complementary to + `specifier-specs' except in the case where SPECIFIER has no specs + at all in it but `nil' is a valid instantiator (in that case, + `specifier-specs' will return `nil' (meaning no specs) and + `set-specifier' will interpret the `nil' as meaning "I'm adding a + global instantiator and its value is `nil'"), or in strange cases + where there is an ambiguity between a spec-list and an inst-list, + etc. (The built-in specifier types are designed in such a way as + to avoid any such ambiguities.) + + If you want to work with spec-lists, you should probably not use + these functions, but should use the lower-level functions + `specifier-spec-list' and `add-spec-list-to-specifier'. These + functions always work with fully-qualified spec-lists; thus, there + is no ambiguity. + + - Function: canonicalize-inst-pair INST-PAIR SPECIFIER-TYPE &optional + NOERROR + This function canonicalizes the given INST-PAIR. + + SPECIFIER-TYPE specifies the type of specifier that this SPEC-LIST + will be used for. + + Canonicalizing means converting to the full form for an inst-pair, + i.e. `(TAG-SET . INSTANTIATOR)'. A single, untagged instantiator + is given a tag set of `nil' (the empty set), and a single tag is + converted into a tag set consisting only of that tag. + + If NOERROR is non-`nil', signal an error if the inst-pair is + invalid; otherwise return `t'. + + - Function: canonicalize-inst-list INST-LIST SPECIFIER-TYPE &optional + NOERROR + This function canonicalizes the given INST-LIST (a list of + inst-pairs). + + SPECIFIER-TYPE specifies the type of specifier that this INST-LIST + will be used for. + + Canonicalizing means converting to the full form for an inst-list, + i.e. `((TAG-SET . INSTANTIATOR) ...)'. This function accepts a + single inst-pair or any abbreviation thereof or a list of + (possibly abbreviated) inst-pairs. (See `canonicalize-inst-pair'.) + + If NOERROR is non-`nil', signal an error if the inst-list is + invalid; otherwise return `t'. + + - Function: canonicalize-spec SPEC SPECIFIER-TYPE &optional NOERROR + This function canonicalizes the given SPEC (a specification). + + SPECIFIER-TYPE specifies the type of specifier that this SPEC-LIST + will be used for. + + Canonicalizing means converting to the full form for a spec, i.e. + `(LOCALE (TAG-SET . INSTANTIATOR) ...)'. This function accepts a + possibly abbreviated inst-list or a cons of a locale and a + possibly abbreviated inst-list. (See `canonicalize-inst-list'.) + + If NOERROR is `nil', signal an error if the specification is + invalid; otherwise return `t'. + + - Function: canonicalize-spec-list SPEC-LIST SPECIFIER-TYPE &optional + NOERROR + This function canonicalizes the given SPEC-LIST (a list of + specifications). + + SPECIFIER-TYPE specifies the type of specifier that this SPEC-LIST + will be used for. + + Canonicalizing means converting to the full form for a spec-list, + i.e. `((LOCALE (TAG-SET . INSTANTIATOR) ...) ...)'. This + function accepts a possibly abbreviated specification or a list of + such things. (See `canonicalize-spec'.) This is the function used + to convert spec-lists accepted by `set-specifier' and such into a + form suitable for `add-spec-list-to-specifier'. + + This function tries extremely hard to resolve any ambiguities, and + the built-in specifier types (font, image, toolbar, etc.) are + designed so that there won't be any ambiguities. + + If NOERROR is `nil', signal an error if the spec-list is invalid; + otherwise return `t'. + + +File: lispref.info, Node: Retrieving Specifications, Next: Specifier Tag Functions, Prev: Adding Specifications, Up: Specifiers + +Retrieving the Specifications from a Specifier +============================================== + + - Function: specifier-spec-list SPECIFIER &optional LOCALE TAG-SET + EXACT-P + This function returns the spec-list of specifications for + SPECIFIER in LOCALE. + + If LOCALE is a particular locale (a window, buffer, frame, device, + or the symbol `global'), a spec-list consisting of the + specification for that locale will be returned. + + If LOCALE is a locale type (i.e. a symbol `window', `buffer', + `frame', or `device'), a spec-list of the specifications for all + locales of that type will be returned. + + If LOCALE is `nil' or the symbol `all', a spec-list of all + specifications in SPECIFIER will be returned. + + LOCALE can also be a list of locales, locale types, and/or `all'; + the result is as if `specifier-spec-list' were called on each + element of the list and the results concatenated together. + + Only instantiators where TAG-SET (a list of zero or more tags) is + a subset of (or possibly equal to) the instantiator's tag set are + returned. (The default value of` nil' is a subset of all tag sets, + so in this case no instantiators will be screened out.) If EXACT-P + is non-`nil', however, TAG-SET must be equal to an instantiator's + tag set for the instantiator to be returned. + + - Function: specifier-specs SPECIFIER &optional LOCALE TAG-SET EXACT-P + This function returns the specification(s) for SPECIFIER in LOCALE. + + If LOCALE is a single locale or is a list of one element + containing a single locale, then a "short form" of the + instantiators for that locale will be returned. Otherwise, this + function is identical to `specifier-spec-list'. + + The "short form" is designed for readability and not for ease of + use in Lisp programs, and is as follows: + + 1. If there is only one instantiator, then an inst-pair (i.e. + cons of tag and instantiator) will be returned; otherwise a + list of inst-pairs will be returned. + + 2. For each inst-pair returned, if the instantiator's tag is + `any', the tag will be removed and the instantiator itself + will be returned instead of the inst-pair. + + 3. If there is only one instantiator, its value is `nil', and + its tag is `any', a one-element list containing `nil' will be + returned rather than just `nil', to distinguish this case + from there being no instantiators at all. + + + - Function: specifier-fallback SPECIFIER + This function returns the fallback value for SPECIFIER. Fallback + values are provided by the C code for certain built-in specifiers + to make sure that instancing won't fail even if all specs are + removed from the specifier, or to implement simple inheritance + behavior (e.g. this method is used to ensure that faces other than + `default' inherit their attributes from `default'). By design, + you cannot change the fallback value, and specifiers created with + `make-specifier' will never have a fallback (although a similar, + Lisp-accessible capability may be provided in the future to allow + for inheritance). + + The fallback value will be an inst-list that is instanced like any + other inst-list, a specifier of the same type as SPECIFIER + (results in inheritance), or `nil' for no fallback. + + When you instance a specifier, you can explicitly request that the + fallback not be consulted. (The C code does this, for example, when + merging faces.) See `specifier-instance'. + + +File: lispref.info, Node: Specifier Tag Functions, Next: Specifier Instancing Functions, Prev: Retrieving Specifications, Up: Specifiers + +Working With Specifier Tags +=========================== + + A specifier tag set is an entity that is attached to an instantiator +and can be used to restrict the scope of that instantiator to a +particular device class or device type and/or to mark instantiators +added by a particular package so that they can be later removed. + + A specifier tag set consists of a list of zero of more specifier +tags, 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 `define-specifier-tag'.) It is called a "tag set" (as +opposed to a list) because the order of the tags or the number of times +a particular tag occurs does not matter. + + Each tag has a predicate associated with it, which specifies whether +that tag applies to a particular device. The tags which are device +types and classes match devices of that type or class. User-defined +tags can have any predicate, or none (meaning that all devices match). +When attempting to instance a specifier, a particular instantiator is +only considered if the device of the domain being instanced over matches +all tags in the tag set attached to that instantiator. + + Most of the time, a tag set is not specified, and the instantiator +gets a null tag set, which matches all devices. + + - Function: valid-specifier-tag-p TAG + This function returns non-`nil' if TAG is a valid specifier tag. + + - Function: valid-specifier-tag-set-p TAG-SET + This function returns non-`nil' if TAG-SET is a valid specifier + tag set. + + - Function: canonicalize-tag-set TAG-SET + This function canonicalizes the given tag set. Two canonicalized + tag sets can be compared with `equal' to see if they represent the + same tag set. (Specifically, canonicalizing involves sorting by + symbol name and removing duplicates.) + + - Function: device-matches-specifier-tag-set-p DEVICE TAG-SET + This function returns non-`nil' if DEVICE matches specifier tag + set TAG-SET. This means that DEVICE matches each tag in the tag + set. + + - Function: define-specifier-tag TAG &optional PREDICATE + This function defines a new specifier tag. If PREDICATE is + specified, it should be a function of one argument (a device) that + specifies whether the tag matches that particular device. If + PREDICATE is omitted, the tag matches all devices. + + You can redefine an existing user-defined specifier tag. However, + you cannot redefine the built-in specifier tags (the device types + and classes) or the symbols `nil', `t', `all', or `global'. + + - Function: device-matching-specifier-tag-list &optional DEVICE + This function returns a list of all specifier tags matching + DEVICE. DEVICE defaults to the selected device if omitted. + + - Function: specifier-tag-list + This function returns a list of all currently-defined specifier + tags. This includes the built-in ones (the device types and + classes). + + - Function: specifier-tag-predicate TAG + This function returns the predicate for the given specifier tag. + + +File: lispref.info, Node: Specifier Instancing Functions, Next: Specifier Example, Prev: Specifier Tag Functions, Up: Specifiers + +Functions for Instancing a Specifier +==================================== + + - Function: specifier-instance SPECIFIER &optional DOMAIN DEFAULT + NO-FALLBACK + This function instantiates SPECIFIER (return its value) in DOMAIN. + If no instance can be generated for this domain, return DEFAULT. + + DOMAIN should be a window, frame, or device. Other values that + are legal as a locale (e.g. a buffer) are not valid as a domain + because they do not provide enough information to identify a + particular device (see `valid-specifier-domain-p'). DOMAIN + defaults to the selected window if omitted. + + "Instantiating" a specifier in a particular domain means + determining the specifier's "value" in that domain. This is + accomplished by searching through the specifications in the + specifier that correspond to all locales that can be derived from + the given domain, from specific to general. In most cases, the + domain is an Emacs window. In that case specifications are + searched for as follows: + + 1. A specification whose locale is the window itself; + + 2. A specification whose locale is the window's buffer; + + 3. A specification whose locale is the window's frame; + + 4. A specification whose locale is the window's frame's device; + + 5. A specification whose locale is the symbol `global'. + + If all of those fail, then the C-code-provided fallback value for + this specifier is consulted (see `specifier-fallback'). If it is + an inst-list, then this function attempts to instantiate that list + just as when a specification is located in the first five steps + above. If the fallback is a specifier, `specifier-instance' is + called recursively on this specifier and the return value used. + Note, however, that if the optional argument NO-FALLBACK is + non-`nil', the fallback value will not be consulted. + + Note that there may be more than one specification matching a + particular locale; all such specifications are considered before + looking for any specifications for more general locales. Any + particular specification that is found may be rejected because it + is tagged to a particular device class (e.g. `color') or device + type (e.g. `x') or both and the device for the given domain does + not match this, or because the specification is not valid for the + device of the given domain (e.g. the font or color name does not + exist for this particular X server). + + The returned value is dependent on the type of specifier. For + example, for a font specifier (as returned by the `face-font' + function), the returned value will be a font-instance object. For + images, the returned value will be a string, pixmap, or subwindow. + + - Function: specifier-instance-from-inst-list SPECIFIER DOMAIN + INST-LIST &optional DEFAULT + This function attempts to convert a particular inst-list into an + instance. This attempts to instantiate INST-LIST in the given + DOMAIN, as if INST-LIST existed in a specification in SPECIFIER. + If the instantiation fails, DEFAULT is returned. In most + circumstances, you should not use this function; use + `specifier-instance' instead. + + +File: lispref.info, Node: Specifier Example, Next: Creating Specifiers, Prev: Specifier Instancing Functions, Up: Specifiers + +Example of Specifier Usage +========================== + + Now let us present an example to clarify the theoretical discussions +we have been through. In this example, we will use the general +specifier functions for clarity. Keep in mind that many types of +specifiers, and some other types of objects that are associated with +specifiers (e.g. faces), provide convenience functions making it easier +to work with objects of that type. + + Let us consider the background color of the default face. A +specifier is used to specify how that color will appear in different +domains. First, let's retrieve the specifier: + + (setq sp (face-property 'default 'background)) + => # + + (specifier-specs sp) + => ((# (nil . "forest green")) + (# (nil . "hot pink")) + (# (nil . "puke orange") + (nil . "moccasin")) + (# (nil . "magenta")) + (global ((tty) . "cyan") (nil . "white")) + ) + + Then, say we want to determine what the background color of the +default face is for the window currently displaying the buffer +`*scratch*'. We call + + (get-buffer-window "*scratch*") + => # + (window-frame (get-buffer-window "*scratch*")) + => # + (specifier-instance sp (get-buffer-window "*scratch*")) + => # + + Note that we passed a window to `specifier-instance', not a buffer. +We cannot pass a buffer because a buffer by itself does not provide +enough information. The buffer might not be displayed anywhere at all, +or could be displayed in many different frames on different devices. + + The result is arrived at like this: + + 1. First, we look for a specification matching the buffer displayed + in the window, i.e. `*scratch'. There are none, so we proceed. + + 2. Then, we look for a specification matching the window itself. + Again, there are none. + + 3. Then, we look for a specification matching the window's frame. The + specification `(# . "puke orange")' is + found. We call the instantiation method for colors, passing it the + locale we were searching over (i.e. the window, in this case) and + the instantiator (`"puke orange"'). However, the particular device + which this window is on (let's say it's an X connection) doesn't + recognize the color `"puke orange"', so the specification is + rejected. + + 4. So we continue looking for a specification matching the window's + frame. We find `(# . "moccasin")'. Again, + we call the instantiation method for colors. This time, the X + server our window is on recognizes the color `moccasin', and so the + instantiation method succeeds and returns a color instance. + + +File: lispref.info, Node: Creating Specifiers, Next: Specifier Validation Functions, Prev: Specifier Example, Up: Specifiers + +Creating New Specifier Objects +============================== + + - Function: make-specifier TYPE + This function creates a new specifier. + + 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 + device-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 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', or `toolbar'. + + For more information on particular types of specifiers, see the + functions `generic-specifier-p', `integer-specifier-p', + `natnum-specifier-p', `boolean-specifier-p', `color-specifier-p', + `font-specifier-p', `image-specifier-p', + `face-boolean-specifier-p', and `toolbar-specifier-p'. + + - Function: make-specifier-and-init TYPE SPEC-LIST &optional + DONT-CANONICALIZE + This function creates and initialize a new specifier. + + This is a front-end onto `make-specifier' that allows you to create + a specifier and add specs to it at the same time. TYPE specifies + the specifier type. SPEC-LIST supplies the specification(s) to be + added to the specifier. Normally, almost any reasonable + abbreviation of the full spec-list form is accepted, and is + converted to the full form; however, if optional argument + DONT-CANONICALIZE is non-`nil', this conversion is not performed, + and the SPEC-LIST must already be in full form. See + `canonicalize-spec-list'. + + +File: lispref.info, Node: Specifier Validation Functions, Next: Other Specification Functions, Prev: Creating Specifiers, Up: Specifiers + +Functions for Checking the Validity of Specifier Components +=========================================================== + + - Function: valid-specifier-domain-p DOMAIN + This function returns non-`nil' 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 a + window, frame, or device. (`nil' is not valid.) + + - Function: valid-specifier-locale-p LOCALE + This function returns non-`nil' if LOCALE is a valid specifier + locale. Valid locales are a device, a frame, a window, a buffer, + and `global'. (`nil' is not valid.) + + - Function: valid-specifier-locale-type-p LOCALE-TYPE + Given a specifier LOCALE-TYPE, this function returns non-nil if it + is valid. Valid locale types are the symbols `global', `device', + `frame', `window', and `buffer'. (Note, however, that in functions + that accept either a locale or a locale type, `global' is + considered an individual locale.) + + - Function: valid-specifier-type-p SPECIFIER-TYPE + Given a SPECIFIER-TYPE, this function returns non-`nil' if it is + valid. Valid types are `generic', `integer', `boolean', `color', + `font', `image', `face-boolean', and `toolbar'. + + - Function: valid-specifier-tag-p TAG + This function returns non-`nil' if TAG is a valid specifier tag. + + - Function: valid-instantiator-p INSTANTIATOR SPECIFIER-TYPE + This function returns non-`nil' if INSTANTIATOR is valid for + SPECIFIER-TYPE. + + - Function: valid-inst-list-p INST-LIST TYPE + This function returns non-`nil' if INST-LIST is valid for + specifier type TYPE. + + - Function: valid-spec-list-p SPEC-LIST TYPE + This function returns non-`nil' if SPEC-LIST is valid for + specifier type TYPE. + + - Function: check-valid-instantiator INSTANTIATOR SPECIFIER-TYPE + This function signals an error if INSTANTIATOR is invalid for + SPECIFIER-TYPE. + + - Function: check-valid-inst-list INST-LIST TYPE + This function signals an error if INST-LIST is invalid for + specifier type TYPE. + + - Function: check-valid-spec-list SPEC-LIST TYPE + This function signals an error if SPEC-LIST is invalid for + specifier type TYPE. + + +File: lispref.info, Node: Other Specification Functions, Prev: Specifier Validation Functions, Up: Specifiers + +Other Functions for Working with Specifications in a Specifier +============================================================== + + - Function: copy-specifier SPECIFIER &optional DEST LOCALE TAG-SET + EXACT-P HOW-TO-ADD + This function copies SPECIFIER to DEST, or creates a new one if + DEST is `nil'. + + If DEST is `nil' or omitted, a new specifier will be created and + the specifications copied into it. Otherwise, the specifications + will be copied into the existing specifier in DEST. + + If LOCALE is `nil' or the symbol `all', all specifications will be + copied. If LOCALE is a particular locale, the specification for + that particular locale will be copied. If LOCALE is a locale + type, the specifications for all locales of that type will be + copied. LOCALE can also be a list of locales, locale types, + and/or `all'; this is equivalent to calling `copy-specifier' for + each of the elements of the list. See `specifier-spec-list' for + more information about LOCALE. + + Only instantiators where TAG-SET (a list of zero or more tags) is + a subset of (or possibly equal to) the instantiator's tag set are + copied. (The default value of `nil' is a subset of all tag sets, + so in this case no instantiators will be screened out.) If EXACT-P + is non-`nil', however, TAG-SET must be equal to an instantiator's + tag set for the instantiator to be copied. + + Optional argument HOW-TO-ADD specifies what to do with existing + specifications in DEST. If nil, then whichever locales or locale + types are copied will first be completely erased in DEST. + Otherwise, it is the same as in `add-spec-to-specifier'. + + - Function: remove-specifier SPECIFIER &optional LOCALE TAG-SET EXACT-P + This function removes specification(s) for SPECIFIER. + + If LOCALE is a particular locale (a buffer, window, frame, device, + or the symbol `global'), the specification for that locale will be + removed. + + If instead, LOCALE is a locale type (i.e. a symbol `buffer', + `window', `frame', or `device'), the specifications for all + locales of that type will be removed. + + If LOCALE is `nil' or the symbol `all', all specifications will be + removed. + + LOCALE can also be a list of locales, locale types, and/or `all'; + this is equivalent to calling `remove-specifier' for each of the + elements in the list. + + Only instantiators where TAG-SET (a list of zero or more tags) is + a subset of (or possibly equal to) the instantiator's tag set are + removed. (The default value of `nil' is a subset of all tag sets, + so in this case no instantiators will be screened out.) If EXACT-P + is non-`nil', however, TAG-SET must be equal to an instantiator's + tag set for the instantiator to be removed. + + - Function: map-specifier SPECIFIER FUNC &optional LOCALE MAPARG + This function applies FUNC to the specification(s) for LOCALE in + SPECIFIER. + + If LOCALE is a locale, FUNC will be called for that locale. If + LOCALE is a locale type, FUNC will be mapped over all locales of + that type. If LOCALE is `nil' or the symbol `all', FUNC will be + mapped over all locales in SPECIFIER. + + FUNC is called with four arguments: the SPECIFIER, the locale + being mapped over, the inst-list for that locale, and the optional + MAPARG. If any invocation of FUNC returns non-`nil', the mapping + will stop and the returned value becomes the value returned from + `map-specifier'. Otherwise, `map-specifier' returns `nil'. + + - Function: specifier-locale-type-from-locale LOCALE + Given a specifier LOCALE, this function returns its type. + + +File: lispref.info, Node: Faces and Window-System Objects, Next: Glyphs, Prev: Specifiers, Up: Top + +Faces and Window-System Objects +******************************* + +* Menu: + +* Faces:: Controlling the way text looks. +* Fonts:: Controlling the typeface of text. +* Colors:: Controlling the color of text and pixmaps. + + +File: lispref.info, Node: Faces, Next: Fonts, Up: Faces and Window-System Objects + +Faces +===== + + A "face" is a named collection of graphical properties: font, +foreground color, background color, background pixmap, optional +underlining, and (on TTY devices) whether the text is to be highlighted, +dimmed, blinking, or displayed in reverse video. Faces control the +display of text on the screen. Every face has a name, which is a symbol +such as `default' or `modeline'. + + Each built-in property of a face is controlled using a specifier, +which allows it to have separate values in particular buffers, frames, +windows, and devices and to further vary according to device type (X or +TTY) and device class (color, mono, or grayscale). *Note Specifiers::, +for more information. + + The face named `default' is used for ordinary text. The face named +`modeline' is used for displaying the modeline. The face named +`highlight' is used for highlighted extents (*note Extents::.). The +faces named `left-margin' and `right-margin' are used for the left and +right margin areas, respectively (*note Annotations::.). The face +named `zmacs-region' is used for the highlighted region between point +and mark. + +* Menu: + +* Merging Faces:: How XEmacs decides which face to use + for a character. +* Basic Face Functions:: How to define and examine faces. +* Face Properties:: How to access and modify a face's properties. +* Face Convenience Functions:: Convenience functions for accessing + particular properties of a face. +* Other Face Display Functions:: Other functions pertaining to how a + a face appears. + + +File: lispref.info, Node: Merging Faces, Next: Basic Face Functions, Up: Faces + +Merging Faces for Display +------------------------- + + Here are all the ways to specify which face to use for display of +text: + + * With defaults. Each frame has a "default face", which is used for + all text that doesn't somehow specify another face. The face named + `default' applies to the text area, while the faces `left-margin' + and `right-margin' apply to the left and right margin areas. + + * With text properties. A character may have a `face' property; if + so, it's displayed with that face. (Text properties are actually + implemented in terms of extents.) *Note Text Properties::. + + * With extents. An extent may have a `face' property, which applies + to all the text covered by the extent; in addition, if the + `highlight' property is set, the `highlight' property applies when + the mouse moves over the extent or if the extent is explicitly + highlighted. *Note Extents::. + + * With annotations. Annotations that are inserted into a buffer can + specify their own face. (Annotations are actually implemented in + terms of extents.) *Note Annotations::. + + If these various sources together specify more than one face for a +particular character, XEmacs merges the properties of the various faces +specified. Extents, text properties, and annotations all use the same +underlying representation (as extents). When multiple extents cover one +character, an extent with higher priority overrides those with lower +priority. *Note Extents::. If no extent covers a particular character, +the `default' face is used. + + If a background pixmap is specified, it determines what will be +displayed in the background of text characters. If the background +pixmap is actually a pixmap, with its colors specified, those colors are +used; if it is a bitmap, the face's foreground and background colors are +used to color it. + + +File: lispref.info, Node: Basic Face Functions, Next: Face Properties, Prev: Merging Faces, Up: Faces + +Basic Functions for Working with Faces +-------------------------------------- + + The properties a face can specify include the font, the foreground +color, the background color, the background pixmap, the underlining, +the display table, and (for TTY devices) whether the text is to be +highlighted, dimmed, blinking, or displayed in reverse video. The face +can also leave these unspecified, causing them to assume the value of +the corresponding property of the `default' face. + + Here are the basic primitives for working with faces. + + - Function: make-face NAME &optional DOC-STRING TEMPORARY + This function defines and returns a new face named NAME, initially + with all properties unspecified. It does nothing if there is + already a face named NAME. Optional argument DOC-STRING specifies + an explanatory string used for descriptive purposes. If optional + argument TEMPORARY is non-`nil', the face will automatically + disappear when there are no more references to it anywhere in text + or Lisp code (otherwise, the face will continue to exist + indefinitely even if it is not used). + + - Function: face-list &optional TEMPORARY + This function returns a list of the names of all defined faces. If + TEMPORARY is `nil', only the permanent faces are included. If it + is `t', only the temporary faces are included. If it is any other + non-`nil' value both permanent and temporary are included. + + - Function: facep OBJECT + This function returns whether the given object is a face. + + - Function: copy-face OLD-FACE NEW-NAME &optional LOCALE HOW-TO-ADD + This function defines a new face named NEW-NAME which is a copy of + the existing face named OLD-FACE. If there is already a face + named NEW-NAME, then it alters the face to have the same + properties as OLD-FACE. LOCALE and HOW-TO-ADD let you copy just + parts of the old face rather than the whole face, and are as in + `copy-specifier' (*note Specifiers::.). + diff --git a/info/lispref.info-35 b/info/lispref.info-35 new file mode 100644 index 0000000..75149c3 --- /dev/null +++ b/info/lispref.info-35 @@ -0,0 +1,982 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Face Properties, Next: Face Convenience Functions, Prev: Basic Face Functions, Up: Faces + +Face Properties +--------------- + + You can examine and modify the properties of an existing face with +the following functions. + + The following symbols have predefined meanings: + +`foreground' + The foreground color of the face. + +`background' + The background color of the face. + +`font' + The font used to display text covered by this face. + +`display-table' + The display table of the face. + +`background-pixmap' + The pixmap displayed in the background of the face. Only used by + faces on X devices. + +`underline' + Underline all text covered by this face. + +`highlight' + Highlight all text covered by this face. Only used by faces on TTY + devices. + +`dim' + Dim all text covered by this face. Only used by faces on TTY + devices. + +`blinking' + Blink all text covered by this face. Only used by faces on TTY + devices. + +`reverse' + Reverse the foreground and background colors. Only used by faces + on TTY devices. + +`doc-string' + Description of what the face's normal use is. NOTE: This is not a + specifier, unlike all the other built-in properties, and cannot + contain locale-specific values. + + - Function: set-face-property FACE PROPERTY VALUE &optional LOCALE TAG + HOW-TO-ADD + This function changes a property of a FACE. + + For built-in properties, the actual value of the property is a + specifier and you cannot change this; but you can change the + specifications within the specifier, and that is what this + function will do. For user-defined properties, you can use this + function to either change the actual value of the property or, if + this value is a specifier, change the specifications within it. + + If PROPERTY is a built-in property, the specifications to be added + to this property can be supplied in many different ways: + + If VALUE is a simple instantiator (e.g. a string naming a + font or color) or a list of instantiators, then the + instantiator(s) will be added as a specification of the + property for the given LOCALE (which defaults to `global' if + omitted). + + If VALUE is a list of specifications (each of which is a cons + of a locale and a list of instantiators), then LOCALE must be + `nil' (it does not make sense to explicitly specify a locale + in this case), and specifications will be added as given. + + If VALUE is a specifier (as would be returned by + `face-property' if no LOCALE argument is given), then some or + all of the specifications in the specifier will be added to + the property. In this case, the function is really + equivalent to `copy-specifier' and LOCALE has the same + semantics (if it is a particular locale, the specification + for the locale will be copied; if a locale type, + specifications for all locales of that type will be copied; + if `nil' or `all', then all specifications will be copied). + + HOW-TO-ADD should be either `nil' or one of the symbols `prepend', + `append', `remove-tag-set-prepend', `remove-tag-set-append', + `remove-locale', `remove-locale-type', or `remove-all'. See + `copy-specifier' and `add-spec-to-specifier' for a description of + what each of these means. Most of the time, you do not need to + worry about this argument; the default behavior usually is fine. + + In general, it is OK to pass an instance object (e.g. as returned + by `face-property-instance') as an instantiator in place of an + actual instantiator. In such a case, the instantiator used to + create that instance object will be used (for example, if you set + a font-instance object as the value of the `font' property, then + the font name used to create that object will be used instead). + If some cases, however, doing this conversion does not make sense, + and this will be noted in the documentation for particular types + of instance objects. + + If PROPERTY is not a built-in property, then this function will + simply set its value if LOCALE is `nil'. However, if LOCALE is + given, then this function will attempt to add VALUE as the + instantiator for the given LOCALE, using `add-spec-to-specifier'. + If the value of the property is not a specifier, it will + automatically be converted into a `generic' specifier. + + - Function: face-property FACE PROPERTY &optional LOCALE + This function returns FACE's value of the given PROPERTY. + + If LOCALE is omitted, the FACE's actual value for PROPERTY will be + returned. For built-in properties, this will be a specifier + object of a type appropriate to the property (e.g. a font or color + specifier). For other properties, this could be anything. + + If LOCALE is supplied, then instead of returning the actual value, + the specification(s) for the given locale or locale type will be + returned. This will only work if the actual value of PROPERTY is + a specifier (this will always be the case for built-in properties, + but not or not may apply to user-defined properties). If the + actual value of PROPERTY is not a specifier, this value will + simply be returned regardless of LOCALE. + + The return value will be a list of instantiators (e.g. strings + specifying a font or color name), or a list of specifications, + each of which is a cons of a locale and a list of instantiators. + Specifically, if LOCALE is a particular locale (a buffer, window, + frame, device, or `global'), a list of instantiators for that + locale will be returned. Otherwise, if LOCALE is a locale type + (one of the symbols `buffer', `window', `frame', or `device'), the + specifications for all locales of that type will be returned. + Finally, if LOCALE is `all', the specifications for all locales of + all types will be returned. + + The specifications in a specifier determine what the value of + PROPERTY will be in a particular "domain" or set of circumstances, + which is typically a particular Emacs window along with the buffer + it contains and the frame and device it lies within. The value is + derived from the instantiator associated with the most specific + locale (in the order buffer, window, frame, device, and `global') + that matches the domain in question. In other words, given a + domain (i.e. an Emacs window, usually), the specifier for PROPERTY + will first be searched for a specification whose locale is the + buffer contained within that window; then for a specification + whose locale is the window itself; then for a specification whose + locale is the frame that the window is contained within; etc. The + first instantiator that is valid for the domain (usually this + means that the instantiator is recognized by the device [i.e. the + X server or TTY device] that the domain is on). The function + `face-property-instance' actually does all this, and is used to + determine how to display the face. + + - Function: face-property-instance FACE PROPERTY &optional DOMAIN + DEFAULT NO-FALLBACK + This function returns the instance of FACE's PROPERTY in the + specified DOMAIN. + + Under most circumstances, DOMAIN will be a particular window, and + the returned instance describes how the specified property + actually is displayed for that window and the particular buffer in + it. Note that this may not be the same as how the property + appears when the buffer is displayed in a different window or + frame, or how the property appears in the same window if you + switch to another buffer in that window; and in those cases, the + returned instance would be different. + + The returned instance will typically be a color-instance, + font-instance, or pixmap-instance object, and you can query it + using the appropriate object-specific functions. For example, you + could use `color-instance-rgb-components' to find out the RGB + (red, green, and blue) components of how the `background' property + of the `highlight' face is displayed in a particular window. The + results might be different from the results you would get for + another window (perhaps the user specified a different color for + the frame that window is on; or perhaps the same color was + specified but the window is on a different X server, and that X + server has different RGB values for the color from this one). + + DOMAIN defaults to the selected window if omitted. + + DOMAIN can be a frame or device, instead of a window. The value + returned for a such a domain is used in special circumstances when + a more specific domain does not apply; for example, a frame value + might be used for coloring a toolbar, which is conceptually + attached to a frame rather than a particular window. The value is + also useful in determining what the value would be for a + particular window within the frame or device, if it is not + overridden by a more specific specification. + + If PROPERTY does not name a built-in property, its value will + simply be returned unless it is a specifier object, in which case + it will be instanced using `specifier-instance'. + + Optional arguments DEFAULT and NO-FALLBACK are the same as in + `specifier-instance'. *Note Specifiers::. + + +File: lispref.info, Node: Face Convenience Functions, Next: Other Face Display Functions, Prev: Face Properties, Up: Faces + +Face Convenience Functions +-------------------------- + + - Function: set-face-foreground FACE COLOR &optional LOCALE TAG + HOW-TO-ADD + - Function: set-face-background FACE COLOR &optional LOCALE TAG + HOW-TO-ADD + These functions set the foreground (respectively, background) + color of face FACE to COLOR. The argument COLOR should be a + string (the name of a color) or a color object as returned by + `make-color' (*note Colors::.). + + - Function: set-face-background-pixmap FACE PIXMAP &optional LOCALE + TAG HOW-TO-ADD + This function sets the background pixmap of face FACE to PIXMAP. + The argument PIXMAP should be a string (the name of a bitmap or + pixmap file; the directories listed in the variable + `x-bitmap-file-path' will be searched) or a glyph object as + returned by `make-glyph' (*note Glyphs::.). The argument may also + be a list of the form `(WIDTH HEIGHT DATA)' where WIDTH and HEIGHT + are the size in pixels, and DATA is a string, containing the raw + bits of the bitmap. + + - Function: set-face-font FACE FONT &optional LOCALE TAG HOW-TO-ADD + This function sets the font of face FACE. The argument FONT + should be a string or a font object as returned by `make-font' + (*note Fonts::.). + + - Function: set-face-underline-p FACE UNDERLINE-P &optional LOCALE TAG + HOW-TO-ADD + This function sets the underline property of face FACE. + + - Function: face-foreground FACE &optional LOCALE + - Function: face-background FACE &optional LOCALE + These functions return the foreground (respectively, background) + color specifier of face FACE. *Note Colors::. + + - Function: face-background-pixmap FACE &optional LOCALE + This function return the background-pixmap glyph object of face + FACE. + + - Function: face-font FACE &optional LOCALE + This function returns the font specifier of face FACE. (Note: + This is not the same as the function `face-font' in FSF Emacs.) + *Note Fonts::. + + - Function: face-font-name FACE &optional DOMAIN + This function returns the name of the font of face FACE, or `nil' + if it is unspecified. This is basically equivalent to `(font-name + (face-font FACE) DOMAIN)' except that it does not cause an error + if FACE's font is `nil'. (This function is named `face-font' in + FSF Emacs.) + + - Function: face-underline-p FACE &optional LOCALE + This function returns the underline property of face FACE. + + - Function: face-foreground-instance FACE &optional DOMAIN + - Function: face-background-instance FACE &optional DOMAIN + These functions return the foreground (respectively, background) + color specifier of face FACE. *Note Colors::. + + - Function: face-background-pixmap-instance FACE &optional DOMAIN + This function return the background-pixmap glyph object of face + FACE. + + - Function: face-font-instance FACE &optional DOMAIN + This function returns the font specifier of face FACE. *Note + Fonts::. + + +File: lispref.info, Node: Other Face Display Functions, Prev: Face Convenience Functions, Up: Faces + +Other Face Display Functions +---------------------------- + + - Function: invert-face FACE &optional LOCALE + Swap the foreground and background colors of face FACE. If the + face doesn't specify both foreground and background, then its + foreground and background are set to the default background and + foreground. + + - Function: face-equal FACE1 FACE2 &optional DOMAIN + This returns `t' if the faces FACE1 and FACE2 will display in the + same way. DOMAIN is as in `face-property-instance'. + + - Function: face-differs-from-default-p FACE &optional DOMAIN + This returns `t' if the face FACE displays differently from the + default face. DOMAIN is as in `face-property-instance'. + + +File: lispref.info, Node: Fonts, Next: Colors, Prev: Faces, Up: Faces and Window-System Objects + +Fonts +===== + + This section describes how to work with font specifier and font +instance objects, which encapsulate fonts in the window system. + +* Menu: + +* Font Specifiers:: Specifying how a font will appear. +* Font Instances:: What a font specifier gets instanced as. +* Font Instance Names:: The name of a font instance. +* Font Instance Size:: The size of a font instance. +* Font Instance Characteristics:: Display characteristics of font instances. +* Font Convenience Functions:: Convenience functions that automatically + instance and retrieve the properties + of a font specifier. + + +File: lispref.info, Node: Font Specifiers, Next: Font Instances, Up: Fonts + +Font Specifiers +--------------- + + - Function: font-specifier-p OBJECT + This predicate returns `t' if OBJECT is a font specifier, and + `nil' otherwise. + + +File: lispref.info, Node: Font Instances, Next: Font Instance Names, Prev: Font Specifiers, Up: Fonts + +Font Instances +-------------- + + - Function: font-instance-p OBJECT + This predicate returns `t' if OBJECT is a font instance, and `nil' + otherwise. + + - Function: make-font-instance NAME &optional DEVICE NOERROR + This function creates a new font-instance object of the specified + name. DEVICE specifies the device this object applies to and + defaults to the selected device. An error is signalled if the + font is unknown or cannot be allocated; however, if NOERROR is + non-`nil', `nil' is simply returned in this case. + + The returned object is a normal, first-class lisp object. The way + you "deallocate" the font is the way you deallocate any other lisp + object: you drop all pointers to it and allow it to be garbage + collected. When these objects are GCed, the underlying X data is + deallocated as well. + + +File: lispref.info, Node: Font Instance Names, Next: Font Instance Size, Prev: Font Instances, Up: Fonts + +Font Instance Names +------------------- + + - Function: list-fonts PATTERN &optional DEVICE + This function returns a list of font names matching the given + pattern. DEVICE specifies which device to search for names, and + defaults to the currently selected device. + + - Function: font-instance-name FONT-INSTANCE + This function returns the name used to allocate FONT-INSTANCE. + + - Function: font-instance-truename FONT-INSTANCE + This function returns the canonical name of the given font + instance. Font names are patterns which may match any number of + fonts, of which the first found is used. This returns an + unambiguous name for that font (but not necessarily its only + unambiguous name). + + +File: lispref.info, Node: Font Instance Size, Next: Font Instance Characteristics, Prev: Font Instance Names, Up: Fonts + +Font Instance Size +------------------ + + - Function: x-font-size FONT + This function returns the nominal size of the given font. This is + done by parsing its name, so it's likely to lose. X fonts can be + specified (by the user) in either pixels or 10ths of points, and + this returns the first one it finds, so you have to decide which + units the returned value is measured in yourself ... + + - Function: x-find-larger-font FONT &optional DEVICE + This function loads a new, slightly larger version of the given + font (or font name). Returns the font if it succeeds, `nil' + otherwise. If scalable fonts are available, this returns a font + which is 1 point larger. Otherwise, it returns the next larger + version of this font that is defined. + + - Function: x-find-smaller-font FONT &optional DEVICE + This function loads a new, slightly smaller version of the given + font (or font name). Returns the font if it succeeds, `nil' + otherwise. If scalable fonts are available, this returns a font + which is 1 point smaller. Otherwise, it returns the next smaller + version of this font that is defined. + + +File: lispref.info, Node: Font Instance Characteristics, Next: Font Convenience Functions, Prev: Font Instance Size, Up: Fonts + +Font Instance Characteristics +----------------------------- + + - Function: font-instance-properties FONT + This function returns the properties (an alist or `nil') of + FONT-INSTANCE. + + - Function: x-make-font-bold FONT &optional DEVICE + Given an X font specification, this attempts to make a "bold" font. + If it fails, it returns `nil'. + + - Function: x-make-font-unbold FONT &optional DEVICE + Given an X font specification, this attempts to make a non-bold + font. If it fails, it returns `nil'. + + - Function: x-make-font-italic FONT &optional DEVICE + Given an X font specification, this attempts to make an "italic" + font. If it fails, it returns `nil'. + + - Function: x-make-font-unitalic FONT &optional DEVICE + Given an X font specification, this attempts to make a non-italic + font. If it fails, it returns `nil'. + + - Function: x-make-font-bold-italic FONT &optional DEVICE + Given an X font specification, this attempts to make a + "bold-italic" font. If it fails, it returns `nil'. + + +File: lispref.info, Node: Font Convenience Functions, Prev: Font Instance Characteristics, Up: Fonts + +Font Convenience Functions +-------------------------- + + - Function: font-name FONT &optional DOMAIN + This function returns the name of the FONT in the specified + DOMAIN, if any. FONT should be a font specifier object and DOMAIN + is normally a window and defaults to the selected window if + omitted. This is equivalent to using `specifier-instance' and + applying `font-instance-name' to the result. + + - Function: font-truename FONT &optional DOMAIN + This function returns the truename of the FONT in the specified + DOMAIN, if any. FONT should be a font specifier object and DOMAIN + is normally a window and defaults to the selected window if + omitted. This is equivalent to using `specifier-instance' and + applying `font-instance-truename' to the result. + + - Function: font-properties FONT &optional DOMAIN + This function returns the properties of the FONT in the specified + DOMAIN, if any. FONT should be a font specifier object and DOMAIN + is normally a window and defaults to the selected window if + omitted. This is equivalent to using `specifier-instance' and + applying `font-instance-properties' to the result. + + +File: lispref.info, Node: Colors, Prev: Fonts, Up: Faces and Window-System Objects + +Colors +====== + +* Menu: + +* Color Specifiers:: Specifying how a color will appear. +* Color Instances:: What a color specifier gets instanced as. +* Color Instance Properties:: Properties of color instances. +* Color Convenience Functions:: Convenience functions that automatically + instance and retrieve the properties + of a color specifier. + + +File: lispref.info, Node: Color Specifiers, Next: Color Instances, Up: Colors + +Color Specifiers +---------------- + + - Function: color-specifier-p OBJECT + This function returns non-`nil' if OBJECT is a color specifier. + + +File: lispref.info, Node: Color Instances, Next: Color Instance Properties, Prev: Color Specifiers, Up: Colors + +Color Instances +--------------- + + A "color-instance object" is an object describing the way a color +specifier is instanced in a particular domain. Functions such as +`face-background-instance' return a color-instance object. For example, + + (face-background-instance 'default (next-window)) + => # + + The color-instance object returned describes the way the background +color of the `default' face is displayed in the next window after the +selected one. + + - Function: color-instance-p OBJECT + This function returns non-`nil' if OBJECT is a color-instance. + + +File: lispref.info, Node: Color Instance Properties, Next: Color Convenience Functions, Prev: Color Instances, Up: Colors + +Color Instance Properties +------------------------- + + - Function: color-instance-name COLOR-INSTANCE + This function returns the name used to allocate COLOR-INSTANCE. + + - Function: color-instance-rgb-components COLOR-INSTANCE + This function returns a three element list containing the red, + green, and blue color components of COLOR-INSTANCE. + + (color-instance-rgb-components + (face-background-instance 'default (next-window))) + => (65535 58596 46517) + + +File: lispref.info, Node: Color Convenience Functions, Prev: Color Instance Properties, Up: Colors + +Color Convenience Functions +--------------------------- + + - Function: color-name COLOR &optional DOMAIN + This function returns the name of the COLOR in the specified + DOMAIN, if any. COLOR should be a color specifier object and + DOMAIN is normally a window and defaults to the selected window if + omitted. This is equivalent to using `specifier-instance' and + applying `color-instance-name' to the result. + + - Function: color-rgb-components COLOR &optional DOMAIN + This function returns the RGB components of the COLOR in the + specified DOMAIN, if any. COLOR should be a color specifier + object and DOMAIN is normally a window and defaults to the + selected window if omitted. This is equivalent to using + `specifier-instance' and applying `color-instance-rgb-components' + to the result. + + (color-rgb-components (face-background 'default (next-window))) + => (65535 58596 46517) + + +File: lispref.info, Node: Glyphs, Next: Annotations, Prev: Faces and Window-System Objects, Up: Top + +Glyphs +****** + + A "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 ("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 (`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 "image specifier" object contained within +the glyph. The separation between an image specifier object and a +glyph object is made because the glyph includes other properties than +just the actual image: e.g. the face it is displayed in (for text +images), the alignment of the image (when it is in a buffer), etc. + + - Function: glyphp OBJECT + This function returns `t' if OBJECT is a glyph. + +* Menu: + +* Glyph Functions:: Functions for working with glyphs. +* Images:: Graphical images displayed in a frame. +* Glyph Types:: Each glyph has a particular type. +* Mouse Pointer:: Controlling the mouse pointer. +* Redisplay Glyphs:: Glyphs controlling various redisplay functions. +* Subwindows:: Inserting an externally-controlled subwindow + into a buffer. + + +File: lispref.info, Node: Glyph Functions, Next: Images, Up: Glyphs + +Glyph Functions +=============== + +* Menu: + +* Creating Glyphs:: Creating new glyphs. +* Glyph Properties:: Accessing and modifying a glyph's properties. +* Glyph Convenience Functions:: + Convenience functions for accessing particular + properties of a glyph. +* Glyph Dimensions:: Determining the height, width, etc. of a glyph. + + +File: lispref.info, Node: Creating Glyphs, Next: Glyph Properties, Up: Glyph Functions + +Creating Glyphs +--------------- + + - Function: make-glyph &optional SPEC-LIST TYPE + This function creates a new glyph object of type TYPE. + + SPEC-LIST is used to initialize the glyph's image. It is + typically an image instantiator (a string or a vector; *Note 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 + `canonicalize-spec-list'. *Note Specifiers::, for more + information about specifiers. + + TYPE specifies the type of the glyph, which specifies in which + contexts the glyph can be used, and controls the allowable image + types into which the glyph's image can be instantiated. 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'. *Note Glyph Types::. + + - Function: make-glyph-internal &optional TYPE + This function creates a new, uninitialized glyph of type TYPE. + + - Function: make-pointer-glyph &optional SPEC-LIST + This function is equivalent to calling `make-glyph' with a TYPE of + `pointer'. + + - Function: make-icon-glyph &optional SPEC-LIST + This function is equivalent to calling `make-glyph' with a TYPE of + `icon'. + + +File: lispref.info, Node: Glyph Properties, Next: Glyph Convenience Functions, Prev: Creating Glyphs, Up: Glyph Functions + +Glyph Properties +---------------- + + Each glyph has a list of properties, which control all of the +aspects of the glyph's appearance. The following symbols have +predefined meanings: + +`image' + The image used to display the glyph. + +`baseline' + Percent above baseline that glyph is to be displayed. Only for + glyphs displayed inside of a buffer. + +`contrib-p' + Whether the glyph contributes to the height of the line it's on. + Only for glyphs displayed inside of a buffer. + +`face' + Face of this glyph (*not* a specifier). + + - Function: set-glyph-property GLYPH PROPERTY VALUE &optional LOCALE + TAG-SET HOW-TO-ADD + This function changes a property of a GLYPH. + + For built-in properties, the actual value of the property is a + specifier and you cannot change this; but you can change the + specifications within the specifier, and that is what this + function will do. For user-defined properties, you can use this + function to either change the actual value of the property or, if + this value is a specifier, change the specifications within it. + + If PROPERTY is a built-in property, the specifications to be added + to this property can be supplied in many different ways: + + * If VALUE is a simple instantiator (e.g. a string naming a + pixmap filename) or a list of instantiators, then the + instantiator(s) will be added as a specification of the + property for the given LOCALE (which defaults to `global' if + omitted). + + * If VALUE is a list of specifications (each of which is a cons + of a locale and a list of instantiators), then LOCALE must be + `nil' (it does not make sense to explicitly specify a locale + in this case), and specifications will be added as given. + + * If VALUE is a specifier (as would be returned by + `glyph-property' if no LOCALE argument is given), then some + or all of the specifications in the specifier will be added + to the property. In this case, the function is really + equivalent to `copy-specifier' and LOCALE has the same + semantics (if it is a particular locale, the specification + for the locale will be copied; if a locale type, + specifications for all locales of that type will be copied; + if `nil' or `all', then all specifications will be copied). + + HOW-TO-ADD should be either `nil' or one of the symbols `prepend', + `append', `remove-tag-set-prepend', `remove-tag-set-append', + `remove-locale', `remove-locale-type', or `remove-all'. See + `copy-specifier' and `add-spec-to-specifier' for a description of + what each of these means. Most of the time, you do not need to + worry about this argument; the default behavior usually is fine. + + In general, it is OK to pass an instance object (e.g. as returned + by `glyph-property-instance') as an instantiator in place of an + actual instantiator. In such a case, the instantiator used to + create that instance object will be used (for example, if you set + a font-instance object as the value of the `font' property, then + the font name used to create that object will be used instead). + If some cases, however, doing this conversion does not make sense, + and this will be noted in the documentation for particular types + of instance objects. + + If PROPERTY is not a built-in property, then this function will + simply set its value if LOCALE is `nil'. However, if LOCALE is + given, then this function will attempt to add VALUE as the + instantiator for the given LOCALE, using `add-spec-to-specifier'. + If the value of the property is not a specifier, it will + automatically be converted into a `generic' specifier. + + - Function: glyph-property GLYPH PROPERTY &optional LOCALE + This function returns GLYPH's value of the given PROPERTY. + + If LOCALE is omitted, the GLYPH's actual value for PROPERTY will + be returned. For built-in properties, this will be a specifier + object of a type appropriate to the property (e.g. a font or color + specifier). For other properties, this could be anything. + + If LOCALE is supplied, then instead of returning the actual value, + the specification(s) for the given locale or locale type will be + returned. This will only work if the actual value of PROPERTY is + a specifier (this will always be the case for built-in properties, + but may or may not apply to user-defined properties). If the + actual value of PROPERTY is not a specifier, this value will + simply be returned regardless of LOCALE. + + The return value will be a list of instantiators (e.g. vectors + specifying pixmap data), or a list of specifications, each of + which is a cons of a locale and a list of instantiators. + Specifically, if LOCALE is a particular locale (a buffer, window, + frame, device, or `global'), a list of instantiators for that + locale will be returned. Otherwise, if LOCALE is a locale type + (one of the symbols `buffer', `window', `frame', or `device'), the + specifications for all locales of that type will be returned. + Finally, if LOCALE is `all', the specifications for all locales of + all types will be returned. + + The specifications in a specifier determine what the value of + PROPERTY will be in a particular "domain" or set of circumstances, + which is typically a particular Emacs window along with the buffer + it contains and the frame and device it lies within. The value is + derived from the instantiator associated with the most specific + locale (in the order buffer, window, frame, device, and `global') + that matches the domain in question. In other words, given a + domain (i.e. an Emacs window, usually), the specifier for PROPERTY + will first be searched for a specification whose locale is the + buffer contained within that window; then for a specification + whose locale is the window itself; then for a specification whose + locale is the frame that the window is contained within; etc. The + first instantiator that is valid for the domain (usually this + means that the instantiator is recognized by the device [i.e. the + X server or TTY device] that the domain is on). The function + `glyph-property-instance' actually does all this, and is used to + determine how to display the glyph. + + - Function: glyph-property-instance GLYPH PROPERTY &optional DOMAIN + DEFAULT NO-FALLBACK + This function returns the instance of GLYPH's PROPERTY in the + specified DOMAIN. + + Under most circumstances, DOMAIN will be a particular window, and + the returned instance describes how the specified property + actually is displayed for that window and the particular buffer in + it. Note that this may not be the same as how the property + appears when the buffer is displayed in a different window or + frame, or how the property appears in the same window if you + switch to another buffer in that window; and in those cases, the + returned instance would be different. + + The returned instance is an image-instance object, and you can + query it using the appropriate image instance functions. For + example, you could use `image-instance-depth' to find out the + depth (number of color planes) of a pixmap displayed in a + particular window. The results might be different from the + results you would get for another window (perhaps the user + specified a different image for the frame that window is on; or + perhaps the same image was specified but the window is on a + different X server, and that X server has different color + capabilities from this one). + + DOMAIN defaults to the selected window if omitted. + + DOMAIN can be a frame or device, instead of a window. The value + returned for such a domain is used in special circumstances when a + more specific domain does not apply; for example, a frame value + might be used for coloring a toolbar, which is conceptually + attached to a frame rather than a particular window. The value is + also useful in determining what the value would be for a + particular window within the frame or device, if it is not + overridden by a more specific specification. + + If PROPERTY does not name a built-in property, its value will + simply be returned unless it is a specifier object, in which case + it will be instanced using `specifier-instance'. + + Optional arguments DEFAULT and NO-FALLBACK are the same as in + `specifier-instance'. *Note Specifiers::. + + - Function: remove-glyph-property GLYPH PROPERTY &optional LOCALE + TAG-SET EXACT-P + This function removes a property from a glyph. For built-in + properties, this is analogous to `remove-specifier'. *Note + remove-specifier-p: Specifiers, for the meaning of the LOCALE, + TAG-SET, and EXACT-P arguments. + + +File: lispref.info, Node: Glyph Convenience Functions, Next: Glyph Dimensions, Prev: Glyph Properties, Up: Glyph Functions + +Glyph Convenience Functions +--------------------------- + + The following functions are provided for working with specific +properties of a glyph. Note that these are exactly like calling the +general functions described above and passing in the appropriate value +for PROPERTY. + + Remember that if you want to determine the "value" of a specific +glyph property, you probably want to use the `*-instance' functions. +For example, to determine whether a glyph contributes to its line +height, use `glyph-contrib-p-instance', not `glyph-contrib-p'. (The +latter will return a boolean specifier or a list of specifications, and +you probably aren't concerned with these.) + + - Function: glyph-image GLYPH &optional LOCALE + This function is equivalent to calling `glyph-property' with a + property of `image'. The return value will be an image specifier + if LOCALE is `nil' or omitted; otherwise, it will be a + specification or list of specifications. + + - Function: set-glyph-image GLYPH SPEC &optional LOCALE TAG-SET + HOW-TO-ADD + This function is equivalent to calling `set-glyph-property' with a + property of `image'. + + - Function: glyph-image-instance GLYPH &optional DOMAIN DEFAULT + NO-FALLBACK + This function returns the instance of GLYPH's image in the given + DOMAIN, and is equivalent to calling `glyph-property-instance' + with a property of `image'. The return value will be an image + instance. + + Normally DOMAIN will be a window or `nil' (meaning the selected + window), and an instance object describing how the image appears + in that particular window and buffer will be returned. + + - Function: glyph-contrib-p GLYPH &optional LOCALE + This function is equivalent to calling `glyph-property' with a + property of `contrib-p'. The return value will be a boolean + specifier if LOCALE is `nil' or omitted; otherwise, it will be a + specification or list of specifications. + + - Function: set-glyph-contrib-p GLYPH SPEC &optional LOCALE TAG-SET + HOW-TO-ADD + This function is equivalent to calling `set-glyph-property' with a + property of `contrib-p'. + + - Function: glyph-contrib-p-instance GLYPH &optional DOMAIN DEFAULT + NO-FALLBACK + This function returns whether the glyph contributes to its line + height in the given DOMAIN, and is equivalent to calling + `glyph-property-instance' with a property of `contrib-p'. The + return value will be either `nil' or `t'. (Normally DOMAIN will be + a window or `nil', meaning the selected window.) + + - Function: glyph-baseline GLYPH &optional LOCALE + This function is equivalent to calling `glyph-property' with a + property of `baseline'. The return value will be a specifier if + LOCALE is `nil' or omitted; otherwise, it will be a specification + or list of specifications. + + - Function: set-glyph-baseline GLYPH SPEC &optional LOCALE TAG-SET + HOW-TO-ADD + This function is equivalent to calling `set-glyph-property' with a + property of `baseline'. + + - Function: glyph-baseline-instance GLYPH &optional DOMAIN DEFAULT + NO-FALLBACK + This function returns the instance of GLYPH's baseline value in + the given DOMAIN, and is equivalent to calling + `glyph-property-instance' with a property of `baseline'. The + return value will be an integer or `nil'. + + Normally DOMAIN will be a window or `nil' (meaning the selected + window), and an instance object describing the baseline value + appears in that particular window and buffer will be returned. + + - Function: glyph-face GLYPH + This function returns the face of GLYPH. (Remember, this is not a + specifier, but a simple property.) + + - Function: set-glyph-face GLYPH FACE + This function changes the face of GLYPH to FACE. + + +File: lispref.info, Node: Glyph Dimensions, Prev: Glyph Convenience Functions, Up: Glyph Functions + +Glyph Dimensions +---------------- + + - Function: glyph-width GLYPH &optional WINDOW + This function returns the width of GLYPH on WINDOW. This may not + be exact as it does not take into account all of the context that + redisplay will. + + - Function: glyph-ascent GLYPH &optional WINDOW + This function returns the ascent value of GLYPH on WINDOW. This + may not be exact as it does not take into account all of the + context that redisplay will. + + - Function: glyph-descent GLYPH &optional WINDOW + This function returns the descent value of GLYPH on WINDOW. This + may not be exact as it does not take into account all of the + context that redisplay will. + + - Function: glyph-height GLYPH &optional WINDOW + This function returns the height of GLYPH on WINDOW. (This is + equivalent to the sum of the ascent and descent values.) This may + not be exact as it does not take into account all of the context + that redisplay will. + + +File: lispref.info, Node: Images, Next: Glyph Types, Prev: Glyph Functions, Up: Glyphs + +Images +====== + +* Menu: + +* Image Specifiers:: Specifying how an image will appear. +* Image Instantiator Conversion:: + Conversion is applied to image instantiators + at the time they are added to an + image specifier or at the time they + are passed to `make-image-instance'. +* Image Instances:: What an image specifier gets instanced as. + diff --git a/info/lispref.info-36 b/info/lispref.info-36 new file mode 100644 index 0000000..d389b0b --- /dev/null +++ b/info/lispref.info-36 @@ -0,0 +1,1121 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Image Specifiers, Next: Image Instantiator Conversion, Up: Images + +Image Specifiers +---------------- + + An image specifier is used to describe the actual image of a glyph. +It works like other specifiers (*note Specifiers::.), in that it +contains a number of specifications describing how the image should +appear in a variety of circumstances. These specifications are called +"image instantiators". When XEmacs wants to display the image, it +instantiates the image into an "image instance". Image instances are +their own primitive object type (similar to font instances and color +instances), describing how the image appears in a particular domain. +(On the other hand, image instantiators, which are just descriptions of +how the image should appear, are represented using strings or vectors.) + + - Function: image-specifier-p OBJECT + This function returns non-`nil' if OBJECT is an image specifier. + Usually, an image specifier results from calling `glyph-image' on + a glyph. + + - Function: make-image-specifier SPEC-LIST + This function creates a new image specifier object and initializes + it according to SPEC-LIST. It is unlikely that you will ever want + to do this, but this function is provided for completeness and for + experimentation purposes. *Note Specifiers::. + + 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.). + + *Note Image Instances::, 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. The "format" field should be a symbol, 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, + similar to a modeline format string; not currently implemented.) + +`xbm' + (An X bitmap; only if X 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'. + 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.) + +`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. Can be instanced as `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.) + +`jpeg' + (A JPEG-format image; only if JPEG support was compiled into this + XEmacs. Can be instanced as `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.) + +`png' + (A PNG/GIF24 image; only if PNG support was compiled into this + XEmacs. Can be instanced as `color-pixmap'.) + +`tiff' + (A TIFF-format image; only if TIFF support was compiled into this + XEmacs. Not currently implemented.) + +`cursor-font' + (One of the standard cursor-font names, such as `watch' or + `right_ptr' under X. Under X, this is, more specifically, any of + the standard cursor names from appendix B of the Xlib manual [also + known as the file `'] minus the `XC_' prefix. On + other window systems, the valid names will be specific to the type + of window system. Can only be instanced as `pointer'.) + +`font' + (A glyph from a font; i.e. the name of a font, and glyph index + into it of the form `FONT fontname index [[mask-font] mask-index]'. + Only if X support was compiled into this XEmacs. Currently can + only be instanced as `pointer', although this should probably be + fixed.) + +`subwindow' + (An embedded X window; not currently implemented.) + +`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.) + + 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 format `nothing'.) + +`: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', and `autodetect'.) + +`:foreground' +`:background' + (For `xbm', `xface', `cursor-font', 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.) + + 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' 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 +specifier (which may be well before 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). + + - Function: valid-image-instantiator-format-p FORMAT + This function returns non-`nil' if FORMAT is a valid image + instantiator format. Note that the return value for many formats + listed above depends on whether XEmacs was compiled with support + for that format. + + - Function: image-instantiator-format-list + This function return a list of valid image-instantiator formats. + + - Variable: xpm-color-symbols + This variable holds definitions of logical color-names used when + reading XPM files. Elements of this list should be of the form + `(COLOR-NAME FORM-TO-EVALUATE)'. The COLOR-NAME should be a + string, which is the name of the color to define; the + FORM-TO-EVALUATE should evaluate to a color specifier object, or a + string to be passed to `make-color-instance' (*note Colors::.). If + a loaded XPM file references a symbolic color called COLOR-NAME, + it will display as the computed color instead. + + The default value of this variable defines the logical color names + `"foreground"' and `"background"' to be the colors of the + `default' face. + + - Variable: x-bitmap-file-path + A list of the directories in which X bitmap files may be found. + If nil, this is initialized from the `"*bitmapFilePath"' resource. + This is used by the `make-image-instance' function (however, note + that if the environment variable `XBMLANGPATH' is set, it is + consulted first). + + +File: lispref.info, Node: Image Instantiator Conversion, Next: Image Instances, Prev: Image Specifiers, Up: Images + +Image Instantiator Conversion +----------------------------- + + - Function: set-console-type-image-conversion-list CONSOLE-TYPE LIST + This function sets the image-conversion-list for consoles of the + given CONSOLE-TYPE. The image-conversion-list specifies how image + instantiators that are strings should be interpreted. Each + element of the list should be a list of two elements (a regular + expression string and a vector) or a list of three elements (the + preceding two plus an integer index into the vector). The string + is converted to the vector associated with the first matching + regular expression. If a vector index is specified, the string + itself is substituted into that position in the vector. + + Note: The conversion above is applied when the image instantiator + is added to an image specifier, not when the specifier is actually + instantiated. Therefore, changing the image-conversion-list only + affects newly-added instantiators. Existing instantiators in + glyphs and image specifiers will not be affected. + + - Function: console-type-image-conversion-list CONSOLE-TYPE + This function returns the image-conversion-list for consoles of + the given CONSOLE-TYPE. + + +File: lispref.info, Node: Image Instances, Prev: Image Instantiator Conversion, Up: Images + +Image Instances +--------------- + + Image-instance objects encapsulate the way a particular image +(pixmap, etc.) is displayed on a particular device. + + In most circumstances, you do not need to directly create image +instances; use a glyph instead. However, it may occasionally be useful +to explicitly create image instances, if you want more control over the +instantiation process. + + - Function: image-instance-p OBJECT + This function returns non-`nil' if OBJECT is an image instance. + +* Menu: + +* Image Instance Types:: Each image instances has a particular type. +* Image Instance Functions:: Functions for working with image instances. + + +File: lispref.info, Node: Image Instance Types, Next: Image Instance Functions, Up: Image Instances + +Image Instance Types +.................... + + Image instances come in a number of different types. The type of an +image instance specifies the nature of the image: Whether it is a text +string, a mono pixmap, a color pixmap, etc. + + The valid image instance types are + +`nothing' + Nothing is displayed. + +`text' + Displayed as text. The foreground and background colors and the + font of the text are specified independent of the pixmap. + Typically these attributes will come from the face of the + surrounding text, unless a face is specified for the glyph in + which the image appears. + +`mono-pixmap' + Displayed as a mono pixmap (a pixmap with only two colors where the + foreground and background can be specified independent of the + pixmap; typically the pixmap assumes the foreground and background + colors of the text around it, unless a face is specified for the + glyph in which the image appears). + +`color-pixmap' + Displayed as a color pixmap. + +`pointer' + Used as the mouse pointer for a window. + +`subwindow' + A child window that is treated as an image. This allows (e.g.) + another program to be responsible for drawing into the window. + Not currently implemented. + + - Function: valid-image-instance-type-p TYPE + This function returns non-`nil' if TYPE is a valid image instance + type. + + - Function: image-instance-type-list + This function returns a list of the valid image instance types. + + - Function: image-instance-type IMAGE-INSTANCE + This function returns the type of the given image instance. The + return value will be one of `nothing', `text', `mono-pixmap', + `color-pixmap', `pointer', or `subwindow'. + + - Function: text-image-instance-p OBJECT + This function returns non-`nil' if OBJECT is an image instance of + type `text'. + + - Function: mono-pixmap-image-instance-p OBJECT + This function returns non-`nil' if OBJECT is an image instance of + type `mono-pixmap'. + + - Function: color-pixmap-image-instance-p OBJECT + This function returns non-`nil' if OBJECT is an image instance of + type `color-pixmap'. + + - Function: pointer-image-instance-p OBJECT + This function returns non-`nil' if OBJECT is an image instance of + type `pointer'. + + - Function: subwindow-image-instance-p OBJECT + This function returns non-`nil' if OBJECT is an image instance of + type `subwindow'. + + - Function: nothing-image-instance-p OBJECT + This function returns non-`nil' if OBJECT is an image instance of + type `nothing'. + + +File: lispref.info, Node: Image Instance Functions, Prev: Image Instance Types, Up: Image Instances + +Image Instance Functions +........................ + + - Function: make-image-instance DATA &optional DEVICE DEST-TYPES + NO-ERROR + This function creates a new image-instance object. + + DATA is an image instantiator, which describes the image (*note + Image Specifiers::.). + + DEST-TYPES should be a list of allowed image instance types that + can be generated. 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. + + 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. + + - Function: colorize-image-instance IMAGE-INSTANCE FOREGROUND + BACKGROUND + This function makes the image instance be displayed in the given + colors. Image instances come in two varieties: bitmaps, which are + 1 bit deep which are rendered in the prevailing foreground and + background colors; and pixmaps, which are of arbitrary depth + (including 1) and which have the colors explicitly specified. + This function converts a bitmap to a pixmap. If the image + instance was a pixmap already, nothing is done (and `nil' is + returned). Otherwise `t' is returned. + + - Function: image-instance-name IMAGE-INSTANCE + This function returns the name of the given image instance. + + - Function: image-instance-string IMAGE-INSTANCE + This function returns the string of the given image instance. + This will only be non-`nil' for text image instances. + + - Function: image-instance-file-name IMAGE-INSTANCE + This function returns the file name from which IMAGE-INSTANCE was + read, if known. + + - Function: image-instance-mask-file-name IMAGE-INSTANCE + This function returns the file name from which IMAGE-INSTANCE's + mask was read, if known. + + - Function: image-instance-depth IMAGE-INSTANCE + This function returns the depth of the image instance. This is 0 + for a mono pixmap, or a positive integer for a color pixmap. + + - Function: image-instance-height IMAGE-INSTANCE + This function returns the height of the image instance, in pixels. + + - Function: image-instance-width IMAGE-INSTANCE + This function returns the width of the image instance, in pixels. + + - Function: image-instance-hotspot-x IMAGE-INSTANCE + This function returns the X coordinate of the image instance's + hotspot, if known. This is a point relative to the origin of the + pixmap. When an image is used as a mouse pointer, the hotspot is + the point on the image that sits over the location that the + pointer points to. This is, for example, the tip of the arrow or + the center of the crosshairs. + + This will always be `nil' for a non-pointer image instance. + + - Function: image-instance-hotspot-y IMAGE-INSTANCE + This function returns the Y coordinate of the image instance's + hotspot, if known. + + - Function: image-instance-foreground IMAGE-INSTANCE + This function returns the foreground color of IMAGE-INSTANCE, if + applicable. This will be a color instance or `nil'. (It will only + be non-`nil' for colorized mono pixmaps and for pointers.) + + - Function: image-instance-background IMAGE-INSTANCE + This function returns the background color of IMAGE-INSTANCE, if + applicable. This will be a color instance or `nil'. (It will only + be non-`nil' for colorized mono pixmaps and for pointers.) + + +File: lispref.info, Node: Glyph Types, Next: Mouse Pointer, Prev: Images, Up: Glyphs + +Glyph Types +=========== + + Each glyph has a particular type, which controls how the glyph's +image is generated. Each glyph type has a corresponding list of +allowable image instance types that can be generated. When you call +`glyph-image-instance' to retrieve the image instance of a glyph, +XEmacs does the equivalent of calling `make-image-instance' and passing +in DEST-TYPES the list of allowable image instance types for the +glyph's type. + + * `buffer' glyphs can be used as the begin-glyph or end-glyph of an + extent, in the modeline, and in the toolbar. Their image can be + instantiated as `nothing', `mono-pixmap', `color-pixmap', `text', + and `subwindow'. + + * `pointer' glyphs can be used to specify the mouse pointer. Their + image can be instantiated as `pointer'. + + * `icon' glyphs can be used to specify the icon used when a frame is + iconified. Their image can be instantiated as `mono-pixmap' and + `color-pixmap'. + + - Function: glyph-type GLYPH + This function returns the type of the given glyph. The return + value will be a symbol, one of `buffer', `pointer', or `icon'. + + - Function: valid-glyph-type-p GLYPH-TYPE + Given a GLYPH-TYPE, this function returns non-`nil' if it is valid. + + - Function: glyph-type-list + This function returns a list of valid glyph types. + + - Function: buffer-glyph-p OBJECT + This function returns non-`nil' if OBJECT is a glyph of type + `buffer'. + + - Function: icon-glyph-p OBJECT + This function returns non-`nil' if OBJECT is a glyph of type + `icon'. + + - Function: pointer-glyph-p OBJECT + This function returns non-`nil' if OBJECT is a glyph of type + `pointer'. + + +File: lispref.info, Node: Mouse Pointer, Next: Redisplay Glyphs, Prev: Glyph Types, Up: Glyphs + +Mouse Pointer +============= + + The shape of the mouse pointer when over a particular section of a +frame is controlled using various glyph variables. Since the image of +a glyph is a specifier, it can be controlled on a per-buffer, +per-frame, per-window, or per-device basis. + + You should use `set-glyph-image' to set the following variables, +*not* `setq'. + + - Glyph: text-pointer-glyph + This variable specifies the shape of the mouse pointer when over + text. + + - Glyph: nontext-pointer-glyph + This variable specifies the shape of the mouse pointer when over a + buffer, but not over text. If unspecified in a particular domain, + `text-pointer-glyph' is used. + + - Glyph: modeline-pointer-glyph + This variable specifies the shape of the mouse pointer when over + the modeline. If unspecified in a particular domain, + `nontext-pointer-glyph' is used. + + - Glyph: selection-pointer-glyph + This variable specifies the shape of the mouse pointer when over a + selectable text region. If unspecified in a particular domain, + `text-pointer-glyph' is used. + + - Glyph: gc-pointer-glyph + This variable specifies the shape of the mouse pointer when a + garbage collection is in progress. If the selected window is on a + window system and this glyph specifies a value (i.e. a pointer + image instance) in the domain of the selected window, the pointer + will be changed as specified during garbage collection. + Otherwise, a message will be printed in the echo area, as + controlled by `gc-message'. + + - Glyph: busy-pointer-glyph + This variable specifies the shape of the mouse pointer when XEmacs + is busy. If unspecified in a particular domain, the pointer is + not changed when XEmacs is busy. + + - Glyph: menubar-pointer-glyph + This variable specifies the shape of the mouse pointer when over + the menubar. If unspecified in a particular domain, the + window-system-provided default pointer is used. + + - Glyph: scrollbar-pointer-glyph + This variable specifies the shape of the mouse pointer when over a + scrollbar. If unspecified in a particular domain, the + window-system-provided default pointer is used. + + - Glyph: toolbar-pointer-glyph + This variable specifies the shape of the mouse pointer when over a + toolbar. If unspecified in a particular domain, + `nontext-pointer-glyph' is used. + + Internally, these variables are implemented in +`default-mouse-motion-handler', and thus only take effect when the +mouse moves. That function calls `set-frame-pointer', which sets the +current mouse pointer for a frame. + + - Function: set-frame-pointer FRAME IMAGE-INSTANCE + This function sets the mouse pointer of FRAME to the given pointer + image instance. You should not call this function directly. (If + you do, the pointer will change again the next time the mouse + moves.) + + +File: lispref.info, Node: Redisplay Glyphs, Next: Subwindows, Prev: Mouse Pointer, Up: Glyphs + +Redisplay Glyphs +================ + + - Glyph: truncation-glyph + This variable specifies what is displayed at the end of truncated + lines. + + - Glyph: continuation-glyph + This variable specifies what is displayed at the end of wrapped + lines. + + - Glyph: octal-escape-glyph + This variable specifies what to prefix character codes displayed + in octal with. + + - Glyph: hscroll-glyph + This variable specifies what to display at the beginning of + horizontally scrolled lines. + + - Glyph: invisible-text-glyph + This variable specifies what to use to indicate the presence of + invisible text. This is the glyph that is displayed when an + ellipsis is called for, according to `selective-display-ellipses' + or `buffer-invisibility-spec'). Normally this is three dots + ("..."). + + - Glyph: control-arrow-glyph + This variable specifies what to use as an arrow for control + characters. + + +File: lispref.info, Node: Subwindows, Prev: Redisplay Glyphs, Up: Glyphs + +Subwindows +========== + + Subwindows are not currently implemented. + + - Function: subwindowp OBJECT + This function returns non-`nil' if OBJECT is a subwindow. + + +File: lispref.info, Node: Annotations, Next: Display, Prev: Glyphs, Up: Top + +Annotations +*********** + + An "annotation" is a pixmap or string that is not part of a buffer's +text but is displayed next to a particular location in a buffer. +Annotations can be displayed intermixed with text, in any whitespace at +the beginning or end of a line, or in a special area at the left or +right side of the frame called a "margin", whose size is controllable. +Annotations are implemented using extents (*note Extents::.); but you +can work with annotations without knowing how extents work. + +* Menu: + +* Annotation Basics:: Introduction to annotations. +* Annotation Primitives:: Creating and deleting annotations. +* Annotation Properties:: Retrieving and changing the characteristics + of an annotation. +* Margin Primitives:: Controlling the size of the margins. +* Locating Annotations:: Looking for annotations in a buffer. +* Annotation Hooks:: Hooks called at certain times during an + annotation's lifetime. + + +File: lispref.info, Node: Annotation Basics, Next: Annotation Primitives, Up: Annotations + +Annotation Basics +================= + + Marginal annotations are notes associated with a particular location +in a buffer. They may be displayed in a margin created on the +left-hand or right-hand side of the frame, in any whitespace at the +beginning or end of a line, or inside of the text itself. Every +annotation may have an associated action to be performed when the +annotation is selected. The term "annotation" is used to refer to an +individual note. The term "margin" is generically used to refer to the +whitespace before the first character on a line or after the last +character on a line. + + Each annotation has the following characteristics: +GLYPH + This is a glyph object and is used as the displayed representation + of the annotation. + +DOWN-GLYPH + If given, this glyph is used as the displayed representation of + the annotation when the mouse is pressed down over the annotation. + +FACE + The face with which to display the glyph. + +SIDE + Which side of the text (left or right) the annotation is displayed + at. + +ACTION + If non-`nil', this field must contain a function capable of being + the first argument to `funcall'. This function is normally + evaluated with a single argument, the value of the DATA field, + each time the annotation is selected. However, if the WITH-EVENT + parameter to `make-annotation' is non-`nil', the function is + called with two arguments. The first argument is the same as + before, and the second argument is the event (a button-up event, + usually) that activated the annotation. + +DATA + Not used internally. This field can contain any E-Lisp object. + It is passed as the first argument to ACTION described above. + +MENU + A menu displayed when the right mouse button is pressed over the + annotation. + + The margin is divided into "outside" and "inside". The outside +margin is space on the left or right side of the frame which normal text +cannot be displayed in. The inside margin is that space between the +leftmost or rightmost point at which text can be displayed and where the +first or last character actually is. + + There are four different "layout types" which affect the exact +location an annotation appears. + +`outside-margin' + The annotation is placed in the outside margin area. as close as + possible to the edge of the frame. If the outside margin is not + wide enough for an annotation to fit, it is not displayed. + +`inside-margin' + The annotation is placed in the inside margin area, as close as + possible to the edge of the frame. If the inside margin is not + wide enough for the annotation to fit, it will be displayed using + any available outside margin space if and only if the specifier + `use-left-overflow' or `use-right-overflow' (depending on which + side the annotation appears in) is non-`nil'. + +`whitespace' + The annotation is placed in the inside margin area, as close as + possible to the first or last non-whitespace character on a line. + If the inside margin is not wide enough for the annotation to fit, + it will be displayed if and only if the specifier + `use-left-overflow' or `use-right-overflow' (depending on which + side the annotation appears in) is non-`nil'. + +`text' + The annotation is placed at the position it is inserted. It will + create enough space for itself inside of the text area. It does + not take up a place in the logical buffer, only in the display of + the buffer. + + The current layout policy is that all `whitespace' annotations are +displayed first. Next, all `inside-margin' annotations are displayed +using any remaining space. Finally as many `outside-margin' +annotations are displayed as possible. The `text' annotations will +always display as they create their own space to display in. + + +File: lispref.info, Node: Annotation Primitives, Next: Annotation Properties, Prev: Annotation Basics, Up: Annotations + +Annotation Primitives +===================== + + - Function: make-annotation GLYPH &optional POSITION LAYOUT BUFFER + WITH-EVENT D-GLYPH RIGHTP + This function creates a marginal annotation at position POS in + BUFFER. The annotation is displayed using GLYPH, which should be + a glyph object or a string, and is positioned using layout policy + LAYOUT. If POS is `nil', point is used. If LAYOUT is `nil', + `whitespace' is used. If BUFFER is `nil', the current buffer is + used. + + If WITH-EVENT is non-`nil', then when an annotation is activated, + the triggering event is passed as the second arg to the annotation + function. If D-GLYPH is non-`nil' then it is used as the glyph + that will be displayed when button1 is down. If RIGHTP is + non-`nil' then the glyph will be displayed on the right side of + the buffer instead of the left. + + The newly created annotation is returned. + + - Function: delete-annotation ANNOTATION + This function removes ANNOTATION from its buffer. This does not + modify the buffer text. + + - Function: annotationp ANNOTATION + This function returns `t' if ANNOTATION is an annotation, `nil' + otherwise. + + +File: lispref.info, Node: Annotation Properties, Next: Margin Primitives, Prev: Annotation Primitives, Up: Annotations + +Annotation Properties +===================== + + - Function: annotation-glyph ANNOTATION + This function returns the glyph object used to display ANNOTATION. + + - Function: set-annotation-glyph ANNOTATION GLYPH &optional LAYOUT SIDE + This function sets the glyph of ANNOTATION to GLYPH, which should + be a glyph object. If LAYOUT is non-`nil', set the layout policy + of ANNOTATION to LAYOUT. If SIDE is `left' or `right', change the + side of the buffer at which the annotation is displayed to the + given side. The new value of `annotation-glyph' is returned. + + - Function: annotation-down-glyph ANNOTATION + This function returns the glyph used to display ANNOTATION when + the left mouse button is depressed on the annotation. + + - Function: set-annotation-down-glyph ANNOTATION GLYPH + This function returns the glyph used to display ANNOTATION when + the left mouse button is depressed on the annotation to GLYPH, + which should be a glyph object. + + - Function: annotation-face ANNOTATION + This function returns the face associated with ANNOTATION. + + - Function: set-annotation-face ANNOTATION FACE + This function sets the face associated with ANNOTATION to FACE. + + - Function: annotation-layout ANNOTATION + This function returns the layout policy of ANNOTATION. + + - Function: set-annotation-layout ANNOTATION LAYOUT + This function sets the layout policy of ANNOTATION to LAYOUT. + + - Function: annotation-side ANNOTATION + This function returns the side of the buffer that ANNOTATION is + displayed on. Return value is a symbol, either `left' or `right'. + + - Function: annotation-data ANNOTATION + This function returns the data associated with ANNOTATION. + + - Function: set-annotation-data ANNOTATION DATA + This function sets the data field of ANNOTATION to DATA. DATA is + returned. + + - Function: annotation-action ANNOTATION + This function returns the action associated with ANNOTATION. + + - Function: set-annotation-action ANNOTATION ACTION + This function sets the action field of ANNOTATION to ACTION. + ACTION is returned.. + + - Function: annotation-menu ANNOTATION + This function returns the menu associated with ANNOTATION. + + - Function: set-annotation-menu ANNOTATION MENU + This function sets the menu associated with ANNOTATION to MENU. + This menu will be displayed when the right mouse button is pressed + over the annotation. + + - Function: annotation-visible ANNOTATION + This function returns `t' if there is enough available space to + display ANNOTATION, `nil' otherwise. + + - Function: annotation-width ANNOTATION + This function returns the width of ANNOTATION in pixels. + + - Function: hide-annotation ANNOTATION + This function removes ANNOTATION's glyph, making it invisible. + + - Function: reveal-annotation ANNOTATION + This function restores ANNOTATION's glyph, making it visible. + + +File: lispref.info, Node: Locating Annotations, Next: Annotation Hooks, Prev: Margin Primitives, Up: Annotations + +Locating Annotations +==================== + + - Function: annotations-in-region START END BUFFER + This function returns a list of all annotations in BUFFER which + are between START and END inclusively. + + - Function: annotations-at &optional POSITION BUFFER + This function returns a list of all annotations at POSITION in + BUFFER. If POSITION is `nil' point is used. If BUFFER is `nil' + the current buffer is used. + + - Function: annotation-list &optional BUFFER + This function returns a list of all annotations in BUFFER. If + BUFFER is `nil', the current buffer is used. + + - Function: all-annotations + This function returns a list of all annotations in all buffers in + existence. + + +File: lispref.info, Node: Margin Primitives, Next: Locating Annotations, Prev: Annotation Properties, Up: Annotations + +Margin Primitives +================= + + The margin widths are controllable on a buffer-local, window-local, +frame-local, device-local, or device-type-local basis through the use +of specifiers. *Note Specifiers::. + + - Specifier: left-margin-width + This is a specifier variable controlling the width of the left + outside margin, in characters. Use `set-specifier' to change its + value. + + - Specifier: right-margin-width + This is a specifier variable controlling the width of the right + outside margin, in characters. Use `set-specifier' to change its + value. + + - Specifier: use-left-overflow + If non-`nil', use the left outside margin as extra whitespace when + displaying `whitespace' and `inside-margin' annotations. Defaults + to `nil'. This is a specifier variable; use `set-specifier' to + change its value. + + - Specifier: use-right-overflow + If non-`nil', use the right outside margin as extra whitespace when + displaying `whitespace' and `inside-margin' annotations. Defaults + to `nil'. This is a specifier variable; use `set-specifier' to + change its value. + + - Function: window-left-margin-pixel-width &optional WINDOW + This function returns the width in pixels of the left outside + margin of WINDOW. If WINDOW is `nil', the selected window is + assumed. + + - Function: window-right-margin-pixel-width &optional WINDOW + This function returns the width in pixels of the right outside + margin of WINDOW. If WINDOW is `nil', the selected window is + assumed. + + The margin colors are controlled by the faces `left-margin' and +`right-margin'. These can be set using the X resources +`Emacs.left-margin.background' and `Emacs.left-margin.foreground'; +likewise for the right margin. + + +File: lispref.info, Node: Annotation Hooks, Prev: Locating Annotations, Up: Annotations + +Annotation Hooks +================ + + The following three hooks are provided for use with the marginal +annotations: + +`before-delete-annotation-hook' + This hook is called immediately before an annotation is destroyed. + It is passed a single argument, the annotation being destroyed. + +`after-delete-annotation-hook' + This normal hook is called immediately after an annotation is + destroyed. + +`make-annotation-hook' + This hook is called immediately after an annotation is created. + It is passed a single argument, the newly created annotation. + + +File: lispref.info, Node: Display, Next: Hash Tables, Prev: Annotations, Up: Top + +Emacs Display +************* + + This chapter describes a number of other features related to the +display that XEmacs presents to the user. + +* Menu: + +* Refresh Screen:: Clearing the screen and redrawing everything on it. +* Truncation:: Folding or wrapping long text lines. +* The Echo Area:: Where messages are displayed. +* Warnings:: Display of Warnings. +* Invisible Text:: Hiding part of the buffer text. +* Selective Display:: Hiding part of the buffer text (the old way). +* Overlay Arrow:: Display of an arrow to indicate position. +* Temporary Displays:: Displays that go away automatically. +* Blinking:: How XEmacs shows the matching open parenthesis. +* Usual Display:: The usual conventions for displaying nonprinting chars. +* Display Tables:: How to specify other conventions. +* Beeping:: Audible signal to the user. + + +File: lispref.info, Node: Refresh Screen, Next: Truncation, Up: Display + +Refreshing the Screen +===================== + + The function `redraw-frame' redisplays the entire contents of a +given frame. *Note Frames::. + + - Function: redraw-frame FRAME + This function clears and redisplays frame FRAME. + + Even more powerful is `redraw-display': + + - Command: redraw-display &optional DEVICE + This function redraws all frames on DEVICE marked as having their + image garbled. DEVICE defaults to the selected device. If DEVICE + is `t', all devices will have their frames checked. + + Processing user input takes absolute priority over redisplay. If you +call these functions when input is available, they do nothing +immediately, but a full redisplay does happen eventually--after all the +input has been processed. + + Normally, suspending and resuming XEmacs also refreshes the screen. +Some terminal emulators record separate contents for display-oriented +programs such as XEmacs and for ordinary sequential display. If you are +using such a terminal, you might want to inhibit the redisplay on +resumption. *Note Suspending XEmacs::. + + - Variable: no-redraw-on-reenter + This variable controls whether XEmacs redraws the entire screen + after it has been suspended and resumed. Non-`nil' means yes, + `nil' means no. + + The above functions do not actually cause the display to be updated; +rather, they clear out the internal display records that XEmacs +maintains, so that the next time the display is updated it will be +redrawn from scratch. Normally this occurs the next time that +`next-event' or `sit-for' is called; however, a display update will not +occur if there is input pending. *Note Command Loop::. + + - Function: force-cursor-redisplay + This function causes an immediate update of the cursor on the + selected frame. (This function does not exist in FSF Emacs.) + + +File: lispref.info, Node: Truncation, Next: The Echo Area, Prev: Refresh Screen, Up: Display + +Truncation +========== + + When a line of text extends beyond the right edge of a window, the +line can either be truncated or continued on the next line. When a line +is truncated, this is normally shown with a `\' in the rightmost column +of the window on X displays, and with a `$' on TTY devices. When a +line is continued or "wrapped" onto the next line, this is shown with a +curved arrow in the rightmost column of the window (or with a `\' on +TTY devices). The additional screen lines used to display a long text +line are called "continuation" lines. + + Normally, whenever line truncation is in effect for a particular +window, a horizontal scrollbar is displayed in that window if the +device supports scrollbars. *Note Scrollbars::. + + Note that continuation is different from filling; continuation +happens on the screen only, not in the buffer contents, and it breaks a +line precisely at the right margin, not at a word boundary. *Note +Filling::. + + - User Option: truncate-lines + This buffer-local variable controls how XEmacs displays lines that + extend beyond the right edge of the window. If it is non-`nil', + then XEmacs does not display continuation lines; rather each line + of text occupies exactly one screen line, and a backslash appears + at the edge of any line that extends to or beyond the edge of the + window. The default is `nil'. + + If the variable `truncate-partial-width-windows' is non-`nil', + then truncation is always used for side-by-side windows (within one + frame) regardless of the value of `truncate-lines'. + + - User Option: default-truncate-lines + This variable is the default value for `truncate-lines', for + buffers that do not have local values for it. + + - User Option: truncate-partial-width-windows + This variable controls display of lines that extend beyond the + right edge of the window, in side-by-side windows (*note Splitting + Windows::.). If it is non-`nil', these lines are truncated; + otherwise, `truncate-lines' says what to do with them. + + The backslash and curved arrow used to indicate truncated or +continued lines are only defaults, and can be changed. These images +are actually glyphs (*note Glyphs::.). XEmacs provides a great deal of +flexibility in how glyphs can be controlled. (This differs from FSF +Emacs, which uses display tables to control these images.) + + For details, *Note Redisplay Glyphs::. + diff --git a/info/lispref.info-37 b/info/lispref.info-37 new file mode 100644 index 0000000..81d60dd --- /dev/null +++ b/info/lispref.info-37 @@ -0,0 +1,1282 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: The Echo Area, Next: Warnings, Prev: Truncation, Up: Display + +The Echo Area +============= + + The "echo area" is used for displaying messages made with the +`message' primitive, and for echoing keystrokes. It is not the same as +the minibuffer, despite the fact that the minibuffer appears (when +active) in the same place on the screen as the echo area. The `XEmacs +Reference Manual' specifies the rules for resolving conflicts between +the echo area and the minibuffer for use of that screen space (*note +The Minibuffer: (emacs)Minibuffer.). Error messages appear in the echo +area; see *Note Errors::. + + You can write output in the echo area by using the Lisp printing +functions with `t' as the stream (*note Output Functions::.), or as +follows: + + - Function: message STRING &rest ARGUMENTS + This function displays a one-line message in the echo area. The + argument STRING is similar to a C language `printf' control + string. See `format' in *Note String Conversion::, for the details + on the conversion specifications. `message' returns the + constructed string. + + In batch mode, `message' prints the message text on the standard + error stream, followed by a newline. + + If STRING is `nil', `message' clears the echo area. If the + minibuffer is active, this brings the minibuffer contents back onto + the screen immediately. + + (message "Minibuffer depth is %d." + (minibuffer-depth)) + -| Minibuffer depth is 0. + => "Minibuffer depth is 0." + + ---------- Echo Area ---------- + Minibuffer depth is 0. + ---------- Echo Area ---------- + + In addition to only displaying a message, XEmacs allows you to +"label" your messages, giving you fine-grained control of their +display. Message label is a symbol denoting the message type. Some +standard labels are: + + * `message'--default label used by the `message' function; + + * `error'--default label used for reporting errors; + + * `progress'--progress indicators like `Converting... 45%' (not + logged by default); + + * `prompt'--prompt-like messages like `Isearch: foo' (not logged by + default); + + * `command'--helper command messages like `Mark set' (not logged by + default); + + * `no-log'--messages that should never be logged + + Several messages may be stacked in the echo area at once. Lisp +programs may access these messages, or remove them as appropriate, via +the message stack. + + - Function: display-message LABEL MESSAGE &optional FRAME STDOUT-P + This function displays MESSAGE (a string) labeled as LABEL, as + described above. + + The FRAME argument specifies the frame to whose minibuffer the + message should be printed. This is currently unimplemented. The + STDOUT-P argument is used internally. + + (display-message 'command "Mark set") + + - Function: lmessage LABEL STRING &rest ARGUMENTS + This function displays a message STRING with label LABEL. It is + similar to `message' in that it accepts a `printf'-like strings + and any number of arguments. + + ;; Display a command message. + (lmessage 'command "Comment column set to %d" comment-column) + + ;; Display a progress message. + (lmessage 'progress "Fontifying %s... (%d)" buffer percentage) + + ;; Display a message that should not be logged. + (lmessage 'no-log "Done") + + - Function: clear-message &optional LABEL FRAME STDOUT-P NO-RESTORE + This function remove any message with the given LABEL from the + message-stack, erasing it from the echo area if it's currently + displayed there. + + If a message remains at the head of the message-stack and + NO-RESTORE is `nil', it will be displayed. The string which + remains in the echo area will be returned, or `nil' if the + message-stack is now empty. If LABEL is nil, the entire + message-stack is cleared. + + ;; Show a message, wait for 2 seconds, and restore old minibuffer + ;; contents. + (message "A message") + -| A message + => "A Message" + (lmessage 'my-label "Newsflash! Newsflash!") + -| Newsflash! Newsflash! + => "Newsflash! Newsflash!" + (sit-for 2) + (clear-message 'my-label) + -| A message + => "A message" + + Unless you need the return value or you need to specify a label, + you should just use `(message nil)'. + + - Function: current-message &optional FRAME + This function returns the current message in the echo area, or + `nil'. The FRAME argument is currently unused. + + Some of the messages displayed in the echo area are also recorded in +the ` *Message-Log*' buffer. Exactly which messages will be recorded +can be tuned using the following variables. + + - User Option: log-message-max-size + This variable specifies the maximum size of the ` *Message-log*' + buffer. + + - Variable: log-message-ignore-labels + This variable specifies the labels whose messages will not be + logged. It should be a list of symbols. + + - Variable: log-message-ignore-regexps + This variable specifies the regular expressions matching messages + that will not be logged. It should be a list of regular + expressions. + + Normally, packages that generate messages that might need to be + ignored should label them with `progress', `prompt', or `no-log', + so they can be filtered by `log-message-ignore-labels'. + + - Variable: echo-keystrokes + This variable determines how much time should elapse before command + characters echo. Its value must be a number, which specifies the + number of seconds to wait before echoing. If the user types a + prefix key (such as `C-x') and then delays this many seconds + before continuing, the prefix key is echoed in the echo area. Any + subsequent characters in the same command will be echoed as well. + + If the value is zero, then command input is not echoed. + + - Variable: cursor-in-echo-area + This variable controls where the cursor appears when a message is + displayed in the echo area. If it is non-`nil', then the cursor + appears at the end of the message. Otherwise, the cursor appears + at point--not in the echo area at all. + + The value is normally `nil'; Lisp programs bind it to `t' for + brief periods of time. + + +File: lispref.info, Node: Warnings, Next: Invisible Text, Prev: The Echo Area, Up: Display + +Warnings +======== + + XEmacs contains a facility for unified display of various warnings. +Unlike errors, warnings are displayed in the situations when XEmacs +encounters a problem that is recoverable, but which should be fixed for +safe future operation. + + For example, warnings are printed by the startup code when it +encounters problems with X keysyms, when there is an error in `.emacs', +and in other problematic situations. Unlike messages, warnings are +displayed in a separate buffer, and include an explanatory message that +may span across several lines. Here is an example of how a warning is +displayed: + + (1) (initialization/error) An error has occurred while loading ~/.emacs: + + Symbol's value as variable is void: bogus-variable + + To ensure normal operation, you should investigate the cause of the error + in your initialization file and remove it. Use the `-debug-init' option + to XEmacs to view a complete error backtrace. + + Each warning has a "class" and a "priority level". The class is a +symbol describing what sort of warning this is, such as +`initialization', `resource' or `key-mapping'. + + The warning priority level specifies how important the warning is. +The recognized warning levels, in increased order of priority, are: +`debug', `info', `notice', `warning', `error', `critical', `alert' and +`emergency'. + + - Function: display-warning CLASS MESSAGE &optional LEVEL + This function displays a warning message MESSAGE (a string). + CLASS should be a warning class symbol, as described above, or a + list of such symbols. LEVEL describes the warning priority level. + If unspecified, it default to `warning'. + + (display-warning 'resource + "Bad resource specification encountered: + something like + + Emacs*foo: bar + + You should replace the * with a . in order to get proper behavior when + you use the specifier and/or `set-face-*' functions.") + + ---------- Warning buffer ---------- + (1) (resource/warning) Bad resource specification encountered: + something like + + Emacs*foo: bar + + You should replace the * with a . in order to get proper behavior when + you use the specifier and/or `set-face-*' functions. + ---------- Warning buffer ---------- + + - Function: lwarn CLASS LEVEL MESSAGE &rest ARGS + This function displays a formatted labeled warning message. As + above, CLASS should be the warning class symbol, or a list of such + symbols, and LEVEL should specify the warning priority level + (`warning' by default). + + Unlike in `display-warning', MESSAGE may be a formatted message, + which will be, together with the rest of the arguments, passed to + `format'. + + (lwarn 'message-log 'warning + "Error caught in `remove-message-hook': %s" + (error-message-string e)) + + - Variable: log-warning-minimum-level + This variable specifies the minimum level of warnings that should + be generated. Warnings with level lower than defined by this + variable are completely ignored, as if they never happened. + + - Variable: display-warning-minimum-level + This variable specifies the minimum level of warnings that should + be displayed. Unlike `log-warning-minimum-level', setting this + function does not suppress warnings entirely--they are still + generated in the `*Warnings*' buffer, only they are not displayed + by default. + + - Variable: log-warning-suppressed-classes + This variable specifies a list of classes that should not be + logged or displayed. If any of the class symbols associated with + a warning is the same as any of the symbols listed here, the + warning will be completely ignored, as it they never happened. + + - Variable: display-warning-suppressed-classes + This variable specifies a list of classes that should not be + logged or displayed. If any of the class symbols associated with + a warning is the same as any of the symbols listed here, the + warning will not be displayed. The warning will still logged in + the *Warnings* buffer (unless also contained in + `log-warning-suppressed-classes'), but the buffer will not be + automatically popped up. + + +File: lispref.info, Node: Invisible Text, Next: Selective Display, Prev: Warnings, Up: Display + +Invisible Text +============== + + You can make characters "invisible", so that they do not appear on +the screen, with the `invisible' property. This can be either a text +property or a property of an overlay. + + In the simplest case, any non-`nil' `invisible' property makes a +character invisible. This is the default case--if you don't alter the +default value of `buffer-invisibility-spec', this is how the +`invisibility' property works. This feature is much like selective +display (*note Selective Display::.), but more general and cleaner. + + More generally, you can use the variable `buffer-invisibility-spec' +to control which values of the `invisible' property make text +invisible. This permits you to classify the text into different subsets +in advance, by giving them different `invisible' values, and +subsequently make various subsets visible or invisible by changing the +value of `buffer-invisibility-spec'. + + Controlling visibility with `buffer-invisibility-spec' is especially +useful in a program to display the list of entries in a data base. It +permits the implementation of convenient filtering commands to view +just a part of the entries in the data base. Setting this variable is +very fast, much faster than scanning all the text in the buffer looking +for properties to change. + + - Variable: buffer-invisibility-spec + This variable specifies which kinds of `invisible' properties + actually make a character invisible. + + `t' + A character is invisible if its `invisible' property is + non-`nil'. This is the default. + + a list + Each element of the list makes certain characters invisible. + Ultimately, a character is invisible if any of the elements + of this list applies to it. The list can have two kinds of + elements: + + `ATOM' + A character is invisible if its `invisible' property + value is ATOM or if it is a list with ATOM as a member. + + `(ATOM . t)' + A character is invisible if its `invisible' property + value is ATOM or if it is a list with ATOM as a member. + Moreover, if this character is at the end of a line and + is followed by a visible newline, it displays an + ellipsis. + + Ordinarily, commands that operate on text or move point do not care +whether the text is invisible. However, the user-level line motion +commands explicitly ignore invisible newlines. + + +File: lispref.info, Node: Selective Display, Next: Overlay Arrow, Prev: Invisible Text, Up: Display + +Selective Display +================= + + "Selective display" is a pair of features that hide certain lines on +the screen. + + The first variant, explicit selective display, is designed for use in +a Lisp program. The program controls which lines are hidden by altering +the text. Outline mode has traditionally used this variant. It has +been partially replaced by the invisible text feature (*note Invisible +Text::.); there is a new version of Outline mode which uses that +instead. + + In the second variant, the choice of lines to hide is made +automatically based on indentation. This variant is designed to be a +user-level feature. + + The way you control explicit selective display is by replacing a +newline (control-j) with a carriage return (control-m). The text that +was formerly a line following that newline is now invisible. Strictly +speaking, it is temporarily no longer a line at all, since only newlines +can separate lines; it is now part of the previous line. + + Selective display does not directly affect editing commands. For +example, `C-f' (`forward-char') moves point unhesitatingly into +invisible text. However, the replacement of newline characters with +carriage return characters affects some editing commands. For example, +`next-line' skips invisible lines, since it searches only for newlines. +Modes that use selective display can also define commands that take +account of the newlines, or that make parts of the text visible or +invisible. + + When you write a selectively displayed buffer into a file, all the +control-m's are output as newlines. This means that when you next read +in the file, it looks OK, with nothing invisible. The selective display +effect is seen only within XEmacs. + + - Variable: selective-display + This buffer-local variable enables selective display. This means + that lines, or portions of lines, may be made invisible. + + * If the value of `selective-display' is `t', then any portion + of a line that follows a control-m is not displayed. + + * If the value of `selective-display' is a positive integer, + then lines that start with more than that many columns of + indentation are not displayed. + + When some portion of a buffer is invisible, the vertical movement + commands operate as if that portion did not exist, allowing a + single `next-line' command to skip any number of invisible lines. + However, character movement commands (such as `forward-char') do + not skip the invisible portion, and it is possible (if tricky) to + insert or delete text in an invisible portion. + + In the examples below, we show the *display appearance* of the + buffer `foo', which changes with the value of `selective-display'. + The *contents* of the buffer do not change. + + (setq selective-display nil) + => nil + + ---------- Buffer: foo ---------- + 1 on this column + 2on this column + 3n this column + 3n this column + 2on this column + 1 on this column + ---------- Buffer: foo ---------- + + (setq selective-display 2) + => 2 + + ---------- Buffer: foo ---------- + 1 on this column + 2on this column + 2on this column + 1 on this column + ---------- Buffer: foo ---------- + + - Variable: selective-display-ellipses + If this buffer-local variable is non-`nil', then XEmacs displays + `...' at the end of a line that is followed by invisible text. + This example is a continuation of the previous one. + + (setq selective-display-ellipses t) + => t + + ---------- Buffer: foo ---------- + 1 on this column + 2on this column ... + 2on this column + 1 on this column + ---------- Buffer: foo ---------- + + You can use a display table to substitute other text for the + ellipsis (`...'). *Note Display Tables::. + + +File: lispref.info, Node: Overlay Arrow, Next: Temporary Displays, Prev: Selective Display, Up: Display + +The Overlay Arrow +================= + + The "overlay arrow" is useful for directing the user's attention to +a particular line in a buffer. For example, in the modes used for +interface to debuggers, the overlay arrow indicates the line of code +about to be executed. + + - Variable: overlay-arrow-string + This variable holds the string to display to call attention to a + particular line, or `nil' if the arrow feature is not in use. + Despite its name, the value of this variable can be either a string + or a glyph (*note Glyphs::.). + + - Variable: overlay-arrow-position + This variable holds a marker that indicates where to display the + overlay arrow. It should point at the beginning of a line. The + arrow text appears at the beginning of that line, overlaying any + text that would otherwise appear. Since the arrow is usually + short, and the line usually begins with indentation, normally + nothing significant is overwritten. + + The overlay string is displayed only in the buffer that this marker + points into. Thus, only one buffer can have an overlay arrow at + any given time. + + You can do the same job by creating an extent with a `begin-glyph' +property. *Note Extent Properties::. + + +File: lispref.info, Node: Temporary Displays, Next: Blinking, Prev: Overlay Arrow, Up: Display + +Temporary Displays +================== + + Temporary displays are used by commands to put output into a buffer +and then present it to the user for perusal rather than for editing. +Many of the help commands use this feature. + + - Special Form: with-output-to-temp-buffer BUFFER-NAME FORMS... + This function executes FORMS while arranging to insert any output + they print into the buffer named BUFFER-NAME. The buffer is then + shown in some window for viewing, displayed but not selected. + + The string BUFFER-NAME specifies the temporary buffer, which need + not already exist. The argument must be a string, not a buffer. + The buffer is erased initially (with no questions asked), and it is + marked as unmodified after `with-output-to-temp-buffer' exits. + + `with-output-to-temp-buffer' binds `standard-output' to the + temporary buffer, then it evaluates the forms in FORMS. Output + using the Lisp output functions within FORMS goes by default to + that buffer (but screen display and messages in the echo area, + although they are "output" in the general sense of the word, are + not affected). *Note Output Functions::. + + The value of the last form in FORMS is returned. + + ---------- Buffer: foo ---------- + This is the contents of foo. + ---------- Buffer: foo ---------- + + (with-output-to-temp-buffer "foo" + (print 20) + (print standard-output)) + => # + + ---------- Buffer: foo ---------- + 20 + + # + + ---------- Buffer: foo ---------- + + - Variable: temp-buffer-show-function + If this variable is non-`nil', `with-output-to-temp-buffer' calls + it as a function to do the job of displaying a help buffer. The + function gets one argument, which is the buffer it should display. + + In Emacs versions 18 and earlier, this variable was called + `temp-buffer-show-hook'. + + - Function: momentary-string-display STRING POSITION &optional CHAR + MESSAGE + This function momentarily displays STRING in the current buffer at + POSITION. It has no effect on the undo list or on the buffer's + modification status. + + The momentary display remains until the next input event. If the + next input event is CHAR, `momentary-string-display' ignores it + and returns. Otherwise, that event remains buffered for + subsequent use as input. Thus, typing CHAR will simply remove the + string from the display, while typing (say) `C-f' will remove the + string from the display and later (presumably) move point forward. + The argument CHAR is a space by default. + + The return value of `momentary-string-display' is not meaningful. + + You can do the same job in a more general way by creating an extent + with a begin-glyph property. *Note Extent Properties::. + + If MESSAGE is non-`nil', it is displayed in the echo area while + STRING is displayed in the buffer. If it is `nil', a default + message says to type CHAR to continue. + + In this example, point is initially located at the beginning of the + second line: + + ---------- Buffer: foo ---------- + This is the contents of foo. + -!-Second line. + ---------- Buffer: foo ---------- + + (momentary-string-display + "**** Important Message! ****" + (point) ?\r + "Type RET when done reading") + => t + + ---------- Buffer: foo ---------- + This is the contents of foo. + **** Important Message! ****Second line. + ---------- Buffer: foo ---------- + + ---------- Echo Area ---------- + Type RET when done reading + ---------- Echo Area ---------- + + This function works by actually changing the text in the buffer. + As a result, if you later undo in this buffer, you will see the + message come and go. + + +File: lispref.info, Node: Blinking, Next: Usual Display, Prev: Temporary Displays, Up: Display + +Blinking Parentheses +==================== + + This section describes the mechanism by which XEmacs shows a matching +open parenthesis when the user inserts a close parenthesis. + + - Variable: blink-paren-function + The value of this variable should be a function (of no arguments) + to be called whenever a character with close parenthesis syntax is + inserted. The value of `blink-paren-function' may be `nil', in + which case nothing is done. + + *Please note:* This variable was named `blink-paren-hook' in + older Emacs versions, but since it is not called with the + standard convention for hooks, it was renamed to + `blink-paren-function' in version 19. + + - Variable: blink-matching-paren + If this variable is `nil', then `blink-matching-open' does nothing. + + - Variable: blink-matching-paren-distance + This variable specifies the maximum distance to scan for a matching + parenthesis before giving up. + + - Variable: blink-matching-paren-delay + This variable specifies the number of seconds for the cursor to + remain at the matching parenthesis. A fraction of a second often + gives good results, but the default is 1, which works on all + systems. + + - Function: blink-matching-open + This function is the default value of `blink-paren-function'. It + assumes that point follows a character with close parenthesis + syntax and moves the cursor momentarily to the matching opening + character. If that character is not already on the screen, it + displays the character's context in the echo area. To avoid long + delays, this function does not search farther than + `blink-matching-paren-distance' characters. + + Here is an example of calling this function explicitly. + + (defun interactive-blink-matching-open () + "Indicate momentarily the start of sexp before point." + (interactive) + + (let ((blink-matching-paren-distance + (buffer-size)) + (blink-matching-paren t)) + (blink-matching-open))) + + +File: lispref.info, Node: Usual Display, Next: Display Tables, Prev: Blinking, Up: Display + +Usual Display Conventions +========================= + + The usual display conventions define how to display each character +code. You can override these conventions by setting up a display table +(*note Display Tables::.). Here are the usual display conventions: + + * Character codes 32 through 126 map to glyph codes 32 through 126. + Normally this means they display as themselves. + + * Character code 9 is a horizontal tab. It displays as whitespace + up to a position determined by `tab-width'. + + * Character code 10 is a newline. + + * All other codes in the range 0 through 31, and code 127, display + in one of two ways according to the value of `ctl-arrow'. If it is + non-`nil', these codes map to sequences of two glyphs, where the + first glyph is the ASCII code for `^'. (A display table can + specify a glyph to use instead of `^'.) Otherwise, these codes map + just like the codes in the range 128 to 255. + + * Character codes 128 through 255 map to sequences of four glyphs, + where the first glyph is the ASCII code for `\', and the others are + digit characters representing the code in octal. (A display table + can specify a glyph to use instead of `\'.) + + The usual display conventions apply even when there is a display +table, for any character whose entry in the active display table is +`nil'. Thus, when you set up a display table, you need only specify +the characters for which you want unusual behavior. + + These variables affect the way certain characters are displayed on +the screen. Since they change the number of columns the characters +occupy, they also affect the indentation functions. + + - User Option: ctl-arrow + This buffer-local variable controls how control characters are + displayed. If it is non-`nil', they are displayed as a caret + followed by the character: `^A'. If it is `nil', they are + displayed as a backslash followed by three octal digits: `\001'. + + - Variable: default-ctl-arrow + The value of this variable is the default value for `ctl-arrow' in + buffers that do not override it. *Note Default Value::. + + - User Option: tab-width + The value of this variable is the spacing between tab stops used + for displaying tab characters in Emacs buffers. The default is 8. + Note that this feature is completely independent from the + user-settable tab stops used by the command `tab-to-tab-stop'. + *Note Indent Tabs::. + + +File: lispref.info, Node: Display Tables, Next: Beeping, Prev: Usual Display, Up: Display + +Display Tables +============== + + You can use the "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 ASCII +character set. + + The display table maps each character code into a sequence of +"runes", each rune being an image that takes up one character position +on the screen. You can also define how to display each rune on your +terminal, using the "rune table". + +* Menu: + +* Display Table Format:: What a display table consists of. +* Active Display Table:: How XEmacs selects a display table to use. +* Character Descriptors:: Format of an individual element of a + display table. + + +File: lispref.info, Node: Display Table Format, Next: Active Display Table, Up: Display Tables + +Display Table Format +-------------------- + + A display table is an array of 256 elements. (In FSF Emacs, a display +table is 262 elements. The six extra elements specify the truncation +and continuation glyphs, etc. This method is very kludgey, and in +XEmacs the variables `truncation-glyph', `continuation-glyph', etc. are +used. *Note Truncation::.) + + - Function: make-display-table + This creates and returns a display table. The table initially has + `nil' in all elements. + + The 256 elements correspond to character codes; the Nth element says +how to display the character code N. The value should be `nil', a +string, a glyph, or a vector of strings and glyphs (*note Character +Descriptors::.). If an element is `nil', it says to display that +character according to the usual display conventions (*note Usual +Display::.). + + If you use the display table to change the display of newline +characters, the whole buffer will be displayed as one long "line." + + For example, here is how to construct a display table that mimics the +effect of setting `ctl-arrow' to a non-`nil' value: + + (setq disptab (make-display-table)) + (let ((i 0)) + (while (< i 32) + (or (= i ?\t) (= i ?\n) + (aset disptab i (concat "^" (char-to-string (+ i 64))))) + (setq i (1+ i))) + (aset disptab 127 "^?")) + + +File: lispref.info, Node: Active Display Table, Next: Character Descriptors, Prev: Display Table Format, Up: Display Tables + +Active Display Table +-------------------- + + The active display table is controlled by the variable +`current-display-table'. This is a specifier, which means that you can +specify separate values for it in individual buffers, windows, frames, +and devices, as well as a global value. It also means that you cannot +set this variable using `setq'; use `set-specifier' instead. *Note +Specifiers::. (FSF Emacs uses `window-display-table', +`buffer-display-table', `standard-display-table', etc. to control the +display table. However, specifiers are a cleaner and more powerful way +of doing the same thing. FSF Emacs also uses a different format for +the contents of a display table, using additional indirection to a +"glyph table" and such. Note that "glyph" has a different meaning in +XEmacs.) + + Individual faces can also specify an overriding display table; this +is set using `set-face-display-table'. *Note Faces::. + + If no display table can be determined for a particular window, then +XEmacs uses the usual display conventions. *Note Usual Display::. + + +File: lispref.info, Node: Character Descriptors, Prev: Active Display Table, Up: Display Tables + +Character Descriptors +--------------------- + + Each element of the display-table vector describes how to display a +particular character and is called a "character descriptor". A +character descriptor can be: + +a string + Display this particular string wherever the character is to be + displayed. + +a glyph + Display this particular glyph wherever the character is to be + displayed. + +a vector + The vector may contain strings and/or glyphs. Display the + elements of the vector one after another wherever the character is + to be displayed. + +`nil' + Display according to the standard interpretation (*note Usual + Display::.). + + +File: lispref.info, Node: Beeping, Prev: Display Tables, Up: Display + +Beeping +======= + + You can make XEmacs ring a bell, play a sound, or blink the screen to +attract the user's attention. Be conservative about how often you do +this; frequent bells can become irritating. Also be careful not to use +beeping alone when signaling an error is appropriate. (*Note Errors::.) + + - Function: ding &optional DONT-TERMINATE SOUND DEVICE + This function beeps, or flashes the screen (see `visible-bell' + below). It also terminates any keyboard macro currently executing + unless DONT-TERMINATE is non-`nil'. If SOUND is specified, it + should be a symbol specifying which sound to make. This sound + will be played if `visible-bell' is `nil'. (This only works if + sound support was compiled into the executable and you are running + on the console of a Sun SparcStation, SGI, HP9000s700, or Linux + PC. Otherwise you just get a beep.) The optional third argument + specifies what device to make the sound on, and defaults to the + selected device. + + - Function: beep &optional DONT-TERMINATE SOUND DEVICE + This is a synonym for `ding'. + + - User Option: visible-bell + This variable determines whether XEmacs should flash the screen to + represent a bell. Non-`nil' means yes, `nil' means no. On TTY + devices, this is effective only if the Termcap entry for the + terminal type has the visible bell flag (`vb') set. + + - Variable: sound-alist + This variable holds an alist associating names with sounds. When + `beep' or `ding' is called with one of the name symbols, the + associated sound will be generated instead of the standard beep. + + Each element of `sound-alist' is a list describing a sound. The + first element of the list is the name of the sound being defined. + Subsequent elements of the list are alternating keyword/value + pairs: + + `sound' + A string of raw sound data, or the name of another sound to + play. The symbol `t' here means use the default X beep. + + `volume' + An integer from 0-100, defaulting to `bell-volume'. + + `pitch' + If using the default X beep, the pitch (Hz) to generate. + + `duration' + If using the default X beep, the duration (milliseconds). + + For compatibility, elements of `sound-alist' may also be: + + * `( sound-name . )' + + * `( sound-name )' + + You should probably add things to this list by calling the function + `load-sound-file'. + + Caveats: + + - 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. + + The following beep-types are used by XEmacs itself: + + `auto-save-error' + when an auto-save does not succeed + + `command-error' + when the XEmacs command loop catches an error + + `undefined-key' + when you type a key that is undefined + + `undefined-click' + when you use an undefined mouse-click combination + + `no-completion' + during completing-read + + `y-or-n-p' + when you type something other than 'y' or 'n' + + `yes-or-no-p' + when you type something other than 'yes' or 'no' + + `default' + used when nothing else is appropriate. + + Other lisp packages may use other beep types, but these are the + ones that the C kernel of XEmacs uses. + + - User Option: bell-volume + This variable specifies the default volume for sounds, from 0 to + 100. + + - Command: load-default-sounds + This function loads and installs some sound files as beep-types. + + - Command: load-sound-file FILENAME SOUND-NAME &optional VOLUME + This function reads in an audio file and adds it to `sound-alist'. + The sound file must be in the Sun/NeXT U-LAW format. SOUND-NAME + should be a symbol, specifying the name of the sound. If VOLUME + is specified, the sound will be played at that volume; otherwise, + the value of BELL-VOLUME will be used. + + - Function: play-sound SOUND &optional VOLUME DEVICE + This function plays sound SOUND, which should be a symbol + mentioned in `sound-alist'. If VOLUME is specified, it overrides + the value (if any) specified in `sound-alist'. DEVICE specifies + the device to play the sound on, and defaults to the selected + device. + + - Command: play-sound-file FILE &optional VOLUME DEVICE + This function plays the named sound file at volume VOLUME, which + defaults to `bell-volume'. DEVICE specifies the device to play + the sound on, and defaults to the selected device. + + +File: lispref.info, Node: Hash Tables, Next: Range Tables, Prev: Display, Up: Top + +Hash Tables +*********** + + - Function: hash-table-p OBJECT + This function returns `t' if OBJECT is a hash table, else `nil'. + +* Menu: + +* Introduction to Hash Tables:: Hash tables are fast data structures for + implementing simple tables (i.e. finite + mappings from keys to values). +* Working With Hash Tables:: Hash table functions. +* Weak Hash Tables:: Hash tables with special garbage-collection + behavior. + + +File: lispref.info, Node: Introduction to Hash Tables, Next: Working With Hash Tables, Up: Hash Tables + +Introduction to Hash Tables +=========================== + + A "hash table" is a data structure that provides mappings from +arbitrary Lisp objects called "keys" to other arbitrary Lisp objects +called "values". A key/value pair is sometimes called an "entry" in +the hash table. There are many ways other than hash tables of +implementing the same sort of mapping, e.g. association lists (*note +Association Lists::.) and property lists (*note Property Lists::.), but +hash tables provide much faster lookup when there are many entries in +the mapping. Hash tables are an implementation of the abstract data +type "dictionary", also known as "associative array". + + Internally, hash tables are hashed using the "linear probing" hash +table implementation method. This method hashes each key to a +particular spot in the hash table, and then scans forward sequentially +until a blank entry is found. To look up a key, hash to the appropriate +spot, then search forward for the key until either a key is found or a +blank entry stops the search. This method is used in preference to +double hashing because of changes in recent hardware. The penalty for +non-sequential access to memory has been increasing, and this +compensates for the problem of clustering that linear probing entails. + + When hash tables are created, the user may (but is not required to) +specify initial properties that influence performance. + + Use the `:size' parameter to specify the number of entries that are +likely to be stored in the hash table, to avoid the overhead of resizing +the table. But if the pre-allocated space for the entries is never +used, it is simply wasted and makes XEmacs slower. Excess unused hash +table entries exact a small continuous performance penalty, since they +must be scanned at every garbage collection. If the number of entries +in the hash table is unknown, simply avoid using the `:size' keyword. + + Use the `:rehash-size' and `:rehash-threshold' keywords to adjust +the algorithm for deciding when to rehash the hash table. For +temporary hash tables that are going to be very heavily used, use a +small rehash threshold, for example, 0.4 and a large rehash size, for +example 2.0. For permanent hash tables that will be infrequently used, +specify a large rehash threshold, for example 0.8. + + Hash tables can also be created by the lisp reader using structure +syntax, for example: + #s(hash-table size 20 data (foo 1 bar 2)) + + The structure syntax accepts the same keywords as `make-hash-table' +(without the `:' character), as well as the additional keyword `data', +which specifies the initial hash table contents. + + - Function: make-hash-table &key `test' `size' `rehash-size' + `rehash-threshold' `weakness' + This function returns a new empty hash table object. + + 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. + + Keyword `:weakness' can be `nil' (default), `t', `key' or `value'. + + A weak hash table is one whose pointers do not count as GC + referents: for any key-value pair in the hash table, if the only + remaining pointer to either the key or the value is in a weak hash + table, then the pair will be removed from the hash table, and the + key and value collected. A non-weak hash table (or any other + pointer) would prevent the object from being collected. + + A key-weak hash table is similar to a fully-weak hash table except + that a key-value pair will be removed only if the key remains + unmarked outside of weak hash tables. The pair will remain in the + hash table if the key is pointed to by something other than a weak + hash table, even if the value is not. + + A 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 + remains 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. + + - Function: copy-hash-table HASH-TABLE + This function returns a new hash table which contains the same + keys and values as HASH-TABLE. The keys and values will not + themselves be copied. + + - Function: hash-table-count HASH-TABLE + This function returns the number of entries in HASH-TABLE. + + - Function: hash-table-test HASH-TABLE + This function returns the test function of HASH-TABLE. This can + be one of `eq', `eql' or `equal'. + + - Function: hash-table-size HASH-TABLE + This function returns the current number of slots in HASH-TABLE, + whether occupied or not. + + - Function: hash-table-rehash-size HASH-TABLE + This function returns the current rehash size of HASH-TABLE. This + is a float greater than 1.0; the factor by which HASH-TABLE is + enlarged when the rehash threshold is exceeded. + + - Function: hash-table-rehash-threshold HASH-TABLE + This function returns the current rehash threshold of HASH-TABLE. + This is a float between 0.0 and 1.0; the maximum "load factor" of + HASH-TABLE, beyond which the HASH-TABLE is enlarged by rehashing. + + - Function: hash-table-weakness HASH-TABLE + This function returns the weakness of HASH-TABLE. This can be one + of `nil', `t', `key' or `value'. + + +File: lispref.info, Node: Working With Hash Tables, Next: Weak Hash Tables, Prev: Introduction to Hash Tables, Up: Hash Tables + +Working With Hash Tables +======================== + + - Function: puthash KEY VALUE HASH-TABLE + This function hashes KEY to VALUE in HASH-TABLE. + + - Function: gethash KEY HASH-TABLE &optional DEFAULT + This function finds the hash value for KEY in HASH-TABLE. If + there is no entry for KEY in HASH-TABLE, DEFAULT is returned + (which in turn defaults to `nil'). + + - Function: remhash KEY HASH-TABLE + This function removes the entry for KEY from HASH-TABLE. Does + nothing if there is no entry for KEY in HASH-TABLE. + + - Function: clrhash HASH-TABLE + This function removes all entries from HASH-TABLE, leaving it + empty. + + - Function: maphash FUNCTION HASH-TABLE + This function maps FUNCTION over entries in HASH-TABLE, calling it + with two args, each key and value in the hash table. + + FUNCTION may not modify HASH-TABLE, with the one exception that + FUNCTION may remhash or puthash the entry currently being + processed by FUNCTION. + + +File: lispref.info, Node: Weak Hash Tables, Prev: Working With Hash Tables, Up: Hash Tables + +Weak Hash Tables +================ + + A "weak hash table" is a special variety of hash table whose +elements do not count as GC referents. For any key-value pair in such a +hash table, if either the key or value (or in some cases, if one +particular one of the two) has no references to it outside of weak hash +tables (and similar structures such as weak lists), the pair will be +removed from the table, and the key and value collected. A non-weak +hash table (or any other pointer) would prevent the objects from being +collected. + + Weak hash tables are useful for keeping track of information in a +non-obtrusive way, for example to implement caching. If the cache +contains objects such as buffers, markers, image instances, etc. that +will eventually disappear and get garbage-collected, using a weak hash +table ensures that these objects are collected normally rather than +remaining around forever, long past their actual period of use. +(Otherwise, you'd have to explicitly map over the hash table every so +often and remove unnecessary elements.) + + There are three types of weak hash tables: + +fully weak hash tables + In these hash tables, a pair disappears if either the key or the + value is unreferenced outside of the table. + +key-weak hash tables + In these hash tables, a pair disappears if the key is unreferenced + outside of the table, regardless of how the value is referenced. + +value-weak hash tables + In these hash tables, a pair disappears if the value is + unreferenced outside of the table, regardless of how the key is + referenced. + + Also see *Note Weak Lists::. + + Weak hash tables are created by specifying the `:weakness' keyword to +`make-hash-table'. + + +File: lispref.info, Node: Range Tables, Next: Databases, Prev: Hash Tables, Up: Top + +Range Tables +************ + + A range table is a table that efficiently associated values with +ranges of integers. + + Note that range tables have a read syntax, like this: + + #s(range-table data ((-3 2) foo (5 20) bar)) + + This maps integers in the range (-3, 2) to `foo' and integers in the +range (5, 20) to `bar'. + + - Function: range-table-p OBJECT + Return non-`nil' if OBJECT is a range table. + +* Menu: + +* Introduction to Range Tables:: Range tables efficiently map ranges of + integers to values. +* Working With Range Tables:: Range table functions. + + +File: lispref.info, Node: Introduction to Range Tables, Next: Working With Range Tables, Up: Range Tables + +Introduction to Range Tables +============================ + + - Function: make-range-table + Make a new, empty range table. + + - Function: copy-range-table OLD-TABLE + Make a new range table which contains the same values for the same + ranges as the given table. The values will not themselves be + copied. + + +File: lispref.info, Node: Working With Range Tables, Prev: Introduction to Range Tables, Up: Range Tables + +Working With Range Tables +========================= + + - Function: get-range-table POS TABLE &optional DEFAULT + This function finds value for position POS in TABLE. If there is + no corresponding value, return DEFAULT (defaults to `nil'). + + - Function: put-range-table START END VAL TABLE + This function sets the value for range (START, END) to be VAL in + TABLE. + + - Function: remove-range-table START END TABLE + This function removes the value for range (START, END) in TABLE. + + - Function: clear-range-table TABLE + This function flushes TABLE. + + - Function: map-range-table FUNCTION TABLE + This function maps FUNCTION over entries in TABLE, calling it with + three args, the beginning and end of the range and the + corresponding value. + + +File: lispref.info, Node: Databases, Next: Processes, Prev: Range Tables, Up: Top + +Databases +********* + + - Function: databasep OBJECT + This function returns non-`nil' if OBJECT is a database. + +* Menu: + +* Connecting to a Database:: +* Working With a Database:: +* Other Database Functions:: + + +File: lispref.info, Node: Connecting to a Database, Next: Working With a Database, Up: Databases + +Connecting to a Database +======================== + + - Function: open-database FILE &optional TYPE SUBTYPE ACCESS MODE + This function opens database FILE, using database method TYPE and + SUBTYPE, with access rights ACCESS and permissions MODE. ACCESS + can be any combination of `r' `w' and `+', for read, write, and + creation flags. + + TYPE can have the value `'dbm' or `'berkeley_db' to select the + type of database file to use. (Note: XEmacs may not support both + of these types.) + + For a TYPE of `'dbm', there are no subtypes, so SUBTYPE should by + `nil'. + + For a TYPE of `'berkeley_db', the following subtypes are + available: `'hash', `'btree', and `'recno'. See the manpages for + the Berkeley DB functions to more information about these types. + + - Function: close-database OBJ + This function closes database OBJ. + + - Function: database-live-p OBJ + This function returns `t' iff OBJ is an active database, else + `nil'. + diff --git a/info/lispref.info-38 b/info/lispref.info-38 new file mode 100644 index 0000000..2a2a68e --- /dev/null +++ b/info/lispref.info-38 @@ -0,0 +1,1188 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Working With a Database, Next: Other Database Functions, Prev: Connecting to a Database, Up: Databases + +Working With a Database +======================= + + - Function: get-database KEY DBASE &optional DEFAULT + This function finds the value for KEY in DATABASE. If there is no + corresponding value, DEFAULT is returned (`nil' if DEFAULT is + omitted). + + - Function: map-database FUNCTION DBASE + This function maps FUNCTION over entries in DATABASE, calling it + with two args, each key and value in the database. + + - Function: put-database KEY VAL DBASE &optional REPLACE + This function stores KEY and VAL in DATABASE. If optional fourth + arg REPLACE is non-`nil', replace any existing entry in the + database. + + - Function: remove-database KEY DBASE + This function removes KEY from DATABASE. + + +File: lispref.info, Node: Other Database Functions, Prev: Working With a Database, Up: Databases + +Other Database Functions +======================== + + - Function: database-file-name OBJ + This function returns the filename associated with the database + OBJ. + + - Function: database-last-error &optional OBJ + This function returns the last error associated with database OBJ. + + - Function: database-subtype OBJ + This function returns the subtype of database OBJ, if any. + + - Function: database-type OBJ + This function returns the type of database OBJ. + + +File: lispref.info, Node: Processes, Next: System Interface, Prev: Databases, Up: Top + +Processes +********* + + In the terminology of operating systems, a "process" is a space in +which a program can execute. XEmacs runs in a process. XEmacs Lisp +programs can invoke other programs in processes of their own. These are +called "subprocesses" or "child processes" of the XEmacs process, which +is their "parent process". + + A subprocess of XEmacs may be "synchronous" or "asynchronous", +depending on how it is created. When you create a synchronous +subprocess, the Lisp program waits for the subprocess to terminate +before continuing execution. When you create an asynchronous +subprocess, it can run in parallel with the Lisp program. This kind of +subprocess is represented within XEmacs by a Lisp object which is also +called a "process". Lisp programs can use this object to communicate +with the subprocess or to control it. For example, you can send +signals, obtain status information, receive output from the process, or +send input to it. + + - Function: processp OBJECT + This function returns `t' if OBJECT is a process, `nil' otherwise. + +* Menu: + +* Subprocess Creation:: Functions that start subprocesses. +* Synchronous Processes:: Details of using synchronous subprocesses. +* MS-DOS Subprocesses:: On MS-DOS, you must indicate text vs binary + for data sent to and from a subprocess. +* Asynchronous Processes:: Starting up an asynchronous subprocess. +* Deleting Processes:: Eliminating an asynchronous subprocess. +* Process Information:: Accessing run-status and other attributes. +* Input to Processes:: Sending input to an asynchronous subprocess. +* Signals to Processes:: Stopping, continuing or interrupting + an asynchronous subprocess. +* Output from Processes:: Collecting output from an asynchronous subprocess. +* Sentinels:: Sentinels run when process run-status changes. +* Process Window Size:: Changing the logical window size of a process. +* Transaction Queues:: Transaction-based communication with subprocesses. +* Network:: Opening network connections. + + +File: lispref.info, Node: Subprocess Creation, Next: Synchronous Processes, Up: Processes + +Functions that Create Subprocesses +================================== + + There are three functions that create a new subprocess in which to +run a program. One of them, `start-process', creates an asynchronous +process and returns a process object (*note Asynchronous Processes::.). +The other two, `call-process' and `call-process-region', create a +synchronous process and do not return a process object (*note +Synchronous Processes::.). + + Synchronous and asynchronous processes are explained in following +sections. Since the three functions are all called in a similar +fashion, their common arguments are described here. + + In all cases, the function's PROGRAM argument specifies the program +to be run. An error is signaled if the file is not found or cannot be +executed. If the file name is relative, the variable `exec-path' +contains a list of directories to search. Emacs initializes +`exec-path' when it starts up, based on the value of the environment +variable `PATH'. The standard file name constructs, `~', `.', and +`..', are interpreted as usual in `exec-path', but environment variable +substitutions (`$HOME', etc.) are not recognized; use +`substitute-in-file-name' to perform them (*note File Name +Expansion::.). + + Each of the subprocess-creating functions has a BUFFER-OR-NAME +argument which specifies where the standard output from the program will +go. If BUFFER-OR-NAME is `nil', that says to discard the output unless +a filter function handles it. (*Note Filter Functions::, and *Note +Read and Print::.) Normally, you should avoid having multiple +processes send output to the same buffer because their output would be +intermixed randomly. + + All three of the subprocess-creating functions have a `&rest' +argument, ARGS. The ARGS must all be strings, and they are supplied to +PROGRAM as separate command line arguments. Wildcard characters and +other shell constructs are not allowed in these strings, since they are +passed directly to the specified program. + + *Please note:* The argument PROGRAM contains only the name of the +program; it may not contain any command-line arguments. You must use +ARGS to provide those. + + The subprocess gets its current directory from the value of +`default-directory' (*note File Name Expansion::.). + + The subprocess inherits its environment from XEmacs; but you can +specify overrides for it with `process-environment'. *Note System +Environment::. + + - Variable: exec-directory + The value of this variable is the name of a directory (a string) + that contains programs that come with XEmacs, that are intended + for XEmacs to invoke. The program `wakeup' is an example of such + a program; the `display-time' command uses it to get a reminder + once per minute. + + - User Option: exec-path + The value of this variable is a list of directories to search for + programs to run in subprocesses. Each element is either the name + of a directory (i.e., a string), or `nil', which stands for the + default directory (which is the value of `default-directory'). + + The value of `exec-path' is used by `call-process' and + `start-process' when the PROGRAM argument is not an absolute file + name. + + +File: lispref.info, Node: Synchronous Processes, Next: MS-DOS Subprocesses, Prev: Subprocess Creation, Up: Processes + +Creating a Synchronous Process +============================== + + After a "synchronous process" is created, XEmacs waits for the +process to terminate before continuing. Starting Dired is an example of +this: it runs `ls' in a synchronous process, then modifies the output +slightly. Because the process is synchronous, the entire directory +listing arrives in the buffer before XEmacs tries to do anything with +it. + + While Emacs waits for the synchronous subprocess to terminate, the +user can quit by typing `C-g'. The first `C-g' tries to kill the +subprocess with a `SIGINT' signal; but it waits until the subprocess +actually terminates before quitting. If during that time the user +types another `C-g', that kills the subprocess instantly with `SIGKILL' +and quits immediately. *Note Quitting::. + + The synchronous subprocess functions returned `nil' in version 18. +In version 19, they return an indication of how the process terminated. + + - Function: call-process PROGRAM &optional INFILE DESTINATION DISPLAY + &rest ARGS + This function calls PROGRAM in a separate process and waits for it + to finish. + + The standard input for the process comes from file INFILE if + INFILE is not `nil' and from `/dev/null' otherwise. The argument + DESTINATION says where to put the process output. Here are the + possibilities: + + a buffer + Insert the output in that buffer, before point. This + includes both the standard output stream and the standard + error stream of the process. + + a string + Find or create a buffer with that name, then insert the + output in that buffer, before point. + + `t' + Insert the output in the current buffer, before point. + + `nil' + Discard the output. + + 0 + Discard the output, and return immediately without waiting + for the subprocess to finish. + + In this case, the process is not truly synchronous, since it + can run in parallel with Emacs; but you can think of it as + synchronous in that Emacs is essentially finished with the + subprocess as soon as this function returns. + + (REAL-DESTINATION ERROR-DESTINATION) + Keep the standard output stream separate from the standard + error stream; deal with the ordinary output as specified by + REAL-DESTINATION, and dispose of the error output according + to ERROR-DESTINATION. The value `nil' means discard it, `t' + means mix it with the ordinary output, and a string specifies + a file name to redirect error output into. + + You can't directly specify a buffer to put the error output + in; that is too difficult to implement. But you can achieve + this result by sending the error output to a temporary file + and then inserting the file into a buffer. + + If DISPLAY is non-`nil', then `call-process' redisplays the buffer + as output is inserted. Otherwise the function does no redisplay, + and the results become visible on the screen only when XEmacs + redisplays that buffer in the normal course of events. + + The remaining arguments, ARGS, are strings that specify command + line arguments for the program. + + The value returned by `call-process' (unless you told it not to + wait) indicates the reason for process termination. A number + gives the exit status of the subprocess; 0 means success, and any + other value means failure. If the process terminated with a + signal, `call-process' returns a string describing the signal. + + In the examples below, the buffer `foo' is current. + + (call-process "pwd" nil t) + => nil + + ---------- Buffer: foo ---------- + /usr/user/lewis/manual + ---------- Buffer: foo ---------- + + (call-process "grep" nil "bar" nil "lewis" "/etc/passwd") + => nil + + ---------- Buffer: bar ---------- + lewis:5LTsHm66CSWKg:398:21:Bil Lewis:/user/lewis:/bin/csh + + ---------- Buffer: bar ---------- + + The `insert-directory' function contains a good example of the use + of `call-process': + + (call-process insert-directory-program nil t nil switches + (if full-directory-p + (concat (file-name-as-directory file) ".") + file)) + + - Function: call-process-region START END PROGRAM &optional DELETE + DESTINATION DISPLAY &rest ARGS + This function sends the text between START to END as standard + input to a process running PROGRAM. It deletes the text sent if + DELETE is non-`nil'; this is useful when BUFFER is `t', to insert + the output in the current buffer. + + The arguments DESTINATION and DISPLAY control what to do with the + output from the subprocess, and whether to update the display as + it comes in. For details, see the description of `call-process', + above. If DESTINATION is the integer 0, `call-process-region' + discards the output and returns `nil' immediately, without waiting + for the subprocess to finish. + + The remaining arguments, ARGS, are strings that specify command + line arguments for the program. + + The return value of `call-process-region' is just like that of + `call-process': `nil' if you told it to return without waiting; + otherwise, a number or string which indicates how the subprocess + terminated. + + In the following example, we use `call-process-region' to run the + `cat' utility, with standard input being the first five characters + in buffer `foo' (the word `input'). `cat' copies its standard + input into its standard output. Since the argument DESTINATION is + `t', this output is inserted in the current buffer. + + ---------- Buffer: foo ---------- + input-!- + ---------- Buffer: foo ---------- + + (call-process-region 1 6 "cat" nil t) + => nil + + ---------- Buffer: foo ---------- + inputinput-!- + ---------- Buffer: foo ---------- + + The `shell-command-on-region' command uses `call-process-region' + like this: + + (call-process-region + start end + shell-file-name ; Name of program. + nil ; Do not delete region. + buffer ; Send output to `buffer'. + nil ; No redisplay during output. + "-c" command) ; Arguments for the shell. + + +File: lispref.info, Node: MS-DOS Subprocesses, Next: Asynchronous Processes, Prev: Synchronous Processes, Up: Processes + +MS-DOS Subprocesses +=================== + + On MS-DOS, you must indicate whether the data going to and from a +synchronous subprocess are text or binary. Text data requires +translation between the end-of-line convention used within Emacs (a +single newline character) and the convention used outside Emacs (the +two-character sequence, CRLF). + + The variable `binary-process-input' applies to input sent to the +subprocess, and `binary-process-output' applies to output received from +it. A non-`nil' value means the data is non-text; `nil' means the data +is text, and calls for conversion. + + - Variable: binary-process-input + If this variable is `nil', convert newlines to CRLF sequences in + the input to a synchronous subprocess. + + - Variable: binary-process-output + If this variable is `nil', convert CRLF sequences to newlines in + the output from a synchronous subprocess. + + *Note Files and MS-DOS::, for related information. + + +File: lispref.info, Node: Asynchronous Processes, Next: Deleting Processes, Prev: MS-DOS Subprocesses, Up: Processes + +Creating an Asynchronous Process +================================ + + After an "asynchronous process" is created, Emacs and the Lisp +program both continue running immediately. The process may thereafter +run in parallel with Emacs, and the two may communicate with each other +using the functions described in following sections. Here we describe +how to create an asynchronous process with `start-process'. + + - Function: start-process NAME BUFFER-OR-NAME PROGRAM &rest ARGS + This function creates a new asynchronous subprocess and starts the + program PROGRAM running in it. It returns a process object that + stands for the new subprocess in Lisp. The argument NAME + specifies the name for the process object; if a process with this + name already exists, then NAME is modified (by adding `<1>', etc.) + to be unique. The buffer BUFFER-OR-NAME is the buffer to + associate with the process. + + The remaining arguments, ARGS, are strings that specify command + line arguments for the program. + + In the example below, the first process is started and runs + (rather, sleeps) for 100 seconds. Meanwhile, the second process + is started, and given the name `my-process<1>' for the sake of + uniqueness. It inserts the directory listing at the end of the + buffer `foo', before the first process finishes. Then it + finishes, and a message to that effect is inserted in the buffer. + Much later, the first process finishes, and another message is + inserted in the buffer for it. + + (start-process "my-process" "foo" "sleep" "100") + => # + + (start-process "my-process" "foo" "ls" "-l" "/user/lewis/bin") + => #> + + ---------- Buffer: foo ---------- + total 2 + lrwxrwxrwx 1 lewis 14 Jul 22 10:12 gnuemacs --> /emacs + -rwxrwxrwx 1 lewis 19 Jul 30 21:02 lemon + + Process my-process<1> finished + + Process my-process finished + ---------- Buffer: foo ---------- + + - Function: start-process-shell-command NAME BUFFER-OR-NAME COMMAND + &rest COMMAND-ARGS + This function is like `start-process' except that it uses a shell + to execute the specified command. The argument COMMAND is a shell + command name, and COMMAND-ARGS are the arguments for the shell + command. + + - Variable: process-connection-type + This variable controls the type of device used to communicate with + asynchronous subprocesses. If it is non-`nil', then PTYs are + used, when available. Otherwise, pipes are used. + + PTYs are usually preferable for processes visible to the user, as + in Shell mode, because they allow job control (`C-c', `C-z', etc.) + to work between the process and its children whereas pipes do not. + For subprocesses used for internal purposes by programs, it is + often better to use a pipe, because they are more efficient. In + addition, the total number of PTYs is limited on many systems and + it is good not to waste them. + + The value `process-connection-type' is used when `start-process' + is called. So you can specify how to communicate with one + subprocess by binding the variable around the call to + `start-process'. + + (let ((process-connection-type nil)) ; Use a pipe. + (start-process ...)) + + To determine whether a given subprocess actually got a pipe or a + PTY, use the function `process-tty-name' (*note Process + Information::.). + + +File: lispref.info, Node: Deleting Processes, Next: Process Information, Prev: Asynchronous Processes, Up: Processes + +Deleting Processes +================== + + "Deleting a process" disconnects XEmacs immediately from the +subprocess, and removes it from the list of active processes. It sends +a signal to the subprocess to make the subprocess terminate, but this is +not guaranteed to happen immediately. The process object itself +continues to exist as long as other Lisp objects point to it. + + You can delete a process explicitly at any time. Processes are +deleted automatically after they terminate, but not necessarily right +away. If you delete a terminated process explicitly before it is +deleted automatically, no harm results. + + - Variable: delete-exited-processes + This variable controls automatic deletion of processes that have + terminated (due to calling `exit' or to a signal). If it is + `nil', then they continue to exist until the user runs + `list-processes'. Otherwise, they are deleted immediately after + they exit. + + - Function: delete-process NAME + This function deletes the process associated with NAME, killing it + with a `SIGHUP' signal. The argument NAME may be a process, the + name of a process, a buffer, or the name of a buffer. + + (delete-process "*shell*") + => nil + + - Function: process-kill-without-query PROCESS &optional + REQUIRE-QUERY-P + This function declares that XEmacs need not query the user if + PROCESS is still running when XEmacs is exited. The process will + be deleted silently. If REQUIRE-QUERY-P is non-`nil', then XEmacs + *will* query the user (this is the default). The return value is + `t' if a query was formerly required, and `nil' otherwise. + + (process-kill-without-query (get-process "shell")) + => t + + +File: lispref.info, Node: Process Information, Next: Input to Processes, Prev: Deleting Processes, Up: Processes + +Process Information +=================== + + Several functions return information about processes. +`list-processes' is provided for interactive use. + + - Command: list-processes + This command displays a listing of all living processes. In + addition, it finally deletes any process whose status was `Exited' + or `Signaled'. It returns `nil'. + + - Function: process-list + This function returns a list of all processes that have not been + deleted. + + (process-list) + => (# #) + + - Function: get-process NAME + This function returns the process named NAME, or `nil' if there is + none. An error is signaled if NAME is not a string. + + (get-process "shell") + => # + + - Function: process-command PROCESS + This function returns the command that was executed to start + PROCESS. This is a list of strings, the first string being the + program executed and the rest of the strings being the arguments + that were given to the program. + + (process-command (get-process "shell")) + => ("/bin/csh" "-i") + + - Function: process-id PROCESS + This function returns the PID of PROCESS. This is an integer that + distinguishes the process PROCESS from all other processes running + on the same computer at the current time. The PID of a process is + chosen by the operating system kernel when the process is started + and remains constant as long as the process exists. + + - Function: process-name PROCESS + This function returns the name of PROCESS. + + - Function: process-status PROCESS-NAME + This function returns the status of PROCESS-NAME as a symbol. The + argument PROCESS-NAME must be a process, a buffer, a process name + (string) or a buffer name (string). + + The possible values for an actual subprocess are: + + `run' + for a process that is running. + + `stop' + for a process that is stopped but continuable. + + `exit' + for a process that has exited. + + `signal' + for a process that has received a fatal signal. + + `open' + for a network connection that is open. + + `closed' + for a network connection that is closed. Once a connection + is closed, you cannot reopen it, though you might be able to + open a new connection to the same place. + + `nil' + if PROCESS-NAME is not the name of an existing process. + + (process-status "shell") + => run + + (process-status (get-buffer "*shell*")) + => run + + x + => #> + (process-status x) + => exit + + For a network connection, `process-status' returns one of the + symbols `open' or `closed'. The latter means that the other side + closed the connection, or XEmacs did `delete-process'. + + In earlier Emacs versions (prior to version 19), the status of a + network connection was `run' if open, and `exit' if closed. + + - Function: process-kill-without-query-p PROCESS + This function returns whether PROCESS will be killed without + querying the user, if it is running when XEmacs is exited. The + default value is `nil'. + + - Function: process-exit-status PROCESS + This function returns the exit status of PROCESS or the signal + number that killed it. (Use the result of `process-status' to + determine which of those it is.) If PROCESS has not yet + terminated, the value is 0. + + - Function: process-tty-name PROCESS + This function returns the terminal name that PROCESS is using for + its communication with Emacs--or `nil' if it is using pipes + instead of a terminal (see `process-connection-type' in *Note + Asynchronous Processes::). + + +File: lispref.info, Node: Input to Processes, Next: Signals to Processes, Prev: Process Information, Up: Processes + +Sending Input to Processes +========================== + + Asynchronous subprocesses receive input when it is sent to them by +XEmacs, which is done with the functions in this section. You must +specify the process to send input to, and the input data to send. The +data appears on the "standard input" of the subprocess. + + Some operating systems have limited space for buffered input in a +PTY. On these systems, Emacs sends an EOF periodically amidst the +other characters, to force them through. For most programs, these EOFs +do no harm. + + - Function: process-send-string PROCESS-NAME STRING + This function sends PROCESS-NAME the contents of STRING as + standard input. The argument PROCESS-NAME must be a process or + the name of a process. If it is `nil', the current buffer's + process is used. + + The function returns `nil'. + + (process-send-string "shell<1>" "ls\n") + => nil + + ---------- Buffer: *shell* ---------- + ... + introduction.texi syntax-tables.texi~ + introduction.texi~ text.texi + introduction.txt text.texi~ + ... + ---------- Buffer: *shell* ---------- + + - Command: process-send-region PROCESS-NAME START END + This function sends the text in the region defined by START and + END as standard input to PROCESS-NAME, which is a process or a + process name. (If it is `nil', the current buffer's process is + used.) + + An error is signaled unless both START and END are integers or + markers that indicate positions in the current buffer. (It is + unimportant which number is larger.) + + - Function: process-send-eof &optional PROCESS-NAME + This function makes PROCESS-NAME see an end-of-file in its input. + The EOF comes after any text already sent to it. + + If PROCESS-NAME is not supplied, or if it is `nil', then this + function sends the EOF to the current buffer's process. An error + is signaled if the current buffer has no process. + + The function returns PROCESS-NAME. + + (process-send-eof "shell") + => "shell" + + +File: lispref.info, Node: Signals to Processes, Next: Output from Processes, Prev: Input to Processes, Up: Processes + +Sending Signals to Processes +============================ + + "Sending a signal" to a subprocess is a way of interrupting its +activities. There are several different signals, each with its own +meaning. The set of signals and their names is defined by the operating +system. For example, the signal `SIGINT' means that the user has typed +`C-c', or that some analogous thing has happened. + + Each signal has a standard effect on the subprocess. Most signals +kill the subprocess, but some stop or resume execution instead. Most +signals can optionally be handled by programs; if the program handles +the signal, then we can say nothing in general about its effects. + + The set of signals and their names is defined by the operating +system; XEmacs has facilities for sending only a few of the signals +that are defined. XEmacs can send signals only to its own subprocesses. + + You can send signals explicitly by calling the functions in this +section. XEmacs also sends signals automatically at certain times: +killing a buffer sends a `SIGHUP' signal to all its associated +processes; killing XEmacs sends a `SIGHUP' signal to all remaining +processes. (`SIGHUP' is a signal that usually indicates that the user +hung up the phone.) + + Each of the signal-sending functions takes two optional arguments: +PROCESS-NAME and CURRENT-GROUP. + + The argument PROCESS-NAME must be either a process, the name of one, +or `nil'. If it is `nil', the process defaults to the process +associated with the current buffer. An error is signaled if +PROCESS-NAME does not identify a process. + + The argument CURRENT-GROUP is a flag that makes a difference when +you are running a job-control shell as an XEmacs subprocess. If it is +non-`nil', then the signal is sent to the current process-group of the +terminal that XEmacs uses to communicate with the subprocess. If the +process is a job-control shell, this means the shell's current subjob. +If it is `nil', the signal is sent to the process group of the +immediate subprocess of XEmacs. If the subprocess is a job-control +shell, this is the shell itself. + + The flag CURRENT-GROUP has no effect when a pipe is used to +communicate with the subprocess, because the operating system does not +support the distinction in the case of pipes. For the same reason, +job-control shells won't work when a pipe is used. See +`process-connection-type' in *Note Asynchronous Processes::. + + - Function: interrupt-process &optional PROCESS-NAME CURRENT-GROUP + This function interrupts the process PROCESS-NAME by sending the + signal `SIGINT'. Outside of XEmacs, typing the "interrupt + character" (normally `C-c' on some systems, and `DEL' on others) + sends this signal. When the argument CURRENT-GROUP is non-`nil', + you can think of this function as "typing `C-c'" on the terminal + by which XEmacs talks to the subprocess. + + - Function: kill-process &optional PROCESS-NAME CURRENT-GROUP + This function kills the process PROCESS-NAME by sending the signal + `SIGKILL'. This signal kills the subprocess immediately, and + cannot be handled by the subprocess. + + - Function: quit-process &optional PROCESS-NAME CURRENT-GROUP + This function sends the signal `SIGQUIT' to the process + PROCESS-NAME. This signal is the one sent by the "quit character" + (usually `C-b' or `C-\') when you are not inside XEmacs. + + - Function: stop-process &optional PROCESS-NAME CURRENT-GROUP + This function stops the process PROCESS-NAME by sending the signal + `SIGTSTP'. Use `continue-process' to resume its execution. + + On systems with job control, the "stop character" (usually `C-z') + sends this signal (outside of XEmacs). When CURRENT-GROUP is + non-`nil', you can think of this function as "typing `C-z'" on the + terminal XEmacs uses to communicate with the subprocess. + + - Function: continue-process &optional PROCESS-NAME CURRENT-GROUP + This function resumes execution of the process PROCESS by sending + it the signal `SIGCONT'. This presumes that PROCESS-NAME was + stopped previously. + + - Function: signal-process PID SIGNAL + This function sends a signal to process PID, which need not be a + child of XEmacs. The argument SIGNAL specifies which signal to + send; it should be an integer. + + +File: lispref.info, Node: Output from Processes, Next: Sentinels, Prev: Signals to Processes, Up: Processes + +Receiving Output from Processes +=============================== + + There are two ways to receive the output that a subprocess writes to +its standard output stream. The output can be inserted in a buffer, +which is called the associated buffer of the process, or a function +called the "filter function" can be called to act on the output. If +the process has no buffer and no filter function, its output is +discarded. + +* Menu: + +* Process Buffers:: If no filter, output is put in a buffer. +* Filter Functions:: Filter functions accept output from the process. +* Accepting Output:: Explicitly permitting subprocess output. + Waiting for subprocess output. + + +File: lispref.info, Node: Process Buffers, Next: Filter Functions, Up: Output from Processes + +Process Buffers +--------------- + + A process can (and usually does) have an "associated buffer", which +is an ordinary Emacs buffer that is used for two purposes: storing the +output from the process, and deciding when to kill the process. You +can also use the buffer to identify a process to operate on, since in +normal practice only one process is associated with any given buffer. +Many applications of processes also use the buffer for editing input to +be sent to the process, but this is not built into XEmacs Lisp. + + Unless the process has a filter function (*note Filter Functions::.), +its output is inserted in the associated buffer. The position to insert +the output is determined by the `process-mark', which is then updated +to point to the end of the text just inserted. Usually, but not +always, the `process-mark' is at the end of the buffer. + + - Function: process-buffer PROCESS + This function returns the associated buffer of the process PROCESS. + + (process-buffer (get-process "shell")) + => # + + - Function: process-mark PROCESS + This function returns the process marker for PROCESS, which is the + marker that says where to insert output from the process. + + If PROCESS does not have a buffer, `process-mark' returns a marker + that points nowhere. + + Insertion of process output in a buffer uses this marker to decide + where to insert, and updates it to point after the inserted text. + That is why successive batches of output are inserted + consecutively. + + Filter functions normally should use this marker in the same + fashion as is done by direct insertion of output in the buffer. A + good example of a filter function that uses `process-mark' is + found at the end of the following section. + + When the user is expected to enter input in the process buffer for + transmission to the process, the process marker is useful for + distinguishing the new input from previous output. + + - Function: set-process-buffer PROCESS BUFFER + This function sets the buffer associated with PROCESS to BUFFER. + If BUFFER is `nil', the process becomes associated with no buffer. + + - Function: get-buffer-process BUFFER-OR-NAME + This function returns the process associated with BUFFER-OR-NAME. + If there are several processes associated with it, then one is + chosen. (Presently, the one chosen is the one most recently + created.) It is usually a bad idea to have more than one process + associated with the same buffer. + + (get-buffer-process "*shell*") + => # + + Killing the process's buffer deletes the process, which kills the + subprocess with a `SIGHUP' signal (*note Signals to Processes::.). + + +File: lispref.info, Node: Filter Functions, Next: Accepting Output, Prev: Process Buffers, Up: Output from Processes + +Process Filter Functions +------------------------ + + A process "filter function" is a function that receives the standard +output from the associated process. If a process has a filter, then +*all* output from that process is passed to the filter. The process +buffer is used directly for output from the process only when there is +no filter. + + A filter function must accept two arguments: the associated process +and a string, which is the output. The function is then free to do +whatever it chooses with the output. + + A filter function runs only while XEmacs is waiting (e.g., for +terminal input, or for time to elapse, or for process output). This +avoids the timing errors that could result from running filters at +random places in the middle of other Lisp programs. You may explicitly +cause Emacs to wait, so that filter functions will run, by calling +`sit-for' or `sleep-for' (*note Waiting::.), or `accept-process-output' +(*note Accepting Output::.). Emacs is also waiting when the command +loop is reading input. + + Quitting is normally inhibited within a filter function--otherwise, +the effect of typing `C-g' at command level or to quit a user command +would be unpredictable. If you want to permit quitting inside a filter +function, bind `inhibit-quit' to `nil'. *Note Quitting::. + + If an error happens during execution of a filter function, it is +caught automatically, so that it doesn't stop the execution of whatever +program was running when the filter function was started. However, if +`debug-on-error' is non-`nil', the error-catching is turned off. This +makes it possible to use the Lisp debugger to debug the filter +function. *Note Debugger::. + + Many filter functions sometimes or always insert the text in the +process's buffer, mimicking the actions of XEmacs when there is no +filter. Such filter functions need to use `set-buffer' in order to be +sure to insert in that buffer. To avoid setting the current buffer +semipermanently, these filter functions must use `unwind-protect' to +make sure to restore the previous current buffer. They should also +update the process marker, and in some cases update the value of point. +Here is how to do these things: + + (defun ordinary-insertion-filter (proc string) + (let ((old-buffer (current-buffer))) + (unwind-protect + (let (moving) + (set-buffer (process-buffer proc)) + (setq moving (= (point) (process-mark proc))) + + (save-excursion + ;; Insert the text, moving the process-marker. + (goto-char (process-mark proc)) + (insert string) + (set-marker (process-mark proc) (point))) + (if moving (goto-char (process-mark proc)))) + (set-buffer old-buffer)))) + +The reason to use an explicit `unwind-protect' rather than letting +`save-excursion' restore the current buffer is so as to preserve the +change in point made by `goto-char'. + + To make the filter force the process buffer to be visible whenever +new text arrives, insert the following line just before the +`unwind-protect': + + (display-buffer (process-buffer proc)) + + To force point to move to the end of the new output no matter where +it was previously, eliminate the variable `moving' and call `goto-char' +unconditionally. + + In earlier Emacs versions, every filter function that did regexp +searching or matching had to explicitly save and restore the match data. +Now Emacs does this automatically; filter functions never need to do it +explicitly. *Note Match Data::. + + A filter function that writes the output into the buffer of the +process should check whether the buffer is still alive. If it tries to +insert into a dead buffer, it will get an error. If the buffer is dead, +`(buffer-name (process-buffer PROCESS))' returns `nil'. + + The output to the function may come in chunks of any size. A program +that produces the same output twice in a row may send it as one batch +of 200 characters one time, and five batches of 40 characters the next. + + - Function: set-process-filter PROCESS FILTER + This function gives PROCESS the filter function FILTER. If FILTER + is `nil', then the process will have no filter. If FILTER is `t', + then no output from the process will be accepted until the filter + is changed. (Output received during this time is not discarded, + but is queued, and will be processed as soon as the filter is + changed.) + + - Function: process-filter PROCESS + This function returns the filter function of PROCESS, or `nil' if + it has none. `t' means that output processing has been stopped. + + Here is an example of use of a filter function: + + (defun keep-output (process output) + (setq kept (cons output kept))) + => keep-output + + (setq kept nil) + => nil + + (set-process-filter (get-process "shell") 'keep-output) + => keep-output + + (process-send-string "shell" "ls ~/other\n") + => nil + kept + => ("lewis@slug[8] % " + + "FINAL-W87-SHORT.MSS backup.otl kolstad.mss~ + address.txt backup.psf kolstad.psf + backup.bib~ david.mss resume-Dec-86.mss~ + backup.err david.psf resume-Dec.psf + backup.mss dland syllabus.mss + " + "#backups.mss# backup.mss~ kolstad.mss + ") + + +File: lispref.info, Node: Accepting Output, Prev: Filter Functions, Up: Output from Processes + +Accepting Output from Processes +------------------------------- + + Output from asynchronous subprocesses normally arrives only while +XEmacs is waiting for some sort of external event, such as elapsed time +or terminal input. Occasionally it is useful in a Lisp program to +explicitly permit output to arrive at a specific point, or even to wait +until output arrives from a process. + + - Function: accept-process-output &optional PROCESS SECONDS MILLISEC + This function allows XEmacs to read pending output from processes. + The output is inserted in the associated buffers or given to + their filter functions. If PROCESS is non-`nil' then this + function does not return until some output has been received from + PROCESS. + + The arguments SECONDS and MILLISEC let you specify timeout + periods. The former specifies a period measured in seconds and the + latter specifies one measured in milliseconds. The two time + periods thus specified are added together, and + `accept-process-output' returns after that much time whether or + not there has been any subprocess output. Note that SECONDS is + allowed to be a floating-point number; thus, there is no need to + ever use MILLISEC. (It is retained for compatibility purposes.) + + The function `accept-process-output' returns non-`nil' if it did + get some output, or `nil' if the timeout expired before output + arrived. + + +File: lispref.info, Node: Sentinels, Next: Process Window Size, Prev: Output from Processes, Up: Processes + +Sentinels: Detecting Process Status Changes +=========================================== + + A "process sentinel" is a function that is called whenever the +associated process changes status for any reason, including signals +(whether sent by XEmacs or caused by the process's own actions) that +terminate, stop, or continue the process. The process sentinel is also +called if the process exits. The sentinel receives two arguments: the +process for which the event occurred, and a string describing the type +of event. + + The string describing the event looks like one of the following: + + * `"finished\n"'. + + * `"exited abnormally with code EXITCODE\n"'. + + * `"NAME-OF-SIGNAL\n"'. + + * `"NAME-OF-SIGNAL (core dumped)\n"'. + + A sentinel runs only while XEmacs is waiting (e.g., for terminal +input, or for time to elapse, or for process output). This avoids the +timing errors that could result from running them at random places in +the middle of other Lisp programs. A program can wait, so that +sentinels will run, by calling `sit-for' or `sleep-for' (*note +Waiting::.), or `accept-process-output' (*note Accepting Output::.). +Emacs is also waiting when the command loop is reading input. + + Quitting is normally inhibited within a sentinel--otherwise, the +effect of typing `C-g' at command level or to quit a user command would +be unpredictable. If you want to permit quitting inside a sentinel, +bind `inhibit-quit' to `nil'. *Note Quitting::. + + A sentinel that writes the output into the buffer of the process +should check whether the buffer is still alive. If it tries to insert +into a dead buffer, it will get an error. If the buffer is dead, +`(buffer-name (process-buffer PROCESS))' returns `nil'. + + If an error happens during execution of a sentinel, it is caught +automatically, so that it doesn't stop the execution of whatever +programs was running when the sentinel was started. However, if +`debug-on-error' is non-`nil', the error-catching is turned off. This +makes it possible to use the Lisp debugger to debug the sentinel. +*Note Debugger::. + + In earlier Emacs versions, every sentinel that did regexp searching +or matching had to explicitly save and restore the match data. Now +Emacs does this automatically; sentinels never need to do it explicitly. +*Note Match Data::. + + - Function: set-process-sentinel PROCESS SENTINEL + This function associates SENTINEL with PROCESS. If SENTINEL is + `nil', then the process will have no sentinel. The default + behavior when there is no sentinel is to insert a message in the + process's buffer when the process status changes. + + (defun msg-me (process event) + (princ + (format "Process: %s had the event `%s'" process event))) + (set-process-sentinel (get-process "shell") 'msg-me) + => msg-me + + (kill-process (get-process "shell")) + -| Process: # had the event `killed' + => # + + - Function: process-sentinel PROCESS + This function returns the sentinel of PROCESS, or `nil' if it has + none. + + - Function: waiting-for-user-input-p + While a sentinel or filter function is running, this function + returns non-`nil' if XEmacs was waiting for keyboard input from + the user at the time the sentinel or filter function was called, + `nil' if it was not. + + +File: lispref.info, Node: Process Window Size, Next: Transaction Queues, Prev: Sentinels, Up: Processes + +Process Window Size +=================== + + - Function: set-process-window-size PROCESS HEIGHT WIDTH + This function tells PROCESS that its logical window size is HEIGHT + by WIDTH characters. This is principally useful with pty's. + + +File: lispref.info, Node: Transaction Queues, Next: Network, Prev: Process Window Size, Up: Processes + +Transaction Queues +================== + + You can use a "transaction queue" for more convenient communication +with subprocesses using transactions. First use `tq-create' to create +a transaction queue communicating with a specified process. Then you +can call `tq-enqueue' to send a transaction. + + - Function: tq-create PROCESS + This function creates and returns a transaction queue + communicating with PROCESS. The argument PROCESS should be a + subprocess capable of sending and receiving streams of bytes. It + may be a child process, or it may be a TCP connection to a server, + possibly on another machine. + + - Function: tq-enqueue QUEUE QUESTION REGEXP CLOSURE FN + This function sends a transaction to queue QUEUE. Specifying the + queue has the effect of specifying the subprocess to talk to. + + The argument QUESTION is the outgoing message that starts the + transaction. The argument FN is the function to call when the + corresponding answer comes back; it is called with two arguments: + CLOSURE, and the answer received. + + The argument REGEXP is a regular expression that should match the + entire answer, but nothing less; that's how `tq-enqueue' determines + where the answer ends. + + The return value of `tq-enqueue' itself is not meaningful. + + - Function: tq-close QUEUE + Shut down transaction queue QUEUE, waiting for all pending + transactions to complete, and then terminate the connection or + child process. + + Transaction queues are implemented by means of a filter function. +*Note Filter Functions::. + + +File: lispref.info, Node: Network, Prev: Transaction Queues, Up: Processes + +Network Connections +=================== + + XEmacs Lisp programs can open TCP network connections to other +processes on the same machine or other machines. A network connection +is handled by Lisp much like a subprocess, and is represented by a +process object. However, the process you are communicating with is not +a child of the XEmacs process, so you can't kill it or send it signals. +All you can do is send and receive data. `delete-process' closes the +connection, but does not kill the process at the other end; that +process must decide what to do about closure of the connection. + + You can distinguish process objects representing network connections +from those representing subprocesses with the `process-status' +function. It always returns either `open' or `closed' for a network +connection, and it never returns either of those values for a real +subprocess. *Note Process Information::. + + - Function: open-network-stream NAME BUFFER-OR-NAME HOST SERVICE + This function opens a TCP connection for a service to a host. It + returns a process object to represent the connection. + + The NAME argument specifies the name for the process object. It + is modified as necessary to make it unique. + + The BUFFER-OR-NAME argument is the buffer to associate with the + connection. Output from the connection is inserted in the buffer, + unless you specify a filter function to handle the output. If + BUFFER-OR-NAME is `nil', it means that the connection is not + associated with any buffer. + + The arguments HOST and SERVICE specify where to connect to; HOST + is the host name or IP address (a string), and SERVICE is the name + of a defined network service (a string) or a port number (an + integer). + diff --git a/info/lispref.info-39 b/info/lispref.info-39 new file mode 100644 index 0000000..0227dd0 --- /dev/null +++ b/info/lispref.info-39 @@ -0,0 +1,1322 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: System Interface, Next: X-Windows, Prev: Processes, Up: Top + +Operating System Interface +************************** + + This chapter is about starting and getting out of Emacs, access to +values in the operating system environment, and terminal input, output, +and flow control. + + *Note Building XEmacs::, for related information. See also *Note +Display::, for additional operating system status information +pertaining to the terminal and the screen. + +* Menu: + +* Starting Up:: Customizing XEmacs start-up processing. +* Getting Out:: How exiting works (permanent or temporary). +* System Environment:: Distinguish the name and kind of system. +* User Identification:: Finding the name and user id of the user. +* Time of Day:: Getting the current time. +* Time Conversion:: Converting a time from numeric form to a string, or + to calendrical data (or vice versa). +* Timers:: Setting a timer to call a function at a certain time. +* Terminal Input:: Recording terminal input for debugging. +* Terminal Output:: Recording terminal output for debugging. +* Flow Control:: How to turn output flow control on or off. +* Batch Mode:: Running XEmacs without terminal interaction. + + +File: lispref.info, Node: Starting Up, Next: Getting Out, Up: System Interface + +Starting Up XEmacs +================== + + This section describes what XEmacs does when it is started, and how +you can customize these actions. + +* Menu: + +* Start-up Summary:: Sequence of actions XEmacs performs at start-up. +* Init File:: Details on reading the init file (`.emacs'). +* Terminal-Specific:: How the terminal-specific Lisp file is read. +* Command Line Arguments:: How command line arguments are processed, + and how you can customize them. + + +File: lispref.info, Node: Start-up Summary, Next: Init File, Up: Starting Up + +Summary: Sequence of Actions at Start Up +---------------------------------------- + + The order of operations performed (in `startup.el') by XEmacs when +it is started up is as follows: + + 1. It loads the initialization library for the window system, if you + are using a window system. This library's name is + `term/WINDOWSYSTEM-win.el'. + + 2. It processes the initial options. (Some of them are handled even + earlier than this.) + + 3. It initializes the X window frame and faces, if appropriate. + + 4. It runs the normal hook `before-init-hook'. + + 5. It loads the library `site-start', unless the option + `-no-site-file' was specified. The library's file name is usually + `site-start.el'. + + 6. It loads the file `~/.emacs' unless `-q' was specified on the + command line. (This is not done in `-batch' mode.) The `-u' + option can specify the user name whose home directory should be + used instead of `~'. + + 7. It loads the library `default' unless `inhibit-default-init' is + non-`nil'. (This is not done in `-batch' mode or if `-q' was + specified on the command line.) The library's file name is + usually `default.el'. + + 8. It runs the normal hook `after-init-hook'. + + 9. It sets the major mode according to `initial-major-mode', provided + the buffer `*scratch*' is still current and still in Fundamental + mode. + + 10. It loads the terminal-specific Lisp file, if any, except when in + batch mode or using a window system. + + 11. It displays the initial echo area message, unless you have + suppressed that with `inhibit-startup-echo-area-message'. + + 12. It processes the action arguments from the command line. + + 13. It runs `term-setup-hook'. + + 14. It calls `frame-notice-user-settings', which modifies the + parameters of the selected frame according to whatever the init + files specify. + + 15. It runs `window-setup-hook'. *Note Terminal-Specific::. + + 16. It displays copyleft, nonwarranty, and basic use information, + provided there were no remaining command line arguments (a few + steps above) and the value of `inhibit-startup-message' is `nil'. + + - User Option: inhibit-startup-message + This variable inhibits the initial startup messages (the + nonwarranty, etc.). If it is non-`nil', then the messages are not + printed. + + This variable exists so you can set it in your personal init file, + once you are familiar with the contents of the startup message. + Do not set this variable in the init file of a new user, or in a + way that affects more than one user, because that would prevent + new users from receiving the information they are supposed to see. + + - User Option: inhibit-startup-echo-area-message + This variable controls the display of the startup echo area + message. You can suppress the startup echo area message by adding + text with this form to your `.emacs' file: + + (setq inhibit-startup-echo-area-message + "YOUR-LOGIN-NAME") + + Simply setting `inhibit-startup-echo-area-message' to your login + name is not sufficient to inhibit the message; Emacs explicitly + checks whether `.emacs' contains an expression as shown above. + Your login name must appear in the expression as a Lisp string + constant. + + This way, you can easily inhibit the message for yourself if you + wish, but thoughtless copying of your `.emacs' file will not + inhibit the message for someone else. + + +File: lispref.info, Node: Init File, Next: Terminal-Specific, Prev: Start-up Summary, Up: Starting Up + +The Init File: `.emacs' +----------------------- + + When you start XEmacs, it normally attempts to load the file +`.emacs' from your home directory. This file, if it exists, must +contain Lisp code. It is called your "init file". The command line +switches `-q' and `-u' affect the use of the init file; `-q' says not +to load an init file, and `-u' says to load a specified user's init +file instead of yours. *Note Entering XEmacs: (xemacs)Entering XEmacs. + + A site may have a "default init file", which is the library named +`default.el'. XEmacs finds the `default.el' file through the standard +search path for libraries (*note How Programs Do Loading::.). The +XEmacs distribution does not come with this file; sites may provide one +for local customizations. If the default init file exists, it is +loaded whenever you start Emacs, except in batch mode or if `-q' is +specified. But your own personal init file, if any, is loaded first; if +it sets `inhibit-default-init' to a non-`nil' value, then XEmacs does +not subsequently load the `default.el' file. + + Another file for site-customization is `site-start.el'. Emacs loads +this *before* the user's init file. You can inhibit the loading of +this file with the option `-no-site-file'. + + - Variable: site-run-file + This variable specifies the site-customization file to load before + the user's init file. Its normal value is `"site-start"'. + + If there is a great deal of code in your `.emacs' file, you should +move it into another file named `SOMETHING.el', byte-compile it (*note +Byte Compilation::.), and make your `.emacs' file load the other file +using `load' (*note Loading::.). + + *Note Init File Examples: (xemacs)Init File Examples, for examples +of how to make various commonly desired customizations in your `.emacs' +file. + + - User Option: inhibit-default-init + This variable prevents XEmacs from loading the default + initialization library file for your session of XEmacs. If its + value is non-`nil', then the default library is not loaded. The + default value is `nil'. + + - Variable: before-init-hook + - Variable: after-init-hook + These two normal hooks are run just before, and just after, + loading of the user's init file, `default.el', and/or + `site-start.el'. + + +File: lispref.info, Node: Terminal-Specific, Next: Command Line Arguments, Prev: Init File, Up: Starting Up + +Terminal-Specific Initialization +-------------------------------- + + Each terminal type can have its own Lisp library that XEmacs loads +when run on that type of terminal. For a terminal type named TERMTYPE, +the library is called `term/TERMTYPE'. XEmacs finds the file by +searching the `load-path' directories as it does for other files, and +trying the `.elc' and `.el' suffixes. Normally, terminal-specific Lisp +library is located in `emacs/lisp/term', a subdirectory of the +`emacs/lisp' directory in which most XEmacs Lisp libraries are kept. + + The library's name is constructed by concatenating the value of the +variable `term-file-prefix' and the terminal type. Normally, +`term-file-prefix' has the value `"term/"'; changing this is not +recommended. + + The usual function of a terminal-specific library is to enable +special keys to send sequences that XEmacs can recognize. It may also +need to set or add to `function-key-map' if the Termcap entry does not +specify all the terminal's function keys. *Note Terminal Input::. + + When the name of the terminal type contains a hyphen, only the part +of the name before the first hyphen is significant in choosing the +library name. Thus, terminal types `aaa-48' and `aaa-30-rv' both use +the `term/aaa' library. If necessary, the library can evaluate +`(getenv "TERM")' to find the full name of the terminal type. + + Your `.emacs' file can prevent the loading of the terminal-specific +library by setting the variable `term-file-prefix' to `nil'. This +feature is useful when experimenting with your own peculiar +customizations. + + You can also arrange to override some of the actions of the +terminal-specific library by setting the variable `term-setup-hook'. +This is a normal hook which XEmacs runs using `run-hooks' at the end of +XEmacs initialization, after loading both your `.emacs' file and any +terminal-specific libraries. You can use this variable to define +initializations for terminals that do not have their own libraries. +*Note Hooks::. + + - Variable: term-file-prefix + If the `term-file-prefix' variable is non-`nil', XEmacs loads a + terminal-specific initialization file as follows: + + (load (concat term-file-prefix (getenv "TERM"))) + + You may set the `term-file-prefix' variable to `nil' in your + `.emacs' file if you do not wish to load the + terminal-initialization file. To do this, put the following in + your `.emacs' file: `(setq term-file-prefix nil)'. + + - Variable: term-setup-hook + This variable is a normal hook that XEmacs runs after loading your + `.emacs' file, the default initialization file (if any) and the + terminal-specific Lisp file. + + You can use `term-setup-hook' to override the definitions made by a + terminal-specific file. + + - Variable: window-setup-hook + This variable is a normal hook which XEmacs runs after loading your + `.emacs' file and the default initialization file (if any), after + loading terminal-specific Lisp code, and after running the hook + `term-setup-hook'. + + +File: lispref.info, Node: Command Line Arguments, Prev: Terminal-Specific, Up: Starting Up + +Command Line Arguments +---------------------- + + You can use command line arguments to request various actions when +you start XEmacs. Since you do not need to start XEmacs more than once +per day, and will often leave your XEmacs session running longer than +that, command line arguments are hardly ever used. As a practical +matter, it is best to avoid making the habit of using them, since this +habit would encourage you to kill and restart XEmacs unnecessarily +often. These options exist for two reasons: to be compatible with +other editors (for invocation by other programs) and to enable shell +scripts to run specific Lisp programs. + + This section describes how Emacs processes command line arguments, +and how you can customize them. + + - Function: command-line + This function parses the command line that XEmacs was called with, + processes it, loads the user's `.emacs' file and displays the + startup messages. + + - Variable: command-line-processed + The value of this variable is `t' once the command line has been + processed. + + If you redump XEmacs by calling `dump-emacs', you may wish to set + this variable to `nil' first in order to cause the new dumped + XEmacs to process its new command line arguments. + + - Variable: command-switch-alist + The value of this variable is an alist of user-defined command-line + options and associated handler functions. This variable exists so + you can add elements to it. + + A "command line option" is an argument on the command line of the + form: + + -OPTION + + The elements of the `command-switch-alist' look like this: + + (OPTION . HANDLER-FUNCTION) + + The HANDLER-FUNCTION is called to handle OPTION and receives the + option name as its sole argument. + + In some cases, the option is followed in the command line by an + argument. In these cases, the HANDLER-FUNCTION can find all the + remaining command-line arguments in the variable + `command-line-args-left'. (The entire list of command-line + arguments is in `command-line-args'.) + + The command line arguments are parsed by the `command-line-1' + function in the `startup.el' file. See also *Note Command Line + Switches and Arguments: (xemacs)Command Switches. + + - Variable: command-line-args + The value of this variable is the list of command line arguments + passed to XEmacs. + + - Variable: command-line-functions + This variable's value is a list of functions for handling an + unrecognized command-line argument. Each time the next argument + to be processed has no special meaning, the functions in this list + are called, in order of appearance, until one of them returns a + non-`nil' value. + + These functions are called with no arguments. They can access the + command-line argument under consideration through the variable + `argi'. The remaining arguments (not including the current one) + are in the variable `command-line-args-left'. + + When a function recognizes and processes the argument in `argi', it + should return a non-`nil' value to say it has dealt with that + argument. If it has also dealt with some of the following + arguments, it can indicate that by deleting them from + `command-line-args-left'. + + If all of these functions return `nil', then the argument is used + as a file name to visit. + + +File: lispref.info, Node: Getting Out, Next: System Environment, Prev: Starting Up, Up: System Interface + +Getting out of XEmacs +===================== + + There are two ways to get out of XEmacs: you can kill the XEmacs job, +which exits permanently, or you can suspend it, which permits you to +reenter the XEmacs process later. As a practical matter, you seldom +kill XEmacs--only when you are about to log out. Suspending is much +more common. + +* Menu: + +* Killing XEmacs:: Exiting XEmacs irreversibly. +* Suspending XEmacs:: Exiting XEmacs reversibly. + + +File: lispref.info, Node: Killing XEmacs, Next: Suspending XEmacs, Up: Getting Out + +Killing XEmacs +-------------- + + Killing XEmacs means ending the execution of the XEmacs process. The +parent process normally resumes control. The low-level primitive for +killing XEmacs is `kill-emacs'. + + - Function: kill-emacs &optional EXIT-DATA + This function exits the XEmacs process and kills it. + + If EXIT-DATA is an integer, then it is used as the exit status of + the XEmacs process. (This is useful primarily in batch operation; + see *Note Batch Mode::.) + + If EXIT-DATA is a string, its contents are stuffed into the + terminal input buffer so that the shell (or whatever program next + reads input) can read them. + + All the information in the XEmacs process, aside from files that have +been saved, is lost when the XEmacs is killed. Because killing XEmacs +inadvertently can lose a lot of work, XEmacs queries for confirmation +before actually terminating if you have buffers that need saving or +subprocesses that are running. This is done in the function +`save-buffers-kill-emacs'. + + - Variable: kill-emacs-query-functions + After asking the standard questions, `save-buffers-kill-emacs' + calls the functions in the list `kill-buffer-query-functions', in + order of appearance, with no arguments. These functions can ask + for additional confirmation from the user. If any of them returns + non-`nil', XEmacs is not killed. + + - Variable: kill-emacs-hook + This variable is a normal hook; once `save-buffers-kill-emacs' is + finished with all file saving and confirmation, it runs the + functions in this hook. + + +File: lispref.info, Node: Suspending XEmacs, Prev: Killing XEmacs, Up: Getting Out + +Suspending XEmacs +----------------- + + "Suspending XEmacs" means stopping XEmacs temporarily and returning +control to its superior process, which is usually the shell. This +allows you to resume editing later in the same XEmacs process, with the +same buffers, the same kill ring, the same undo history, and so on. To +resume XEmacs, use the appropriate command in the parent shell--most +likely `fg'. + + Some operating systems do not support suspension of jobs; on these +systems, "suspension" actually creates a new shell temporarily as a +subprocess of XEmacs. Then you would exit the shell to return to +XEmacs. + + Suspension is not useful with window systems such as X, because the +XEmacs job may not have a parent that can resume it again, and in any +case you can give input to some other job such as a shell merely by +moving to a different window. Therefore, suspending is not allowed +when XEmacs is an X client. + + - Function: suspend-emacs STRING + This function stops XEmacs and returns control to the superior + process. If and when the superior process resumes XEmacs, + `suspend-emacs' returns `nil' to its caller in Lisp. + + If STRING is non-`nil', its characters are sent to be read as + terminal input by XEmacs's superior shell. The characters in + STRING are not echoed by the superior shell; only the results + appear. + + Before suspending, `suspend-emacs' runs the normal hook + `suspend-hook'. In Emacs version 18, `suspend-hook' was not a + normal hook; its value was a single function, and if its value was + non-`nil', then `suspend-emacs' returned immediately without + actually suspending anything. + + After the user resumes XEmacs, `suspend-emacs' runs the normal hook + `suspend-resume-hook'. *Note Hooks::. + + The next redisplay after resumption will redraw the entire screen, + unless the variable `no-redraw-on-reenter' is non-`nil' (*note + Refresh Screen::.). + + In the following example, note that `pwd' is not echoed after + XEmacs is suspended. But it is read and executed by the shell. + + (suspend-emacs) + => nil + + (add-hook 'suspend-hook + (function (lambda () + (or (y-or-n-p + "Really suspend? ") + (error "Suspend cancelled"))))) + => (lambda nil + (or (y-or-n-p "Really suspend? ") + (error "Suspend cancelled"))) + + (add-hook 'suspend-resume-hook + (function (lambda () (message "Resumed!")))) + => (lambda nil (message "Resumed!")) + + (suspend-emacs "pwd") + => nil + + ---------- Buffer: Minibuffer ---------- + Really suspend? y + ---------- Buffer: Minibuffer ---------- + + ---------- Parent Shell ---------- + lewis@slug[23] % /user/lewis/manual + lewis@slug[24] % fg + + ---------- Echo Area ---------- + Resumed! + + - Variable: suspend-hook + This variable is a normal hook run before suspending. + + - Variable: suspend-resume-hook + This variable is a normal hook run after suspending. + + +File: lispref.info, Node: System Environment, Next: User Identification, Prev: Getting Out, Up: System Interface + +Operating System Environment +============================ + + XEmacs provides access to variables in the operating system +environment through various functions. These variables include the +name of the system, the user's UID, and so on. + + - Variable: system-type + The value of this variable is a symbol indicating the type of + operating system XEmacs is operating on. Here is a table of the + possible values: + + `aix-v3' + AIX. + + `berkeley-unix' + Berkeley BSD. + + `dgux' + Data General DGUX operating system. + + `gnu' + A GNU system using the GNU HURD and Mach. + + `hpux' + Hewlett-Packard HPUX operating system. + + `irix' + Silicon Graphics Irix system. + + `linux' + A GNU system using the Linux kernel. + + `ms-dos' + Microsoft MS-DOS "operating system." + + `next-mach' + NeXT Mach-based system. + + `rtu' + Masscomp RTU, UCB universe. + + `unisoft-unix' + UniSoft UniPlus. + + `usg-unix-v' + AT&T System V. + + `vax-vms' + VAX VMS. + + `windows-nt' + Microsoft windows NT. + + `xenix' + SCO Xenix 386. + + We do not wish to add new symbols to make finer distinctions + unless it is absolutely necessary! In fact, we hope to eliminate + some of these alternatives in the future. We recommend using + `system-configuration' to distinguish between different operating + systems. + + - Variable: system-configuration + This variable holds the three-part configuration name for the + hardware/software configuration of your system, as a string. The + convenient way to test parts of this string is with `string-match'. + + - Function: system-name + This function returns the name of the machine you are running on. + (system-name) + => "prep.ai.mit.edu" + + The symbol `system-name' is a variable as well as a function. In +fact, the function returns whatever value the variable `system-name' +currently holds. Thus, you can set the variable `system-name' in case +Emacs is confused about the name of your system. The variable is also +useful for constructing frame titles (*note Frame Titles::.). + + - Variable: mail-host-address + If this variable is non-`nil', it is used instead of `system-name' + for purposes of generating email addresses. For example, it is + used when constructing the default value of `user-mail-address'. + *Note User Identification::. (Since this is done when XEmacs + starts up, the value actually used is the one saved when XEmacs + was dumped. *Note Building XEmacs::.) + + - Function: getenv VAR + This function returns the value of the environment variable VAR, + as a string. Within XEmacs, the environment variable values are + kept in the Lisp variable `process-environment'. + + (getenv "USER") + => "lewis" + + lewis@slug[10] % printenv + PATH=.:/user/lewis/bin:/usr/bin:/usr/local/bin + USER=lewis + TERM=ibmapa16 + SHELL=/bin/csh + HOME=/user/lewis + + - Command: setenv VARIABLE VALUE + This command sets the value of the environment variable named + VARIABLE to VALUE. Both arguments should be strings. This + function works by modifying `process-environment'; binding that + variable with `let' is also reasonable practice. + + - Variable: process-environment + This variable is a list of strings, each describing one environment + variable. The functions `getenv' and `setenv' work by means of + this variable. + + process-environment + => ("l=/usr/stanford/lib/gnuemacs/lisp" + "PATH=.:/user/lewis/bin:/usr/class:/nfsusr/local/bin" + "USER=lewis" + + "TERM=ibmapa16" + "SHELL=/bin/csh" + "HOME=/user/lewis") + + - Variable: path-separator + This variable holds a string which says which character separates + directories in a search path (as found in an environment + variable). Its value is `":"' for Unix and GNU systems, and `";"' + for MS-DOS and Windows NT. + + - Variable: invocation-name + This variable holds the program name under which Emacs was + invoked. The value is a string, and does not include a directory + name. + + - Variable: invocation-directory + This variable holds the directory from which the Emacs executable + was invoked, or perhaps `nil' if that directory cannot be + determined. + + - Variable: installation-directory + If non-`nil', this is a directory within which to look for the + `lib-src' and `etc' subdirectories. This is non-`nil' when Emacs + can't find those directories in their standard installed + locations, but can find them in a directory related somehow to the + one containing the Emacs executable. + + - Function: load-average &optional USE-FLOATS + This function returns a list of the current 1-minute, 5-minute and + 15-minute load averages. The values are integers that are 100 + times the system load averages. (The load averages indicate the + number of processes trying to run.) + + When USE-FLOATS is non-`nil', floats will be returned instead of + integers. These floats are not multiplied by 100. + + (load-average) + => (169 158 164) + (load-average t) + => (1.69921875 1.58984375 1.640625) + + lewis@rocky[5] % uptime + 8:06pm up 16 day(s), 21:57, 40 users, + load average: 1.68, 1.59, 1.64 + + If the 5-minute or 15-minute load averages are not available, + return a shortened list, containing only those averages which are + available. + + On some systems, this function may require special privileges to + run, or it may be unimplemented for the particular system type. + In that case, the function will signal an error. + + - Function: emacs-pid + This function returns the process ID of the Emacs process. + + - Function: setprv PRIVILEGE-NAME &optional SETP GETPRV + This function sets or resets a VMS privilege. (It does not exist + on Unix.) The first arg is the privilege name, as a string. The + second argument, SETP, is `t' or `nil', indicating whether the + privilege is to be turned on or off. Its default is `nil'. The + function returns `t' if successful, `nil' otherwise. + + If the third argument, GETPRV, is non-`nil', `setprv' does not + change the privilege, but returns `t' or `nil' indicating whether + the privilege is currently enabled. + + +File: lispref.info, Node: User Identification, Next: Time of Day, Prev: System Environment, Up: System Interface + +User Identification +=================== + + - Variable: user-mail-address + This holds the nominal email address of the user who is using + Emacs. When Emacs starts up, it computes a default value that is + usually right, but users often set this themselves when the + default value is not right. + + - Function: user-login-name &optional UID + If you don't specify UID, this function returns the name under + which the user is logged in. If the environment variable `LOGNAME' + is set, that value is used. Otherwise, if the environment variable + `USER' is set, that value is used. Otherwise, the value is based + on the effective UID, not the real UID. + + If you specify UID, the value is the user name that corresponds to + UID (which should be an integer). + + (user-login-name) + => "lewis" + + - Function: user-real-login-name + This function returns the user name corresponding to Emacs's real + UID. This ignores the effective UID and ignores the environment + variables `LOGNAME' and `USER'. + + - Variable: user-full-name + This variable holds the name of the user running this Emacs. It is + initialized at startup time from the value of `NAME' environment + variable. You can change the value of this variable to alter the + result of the `user-full-name' function. + + - Function: user-full-name &optional USER + This function returns the full name of USER. If USER is `nil', it + defaults to the user running this Emacs. In that case, the value + of `user-full-name' variable, if non-`nil', will be used. + + If USER is specified explicitly, `user-full-name' variable is + ignored. + + (user-full-name) + => "Hrvoje Niksic" + (setq user-full-name "Hrvoje \"Niksa\" Niksic") + (user-full-name) + => "Hrvoje \"Niksa\" Niksic" + (user-full-name "hniksic") + => "Hrvoje Niksic" + + The symbols `user-login-name', `user-real-login-name' and +`user-full-name' are variables as well as functions. The functions +return the same values that the variables hold. These variables allow +you to "fake out" Emacs by telling the functions what to return. The +variables are also useful for constructing frame titles (*note Frame +Titles::.). + + - Function: user-real-uid + This function returns the real UID of the user. + + (user-real-uid) + => 19 + + - Function: user-uid + This function returns the effective UID of the user. + + - Function: user-home-directory + This function returns the "`HOME'" directory of the user, and is + intended to replace occurrences of "`(getenv "HOME")'". Under + Unix systems, the following is done: + + 1. Return the value of "`(getenv "HOME")'", if set. + + 2. Return "/", as a fallback, but issue a warning. (Future + versions of XEmacs will also attempt to lookup the `HOME' + directory via `getpwent()', but this has not yet been + implemented.) + + Under MS Windows, this is done: + + 1. Return the value of "`(getenv "HOME")'", if set. + + 2. If the environment variables `HOMEDRIVE' and `HOMEDIR' are + both set, return the concatenation (the following description + uses MS Windows environment variable substitution syntax): + `%HOMEDRIVE%%HOMEDIR%'. + + 3. Return "C:\", as a fallback, but issue a warning. + + +File: lispref.info, Node: Time of Day, Next: Time Conversion, Prev: User Identification, Up: System Interface + +Time of Day +=========== + + This section explains how to determine the current time and the time +zone. + + - Function: current-time-string &optional TIME-VALUE + This function returns the current time and date as a + humanly-readable string. The format of the string is unvarying; + the number of characters used for each part is always the same, so + you can reliably use `substring' to extract pieces of it. It is + wise to count the characters from the beginning of the string + rather than from the end, as additional information may be added + at the end. + + The argument TIME-VALUE, if given, specifies a time to format + instead of the current time. The argument should be a list whose + first two elements are integers. Thus, you can use times obtained + from `current-time' (see below) and from `file-attributes' (*note + File Attributes::.). + + (current-time-string) + => "Wed Oct 14 22:21:05 1987" + + - Function: current-time + This function returns the system's time value as a list of three + integers: `(HIGH LOW MICROSEC)'. The integers HIGH and LOW + combine to give the number of seconds since 0:00 January 1, 1970, + which is HIGH * 2**16 + LOW. + + The third element, MICROSEC, gives the microseconds since the + start of the current second (or 0 for systems that return time + only on the resolution of a second). + + The first two elements can be compared with file time values such + as you get with the function `file-attributes'. *Note File + Attributes::. + + - Function: current-time-zone &optional TIME-VALUE + This function returns a list describing the time zone that the + user is in. + + The value has the form `(OFFSET NAME)'. Here OFFSET is an integer + giving the number of seconds ahead of UTC (east of Greenwich). A + negative value means west of Greenwich. The second element, NAME + is a string giving the name of the time zone. Both elements + change when daylight savings time begins or ends; if the user has + specified a time zone that does not use a seasonal time + adjustment, then the value is constant through time. + + If the operating system doesn't supply all the information + necessary to compute the value, both elements of the list are + `nil'. + + The argument TIME-VALUE, if given, specifies a time to analyze + instead of the current time. The argument should be a cons cell + containing two integers, or a list whose first two elements are + integers. Thus, you can use times obtained from `current-time' + (see above) and from `file-attributes' (*note File Attributes::.). + + +File: lispref.info, Node: Time Conversion, Next: Timers, Prev: Time of Day, Up: System Interface + +Time Conversion +=============== + + These functions convert time values (lists of two or three integers) +to strings or to calendrical information. There is also a function to +convert calendrical information to a time value. You can get time +values from the functions `current-time' (*note Time of Day::.) and +`file-attributes' (*note File Attributes::.). + + - Function: format-time-string FORMAT-STRING &optional TIME + This function converts TIME to a string according to + FORMAT-STRING. If TIME is omitted, it defaults to the current + time. The argument FORMAT-STRING may contain `%'-sequences which + say to substitute parts of the time. Here is a table of what the + `%'-sequences mean: + + `%a' + This stands for the abbreviated name of the day of week. + + `%A' + This stands for the full name of the day of week. + + `%b' + This stands for the abbreviated name of the month. + + `%B' + This stands for the full name of the month. + + `%c' + This is a synonym for `%x %X'. + + `%C' + This has a locale-specific meaning. In the default locale + (named C), it is equivalent to `%A, %B %e, %Y'. + + `%d' + This stands for the day of month, zero-padded. + + `%D' + This is a synonym for `%m/%d/%y'. + + `%e' + This stands for the day of month, blank-padded. + + `%h' + This is a synonym for `%b'. + + `%H' + This stands for the hour (00-23). + + `%I' + This stands for the hour (00-12). + + `%j' + This stands for the day of the year (001-366). + + `%k' + This stands for the hour (0-23), blank padded. + + `%l' + This stands for the hour (1-12), blank padded. + + `%m' + This stands for the month (01-12). + + `%M' + This stands for the minute (00-59). + + `%n' + This stands for a newline. + + `%p' + This stands for `AM' or `PM', as appropriate. + + `%r' + This is a synonym for `%I:%M:%S %p'. + + `%R' + This is a synonym for `%H:%M'. + + `%S' + This stands for the seconds (00-60). + + `%t' + This stands for a tab character. + + `%T' + This is a synonym for `%H:%M:%S'. + + `%U' + This stands for the week of the year (01-52), assuming that + weeks start on Sunday. + + `%w' + This stands for the numeric day of week (0-6). Sunday is day + 0. + + `%W' + This stands for the week of the year (01-52), assuming that + weeks start on Monday. + + `%x' + This has a locale-specific meaning. In the default locale + (named C), it is equivalent to `%D'. + + `%X' + This has a locale-specific meaning. In the default locale + (named C), it is equivalent to `%T'. + + `%y' + This stands for the year without century (00-99). + + `%Y' + This stands for the year with century. + + `%Z' + This stands for the time zone abbreviation. + + - Function: decode-time TIME + This function converts a time value into calendrical information. + The return value is a list of nine elements, as follows: + + (SECONDS MINUTES HOUR DAY MONTH YEAR DOW DST ZONE) + + Here is what the elements mean: + + SEC + The number of seconds past the minute, as an integer between + 0 and 59. + + MINUTE + The number of minutes past the hour, as an integer between 0 + and 59. + + HOUR + The hour of the day, as an integer between 0 and 23. + + DAY + The day of the month, as an integer between 1 and 31. + + MONTH + The month of the year, as an integer between 1 and 12. + + YEAR + The year, an integer typically greater than 1900. + + DOW + The day of week, as an integer between 0 and 6, where 0 + stands for Sunday. + + DST + `t' if daylight savings time is effect, otherwise `nil'. + + ZONE + An integer indicating the time zone, as the number of seconds + east of Greenwich. + + Note that Common Lisp has different meanings for DOW and ZONE. + + - Function: encode-time SECONDS MINUTES HOUR DAY MONTH YEAR &optional + ZONE + This function is the inverse of `decode-time'. It converts seven + items of calendrical data into a time value. For the meanings of + the arguments, see the table above under `decode-time'. + + Year numbers less than 100 are treated just like other year + numbers. If you want them to stand for years above 1900, you must + alter them yourself before you call `encode-time'. + + The optional argument ZONE defaults to the current time zone and + its daylight savings time rules. If specified, it can be either a + list (as you would get from `current-time-zone') or an integer (as + you would get from `decode-time'). The specified zone is used + without any further alteration for daylight savings time. + + +File: lispref.info, Node: Timers, Next: Terminal Input, Prev: Time Conversion, Up: System Interface + +Timers for Delayed Execution +============================ + + You can set up a timer to call a function at a specified future time. + + - Function: add-timeout SECS FUNCTION OBJECT &optional RESIGNAL + This function adds a timeout, to be signaled after the timeout + period has elapsed. SECS is a number of seconds, expressed as an + integer or a float. FUNCTION will be called after that many + seconds have elapsed, with one argument, the given OBJECT. If the + optional RESIGNAL argument is provided, then after this timeout + expires, `add-timeout' will automatically be called again with + RESIGNAL as the first argument. + + This function returns an object which is the "id" of this + particular timeout. You can pass that object to `disable-timeout' + to turn off the timeout before it has been signalled. + + The number of seconds may be expressed as a floating-point number, + in which case some fractional part of a second will be used. + Caveat: the usable timeout granularity will vary from system to + system. + + Adding a timeout causes a timeout event to be returned by + `next-event', and the function will be invoked by + `dispatch-event', so if XEmacs is in a tight loop, the function + will not be invoked until the next call to sit-for or until the + return to top-level (the same is true of process filters). + + WARNING: if you are thinking of calling add-timeout from inside of + a callback function as a way of resignalling a timeout, think + again. There is a race condition. That's why the RESIGNAL + argument exists. + + (NOTE: In FSF Emacs, this function is called `run-at-time' and has + different semantics.) + + - Function: disable-timeout ID + Cancel the requested action for ID, which should be a value + previously returned by `add-timeout'. This cancels the effect of + that call to `add-timeout'; the arrival of the specified time will + not cause anything special to happen. (NOTE: In FSF Emacs, this + function is called `cancel-timer'.) + + +File: lispref.info, Node: Terminal Input, Next: Terminal Output, Prev: Timers, Up: System Interface + +Terminal Input +============== + + This section describes functions and variables for recording or +manipulating terminal input. See *Note Display::, for related +functions. + +* Menu: + +* Input Modes:: Options for how input is processed. +* Translating Input:: Low level conversion of some characters or events + into others. +* Recording Input:: Saving histories of recent or all input events. + + +File: lispref.info, Node: Input Modes, Next: Translating Input, Up: Terminal Input + +Input Modes +----------- + + - Function: set-input-mode INTERRUPT FLOW META QUIT-CHAR + This function sets the mode for reading keyboard input. If + INTERRUPT is non-null, then XEmacs uses input interrupts. If it is + `nil', then it uses CBREAK mode. When XEmacs communicates + directly with X, it ignores this argument and uses interrupts if + that is the way it knows how to communicate. + + If FLOW is non-`nil', then XEmacs uses XON/XOFF (`C-q', `C-s') + flow control for output to the terminal. This has no effect except + in CBREAK mode. *Note Flow Control::. + + The default setting is system dependent. Some systems always use + CBREAK mode regardless of what is specified. + + The argument META controls support for input character codes above + 127. If META is `t', XEmacs converts characters with the 8th bit + set into Meta characters. If META is `nil', XEmacs disregards the + 8th bit; this is necessary when the terminal uses it as a parity + bit. If META is neither `t' nor `nil', XEmacs uses all 8 bits of + input unchanged. This is good for terminals using European 8-bit + character sets. + + If QUIT-CHAR is non-`nil', it specifies the character to use for + quitting. Normally this character is `C-g'. *Note Quitting::. + + The `current-input-mode' function returns the input mode settings +XEmacs is currently using. + + - Function: current-input-mode + This function returns current mode for reading keyboard input. It + returns a list, corresponding to the arguments of `set-input-mode', + of the form `(INTERRUPT FLOW META QUIT)' in which: + INTERRUPT + is non-`nil' when XEmacs is using interrupt-driven input. If + `nil', Emacs is using CBREAK mode. + + FLOW + is non-`nil' if XEmacs uses XON/XOFF (`C-q', `C-s') flow + control for output to the terminal. This value has no effect + unless INTERRUPT is non-`nil'. + + META + is `t' if XEmacs treats the eighth bit of input characters as + the meta bit; `nil' means XEmacs clears the eighth bit of + every input character; any other value means XEmacs uses all + eight bits as the basic character code. + + QUIT + is the character XEmacs currently uses for quitting, usually + `C-g'. + + +File: lispref.info, Node: Translating Input, Next: Recording Input, Prev: Input Modes, Up: Terminal Input + +Translating Input Events +------------------------ + + This section describes features for translating input events into +other input events before they become part of key sequences. + + - Variable: function-key-map + This variable holds a keymap that describes the character sequences + sent by function keys on an ordinary character terminal. This + keymap uses the same data structure as other keymaps, but is used + differently: it specifies translations to make while reading + events. + + If `function-key-map' "binds" a key sequence K to a vector V, then + when K appears as a subsequence *anywhere* in a key sequence, it + is replaced with the events in V. + + For example, VT100 terminals send ` O P' when the keypad PF1 + key is pressed. Therefore, we want XEmacs to translate that + sequence of events into the single event `pf1'. We accomplish + this by "binding" ` O P' to `[pf1]' in `function-key-map', + when using a VT100. + + Thus, typing `C-c ' sends the character sequence `C-c O + P'; later the function `read-key-sequence' translates this back + into `C-c ', which it returns as the vector `[?\C-c pf1]'. + + Entries in `function-key-map' are ignored if they conflict with + bindings made in the minor mode, local, or global keymaps. The + intent is that the character sequences that function keys send + should not have command bindings in their own right. + + The value of `function-key-map' is usually set up automatically + according to the terminal's Terminfo or Termcap entry, but + sometimes those need help from terminal-specific Lisp files. + XEmacs comes with terminal-specific files for many common + terminals; their main purpose is to make entries in + `function-key-map' beyond those that can be deduced from Termcap + and Terminfo. *Note Terminal-Specific::. + + Emacs versions 18 and earlier used totally different means of + detecting the character sequences that represent function keys. + + - Variable: key-translation-map + This variable is another keymap used just like `function-key-map' + to translate input events into other events. It differs from + `function-key-map' in two ways: + + * `key-translation-map' goes to work after `function-key-map' is + finished; it receives the results of translation by + `function-key-map'. + + * `key-translation-map' overrides actual key bindings. + + The intent of `key-translation-map' is for users to map one + character set to another, including ordinary characters normally + bound to `self-insert-command'. + + You can use `function-key-map' or `key-translation-map' for more +than simple aliases, by using a function, instead of a key sequence, as +the "translation" of a key. Then this function is called to compute +the translation of that key. + + The key translation function receives one argument, which is the +prompt that was specified in `read-key-sequence'--or `nil' if the key +sequence is being read by the editor command loop. In most cases you +can ignore the prompt value. + + If the function reads input itself, it can have the effect of +altering the event that follows. For example, here's how to define +`C-c h' to turn the character that follows into a Hyper character: + + (defun hyperify (prompt) + (let ((e (read-event))) + (vector (if (numberp e) + (logior (lsh 1 20) e) + (if (memq 'hyper (event-modifiers e)) + e + (add-event-modifier "H-" e)))))) + + (defun add-event-modifier (string e) + (let ((symbol (if (symbolp e) e (car e)))) + (setq symbol (intern (concat string + (symbol-name symbol)))) + (if (symbolp e) + symbol + (cons symbol (cdr e))))) + + (define-key function-key-map "\C-ch" 'hyperify) + + The `iso-transl' library uses this feature to provide a way of +inputting non-ASCII Latin-1 characters. + + +File: lispref.info, Node: Recording Input, Prev: Translating Input, Up: Terminal Input + +Recording Input +--------------- + + - Function: recent-keys &optional NUMBER + This function returns a vector containing recent input events from + the keyboard or mouse. By default, 100 events are recorded, which + is how many `recent-keys' returns. + + All input events are included, whether or not they were used as + parts of key sequences. Thus, you always get the last 100 inputs, + not counting keyboard macros. (Events from keyboard macros are + excluded because they are less interesting for debugging; it + should be enough to see the events that invoked the macros.) + + If NUMBER is specified, not more than NUMBER events will be + returned. You may change the number of stored events using + `set-recent-keys-ring-size'. + + - Function: recent-keys-ring-size + This function returns the number of recent events stored + internally. This is also the maximum number of events + `recent-keys' can return. By default, 100 events are stored. + + - Function: set-recent-keys-ring-size SIZE + This function changes the number of events stored by XEmacs and + returned by `recent-keys'. + + For example, `(set-recent-keys-ring-size 250)' will make XEmacs + remember last 250 events and will make `recent-keys' return last + 250 events by default. + + - Command: open-dribble-file FILENAME + This function opens a "dribble file" named FILENAME. When a + dribble file is open, each input event from the keyboard or mouse + (but not those from keyboard macros) is written in that file. A + non-character event is expressed using its printed representation + surrounded by `<...>'. + + You close the dribble file by calling this function with an + argument of `nil'. + + This function is normally used to record the input necessary to + trigger an XEmacs bug, for the sake of a bug report. + + (open-dribble-file "~/dribble") + => nil + + See also the `open-termscript' function (*note Terminal Output::.). + diff --git a/info/lispref.info-4 b/info/lispref.info-4 index 5f78301..096f2d3 100644 --- a/info/lispref.info-4 +++ b/info/lispref.info-4 @@ -1,5 +1,5 @@ -This is ../info/lispref.info, produced by makeinfo version 4.0 from -lispref/lispref.texi. +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -445,10 +445,10 @@ with references to further information. The most general way to check the type of an object is to call the function `type-of'. Recall that each object belongs to one and only one primitive type; `type-of' tells you which one (*note Lisp Data -Types::). But `type-of' knows nothing about non-primitive types. In +Types::.). But `type-of' knows nothing about non-primitive types. In most cases, it is more convenient to use type predicates than `type-of'. - - Function: type-of object + - Function: type-of OBJECT This function returns a symbol naming the primitive type of OBJECT. The value is one of `bit-vector', `buffer', `char-table', `character', `charset', `coding-system', `cons', `color-instance', @@ -480,7 +480,7 @@ objects. Other functions test equality between objects of specific types, e.g., strings. For these predicates, see the appropriate chapter describing the data type. - - Function: eq object1 object2 + - Function: eq OBJECT1 OBJECT2 This function returns `t' if OBJECT1 and OBJECT2 are the same object, `nil' otherwise. The "same object" means that a change in one will be reflected by the same change in the other. @@ -530,12 +530,12 @@ describing the data type. => nil - - Function: old-eq object1 object2 + - Function: old-eq OBJ1 OBJ2 This function exists under XEmacs 20 and is exactly like `eq' except that it suffers from the char-int confoundance disease. In other words, it returns `t' if given a character and the equivalent integer, even though the objects are of different types! - You should _not_ ever call this function explicitly in your code. + You should *not* ever call this function explicitly in your code. However, be aware that all calls to `eq' in byte code compiled under version 19 map to `old-eq' in XEmacs 20. (Likewise for `old-equal', `old-memq', `old-member', `old-assq' and @@ -551,7 +551,7 @@ describing the data type. (eq ?A 65) => nil ; We are still healthy. - - Function: equal object1 object2 + - Function: equal OBJECT1 OBJECT2 This function returns `t' if OBJECT1 and OBJECT2 have equal components, `nil' otherwise. Whereas `eq' tests if its arguments are the same object, `equal' looks inside nonidentical arguments @@ -655,7 +655,7 @@ optional initial sign and optional final period. -0 ; The integer 0. To understand how various functions work on integers, especially the -bitwise operators (*note Bitwise Operations::), it is often helpful to +bitwise operators (*note Bitwise Operations::.), it is often helpful to view the numbers in their binary form. In 28-bit binary, the decimal integer 5 looks like this: @@ -727,7 +727,7 @@ NaNs or infinities; perhaps we should create a syntax in the future. You can use `logb' to extract the binary exponent of a floating point number (or estimate the logarithm of an integer): - - Function: logb number + - Function: logb NUMBER This function returns the binary exponent of NUMBER. More precisely, the value is the logarithm of NUMBER base 2, rounded down to an integer. @@ -746,27 +746,27 @@ predicate requires a number as its argument. See also `integer-or-marker-p', `integer-char-or-marker-p', `number-or-marker-p' and `number-char-or-marker-p', in *Note Predicates on Markers::. - - Function: floatp object + - Function: floatp OBJECT This predicate tests whether its argument is a floating point number and returns `t' if so, `nil' otherwise. `floatp' does not exist in Emacs versions 18 and earlier. - - Function: integerp object + - Function: integerp OBJECT This predicate tests whether its argument is an integer, and returns `t' if so, `nil' otherwise. - - Function: numberp object + - Function: numberp OBJECT This predicate tests whether its argument is a number (either integer or floating point), and returns `t' if so, `nil' otherwise. - - Function: natnump object + - Function: natnump OBJECT The `natnump' predicate (whose name comes from the phrase "natural-number-p") tests to see whether its argument is a nonnegative integer, and returns `t' if so, `nil' otherwise. 0 is considered non-negative. - - Function: zerop number + - Function: zerop NUMBER This predicate tests whether its argument is zero, and returns `t' if so, `nil' otherwise. The argument must be a number. @@ -781,7 +781,7 @@ Comparison of Numbers To test numbers for numerical equality, you should normally use `=', not `eq'. There can be many distinct floating point number objects with the same numeric value. If you use `eq' to compare them, then you -test whether two values are the same _object_. By contrast, `=' +test whether two values are the same *object*. By contrast, `=' compares only the numeric values of the objects. At present, each integer value has a unique Lisp object in XEmacs @@ -816,7 +816,7 @@ Here's a function to do this: characters and markers as arguments, and treat them as their number equivalents. - - Function: = number &rest more-numbers + - Function: = NUMBER &rest MORE-NUMBERS This function returns `t' if all of its arguments are numerically equal, `nil' otherwise. @@ -829,7 +829,7 @@ equivalents. (= 5 5 6) => nil - - Function: /= number &rest more-numbers + - Function: /= NUMBER &rest MORE-NUMBERS This function returns `t' if no two arguments are numerically equal, `nil' otherwise. @@ -840,7 +840,7 @@ equivalents. (/= 5 6 1) => t - - Function: < number &rest more-numbers + - Function: < NUMBER &rest MORE-NUMBERS This function returns `t' if the sequence of its arguments is monotonically increasing, `nil' otherwise. @@ -851,7 +851,7 @@ equivalents. (< 5 6 7) => t - - Function: <= number &rest more-numbers + - Function: <= NUMBER &rest MORE-NUMBERS This function returns `t' if the sequence of its arguments is monotonically nondecreasing, `nil' otherwise. @@ -862,15 +862,15 @@ equivalents. (<= 5 6 5) => nil - - Function: > number &rest more-numbers + - Function: > NUMBER &rest MORE-NUMBERS This function returns `t' if the sequence of its arguments is monotonically decreasing, `nil' otherwise. - - Function: >= number &rest more-numbers + - Function: >= NUMBER &rest MORE-NUMBERS This function returns `t' if the sequence of its arguments is monotonically nonincreasing, `nil' otherwise. - - Function: max number &rest more-numbers + - Function: max NUMBER &rest MORE-NUMBERS This function returns the largest of its arguments. (max 20) @@ -880,7 +880,7 @@ equivalents. (max 1 3 2.5) => 3 - - Function: min number &rest more-numbers + - Function: min NUMBER &rest MORE-NUMBERS This function returns the smallest of its arguments. (min -4 1) @@ -894,7 +894,7 @@ Numeric Conversions To convert an integer to floating point, use the function `float'. - - Function: float number + - Function: float NUMBER This returns NUMBER converted to floating point. If NUMBER is already a floating point number, `float' returns it unchanged. @@ -902,11 +902,11 @@ Numeric Conversions integers; they differ in how they round. These functions accept integer arguments also, and return such arguments unchanged. - - Function: truncate number + - Function: truncate NUMBER This returns NUMBER, converted to an integer by rounding towards zero. - - Function: floor number &optional divisor + - Function: floor NUMBER &optional DIVISOR This returns NUMBER, converted to an integer by rounding downward (towards negative infinity). @@ -914,11 +914,11 @@ integer arguments also, and return such arguments unchanged. floor is taken; this is the division operation that corresponds to `mod'. An `arith-error' results if DIVISOR is 0. - - Function: ceiling number + - Function: ceiling NUMBER This returns NUMBER, converted to an integer by rounding upward (towards positive infinity). - - Function: round number + - Function: round NUMBER This returns NUMBER, converted to an integer by rounding towards the nearest integer. Rounding a value equidistant between two integers may choose the integer closer to zero, or it may prefer @@ -943,12 +943,8 @@ any argument is floating. not check for overflow. Thus `(1+ 134217727)' may evaluate to -134217728, depending on your hardware. - - Function: 1+ number - This function returns NUMBER plus one. NUMBER may be a number, - character or marker. Markers and characters are converted to - integers. - - For example, + - Function: 1+ NUMBER-OR-MARKER + This function returns NUMBER-OR-MARKER plus 1. For example, (setq foo 4) => 4 @@ -972,21 +968,16 @@ not check for overflow. Thus `(1+ 134217727)' may evaluate to more convenient and natural way to increment a variable is `(incf foo)'. - - Function: 1- number - This function returns NUMBER minus one. NUMBER may be a number, - character or marker. Markers and characters are converted to - integers. + - Function: 1- NUMBER-OR-MARKER + This function returns NUMBER-OR-MARKER minus 1. - - Function: abs number + - Function: abs NUMBER This returns the absolute value of NUMBER. - - Function: + &rest numbers + - Function: + &rest NUMBERS-OR-MARKERS This function adds its arguments together. When given no arguments, `+' returns 0. - If any of the arguments are characters or markers, they are first - converted to integers. - (+) => 0 (+ 1) @@ -994,15 +985,12 @@ not check for overflow. Thus `(1+ 134217727)' may evaluate to (+ 1 2 3 4) => 10 - - Function: - &optional number &rest other-numbers + - Function: - &optional NUMBER-OR-MARKER &rest OTHER-NUMBERS-OR-MARKERS The `-' function serves two purposes: negation and subtraction. When `-' has a single argument, the value is the negative of the argument. When there are multiple arguments, `-' subtracts each of - the OTHER-NUMBERS from NUMBER, cumulatively. If there are no - arguments, an error is signaled. - - If any of the arguments are characters or markers, they are first - converted to integers. + the OTHER-NUMBERS-OR-MARKERS from NUMBER-OR-MARKER, cumulatively. + If there are no arguments, the result is 0. (- 10 1 2 3 4) => 0 @@ -1011,13 +999,10 @@ not check for overflow. Thus `(1+ 134217727)' may evaluate to (-) => 0 - - Function: * &rest numbers + - Function: * &rest NUMBERS-OR-MARKERS This function multiplies its arguments together, and returns the product. When given no arguments, `*' returns 1. - If any of the arguments are characters or markers, they are first - converted to integers. - (*) => 1 (* 1) @@ -1025,24 +1010,20 @@ not check for overflow. Thus `(1+ 134217727)' may evaluate to (* 1 2 3 4) => 24 - - Function: / dividend &rest divisors - The `/' function serves two purposes: inversion and division. When - `/' has a single argument, the value is the inverse of the - argument. When there are multiple arguments, `/' divides DIVIDEND - by each of the DIVISORS, cumulatively, returning the quotient. If - there are no arguments, an error is signaled. + - Function: / DIVIDEND DIVISOR &rest DIVISORS + This function divides DIVIDEND by DIVISOR and returns the + quotient. If there are additional arguments DIVISORS, then it + divides DIVIDEND by each divisor in turn. Each argument may be a + number or a marker. - If none of the arguments are floats, then the result is an integer. - This means the result has to be rounded. On most machines, the - result is rounded towards zero after each division, but some + If all the arguments are integers, then the result is an integer + too. This means the result has to be rounded. On most machines, + the result is rounded towards zero after each division, but some machines may round differently with negative arguments. This is because the Lisp function `/' is implemented using the C division operator, which also permits machine-dependent rounding. As a practical matter, all known machines round in the standard fashion. - If any of the arguments are characters or markers, they are first - converted to integers. - If you divide by 0, an `arith-error' error is signaled. (*Note Errors::.) @@ -1052,15 +1033,13 @@ not check for overflow. Thus `(1+ 134217727)' may evaluate to => 2 (/ 25 3 2) => 4 - (/ 3.0) - => 0.3333333333333333 (/ -17 6) => -2 The result of `(/ -17 6)' could in principle be -3 on some machines. - - Function: % dividend divisor + - Function: % DIVIDEND DIVISOR This function returns the integer remainder after division of DIVIDEND by DIVISOR. The arguments must be integers or markers. @@ -1086,7 +1065,7 @@ not check for overflow. Thus `(1+ 134217727)' may evaluate to always equals DIVIDEND. - - Function: mod dividend divisor + - Function: mod DIVIDEND DIVISOR This function returns the value of DIVIDEND modulo DIVISOR; in other words, the remainder after division of DIVIDEND by DIVISOR, but with the same sign as DIVISOR. The arguments must be numbers @@ -1131,20 +1110,20 @@ is a nearby integer. `ffloor' returns the nearest integer below; `fceiling', the nearest integer above; `ftruncate', the nearest integer in the direction towards zero; `fround', the nearest integer. - - Function: ffloor number - This function rounds NUMBER to the next lower integral value, and + - Function: ffloor FLOAT + This function rounds FLOAT to the next lower integral value, and returns that value as a floating point number. - - Function: fceiling number - This function rounds NUMBER to the next higher integral value, and + - Function: fceiling FLOAT + This function rounds FLOAT to the next higher integral value, and returns that value as a floating point number. - - Function: ftruncate number - This function rounds NUMBER towards zero to an integral value, and + - Function: ftruncate FLOAT + This function rounds FLOAT towards zero to an integral value, and returns that value as a floating point number. - - Function: fround number - This function rounds NUMBER to the nearest integral value, and + - Function: fround FLOAT + This function rounds FLOAT to the nearest integral value, and returns that value as a floating point number.  @@ -1161,7 +1140,7 @@ reproducing the same pattern "moved over". The bitwise operations in XEmacs Lisp apply only to integers. - - Function: lsh integer1 count + - Function: lsh INTEGER1 COUNT `lsh', which is an abbreviation for "logical shift", shifts the bits in INTEGER1 to the left COUNT places, or to the right if COUNT is negative, bringing zeros into the vacated bits. If COUNT @@ -1229,7 +1208,7 @@ reproducing the same pattern "moved over". ;; Decimal -2 1111 1111 1111 1111 1111 1111 1110 - - Function: ash integer1 count + - Function: ash INTEGER1 COUNT `ash' ("arithmetic shift") shifts the bits in INTEGER1 to the left COUNT places, or to the right if COUNT is negative. @@ -1258,26 +1237,31 @@ reproducing the same pattern "moved over". Here are other examples: - ; 28-bit binary values + ; 28-bit binary values (lsh 5 2) ; 5 = 0000 0000 0000 0000 0000 0000 0101 => 20 ; = 0000 0000 0000 0000 0000 0001 0100 + (ash 5 2) => 20 (lsh -5 2) ; -5 = 1111 1111 1111 1111 1111 1111 1011 => -20 ; = 1111 1111 1111 1111 1111 1110 1100 (ash -5 2) => -20 + (lsh 5 -2) ; 5 = 0000 0000 0000 0000 0000 0000 0101 => 1 ; = 0000 0000 0000 0000 0000 0000 0001 + (ash 5 -2) => 1 + (lsh -5 -2) ; -5 = 1111 1111 1111 1111 1111 1111 1011 => 4194302 ; = 0011 1111 1111 1111 1111 1111 1110 + (ash -5 -2) ; -5 = 1111 1111 1111 1111 1111 1111 1011 => -2 ; = 1111 1111 1111 1111 1111 1111 1110 - - Function: logand &rest ints-or-markers + - Function: logand &rest INTS-OR-MARKERS This function returns the "logical and" of the arguments: the Nth bit is set in the result if, and only if, the Nth bit is set in all the arguments. ("Set" means that the value of the bit is 1 @@ -1301,57 +1285,57 @@ reproducing the same pattern "moved over". representation consists entirely of ones. If `logand' is passed just one argument, it returns that argument. - ; 28-bit binary values + ; 28-bit binary values (logand 14 13) ; 14 = 0000 0000 0000 0000 0000 0000 1110 ; 13 = 0000 0000 0000 0000 0000 0000 1101 => 12 ; 12 = 0000 0000 0000 0000 0000 0000 1100 - + (logand 14 13 4) ; 14 = 0000 0000 0000 0000 0000 0000 1110 ; 13 = 0000 0000 0000 0000 0000 0000 1101 ; 4 = 0000 0000 0000 0000 0000 0000 0100 => 4 ; 4 = 0000 0000 0000 0000 0000 0000 0100 - + (logand) => -1 ; -1 = 1111 1111 1111 1111 1111 1111 1111 - - Function: logior &rest ints-or-markers + - Function: logior &rest INTS-OR-MARKERS This function returns the "inclusive or" of its arguments: the Nth bit is set in the result if, and only if, the Nth bit is set in at least one of the arguments. If there are no arguments, the result is zero, which is an identity element for this operation. If `logior' is passed just one argument, it returns that argument. - ; 28-bit binary values + ; 28-bit binary values (logior 12 5) ; 12 = 0000 0000 0000 0000 0000 0000 1100 ; 5 = 0000 0000 0000 0000 0000 0000 0101 => 13 ; 13 = 0000 0000 0000 0000 0000 0000 1101 - + (logior 12 5 7) ; 12 = 0000 0000 0000 0000 0000 0000 1100 ; 5 = 0000 0000 0000 0000 0000 0000 0101 ; 7 = 0000 0000 0000 0000 0000 0000 0111 => 15 ; 15 = 0000 0000 0000 0000 0000 0000 1111 - - Function: logxor &rest ints-or-markers + - Function: logxor &rest INTS-OR-MARKERS This function returns the "exclusive or" of its arguments: the Nth bit is set in the result if, and only if, the Nth bit is set in an odd number of the arguments. If there are no arguments, the result is 0, which is an identity element for this operation. If `logxor' is passed just one argument, it returns that argument. - ; 28-bit binary values + ; 28-bit binary values (logxor 12 5) ; 12 = 0000 0000 0000 0000 0000 0000 1100 ; 5 = 0000 0000 0000 0000 0000 0000 0101 => 9 ; 9 = 0000 0000 0000 0000 0000 0000 1001 - + (logxor 12 5 7) ; 12 = 0000 0000 0000 0000 0000 0000 1100 ; 5 = 0000 0000 0000 0000 0000 0000 0101 ; 7 = 0000 0000 0000 0000 0000 0000 0111 => 14 ; 14 = 0000 0000 0000 0000 0000 0000 1110 - - Function: lognot integer + - Function: lognot INTEGER This function returns the logical complement of its argument: the Nth bit is one in the result if, and only if, the Nth bit is zero in INTEGER, and vice-versa. @@ -1372,65 +1356,62 @@ Standard Mathematical Functions supported (which is the normal state of affairs). They allow integers as well as floating point numbers as arguments. - - Function: sin number - - Function: cos number - - Function: tan number + - Function: sin ARG + - Function: cos ARG + - Function: tan ARG These are the ordinary trigonometric functions, with argument measured in radians. - - Function: asin number - The value of `(asin NUMBER)' is a number between -pi/2 and pi/2 - (inclusive) whose sine is NUMBER; if, however, NUMBER is out of - range (outside [-1, 1]), then the result is a NaN. - - - Function: acos number - The value of `(acos NUMBER)' is a number between 0 and pi - (inclusive) whose cosine is NUMBER; if, however, NUMBER is out of - range (outside [-1, 1]), then the result is a NaN. + - Function: asin ARG + The value of `(asin ARG)' is a number between -pi/2 and pi/2 + (inclusive) whose sine is ARG; if, however, ARG is out of range + (outside [-1, 1]), then the result is a NaN. - - Function: atan number &optional number2 - The value of `(atan NUMBER)' is a number between -pi/2 and pi/2 - (exclusive) whose tangent is NUMBER. + - Function: acos ARG + The value of `(acos ARG)' is a number between 0 and pi (inclusive) + whose cosine is ARG; if, however, ARG is out of range (outside + [-1, 1]), then the result is a NaN. - If optional argument NUMBER2 is supplied, the function returns - `atan2(NUMBER,NUMBER2)'. + - Function: atan ARG + The value of `(atan ARG)' is a number between -pi/2 and pi/2 + (exclusive) whose tangent is ARG. - - Function: sinh number - - Function: cosh number - - Function: tanh number + - Function: sinh ARG + - Function: cosh ARG + - Function: tanh ARG These are the ordinary hyperbolic trigonometric functions. - - Function: asinh number - - Function: acosh number - - Function: atanh number + - Function: asinh ARG + - Function: acosh ARG + - Function: atanh ARG These are the inverse hyperbolic trigonometric functions. - - Function: exp number - This is the exponential function; it returns e to the power - NUMBER. e is a fundamental mathematical constant also called the - base of natural logarithms. + - Function: exp ARG + This is the exponential function; it returns e to the power ARG. + e is a fundamental mathematical constant also called the base of + natural logarithms. - - Function: log number &optional base - This function returns the logarithm of NUMBER, with base BASE. If - you don't specify BASE, the base E is used. If NUMBER is - negative, the result is a NaN. + - Function: log ARG &optional BASE + This function returns the logarithm of ARG, with base BASE. If + you don't specify BASE, the base E is used. If ARG is negative, + the result is a NaN. - - Function: log10 number - This function returns the logarithm of NUMBER, with base 10. If - NUMBER is negative, the result is a NaN. `(log10 X)' == `(log X - 10)', at least approximately. + - Function: log10 ARG + This function returns the logarithm of ARG, with base 10. If ARG + is negative, the result is a NaN. `(log10 X)' == `(log X 10)', at + least approximately. - - Function: expt x y + - Function: expt X Y This function returns X raised to power Y. If both arguments are integers and Y is positive, the result is an integer; in this case, it is truncated to fit the range of possible integer values. - - Function: sqrt number - This returns the square root of NUMBER. If NUMBER is negative, - the value is a NaN. + - Function: sqrt ARG + This returns the square root of ARG. If ARG is negative, the + value is a NaN. - - Function: cube-root number - This returns the cube root of NUMBER. + - Function: cube-root ARG + This returns the cube root of ARG.  File: lispref.info, Node: Random Numbers, Prev: Math Functions, Up: Numbers @@ -1458,7 +1439,7 @@ debugging. t)'. This chooses a new seed based on the current time of day and on XEmacs's process ID number. - - Function: random &optional limit + - Function: random &optional LIMIT This function returns a pseudo-random integer. Repeated calls return a series of pseudo-random integers. @@ -1488,7 +1469,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. diff --git a/info/lispref.info-40 b/info/lispref.info-40 new file mode 100644 index 0000000..b79fe21 --- /dev/null +++ b/info/lispref.info-40 @@ -0,0 +1,1263 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Terminal Output, Next: Flow Control, Prev: Terminal Input, Up: System Interface + +Terminal Output +=============== + + The terminal output functions send output to the terminal or keep +track of output sent to the terminal. The function `device-baud-rate' +tells you what XEmacs thinks is the output speed of the terminal. + + - Function: device-baud-rate &optional DEVICE + This function's value is the output speed of the terminal + associated with DEVICE, as far as XEmacs knows. DEVICE defaults + to the selected device (usually the only device) if omitted. + Changing this value does not change the speed of actual data + transmission, but the value is used for calculations such as + padding. This value has no effect for window-system devices. + (This is different in FSF Emacs, where the baud rate also affects + decisions about whether to scroll part of the screen or repaint, + even when using a window system.) + + The value is measured in bits per second. + + XEmacs attempts to automatically initialize the baud rate by querying +the terminal. If you are running across a network, however, and +different parts of the network work are at different baud rates, the +value returned by XEmacs may be different from the value used by your +local terminal. Some network protocols communicate the local terminal +speed to the remote machine, so that XEmacs and other programs can get +the proper value, but others do not. If XEmacs has the wrong value, it +makes decisions that are less than optimal. To fix the problem, use +`set-device-baud-rate'. + + - Function: set-device-baud-rate &optional DEVICE + This function sets the output speed of DEVICE. See + `device-baud-rate'. DEVICE defaults to the selected device + (usually the only device) if omitted. + + - Function: send-string-to-terminal CHAR-OR-STRING &optional STDOUT-P + DEVICE + This function sends CHAR-OR-STRING to the terminal without + alteration. Control characters in CHAR-OR-STRING have + terminal-dependent effects. + + If DEVICE is `nil', this function writes to XEmacs's stderr, or to + stdout if STDOUT-P is non-`nil'. Otherwise, DEVICE should be a + tty or stream device, and the function writes to the device's + normal or error output, according to STDOUT-P. + + One use of this function is to define function keys on terminals + that have downloadable function key definitions. For example, + this is how on certain terminals to define function key 4 to move + forward four characters (by transmitting the characters `C-u C-f' + to the computer): + + (send-string-to-terminal "\eF4\^U\^F") + => nil + + - Command: open-termscript FILENAME + This function is used to open a "termscript file" that will record + all the characters sent by XEmacs to the terminal. (If there are + multiple tty or stream devices, all characters sent to all such + devices are recorded.) The function returns `nil'. Termscript + files are useful for investigating problems where XEmacs garbles + the screen, problems that are due to incorrect Termcap entries or + to undesirable settings of terminal options more often than to + actual XEmacs bugs. Once you are certain which characters were + actually output, you can determine reliably whether they + correspond to the Termcap specifications in use. + + A `nil' value for FILENAME stops recording terminal output. + + See also `open-dribble-file' in *Note Terminal Input::. + + (open-termscript "../junk/termscript") + => nil + + +File: lispref.info, Node: Flow Control, Next: Batch Mode, Prev: Terminal Output, Up: System Interface + +Flow Control +============ + + This section attempts to answer the question "Why does XEmacs choose +to use flow-control characters in its command character set?" For a +second view on this issue, read the comments on flow control in the +`emacs/INSTALL' file from the distribution; for help with Termcap +entries and DEC terminal concentrators, see `emacs/etc/TERMS'. + + At one time, most terminals did not need flow control, and none used +`C-s' and `C-q' for flow control. Therefore, the choice of `C-s' and +`C-q' as command characters was uncontroversial. XEmacs, for economy +of keystrokes and portability, used nearly all the ASCII control +characters, with mnemonic meanings when possible; thus, `C-s' for +search and `C-q' for quote. + + Later, some terminals were introduced which required these characters +for flow control. They were not very good terminals for full-screen +editing, so XEmacs maintainers did not pay attention. In later years, +flow control with `C-s' and `C-q' became widespread among terminals, +but by this time it was usually an option. And the majority of users, +who can turn flow control off, were unwilling to switch to less +mnemonic key bindings for the sake of flow control. + + So which usage is "right", XEmacs's or that of some terminal and +concentrator manufacturers? This question has no simple answer. + + One reason why we are reluctant to cater to the problems caused by +`C-s' and `C-q' is that they are gratuitous. There are other +techniques (albeit less common in practice) for flow control that +preserve transparency of the character stream. Note also that their use +for flow control is not an official standard. Interestingly, on the +model 33 teletype with a paper tape punch (which is very old), `C-s' +and `C-q' were sent by the computer to turn the punch on and off! + + As X servers and other window systems replace character-only +terminals, this problem is gradually being cured. For the mean time, +XEmacs provides a convenient way of enabling flow control if you want +it: call the function `enable-flow-control'. + + - Function: enable-flow-control + This function enables use of `C-s' and `C-q' for output flow + control, and provides the characters `C-\' and `C-^' as aliases + for them using `keyboard-translate-table' (*note Translating + Input::.). + + You can use the function `enable-flow-control-on' in your `.emacs' +file to enable flow control automatically on certain terminal types. + + - Function: enable-flow-control-on &rest TERMTYPES + This function enables flow control, and the aliases `C-\' and + `C-^', if the terminal type is one of TERMTYPES. For example: + + (enable-flow-control-on "vt200" "vt300" "vt101" "vt131") + + Here is how `enable-flow-control' does its job: + + 1. It sets CBREAK mode for terminal input, and tells the operating + system to handle flow control, with `(set-input-mode nil t)'. + + 2. It sets up `keyboard-translate-table' to translate `C-\' and `C-^' + into `C-s' and `C-q'. Except at its very lowest level, XEmacs + never knows that the characters typed were anything but `C-s' and + `C-q', so you can in effect type them as `C-\' and `C-^' even when + they are input for other commands. *Note Translating Input::. + + If the terminal is the source of the flow control characters, then +once you enable kernel flow control handling, you probably can make do +with less padding than normal for that terminal. You can reduce the +amount of padding by customizing the Termcap entry. You can also +reduce it by setting `baud-rate' to a smaller value so that XEmacs uses +a smaller speed when calculating the padding needed. *Note Terminal +Output::. + + +File: lispref.info, Node: Batch Mode, Prev: Flow Control, Up: System Interface + +Batch Mode +========== + + The command line option `-batch' causes XEmacs to run +noninteractively. In this mode, XEmacs does not read commands from the +terminal, it does not alter the terminal modes, and it does not expect +to be outputting to an erasable screen. The idea is that you specify +Lisp programs to run; when they are finished, XEmacs should exit. The +way to specify the programs to run is with `-l FILE', which loads the +library named FILE, and `-f FUNCTION', which calls FUNCTION with no +arguments. + + Any Lisp program output that would normally go to the echo area, +either using `message' or using `prin1', etc., with `t' as the stream, +goes instead to XEmacs's standard error descriptor when in batch mode. +Thus, XEmacs behaves much like a noninteractive application program. +(The echo area output that XEmacs itself normally generates, such as +command echoing, is suppressed entirely.) + + - Function: noninteractive + This function returns non-`nil' when XEmacs is running in batch + mode. + + - Variable: noninteractive + This variable is non-`nil' when XEmacs is running in batch mode. + Setting this variable to `nil', however, will not change whether + XEmacs is running in batch mode, and will not change the return + value of the `noninteractive' function. + + +File: lispref.info, Node: X-Windows, Next: ToolTalk Support, Prev: System Interface, Up: Top + +Functions Specific to the X Window System +***************************************** + + XEmacs provides the concept of "devices", which generalizes +connections to an X server, a TTY device, etc. Most information about +an X server that XEmacs is connected to can be determined through +general console and device functions. *Note Consoles and Devices::. +However, there are some features of the X Window System that do not +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 Miscellaneous:: Other X-specific functions and variables. + + +File: lispref.info, Node: X Selections, Next: X Server, Up: X-Windows + +X Selections +============ + + The X server records a set of "selections" which permit transfer of +data between application programs. The various selections are +distinguished by "selection types", represented in XEmacs by symbols. +X clients including XEmacs can read or set the selection for any given +type. + + - Function: x-own-selection DATA &optional TYPE + This function sets a "selection" in the X server. It takes two + arguments: a value, DATA, and the selection type TYPE to assign it + to. DATA may be a string, a cons of two markers, or an extent. + In the latter cases, the selection is considered to be the text + between the markers, or between the extent's endpoints. + + Each possible TYPE has its own selection value, which changes + independently. The usual values of TYPE are `PRIMARY' and + `SECONDARY'; these are symbols with upper-case names, in accord + with X Windows conventions. The default is `PRIMARY'. + + (In FSF Emacs, this function is called `x-set-selection' and takes + different arguments.) + + - Function: x-get-selection + This function accesses selections set up by XEmacs or by other X + clients. It returns the value of the current primary selection. + + - Function: x-disown-selection &optional SECONDARY-P + Assuming we own the selection, this function disowns it. If + SECONDARY-P is non-`nil', the secondary selection instead of the + primary selection is discarded. + + The X server also has a set of numbered "cut buffers" which can +store text or other data being moved between applications. Cut buffers +are considered obsolete, but XEmacs supports them for the sake of X +clients that still use them. + + - Function: x-get-cutbuffer &optional N + This function returns the contents of cut buffer number N. (This + function is called `x-get-cut-buffer' in FSF Emacs.) + + - Function: x-store-cutbuffer STRING + This function stores STRING into the first cut buffer (cut buffer + 0), moving the other values down through the series of cut buffers, + kill-ring-style. (This function is called `x-set-cut-buffer' in FSF + Emacs.) + + +File: lispref.info, Node: X Server, Next: X Miscellaneous, Prev: X Selections, Up: X-Windows + +X Server +======== + + This section describes how to access and change the overall status of +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. + + +File: lispref.info, Node: Resources, Next: Server Data, Up: X Server + +Resources +--------- + + - Function: default-x-device + This function return the default X device for resourcing. This is + the first-created X device that still exists. + + - Function: x-get-resource NAME CLASS TYPE &optional LOCALE DEVICE + NOERROR + This function retrieves a resource value from the X resource + manager. + + * The first arg is the name of the resource to retrieve, such as + `"font"'. + + * The second arg is the class of the resource to retrieve, like + `"Font"'. + + * The third arg should be one of the symbols `string', + `integer', `natnum', or `boolean', specifying the type of + object that the database is searched for. + + * The fourth arg is the locale to search for the resources on, + and can currently be a a buffer, a frame, a device, or the + symbol `global'. If omitted, it defaults to `global'. + + * The fifth arg is the device to search for the resources on. + (The resource database for a particular device is constructed + by combining non-device- specific resources such any + command-line resources specified and any app-defaults files + found [or the fallback resources supplied by XEmacs, if no + app-defaults file is found] with device-specific resources + such as those supplied using `xrdb'.) If omitted, it defaults + to the device of LOCALE, if a device can be derived (i.e. if + LOCALE is a frame or device), and otherwise defaults to the + value of `default-x-device'. + + * 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. + + The resource names passed to this function are looked up relative + to the locale. + + If you want to search for a subresource, you just need to specify + the resource levels in NAME and CLASS. For example, NAME could be + `"modeline.attributeFont"', and CLASS `"Face.AttributeFont"'. + + Specifically, + + 1. If LOCALE is a buffer, a call + + `(x-get-resource "foreground" "Foreground" 'string SOME-BUFFER)' + + is an interface to a C call something like + + `XrmGetResource (db, "xemacs.buffer.BUFFER-NAME.foreground", + "Emacs.EmacsLocaleType.EmacsBuffer.Foreground", + "String");' + + 2. If LOCALE is a frame, a call + + `(x-get-resource "foreground" "Foreground" 'string SOME-FRAME)' + + is an interface to a C call something like + + `XrmGetResource (db, "xemacs.frame.FRAME-NAME.foreground", + "Emacs.EmacsLocaleType.EmacsFrame.Foreground", + "String");' + + 3. If LOCALE is a device, a call + + `(x-get-resource "foreground" "Foreground" 'string SOME-DEVICE)' + + is an interface to a C call something like + + `XrmGetResource (db, "xemacs.device.DEVICE-NAME.foreground", + "Emacs.EmacsLocaleType.EmacsDevice.Foreground", + "String");' + + 4. If LOCALE is the symbol `global', a call + + `(x-get-resource "foreground" "Foreground" 'string 'global)' + + is an interface to a C call something like + + `XrmGetResource (db, "xemacs.foreground", + "Emacs.Foreground", + "String");' + + Note that for `global', no prefix is added other than that of the + application itself; thus, you can use this locale to retrieve + arbitrary application resources, if you really want to. + + The returned value of this function is `nil' if the queried + resource is not found. If TYPE is `string', a string is returned, + and if it is `integer', an integer is returned. If TYPE is + `boolean', then the returned value is the list `(t)' for true, + `(nil)' for false, and is `nil' to mean "unspecified". + + - Function: x-put-resource RESOURCE-LINE &optional DEVICE + This function adds a resource to the resource database for DEVICE. + RESOURCE-LINE specifies the resource to add and should be a + standard resource specification. + + - Variable: x-emacs-application-class + This variable holds The X application class of the XEmacs process. + This controls, among other things, the name of the "app-defaults" + file that XEmacs will use. For changes to this variable to take + effect, they must be made before the connection to the X server is + initialized, that is, this variable may only be changed before + XEmacs is dumped, or by setting it in the file + `lisp/term/x-win.el'. + + By default, this variable is nil at startup. When the connection + to the X server is first initialized, the X resource database will + be consulted and the value will be set according to whether any + resources are found for the application class "XEmacs". + + +File: lispref.info, Node: Server Data, Next: Grabs, Prev: Resources, Up: X Server + +Data about the X Server +----------------------- + + This section describes functions and a variable that you can use to +get information about the capabilities and origin of the X server +corresponding to a particular device. The device argument is generally +optional and defaults to the selected device. + + - Function: x-server-version &optional DEVICE + This function returns the list of version numbers of the X server + DEVICE is on. The returned value is a list of three integers: the + major and minor version numbers of the X protocol in use, and the + vendor-specific release number. + + - Function: x-server-vendor &optional DEVICE + This function returns the vendor supporting the X server DEVICE is + on. + + - Function: x-display-visual-class &optional DEVICE + This function returns the visual class of the display DEVICE is + on. The value is one of the symbols `static-gray', `gray-scale', + `static-color', `pseudo-color', `true-color', and `direct-color'. + (Note that this is different from previous versions of XEmacs, + which returned `StaticGray', `GrayScale', etc.) + + +File: lispref.info, Node: Grabs, Prev: Server Data, Up: X Server + +Restricting Access to the Server by Other Apps +---------------------------------------------- + + - Function: 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 eavesdrop on them. Ungrab the keyboard + with `x-ungrab-keyboard' (use an `unwind-protect'). Returns `t' + if the grab was successful; `nil' otherwise. + + - Function: x-ungrab-keyboard &optional DEVICE + This function releases a keyboard grab made with `x-grab-keyboard'. + + - Function: x-grab-pointer &optional DEVICE CURSOR IGNORE-KEYBOARD + This function grabs the pointer and restricts it to its current + window. If optional DEVICE argument is `nil', the selected device + will be used. If optional CURSOR argument is non-`nil', change + the pointer shape to that until `x-ungrab-pointer' is called (it + should be an object returned by the `make-cursor' function). If + the second optional argument IGNORE-KEYBOARD is non-`nil', ignore + all keyboard events during the grab. Returns `t' if the grab is + successful, `nil' otherwise. + + - Function: x-ungrab-pointer &optional DEVICE + This function releases a pointer grab made with `x-grab-pointer'. + If optional first arg DEVICE is `nil' the selected device is used. + If it is `t' the pointer will be released on all X devices. + + +File: lispref.info, Node: X Miscellaneous, Prev: X Server, Up: X-Windows + +Miscellaneous X Functions and Variables +======================================= + + - Variable: x-bitmap-file-path + This variable holds a list of the directories in which X bitmap + files may be found. If `nil', this is initialized from the + `"*bitmapFilePath"' resource. This is used by the + `make-image-instance' function (however, note that if the + environment variable `XBMLANGPATH' is set, it is consulted first). + + - Variable: x-library-search-path + This variable holds the search path used by `read-color' to find + `rgb.txt'. + + - Function: x-valid-keysym-name-p KEYSYM + This function returns true if KEYSYM names a keysym that the X + library knows about. Valid keysyms are listed in the files + `/usr/include/X11/keysymdef.h' and in `/usr/lib/X11/XKeysymDB', or + whatever the equivalents are on your system. + + - Function: x-window-id &optional FRAME + This function returns the ID of the X11 window. This gives us a + chance to manipulate the Emacs window from within a different + program. Since the ID is an unsigned long, we return it as a + string. + + - Variable: x-allow-sendevents + If non-`nil', synthetic events are allowed. `nil' means they are + ignored. Beware: allowing XEmacs to process SendEvents opens a + big security hole. + + - Function: x-debug-mode ARG &optional DEVICE + With a true arg, make the connection to the X server synchronous. + With false, make it asynchronous. Synchronous connections are + much slower, but are useful for debugging. (If you get X errors, + make the connection synchronous, and use a debugger to set a + breakpoint on `x_error_handler'. Your backtrace of the C stack + will now be useful. In asynchronous mode, the stack above + `x_error_handler' isn't helpful because of buffering.) If DEVICE + is not specified, the selected device is assumed. + + Calling this function is the same as calling the C function + `XSynchronize', or starting the program with the `-sync' command + line argument. + + - Variable: x-debug-events + If non-zero, debug information about events that XEmacs sees is + displayed. Information is displayed on stderr. Currently defined + values are: + + * 1 == non-verbose output + + * 2 == verbose output + + +File: lispref.info, Node: ToolTalk Support, Next: LDAP Support, Prev: X-Windows, Up: Top + +ToolTalk Support +**************** + +* Menu: + +* XEmacs ToolTalk API Summary:: +* Sending Messages:: +* Receiving Messages:: + + +File: lispref.info, Node: XEmacs ToolTalk API Summary, Next: Sending Messages, Up: ToolTalk Support + +XEmacs ToolTalk API Summary +=========================== + + The XEmacs Lisp interface to ToolTalk is similar, at least in spirit, +to the standard C ToolTalk API. Only the message and pattern parts of +the API are supported at present; more of the API could be added if +needed. The Lisp interface departs from the C API in a few ways: + + * ToolTalk is initialized automatically at XEmacs startup-time. + Messages can only be sent other ToolTalk applications connected to + the same X11 server that XEmacs is running on. + + * There are fewer entry points; polymorphic functions with keyword + arguments are used instead. + + * The callback interface is simpler and marginally less functional. + A single callback may be associated with a message or a pattern; + the callback is specified with a Lisp symbol (the symbol should + have a function binding). + + * The session attribute for messages and patterns is always + initialized to the default session. + + * Anywhere a ToolTalk enum constant, e.g. `TT_SESSION', is valid, one + can substitute the corresponding symbol, e.g. `'TT_SESSION'. This + simplifies building lists that represent messages and patterns. + + +File: lispref.info, Node: Sending Messages, Next: Receiving Messages, Prev: XEmacs ToolTalk API Summary, Up: ToolTalk Support + +Sending Messages +================ + +* Menu: + +* Example of Sending Messages:: +* Elisp Interface for Sending Messages:: + + +File: lispref.info, Node: Example of Sending Messages, Next: Elisp Interface for Sending Messages, Up: Sending Messages + +Example of Sending Messages +--------------------------- + + Here's a simple example that sends a query to another application +and then displays its reply. Both the query and the reply are stored +in the first argument of the message. + + (defun tooltalk-random-query-handler (msg) + (let ((state (get-tooltalk-message-attribute msg 'state))) + (cond + ((eq state 'TT_HANDLED) + (message (get-tooltalk-message-attribute msg arg_val 0))) + ((memq state '(TT_FAILED TT_REJECTED)) + (message "Random query turns up nothing"))))) + + (defvar random-query-message + '( class TT_REQUEST + scope TT_SESSION + address TT_PROCEDURE + op "random-query" + args '((TT_INOUT "?" "string")) + callback tooltalk-random-query-handler)) + + (let ((m (make-tooltalk-message random-query-message))) + (send-tooltalk-message m)) + + +File: lispref.info, Node: Elisp Interface for Sending Messages, Prev: Example of Sending Messages, Up: Sending Messages + +Elisp Interface for Sending Messages +------------------------------------ + + - Function: make-tooltalk-message ATTRIBUTES + Create a ToolTalk message and initialize its attributes. The + value of ATTRIBUTES must be a list of alternating keyword/values, + where keywords are symbols that name valid message attributes. + For example: + + (make-tooltalk-message + '(class TT_NOTICE + scope TT_SESSION + address TT_PROCEDURE + op "do-something" + args ("arg1" 12345 (TT_INOUT "arg3" "string")))) + + Values must always be strings, integers, or symbols that represent + ToolTalk constants. Attribute names are the same as those + supported by `set-tooltalk-message-attribute', plus `args'. + + The value of `args' should be a list of message arguments where + each message argument has the following form: + + `(mode [value [type]])' or just `value' + + Where MODE is one of `TT_IN', `TT_OUT', or `TT_INOUT' and TYPE is + a string. If TYPE isn't specified then `int' is used if VALUE is + a number; otherwise `string' is used. If TYPE is `string' then + VALUE is converted to a string (if it isn't a string already) with + `prin1-to-string'. If only a value is specified then MODE + defaults to `TT_IN'. If MODE is `TT_OUT' then VALUE and TYPE + don't need to be specified. You can find out more about the + semantics and uses of ToolTalk message arguments in chapter 4 of + the `ToolTalk Programmer's Guide'. + + + - Function: send-tooltalk-message MSG + Send the message on its way. Once the message has been sent it's + almost always a good idea to get rid of it with + `destroy-tooltalk-message'. + + + - Function: return-tooltalk-message MSG &optional MODE + Send a reply to this message. The second argument can be `reply', + `reject' or `fail'; the default is `reply'. Before sending a + reply, all message arguments whose mode is `TT_INOUT' or `TT_OUT' + should have been filled in - see `set-tooltalk-message-attribute'. + + + - Function: get-tooltalk-message-attribute MSG ATTRIBUTE &optional ARGN + Returns the indicated ToolTalk message attribute. Attributes are + identified by symbols with the same name (underscores and all) as + the suffix of the ToolTalk `tt_message_' function that + extracts the value. String attribute values are copied and + enumerated type values (except disposition) are converted to + symbols; e.g. `TT_HANDLER' is `'TT_HANDLER', `uid' and `gid' are + represented by fixnums (small integers), `opnum' is converted to a + string, and `disposition' is converted to a fixnum. We convert + `opnum' (a C int) to a string (e.g. `123' => `"123"') because + there's no guarantee that opnums will fit within the range of + XEmacs Lisp integers. + + [TBD] Use the `plist' attribute instead of C API `user' attribute + for user-defined message data. To retrieve the value of a message + property, specify the indicator for ARGN. For example, to get the + value of a property called `rflag', use + + (get-tooltalk-message-attribute msg 'plist 'rflag) + + To get the value of a message argument use one of the `arg_val' + (strings), `arg_ival' (integers), or `arg_bval' (strings with + embedded nulls), attributes. For example, to get the integer + value of the third argument: + + (get-tooltalk-message-attribute msg 'arg_ival 2) + + As you can see, argument numbers are zero-based. The type of each + arguments can be retrieved with the `arg_type' attribute; however + ToolTalk doesn't define any semantics for the string value of + `arg_type'. Conventionally `string' is used for strings and `int' + for 32 bit integers. Note that XEmacs Lisp stores the lengths of + strings explicitly (unlike C) so treating the value returned by + `arg_bval' like a string is fine. + + + - Function: set-tooltalk-message-attribute VALUE MSG ATTRIBUTE + &optional ARGN + Initialize one ToolTalk message attribute. + + Attribute names and values are the same as for + `get-tooltalk-message-attribute'. A property list is provided for + user data (instead of the `user' message attribute); see + `get-tooltalk-message-attribute'. + + Callbacks are handled slightly differently than in the C ToolTalk + API. The value of CALLBACK should be the name of a function of one + argument. It will be called each time the state of the message + changes. This is usually used to notice when the message's state + has changed to `TT_HANDLED' (or `TT_FAILED'), so that reply + argument values can be used. + + If one of the argument attributes is specified as `arg_val', + `arg_ival', or `arg_bval', then ARGN must be the number of an + already created argument. Arguments can be added to a message + with `add-tooltalk-message-arg'. + + + - Function: add-tooltalk-message-arg MSG MODE TYPE &optional VALUE + Append one new argument to the message. MODE must be one of + `TT_IN', `TT_INOUT', or `TT_OUT', TYPE must be a string, and VALUE + can be a string or an integer. ToolTalk doesn't define any + semantics for TYPE, so only the participants in the protocol + you're using need to agree what types mean (if anything). + Conventionally `string' is used for strings and `int' for 32 bit + integers. Arguments can initialized by providing a value or with + `set-tooltalk-message-attribute'; the latter is necessary if you + want to initialize the argument with a string that can contain + embedded nulls (use `arg_bval'). + + + - Function: create-tooltalk-message + Create a new ToolTalk message. The message's session attribute is + initialized to the default session. Other attributes can be + initialized with `set-tooltalk-message-attribute'. + `make-tooltalk-message' is the preferred way to create and + initialize a message. + + + - Function: destroy-tooltalk-message MSG + Apply `tt_message_destroy' to the message. It's not necessary to + destroy messages after they've been processed by a message or + pattern callback, the Lisp/ToolTalk callback machinery does this + for you. + + +File: lispref.info, Node: Receiving Messages, Prev: Sending Messages, Up: ToolTalk Support + +Receiving Messages +================== + +* Menu: + +* Example of Receiving Messages:: +* Elisp Interface for Receiving Messages:: + + +File: lispref.info, Node: Example of Receiving Messages, Next: Elisp Interface for Receiving Messages, Up: Receiving Messages + +Example of Receiving Messages +----------------------------- + + Here's a simple example of a handler for a message that tells XEmacs +to display a string in the mini-buffer area. The message operation is +called `emacs-display-string'. Its first (0th) argument is the string +to display. + + (defun tooltalk-display-string-handler (msg) + (message (get-tooltalk-message-attribute msg 'arg_val 0))) + + (defvar display-string-pattern + '(category TT_HANDLE + scope TT_SESSION + op "emacs-display-string" + callback tooltalk-display-string-handler)) + + (let ((p (make-tooltalk-pattern display-string-pattern))) + (register-tooltalk-pattern p)) + + +File: lispref.info, Node: Elisp Interface for Receiving Messages, Prev: Example of Receiving Messages, Up: Receiving Messages + +Elisp Interface for Receiving Messages +-------------------------------------- + + - Function: make-tooltalk-pattern ATTRIBUTES + Create a ToolTalk pattern and initialize its attributes. The + value of attributes must be a list of alternating keyword/values, + where keywords are symbols that name valid pattern attributes or + lists of valid attributes. For example: + + (make-tooltalk-pattern + '(category TT_OBSERVE + scope TT_SESSION + op ("operation1" "operation2") + args ("arg1" 12345 (TT_INOUT "arg3" "string")))) + + Attribute names are the same as those supported by + `add-tooltalk-pattern-attribute', plus `'args'. + + Values must always be strings, integers, or symbols that represent + ToolTalk constants or lists of same. When a list of values is + provided all of the list elements are added to the attribute. In + the example above, messages whose `op' attribute is `"operation1"' + or `"operation2"' would match the pattern. + + The value of ARGS should be a list of pattern arguments where each + pattern argument has the following form: + + `(mode [value [type]])' or just `value' + + Where MODE is one of `TT_IN', `TT_OUT', or `TT_INOUT' and TYPE is + a string. If TYPE isn't specified then `int' is used if VALUE is + a number; otherwise `string' is used. If TYPE is `string' then + VALUE is converted to a string (if it isn't a string already) with + `prin1-to-string'. If only a value is specified then MODE + defaults to `TT_IN'. If MODE is `TT_OUT' then VALUE and TYPE + don't need to be specified. You can find out more about the + semantics and uses of ToolTalk pattern arguments in chapter 3 of + the `ToolTalk Programmer's Guide'. + + + - Function: register-tooltalk-pattern PAT + XEmacs will begin receiving messages that match this pattern. + + - Function: unregister-tooltalk-pattern PAT + XEmacs will stop receiving messages that match this pattern. + + - Function: add-tooltalk-pattern-attribute VALUE PAT INDICATOR + Add one value to the indicated pattern attribute. The names of + attributes are the same as the ToolTalk accessors used to set them + less the `tooltalk_pattern_' prefix and the `_add' suffix. For + example, the name of the attribute for the + `tt_pattern_disposition_add' attribute is `disposition'. The + `category' attribute is handled specially, since a pattern can only + be a member of one category (`TT_OBSERVE' or `TT_HANDLE'). + + Callbacks are handled slightly differently than in the C ToolTalk + API. The value of CALLBACK should be the name of a function of one + argument. It will be called each time the pattern matches an + incoming message. + + - Function: add-tooltalk-pattern-arg PAT MODE TYPE VALUE + Add one fully-specified argument to a ToolTalk pattern. MODE must + be one of `TT_IN', `TT_INOUT', or `TT_OUT'. TYPE must be a + string. VALUE can be an integer, string or `nil'. If VALUE is an + integer then an integer argument (`tt_pattern_iarg_add') is added; + otherwise a string argument is added. At present there's no way + to add a binary data argument. + + + - Function: create-tooltalk-pattern + Create a new ToolTalk pattern and initialize its session attribute + to be the default session. + + - Function: destroy-tooltalk-pattern PAT + Apply `tt_pattern_destroy' to the pattern. This effectively + unregisters the pattern. + + - Function: describe-tooltalk-message MSG &optional STREAM + Print the message's attributes and arguments to STREAM. This is + often useful for debugging. + + +File: lispref.info, Node: LDAP Support, Next: Internationalization, Prev: ToolTalk Support, Up: Top + +LDAP Support +************ + + XEmacs can be linked with a LDAP client library to provide Elisp +primitives to access directory servers using the Lightweight Directory +Access Protocol. + +* Menu: + +* Building XEmacs with LDAP support:: How to add LDAP support to XEmacs +* XEmacs LDAP API:: Lisp access to LDAP functions +* Syntax of Search Filters:: A brief summary of RFC 1558 + + +File: lispref.info, Node: Building XEmacs with LDAP support, Next: XEmacs LDAP API, Prev: LDAP Support, Up: LDAP Support + +Building XEmacs with LDAP support +================================= + + LDAP support must be added to XEmacs at build time since it requires +linking to an external LDAP client library. As of 21.2, XEmacs has been +successfully built and tested with + + * OpenLDAP 1.0.3 (`http://www.openldap.org/') + + * University of Michigan's LDAP 3.3 + (`http://www.umich.edu/~dirsvcs/ldap/') + + * LDAP SDK 1.0 from Netscape Corp. (`http://developer.netscape.com/') + + Other libraries conforming to RFC 1823 will probably work also but +may require some minor tweaking at C level. + + The standard XEmacs configure script autodetects an installed LDAP +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. + + +File: lispref.info, Node: XEmacs LDAP API, Next: Syntax of Search Filters, Prev: Building XEmacs with LDAP support, Up: LDAP Support + +XEmacs LDAP API +=============== + + XEmacs LDAP API consists of two layers: a low-level layer which +tries to stay as close as possible to the C API (where practical) and a +higher-level layer which provides more convenient primitives to +effectively use LDAP. + + As of XEmacs 21.0, only interfaces to basic LDAP search functions are +provided, broader support is planned in future versions. + +* 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 + + +File: lispref.info, Node: LDAP Variables, Next: The High-Level LDAP API, Prev: XEmacs LDAP API, Up: XEmacs LDAP API + +LDAP Variables +-------------- + + - Variable: ldap-default-host + The default LDAP server hostname. A TCP port number can be + appended to that name using a colon as a separator. + + - Variable: ldap-default-port + Default TCP port for LDAP connections. Initialized from the LDAP + library. Default value is 389. + + - Variable: ldap-default-base + Default base for LDAP searches. This is a string using the syntax + of RFC 1779. For instance, "o¬ME, cÿ" limits the search to the + Acme organization in the United States. + + - Variable: ldap-host-parameters-alist + An alist of per host options for LDAP transactions. The list + elements look like `(HOST PROP1 VAL1 PROP2 VAL2 ...)' HOST is the + name of an LDAP server. A TCP port number can be appended to that + name using a colon as a separator. PROPN and VALN are + property/value pairs describing parameters for the server. Valid + properties: + `binddn' + The distinguished name of the user to bind as. This may look + like `cÿ, o¬me, cnÿnny Bugs', see RFC 1779 for details. + + `passwd' + The password to use for authentication. + + `auth' + The authentication method to use, possible values depend on + the LDAP library XEmacs was compiled with, they may include + `simple', `krbv41' and `krbv42'. + + `base' + The base for the search. This may look like `cÿ, o¬me', see + RFC 1779 for syntax details. + + `scope' + One of the symbols `base', `onelevel' or `subtree' indicating + the scope of the search limited to a base object, to a single + level or to the whole subtree. + + `deref' + The dereference policy is one of the symbols `never', + `always', `search' or `find' and defines how aliases are + dereferenced. + `never' + Aliases are never dereferenced + + `always' + Aliases are always dereferenced + + `search' + Aliases are dereferenced when searching + + `find' + Aliases are dereferenced when locating the base object + for the search + + `timelimit' + The timeout limit for the connection in seconds. + + `sizelimit' + The maximum number of matches to return for searches + performed on this connection. + + +File: lispref.info, Node: The High-Level LDAP API, Next: The Low-Level LDAP API, Prev: LDAP Variables, Up: XEmacs LDAP API + +The High-Level LDAP API +----------------------- + + As of this writing the high-level Lisp LDAP API only provides for +LDAP searches. Further support is planned in the future. + + The `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 +*note The Low-Level LDAP API::. + + - Function: ldap-search FILTER &optional HOST ATTRIBUTES ATTRSONLY + Perform an LDAP search. FILTER is the search filter *note Syntax + of Search Filters::. HOST is the LDAP host on which to perform + the search ATTRIBUTES is the specific attributes to retrieve, + `nil' means retrieve all ATTRSONLY if non-`nil' retrieves the + attributes only without their associated values. Additional + search parameters can be specified through + `ldap-host-parameters-alist'. + + +File: lispref.info, Node: The Low-Level LDAP API, Prev: The High-Level LDAP API, Up: XEmacs LDAP API + +The Low-Level LDAP API +---------------------- + +* Menu: + +* The LDAP Lisp Object:: +* Opening and Closing a LDAP Connection:: +* Searching on a LDAP Server (Low-level):: + + +File: lispref.info, Node: The LDAP Lisp Object, Next: Opening and Closing a LDAP Connection, Prev: The Low-Level LDAP API, Up: The Low-Level LDAP API + +The LDAP Lisp Object +.................... + + An internal built-in `ldap' lisp object represents a LDAP connection. + + - Function: ldapp OBJECT + This function returns non-`nil' if OBJECT is a `ldap' object. + + - Function: ldap-host LDAP + Return the server host of the connection represented by LDAP + + - Function: ldap-live-p LDAP + Return non-`nil' if LDAP is an active LDAP connection + + +File: lispref.info, Node: Opening and Closing a LDAP Connection, Next: Searching on a LDAP Server (Low-level), Prev: The LDAP Lisp Object, Up: The Low-Level LDAP API + +Opening and Closing a LDAP Connection +..................................... + + - Function: ldap-open HOST &optional PLIST + Open a LDAP connection to HOST. PLIST is a property list + containing additional parameters for the connection. Valid keys + in that list are: + `port' + The TCP port to use for the connection if different from + `ldap-default-port' or the library builtin value + + `auth' + The authentication method to use, possible values depend on + the LDAP library XEmacs was compiled with, they may include + `simple', `krbv41' and `krbv42'. + + `binddn' + The distinguished name of the user to bind as. This may look + like `cÿ, o¬me, cnÿnny Bugs', see RFC 1779 for details. + + `passwd' + The password to use for authentication. + + `deref' + The dereference policy is one of the symbols `never', + `always', `search' or `find' and defines how aliases are + dereferenced. + `never' + Aliases are never dereferenced + + `always' + Aliases are always dereferenced + + `search' + Aliases are dereferenced when searching + + `find' + Aliases are dereferenced when locating the base object + for the search The default is `never'. + + `timelimit' + The timeout limit for the connection in seconds. + + `sizelimit' + The maximum number of matches to return for searches + performed on this connection. + + - Function: ldap-close LDAP + Close the connection represented by LDAP + + +File: lispref.info, Node: Searching on a LDAP Server (Low-level), Prev: Opening and Closing a LDAP Connection, Up: The Low-Level LDAP API + +Searching on a LDAP Server (Low-level) +...................................... + + `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 `ldap-open'. Multiple searches +can be made on the same connection, then the session must be closed +with `ldap-close'. + + - Function: ldap-search-internal LDAP FILTER BASE SCOPE ATTRS ATTRSONLY + Perform a search on an open connection LDAP created with + `ldap-open'. FILTER is a filter string for the search *note + Syntax of Search Filters::. BASE is the distinguished name at + which to start the search. SCOPE is one of the symbols `base', + `onelevel' or `subtree' indicating the scope of the search limited + to a base object, to a single level or to the whole subtree. The + default is `subtree'. `attrs' is a list of strings indicating + which attributes to retrieve for each matching entry. If `nil' all + available attributes are returned. If `attrsonly' is non-`nil' + then only the attributes are retrieved, not their associated values + The function returns a list of matching entries. Each entry being + itself an alist of attribute/values. + + +File: lispref.info, Node: Syntax of Search Filters, Prev: XEmacs LDAP API, Up: LDAP Support + +Syntax of Search Filters +======================== + + LDAP search functions use RFC1558 syntax to describe the search +filter. In that syntax simple filters have the form: + + ( ) + + `' is an attribute name such as `cn' for Common Name, `o' for +Organization, etc... + + `' is the corresponding value. This is generally an exact +string but may also contain `*' characters as wildcards + + `filtertype' is one `=' `~=', `<=', `>=' which respectively describe +equality, approximate equality, inferiority and superiority. + + Thus `(cn=John Smith)' matches all records having a canonical name +equal to John Smith. + + A special case is the presence filter `(=*' which matches +records containing a particular attribute. For instance `(mail=*)' +matches all records containing a `mail' attribute. + + Simple filters can be connected together with the logical operators +`&', `|' and `!' which stand for the usual and, or and not operators. + + `(&(objectClass=Person)(mail=*)(|(sn=Smith)(givenname=John)))' +matches records of class `Person' containing a `mail' attribute and +corresponding to people whose last name is `Smith' or whose first name +is `John'. + + +File: lispref.info, Node: Internationalization, Next: MULE, Prev: LDAP Support, Up: Top + +Internationalization +******************** + +* Menu: + +* I18N Levels 1 and 2:: Support for different time, date, and currency formats. +* I18N Level 3:: Support for localized messages. +* I18N Level 4:: Support for Asian languages. + + +File: lispref.info, Node: I18N Levels 1 and 2, Next: I18N Level 3, Up: Internationalization + +I18N Levels 1 and 2 +=================== + + XEmacs is now compliant with I18N levels 1 and 2. Specifically, +this means that it is 8-bit clean and correctly handles time and date +functions. XEmacs will correctly display the entire ISO-Latin 1 +character set. + + The compose key may now be used to create any character in the +ISO-Latin 1 character set not directly available via the keyboard.. In +order for the compose key to work it is necessary to load the file +`x-compose.el'. At any time while composing a character, `C-h' will +display all valid completions and the character which would be produced. + + +File: lispref.info, Node: I18N Level 3, Next: I18N Level 4, Prev: I18N Levels 1 and 2, Up: Internationalization + +I18N Level 3 +============ + +* Menu: + +* Level 3 Basics:: +* Level 3 Primitives:: +* Dynamic Messaging:: +* Domain Specification:: +* Documentation String Extraction:: + + +File: lispref.info, Node: Level 3 Basics, Next: Level 3 Primitives, Up: I18N Level 3 + +Level 3 Basics +-------------- + + XEmacs now provides alpha-level functionality for I18N Level 3. +This means that everything necessary for full messaging is available, +but not every file has been converted. + + The two message files which have been created are `src/emacs.po' and +`lisp/packages/mh-e.po'. Both files need to be converted using +`msgfmt', and the resulting `.mo' files placed in some locale's +`LC_MESSAGES' directory. The test "translations" in these files are +the original messages prefixed by `TRNSLT_'. + + The domain for a variable is stored on the variable's property list +under the property name VARIABLE-DOMAIN. The function +`documentation-property' uses this information when translating a +variable's documentation. + diff --git a/info/lispref.info-41 b/info/lispref.info-41 new file mode 100644 index 0000000..73d9255 --- /dev/null +++ b/info/lispref.info-41 @@ -0,0 +1,1224 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Level 3 Primitives, Next: Dynamic Messaging, Prev: Level 3 Basics, Up: I18N Level 3 + +Level 3 Primitives +------------------ + + - Function: gettext STRING + This function looks up STRING in the default message domain and + returns its translation. If `I18N3' was not enabled when XEmacs + was compiled, it just returns STRING. + + - Function: dgettext DOMAIN STRING + This function looks up STRING in the specified message domain and + returns its translation. If `I18N3' was not enabled when XEmacs + was compiled, it just returns STRING. + + - Function: bind-text-domain DOMAIN PATHNAME + This function associates a pathname with a message domain. Here's + how the path to message file is constructed under SunOS 5.x: + + `{pathname}/{LANG}/LC_MESSAGES/{domain}.mo' + + If `I18N3' was not enabled when XEmacs was compiled, this function + does nothing. + + - Special Form: domain STRING + This function specifies the text domain used for translating + documentation strings and interactive prompts of a function. For + example, write: + + (defun foo (arg) "Doc string" (domain "emacs-foo") ...) + + to specify `emacs-foo' as the text domain of the function `foo'. + The "call" to `domain' is actually a declaration rather than a + function; when actually called, `domain' just returns `nil'. + + - Function: domain-of FUNCTION + This function returns the text domain of FUNCTION; it returns + `nil' if it is the default domain. If `I18N3' was not enabled + when XEmacs was compiled, it always returns `nil'. + + +File: lispref.info, Node: Dynamic Messaging, Next: Domain Specification, Prev: Level 3 Primitives, Up: I18N Level 3 + +Dynamic Messaging +----------------- + + The `format' function has been extended to permit you to change the +order of parameter insertion. For example, the conversion format +`%1$s' inserts parameter one as a string, while `%2$s' inserts +parameter two. This is useful when creating translations which require +you to change the word order. + + +File: lispref.info, Node: Domain Specification, Next: Documentation String Extraction, Prev: Dynamic Messaging, Up: I18N Level 3 + +Domain Specification +-------------------- + + The default message domain of XEmacs is `emacs'. For add-on +packages, it is best to use a different domain. For example, let us +say we want to convert the "gorilla" package to use the domain +`emacs-gorilla'. To translate the message "What gorilla?", use +`dgettext' as follows: + + (dgettext "emacs-gorilla" "What gorilla?") + + A function (or macro) which has a documentation string or an +interactive prompt needs to be associated with the domain in order for +the documentation or prompt to be translated. This is done with the +`domain' special form as follows: + + (defun scratch (location) + "Scratch the specified location." + (domain "emacs-gorilla") + (interactive "sScratch: ") + ... ) + + It is most efficient to specify the domain in the first line of the +function body, before the `interactive' form. + + For variables and constants which have documentation strings, +specify the domain after the documentation. + + - Special Form: defvar SYMBOL [VALUE [DOC-STRING [DOMAIN]]] + Example: + (defvar weight 250 "Weight of gorilla, in pounds." "emacs-gorilla") + + - Special Form: defconst SYMBOL [VALUE [DOC-STRING [DOMAIN]]] + Example: + (defconst limbs 4 "Number of limbs" "emacs-gorilla") + + Autoloaded functions which are specified in `loaddefs.el' do not need +to have a domain specification, because their documentation strings are +extracted into the main message base. However, for autoloaded functions +which are specified in a separate package, use following syntax: + + - Function: autoload SYMBOL FILENAME &optional DOCSTRING INTERACTIVE + MACRO DOMAIN + Example: + (autoload 'explore "jungle" "Explore the jungle." nil nil "emacs-gorilla") + + +File: lispref.info, Node: Documentation String Extraction, Prev: Domain Specification, Up: I18N Level 3 + +Documentation String Extraction +------------------------------- + + The utility `etc/make-po' scans the file `DOC' to extract +documentation strings and creates a message file `doc.po'. This file +may then be inserted within `emacs.po'. + + Currently, `make-po' is hard-coded to read from `DOC' and write to +`doc.po'. In order to extract documentation strings from an add-on +package, first run `make-docfile' on the package to produce the `DOC' +file. Then run `make-po -p' with the `-p' argument to indicate that we +are extracting documentation for an add-on package. + + (The `-p' argument is a kludge to make up for a subtle difference +between pre-loaded documentation and add-on documentation: For add-on +packages, the final carriage returns in the strings produced by +`make-docfile' must be ignored.) + + +File: lispref.info, Node: I18N Level 4, Prev: I18N Level 3, Up: Internationalization + +I18N Level 4 +============ + + The Asian-language support in XEmacs is called "MULE". *Note MULE::. + + +File: lispref.info, Node: MULE, Next: Tips, Prev: Internationalization, Up: Top + +MULE +**** + + "MULE" is the name originally given to the version of GNU Emacs +extended for multi-lingual (and in particular Asian-language) support. +"MULE" is short for "MUlti-Lingual Emacs". It was originally called +Nemacs ("Nihon Emacs" where "Nihon" is the Japanese word for "Japan"), +when it only provided support for Japanese. XEmacs refers to its +multi-lingual support as "MULE support" since it is based on "MULE". + +* Menu: + +* Internationalization Terminology:: + Definition of various internationalization terms. +* 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. + + +File: lispref.info, Node: Internationalization Terminology, Next: Charsets, Up: MULE + +Internationalization Terminology +================================ + + In internationalization terminology, a string of text is divided up +into "characters", which are the printable units that make up the text. +A single character is (for example) a capital `A', the number `2', a +Katakana character, a Kanji ideograph (an "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 `a' +and `g' each have two distinct possible shapes - the `a' can optionally +have a curved tail projecting off the top, and the `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 character are called "glyphs". The +important characteristic of two 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 `A' and +lowercase `a' are different characters rather than different glyphs - +e.g. `Aspen' is a city while `aspen' is a kind of tree). + + Note that "character" and "glyph" are used differently here than +elsewhere in XEmacs. + + A "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), 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. + + Every character set has one or more "orderings", which can be viewed +as a way of assigning a number (or set of numbers) to each character in +the set. For most character sets, there is a standard ordering, and in +fact all of the character sets mentioned above define a particular +ordering. ASCII, for example, places letters in their "natural" order, +puts uppercase letters before lowercase letters, numbers before +letters, etc. Note that for many of the Asian character sets, there is +no natural ordering of the characters. The actual orderings are based +on one or more salient characteristic, of which there are many to +choose from - e.g. number of strokes, common radicals, phonetic +ordering, etc. + + The set of numbers assigned to any particular character are called +the character's "position codes". The number of position codes +required to index a particular character in a character set is called +the "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 *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 "encoding" is a way of numerically representing characters from +one or more character sets into a stream of like-sized numerical values +called "words"; typically these are 8-bit, 16-bit, or 32-bit +quantities. If an encoding encompasses only one character set, then the +position codes for the characters in that character set could be used +directly. (This is the case with ASCII, and as a result, most people do +not understand the difference between a character set and an encoding.) +This is not possible, however, if more than one character set is to be +used in the encoding. For example, printed Japanese text typically +requires characters from multiple character sets - ASCII, JISX0208, and +JISX0212, to be specific. Each of these is indexed using one or more +position codes in the range 33 through 126, so the position codes could +not be used directly or there would be no way to tell which character +was meant. Different Japanese encodings handle this differently - JIS +uses special escape characters to denote different character sets; EUC +sets the high bit of the position codes for JISX0208 and JISX0212, and +puts a special extra byte before each JISX0212 character; etc. (JIS, +EUC, and most of the other encodings you will encounter are 7-bit or +8-bit encodings. There is one common 16-bit encoding, which is Unicode; +this strives to represent all the world's characters in a single large +character set. 32-bit encodings are generally used internally in +programs to simplify the code that manipulates them; however, they are +not much used externally because they are not very space-efficient.) + + Encodings are classified as either "modal" or "non-modal". In a +"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 "escape sequences", are used to change the global state. JIS, +for example, is a modal encoding. The bytes `ESC $ B' indicate that, +from then on, bytes are to be interpreted as position codes for +JISX0208, rather than as ASCII. This effect is cancelled using the +bytes `ESC ( B', which mean "switch from whatever the current state is +to ASCII". To switch to JISX0212, the escape sequence `ESC $ ( D'. +(Note that here, as is common, the escape sequences do in fact begin +with `ESC'. This is not necessarily the case, however.) + + A "non-modal encoding" has no global state that extends past the +character currently being interpreted. EUC, for example, is a +non-modal encoding. Characters in JISX0208 are encoded by setting the +high bit of the position codes, and characters in JISX0212 are encoded +by doing the same but also prefixing the character with the byte 0x8F. + + The advantage of a modal encoding is that it is generally more +space-efficient, and is easily extendable because there are essentially +an arbitrary number of escape sequences that can be created. The +disadvantage, however, is that it is much more difficult to work with +if it is not being processed in a sequential manner. In the non-modal +EUC encoding, for example, the byte 0x41 always refers to the letter +`A'; whereas in JIS, it could either be the letter `A', or one of the +two position codes in a JISX0208 character, or one of the two position +codes in a JISX0212 character. Determining exactly which one is meant +could be difficult and time-consuming if the previous bytes in the +string have not already been processed. + + Non-modal encodings are further divided into "fixed-width" and +"variable-width" formats. A fixed-width encoding always uses the same +number of words per character, whereas a variable-width encoding does +not. EUC is a good example of a variable-width encoding: one to three +bytes are used per character, depending on the character set. 16-bit +and 32-bit encodings are nearly always fixed-width, and this is in fact +one of the main reasons for using 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. + + Note that the bytes in an 8-bit encoding are often referred to as +"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. + + +File: lispref.info, Node: Charsets, Next: MULE Characters, Prev: Internationalization Terminology, Up: MULE + +Charsets +======== + + A "charset" in MULE is an object that encapsulates a particular +character set as well as an ordering of those characters. Charsets are +permanent objects and are named using symbols, like faces. + + - Function: charsetp OBJECT + This function returns non-`nil' if OBJECT is a charset. + +* Menu: + +* Charset Properties:: Properties of a charset. +* Basic Charset Functions:: Functions for working with charsets. +* Charset Property Functions:: Functions for accessing charset properties. +* Predefined Charsets:: Predefined charset objects. + + +File: lispref.info, Node: Charset Properties, Next: Basic Charset Functions, Up: Charsets + +Charset Properties +------------------ + + Charsets have the following properties: + +`name' + A symbol naming the charset. Every charset must have a different + name; this allows a charset to be referred to using its name + rather than the actual charset object. + +`doc-string' + A documentation string describing the charset. + +`registry' + A regular expression matching the font registry field for this + character set. For example, both the `ascii' and `latin-iso8859-1' + charsets use the registry `"ISO8859-1"'. This field is used to + choose an appropriate font when the user gives a general font + specification such as `-*-courier-medium-r-*-140-*', i.e. a + 14-point upright medium-weight Courier font. + +`dimension' + Number of position codes used to index a character in the + character set. XEmacs/MULE can only handle character sets of + dimension 1 or 2. This property defaults to 1. + +`chars' + Number of characters in each dimension. In XEmacs/MULE, the only + allowed values are 94 or 96. (There are a couple of pre-defined + character sets, such as ASCII, that do not follow this, but you + cannot define new ones like this.) Defaults to 94. Note that if + the dimension is 2, the character set thus described is 94x94 or + 96x96. + +`columns' + Number of columns used to display a character in this charset. + Only used in TTY mode. (Under X, the actual width of a character + can be derived from the font used to display the characters.) If + unspecified, defaults to the dimension. (This is almost always the + correct value, because character sets with dimension 2 are usually + ideograph character sets, which need two columns to display the + intricate ideographs.) + +`direction' + A symbol, either `l2r' (left-to-right) or `r2l' (right-to-left). + Defaults to `l2r'. This specifies the direction that the text + should be displayed in, and will be left-to-right for most + charsets but right-to-left for Hebrew and Arabic. (Right-to-left + display is not currently implemented.) + +`final' + Final byte of the standard ISO 2022 escape sequence designating + this charset. Must be supplied. Each combination of (DIMENSION, + CHARS) defines a separate namespace for final bytes, and each + charset within a particular namespace must have a different final + byte. Note that ISO 2022 restricts the final byte to the range + 0x30 - 0x7E if dimension == 1, and 0x30 - 0x5F if dimension == 2. + Note also that final bytes in the range 0x30 - 0x3F are reserved + for user-defined (not official) character sets. For more + information on ISO 2022, see *Note Coding Systems::. + +`graphic' + 0 (use left half of font on output) or 1 (use right half of font on + output). Defaults to 0. This specifies how to convert the + position codes that index a character in a character set into an + index into the font used to display the character set. With + `graphic' set to 0, position codes 33 through 126 map to font + indices 33 through 126; with it set to 1, position codes 33 + through 126 map to font indices 161 through 254 (i.e. the same + number but with the high bit set). For example, for a font whose + registry is ISO8859-1, the left half of the font (octets 0x20 - + 0x7F) is the `ascii' charset, while the right half (octets 0xA0 - + 0xFF) is the `latin-iso8859-1' charset. + +`ccl-program' + A compiled CCL program used to convert a character in this charset + into an index into the font. This is in addition to the `graphic' + property. If a CCL program is defined, the position codes of a + character will first be processed according to `graphic' and 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 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, so as to group the most + commonly used characters together) into two charset objects + (`big5-1' and `big5-2'), each of size 94x94, and each charset + object uses a CCL program to convert the modified position codes + back into standard Big5 indices to retrieve a character from a + Big5 font. + + Most of the above properties can only be changed when the charset is +created. *Note Charset Property Functions::. + + +File: lispref.info, Node: Basic Charset Functions, Next: Charset Property Functions, Prev: Charset Properties, Up: Charsets + +Basic Charset Functions +----------------------- + + - Function: find-charset CHARSET-OR-NAME + This function retrieves the charset of the given name. If + CHARSET-OR-NAME is a charset object, it is simply returned. + Otherwise, CHARSET-OR-NAME should be a symbol. If there is no + such charset, `nil' is returned. Otherwise the associated charset + object is returned. + + - Function: get-charset NAME + This function retrieves the charset of the given name. Same as + `find-charset' except an error is signalled if there is no such + charset instead of returning `nil'. + + - Function: charset-list + This function returns a list of the names of all defined charsets. + + - Function: make-charset NAME DOC-STRING PROPS + This function defines a new character set. This function is for + use with Mule support. NAME is a symbol, the name by which the + character set is normally referred. DOC-STRING is a string + describing the character set. PROPS is a property list, + describing the specific nature of the character set. The + recognized properties are `registry', `dimension', `columns', + `chars', `final', `graphic', `direction', and `ccl-program', as + previously described. + + - Function: make-reverse-direction-charset CHARSET NEW-NAME + This function makes a charset equivalent to CHARSET but which goes + in the opposite direction. NEW-NAME is the name of the new + charset. The new charset is returned. + + - Function: charset-from-attributes DIMENSION CHARS FINAL &optional + DIRECTION + This function returns a charset with the given DIMENSION, CHARS, + FINAL, and DIRECTION. If DIRECTION is omitted, both directions + will be checked (left-to-right will be returned if character sets + exist for both directions). + + - Function: charset-reverse-direction-charset CHARSET + This function returns the charset (if any) with the same dimension, + number of characters, and final byte as CHARSET, but which is + displayed in the opposite direction. + + +File: lispref.info, Node: Charset Property Functions, Next: Predefined Charsets, Prev: Basic Charset Functions, Up: Charsets + +Charset Property Functions +-------------------------- + + All of these functions accept either a charset name or charset +object. + + - Function: charset-property CHARSET PROP + This function returns property PROP of CHARSET. *Note Charset + Properties::. + + Convenience functions are also provided for retrieving individual +properties of a charset. + + - Function: charset-name CHARSET + This function returns the name of CHARSET. This will be a symbol. + + - Function: charset-doc-string CHARSET + This function returns the doc string of CHARSET. + + - Function: charset-registry CHARSET + This function returns the registry of CHARSET. + + - Function: charset-dimension CHARSET + This function returns the dimension of CHARSET. + + - Function: charset-chars CHARSET + This function returns the number of characters per dimension of + CHARSET. + + - Function: charset-columns CHARSET + This function returns the number of display columns per character + (in TTY mode) of CHARSET. + + - Function: charset-direction CHARSET + This function returns the display direction of CHARSET - either + `l2r' or `r2l'. + + - Function: charset-final CHARSET + This function returns the final byte of the ISO 2022 escape + sequence designating CHARSET. + + - Function: charset-graphic CHARSET + This function returns either 0 or 1, depending on whether the + position codes of characters in CHARSET map to the left or right + half of their font, respectively. + + - Function: charset-ccl-program CHARSET + This function returns the CCL program, if any, for converting + position codes of characters in CHARSET into font indices. + + The only property of a charset that can currently be set after the +charset has been created is the CCL program. + + - Function: set-charset-ccl-program CHARSET CCL-PROGRAM + This function sets the `ccl-program' property of CHARSET to + CCL-PROGRAM. + + +File: lispref.info, Node: Predefined Charsets, Prev: Charset Property Functions, Up: Charsets + +Predefined Charsets +------------------- + + The following charsets are predefined in the C code. + + Name Type Fi Gr Dir Registry + -------------------------------------------------------------- + ascii 94 B 0 l2r ISO8859-1 + control-1 94 0 l2r --- + latin-iso8859-1 94 A 1 l2r ISO8859-1 + latin-iso8859-2 96 B 1 l2r ISO8859-2 + latin-iso8859-3 96 C 1 l2r ISO8859-3 + latin-iso8859-4 96 D 1 l2r ISO8859-4 + cyrillic-iso8859-5 96 L 1 l2r ISO8859-5 + arabic-iso8859-6 96 G 1 r2l ISO8859-6 + greek-iso8859-7 96 F 1 l2r ISO8859-7 + hebrew-iso8859-8 96 H 1 r2l ISO8859-8 + latin-iso8859-9 96 M 1 l2r ISO8859-9 + thai-tis620 96 T 1 l2r TIS620 + katakana-jisx0201 94 I 1 l2r JISX0201.1976 + latin-jisx0201 94 J 0 l2r JISX0201.1976 + japanese-jisx0208-1978 94x94 @ 0 l2r JISX0208.1978 + japanese-jisx0208 94x94 B 0 l2r JISX0208.19(83|90) + japanese-jisx0212 94x94 D 0 l2r JISX0212 + chinese-gb2312 94x94 A 0 l2r GB2312 + chinese-cns11643-1 94x94 G 0 l2r CNS11643.1 + chinese-cns11643-2 94x94 H 0 l2r CNS11643.2 + chinese-big5-1 94x94 0 0 l2r Big5 + chinese-big5-2 94x94 1 0 l2r Big5 + korean-ksc5601 94x94 C 0 l2r KSC5601 + composite 96x96 0 l2r --- + + The following charsets are predefined in the Lisp code. + + Name Type Fi Gr Dir Registry + -------------------------------------------------------------- + arabic-digit 94 2 0 l2r MuleArabic-0 + arabic-1-column 94 3 0 r2l MuleArabic-1 + arabic-2-column 94 4 0 r2l MuleArabic-2 + sisheng 94 0 0 l2r sisheng_cwnn\|OMRON_UDC_ZH + chinese-cns11643-3 94x94 I 0 l2r CNS11643.1 + chinese-cns11643-4 94x94 J 0 l2r CNS11643.1 + chinese-cns11643-5 94x94 K 0 l2r CNS11643.1 + chinese-cns11643-6 94x94 L 0 l2r CNS11643.1 + chinese-cns11643-7 94x94 M 0 l2r CNS11643.1 + ethiopic 94x94 2 0 l2r Ethio + ascii-r2l 94 B 0 r2l ISO8859-1 + ipa 96 0 1 l2r MuleIPA + vietnamese-lower 96 1 1 l2r VISCII1.1 + vietnamese-upper 96 2 1 l2r VISCII1.1 + + 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. +This is why some of the fields are blank; and some of the filled-in +fields (e.g. the type) are not really accurate. + + +File: lispref.info, Node: MULE Characters, Next: Composite Characters, Prev: Charsets, Up: MULE + +MULE Characters +=============== + + - Function: make-char CHARSET ARG1 &optional ARG2 + This function makes a multi-byte character from CHARSET and octets + ARG1 and ARG2. + + - Function: char-charset CH + This function returns the character set of char CH. + + - Function: char-octet CH &optional N + This function returns the octet (i.e. position code) numbered N + (should be 0 or 1) of char CH. N defaults to 0 if omitted. + + - Function: find-charset-region START END &optional BUFFER + This function returns a list of the charsets in the region between + START and END. BUFFER defaults to the current buffer if omitted. + + - Function: find-charset-string STRING + This function returns a list of the charsets in STRING. + + +File: lispref.info, Node: Composite Characters, Next: ISO 2022, Prev: MULE Characters, Up: MULE + +Composite Characters +==================== + + Composite characters are not yet completely implemented. + + - Function: make-composite-char STRING + This function converts a string into a single composite character. + The character is the result of overstriking all the characters in + the string. + + - Function: composite-char-string CH + This function returns a string of the characters comprising a + composite character. + + - Function: compose-region START END &optional BUFFER + This function composes the characters in the region from START to + END in BUFFER into one composite character. The composite + character replaces the composed characters. BUFFER defaults to + the current buffer if omitted. + + - Function: decompose-region START END &optional BUFFER + This function decomposes any composite characters in the region + from START to END in BUFFER. 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. + + +File: lispref.info, Node: ISO 2022, Next: Coding Systems, Prev: Composite Characters, Up: MULE + +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 ("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. + +94-charset + ASCII(B), left(J) and right(I) half of JISX0201, ... + +96-charset + Latin-1(A), Latin-2(B), Latin-3(C), ... + +94x94-charset + GB2312(A), JISX0208(B), KSC5601(C), ... + +96x96-charset + none for the moment + + The character in parentheses after the name of each charset is the +"final character" F, which can be regarded as the identifier of the +charset. ECMA allocates F to each charset. F is in the range of +0x30..0x7F, but 0x30..0x3F are only for private use. + + Note: "ECMA" = European Computer Manufacturers Association + + There are four "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. + + C0: 0x00 - 0x1F + GL: 0x20 - 0x7F + C1: 0x80 - 0x9F + GR: 0xA0 - 0xFF + + 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: + + ESC [I] I F + + where I is an intermediate character in the range 0x20 - 0x2F, and F +is the final character identifying this charset. + + The meaning of intermediate characters are: + + $ [0x24]: indicate charset of dimension 2 (94x94 or 96x96). + ( [0x28]: designate to G0 a 94-charset whose final byte is F. + ) [0x29]: designate to G1 a 94-charset whose final byte is F. + * [0x2A]: designate to G2 a 94-charset whose final byte is F. + + [0x2B]: designate to G3 a 94-charset whose final byte is F. + - [0x2D]: designate to G1 a 96-charset whose final byte is F. + . [0x2E]: designate to G2 a 96-charset whose final byte is F. + / [0x2F]: designate to G3 a 96-charset whose final byte is F. + + The following rule is not allowed in ISO 2022 but can be used in +Mule. + + , [0x2C]: designate to G0 a 96-charset whose final byte is F. + + Here are examples of designations: + + 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 + + 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: + + 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 + + Single Shift is done as follows: + + SS2 or ESC N: invoke G2 into GL + SS3 or ESC O: invoke G3 into GL + + (#### 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: + + 1. Initial designation to G0 thru G3. + + 2. Allow designation of short form for Japanese and Chinese. + + 3. Should we designate ASCII to G0 before control characters? + + 4. Should we designate ASCII to G0 at the end of line? + + 5. 7-bit environment or 8-bit environment. + + 6. Use Locking Shift or not. + + 7. Use ASCII or JIS0201-1976-Roman. + + 8. Use JISX0208-1983 or JISX0208-1976. + + (The last two are only for Japanese.) + + By specifying these attributes, you can create any variant of ISO +2022. + + Here are several examples: + + 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 + + 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 + + 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 + + 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. + + Mule creates all these coding systems by default. + + +File: lispref.info, Node: Coding Systems, Next: CCL, Prev: ISO 2022, Up: MULE + +Coding Systems +============== + + A coding system is an object that defines how text containing +multiple character sets is encoded into a stream of (typically 8-bit) +bytes. The coding system is used to decode the stream into a series of +characters (which may be from multiple charsets) when the text is read +from a file or process, and is used to encode the text back into the +same format when it is written out to a file or process. + + For example, many ISO-2022-compliant coding systems (such as Compound +Text, which is used for inter-client data under the X Window System) use +escape sequences to switch between different charsets - Japanese Kanji, +for example, is invoked with `ESC $ ( B'; ASCII is invoked with `ESC ( +B'; and Cyrillic is invoked with `ESC - L'. See `make-coding-system' +for more information. + + Coding systems are normally identified using a symbol, and the +symbol is accepted in place of the actual coding system object whenever +a coding system is called for. (This is similar to how faces and +charsets work.) + + - Function: coding-system-p OBJECT + This function returns non-`nil' if OBJECT is a coding system. + +* Menu: + +* Coding System Types:: Classifying coding systems. +* EOL Conversion:: Dealing with different ways of denoting + the end of a line. +* Coding System Properties:: Properties of a coding system. +* Basic Coding System Functions:: Working with coding systems. +* Coding System Property Functions:: Retrieving a coding system's properties. +* Encoding and Decoding Text:: Encoding and decoding text. +* Detection of Textual Encoding:: Determining how text is encoded. +* Big5 and Shift-JIS Functions:: Special functions for these non-standard + encodings. + + +File: lispref.info, Node: Coding System Types, Next: EOL Conversion, Up: Coding Systems + +Coding System Types +------------------- + +`nil' +`autodetect' + Automatic conversion. XEmacs attempts to detect the coding system + used in the file. + +`no-conversion' + No conversion. Use this for binary files and such. On output, + graphic characters that are not in ASCII or Latin-1 will be + replaced by a `?'. (For a no-conversion-encoded buffer, these + characters will only be present if you explicitly insert them.) + +`shift-jis' + Shift-JIS (a Japanese encoding commonly used in PC operating + systems). + +`iso2022' + Any ISO-2022-compliant encoding. Among other things, this + includes JIS (the Japanese encoding commonly used for e-mail), + national variants of EUC (the standard Unix encoding for Japanese + and other languages), and Compound Text (an encoding used in X11). + You can specify more specific information about the conversion + with the FLAGS argument. + +`big5' + Big5 (the encoding commonly used for Taiwanese). + +`ccl' + The conversion is performed using a user-written pseudo-code + program. CCL (Code Conversion Language) is the name of this + pseudo-code. + +`internal' + Write out or read in the raw contents of the memory representing + the buffer's text. This is primarily useful for debugging + purposes, and is only enabled when XEmacs has been compiled with + `DEBUG_XEMACS' set (the `--debug' configure option). *Warning*: + Reading in a file using `internal' conversion can result in an + internal inconsistency in the memory representing a buffer's text, + which will produce unpredictable results and may cause XEmacs to + crash. Under normal circumstances you should never use `internal' + conversion. + + +File: lispref.info, Node: EOL Conversion, Next: Coding System Properties, Prev: Coding System Types, Up: Coding Systems + +EOL Conversion +-------------- + +`nil' + Automatically detect the end-of-line type (LF, CRLF, or CR). Also + generate subsidiary coding systems named `NAME-unix', `NAME-dos', + and `NAME-mac', that are identical to this coding system but have + an EOL-TYPE value of `lf', `crlf', and `cr', respectively. + +`lf' + The end of a line is marked externally using ASCII LF. Since this + is also the way that XEmacs represents an end-of-line internally, + specifying this option results in no end-of-line conversion. This + is the standard format for Unix text files. + +`crlf' + The end of a line is marked externally using ASCII CRLF. This is + the standard format for MS-DOS text files. + +`cr' + The end of a line is marked externally using ASCII CR. This is the + standard format for Macintosh text files. + +`t' + Automatically detect the end-of-line type but do not generate + subsidiary coding systems. (This value is converted to `nil' when + stored internally, and `coding-system-property' will return `nil'.) + + +File: lispref.info, Node: Coding System Properties, Next: Basic Coding System Functions, Prev: EOL Conversion, Up: Coding Systems + +Coding System Properties +------------------------ + +`mnemonic' + String to be displayed in the modeline when this coding system is + active. + +`eol-type' + End-of-line conversion to be used. It should be one of the types + listed in *Note EOL Conversion::. + +`post-read-conversion' + Function called after a file has been read in, to perform the + decoding. Called with two arguments, BEG and END, denoting a + region of the current buffer to be decoded. + +`pre-write-conversion' + Function called before a file is written out, to perform the + encoding. Called with two arguments, BEG and END, denoting a + region of the current buffer to be encoded. + + The following additional properties are recognized if TYPE is +`iso2022': + +`charset-g0' +`charset-g1' +`charset-g2' +`charset-g3' + The character set initially designated to the G0 - G3 registers. + The value should be one of + + * A charset object (designate that character set) + + * `nil' (do not ever use this register) + + * `t' (no character set is initially designated to the + register, but may be later on; this automatically sets the + corresponding `force-g*-on-output' property) + +`force-g0-on-output' +`force-g1-on-output' +`force-g2-on-output' +`force-g3-on-output' + If non-`nil', send an explicit designation sequence on output + before using the specified register. + +`short' + If non-`nil', use the short forms `ESC $ @', `ESC $ A', and `ESC $ + B' on output in place of the full designation sequences `ESC $ ( + @', `ESC $ ( A', and `ESC $ ( B'. + +`no-ascii-eol' + If non-`nil', don't designate ASCII to G0 at each end of line on + output. Setting this to non-`nil' also suppresses other + state-resetting that normally happens at the end of a line. + +`no-ascii-cntl' + If non-`nil', don't designate ASCII to G0 before control chars on + output. + +`seven' + If non-`nil', use 7-bit environment on output. Otherwise, use + 8-bit environment. + +`lock-shift' + If non-`nil', use locking-shift (SO/SI) instead of single-shift or + designation by escape sequence. + +`no-iso6429' + If non-`nil', don't use ISO6429's direction specification. + +`escape-quoted' + If non-nil, literal control characters that are the same as the + beginning of a recognized ISO 2022 or ISO 6429 escape sequence (in + particular, ESC (0x1B), SO (0x0E), SI (0x0F), SS2 (0x8E), SS3 + (0x8F), and CSI (0x9B)) are "quoted" with an escape character so + that they can be properly distinguished from an escape sequence. + (Note that doing this results in a non-portable encoding.) This + encoding flag is used for byte-compiled files. Note that ESC is a + good choice for a quoting character because there are no escape + sequences whose second byte is a character from the Control-0 or + Control-1 character sets; this is explicitly disallowed by the ISO + 2022 standard. + +`input-charset-conversion' + A list of conversion specifications, specifying conversion of + characters in one charset to another when decoding is performed. + Each specification is a list of two elements: the source charset, + and the destination charset. + +`output-charset-conversion' + A list of conversion specifications, specifying conversion of + characters in one charset to another when encoding is performed. + The form of each specification is the same as for + `input-charset-conversion'. + + The following additional properties are recognized (and required) if +TYPE is `ccl': + +`decode' + CCL program used for decoding (converting to internal format). + +`encode' + CCL program used for encoding (converting to external format). + + +File: lispref.info, Node: Basic Coding System Functions, Next: Coding System Property Functions, Prev: Coding System Properties, Up: Coding Systems + +Basic Coding System Functions +----------------------------- + + - Function: find-coding-system CODING-SYSTEM-OR-NAME + This function retrieves the coding system of the given name. + + If CODING-SYSTEM-OR-NAME is a coding-system object, it is simply + returned. Otherwise, CODING-SYSTEM-OR-NAME should be a symbol. + If there is no such coding system, `nil' is returned. Otherwise + the associated coding system object is returned. + + - Function: get-coding-system NAME + This function retrieves the coding system of the given name. Same + as `find-coding-system' except an error is signalled if there is no + such coding system instead of returning `nil'. + + - Function: coding-system-list + This function returns a list of the names of all defined coding + systems. + + - Function: coding-system-name CODING-SYSTEM + This function returns the name of the given coding system. + + - Function: make-coding-system NAME TYPE &optional DOC-STRING PROPS + This function registers symbol NAME as a coding system. + + TYPE describes the conversion method used and should be one of the + types listed in *Note Coding System Types::. + + DOC-STRING is a string describing the coding system. + + PROPS is a property list, describing the specific nature of the + character set. Recognized properties are as in *Note Coding + System Properties::. + + - Function: copy-coding-system OLD-CODING-SYSTEM NEW-NAME + This function copies OLD-CODING-SYSTEM to NEW-NAME. If NEW-NAME + does not name an existing coding system, a new one will be created. + + - Function: subsidiary-coding-system CODING-SYSTEM EOL-TYPE + This function returns the subsidiary coding system of + CODING-SYSTEM with eol type EOL-TYPE. + + +File: lispref.info, Node: Coding System Property Functions, Next: Encoding and Decoding Text, Prev: Basic Coding System Functions, Up: Coding Systems + +Coding System Property Functions +-------------------------------- + + - Function: coding-system-doc-string CODING-SYSTEM + This function returns the doc string for CODING-SYSTEM. + + - Function: coding-system-type CODING-SYSTEM + This function returns the type of CODING-SYSTEM. + + - Function: coding-system-property CODING-SYSTEM PROP + This function returns the PROP property of CODING-SYSTEM. + + +File: lispref.info, Node: Encoding and Decoding Text, Next: Detection of Textual Encoding, Prev: Coding System Property Functions, Up: Coding Systems + +Encoding and Decoding Text +-------------------------- + + - Function: decode-coding-region START END CODING-SYSTEM &optional + BUFFER + This function decodes the text between START and END which is + encoded in CODING-SYSTEM. This is useful if you've read in + encoded text from a file without decoding it (e.g. you read in a + JIS-formatted file but used the `binary' or `no-conversion' coding + system, so that it shows up as `^[$B!> | <8 | >8 | // + | < | > | == | <= | >= | != | de-sjis | en-sjis +ASSIGNMENT_OPERATOR := + += | -= | *= | /= | %= | &= | '|=' | ^= | <<= | >>= +ARRAY := '[' integer ... ']' + + +File: lispref.info, Node: CCL Statements, Next: CCL Expressions, Prev: CCL Syntax, Up: CCL + +CCL Statements +-------------- + + The Emacs Code Conversion Language provides the following statement +types: "set", "if", "branch", "loop", "repeat", "break", "read", +"write", "call", and "end". + +Set statement: +============== + + The "set" statement has three variants with the syntaxes `(REG = +EXPRESSION)', `(REG ASSIGNMENT_OPERATOR EXPRESSION)', and `INTEGER'. +The assignment operator variation of the "set" statement works the same +way as the corresponding C expression statement does. The assignment +operators are `+=', `-=', `*=', `/=', `%=', `&=', `|=', `^=', `<<=', +and `>>=', and they have the same meanings as in C. A "naked integer" +INTEGER is equivalent to a SET statement of the form `(r0 = INTEGER)'. + +I/O statements: +=============== + + The "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 "write" takes several forms. In the form `(write 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 current +output buffer. If it is less than 256, it is written as is. The forms +`(write EXPRESSION)' and `(write INTEGER)' are treated analogously. +The form `(write STRING)' writes the constant string to the output. A +"naked string" `STRING' is equivalent to the statement `(write +STRING)'. The form `(write REG ARRAY)' writes the REGth element of the +ARRAY to the output. + +Conditional statements: +======================= + + The "if" statement takes an EXPRESSION, a CCL BLOCK, and an optional +SECOND CCL BLOCK as arguments. If the EXPRESSION evaluates to +non-zero, the first CCL BLOCK is executed. Otherwise, if there is a +SECOND CCL BLOCK, it is executed. + + The "read-if" variant of the "if" statement takes an EXPRESSION, a +CCL BLOCK, and an optional SECOND CCL BLOCK as arguments. The +EXPRESSION must have the form `(REG OPERATOR OPERAND)' (where OPERAND is +a register or an integer). The `read-if' statement first reads from +the input into the first register operand in the EXPRESSION, then +conditionally executes a CCL block just as the `if' statement does. + + The "branch" statement takes an EXPRESSION and one or more CCL +blocks as arguments. The CCL blocks are treated as a zero-indexed +array, and the `branch' statement uses the EXPRESSION as the index of +the CCL block to execute. Null CCL blocks may be used as no-ops, +continuing execution with the statement following the `branch' +statement in the containing CCL block. Out-of-range values for the +EXPRESSION are also treated as no-ops. + + The "read-branch" variant of the "branch" statement takes an +REGISTER, a CCL BLOCK, and an optional SECOND CCL BLOCK as arguments. +The `read-branch' statement first reads from the input into the +REGISTER, then conditionally executes a CCL block just as the `branch' +statement does. + +Loop control statements: +======================== + + The "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 `break' +statement, and continued without executing the tail by a `repeat' +statement. + + The "break" statement, written `(break)', terminates the current +loop and continues with the next statement in the current block. + + The "repeat" statement has three variants, `repeat', `write-repeat', +and `write-read-repeat'. Each continues the current loop from its +head, possibly after performing I/O. `repeat' takes no arguments and +does no I/O before jumping. `write-repeat' takes a single argument (a +register, an integer, or a string), writes it to the output, then jumps. +`write-read-repeat' takes one or two arguments. The first must be a +register. The second may be an integer or an array; if absent, it is +implicitly set to the first (register) argument. `write-read-repeat' +writes its second argument to the output, then reads from the input +into the register, and finally jumps. See the `write' and `read' +statements for the semantics of the I/O operations for each type of +argument. + +Other control statements: +========================= + + The "call" statement, written `(call 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 "end" statement, written `(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. + + +File: lispref.info, Node: CCL Expressions, Next: Calling CCL, Prev: CCL Statements, Up: CCL + +CCL Expressions +--------------- + + CCL, unlike Lisp, uses infix expressions. The simplest CCL +expressions consist of a single OPERAND, either a register (one of `r0', +..., `r0') or an integer. Complex expressions are lists of the form `( +EXPRESSION OPERATOR OPERAND )'. Unlike C, assignments are not +expressions. + + In the following table, X is the target resister for a "set". In +subexpressions, this is implicitly `r7'. This means that `>8', `//', +`de-sjis', and `en-sjis' cannot be used freely in subexpressions, since +they return parts of their values in `r7'. Y may be an expression, +register, or integer, while Z must be a register or an integer. + +Name Operator Code C-like Description +CCL_PLUS `+' 0x00 X = Y + Z +CCL_MINUS `-' 0x01 X = Y - Z +CCL_MUL `*' 0x02 X = Y * Z +CCL_DIV `/' 0x03 X = Y / Z +CCL_MOD `%' 0x04 X = Y % Z +CCL_AND `&' 0x05 X = Y & Z +CCL_OR `|' 0x06 X = Y | Z +CCL_XOR `^' 0x07 X = Y ^ Z +CCL_LSH `<<' 0x08 X = Y << Z +CCL_RSH `>>' 0x09 X = Y >> Z +CCL_LSH8 `<8' 0x0A X = (Y << 8) | Z +CCL_RSH8 `>8' 0x0B X = Y >> 8, r[7] = Y & 0xFF +CCL_DIVMOD `//' 0x0C X = Y / Z, r[7] = Y % Z +CCL_LS `<' 0x10 X = (X < Y) +CCL_GT `>' 0x11 X = (X > Y) +CCL_EQ `==' 0x12 X = (X == Y) +CCL_LE `<=' 0x13 X = (X <= Y) +CCL_GE `>=' 0x14 X = (X >= Y) +CCL_NE `!=' 0x15 X = (X != Y) +CCL_ENCODE_SJIS `en-sjis' 0x16 X = HIGHER_BYTE (SJIS (Y, Z)) + r[7] = LOWER_BYTE (SJIS (Y, Z) +CCL_DECODE_SJIS `de-sjis' 0x17 X = HIGHER_BYTE (DE-SJIS (Y, Z)) + r[7] = LOWER_BYTE (DE-SJIS (Y, Z)) + + 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 encoding of Japanese characters used by Microsoft. +CCL_ENCODE_SJIS is a complicated transformation of the Japanese +standard JIS encoding to Shift JIS. CCL_DECODE_SJIS is its inverse.) +It is somewhat odd to represent the SJIS operations in infix form. + + +File: lispref.info, Node: Calling CCL, Next: CCL Examples, Prev: CCL Expressions, Up: CCL + +Calling CCL +----------- + + CCL programs are called automatically during Emacs buffer I/O when +the external representation has a coding system type of `shift-jis', +`big5', or `ccl'. The program is specified by the coding system (*note +Coding Systems::.). You can also call CCL programs from other CCL +programs, and from Lisp using these functions: + + - Function: ccl-execute CCL-PROGRAM STATUS + Execute CCL-PROGRAM with registers initialized by STATUS. + CCL-PROGRAM is a vector of compiled CCL code created by + `ccl-compile'. It is an error for the program to try to execute a + CCL I/O command. STATUS must be a vector of nine values, + specifying the initial value for the R0, R1 .. R7 registers and + for the instruction counter IC. A `nil' value for a register + initializer causes the register to be set to 0. A `nil' value for + the IC initializer causes execution to start at the beginning of + the program. When the program is done, STATUS is modified (by + side-effect) to contain the ending values for the corresponding + registers and IC. + + - Function: ccl-execute-on-string CCL-PROGRAM STATUS STR &optional + CONTINUE + Execute CCL-PROGRAM with initial STATUS on STRING. CCL-PROGRAM is + a vector of compiled CCL code created by `ccl-compile'. STATUS + must be a vector of nine values, specifying the initial value for + the R0, R1 .. R7 registers and for the instruction counter IC. A + `nil' value for a register initializer causes the register to be + set to 0. A `nil' value for the IC initializer causes execution + to start at the beginning of the program. An optional fourth + argument CONTINUE, if non-nil, causes the IC to remain on the + unsatisfied read operation if the program terminates due to + exhaustion of the input buffer. Otherwise the IC is set to the end + of the program. When the program is done, STATUS is modified (by + side-effect) to contain the ending values for the corresponding + registers and IC. Returns the resulting string. + + To call a CCL program from another CCL program, it must first be +registered: + + - Function: register-ccl-program NAME CCL-PROGRAM + Register NAME for CCL program PROGRAM in `ccl-program-table'. + PROGRAM should be the compiled form of a CCL program, or nil. + Return index number of the registered CCL program. + + Information about the processor time used by the CCL interpreter can +be obtained using these functions: + + - Function: ccl-elapsed-time + Returns the elapsed processor time of the CCL interpreter as cons + of user and system time, as floating point numbers measured in + seconds. If only one overall value can be determined, the return + value will be a cons of that value and 0. + + - Function: ccl-reset-elapsed-time + Resets the CCL interpreter's internal elapsed time registers. + + +File: lispref.info, Node: CCL Examples, Prev: Calling CCL, Up: CCL + +CCL Examples +------------ + + This section is not yet written. + + +File: lispref.info, Node: Category Tables, Prev: CCL, Up: MULE + +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 +complicated [] expression (and category lookups are significantly +faster). + + There are 95 different categories available, one for each printable +character (including space) in the ASCII charset. Each category is +designated by one such character, called a "category designator". They +are specified in a regexp using the syntax `\cX', where X is a category +designator. (This is not yet implemented.) + + A category table specifies, for each character, the categories that +the character is in. Note that a character can be in more than one +category. More specifically, a category table maps from a character to +either the value `nil' (meaning the character is in no categories) or a +95-element bit vector, specifying for each of the 95 categories whether +the character is in that category. + + Special Lisp functions are provided that abstract this, so you do not +have to directly manipulate bit vectors. + + - Function: category-table-p OBJ + This function returns `t' if ARG is a category table. + + - Function: category-table &optional BUFFER + This function returns the current category table. This is the one + specified by the current buffer, or by BUFFER if it is non-`nil'. + + - Function: standard-category-table + This function returns the standard category table. This is the + one used for new buffers. + + - Function: copy-category-table &optional TABLE + This function constructs a new category table and return it. It + is a copy of the TABLE, which defaults to the standard category + table. + + - Function: set-category-table TABLE &optional BUFFER + This function selects a new category table for BUFFER. One + argument, a category table. BUFFER defaults to the current buffer + if omitted. + + - Function: category-designator-p OBJ + This function returns `t' if ARG is a category designator (a char + in the range `' '' to `'~''). + + - Function: category-table-value-p OBJ + This function returns `t' if ARG is a category table value. Valid + values are `nil' or a bit vector of size 95. + + +File: lispref.info, Node: Tips, Next: Building XEmacs and Object Allocation, Prev: MULE, Up: Top + +Tips and Standards +****************** + + This chapter describes no additional features of XEmacs Lisp. +Instead it gives advice on making effective use of the features +described in the previous chapters. + +* Menu: + +* Style Tips:: Writing clean and robust programs. +* Compilation Tips:: Making compiled code run fast. +* Documentation Tips:: Writing readable documentation strings. +* Comment Tips:: Conventions for writing comments. +* Library Headers:: Standard headers for library packages. + + +File: lispref.info, Node: Style Tips, Next: Compilation Tips, Up: Tips + +Writing Clean Lisp Programs +=========================== + + Here are some tips for avoiding common errors in writing Lisp code +intended for widespread use: + + * Since all global variables share the same name space, and all + functions share another name space, you should choose a short word + to distinguish your program from other Lisp programs. Then take + care to begin the names of all global variables, constants, and + functions with the chosen prefix. This helps avoid name conflicts. + + This recommendation applies even to names for traditional Lisp + primitives that are not primitives in XEmacs Lisp--even to `cadr'. + Believe it or not, there is more than one plausible way to define + `cadr'. Play it safe; append your name prefix to produce a name + like `foo-cadr' or `mylib-cadr' instead. + + If you write a function that you think ought to be added to Emacs + under a certain name, such as `twiddle-files', don't call it by + that name in your program. Call it `mylib-twiddle-files' in your + program, and send mail to `bug-gnu-emacs@prep.ai.mit.edu' + suggesting we add it to Emacs. If and when we do, we can change + the name easily enough. + + If one prefix is insufficient, your package may use two or three + alternative common prefixes, so long as they make sense. + + Separate the prefix from the rest of the symbol name with a hyphen, + `-'. This will be consistent with XEmacs itself and with most + Emacs Lisp programs. + + * It is often useful to put a call to `provide' in each separate + library program, at least if there is more than one entry point to + the program. + + * If a file requires certain other library programs to be loaded + beforehand, then the comments at the beginning of the file should + say so. Also, use `require' to make sure they are loaded. + + * If one file FOO uses a macro defined in another file BAR, FOO + should contain this expression before the first use of the macro: + + (eval-when-compile (require 'BAR)) + + (And BAR should contain `(provide 'BAR)', to make the `require' + work.) This will cause BAR to be loaded when you byte-compile + FOO. Otherwise, you risk compiling FOO without the necessary + macro loaded, and that would produce compiled code that won't work + right. *Note Compiling Macros::. + + Using `eval-when-compile' avoids loading BAR when the compiled + version of FOO is *used*. + + * If you define a major mode, make sure to run a hook variable using + `run-hooks', just as the existing major modes do. *Note Hooks::. + + * If the purpose of a function is to tell you whether a certain + condition is true or false, give the function a name that ends in + `p'. If the name is one word, add just `p'; if the name is + multiple words, add `-p'. Examples are `framep' and + `frame-live-p'. + + * If a user option variable records a true-or-false condition, give + it a name that ends in `-flag'. + + * Please do not define `C-c LETTER' as a key in your major modes. + These sequences are reserved for users; they are the *only* + sequences reserved for users, so we cannot do without them. + + Instead, define sequences consisting of `C-c' followed by a + non-letter. These sequences are reserved for major modes. + + Changing all the major modes in Emacs 18 so they would follow this + convention was a lot of work. Abandoning this convention would + make that work go to waste, and inconvenience users. + + * Sequences consisting of `C-c' followed by `{', `}', `<', `>', `:' + or `;' are also reserved for major modes. + + * Sequences consisting of `C-c' followed by any other punctuation + character are allocated for minor modes. Using them in a major + mode is not absolutely prohibited, but if you do that, the major + mode binding may be shadowed from time to time by minor modes. + + * You should not bind `C-h' following any prefix character (including + `C-c'). If you don't bind `C-h', it is automatically available as + a help character for listing the subcommands of the prefix + character. + + * You should not bind a key sequence ending in except following + another . (That is, it is ok to bind a sequence ending in + ` '.) + + The reason for this rule is that a non-prefix binding for in + any context prevents recognition of escape sequences as function + keys in that context. + + * Applications should not bind mouse events based on button 1 with + the shift key held down. These events include `S-mouse-1', + `M-S-mouse-1', `C-S-mouse-1', and so on. They are reserved for + users. + + * Modes should redefine `mouse-2' as a command to follow some sort of + reference in the text of a buffer, if users usually would not want + to alter the text in that buffer by hand. Modes such as Dired, + Info, Compilation, and Occur redefine it in this way. + + * When a package provides a modification of ordinary Emacs behavior, + it is good to include a command to enable and disable the feature, + Provide a command named `WHATEVER-mode' which turns the feature on + or off, and make it autoload (*note Autoload::.). Design the + package so that simply loading it has no visible effect--that + should not enable the feature. Users will request the feature by + invoking the command. + + * It is a bad idea to define aliases for the Emacs primitives. Use + the standard names instead. + + * Redefining an Emacs primitive is an even worse idea. It may do + the right thing for a particular program, but there is no telling + what other programs might break as a result. + + * If a file does replace any of the functions or library programs of + standard XEmacs, prominent comments at the beginning of the file + should say which functions are replaced, and how the behavior of + the replacements differs from that of the originals. + + * Please keep the names of your XEmacs Lisp source files to 13 + characters or less. This way, if the files are compiled, the + compiled files' names will be 14 characters or less, which is + short enough to fit on all kinds of Unix systems. + + * Don't use `next-line' or `previous-line' in programs; nearly + always, `forward-line' is more convenient as well as more + predictable and robust. *Note Text Lines::. + + * Don't call functions that set the mark, unless setting the mark is + one of the intended features of your program. The mark is a + user-level feature, so it is incorrect to change the mark except + to supply a value for the user's benefit. *Note The Mark::. + + In particular, don't use these functions: + + * `beginning-of-buffer', `end-of-buffer' + + * `replace-string', `replace-regexp' + + If you just want to move point, or replace a certain string, + without any of the other features intended for interactive users, + you can replace these functions with one or two lines of simple + Lisp code. + + * Use lists rather than vectors, except when there is a particular + reason to use a vector. Lisp has more facilities for manipulating + lists than for vectors, and working with lists is usually more + convenient. + + Vectors are advantageous for tables that are substantial in size + and are accessed in random order (not searched front to back), + provided there is no need to insert or delete elements (only lists + allow that). + + * The recommended way to print a message in the echo area is with + the `message' function, not `princ'. *Note The Echo Area::. + + * When you encounter an error condition, call the function `error' + (or `signal'). The function `error' does not return. *Note + Signaling Errors::. + + Do not use `message', `throw', `sleep-for', or `beep' to report + errors. + + * An error message should start with a capital letter but should not + end with a period. + + * Try to avoid using recursive edits. Instead, do what the Rmail `e' + command does: use a new local keymap that contains one command + defined to switch back to the old local keymap. Or do what the + `edit-options' command does: switch to another buffer and let the + user switch back at will. *Note Recursive Editing::. + + * In some other systems there is a convention of choosing variable + names that begin and end with `*'. We don't use that convention + in Emacs Lisp, so please don't use it in your programs. (Emacs + uses such names only for program-generated buffers.) The users + will find Emacs more coherent if all libraries use the same + conventions. + + * Indent each function with `C-M-q' (`indent-sexp') using the + default indentation parameters. + + * Don't make a habit of putting close-parentheses on lines by + themselves; Lisp programmers find this disconcerting. Once in a + while, when there is a sequence of many consecutive + close-parentheses, it may make sense to split them in one or two + significant places. + + * Please put a copyright notice on the file if you give copies to + anyone. Use the same lines that appear at the top of the Lisp + files in XEmacs itself. If you have not signed papers to assign + the copyright to the Foundation, then place your name in the + copyright notice in place of the Foundation's name. + + +File: lispref.info, Node: Compilation Tips, Next: Documentation Tips, Prev: Style Tips, Up: Tips + +Tips for Making Compiled Code Fast +================================== + + Here are ways of improving the execution speed of byte-compiled Lisp +programs. + + * Use the `profile' library to profile your program. See the file + `profile.el' for instructions. + + * Use iteration rather than recursion whenever possible. Function + calls are slow in XEmacs Lisp even when a compiled function is + calling another compiled function. + + * Using the primitive list-searching functions `memq', `member', + `assq', or `assoc' is even faster than explicit iteration. It may + be worth rearranging a data structure so that one of these + primitive search functions can be used. + + * Certain built-in functions are handled specially in byte-compiled + code, avoiding the need for an ordinary function call. It is a + good idea to use these functions rather than alternatives. To see + whether a function is handled specially by the compiler, examine + its `byte-compile' property. If the property is non-`nil', then + the function is handled specially. + + For example, the following input will show you that `aref' is + compiled specially (*note Array Functions::.) while `elt' is not + (*note Sequence Functions::.): + + (get 'aref 'byte-compile) + => byte-compile-two-args + + (get 'elt 'byte-compile) + => nil + + * If calling a small function accounts for a substantial part of + your program's running time, make the function inline. This + eliminates the function call overhead. Since making a function + inline reduces the flexibility of changing the program, don't do + it unless it gives a noticeable speedup in something slow enough + that users care about the speed. *Note Inline Functions::. + + +File: lispref.info, Node: Documentation Tips, Next: Comment Tips, Prev: Compilation Tips, Up: Tips + +Tips for Documentation Strings +============================== + + Here are some tips for the writing of documentation strings. + + * Every command, function, or variable intended for users to know + about should have a documentation string. + + * An internal variable or subroutine of a Lisp program might as well + have a documentation string. In earlier Emacs versions, you could + save space by using a comment instead of a documentation string, + but that is no longer the case. + + * The first line of the documentation string should consist of one + or two complete sentences that stand on their own as a summary. + `M-x apropos' displays just the first line, and if it doesn't + stand on its own, the result looks bad. In particular, start the + first line with a capital letter and end with a period. + + The documentation string can have additional lines that expand on + the details of how to use the function or variable. The + additional lines should be made up of complete sentences also, but + they may be filled if that looks good. + + * For consistency, phrase the verb in the first sentence of a + documentation string as an infinitive with "to" omitted. For + instance, use "Return the cons of A and B." in preference to + "Returns the cons of A and B." Usually it looks good to do + likewise for the rest of the first paragraph. Subsequent + paragraphs usually look better if they have proper subjects. + + * Write documentation strings in the active voice, not the passive, + and in the present tense, not the future. For instance, use + "Return a list containing A and B." instead of "A list containing + A and B will be returned." + + * Avoid using the word "cause" (or its equivalents) unnecessarily. + Instead of, "Cause Emacs to display text in boldface," write just + "Display text in boldface." + + * Do not start or end a documentation string with whitespace. + + * Format the documentation string so that it fits in an Emacs window + on an 80-column screen. It is a good idea for most lines to be no + wider than 60 characters. The first line can be wider if + necessary to fit the information that ought to be there. + + However, rather than simply filling the entire documentation + string, you can make it much more readable by choosing line breaks + with care. Use blank lines between topics if the documentation + string is long. + + * *Do not* indent subsequent lines of a documentation string so that + the text is lined up in the source code with the text of the first + line. This looks nice in the source code, but looks bizarre when + users view the documentation. Remember that the indentation + before the starting double-quote is not part of the string! + + * A variable's documentation string should start with `*' if the + variable is one that users would often want to set interactively. + If the value is a long list, or a function, or if the variable + would be set only in init files, then don't start the + documentation string with `*'. *Note Defining Variables::. + + * The documentation string for a variable that is a yes-or-no flag + should start with words such as "Non-nil means...", to make it + clear that all non-`nil' values are equivalent and indicate + explicitly what `nil' and non-`nil' mean. + + * When a function's documentation string mentions the value of an + argument of the function, use the argument name in capital letters + as if it were a name for that value. Thus, the documentation + string of the function `/' refers to its second argument as + `DIVISOR', because the actual argument name is `divisor'. + + Also use all caps for meta-syntactic variables, such as when you + show the decomposition of a list or vector into subunits, some of + which may vary. + + * When a documentation string refers to a Lisp symbol, write it as it + would be printed (which usually means in lower case), with + single-quotes around it. For example: `lambda'. There are two + exceptions: write t and nil without single-quotes. (In this + manual, we normally do use single-quotes for those symbols.) + + * Don't write key sequences directly in documentation strings. + Instead, use the `\\[...]' construct to stand for them. For + example, instead of writing `C-f', write `\\[forward-char]'. When + Emacs displays the documentation string, it substitutes whatever + key is currently bound to `forward-char'. (This is normally `C-f', + but it may be some other character if the user has moved key + bindings.) *Note Keys in Documentation::. + + * In documentation strings for a major mode, you will want to refer + to the key bindings of that mode's local map, rather than global + ones. Therefore, use the construct `\\<...>' once in the + documentation string to specify which key map to use. Do this + before the first use of `\\[...]'. The text inside the `\\<...>' + should be the name of the variable containing the local keymap for + the major mode. + + It is not practical to use `\\[...]' very many times, because + display of the documentation string will become slow. So use this + to describe the most important commands in your major mode, and + then use `\\{...}' to display the rest of the mode's keymap. + + +File: lispref.info, Node: Comment Tips, Next: Library Headers, Prev: Documentation Tips, Up: Tips + +Tips on Writing Comments +======================== + + We recommend these conventions for where to put comments and how to +indent them: + +`;' + Comments that start with a single semicolon, `;', should all be + aligned to the same column on the right of the source code. Such + comments usually explain how the code on the same line does its + job. In Lisp mode and related modes, the `M-;' + (`indent-for-comment') command automatically inserts such a `;' in + the right place, or aligns such a comment if it is already present. + + This and following examples are taken from the Emacs sources. + + (setq base-version-list ; there was a base + (assoc (substring fn 0 start-vn) ; version to which + file-version-assoc-list)) ; this looks like + ; a subversion + +`;;' + Comments that start with two semicolons, `;;', should be aligned to + the same level of indentation as the code. Such comments usually + describe the purpose of the following lines or the state of the + program at that point. For example: + + (prog1 (setq auto-fill-function + ... + ... + ;; update modeline + (redraw-modeline))) + + Every function that has no documentation string (because it is use + only internally within the package it belongs to), should have + instead a two-semicolon comment right before the function, + explaining what the function does and how to call it properly. + Explain precisely what each argument means and how the function + interprets its possible values. + +`;;;' + Comments that start with three semicolons, `;;;', should start at + the left margin. Such comments are used outside function + definitions to make general statements explaining the design + principles of the program. For example: + + ;;; This Lisp code is run in XEmacs + ;;; when it is to operate as a server + ;;; for other processes. + + Another use for triple-semicolon comments is for commenting out + lines within a function. We use triple-semicolons for this + precisely so that they remain at the left margin. + + (defun foo (a) + ;;; This is no longer necessary. + ;;; (force-mode-line-update) + (message "Finished with %s" a)) + +`;;;;' + Comments that start with four semicolons, `;;;;', should be aligned + to the left margin and are used for headings of major sections of a + program. For example: + + ;;;; The kill ring + +The indentation commands of the Lisp modes in XEmacs, such as `M-;' +(`indent-for-comment') and (`lisp-indent-line') automatically +indent comments according to these conventions, depending on the number +of semicolons. *Note Manipulating Comments: (emacs)Comments. + + +File: lispref.info, Node: Library Headers, Prev: Comment Tips, Up: Tips + +Conventional Headers for XEmacs Libraries +========================================= + + XEmacs has conventions for using special comments in Lisp libraries +to divide them into sections and give information such as who wrote +them. This section explains these conventions. First, an example: + + ;;; lisp-mnt.el --- minor mode for Emacs Lisp maintainers + + ;; Copyright (C) 1992 Free Software Foundation, Inc. + + ;; Author: Eric S. Raymond + ;; Maintainer: Eric S. Raymond + ;; Created: 14 Jul 1992 + ;; Version: 1.2 + ;; Keywords: docs + + ;; This file is part of XEmacs. + COPYING PERMISSIONS... + + The very first line should have this format: + + ;;; FILENAME --- DESCRIPTION + +The description should be complete in one line. + + After the copyright notice come several "header comment" lines, each +beginning with `;; HEADER-NAME:'. Here is a table of the conventional +possibilities for HEADER-NAME: + +`Author' + This line states the name and net address of at least the principal + author of the library. + + If there are multiple authors, you can list them on continuation + lines led by `;;' and a tab character, like this: + + ;; Author: Ashwin Ram + ;; Dave Sill + ;; Dave Brennan + ;; Eric Raymond + +`Maintainer' + This line should contain a single name/address as in the Author + line, or an address only, or the string `FSF'. If there is no + maintainer line, the person(s) in the Author field are presumed to + be the maintainers. The example above is mildly bogus because the + maintainer line is redundant. + + The idea behind the `Author' and `Maintainer' lines is to make + possible a Lisp function to "send mail to the maintainer" without + having to mine the name out by hand. + + Be sure to surround the network address with `<...>' if you + include the person's full name as well as the network address. + +`Created' + This optional line gives the original creation date of the file. + For historical interest only. + +`Version' + If you wish to record version numbers for the individual Lisp + program, put them in this line. + +`Adapted-By' + In this header line, place the name of the person who adapted the + library for installation (to make it fit the style conventions, for + example). + +`Keywords' + This line lists keywords for the `finder-by-keyword' help command. + This field is important; it's how people will find your package + when they're looking for things by topic area. To separate the + keywords, you can use spaces, commas, or both. + + Just about every Lisp library ought to have the `Author' and +`Keywords' header comment lines. Use the others if they are +appropriate. You can also put in header lines with other header +names--they have no standard meanings, so they can't do any harm. + + We use additional stylized comments to subdivide the contents of the +library file. Here is a table of them: + +`;;; Commentary:' + This begins introductory comments that explain how the library + works. It should come right after the copying permissions. + +`;;; Change log:' + This begins change log information stored in the library file (if + you store the change history there). For most of the Lisp files + distributed with XEmacs, the change history is kept in the file + `ChangeLog' and not in the source file at all; these files do not + have a `;;; Change log:' line. + +`;;; Code:' + This begins the actual code of the program. + +`;;; FILENAME ends here' + This is the "footer line"; it appears at the very end of the file. + Its purpose is to enable people to detect truncated versions of + the file from the lack of a footer line. + + +File: lispref.info, Node: Building XEmacs and Object Allocation, Next: Standard Errors, Prev: Tips, Up: Top + +Building XEmacs; Allocation of Objects +************************************** + + This chapter describes how the runnable XEmacs executable is dumped +with the preloaded Lisp libraries in it and how storage is allocated. + + There is an entire separate document, the `XEmacs Internals Manual', +devoted to the internals of XEmacs from the perspective of the C +programmer. It contains much more detailed information about the build +process, the allocation and garbage-collection process, and other +aspects related to the internals of XEmacs. + +* Menu: + +* Building XEmacs:: How to preload Lisp libraries into XEmacs. +* Pure Storage:: A kludge to make preloaded Lisp functions sharable. +* Garbage Collection:: Reclaiming space for Lisp objects no longer used. + diff --git a/info/lispref.info-43 b/info/lispref.info-43 new file mode 100644 index 0000000..78cbdf4 --- /dev/null +++ b/info/lispref.info-43 @@ -0,0 +1,1450 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Building XEmacs, Next: Pure Storage, Up: Building XEmacs and Object Allocation + +Building XEmacs +=============== + + This section explains the steps involved in building the XEmacs +executable. You don't have to know this material to build and install +XEmacs, since the makefiles do all these things automatically. This +information is pertinent to XEmacs maintenance. + + The `XEmacs Internals Manual' contains more information about this. + + Compilation of the C source files in the `src' directory produces an +executable file called `temacs', also called a "bare impure XEmacs". +It contains the XEmacs Lisp interpreter and I/O routines, but not the +editing commands. + + Before XEmacs is actually usable, a number of Lisp files need to be +loaded. These define all the editing commands, plus most of the startup +code and many very basic Lisp primitives. This is accomplished by +loading the file `loadup.el', which in turn loads all of the other +standardly-loaded Lisp files. + + It takes a substantial time to load the standard Lisp files. +Luckily, you don't have to do this each time you run XEmacs; `temacs' +can dump out an executable program called `xemacs' that has these files +preloaded. `xemacs' starts more quickly because it does not need to +load the files. This is the XEmacs executable that is normally +installed. + + To create `xemacs', use the command `temacs -batch -l loadup dump'. +The purpose of `-batch' here is to tell `temacs' to run in +non-interactive, command-line mode. (`temacs' can *only* run in this +fashion. Part of the code required to initialize frames and faces is +in Lisp, and must be loaded before XEmacs is able to create any frames.) +The argument `dump' tells `loadup.el' to dump a new executable named +`xemacs'. + + The dumping process is highly system-specific, and some operating +systems don't support dumping. On those systems, you must start XEmacs +with the `temacs -batch -l loadup run-temacs' command each time you use +it. This takes a substantial time, but since you need to start Emacs +once a day at most--or once a week if you never log out--the extra time +is not too severe a problem. (In older versions of Emacs, you started +Emacs from `temacs' using `temacs -l loadup'.) + + You are free to start XEmacs directly from `temacs' if you want, +even if there is already a dumped `xemacs'. Normally you wouldn't want +to do that; but the Makefiles do this when you rebuild XEmacs using +`make all-elc', which builds XEmacs and simultaneously compiles any +out-of-date Lisp files. (You need `xemacs' in order to compile Lisp +files. However, you also need the compiled Lisp files in order to dump +out `xemacs'. If both of these are missing or corrupted, you are out +of luck unless you're able to bootstrap `xemacs' from `temacs'. Note +that `make all-elc' actually loads the alternative loadup file +`loadup-el.el', which works like `loadup.el' but disables the +pure-copying process and forces XEmacs to ignore any compiled Lisp +files even if they exist.) + + You can specify additional files to preload by writing a library +named `site-load.el' that loads them. You may need to increase the +value of `PURESIZE', in `src/puresize.h', to make room for the +additional files. You should *not* modify this file directly, however; +instead, use the `--puresize' configuration option. (If you run out of +pure space while dumping `xemacs', you will be told how much pure space +you actually will need.) However, the advantage of preloading +additional files decreases as machines get faster. On modern machines, +it is often not advisable, especially if the Lisp code is on a file +system local to the machine running XEmacs. + + You can specify other Lisp expressions to execute just before dumping +by putting them in a library named `site-init.el'. However, if they +might alter the behavior that users expect from an ordinary unmodified +XEmacs, it is better to put them in `default.el', so that users can +override them if they wish. *Note Start-up Summary::. + + Before `loadup.el' dumps the new executable, it finds the +documentation strings for primitive and preloaded functions (and +variables) in the file where they are stored, by calling +`Snarf-documentation' (*note Accessing Documentation::.). These +strings were moved out of the `xemacs' executable to make it smaller. +*Note Documentation Basics::. + + - Function: dump-emacs TO-FILE FROM-FILE + This function dumps the current state of XEmacs into an executable + file TO-FILE. It takes symbols from FROM-FILE (this is normally + the executable file `temacs'). + + If you use this function in an XEmacs that was already dumped, you + must set `command-line-processed' to `nil' first for good results. + *Note Command Line Arguments::. + + - Function: run-emacs-from-temacs &rest ARGS + This is the function that implements the `run-temacs' command-line + argument. It is called from `loadup.el' as appropriate. You + should most emphatically *not* call this yourself; it will + reinitialize your XEmacs process and you'll be sorry. + + - Command: emacs-version + This function returns a string describing the version of XEmacs + that is running. It is useful to include this string in bug + reports. + + (emacs-version) + => "XEmacs 20.1 [Lucid] (i586-unknown-linux2.0.29) + of Mon Apr 7 1997 on altair.xemacs.org" + + Called interactively, the function prints the same information in + the echo area. + + - Variable: emacs-build-time + The value of this variable is the time at which XEmacs was built + at the local site. + + emacs-build-time "Mon Apr 7 20:28:52 1997" + => + + - Variable: emacs-version + The value of this variable is the version of Emacs being run. It + is a string, e.g. `"20.1 XEmacs Lucid"'. + + The following two variables did not exist before FSF GNU Emacs +version 19.23 and XEmacs version 19.10, which reduces their usefulness +at present, but we hope they will be convenient in the future. + + - Variable: emacs-major-version + The major version number of Emacs, as an integer. For XEmacs + version 20.1, the value is 20. + + - Variable: emacs-minor-version + The minor version number of Emacs, as an integer. For XEmacs + version 20.1, the value is 1. + + +File: lispref.info, Node: Pure Storage, Next: Garbage Collection, Prev: Building XEmacs, Up: Building XEmacs and Object Allocation + +Pure Storage +============ + + XEmacs Lisp uses two kinds of storage for user-created Lisp objects: +"normal storage" and "pure storage". Normal storage is where all the +new data created during an XEmacs session is kept; see the following +section for information on normal storage. Pure storage is used for +certain data in the preloaded standard Lisp files--data that should +never change during actual use of XEmacs. + + Pure storage is allocated only while `temacs' is loading the +standard preloaded Lisp libraries. In the file `xemacs', it is marked +as read-only (on operating systems that permit this), so that the +memory space can be shared by all the XEmacs jobs running on the machine +at once. Pure storage is not expandable; a fixed amount is allocated +when XEmacs is compiled, and if that is not sufficient for the preloaded +libraries, `temacs' aborts with an error message. If that happens, you +must increase the compilation parameter `PURESIZE' using the +`--puresize' option to `configure'. This normally won't happen unless +you try to preload additional libraries or add features to the standard +ones. + + - Function: purecopy OBJECT + This function makes a copy of OBJECT in pure storage and returns + it. It copies strings by simply making a new string with the same + characters in pure storage. It recursively copies the contents of + vectors and cons cells. It does not make copies of other objects + such as symbols, but just returns them unchanged. It signals an + error if asked to copy markers. + + This function is a no-op except while XEmacs is being built and + dumped; it is usually called only in the file + `xemacs/lisp/prim/loaddefs.el', but a few packages call it just in + case you decide to preload them. + + - Variable: pure-bytes-used + The value of this variable is the number of bytes of pure storage + allocated so far. Typically, in a dumped XEmacs, this number is + very close to the total amount of pure storage available--if it + were not, we would preallocate less. + + - Variable: purify-flag + This variable determines whether `defun' should make a copy of the + function definition in pure storage. If it is non-`nil', then the + function definition is copied into pure storage. + + This flag is `t' while loading all of the basic functions for + building XEmacs initially (allowing those functions to be sharable + and non-collectible). Dumping XEmacs as an executable always + writes `nil' in this variable, regardless of the value it actually + has before and after dumping. + + You should not change this flag in a running XEmacs. + + +File: lispref.info, Node: Garbage Collection, Prev: Pure Storage, Up: Building XEmacs and Object Allocation + +Garbage Collection +================== + + When a program creates a list or the user defines a new function +(such as by loading a library), that data is placed in normal storage. +If normal storage runs low, then XEmacs asks the operating system to +allocate more memory in blocks of 2k bytes. Each block is used for one +type of Lisp object, so symbols, cons cells, markers, etc., are +segregated in distinct blocks in memory. (Vectors, long strings, +buffers and certain other editing types, which are fairly large, are +allocated in individual blocks, one per object, while small strings are +packed into blocks of 8k bytes. [More correctly, a string is allocated +in two sections: a fixed size chunk containing the length, list of +extents, etc.; and a chunk containing the actual characters in the +string. It is this latter chunk that is either allocated individually +or packed into 8k blocks. The fixed size chunk is packed into 2k +blocks, as for conses, markers, etc.]) + + It is quite common to use some storage for a while, then release it +by (for example) killing a buffer or deleting the last pointer to an +object. XEmacs provides a "garbage collector" to reclaim this +abandoned storage. (This name is traditional, but "garbage recycler" +might be a more intuitive metaphor for this facility.) + + The garbage collector operates by finding and marking all Lisp +objects that are still accessible to Lisp programs. To begin with, it +assumes all the symbols, their values and associated function +definitions, and any data presently on the stack, are accessible. Any +objects that can be reached indirectly through other accessible objects +are also accessible. + + When marking is finished, all objects still unmarked are garbage. No +matter what the Lisp program or the user does, it is impossible to refer +to them, since there is no longer a way to reach them. Their space +might as well be reused, since no one will miss them. The second +("sweep") phase of the garbage collector arranges to reuse them. + + The sweep phase puts unused cons cells onto a "free list" for future +allocation; likewise for symbols, markers, extents, events, floats, +compiled-function objects, and the fixed-size portion of strings. It +compacts the accessible small string-chars chunks so they occupy fewer +8k blocks; then it frees the other 8k blocks. Vectors, buffers, +windows, and other large objects are individually allocated and freed +using `malloc' and `free'. + + Common Lisp note: unlike other Lisps, XEmacs Lisp does not call + the garbage collector when the free list is empty. Instead, it + simply requests the operating system to allocate more storage, and + processing continues until `gc-cons-threshold' bytes have been + used. + + This means that you can make sure that the garbage collector will + not run during a certain portion of a Lisp program by calling the + garbage collector explicitly just before it (provided that portion + of the program does not use so much space as to force a second + garbage collection). + + - Command: garbage-collect + This command runs a garbage collection, and returns information on + the amount of space in use. (Garbage collection can also occur + spontaneously if you use more than `gc-cons-threshold' bytes of + Lisp data since the previous garbage collection.) + + `garbage-collect' returns a list containing the following + information: + + ((USED-CONSES . FREE-CONSES) + (USED-SYMS . FREE-SYMS) + (USED-MARKERS . FREE-MARKERS) + USED-STRING-CHARS + USED-VECTOR-SLOTS + (PLIST)) + + => ((73362 . 8325) (13718 . 164) + (5089 . 5098) 949121 118677 + (conses-used 73362 conses-free 8329 cons-storage 658168 + symbols-used 13718 symbols-free 164 symbol-storage 335216 + bit-vectors-used 0 bit-vectors-total-length 0 + bit-vector-storage 0 vectors-used 7882 + vectors-total-length 118677 vector-storage 537764 + compiled-functions-used 1336 compiled-functions-free 37 + compiled-function-storage 44440 short-strings-used 28829 + long-strings-used 2 strings-free 7722 + short-strings-total-length 916657 short-string-storage 1179648 + long-strings-total-length 32464 string-header-storage 441504 + floats-used 3 floats-free 43 float-storage 2044 markers-used 5089 + markers-free 5098 marker-storage 245280 events-used 103 + events-free 835 event-storage 110656 extents-used 10519 + extents-free 2718 extent-storage 372736 + extent-auxiliarys-used 111 extent-auxiliarys-freed 3 + extent-auxiliary-storage 4440 window-configurations-used 39 + window-configurations-on-free-list 5 + window-configurations-freed 10 window-configuration-storage 9492 + popup-datas-used 3 popup-data-storage 72 toolbar-buttons-used 62 + toolbar-button-storage 4960 toolbar-datas-used 12 + toolbar-data-storage 240 symbol-value-buffer-locals-used 182 + symbol-value-buffer-local-storage 5824 + symbol-value-lisp-magics-used 22 + symbol-value-lisp-magic-storage 1496 + symbol-value-varaliases-used 43 + symbol-value-varalias-storage 1032 opaque-lists-used 2 + opaque-list-storage 48 color-instances-used 12 + color-instance-storage 288 font-instances-used 5 + font-instance-storage 180 opaques-used 11 opaque-storage 312 + range-tables-used 1 range-table-storage 16 faces-used 34 + face-storage 2584 glyphs-used 124 glyph-storage 4464 + specifiers-used 775 specifier-storage 43869 weak-lists-used 786 + weak-list-storage 18864 char-tables-used 40 + char-table-storage 41920 buffers-used 25 buffer-storage 7000 + extent-infos-used 457 extent-infos-freed 73 + extent-info-storage 9140 keymaps-used 275 keymap-storage 12100 + consoles-used 4 console-storage 384 command-builders-used 2 + command-builder-storage 120 devices-used 2 device-storage 344 + frames-used 3 frame-storage 624 image-instances-used 47 + image-instance-storage 3008 windows-used 27 windows-freed 2 + window-storage 9180 lcrecord-lists-used 15 + lcrecord-list-storage 360 hash-tables-used 631 + hash-table-storage 25240 streams-used 1 streams-on-free-list 3 + streams-freed 12 stream-storage 91)) + + Here is a table explaining each element: + + USED-CONSES + The number of cons cells in use. + + FREE-CONSES + The number of cons cells for which space has been obtained + from the operating system, but that are not currently being + used. + + USED-SYMS + The number of symbols in use. + + FREE-SYMS + The number of symbols for which space has been obtained from + the operating system, but that are not currently being used. + + USED-MARKERS + The number of markers in use. + + FREE-MARKERS + The number of markers for which space has been obtained from + the operating system, but that are not currently being used. + + USED-STRING-CHARS + The total size of all strings, in characters. + + USED-VECTOR-SLOTS + The total number of elements of existing vectors. + + PLIST + A list of alternating keyword/value pairs providing more + detailed information. (As you can see above, quite a lot of + information is provided.) + + - User Option: gc-cons-threshold + The value of this variable is the number of bytes of storage that + must be allocated for Lisp objects after one garbage collection in + order to trigger another garbage collection. A cons cell counts + as eight bytes, a string as one byte per character plus a few + bytes of overhead, and so on; space allocated to the contents of + buffers does not count. Note that the subsequent garbage + collection does not happen immediately when the threshold is + exhausted, but only the next time the Lisp evaluator is called. + + The initial threshold value is 500,000. If you specify a larger + value, garbage collection will happen less often. This reduces the + amount of time spent garbage collecting, but increases total + memory use. You may want to do this when running a program that + creates lots of Lisp data. + + You can make collections more frequent by specifying a smaller + value, down to 10,000. A value less than 10,000 will remain in + effect only until the subsequent garbage collection, at which time + `garbage-collect' will set the threshold back to 10,000. (This does + not apply if XEmacs was configured with `--debug'. Therefore, be + careful when setting `gc-cons-threshold' in that case!) + + - Function: memory-limit + This function returns the address of the last byte XEmacs has + allocated, divided by 1024. We divide the value by 1024 to make + sure it fits in a Lisp integer. + + You can use this to get a general idea of how your actions affect + the memory usage. + + - Variable: pre-gc-hook + This is a normal hook to be run just before each garbage + collection. Interrupts, garbage collection, and errors are + inhibited while this hook runs, so be extremely careful in what + you add here. In particular, avoid consing, and do not interact + with the user. + + - Variable: post-gc-hook + This is a normal hook to be run just after each garbage collection. + Interrupts, garbage collection, and errors are inhibited while + this hook runs, so be extremely careful in what you add here. In + particular, avoid consing, and do not interact with the user. + + - Variable: gc-message + This is a string to print to indicate that a garbage collection is + in progress. This is printed in the echo area. If the selected + frame is on a window system and `gc-pointer-glyph' specifies a + value (i.e. a pointer image instance) in the domain of the + selected frame, the mouse cursor will change instead of this + message being printed. + + - Glyph: gc-pointer-glyph + This holds the pointer glyph used to indicate that a garbage + collection is in progress. If the selected window is on a window + system and this glyph specifies a value (i.e. a pointer image + instance) in the domain of the selected window, the cursor will be + changed as specified during garbage collection. Otherwise, a + message will be printed in the echo area, as controlled by + `gc-message'. *Note Glyphs::. + + If XEmacs was configured with `--debug', you can set the following +two variables to get direct information about all the allocation that +is happening in a segment of Lisp code. + + - Variable: debug-allocation + If non-zero, print out information to stderr about all objects + allocated. + + - Variable: debug-allocation-backtrace + Length (in stack frames) of short backtrace printed out by + `debug-allocation'. + + +File: lispref.info, Node: Standard Errors, Next: Standard Buffer-Local Variables, Prev: Building XEmacs and Object Allocation, Up: Top + +Standard Errors +*************** + + Here is the complete list of the error symbols in standard Emacs, +grouped by concept. The list includes each symbol's message (on the +`error-message' property of the symbol) and a cross reference to a +description of how the error can occur. + + Each error symbol has an `error-conditions' property that is a list +of symbols. Normally this list includes the error symbol itself and +the symbol `error'. Occasionally it includes additional symbols, which +are intermediate classifications, narrower than `error' but broader +than a single error symbol. For example, all the errors in accessing +files have the condition `file-error'. + + As a special exception, the error symbol `quit' does not have the +condition `error', because quitting is not considered an error. + + *Note Errors::, for an explanation of how errors are generated and +handled. + +`SYMBOL' + STRING; REFERENCE. + +`error' + `"error"' + *Note Errors::. + +`quit' + `"Quit"' + *Note Quitting::. + +`args-out-of-range' + `"Args out of range"' + *Note Sequences Arrays Vectors::. + +`arith-error' + `"Arithmetic error"' + See `/' and `%' in *Note Numbers::. + +`beginning-of-buffer' + `"Beginning of buffer"' + *Note Motion::. + +`buffer-read-only' + `"Buffer is read-only"' + *Note Read Only Buffers::. + +`cyclic-function-indirection' + `"Symbol's chain of function indirections contains a loop"' + *Note Function Indirection::. + +`domain-error' + `"Arithmetic domain error"' +`end-of-buffer' + `"End of buffer"' + *Note Motion::. + +`end-of-file' + `"End of file during parsing"' + This is not a `file-error'. + *Note Input Functions::. + +`file-error' + This error and its subcategories do not have error-strings, + because the error message is constructed from the data items alone + when the error condition `file-error' is present. + *Note Files::. + +`file-locked' + This is a `file-error'. + *Note File Locks::. + +`file-already-exists' + This is a `file-error'. + *Note Writing to Files::. + +`file-supersession' + This is a `file-error'. + *Note Modification Time::. + +`invalid-byte-code' + `"Invalid byte code"' + *Note Byte Compilation::. + +`invalid-function' + `"Invalid function"' + *Note Classifying Lists::. + +`invalid-read-syntax' + `"Invalid read syntax"' + *Note Input Functions::. + +`invalid-regexp' + `"Invalid regexp"' + *Note Regular Expressions::. + +`mark-inactive' + `"The mark is not active now"' +`no-catch' + `"No catch for tag"' + *Note Catch and Throw::. + +`overflow-error' + `"Arithmetic overflow error"' +`protected-field' + `"Attempt to modify a protected field"' +`range-error' + `"Arithmetic range error"' +`search-failed' + `"Search failed"' + *Note Searching and Matching::. + +`setting-constant' + `"Attempt to set a constant symbol"' + *Note Variables that Never Change: Constant Variables. + +`singularity-error' + `"Arithmetic singularity error"' +`tooltalk-error' + `"ToolTalk error"' + *Note ToolTalk Support::. + +`undefined-keystroke-sequence' + `"Undefined keystroke sequence"' +`void-function' + `"Symbol's function definition is void"' + *Note Function Cells::. + +`void-variable' + `"Symbol's value as variable is void"' + *Note Accessing Variables::. + +`wrong-number-of-arguments' + `"Wrong number of arguments"' + *Note Classifying Lists::. + +`wrong-type-argument' + `"Wrong type argument"' + *Note Type Predicates::. + + These error types, which are all classified as special cases of +`arith-error', can occur on certain systems for invalid use of +mathematical functions. + +`domain-error' + `"Arithmetic domain error"' + *Note Math Functions::. + +`overflow-error' + `"Arithmetic overflow error"' + *Note Math Functions::. + +`range-error' + `"Arithmetic range error"' + *Note Math Functions::. + +`singularity-error' + `"Arithmetic singularity error"' + *Note Math Functions::. + +`underflow-error' + `"Arithmetic underflow error"' + *Note Math Functions::. + + +File: lispref.info, Node: Standard Buffer-Local Variables, Next: Standard Keymaps, Prev: Standard Errors, Up: Top + +Buffer-Local Variables +********************** + + The table below lists the general-purpose Emacs variables that are +automatically local (when set) in each buffer. Many Lisp packages +define such variables for their internal use; we don't list them here. + +`abbrev-mode' + *note Abbrevs::. + +`auto-fill-function' + *note Auto Filling::. + +`buffer-auto-save-file-name' + *note Auto-Saving::. + +`buffer-backed-up' + *note Backup Files::. + +`buffer-display-table' + *note Display Tables::. + +`buffer-file-format' + *note Format Conversion::. + +`buffer-file-name' + *note Buffer File Name::. + +`buffer-file-number' + *note Buffer File Name::. + +`buffer-file-truename' + *note Buffer File Name::. + +`buffer-file-type' + *note Files and MS-DOS::. + +`buffer-invisibility-spec' + *note Invisible Text::. + +`buffer-offer-save' + *note Saving Buffers::. + +`buffer-read-only' + *note Read Only Buffers::. + +`buffer-saved-size' + *note Point::. + +`buffer-undo-list' + *note Undo::. + +`cache-long-line-scans' + *note Text Lines::. + +`case-fold-search' + *note Searching and Case::. + +`ctl-arrow' + *note Usual Display::. + +`comment-column' + *note Comments: (emacs)Comments. + +`default-directory' + *note System Environment::. + +`defun-prompt-regexp' + *note List Motion::. + +`fill-column' + *note Auto Filling::. + +`goal-column' + *note Moving Point: (emacs)Moving Point. + +`left-margin' + *note Indentation::. + +`local-abbrev-table' + *note Abbrevs::. + +`local-write-file-hooks' + *note Saving Buffers::. + +`major-mode' + *note Mode Help::. + +`mark-active' + *note The Mark::. + +`mark-ring' + *note The Mark::. + +`minor-modes' + *note Minor Modes::. + +`modeline-format' + *note Modeline Data::. + +`modeline-buffer-identification' + *note Modeline Variables::. + +`modeline-format' + *note Modeline Data::. + +`modeline-modified' + *note Modeline Variables::. + +`modeline-process' + *note Modeline Variables::. + +`mode-name' + *note Modeline Variables::. + +`overwrite-mode' + *note Insertion::. + +`paragraph-separate' + *note Standard Regexps::. + +`paragraph-start' + *note Standard Regexps::. + +`point-before-scroll' + Used for communication between mouse commands and scroll-bar + commands. + +`require-final-newline' + *note Insertion::. + +`selective-display' + *note Selective Display::. + +`selective-display-ellipses' + *note Selective Display::. + +`tab-width' + *note Usual Display::. + +`truncate-lines' + *note Truncation::. + +`vc-mode' + *note Modeline Variables::. + + +File: lispref.info, Node: Standard Keymaps, Next: Standard Hooks, Prev: Standard Buffer-Local Variables, Up: Top + +Standard Keymaps +**************** + + The following symbols are used as the names for various keymaps. +Some of these exist when XEmacs is first started, others are loaded +only when their respective mode is used. This is not an exhaustive +list. + + Almost all of these maps are used as local maps. Indeed, of the +modes that presently exist, only Vip mode and Terminal mode ever change +the global keymap. + +`bookmark-map' + A keymap containing bindings to bookmark functions. + +`Buffer-menu-mode-map' + A keymap used by Buffer Menu mode. + +`c++-mode-map' + A keymap used by C++ mode. + +`c-mode-map' + A keymap used by C mode. A sparse keymap used by C mode. + +`command-history-map' + A keymap used by Command History mode. + +`ctl-x-4-map' + A keymap for subcommands of the prefix `C-x 4'. + +`ctl-x-5-map' + A keymap for subcommands of the prefix `C-x 5'. + +`ctl-x-map' + A keymap for `C-x' commands. + +`debugger-mode-map' + A keymap used by Debugger mode. + +`dired-mode-map' + A keymap for `dired-mode' buffers. + +`edit-abbrevs-map' + A keymap used in `edit-abbrevs'. + +`edit-tab-stops-map' + A keymap used in `edit-tab-stops'. + +`electric-buffer-menu-mode-map' + A keymap used by Electric Buffer Menu mode. + +`electric-history-map' + A keymap used by Electric Command History mode. + +`emacs-lisp-mode-map' + A keymap used by Emacs Lisp mode. + +`help-map' + A keymap for characters following the Help key. + +`Helper-help-map' + A keymap used by the help utility package. + It has the same keymap in its value cell and in its function cell. + +`Info-edit-map' + A keymap used by the `e' command of Info. + +`Info-mode-map' + A keymap containing Info commands. + +`isearch-mode-map' + A keymap that defines the characters you can type within + incremental search. + +`itimer-edit-map' + A keymap used when in Itimer Edit mode. + +`lisp-interaction-mode-map' + A keymap used by Lisp mode. + +`lisp-mode-map' + A keymap used by Lisp mode. + + A keymap for minibuffer input with completion. + +`minibuffer-local-isearch-map' + A keymap for editing isearch strings in the minibuffer. + +`minibuffer-local-map' + Default keymap to use when reading from the minibuffer. + +`minibuffer-local-must-match-map' + A keymap for minibuffer input with completion, for exact match. + +`mode-specific-map' + The keymap for characters following `C-c'. Note, this is in the + global map. This map is not actually mode specific: its name was + chosen to be informative for the user in `C-h b' + (`display-bindings'), where it describes the main use of the `C-c' + prefix key. + +`modeline-map' + The keymap consulted for mouse-clicks on the modeline of a window. + +`objc-mode-map' + A keymap used in Objective C mode as a local map. + +`occur-mode-map' + A local keymap used by Occur mode. + +`overriding-local-map' + A keymap that overrides all other local keymaps. + +`query-replace-map' + A local keymap used for responses in `query-replace' and related + commands; also for `y-or-n-p' and `map-y-or-n-p'. The functions + that use this map do not support prefix keys; they look up one + event at a time. + +`read-expression-map' + The minibuffer keymap used for reading Lisp expressions. + +`read-shell-command-map' + The minibuffer keymap used by shell-command and related commands. + +`shared-lisp-mode-map' + A keymap for commands shared by all sorts of Lisp modes. + +`text-mode-map' + A keymap used by Text mode. + +`toolbar-map' + The keymap consulted for mouse-clicks over a toolbar. + +`view-mode-map' + A keymap used by View mode. + + +File: lispref.info, Node: Standard Hooks, Next: Index, Prev: Standard Keymaps, Up: Top + +Standard Hooks +************** + + The following is a list of hook variables that let you provide +functions to be called from within Emacs on suitable occasions. + + Most of these variables have names ending with `-hook'. They are +"normal hooks", run by means of `run-hooks'. The value of such a hook +is a list of functions. The recommended way to put a new function on +such a hook is to call `add-hook'. *Note Hooks::, for more information +about using hooks. + + The variables whose names end in `-function' have single functions +as their values. Usually there is a specific reason why the variable is +not a normal hook, such as the need to pass arguments to the function. +(In older Emacs versions, some of these variables had names ending in +`-hook' even though they were not normal hooks.) + + The variables whose names end in `-hooks' or `-functions' have lists +of functions as their values, but these functions are called in a +special way (they are passed arguments, or else their values are used). + +`activate-menubar-hook' + +`activate-popup-menu-hook' + +`ad-definition-hooks' + +`adaptive-fill-function' + +`add-log-current-defun-function' + +`after-change-functions' + +`after-delete-annotation-hook' + +`after-init-hook' + +`after-insert-file-functions' + +`after-revert-hook' + +`after-save-hook' + +`after-set-visited-file-name-hooks' + +`after-write-file-hooks' + +`auto-fill-function' + +`auto-save-hook' + +`before-change-functions' + +`before-delete-annotation-hook' + +`before-init-hook' + +`before-revert-hook' + +`blink-paren-function' + +`buffers-menu-switch-to-buffer-function' + +`c++-mode-hook' + +`c-delete-function' + +`c-mode-common-hook' + +`c-mode-hook' + +`c-special-indent-hook' + +`calendar-load-hook' + +`change-major-mode-hook' + +`command-history-hook' + +`comment-indent-function' + +`compilation-buffer-name-function' + +`compilation-exit-message-function' + +`compilation-finish-function' + +`compilation-parse-errors-function' + +`compilation-mode-hook' + +`create-console-hook' + +`create-device-hook' + +`create-frame-hook' + +`dabbrev-friend-buffer-function' + +`dabbrev-select-buffers-function' + +`delete-console-hook' + +`delete-device-hook' + +`delete-frame-hook' + +`deselect-frame-hook' + +`diary-display-hook' + +`diary-hook' + +`dired-after-readin-hook' + +`dired-before-readin-hook' + +`dired-load-hook' + +`dired-mode-hook' + +`disabled-command-hook' + +`display-buffer-function' + +`ediff-after-setup-control-frame-hook' + +`ediff-after-setup-windows-hook' + +`ediff-before-setup-control-frame-hook' + +`ediff-before-setup-windows-hook' + +`ediff-brief-help-message-function' + +`ediff-cleanup-hook' + +`ediff-control-frame-position-function' + +`ediff-display-help-hook' + +`ediff-focus-on-regexp-matches-function' + +`ediff-forward-word-function' + +`ediff-hide-regexp-matches-function' + +`ediff-keymap-setup-hook' + +`ediff-load-hook' + +`ediff-long-help-message-function' + +`ediff-make-wide-display-function' + +`ediff-merge-split-window-function' + +`ediff-meta-action-function' + +`ediff-meta-redraw-function' + +`ediff-mode-hook' + +`ediff-prepare-buffer-hook' + +`ediff-quit-hook' + +`ediff-registry-setup-hook' + +`ediff-select-hook' + +`ediff-session-action-function' + +`ediff-session-group-setup-hook' + +`ediff-setup-diff-regions-function' + +`ediff-show-registry-hook' + +`ediff-show-session-group-hook' + +`ediff-skip-diff-region-function' + +`ediff-split-window-function' + +`ediff-startup-hook' + +`ediff-suspend-hook' + +`ediff-toggle-read-only-function' + +`ediff-unselect-hook' + +`ediff-window-setup-function' + +`edit-picture-hook' + +`electric-buffer-menu-mode-hook' + +`electric-command-history-hook' + +`electric-help-mode-hook' + +`emacs-lisp-mode-hook' + +`fill-paragraph-function' + +`find-file-hooks' + +`find-file-not-found-hooks' + +`first-change-hook' + +`font-lock-after-fontify-buffer-hook' + +`font-lock-beginning-of-syntax-function' + +`font-lock-mode-hook' + +`fume-found-function-hook' + +`fume-list-mode-hook' + +`fume-rescan-buffer-hook' + +`fume-sort-function' + +`gnus-startup-hook' + +`hack-local-variables-hook' + +`highlight-headers-follow-url-function' + +`hyper-apropos-mode-hook' + +`indent-line-function' + +`indent-mim-hook' + +`indent-region-function' + +`initial-calendar-window-hook' + +`isearch-mode-end-hook' + +`isearch-mode-hook' + +`java-mode-hook' + +`kill-buffer-hook' + +`kill-buffer-query-functions' + +`kill-emacs-hook' + +`kill-emacs-query-functions' + +`kill-hooks' + +`LaTeX-mode-hook' + +`latex-mode-hook' + +`ledit-mode-hook' + +`lisp-indent-function' + +`lisp-interaction-mode-hook' + +`lisp-mode-hook' + +`list-diary-entries-hook' + +`load-read-function' + +`log-message-filter-function' + +`m2-mode-hook' + +`mail-citation-hook' + +`mail-mode-hook' + +`mail-setup-hook' + +`make-annotation-hook' + +`makefile-mode-hook' + +`map-frame-hook' + +`mark-diary-entries-hook' + +`medit-mode-hook' + +`menu-no-selection-hook' + +`mh-compose-letter-hook' + +`mh-folder-mode-hook' + +`mh-letter-mode-hook' + +`mim-mode-hook' + +`minibuffer-exit-hook' + +`minibuffer-setup-hook' + +`mode-motion-hook' + +`mouse-enter-frame-hook' + +`mouse-leave-frame-hook' + +`mouse-track-cleanup-hook' + +`mouse-track-click-hook' + +`mouse-track-down-hook' + +`mouse-track-drag-hook' + +`mouse-track-drag-up-hook' + +`mouse-track-up-hook' + +`mouse-yank-function' + +`news-mode-hook' + +`news-reply-mode-hook' + +`news-setup-hook' + +`nongregorian-diary-listing-hook' + +`nongregorian-diary-marking-hook' + +`nroff-mode-hook' + +`objc-mode-hook' + +`outline-mode-hook' + +`perl-mode-hook' + +`plain-TeX-mode-hook' + +`post-command-hook' + +`post-gc-hook' + +`pre-abbrev-expand-hook' + +`pre-command-hook' + +`pre-display-buffer-function' + +`pre-gc-hook' + +`pre-idle-hook' + +`print-diary-entries-hook' + +`prolog-mode-hook' + +`protect-innocence-hook' + +`remove-message-hook' + +`revert-buffer-function' + +`revert-buffer-insert-contents-function' + +`rmail-edit-mode-hook' + +`rmail-mode-hook' + +`rmail-retry-setup-hook' + +`rmail-summary-mode-hook' + +`scheme-indent-hook' + +`scheme-mode-hook' + +`scribe-mode-hook' + +`select-frame-hook' + +`send-mail-function' + +`shell-mode-hook' + +`shell-set-directory-error-hook' + +`special-display-function' + +`suspend-hook' + +`suspend-resume-hook' + +`temp-buffer-show-function' + +`term-setup-hook' + +`terminal-mode-hook' + +`terminal-mode-break-hook' + +`TeX-mode-hook' + +`tex-mode-hook' + +`text-mode-hook' + +`today-visible-calendar-hook' + +`today-invisible-calendar-hook' + +`tooltalk-message-handler-hook' + +`tooltalk-pattern-handler-hook' + +`tooltalk-unprocessed-message-hook' + +`unmap-frame-hook' + +`vc-checkin-hook' + +`vc-checkout-writable-buffer-hook' + +`vc-log-after-operation-hook' + +`vc-make-buffer-writable-hook' + +`view-hook' + +`vm-arrived-message-hook' + +`vm-arrived-messages-hook' + +`vm-chop-full-name-function' + +`vm-display-buffer-hook' + +`vm-edit-message-hook' + +`vm-forward-message-hook' + +`vm-iconify-frame-hook' + +`vm-inhibit-write-file-hook' + +`vm-key-functions' + +`vm-mail-hook' + +`vm-mail-mode-hook' + +`vm-menu-setup-hook' + +`vm-mode-hook' + +`vm-quit-hook' + +`vm-rename-current-buffer-function' + +`vm-reply-hook' + +`vm-resend-bounced-message-hook' + +`vm-resend-message-hook' + +`vm-retrieved-spooled-mail-hook' + +`vm-select-message-hook' + +`vm-select-new-message-hook' + +`vm-select-unread-message-hook' + +`vm-send-digest-hook' + +`vm-summary-mode-hook' + +`vm-summary-pointer-update-hook' + +`vm-summary-redo-hook' + +`vm-summary-update-hook' + +`vm-undisplay-buffer-hook' + +`vm-visit-folder-hook' + +`window-setup-hook' + +`write-contents-hooks' + +`write-file-data-hooks' + +`write-file-hooks' + +`write-region-annotate-functions' + +`x-lost-selection-hooks' + +`x-sent-selection-hooks' + +`zmacs-activate-region-hook' + +`zmacs-deactivate-region-hook' + +`zmacs-update-region-hook' diff --git a/info/lispref.info-44 b/info/lispref.info-44 new file mode 100644 index 0000000..1c75f09 --- /dev/null +++ b/info/lispref.info-44 @@ -0,0 +1,3343 @@ +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Index, Prev: Standard Hooks, Up: Top + +Index +***** + +* Menu: + +* " in printing: Output Functions. +* " in strings: String Type. +* #$: Docs and Compilation. +* #@COUNT: Docs and Compilation. +* $ in display: Truncation. +* $ in regexp: Syntax of Regexps. +* %: Arithmetic Operations. +* % in format: Formatting Strings. +* & in replacement: Replacing Match. +* &define (Edebug): Specification List. +* ¬ (Edebug): Specification List. +* &optional: Argument List. +* &optional (Edebug): Specification List. +* &or (Edebug): Specification List. +* &rest: Argument List. +* &rest (Edebug): Specification List. +* ' for quoting: Quoting. +* ( in regexp: Syntax of Regexps. +* (...) in lists: Cons Cell Type. +* ) in regexp: Syntax of Regexps. +* *: Arithmetic Operations. +* * in interactive: Using Interactive. +* * in regexp: Syntax of Regexps. +* *? in regexp: Syntax of Regexps. +* *scratch*: Auto Major Mode. +* +: Arithmetic Operations. +* + in regexp: Syntax of Regexps. +* +? in regexp: Syntax of Regexps. +* , (with Backquote): Backquote. +* ,@ (with Backquote): Backquote. +* -: Arithmetic Operations. +* . in lists: Dotted Pair Notation. +* . in regexp: Syntax of Regexps. +* .emacs: Init File. +* .emacs customization: Major Mode Conventions. +* /: Arithmetic Operations. +* /=: Comparison of Numbers. +* 1+: Arithmetic Operations. +* 1-: Arithmetic Operations. +* ; in comment: Comments. +* <: Comparison of Numbers. +* <=: Comparison of Numbers. +* : Functions for Key Lookup. +* in minibuffer: Text from Minibuffer. +* in minibuffer: Text from Minibuffer. +* =: Comparison of Numbers. +* >: Comparison of Numbers. +* >=: Comparison of Numbers. +* ? in character constant: Character Type. +* ? in minibuffer: Text from Minibuffer. +* ? in regexp: Syntax of Regexps. +* @ in interactive: Using Interactive. +* [ in regexp: Syntax of Regexps. +* [...] (Edebug): Specification List. +* \ in character constant: Character Type. +* \ in display: Truncation. +* \ in printing: Output Functions. +* \ in regexp: Syntax of Regexps. +* \ in replacement: Replacing Match. +* \ in strings: String Type. +* \ in symbols: Symbol Type. +* \' in regexp: Syntax of Regexps. +* \(?: in regexp: Syntax of Regexps. +* \< in regexp: Syntax of Regexps. +* \= in regexp: Syntax of Regexps. +* \> in regexp: Syntax of Regexps. +* \` in regexp: Syntax of Regexps. +* \a: Character Type. +* \b: Character Type. +* \B in regexp: Syntax of Regexps. +* \b in regexp: Syntax of Regexps. +* \e: Character Type. +* \f: Character Type. +* \n: Character Type. +* \n in print: Output Variables. +* \N in replacement: Replacing Match. +* \r: Character Type. +* \S in regexp: Syntax of Regexps. +* \s in regexp: Syntax of Regexps. +* \t: Character Type. +* \v: Character Type. +* \W in regexp: Syntax of Regexps. +* \w in regexp: Syntax of Regexps. +* \{n,m\} in regexp: Syntax of Regexps. +* ] in regexp: Syntax of Regexps. +* ^ in regexp: Syntax of Regexps. +* _ in interactive: Using Interactive. +* `: Backquote. +* ` (Edebug): Debugging Backquote. +* ` (list substitution): Backquote. +* abbrev: Abbrevs. +* abbrev table: Abbrevs. +* abbrev tables in modes: Major Mode Conventions. +* abbrev-all-caps: Abbrev Expansion. +* abbrev-expansion: Abbrev Expansion. +* abbrev-file-name: Abbrev Files. +* abbrev-mode: Abbrev Mode. +* abbrev-prefix-mark: Abbrev Expansion. +* abbrev-start-location: Abbrev Expansion. +* abbrev-start-location-buffer: Abbrev Expansion. +* abbrev-symbol: Abbrev Expansion. +* abbrev-table-name-list: Abbrev Tables. +* abbreviate-file-name: Directory Names. +* abbrevs-changed: Abbrev Files. +* abort-recursive-edit: Recursive Editing. +* aborting: Recursive Editing. +* abs: Arithmetic Operations. +* absolute file name: Relative File Names. +* accelerate-menu: Menu Accelerator Functions. +* accept-process-output: Accepting Output. +* accessibility of a file: Testing Accessibility. +* accessible portion (of a buffer): Narrowing. +* accessible-keymaps: Scanning Keymaps. +* acos: Math Functions. +* acosh: Math Functions. +* activate-menubar-hook: Menubar. +* activate-popup-menu-hook: Pop-Up Menus. +* active display table: Active Display Table. +* active keymap: Active Keymaps. +* active-minibuffer-window: Minibuffer Misc. +* add-abbrev: Defining Abbrevs. +* add-hook: Hooks. +* add-menu: Modifying Menus. +* add-menu-button: Modifying Menus. +* add-menu-item: Modifying Menus. +* add-name-to-file: Changing File Attributes. +* add-spec-list-to-specifier: Adding Specifications. +* add-spec-to-specifier: Adding Specifications. +* add-submenu: Modifying Menus. +* add-text-properties: Changing Properties. +* add-timeout: Timers. +* add-to-list: Setting Variables. +* add-tooltalk-message-arg: Elisp Interface for Sending Messages. +* add-tooltalk-pattern-arg: Elisp Interface for Receiving Messages. +* add-tooltalk-pattern-attribute: Elisp Interface for Receiving Messages. +* address field of register: Cons Cell Type. +* after-change-function: Change Hooks. +* after-change-functions: Change Hooks. +* after-find-file: Subroutines of Visiting. +* after-init-hook: Init File. +* after-insert-file-functions: Saving Properties. +* after-load-alist: Hooks for Loading. +* after-revert-hook: Reverting. +* after-save-hook: Saving Buffers. +* aliases, for variables: Variable Aliases. +* alist: Association Lists. +* alist-to-plist: Converting Plists To/From Alists. +* all-annotations: Locating Annotations. +* all-completions: Basic Completion. +* and: Combining Conditions. +* annotation: Annotations. +* annotation hooks: Annotation Hooks. +* annotation-action: Annotation Properties. +* annotation-data: Annotation Properties. +* annotation-down-glyph: Annotation Properties. +* annotation-face: Annotation Properties. +* annotation-glyph: Annotation Properties. +* annotation-layout: Annotation Properties. +* annotation-list: Locating Annotations. +* annotation-menu: Annotation Properties. +* annotation-side: Annotation Properties. +* annotation-visible: Annotation Properties. +* annotation-width: Annotation Properties. +* annotationp: Annotation Primitives. +* annotations-at: Locating Annotations. +* annotations-in-region: Locating Annotations. +* anonymous function: Anonymous Functions. +* anonymous lambda expressions (Edebug): Instrumenting. +* apostrophe for quoting: Quoting. +* append: Building Lists. +* append-to-file: Writing to Files. +* apply: Calling Functions. +* apply, and debugging: Internals of Debugger. +* apropos: Help Functions. +* aref: Array Functions. +* argument binding: Argument List. +* argument descriptors: Using Interactive. +* argument evaluation form: Using Interactive. +* argument prompt: Using Interactive. +* arguments, reading: Minibuffers. +* arith-error example: Handling Errors. +* arith-error in division: Arithmetic Operations. +* arithmetic shift: Bitwise Operations. +* array: Arrays. +* array elements: Array Functions. +* arrayp: Array Functions. +* ASCII character codes: Character Type. +* aset: Array Functions. +* ash: Bitwise Operations. +* asin: Math Functions. +* asinh: Math Functions. +* ask-user-about-lock: File Locks. +* ask-user-about-supersession-threat: Modification Time. +* asking the user questions: Yes-or-No Queries. +* assoc: Association Lists. +* association list: Association Lists. +* assq: Association Lists. +* asynchronous subprocess: Asynchronous Processes. +* atan: Math Functions. +* atanh: Math Functions. +* atom <1>: Cons Cell Type. +* atom: List-related Predicates. +* atomic extent: Atomic Extents. +* atoms: List-related Predicates. +* attributes of text: Text Properties. +* Auto Fill mode: Auto Filling. +* auto-fill-function: Auto Filling. +* auto-lower-frame: Raising and Lowering. +* auto-mode-alist: Auto Major Mode. +* auto-raise-frame: Raising and Lowering. +* auto-save-default: Auto-Saving. +* auto-save-file-format: Format Conversion. +* auto-save-file-name-p: Auto-Saving. +* auto-save-hook: Auto-Saving. +* auto-save-interval: Auto-Saving. +* auto-save-list-file-name: Auto-Saving. +* auto-save-mode: Auto-Saving. +* auto-save-timeout: Auto-Saving. +* auto-save-visited-file-name: Auto-Saving. +* auto-saving: Auto-Saving. +* autoload <1>: Domain Specification. +* autoload: Autoload. +* autoload errors: Autoload. +* automatically buffer-local: Intro to Buffer-Local. +* available fonts: Font Instance Names. +* back-to-indentation: Motion by Indent. +* background pixmap: Merging Faces. +* backquote (Edebug): Debugging Backquote. +* backquote (list substitution): Backquote. +* backslash in character constant: Character Type. +* backslash in strings: String Type. +* backslash in symbols: Symbol Type. +* backspace: Character Type. +* backtrace: Internals of Debugger. +* backtrace-debug: Internals of Debugger. +* backtrace-frame: Internals of Debugger. +* backtracking: Backtracking. +* backup file: Backup Files. +* backup files, how to make them: Rename or Copy. +* backup-buffer: Making Backups. +* backup-by-copying: Rename or Copy. +* backup-by-copying-when-linked: Rename or Copy. +* backup-by-copying-when-mismatch: Rename or Copy. +* backup-enable-predicate: Making Backups. +* backup-file-name-p: Backup Names. +* backup-inhibited: Making Backups. +* backward-char: Character Motion. +* backward-delete-char-untabify: Deletion. +* backward-list: List Motion. +* backward-prefix-chars: Motion and Syntax. +* backward-sexp: List Motion. +* backward-to-indentation: Motion by Indent. +* backward-word: Word Motion. +* balancing parentheses: Blinking. +* barf-if-buffer-read-only: Read Only Buffers. +* base buffer: Indirect Buffers. +* base64: Transformations. +* base64-decode-region: Transformations. +* base64-decode-string: Transformations. +* base64-encode-region: Transformations. +* base64-encode-string: Transformations. +* batch mode: Batch Mode. +* batch-byte-compile: Compilation Functions. +* batch-byte-recompile-directory: Compilation Functions. +* beep: Beeping. +* beeping: Beeping. +* before point, insertion: Insertion. +* before-change-function: Change Hooks. +* before-change-functions: Change Hooks. +* before-init-hook: Init File. +* before-revert-hook: Reverting. +* beginning of line: Text Lines. +* beginning of line in regexp: Syntax of Regexps. +* beginning-of-buffer: Buffer End Motion. +* beginning-of-defun: List Motion. +* beginning-of-line: Text Lines. +* bell: Beeping. +* bell character: Character Type. +* bell-volume: Beeping. +* binary files and text files: Files and MS-DOS. +* binary-process-input: MS-DOS Subprocesses. +* binary-process-output: MS-DOS Subprocesses. +* bind-text-domain: Level 3 Primitives. +* binding arguments: Argument List. +* binding local variables: Local Variables. +* binding of a key: Keymap Terminology. +* bit vector: Bit Vectors. +* bit vector length: Sequence Functions. +* bit-vector: Bit Vector Functions. +* bit-vector-p: Bit Vector Functions. +* bitp: Bit Vector Functions. +* bitwise and: Bitwise Operations. +* bitwise exclusive or: Bitwise Operations. +* bitwise not: Bitwise Operations. +* bitwise or: Bitwise Operations. +* blink-matching-open: Blinking. +* blink-matching-paren: Blinking. +* blink-matching-paren-delay: Blinking. +* blink-matching-paren-distance: Blinking. +* blink-paren-function: Blinking. +* blink-paren-hook: Blinking. +* blinking: Blinking. +* bobp: Near Point. +* body of function: Lambda Components. +* bold: Font Instance Characteristics. +* bolp: Near Point. +* bookmark-map: Standard Keymaps. +* boolean: nil and t. +* boolean-specifier-p: Specifier Types. +* bootstrapping XEmacs from temacs: Building XEmacs. +* bottom-toolbar: Specifying the Toolbar. +* bottom-toolbar-height: Other Toolbar Variables. +* bottom-toolbar-visible-p: Other Toolbar Variables. +* boundp: Void Variables. +* box diagrams, for lists: Cons Cell Type. +* box representation for lists: Lists as Boxes. +* break: Debugger. +* breakpoints: Breakpoints. +* bucket (in obarray): Creating Symbols. +* buffer: Buffers. +* buffer contents: Text. +* buffer file name: Buffer File Name. +* buffer input stream: Input Streams. +* buffer list: The Buffer List. +* buffer modification: Buffer Modification. +* buffer names: Buffer Names. +* buffer output stream: Output Streams. +* buffer text notation: Buffer Text Notation. +* buffer, read-only: Read Only Buffers. +* buffer-auto-save-file-name: Auto-Saving. +* buffer-backed-up: Making Backups. +* buffer-base-buffer: Indirect Buffers. +* buffer-disable-undo: Maintaining Undo. +* buffer-enable-undo: Maintaining Undo. +* buffer-end: Point. +* buffer-file-format: Format Conversion. +* buffer-file-name: Buffer File Name. +* buffer-file-number: Buffer File Name. +* buffer-file-truename: Buffer File Name. +* buffer-file-type: Files and MS-DOS. +* buffer-flush-undo: Maintaining Undo. +* buffer-glyph-p: Glyph Types. +* buffer-indirect-children: Indirect Buffers. +* buffer-invisibility-spec: Invisible Text. +* buffer-list: The Buffer List. +* buffer-live-p: Killing Buffers. +* buffer-local variables: Buffer-Local Variables. +* buffer-local variables in modes: Major Mode Conventions. +* buffer-local-variables: Creating Buffer-Local. +* Buffer-menu-mode-map: Standard Keymaps. +* buffer-modified-p: Buffer Modification. +* buffer-modified-tick: Buffer Modification. +* buffer-name: Buffer Names. +* buffer-offer-save <1>: Killing Buffers. +* buffer-offer-save: Saving Buffers. +* buffer-read-only: Read Only Buffers. +* buffer-saved-size <1>: Auto-Saving. +* buffer-saved-size: Point. +* buffer-size: Point. +* buffer-string: Buffer Contents. +* buffer-substring: Buffer Contents. +* buffer-undo-list: Undo. +* bufferp: Buffer Basics. +* buffers menu: Buffers Menu. +* buffers, controlled in windows: Buffers and Windows. +* buffers, creating: Creating Buffers. +* buffers, killing: Killing Buffers. +* buffers-menu-filter: Menu Filters. +* buffers-menu-max-size: Buffers Menu. +* buffers-menu-switch-to-buffer-function: Buffers Menu. +* building lists: Building Lists. +* building XEmacs: Building XEmacs. +* built-in function: What Is a Function. +* bury-buffer: The Buffer List. +* busy-pointer-glyph: Mouse Pointer. +* button-event-p: Event Predicates. +* button-press-event-p: Event Predicates. +* button-release-event-p: Event Predicates. +* bvconcat: Bit Vector Functions. +* byte-code <1>: Compilation Functions. +* byte-code: Byte Compilation. +* byte-code function: Compiled-Function Objects. +* byte-code interpreter: Compilation Functions. +* byte-compile: Compilation Functions. +* byte-compile-dynamic: Dynamic Loading. +* byte-compile-dynamic-docstrings: Docs and Compilation. +* byte-compile-file: Compilation Functions. +* byte-compiling macros: Compiling Macros. +* byte-compiling require: Named Features. +* byte-recompile-directory: Compilation Functions. +* byte-recompile-directory-ignore-errors-p: Compilation Functions. +* bytes: Strings and Characters. +* c++-mode-map: Standard Keymaps. +* C-c: Prefix Keys. +* C-g: Quitting. +* C-h: Prefix Keys. +* C-M-x: Instrumenting. +* c-mode-abbrev-table: Standard Abbrev Tables. +* c-mode-map: Standard Keymaps. +* c-mode-syntax-table: Standard Syntax Tables. +* C-q: Flow Control. +* C-s: Flow Control. +* C-x: Prefix Keys. +* C-x 4: Prefix Keys. +* C-x 5: Prefix Keys. +* C-x a: Prefix Keys. +* C-x n: Prefix Keys. +* C-x r: Prefix Keys. +* caaaar: List Elements. +* caaadr: List Elements. +* caaar: List Elements. +* caadar: List Elements. +* caaddr: List Elements. +* caadr: List Elements. +* caar: List Elements. +* cadaar: List Elements. +* cadadr: List Elements. +* cadar: List Elements. +* caddar: List Elements. +* cadddr: List Elements. +* caddr: List Elements. +* cadr: List Elements. +* call stack: Internals of Debugger. +* call-interactively: Interactive Call. +* call-process: Synchronous Processes. +* call-process-region: Synchronous Processes. +* calling a function: Calling Functions. +* cancel-debug-on-entry: Function Debugging. +* canonicalize-inst-list: Adding Specifications. +* canonicalize-inst-pair: Adding Specifications. +* canonicalize-lax-plist: Working With Lax Plists. +* canonicalize-plist: Working With Normal Plists. +* canonicalize-spec: Adding Specifications. +* canonicalize-spec-list: Adding Specifications. +* canonicalize-tag-set: Specifier Tag Functions. +* capitalization: Character Case. +* capitalize: Character Case. +* capitalize-region: Case Changes. +* capitalize-word: Case Changes. +* car: List Elements. +* car-safe: List Elements. +* case changes: Case Changes. +* case in replacements: Replacing Match. +* case-fold-search: Searching and Case. +* case-replace: Searching and Case. +* case-table-p: Case Tables. +* catch: Catch and Throw. +* category-designator-p: Category Tables. +* category-table: Category Tables. +* category-table-p: Category Tables. +* category-table-value-p: Category Tables. +* CBREAK: Flow Control. +* ccl-elapsed-time: Calling CCL. +* ccl-execute: Calling CCL. +* ccl-execute-on-string: Calling CCL. +* ccl-reset-elapsed-time: Calling CCL. +* cdaaar: List Elements. +* cdaadr: List Elements. +* cdaar: List Elements. +* cdadar: List Elements. +* cdaddr: List Elements. +* cdadr: List Elements. +* cdar: List Elements. +* cddaar: List Elements. +* cddadr: List Elements. +* cddar: List Elements. +* cdddar: List Elements. +* cddddr: List Elements. +* cdddr: List Elements. +* cddr: List Elements. +* CDE dt: CDE dt. +* cdr: List Elements. +* cdr-safe: List Elements. +* ceiling: Numeric Conversions. +* centering point: Vertical Scrolling. +* change hooks: Change Hooks. +* change-major-mode-hook: Major Mode Conventions. +* changing key bindings: Changing Key Bindings. +* changing to another buffer: Current Buffer. +* changing window size: Resizing Windows. +* char table type: Char Table Type. +* char-after: Near Point. +* char-charset: MULE Characters. +* char-equal: Text Comparison. +* char-int: Character Codes. +* char-int confoundance disease: Character Type. +* char-int-p: Character Codes. +* char-octet: MULE Characters. +* char-or-char-int-p: Character Codes. +* char-or-string-p: Predicates for Strings. +* char-syntax: Syntax Table Functions. +* char-table-p: Char Tables. +* char-table-type: Char Table Types. +* char-table-type-list: Char Table Types. +* char-to-string: String Conversion. +* char=: Text Comparison. +* character arrays: Strings and Characters. +* character case: Character Case. +* character descriptor: Character Descriptors. +* character insertion: Commands for Insertion. +* character printing: Describing Characters. +* character quote: Syntax Class Table. +* character set (in regexp): Syntax of Regexps. +* character to string: String Conversion. +* character-to-event: Converting Events. +* characteristics of font instances: Font Instance Characteristics. +* characterp: Predicates for Characters. +* characters: Strings and Characters. +* characters for interactive codes: Interactive Codes. +* charset type: Charset Type. +* charset-ccl-program: Charset Property Functions. +* charset-chars: Charset Property Functions. +* charset-columns: Charset Property Functions. +* charset-dimension: Charset Property Functions. +* charset-direction: Charset Property Functions. +* charset-doc-string: Charset Property Functions. +* charset-final: Charset Property Functions. +* charset-from-attributes: Basic Charset Functions. +* charset-graphic: Charset Property Functions. +* charset-list: Basic Charset Functions. +* charset-name: Charset Property Functions. +* charset-property: Charset Property Functions. +* charset-registry: Charset Property Functions. +* charset-reverse-direction-charset: Basic Charset Functions. +* charsetp: Charsets. +* check-toolbar-button-syntax: Toolbar Descriptor Format. +* check-valid-char-table-value: Working With Char Tables. +* check-valid-inst-list: Specifier Validation Functions. +* check-valid-instantiator: Specifier Validation Functions. +* check-valid-plist: Property Lists. +* check-valid-spec-list: Specifier Validation Functions. +* child process: Processes. +* children, of extent: Extent Parents. +* CL note---allocate more storage: Garbage Collection. +* CL note---case of letters: Symbol Type. +* CL note---default optional arg: Argument List. +* CL note---integers vrs eq: Comparison of Numbers. +* CL note---lack union, set: Sets And Lists. +* CL note---no continuable errors: Signaling Errors. +* CL note---only throw in Emacs: Catch and Throw. +* CL note---rplaca vrs setcar: Modifying Lists. +* CL note---set local: Setting Variables. +* CL note---special forms compared: Special Forms. +* CL note---special variables: Variable Scoping. +* CL note---symbol in obarrays: Creating Symbols. +* cl-read: Reading in Edebug. +* cl-specs.el: Instrumenting. +* cl.el (Edebug): Instrumenting. +* cleanup forms: Cleanups. +* clear-abbrev-table: Abbrev Tables. +* clear-message: The Echo Area. +* clear-range-table: Working With Range Tables. +* clear-visited-file-modtime: Modification Time. +* close parenthesis: Blinking. +* close parenthesis character: Syntax Class Table. +* close-database: Connecting to a Database. +* closures not available: Extent. +* clrhash: Working With Hash Tables. +* codes, interactive, description of: Interactive Codes. +* coding standards: Tips. +* coding system type: Coding System Type. +* coding-category-list: Detection of Textual Encoding. +* coding-category-system: Detection of Textual Encoding. +* coding-priority-list: Detection of Textual Encoding. +* coding-system-doc-string: Coding System Property Functions. +* coding-system-list: Basic Coding System Functions. +* coding-system-name: Basic Coding System Functions. +* coding-system-p: Coding Systems. +* coding-system-property: Coding System Property Functions. +* coding-system-type: Coding System Property Functions. +* color instance type: Color Instance Type. +* color instances: Color Instances. +* color-instance-name: Color Instance Properties. +* color-instance-p: Color Instances. +* color-instance-rgb-components: Color Instance Properties. +* color-name: Color Convenience Functions. +* color-pixmap-image-instance-p: Image Instance Types. +* color-rgb-components: Color Convenience Functions. +* color-specifier-p <1>: Color Specifiers. +* color-specifier-p: Specifier Types. +* colorize-image-instance: Image Instance Functions. +* colors: Colors. +* columns: Columns. +* command: What Is a Function. +* command descriptions: A Sample Function Description. +* command history: Command History. +* command in keymap: Key Lookup. +* command line arguments: Command Line Arguments. +* command line options: Command Line Arguments. +* command loop: Command Loop. +* command loop, recursive: Recursive Editing. +* command-debug-status: Internals of Debugger. +* command-execute: Interactive Call. +* command-history: Command History. +* command-history-map: Standard Keymaps. +* command-line: Command Line Arguments. +* command-line-args: Command Line Arguments. +* command-line-functions: Command Line Arguments. +* command-line-processed: Command Line Arguments. +* command-switch-alist: Command Line Arguments. +* commandp: Interactive Call. +* commandp example: High-Level Completion. +* commands, defining: Defining Commands. +* comment ender: Syntax Class Table. +* comment starter: Syntax Class Table. +* comment syntax: Syntax Class Table. +* comments: Comments. +* Common Lisp: Lisp History. +* Common Lisp (Edebug): Instrumenting. +* compare-buffer-substrings: Comparing Text. +* comparing buffer text: Comparing Text. +* comparison of modification time: Modification Time. +* compilation: Byte Compilation. +* compilation functions: Compilation Functions. +* compile-defun: Compilation Functions. +* compiled function: Compiled-Function Objects. +* compiled-function-arglist: Compiled-Function Objects. +* compiled-function-constants: Compiled-Function Objects. +* compiled-function-doc-string: Compiled-Function Objects. +* compiled-function-domain: Compiled-Function Objects. +* compiled-function-instructions: Compiled-Function Objects. +* compiled-function-interactive: Compiled-Function Objects. +* compiled-function-p: What Is a Function. +* compiled-function-stack-size: Compiled-Function Objects. +* complete key: Keymap Terminology. +* completing-read: Minibuffer Completion. +* completion: Completion. +* completion, file name: File Name Completion. +* completion, user name: User Name Completion. +* completion-auto-help: Completion Commands. +* completion-ignore-case: Basic Completion. +* completion-ignored-extensions: File Name Completion. +* complex arguments: Minibuffers. +* complex command: Command History. +* complex-buffers-menu-p: Buffers Menu. +* compose-region: Composite Characters. +* composite-char-string: Composite Characters. +* concat: Creating Strings. +* concatenating lists: Rearrangement. +* concatenating strings: Creating Strings. +* cond: Conditionals. +* condition name: Error Symbols. +* condition-case: Handling Errors. +* conditional evaluation: Conditionals. +* cons: Building Lists. +* cons cell as box: Lists as Boxes. +* cons cells: Building Lists. +* consing: Building Lists. +* console-device-list: Basic Console Functions. +* console-disable-input: Console and Device I/O. +* console-enable-input: Console and Device I/O. +* console-list: Basic Console Functions. +* console-live-p: Connecting to a Console or Device. +* console-type-image-conversion-list: Image Instantiator Conversion. +* consolep: Consoles and Devices. +* consoles: Consoles and Devices. +* consp: List-related Predicates. +* continuation lines: Truncation. +* continuation-glyph: Redisplay Glyphs. +* continue-process: Signals to Processes. +* control character printing: Describing Characters. +* control characters: Character Type. +* control characters in display: Usual Display. +* control characters, reading: Quoted Character Input. +* control structures: Control Structures. +* control-arrow-glyph: Redisplay Glyphs. +* Control-X-prefix: Prefix Keys. +* conventions for writing minor modes: Minor Mode Conventions. +* conversion of image instantiators: Image Instantiator Conversion. +* conversion of strings: String Conversion. +* copy-alist: Association Lists. +* copy-category-table: Category Tables. +* copy-coding-system: Basic Coding System Functions. +* copy-event: Working With Events. +* copy-extent: Detached Extents. +* copy-face: Basic Face Functions. +* copy-file: Changing File Attributes. +* copy-hash-table: Introduction to Hash Tables. +* copy-keymap: Creating Keymaps. +* copy-marker: Creating Markers. +* copy-range-table: Introduction to Range Tables. +* copy-region-as-kill: Kill Functions. +* copy-sequence: Sequence Functions. +* copy-specifier: Other Specification Functions. +* copy-syntax-table: Syntax Table Functions. +* copying alists: Association Lists. +* copying bit vectors: Bit Vector Functions. +* copying files: Changing File Attributes. +* copying lists: Building Lists. +* copying sequences: Sequence Functions. +* copying strings: Creating Strings. +* copying vectors: Vector Functions. +* cos: Math Functions. +* cosh: Math Functions. +* count-lines: Text Lines. +* count-loop: A Sample Function Description. +* counting columns: Columns. +* coverage testing: Coverage Testing. +* create-device-hook: Connecting to a Console or Device. +* create-file-buffer: Subroutines of Visiting. +* create-frame-hook: Frame Hooks. +* create-tooltalk-message: Elisp Interface for Sending Messages. +* create-tooltalk-pattern: Elisp Interface for Receiving Messages. +* creating buffers: Creating Buffers. +* creating keymaps: Creating Keymaps. +* ctl-arrow: Usual Display. +* ctl-x-4-map <1>: Prefix Keys. +* ctl-x-4-map: Standard Keymaps. +* ctl-x-5-map <1>: Prefix Keys. +* ctl-x-5-map: Standard Keymaps. +* ctl-x-map <1>: Standard Keymaps. +* ctl-x-map: Prefix Keys. +* cube-root: Math Functions. +* current binding: Local Variables. +* current buffer: Current Buffer. +* current buffer excursion: Excursions. +* current buffer mark: The Mark. +* current buffer point and mark (Edebug): Edebug Display Update. +* current buffer position: Point. +* current command: Command Loop Info. +* current stack frame: Using Debugger. +* current-buffer: Current Buffer. +* current-case-table: Case Tables. +* current-column: Columns. +* current-fill-column: Margins. +* current-frame-configuration: Frame Configurations. +* current-global-map: Active Keymaps. +* current-indentation: Primitive Indent. +* current-input-mode: Input Modes. +* current-justification: Filling. +* current-keymaps: Active Keymaps. +* current-kill: Low-Level Kill Ring. +* current-left-margin: Margins. +* current-local-map: Active Keymaps. +* current-menubar: Menubar. +* current-message: The Echo Area. +* current-minor-mode-maps: Active Keymaps. +* current-mouse-event: Command Loop Info. +* current-prefix-arg: Prefix Command Arguments. +* current-time: Time of Day. +* current-time-string: Time of Day. +* current-time-zone: Time of Day. +* current-window-configuration: Window Configurations. +* cursor (mouse): Mouse Pointer. +* cursor-in-echo-area: The Echo Area. +* cust-print: Printing in Edebug. +* cut buffer: X Selections. +* cyclic ordering of windows: Cyclic Window Ordering. +* data type: Lisp Data Types. +* data-directory: Accessing Documentation. +* database: Databases. +* database type: Database Type. +* database-file-name: Other Database Functions. +* database-last-error: Other Database Functions. +* database-live-p: Connecting to a Database. +* database-subtype: Other Database Functions. +* database-type: Other Database Functions. +* databasep: Databases. +* deallocate-event: Working With Events. +* debug: Invoking the Debugger. +* debug-allocation: Garbage Collection. +* debug-allocation-backtrace: Garbage Collection. +* debug-ignored-errors: Error Debugging. +* debug-on-entry: Function Debugging. +* debug-on-error: Error Debugging. +* debug-on-error use: Processing of Errors. +* debug-on-next-call: Internals of Debugger. +* debug-on-quit: Infinite Loops. +* debug-on-signal: Error Debugging. +* debugger <1>: Debugger. +* debugger: Internals of Debugger. +* debugger command list: Debugger Commands. +* debugger-mode-map: Standard Keymaps. +* debugging errors: Error Debugging. +* debugging specific functions: Function Debugging. +* decode-big5-char: Big5 and Shift-JIS Functions. +* decode-coding-region: Encoding and Decoding Text. +* decode-shift-jis-char: Big5 and Shift-JIS Functions. +* decode-time: Time Conversion. +* decoding file formats: Format Conversion. +* decompose-region: Composite Characters. +* decrement field of register: Cons Cell Type. +* dedicated window: Choosing Window. +* deep binding: Impl of Scope. +* def-edebug-spec: Instrumenting Macro Calls. +* defalias: Defining Functions. +* default argument string: Interactive Codes. +* default init file: Init File. +* default value: Default Value. +* default-abbrev-mode: Abbrev Mode. +* default-boundp: Default Value. +* default-buffer-file-type: Files and MS-DOS. +* default-case-fold-search: Searching and Case. +* default-ctl-arrow: Usual Display. +* default-deselect-frame-hook: Raising and Lowering. +* default-directory: File Name Expansion. +* default-file-modes: Changing File Attributes. +* default-fill-column: Margins. +* default-frame-name: Frame Name. +* default-frame-plist: Initial Properties. +* default-justification: Filling. +* default-major-mode: Auto Major Mode. +* default-menubar: Menubar. +* default-minibuffer-frame: Minibuffers and Frames. +* default-modeline-format: Modeline Variables. +* default-popup-menu: Pop-Up Menus. +* default-select-frame-hook: Raising and Lowering. +* default-text-properties: Examining Properties. +* default-toolbar: Specifying the Toolbar. +* default-toolbar-height: Other Toolbar Variables. +* default-toolbar-position: Specifying the Toolbar. +* default-toolbar-visible-p: Other Toolbar Variables. +* default-toolbar-width: Other Toolbar Variables. +* default-truncate-lines: Truncation. +* default-value: Default Value. +* default-x-device: Resources. +* default.el: Start-up Summary. +* defconst <1>: Domain Specification. +* defconst: Defining Variables. +* defcustom: Variable Definitions. +* defgroup: Group Definitions. +* define-abbrev: Defining Abbrevs. +* define-abbrev-table: Abbrev Tables. +* define-derived-mode: Derived Modes. +* define-function: Defining Functions. +* define-key: Changing Key Bindings. +* define-logical-name: Changing File Attributes. +* define-obsolete-function-alias: Obsoleteness. +* define-obsolete-variable-alias: Obsoleteness. +* define-prefix-command: Prefix Keys. +* define-specifier-tag: Specifier Tag Functions. +* defining a function: Defining Functions. +* defining commands: Defining Commands. +* defining-kbd-macro: Keyboard Macros. +* definition of a symbol: Definitions. +* defmacro: Defining Macros. +* defsubst: Inline Functions. +* defun: Defining Functions. +* defun-prompt-regexp: List Motion. +* defvar <1>: Defining Variables. +* defvar: Domain Specification. +* defvaralias: Variable Aliases. +* deiconify-frame: Visibility of Frames. +* delete: Sets And Lists. +* delete previous char: Deletion. +* delete-annotation: Annotation Primitives. +* delete-auto-save-file-if-necessary: Auto-Saving. +* delete-auto-save-files: Auto-Saving. +* delete-backward-char: Deletion. +* delete-blank-lines: User-Level Deletion. +* delete-char: Deletion. +* delete-device: Connecting to a Console or Device. +* delete-device-hook: Connecting to a Console or Device. +* delete-directory: Create/Delete Dirs. +* delete-exited-processes: Deleting Processes. +* delete-extent: Creating and Modifying Extents. +* delete-file: Changing File Attributes. +* delete-frame: Deleting Frames. +* delete-frame-hook: Frame Hooks. +* delete-horizontal-space: User-Level Deletion. +* delete-indentation: User-Level Deletion. +* delete-menu-item: Modifying Menus. +* delete-other-windows: Deleting Windows. +* delete-process: Deleting Processes. +* delete-region: Deletion. +* delete-to-left-margin: Margins. +* delete-window: Deleting Windows. +* delete-windows-on: Deleting Windows. +* deleting files: Changing File Attributes. +* deleting processes: Deleting Processes. +* deleting whitespace: User-Level Deletion. +* deleting windows: Deleting Windows. +* deletion of elements: Sets And Lists. +* deletion of frames: Deleting Frames. +* deletion vs killing: Deletion. +* delq: Sets And Lists. +* demibold: Font Instance Characteristics. +* describe-bindings: Scanning Keymaps. +* describe-bindings-internal: Scanning Keymaps. +* describe-buffer-case-table: Case Tables. +* describe-mode: Mode Help. +* describe-prefix-bindings: Help Functions. +* describe-tooltalk-message: Elisp Interface for Receiving Messages. +* description for interactive codes: Interactive Codes. +* description format: Format of Descriptions. +* deselect-frame-hook: Frame Hooks. +* destroy-tooltalk-message: Elisp Interface for Sending Messages. +* destroy-tooltalk-pattern: Elisp Interface for Receiving Messages. +* destructive-alist-to-plist: Converting Plists To/From Alists. +* destructive-plist-to-alist: Converting Plists To/From Alists. +* detach-extent: Detached Extents. +* detached extent: Detached Extents. +* detect-coding-region: Detection of Textual Encoding. +* device-baud-rate <1>: Console and Device I/O. +* device-baud-rate: Terminal Output. +* device-class: Console Types and Device Classes. +* device-frame-list <1>: Finding All Frames. +* device-frame-list: Basic Device Functions. +* device-list: Basic Device Functions. +* device-live-p: Connecting to a Console or Device. +* device-matches-specifier-tag-set-p: Specifier Tag Functions. +* device-matching-specifier-tag-list: Specifier Tag Functions. +* device-or-frame-p: Basic Device Functions. +* device-or-frame-type: Console Types and Device Classes. +* device-type: Console Types and Device Classes. +* device-x-display: Connecting to a Console or Device. +* devicep: Consoles and Devices. +* devices: Consoles and Devices. +* dgettext: Level 3 Primitives. +* diagrams, boxed, for lists: Cons Cell Type. +* dialog box: Dialog Boxes. +* digit-argument: Prefix Command Arguments. +* ding: Beeping. +* directory name: Directory Names. +* directory name abbreviation: Directory Names. +* directory part (of file name): File Name Components. +* directory-abbrev-alist: Directory Names. +* directory-file-name: Directory Names. +* directory-files: Contents of Directories. +* directory-oriented functions: Contents of Directories. +* dired-kept-versions: Numbered Backups. +* dired-mode-map: Standard Keymaps. +* disable undo: Maintaining Undo. +* disable-command: Disabling Commands. +* disable-menu-item: Modifying Menus. +* disable-timeout: Timers. +* disabled: Disabling Commands. +* disabled command: Disabling Commands. +* disabled-command-hook: Disabling Commands. +* disassemble: Disassembly. +* disassembled byte-code: Disassembly. +* discard input: Peeking and Discarding. +* discard-input: Peeking and Discarding. +* dispatch-event: Dispatching an Event. +* dispatching an event: Dispatching an Event. +* display columns: Size and Position. +* display lines: Size and Position. +* display order: Extent Endpoints. +* display table: Display Tables. +* display update: Refresh Screen. +* display-buffer: Choosing Window. +* display-buffer-function: Choosing Window. +* display-completion-list: Completion Commands. +* display-message: The Echo Area. +* display-warning: Warnings. +* display-warning-minimum-level: Warnings. +* display-warning-suppressed-classes: Warnings. +* displaying a buffer: Displaying Buffers. +* do-auto-save: Auto-Saving. +* DOC (documentation) file: Documentation Basics. +* doc-directory: Accessing Documentation. +* documentation: Accessing Documentation. +* documentation conventions: Documentation Basics. +* documentation for major mode: Mode Help. +* documentation notation: Evaluation Notation. +* documentation of function: Function Documentation. +* documentation strings: Documentation. +* documentation, keys in: Keys in Documentation. +* documentation-property: Accessing Documentation. +* domain: Level 3 Primitives. +* domain (in a specifier): Specifiers In-Depth. +* domain-of: Level 3 Primitives. +* dotted lists (Edebug): Specification List. +* dotted pair notation: Dotted Pair Notation. +* double-quote in strings: String Type. +* down-list: List Motion. +* downcase: Character Case. +* downcase-region: Case Changes. +* downcase-word: Case Changes. +* downcasing in lookup-key: Key Sequence Input. +* drag: Drag Interface. +* drag and drop: Drag and Drop. +* Drag API: Drag Interface. +* dribble file: Recording Input. +* drop: Drop Interface. +* Drop API: Drop Interface. +* dump-emacs: Building XEmacs. +* duplicable extent: Duplicable Extents. +* dynamic loading of documentation: Docs and Compilation. +* dynamic loading of functions: Dynamic Loading. +* dynamic scoping: Variable Scoping. +* echo area: The Echo Area. +* echo-keystrokes <1>: The Echo Area. +* echo-keystrokes: Command Loop Info. +* Edebug: Edebug. +* edebug: Embedded Breakpoints. +* Edebug execution modes: Edebug Execution Modes. +* Edebug mode: Edebug. +* Edebug specification list: Specification List. +* edebug-`: Debugging Backquote. +* edebug-all-defs <1>: Edebug Options. +* edebug-all-defs: Instrumenting. +* edebug-all-forms <1>: Instrumenting. +* edebug-all-forms: Edebug Options. +* edebug-continue-kbd-macro: Edebug Options. +* edebug-display-freq-count: Coverage Testing. +* edebug-eval-top-level-form: Instrumenting. +* edebug-global-break-condition <1>: Global Break Condition. +* edebug-global-break-condition: Edebug Options. +* edebug-initial-mode: Edebug Options. +* edebug-on-error <1>: Edebug Options. +* edebug-on-error: Trapping Errors. +* edebug-on-quit <1>: Edebug Options. +* edebug-on-quit: Trapping Errors. +* edebug-print-circle <1>: Printing in Edebug. +* edebug-print-circle: Edebug Options. +* edebug-print-length <1>: Printing in Edebug. +* edebug-print-length: Edebug Options. +* edebug-print-level <1>: Printing in Edebug. +* edebug-print-level: Edebug Options. +* edebug-print-trace-after <1>: Tracing. +* edebug-print-trace-after: Edebug Options. +* edebug-print-trace-before <1>: Tracing. +* edebug-print-trace-before: Edebug Options. +* edebug-save-displayed-buffer-points <1>: Edebug Options. +* edebug-save-displayed-buffer-points: Edebug Display Update. +* edebug-save-windows <1>: Edebug Options. +* edebug-save-windows: Edebug Display Update. +* edebug-set-global-break-condition: Global Break Condition. +* edebug-setup-hook: Edebug Options. +* edebug-test-coverage: Edebug Options. +* edebug-trace <1>: Edebug Options. +* edebug-trace: Tracing. +* edebug-tracing: Tracing. +* edebug-unwrap: Specification List. +* edebug-unwrap-results <1>: Debugging Backquote. +* edebug-unwrap-results: Edebug Options. +* edit-abbrevs-map: Standard Keymaps. +* edit-and-eval-command: Object from Minibuffer. +* edit-menu-filter: Menu Filters. +* edit-tab-stops-map: Standard Keymaps. +* editing types: Editing Types. +* editor command loop: Command Loop. +* eighth: List Elements. +* electric-buffer-menu-mode-map: Standard Keymaps. +* electric-future-map: A Sample Variable Description. +* electric-history-map: Standard Keymaps. +* element (of list): Lists. +* elements of sequences: Sequence Functions. +* elt: Sequence Functions. +* emacs-build-time: Building XEmacs. +* emacs-lisp-mode-map: Standard Keymaps. +* emacs-lisp-mode-syntax-table: Standard Syntax Tables. +* emacs-major-version: Building XEmacs. +* emacs-minor-version: Building XEmacs. +* emacs-pid: System Environment. +* emacs-version: Building XEmacs. +* EMACSLOADPATH environment variable: How Programs Do Loading. +* embedded breakpoints: Embedded Breakpoints. +* empty list: Cons Cell Type. +* enable-command: Disabling Commands. +* enable-flow-control: Flow Control. +* enable-flow-control-on: Flow Control. +* enable-local-eval: Auto Major Mode. +* enable-local-variables: Auto Major Mode. +* enable-menu-item: Modifying Menus. +* enable-recursive-minibuffers: Minibuffer Misc. +* encode-big5-char: Big5 and Shift-JIS Functions. +* encode-coding-region: Encoding and Decoding Text. +* encode-shift-jis-char: Big5 and Shift-JIS Functions. +* encode-time: Time Conversion. +* encoding file formats: Format Conversion. +* end of buffer marker: Creating Markers. +* end-of-buffer: Buffer End Motion. +* end-of-defun: List Motion. +* end-of-file: Input Functions. +* end-of-line: Text Lines. +* enlarge-window: Resizing Windows. +* enlarge-window-horizontally: Resizing Windows. +* enlarge-window-pixels: Resizing Windows. +* enqueue-eval-event: Reading One Event. +* environment: Intro Eval. +* environment variable access: System Environment. +* environment variables, subprocesses: Subprocess Creation. +* eobp: Near Point. +* eolp: Near Point. +* eq: Equality Predicates. +* equal: Equality Predicates. +* equality: Equality Predicates. +* erase-buffer: Deletion. +* error: Signaling Errors. +* error cleanup: Cleanups. +* error debugging: Error Debugging. +* error display: The Echo Area. +* error handler: Handling Errors. +* error in debug: Invoking the Debugger. +* error message notation: Error Messages. +* error name: Error Symbols. +* error symbol: Error Symbols. +* error-conditions: Error Symbols. +* errors: Errors. +* esc-map: Prefix Keys. +* ESC-prefix: Prefix Keys. +* escape <1>: Character Type. +* escape: Syntax Class Table. +* escape characters: Output Variables. +* escape characters in printing: Output Functions. +* escape sequence: Character Type. +* eval: Eval. +* eval, and debugging: Internals of Debugger. +* eval-and-compile: Eval During Compile. +* eval-buffer: Eval. +* eval-current-buffer (Edebug): Instrumenting. +* eval-defun (Edebug): Instrumenting. +* eval-event-p: Event Predicates. +* eval-expression (Edebug): Instrumenting. +* eval-minibuffer: Object from Minibuffer. +* eval-region: Eval. +* eval-region (Edebug): Instrumenting. +* eval-when-compile: Eval During Compile. +* evaluated expression argument: Interactive Codes. +* evaluation: Evaluation. +* evaluation error: Local Variables. +* evaluation list (Edebug): Eval List. +* evaluation notation: Evaluation Notation. +* evaluation of buffer contents: Eval. +* event printing: Describing Characters. +* event-buffer: Window-Level Event Position Info. +* event-button: Accessing Other Event Info. +* event-closest-point: Event Text Position Info. +* event-device: Accessing Other Event Info. +* event-frame: Frame-Level Event Position Info. +* event-function: Accessing Other Event Info. +* event-glyph-extent: Event Glyph Position Info. +* event-glyph-x-pixel: Event Glyph Position Info. +* event-glyph-y-pixel: Event Glyph Position Info. +* event-key: Accessing Other Event Info. +* event-live-p: Event Predicates. +* event-matches-key-specifier-p: Key Sequences. +* event-modifier-bits: Accessing Other Event Info. +* event-modifiers: Accessing Other Event Info. +* event-object: Accessing Other Event Info. +* event-over-border-p: Other Event Position Info. +* event-over-glyph-p: Event Glyph Position Info. +* event-over-modeline-p: Event Text Position Info. +* event-over-text-area-p: Event Text Position Info. +* event-over-toolbar-p: Event Toolbar Position Info. +* event-point: Event Text Position Info. +* event-process: Accessing Other Event Info. +* event-timestamp: Accessing Other Event Info. +* event-to-character: Converting Events. +* event-toolbar-button: Event Toolbar Position Info. +* event-type: Event Contents. +* event-window: Window-Level Event Position Info. +* event-window-x-pixel: Window-Level Event Position Info. +* event-window-y-pixel: Window-Level Event Position Info. +* event-x: Event Text Position Info. +* event-x-pixel: Frame-Level Event Position Info. +* event-y: Event Text Position Info. +* event-y-pixel: Frame-Level Event Position Info. +* eventp: Events. +* events: Events. +* events-to-keys: Converting Events. +* examining windows: Buffers and Windows. +* examples of using interactive: Interactive Examples. +* exchange-point-and-mark: The Mark. +* excursion: Excursions. +* exec-directory: Subprocess Creation. +* exec-path: Subprocess Creation. +* execute program: Subprocess Creation. +* execute with prefix argument: Interactive Call. +* execute-extended-command: Interactive Call. +* execute-kbd-macro: Keyboard Macros. +* executing-macro: Keyboard Macros. +* execution speed: Compilation Tips. +* exit: Recursive Editing. +* exit recursive editing: Recursive Editing. +* exit-minibuffer: Minibuffer Misc. +* exit-recursive-edit: Recursive Editing. +* exiting XEmacs: Getting Out. +* exp: Math Functions. +* expand-abbrev: Abbrev Expansion. +* expand-file-name: File Name Expansion. +* expansion of file names: File Name Expansion. +* expansion of macros: Expansion. +* expression: Intro Eval. +* expression prefix: Syntax Class Table. +* expt: Math Functions. +* extended-command-history: Minibuffer History. +* extent <1>: Variable Scoping. +* extent: Extents. +* extent children: Extent Parents. +* extent end position: Extent Endpoints. +* extent endpoint: Extent Endpoints. +* extent order: Extent Endpoints. +* extent parent: Extent Parents. +* extent priority: Intro to Extents. +* extent property: Extent Properties. +* extent replica: Duplicable Extents. +* extent start position: Extent Endpoints. +* extent, duplicable: Duplicable Extents. +* extent, unique: Duplicable Extents. +* extent-at: Finding Extents. +* extent-begin-glyph: Extent Properties. +* extent-begin-glyph-layout: Extent Properties. +* extent-children: Extent Parents. +* extent-descendants: Extent Parents. +* extent-detached-p: Detached Extents. +* extent-end-glyph: Extent Properties. +* extent-end-glyph-layout: Extent Properties. +* extent-end-position: Extent Endpoints. +* extent-face: Extent Properties. +* extent-in-region-p: Mapping Over Extents. +* extent-keymap: Extent Properties. +* extent-length: Extent Endpoints. +* extent-list: Finding Extents. +* extent-live-p: Creating and Modifying Extents. +* extent-mouse-face: Extent Properties. +* extent-object: Creating and Modifying Extents. +* extent-parent: Extent Parents. +* extent-priority: Extent Properties. +* extent-properties: Extent Properties. +* extent-property: Extent Properties. +* extent-start-position: Extent Endpoints. +* extentp: Extents. +* extents, locating: Finding Extents. +* extents, mapping: Mapping Over Extents. +* face type: Face Type. +* face-background: Face Convenience Functions. +* face-background-instance: Face Convenience Functions. +* face-background-pixmap: Face Convenience Functions. +* face-background-pixmap-instance: Face Convenience Functions. +* face-boolean-specifier-p: Specifier Types. +* face-differs-from-default-p: Other Face Display Functions. +* face-equal: Other Face Display Functions. +* face-font: Face Convenience Functions. +* face-font-instance: Face Convenience Functions. +* face-font-name: Face Convenience Functions. +* face-foreground: Face Convenience Functions. +* face-foreground-instance: Face Convenience Functions. +* face-list: Basic Face Functions. +* face-property: Face Properties. +* face-property-instance: Face Properties. +* face-underline-p: Face Convenience Functions. +* facep: Basic Face Functions. +* faces: Faces and Window-System Objects. +* fallback (in a specifier): Specifier Instancing. +* false: nil and t. +* fboundp: Function Cells. +* fceiling: Rounding Operations. +* featurep: Named Features. +* features: Named Features. +* fetch-bytecode: Dynamic Loading. +* ffloor: Rounding Operations. +* field width: Formatting Strings. +* fifth: List Elements. +* file accessibility: Testing Accessibility. +* file age: Testing Accessibility. +* file attributes: File Attributes. +* file format conversion: Format Conversion. +* file hard link: Changing File Attributes. +* file locks: File Locks. +* file mode specification error: Auto Major Mode. +* file modes and MS-DOS: Changing File Attributes. +* file modification time: Testing Accessibility. +* file name completion subroutines: File Name Completion. +* file name of buffer: Buffer File Name. +* file name of directory: Directory Names. +* file names: File Names. +* file names in directory: Contents of Directories. +* file open error: Subroutines of Visiting. +* file symbolic links: Kinds of Files. +* file types on MS-DOS: Files and MS-DOS. +* file with multiple names: Changing File Attributes. +* file-accessible-directory-p: Testing Accessibility. +* file-already-exists: Changing File Attributes. +* file-attributes: File Attributes. +* file-directory-p: Kinds of Files. +* file-error: How Programs Do Loading. +* file-executable-p: Testing Accessibility. +* file-exists-p: Testing Accessibility. +* file-local-copy: Magic File Names. +* file-locked: File Locks. +* file-locked-p: File Locks. +* file-menu-filter: Menu Filters. +* file-modes: File Attributes. +* file-name-absolute-p: Relative File Names. +* file-name-all-completions: File Name Completion. +* file-name-as-directory: Directory Names. +* file-name-buffer-file-type-alist: Files and MS-DOS. +* file-name-completion: File Name Completion. +* file-name-directory: File Name Components. +* file-name-history: Minibuffer History. +* file-name-nondirectory: File Name Components. +* file-name-sans-extension: File Name Components. +* file-name-sans-versions: File Name Components. +* file-newer-than-file-p: Testing Accessibility. +* file-newest-backup: Backup Names. +* file-nlinks: File Attributes. +* file-ownership-preserved-p: Testing Accessibility. +* file-precious-flag: Saving Buffers. +* file-readable-p: Testing Accessibility. +* file-regular-p: Kinds of Files. +* file-relative-name: File Name Expansion. +* file-supersession: Modification Time. +* file-symlink-p: Kinds of Files. +* file-truename: Truenames. +* file-writable-p: Testing Accessibility. +* fill-column: Margins. +* fill-individual-paragraphs: Filling. +* fill-individual-varying-indent: Filling. +* fill-paragraph: Filling. +* fill-paragraph-function: Filling. +* fill-prefix: Margins. +* fill-region: Filling. +* fill-region-as-paragraph: Filling. +* fillarray: Array Functions. +* filling a paragraph: Filling. +* filling, automatic: Auto Filling. +* filling, explicit: Filling. +* filter function: Filter Functions. +* find-backup-file-name: Backup Names. +* find-buffer-file-type: Files and MS-DOS. +* find-charset: Basic Charset Functions. +* find-charset-region: MULE Characters. +* find-charset-string: MULE Characters. +* find-coding-system: Basic Coding System Functions. +* find-file: Visiting Functions. +* find-file-binary: Files and MS-DOS. +* find-file-hooks: Visiting Functions. +* find-file-name-handler: Magic File Names. +* find-file-noselect: Visiting Functions. +* find-file-not-found-hooks: Visiting Functions. +* find-file-other-window: Visiting Functions. +* find-file-read-only: Visiting Functions. +* find-file-text: Files and MS-DOS. +* find-menu-item: Modifying Menus. +* finding files: Visiting Files. +* finding windows: Selecting Windows. +* first: List Elements. +* first-change-hook: Change Hooks. +* fixup-whitespace: User-Level Deletion. +* float: Numeric Conversions. +* float-output-format: Output Variables. +* floating-point numbers, printing: Output Variables. +* floatp: Predicates on Numbers. +* floor: Numeric Conversions. +* flow control characters: Flow Control. +* flush input: Peeking and Discarding. +* fmakunbound: Function Cells. +* focus-frame: Input Focus. +* following-char: Near Point. +* font instance characteristics: Font Instance Characteristics. +* font instance name: Font Instance Names. +* font instance size: Font Instance Size. +* font instance type: Font Instance Type. +* font-instance-name: Font Instance Names. +* font-instance-p: Font Instances. +* font-instance-properties: Font Instance Characteristics. +* font-instance-truename: Font Instance Names. +* font-name: Font Convenience Functions. +* font-properties: Font Convenience Functions. +* font-specifier-p <1>: Font Specifiers. +* font-specifier-p: Specifier Types. +* font-truename: Font Convenience Functions. +* fonts <1>: Fonts. +* fonts: Some Terms. +* fonts available: Font Instance Names. +* foo: A Sample Function Description. +* for: Argument Evaluation. +* force-cursor-redisplay: Refresh Screen. +* force-highlight-extent: Extents and Events. +* forcing redisplay: Waiting. +* format: Formatting Strings. +* format definition: Format Conversion. +* format of keymaps: Format of Keymaps. +* format of menus: Menu Format. +* format of the menubar: Menubar Format. +* format precision: Formatting Strings. +* format specification: Formatting Strings. +* format-alist: Format Conversion. +* format-buffers-menu-line: Buffers Menu. +* format-find-file: Format Conversion. +* format-insert-file: Format Conversion. +* format-time-string: Time Conversion. +* format-write-file: Format Conversion. +* formatting strings: Formatting Strings. +* formfeed: Character Type. +* forms: Intro Eval. +* forward-char: Character Motion. +* forward-comment: Parsing Expressions. +* forward-line: Text Lines. +* forward-list: List Motion. +* forward-sexp: List Motion. +* forward-to-indentation: Motion by Indent. +* forward-word: Word Motion. +* fourth: List Elements. +* frame: Frames. +* frame configuration: Frame Configurations. +* frame hooks: Frame Hooks. +* frame name: Frame Name. +* frame of terminal: Basic Windows. +* frame position: Size and Position. +* frame size: Size and Position. +* frame visibility: Visibility of Frames. +* frame-device: Basic Device Functions. +* frame-height: Size and Position. +* frame-icon-title-format: Frame Titles. +* frame-iconified-p: Visibility of Frames. +* frame-list: Finding All Frames. +* frame-live-p: Deleting Frames. +* frame-name: Frame Name. +* frame-pixel-height: Size and Position. +* frame-pixel-width: Size and Position. +* frame-properties: Property Access. +* frame-property: Property Access. +* frame-root-window: Frames and Windows. +* frame-selected-window: Frames and Windows. +* frame-title-format: Frame Titles. +* frame-top-window: Frames and Windows. +* frame-totally-visible-p: Visibility of Frames. +* frame-visible-p: Visibility of Frames. +* frame-width: Size and Position. +* framep: Frames. +* free list: Garbage Collection. +* frequency counts: Coverage Testing. +* fround: Rounding Operations. +* fset: Function Cells. +* ftp-login: Cleanups. +* ftruncate: Rounding Operations. +* funcall: Calling Functions. +* funcall, and debugging: Internals of Debugger. +* function <1>: What Is a Function. +* function: Anonymous Functions. +* function call: Function Forms. +* function call debugging: Function Debugging. +* function cell: Symbol Components. +* function cell in autoload: Autoload. +* function definition: Function Names. +* function descriptions: A Sample Function Description. +* function form evaluation: Function Forms. +* function input stream: Input Streams. +* function invocation: Calling Functions. +* function name: Function Names. +* function output stream: Output Streams. +* function quoting: Anonymous Functions. +* function-interactive: Using Interactive. +* function-key-map: Translating Input. +* function-obsoleteness-doc: Obsoleteness. +* functionals: Calling Functions. +* functions in modes: Major Mode Conventions. +* functions, making them interactive: Defining Commands. +* Fundamental mode: Major Modes. +* fundamental-mode: Auto Major Mode. +* fundamental-mode-abbrev-table: Standard Abbrev Tables. +* garbage collector: Garbage Collection. +* garbage-collect: Garbage Collection. +* gc-cons-threshold: Garbage Collection. +* gc-message: Garbage Collection. +* gc-pointer-glyph <1>: Mouse Pointer. +* gc-pointer-glyph: Garbage Collection. +* generate-new-buffer: Creating Buffers. +* generate-new-buffer-name: Buffer Names. +* generic-specifier-p: Specifier Types. +* get: Symbol Plists. +* get-buffer: Buffer Names. +* get-buffer-create: Creating Buffers. +* get-buffer-process: Process Buffers. +* get-buffer-window: Buffers and Windows. +* get-char-property: Examining Properties. +* get-char-table: Working With Char Tables. +* get-charset: Basic Charset Functions. +* get-coding-system: Basic Coding System Functions. +* get-database: Working With a Database. +* get-file-buffer: Buffer File Name. +* get-largest-window: Selecting Windows. +* get-lru-window: Selecting Windows. +* get-process: Process Information. +* get-range-char-table: Working With Char Tables. +* get-range-table: Working With Range Tables. +* get-register: Registers. +* get-text-property: Examining Properties. +* get-tooltalk-message-attribute: Elisp Interface for Sending Messages. +* getenv: System Environment. +* getf: Other Plists. +* gethash: Working With Hash Tables. +* gettext: Level 3 Primitives. +* global binding: Local Variables. +* global break condition: Global Break Condition. +* global keymap: Active Keymaps. +* global mark ring: The Mark. +* global variable: Global Variables. +* global-abbrev-table: Standard Abbrev Tables. +* global-key-binding: Functions for Key Lookup. +* global-map: Active Keymaps. +* global-mark-ring: The Mark. +* global-mode-string: Modeline Variables. +* global-popup-menu: Pop-Up Menus. +* global-set-key: Key Binding Commands. +* global-unset-key: Key Binding Commands. +* glyph type: Glyph Type. +* glyph-ascent: Glyph Dimensions. +* glyph-baseline: Glyph Convenience Functions. +* glyph-baseline-instance: Glyph Convenience Functions. +* glyph-contrib-p: Glyph Convenience Functions. +* glyph-contrib-p-instance: Glyph Convenience Functions. +* glyph-descent: Glyph Dimensions. +* glyph-face: Glyph Convenience Functions. +* glyph-height: Glyph Dimensions. +* glyph-image: Glyph Convenience Functions. +* glyph-image-instance: Glyph Convenience Functions. +* glyph-property: Glyph Properties. +* glyph-property-instance: Glyph Properties. +* glyph-type: Glyph Types. +* glyph-type-list: Glyph Types. +* glyph-width: Glyph Dimensions. +* glyphp: Glyphs. +* glyphs: Glyphs. +* goto-char: Character Motion. +* goto-line: Text Lines. +* hack-local-variables: Auto Major Mode. +* handling errors: Handling Errors. +* hash notation: Printed Representation. +* hash table: Hash Tables. +* hash table type: Hash Table Type. +* hash table, weak: Weak Hash Tables. +* hash-table-count: Introduction to Hash Tables. +* hash-table-p: Hash Tables. +* hash-table-rehash-size: Introduction to Hash Tables. +* hash-table-rehash-threshold: Introduction to Hash Tables. +* hash-table-size: Introduction to Hash Tables. +* hash-table-test: Introduction to Hash Tables. +* hash-table-weakness: Introduction to Hash Tables. +* hashing: Creating Symbols. +* header comments: Library Headers. +* help for major mode: Mode Help. +* help-char: Help Functions. +* help-command: Help Functions. +* help-form: Help Functions. +* help-map <1>: Help Functions. +* help-map: Standard Keymaps. +* Helper-describe-bindings: Help Functions. +* Helper-help: Help Functions. +* Helper-help-map: Standard Keymaps. +* hide-annotation: Annotation Properties. +* highlight-extent: Extents and Events. +* history list: Minibuffer History. +* history of commands: Command History. +* HOME environment variable: Subprocess Creation. +* hooks: Hooks. +* hooks for loading: Hooks for Loading. +* hooks for text changes: Change Hooks. +* horizontal position: Columns. +* horizontal scrolling: Horizontal Scrolling. +* hscroll-glyph: Redisplay Glyphs. +* icon-glyph-p: Glyph Types. +* iconified frame: Visibility of Frames. +* iconify-frame: Visibility of Frames. +* identity: Calling Functions. +* IEEE floating point: Float Basics. +* if: Conditionals. +* ignore: Calling Functions. +* ignored-local-variables: Auto Major Mode. +* image instance type: Image Instance Type. +* image instance types: Image Instance Types. +* image instances: Image Instances. +* image instantiator conversion: Image Instantiator Conversion. +* image specifiers: Image Specifiers. +* image-instance-background: Image Instance Functions. +* image-instance-depth: Image Instance Functions. +* image-instance-file-name: Image Instance Functions. +* image-instance-foreground: Image Instance Functions. +* image-instance-height: Image Instance Functions. +* image-instance-hotspot-x: Image Instance Functions. +* image-instance-hotspot-y: Image Instance Functions. +* image-instance-mask-file-name: Image Instance Functions. +* image-instance-name: Image Instance Functions. +* image-instance-p: Image Instances. +* image-instance-string: Image Instance Functions. +* image-instance-type: Image Instance Types. +* image-instance-type-list: Image Instance Types. +* image-instance-width: Image Instance Functions. +* image-instantiator-format-list: Image Specifiers. +* image-specifier-p <1>: Specifier Types. +* image-specifier-p: Image Specifiers. +* implicit progn: Sequencing. +* inc: Simple Macro. +* indent-according-to-mode: Mode-Specific Indent. +* indent-code-rigidly: Region Indent. +* indent-for-tab-command: Mode-Specific Indent. +* indent-line-function: Mode-Specific Indent. +* indent-region: Region Indent. +* indent-region-function: Region Indent. +* indent-relative: Relative Indent. +* indent-relative-maybe: Relative Indent. +* indent-rigidly: Region Indent. +* indent-tabs-mode: Primitive Indent. +* indent-to: Primitive Indent. +* indent-to-left-margin: Margins. +* indentation: Indentation. +* indenting with parentheses: Parsing Expressions. +* indirect buffers: Indirect Buffers. +* indirect specifications: Specification List. +* indirect variables: Variable Aliases. +* indirect-function: Function Indirection. +* indirect-variable: Variable Aliases. +* indirection: Function Indirection. +* infinite loops: Infinite Loops. +* infinite recursion: Local Variables. +* infinity: Float Basics. +* Info-edit-map: Standard Keymaps. +* Info-minibuffer-history: Minibuffer History. +* Info-mode-map: Standard Keymaps. +* inherit: Syntax Class Table. +* inheriting a keymap's bindings: Inheritance and Keymaps. +* inhibit-default-init: Init File. +* inhibit-file-name-handlers: Magic File Names. +* inhibit-file-name-operation: Magic File Names. +* inhibit-quit: Quitting. +* inhibit-read-only: Read Only Buffers. +* inhibit-startup-echo-area-message: Start-up Summary. +* inhibit-startup-message: Start-up Summary. +* init file: Init File. +* initial-frame-plist: Initial Properties. +* initial-major-mode: Auto Major Mode. +* initial-toolbar-spec: Other Toolbar Variables. +* initialization: Start-up Summary. +* inline functions: Inline Functions. +* innermost containing parentheses: Parsing Expressions. +* input events: Events. +* input focus: Input Focus. +* input modes: Input Modes. +* input stream: Input Streams. +* input-pending-p: Peeking and Discarding. +* insert: Insertion. +* insert-abbrev-table-description: Abbrev Tables. +* insert-before-markers: Insertion. +* insert-buffer: Commands for Insertion. +* insert-buffer-substring: Insertion. +* insert-char: Insertion. +* insert-default-directory: Reading File Names. +* insert-directory: Contents of Directories. +* insert-directory-program: Contents of Directories. +* insert-extent: Detached Extents. +* insert-file-contents: Reading from Files. +* insert-register: Registers. +* insert-string: Insertion. +* inserting killed text: Yank Commands. +* insertion before point: Insertion. +* insertion of text: Insertion. +* inside comment: Parsing Expressions. +* inside margin: Annotation Basics. +* inside string: Parsing Expressions. +* inst-list (in a specifier): Specifiers In-Depth. +* inst-pair (in a specifier): Specifiers In-Depth. +* installation-directory: System Environment. +* instance (in a specifier): Specifiers In-Depth. +* instancing (in a specifier): Specifiers In-Depth. +* instantiator (in a specifier): Specifiers In-Depth. +* int-char: Character Codes. +* int-to-string: String Conversion. +* integer to decimal: String Conversion. +* integer to hexadecimal: Formatting Strings. +* integer to octal: Formatting Strings. +* integer to string: String Conversion. +* integer-char-or-marker-p: Predicates on Markers. +* integer-or-char-p: Predicates for Characters. +* integer-or-marker-p: Predicates on Markers. +* integer-specifier-p: Specifier Types. +* integerp: Predicates on Numbers. +* integers: Numbers. +* interactive: Using Interactive. +* interactive call: Interactive Call. +* interactive code description: Interactive Codes. +* interactive commands (Edebug): Instrumenting. +* interactive completion: Interactive Codes. +* interactive function: Defining Commands. +* interactive, examples of using: Interactive Examples. +* interactive-p: Interactive Call. +* intern: Creating Symbols. +* intern-soft: Creating Symbols. +* internal-doc-file-name: Accessing Documentation. +* interning: Creating Symbols. +* interpreter: Evaluation. +* interpreter-mode-alist: Auto Major Mode. +* interprogram-cut-function: Low-Level Kill Ring. +* interprogram-paste-function: Low-Level Kill Ring. +* interrupt-process: Signals to Processes. +* invalid function: Function Indirection. +* invalid prefix key error: Changing Key Bindings. +* invalid-function: Function Indirection. +* invalid-read-syntax: Printed Representation. +* invalid-regexp: Syntax of Regexps. +* invert-face: Other Face Display Functions. +* invisible frame: Visibility of Frames. +* invisible text: Invisible Text. +* invisible-text-glyph: Redisplay Glyphs. +* invocation-directory: System Environment. +* invocation-name: System Environment. +* isearch-mode-map: Standard Keymaps. +* ISO Latin 1: Case Tables. +* ISO Latin-1 characters (input): Translating Input. +* iso-syntax: Case Tables. +* iso-transl: Translating Input. +* italic: Font Instance Characteristics. +* iteration: Iteration. +* itimer-edit-map: Standard Keymaps. +* joining lists: Rearrangement. +* just-one-space: User-Level Deletion. +* justify-current-line: Filling. +* kept-new-versions: Numbered Backups. +* kept-old-versions: Numbered Backups. +* key: Keymap Terminology. +* key binding: Keymap Terminology. +* key lookup: Key Lookup. +* key sequence: Key Sequence Input. +* key sequence error: Changing Key Bindings. +* key sequence input: Key Sequence Input. +* key sequences: Key Sequences. +* key translation function: Translating Input. +* key-binding: Functions for Key Lookup. +* key-description: Describing Characters. +* key-press-event-p: Event Predicates. +* key-translation-map: Translating Input. +* keyboard macro execution: Interactive Call. +* keyboard macro termination: Beeping. +* keyboard macros: Keyboard Macros. +* keyboard macros (Edebug): Edebug Execution Modes. +* keyboard menu accelerators: Menu Accelerators. +* keyboard-quit: Quitting. +* keymap: Keymaps. +* keymap entry: Key Lookup. +* keymap format: Format of Keymaps. +* keymap in keymap: Key Lookup. +* keymap inheritance: Inheritance and Keymaps. +* keymap parent: Inheritance and Keymaps. +* keymap-default-binding: Inheritance and Keymaps. +* keymap-fullness: Scanning Keymaps. +* keymap-name: Creating Keymaps. +* keymap-parents: Inheritance and Keymaps. +* keymap-prompt: Other Keymap Functions. +* keymapp: Format of Keymaps. +* keymaps in modes: Major Mode Conventions. +* keys in documentation strings: Keys in Documentation. +* keystroke: Keymap Terminology. +* keystroke command: What Is a Function. +* keywordp: Specification List. +* kill command repetition: Command Loop Info. +* kill ring: The Kill Ring. +* kill-all-local-variables: Creating Buffer-Local. +* kill-append: Low-Level Kill Ring. +* kill-buffer: Killing Buffers. +* kill-buffer-hook: Killing Buffers. +* kill-buffer-query-functions: Killing Buffers. +* kill-emacs: Killing XEmacs. +* kill-emacs-hook: Killing XEmacs. +* kill-emacs-query-functions: Killing XEmacs. +* kill-local-variable: Creating Buffer-Local. +* kill-new: Low-Level Kill Ring. +* kill-process: Signals to Processes. +* kill-region: Kill Functions. +* kill-ring: Internals of Kill Ring. +* kill-ring-max: Internals of Kill Ring. +* kill-ring-yank-pointer: Internals of Kill Ring. +* killing buffers: Killing Buffers. +* killing XEmacs: Killing XEmacs. +* lambda expression: Lambda Expressions. +* lambda expression in hook: Hooks. +* lambda in debug: Invoking the Debugger. +* lambda in keymap: Key Lookup. +* lambda list: Lambda Components. +* lambda-list (Edebug): Specification List. +* lambda-list-keywordp: Specification List. +* last-abbrev: Abbrev Expansion. +* last-abbrev-location: Abbrev Expansion. +* last-abbrev-text: Abbrev Expansion. +* last-command: Command Loop Info. +* last-command-char: Command Loop Info. +* last-command-event: Command Loop Info. +* last-input-char: Peeking and Discarding. +* last-input-event: Peeking and Discarding. +* last-kbd-macro: Keyboard Macros. +* Latin-1 character set (input): Translating Input. +* lax-plist-get: Working With Lax Plists. +* lax-plist-member: Working With Lax Plists. +* lax-plist-put: Working With Lax Plists. +* lax-plist-remprop: Working With Lax Plists. +* lax-plists-eq: Working With Lax Plists. +* lax-plists-equal: Working With Lax Plists. +* layout policy: Annotation Basics. +* layout types: Annotation Basics. +* lazy loading: Dynamic Loading. +* LDAP: LDAP Support. +* ldap-close: Opening and Closing a LDAP Connection. +* ldap-default-base: LDAP Variables. +* ldap-default-host: LDAP Variables. +* ldap-default-port: LDAP Variables. +* ldap-host: The LDAP Lisp Object. +* ldap-host-parameters-alist: LDAP Variables. +* ldap-live-p: The LDAP Lisp Object. +* ldap-open: Opening and Closing a LDAP Connection. +* ldap-search: The High-Level LDAP API. +* ldap-search-internal: Searching on a LDAP Server (Low-level). +* ldapp: The LDAP Lisp Object. +* left-margin: Margins. +* left-margin-width: Margin Primitives. +* left-toolbar: Specifying the Toolbar. +* left-toolbar-visible-p: Other Toolbar Variables. +* left-toolbar-width: Other Toolbar Variables. +* length: Sequence Functions. +* let: Local Variables. +* let*: Local Variables. +* let-specifier: Adding Specifications. +* lexical binding (Edebug): Edebug Eval. +* lexical comparison: Text Comparison. +* library: Loading. +* library compilation: Compilation Functions. +* library header comments: Library Headers. +* line wrapping: Truncation. +* lines: Text Lines. +* lines in region: Text Lines. +* linking files: Changing File Attributes. +* Lisp debugger: Debugger. +* Lisp expression motion: List Motion. +* Lisp history: Lisp History. +* Lisp library: Loading. +* Lisp nesting error: Eval. +* Lisp object: Lisp Data Types. +* Lisp printer: Output Functions. +* Lisp reader: Streams Intro. +* lisp-interaction-mode-map: Standard Keymaps. +* lisp-mode-abbrev-table: Standard Abbrev Tables. +* lisp-mode-map: Standard Keymaps. +* lisp-mode.el: Example Major Modes. +* list <1>: Lists. +* list: Building Lists. +* list elements: List Elements. +* list form evaluation: Classifying Lists. +* list in keymap: Key Lookup. +* list length: Sequence Functions. +* list motion: List Motion. +* list structure: Cons Cells. +* list-buffers: The Buffer List. +* list-buffers-directory: Buffer File Name. +* list-fonts: Font Instance Names. +* list-processes: Process Information. +* listp: List-related Predicates. +* lists and cons cells: Cons Cells. +* lists as sets: Sets And Lists. +* lists represented as boxes: Lists as Boxes. +* literal evaluation: Self-Evaluating Forms. +* lmessage: The Echo Area. +* ln: Changing File Attributes. +* load: How Programs Do Loading. +* load error with require: Named Features. +* load errors: How Programs Do Loading. +* load-average: System Environment. +* load-default-sounds: Beeping. +* load-history: Unloading. +* load-ignore-elc-files: How Programs Do Loading. +* load-in-progress: How Programs Do Loading. +* load-path: How Programs Do Loading. +* load-read-function: How Programs Do Loading. +* load-sound-file: Beeping. +* load-warn-when-source-newer: How Programs Do Loading. +* load-warn-when-source-only: How Programs Do Loading. +* loading: Loading. +* loading hooks: Hooks for Loading. +* loadup.el: Building XEmacs. +* local binding: Local Variables. +* local keymap: Active Keymaps. +* local variables: Local Variables. +* local-abbrev-table: Standard Abbrev Tables. +* local-key-binding: Functions for Key Lookup. +* local-set-key: Key Binding Commands. +* local-unset-key: Key Binding Commands. +* local-variable-p: Creating Buffer-Local. +* local-write-file-hooks: Saving Buffers. +* locale (in a specifier): Specifiers In-Depth. +* locate-file: How Programs Do Loading. +* locate-file-clear-hashing: How Programs Do Loading. +* lock-buffer: File Locks. +* log: Math Functions. +* log-message-ignore-labels: The Echo Area. +* log-message-ignore-regexps: The Echo Area. +* log-message-max-size: The Echo Area. +* log-warning-minimum-level: Warnings. +* log-warning-suppressed-classes: Warnings. +* log10: Math Functions. +* logand: Bitwise Operations. +* logb: Float Basics. +* logical and: Bitwise Operations. +* logical exclusive or: Bitwise Operations. +* logical inclusive or: Bitwise Operations. +* logical not: Bitwise Operations. +* logical shift: Bitwise Operations. +* logior: Bitwise Operations. +* lognot: Bitwise Operations. +* logxor: Bitwise Operations. +* looking-at: Regexp Search. +* lookup-key: Functions for Key Lookup. +* loops, infinite: Infinite Loops. +* lower case: Character Case. +* lower-frame: Raising and Lowering. +* lowering a frame: Raising and Lowering. +* lsh: Bitwise Operations. +* lwarn: Warnings. +* M-x: Interactive Call. +* Maclisp: Lisp History. +* macro: What Is a Function. +* macro argument evaluation: Argument Evaluation. +* macro call: Expansion. +* macro call evaluation: Macro Forms. +* macro compilation: Compilation Functions. +* macro descriptions: A Sample Function Description. +* macro expansion: Expansion. +* macroexpand: Expansion. +* macros: Macros. +* magic file names: Magic File Names. +* mail-host-address: System Environment. +* major mode: Major Modes. +* major mode hook: Major Mode Conventions. +* major mode keymap: Active Keymaps. +* major-mode: Mode Help. +* make-abbrev-table: Abbrev Tables. +* make-annotation: Annotation Primitives. +* make-auto-save-file-name: Auto-Saving. +* make-backup-file-name: Backup Names. +* make-backup-files: Making Backups. +* make-bit-vector: Bit Vector Functions. +* make-byte-code: Compiled-Function Objects. +* make-char: MULE Characters. +* make-char-table: Working With Char Tables. +* make-charset: Basic Charset Functions. +* make-coding-system: Basic Coding System Functions. +* make-composite-char: Composite Characters. +* make-device: Connecting to a Console or Device. +* make-directory: Create/Delete Dirs. +* make-display-table: Display Table Format. +* make-event: Working With Events. +* make-extent: Creating and Modifying Extents. +* make-face: Basic Face Functions. +* make-file-part: Creating a Partial File. +* make-font-instance: Font Instances. +* make-frame: Creating Frames. +* make-frame-invisible: Visibility of Frames. +* make-frame-visible: Visibility of Frames. +* make-glyph: Creating Glyphs. +* make-glyph-internal: Creating Glyphs. +* make-hash-table: Introduction to Hash Tables. +* make-icon-glyph: Creating Glyphs. +* make-image-instance: Image Instance Functions. +* make-image-specifier: Image Specifiers. +* make-indirect-buffer: Indirect Buffers. +* make-keymap: Creating Keymaps. +* make-list: Building Lists. +* make-local-hook: Hooks. +* make-local-variable: Creating Buffer-Local. +* make-marker: Creating Markers. +* make-obsolete: Obsoleteness. +* make-obsolete-variable: Obsoleteness. +* make-pointer-glyph: Creating Glyphs. +* make-range-table: Introduction to Range Tables. +* make-reverse-direction-charset: Basic Charset Functions. +* make-sparse-keymap: Creating Keymaps. +* make-specifier: Creating Specifiers. +* make-specifier-and-init: Creating Specifiers. +* make-string: Creating Strings. +* make-symbol: Creating Symbols. +* make-symbolic-link: Changing File Attributes. +* make-syntax-table: Syntax Table Functions. +* make-temp-name: Unique File Names. +* make-tooltalk-message: Elisp Interface for Sending Messages. +* make-tooltalk-pattern: Elisp Interface for Receiving Messages. +* make-tty-device: Connecting to a Console or Device. +* make-variable-buffer-local: Creating Buffer-Local. +* make-vector: Vector Functions. +* make-weak-list: Weak Lists. +* make-x-device: Connecting to a Console or Device. +* makunbound: Void Variables. +* Manual-page-minibuffer-history: Minibuffer History. +* map-char-table: Working With Char Tables. +* map-database: Working With a Database. +* map-extent-children: Mapping Over Extents. +* map-extents: Mapping Over Extents. +* map-frame-hook: Frame Hooks. +* map-keymap: Scanning Keymaps. +* map-range-table: Working With Range Tables. +* map-specifier: Other Specification Functions. +* map-y-or-n-p: Multiple Queries. +* mapatoms: Creating Symbols. +* mapcar: Mapping Functions. +* mapcar-extents: Mapping Over Extents. +* mapconcat: Mapping Functions. +* maphash: Working With Hash Tables. +* mapping functions: Mapping Functions. +* margin: Annotation Basics. +* margin width: Margin Primitives. +* mark: The Mark. +* mark excursion: Excursions. +* mark ring: The Mark. +* mark, the: The Mark. +* mark-marker: The Mark. +* mark-ring: The Mark. +* mark-ring-max: The Mark. +* marker argument: Interactive Codes. +* marker garbage collection: Overview of Markers. +* marker input stream: Input Streams. +* marker output stream: Output Streams. +* marker relocation: Overview of Markers. +* marker-buffer: Information from Markers. +* marker-position: Information from Markers. +* markerp: Predicates on Markers. +* markers: Markers. +* markers as numbers: Overview of Markers. +* markers vs. extents: Overview of Markers. +* match data: Match Data. +* match-beginning: Simple Match Data. +* match-data: Entire Match Data. +* match-end: Simple Match Data. +* match-string: Simple Match Data. +* mathematical functions: Math Functions. +* max: Comparison of Numbers. +* max-lisp-eval-depth: Eval. +* max-specpdl-size: Local Variables. +* md5: Transformations. +* MD5 digests: Transformations. +* member: Sets And Lists. +* membership in a list: Sets And Lists. +* memory allocation: Garbage Collection. +* memory-limit: Garbage Collection. +* memq: Sets And Lists. +* menu: Menus. +* menu accelerators: Menu Accelerators. +* menu filters: Menu Filters. +* menu format: Menu Format. +* menu-accelerator-enabled: Menu Accelerator Functions. +* menu-accelerator-map: Menu Accelerator Functions. +* menu-accelerator-modifiers: Menu Accelerator Functions. +* menu-accelerator-prefix: Menu Accelerator Functions. +* menu-no-selection-hook: Menubar. +* menubar: Menubar. +* menubar format: Menubar Format. +* menubar-configuration: Menu Format. +* menubar-pointer-glyph: Mouse Pointer. +* menubar-show-keybindings: Menubar. +* message: The Echo Area. +* meta character printing: Describing Characters. +* meta-prefix-char: Functions for Key Lookup. +* min: Comparison of Numbers. +* minibuffer: Minibuffers. +* minibuffer history: Minibuffer History. +* minibuffer input: Recursive Editing. +* minibuffer window: Cyclic Window Ordering. +* minibuffer-complete: Completion Commands. +* minibuffer-complete-and-exit: Completion Commands. +* minibuffer-complete-word: Completion Commands. +* minibuffer-completion-confirm: Completion Commands. +* minibuffer-completion-help: Completion Commands. +* minibuffer-completion-predicate: Completion Commands. +* minibuffer-completion-table: Completion Commands. +* minibuffer-depth: Minibuffer Misc. +* minibuffer-exit-hook: Minibuffer Misc. +* minibuffer-frame-plist: Initial Properties. +* minibuffer-help-form: Minibuffer Misc. +* minibuffer-history: Minibuffer History. +* minibuffer-local-completion-map <1>: Completion Commands. +* minibuffer-local-completion-map: Standard Keymaps. +* minibuffer-local-isearch-map: Standard Keymaps. +* minibuffer-local-map <1>: Standard Keymaps. +* minibuffer-local-map: Text from Minibuffer. +* minibuffer-local-must-match-map <1>: Completion Commands. +* minibuffer-local-must-match-map: Standard Keymaps. +* minibuffer-local-ns-map: Text from Minibuffer. +* minibuffer-prompt: Minibuffer Misc. +* minibuffer-prompt-width: Minibuffer Misc. +* minibuffer-scroll-window: Minibuffer Misc. +* minibuffer-setup-hook: Minibuffer Misc. +* minibuffer-window: Minibuffer Misc. +* minibuffer-window-active-p: Minibuffer Misc. +* minimum window size: Resizing Windows. +* minor mode: Minor Modes. +* minor mode conventions: Minor Mode Conventions. +* minor-mode-alist: Modeline Variables. +* minor-mode-key-binding: Functions for Key Lookup. +* minor-mode-map-alist: Active Keymaps. +* misc-user-event-p: Event Predicates. +* mod: Arithmetic Operations. +* mode: Modes. +* mode help: Mode Help. +* mode hook: Major Mode Conventions. +* mode loading: Major Mode Conventions. +* mode variable: Minor Mode Conventions. +* mode-class property: Major Mode Conventions. +* mode-name: Modeline Variables. +* mode-popup-menu: Pop-Up Menus. +* mode-specific-map <1>: Standard Keymaps. +* mode-specific-map: Prefix Keys. +* modeline: Modeline Format. +* modeline construct: Modeline Data. +* modeline-buffer-identification: Modeline Variables. +* modeline-format: Modeline Data. +* modeline-map <1>: Active Keymaps. +* modeline-map: Standard Keymaps. +* modeline-modified: Modeline Variables. +* modeline-pointer-glyph: Mouse Pointer. +* modeline-process: Modeline Variables. +* modification flag (of buffer): Buffer Modification. +* modification of lists: Rearrangement. +* modification time, comparison of: Modification Time. +* modify-syntax-entry: Syntax Table Functions. +* modulus: Arithmetic Operations. +* momentary-string-display: Temporary Displays. +* mono-pixmap-image-instance-p: Image Instance Types. +* motion-event-p: Event Predicates. +* mouse cursor: Mouse Pointer. +* mouse pointer: Mouse Pointer. +* mouse-event-p: Event Predicates. +* mouse-grabbed-buffer: Active Keymaps. +* mouse-highlight-priority: Extents and Events. +* move-marker: Changing Markers. +* move-to-column: Columns. +* move-to-left-margin: Margins. +* move-to-window-line: Screen Lines. +* MS-DOS and file modes: Changing File Attributes. +* MS-DOS file types: Files and MS-DOS. +* MSWindows OLE: MSWindows OLE. +* multilingual string formatting: Formatting Strings. +* multiple windows: Basic Windows. +* named function: Function Names. +* NaN: Float Basics. +* narrow-to-page: Narrowing. +* narrow-to-region: Narrowing. +* narrowing: Narrowing. +* natnum-specifier-p: Specifier Types. +* natnump: Predicates on Numbers. +* natural numbers: Predicates on Numbers. +* nconc: Rearrangement. +* negative infinity: Float Basics. +* negative-argument: Prefix Command Arguments. +* network connection: Network. +* new file message: Subroutines of Visiting. +* newline <1>: Character Type. +* newline: Commands for Insertion. +* newline and Auto Fill mode: Commands for Insertion. +* newline in print: Output Functions. +* newline in strings: String Type. +* newline-and-indent: Mode-Specific Indent. +* next input: Peeking and Discarding. +* next-command-event: Reading One Event. +* next-event: Reading One Event. +* next-extent: Finding Extents. +* next-frame: Finding All Frames. +* next-history-element: Minibuffer Misc. +* next-matching-history-element: Minibuffer Misc. +* next-property-change: Property Search. +* next-screen-context-lines: Vertical Scrolling. +* next-single-property-change: Property Search. +* next-window: Cyclic Window Ordering. +* nil: Constant Variables. +* nil and lists: Cons Cells. +* nil in keymap: Key Lookup. +* nil in lists: Cons Cell Type. +* nil input stream: Input Streams. +* nil output stream: Output Streams. +* nil, uses of: nil and t. +* ninth: List Elements. +* nlistp: List-related Predicates. +* no-catch: Catch and Throw. +* no-redraw-on-reenter: Refresh Screen. +* nondirectory part (of file name): File Name Components. +* noninteractive: Batch Mode. +* noninteractive use: Batch Mode. +* nonlocal exits: Nonlocal Exits. +* nonprinting characters, reading: Quoted Character Input. +* nontext-pointer-glyph: Mouse Pointer. +* normal-mode: Auto Major Mode. +* not: Combining Conditions. +* not-modified: Buffer Modification. +* nothing-image-instance-p: Image Instance Types. +* nreverse: Rearrangement. +* nth: List Elements. +* nthcdr: List Elements. +* null: List-related Predicates. +* number equality: Comparison of Numbers. +* number-char-or-marker-p: Predicates on Markers. +* number-or-marker-p: Predicates on Markers. +* number-to-string: String Conversion. +* numberp: Predicates on Numbers. +* numbers: Numbers. +* numeric prefix: Formatting Strings. +* numeric prefix argument: Prefix Command Arguments. +* numeric prefix argument usage: Interactive Codes. +* obarray: Creating Symbols. +* obarray in completion: Basic Completion. +* objc-mode-map: Standard Keymaps. +* object: Lisp Data Types. +* object to string: Output Functions. +* oblique: Font Instance Characteristics. +* obsolete buffer: Modification Time. +* occur-mode-map: Standard Keymaps. +* octal character code: Character Type. +* octal character input: Quoted Character Input. +* octal-escape-glyph: Redisplay Glyphs. +* OffiX DND: OffiX DND. +* old-eq: Equality Predicates. +* one-window-p: Splitting Windows. +* only-global-abbrevs: Defining Abbrevs. +* open parenthesis character: Syntax Class Table. +* open-database: Connecting to a Database. +* open-dribble-file: Recording Input. +* open-network-stream: Network. +* open-termscript: Terminal Output. +* operating system environment: System Environment. +* option descriptions: A Sample Variable Description. +* optional arguments: Argument List. +* options on command line: Command Line Arguments. +* or: Combining Conditions. +* order of extents: Extent Endpoints. +* ordering of windows, cyclic: Cyclic Window Ordering. +* other-buffer: The Buffer List. +* other-window: Cyclic Window Ordering. +* other-window-scroll-buffer: Vertical Scrolling. +* Outline mode: Substitution. +* output from processes: Output from Processes. +* output stream: Output Streams. +* outside margin: Annotation Basics. +* overflow: Integer Basics. +* overlay arrow: Overlay Arrow. +* overlay-arrow-position: Overlay Arrow. +* overlay-arrow-string: Overlay Arrow. +* overriding-local-map <1>: Standard Keymaps. +* overriding-local-map: Active Keymaps. +* overriding-terminal-local-map: Active Keymaps. +* overwrite-mode: Commands for Insertion. +* padding: Formatting Strings. +* page-delimiter: Standard Regexps. +* paired delimiter: Syntax Class Table. +* paragraph-separate: Standard Regexps. +* paragraph-start: Standard Regexps. +* parent of a keymap: Inheritance and Keymaps. +* parent process: Processes. +* parent, of extent: Extent Parents. +* parenthesis: Cons Cell Type. +* parenthesis depth: Parsing Expressions. +* parenthesis matching: Blinking. +* parenthesis syntax: Syntax Class Table. +* parse state: Parsing Expressions. +* parse-partial-sexp: Parsing Expressions. +* parse-sexp-ignore-comments: Parsing Expressions. +* parsing: Syntax Tables. +* partial files: Partial Files. +* PATH environment variable: Subprocess Creation. +* path-separator: System Environment. +* pausing: Waiting. +* peculiar error: Error Symbols. +* peeking at input: Peeking and Discarding. +* percent symbol in modeline: Modeline Data. +* perform-replace: Search and Replace. +* performance analysis: Coverage Testing. +* permanent local variable: Creating Buffer-Local. +* permission: File Attributes. +* pipes: Asynchronous Processes. +* play-sound: Beeping. +* play-sound-file: Beeping. +* plist: Property Lists. +* plist, symbol: Symbol Properties. +* plist-get: Working With Normal Plists. +* plist-member: Working With Normal Plists. +* plist-put: Working With Normal Plists. +* plist-remprop: Working With Normal Plists. +* plist-to-alist: Converting Plists To/From Alists. +* plists-eq <1>: Working With Normal Plists. +* plists-eq: Other Plists. +* plists-equal <1>: Working With Normal Plists. +* plists-equal: Other Plists. +* point: Point. +* point excursion: Excursions. +* point in window: Window Point. +* point with narrowing: Point. +* point-marker: Creating Markers. +* point-max: Point. +* point-max-marker: Creating Markers. +* point-min: Point. +* point-min-marker: Creating Markers. +* pointer (mouse): Mouse Pointer. +* pointer-glyph-p: Glyph Types. +* pointer-image-instance-p: Image Instance Types. +* pop-global-mark: The Mark. +* pop-mark: The Mark. +* pop-to-buffer: Displaying Buffers. +* pop-up menu: Pop-Up Menus. +* pop-up-frame-function: Choosing Window. +* pop-up-frame-plist: Choosing Window. +* pop-up-frames: Choosing Window. +* pop-up-windows: Choosing Window. +* popup-buffer-menu: Pop-Up Menus. +* popup-dialog-box: Dialog Box Functions. +* popup-menu: Pop-Up Menus. +* popup-menu-titles: Pop-Up Menus. +* popup-menu-up-p: Pop-Up Menus. +* popup-menubar-menu: Pop-Up Menus. +* popup-mode-menu: Pop-Up Menus. +* pos-visible-in-window-p: Window Start. +* position (in buffer): Positions. +* position argument: Interactive Codes. +* position in window: Window Point. +* position of frame: Size and Position. +* position of window: Position of Window. +* positive infinity: Float Basics. +* posix-looking-at: POSIX Regexps. +* posix-search-backward: POSIX Regexps. +* posix-search-forward: POSIX Regexps. +* posix-string-match: POSIX Regexps. +* post-command-hook: Command Overview. +* post-gc-hook: Garbage Collection. +* pre-abbrev-expand-hook: Abbrev Expansion. +* pre-command-hook: Command Overview. +* pre-gc-hook: Garbage Collection. +* preceding-char: Near Point. +* precision of formatted numbers: Formatting Strings. +* predicates: Type Predicates. +* prefix argument: Prefix Command Arguments. +* prefix argument unreading: Peeking and Discarding. +* prefix command: Prefix Keys. +* prefix key: Prefix Keys. +* prefix-arg: Prefix Command Arguments. +* prefix-help-command: Help Functions. +* prefix-numeric-value: Prefix Command Arguments. +* preventing backtracking: Specification List. +* preventing prefix key: Key Lookup. +* previous complete subexpression: Parsing Expressions. +* previous-extent: Finding Extents. +* previous-frame: Finding All Frames. +* previous-history-element: Minibuffer Misc. +* previous-matching-history-element: Minibuffer Misc. +* previous-property-change: Property Search. +* previous-single-property-change: Property Search. +* previous-window: Cyclic Window Ordering. +* primitive: What Is a Function. +* primitive type: Lisp Data Types. +* primitive types: Primitive Types. +* primitive-undo: Undo. +* prin1: Output Functions. +* prin1-to-string: Output Functions. +* princ: Output Functions. +* print: Output Functions. +* print example: Output Streams. +* print name cell: Symbol Components. +* print-escape-newlines: Output Variables. +* print-gensym: Output Variables. +* print-help-return-message: Help Functions. +* print-length: Output Variables. +* print-level: Output Variables. +* print-readably <1>: Output Variables. +* print-readably: Printing in Edebug. +* print-string-length: Output Variables. +* printed representation: Printed Representation. +* printed representation for characters: Character Type. +* printing: Streams Intro. +* printing (Edebug): Printing in Edebug. +* printing circular structures: Printing in Edebug. +* printing floating-point numbers: Output Variables. +* printing limits: Output Variables. +* printing notation: Printing Notation. +* printing readably: Output Variables. +* printing uninterned symbols: Output Variables. +* priority of an extent: Intro to Extents. +* process: Processes. +* process filter: Filter Functions. +* process input: Input to Processes. +* process output: Output from Processes. +* process sentinel: Sentinels. +* process signals: Signals to Processes. +* process window size: Process Window Size. +* process-buffer: Process Buffers. +* process-command: Process Information. +* process-connection-type: Asynchronous Processes. +* process-environment: System Environment. +* process-event-p: Event Predicates. +* process-exit-status: Process Information. +* process-filter: Filter Functions. +* process-id: Process Information. +* process-kill-without-query: Deleting Processes. +* process-kill-without-query-p: Process Information. +* process-list: Process Information. +* process-mark: Process Buffers. +* process-name: Process Information. +* process-send-eof: Input to Processes. +* process-send-region: Input to Processes. +* process-send-string: Input to Processes. +* process-sentinel: Sentinels. +* process-status: Process Information. +* process-tty-name: Process Information. +* processp: Processes. +* profile.el: Compilation Tips. +* profiling: Compilation Tips. +* prog1: Sequencing. +* prog2: Sequencing. +* progn: Sequencing. +* program arguments: Subprocess Creation. +* program directories: Subprocess Creation. +* programmed completion: Programmed Completion. +* programming types: Programming Types. +* properties of strings: String Properties. +* properties of text: Text Properties. +* property list: Property Lists. +* property list cell (symbol): Symbol Components. +* property list, symbol: Symbol Properties. +* property lists vs association lists: Plists and Alists. +* property of an extent: Extent Properties. +* protected forms: Cleanups. +* provide: Named Features. +* providing features: Named Features. +* PTYs: Asynchronous Processes. +* punctuation character: Syntax Class Table. +* pure storage: Pure Storage. +* pure-bytes-used: Pure Storage. +* purecopy: Pure Storage. +* purify-flag: Pure Storage. +* push-mark: The Mark. +* put: Symbol Plists. +* put-char-table: Working With Char Tables. +* put-database: Working With a Database. +* put-range-table: Working With Range Tables. +* put-text-property: Changing Properties. +* putf: Other Plists. +* puthash: Working With Hash Tables. +* query-replace-history: Minibuffer History. +* query-replace-map <1>: Search and Replace. +* query-replace-map: Standard Keymaps. +* querying the user: Yes-or-No Queries. +* question mark in character constant: Character Type. +* quietly-read-abbrev-file: Abbrev Files. +* quit-flag: Quitting. +* quit-process: Signals to Processes. +* quitting: Quitting. +* quitting from infinite loop: Infinite Loops. +* quote: Quoting. +* quote character: Parsing Expressions. +* quoted character input: Quoted Character Input. +* quoted-insert suppression: Changing Key Bindings. +* quoting: Quoting. +* quoting characters in printing: Output Functions. +* quoting using apostrophe: Quoting. +* raise-frame: Raising and Lowering. +* raising a frame: Raising and Lowering. +* random: Random Numbers. +* random numbers: Random Numbers. +* range table type: Range Table Type. +* Range Tables: Range Tables. +* range-table-p: Range Tables. +* rassoc: Association Lists. +* rassq: Association Lists. +* raw prefix argument: Prefix Command Arguments. +* raw prefix argument usage: Interactive Codes. +* re-search-backward: Regexp Search. +* re-search-forward: Regexp Search. +* read: Input Functions. +* read command name: Interactive Call. +* read syntax: Printed Representation. +* read syntax for characters: Character Type. +* read-buffer: High-Level Completion. +* read-char: Reading One Event. +* read-command: High-Level Completion. +* read-expression-history: Minibuffer History. +* read-expression-map: Standard Keymaps. +* read-file-name: Reading File Names. +* read-from-minibuffer: Text from Minibuffer. +* read-from-string: Input Functions. +* read-key-sequence: Key Sequence Input. +* read-minibuffer: Object from Minibuffer. +* read-no-blanks-input: Text from Minibuffer. +* read-only buffer: Read Only Buffers. +* read-only buffers in interactive: Using Interactive. +* read-quoted-char: Quoted Character Input. +* read-quoted-char quitting: Quitting. +* read-shell-command-map: Standard Keymaps. +* read-string: Text from Minibuffer. +* read-variable: High-Level Completion. +* reading: Streams Intro. +* reading (Edebug): Reading in Edebug. +* reading interactive arguments: Interactive Codes. +* reading symbols: Creating Symbols. +* rearrangement of lists: Rearrangement. +* rebinding: Changing Key Bindings. +* receiving ToolTalk messages: Receiving Messages. +* recent-auto-save-p: Auto-Saving. +* recent-keys: Recording Input. +* recent-keys-ring-size: Recording Input. +* recenter: Vertical Scrolling. +* record command history: Interactive Call. +* recursion: Iteration. +* recursion-depth: Recursive Editing. +* recursive command loop: Recursive Editing. +* recursive editing level: Recursive Editing. +* recursive evaluation: Intro Eval. +* recursive-edit: Recursive Editing. +* redo: Undo. +* redraw-display: Refresh Screen. +* redraw-frame: Refresh Screen. +* redraw-modeline: Modeline Format. +* refresh display: Refresh Screen. +* regexp: Regular Expressions. +* regexp alternative: Syntax of Regexps. +* regexp grouping: Syntax of Regexps. +* regexp searching: Regexp Search. +* regexp-history: Minibuffer History. +* regexp-quote: Syntax of Regexps. +* regexps used standardly in editing: Standard Regexps. +* region argument: Interactive Codes. +* region, the: The Region. +* region-active-p: The Region. +* region-beginning: The Region. +* region-end: The Region. +* region-exists-p: The Region. +* register-alist: Registers. +* register-ccl-program: Calling CCL. +* register-tooltalk-pattern: Elisp Interface for Receiving Messages. +* registers: Registers. +* regular expression: Regular Expressions. +* regular expression searching: Regexp Search. +* reindent-then-newline-and-indent: Mode-Specific Indent. +* relabel-menu-item: Modifying Menus. +* relative file name: Relative File Names. +* remainder: Arithmetic Operations. +* remassoc: Association Lists. +* remassq: Association Lists. +* remhash: Working With Hash Tables. +* remove-database: Working With a Database. +* remove-glyph-property: Glyph Properties. +* remove-hook: Hooks. +* remove-range-table: Working With Range Tables. +* remove-specifier: Other Specification Functions. +* remove-text-properties: Changing Properties. +* remrassoc: Association Lists. +* remrassq: Association Lists. +* rename-auto-save-file: Auto-Saving. +* rename-buffer: Buffer Names. +* rename-file: Changing File Attributes. +* renaming files: Changing File Attributes. +* repeated loading: Repeated Loading. +* replace bindings: Changing Key Bindings. +* replace characters: Substitution. +* replace-buffer-in-windows: Displaying Buffers. +* replace-match: Replacing Match. +* replacement: Search and Replace. +* repositioning format arguments: Formatting Strings. +* require: Named Features. +* require-final-newline: Saving Buffers. +* requiring features: Named Features. +* reset-char-table: Working With Char Tables. +* resize redisplay: Size and Position. +* rest arguments: Argument List. +* restriction (in a buffer): Narrowing. +* resume (cf. no-redraw-on-reenter): Refresh Screen. +* return: Character Type. +* return-tooltalk-message: Elisp Interface for Sending Messages. +* reveal-annotation: Annotation Properties. +* reverse: Building Lists. +* reversing a list: Rearrangement. +* revert-buffer: Reverting. +* revert-buffer-function: Reverting. +* revert-buffer-insert-file-contents-function: Reverting. +* right-margin-width: Margin Primitives. +* right-toolbar: Specifying the Toolbar. +* right-toolbar-visible-p: Other Toolbar Variables. +* right-toolbar-width: Other Toolbar Variables. +* rm: Changing File Attributes. +* round: Numeric Conversions. +* rounding in conversions: Numeric Conversions. +* rounding without conversion: Rounding Operations. +* rplaca: Modifying Lists. +* rplacd: Modifying Lists. +* run time stack: Internals of Debugger. +* run-emacs-from-temacs: Building XEmacs. +* run-hooks: Hooks. +* runnable temacs: Building XEmacs. +* same-window-buffer-names: Choosing Window. +* same-window-regexps: Choosing Window. +* save-abbrevs: Abbrev Files. +* save-buffer: Saving Buffers. +* save-current-buffer: Excursions. +* save-excursion: Excursions. +* save-excursion (Edebug): Edebug Display Update. +* save-match-data: Saving Match Data. +* save-restriction: Narrowing. +* save-selected-frame: Input Focus. +* save-selected-window <1>: Excursions. +* save-selected-window: Selecting Windows. +* save-some-buffers: Saving Buffers. +* save-window-excursion: Window Configurations. +* saving text properties: Saving Properties. +* saving window information: Window Configurations. +* scan-lists: Parsing Expressions. +* scan-sexps: Parsing Expressions. +* scope: Variable Scoping. +* screen layout: Window Configuration Type. +* scroll-conservatively: Vertical Scrolling. +* scroll-down: Vertical Scrolling. +* scroll-left: Horizontal Scrolling. +* scroll-other-window: Vertical Scrolling. +* scroll-right: Horizontal Scrolling. +* scroll-step: Vertical Scrolling. +* scroll-up: Vertical Scrolling. +* scrollbar-pointer-glyph: Mouse Pointer. +* scrollbars: Scrollbars. +* scrolling vertically: Vertical Scrolling. +* search-backward: String Search. +* search-failed: String Search. +* search-forward: String Search. +* searching: Searching and Matching. +* searching and case: Searching and Case. +* searching for regexp: Regexp Search. +* second: List Elements. +* select-console: The Selected Console and Device. +* select-device: The Selected Console and Device. +* select-frame: Input Focus. +* select-frame-hook: Frame Hooks. +* select-window: Selecting Windows. +* selected frame: Input Focus. +* selected window: Basic Windows. +* selected-console: The Selected Console and Device. +* selected-device: The Selected Console and Device. +* selected-frame: Input Focus. +* selected-window: Selecting Windows. +* selecting a buffer: Current Buffer. +* selecting windows: Selecting Windows. +* selection (for X windows): X Selections. +* selection-pointer-glyph: Mouse Pointer. +* selective display: Selective Display. +* selective-display: Selective Display. +* selective-display-ellipses: Selective Display. +* self-evaluating form: Self-Evaluating Forms. +* self-insert-and-exit: Minibuffer Misc. +* self-insert-command: Commands for Insertion. +* self-insert-command override: Changing Key Bindings. +* self-insert-command, minor modes: Keymaps and Minor Modes. +* self-insertion: Commands for Insertion. +* send-string-to-terminal: Terminal Output. +* send-tooltalk-message: Elisp Interface for Sending Messages. +* sending signals: Signals to Processes. +* sending ToolTalk messages: Sending Messages. +* sentence-end: Standard Regexps. +* sentinel: Sentinels. +* sequence: Sequences Arrays Vectors. +* sequence length: Sequence Functions. +* sequencep: Sequence Functions. +* set: Setting Variables. +* set-annotation-action: Annotation Properties. +* set-annotation-data: Annotation Properties. +* set-annotation-down-glyph: Annotation Properties. +* set-annotation-face: Annotation Properties. +* set-annotation-glyph: Annotation Properties. +* set-annotation-layout: Annotation Properties. +* set-annotation-menu: Annotation Properties. +* set-auto-mode: Auto Major Mode. +* set-buffer: Current Buffer. +* set-buffer-auto-saved: Auto-Saving. +* set-buffer-major-mode: Auto Major Mode. +* set-buffer-menubar: Menubar. +* set-buffer-modified-p: Buffer Modification. +* set-case-syntax: Case Tables. +* set-case-syntax-delims: Case Tables. +* set-case-syntax-pair: Case Tables. +* set-case-table: Case Tables. +* set-category-table: Category Tables. +* set-charset-ccl-program: Charset Property Functions. +* set-coding-category-system: Detection of Textual Encoding. +* set-coding-priority-list: Detection of Textual Encoding. +* set-console-type-image-conversion-list: Image Instantiator Conversion. +* set-default: Default Value. +* set-default-file-modes: Changing File Attributes. +* set-default-toolbar-position: Specifying the Toolbar. +* set-device-baud-rate <1>: Terminal Output. +* set-device-baud-rate: Console and Device I/O. +* set-extent-begin-glyph: Extent Properties. +* set-extent-begin-glyph-layout: Extent Properties. +* set-extent-end-glyph: Extent Properties. +* set-extent-end-glyph-layout: Extent Properties. +* set-extent-endpoints: Extent Endpoints. +* set-extent-face: Extent Properties. +* set-extent-initial-redisplay-function: Extent Properties. +* set-extent-keymap: Extent Properties. +* set-extent-mouse-face: Extent Properties. +* set-extent-parent: Extent Parents. +* set-extent-priority: Extent Properties. +* set-extent-properties: Extent Properties. +* set-extent-property: Extent Properties. +* set-face-background: Face Convenience Functions. +* set-face-background-pixmap: Face Convenience Functions. +* set-face-font: Face Convenience Functions. +* set-face-foreground: Face Convenience Functions. +* set-face-property: Face Properties. +* set-face-underline-p: Face Convenience Functions. +* set-file-modes: Changing File Attributes. +* set-frame-configuration: Frame Configurations. +* set-frame-pointer: Mouse Pointer. +* set-frame-position: Size and Position. +* set-frame-properties: Property Access. +* set-frame-property: Property Access. +* set-frame-size: Size and Position. +* set-glyph-baseline: Glyph Convenience Functions. +* set-glyph-contrib-p: Glyph Convenience Functions. +* set-glyph-face: Glyph Convenience Functions. +* set-glyph-image: Glyph Convenience Functions. +* set-glyph-property: Glyph Properties. +* set-input-mode: Input Modes. +* set-keymap-default-binding: Inheritance and Keymaps. +* set-keymap-name: Creating Keymaps. +* set-keymap-parents: Inheritance and Keymaps. +* set-keymap-prompt: Other Keymap Functions. +* set-left-margin: Margins. +* set-mark: The Mark. +* set-marker: Changing Markers. +* set-match-data: Entire Match Data. +* set-menubar: Menubar. +* set-menubar-dirty-flag: Menubar. +* set-process-buffer: Process Buffers. +* set-process-filter: Filter Functions. +* set-process-sentinel: Sentinels. +* set-process-window-size: Process Window Size. +* set-recent-keys-ring-size: Recording Input. +* set-register: Registers. +* set-right-margin: Margins. +* set-specifier: Adding Specifications. +* set-standard-case-table: Case Tables. +* set-syntax-table: Syntax Table Functions. +* set-text-properties: Changing Properties. +* set-tooltalk-message-attribute: Elisp Interface for Sending Messages. +* set-visited-file-modtime: Modification Time. +* set-visited-file-name: Buffer File Name. +* set-weak-list-list: Weak Lists. +* set-window-buffer: Buffers and Windows. +* set-window-buffer-dedicated: Choosing Window. +* set-window-configuration: Window Configurations. +* set-window-dedicated-p: Choosing Window. +* set-window-hscroll: Horizontal Scrolling. +* set-window-point: Window Point. +* set-window-start: Window Start. +* setcar: Setcar. +* setcdr: Setcdr. +* setenv: System Environment. +* setplist: Symbol Plists. +* setprv: System Environment. +* setq: Setting Variables. +* setq-default: Default Value. +* sets: Sets And Lists. +* setting modes of files: Changing File Attributes. +* setting-constant: Constant Variables. +* seventh: List Elements. +* sexp motion: List Motion. +* shadowing of variables: Local Variables. +* shallow binding: Impl of Scope. +* shared-lisp-mode-map: Standard Keymaps. +* Shell mode modeline-format: Modeline Data. +* shell-command-history: Minibuffer History. +* shrink-window: Resizing Windows. +* shrink-window-horizontally: Resizing Windows. +* shrink-window-pixels: Resizing Windows. +* side effect: Intro Eval. +* signal: Signaling Errors. +* signal-process: Signals to Processes. +* signaling errors: Signaling Errors. +* signals: Signals to Processes. +* sin: Math Functions. +* single-key-description: Describing Characters. +* sinh: Math Functions. +* sit-for: Waiting. +* site-init.el: Building XEmacs. +* site-load.el: Building XEmacs. +* site-run-file: Init File. +* site-start.el: Start-up Summary. +* sixth: List Elements. +* size of frame: Size and Position. +* size of window: Size of Window. +* skip-chars-backward: Skipping Characters. +* skip-chars-forward: Skipping Characters. +* skip-syntax-backward: Motion and Syntax. +* skip-syntax-forward: Motion and Syntax. +* skipping characters: Skipping Characters. +* skipping comments: Parsing Expressions. +* sleep-for: Waiting. +* Snarf-documentation: Accessing Documentation. +* sort: Rearrangement. +* sort-columns: Sorting. +* sort-fields: Sorting. +* sort-lines: Sorting. +* sort-numeric-fields: Sorting. +* sort-pages: Sorting. +* sort-paragraphs: Sorting. +* sort-regexp-fields: Sorting. +* sort-subr: Sorting. +* sorting lists: Rearrangement. +* sorting text: Sorting. +* sound: Beeping. +* sound-alist: Beeping. +* special: Major Mode Conventions. +* special form descriptions: A Sample Function Description. +* special form evaluation: Special Forms. +* special forms: Primitive Function Type. +* special forms (Edebug): Instrumenting. +* special forms for control structures: Control Structures. +* special-display-buffer-names: Choosing Window. +* special-display-frame-plist: Choosing Window. +* special-display-function: Choosing Window. +* special-display-popup-frame: Choosing Window. +* special-display-regexps: Choosing Window. +* specification (in a specifier): Specifiers In-Depth. +* specifier: Specifiers. +* specifier type: Specifier Type. +* specifier, domain: Specifiers In-Depth. +* specifier, fallback: Specifier Instancing. +* specifier, inst-list: Specifiers In-Depth. +* specifier, inst-pair: Specifiers In-Depth. +* specifier, instance: Specifiers In-Depth. +* specifier, instancing: Specifiers In-Depth. +* specifier, instantiator: Specifiers In-Depth. +* specifier, locale: Specifiers In-Depth. +* specifier, specification: Specifiers In-Depth. +* specifier, tag: Specifiers In-Depth. +* specifier, tag set: Specifiers In-Depth. +* specifier-fallback: Retrieving Specifications. +* specifier-instance: Specifier Instancing Functions. +* specifier-instance-from-inst-list: Specifier Instancing Functions. +* specifier-locale-type-from-locale: Other Specification Functions. +* specifier-spec-list: Retrieving Specifications. +* specifier-specs: Retrieving Specifications. +* specifier-tag-list: Specifier Tag Functions. +* specifier-tag-predicate: Specifier Tag Functions. +* specifier-type: Specifier Types. +* specifierp: Specifiers. +* speedups: Compilation Tips. +* splicing (with backquote): Backquote. +* split-height-threshold: Choosing Window. +* split-line: Commands for Insertion. +* split-path: Regexp Search. +* split-string: Regexp Search. +* split-window: Splitting Windows. +* split-window-horizontally: Splitting Windows. +* split-window-vertically: Splitting Windows. +* splitting windows: Splitting Windows. +* sqrt: Math Functions. +* stable sort: Rearrangement. +* standard regexps used in editing: Standard Regexps. +* standard-case-table: Case Tables. +* standard-category-table: Category Tables. +* standard-input: Input Functions. +* standard-output: Output Variables. +* standard-syntax-table: Standard Syntax Tables. +* standards of coding style: Tips. +* start up of XEmacs: Start-up Summary. +* start-process: Asynchronous Processes. +* start-process-shell-command: Asynchronous Processes. +* startup.el: Start-up Summary. +* stop points: Using Edebug. +* stop-process: Signals to Processes. +* stopping an infinite loop: Infinite Loops. +* stopping on events: Global Break Condition. +* store-match-data: Entire Match Data. +* stream (for printing): Output Streams. +* stream (for reading): Input Streams. +* string: Creating Strings. +* string equality: Text Comparison. +* string in keymap: Key Lookup. +* string input stream: Input Streams. +* string length: Sequence Functions. +* string length, maximum when printing: Output Variables. +* string properties: String Properties. +* string quote: Syntax Class Table. +* string search: String Search. +* string to character: String Conversion. +* string to number: String Conversion. +* string to object: Input Functions. +* string, writing a doc string: Documentation Basics. +* string-equal: Text Comparison. +* string-lessp: Text Comparison. +* string-match: Regexp Search. +* string-modified-tick: Modifying Strings. +* string-to-char: String Conversion. +* string-to-int: String Conversion. +* string-to-number: String Conversion. +* string<: Text Comparison. +* string=: Text Comparison. +* stringp: Predicates for Strings. +* strings: Strings and Characters. +* strings, formatting them: Formatting Strings. +* strings, modifying: Modifying Strings. +* subprocess: Processes. +* subr: What Is a Function. +* subrp: What Is a Function. +* subsidiary-coding-system: Basic Coding System Functions. +* subst-char-in-region: Substitution. +* substitute-command-keys: Keys in Documentation. +* substitute-in-file-name: File Name Expansion. +* substitute-key-definition: Changing Key Bindings. +* substituting keys in documentation: Keys in Documentation. +* substring: Creating Strings. +* subwindow type: Subwindow Type. +* subwindow-image-instance-p: Image Instance Types. +* subwindowp: Subwindows. +* suppress-keymap: Changing Key Bindings. +* suspend (cf. no-redraw-on-reenter): Refresh Screen. +* suspend evaluation: Recursive Editing. +* suspend-emacs: Suspending XEmacs. +* suspend-hook: Suspending XEmacs. +* suspend-resume-hook: Suspending XEmacs. +* suspending XEmacs: Suspending XEmacs. +* switch-to-buffer: Displaying Buffers. +* switch-to-buffer-other-window: Displaying Buffers. +* switches on command line: Command Line Arguments. +* switching to a buffer: Displaying Buffers. +* symbol: Symbols. +* symbol components: Symbol Components. +* symbol constituent: Syntax Class Table. +* symbol equality: Creating Symbols. +* symbol evaluation: Symbol Forms. +* symbol function indirection: Function Indirection. +* symbol in keymap: Key Lookup. +* symbol name hashing: Creating Symbols. +* symbol-function: Function Cells. +* symbol-name: Creating Symbols. +* symbol-plist: Symbol Plists. +* symbol-value: Accessing Variables. +* symbolp: Symbols. +* synchronous subprocess: Synchronous Processes. +* syntax classes: Syntax Descriptors. +* syntax descriptor: Syntax Descriptors. +* syntax error (Edebug): Backtracking. +* syntax flags: Syntax Flags. +* syntax for characters: Character Type. +* syntax table: Syntax Tables. +* syntax table example: Example Major Modes. +* syntax table internals: Syntax Table Internals. +* syntax tables in modes: Major Mode Conventions. +* syntax-table: Syntax Table Functions. +* syntax-table-p: Syntax Basics. +* system-configuration: System Environment. +* system-name: System Environment. +* system-type: System Environment. +* t: Constant Variables. +* t and truth: nil and t. +* t input stream: Input Streams. +* t output stream: Output Streams. +* tab: Character Type. +* tab deletion: Deletion. +* tab-stop-list: Indent Tabs. +* tab-to-tab-stop: Indent Tabs. +* tab-width: Usual Display. +* tabs stops for indentation: Indent Tabs. +* tag (in a specifier): Specifiers In-Depth. +* tag on run time stack: Catch and Throw. +* tag set (in a specifier): Specifiers In-Depth. +* tan: Math Functions. +* tanh: Math Functions. +* TCP: Network. +* temacs: Building XEmacs. +* temp-buffer-show-function: Temporary Displays. +* temp-directory: Unique File Names. +* tenth: List Elements. +* TERM environment variable: Terminal-Specific. +* term-file-prefix: Terminal-Specific. +* term-setup-hook: Terminal-Specific. +* Termcap: Terminal-Specific. +* terminal frame <1>: Frames. +* terminal frame: Basic Windows. +* terminal input: Terminal Input. +* terminal input modes: Input Modes. +* terminal output: Terminal Output. +* terminal-device: Console Types and Device Classes. +* terminal-specific initialization: Terminal-Specific. +* terminate keyboard macro: Peeking and Discarding. +* termscript file: Terminal Output. +* terpri: Output Functions. +* testing types: Type Predicates. +* text: Text. +* text files and binary files: Files and MS-DOS. +* text insertion: Insertion. +* text parsing: Syntax Tables. +* text properties: Text Properties. +* text properties in files: Saving Properties. +* text-char-description: Describing Characters. +* text-image-instance-p: Image Instance Types. +* text-mode-abbrev-table: Standard Abbrev Tables. +* text-mode-map: Standard Keymaps. +* text-mode-syntax-table: Standard Syntax Tables. +* text-pointer-glyph: Mouse Pointer. +* text-properties-at: Examining Properties. +* text-property-any: Property Search. +* text-property-not-all: Property Search. +* third: List Elements. +* this-command: Command Loop Info. +* this-command-keys: Command Loop Info. +* throw: Catch and Throw. +* throw example: Recursive Editing. +* tiled windows: Basic Windows. +* timeout-event-p: Event Predicates. +* timing programs: Compilation Tips. +* tips: Tips. +* toggle-read-only: Read Only Buffers. +* toolbar: Toolbar. +* toolbar button type: Toolbar Button Type. +* toolbar-buttons-captioned-p: Other Toolbar Variables. +* toolbar-make-button-list: Toolbar Descriptor Format. +* toolbar-map <1>: Active Keymaps. +* toolbar-map: Standard Keymaps. +* toolbar-pointer-glyph: Mouse Pointer. +* toolbar-specifier-p <1>: Specifier Types. +* toolbar-specifier-p: Specifying the Toolbar. +* ToolTalk: ToolTalk Support. +* ToolTalk message: Sending Messages. +* ToolTalk pattern: Receiving Messages. +* top-level: Recursive Editing. +* top-level form: Loading. +* top-toolbar: Specifying the Toolbar. +* top-toolbar-height: Other Toolbar Variables. +* top-toolbar-visible-p: Other Toolbar Variables. +* tq-close: Transaction Queues. +* tq-create: Transaction Queues. +* tq-enqueue: Transaction Queues. +* tracing: Tracing. +* transaction queue: Transaction Queues. +* transcendental functions: Math Functions. +* translate-region: Substitution. +* translating input events: Translating Input. +* transpose-regions: Transposition. +* trim-versions-without-asking: Numbered Backups. +* true: nil and t. +* truename (of file): Truenames. +* truncate: Numeric Conversions. +* truncate-lines: Truncation. +* truncate-partial-width-windows: Truncation. +* truncation-glyph: Redisplay Glyphs. +* truth value: nil and t. +* try-completion: Basic Completion. +* two's complement: Integer Basics. +* type: Lisp Data Types. +* type checking: Type Predicates. +* type predicates: Type Predicates. +* type-of: Type Predicates. +* unbinding keys: Key Binding Commands. +* undefined: Functions for Key Lookup. +* undefined in keymap: Key Lookup. +* undefined key: Keymap Terminology. +* undo avoidance: Substitution. +* undo-boundary: Undo. +* undo-limit: Maintaining Undo. +* undo-strong-limit: Maintaining Undo. +* unexec: Building XEmacs. +* unhandled-file-name-directory: Magic File Names. +* unintern: Creating Symbols. +* uninterned symbol: Creating Symbols. +* uninterned symbols, printing: Output Variables. +* unique extents: Duplicable Extents. +* universal-argument: Prefix Command Arguments. +* unload-feature: Unloading. +* unloading: Unloading. +* unlock-buffer: File Locks. +* unmap-frame-hook: Frame Hooks. +* unread-command-event: Peeking and Discarding. +* unread-command-events: Peeking and Discarding. +* unreading: Input Streams. +* unregister-tooltalk-pattern: Elisp Interface for Receiving Messages. +* unwind-protect: Cleanups. +* unwinding: Cleanups. +* up-list: List Motion. +* upcase: Character Case. +* upcase-region: Case Changes. +* upcase-word: Case Changes. +* update display: Refresh Screen. +* update-directory-autoloads: Autoload. +* update-file-autoloads: Autoload. +* upper case: Character Case. +* upper case key sequence: Key Sequence Input. +* use-global-map: Active Keymaps. +* use-hard-newlines: Filling. +* use-left-overflow: Margin Primitives. +* use-local-map: Active Keymaps. +* use-right-overflow: Margin Primitives. +* user name completion subroutines: User Name Completion. +* user option: Defining Variables. +* user-defined error: Error Symbols. +* user-full-name: User Identification. +* user-home-directory: User Identification. +* user-login-name: User Identification. +* user-mail-address: User Identification. +* user-name-all-completions: User Name Completion. +* user-name-completion: User Name Completion. +* user-name-completion-1: User Name Completion. +* user-real-login-name: User Identification. +* user-real-uid: User Identification. +* user-uid: User Identification. +* user-variable-p: Defining Variables. +* user-variable-p example: High-Level Completion. +* valid-char-table-type-p: Char Table Types. +* valid-char-table-value-p: Working With Char Tables. +* valid-device-class-p: Console Types and Device Classes. +* valid-device-type-p: Console Types and Device Classes. +* valid-glyph-type-p: Glyph Types. +* valid-image-instance-type-p: Image Instance Types. +* valid-image-instantiator-format-p: Image Specifiers. +* valid-inst-list-p: Specifier Validation Functions. +* valid-instantiator-p: Specifier Validation Functions. +* valid-plist-p: Property Lists. +* valid-spec-list-p: Specifier Validation Functions. +* valid-specifier-domain-p: Specifier Validation Functions. +* valid-specifier-locale-p: Specifier Validation Functions. +* valid-specifier-locale-type-p: Specifier Validation Functions. +* valid-specifier-tag-p <1>: Specifier Tag Functions. +* valid-specifier-tag-p: Specifier Validation Functions. +* valid-specifier-tag-set-p: Specifier Tag Functions. +* valid-specifier-type-p: Specifier Validation Functions. +* value cell: Symbol Components. +* value of expression: Evaluation. +* values: Eval. +* variable: Variables. +* variable aliases: Variable Aliases. +* variable definition: Defining Variables. +* variable descriptions: A Sample Variable Description. +* variable limit error: Local Variables. +* variable-alias: Variable Aliases. +* variable-documentation: Documentation Basics. +* variable-obsoleteness-doc: Obsoleteness. +* variables, buffer-local: Buffer-Local Variables. +* variables, indirect: Variable Aliases. +* vc-mode: Modeline Variables. +* vconcat: Vector Functions. +* vector <1>: Vector Functions. +* vector: Vectors. +* vector evaluation: Self-Evaluating Forms. +* vector length: Sequence Functions. +* vectorp: Vector Functions. +* verify-visited-file-modtime: Modification Time. +* version number (in file name): File Name Components. +* version-control: Numbered Backups. +* vertical scrolling: Vertical Scrolling. +* vertical tab: Character Type. +* vertical-motion: Screen Lines. +* vertical-motion-pixels: Screen Lines. +* view-file: Visiting Functions. +* view-mode-map: Standard Keymaps. +* view-register: Registers. +* visible frame: Visibility of Frames. +* visible-bell: Beeping. +* visible-frame-list: Finding All Frames. +* visited file: Buffer File Name. +* visited file mode: Auto Major Mode. +* visited-file-modtime: Modification Time. +* visiting files: Visiting Files. +* void function: Function Indirection. +* void function cell: Function Cells. +* void variable: Void Variables. +* void-function: Function Cells. +* void-variable: Void Variables. +* waiting: Waiting. +* waiting for command key input: Peeking and Discarding. +* waiting-for-user-input-p: Sentinels. +* wakeup: Subprocess Creation. +* walk-windows: Cyclic Window Ordering. +* weak hash table: Weak Hash Tables. +* weak list: Weak Lists. +* weak list type: Weak List Type. +* weak-list-list: Weak Lists. +* weak-list-p: Weak Lists. +* weak-list-type: Weak Lists. +* where-is-internal: Scanning Keymaps. +* while: Iteration. +* whitespace: Character Type. +* whitespace character: Syntax Class Table. +* widen: Narrowing. +* widening: Narrowing. +* window: Basic Windows. +* window configuration (Edebug): Edebug Display Update. +* window configurations: Window Configurations. +* window excursions: Excursions. +* window ordering, cyclic: Cyclic Window Ordering. +* window point: Window Point. +* window position <1>: Window Point. +* window position: Position of Window. +* window resizing: Resizing Windows. +* window size: Size of Window. +* window size, changing: Resizing Windows. +* window splitting: Splitting Windows. +* window system types: Window-System Types. +* window top line: Window Start. +* window-buffer: Buffers and Windows. +* window-configuration-p: Window Configurations. +* window-dedicated-p: Choosing Window. +* window-displayed-text-pixel-height: Size of Window. +* window-end: Window Start. +* window-frame: Frames and Windows. +* window-height: Size of Window. +* window-highest-p: Position of Window. +* window-hscroll: Horizontal Scrolling. +* window-left-margin-pixel-width: Margin Primitives. +* window-live-p: Deleting Windows. +* window-lowest-p: Position of Window. +* window-min-height: Resizing Windows. +* window-min-width: Resizing Windows. +* window-minibuffer-p: Minibuffer Misc. +* window-pixel-edges: Position of Window. +* window-pixel-height: Size of Window. +* window-pixel-width: Size of Window. +* window-point: Window Point. +* window-right-margin-pixel-width: Margin Primitives. +* window-setup-hook: Terminal-Specific. +* window-size-change-functions: Resizing Windows. +* window-start: Window Start. +* window-system objects: Faces and Window-System Objects. +* window-text-area-pixel-edges: Position of Window. +* window-text-area-pixel-height: Size of Window. +* window-text-area-pixel-width: Size of Window. +* window-width: Size of Window. +* windowp: Basic Windows. +* windows, controlling precisely: Buffers and Windows. +* with-current-buffer: Excursions. +* with-output-to-temp-buffer: Temporary Displays. +* with-selected-frame: Input Focus. +* with-temp-file: Excursions. +* word constituent: Syntax Class Table. +* word search: String Search. +* word-search-backward: String Search. +* word-search-forward: String Search. +* words-include-escapes: Word Motion. +* write-abbrev-file: Abbrev Files. +* write-char: Output Functions. +* write-contents-hooks: Saving Buffers. +* write-file: Saving Buffers. +* write-file-hooks: Saving Buffers. +* write-region: Writing to Files. +* write-region-annotate-functions: Saving Properties. +* writing a documentation string: Documentation Basics. +* wrong-number-of-arguments: Argument List. +* wrong-type-argument: Type Predicates. +* X: X-Windows. +* X resource type: X Resource Type. +* X window frame: Frames. +* x-allow-sendevents: X Miscellaneous. +* x-bitmap-file-path <1>: X Miscellaneous. +* x-bitmap-file-path: Image Specifiers. +* x-debug-events: X Miscellaneous. +* x-debug-mode: X Miscellaneous. +* x-disown-selection: X Selections. +* x-display-visual-class: Server Data. +* x-emacs-application-class: Resources. +* x-find-larger-font: Font Instance Size. +* x-find-smaller-font: Font Instance Size. +* x-font-size: Font Instance Size. +* x-get-cutbuffer: X Selections. +* x-get-resource: Resources. +* x-get-selection: X Selections. +* x-grab-keyboard: Grabs. +* x-grab-pointer: Grabs. +* x-library-search-path: X Miscellaneous. +* x-make-font-bold: Font Instance Characteristics. +* x-make-font-bold-italic: Font Instance Characteristics. +* x-make-font-italic: Font Instance Characteristics. +* x-make-font-unbold: Font Instance Characteristics. +* x-make-font-unitalic: Font Instance Characteristics. +* x-own-selection: X Selections. +* x-put-resource: Resources. +* x-server-vendor: Server Data. +* x-server-version: Server Data. +* x-set-frame-icon-pixmap: Frame Titles. +* x-store-cutbuffer: X Selections. +* x-ungrab-keyboard: Grabs. +* x-ungrab-pointer: Grabs. +* x-valid-keysym-name-p: X Miscellaneous. +* x-window-id: X Miscellaneous. +* X-Windows: X-Windows. +* XEmacs event standard notation: Describing Characters. +* xpm-color-symbols: Image Specifiers. +* y-or-n-p: Yes-or-No Queries. +* y-or-n-p-maybe-dialog-box: Yes-or-No Queries. +* yank: Yank Commands. +* yank suppression: Changing Key Bindings. +* yank-pop: Yank Commands. +* yes-or-no questions: Yes-or-No Queries. +* yes-or-no-p: Yes-or-No Queries. +* yes-or-no-p-dialog-box: Yes-or-No Queries. +* yes-or-no-p-maybe-dialog-box: Yes-or-No Queries. +* zero-length extent: Extent Endpoints. +* zerop: Predicates on Numbers. +* zmacs-activate-region: The Region. +* zmacs-activate-region-hook: The Region. +* zmacs-deactivate-region: The Region. +* zmacs-deactivate-region-hook: The Region. +* zmacs-region-stays: The Region. +* zmacs-regions: The Region. +* zmacs-update-region: The Region. +* zmacs-update-region-hook: The Region. +* | in regexp: Syntax of Regexps. + + diff --git a/info/lispref.info-45 b/info/lispref.info-45 new file mode 100644 index 0000000..f6e4355 --- /dev/null +++ b/info/lispref.info-45 @@ -0,0 +1,1316 @@ +This is ../info/lispref.info, produced by makeinfo version 4.0 from +lispref/lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Pure Storage, Next: Garbage Collection, Prev: Building XEmacs, Up: Building XEmacs and Object Allocation + +Pure Storage +============ + + XEmacs Lisp uses two kinds of storage for user-created Lisp objects: +"normal storage" and "pure storage". Normal storage is where all the +new data created during an XEmacs session is kept; see the following +section for information on normal storage. Pure storage is used for +certain data in the preloaded standard Lisp files--data that should +never change during actual use of XEmacs. + + Pure storage is allocated only while `temacs' is loading the +standard preloaded Lisp libraries. In the file `xemacs', it is marked +as read-only (on operating systems that permit this), so that the +memory space can be shared by all the XEmacs jobs running on the machine +at once. Pure storage is not expandable; a fixed amount is allocated +when XEmacs is compiled, and if that is not sufficient for the preloaded +libraries, `temacs' aborts with an error message. If that happens, you +must increase the compilation parameter `PURESIZE' using the +`--puresize' option to `configure'. This normally won't happen unless +you try to preload additional libraries or add features to the standard +ones. + + - Function: purecopy object + This function makes a copy of OBJECT in pure storage and returns + it. It copies strings by simply making a new string with the same + characters in pure storage. It recursively copies the contents of + vectors and cons cells. It does not make copies of other objects + such as symbols, but just returns them unchanged. It signals an + error if asked to copy markers. + + This function is a no-op except while XEmacs is being built and + dumped; it is usually called only in the file + `xemacs/lisp/prim/loaddefs.el', but a few packages call it just in + case you decide to preload them. + + - Variable: pure-bytes-used + The value of this variable is the number of bytes of pure storage + allocated so far. Typically, in a dumped XEmacs, this number is + very close to the total amount of pure storage available--if it + were not, we would preallocate less. + + - Variable: purify-flag + This variable determines whether `defun' should make a copy of the + function definition in pure storage. If it is non-`nil', then the + function definition is copied into pure storage. + + This flag is `t' while loading all of the basic functions for + building XEmacs initially (allowing those functions to be sharable + and non-collectible). Dumping XEmacs as an executable always + writes `nil' in this variable, regardless of the value it actually + has before and after dumping. + + You should not change this flag in a running XEmacs. + + +File: lispref.info, Node: Garbage Collection, Prev: Pure Storage, Up: Building XEmacs and Object Allocation + +Garbage Collection +================== + + When a program creates a list or the user defines a new function +(such as by loading a library), that data is placed in normal storage. +If normal storage runs low, then XEmacs asks the operating system to +allocate more memory in blocks of 2k bytes. Each block is used for one +type of Lisp object, so symbols, cons cells, markers, etc., are +segregated in distinct blocks in memory. (Vectors, long strings, +buffers and certain other editing types, which are fairly large, are +allocated in individual blocks, one per object, while small strings are +packed into blocks of 8k bytes. [More correctly, a string is allocated +in two sections: a fixed size chunk containing the length, list of +extents, etc.; and a chunk containing the actual characters in the +string. It is this latter chunk that is either allocated individually +or packed into 8k blocks. The fixed size chunk is packed into 2k +blocks, as for conses, markers, etc.]) + + It is quite common to use some storage for a while, then release it +by (for example) killing a buffer or deleting the last pointer to an +object. XEmacs provides a "garbage collector" to reclaim this +abandoned storage. (This name is traditional, but "garbage recycler" +might be a more intuitive metaphor for this facility.) + + The garbage collector operates by finding and marking all Lisp +objects that are still accessible to Lisp programs. To begin with, it +assumes all the symbols, their values and associated function +definitions, and any data presently on the stack, are accessible. Any +objects that can be reached indirectly through other accessible objects +are also accessible. + + When marking is finished, all objects still unmarked are garbage. No +matter what the Lisp program or the user does, it is impossible to refer +to them, since there is no longer a way to reach them. Their space +might as well be reused, since no one will miss them. The second +("sweep") phase of the garbage collector arranges to reuse them. + + The sweep phase puts unused cons cells onto a "free list" for future +allocation; likewise for symbols, markers, extents, events, floats, +compiled-function objects, and the fixed-size portion of strings. It +compacts the accessible small string-chars chunks so they occupy fewer +8k blocks; then it frees the other 8k blocks. Vectors, buffers, +windows, and other large objects are individually allocated and freed +using `malloc' and `free'. + + Common Lisp note: unlike other Lisps, XEmacs Lisp does not call + the garbage collector when the free list is empty. Instead, it + simply requests the operating system to allocate more storage, and + processing continues until `gc-cons-threshold' bytes have been + used. + + This means that you can make sure that the garbage collector will + not run during a certain portion of a Lisp program by calling the + garbage collector explicitly just before it (provided that portion + of the program does not use so much space as to force a second + garbage collection). + + - Command: garbage-collect + This command runs a garbage collection, and returns information on + the amount of space in use. (Garbage collection can also occur + spontaneously if you use more than `gc-cons-threshold' bytes of + Lisp data since the previous garbage collection.) + + `garbage-collect' returns a list containing the following + information: + + ((USED-CONSES . FREE-CONSES) + (USED-SYMS . FREE-SYMS) + (USED-MARKERS . FREE-MARKERS) + USED-STRING-CHARS + USED-VECTOR-SLOTS + (PLIST)) + + => ((73362 . 8325) (13718 . 164) + (5089 . 5098) 949121 118677 + (conses-used 73362 conses-free 8329 cons-storage 658168 + symbols-used 13718 symbols-free 164 symbol-storage 335216 + bit-vectors-used 0 bit-vectors-total-length 0 + bit-vector-storage 0 vectors-used 7882 + vectors-total-length 118677 vector-storage 537764 + compiled-functions-used 1336 compiled-functions-free 37 + compiled-function-storage 44440 short-strings-used 28829 + long-strings-used 2 strings-free 7722 + short-strings-total-length 916657 short-string-storage 1179648 + long-strings-total-length 32464 string-header-storage 441504 + floats-used 3 floats-free 43 float-storage 2044 markers-used 5089 + markers-free 5098 marker-storage 245280 events-used 103 + events-free 835 event-storage 110656 extents-used 10519 + extents-free 2718 extent-storage 372736 + extent-auxiliarys-used 111 extent-auxiliarys-freed 3 + extent-auxiliary-storage 4440 window-configurations-used 39 + window-configurations-on-free-list 5 + window-configurations-freed 10 window-configuration-storage 9492 + popup-datas-used 3 popup-data-storage 72 toolbar-buttons-used 62 + toolbar-button-storage 4960 toolbar-datas-used 12 + toolbar-data-storage 240 symbol-value-buffer-locals-used 182 + symbol-value-buffer-local-storage 5824 + symbol-value-lisp-magics-used 22 + symbol-value-lisp-magic-storage 1496 + symbol-value-varaliases-used 43 + symbol-value-varalias-storage 1032 opaque-lists-used 2 + opaque-list-storage 48 color-instances-used 12 + color-instance-storage 288 font-instances-used 5 + font-instance-storage 180 opaques-used 11 opaque-storage 312 + range-tables-used 1 range-table-storage 16 faces-used 34 + face-storage 2584 glyphs-used 124 glyph-storage 4464 + specifiers-used 775 specifier-storage 43869 weak-lists-used 786 + weak-list-storage 18864 char-tables-used 40 + char-table-storage 41920 buffers-used 25 buffer-storage 7000 + extent-infos-used 457 extent-infos-freed 73 + extent-info-storage 9140 keymaps-used 275 keymap-storage 12100 + consoles-used 4 console-storage 384 command-builders-used 2 + command-builder-storage 120 devices-used 2 device-storage 344 + frames-used 3 frame-storage 624 image-instances-used 47 + image-instance-storage 3008 windows-used 27 windows-freed 2 + window-storage 9180 lcrecord-lists-used 15 + lcrecord-list-storage 360 hash-tables-used 631 + hash-table-storage 25240 streams-used 1 streams-on-free-list 3 + streams-freed 12 stream-storage 91)) + + Here is a table explaining each element: + + USED-CONSES + The number of cons cells in use. + + FREE-CONSES + The number of cons cells for which space has been obtained + from the operating system, but that are not currently being + used. + + USED-SYMS + The number of symbols in use. + + FREE-SYMS + The number of symbols for which space has been obtained from + the operating system, but that are not currently being used. + + USED-MARKERS + The number of markers in use. + + FREE-MARKERS + The number of markers for which space has been obtained from + the operating system, but that are not currently being used. + + USED-STRING-CHARS + The total size of all strings, in characters. + + USED-VECTOR-SLOTS + The total number of elements of existing vectors. + + PLIST + A list of alternating keyword/value pairs providing more + detailed information. (As you can see above, quite a lot of + information is provided.) + + - User Option: gc-cons-threshold + The value of this variable is the number of bytes of storage that + must be allocated for Lisp objects after one garbage collection in + order to trigger another garbage collection. A cons cell counts + as eight bytes, a string as one byte per character plus a few + bytes of overhead, and so on; space allocated to the contents of + buffers does not count. Note that the subsequent garbage + collection does not happen immediately when the threshold is + exhausted, but only the next time the Lisp evaluator is called. + + The initial threshold value is 500,000. If you specify a larger + value, garbage collection will happen less often. This reduces the + amount of time spent garbage collecting, but increases total + memory use. You may want to do this when running a program that + creates lots of Lisp data. + + You can make collections more frequent by specifying a smaller + value, down to 10,000. A value less than 10,000 will remain in + effect only until the subsequent garbage collection, at which time + `garbage-collect' will set the threshold back to 10,000. (This does + not apply if XEmacs was configured with `--debug'. Therefore, be + careful when setting `gc-cons-threshold' in that case!) + + - Function: memory-limit + This function returns the address of the last byte XEmacs has + allocated, divided by 1024. We divide the value by 1024 to make + sure it fits in a Lisp integer. + + You can use this to get a general idea of how your actions affect + the memory usage. + + - Variable: pre-gc-hook + This is a normal hook to be run just before each garbage + collection. Interrupts, garbage collection, and errors are + inhibited while this hook runs, so be extremely careful in what + you add here. In particular, avoid consing, and do not interact + with the user. + + - Variable: post-gc-hook + This is a normal hook to be run just after each garbage collection. + Interrupts, garbage collection, and errors are inhibited while + this hook runs, so be extremely careful in what you add here. In + particular, avoid consing, and do not interact with the user. + + - Variable: gc-message + This is a string to print to indicate that a garbage collection is + in progress. This is printed in the echo area. If the selected + frame is on a window system and `gc-pointer-glyph' specifies a + value (i.e. a pointer image instance) in the domain of the + selected frame, the mouse cursor will change instead of this + message being printed. + + - Glyph: gc-pointer-glyph + This holds the pointer glyph used to indicate that a garbage + collection is in progress. If the selected window is on a window + system and this glyph specifies a value (i.e. a pointer image + instance) in the domain of the selected window, the cursor will be + changed as specified during garbage collection. Otherwise, a + message will be printed in the echo area, as controlled by + `gc-message'. *Note Glyphs::. + + If XEmacs was configured with `--debug', you can set the following +two variables to get direct information about all the allocation that +is happening in a segment of Lisp code. + + - Variable: debug-allocation + If non-zero, print out information to stderr about all objects + allocated. + + - Variable: debug-allocation-backtrace + Length (in stack frames) of short backtrace printed out by + `debug-allocation'. + + +File: lispref.info, Node: Standard Errors, Next: Standard Buffer-Local Variables, Prev: Building XEmacs and Object Allocation, Up: Top + +Standard Errors +*************** + + Here is the complete list of the error symbols in standard Emacs, +grouped by concept. The list includes each symbol's message (on the +`error-message' property of the symbol) and a cross reference to a +description of how the error can occur. + + Each error symbol has an `error-conditions' property that is a list +of symbols. Normally this list includes the error symbol itself and +the symbol `error'. Occasionally it includes additional symbols, which +are intermediate classifications, narrower than `error' but broader +than a single error symbol. For example, all the errors in accessing +files have the condition `file-error'. + + As a special exception, the error symbol `quit' does not have the +condition `error', because quitting is not considered an error. + + *Note Errors::, for an explanation of how errors are generated and +handled. + +`SYMBOL' + STRING; REFERENCE. + +`error' + `"error"' + *Note Errors::. + +`quit' + `"Quit"' + *Note Quitting::. + +`args-out-of-range' + `"Args out of range"' + *Note Sequences Arrays Vectors::. + +`arith-error' + `"Arithmetic error"' + See `/' and `%' in *Note Numbers::. + +`beginning-of-buffer' + `"Beginning of buffer"' + *Note Motion::. + +`buffer-read-only' + `"Buffer is read-only"' + *Note Read Only Buffers::. + +`cyclic-function-indirection' + `"Symbol's chain of function indirections contains a loop"' + *Note Function Indirection::. + +`domain-error' + `"Arithmetic domain error"' +`end-of-buffer' + `"End of buffer"' + *Note Motion::. + +`end-of-file' + `"End of file during parsing"' + This is not a `file-error'. + *Note Input Functions::. + +`file-error' + This error and its subcategories do not have error-strings, + because the error message is constructed from the data items alone + when the error condition `file-error' is present. + *Note Files::. + +`file-locked' + This is a `file-error'. + *Note File Locks::. + +`file-already-exists' + This is a `file-error'. + *Note Writing to Files::. + +`file-supersession' + This is a `file-error'. + *Note Modification Time::. + +`invalid-byte-code' + `"Invalid byte code"' + *Note Byte Compilation::. + +`invalid-function' + `"Invalid function"' + *Note Classifying Lists::. + +`invalid-read-syntax' + `"Invalid read syntax"' + *Note Input Functions::. + +`invalid-regexp' + `"Invalid regexp"' + *Note Regular Expressions::. + +`mark-inactive' + `"The mark is not active now"' +`no-catch' + `"No catch for tag"' + *Note Catch and Throw::. + +`overflow-error' + `"Arithmetic overflow error"' +`protected-field' + `"Attempt to modify a protected field"' +`range-error' + `"Arithmetic range error"' +`search-failed' + `"Search failed"' + *Note Searching and Matching::. + +`setting-constant' + `"Attempt to set a constant symbol"' + *Note Variables that Never Change: Constant Variables. + +`singularity-error' + `"Arithmetic singularity error"' +`tooltalk-error' + `"ToolTalk error"' + *Note ToolTalk Support::. + +`undefined-keystroke-sequence' + `"Undefined keystroke sequence"' +`void-function' + `"Symbol's function definition is void"' + *Note Function Cells::. + +`void-variable' + `"Symbol's value as variable is void"' + *Note Accessing Variables::. + +`wrong-number-of-arguments' + `"Wrong number of arguments"' + *Note Classifying Lists::. + +`wrong-type-argument' + `"Wrong type argument"' + *Note Type Predicates::. + + These error types, which are all classified as special cases of +`arith-error', can occur on certain systems for invalid use of +mathematical functions. + +`domain-error' + `"Arithmetic domain error"' + *Note Math Functions::. + +`overflow-error' + `"Arithmetic overflow error"' + *Note Math Functions::. + +`range-error' + `"Arithmetic range error"' + *Note Math Functions::. + +`singularity-error' + `"Arithmetic singularity error"' + *Note Math Functions::. + +`underflow-error' + `"Arithmetic underflow error"' + *Note Math Functions::. + + +File: lispref.info, Node: Standard Buffer-Local Variables, Next: Standard Keymaps, Prev: Standard Errors, Up: Top + +Buffer-Local Variables +********************** + + The table below lists the general-purpose Emacs variables that are +automatically local (when set) in each buffer. Many Lisp packages +define such variables for their internal use; we don't list them here. + +`abbrev-mode' + *note Abbrevs:: + +`auto-fill-function' + *note Auto Filling:: + +`buffer-auto-save-file-name' + *note Auto-Saving:: + +`buffer-backed-up' + *note Backup Files:: + +`buffer-display-table' + *note Display Tables:: + +`buffer-file-format' + *note Format Conversion:: + +`buffer-file-name' + *note Buffer File Name:: + +`buffer-file-number' + *note Buffer File Name:: + +`buffer-file-truename' + *note Buffer File Name:: + +`buffer-file-type' + *note Files and MS-DOS:: + +`buffer-invisibility-spec' + *note Invisible Text:: + +`buffer-offer-save' + *note Saving Buffers:: + +`buffer-read-only' + *note Read Only Buffers:: + +`buffer-saved-size' + *note Point:: + +`buffer-undo-list' + *note Undo:: + +`cache-long-line-scans' + *note Text Lines:: + +`case-fold-search' + *note Searching and Case:: + +`ctl-arrow' + *note Usual Display:: + +`comment-column' + *note Comments: (emacs)Comments. + +`default-directory' + *note System Environment:: + +`defun-prompt-regexp' + *note List Motion:: + +`fill-column' + *note Auto Filling:: + +`goal-column' + *note Moving Point: (emacs)Moving Point. + +`left-margin' + *note Indentation:: + +`local-abbrev-table' + *note Abbrevs:: + +`local-write-file-hooks' + *note Saving Buffers:: + +`major-mode' + *note Mode Help:: + +`mark-active' + *note The Mark:: + +`mark-ring' + *note The Mark:: + +`minor-modes' + *note Minor Modes:: + +`modeline-format' + *note Modeline Data:: + +`modeline-buffer-identification' + *note Modeline Variables:: + +`modeline-format' + *note Modeline Data:: + +`modeline-modified' + *note Modeline Variables:: + +`modeline-process' + *note Modeline Variables:: + +`mode-name' + *note Modeline Variables:: + +`overwrite-mode' + *note Insertion:: + +`paragraph-separate' + *note Standard Regexps:: + +`paragraph-start' + *note Standard Regexps:: + +`point-before-scroll' + Used for communication between mouse commands and scroll-bar + commands. + +`require-final-newline' + *note Insertion:: + +`selective-display' + *note Selective Display:: + +`selective-display-ellipses' + *note Selective Display:: + +`tab-width' + *note Usual Display:: + +`truncate-lines' + *note Truncation:: + +`vc-mode' + *note Modeline Variables:: + + +File: lispref.info, Node: Standard Keymaps, Next: Standard Hooks, Prev: Standard Buffer-Local Variables, Up: Top + +Standard Keymaps +**************** + + The following symbols are used as the names for various keymaps. +Some of these exist when XEmacs is first started, others are loaded +only when their respective mode is used. This is not an exhaustive +list. + + Almost all of these maps are used as local maps. Indeed, of the +modes that presently exist, only Vip mode and Terminal mode ever change +the global keymap. + +`bookmark-map' + A keymap containing bindings to bookmark functions. + +`Buffer-menu-mode-map' + A keymap used by Buffer Menu mode. + +`c++-mode-map' + A keymap used by C++ mode. + +`c-mode-map' + A keymap used by C mode. A sparse keymap used by C mode. + +`command-history-map' + A keymap used by Command History mode. + +`ctl-x-4-map' + A keymap for subcommands of the prefix `C-x 4'. + +`ctl-x-5-map' + A keymap for subcommands of the prefix `C-x 5'. + +`ctl-x-map' + A keymap for `C-x' commands. + +`debugger-mode-map' + A keymap used by Debugger mode. + +`dired-mode-map' + A keymap for `dired-mode' buffers. + +`edit-abbrevs-map' + A keymap used in `edit-abbrevs'. + +`edit-tab-stops-map' + A keymap used in `edit-tab-stops'. + +`electric-buffer-menu-mode-map' + A keymap used by Electric Buffer Menu mode. + +`electric-history-map' + A keymap used by Electric Command History mode. + +`emacs-lisp-mode-map' + A keymap used by Emacs Lisp mode. + +`help-map' + A keymap for characters following the Help key. + +`Helper-help-map' + A keymap used by the help utility package. + It has the same keymap in its value cell and in its function cell. + +`Info-edit-map' + A keymap used by the `e' command of Info. + +`Info-mode-map' + A keymap containing Info commands. + +`isearch-mode-map' + A keymap that defines the characters you can type within + incremental search. + +`itimer-edit-map' + A keymap used when in Itimer Edit mode. + +`lisp-interaction-mode-map' + A keymap used by Lisp mode. + +`lisp-mode-map' + A keymap used by Lisp mode. + + A keymap for minibuffer input with completion. + +`minibuffer-local-isearch-map' + A keymap for editing isearch strings in the minibuffer. + +`minibuffer-local-map' + Default keymap to use when reading from the minibuffer. + +`minibuffer-local-must-match-map' + A keymap for minibuffer input with completion, for exact match. + +`mode-specific-map' + The keymap for characters following `C-c'. Note, this is in the + global map. This map is not actually mode specific: its name was + chosen to be informative for the user in `C-h b' + (`display-bindings'), where it describes the main use of the `C-c' + prefix key. + +`modeline-map' + The keymap consulted for mouse-clicks on the modeline of a window. + +`objc-mode-map' + A keymap used in Objective C mode as a local map. + +`occur-mode-map' + A local keymap used by Occur mode. + +`overriding-local-map' + A keymap that overrides all other local keymaps. + +`query-replace-map' + A local keymap used for responses in `query-replace' and related + commands; also for `y-or-n-p' and `map-y-or-n-p'. The functions + that use this map do not support prefix keys; they look up one + event at a time. + +`read-expression-map' + The minibuffer keymap used for reading Lisp expressions. + +`read-shell-command-map' + The minibuffer keymap used by shell-command and related commands. + +`shared-lisp-mode-map' + A keymap for commands shared by all sorts of Lisp modes. + +`text-mode-map' + A keymap used by Text mode. + +`toolbar-map' + The keymap consulted for mouse-clicks over a toolbar. + +`view-mode-map' + A keymap used by View mode. + + +File: lispref.info, Node: Standard Hooks, Next: Index, Prev: Standard Keymaps, Up: Top + +Standard Hooks +************** + + The following is a list of hook variables that let you provide +functions to be called from within Emacs on suitable occasions. + + Most of these variables have names ending with `-hook'. They are +"normal hooks", run by means of `run-hooks'. The value of such a hook +is a list of functions. The recommended way to put a new function on +such a hook is to call `add-hook'. *Note Hooks::, for more information +about using hooks. + + The variables whose names end in `-function' have single functions +as their values. Usually there is a specific reason why the variable is +not a normal hook, such as the need to pass arguments to the function. +(In older Emacs versions, some of these variables had names ending in +`-hook' even though they were not normal hooks.) + + The variables whose names end in `-hooks' or `-functions' have lists +of functions as their values, but these functions are called in a +special way (they are passed arguments, or else their values are used). + +`activate-menubar-hook' + +`activate-popup-menu-hook' + +`ad-definition-hooks' + +`adaptive-fill-function' + +`add-log-current-defun-function' + +`after-change-functions' + +`after-delete-annotation-hook' + +`after-init-hook' + +`after-insert-file-functions' + +`after-revert-hook' + +`after-save-hook' + +`after-set-visited-file-name-hooks' + +`after-write-file-hooks' + +`auto-fill-function' + +`auto-save-hook' + +`before-change-functions' + +`before-delete-annotation-hook' + +`before-init-hook' + +`before-revert-hook' + +`blink-paren-function' + +`buffers-menu-switch-to-buffer-function' + +`c++-mode-hook' + +`c-delete-function' + +`c-mode-common-hook' + +`c-mode-hook' + +`c-special-indent-hook' + +`calendar-load-hook' + +`change-major-mode-hook' + +`command-history-hook' + +`comment-indent-function' + +`compilation-buffer-name-function' + +`compilation-exit-message-function' + +`compilation-finish-function' + +`compilation-parse-errors-function' + +`compilation-mode-hook' + +`create-console-hook' + +`create-device-hook' + +`create-frame-hook' + +`dabbrev-friend-buffer-function' + +`dabbrev-select-buffers-function' + +`delete-console-hook' + +`delete-device-hook' + +`delete-frame-hook' + +`deselect-frame-hook' + +`diary-display-hook' + +`diary-hook' + +`dired-after-readin-hook' + +`dired-before-readin-hook' + +`dired-load-hook' + +`dired-mode-hook' + +`disabled-command-hook' + +`display-buffer-function' + +`ediff-after-setup-control-frame-hook' + +`ediff-after-setup-windows-hook' + +`ediff-before-setup-control-frame-hook' + +`ediff-before-setup-windows-hook' + +`ediff-brief-help-message-function' + +`ediff-cleanup-hook' + +`ediff-control-frame-position-function' + +`ediff-display-help-hook' + +`ediff-focus-on-regexp-matches-function' + +`ediff-forward-word-function' + +`ediff-hide-regexp-matches-function' + +`ediff-keymap-setup-hook' + +`ediff-load-hook' + +`ediff-long-help-message-function' + +`ediff-make-wide-display-function' + +`ediff-merge-split-window-function' + +`ediff-meta-action-function' + +`ediff-meta-redraw-function' + +`ediff-mode-hook' + +`ediff-prepare-buffer-hook' + +`ediff-quit-hook' + +`ediff-registry-setup-hook' + +`ediff-select-hook' + +`ediff-session-action-function' + +`ediff-session-group-setup-hook' + +`ediff-setup-diff-regions-function' + +`ediff-show-registry-hook' + +`ediff-show-session-group-hook' + +`ediff-skip-diff-region-function' + +`ediff-split-window-function' + +`ediff-startup-hook' + +`ediff-suspend-hook' + +`ediff-toggle-read-only-function' + +`ediff-unselect-hook' + +`ediff-window-setup-function' + +`edit-picture-hook' + +`electric-buffer-menu-mode-hook' + +`electric-command-history-hook' + +`electric-help-mode-hook' + +`emacs-lisp-mode-hook' + +`fill-paragraph-function' + +`find-file-hooks' + +`find-file-not-found-hooks' + +`first-change-hook' + +`font-lock-after-fontify-buffer-hook' + +`font-lock-beginning-of-syntax-function' + +`font-lock-mode-hook' + +`fume-found-function-hook' + +`fume-list-mode-hook' + +`fume-rescan-buffer-hook' + +`fume-sort-function' + +`gnus-startup-hook' + +`hack-local-variables-hook' + +`highlight-headers-follow-url-function' + +`hyper-apropos-mode-hook' + +`indent-line-function' + +`indent-mim-hook' + +`indent-region-function' + +`initial-calendar-window-hook' + +`isearch-mode-end-hook' + +`isearch-mode-hook' + +`java-mode-hook' + +`kill-buffer-hook' + +`kill-buffer-query-functions' + +`kill-emacs-hook' + +`kill-emacs-query-functions' + +`kill-hooks' + +`LaTeX-mode-hook' + +`latex-mode-hook' + +`ledit-mode-hook' + +`lisp-indent-function' + +`lisp-interaction-mode-hook' + +`lisp-mode-hook' + +`list-diary-entries-hook' + +`load-read-function' + +`log-message-filter-function' + +`m2-mode-hook' + +`mail-citation-hook' + +`mail-mode-hook' + +`mail-setup-hook' + +`make-annotation-hook' + +`makefile-mode-hook' + +`map-frame-hook' + +`mark-diary-entries-hook' + +`medit-mode-hook' + +`menu-no-selection-hook' + +`mh-compose-letter-hook' + +`mh-folder-mode-hook' + +`mh-letter-mode-hook' + +`mim-mode-hook' + +`minibuffer-exit-hook' + +`minibuffer-setup-hook' + +`mode-motion-hook' + +`mouse-enter-frame-hook' + +`mouse-leave-frame-hook' + +`mouse-track-cleanup-hook' + +`mouse-track-click-hook' + +`mouse-track-down-hook' + +`mouse-track-drag-hook' + +`mouse-track-drag-up-hook' + +`mouse-track-up-hook' + +`mouse-yank-function' + +`news-mode-hook' + +`news-reply-mode-hook' + +`news-setup-hook' + +`nongregorian-diary-listing-hook' + +`nongregorian-diary-marking-hook' + +`nroff-mode-hook' + +`objc-mode-hook' + +`outline-mode-hook' + +`perl-mode-hook' + +`plain-TeX-mode-hook' + +`post-command-hook' + +`post-gc-hook' + +`pre-abbrev-expand-hook' + +`pre-command-hook' + +`pre-display-buffer-function' + +`pre-gc-hook' + +`pre-idle-hook' + +`print-diary-entries-hook' + +`prolog-mode-hook' + +`protect-innocence-hook' + +`remove-message-hook' + +`revert-buffer-function' + +`revert-buffer-insert-contents-function' + +`rmail-edit-mode-hook' + +`rmail-mode-hook' + +`rmail-retry-setup-hook' + +`rmail-summary-mode-hook' + +`scheme-indent-hook' + +`scheme-mode-hook' + +`scribe-mode-hook' + +`select-frame-hook' + +`send-mail-function' + +`shell-mode-hook' + +`shell-set-directory-error-hook' + +`special-display-function' + +`suspend-hook' + +`suspend-resume-hook' + +`temp-buffer-show-function' + +`term-setup-hook' + +`terminal-mode-hook' + +`terminal-mode-break-hook' + +`TeX-mode-hook' + +`tex-mode-hook' + +`text-mode-hook' + +`today-visible-calendar-hook' + +`today-invisible-calendar-hook' + +`tooltalk-message-handler-hook' + +`tooltalk-pattern-handler-hook' + +`tooltalk-unprocessed-message-hook' + +`unmap-frame-hook' + +`vc-checkin-hook' + +`vc-checkout-writable-buffer-hook' + +`vc-log-after-operation-hook' + +`vc-make-buffer-writable-hook' + +`view-hook' + +`vm-arrived-message-hook' + +`vm-arrived-messages-hook' + +`vm-chop-full-name-function' + +`vm-display-buffer-hook' + +`vm-edit-message-hook' + +`vm-forward-message-hook' + +`vm-iconify-frame-hook' + +`vm-inhibit-write-file-hook' + +`vm-key-functions' + +`vm-mail-hook' + +`vm-mail-mode-hook' + +`vm-menu-setup-hook' + +`vm-mode-hook' + +`vm-quit-hook' + +`vm-rename-current-buffer-function' + +`vm-reply-hook' + +`vm-resend-bounced-message-hook' + +`vm-resend-message-hook' + +`vm-retrieved-spooled-mail-hook' + +`vm-select-message-hook' + +`vm-select-new-message-hook' + +`vm-select-unread-message-hook' + +`vm-send-digest-hook' + +`vm-summary-mode-hook' + +`vm-summary-pointer-update-hook' + +`vm-summary-redo-hook' + +`vm-summary-update-hook' + +`vm-undisplay-buffer-hook' + +`vm-visit-folder-hook' + +`window-setup-hook' + +`write-contents-hooks' + +`write-file-data-hooks' + +`write-file-hooks' + +`write-region-annotate-functions' + +`x-lost-selection-hooks' + +`x-sent-selection-hooks' + +`zmacs-activate-region-hook' + +`zmacs-deactivate-region-hook' + +`zmacs-update-region-hook' diff --git a/info/lispref.info-46 b/info/lispref.info-46 new file mode 100644 index 0000000..11acac1 --- /dev/null +++ b/info/lispref.info-46 @@ -0,0 +1,3464 @@ +This is ../info/lispref.info, produced by makeinfo version 4.0 from +lispref/lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Index, Prev: Standard Hooks, Up: Top + +Index +***** + +* Menu: + +* " in printing: Output Functions. +* " in strings: String Type. +* #$: Docs and Compilation. +* #@COUNT: Docs and Compilation. +* $ in display: Truncation. +* $ in regexp: Syntax of Regexps. +* %: Arithmetic Operations. +* % in format: Formatting Strings. +* & in replacement: Replacing Match. +* &define (Edebug): Specification List. +* ¬ (Edebug): Specification List. +* &optional: Argument List. +* &optional (Edebug): Specification List. +* &or (Edebug): Specification List. +* &rest: Argument List. +* &rest (Edebug): Specification List. +* ' for quoting: Quoting. +* ( in regexp: Syntax of Regexps. +* (...) in lists: Cons Cell Type. +* ) in regexp: Syntax of Regexps. +* *: Arithmetic Operations. +* * in interactive: Using Interactive. +* * in regexp: Syntax of Regexps. +* *? in regexp: Syntax of Regexps. +* *PQfn: Unimplemented libpq Functions. +* *PQoidStatus: Unimplemented libpq Functions. +* *PQsetdb: Unimplemented libpq Functions. +* *PQsetdbLogin: Unimplemented libpq Functions. +* *scratch*: Auto Major Mode. +* +: Arithmetic Operations. +* + in regexp: Syntax of Regexps. +* +? in regexp: Syntax of Regexps. +* , (with Backquote): Backquote. +* ,@ (with Backquote): Backquote. +* -: Arithmetic Operations. +* . in lists: Dotted Pair Notation. +* . in regexp: Syntax of Regexps. +* .emacs: Init File. +* .emacs customization: Major Mode Conventions. +* /: Arithmetic Operations. +* /=: Comparison of Numbers. +* 1+: Arithmetic Operations. +* 1-: Arithmetic Operations. +* ; in comment: Comments. +* <: Comparison of Numbers. +* <=: Comparison of Numbers. +* : Functions for Key Lookup. +* =: Comparison of Numbers. +* >: Comparison of Numbers. +* >=: Comparison of Numbers. +* ? in character constant: Character Type. +* ? in regexp: Syntax of Regexps. +* @ in interactive: Using Interactive. +* [ in regexp: Syntax of Regexps. +* [...] (Edebug): Specification List. +* \ in character constant: Character Type. +* \ in display: Truncation. +* \ in printing: Output Functions. +* \ in regexp: Syntax of Regexps. +* \ in replacement: Replacing Match. +* \ in strings: String Type. +* \ in symbols: Symbol Type. +* \' in regexp: Syntax of Regexps. +* \(?: in regexp: Syntax of Regexps. +* \< in regexp: Syntax of Regexps. +* \= in regexp: Syntax of Regexps. +* \> in regexp: Syntax of Regexps. +* \` in regexp: Syntax of Regexps. +* \a: Character Type. +* \b: Character Type. +* \B in regexp: Syntax of Regexps. +* \b in regexp: Syntax of Regexps. +* \e: Character Type. +* \f: Character Type. +* \n: Character Type. +* \n in print: Output Variables. +* \N in replacement: Replacing Match. +* \r: Character Type. +* \S in regexp: Syntax of Regexps. +* \s in regexp: Syntax of Regexps. +* \t: Character Type. +* \v: Character Type. +* \W in regexp: Syntax of Regexps. +* \w in regexp: Syntax of Regexps. +* \{n,m\} in regexp: Syntax of Regexps. +* ] in regexp: Syntax of Regexps. +* ^ in regexp: Syntax of Regexps. +* _ in interactive: Using Interactive. +* `: Backquote. +* ` (Edebug): Debugging Backquote. +* ` (list substitution): Backquote. +* abbrev: Abbrevs. +* abbrev table: Abbrevs. +* abbrev tables in modes: Major Mode Conventions. +* abbrev-all-caps: Abbrev Expansion. +* abbrev-expansion: Abbrev Expansion. +* abbrev-file-name: Abbrev Files. +* abbrev-mode: Abbrev Mode. +* abbrev-prefix-mark: Abbrev Expansion. +* abbrev-start-location: Abbrev Expansion. +* abbrev-start-location-buffer: Abbrev Expansion. +* abbrev-symbol: Abbrev Expansion. +* abbrev-table-name-list: Abbrev Tables. +* abbreviate-file-name: Directory Names. +* abbrevs-changed: Abbrev Files. +* abort-recursive-edit: Recursive Editing. +* aborting: Recursive Editing. +* abs: Arithmetic Operations. +* absolute file name: Relative File Names. +* accelerate-menu: Menu Accelerator Functions. +* accept-process-output: Accepting Output. +* accessibility of a file: Testing Accessibility. +* accessible portion (of a buffer): Narrowing. +* accessible-keymaps: Scanning Keymaps. +* acos: Math Functions. +* acosh: Math Functions. +* activate-menubar-hook: Menubar. +* activate-popup-menu-hook: Pop-Up Menus. +* active display table: Active Display Table. +* active keymap: Active Keymaps. +* active-minibuffer-window: Minibuffer Misc. +* add-abbrev: Defining Abbrevs. +* add-hook: Hooks. +* add-menu: Modifying Menus. +* add-menu-button: Modifying Menus. +* add-menu-item: Modifying Menus. +* add-name-to-file: Changing File Attributes. +* add-spec-list-to-specifier: Adding Specifications. +* add-spec-to-specifier: Adding Specifications. +* add-submenu: Modifying Menus. +* add-text-properties: Changing Properties. +* add-timeout: Timers. +* add-to-list: Setting Variables. +* add-tooltalk-message-arg: Elisp Interface for Sending Messages. +* add-tooltalk-pattern-arg: Elisp Interface for Receiving Messages. +* add-tooltalk-pattern-attribute: Elisp Interface for Receiving Messages. +* address field of register: Cons Cell Type. +* after-change-function: Change Hooks. +* after-change-functions: Change Hooks. +* after-find-file: Subroutines of Visiting. +* after-init-hook: Init File. +* after-insert-file-functions: Saving Properties. +* after-load-alist: Hooks for Loading. +* after-revert-hook: Reverting. +* after-save-hook: Saving Buffers. +* aliases, for variables: Variable Aliases. +* alist: Association Lists. +* alist-to-plist: Converting Plists To/From Alists. +* all-annotations: Locating Annotations. +* all-completions: Basic Completion. +* and: Combining Conditions. +* annotation: Annotations. +* annotation hooks: Annotation Hooks. +* annotation-action: Annotation Properties. +* annotation-data: Annotation Properties. +* annotation-down-glyph: Annotation Properties. +* annotation-face: Annotation Properties. +* annotation-glyph: Annotation Properties. +* annotation-layout: Annotation Properties. +* annotation-list: Locating Annotations. +* annotation-menu: Annotation Properties. +* annotation-side: Annotation Properties. +* annotation-visible: Annotation Properties. +* annotation-width: Annotation Properties. +* annotationp: Annotation Primitives. +* annotations-at: Locating Annotations. +* annotations-in-region: Locating Annotations. +* anonymous function: Anonymous Functions. +* anonymous lambda expressions (Edebug): Instrumenting. +* apostrophe for quoting: Quoting. +* append: Building Lists. +* append-to-file: Writing to Files. +* apply: Calling Functions. +* apply, and debugging: Internals of Debugger. +* apropos: Help Functions. +* aref: Array Functions. +* argument binding: Argument List. +* argument descriptors: Using Interactive. +* argument evaluation form: Using Interactive. +* argument prompt: Using Interactive. +* arguments, reading: Minibuffers. +* arith-error example: Handling Errors. +* arith-error in division: Arithmetic Operations. +* arithmetic shift: Bitwise Operations. +* array: Arrays. +* array elements: Array Functions. +* arrayp: Array Functions. +* ASCII character codes: Character Type. +* aset: Array Functions. +* ash: Bitwise Operations. +* asin: Math Functions. +* asinh: Math Functions. +* ask-user-about-lock: File Locks. +* ask-user-about-supersession-threat: Modification Time. +* asking the user questions: Yes-or-No Queries. +* assoc: Association Lists. +* association list: Association Lists. +* assq: Association Lists. +* asynchronous subprocess: Asynchronous Processes. +* atan: Math Functions. +* atanh: Math Functions. +* atom <1>: List-related Predicates. +* atom: Cons Cell Type. +* atomic extent: Atomic Extents. +* atoms: List-related Predicates. +* attributes of text: Text Properties. +* Auto Fill mode: Auto Filling. +* auto-fill-function: Auto Filling. +* auto-lower-frame: Raising and Lowering. +* auto-mode-alist: Auto Major Mode. +* auto-raise-frame: Raising and Lowering. +* auto-save-default: Auto-Saving. +* auto-save-file-format: Format Conversion. +* auto-save-file-name-p: Auto-Saving. +* auto-save-hook: Auto-Saving. +* auto-save-interval: Auto-Saving. +* auto-save-list-file-name: Auto-Saving. +* auto-save-mode: Auto-Saving. +* auto-save-timeout: Auto-Saving. +* auto-save-visited-file-name: Auto-Saving. +* auto-saving: Auto-Saving. +* autoload <1>: Domain Specification. +* autoload: Autoload. +* autoload errors: Autoload. +* automatically buffer-local: Intro to Buffer-Local. +* available fonts: Font Instance Names. +* back-to-indentation: Motion by Indent. +* background pixmap: Merging Faces. +* backquote (Edebug): Debugging Backquote. +* backquote (list substitution): Backquote. +* backslash in character constant: Character Type. +* backslash in strings: String Type. +* backslash in symbols: Symbol Type. +* backspace: Character Type. +* backtrace: Internals of Debugger. +* backtrace-debug: Internals of Debugger. +* backtrace-frame: Internals of Debugger. +* backtracking: Backtracking. +* backup file: Backup Files. +* backup files, how to make them: Rename or Copy. +* backup-buffer: Making Backups. +* backup-by-copying: Rename or Copy. +* backup-by-copying-when-linked: Rename or Copy. +* backup-by-copying-when-mismatch: Rename or Copy. +* backup-enable-predicate: Making Backups. +* backup-file-name-p: Backup Names. +* backup-inhibited: Making Backups. +* backward-char: Character Motion. +* backward-delete-char-untabify: Deletion. +* backward-list: List Motion. +* backward-prefix-chars: Motion and Syntax. +* backward-sexp: List Motion. +* backward-to-indentation: Motion by Indent. +* backward-word: Word Motion. +* balancing parentheses: Blinking. +* barf-if-buffer-read-only: Read Only Buffers. +* base buffer: Indirect Buffers. +* base64: Transformations. +* base64-decode-region: Transformations. +* base64-decode-string: Transformations. +* base64-encode-region: Transformations. +* base64-encode-string: Transformations. +* batch mode: Batch Mode. +* batch-byte-compile: Compilation Functions. +* batch-byte-recompile-directory: Compilation Functions. +* beep: Beeping. +* beeping: Beeping. +* before point, insertion: Insertion. +* before-change-function: Change Hooks. +* before-change-functions: Change Hooks. +* before-init-hook: Init File. +* before-revert-hook: Reverting. +* beginning of line: Text Lines. +* beginning of line in regexp: Syntax of Regexps. +* beginning-of-buffer: Buffer End Motion. +* beginning-of-defun: List Motion. +* beginning-of-line: Text Lines. +* bell: Beeping. +* bell character: Character Type. +* bell-volume: Beeping. +* binary files and text files: Files and MS-DOS. +* binary-process-input: MS-DOS Subprocesses. +* binary-process-output: MS-DOS Subprocesses. +* bind-text-domain: Level 3 Primitives. +* binding arguments: Argument List. +* binding local variables: Local Variables. +* binding of a key: Keymap Terminology. +* bit vector: Bit Vectors. +* bit vector length: Sequence Functions. +* bit-vector: Bit Vector Functions. +* bit-vector-p: Bit Vector Functions. +* bitp: Bit Vector Functions. +* bitwise and: Bitwise Operations. +* bitwise exclusive or: Bitwise Operations. +* bitwise not: Bitwise Operations. +* bitwise or: Bitwise Operations. +* blink-matching-open: Blinking. +* blink-matching-paren: Blinking. +* blink-matching-paren-delay: Blinking. +* blink-matching-paren-distance: Blinking. +* blink-paren-function: Blinking. +* blink-paren-hook: Blinking. +* blinking: Blinking. +* bobp: Near Point. +* body of function: Lambda Components. +* bold: Font Instance Characteristics. +* bolp: Near Point. +* bookmark-map: Standard Keymaps. +* boolean: nil and t. +* boolean-specifier-p: Specifier Types. +* bootstrapping XEmacs from temacs: Building XEmacs. +* bottom-gutter: Specifying a Gutter. +* bottom-gutter-height: Other Gutter Variables. +* bottom-gutter-visible-p: Other Gutter Variables. +* bottom-toolbar: Specifying the Toolbar. +* bottom-toolbar-height: Other Toolbar Variables. +* bottom-toolbar-visible-p: Other Toolbar Variables. +* boundp: Void Variables. +* box diagrams, for lists: Cons Cell Type. +* box representation for lists: Lists as Boxes. +* break: Debugger. +* breakpoints: Breakpoints. +* bucket (in obarray): Creating Symbols. +* buffer: Buffers. +* buffer contents: Text. +* buffer file name: Buffer File Name. +* buffer input stream: Input Streams. +* buffer list: The Buffer List. +* buffer modification: Buffer Modification. +* buffer names: Buffer Names. +* buffer output stream: Output Streams. +* buffer text notation: Buffer Text Notation. +* buffer, read-only: Read Only Buffers. +* buffer-auto-save-file-name: Auto-Saving. +* buffer-backed-up: Making Backups. +* buffer-base-buffer: Indirect Buffers. +* buffer-disable-undo: Maintaining Undo. +* buffer-enable-undo: Maintaining Undo. +* buffer-end: Point. +* buffer-file-format: Format Conversion. +* buffer-file-name: Buffer File Name. +* buffer-file-number: Buffer File Name. +* buffer-file-truename: Buffer File Name. +* buffer-file-type: Files and MS-DOS. +* buffer-flush-undo: Maintaining Undo. +* buffer-glyph-p: Glyph Types. +* buffer-indirect-children: Indirect Buffers. +* buffer-invisibility-spec: Invisible Text. +* buffer-list: The Buffer List. +* buffer-live-p: Killing Buffers. +* buffer-local variables: Buffer-Local Variables. +* buffer-local variables in modes: Major Mode Conventions. +* buffer-local-variables: Creating Buffer-Local. +* Buffer-menu-mode-map: Standard Keymaps. +* buffer-modified-p: Buffer Modification. +* buffer-modified-tick: Buffer Modification. +* buffer-name: Buffer Names. +* buffer-offer-save <1>: Killing Buffers. +* buffer-offer-save: Saving Buffers. +* buffer-read-only: Read Only Buffers. +* buffer-saved-size <1>: Point. +* buffer-saved-size: Auto-Saving. +* buffer-size: Point. +* buffer-string: Buffer Contents. +* buffer-substring: Buffer Contents. +* buffer-undo-list: Undo. +* bufferp: Buffer Basics. +* buffers menu: Buffers Menu. +* buffers, controlled in windows: Buffers and Windows. +* buffers, creating: Creating Buffers. +* buffers, killing: Killing Buffers. +* buffers-menu-filter: Menu Filters. +* buffers-menu-max-size: Buffers Menu. +* buffers-menu-switch-to-buffer-function: Buffers Menu. +* building lists: Building Lists. +* building XEmacs: Building XEmacs. +* built-in function: What Is a Function. +* bury-buffer: The Buffer List. +* busy-pointer-glyph: Mouse Pointer. +* button-event-p: Event Predicates. +* button-press-event-p: Event Predicates. +* button-release-event-p: Event Predicates. +* bvconcat: Bit Vector Functions. +* byte-code <1>: Compilation Functions. +* byte-code: Byte Compilation. +* byte-code function: Compiled-Function Objects. +* byte-code interpreter: Compilation Functions. +* byte-compile: Compilation Functions. +* byte-compile-dynamic: Dynamic Loading. +* byte-compile-dynamic-docstrings: Docs and Compilation. +* byte-compile-file: Compilation Functions. +* byte-compiling macros: Compiling Macros. +* byte-compiling require: Named Features. +* byte-recompile-directory: Compilation Functions. +* byte-recompile-directory-ignore-errors-p: Compilation Functions. +* bytes: Strings and Characters. +* c++-mode-map: Standard Keymaps. +* C-c: Prefix Keys. +* C-g: Quitting. +* C-h: Prefix Keys. +* C-M-x: Instrumenting. +* c-mode-abbrev-table: Standard Abbrev Tables. +* c-mode-map: Standard Keymaps. +* c-mode-syntax-table: Standard Syntax Tables. +* C-q: Flow Control. +* C-s: Flow Control. +* C-x: Prefix Keys. +* C-x 4: Prefix Keys. +* C-x 5: Prefix Keys. +* C-x a: Prefix Keys. +* C-x n: Prefix Keys. +* C-x r: Prefix Keys. +* caaaar: List Elements. +* caaadr: List Elements. +* caaar: List Elements. +* caadar: List Elements. +* caaddr: List Elements. +* caadr: List Elements. +* caar: List Elements. +* cadaar: List Elements. +* cadadr: List Elements. +* cadar: List Elements. +* caddar: List Elements. +* cadddr: List Elements. +* caddr: List Elements. +* cadr: List Elements. +* call stack: Internals of Debugger. +* call-interactively: Interactive Call. +* call-process: Synchronous Processes. +* call-process-region: Synchronous Processes. +* calling a function: Calling Functions. +* cancel-debug-on-entry: Function Debugging. +* canonicalize-inst-list: Adding Specifications. +* canonicalize-inst-pair: Adding Specifications. +* canonicalize-lax-plist: Working With Lax Plists. +* canonicalize-plist: Working With Normal Plists. +* canonicalize-spec: Adding Specifications. +* canonicalize-spec-list: Adding Specifications. +* canonicalize-tag-set: Specifier Tag Functions. +* capitalization: Character Case. +* capitalize: Character Case. +* capitalize-region: Case Changes. +* capitalize-word: Case Changes. +* car: List Elements. +* car-safe: List Elements. +* case changes: Case Changes. +* case in replacements: Replacing Match. +* case-fold-search: Searching and Case. +* case-replace: Searching and Case. +* case-table-p: Case Tables. +* catch: Catch and Throw. +* category-designator-p: Category Tables. +* category-table: Category Tables. +* category-table-p: Category Tables. +* category-table-value-p: Category Tables. +* CBREAK: Flow Control. +* ccl-elapsed-time: Calling CCL. +* ccl-execute: Calling CCL. +* ccl-execute-on-string: Calling CCL. +* ccl-reset-elapsed-time: Calling CCL. +* cdaaar: List Elements. +* cdaadr: List Elements. +* cdaar: List Elements. +* cdadar: List Elements. +* cdaddr: List Elements. +* cdadr: List Elements. +* cdar: List Elements. +* cddaar: List Elements. +* cddadr: List Elements. +* cddar: List Elements. +* cdddar: List Elements. +* cddddr: List Elements. +* cdddr: List Elements. +* cddr: List Elements. +* CDE dt: CDE dt. +* cdr: List Elements. +* cdr-safe: List Elements. +* ceiling: Numeric Conversions. +* centering point: Vertical Scrolling. +* cerror: Signaling Errors. +* change hooks: Change Hooks. +* change-major-mode-hook: Major Mode Conventions. +* changing key bindings: Changing Key Bindings. +* changing to another buffer: Current Buffer. +* changing window size: Resizing Windows. +* char table type: Char Table Type. +* char-after: Near Point. +* char-before: Near Point. +* char-charset: MULE Characters. +* char-equal: Text Comparison. +* char-int: Character Codes. +* char-int confoundance disease: Character Type. +* char-int-p: Character Codes. +* char-octet: MULE Characters. +* char-or-char-int-p: Character Codes. +* char-or-string-p: Predicates for Strings. +* char-syntax: Syntax Table Functions. +* char-table-p: Char Tables. +* char-table-type: Char Table Types. +* char-table-type-list: Char Table Types. +* char-to-string: String Conversion. +* char=: Text Comparison. +* character arrays: Strings and Characters. +* character case: Character Case. +* character descriptor: Character Descriptors. +* character insertion: Commands for Insertion. +* character printing: Describing Characters. +* character set (in regexp): Syntax of Regexps. +* character to string: String Conversion. +* character-to-event: Converting Events. +* characteristics of font instances: Font Instance Characteristics. +* characterp: Predicates for Characters. +* characters: Strings and Characters. +* characters for interactive codes: Interactive Codes. +* character quote: Syntax Class Table. +* charset type: Charset Type. +* charset-ccl-program: Charset Property Functions. +* charset-chars: Charset Property Functions. +* charset-columns: Charset Property Functions. +* charset-dimension: Charset Property Functions. +* charset-direction: Charset Property Functions. +* charset-doc-string: Charset Property Functions. +* charset-final: Charset Property Functions. +* charset-from-attributes: Basic Charset Functions. +* charset-graphic: Charset Property Functions. +* charset-list: Basic Charset Functions. +* charset-name: Charset Property Functions. +* charset-property: Charset Property Functions. +* charset-registry: Charset Property Functions. +* charset-reverse-direction-charset: Basic Charset Functions. +* charsetp: Charsets. +* check-argument-type: Signaling Errors. +* check-gutter-button-syntax: Gutter Descriptor Format. +* check-toolbar-button-syntax: Toolbar Descriptor Format. +* check-valid-char-table-value: Working With Char Tables. +* check-valid-inst-list: Specifier Validation Functions. +* check-valid-instantiator: Specifier Validation Functions. +* check-valid-plist: Property Lists. +* check-valid-spec-list: Specifier Validation Functions. +* child process: Processes. +* children, of extent: Extent Parents. +* CL note--allocate more storage: Garbage Collection. +* CL note--case of letters: Symbol Type. +* CL note--default optional arg: Argument List. +* CL note--integers vrs eq: Comparison of Numbers. +* CL note--lack union, set: Sets And Lists. +* CL note--only throw in Emacs: Catch and Throw. +* CL note--rplaca vrs setcar: Modifying Lists. +* CL note--set local: Setting Variables. +* CL note--special forms compared: Special Forms. +* CL note--special variables: Variable Scoping. +* CL note--symbol in obarrays: Creating Symbols. +* cl-read: Reading in Edebug. +* cl-specs.el: Instrumenting. +* cl.el (Edebug): Instrumenting. +* cleanup forms: Cleanups. +* clear-abbrev-table: Abbrev Tables. +* clear-message: The Echo Area. +* clear-range-table: Working With Range Tables. +* clear-visited-file-modtime: Modification Time. +* close parenthesis: Blinking. +* close-database: Connecting to a Database. +* close parenthesis character: Syntax Class Table. +* closures not available: Extent. +* clrhash: Working With Hash Tables. +* codes, interactive, description of: Interactive Codes. +* coding standards: Tips. +* coding system type: Coding System Type. +* coding-category-list: Detection of Textual Encoding. +* coding-category-system: Detection of Textual Encoding. +* coding-priority-list: Detection of Textual Encoding. +* coding-system-base: Basic Coding System Functions. +* coding-system-doc-string: Coding System Property Functions. +* coding-system-list: Basic Coding System Functions. +* coding-system-name: Basic Coding System Functions. +* coding-system-p: Coding Systems. +* coding-system-property: Coding System Property Functions. +* coding-system-type: Coding System Property Functions. +* color instance type: Color Instance Type. +* color instances: Color Instances. +* color-instance-name: Color Instance Properties. +* color-instance-p: Color Instances. +* color-instance-rgb-components: Color Instance Properties. +* color-name: Color Convenience Functions. +* color-pixmap-image-instance-p: Image Instance Types. +* color-rgb-components: Color Convenience Functions. +* color-specifier-p <1>: Color Specifiers. +* color-specifier-p: Specifier Types. +* colorize-image-instance: Image Instance Functions. +* colors: Colors. +* columns: Columns. +* command: What Is a Function. +* command descriptions: A Sample Function Description. +* command history: Command History. +* command in keymap: Key Lookup. +* command line arguments: Command Line Arguments. +* command line options: Command Line Arguments. +* command loop: Command Loop. +* command loop, recursive: Recursive Editing. +* command-debug-status: Internals of Debugger. +* command-execute: Interactive Call. +* command-history: Command History. +* command-history-map: Standard Keymaps. +* command-line: Command Line Arguments. +* command-line-args: Command Line Arguments. +* command-line-functions: Command Line Arguments. +* command-line-processed: Command Line Arguments. +* command-switch-alist: Command Line Arguments. +* commandp: Interactive Call. +* commandp example: High-Level Completion. +* commands, defining: Defining Commands. +* comment syntax: Syntax Class Table. +* comments: Comments. +* comment ender: Syntax Class Table. +* comment starter: Syntax Class Table. +* Common Lisp: Lisp History. +* Common Lisp (Edebug): Instrumenting. +* compare-buffer-substrings: Comparing Text. +* comparing buffer text: Comparing Text. +* comparison of modification time: Modification Time. +* compilation: Byte Compilation. +* compilation functions: Compilation Functions. +* compile-defun: Compilation Functions. +* compiled function: Compiled-Function Objects. +* compiled-function-arglist: Compiled-Function Objects. +* compiled-function-constants: Compiled-Function Objects. +* compiled-function-doc-string: Compiled-Function Objects. +* compiled-function-domain: Compiled-Function Objects. +* compiled-function-instructions: Compiled-Function Objects. +* compiled-function-interactive: Compiled-Function Objects. +* compiled-function-p: What Is a Function. +* compiled-function-stack-size: Compiled-Function Objects. +* complete key: Keymap Terminology. +* completing-read: Minibuffer Completion. +* completion: Completion. +* completion, file name: File Name Completion. +* completion, user name: User Name Completion. +* completion-auto-help: Completion Commands. +* completion-ignore-case: Basic Completion. +* completion-ignored-extensions: File Name Completion. +* complex arguments: Minibuffers. +* complex command: Command History. +* complex-buffers-menu-p: Buffers Menu. +* compose-region: Composite Characters. +* composite-char-string: Composite Characters. +* concat: Creating Strings. +* concatenating lists: Rearrangement. +* concatenating strings: Creating Strings. +* cond: Conditionals. +* condition name: Error Symbols. +* condition-case: Handling Errors. +* conditional evaluation: Conditionals. +* cons: Building Lists. +* cons cell as box: Lists as Boxes. +* cons cells: Building Lists. +* consing: Building Lists. +* console-device-list: Basic Console Functions. +* console-disable-input: Console and Device I/O. +* console-enable-input: Console and Device I/O. +* console-list: Basic Console Functions. +* console-live-p: Connecting to a Console or Device. +* console-type-image-conversion-list: Image Instantiator Conversion. +* consolep: Consoles and Devices. +* consoles: Consoles and Devices. +* consp: List-related Predicates. +* continuation lines: Truncation. +* continuation-glyph: Redisplay Glyphs. +* continue-process: Signals to Processes. +* control character printing: Describing Characters. +* control characters: Character Type. +* control characters in display: Usual Display. +* control characters, reading: Quoted Character Input. +* control structures: Control Structures. +* control-arrow-glyph: Redisplay Glyphs. +* Control-X-prefix: Prefix Keys. +* conventions for writing minor modes: Minor Mode Conventions. +* conversion of image instantiators: Image Instantiator Conversion. +* conversion of strings: String Conversion. +* copy-alist: Association Lists. +* copy-category-table: Category Tables. +* copy-coding-system: Basic Coding System Functions. +* copy-event: Working With Events. +* copy-extent: Detached Extents. +* copy-face: Basic Face Functions. +* copy-file: Changing File Attributes. +* copy-hash-table: Introduction to Hash Tables. +* copy-keymap: Creating Keymaps. +* copy-marker: Creating Markers. +* copy-range-table: Introduction to Range Tables. +* copy-region-as-kill: Kill Functions. +* copy-sequence: Sequence Functions. +* copy-specifier: Other Specification Functions. +* copy-syntax-table: Syntax Table Functions. +* copying alists: Association Lists. +* copying bit vectors: Bit Vector Functions. +* copying files: Changing File Attributes. +* copying lists: Building Lists. +* copying sequences: Sequence Functions. +* copying strings: Creating Strings. +* copying vectors: Vector Functions. +* cos: Math Functions. +* cosh: Math Functions. +* count-lines: Text Lines. +* count-loop: A Sample Function Description. +* counting columns: Columns. +* coverage testing: Coverage Testing. +* create-device-hook: Connecting to a Console or Device. +* create-file-buffer: Subroutines of Visiting. +* create-frame-hook: Frame Hooks. +* create-tooltalk-message: Elisp Interface for Sending Messages. +* create-tooltalk-pattern: Elisp Interface for Receiving Messages. +* creating buffers: Creating Buffers. +* creating keymaps: Creating Keymaps. +* ctl-arrow: Usual Display. +* ctl-x-4-map <1>: Standard Keymaps. +* ctl-x-4-map: Prefix Keys. +* ctl-x-5-map <1>: Standard Keymaps. +* ctl-x-5-map: Prefix Keys. +* ctl-x-map <1>: Standard Keymaps. +* ctl-x-map: Prefix Keys. +* cube-root: Math Functions. +* current binding: Local Variables. +* current buffer: Current Buffer. +* current buffer excursion: Excursions. +* current buffer mark: The Mark. +* current buffer point and mark (Edebug): Edebug Display Update. +* current buffer position: Point. +* current command: Command Loop Info. +* current stack frame: Using Debugger. +* current-buffer: Current Buffer. +* current-case-table: Case Tables. +* current-column: Columns. +* current-fill-column: Margins. +* current-frame-configuration: Frame Configurations. +* current-global-map: Active Keymaps. +* current-indentation: Primitive Indent. +* current-input-mode: Input Modes. +* current-justification: Filling. +* current-keymaps: Active Keymaps. +* current-kill: Low-Level Kill Ring. +* current-left-margin: Margins. +* current-local-map: Active Keymaps. +* current-menubar: Menubar. +* current-message: The Echo Area. +* current-minor-mode-maps: Active Keymaps. +* current-mouse-event: Command Loop Info. +* current-prefix-arg: Prefix Command Arguments. +* current-time: Time of Day. +* current-time-string: Time of Day. +* current-time-zone: Time of Day. +* current-window-configuration: Window Configurations. +* cursor (mouse): Mouse Pointer. +* cursor-in-echo-area: The Echo Area. +* cust-print: Printing in Edebug. +* cut buffer: X Selections. +* cyclic ordering of windows: Cyclic Window Ordering. +* data type: Lisp Data Types. +* data-directory: Accessing Documentation. +* database: Databases. +* database type: Database Type. +* database-file-name: Other Database Functions. +* database-last-error: Other Database Functions. +* database-live-p: Connecting to a Database. +* database-subtype: Other Database Functions. +* database-type: Other Database Functions. +* databasep: Databases. +* deallocate-event: Working With Events. +* debug: Invoking the Debugger. +* debug-allocation: Garbage Collection. +* debug-allocation-backtrace: Garbage Collection. +* debug-ignored-errors: Error Debugging. +* debug-on-entry: Function Debugging. +* debug-on-error: Error Debugging. +* debug-on-error use: Processing of Errors. +* debug-on-next-call: Internals of Debugger. +* debug-on-quit: Infinite Loops. +* debug-on-signal: Error Debugging. +* debug-on-signal use: Handling Errors. +* debugger <1>: Internals of Debugger. +* debugger: Debugger. +* debugger command list: Debugger Commands. +* debugger-mode-map: Standard Keymaps. +* debugging errors: Error Debugging. +* debugging specific functions: Function Debugging. +* decode-big5-char: Big5 and Shift-JIS Functions. +* decode-coding-region: Encoding and Decoding Text. +* decode-shift-jis-char: Big5 and Shift-JIS Functions. +* decode-time: Time Conversion. +* decoding file formats: Format Conversion. +* decompose-region: Composite Characters. +* decrement field of register: Cons Cell Type. +* dedicated window: Choosing Window. +* deep binding: Impl of Scope. +* def-edebug-spec: Instrumenting Macro Calls. +* defalias: Defining Functions. +* default argument string: Interactive Codes. +* default init file: Init File. +* default value: Default Value. +* default-abbrev-mode: Abbrev Mode. +* default-boundp: Default Value. +* default-buffer-file-type: Files and MS-DOS. +* default-case-fold-search: Searching and Case. +* default-ctl-arrow: Usual Display. +* default-deselect-frame-hook: Raising and Lowering. +* default-directory: File Name Expansion. +* default-file-modes: Changing File Attributes. +* default-fill-column: Margins. +* default-frame-name: Frame Name. +* default-frame-plist: Initial Properties. +* default-gutter: Specifying a Gutter. +* default-gutter-height: Other Gutter Variables. +* default-gutter-position: Specifying a Gutter. +* default-gutter-visible-p: Other Gutter Variables. +* default-gutter-width: Other Gutter Variables. +* default-justification: Filling. +* default-major-mode: Auto Major Mode. +* default-menubar: Menubar. +* default-minibuffer-frame: Minibuffers and Frames. +* default-modeline-format: Modeline Variables. +* default-popup-menu: Pop-Up Menus. +* default-select-frame-hook: Raising and Lowering. +* default-text-properties: Examining Properties. +* default-toolbar: Specifying the Toolbar. +* default-toolbar-height: Other Toolbar Variables. +* default-toolbar-position: Specifying the Toolbar. +* default-toolbar-visible-p: Other Toolbar Variables. +* default-toolbar-width: Other Toolbar Variables. +* default-truncate-lines: Truncation. +* default-value: Default Value. +* default-x-device: Resources. +* default.el: Start-up Summary. +* defconst <1>: Domain Specification. +* defconst: Defining Variables. +* defcustom: Variable Definitions. +* defgroup: Group Definitions. +* define-abbrev: Defining Abbrevs. +* define-abbrev-table: Abbrev Tables. +* define-derived-mode: Derived Modes. +* define-error: Error Symbols. +* define-function: Defining Functions. +* define-key: Changing Key Bindings. +* define-logical-name: Changing File Attributes. +* define-obsolete-function-alias: Obsoleteness. +* define-obsolete-variable-alias: Obsoleteness. +* define-prefix-command: Prefix Keys. +* define-specifier-tag: Specifier Tag Functions. +* defining a function: Defining Functions. +* defining commands: Defining Commands. +* defining-kbd-macro: Keyboard Macros. +* definition of a symbol: Definitions. +* defmacro: Defining Macros. +* defsubst: Inline Functions. +* defun: Defining Functions. +* defun-prompt-regexp: List Motion. +* defvar <1>: Domain Specification. +* defvar: Defining Variables. +* defvaralias: Variable Aliases. +* deiconify-frame: Visibility of Frames. +* delete: Sets And Lists. +* delete previous char: Deletion. +* delete-annotation: Annotation Primitives. +* delete-auto-save-file-if-necessary: Auto-Saving. +* delete-auto-save-files: Auto-Saving. +* delete-backward-char: Deletion. +* delete-blank-lines: User-Level Deletion. +* delete-char: Deletion. +* delete-device: Connecting to a Console or Device. +* delete-device-hook: Connecting to a Console or Device. +* delete-directory: Create/Delete Dirs. +* delete-exited-processes: Deleting Processes. +* delete-extent: Creating and Modifying Extents. +* delete-file: Changing File Attributes. +* delete-frame: Deleting Frames. +* delete-frame-hook: Frame Hooks. +* delete-horizontal-space: User-Level Deletion. +* delete-indentation: User-Level Deletion. +* delete-menu-item: Modifying Menus. +* delete-old-versions: Numbered Backups. +* delete-other-windows: Deleting Windows. +* delete-process: Deleting Processes. +* delete-region: Deletion. +* delete-to-left-margin: Margins. +* delete-window: Deleting Windows. +* delete-windows-on: Deleting Windows. +* deleting files: Changing File Attributes. +* deleting processes: Deleting Processes. +* deleting whitespace: User-Level Deletion. +* deleting windows: Deleting Windows. +* deletion of elements: Sets And Lists. +* deletion of frames: Deleting Frames. +* deletion vs killing: Deletion. +* delq: Sets And Lists. +* demibold: Font Instance Characteristics. +* describe-bindings: Scanning Keymaps. +* describe-bindings-internal: Scanning Keymaps. +* describe-buffer-case-table: Case Tables. +* describe-mode: Mode Help. +* describe-prefix-bindings: Help Functions. +* describe-tooltalk-message: Elisp Interface for Receiving Messages. +* description for interactive codes: Interactive Codes. +* description format: Format of Descriptions. +* deselect-frame-hook: Frame Hooks. +* destroy-tooltalk-message: Elisp Interface for Sending Messages. +* destroy-tooltalk-pattern: Elisp Interface for Receiving Messages. +* destructive-alist-to-plist: Converting Plists To/From Alists. +* destructive-plist-to-alist: Converting Plists To/From Alists. +* detach-extent: Detached Extents. +* detached extent: Detached Extents. +* detect-coding-region: Detection of Textual Encoding. +* device-baud-rate <1>: Terminal Output. +* device-baud-rate: Console and Device I/O. +* device-class: Console Types and Device Classes. +* device-frame-list <1>: Basic Device Functions. +* device-frame-list: Finding All Frames. +* device-list: Basic Device Functions. +* device-live-p: Connecting to a Console or Device. +* device-matches-specifier-tag-set-p: Specifier Tag Functions. +* device-matching-specifier-tag-list: Specifier Tag Functions. +* device-or-frame-p: Basic Device Functions. +* device-or-frame-type: Console Types and Device Classes. +* device-type: Console Types and Device Classes. +* device-x-display: Connecting to a Console or Device. +* devicep: Consoles and Devices. +* devices: Consoles and Devices. +* dgettext: Level 3 Primitives. +* diagrams, boxed, for lists: Cons Cell Type. +* dialog box: Dialog Boxes. +* digit-argument: Prefix Command Arguments. +* ding: Beeping. +* directory name: Directory Names. +* directory name abbreviation: Directory Names. +* directory part (of file name): File Name Components. +* directory-abbrev-alist: Directory Names. +* directory-file-name: Directory Names. +* directory-files: Contents of Directories. +* directory-oriented functions: Contents of Directories. +* dired-kept-versions: Numbered Backups. +* dired-mode-map: Standard Keymaps. +* disable undo: Maintaining Undo. +* disable-command: Disabling Commands. +* disable-menu-item: Modifying Menus. +* disable-timeout: Timers. +* disabled: Disabling Commands. +* disabled command: Disabling Commands. +* disabled-command-hook: Disabling Commands. +* disassemble: Disassembly. +* disassembled byte-code: Disassembly. +* discard input: Peeking and Discarding. +* discard-input: Peeking and Discarding. +* dispatch-event: Dispatching an Event. +* dispatching an event: Dispatching an Event. +* display columns: Size and Position. +* display lines: Size and Position. +* display order: Extent Endpoints. +* display table: Display Tables. +* display update: Refresh Screen. +* display-buffer: Choosing Window. +* display-buffer-function: Choosing Window. +* display-completion-list: Completion Commands. +* display-error: Processing of Errors. +* display-message: The Echo Area. +* display-warning: Warnings. +* display-warning-minimum-level: Warnings. +* display-warning-suppressed-classes: Warnings. +* displaying a buffer: Displaying Buffers. +* do-auto-save: Auto-Saving. +* DOC (documentation) file: Documentation Basics. +* doc-directory: Accessing Documentation. +* documentation: Accessing Documentation. +* documentation conventions: Documentation Basics. +* documentation for major mode: Mode Help. +* documentation notation: Evaluation Notation. +* documentation of function: Function Documentation. +* documentation strings: Documentation. +* documentation, keys in: Keys in Documentation. +* documentation-property: Accessing Documentation. +* domain: Level 3 Primitives. +* domain (in a specifier): Specifiers In-Depth. +* domain-of: Level 3 Primitives. +* dotted lists (Edebug): Specification List. +* dotted pair notation: Dotted Pair Notation. +* double-quote in strings: String Type. +* down-list: List Motion. +* downcase: Character Case. +* downcase-region: Case Changes. +* downcase-word: Case Changes. +* downcasing in lookup-key: Key Sequence Input. +* drag: Drag Interface. +* drag and drop: Drag and Drop. +* Drag API: Drag Interface. +* dribble file: Recording Input. +* drop: Drop Interface. +* Drop API: Drop Interface. +* dump-emacs: Building XEmacs. +* duplicable extent: Duplicable Extents. +* dynamic loading of documentation: Docs and Compilation. +* dynamic loading of functions: Dynamic Loading. +* dynamic scoping: Variable Scoping. +* echo area: The Echo Area. +* echo-keystrokes <1>: The Echo Area. +* echo-keystrokes: Command Loop Info. +* edebug: Embedded Breakpoints. +* Edebug: Edebug. +* Edebug execution modes: Edebug Execution Modes. +* Edebug mode: Edebug. +* Edebug specification list: Specification List. +* edebug-`: Debugging Backquote. +* edebug-all-defs <1>: Edebug Options. +* edebug-all-defs: Instrumenting. +* edebug-all-forms <1>: Edebug Options. +* edebug-all-forms: Instrumenting. +* edebug-continue-kbd-macro: Edebug Options. +* edebug-display-freq-count: Coverage Testing. +* edebug-eval-top-level-form: Instrumenting. +* edebug-global-break-condition <1>: Edebug Options. +* edebug-global-break-condition: Global Break Condition. +* edebug-initial-mode: Edebug Options. +* edebug-on-error <1>: Edebug Options. +* edebug-on-error: Trapping Errors. +* edebug-on-quit <1>: Edebug Options. +* edebug-on-quit: Trapping Errors. +* edebug-print-circle <1>: Edebug Options. +* edebug-print-circle: Printing in Edebug. +* edebug-print-length <1>: Edebug Options. +* edebug-print-length: Printing in Edebug. +* edebug-print-level <1>: Edebug Options. +* edebug-print-level: Printing in Edebug. +* edebug-print-trace-after <1>: Edebug Options. +* edebug-print-trace-after: Tracing. +* edebug-print-trace-before <1>: Edebug Options. +* edebug-print-trace-before: Tracing. +* edebug-save-displayed-buffer-points <1>: Edebug Options. +* edebug-save-displayed-buffer-points: Edebug Display Update. +* edebug-save-windows <1>: Edebug Options. +* edebug-save-windows: Edebug Display Update. +* edebug-set-global-break-condition: Global Break Condition. +* edebug-setup-hook: Edebug Options. +* edebug-test-coverage: Edebug Options. +* edebug-trace <1>: Edebug Options. +* edebug-trace: Tracing. +* edebug-tracing: Tracing. +* edebug-unwrap: Specification List. +* edebug-unwrap-results <1>: Edebug Options. +* edebug-unwrap-results: Debugging Backquote. +* edit-abbrevs-map: Standard Keymaps. +* edit-and-eval-command: Object from Minibuffer. +* edit-menu-filter: Menu Filters. +* edit-tab-stops-map: Standard Keymaps. +* editing types: Editing Types. +* editor command loop: Command Loop. +* eighth: List Elements. +* electric-buffer-menu-mode-map: Standard Keymaps. +* electric-future-map: A Sample Variable Description. +* electric-history-map: Standard Keymaps. +* element (of list): Lists. +* elements of sequences: Sequence Functions. +* elt: Sequence Functions. +* emacs-build-time: Building XEmacs. +* emacs-lisp-mode-map: Standard Keymaps. +* emacs-lisp-mode-syntax-table: Standard Syntax Tables. +* emacs-major-version: Building XEmacs. +* emacs-minor-version: Building XEmacs. +* emacs-pid: System Environment. +* emacs-version: Building XEmacs. +* EMACSLOADPATH environment variable: How Programs Do Loading. +* embedded breakpoints: Embedded Breakpoints. +* empty list: Cons Cell Type. +* enable-command: Disabling Commands. +* enable-flow-control: Flow Control. +* enable-flow-control-on: Flow Control. +* enable-local-eval: Auto Major Mode. +* enable-local-variables: Auto Major Mode. +* enable-menu-item: Modifying Menus. +* enable-recursive-minibuffers: Minibuffer Misc. +* encode-big5-char: Big5 and Shift-JIS Functions. +* encode-coding-region: Encoding and Decoding Text. +* encode-shift-jis-char: Big5 and Shift-JIS Functions. +* encode-time: Time Conversion. +* encoding file formats: Format Conversion. +* end of buffer marker: Creating Markers. +* end-of-buffer: Buffer End Motion. +* end-of-defun: List Motion. +* end-of-file: Input Functions. +* end-of-line: Text Lines. +* enlarge-window: Resizing Windows. +* enlarge-window-horizontally: Resizing Windows. +* enlarge-window-pixels: Resizing Windows. +* enqueue-eval-event: Reading One Event. +* environment: Intro Eval. +* environment variable access: System Environment. +* environment variables, subprocesses: Subprocess Creation. +* eobp: Near Point. +* eolp: Near Point. +* eq: Equality Predicates. +* equal: Equality Predicates. +* equality: Equality Predicates. +* erase-buffer: Deletion. +* error: Signaling Errors. +* error cleanup: Cleanups. +* error debugging: Error Debugging. +* error display: The Echo Area. +* error handler: Handling Errors. +* error in debug: Invoking the Debugger. +* error message notation: Error Messages. +* error name: Error Symbols. +* error symbol: Error Symbols. +* error-conditions: Error Symbols. +* error-message-string: Processing of Errors. +* errors: Errors. +* esc-map: Prefix Keys. +* ESC-prefix: Prefix Keys. +* escape <1>: Syntax Class Table. +* escape: Character Type. +* escape characters: Output Variables. +* escape characters in printing: Output Functions. +* escape sequence: Character Type. +* eval: Eval. +* eval, and debugging: Internals of Debugger. +* eval-and-compile: Eval During Compile. +* eval-buffer: Eval. +* eval-current-buffer (Edebug): Instrumenting. +* eval-defun (Edebug): Instrumenting. +* eval-event-p: Event Predicates. +* eval-expression (Edebug): Instrumenting. +* eval-minibuffer: Object from Minibuffer. +* eval-region: Eval. +* eval-region (Edebug): Instrumenting. +* eval-when-compile: Eval During Compile. +* evaluated expression argument: Interactive Codes. +* evaluation: Evaluation. +* evaluation error: Local Variables. +* evaluation list (Edebug): Eval List. +* evaluation notation: Evaluation Notation. +* evaluation of buffer contents: Eval. +* event printing: Describing Characters. +* event-buffer: Window-Level Event Position Info. +* event-button: Accessing Other Event Info. +* event-closest-point: Event Text Position Info. +* event-device: Accessing Other Event Info. +* event-frame: Frame-Level Event Position Info. +* event-function: Accessing Other Event Info. +* event-glyph-extent: Event Glyph Position Info. +* event-glyph-x-pixel: Event Glyph Position Info. +* event-glyph-y-pixel: Event Glyph Position Info. +* event-key: Accessing Other Event Info. +* event-live-p: Event Predicates. +* event-matches-key-specifier-p: Key Sequences. +* event-modifier-bits: Accessing Other Event Info. +* event-modifiers: Accessing Other Event Info. +* event-object: Accessing Other Event Info. +* event-over-border-p: Other Event Position Info. +* event-over-glyph-p: Event Glyph Position Info. +* event-over-modeline-p: Event Text Position Info. +* event-over-text-area-p: Event Text Position Info. +* event-over-toolbar-p: Event Toolbar Position Info. +* event-point: Event Text Position Info. +* event-process: Accessing Other Event Info. +* event-timestamp: Accessing Other Event Info. +* event-to-character: Converting Events. +* event-toolbar-button: Event Toolbar Position Info. +* event-type: Event Contents. +* event-window: Window-Level Event Position Info. +* event-window-x-pixel: Window-Level Event Position Info. +* event-window-y-pixel: Window-Level Event Position Info. +* event-x: Event Text Position Info. +* event-x-pixel: Frame-Level Event Position Info. +* event-y: Event Text Position Info. +* event-y-pixel: Frame-Level Event Position Info. +* eventp: Events. +* events: Events. +* events-to-keys: Converting Events. +* examining windows: Buffers and Windows. +* examples of using interactive: Interactive Examples. +* exchange-point-and-mark: The Mark. +* excursion: Excursions. +* exec-directory: Subprocess Creation. +* exec-path: Subprocess Creation. +* execute program: Subprocess Creation. +* execute with prefix argument: Interactive Call. +* execute-extended-command: Interactive Call. +* execute-kbd-macro: Keyboard Macros. +* executing-macro: Keyboard Macros. +* execution speed: Compilation Tips. +* exit: Recursive Editing. +* exit recursive editing: Recursive Editing. +* exit-minibuffer: Minibuffer Misc. +* exit-recursive-edit: Recursive Editing. +* exiting XEmacs: Getting Out. +* exp: Math Functions. +* expand-abbrev: Abbrev Expansion. +* expand-file-name: File Name Expansion. +* expansion of file names: File Name Expansion. +* expansion of macros: Expansion. +* expression: Intro Eval. +* expression prefix: Syntax Class Table. +* expt: Math Functions. +* extended-command-history: Minibuffer History. +* extent <1>: Extents. +* extent: Variable Scoping. +* extent children: Extent Parents. +* extent end position: Extent Endpoints. +* extent endpoint: Extent Endpoints. +* extent order: Extent Endpoints. +* extent parent: Extent Parents. +* extent priority: Intro to Extents. +* extent property: Extent Properties. +* extent replica: Duplicable Extents. +* extent start position: Extent Endpoints. +* extent, duplicable: Duplicable Extents. +* extent, unique: Duplicable Extents. +* extent-at: Finding Extents. +* extent-begin-glyph: Extent Properties. +* extent-begin-glyph-layout: Extent Properties. +* extent-children: Extent Parents. +* extent-descendants: Extent Parents. +* extent-detached-p: Detached Extents. +* extent-end-glyph: Extent Properties. +* extent-end-glyph-layout: Extent Properties. +* extent-end-position: Extent Endpoints. +* extent-face: Extent Properties. +* extent-in-region-p: Mapping Over Extents. +* extent-keymap: Extent Properties. +* extent-length: Extent Endpoints. +* extent-list: Finding Extents. +* extent-live-p: Creating and Modifying Extents. +* extent-mouse-face: Extent Properties. +* extent-object: Creating and Modifying Extents. +* extent-parent: Extent Parents. +* extent-priority: Extent Properties. +* extent-properties: Extent Properties. +* extent-property: Extent Properties. +* extent-start-position: Extent Endpoints. +* extentp: Extents. +* extents, locating: Finding Extents. +* extents, mapping: Mapping Over Extents. +* face type: Face Type. +* face-background: Face Convenience Functions. +* face-background-instance: Face Convenience Functions. +* face-background-pixmap: Face Convenience Functions. +* face-background-pixmap-instance: Face Convenience Functions. +* face-boolean-specifier-p: Specifier Types. +* face-differs-from-default-p: Other Face Display Functions. +* face-equal: Other Face Display Functions. +* face-font: Face Convenience Functions. +* face-font-instance: Face Convenience Functions. +* face-font-name: Face Convenience Functions. +* face-foreground: Face Convenience Functions. +* face-foreground-instance: Face Convenience Functions. +* face-list: Basic Face Functions. +* face-property: Face Properties. +* face-property-instance: Face Properties. +* face-underline-p: Face Convenience Functions. +* facep: Basic Face Functions. +* faces: Faces and Window-System Objects. +* fallback (in a specifier): Specifier Instancing. +* false: nil and t. +* fboundp: Function Cells. +* fceiling: Rounding Operations. +* featurep: Named Features. +* features: Named Features. +* fetch-bytecode: Dynamic Loading. +* ffloor: Rounding Operations. +* field width: Formatting Strings. +* fifth: List Elements. +* file accessibility: Testing Accessibility. +* file age: Testing Accessibility. +* file attributes: File Attributes. +* file format conversion: Format Conversion. +* file hard link: Changing File Attributes. +* file locks: File Locks. +* file mode specification error: Auto Major Mode. +* file modes and MS-DOS: Changing File Attributes. +* file modification time: Testing Accessibility. +* file name completion subroutines: File Name Completion. +* file name of buffer: Buffer File Name. +* file name of directory: Directory Names. +* file names: File Names. +* file names in directory: Contents of Directories. +* file open error: Subroutines of Visiting. +* file symbolic links: Kinds of Files. +* file types on MS-DOS: Files and MS-DOS. +* file with multiple names: Changing File Attributes. +* file-accessible-directory-p: Testing Accessibility. +* file-already-exists: Changing File Attributes. +* file-attributes: File Attributes. +* file-directory-p: Kinds of Files. +* file-error: How Programs Do Loading. +* file-executable-p: Testing Accessibility. +* file-exists-p: Testing Accessibility. +* file-local-copy: Magic File Names. +* file-locked: File Locks. +* file-locked-p: File Locks. +* file-menu-filter: Menu Filters. +* file-modes: File Attributes. +* file-name-absolute-p: Relative File Names. +* file-name-all-completions: File Name Completion. +* file-name-as-directory: Directory Names. +* file-name-buffer-file-type-alist: Files and MS-DOS. +* file-name-completion: File Name Completion. +* file-name-directory: File Name Components. +* file-name-history: Minibuffer History. +* file-name-nondirectory: File Name Components. +* file-name-sans-extension: File Name Components. +* file-name-sans-versions: File Name Components. +* file-newer-than-file-p: Testing Accessibility. +* file-newest-backup: Backup Names. +* file-nlinks: File Attributes. +* file-ownership-preserved-p: Testing Accessibility. +* file-precious-flag: Saving Buffers. +* file-readable-p: Testing Accessibility. +* file-regular-p: Kinds of Files. +* file-relative-name: File Name Expansion. +* file-supersession: Modification Time. +* file-symlink-p: Kinds of Files. +* file-truename: Truenames. +* file-writable-p: Testing Accessibility. +* fill-column: Margins. +* fill-individual-paragraphs: Filling. +* fill-individual-varying-indent: Filling. +* fill-paragraph: Filling. +* fill-paragraph-function: Filling. +* fill-prefix: Margins. +* fill-region: Filling. +* fill-region-as-paragraph: Filling. +* fillarray: Array Functions. +* filling a paragraph: Filling. +* filling, automatic: Auto Filling. +* filling, explicit: Filling. +* filter function: Filter Functions. +* find-backup-file-name: Backup Names. +* find-buffer-file-type: Files and MS-DOS. +* find-charset: Basic Charset Functions. +* find-charset-region: MULE Characters. +* find-charset-string: MULE Characters. +* find-coding-system: Basic Coding System Functions. +* find-file: Visiting Functions. +* find-file-binary: Files and MS-DOS. +* find-file-hooks: Visiting Functions. +* find-file-name-handler: Magic File Names. +* find-file-noselect: Visiting Functions. +* find-file-not-found-hooks: Visiting Functions. +* find-file-other-window: Visiting Functions. +* find-file-read-only: Visiting Functions. +* find-file-text: Files and MS-DOS. +* find-menu-item: Modifying Menus. +* finding files: Visiting Files. +* finding windows: Selecting Windows. +* first: List Elements. +* first-change-hook: Change Hooks. +* fixup-whitespace: User-Level Deletion. +* float: Numeric Conversions. +* float-output-format: Output Variables. +* floating-point numbers, printing: Output Variables. +* floatp: Predicates on Numbers. +* floor: Numeric Conversions. +* flow control characters: Flow Control. +* flush input: Peeking and Discarding. +* fmakunbound: Function Cells. +* focus-frame: Input Focus. +* following-char: Near Point. +* font instance characteristics: Font Instance Characteristics. +* font instance name: Font Instance Names. +* font instance size: Font Instance Size. +* font instance type: Font Instance Type. +* font-instance-name: Font Instance Names. +* font-instance-p: Font Instances. +* font-instance-properties: Font Instance Characteristics. +* font-instance-truename: Font Instance Names. +* font-name: Font Convenience Functions. +* font-properties: Font Convenience Functions. +* font-specifier-p <1>: Font Specifiers. +* font-specifier-p: Specifier Types. +* font-truename: Font Convenience Functions. +* fonts <1>: Fonts. +* fonts: Some Terms. +* fonts available: Font Instance Names. +* foo: A Sample Function Description. +* for: Argument Evaluation. +* force-cursor-redisplay: Refresh Screen. +* force-highlight-extent: Extents and Events. +* forcing redisplay: Waiting. +* format: Formatting Strings. +* format definition: Format Conversion. +* format of keymaps: Format of Keymaps. +* format of menus: Menu Format. +* format of the menubar: Menubar Format. +* format precision: Formatting Strings. +* format specification: Formatting Strings. +* format-alist: Format Conversion. +* format-buffers-menu-line: Buffers Menu. +* format-find-file: Format Conversion. +* format-insert-file: Format Conversion. +* format-time-string: Time Conversion. +* format-write-file: Format Conversion. +* formatting strings: Formatting Strings. +* formfeed: Character Type. +* forms: Intro Eval. +* forward-char: Character Motion. +* forward-comment: Parsing Expressions. +* forward-line: Text Lines. +* forward-list: List Motion. +* forward-sexp: List Motion. +* forward-to-indentation: Motion by Indent. +* forward-word: Word Motion. +* fourth: List Elements. +* frame: Frames. +* frame configuration: Frame Configurations. +* frame hooks: Frame Hooks. +* frame name: Frame Name. +* frame of terminal: Basic Windows. +* frame position: Size and Position. +* frame size: Size and Position. +* frame visibility: Visibility of Frames. +* frame-device: Basic Device Functions. +* frame-height: Size and Position. +* frame-icon-title-format: Frame Titles. +* frame-iconified-p: Visibility of Frames. +* frame-list: Finding All Frames. +* frame-live-p: Deleting Frames. +* frame-name: Frame Name. +* frame-pixel-height: Size and Position. +* frame-pixel-width: Size and Position. +* frame-properties: Property Access. +* frame-property: Property Access. +* frame-root-window: Frames and Windows. +* frame-selected-window: Frames and Windows. +* frame-title-format: Frame Titles. +* frame-top-window: Frames and Windows. +* frame-totally-visible-p: Visibility of Frames. +* frame-visible-p: Visibility of Frames. +* frame-width: Size and Position. +* framep: Frames. +* free list: Garbage Collection. +* frequency counts: Coverage Testing. +* fround: Rounding Operations. +* fset: Function Cells. +* ftp-login: Cleanups. +* ftruncate: Rounding Operations. +* funcall: Calling Functions. +* funcall, and debugging: Internals of Debugger. +* function <1>: Anonymous Functions. +* function: What Is a Function. +* function call: Function Forms. +* function call debugging: Function Debugging. +* function cell: Symbol Components. +* function cell in autoload: Autoload. +* function definition: Function Names. +* function descriptions: A Sample Function Description. +* function form evaluation: Function Forms. +* function input stream: Input Streams. +* function invocation: Calling Functions. +* function name: Function Names. +* function output stream: Output Streams. +* function quoting: Anonymous Functions. +* function-interactive: Using Interactive. +* function-key-map: Translating Input. +* function-obsoleteness-doc: Obsoleteness. +* functionals: Calling Functions. +* functions in modes: Major Mode Conventions. +* functions, making them interactive: Defining Commands. +* Fundamental mode: Major Modes. +* fundamental-mode: Auto Major Mode. +* fundamental-mode-abbrev-table: Standard Abbrev Tables. +* garbage collector: Garbage Collection. +* garbage-collect: Garbage Collection. +* gc-cons-threshold: Garbage Collection. +* gc-message: Garbage Collection. +* gc-pointer-glyph <1>: Garbage Collection. +* gc-pointer-glyph: Mouse Pointer. +* generate-new-buffer: Creating Buffers. +* generate-new-buffer-name: Buffer Names. +* generic-specifier-p: Specifier Types. +* get: Object Plists. +* get-buffer: Buffer Names. +* get-buffer-create: Creating Buffers. +* get-buffer-process: Process Buffers. +* get-buffer-window: Buffers and Windows. +* get-char-property: Examining Properties. +* get-char-table: Working With Char Tables. +* get-charset: Basic Charset Functions. +* get-coding-system: Basic Coding System Functions. +* get-database: Working With a Database. +* get-file-buffer: Buffer File Name. +* get-largest-window: Selecting Windows. +* get-lru-window: Selecting Windows. +* get-process: Process Information. +* get-range-char-table: Working With Char Tables. +* get-range-table: Working With Range Tables. +* get-register: Registers. +* get-text-property: Examining Properties. +* get-tooltalk-message-attribute: Elisp Interface for Sending Messages. +* getenv: System Environment. +* getf: Other Plists. +* gethash: Working With Hash Tables. +* gettext: Level 3 Primitives. +* global binding: Local Variables. +* global break condition: Global Break Condition. +* global keymap: Active Keymaps. +* global mark ring: The Mark. +* global variable: Global Variables. +* global-abbrev-table: Standard Abbrev Tables. +* global-key-binding: Functions for Key Lookup. +* global-map: Active Keymaps. +* global-mark-ring: The Mark. +* global-mode-string: Modeline Variables. +* global-popup-menu: Pop-Up Menus. +* global-set-key: Key Binding Commands. +* global-unset-key: Key Binding Commands. +* glyph type: Glyph Type. +* glyph-ascent: Glyph Dimensions. +* glyph-baseline: Glyph Convenience Functions. +* glyph-baseline-instance: Glyph Convenience Functions. +* glyph-contrib-p: Glyph Convenience Functions. +* glyph-contrib-p-instance: Glyph Convenience Functions. +* glyph-descent: Glyph Dimensions. +* glyph-face: Glyph Convenience Functions. +* glyph-height: Glyph Dimensions. +* glyph-image: Glyph Convenience Functions. +* glyph-image-instance: Glyph Convenience Functions. +* glyph-property: Glyph Properties. +* glyph-property-instance: Glyph Properties. +* glyph-type: Glyph Types. +* glyph-type-list: Glyph Types. +* glyph-width: Glyph Dimensions. +* glyphp: Glyphs. +* glyphs: Glyphs. +* goto-char: Character Motion. +* goto-line: Text Lines. +* gutter: Gutter. +* gutter-buttons-captioned-p: Other Gutter Variables. +* gutter-make-button-list: Gutter Descriptor Format. +* gutter-specifier-p: Specifying a Gutter. +* hack-local-variables: Auto Major Mode. +* handling errors: Handling Errors. +* hash notation: Printed Representation. +* hash table: Hash Tables. +* hash table type: Hash Table Type. +* hash table, weak: Weak Hash Tables. +* hash-table-count: Introduction to Hash Tables. +* hash-table-p: Hash Tables. +* hash-table-rehash-size: Introduction to Hash Tables. +* hash-table-rehash-threshold: Introduction to Hash Tables. +* hash-table-size: Introduction to Hash Tables. +* hash-table-test: Introduction to Hash Tables. +* hash-table-weakness: Introduction to Hash Tables. +* hashing: Creating Symbols. +* header comments: Library Headers. +* help for major mode: Mode Help. +* help-char: Help Functions. +* help-command: Help Functions. +* help-form: Help Functions. +* help-map <1>: Standard Keymaps. +* help-map: Help Functions. +* Helper-describe-bindings: Help Functions. +* Helper-help: Help Functions. +* Helper-help-map: Standard Keymaps. +* hide-annotation: Annotation Properties. +* highlight-extent: Extents and Events. +* history list: Minibuffer History. +* history of commands: Command History. +* HOME environment variable: Subprocess Creation. +* hooks: Hooks. +* hooks for loading: Hooks for Loading. +* hooks for text changes: Change Hooks. +* horizontal position: Columns. +* horizontal scrolling: Horizontal Scrolling. +* hscroll-glyph: Redisplay Glyphs. +* icon-glyph-p: Glyph Types. +* iconified frame: Visibility of Frames. +* iconify-frame: Visibility of Frames. +* identity: Calling Functions. +* IEEE floating point: Float Basics. +* if: Conditionals. +* ignore: Calling Functions. +* ignored-local-variables: Auto Major Mode. +* image instance type: Image Instance Type. +* image instance types: Image Instance Types. +* image instances: Image Instances. +* image instantiator conversion: Image Instantiator Conversion. +* image specifiers: Image Specifiers. +* image-instance-background: Image Instance Functions. +* image-instance-depth: Image Instance Functions. +* image-instance-file-name: Image Instance Functions. +* image-instance-foreground: Image Instance Functions. +* image-instance-height: Image Instance Functions. +* image-instance-hotspot-x: Image Instance Functions. +* image-instance-hotspot-y: Image Instance Functions. +* image-instance-mask-file-name: Image Instance Functions. +* image-instance-name: Image Instance Functions. +* image-instance-p: Image Instances. +* image-instance-string: Image Instance Functions. +* image-instance-type: Image Instance Types. +* image-instance-type-list: Image Instance Types. +* image-instance-width: Image Instance Functions. +* image-instantiator-format-list: Image Specifiers. +* image-specifier-p <1>: Image Specifiers. +* image-specifier-p: Specifier Types. +* implicit progn: Sequencing. +* inc: Simple Macro. +* indent-according-to-mode: Mode-Specific Indent. +* indent-code-rigidly: Region Indent. +* indent-for-tab-command: Mode-Specific Indent. +* indent-line-function: Mode-Specific Indent. +* indent-region: Region Indent. +* indent-region-function: Region Indent. +* indent-relative: Relative Indent. +* indent-relative-maybe: Relative Indent. +* indent-rigidly: Region Indent. +* indent-tabs-mode: Primitive Indent. +* indent-to: Primitive Indent. +* indent-to-left-margin: Margins. +* indentation: Indentation. +* indenting with parentheses: Parsing Expressions. +* indirect buffers: Indirect Buffers. +* indirect specifications: Specification List. +* indirect variables: Variable Aliases. +* indirect-function: Function Indirection. +* indirect-variable: Variable Aliases. +* indirection: Function Indirection. +* infinite loops: Infinite Loops. +* infinite recursion: Local Variables. +* infinity: Float Basics. +* Info-edit-map: Standard Keymaps. +* Info-minibuffer-history: Minibuffer History. +* Info-mode-map: Standard Keymaps. +* inherit: Syntax Class Table. +* inheriting a keymap's bindings: Inheritance and Keymaps. +* inhibit-default-init: Init File. +* inhibit-file-name-handlers: Magic File Names. +* inhibit-file-name-operation: Magic File Names. +* inhibit-quit: Quitting. +* inhibit-read-only: Read Only Buffers. +* inhibit-startup-echo-area-message: Start-up Summary. +* inhibit-startup-message: Start-up Summary. +* init file: Init File. +* initial-frame-plist: Initial Properties. +* initial-gutter-spec: Other Gutter Variables. +* initial-major-mode: Auto Major Mode. +* initial-toolbar-spec: Other Toolbar Variables. +* initialization: Start-up Summary. +* inline functions: Inline Functions. +* innermost containing parentheses: Parsing Expressions. +* input events: Events. +* input focus: Input Focus. +* input modes: Input Modes. +* input stream: Input Streams. +* input-pending-p: Peeking and Discarding. +* insert: Insertion. +* insert-abbrev-table-description: Abbrev Tables. +* insert-before-markers: Insertion. +* insert-buffer: Commands for Insertion. +* insert-buffer-substring: Insertion. +* insert-char: Insertion. +* insert-default-directory: Reading File Names. +* insert-directory: Contents of Directories. +* insert-directory-program: Contents of Directories. +* insert-extent: Detached Extents. +* insert-file-contents: Reading from Files. +* insert-register: Registers. +* insert-string: Insertion. +* inserting killed text: Yank Commands. +* insertion before point: Insertion. +* insertion of text: Insertion. +* inside comment: Parsing Expressions. +* inside margin: Annotation Basics. +* inside string: Parsing Expressions. +* inst-list (in a specifier): Specifiers In-Depth. +* inst-pair (in a specifier): Specifiers In-Depth. +* installation-directory: System Environment. +* instance (in a specifier): Specifiers In-Depth. +* instancing (in a specifier): Specifiers In-Depth. +* instantiator (in a specifier): Specifiers In-Depth. +* int-char: Character Codes. +* int-to-string: String Conversion. +* integer to decimal: String Conversion. +* integer to hexadecimal: Formatting Strings. +* integer to octal: Formatting Strings. +* integer to string: String Conversion. +* integer-char-or-marker-p: Predicates on Markers. +* integer-or-char-p: Predicates for Characters. +* integer-or-marker-p: Predicates on Markers. +* integer-specifier-p: Specifier Types. +* integerp: Predicates on Numbers. +* integers: Numbers. +* interactive: Using Interactive. +* interactive call: Interactive Call. +* interactive code description: Interactive Codes. +* interactive commands (Edebug): Instrumenting. +* interactive completion: Interactive Codes. +* interactive function: Defining Commands. +* interactive, examples of using: Interactive Examples. +* interactive-p: Interactive Call. +* intern: Creating Symbols. +* intern-soft: Creating Symbols. +* internal-doc-file-name: Accessing Documentation. +* interning: Creating Symbols. +* interpreter: Evaluation. +* interpreter-mode-alist: Auto Major Mode. +* interprogram-cut-function: Low-Level Kill Ring. +* interprogram-paste-function: Low-Level Kill Ring. +* interrupt-process: Signals to Processes. +* invalid function: Function Indirection. +* invalid prefix key error: Changing Key Bindings. +* invalid-function: Function Indirection. +* invalid-read-syntax: Printed Representation. +* invalid-regexp: Syntax of Regexps. +* invert-face: Other Face Display Functions. +* invisible frame: Visibility of Frames. +* invisible text: Invisible Text. +* invisible-text-glyph: Redisplay Glyphs. +* invocation-directory: System Environment. +* invocation-name: System Environment. +* isearch-mode-map: Standard Keymaps. +* ISO Latin 1: Case Tables. +* ISO Latin-1 characters (input): Translating Input. +* iso-syntax: Case Tables. +* iso-transl: Translating Input. +* italic: Font Instance Characteristics. +* iteration: Iteration. +* itimer-edit-map: Standard Keymaps. +* joining lists: Rearrangement. +* just-one-space: User-Level Deletion. +* justify-current-line: Filling. +* kept-new-versions: Numbered Backups. +* kept-old-versions: Numbered Backups. +* key: Keymap Terminology. +* key binding: Keymap Terminology. +* key lookup: Key Lookup. +* key sequence: Key Sequence Input. +* key sequence error: Changing Key Bindings. +* key sequence input: Key Sequence Input. +* key sequences: Key Sequences. +* key translation function: Translating Input. +* key-binding: Functions for Key Lookup. +* key-description: Describing Characters. +* key-press-event-p: Event Predicates. +* key-translation-map: Translating Input. +* keyboard macro execution: Interactive Call. +* keyboard macro termination: Beeping. +* keyboard macros: Keyboard Macros. +* keyboard macros (Edebug): Edebug Execution Modes. +* keyboard menu accelerators: Menu Accelerators. +* keyboard-quit: Quitting. +* keymap: Keymaps. +* keymap entry: Key Lookup. +* keymap format: Format of Keymaps. +* keymap in keymap: Key Lookup. +* keymap inheritance: Inheritance and Keymaps. +* keymap parent: Inheritance and Keymaps. +* keymap-default-binding: Inheritance and Keymaps. +* keymap-fullness: Scanning Keymaps. +* keymap-name: Creating Keymaps. +* keymap-parents: Inheritance and Keymaps. +* keymap-prompt: Other Keymap Functions. +* keymapp: Format of Keymaps. +* keymaps in modes: Major Mode Conventions. +* keys in documentation strings: Keys in Documentation. +* keystroke: Keymap Terminology. +* keystroke command: What Is a Function. +* keywordp: Specification List. +* kill command repetition: Command Loop Info. +* kill ring: The Kill Ring. +* kill-all-local-variables: Creating Buffer-Local. +* kill-append: Low-Level Kill Ring. +* kill-buffer: Killing Buffers. +* kill-buffer-hook: Killing Buffers. +* kill-buffer-query-functions: Killing Buffers. +* kill-emacs: Killing XEmacs. +* kill-emacs-hook: Killing XEmacs. +* kill-emacs-query-functions: Killing XEmacs. +* kill-local-variable: Creating Buffer-Local. +* kill-new: Low-Level Kill Ring. +* kill-process: Signals to Processes. +* kill-region: Kill Functions. +* kill-ring: Internals of Kill Ring. +* kill-ring-max: Internals of Kill Ring. +* kill-ring-yank-pointer: Internals of Kill Ring. +* killing buffers: Killing Buffers. +* killing XEmacs: Killing XEmacs. +* lambda expression: Lambda Expressions. +* lambda expression in hook: Hooks. +* lambda in debug: Invoking the Debugger. +* lambda in keymap: Key Lookup. +* lambda list: Lambda Components. +* lambda-list (Edebug): Specification List. +* lambda-list-keywordp: Specification List. +* last-abbrev: Abbrev Expansion. +* last-abbrev-location: Abbrev Expansion. +* last-abbrev-text: Abbrev Expansion. +* last-command: Command Loop Info. +* last-command-char: Command Loop Info. +* last-command-event: Command Loop Info. +* last-input-char: Peeking and Discarding. +* last-input-event: Peeking and Discarding. +* last-kbd-macro: Keyboard Macros. +* Latin-1 character set (input): Translating Input. +* lax-plist-get: Working With Lax Plists. +* lax-plist-member: Working With Lax Plists. +* lax-plist-put: Working With Lax Plists. +* lax-plist-remprop: Working With Lax Plists. +* lax-plists-eq: Working With Lax Plists. +* lax-plists-equal: Working With Lax Plists. +* layout policy: Annotation Basics. +* layout types: Annotation Basics. +* lazy loading: Dynamic Loading. +* LDAP: LDAP Support. +* ldap-close: Opening and Closing a LDAP Connection. +* ldap-default-base: LDAP Variables. +* ldap-default-host: LDAP Variables. +* ldap-default-port: LDAP Variables. +* ldap-host: The LDAP Lisp Object. +* ldap-host-parameters-alist: LDAP Variables. +* ldap-live-p: The LDAP Lisp Object. +* ldap-open: Opening and Closing a LDAP Connection. +* ldap-search: The High-Level LDAP API. +* ldap-search-internal: Searching on a LDAP Server (Low-level). +* ldapp: The LDAP Lisp Object. +* left-gutter: Specifying a Gutter. +* left-gutter-visible-p: Other Gutter Variables. +* left-gutter-width: Other Gutter Variables. +* left-margin: Margins. +* left-margin-width: Margin Primitives. +* left-toolbar: Specifying the Toolbar. +* left-toolbar-visible-p: Other Toolbar Variables. +* left-toolbar-width: Other Toolbar Variables. +* length: Sequence Functions. +* let: Local Variables. +* let*: Local Variables. +* let-specifier: Adding Specifications. +* lexical binding (Edebug): Edebug Eval. +* lexical comparison: Text Comparison. +* library: Loading. +* library compilation: Compilation Functions. +* library header comments: Library Headers. +* line wrapping: Truncation. +* lines: Text Lines. +* lines in region: Text Lines. +* linking files: Changing File Attributes. +* Lisp debugger: Debugger. +* Lisp expression motion: List Motion. +* Lisp history: Lisp History. +* Lisp library: Loading. +* Lisp nesting error: Eval. +* Lisp object: Lisp Data Types. +* Lisp printer: Output Functions. +* Lisp reader: Streams Intro. +* lisp-interaction-mode-map: Standard Keymaps. +* lisp-mode-abbrev-table: Standard Abbrev Tables. +* lisp-mode-map: Standard Keymaps. +* lisp-mode.el: Example Major Modes. +* list <1>: Building Lists. +* list: Lists. +* list elements: List Elements. +* list form evaluation: Classifying Lists. +* list in keymap: Key Lookup. +* list length: Sequence Functions. +* list motion: List Motion. +* list structure: Cons Cells. +* list-buffers: The Buffer List. +* list-buffers-directory: Buffer File Name. +* list-fonts: Font Instance Names. +* list-processes: Process Information. +* listp: List-related Predicates. +* lists and cons cells: Cons Cells. +* lists as sets: Sets And Lists. +* lists represented as boxes: Lists as Boxes. +* literal evaluation: Self-Evaluating Forms. +* lmessage: The Echo Area. +* ln: Changing File Attributes. +* load: How Programs Do Loading. +* load error with require: Named Features. +* load errors: How Programs Do Loading. +* load-average: System Environment. +* load-default-sounds: Beeping. +* load-history: Unloading. +* load-ignore-elc-files: How Programs Do Loading. +* load-in-progress: How Programs Do Loading. +* load-path: How Programs Do Loading. +* load-read-function: How Programs Do Loading. +* load-sound-file: Beeping. +* load-warn-when-source-newer: How Programs Do Loading. +* load-warn-when-source-only: How Programs Do Loading. +* loading: Loading. +* loading hooks: Hooks for Loading. +* loadup.el: Building XEmacs. +* local binding: Local Variables. +* local keymap: Active Keymaps. +* local variables: Local Variables. +* local-abbrev-table: Standard Abbrev Tables. +* local-key-binding: Functions for Key Lookup. +* local-set-key: Key Binding Commands. +* local-unset-key: Key Binding Commands. +* local-variable-p: Creating Buffer-Local. +* local-write-file-hooks: Saving Buffers. +* locale (in a specifier): Specifiers In-Depth. +* locate-file: How Programs Do Loading. +* locate-file-clear-hashing: How Programs Do Loading. +* lock-buffer: File Locks. +* log: Math Functions. +* log-message-ignore-labels: The Echo Area. +* log-message-ignore-regexps: The Echo Area. +* log-message-max-size: The Echo Area. +* log-warning-minimum-level: Warnings. +* log-warning-suppressed-classes: Warnings. +* log10: Math Functions. +* logand: Bitwise Operations. +* logb: Float Basics. +* logical and: Bitwise Operations. +* logical exclusive or: Bitwise Operations. +* logical inclusive or: Bitwise Operations. +* logical not: Bitwise Operations. +* logical shift: Bitwise Operations. +* logior: Bitwise Operations. +* lognot: Bitwise Operations. +* logxor: Bitwise Operations. +* looking-at: Regexp Search. +* lookup-key: Functions for Key Lookup. +* loops, infinite: Infinite Loops. +* lower case: Character Case. +* lower-frame: Raising and Lowering. +* lowering a frame: Raising and Lowering. +* lsh: Bitwise Operations. +* lwarn: Warnings. +* M-x: Interactive Call. +* Maclisp: Lisp History. +* macro: What Is a Function. +* macro argument evaluation: Argument Evaluation. +* macro call: Expansion. +* macro call evaluation: Macro Forms. +* macro compilation: Compilation Functions. +* macro descriptions: A Sample Function Description. +* macro expansion: Expansion. +* macroexpand: Expansion. +* macros: Macros. +* magic file names: Magic File Names. +* mail-host-address: System Environment. +* major mode: Major Modes. +* major mode hook: Major Mode Conventions. +* major mode keymap: Active Keymaps. +* major-mode: Mode Help. +* make-abbrev-table: Abbrev Tables. +* make-annotation: Annotation Primitives. +* make-auto-save-file-name: Auto-Saving. +* make-backup-file-name: Backup Names. +* make-backup-files: Making Backups. +* make-bit-vector: Bit Vector Functions. +* make-byte-code: Compiled-Function Objects. +* make-char: MULE Characters. +* make-char-table: Working With Char Tables. +* make-charset: Basic Charset Functions. +* make-coding-system: Basic Coding System Functions. +* make-composite-char: Composite Characters. +* make-device: Connecting to a Console or Device. +* make-directory: Create/Delete Dirs. +* make-display-table: Display Table Format. +* make-event: Working With Events. +* make-extent: Creating and Modifying Extents. +* make-face: Basic Face Functions. +* make-file-part: Creating a Partial File. +* make-font-instance: Font Instances. +* make-frame: Creating Frames. +* make-frame-invisible: Visibility of Frames. +* make-frame-visible: Visibility of Frames. +* make-glyph: Creating Glyphs. +* make-glyph-internal: Creating Glyphs. +* make-hash-table: Introduction to Hash Tables. +* make-icon-glyph: Creating Glyphs. +* make-image-instance: Image Instance Functions. +* make-image-specifier: Image Specifiers. +* make-indirect-buffer: Indirect Buffers. +* make-keymap: Creating Keymaps. +* make-list: Building Lists. +* make-local-hook: Hooks. +* make-local-variable: Creating Buffer-Local. +* make-marker: Creating Markers. +* make-obsolete: Obsoleteness. +* make-obsolete-variable: Obsoleteness. +* make-pointer-glyph: Creating Glyphs. +* make-range-table: Introduction to Range Tables. +* make-reverse-direction-charset: Basic Charset Functions. +* make-sparse-keymap: Creating Keymaps. +* make-specifier: Creating Specifiers. +* make-specifier-and-init: Creating Specifiers. +* make-string: Creating Strings. +* make-symbol: Creating Symbols. +* make-symbolic-link: Changing File Attributes. +* make-syntax-table: Syntax Table Functions. +* make-temp-name: Unique File Names. +* make-tooltalk-message: Elisp Interface for Sending Messages. +* make-tooltalk-pattern: Elisp Interface for Receiving Messages. +* make-tty-device: Connecting to a Console or Device. +* make-variable-buffer-local: Creating Buffer-Local. +* make-vector: Vector Functions. +* make-weak-list: Weak Lists. +* make-x-device: Connecting to a Console or Device. +* makunbound: Void Variables. +* Manual-page-minibuffer-history: Minibuffer History. +* map-char-table: Working With Char Tables. +* map-database: Working With a Database. +* map-extent-children: Mapping Over Extents. +* map-extents: Mapping Over Extents. +* map-frame-hook: Frame Hooks. +* map-keymap: Scanning Keymaps. +* map-range-table: Working With Range Tables. +* map-specifier: Other Specification Functions. +* map-y-or-n-p: Multiple Queries. +* mapatoms: Creating Symbols. +* mapcar: Mapping Functions. +* mapcar-extents: Mapping Over Extents. +* mapconcat: Mapping Functions. +* maphash: Working With Hash Tables. +* mapping functions: Mapping Functions. +* margin: Annotation Basics. +* margin width: Margin Primitives. +* mark: The Mark. +* mark excursion: Excursions. +* mark ring: The Mark. +* mark, the: The Mark. +* mark-marker: The Mark. +* mark-ring: The Mark. +* mark-ring-max: The Mark. +* marker argument: Interactive Codes. +* marker garbage collection: Overview of Markers. +* marker input stream: Input Streams. +* marker output stream: Output Streams. +* marker relocation: Overview of Markers. +* marker-buffer: Information from Markers. +* marker-position: Information from Markers. +* markerp: Predicates on Markers. +* markers: Markers. +* markers as numbers: Overview of Markers. +* markers vs. extents: Overview of Markers. +* match data: Match Data. +* match-beginning: Simple Match Data. +* match-data: Entire Match Data. +* match-end: Simple Match Data. +* match-string: Simple Match Data. +* mathematical functions: Math Functions. +* max: Comparison of Numbers. +* max-lisp-eval-depth: Eval. +* max-specpdl-size: Local Variables. +* md5: Transformations. +* MD5 digests: Transformations. +* member: Sets And Lists. +* membership in a list: Sets And Lists. +* memory allocation: Garbage Collection. +* memory-limit: Garbage Collection. +* memq: Sets And Lists. +* menu: Menus. +* menu accelerators: Menu Accelerators. +* menu filters: Menu Filters. +* menu format: Menu Format. +* menu-accelerator-enabled: Menu Accelerator Functions. +* menu-accelerator-map: Menu Accelerator Functions. +* menu-accelerator-modifiers: Menu Accelerator Functions. +* menu-accelerator-prefix: Menu Accelerator Functions. +* menu-no-selection-hook: Menubar. +* menubar: Menubar. +* menubar format: Menubar Format. +* menubar-configuration: Menu Format. +* menubar-pointer-glyph: Mouse Pointer. +* menubar-show-keybindings: Menubar. +* message: The Echo Area. +* meta character printing: Describing Characters. +* meta-prefix-char: Functions for Key Lookup. +* min: Comparison of Numbers. +* minibuffer: Minibuffers. +* minibuffer history: Minibuffer History. +* minibuffer input: Recursive Editing. +* minibuffer window: Cyclic Window Ordering. +* minibuffer-complete: Completion Commands. +* minibuffer-complete-and-exit: Completion Commands. +* minibuffer-complete-word: Completion Commands. +* minibuffer-completion-confirm: Completion Commands. +* minibuffer-completion-help: Completion Commands. +* minibuffer-completion-predicate: Completion Commands. +* minibuffer-completion-table: Completion Commands. +* minibuffer-depth: Minibuffer Misc. +* minibuffer-exit-hook: Minibuffer Misc. +* minibuffer-frame-plist: Initial Properties. +* minibuffer-help-form: Minibuffer Misc. +* minibuffer-history: Minibuffer History. +* minibuffer-local-completion-map <1>: Standard Keymaps. +* minibuffer-local-completion-map: Completion Commands. +* minibuffer-local-isearch-map: Standard Keymaps. +* minibuffer-local-map <1>: Standard Keymaps. +* minibuffer-local-map: Text from Minibuffer. +* minibuffer-local-must-match-map <1>: Standard Keymaps. +* minibuffer-local-must-match-map: Completion Commands. +* minibuffer-prompt: Minibuffer Misc. +* minibuffer-prompt-width: Minibuffer Misc. +* minibuffer-scroll-window: Minibuffer Misc. +* minibuffer-setup-hook: Minibuffer Misc. +* minibuffer-window: Minibuffer Misc. +* minibuffer-window-active-p: Minibuffer Misc. +* minimum window size: Resizing Windows. +* minor mode: Minor Modes. +* minor mode conventions: Minor Mode Conventions. +* minor-mode-alist: Modeline Variables. +* minor-mode-key-binding: Functions for Key Lookup. +* minor-mode-map-alist: Active Keymaps. +* misc-user-event-p: Event Predicates. +* mod: Arithmetic Operations. +* mode: Modes. +* mode help: Mode Help. +* mode hook: Major Mode Conventions. +* mode loading: Major Mode Conventions. +* mode variable: Minor Mode Conventions. +* mode-class property: Major Mode Conventions. +* mode-name: Modeline Variables. +* mode-popup-menu: Pop-Up Menus. +* mode-specific-map <1>: Standard Keymaps. +* mode-specific-map: Prefix Keys. +* modeline: Modeline Format. +* modeline construct: Modeline Data. +* modeline-buffer-identification: Modeline Variables. +* modeline-format: Modeline Data. +* modeline-map <1>: Standard Keymaps. +* modeline-map: Active Keymaps. +* modeline-modified: Modeline Variables. +* modeline-pointer-glyph: Mouse Pointer. +* modeline-process: Modeline Variables. +* modification flag (of buffer): Buffer Modification. +* modification of lists: Rearrangement. +* modification time, comparison of: Modification Time. +* modify-syntax-entry: Syntax Table Functions. +* modulus: Arithmetic Operations. +* momentary-string-display: Temporary Displays. +* mono-pixmap-image-instance-p: Image Instance Types. +* motion-event-p: Event Predicates. +* mouse cursor: Mouse Pointer. +* mouse pointer: Mouse Pointer. +* mouse-event-p: Event Predicates. +* mouse-grabbed-buffer: Active Keymaps. +* mouse-highlight-priority: Extents and Events. +* move-marker: Changing Markers. +* move-to-column: Columns. +* move-to-left-margin: Margins. +* move-to-window-line: Screen Lines. +* MS-DOS and file modes: Changing File Attributes. +* MS-DOS file types: Files and MS-DOS. +* MSWindows OLE: MSWindows OLE. +* multilingual string formatting: Formatting Strings. +* multiple windows: Basic Windows. +* named function: Function Names. +* NaN: Float Basics. +* narrow-to-page: Narrowing. +* narrow-to-region: Narrowing. +* narrowing: Narrowing. +* natnum-specifier-p: Specifier Types. +* natnump: Predicates on Numbers. +* natural numbers: Predicates on Numbers. +* nconc: Rearrangement. +* negative infinity: Float Basics. +* negative-argument: Prefix Command Arguments. +* network connection: Network. +* new file message: Subroutines of Visiting. +* newline <1>: Commands for Insertion. +* newline: Character Type. +* newline and Auto Fill mode: Commands for Insertion. +* newline in print: Output Functions. +* newline in strings: String Type. +* newline-and-indent: Mode-Specific Indent. +* next input: Peeking and Discarding. +* next-command-event: Reading One Event. +* next-event: Reading One Event. +* next-extent: Finding Extents. +* next-frame: Finding All Frames. +* next-history-element: Minibuffer Misc. +* next-matching-history-element: Minibuffer Misc. +* next-property-change: Property Search. +* next-screen-context-lines: Vertical Scrolling. +* next-single-property-change: Property Search. +* next-window: Cyclic Window Ordering. +* nil: Constant Variables. +* nil and lists: Cons Cells. +* nil in keymap: Key Lookup. +* nil in lists: Cons Cell Type. +* nil input stream: Input Streams. +* nil output stream: Output Streams. +* nil, uses of: nil and t. +* ninth: List Elements. +* nlistp: List-related Predicates. +* no-catch: Catch and Throw. +* no-redraw-on-reenter: Refresh Screen. +* nondirectory part (of file name): File Name Components. +* noninteractive: Batch Mode. +* noninteractive use: Batch Mode. +* nonlocal exits: Nonlocal Exits. +* nonprinting characters, reading: Quoted Character Input. +* nontext-pointer-glyph: Mouse Pointer. +* normal-mode: Auto Major Mode. +* not: Combining Conditions. +* not-modified: Buffer Modification. +* nothing-image-instance-p: Image Instance Types. +* nreverse: Rearrangement. +* nth: List Elements. +* nthcdr: List Elements. +* null: List-related Predicates. +* number equality: Comparison of Numbers. +* number-char-or-marker-p: Predicates on Markers. +* number-or-marker-p: Predicates on Markers. +* number-to-string: String Conversion. +* numberp: Predicates on Numbers. +* numbers: Numbers. +* numeric prefix: Formatting Strings. +* numeric prefix argument: Prefix Command Arguments. +* numeric prefix argument usage: Interactive Codes. +* obarray: Creating Symbols. +* obarray in completion: Basic Completion. +* objc-mode-map: Standard Keymaps. +* object: Lisp Data Types. +* object to string: Output Functions. +* object-plist: Object Plists. +* oblique: Font Instance Characteristics. +* obsolete buffer: Modification Time. +* occur-mode-map: Standard Keymaps. +* octal character code: Character Type. +* octal character input: Quoted Character Input. +* octal-escape-glyph: Redisplay Glyphs. +* OffiX DND: OffiX DND. +* old-eq: Equality Predicates. +* one-window-p: Splitting Windows. +* only-global-abbrevs: Defining Abbrevs. +* open-database: Connecting to a Database. +* open-dribble-file: Recording Input. +* open-network-stream: Network. +* open-termscript: Terminal Output. +* open parenthesis character: Syntax Class Table. +* operating system environment: System Environment. +* option descriptions: A Sample Variable Description. +* optional arguments: Argument List. +* options on command line: Command Line Arguments. +* or: Combining Conditions. +* order of extents: Extent Endpoints. +* ordering of windows, cyclic: Cyclic Window Ordering. +* other-buffer: The Buffer List. +* other-window: Cyclic Window Ordering. +* other-window-scroll-buffer: Vertical Scrolling. +* Outline mode: Substitution. +* output from processes: Output from Processes. +* output stream: Output Streams. +* outside margin: Annotation Basics. +* overflow: Integer Basics. +* overlay arrow: Overlay Arrow. +* overlay-arrow-position: Overlay Arrow. +* overlay-arrow-string: Overlay Arrow. +* overriding-local-map <1>: Standard Keymaps. +* overriding-local-map: Active Keymaps. +* overriding-terminal-local-map: Active Keymaps. +* overwrite-mode: Commands for Insertion. +* padding: Formatting Strings. +* page-delimiter: Standard Regexps. +* paired delimiter: Syntax Class Table. +* paragraph-separate: Standard Regexps. +* paragraph-start: Standard Regexps. +* parent of a keymap: Inheritance and Keymaps. +* parent process: Processes. +* parent, of extent: Extent Parents. +* parenthesis: Cons Cell Type. +* parenthesis depth: Parsing Expressions. +* parenthesis matching: Blinking. +* parenthesis syntax: Syntax Class Table. +* parse state: Parsing Expressions. +* parse-partial-sexp: Parsing Expressions. +* parse-sexp-ignore-comments: Parsing Expressions. +* parsing: Syntax Tables. +* partial files: Partial Files. +* passwd-echo: Reading a Password. +* passwd-invert-frame-when-keyboard-grabbed: Reading a Password. +* passwords, reading: Reading a Password. +* PATH environment variable: Subprocess Creation. +* path-separator: System Environment. +* pausing: Waiting. +* peeking at input: Peeking and Discarding. +* percent symbol in modeline: Modeline Data. +* perform-replace: Search and Replace. +* performance analysis: Coverage Testing. +* permanent local variable: Creating Buffer-Local. +* permission: File Attributes. +* pg-coding-system: libpq Lisp Variables. +* pg:authtype: libpq Lisp Variables. +* pg:client-encoding: libpq Lisp Variables. +* pg:cost-heap: libpq Lisp Variables. +* pg:cost-index: libpq Lisp Variables. +* pg:database: libpq Lisp Variables. +* pg:date-style: libpq Lisp Variables. +* pg:geqo: libpq Lisp Variables. +* pg:host: libpq Lisp Variables. +* pg:options: libpq Lisp Variables. +* pg:port: libpq Lisp Variables. +* pg:realm: libpq Lisp Variables. +* pg:tty: libpq Lisp Variables. +* pg:tz: libpq Lisp Variables. +* pg:user: libpq Lisp Variables. +* pgres::polling-active: libpq Lisp Symbols and DataTypes. +* pgres::polling-failed: libpq Lisp Symbols and DataTypes. +* pgres::polling-ok: libpq Lisp Symbols and DataTypes. +* pgres::polling-reading: libpq Lisp Symbols and DataTypes. +* pgres::polling-writing: libpq Lisp Symbols and DataTypes. +* pipes: Asynchronous Processes. +* play-sound: Beeping. +* play-sound-file: Beeping. +* plist: Property Lists. +* plist, symbol: Symbol Properties. +* plist-get: Working With Normal Plists. +* plist-member: Working With Normal Plists. +* plist-put: Working With Normal Plists. +* plist-remprop: Working With Normal Plists. +* plist-to-alist: Converting Plists To/From Alists. +* plists-eq <1>: Other Plists. +* plists-eq: Working With Normal Plists. +* plists-equal <1>: Other Plists. +* plists-equal: Working With Normal Plists. +* point: Point. +* point excursion: Excursions. +* point in window: Window Point. +* point with narrowing: Point. +* point-marker: Creating Markers. +* point-max: Point. +* point-max-marker: Creating Markers. +* point-min: Point. +* point-min-marker: Creating Markers. +* pointer (mouse): Mouse Pointer. +* pointer-glyph-p: Glyph Types. +* pointer-image-instance-p: Image Instance Types. +* pop-global-mark: The Mark. +* pop-mark: The Mark. +* pop-to-buffer: Displaying Buffers. +* pop-up menu: Pop-Up Menus. +* pop-up-frame-function: Choosing Window. +* pop-up-frame-plist: Choosing Window. +* pop-up-frames: Choosing Window. +* pop-up-windows: Choosing Window. +* popup-buffer-menu: Pop-Up Menus. +* popup-dialog-box: Dialog Box Functions. +* popup-menu: Pop-Up Menus. +* popup-menu-titles: Pop-Up Menus. +* popup-menu-up-p: Pop-Up Menus. +* popup-menubar-menu: Pop-Up Menus. +* popup-mode-menu: Pop-Up Menus. +* pos-visible-in-window-p: Window Start. +* position (in buffer): Positions. +* position argument: Interactive Codes. +* position in window: Window Point. +* position of frame: Size and Position. +* position of window: Position of Window. +* positive infinity: Float Basics. +* posix-looking-at: POSIX Regexps. +* posix-search-backward: POSIX Regexps. +* posix-search-forward: POSIX Regexps. +* posix-string-match: POSIX Regexps. +* post-command-hook: Command Overview. +* post-gc-hook: Garbage Collection. +* PostgreSQL: PostgreSQL Support. +* pq-binary-tuples: libpq Lisp Symbols and DataTypes. +* pq-clear: Other libpq Functions. +* pq-client-encoding: Other libpq Functions. +* pq-cmd-status: libpq Lisp Symbols and DataTypes. +* pq-cmd-tuples: libpq Lisp Symbols and DataTypes. +* pq-conn-defaults: Other libpq Functions. +* pq-connect-poll: Asynchronous Interface Functions. +* pq-connect-start: Asynchronous Interface Functions. +* pq-connectdb: Synchronous Interface Functions. +* pq-consume-input: Asynchronous Interface Functions. +* pq-env-2-encoding: Other libpq Functions. +* pq-exec: Synchronous Interface Functions. +* pq-finish: Other libpq Functions. +* pq-flush: Asynchronous Interface Functions. +* pq-fmod: libpq Lisp Symbols and DataTypes. +* pq-fname: libpq Lisp Symbols and DataTypes. +* pq-fnumber: libpq Lisp Symbols and DataTypes. +* pq-fsize: libpq Lisp Symbols and DataTypes. +* pq-ftype: libpq Lisp Symbols and DataTypes. +* pq-get-is-null: libpq Lisp Symbols and DataTypes. +* pq-get-length: libpq Lisp Symbols and DataTypes. +* pq-get-result: Asynchronous Interface Functions. +* pq-get-value: libpq Lisp Symbols and DataTypes. +* pq-is-busy: Asynchronous Interface Functions. +* pq-is-nonblocking: Asynchronous Interface Functions. +* pq-lo-close: Unimplemented libpq Functions. +* pq-lo-creat: Unimplemented libpq Functions. +* pq-lo-export: Large Object Support. +* pq-lo-import: Large Object Support. +* pq-lo-lseek: Unimplemented libpq Functions. +* pq-lo-open: Unimplemented libpq Functions. +* pq-lo-read: Unimplemented libpq Functions. +* pq-lo-tell: Unimplemented libpq Functions. +* pq-lo-unlink: Unimplemented libpq Functions. +* pq-lo-write: Unimplemented libpq Functions. +* pq-make-empty-pgresult: libpq Lisp Symbols and DataTypes. +* pq-nfields: libpq Lisp Symbols and DataTypes. +* pq-notifies: Synchronous Interface Functions. +* pq-ntuples: libpq Lisp Symbols and DataTypes. +* pq-oid-value: libpq Lisp Symbols and DataTypes. +* pq-pgconn: libpq Lisp Symbols and DataTypes. +* pq-res-status: libpq Lisp Symbols and DataTypes. +* pq-reset: Synchronous Interface Functions. +* pq-reset-cancel: Asynchronous Interface Functions. +* pq-reset-poll: Asynchronous Interface Functions. +* pq-reset-start: Asynchronous Interface Functions. +* pq-result-error-message: libpq Lisp Symbols and DataTypes. +* pq-result-status: libpq Lisp Symbols and DataTypes. +* pq-send-query: Asynchronous Interface Functions. +* pq-set-client-encoding: Other libpq Functions. +* pq-set-nonblocking: Asynchronous Interface Functions. +* PQdisplayTuples: Unimplemented libpq Functions. +* PQmblen: Unimplemented libpq Functions. +* PQprint: Unimplemented libpq Functions. +* PQprintTuples: Unimplemented libpq Functions. +* PQsetenv: Synchronous Interface Functions. +* PQsetenvAbort: Asynchronous Interface Functions. +* PQsetenvPoll: Asynchronous Interface Functions. +* PQsetenvStart: Asynchronous Interface Functions. +* PQsocket: Unimplemented libpq Functions. +* PQtrace: Unimplemented libpq Functions. +* PQuntrace: Unimplemented libpq Functions. +* pre-abbrev-expand-hook: Abbrev Expansion. +* pre-command-hook: Command Overview. +* pre-gc-hook: Garbage Collection. +* preceding-char: Near Point. +* precision of formatted numbers: Formatting Strings. +* predicates: Type Predicates. +* prefix argument: Prefix Command Arguments. +* prefix argument unreading: Peeking and Discarding. +* prefix command: Prefix Keys. +* prefix key: Prefix Keys. +* prefix-arg: Prefix Command Arguments. +* prefix-help-command: Help Functions. +* prefix-numeric-value: Prefix Command Arguments. +* preventing backtracking: Specification List. +* preventing prefix key: Key Lookup. +* previous complete subexpression: Parsing Expressions. +* previous-extent: Finding Extents. +* previous-frame: Finding All Frames. +* previous-history-element: Minibuffer Misc. +* previous-matching-history-element: Minibuffer Misc. +* previous-property-change: Property Search. +* previous-single-property-change: Property Search. +* previous-window: Cyclic Window Ordering. +* primitive: What Is a Function. +* primitive type: Lisp Data Types. +* primitive types: Primitive Types. +* primitive-undo: Undo. +* prin1: Output Functions. +* prin1-to-string: Output Functions. +* princ: Output Functions. +* print: Output Functions. +* print example: Output Streams. +* print name cell: Symbol Components. +* print-escape-newlines: Output Variables. +* print-gensym: Output Variables. +* print-help-return-message: Help Functions. +* print-length: Output Variables. +* print-level: Output Variables. +* print-readably <1>: Output Variables. +* print-readably: Printing in Edebug. +* print-string-length: Output Variables. +* printed representation: Printed Representation. +* printed representation for characters: Character Type. +* printing: Streams Intro. +* printing (Edebug): Printing in Edebug. +* printing circular structures: Printing in Edebug. +* printing floating-point numbers: Output Variables. +* printing limits: Output Variables. +* printing notation: Printing Notation. +* printing readably: Output Variables. +* printing uninterned symbols: Output Variables. +* priority of an extent: Intro to Extents. +* process: Processes. +* process filter: Filter Functions. +* process input: Input to Processes. +* process output: Output from Processes. +* process sentinel: Sentinels. +* process signals: Signals to Processes. +* process window size: Process Window Size. +* process-buffer: Process Buffers. +* process-command: Process Information. +* process-connection-type: Asynchronous Processes. +* process-environment: System Environment. +* process-event-p: Event Predicates. +* process-exit-status: Process Information. +* process-filter: Filter Functions. +* process-id: Process Information. +* process-kill-without-query: Deleting Processes. +* process-kill-without-query-p: Process Information. +* process-list: Process Information. +* process-mark: Process Buffers. +* process-name: Process Information. +* process-send-eof: Input to Processes. +* process-send-region: Input to Processes. +* process-send-string: Input to Processes. +* process-sentinel: Sentinels. +* process-status: Process Information. +* process-tty-name: Process Information. +* processp: Processes. +* profile.el: Compilation Tips. +* profiling: Compilation Tips. +* prog1: Sequencing. +* prog2: Sequencing. +* progn: Sequencing. +* program arguments: Subprocess Creation. +* program directories: Subprocess Creation. +* programmed completion: Programmed Completion. +* programming types: Programming Types. +* properties of strings: String Properties. +* properties of text: Text Properties. +* property list: Property Lists. +* property list cell (symbol): Symbol Components. +* property list, symbol: Symbol Properties. +* property lists vs association lists: Plists and Alists. +* property of an extent: Extent Properties. +* protected forms: Cleanups. +* provide: Named Features. +* providing features: Named Features. +* PTYs: Asynchronous Processes. +* punctuation character: Syntax Class Table. +* pure storage: Pure Storage. +* pure-bytes-used: Pure Storage. +* purecopy: Pure Storage. +* purify-flag: Pure Storage. +* push-mark: The Mark. +* put: Object Plists. +* put-char-table: Working With Char Tables. +* put-database: Working With a Database. +* put-range-table: Working With Range Tables. +* put-text-property: Changing Properties. +* putf: Other Plists. +* puthash: Working With Hash Tables. +* query-replace-history: Minibuffer History. +* query-replace-map <1>: Standard Keymaps. +* query-replace-map: Search and Replace. +* querying the user: Yes-or-No Queries. +* question mark in character constant: Character Type. +* quietly-read-abbrev-file: Abbrev Files. +* quit-flag: Quitting. +* quit-process: Signals to Processes. +* quitting: Quitting. +* quitting from infinite loop: Infinite Loops. +* quote: Quoting. +* quote character: Parsing Expressions. +* quoted character input: Quoted Character Input. +* quoted-insert suppression: Changing Key Bindings. +* quoting: Quoting. +* quoting characters in printing: Output Functions. +* quoting using apostrophe: Quoting. +* raise-frame: Raising and Lowering. +* raising a frame: Raising and Lowering. +* random: Random Numbers. +* random numbers: Random Numbers. +* range table type: Range Table Type. +* Range Tables: Range Tables. +* range-table-p: Range Tables. +* rassoc: Association Lists. +* rassq: Association Lists. +* raw prefix argument: Prefix Command Arguments. +* raw prefix argument usage: Interactive Codes. +* re-search-backward: Regexp Search. +* re-search-forward: Regexp Search. +* read: Input Functions. +* read command name: Interactive Call. +* read syntax: Printed Representation. +* read syntax for characters: Character Type. +* read-buffer: High-Level Completion. +* read-char: Reading One Event. +* read-command: High-Level Completion. +* read-expression: Object from Minibuffer. +* read-expression-history: Minibuffer History. +* read-expression-map: Standard Keymaps. +* read-file-name: Reading File Names. +* read-from-minibuffer: Text from Minibuffer. +* read-from-string: Input Functions. +* read-key-sequence: Key Sequence Input. +* read-minibuffer: Object from Minibuffer. +* read-only buffer: Read Only Buffers. +* read-only buffers in interactive: Using Interactive. +* read-passwd: Reading a Password. +* read-quoted-char: Quoted Character Input. +* read-quoted-char quitting: Quitting. +* read-shell-command-map: Standard Keymaps. +* read-string: Text from Minibuffer. +* read-variable: High-Level Completion. +* reading: Streams Intro. +* reading (Edebug): Reading in Edebug. +* reading interactive arguments: Interactive Codes. +* reading symbols: Creating Symbols. +* rearrangement of lists: Rearrangement. +* rebinding: Changing Key Bindings. +* receiving ToolTalk messages: Receiving Messages. +* recent-auto-save-p: Auto-Saving. +* recent-keys: Recording Input. +* recent-keys-ring-size: Recording Input. +* recenter: Vertical Scrolling. +* record command history: Interactive Call. +* recursion: Iteration. +* recursion-depth: Recursive Editing. +* recursive command loop: Recursive Editing. +* recursive editing level: Recursive Editing. +* recursive evaluation: Intro Eval. +* recursive-edit: Recursive Editing. +* redo: Undo. +* redraw-display: Refresh Screen. +* redraw-frame: Refresh Screen. +* redraw-modeline: Modeline Format. +* refresh display: Refresh Screen. +* regexp: Regular Expressions. +* regexp alternative: Syntax of Regexps. +* regexp grouping: Syntax of Regexps. +* regexp searching: Regexp Search. +* regexp-history: Minibuffer History. +* regexp-quote: Syntax of Regexps. +* regexps used standardly in editing: Standard Regexps. +* region argument: Interactive Codes. +* region, the: The Region. +* region-active-p: The Region. +* region-beginning: The Region. +* region-end: The Region. +* region-exists-p: The Region. +* register-alist: Registers. +* register-ccl-program: Calling CCL. +* register-tooltalk-pattern: Elisp Interface for Receiving Messages. +* registers: Registers. +* regular expression: Regular Expressions. +* regular expression searching: Regexp Search. +* reindent-then-newline-and-indent: Mode-Specific Indent. +* relabel-menu-item: Modifying Menus. +* relative file name: Relative File Names. +* remainder: Arithmetic Operations. +* remassoc: Association Lists. +* remassq: Association Lists. +* remhash: Working With Hash Tables. +* remove-database: Working With a Database. +* remove-face-property: Face Properties. +* remove-glyph-property: Glyph Properties. +* remove-hook: Hooks. +* remove-range-table: Working With Range Tables. +* remove-specifier: Other Specification Functions. +* remove-text-properties: Changing Properties. +* remprop: Object Plists. +* remrassoc: Association Lists. +* remrassq: Association Lists. +* rename-auto-save-file: Auto-Saving. +* rename-buffer: Buffer Names. +* rename-file: Changing File Attributes. +* renaming files: Changing File Attributes. +* repeated loading: Repeated Loading. +* replace bindings: Changing Key Bindings. +* replace characters: Substitution. +* replace-buffer-in-windows: Displaying Buffers. +* replace-match: Replacing Match. +* replacement: Search and Replace. +* repositioning format arguments: Formatting Strings. +* require: Named Features. +* require-final-newline: Saving Buffers. +* requiring features: Named Features. +* reset-char-table: Working With Char Tables. +* resize redisplay: Size and Position. +* rest arguments: Argument List. +* restriction (in a buffer): Narrowing. +* resume (cf. no-redraw-on-reenter): Refresh Screen. +* return: Character Type. +* return-tooltalk-message: Elisp Interface for Sending Messages. +* reveal-annotation: Annotation Properties. +* reverse: Building Lists. +* reversing a list: Rearrangement. +* revert-buffer: Reverting. +* revert-buffer-function: Reverting. +* revert-buffer-insert-file-contents-function: Reverting. +* right-gutter: Specifying a Gutter. +* right-gutter-visible-p: Other Gutter Variables. +* right-gutter-width: Other Gutter Variables. +* right-margin-width: Margin Primitives. +* right-toolbar: Specifying the Toolbar. +* right-toolbar-visible-p: Other Toolbar Variables. +* right-toolbar-width: Other Toolbar Variables. +* rm: Changing File Attributes. +* round: Numeric Conversions. +* rounding in conversions: Numeric Conversions. +* rounding without conversion: Rounding Operations. +* rplaca: Modifying Lists. +* rplacd: Modifying Lists. +* run time stack: Internals of Debugger. +* run-emacs-from-temacs: Building XEmacs. +* run-hooks: Hooks. +* runnable temacs: Building XEmacs. +* same-window-buffer-names: Choosing Window. +* same-window-regexps: Choosing Window. +* save-abbrevs: Abbrev Files. +* save-buffer: Saving Buffers. +* save-current-buffer: Excursions. +* save-excursion: Excursions. +* save-excursion (Edebug): Edebug Display Update. +* save-match-data: Saving Match Data. +* save-restriction: Narrowing. +* save-selected-frame: Input Focus. +* save-selected-window <1>: Excursions. +* save-selected-window: Selecting Windows. +* save-some-buffers: Saving Buffers. +* save-window-excursion: Window Configurations. +* saving text properties: Saving Properties. +* saving window information: Window Configurations. +* scan-lists: Parsing Expressions. +* scan-sexps: Parsing Expressions. +* scope: Variable Scoping. +* screen layout: Window Configuration Type. +* scroll-conservatively: Vertical Scrolling. +* scroll-down: Vertical Scrolling. +* scroll-left: Horizontal Scrolling. +* scroll-other-window: Vertical Scrolling. +* scroll-right: Horizontal Scrolling. +* scroll-step: Vertical Scrolling. +* scroll-up: Vertical Scrolling. +* scrollbar-pointer-glyph: Mouse Pointer. +* scrollbars: Scrollbars. +* scrolling vertically: Vertical Scrolling. +* search-backward: String Search. +* search-failed: String Search. +* search-forward: String Search. +* searching: Searching and Matching. +* searching and case: Searching and Case. +* searching for regexp: Regexp Search. +* second: List Elements. +* select-console: The Selected Console and Device. +* select-device: The Selected Console and Device. +* select-frame: Input Focus. +* select-frame-hook: Frame Hooks. +* select-window: Selecting Windows. +* selected frame: Input Focus. +* selected window: Basic Windows. +* selected-console: The Selected Console and Device. +* selected-device: The Selected Console and Device. +* selected-frame: Input Focus. +* selected-window: Selecting Windows. +* selecting a buffer: Current Buffer. +* selecting windows: Selecting Windows. +* selection (for X windows): X Selections. +* selection-pointer-glyph: Mouse Pointer. +* selective display: Selective Display. +* selective-display: Selective Display. +* selective-display-ellipses: Selective Display. +* self-evaluating form: Self-Evaluating Forms. +* self-insert-and-exit: Minibuffer Misc. +* self-insert-command: Commands for Insertion. +* self-insert-command override: Changing Key Bindings. +* self-insert-command, minor modes: Keymaps and Minor Modes. +* self-insertion: Commands for Insertion. +* send-string-to-terminal: Terminal Output. +* send-tooltalk-message: Elisp Interface for Sending Messages. +* sending signals: Signals to Processes. +* sending ToolTalk messages: Sending Messages. +* sentence-end: Standard Regexps. +* sentinel: Sentinels. +* sequence: Sequences Arrays Vectors. +* sequence length: Sequence Functions. +* sequencep: Sequence Functions. +* set: Setting Variables. +* set-annotation-action: Annotation Properties. +* set-annotation-data: Annotation Properties. +* set-annotation-down-glyph: Annotation Properties. +* set-annotation-face: Annotation Properties. +* set-annotation-glyph: Annotation Properties. +* set-annotation-layout: Annotation Properties. +* set-annotation-menu: Annotation Properties. +* set-auto-mode: Auto Major Mode. +* set-buffer: Current Buffer. +* set-buffer-auto-saved: Auto-Saving. +* set-buffer-major-mode: Auto Major Mode. +* set-buffer-menubar: Menubar. +* set-buffer-modified-p: Buffer Modification. +* set-case-syntax: Case Tables. +* set-case-syntax-delims: Case Tables. +* set-case-syntax-pair: Case Tables. +* set-case-table: Case Tables. +* set-category-table: Category Tables. +* set-charset-ccl-program: Charset Property Functions. +* set-coding-category-system: Detection of Textual Encoding. +* set-coding-priority-list: Detection of Textual Encoding. +* set-console-type-image-conversion-list: Image Instantiator Conversion. +* set-default: Default Value. +* set-default-file-modes: Changing File Attributes. +* set-default-gutter-position: Specifying a Gutter. +* set-default-toolbar-position: Specifying the Toolbar. +* set-device-baud-rate <1>: Terminal Output. +* set-device-baud-rate: Console and Device I/O. +* set-extent-begin-glyph: Extent Properties. +* set-extent-begin-glyph-layout: Extent Properties. +* set-extent-end-glyph: Extent Properties. +* set-extent-end-glyph-layout: Extent Properties. +* set-extent-endpoints: Extent Endpoints. +* set-extent-face: Extent Properties. +* set-extent-initial-redisplay-function: Extent Properties. +* set-extent-keymap: Extent Properties. +* set-extent-mouse-face: Extent Properties. +* set-extent-parent: Extent Parents. +* set-extent-priority: Extent Properties. +* set-extent-properties: Extent Properties. +* set-extent-property: Extent Properties. +* set-face-background: Face Convenience Functions. +* set-face-background-pixmap: Face Convenience Functions. +* set-face-font: Face Convenience Functions. +* set-face-foreground: Face Convenience Functions. +* set-face-property: Face Properties. +* set-face-underline-p: Face Convenience Functions. +* set-file-modes: Changing File Attributes. +* set-frame-configuration: Frame Configurations. +* set-frame-pointer: Mouse Pointer. +* set-frame-position: Size and Position. +* set-frame-properties: Property Access. +* set-frame-property: Property Access. +* set-frame-size: Size and Position. +* set-glyph-baseline: Glyph Convenience Functions. +* set-glyph-contrib-p: Glyph Convenience Functions. +* set-glyph-face: Glyph Convenience Functions. +* set-glyph-image: Glyph Convenience Functions. +* set-glyph-property: Glyph Properties. +* set-input-mode: Input Modes. +* set-keymap-default-binding: Inheritance and Keymaps. +* set-keymap-name: Creating Keymaps. +* set-keymap-parents: Inheritance and Keymaps. +* set-keymap-prompt: Other Keymap Functions. +* set-left-margin: Margins. +* set-mark: The Mark. +* set-marker: Changing Markers. +* set-match-data: Entire Match Data. +* set-menubar: Menubar. +* set-menubar-dirty-flag: Menubar. +* set-process-buffer: Process Buffers. +* set-process-filter: Filter Functions. +* set-process-sentinel: Sentinels. +* set-process-window-size: Process Window Size. +* set-recent-keys-ring-size: Recording Input. +* set-register: Registers. +* set-right-margin: Margins. +* set-specifier: Adding Specifications. +* set-standard-case-table: Case Tables. +* set-syntax-table: Syntax Table Functions. +* set-text-properties: Changing Properties. +* set-tooltalk-message-attribute: Elisp Interface for Sending Messages. +* set-visited-file-modtime: Modification Time. +* set-visited-file-name: Buffer File Name. +* set-weak-list-list: Weak Lists. +* set-window-buffer: Buffers and Windows. +* set-window-buffer-dedicated: Choosing Window. +* set-window-configuration: Window Configurations. +* set-window-dedicated-p: Choosing Window. +* set-window-hscroll: Horizontal Scrolling. +* set-window-point: Window Point. +* set-window-start: Window Start. +* setcar: Setcar. +* setcdr: Setcdr. +* setenv: System Environment. +* setplist: Object Plists. +* setprv: System Environment. +* setq: Setting Variables. +* setq-default: Default Value. +* sets: Sets And Lists. +* setting modes of files: Changing File Attributes. +* setting-constant: Constant Variables. +* seventh: List Elements. +* sexp motion: List Motion. +* shadowing of variables: Local Variables. +* shallow binding: Impl of Scope. +* shared-lisp-mode-map: Standard Keymaps. +* Shell mode modeline-format: Modeline Data. +* shell-command-history: Minibuffer History. +* shrink-window: Resizing Windows. +* shrink-window-horizontally: Resizing Windows. +* shrink-window-pixels: Resizing Windows. +* side effect: Intro Eval. +* signal: Signaling Errors. +* signal-error: Signaling Errors. +* signal-process: Signals to Processes. +* signaling errors: Signaling Errors. +* signals: Signals to Processes. +* sin: Math Functions. +* single-key-description: Describing Characters. +* sinh: Math Functions. +* sit-for: Waiting. +* site-init.el: Building XEmacs. +* site-load.el: Building XEmacs. +* site-run-file: Init File. +* site-start.el: Start-up Summary. +* sixth: List Elements. +* size of frame: Size and Position. +* size of window: Size of Window. +* skip-chars-backward: Skipping Characters. +* skip-chars-forward: Skipping Characters. +* skip-syntax-backward: Motion and Syntax. +* skip-syntax-forward: Motion and Syntax. +* skipping characters: Skipping Characters. +* skipping comments: Parsing Expressions. +* sleep-for: Waiting. +* Snarf-documentation: Accessing Documentation. +* sort: Rearrangement. +* sort-columns: Sorting. +* sort-fields: Sorting. +* sort-lines: Sorting. +* sort-numeric-fields: Sorting. +* sort-pages: Sorting. +* sort-paragraphs: Sorting. +* sort-regexp-fields: Sorting. +* sort-subr: Sorting. +* sorting lists: Rearrangement. +* sorting text: Sorting. +* sound: Beeping. +* sound-alist: Beeping. +* special: Major Mode Conventions. +* special form descriptions: A Sample Function Description. +* special form evaluation: Special Forms. +* special forms: Primitive Function Type. +* special forms (Edebug): Instrumenting. +* special forms for control structures: Control Structures. +* special-display-buffer-names: Choosing Window. +* special-display-frame-plist: Choosing Window. +* special-display-function: Choosing Window. +* special-display-popup-frame: Choosing Window. +* special-display-regexps: Choosing Window. +* specification (in a specifier): Specifiers In-Depth. +* specifier: Specifiers. +* specifier type: Specifier Type. +* specifier, domain: Specifiers In-Depth. +* specifier, fallback: Specifier Instancing. +* specifier, inst-list: Specifiers In-Depth. +* specifier, inst-pair: Specifiers In-Depth. +* specifier, instance: Specifiers In-Depth. +* specifier, instancing: Specifiers In-Depth. +* specifier, instantiator: Specifiers In-Depth. +* specifier, locale: Specifiers In-Depth. +* specifier, specification: Specifiers In-Depth. +* specifier, tag: Specifiers In-Depth. +* specifier, tag set: Specifiers In-Depth. +* specifier-fallback: Retrieving Specifications. +* specifier-instance: Specifier Instancing Functions. +* specifier-instance-from-inst-list: Specifier Instancing Functions. +* specifier-locale-type-from-locale: Other Specification Functions. +* specifier-spec-list: Retrieving Specifications. +* specifier-specs: Retrieving Specifications. +* specifier-tag-list: Specifier Tag Functions. +* specifier-tag-predicate: Specifier Tag Functions. +* specifier-type: Specifier Types. +* specifierp: Specifiers. +* speedups: Compilation Tips. +* splicing (with backquote): Backquote. +* split-height-threshold: Choosing Window. +* split-line: Commands for Insertion. +* split-path: Regexp Search. +* split-string: Regexp Search. +* split-window: Splitting Windows. +* split-window-horizontally: Splitting Windows. +* split-window-vertically: Splitting Windows. +* splitting windows: Splitting Windows. +* sqrt: Math Functions. +* stable sort: Rearrangement. +* standard regexps used in editing: Standard Regexps. +* standard-case-table: Case Tables. +* standard-category-table: Category Tables. +* standard-input: Input Functions. +* standard-output: Output Variables. +* standard-syntax-table: Standard Syntax Tables. +* standards of coding style: Tips. +* start up of XEmacs: Start-up Summary. +* start-process: Asynchronous Processes. +* start-process-shell-command: Asynchronous Processes. +* startup.el: Start-up Summary. +* stop points: Using Edebug. +* stop-process: Signals to Processes. +* stopping an infinite loop: Infinite Loops. +* stopping on events: Global Break Condition. +* store-match-data: Entire Match Data. +* stream (for printing): Output Streams. +* stream (for reading): Input Streams. +* string: Creating Strings. +* string equality: Text Comparison. +* string in keymap: Key Lookup. +* string input stream: Input Streams. +* string length: Sequence Functions. +* string length, maximum when printing: Output Variables. +* string properties: String Properties. +* string search: String Search. +* string to character: String Conversion. +* string to number: String Conversion. +* string to object: Input Functions. +* string, writing a doc string: Documentation Basics. +* string-equal: Text Comparison. +* string-lessp: Text Comparison. +* string-match: Regexp Search. +* string-modified-tick: Modifying Strings. +* string-to-char: String Conversion. +* string-to-int: String Conversion. +* string-to-number: String Conversion. +* string<: Text Comparison. +* string=: Text Comparison. +* stringp: Predicates for Strings. +* strings: Strings and Characters. +* strings, formatting them: Formatting Strings. +* strings, modifying: Modifying Strings. +* string quote: Syntax Class Table. +* subprocess: Processes. +* subr: What Is a Function. +* subrp: What Is a Function. +* subsidiary-coding-system: Basic Coding System Functions. +* subst-char-in-region: Substitution. +* substitute-command-keys: Keys in Documentation. +* substitute-in-file-name: File Name Expansion. +* substitute-key-definition: Changing Key Bindings. +* substituting keys in documentation: Keys in Documentation. +* substring: Creating Strings. +* subwindow type: Subwindow Type. +* subwindow-image-instance-p: Image Instance Types. +* subwindowp: Subwindows. +* suppress-keymap: Changing Key Bindings. +* suspend (cf. no-redraw-on-reenter): Refresh Screen. +* suspend evaluation: Recursive Editing. +* suspend-emacs: Suspending XEmacs. +* suspend-hook: Suspending XEmacs. +* suspend-resume-hook: Suspending XEmacs. +* suspending XEmacs: Suspending XEmacs. +* switch-to-buffer: Displaying Buffers. +* switch-to-buffer-other-window: Displaying Buffers. +* switches on command line: Command Line Arguments. +* switching to a buffer: Displaying Buffers. +* symbol: Symbols. +* symbol components: Symbol Components. +* symbol equality: Creating Symbols. +* symbol evaluation: Symbol Forms. +* symbol function indirection: Function Indirection. +* symbol in keymap: Key Lookup. +* symbol name hashing: Creating Symbols. +* symbol-function: Function Cells. +* symbol-name: Creating Symbols. +* symbol-plist: Object Plists. +* symbol-value: Accessing Variables. +* symbolp: Symbols. +* symbol constituent: Syntax Class Table. +* synchronous subprocess: Synchronous Processes. +* syntax classes: Syntax Descriptors. +* syntax descriptor: Syntax Descriptors. +* syntax error (Edebug): Backtracking. +* syntax flags: Syntax Flags. +* syntax for characters: Character Type. +* syntax table: Syntax Tables. +* syntax table example: Example Major Modes. +* syntax table internals: Syntax Table Internals. +* syntax tables in modes: Major Mode Conventions. +* syntax-table: Syntax Table Functions. +* syntax-table-p: Syntax Basics. +* system-configuration: System Environment. +* system-name: System Environment. +* system-type: System Environment. +* t: Constant Variables. +* t and truth: nil and t. +* t input stream: Input Streams. +* t output stream: Output Streams. +* tab: Character Type. +* tab deletion: Deletion. +* tab-stop-list: Indent Tabs. +* tab-to-tab-stop: Indent Tabs. +* tab-width: Usual Display. +* tabs stops for indentation: Indent Tabs. +* tag (in a specifier): Specifiers In-Depth. +* tag on run time stack: Catch and Throw. +* tag set (in a specifier): Specifiers In-Depth. +* tan: Math Functions. +* tanh: Math Functions. +* TCP: Network. +* temacs: Building XEmacs. +* temp-buffer-show-function: Temporary Displays. +* temp-directory: Unique File Names. +* tenth: List Elements. +* TERM environment variable: Terminal-Specific. +* term-file-prefix: Terminal-Specific. +* term-setup-hook: Terminal-Specific. +* Termcap: Terminal-Specific. +* terminal frame <1>: Frames. +* terminal frame: Basic Windows. +* terminal input: Terminal Input. +* terminal input modes: Input Modes. +* terminal output: Terminal Output. +* terminal-device: Console Types and Device Classes. +* terminal-specific initialization: Terminal-Specific. +* terminate keyboard macro: Peeking and Discarding. +* termscript file: Terminal Output. +* terpri: Output Functions. +* testing types: Type Predicates. +* text: Text. +* text files and binary files: Files and MS-DOS. +* text insertion: Insertion. +* text parsing: Syntax Tables. +* text properties: Text Properties. +* text properties in files: Saving Properties. +* text-char-description: Describing Characters. +* text-image-instance-p: Image Instance Types. +* text-mode-abbrev-table: Standard Abbrev Tables. +* text-mode-map: Standard Keymaps. +* text-mode-syntax-table: Standard Syntax Tables. +* text-pointer-glyph: Mouse Pointer. +* text-properties-at: Examining Properties. +* text-property-any: Property Search. +* text-property-not-all: Property Search. +* third: List Elements. +* this-command: Command Loop Info. +* this-command-keys: Command Loop Info. +* throw: Catch and Throw. +* throw example: Recursive Editing. +* tiled windows: Basic Windows. +* timeout-event-p: Event Predicates. +* timing programs: Compilation Tips. +* tips: Tips. +* toggle-read-only: Read Only Buffers. +* toolbar: Toolbar. +* toolbar button type: Toolbar Button Type. +* toolbar-buttons-captioned-p: Other Toolbar Variables. +* toolbar-make-button-list: Toolbar Descriptor Format. +* toolbar-map <1>: Standard Keymaps. +* toolbar-map: Active Keymaps. +* toolbar-pointer-glyph: Mouse Pointer. +* toolbar-specifier-p <1>: Specifier Types. +* toolbar-specifier-p: Specifying the Toolbar. +* ToolTalk: ToolTalk Support. +* ToolTalk message: Sending Messages. +* ToolTalk pattern: Receiving Messages. +* top-gutter: Specifying a Gutter. +* top-gutter-height: Other Gutter Variables. +* top-gutter-visible-p: Other Gutter Variables. +* top-level: Recursive Editing. +* top-level form: Loading. +* top-toolbar: Specifying the Toolbar. +* top-toolbar-height: Other Toolbar Variables. +* top-toolbar-visible-p: Other Toolbar Variables. +* tq-close: Transaction Queues. +* tq-create: Transaction Queues. +* tq-enqueue: Transaction Queues. +* tracing: Tracing. +* transaction queue: Transaction Queues. +* transcendental functions: Math Functions. +* translate-region: Substitution. +* translating input events: Translating Input. +* transpose-regions: Transposition. +* true: nil and t. +* truename (of file): Truenames. +* truncate: Numeric Conversions. +* truncate-lines: Truncation. +* truncate-partial-width-windows: Truncation. +* truncation-glyph: Redisplay Glyphs. +* truth value: nil and t. +* try-completion: Basic Completion. +* two's complement: Integer Basics. +* type: Lisp Data Types. +* type checking: Type Predicates. +* type predicates: Type Predicates. +* type-of: Type Predicates. +* unbinding keys: Key Binding Commands. +* undefined: Functions for Key Lookup. +* undefined in keymap: Key Lookup. +* undefined key: Keymap Terminology. +* undo avoidance: Substitution. +* undo-boundary: Undo. +* undo-limit: Maintaining Undo. +* undo-strong-limit: Maintaining Undo. +* unexec: Building XEmacs. +* unhandled-file-name-directory: Magic File Names. +* unintern: Creating Symbols. +* uninterned symbol: Creating Symbols. +* uninterned symbols, printing: Output Variables. +* unique extents: Duplicable Extents. +* universal-argument: Prefix Command Arguments. +* unload-feature: Unloading. +* unloading: Unloading. +* unlock-buffer: File Locks. +* unmap-frame-hook: Frame Hooks. +* unread-command-event: Peeking and Discarding. +* unread-command-events: Peeking and Discarding. +* unreading: Input Streams. +* unregister-tooltalk-pattern: Elisp Interface for Receiving Messages. +* unwind-protect: Cleanups. +* unwinding: Cleanups. +* up-list: List Motion. +* upcase: Character Case. +* upcase-region: Case Changes. +* upcase-word: Case Changes. +* update display: Refresh Screen. +* update-directory-autoloads: Autoload. +* update-file-autoloads: Autoload. +* upper case: Character Case. +* upper case key sequence: Key Sequence Input. +* use-global-map: Active Keymaps. +* use-hard-newlines: Filling. +* use-left-overflow: Margin Primitives. +* use-local-map: Active Keymaps. +* use-right-overflow: Margin Primitives. +* user name completion subroutines: User Name Completion. +* user option: Defining Variables. +* user-defined error: Error Symbols. +* user-full-name: User Identification. +* user-home-directory: User Identification. +* user-login-name: User Identification. +* user-mail-address: User Identification. +* user-name-all-completions: User Name Completion. +* user-name-completion: User Name Completion. +* user-name-completion-1: User Name Completion. +* user-real-login-name: User Identification. +* user-real-uid: User Identification. +* user-uid: User Identification. +* user-variable-p: Defining Variables. +* user-variable-p example: High-Level Completion. +* valid-char-table-type-p: Char Table Types. +* valid-char-table-value-p: Working With Char Tables. +* valid-device-class-p: Console Types and Device Classes. +* valid-device-type-p: Console Types and Device Classes. +* valid-glyph-type-p: Glyph Types. +* valid-image-instance-type-p: Image Instance Types. +* valid-image-instantiator-format-p: Image Specifiers. +* valid-inst-list-p: Specifier Validation Functions. +* valid-instantiator-p: Specifier Validation Functions. +* valid-plist-p: Property Lists. +* valid-spec-list-p: Specifier Validation Functions. +* valid-specifier-domain-p: Specifier Validation Functions. +* valid-specifier-locale-p: Specifier Validation Functions. +* valid-specifier-locale-type-p: Specifier Validation Functions. +* valid-specifier-tag-p <1>: Specifier Validation Functions. +* valid-specifier-tag-p: Specifier Tag Functions. +* valid-specifier-tag-set-p: Specifier Tag Functions. +* valid-specifier-type-p: Specifier Validation Functions. +* value cell: Symbol Components. +* value of expression: Evaluation. +* values: Eval. +* variable: Variables. +* variable aliases: Variable Aliases. +* variable definition: Defining Variables. +* variable descriptions: A Sample Variable Description. +* variable limit error: Local Variables. +* variable-alias: Variable Aliases. +* variable-documentation: Documentation Basics. +* variable-obsoleteness-doc: Obsoleteness. +* variables, buffer-local: Buffer-Local Variables. +* variables, indirect: Variable Aliases. +* vc-mode: Modeline Variables. +* vconcat: Vector Functions. +* vector <1>: Vector Functions. +* vector: Vectors. +* vector evaluation: Self-Evaluating Forms. +* vector length: Sequence Functions. +* vectorp: Vector Functions. +* verify-visited-file-modtime: Modification Time. +* version number (in file name): File Name Components. +* version-control: Numbered Backups. +* vertical scrolling: Vertical Scrolling. +* vertical tab: Character Type. +* vertical-motion: Screen Lines. +* vertical-motion-pixels: Screen Lines. +* view-file: Visiting Functions. +* view-mode-map: Standard Keymaps. +* view-register: Registers. +* visible frame: Visibility of Frames. +* visible-bell: Beeping. +* visible-frame-list: Finding All Frames. +* visited file: Buffer File Name. +* visited file mode: Auto Major Mode. +* visited-file-modtime: Modification Time. +* visiting files: Visiting Files. +* void function: Function Indirection. +* void function cell: Function Cells. +* void variable: Void Variables. +* void-function: Function Cells. +* void-variable: Void Variables. +* waiting: Waiting. +* waiting for command key input: Peeking and Discarding. +* waiting-for-user-input-p: Sentinels. +* wakeup: Subprocess Creation. +* walk-windows: Cyclic Window Ordering. +* weak hash table: Weak Hash Tables. +* weak list: Weak Lists. +* weak list type: Weak List Type. +* weak-list-list: Weak Lists. +* weak-list-p: Weak Lists. +* weak-list-type: Weak Lists. +* where-is-internal: Scanning Keymaps. +* while: Iteration. +* whitespace: Character Type. +* whitespace character: Syntax Class Table. +* widen: Narrowing. +* widening: Narrowing. +* window: Basic Windows. +* window configuration (Edebug): Edebug Display Update. +* window configurations: Window Configurations. +* window excursions: Excursions. +* window ordering, cyclic: Cyclic Window Ordering. +* window point: Window Point. +* window position <1>: Position of Window. +* window position: Window Point. +* window resizing: Resizing Windows. +* window size: Size of Window. +* window size, changing: Resizing Windows. +* window splitting: Splitting Windows. +* window system types: Window-System Types. +* window top line: Window Start. +* window-buffer: Buffers and Windows. +* window-configuration-p: Window Configurations. +* window-dedicated-p: Choosing Window. +* window-displayed-text-pixel-height: Size of Window. +* window-end: Window Start. +* window-frame: Frames and Windows. +* window-height: Size of Window. +* window-highest-p: Position of Window. +* window-hscroll: Horizontal Scrolling. +* window-left-margin-pixel-width: Margin Primitives. +* window-live-p: Deleting Windows. +* window-lowest-p: Position of Window. +* window-min-height: Resizing Windows. +* window-min-width: Resizing Windows. +* window-minibuffer-p: Minibuffer Misc. +* window-pixel-edges: Position of Window. +* window-pixel-height: Size of Window. +* window-pixel-width: Size of Window. +* window-point: Window Point. +* window-right-margin-pixel-width: Margin Primitives. +* window-setup-hook: Terminal-Specific. +* window-size-change-functions: Resizing Windows. +* window-start: Window Start. +* window-system objects: Faces and Window-System Objects. +* window-text-area-pixel-edges: Position of Window. +* window-text-area-pixel-height: Size of Window. +* window-text-area-pixel-width: Size of Window. +* window-width: Size of Window. +* windowp: Basic Windows. +* windows, controlling precisely: Buffers and Windows. +* with-current-buffer: Excursions. +* with-output-to-temp-buffer: Temporary Displays. +* with-selected-frame: Input Focus. +* with-temp-file: Excursions. +* word search: String Search. +* word-search-backward: String Search. +* word-search-forward: String Search. +* words-include-escapes: Word Motion. +* word constituent: Syntax Class Table. +* write-abbrev-file: Abbrev Files. +* write-char: Output Functions. +* write-contents-hooks: Saving Buffers. +* write-file: Saving Buffers. +* write-file-hooks: Saving Buffers. +* write-region: Writing to Files. +* write-region-annotate-functions: Saving Properties. +* writing a documentation string: Documentation Basics. +* wrong-number-of-arguments: Argument List. +* wrong-type-argument: Type Predicates. +* X: X-Windows. +* X resource type: X Resource Type. +* X window frame: Frames. +* x-allow-sendevents: X Miscellaneous. +* x-bitmap-file-path <1>: X Miscellaneous. +* x-bitmap-file-path: Image Specifiers. +* x-debug-events: X Miscellaneous. +* x-debug-mode: X Miscellaneous. +* x-disown-selection: X Selections. +* x-display-visual-class: Server Data. +* x-emacs-application-class: Resources. +* x-find-larger-font: Font Instance Size. +* x-find-smaller-font: Font Instance Size. +* x-font-size: Font Instance Size. +* x-get-cutbuffer: X Selections. +* x-get-resource: Resources. +* x-get-selection: X Selections. +* x-grab-keyboard: Grabs. +* x-grab-pointer: Grabs. +* x-library-search-path: X Miscellaneous. +* x-make-font-bold: Font Instance Characteristics. +* x-make-font-bold-italic: Font Instance Characteristics. +* x-make-font-italic: Font Instance Characteristics. +* x-make-font-unbold: Font Instance Characteristics. +* x-make-font-unitalic: Font Instance Characteristics. +* x-own-selection: X Selections. +* x-put-resource: Resources. +* x-server-vendor: Server Data. +* x-server-version: Server Data. +* x-set-frame-icon-pixmap: Frame Titles. +* x-store-cutbuffer: X Selections. +* x-ungrab-keyboard: Grabs. +* x-ungrab-pointer: Grabs. +* x-valid-keysym-name-p: X Miscellaneous. +* x-window-id: X Miscellaneous. +* X-Windows: X-Windows. +* XEmacs event standard notation: Describing Characters. +* xpm-color-symbols: Image Specifiers. +* y-or-n-p: Yes-or-No Queries. +* y-or-n-p-maybe-dialog-box: Yes-or-No Queries. +* yank: Yank Commands. +* yank suppression: Changing Key Bindings. +* yank-pop: Yank Commands. +* yes-or-no questions: Yes-or-No Queries. +* yes-or-no-p: Yes-or-No Queries. +* yes-or-no-p-dialog-box: Yes-or-No Queries. +* yes-or-no-p-maybe-dialog-box: Yes-or-No Queries. +* zero-length extent: Extent Endpoints. +* zerop: Predicates on Numbers. +* zmacs-activate-region: The Region. +* zmacs-activate-region-hook: The Region. +* zmacs-deactivate-region: The Region. +* zmacs-deactivate-region-hook: The Region. +* zmacs-region-stays: The Region. +* zmacs-regions: The Region. +* zmacs-update-region: The Region. +* zmacs-update-region-hook: The Region. +* | in regexp: Syntax of Regexps. + + diff --git a/info/lispref.info-47 b/info/lispref.info-47 new file mode 100644 index 0000000..4f23472 --- /dev/null +++ b/info/lispref.info-47 @@ -0,0 +1,3484 @@ +This is ../info/lispref.info, produced by makeinfo version 4.0 from +lispref/lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Index, Prev: Standard Hooks, Up: Top + +Index +***** + +* Menu: + +* " in printing: Output Functions. +* " in strings: String Type. +* #$: Docs and Compilation. +* #@COUNT: Docs and Compilation. +* $ in display: Truncation. +* $ in regexp: Syntax of Regexps. +* %: Arithmetic Operations. +* % in format: Formatting Strings. +* & in replacement: Replacing Match. +* &define (Edebug): Specification List. +* ¬ (Edebug): Specification List. +* &optional: Argument List. +* &optional (Edebug): Specification List. +* &or (Edebug): Specification List. +* &rest: Argument List. +* &rest (Edebug): Specification List. +* ' for quoting: Quoting. +* ( in regexp: Syntax of Regexps. +* (...) in lists: Cons Cell Type. +* ) in regexp: Syntax of Regexps. +* *: Arithmetic Operations. +* * in interactive: Using Interactive. +* * in regexp: Syntax of Regexps. +* *? in regexp: Syntax of Regexps. +* *PQfn: Unimplemented libpq Functions. +* *PQoidStatus: Unimplemented libpq Functions. +* *PQsetdb: Unimplemented libpq Functions. +* *PQsetdbLogin: Unimplemented libpq Functions. +* *scratch*: Auto Major Mode. +* +: Arithmetic Operations. +* + in regexp: Syntax of Regexps. +* +? in regexp: Syntax of Regexps. +* , (with Backquote): Backquote. +* ,@ (with Backquote): Backquote. +* -: Arithmetic Operations. +* . in lists: Dotted Pair Notation. +* . in regexp: Syntax of Regexps. +* .emacs: Init File. +* .emacs customization: Major Mode Conventions. +* /: Arithmetic Operations. +* /=: Comparison of Numbers. +* 1+: Arithmetic Operations. +* 1-: Arithmetic Operations. +* ; in comment: Comments. +* <: Comparison of Numbers. +* <=: Comparison of Numbers. +* : Functions for Key Lookup. +* =: Comparison of Numbers. +* >: Comparison of Numbers. +* >=: Comparison of Numbers. +* ? in character constant: Character Type. +* ? in regexp: Syntax of Regexps. +* @ in interactive: Using Interactive. +* [ in regexp: Syntax of Regexps. +* [...] (Edebug): Specification List. +* \ in character constant: Character Type. +* \ in display: Truncation. +* \ in printing: Output Functions. +* \ in regexp: Syntax of Regexps. +* \ in replacement: Replacing Match. +* \ in strings: String Type. +* \ in symbols: Symbol Type. +* \' in regexp: Syntax of Regexps. +* \(?: in regexp: Syntax of Regexps. +* \< in regexp: Syntax of Regexps. +* \= in regexp: Syntax of Regexps. +* \> in regexp: Syntax of Regexps. +* \` in regexp: Syntax of Regexps. +* \a: Character Type. +* \b: Character Type. +* \B in regexp: Syntax of Regexps. +* \b in regexp: Syntax of Regexps. +* \e: Character Type. +* \f: Character Type. +* \n: Character Type. +* \n in print: Output Variables. +* \N in replacement: Replacing Match. +* \r: Character Type. +* \S in regexp: Syntax of Regexps. +* \s in regexp: Syntax of Regexps. +* \t: Character Type. +* \v: Character Type. +* \W in regexp: Syntax of Regexps. +* \w in regexp: Syntax of Regexps. +* \{n,m\} in regexp: Syntax of Regexps. +* ] in regexp: Syntax of Regexps. +* ^ in regexp: Syntax of Regexps. +* _ in interactive: Using Interactive. +* `: Backquote. +* ` (Edebug): Debugging Backquote. +* ` (list substitution): Backquote. +* abbrev: Abbrevs. +* abbrev table: Abbrevs. +* abbrev tables in modes: Major Mode Conventions. +* abbrev-all-caps: Abbrev Expansion. +* abbrev-expansion: Abbrev Expansion. +* abbrev-file-name: Abbrev Files. +* abbrev-mode: Abbrev Mode. +* abbrev-prefix-mark: Abbrev Expansion. +* abbrev-start-location: Abbrev Expansion. +* abbrev-start-location-buffer: Abbrev Expansion. +* abbrev-symbol: Abbrev Expansion. +* abbrev-table-name-list: Abbrev Tables. +* abbreviate-file-name: Directory Names. +* abbrevs-changed: Abbrev Files. +* abort-recursive-edit: Recursive Editing. +* aborting: Recursive Editing. +* abs: Arithmetic Operations. +* absolute file name: Relative File Names. +* accelerate-menu: Menu Accelerator Functions. +* accept-process-output: Accepting Output. +* accessibility of a file: Testing Accessibility. +* accessible portion (of a buffer): Narrowing. +* accessible-keymaps: Scanning Keymaps. +* acos: Math Functions. +* acosh: Math Functions. +* activate-menubar-hook: Menubar. +* activate-popup-menu-hook: Pop-Up Menus. +* active display table: Active Display Table. +* active keymap: Active Keymaps. +* active-minibuffer-window: Minibuffer Misc. +* add-abbrev: Defining Abbrevs. +* add-hook: Hooks. +* add-menu: Modifying Menus. +* add-menu-button: Modifying Menus. +* add-menu-item: Modifying Menus. +* add-name-to-file: Changing File Attributes. +* add-spec-list-to-specifier: Adding Specifications. +* add-spec-to-specifier: Adding Specifications. +* add-submenu: Modifying Menus. +* add-text-properties: Changing Properties. +* add-timeout: Timers. +* add-to-list: Setting Variables. +* add-tooltalk-message-arg: Elisp Interface for Sending Messages. +* add-tooltalk-pattern-arg: Elisp Interface for Receiving Messages. +* add-tooltalk-pattern-attribute: Elisp Interface for Receiving Messages. +* address field of register: Cons Cell Type. +* after-change-function: Change Hooks. +* after-change-functions: Change Hooks. +* after-find-file: Subroutines of Visiting. +* after-init-hook: Init File. +* after-insert-file-functions: Saving Properties. +* after-load-alist: Hooks for Loading. +* after-revert-hook: Reverting. +* after-save-hook: Saving Buffers. +* aliases, for variables: Variable Aliases. +* alist: Association Lists. +* alist-to-plist: Converting Plists To/From Alists. +* all-annotations: Locating Annotations. +* all-completions: Basic Completion. +* and: Combining Conditions. +* annotation: Annotations. +* annotation hooks: Annotation Hooks. +* annotation-action: Annotation Properties. +* annotation-data: Annotation Properties. +* annotation-down-glyph: Annotation Properties. +* annotation-face: Annotation Properties. +* annotation-glyph: Annotation Properties. +* annotation-layout: Annotation Properties. +* annotation-list: Locating Annotations. +* annotation-menu: Annotation Properties. +* annotation-side: Annotation Properties. +* annotation-visible: Annotation Properties. +* annotation-width: Annotation Properties. +* annotationp: Annotation Primitives. +* annotations-at: Locating Annotations. +* annotations-in-region: Locating Annotations. +* anonymous function: Anonymous Functions. +* anonymous lambda expressions (Edebug): Instrumenting. +* apostrophe for quoting: Quoting. +* append: Building Lists. +* append-to-file: Writing to Files. +* apply: Calling Functions. +* apply, and debugging: Internals of Debugger. +* apropos: Help Functions. +* aref: Array Functions. +* argument binding: Argument List. +* argument descriptors: Using Interactive. +* argument evaluation form: Using Interactive. +* argument prompt: Using Interactive. +* arguments, reading: Minibuffers. +* arith-error example: Handling Errors. +* arith-error in division: Arithmetic Operations. +* arithmetic shift: Bitwise Operations. +* array: Arrays. +* array elements: Array Functions. +* arrayp: Array Functions. +* ASCII character codes: Character Type. +* aset: Array Functions. +* ash: Bitwise Operations. +* asin: Math Functions. +* asinh: Math Functions. +* ask-user-about-lock: File Locks. +* ask-user-about-supersession-threat: Modification Time. +* asking the user questions: Yes-or-No Queries. +* assoc: Association Lists. +* association list: Association Lists. +* assq: Association Lists. +* asynchronous subprocess: Asynchronous Processes. +* atan: Math Functions. +* atanh: Math Functions. +* atom <1>: List-related Predicates. +* atom: Cons Cell Type. +* atomic extent: Atomic Extents. +* atoms: List-related Predicates. +* attributes of text: Text Properties. +* Auto Fill mode: Auto Filling. +* auto-fill-function: Auto Filling. +* auto-lower-frame: Raising and Lowering. +* auto-mode-alist: Auto Major Mode. +* auto-raise-frame: Raising and Lowering. +* auto-save-default: Auto-Saving. +* auto-save-file-format: Format Conversion. +* auto-save-file-name-p: Auto-Saving. +* auto-save-hook: Auto-Saving. +* auto-save-interval: Auto-Saving. +* auto-save-list-file-name: Auto-Saving. +* auto-save-mode: Auto-Saving. +* auto-save-timeout: Auto-Saving. +* auto-save-visited-file-name: Auto-Saving. +* auto-saving: Auto-Saving. +* autoload <1>: Domain Specification. +* autoload: Autoload. +* autoload errors: Autoload. +* automatically buffer-local: Intro to Buffer-Local. +* available fonts: Font Instance Names. +* back-to-indentation: Motion by Indent. +* background pixmap: Merging Faces. +* backquote (Edebug): Debugging Backquote. +* backquote (list substitution): Backquote. +* backslash in character constant: Character Type. +* backslash in strings: String Type. +* backslash in symbols: Symbol Type. +* backspace: Character Type. +* backtrace: Internals of Debugger. +* backtrace-debug: Internals of Debugger. +* backtrace-frame: Internals of Debugger. +* backtracking: Backtracking. +* backup file: Backup Files. +* backup files, how to make them: Rename or Copy. +* backup-buffer: Making Backups. +* backup-by-copying: Rename or Copy. +* backup-by-copying-when-linked: Rename or Copy. +* backup-by-copying-when-mismatch: Rename or Copy. +* backup-enable-predicate: Making Backups. +* backup-file-name-p: Backup Names. +* backup-inhibited: Making Backups. +* backward-char: Character Motion. +* backward-delete-char-untabify: Deletion. +* backward-list: List Motion. +* backward-prefix-chars: Motion and Syntax. +* backward-sexp: List Motion. +* backward-to-indentation: Motion by Indent. +* backward-word: Word Motion. +* balancing parentheses: Blinking. +* barf-if-buffer-read-only: Read Only Buffers. +* base buffer: Indirect Buffers. +* base64: Transformations. +* base64-decode-region: Transformations. +* base64-decode-string: Transformations. +* base64-encode-region: Transformations. +* base64-encode-string: Transformations. +* batch mode: Batch Mode. +* batch-byte-compile: Compilation Functions. +* batch-byte-recompile-directory: Compilation Functions. +* beep: Beeping. +* beeping: Beeping. +* before point, insertion: Insertion. +* before-change-function: Change Hooks. +* before-change-functions: Change Hooks. +* before-init-hook: Init File. +* before-revert-hook: Reverting. +* beginning of line: Text Lines. +* beginning of line in regexp: Syntax of Regexps. +* beginning-of-buffer: Buffer End Motion. +* beginning-of-defun: List Motion. +* beginning-of-line: Text Lines. +* bell: Beeping. +* bell character: Character Type. +* bell-volume: Beeping. +* binary files and text files: Files and MS-DOS. +* binary-process-input: MS-DOS Subprocesses. +* binary-process-output: MS-DOS Subprocesses. +* bind-text-domain: Level 3 Primitives. +* binding arguments: Argument List. +* binding local variables: Local Variables. +* binding of a key: Keymap Terminology. +* bit vector: Bit Vectors. +* bit vector length: Sequence Functions. +* bit-vector: Bit Vector Functions. +* bit-vector-p: Bit Vector Functions. +* bitp: Bit Vector Functions. +* bitwise and: Bitwise Operations. +* bitwise exclusive or: Bitwise Operations. +* bitwise not: Bitwise Operations. +* bitwise or: Bitwise Operations. +* blink-matching-open: Blinking. +* blink-matching-paren: Blinking. +* blink-matching-paren-delay: Blinking. +* blink-matching-paren-distance: Blinking. +* blink-paren-function: Blinking. +* blink-paren-hook: Blinking. +* blinking: Blinking. +* bobp: Near Point. +* body of function: Lambda Components. +* bold: Font Instance Characteristics. +* bolp: Near Point. +* bookmark-map: Standard Keymaps. +* boolean: nil and t. +* boolean-specifier-p: Specifier Types. +* bootstrapping XEmacs from temacs: Building XEmacs. +* bottom-gutter: Specifying a Gutter. +* bottom-gutter-height: Other Gutter Variables. +* bottom-gutter-visible-p: Other Gutter Variables. +* bottom-toolbar: Specifying the Toolbar. +* bottom-toolbar-height: Other Toolbar Variables. +* bottom-toolbar-visible-p: Other Toolbar Variables. +* boundp: Void Variables. +* box diagrams, for lists: Cons Cell Type. +* box representation for lists: Lists as Boxes. +* break: Debugger. +* breakpoints: Breakpoints. +* bucket (in obarray): Creating Symbols. +* buffer: Buffers. +* buffer contents: Text. +* buffer file name: Buffer File Name. +* buffer input stream: Input Streams. +* buffer list: The Buffer List. +* buffer modification: Buffer Modification. +* buffer names: Buffer Names. +* buffer output stream: Output Streams. +* buffer text notation: Buffer Text Notation. +* buffer, read-only: Read Only Buffers. +* buffer-auto-save-file-name: Auto-Saving. +* buffer-backed-up: Making Backups. +* buffer-base-buffer: Indirect Buffers. +* buffer-disable-undo: Maintaining Undo. +* buffer-enable-undo: Maintaining Undo. +* buffer-end: Point. +* buffer-file-format: Format Conversion. +* buffer-file-name: Buffer File Name. +* buffer-file-number: Buffer File Name. +* buffer-file-truename: Buffer File Name. +* buffer-file-type: Files and MS-DOS. +* buffer-flush-undo: Maintaining Undo. +* buffer-glyph-p: Glyph Types. +* buffer-indirect-children: Indirect Buffers. +* buffer-invisibility-spec: Invisible Text. +* buffer-list: The Buffer List. +* buffer-live-p: Killing Buffers. +* buffer-local variables: Buffer-Local Variables. +* buffer-local variables in modes: Major Mode Conventions. +* buffer-local-variables: Creating Buffer-Local. +* Buffer-menu-mode-map: Standard Keymaps. +* buffer-modified-p: Buffer Modification. +* buffer-modified-tick: Buffer Modification. +* buffer-name: Buffer Names. +* buffer-offer-save <1>: Killing Buffers. +* buffer-offer-save: Saving Buffers. +* buffer-read-only: Read Only Buffers. +* buffer-saved-size <1>: Point. +* buffer-saved-size: Auto-Saving. +* buffer-size: Point. +* buffer-string: Buffer Contents. +* buffer-substring: Buffer Contents. +* buffer-undo-list: Undo. +* bufferp: Buffer Basics. +* buffers menu: Buffers Menu. +* buffers, controlled in windows: Buffers and Windows. +* buffers, creating: Creating Buffers. +* buffers, killing: Killing Buffers. +* buffers-menu-filter: Menu Filters. +* buffers-menu-max-size: Buffers Menu. +* buffers-menu-switch-to-buffer-function: Buffers Menu. +* building lists: Building Lists. +* building XEmacs: Building XEmacs. +* built-in function: What Is a Function. +* bury-buffer: The Buffer List. +* busy-pointer-glyph: Mouse Pointer. +* button-event-p: Event Predicates. +* button-press-event-p: Event Predicates. +* button-release-event-p: Event Predicates. +* bvconcat: Bit Vector Functions. +* byte-code <1>: Compilation Functions. +* byte-code: Byte Compilation. +* byte-code function: Compiled-Function Objects. +* byte-code interpreter: Compilation Functions. +* byte-compile: Compilation Functions. +* byte-compile-dynamic: Dynamic Loading. +* byte-compile-dynamic-docstrings: Docs and Compilation. +* byte-compile-file: Compilation Functions. +* byte-compiling macros: Compiling Macros. +* byte-compiling require: Named Features. +* byte-recompile-directory: Compilation Functions. +* byte-recompile-directory-ignore-errors-p: Compilation Functions. +* bytes: Strings and Characters. +* c++-mode-map: Standard Keymaps. +* C-c: Prefix Keys. +* C-g: Quitting. +* C-h: Prefix Keys. +* C-M-x: Instrumenting. +* c-mode-abbrev-table: Standard Abbrev Tables. +* c-mode-map: Standard Keymaps. +* c-mode-syntax-table: Standard Syntax Tables. +* C-q: Flow Control. +* C-s: Flow Control. +* C-x: Prefix Keys. +* C-x 4: Prefix Keys. +* C-x 5: Prefix Keys. +* C-x a: Prefix Keys. +* C-x n: Prefix Keys. +* C-x r: Prefix Keys. +* caaaar: List Elements. +* caaadr: List Elements. +* caaar: List Elements. +* caadar: List Elements. +* caaddr: List Elements. +* caadr: List Elements. +* caar: List Elements. +* cadaar: List Elements. +* cadadr: List Elements. +* cadar: List Elements. +* caddar: List Elements. +* cadddr: List Elements. +* caddr: List Elements. +* cadr: List Elements. +* call stack: Internals of Debugger. +* call-interactively: Interactive Call. +* call-process: Synchronous Processes. +* call-process-region: Synchronous Processes. +* calling a function: Calling Functions. +* cancel-debug-on-entry: Function Debugging. +* canonicalize-inst-list: Adding Specifications. +* canonicalize-inst-pair: Adding Specifications. +* canonicalize-lax-plist: Working With Lax Plists. +* canonicalize-plist: Working With Normal Plists. +* canonicalize-spec: Adding Specifications. +* canonicalize-spec-list: Adding Specifications. +* canonicalize-tag-set: Specifier Tag Functions. +* capitalization: Character Case. +* capitalize: Character Case. +* capitalize-region: Case Changes. +* capitalize-word: Case Changes. +* car: List Elements. +* car-safe: List Elements. +* case changes: Case Changes. +* case in replacements: Replacing Match. +* case-fold-search: Searching and Case. +* case-replace: Searching and Case. +* case-table-p: Case Tables. +* catch: Catch and Throw. +* category-designator-p: Category Tables. +* category-table: Category Tables. +* category-table-p: Category Tables. +* category-table-value-p: Category Tables. +* CBREAK: Flow Control. +* ccl-elapsed-time: Calling CCL. +* ccl-execute: Calling CCL. +* ccl-execute-on-string: Calling CCL. +* ccl-reset-elapsed-time: Calling CCL. +* cdaaar: List Elements. +* cdaadr: List Elements. +* cdaar: List Elements. +* cdadar: List Elements. +* cdaddr: List Elements. +* cdadr: List Elements. +* cdar: List Elements. +* cddaar: List Elements. +* cddadr: List Elements. +* cddar: List Elements. +* cdddar: List Elements. +* cddddr: List Elements. +* cdddr: List Elements. +* cddr: List Elements. +* CDE dt: CDE dt. +* cdr: List Elements. +* cdr-safe: List Elements. +* ceiling: Numeric Conversions. +* centering point: Vertical Scrolling. +* cerror: Signaling Errors. +* change hooks: Change Hooks. +* change-major-mode-hook: Major Mode Conventions. +* changing key bindings: Changing Key Bindings. +* changing to another buffer: Current Buffer. +* changing window size: Resizing Windows. +* char table type: Char Table Type. +* char-after: Near Point. +* char-before: Near Point. +* char-charset: MULE Characters. +* char-equal: Text Comparison. +* char-int: Character Codes. +* char-int confoundance disease: Character Type. +* char-int-p: Character Codes. +* char-octet: MULE Characters. +* char-or-char-int-p: Character Codes. +* char-or-string-p: Predicates for Strings. +* char-syntax: Syntax Table Functions. +* char-table-p: Char Tables. +* char-table-type: Char Table Types. +* char-table-type-list: Char Table Types. +* char-to-string: String Conversion. +* char=: Text Comparison. +* character arrays: Strings and Characters. +* character case: Character Case. +* character descriptor: Character Descriptors. +* character insertion: Commands for Insertion. +* character printing: Describing Characters. +* character set (in regexp): Syntax of Regexps. +* character to string: String Conversion. +* character-to-event: Converting Events. +* characteristics of font instances: Font Instance Characteristics. +* characterp: Predicates for Characters. +* characters: Strings and Characters. +* characters for interactive codes: Interactive Codes. +* character quote: Syntax Class Table. +* charset type: Charset Type. +* charset-ccl-program: Charset Property Functions. +* charset-chars: Charset Property Functions. +* charset-columns: Charset Property Functions. +* charset-dimension: Charset Property Functions. +* charset-direction: Charset Property Functions. +* charset-doc-string: Charset Property Functions. +* charset-final: Charset Property Functions. +* charset-from-attributes: Basic Charset Functions. +* charset-graphic: Charset Property Functions. +* charset-list: Basic Charset Functions. +* charset-name: Charset Property Functions. +* charset-property: Charset Property Functions. +* charset-registry: Charset Property Functions. +* charset-reverse-direction-charset: Basic Charset Functions. +* charsetp: Charsets. +* check-argument-type: Signaling Errors. +* check-gutter-button-syntax: Gutter Descriptor Format. +* check-toolbar-button-syntax: Toolbar Descriptor Format. +* check-valid-char-table-value: Working With Char Tables. +* check-valid-inst-list: Specifier Validation Functions. +* check-valid-instantiator: Specifier Validation Functions. +* check-valid-plist: Property Lists. +* check-valid-spec-list: Specifier Validation Functions. +* child process: Processes. +* children, of extent: Extent Parents. +* CL note--allocate more storage: Garbage Collection. +* CL note--case of letters: Symbol Type. +* CL note--default optional arg: Argument List. +* CL note--integers vrs eq: Comparison of Numbers. +* CL note--lack union, set: Sets And Lists. +* CL note--only throw in Emacs: Catch and Throw. +* CL note--rplaca vrs setcar: Modifying Lists. +* CL note--set local: Setting Variables. +* CL note--special forms compared: Special Forms. +* CL note--special variables: Variable Scoping. +* CL note--symbol in obarrays: Creating Symbols. +* cl-read: Reading in Edebug. +* cl-specs.el: Instrumenting. +* cl.el (Edebug): Instrumenting. +* cleanup forms: Cleanups. +* clear-abbrev-table: Abbrev Tables. +* clear-message: The Echo Area. +* clear-range-table: Working With Range Tables. +* clear-visited-file-modtime: Modification Time. +* close parenthesis: Blinking. +* close-database: Connecting to a Database. +* close parenthesis character: Syntax Class Table. +* closures not available: Extent. +* clrhash: Working With Hash Tables. +* codes, interactive, description of: Interactive Codes. +* coding standards: Tips. +* coding system type: Coding System Type. +* coding-category-list: Detection of Textual Encoding. +* coding-category-system: Detection of Textual Encoding. +* coding-priority-list: Detection of Textual Encoding. +* coding-system-base: Basic Coding System Functions. +* coding-system-doc-string: Coding System Property Functions. +* coding-system-list: Basic Coding System Functions. +* coding-system-name: Basic Coding System Functions. +* coding-system-p: Coding Systems. +* coding-system-property: Coding System Property Functions. +* coding-system-type: Coding System Property Functions. +* color instance type: Color Instance Type. +* color instances: Color Instances. +* color-instance-name: Color Instance Properties. +* color-instance-p: Color Instances. +* color-instance-rgb-components: Color Instance Properties. +* color-name: Color Convenience Functions. +* color-pixmap-image-instance-p: Image Instance Types. +* color-rgb-components: Color Convenience Functions. +* color-specifier-p <1>: Color Specifiers. +* color-specifier-p: Specifier Types. +* colorize-image-instance: Image Instance Functions. +* colors: Colors. +* columns: Columns. +* command: What Is a Function. +* command descriptions: A Sample Function Description. +* command history: Command History. +* command in keymap: Key Lookup. +* command line arguments: Command Line Arguments. +* command line options: Command Line Arguments. +* command loop: Command Loop. +* command loop, recursive: Recursive Editing. +* command-debug-status: Internals of Debugger. +* command-execute: Interactive Call. +* command-history: Command History. +* command-history-map: Standard Keymaps. +* command-line: Command Line Arguments. +* command-line-args: Command Line Arguments. +* command-line-functions: Command Line Arguments. +* command-line-processed: Command Line Arguments. +* command-switch-alist: Command Line Arguments. +* commandp: Interactive Call. +* commandp example: High-Level Completion. +* commands, defining: Defining Commands. +* comment syntax: Syntax Class Table. +* comments: Comments. +* comment ender: Syntax Class Table. +* comment starter: Syntax Class Table. +* Common Lisp: Lisp History. +* Common Lisp (Edebug): Instrumenting. +* compare-buffer-substrings: Comparing Text. +* comparing buffer text: Comparing Text. +* comparison of modification time: Modification Time. +* compilation: Byte Compilation. +* compilation functions: Compilation Functions. +* compile-defun: Compilation Functions. +* compiled function: Compiled-Function Objects. +* compiled-function-arglist: Compiled-Function Objects. +* compiled-function-constants: Compiled-Function Objects. +* compiled-function-doc-string: Compiled-Function Objects. +* compiled-function-domain: Compiled-Function Objects. +* compiled-function-instructions: Compiled-Function Objects. +* compiled-function-interactive: Compiled-Function Objects. +* compiled-function-p: What Is a Function. +* compiled-function-stack-size: Compiled-Function Objects. +* complete key: Keymap Terminology. +* completing-read: Minibuffer Completion. +* completion: Completion. +* completion, file name: File Name Completion. +* completion, user name: User Name Completion. +* completion-auto-help: Completion Commands. +* completion-ignore-case: Basic Completion. +* completion-ignored-extensions: File Name Completion. +* complex arguments: Minibuffers. +* complex command: Command History. +* complex-buffers-menu-p: Buffers Menu. +* compose-region: Composite Characters. +* composite-char-string: Composite Characters. +* concat: Creating Strings. +* concatenating lists: Rearrangement. +* concatenating strings: Creating Strings. +* cond: Conditionals. +* condition name: Error Symbols. +* condition-case: Handling Errors. +* conditional evaluation: Conditionals. +* cons: Building Lists. +* cons cell as box: Lists as Boxes. +* cons cells: Building Lists. +* consing: Building Lists. +* console-device-list: Basic Console Functions. +* console-disable-input: Console and Device I/O. +* console-enable-input: Console and Device I/O. +* console-list: Basic Console Functions. +* console-live-p: Connecting to a Console or Device. +* console-type-image-conversion-list: Image Instantiator Conversion. +* consolep: Consoles and Devices. +* consoles: Consoles and Devices. +* consp: List-related Predicates. +* continuation lines: Truncation. +* continuation-glyph: Redisplay Glyphs. +* continue-process: Signals to Processes. +* control character printing: Describing Characters. +* control characters: Character Type. +* control characters in display: Usual Display. +* control characters, reading: Quoted Character Input. +* control structures: Control Structures. +* control-arrow-glyph: Redisplay Glyphs. +* Control-X-prefix: Prefix Keys. +* conventions for writing minor modes: Minor Mode Conventions. +* conversion of image instantiators: Image Instantiator Conversion. +* conversion of strings: String Conversion. +* copy-alist: Association Lists. +* copy-category-table: Category Tables. +* copy-coding-system: Basic Coding System Functions. +* copy-event: Working With Events. +* copy-extent: Detached Extents. +* copy-face: Basic Face Functions. +* copy-file: Changing File Attributes. +* copy-hash-table: Introduction to Hash Tables. +* copy-keymap: Creating Keymaps. +* copy-marker: Creating Markers. +* copy-range-table: Introduction to Range Tables. +* copy-region-as-kill: Kill Functions. +* copy-sequence: Sequence Functions. +* copy-specifier: Other Specification Functions. +* copy-syntax-table: Syntax Table Functions. +* copying alists: Association Lists. +* copying bit vectors: Bit Vector Functions. +* copying files: Changing File Attributes. +* copying lists: Building Lists. +* copying sequences: Sequence Functions. +* copying strings: Creating Strings. +* copying vectors: Vector Functions. +* cos: Math Functions. +* cosh: Math Functions. +* count-lines: Text Lines. +* count-loop: A Sample Function Description. +* counting columns: Columns. +* coverage testing: Coverage Testing. +* create-device-hook: Connecting to a Console or Device. +* create-file-buffer: Subroutines of Visiting. +* create-frame-hook: Frame Hooks. +* create-tooltalk-message: Elisp Interface for Sending Messages. +* create-tooltalk-pattern: Elisp Interface for Receiving Messages. +* creating buffers: Creating Buffers. +* creating keymaps: Creating Keymaps. +* ctl-arrow: Usual Display. +* ctl-x-4-map <1>: Standard Keymaps. +* ctl-x-4-map: Prefix Keys. +* ctl-x-5-map <1>: Standard Keymaps. +* ctl-x-5-map: Prefix Keys. +* ctl-x-map <1>: Standard Keymaps. +* ctl-x-map: Prefix Keys. +* cube-root: Math Functions. +* current binding: Local Variables. +* current buffer: Current Buffer. +* current buffer excursion: Excursions. +* current buffer mark: The Mark. +* current buffer point and mark (Edebug): Edebug Display Update. +* current buffer position: Point. +* current command: Command Loop Info. +* current stack frame: Using Debugger. +* current-buffer: Current Buffer. +* current-case-table: Case Tables. +* current-column: Columns. +* current-fill-column: Margins. +* current-frame-configuration: Frame Configurations. +* current-global-map: Active Keymaps. +* current-indentation: Primitive Indent. +* current-input-mode: Input Modes. +* current-justification: Filling. +* current-keymaps: Active Keymaps. +* current-kill: Low-Level Kill Ring. +* current-left-margin: Margins. +* current-local-map: Active Keymaps. +* current-menubar: Menubar. +* current-message: The Echo Area. +* current-minor-mode-maps: Active Keymaps. +* current-mouse-event: Command Loop Info. +* current-prefix-arg: Prefix Command Arguments. +* current-time: Time of Day. +* current-time-string: Time of Day. +* current-time-zone: Time of Day. +* current-window-configuration: Window Configurations. +* cursor (mouse): Mouse Pointer. +* cursor-in-echo-area: The Echo Area. +* cust-print: Printing in Edebug. +* cut buffer: X Selections. +* cyclic ordering of windows: Cyclic Window Ordering. +* data type: Lisp Data Types. +* data-directory: Accessing Documentation. +* database: Databases. +* database type: Database Type. +* database-file-name: Other Database Functions. +* database-last-error: Other Database Functions. +* database-live-p: Connecting to a Database. +* database-subtype: Other Database Functions. +* database-type: Other Database Functions. +* databasep: Databases. +* deallocate-event: Working With Events. +* debug: Invoking the Debugger. +* debug-allocation: Garbage Collection. +* debug-allocation-backtrace: Garbage Collection. +* debug-ignored-errors: Error Debugging. +* debug-on-entry: Function Debugging. +* debug-on-error: Error Debugging. +* debug-on-error use: Processing of Errors. +* debug-on-next-call: Internals of Debugger. +* debug-on-quit: Infinite Loops. +* debug-on-signal: Error Debugging. +* debug-on-signal use: Handling Errors. +* debugger <1>: Internals of Debugger. +* debugger: Debugger. +* debugger command list: Debugger Commands. +* debugger-mode-map: Standard Keymaps. +* debugging errors: Error Debugging. +* debugging specific functions: Function Debugging. +* decode-big5-char: Big5 and Shift-JIS Functions. +* decode-coding-region: Encoding and Decoding Text. +* decode-shift-jis-char: Big5 and Shift-JIS Functions. +* decode-time: Time Conversion. +* decoding file formats: Format Conversion. +* decompose-region: Composite Characters. +* decrement field of register: Cons Cell Type. +* dedicated window: Choosing Window. +* deep binding: Impl of Scope. +* def-edebug-spec: Instrumenting Macro Calls. +* defalias: Defining Functions. +* default argument string: Interactive Codes. +* default init file: Init File. +* default value: Default Value. +* default-abbrev-mode: Abbrev Mode. +* default-boundp: Default Value. +* default-buffer-file-type: Files and MS-DOS. +* default-case-fold-search: Searching and Case. +* default-ctl-arrow: Usual Display. +* default-deselect-frame-hook: Raising and Lowering. +* default-directory: File Name Expansion. +* default-file-modes: Changing File Attributes. +* default-fill-column: Margins. +* default-frame-name: Frame Name. +* default-frame-plist: Initial Properties. +* default-gutter: Specifying a Gutter. +* default-gutter-height: Other Gutter Variables. +* default-gutter-position: Specifying a Gutter. +* default-gutter-visible-p: Other Gutter Variables. +* default-gutter-width: Other Gutter Variables. +* default-justification: Filling. +* default-major-mode: Auto Major Mode. +* default-menubar: Menubar. +* default-minibuffer-frame: Minibuffers and Frames. +* default-modeline-format: Modeline Variables. +* default-popup-menu: Pop-Up Menus. +* default-select-frame-hook: Raising and Lowering. +* default-text-properties: Examining Properties. +* default-toolbar: Specifying the Toolbar. +* default-toolbar-height: Other Toolbar Variables. +* default-toolbar-position: Specifying the Toolbar. +* default-toolbar-visible-p: Other Toolbar Variables. +* default-toolbar-width: Other Toolbar Variables. +* default-truncate-lines: Truncation. +* default-value: Default Value. +* default-x-device: Resources. +* default.el: Start-up Summary. +* defconst <1>: Domain Specification. +* defconst: Defining Variables. +* defcustom: Variable Definitions. +* defgroup: Group Definitions. +* define-abbrev: Defining Abbrevs. +* define-abbrev-table: Abbrev Tables. +* define-derived-mode: Derived Modes. +* define-error: Error Symbols. +* define-function: Defining Functions. +* define-key: Changing Key Bindings. +* define-logical-name: Changing File Attributes. +* define-obsolete-function-alias: Obsoleteness. +* define-obsolete-variable-alias: Obsoleteness. +* define-prefix-command: Prefix Keys. +* define-specifier-tag: Specifier Tag Functions. +* defining a function: Defining Functions. +* defining commands: Defining Commands. +* defining-kbd-macro: Keyboard Macros. +* definition of a symbol: Definitions. +* defmacro: Defining Macros. +* defsubst: Inline Functions. +* defun: Defining Functions. +* defun-prompt-regexp: List Motion. +* defvar <1>: Domain Specification. +* defvar: Defining Variables. +* defvaralias: Variable Aliases. +* deiconify-frame: Visibility of Frames. +* delete: Sets And Lists. +* delete previous char: Deletion. +* delete-annotation: Annotation Primitives. +* delete-auto-save-file-if-necessary: Auto-Saving. +* delete-auto-save-files: Auto-Saving. +* delete-backward-char: Deletion. +* delete-blank-lines: User-Level Deletion. +* delete-char: Deletion. +* delete-device: Connecting to a Console or Device. +* delete-device-hook: Connecting to a Console or Device. +* delete-directory: Create/Delete Dirs. +* delete-exited-processes: Deleting Processes. +* delete-extent: Creating and Modifying Extents. +* delete-file: Changing File Attributes. +* delete-frame: Deleting Frames. +* delete-frame-hook: Frame Hooks. +* delete-horizontal-space: User-Level Deletion. +* delete-indentation: User-Level Deletion. +* delete-menu-item: Modifying Menus. +* delete-old-versions: Numbered Backups. +* delete-other-windows: Deleting Windows. +* delete-process: Deleting Processes. +* delete-region: Deletion. +* delete-to-left-margin: Margins. +* delete-window: Deleting Windows. +* delete-windows-on: Deleting Windows. +* deleting files: Changing File Attributes. +* deleting processes: Deleting Processes. +* deleting whitespace: User-Level Deletion. +* deleting windows: Deleting Windows. +* deletion of elements: Sets And Lists. +* deletion of frames: Deleting Frames. +* deletion vs killing: Deletion. +* delq: Sets And Lists. +* demibold: Font Instance Characteristics. +* describe-bindings: Scanning Keymaps. +* describe-bindings-internal: Scanning Keymaps. +* describe-buffer-case-table: Case Tables. +* describe-mode: Mode Help. +* describe-prefix-bindings: Help Functions. +* describe-tooltalk-message: Elisp Interface for Receiving Messages. +* description for interactive codes: Interactive Codes. +* description format: Format of Descriptions. +* deselect-frame-hook: Frame Hooks. +* destroy-tooltalk-message: Elisp Interface for Sending Messages. +* destroy-tooltalk-pattern: Elisp Interface for Receiving Messages. +* destructive-alist-to-plist: Converting Plists To/From Alists. +* destructive-plist-to-alist: Converting Plists To/From Alists. +* detach-extent: Detached Extents. +* detached extent: Detached Extents. +* detect-coding-region: Detection of Textual Encoding. +* device-baud-rate <1>: Terminal Output. +* device-baud-rate: Console and Device I/O. +* device-class: Console Types and Device Classes. +* device-frame-list <1>: Basic Device Functions. +* device-frame-list: Finding All Frames. +* device-list: Basic Device Functions. +* device-live-p: Connecting to a Console or Device. +* device-matches-specifier-tag-set-p: Specifier Tag Functions. +* device-matching-specifier-tag-list: Specifier Tag Functions. +* device-or-frame-p: Basic Device Functions. +* device-or-frame-type: Console Types and Device Classes. +* device-type: Console Types and Device Classes. +* device-x-display: Connecting to a Console or Device. +* devicep: Consoles and Devices. +* devices: Consoles and Devices. +* dgettext: Level 3 Primitives. +* diagrams, boxed, for lists: Cons Cell Type. +* dialog box: Dialog Boxes. +* digit-argument: Prefix Command Arguments. +* ding: Beeping. +* directory name: Directory Names. +* directory name abbreviation: Directory Names. +* directory part (of file name): File Name Components. +* directory-abbrev-alist: Directory Names. +* directory-file-name: Directory Names. +* directory-files: Contents of Directories. +* directory-oriented functions: Contents of Directories. +* dired-kept-versions: Numbered Backups. +* dired-mode-map: Standard Keymaps. +* disable undo: Maintaining Undo. +* disable-command: Disabling Commands. +* disable-menu-item: Modifying Menus. +* disable-timeout: Timers. +* disabled: Disabling Commands. +* disabled command: Disabling Commands. +* disabled-command-hook: Disabling Commands. +* disassemble: Disassembly. +* disassembled byte-code: Disassembly. +* discard input: Peeking and Discarding. +* discard-input: Peeking and Discarding. +* dispatch-event: Dispatching an Event. +* dispatching an event: Dispatching an Event. +* display columns: Size and Position. +* display lines: Size and Position. +* display order: Extent Endpoints. +* display table: Display Tables. +* display update: Refresh Screen. +* display-buffer: Choosing Window. +* display-buffer-function: Choosing Window. +* display-completion-list: Completion Commands. +* display-error: Processing of Errors. +* display-message: The Echo Area. +* display-warning: Warnings. +* display-warning-minimum-level: Warnings. +* display-warning-suppressed-classes: Warnings. +* displaying a buffer: Displaying Buffers. +* do-auto-save: Auto-Saving. +* DOC (documentation) file: Documentation Basics. +* doc-directory: Accessing Documentation. +* documentation: Accessing Documentation. +* documentation conventions: Documentation Basics. +* documentation for major mode: Mode Help. +* documentation notation: Evaluation Notation. +* documentation of function: Function Documentation. +* documentation strings: Documentation. +* documentation, keys in: Keys in Documentation. +* documentation-property: Accessing Documentation. +* domain: Level 3 Primitives. +* domain (in a specifier): Specifiers In-Depth. +* domain-of: Level 3 Primitives. +* dotted lists (Edebug): Specification List. +* dotted pair notation: Dotted Pair Notation. +* double-quote in strings: String Type. +* down-list: List Motion. +* downcase: Character Case. +* downcase-region: Case Changes. +* downcase-word: Case Changes. +* downcasing in lookup-key: Key Sequence Input. +* drag: Drag Interface. +* drag and drop: Drag and Drop. +* Drag API: Drag Interface. +* dribble file: Recording Input. +* drop: Drop Interface. +* Drop API: Drop Interface. +* dump-emacs: Building XEmacs. +* duplicable extent: Duplicable Extents. +* dynamic loading of documentation: Docs and Compilation. +* dynamic loading of functions: Dynamic Loading. +* dynamic scoping: Variable Scoping. +* echo area: The Echo Area. +* echo-keystrokes <1>: The Echo Area. +* echo-keystrokes: Command Loop Info. +* edebug: Embedded Breakpoints. +* Edebug: Edebug. +* Edebug execution modes: Edebug Execution Modes. +* Edebug mode: Edebug. +* Edebug specification list: Specification List. +* edebug-`: Debugging Backquote. +* edebug-all-defs <1>: Edebug Options. +* edebug-all-defs: Instrumenting. +* edebug-all-forms <1>: Edebug Options. +* edebug-all-forms: Instrumenting. +* edebug-continue-kbd-macro: Edebug Options. +* edebug-display-freq-count: Coverage Testing. +* edebug-eval-top-level-form: Instrumenting. +* edebug-global-break-condition <1>: Edebug Options. +* edebug-global-break-condition: Global Break Condition. +* edebug-initial-mode: Edebug Options. +* edebug-on-error <1>: Edebug Options. +* edebug-on-error: Trapping Errors. +* edebug-on-quit <1>: Edebug Options. +* edebug-on-quit: Trapping Errors. +* edebug-print-circle <1>: Edebug Options. +* edebug-print-circle: Printing in Edebug. +* edebug-print-length <1>: Edebug Options. +* edebug-print-length: Printing in Edebug. +* edebug-print-level <1>: Edebug Options. +* edebug-print-level: Printing in Edebug. +* edebug-print-trace-after <1>: Edebug Options. +* edebug-print-trace-after: Tracing. +* edebug-print-trace-before <1>: Edebug Options. +* edebug-print-trace-before: Tracing. +* edebug-save-displayed-buffer-points <1>: Edebug Options. +* edebug-save-displayed-buffer-points: Edebug Display Update. +* edebug-save-windows <1>: Edebug Options. +* edebug-save-windows: Edebug Display Update. +* edebug-set-global-break-condition: Global Break Condition. +* edebug-setup-hook: Edebug Options. +* edebug-test-coverage: Edebug Options. +* edebug-trace <1>: Edebug Options. +* edebug-trace: Tracing. +* edebug-tracing: Tracing. +* edebug-unwrap: Specification List. +* edebug-unwrap-results <1>: Edebug Options. +* edebug-unwrap-results: Debugging Backquote. +* edit-abbrevs-map: Standard Keymaps. +* edit-and-eval-command: Object from Minibuffer. +* edit-menu-filter: Menu Filters. +* edit-tab-stops-map: Standard Keymaps. +* editing types: Editing Types. +* editor command loop: Command Loop. +* eighth: List Elements. +* electric-buffer-menu-mode-map: Standard Keymaps. +* electric-future-map: A Sample Variable Description. +* electric-history-map: Standard Keymaps. +* element (of list): Lists. +* elements of sequences: Sequence Functions. +* elt: Sequence Functions. +* emacs-build-time: Building XEmacs. +* emacs-lisp-mode-map: Standard Keymaps. +* emacs-lisp-mode-syntax-table: Standard Syntax Tables. +* emacs-major-version: Building XEmacs. +* emacs-minor-version: Building XEmacs. +* emacs-pid: System Environment. +* emacs-version: Building XEmacs. +* EMACSLOADPATH environment variable: How Programs Do Loading. +* embedded breakpoints: Embedded Breakpoints. +* empty list: Cons Cell Type. +* enable-command: Disabling Commands. +* enable-flow-control: Flow Control. +* enable-flow-control-on: Flow Control. +* enable-local-eval: Auto Major Mode. +* enable-local-variables: Auto Major Mode. +* enable-menu-item: Modifying Menus. +* enable-recursive-minibuffers: Minibuffer Misc. +* encode-big5-char: Big5 and Shift-JIS Functions. +* encode-coding-region: Encoding and Decoding Text. +* encode-shift-jis-char: Big5 and Shift-JIS Functions. +* encode-time: Time Conversion. +* encoding file formats: Format Conversion. +* end of buffer marker: Creating Markers. +* end-of-buffer: Buffer End Motion. +* end-of-defun: List Motion. +* end-of-file: Input Functions. +* end-of-line: Text Lines. +* enlarge-window: Resizing Windows. +* enlarge-window-horizontally: Resizing Windows. +* enlarge-window-pixels: Resizing Windows. +* enqueue-eval-event: Reading One Event. +* environment: Intro Eval. +* environment variable access: System Environment. +* environment variables, subprocesses: Subprocess Creation. +* eobp: Near Point. +* eolp: Near Point. +* eq: Equality Predicates. +* equal: Equality Predicates. +* equality: Equality Predicates. +* erase-buffer: Deletion. +* error: Signaling Errors. +* error cleanup: Cleanups. +* error debugging: Error Debugging. +* error display: The Echo Area. +* error handler: Handling Errors. +* error in debug: Invoking the Debugger. +* error message notation: Error Messages. +* error name: Error Symbols. +* error symbol: Error Symbols. +* error-conditions: Error Symbols. +* error-message-string: Processing of Errors. +* errors: Errors. +* esc-map: Prefix Keys. +* ESC-prefix: Prefix Keys. +* escape <1>: Syntax Class Table. +* escape: Character Type. +* escape characters: Output Variables. +* escape characters in printing: Output Functions. +* escape sequence: Character Type. +* eval: Eval. +* eval, and debugging: Internals of Debugger. +* eval-and-compile: Eval During Compile. +* eval-buffer: Eval. +* eval-current-buffer (Edebug): Instrumenting. +* eval-defun (Edebug): Instrumenting. +* eval-event-p: Event Predicates. +* eval-expression (Edebug): Instrumenting. +* eval-minibuffer: Object from Minibuffer. +* eval-region: Eval. +* eval-region (Edebug): Instrumenting. +* eval-when-compile: Eval During Compile. +* evaluated expression argument: Interactive Codes. +* evaluation: Evaluation. +* evaluation error: Local Variables. +* evaluation list (Edebug): Eval List. +* evaluation notation: Evaluation Notation. +* evaluation of buffer contents: Eval. +* event printing: Describing Characters. +* event-buffer: Window-Level Event Position Info. +* event-button: Accessing Other Event Info. +* event-closest-point: Event Text Position Info. +* event-device: Accessing Other Event Info. +* event-frame: Frame-Level Event Position Info. +* event-function: Accessing Other Event Info. +* event-glyph-extent: Event Glyph Position Info. +* event-glyph-x-pixel: Event Glyph Position Info. +* event-glyph-y-pixel: Event Glyph Position Info. +* event-key: Accessing Other Event Info. +* event-live-p: Event Predicates. +* event-matches-key-specifier-p: Key Sequences. +* event-modifier-bits: Accessing Other Event Info. +* event-modifiers: Accessing Other Event Info. +* event-object: Accessing Other Event Info. +* event-over-border-p: Other Event Position Info. +* event-over-glyph-p: Event Glyph Position Info. +* event-over-modeline-p: Event Text Position Info. +* event-over-text-area-p: Event Text Position Info. +* event-over-toolbar-p: Event Toolbar Position Info. +* event-point: Event Text Position Info. +* event-process: Accessing Other Event Info. +* event-timestamp: Accessing Other Event Info. +* event-to-character: Converting Events. +* event-toolbar-button: Event Toolbar Position Info. +* event-type: Event Contents. +* event-window: Window-Level Event Position Info. +* event-window-x-pixel: Window-Level Event Position Info. +* event-window-y-pixel: Window-Level Event Position Info. +* event-x: Event Text Position Info. +* event-x-pixel: Frame-Level Event Position Info. +* event-y: Event Text Position Info. +* event-y-pixel: Frame-Level Event Position Info. +* eventp: Events. +* events: Events. +* events-to-keys: Converting Events. +* examining windows: Buffers and Windows. +* examples of using interactive: Interactive Examples. +* exchange-point-and-mark: The Mark. +* excursion: Excursions. +* exec-directory: Subprocess Creation. +* exec-path: Subprocess Creation. +* execute program: Subprocess Creation. +* execute with prefix argument: Interactive Call. +* execute-extended-command: Interactive Call. +* execute-kbd-macro: Keyboard Macros. +* executing-macro: Keyboard Macros. +* execution speed: Compilation Tips. +* exit: Recursive Editing. +* exit recursive editing: Recursive Editing. +* exit-minibuffer: Minibuffer Misc. +* exit-recursive-edit: Recursive Editing. +* exiting XEmacs: Getting Out. +* exp: Math Functions. +* expand-abbrev: Abbrev Expansion. +* expand-file-name: File Name Expansion. +* expansion of file names: File Name Expansion. +* expansion of macros: Expansion. +* expression: Intro Eval. +* expression prefix: Syntax Class Table. +* expt: Math Functions. +* extended-command-history: Minibuffer History. +* extent <1>: Extents. +* extent: Variable Scoping. +* extent children: Extent Parents. +* extent end position: Extent Endpoints. +* extent endpoint: Extent Endpoints. +* extent order: Extent Endpoints. +* extent parent: Extent Parents. +* extent priority: Intro to Extents. +* extent property: Extent Properties. +* extent replica: Duplicable Extents. +* extent start position: Extent Endpoints. +* extent, duplicable: Duplicable Extents. +* extent, unique: Duplicable Extents. +* extent-at: Finding Extents. +* extent-begin-glyph: Extent Properties. +* extent-begin-glyph-layout: Extent Properties. +* extent-children: Extent Parents. +* extent-descendants: Extent Parents. +* extent-detached-p: Detached Extents. +* extent-end-glyph: Extent Properties. +* extent-end-glyph-layout: Extent Properties. +* extent-end-position: Extent Endpoints. +* extent-face: Extent Properties. +* extent-in-region-p: Mapping Over Extents. +* extent-keymap: Extent Properties. +* extent-length: Extent Endpoints. +* extent-list: Finding Extents. +* extent-live-p: Creating and Modifying Extents. +* extent-mouse-face: Extent Properties. +* extent-object: Creating and Modifying Extents. +* extent-parent: Extent Parents. +* extent-priority: Extent Properties. +* extent-properties: Extent Properties. +* extent-property: Extent Properties. +* extent-start-position: Extent Endpoints. +* extentp: Extents. +* extents, locating: Finding Extents. +* extents, mapping: Mapping Over Extents. +* face type: Face Type. +* face-background: Face Convenience Functions. +* face-background-instance: Face Convenience Functions. +* face-background-pixmap: Face Convenience Functions. +* face-background-pixmap-instance: Face Convenience Functions. +* face-boolean-specifier-p: Specifier Types. +* face-differs-from-default-p: Other Face Display Functions. +* face-equal: Other Face Display Functions. +* face-font: Face Convenience Functions. +* face-font-instance: Face Convenience Functions. +* face-font-name: Face Convenience Functions. +* face-foreground: Face Convenience Functions. +* face-foreground-instance: Face Convenience Functions. +* face-list: Basic Face Functions. +* face-property: Face Properties. +* face-property-instance: Face Properties. +* face-underline-p: Face Convenience Functions. +* facep: Basic Face Functions. +* faces: Faces and Window-System Objects. +* fallback (in a specifier): Specifier Instancing. +* false: nil and t. +* fboundp: Function Cells. +* fceiling: Rounding Operations. +* featurep: Named Features. +* features: Named Features. +* fetch-bytecode: Dynamic Loading. +* ffloor: Rounding Operations. +* field width: Formatting Strings. +* fifth: List Elements. +* file accessibility: Testing Accessibility. +* file age: Testing Accessibility. +* file attributes: File Attributes. +* file format conversion: Format Conversion. +* file hard link: Changing File Attributes. +* file locks: File Locks. +* file mode specification error: Auto Major Mode. +* file modes and MS-DOS: Changing File Attributes. +* file modification time: Testing Accessibility. +* file name completion subroutines: File Name Completion. +* file name of buffer: Buffer File Name. +* file name of directory: Directory Names. +* file names: File Names. +* file names in directory: Contents of Directories. +* file open error: Subroutines of Visiting. +* file symbolic links: Kinds of Files. +* file types on MS-DOS: Files and MS-DOS. +* file with multiple names: Changing File Attributes. +* file-accessible-directory-p: Testing Accessibility. +* file-already-exists: Changing File Attributes. +* file-attributes: File Attributes. +* file-directory-p: Kinds of Files. +* file-error: How Programs Do Loading. +* file-executable-p: Testing Accessibility. +* file-exists-p: Testing Accessibility. +* file-local-copy: Magic File Names. +* file-locked: File Locks. +* file-locked-p: File Locks. +* file-menu-filter: Menu Filters. +* file-modes: File Attributes. +* file-name-absolute-p: Relative File Names. +* file-name-all-completions: File Name Completion. +* file-name-as-directory: Directory Names. +* file-name-buffer-file-type-alist: Files and MS-DOS. +* file-name-completion: File Name Completion. +* file-name-directory: File Name Components. +* file-name-history: Minibuffer History. +* file-name-nondirectory: File Name Components. +* file-name-sans-extension: File Name Components. +* file-name-sans-versions: File Name Components. +* file-newer-than-file-p: Testing Accessibility. +* file-newest-backup: Backup Names. +* file-nlinks: File Attributes. +* file-ownership-preserved-p: Testing Accessibility. +* file-precious-flag: Saving Buffers. +* file-readable-p: Testing Accessibility. +* file-regular-p: Kinds of Files. +* file-relative-name: File Name Expansion. +* file-supersession: Modification Time. +* file-symlink-p: Kinds of Files. +* file-truename: Truenames. +* file-writable-p: Testing Accessibility. +* fill-column: Margins. +* fill-individual-paragraphs: Filling. +* fill-individual-varying-indent: Filling. +* fill-paragraph: Filling. +* fill-paragraph-function: Filling. +* fill-prefix: Margins. +* fill-region: Filling. +* fill-region-as-paragraph: Filling. +* fillarray: Array Functions. +* filling a paragraph: Filling. +* filling, automatic: Auto Filling. +* filling, explicit: Filling. +* filter function: Filter Functions. +* find-backup-file-name: Backup Names. +* find-buffer-file-type: Files and MS-DOS. +* find-charset: Basic Charset Functions. +* find-charset-region: MULE Characters. +* find-charset-string: MULE Characters. +* find-coding-system: Basic Coding System Functions. +* find-file: Visiting Functions. +* find-file-binary: Files and MS-DOS. +* find-file-hooks: Visiting Functions. +* find-file-name-handler: Magic File Names. +* find-file-noselect: Visiting Functions. +* find-file-not-found-hooks: Visiting Functions. +* find-file-other-window: Visiting Functions. +* find-file-read-only: Visiting Functions. +* find-file-text: Files and MS-DOS. +* find-menu-item: Modifying Menus. +* finding files: Visiting Files. +* finding windows: Selecting Windows. +* first: List Elements. +* first-change-hook: Change Hooks. +* fixup-whitespace: User-Level Deletion. +* float: Numeric Conversions. +* float-output-format: Output Variables. +* floating-point numbers, printing: Output Variables. +* floatp: Predicates on Numbers. +* floor: Numeric Conversions. +* flow control characters: Flow Control. +* flush input: Peeking and Discarding. +* fmakunbound: Function Cells. +* focus-frame: Input Focus. +* following-char: Near Point. +* font instance characteristics: Font Instance Characteristics. +* font instance name: Font Instance Names. +* font instance size: Font Instance Size. +* font instance type: Font Instance Type. +* font-instance-name: Font Instance Names. +* font-instance-p: Font Instances. +* font-instance-properties: Font Instance Characteristics. +* font-instance-truename: Font Instance Names. +* font-name: Font Convenience Functions. +* font-properties: Font Convenience Functions. +* font-specifier-p <1>: Font Specifiers. +* font-specifier-p: Specifier Types. +* font-truename: Font Convenience Functions. +* fonts <1>: Fonts. +* fonts: Some Terms. +* fonts available: Font Instance Names. +* foo: A Sample Function Description. +* for: Argument Evaluation. +* force-cursor-redisplay: Refresh Screen. +* force-highlight-extent: Extents and Events. +* forcing redisplay: Waiting. +* format: Formatting Strings. +* format definition: Format Conversion. +* format of keymaps: Format of Keymaps. +* format of menus: Menu Format. +* format of the menubar: Menubar Format. +* format precision: Formatting Strings. +* format specification: Formatting Strings. +* format-alist: Format Conversion. +* format-buffers-menu-line: Buffers Menu. +* format-find-file: Format Conversion. +* format-insert-file: Format Conversion. +* format-time-string: Time Conversion. +* format-write-file: Format Conversion. +* formatting strings: Formatting Strings. +* formfeed: Character Type. +* forms: Intro Eval. +* forward-char: Character Motion. +* forward-comment: Parsing Expressions. +* forward-line: Text Lines. +* forward-list: List Motion. +* forward-sexp: List Motion. +* forward-to-indentation: Motion by Indent. +* forward-word: Word Motion. +* fourth: List Elements. +* frame: Frames. +* frame configuration: Frame Configurations. +* frame hooks: Frame Hooks. +* frame name: Frame Name. +* frame of terminal: Basic Windows. +* frame position: Size and Position. +* frame size: Size and Position. +* frame visibility: Visibility of Frames. +* frame-device: Basic Device Functions. +* frame-height: Size and Position. +* frame-icon-title-format: Frame Titles. +* frame-iconified-p: Visibility of Frames. +* frame-list: Finding All Frames. +* frame-live-p: Deleting Frames. +* frame-name: Frame Name. +* frame-pixel-height: Size and Position. +* frame-pixel-width: Size and Position. +* frame-properties: Property Access. +* frame-property: Property Access. +* frame-root-window: Frames and Windows. +* frame-selected-window: Frames and Windows. +* frame-title-format: Frame Titles. +* frame-top-window: Frames and Windows. +* frame-totally-visible-p: Visibility of Frames. +* frame-visible-p: Visibility of Frames. +* frame-width: Size and Position. +* framep: Frames. +* free list: Garbage Collection. +* frequency counts: Coverage Testing. +* fround: Rounding Operations. +* fset: Function Cells. +* ftp-login: Cleanups. +* ftruncate: Rounding Operations. +* funcall: Calling Functions. +* funcall, and debugging: Internals of Debugger. +* function <1>: Anonymous Functions. +* function: What Is a Function. +* function call: Function Forms. +* function call debugging: Function Debugging. +* function cell: Symbol Components. +* function cell in autoload: Autoload. +* function definition: Function Names. +* function descriptions: A Sample Function Description. +* function form evaluation: Function Forms. +* function input stream: Input Streams. +* function invocation: Calling Functions. +* function name: Function Names. +* function output stream: Output Streams. +* function quoting: Anonymous Functions. +* function-interactive: Using Interactive. +* function-key-map: Translating Input. +* function-obsoleteness-doc: Obsoleteness. +* functionals: Calling Functions. +* functions in modes: Major Mode Conventions. +* functions, making them interactive: Defining Commands. +* Fundamental mode: Major Modes. +* fundamental-mode: Auto Major Mode. +* fundamental-mode-abbrev-table: Standard Abbrev Tables. +* garbage collector: Garbage Collection. +* garbage-collect: Garbage Collection. +* gc-cons-threshold: Garbage Collection. +* gc-message: Garbage Collection. +* gc-pointer-glyph <1>: Garbage Collection. +* gc-pointer-glyph: Mouse Pointer. +* generate-new-buffer: Creating Buffers. +* generate-new-buffer-name: Buffer Names. +* generic-specifier-p: Specifier Types. +* get: Object Plists. +* get-buffer: Buffer Names. +* get-buffer-create: Creating Buffers. +* get-buffer-process: Process Buffers. +* get-buffer-window: Buffers and Windows. +* get-char-property: Examining Properties. +* get-char-table: Working With Char Tables. +* get-charset: Basic Charset Functions. +* get-coding-system: Basic Coding System Functions. +* get-database: Working With a Database. +* get-file-buffer: Buffer File Name. +* get-largest-window: Selecting Windows. +* get-lru-window: Selecting Windows. +* get-process: Process Information. +* get-range-char-table: Working With Char Tables. +* get-range-table: Working With Range Tables. +* get-register: Registers. +* get-text-property: Examining Properties. +* get-tooltalk-message-attribute: Elisp Interface for Sending Messages. +* getenv: System Environment. +* getf: Other Plists. +* gethash: Working With Hash Tables. +* gettext: Level 3 Primitives. +* global binding: Local Variables. +* global break condition: Global Break Condition. +* global keymap: Active Keymaps. +* global mark ring: The Mark. +* global variable: Global Variables. +* global-abbrev-table: Standard Abbrev Tables. +* global-key-binding: Functions for Key Lookup. +* global-map: Active Keymaps. +* global-mark-ring: The Mark. +* global-mode-string: Modeline Variables. +* global-popup-menu: Pop-Up Menus. +* global-set-key: Key Binding Commands. +* global-unset-key: Key Binding Commands. +* glyph type: Glyph Type. +* glyph-ascent: Glyph Dimensions. +* glyph-baseline: Glyph Convenience Functions. +* glyph-baseline-instance: Glyph Convenience Functions. +* glyph-contrib-p: Glyph Convenience Functions. +* glyph-contrib-p-instance: Glyph Convenience Functions. +* glyph-descent: Glyph Dimensions. +* glyph-face: Glyph Convenience Functions. +* glyph-height: Glyph Dimensions. +* glyph-image: Glyph Convenience Functions. +* glyph-image-instance: Glyph Convenience Functions. +* glyph-property: Glyph Properties. +* glyph-property-instance: Glyph Properties. +* glyph-type: Glyph Types. +* glyph-type-list: Glyph Types. +* glyph-width: Glyph Dimensions. +* glyphp: Glyphs. +* glyphs: Glyphs. +* goto-char: Character Motion. +* goto-line: Text Lines. +* gutter: Gutter. +* gutter-buttons-captioned-p: Other Gutter Variables. +* gutter-make-button-list: Gutter Descriptor Format. +* gutter-specifier-p: Specifying a Gutter. +* hack-local-variables: Auto Major Mode. +* handling errors: Handling Errors. +* hash notation: Printed Representation. +* hash table: Hash Tables. +* hash table type: Hash Table Type. +* hash table, weak: Weak Hash Tables. +* hash-table-count: Introduction to Hash Tables. +* hash-table-p: Hash Tables. +* hash-table-rehash-size: Introduction to Hash Tables. +* hash-table-rehash-threshold: Introduction to Hash Tables. +* hash-table-size: Introduction to Hash Tables. +* hash-table-test: Introduction to Hash Tables. +* hash-table-weakness: Introduction to Hash Tables. +* hashing: Creating Symbols. +* header comments: Library Headers. +* help for major mode: Mode Help. +* help-char: Help Functions. +* help-command: Help Functions. +* help-form: Help Functions. +* help-map <1>: Standard Keymaps. +* help-map: Help Functions. +* Helper-describe-bindings: Help Functions. +* Helper-help: Help Functions. +* Helper-help-map: Standard Keymaps. +* hide-annotation: Annotation Properties. +* highlight-extent: Extents and Events. +* history list: Minibuffer History. +* history of commands: Command History. +* HOME environment variable: Subprocess Creation. +* hooks: Hooks. +* hooks for loading: Hooks for Loading. +* hooks for text changes: Change Hooks. +* horizontal position: Columns. +* horizontal scrolling: Horizontal Scrolling. +* hscroll-glyph: Redisplay Glyphs. +* icon-glyph-p: Glyph Types. +* iconified frame: Visibility of Frames. +* iconify-frame: Visibility of Frames. +* identity: Calling Functions. +* IEEE floating point: Float Basics. +* if: Conditionals. +* ignore: Calling Functions. +* ignored-local-variables: Auto Major Mode. +* image instance type: Image Instance Type. +* image instance types: Image Instance Types. +* image instances: Image Instances. +* image instantiator conversion: Image Instantiator Conversion. +* image specifiers: Image Specifiers. +* image-instance-background: Image Instance Functions. +* image-instance-depth: Image Instance Functions. +* image-instance-file-name: Image Instance Functions. +* image-instance-foreground: Image Instance Functions. +* image-instance-height: Image Instance Functions. +* image-instance-hotspot-x: Image Instance Functions. +* image-instance-hotspot-y: Image Instance Functions. +* image-instance-mask-file-name: Image Instance Functions. +* image-instance-name: Image Instance Functions. +* image-instance-p: Image Instances. +* image-instance-string: Image Instance Functions. +* image-instance-type: Image Instance Types. +* image-instance-type-list: Image Instance Types. +* image-instance-width: Image Instance Functions. +* image-instantiator-format-list: Image Specifiers. +* image-specifier-p <1>: Image Specifiers. +* image-specifier-p: Specifier Types. +* implicit progn: Sequencing. +* inc: Simple Macro. +* indent-according-to-mode: Mode-Specific Indent. +* indent-code-rigidly: Region Indent. +* indent-for-tab-command: Mode-Specific Indent. +* indent-line-function: Mode-Specific Indent. +* indent-region: Region Indent. +* indent-region-function: Region Indent. +* indent-relative: Relative Indent. +* indent-relative-maybe: Relative Indent. +* indent-rigidly: Region Indent. +* indent-tabs-mode: Primitive Indent. +* indent-to: Primitive Indent. +* indent-to-left-margin: Margins. +* indentation: Indentation. +* indenting with parentheses: Parsing Expressions. +* indirect buffers: Indirect Buffers. +* indirect specifications: Specification List. +* indirect variables: Variable Aliases. +* indirect-function: Function Indirection. +* indirect-variable: Variable Aliases. +* indirection: Function Indirection. +* infinite loops: Infinite Loops. +* infinite recursion: Local Variables. +* infinity: Float Basics. +* Info-edit-map: Standard Keymaps. +* Info-minibuffer-history: Minibuffer History. +* Info-mode-map: Standard Keymaps. +* inherit: Syntax Class Table. +* inheriting a keymap's bindings: Inheritance and Keymaps. +* inhibit-default-init: Init File. +* inhibit-file-name-handlers: Magic File Names. +* inhibit-file-name-operation: Magic File Names. +* inhibit-quit: Quitting. +* inhibit-read-only: Read Only Buffers. +* inhibit-startup-echo-area-message: Start-up Summary. +* inhibit-startup-message: Start-up Summary. +* init file: Init File. +* initial-frame-plist: Initial Properties. +* initial-gutter-spec: Other Gutter Variables. +* initial-major-mode: Auto Major Mode. +* initial-toolbar-spec: Other Toolbar Variables. +* initialization: Start-up Summary. +* inline functions: Inline Functions. +* innermost containing parentheses: Parsing Expressions. +* input events: Events. +* input focus: Input Focus. +* input modes: Input Modes. +* input stream: Input Streams. +* input-pending-p: Peeking and Discarding. +* insert: Insertion. +* insert-abbrev-table-description: Abbrev Tables. +* insert-before-markers: Insertion. +* insert-buffer: Commands for Insertion. +* insert-buffer-substring: Insertion. +* insert-char: Insertion. +* insert-default-directory: Reading File Names. +* insert-directory: Contents of Directories. +* insert-directory-program: Contents of Directories. +* insert-extent: Detached Extents. +* insert-file-contents: Reading from Files. +* insert-register: Registers. +* insert-string: Insertion. +* inserting killed text: Yank Commands. +* insertion before point: Insertion. +* insertion of text: Insertion. +* inside comment: Parsing Expressions. +* inside margin: Annotation Basics. +* inside string: Parsing Expressions. +* inst-list (in a specifier): Specifiers In-Depth. +* inst-pair (in a specifier): Specifiers In-Depth. +* installation-directory: System Environment. +* instance (in a specifier): Specifiers In-Depth. +* instancing (in a specifier): Specifiers In-Depth. +* instantiator (in a specifier): Specifiers In-Depth. +* int-char: Character Codes. +* int-to-string: String Conversion. +* integer to decimal: String Conversion. +* integer to hexadecimal: Formatting Strings. +* integer to octal: Formatting Strings. +* integer to string: String Conversion. +* integer-char-or-marker-p: Predicates on Markers. +* integer-or-char-p: Predicates for Characters. +* integer-or-marker-p: Predicates on Markers. +* integer-specifier-p: Specifier Types. +* integerp: Predicates on Numbers. +* integers: Numbers. +* interactive: Using Interactive. +* interactive call: Interactive Call. +* interactive code description: Interactive Codes. +* interactive commands (Edebug): Instrumenting. +* interactive completion: Interactive Codes. +* interactive function: Defining Commands. +* interactive, examples of using: Interactive Examples. +* interactive-p: Interactive Call. +* intern: Creating Symbols. +* intern-soft: Creating Symbols. +* internal-doc-file-name: Accessing Documentation. +* interning: Creating Symbols. +* interpreter: Evaluation. +* interpreter-mode-alist: Auto Major Mode. +* interprogram-cut-function: Low-Level Kill Ring. +* interprogram-paste-function: Low-Level Kill Ring. +* interrupt-process: Signals to Processes. +* invalid function: Function Indirection. +* invalid prefix key error: Changing Key Bindings. +* invalid-function: Function Indirection. +* invalid-read-syntax: Printed Representation. +* invalid-regexp: Syntax of Regexps. +* invert-face: Other Face Display Functions. +* invisible frame: Visibility of Frames. +* invisible text: Invisible Text. +* invisible-text-glyph: Redisplay Glyphs. +* invocation-directory: System Environment. +* invocation-name: System Environment. +* isearch-mode-map: Standard Keymaps. +* ISO Latin 1: Case Tables. +* ISO Latin-1 characters (input): Translating Input. +* iso-syntax: Case Tables. +* iso-transl: Translating Input. +* italic: Font Instance Characteristics. +* iteration: Iteration. +* itimer-edit-map: Standard Keymaps. +* joining lists: Rearrangement. +* just-one-space: User-Level Deletion. +* justify-current-line: Filling. +* kept-new-versions: Numbered Backups. +* kept-old-versions: Numbered Backups. +* key: Keymap Terminology. +* key binding: Keymap Terminology. +* key lookup: Key Lookup. +* key sequence: Key Sequence Input. +* key sequence error: Changing Key Bindings. +* key sequence input: Key Sequence Input. +* key sequences: Key Sequences. +* key translation function: Translating Input. +* key-binding: Functions for Key Lookup. +* key-description: Describing Characters. +* key-press-event-p: Event Predicates. +* key-translation-map: Translating Input. +* keyboard macro execution: Interactive Call. +* keyboard macro termination: Beeping. +* keyboard macros: Keyboard Macros. +* keyboard macros (Edebug): Edebug Execution Modes. +* keyboard menu accelerators: Menu Accelerators. +* keyboard-quit: Quitting. +* keymap: Keymaps. +* keymap entry: Key Lookup. +* keymap format: Format of Keymaps. +* keymap in keymap: Key Lookup. +* keymap inheritance: Inheritance and Keymaps. +* keymap parent: Inheritance and Keymaps. +* keymap-default-binding: Inheritance and Keymaps. +* keymap-fullness: Scanning Keymaps. +* keymap-name: Creating Keymaps. +* keymap-parents: Inheritance and Keymaps. +* keymap-prompt: Other Keymap Functions. +* keymapp: Format of Keymaps. +* keymaps in modes: Major Mode Conventions. +* keys in documentation strings: Keys in Documentation. +* keystroke: Keymap Terminology. +* keystroke command: What Is a Function. +* keywordp: Specification List. +* kill command repetition: Command Loop Info. +* kill ring: The Kill Ring. +* kill-all-local-variables: Creating Buffer-Local. +* kill-append: Low-Level Kill Ring. +* kill-buffer: Killing Buffers. +* kill-buffer-hook: Killing Buffers. +* kill-buffer-query-functions: Killing Buffers. +* kill-emacs: Killing XEmacs. +* kill-emacs-hook: Killing XEmacs. +* kill-emacs-query-functions: Killing XEmacs. +* kill-local-variable: Creating Buffer-Local. +* kill-new: Low-Level Kill Ring. +* kill-process: Signals to Processes. +* kill-region: Kill Functions. +* kill-ring: Internals of Kill Ring. +* kill-ring-max: Internals of Kill Ring. +* kill-ring-yank-pointer: Internals of Kill Ring. +* killing buffers: Killing Buffers. +* killing XEmacs: Killing XEmacs. +* lambda expression: Lambda Expressions. +* lambda expression in hook: Hooks. +* lambda in debug: Invoking the Debugger. +* lambda in keymap: Key Lookup. +* lambda list: Lambda Components. +* lambda-list (Edebug): Specification List. +* lambda-list-keywordp: Specification List. +* last-abbrev: Abbrev Expansion. +* last-abbrev-location: Abbrev Expansion. +* last-abbrev-text: Abbrev Expansion. +* last-command: Command Loop Info. +* last-command-char: Command Loop Info. +* last-command-event: Command Loop Info. +* last-input-char: Peeking and Discarding. +* last-input-event: Peeking and Discarding. +* last-kbd-macro: Keyboard Macros. +* Latin-1 character set (input): Translating Input. +* lax-plist-get: Working With Lax Plists. +* lax-plist-member: Working With Lax Plists. +* lax-plist-put: Working With Lax Plists. +* lax-plist-remprop: Working With Lax Plists. +* lax-plists-eq: Working With Lax Plists. +* lax-plists-equal: Working With Lax Plists. +* layout policy: Annotation Basics. +* layout types: Annotation Basics. +* lazy loading: Dynamic Loading. +* LDAP: LDAP Support. +* ldap-add: Low-level Operations on a LDAP Server. +* ldap-add-entries: The High-Level LDAP API. +* ldap-attribute-syntax-decoders: LDAP Internationalization Variables. +* ldap-attribute-syntax-encoders: LDAP Internationalization Variables. +* ldap-attribute-syntaxes-alist: LDAP Internationalization Variables. +* ldap-close: Opening and Closing a LDAP Connection. +* ldap-coding-system: LDAP Internationalization Variables. +* ldap-decode-address: Encoder/Decoder Functions. +* ldap-decode-attribute: LDAP Internationalization. +* ldap-decode-boolean: Encoder/Decoder Functions. +* ldap-decode-string: Encoder/Decoder Functions. +* ldap-default-attribute-decoder: LDAP Internationalization Variables. +* ldap-default-base: LDAP Variables. +* ldap-default-host: LDAP Variables. +* ldap-default-port: LDAP Variables. +* ldap-delete: Low-level Operations on a LDAP Server. +* ldap-delete-entries: The High-Level LDAP API. +* ldap-encode-address: Encoder/Decoder Functions. +* ldap-encode-boolean: Encoder/Decoder Functions. +* ldap-encode-string: Encoder/Decoder Functions. +* ldap-host: The LDAP Lisp Object. +* ldap-host-parameters-alist: LDAP Variables. +* ldap-ignore-attribute-codings: LDAP Internationalization Variables. +* ldap-live-p: The LDAP Lisp Object. +* ldap-modify: Low-level Operations on a LDAP Server. +* ldap-modify-entries: The High-Level LDAP API. +* ldap-open: Opening and Closing a LDAP Connection. +* ldap-search-basic: Low-level Operations on a LDAP Server. +* ldap-search-entries: The High-Level LDAP API. +* ldap-verbose: LDAP Variables. +* ldapp: The LDAP Lisp Object. +* left-gutter: Specifying a Gutter. +* left-gutter-visible-p: Other Gutter Variables. +* left-gutter-width: Other Gutter Variables. +* left-margin: Margins. +* left-margin-width: Margin Primitives. +* left-toolbar: Specifying the Toolbar. +* left-toolbar-visible-p: Other Toolbar Variables. +* left-toolbar-width: Other Toolbar Variables. +* length: Sequence Functions. +* let: Local Variables. +* let*: Local Variables. +* let-specifier: Adding Specifications. +* lexical binding (Edebug): Edebug Eval. +* lexical comparison: Text Comparison. +* library: Loading. +* library compilation: Compilation Functions. +* library header comments: Library Headers. +* line wrapping: Truncation. +* lines: Text Lines. +* lines in region: Text Lines. +* linking files: Changing File Attributes. +* Lisp debugger: Debugger. +* Lisp expression motion: List Motion. +* Lisp history: Lisp History. +* Lisp library: Loading. +* Lisp nesting error: Eval. +* Lisp object: Lisp Data Types. +* Lisp printer: Output Functions. +* Lisp reader: Streams Intro. +* lisp-interaction-mode-map: Standard Keymaps. +* lisp-mode-abbrev-table: Standard Abbrev Tables. +* lisp-mode-map: Standard Keymaps. +* lisp-mode.el: Example Major Modes. +* list <1>: Building Lists. +* list: Lists. +* list elements: List Elements. +* list form evaluation: Classifying Lists. +* list in keymap: Key Lookup. +* list length: Sequence Functions. +* list motion: List Motion. +* list structure: Cons Cells. +* list-buffers: The Buffer List. +* list-buffers-directory: Buffer File Name. +* list-fonts: Font Instance Names. +* list-processes: Process Information. +* listp: List-related Predicates. +* lists and cons cells: Cons Cells. +* lists as sets: Sets And Lists. +* lists represented as boxes: Lists as Boxes. +* literal evaluation: Self-Evaluating Forms. +* lmessage: The Echo Area. +* ln: Changing File Attributes. +* load: How Programs Do Loading. +* load error with require: Named Features. +* load errors: How Programs Do Loading. +* load-average: System Environment. +* load-default-sounds: Beeping. +* load-history: Unloading. +* load-ignore-elc-files: How Programs Do Loading. +* load-in-progress: How Programs Do Loading. +* load-path: How Programs Do Loading. +* load-read-function: How Programs Do Loading. +* load-sound-file: Beeping. +* load-warn-when-source-newer: How Programs Do Loading. +* load-warn-when-source-only: How Programs Do Loading. +* loading: Loading. +* loading hooks: Hooks for Loading. +* loadup.el: Building XEmacs. +* local binding: Local Variables. +* local keymap: Active Keymaps. +* local variables: Local Variables. +* local-abbrev-table: Standard Abbrev Tables. +* local-key-binding: Functions for Key Lookup. +* local-set-key: Key Binding Commands. +* local-unset-key: Key Binding Commands. +* local-variable-p: Creating Buffer-Local. +* local-write-file-hooks: Saving Buffers. +* locale (in a specifier): Specifiers In-Depth. +* locate-file: How Programs Do Loading. +* locate-file-clear-hashing: How Programs Do Loading. +* lock-buffer: File Locks. +* log: Math Functions. +* log-message-ignore-labels: The Echo Area. +* log-message-ignore-regexps: The Echo Area. +* log-message-max-size: The Echo Area. +* log-warning-minimum-level: Warnings. +* log-warning-suppressed-classes: Warnings. +* log10: Math Functions. +* logand: Bitwise Operations. +* logb: Float Basics. +* logical and: Bitwise Operations. +* logical exclusive or: Bitwise Operations. +* logical inclusive or: Bitwise Operations. +* logical not: Bitwise Operations. +* logical shift: Bitwise Operations. +* logior: Bitwise Operations. +* lognot: Bitwise Operations. +* logxor: Bitwise Operations. +* looking-at: Regexp Search. +* lookup-key: Functions for Key Lookup. +* loops, infinite: Infinite Loops. +* lower case: Character Case. +* lower-frame: Raising and Lowering. +* lowering a frame: Raising and Lowering. +* lsh: Bitwise Operations. +* lwarn: Warnings. +* M-x: Interactive Call. +* Maclisp: Lisp History. +* macro: What Is a Function. +* macro argument evaluation: Argument Evaluation. +* macro call: Expansion. +* macro call evaluation: Macro Forms. +* macro compilation: Compilation Functions. +* macro descriptions: A Sample Function Description. +* macro expansion: Expansion. +* macroexpand: Expansion. +* macros: Macros. +* magic file names: Magic File Names. +* mail-host-address: System Environment. +* major mode: Major Modes. +* major mode hook: Major Mode Conventions. +* major mode keymap: Active Keymaps. +* major-mode: Mode Help. +* make-abbrev-table: Abbrev Tables. +* make-annotation: Annotation Primitives. +* make-auto-save-file-name: Auto-Saving. +* make-backup-file-name: Backup Names. +* make-backup-files: Making Backups. +* make-bit-vector: Bit Vector Functions. +* make-byte-code: Compiled-Function Objects. +* make-char: MULE Characters. +* make-char-table: Working With Char Tables. +* make-charset: Basic Charset Functions. +* make-coding-system: Basic Coding System Functions. +* make-composite-char: Composite Characters. +* make-device: Connecting to a Console or Device. +* make-directory: Create/Delete Dirs. +* make-display-table: Display Table Format. +* make-event: Working With Events. +* make-extent: Creating and Modifying Extents. +* make-face: Basic Face Functions. +* make-file-part: Creating a Partial File. +* make-font-instance: Font Instances. +* make-frame: Creating Frames. +* make-frame-invisible: Visibility of Frames. +* make-frame-visible: Visibility of Frames. +* make-glyph: Creating Glyphs. +* make-glyph-internal: Creating Glyphs. +* make-hash-table: Introduction to Hash Tables. +* make-icon-glyph: Creating Glyphs. +* make-image-instance: Image Instance Functions. +* make-image-specifier: Image Specifiers. +* make-indirect-buffer: Indirect Buffers. +* make-keymap: Creating Keymaps. +* make-list: Building Lists. +* make-local-hook: Hooks. +* make-local-variable: Creating Buffer-Local. +* make-marker: Creating Markers. +* make-obsolete: Obsoleteness. +* make-obsolete-variable: Obsoleteness. +* make-pointer-glyph: Creating Glyphs. +* make-range-table: Introduction to Range Tables. +* make-reverse-direction-charset: Basic Charset Functions. +* make-sparse-keymap: Creating Keymaps. +* make-specifier: Creating Specifiers. +* make-specifier-and-init: Creating Specifiers. +* make-string: Creating Strings. +* make-symbol: Creating Symbols. +* make-symbolic-link: Changing File Attributes. +* make-syntax-table: Syntax Table Functions. +* make-temp-name: Unique File Names. +* make-tooltalk-message: Elisp Interface for Sending Messages. +* make-tooltalk-pattern: Elisp Interface for Receiving Messages. +* make-tty-device: Connecting to a Console or Device. +* make-variable-buffer-local: Creating Buffer-Local. +* make-vector: Vector Functions. +* make-weak-list: Weak Lists. +* make-x-device: Connecting to a Console or Device. +* makunbound: Void Variables. +* Manual-page-minibuffer-history: Minibuffer History. +* map-char-table: Working With Char Tables. +* map-database: Working With a Database. +* map-extent-children: Mapping Over Extents. +* map-extents: Mapping Over Extents. +* map-frame-hook: Frame Hooks. +* map-keymap: Scanning Keymaps. +* map-range-table: Working With Range Tables. +* map-specifier: Other Specification Functions. +* map-y-or-n-p: Multiple Queries. +* mapatoms: Creating Symbols. +* mapcar: Mapping Functions. +* mapcar-extents: Mapping Over Extents. +* mapconcat: Mapping Functions. +* maphash: Working With Hash Tables. +* mapping functions: Mapping Functions. +* margin: Annotation Basics. +* margin width: Margin Primitives. +* mark: The Mark. +* mark excursion: Excursions. +* mark ring: The Mark. +* mark, the: The Mark. +* mark-marker: The Mark. +* mark-ring: The Mark. +* mark-ring-max: The Mark. +* marker argument: Interactive Codes. +* marker garbage collection: Overview of Markers. +* marker input stream: Input Streams. +* marker output stream: Output Streams. +* marker relocation: Overview of Markers. +* marker-buffer: Information from Markers. +* marker-position: Information from Markers. +* markerp: Predicates on Markers. +* markers: Markers. +* markers as numbers: Overview of Markers. +* markers vs. extents: Overview of Markers. +* match data: Match Data. +* match-beginning: Simple Match Data. +* match-data: Entire Match Data. +* match-end: Simple Match Data. +* match-string: Simple Match Data. +* mathematical functions: Math Functions. +* max: Comparison of Numbers. +* max-lisp-eval-depth: Eval. +* max-specpdl-size: Local Variables. +* md5: Transformations. +* MD5 digests: Transformations. +* member: Sets And Lists. +* membership in a list: Sets And Lists. +* memory allocation: Garbage Collection. +* memory-limit: Garbage Collection. +* memq: Sets And Lists. +* menu: Menus. +* menu accelerators: Menu Accelerators. +* menu filters: Menu Filters. +* menu format: Menu Format. +* menu-accelerator-enabled: Menu Accelerator Functions. +* menu-accelerator-map: Menu Accelerator Functions. +* menu-accelerator-modifiers: Menu Accelerator Functions. +* menu-accelerator-prefix: Menu Accelerator Functions. +* menu-no-selection-hook: Menubar. +* menubar: Menubar. +* menubar format: Menubar Format. +* menubar-configuration: Menu Format. +* menubar-pointer-glyph: Mouse Pointer. +* menubar-show-keybindings: Menubar. +* message: The Echo Area. +* meta character printing: Describing Characters. +* meta-prefix-char: Functions for Key Lookup. +* min: Comparison of Numbers. +* minibuffer: Minibuffers. +* minibuffer history: Minibuffer History. +* minibuffer input: Recursive Editing. +* minibuffer window: Cyclic Window Ordering. +* minibuffer-complete: Completion Commands. +* minibuffer-complete-and-exit: Completion Commands. +* minibuffer-complete-word: Completion Commands. +* minibuffer-completion-confirm: Completion Commands. +* minibuffer-completion-help: Completion Commands. +* minibuffer-completion-predicate: Completion Commands. +* minibuffer-completion-table: Completion Commands. +* minibuffer-depth: Minibuffer Misc. +* minibuffer-exit-hook: Minibuffer Misc. +* minibuffer-frame-plist: Initial Properties. +* minibuffer-help-form: Minibuffer Misc. +* minibuffer-history: Minibuffer History. +* minibuffer-local-completion-map <1>: Standard Keymaps. +* minibuffer-local-completion-map: Completion Commands. +* minibuffer-local-isearch-map: Standard Keymaps. +* minibuffer-local-map <1>: Standard Keymaps. +* minibuffer-local-map: Text from Minibuffer. +* minibuffer-local-must-match-map <1>: Standard Keymaps. +* minibuffer-local-must-match-map: Completion Commands. +* minibuffer-prompt: Minibuffer Misc. +* minibuffer-prompt-width: Minibuffer Misc. +* minibuffer-scroll-window: Minibuffer Misc. +* minibuffer-setup-hook: Minibuffer Misc. +* minibuffer-window: Minibuffer Misc. +* minibuffer-window-active-p: Minibuffer Misc. +* minimum window size: Resizing Windows. +* minor mode: Minor Modes. +* minor mode conventions: Minor Mode Conventions. +* minor-mode-alist: Modeline Variables. +* minor-mode-key-binding: Functions for Key Lookup. +* minor-mode-map-alist: Active Keymaps. +* misc-user-event-p: Event Predicates. +* mod: Arithmetic Operations. +* mode: Modes. +* mode help: Mode Help. +* mode hook: Major Mode Conventions. +* mode loading: Major Mode Conventions. +* mode variable: Minor Mode Conventions. +* mode-class property: Major Mode Conventions. +* mode-name: Modeline Variables. +* mode-popup-menu: Pop-Up Menus. +* mode-specific-map <1>: Standard Keymaps. +* mode-specific-map: Prefix Keys. +* modeline: Modeline Format. +* modeline construct: Modeline Data. +* modeline-buffer-identification: Modeline Variables. +* modeline-format: Modeline Data. +* modeline-map <1>: Standard Keymaps. +* modeline-map: Active Keymaps. +* modeline-modified: Modeline Variables. +* modeline-pointer-glyph: Mouse Pointer. +* modeline-process: Modeline Variables. +* modification flag (of buffer): Buffer Modification. +* modification of lists: Rearrangement. +* modification time, comparison of: Modification Time. +* modify-syntax-entry: Syntax Table Functions. +* modulus: Arithmetic Operations. +* momentary-string-display: Temporary Displays. +* mono-pixmap-image-instance-p: Image Instance Types. +* motion-event-p: Event Predicates. +* mouse cursor: Mouse Pointer. +* mouse pointer: Mouse Pointer. +* mouse-event-p: Event Predicates. +* mouse-grabbed-buffer: Active Keymaps. +* mouse-highlight-priority: Extents and Events. +* move-marker: Changing Markers. +* move-to-column: Columns. +* move-to-left-margin: Margins. +* move-to-window-line: Screen Lines. +* MS-DOS and file modes: Changing File Attributes. +* MS-DOS file types: Files and MS-DOS. +* MSWindows OLE: MSWindows OLE. +* multilingual string formatting: Formatting Strings. +* multiple windows: Basic Windows. +* named function: Function Names. +* NaN: Float Basics. +* narrow-to-page: Narrowing. +* narrow-to-region: Narrowing. +* narrowing: Narrowing. +* natnum-specifier-p: Specifier Types. +* natnump: Predicates on Numbers. +* natural numbers: Predicates on Numbers. +* nconc: Rearrangement. +* negative infinity: Float Basics. +* negative-argument: Prefix Command Arguments. +* network connection: Network. +* new file message: Subroutines of Visiting. +* newline <1>: Commands for Insertion. +* newline: Character Type. +* newline and Auto Fill mode: Commands for Insertion. +* newline in print: Output Functions. +* newline in strings: String Type. +* newline-and-indent: Mode-Specific Indent. +* next input: Peeking and Discarding. +* next-command-event: Reading One Event. +* next-event: Reading One Event. +* next-extent: Finding Extents. +* next-frame: Finding All Frames. +* next-history-element: Minibuffer Misc. +* next-matching-history-element: Minibuffer Misc. +* next-property-change: Property Search. +* next-screen-context-lines: Vertical Scrolling. +* next-single-property-change: Property Search. +* next-window: Cyclic Window Ordering. +* nil: Constant Variables. +* nil and lists: Cons Cells. +* nil in keymap: Key Lookup. +* nil in lists: Cons Cell Type. +* nil input stream: Input Streams. +* nil output stream: Output Streams. +* nil, uses of: nil and t. +* ninth: List Elements. +* nlistp: List-related Predicates. +* no-catch: Catch and Throw. +* no-redraw-on-reenter: Refresh Screen. +* nondirectory part (of file name): File Name Components. +* noninteractive: Batch Mode. +* noninteractive use: Batch Mode. +* nonlocal exits: Nonlocal Exits. +* nonprinting characters, reading: Quoted Character Input. +* nontext-pointer-glyph: Mouse Pointer. +* normal-mode: Auto Major Mode. +* not: Combining Conditions. +* not-modified: Buffer Modification. +* nothing-image-instance-p: Image Instance Types. +* nreverse: Rearrangement. +* nth: List Elements. +* nthcdr: List Elements. +* null: List-related Predicates. +* number equality: Comparison of Numbers. +* number-char-or-marker-p: Predicates on Markers. +* number-or-marker-p: Predicates on Markers. +* number-to-string: String Conversion. +* numberp: Predicates on Numbers. +* numbers: Numbers. +* numeric prefix: Formatting Strings. +* numeric prefix argument: Prefix Command Arguments. +* numeric prefix argument usage: Interactive Codes. +* obarray: Creating Symbols. +* obarray in completion: Basic Completion. +* objc-mode-map: Standard Keymaps. +* object: Lisp Data Types. +* object to string: Output Functions. +* object-plist: Object Plists. +* oblique: Font Instance Characteristics. +* obsolete buffer: Modification Time. +* occur-mode-map: Standard Keymaps. +* octal character code: Character Type. +* octal character input: Quoted Character Input. +* octal-escape-glyph: Redisplay Glyphs. +* OffiX DND: OffiX DND. +* old-eq: Equality Predicates. +* one-window-p: Splitting Windows. +* only-global-abbrevs: Defining Abbrevs. +* open-database: Connecting to a Database. +* open-dribble-file: Recording Input. +* open-network-stream: Network. +* open-termscript: Terminal Output. +* open parenthesis character: Syntax Class Table. +* operating system environment: System Environment. +* option descriptions: A Sample Variable Description. +* optional arguments: Argument List. +* options on command line: Command Line Arguments. +* or: Combining Conditions. +* order of extents: Extent Endpoints. +* ordering of windows, cyclic: Cyclic Window Ordering. +* other-buffer: The Buffer List. +* other-window: Cyclic Window Ordering. +* other-window-scroll-buffer: Vertical Scrolling. +* Outline mode: Substitution. +* output from processes: Output from Processes. +* output stream: Output Streams. +* outside margin: Annotation Basics. +* overflow: Integer Basics. +* overlay arrow: Overlay Arrow. +* overlay-arrow-position: Overlay Arrow. +* overlay-arrow-string: Overlay Arrow. +* overriding-local-map <1>: Standard Keymaps. +* overriding-local-map: Active Keymaps. +* overriding-terminal-local-map: Active Keymaps. +* overwrite-mode: Commands for Insertion. +* padding: Formatting Strings. +* page-delimiter: Standard Regexps. +* paired delimiter: Syntax Class Table. +* paragraph-separate: Standard Regexps. +* paragraph-start: Standard Regexps. +* parent of a keymap: Inheritance and Keymaps. +* parent process: Processes. +* parent, of extent: Extent Parents. +* parenthesis: Cons Cell Type. +* parenthesis depth: Parsing Expressions. +* parenthesis matching: Blinking. +* parenthesis syntax: Syntax Class Table. +* parse state: Parsing Expressions. +* parse-partial-sexp: Parsing Expressions. +* parse-sexp-ignore-comments: Parsing Expressions. +* parsing: Syntax Tables. +* partial files: Partial Files. +* passwd-echo: Reading a Password. +* passwd-invert-frame-when-keyboard-grabbed: Reading a Password. +* passwords, reading: Reading a Password. +* PATH environment variable: Subprocess Creation. +* path-separator: System Environment. +* pausing: Waiting. +* peeking at input: Peeking and Discarding. +* percent symbol in modeline: Modeline Data. +* perform-replace: Search and Replace. +* performance analysis: Coverage Testing. +* permanent local variable: Creating Buffer-Local. +* permission: File Attributes. +* pg-coding-system: libpq Lisp Variables. +* pg:authtype: libpq Lisp Variables. +* pg:client-encoding: libpq Lisp Variables. +* pg:cost-heap: libpq Lisp Variables. +* pg:cost-index: libpq Lisp Variables. +* pg:database: libpq Lisp Variables. +* pg:date-style: libpq Lisp Variables. +* pg:geqo: libpq Lisp Variables. +* pg:host: libpq Lisp Variables. +* pg:options: libpq Lisp Variables. +* pg:port: libpq Lisp Variables. +* pg:realm: libpq Lisp Variables. +* pg:tty: libpq Lisp Variables. +* pg:tz: libpq Lisp Variables. +* pg:user: libpq Lisp Variables. +* pgres::polling-active: libpq Lisp Symbols and DataTypes. +* pgres::polling-failed: libpq Lisp Symbols and DataTypes. +* pgres::polling-ok: libpq Lisp Symbols and DataTypes. +* pgres::polling-reading: libpq Lisp Symbols and DataTypes. +* pgres::polling-writing: libpq Lisp Symbols and DataTypes. +* pipes: Asynchronous Processes. +* play-sound: Beeping. +* play-sound-file: Beeping. +* plist: Property Lists. +* plist, symbol: Symbol Properties. +* plist-get: Working With Normal Plists. +* plist-member: Working With Normal Plists. +* plist-put: Working With Normal Plists. +* plist-remprop: Working With Normal Plists. +* plist-to-alist: Converting Plists To/From Alists. +* plists-eq <1>: Other Plists. +* plists-eq: Working With Normal Plists. +* plists-equal <1>: Other Plists. +* plists-equal: Working With Normal Plists. +* point: Point. +* point excursion: Excursions. +* point in window: Window Point. +* point with narrowing: Point. +* point-marker: Creating Markers. +* point-max: Point. +* point-max-marker: Creating Markers. +* point-min: Point. +* point-min-marker: Creating Markers. +* pointer (mouse): Mouse Pointer. +* pointer-glyph-p: Glyph Types. +* pointer-image-instance-p: Image Instance Types. +* pop-global-mark: The Mark. +* pop-mark: The Mark. +* pop-to-buffer: Displaying Buffers. +* pop-up menu: Pop-Up Menus. +* pop-up-frame-function: Choosing Window. +* pop-up-frame-plist: Choosing Window. +* pop-up-frames: Choosing Window. +* pop-up-windows: Choosing Window. +* popup-buffer-menu: Pop-Up Menus. +* popup-dialog-box: Dialog Box Functions. +* popup-menu: Pop-Up Menus. +* popup-menu-titles: Pop-Up Menus. +* popup-menu-up-p: Pop-Up Menus. +* popup-menubar-menu: Pop-Up Menus. +* popup-mode-menu: Pop-Up Menus. +* pos-visible-in-window-p: Window Start. +* position (in buffer): Positions. +* position argument: Interactive Codes. +* position in window: Window Point. +* position of frame: Size and Position. +* position of window: Position of Window. +* positive infinity: Float Basics. +* posix-looking-at: POSIX Regexps. +* posix-search-backward: POSIX Regexps. +* posix-search-forward: POSIX Regexps. +* posix-string-match: POSIX Regexps. +* post-command-hook: Command Overview. +* post-gc-hook: Garbage Collection. +* PostgreSQL: PostgreSQL Support. +* pq-binary-tuples: libpq Lisp Symbols and DataTypes. +* pq-clear: Other libpq Functions. +* pq-client-encoding: Other libpq Functions. +* pq-cmd-status: libpq Lisp Symbols and DataTypes. +* pq-cmd-tuples: libpq Lisp Symbols and DataTypes. +* pq-conn-defaults: Other libpq Functions. +* pq-connect-poll: Asynchronous Interface Functions. +* pq-connect-start: Asynchronous Interface Functions. +* pq-connectdb: Synchronous Interface Functions. +* pq-consume-input: Asynchronous Interface Functions. +* pq-env-2-encoding: Other libpq Functions. +* pq-exec: Synchronous Interface Functions. +* pq-finish: Other libpq Functions. +* pq-flush: Asynchronous Interface Functions. +* pq-fmod: libpq Lisp Symbols and DataTypes. +* pq-fname: libpq Lisp Symbols and DataTypes. +* pq-fnumber: libpq Lisp Symbols and DataTypes. +* pq-fsize: libpq Lisp Symbols and DataTypes. +* pq-ftype: libpq Lisp Symbols and DataTypes. +* pq-get-is-null: libpq Lisp Symbols and DataTypes. +* pq-get-length: libpq Lisp Symbols and DataTypes. +* pq-get-result: Asynchronous Interface Functions. +* pq-get-value: libpq Lisp Symbols and DataTypes. +* pq-is-busy: Asynchronous Interface Functions. +* pq-is-nonblocking: Asynchronous Interface Functions. +* pq-lo-close: Unimplemented libpq Functions. +* pq-lo-creat: Unimplemented libpq Functions. +* pq-lo-export: Large Object Support. +* pq-lo-import: Large Object Support. +* pq-lo-lseek: Unimplemented libpq Functions. +* pq-lo-open: Unimplemented libpq Functions. +* pq-lo-read: Unimplemented libpq Functions. +* pq-lo-tell: Unimplemented libpq Functions. +* pq-lo-unlink: Unimplemented libpq Functions. +* pq-lo-write: Unimplemented libpq Functions. +* pq-make-empty-pgresult: libpq Lisp Symbols and DataTypes. +* pq-nfields: libpq Lisp Symbols and DataTypes. +* pq-notifies: Synchronous Interface Functions. +* pq-ntuples: libpq Lisp Symbols and DataTypes. +* pq-oid-value: libpq Lisp Symbols and DataTypes. +* pq-pgconn: libpq Lisp Symbols and DataTypes. +* pq-res-status: libpq Lisp Symbols and DataTypes. +* pq-reset: Synchronous Interface Functions. +* pq-reset-cancel: Asynchronous Interface Functions. +* pq-reset-poll: Asynchronous Interface Functions. +* pq-reset-start: Asynchronous Interface Functions. +* pq-result-error-message: libpq Lisp Symbols and DataTypes. +* pq-result-status: libpq Lisp Symbols and DataTypes. +* pq-send-query: Asynchronous Interface Functions. +* pq-set-client-encoding: Other libpq Functions. +* pq-set-nonblocking: Asynchronous Interface Functions. +* PQdisplayTuples: Unimplemented libpq Functions. +* PQmblen: Unimplemented libpq Functions. +* PQprint: Unimplemented libpq Functions. +* PQprintTuples: Unimplemented libpq Functions. +* PQsetenv: Synchronous Interface Functions. +* PQsetenvAbort: Asynchronous Interface Functions. +* PQsetenvPoll: Asynchronous Interface Functions. +* PQsetenvStart: Asynchronous Interface Functions. +* PQsocket: Unimplemented libpq Functions. +* PQtrace: Unimplemented libpq Functions. +* PQuntrace: Unimplemented libpq Functions. +* pre-abbrev-expand-hook: Abbrev Expansion. +* pre-command-hook: Command Overview. +* pre-gc-hook: Garbage Collection. +* preceding-char: Near Point. +* precision of formatted numbers: Formatting Strings. +* predicates: Type Predicates. +* prefix argument: Prefix Command Arguments. +* prefix argument unreading: Peeking and Discarding. +* prefix command: Prefix Keys. +* prefix key: Prefix Keys. +* prefix-arg: Prefix Command Arguments. +* prefix-help-command: Help Functions. +* prefix-numeric-value: Prefix Command Arguments. +* preventing backtracking: Specification List. +* preventing prefix key: Key Lookup. +* previous complete subexpression: Parsing Expressions. +* previous-extent: Finding Extents. +* previous-frame: Finding All Frames. +* previous-history-element: Minibuffer Misc. +* previous-matching-history-element: Minibuffer Misc. +* previous-property-change: Property Search. +* previous-single-property-change: Property Search. +* previous-window: Cyclic Window Ordering. +* primitive: What Is a Function. +* primitive type: Lisp Data Types. +* primitive types: Primitive Types. +* primitive-undo: Undo. +* prin1: Output Functions. +* prin1-to-string: Output Functions. +* princ: Output Functions. +* print: Output Functions. +* print example: Output Streams. +* print name cell: Symbol Components. +* print-escape-newlines: Output Variables. +* print-gensym: Output Variables. +* print-help-return-message: Help Functions. +* print-length: Output Variables. +* print-level: Output Variables. +* print-readably <1>: Output Variables. +* print-readably: Printing in Edebug. +* print-string-length: Output Variables. +* printed representation: Printed Representation. +* printed representation for characters: Character Type. +* printing: Streams Intro. +* printing (Edebug): Printing in Edebug. +* printing circular structures: Printing in Edebug. +* printing floating-point numbers: Output Variables. +* printing limits: Output Variables. +* printing notation: Printing Notation. +* printing readably: Output Variables. +* printing uninterned symbols: Output Variables. +* priority of an extent: Intro to Extents. +* process: Processes. +* process filter: Filter Functions. +* process input: Input to Processes. +* process output: Output from Processes. +* process sentinel: Sentinels. +* process signals: Signals to Processes. +* process window size: Process Window Size. +* process-buffer: Process Buffers. +* process-command: Process Information. +* process-connection-type: Asynchronous Processes. +* process-environment: System Environment. +* process-event-p: Event Predicates. +* process-exit-status: Process Information. +* process-filter: Filter Functions. +* process-id: Process Information. +* process-kill-without-query: Deleting Processes. +* process-kill-without-query-p: Process Information. +* process-list: Process Information. +* process-mark: Process Buffers. +* process-name: Process Information. +* process-send-eof: Input to Processes. +* process-send-region: Input to Processes. +* process-send-string: Input to Processes. +* process-sentinel: Sentinels. +* process-status: Process Information. +* process-tty-name: Process Information. +* processp: Processes. +* profile.el: Compilation Tips. +* profiling: Compilation Tips. +* prog1: Sequencing. +* prog2: Sequencing. +* progn: Sequencing. +* program arguments: Subprocess Creation. +* program directories: Subprocess Creation. +* programmed completion: Programmed Completion. +* programming types: Programming Types. +* properties of strings: String Properties. +* properties of text: Text Properties. +* property list: Property Lists. +* property list cell (symbol): Symbol Components. +* property list, symbol: Symbol Properties. +* property lists vs association lists: Plists and Alists. +* property of an extent: Extent Properties. +* protected forms: Cleanups. +* provide: Named Features. +* providing features: Named Features. +* PTYs: Asynchronous Processes. +* punctuation character: Syntax Class Table. +* pure storage: Pure Storage. +* pure-bytes-used: Pure Storage. +* purecopy: Pure Storage. +* purify-flag: Pure Storage. +* push-mark: The Mark. +* put: Object Plists. +* put-char-table: Working With Char Tables. +* put-database: Working With a Database. +* put-range-table: Working With Range Tables. +* put-text-property: Changing Properties. +* putf: Other Plists. +* puthash: Working With Hash Tables. +* query-replace-history: Minibuffer History. +* query-replace-map <1>: Standard Keymaps. +* query-replace-map: Search and Replace. +* querying the user: Yes-or-No Queries. +* question mark in character constant: Character Type. +* quietly-read-abbrev-file: Abbrev Files. +* quit-flag: Quitting. +* quit-process: Signals to Processes. +* quitting: Quitting. +* quitting from infinite loop: Infinite Loops. +* quote: Quoting. +* quote character: Parsing Expressions. +* quoted character input: Quoted Character Input. +* quoted-insert suppression: Changing Key Bindings. +* quoting: Quoting. +* quoting characters in printing: Output Functions. +* quoting using apostrophe: Quoting. +* raise-frame: Raising and Lowering. +* raising a frame: Raising and Lowering. +* random: Random Numbers. +* random numbers: Random Numbers. +* range table type: Range Table Type. +* Range Tables: Range Tables. +* range-table-p: Range Tables. +* rassoc: Association Lists. +* rassq: Association Lists. +* raw prefix argument: Prefix Command Arguments. +* raw prefix argument usage: Interactive Codes. +* re-search-backward: Regexp Search. +* re-search-forward: Regexp Search. +* read: Input Functions. +* read command name: Interactive Call. +* read syntax: Printed Representation. +* read syntax for characters: Character Type. +* read-buffer: High-Level Completion. +* read-char: Reading One Event. +* read-command: High-Level Completion. +* read-expression: Object from Minibuffer. +* read-expression-history: Minibuffer History. +* read-expression-map: Standard Keymaps. +* read-file-name: Reading File Names. +* read-from-minibuffer: Text from Minibuffer. +* read-from-string: Input Functions. +* read-key-sequence: Key Sequence Input. +* read-minibuffer: Object from Minibuffer. +* read-only buffer: Read Only Buffers. +* read-only buffers in interactive: Using Interactive. +* read-passwd: Reading a Password. +* read-quoted-char: Quoted Character Input. +* read-quoted-char quitting: Quitting. +* read-shell-command-map: Standard Keymaps. +* read-string: Text from Minibuffer. +* read-variable: High-Level Completion. +* reading: Streams Intro. +* reading (Edebug): Reading in Edebug. +* reading interactive arguments: Interactive Codes. +* reading symbols: Creating Symbols. +* rearrangement of lists: Rearrangement. +* rebinding: Changing Key Bindings. +* receiving ToolTalk messages: Receiving Messages. +* recent-auto-save-p: Auto-Saving. +* recent-keys: Recording Input. +* recent-keys-ring-size: Recording Input. +* recenter: Vertical Scrolling. +* record command history: Interactive Call. +* recursion: Iteration. +* recursion-depth: Recursive Editing. +* recursive command loop: Recursive Editing. +* recursive editing level: Recursive Editing. +* recursive evaluation: Intro Eval. +* recursive-edit: Recursive Editing. +* redo: Undo. +* redraw-display: Refresh Screen. +* redraw-frame: Refresh Screen. +* redraw-modeline: Modeline Format. +* refresh display: Refresh Screen. +* regexp: Regular Expressions. +* regexp alternative: Syntax of Regexps. +* regexp grouping: Syntax of Regexps. +* regexp searching: Regexp Search. +* regexp-history: Minibuffer History. +* regexp-quote: Syntax of Regexps. +* regexps used standardly in editing: Standard Regexps. +* region argument: Interactive Codes. +* region, the: The Region. +* region-active-p: The Region. +* region-beginning: The Region. +* region-end: The Region. +* region-exists-p: The Region. +* register-alist: Registers. +* register-ccl-program: Calling CCL. +* register-tooltalk-pattern: Elisp Interface for Receiving Messages. +* registers: Registers. +* regular expression: Regular Expressions. +* regular expression searching: Regexp Search. +* reindent-then-newline-and-indent: Mode-Specific Indent. +* relabel-menu-item: Modifying Menus. +* relative file name: Relative File Names. +* remainder: Arithmetic Operations. +* remassoc: Association Lists. +* remassq: Association Lists. +* remhash: Working With Hash Tables. +* remove-database: Working With a Database. +* remove-face-property: Face Properties. +* remove-glyph-property: Glyph Properties. +* remove-hook: Hooks. +* remove-range-table: Working With Range Tables. +* remove-specifier: Other Specification Functions. +* remove-text-properties: Changing Properties. +* remprop: Object Plists. +* remrassoc: Association Lists. +* remrassq: Association Lists. +* rename-auto-save-file: Auto-Saving. +* rename-buffer: Buffer Names. +* rename-file: Changing File Attributes. +* renaming files: Changing File Attributes. +* repeated loading: Repeated Loading. +* replace bindings: Changing Key Bindings. +* replace characters: Substitution. +* replace-buffer-in-windows: Displaying Buffers. +* replace-match: Replacing Match. +* replacement: Search and Replace. +* repositioning format arguments: Formatting Strings. +* require: Named Features. +* require-final-newline: Saving Buffers. +* requiring features: Named Features. +* reset-char-table: Working With Char Tables. +* resize redisplay: Size and Position. +* rest arguments: Argument List. +* restriction (in a buffer): Narrowing. +* resume (cf. no-redraw-on-reenter): Refresh Screen. +* return: Character Type. +* return-tooltalk-message: Elisp Interface for Sending Messages. +* reveal-annotation: Annotation Properties. +* reverse: Building Lists. +* reversing a list: Rearrangement. +* revert-buffer: Reverting. +* revert-buffer-function: Reverting. +* revert-buffer-insert-file-contents-function: Reverting. +* right-gutter: Specifying a Gutter. +* right-gutter-visible-p: Other Gutter Variables. +* right-gutter-width: Other Gutter Variables. +* right-margin-width: Margin Primitives. +* right-toolbar: Specifying the Toolbar. +* right-toolbar-visible-p: Other Toolbar Variables. +* right-toolbar-width: Other Toolbar Variables. +* rm: Changing File Attributes. +* round: Numeric Conversions. +* rounding in conversions: Numeric Conversions. +* rounding without conversion: Rounding Operations. +* rplaca: Modifying Lists. +* rplacd: Modifying Lists. +* run time stack: Internals of Debugger. +* run-emacs-from-temacs: Building XEmacs. +* run-hooks: Hooks. +* runnable temacs: Building XEmacs. +* same-window-buffer-names: Choosing Window. +* same-window-regexps: Choosing Window. +* save-abbrevs: Abbrev Files. +* save-buffer: Saving Buffers. +* save-current-buffer: Excursions. +* save-excursion: Excursions. +* save-excursion (Edebug): Edebug Display Update. +* save-match-data: Saving Match Data. +* save-restriction: Narrowing. +* save-selected-frame: Input Focus. +* save-selected-window <1>: Excursions. +* save-selected-window: Selecting Windows. +* save-some-buffers: Saving Buffers. +* save-window-excursion: Window Configurations. +* saving text properties: Saving Properties. +* saving window information: Window Configurations. +* scan-lists: Parsing Expressions. +* scan-sexps: Parsing Expressions. +* scope: Variable Scoping. +* screen layout: Window Configuration Type. +* scroll-conservatively: Vertical Scrolling. +* scroll-down: Vertical Scrolling. +* scroll-left: Horizontal Scrolling. +* scroll-other-window: Vertical Scrolling. +* scroll-right: Horizontal Scrolling. +* scroll-step: Vertical Scrolling. +* scroll-up: Vertical Scrolling. +* scrollbar-pointer-glyph: Mouse Pointer. +* scrollbars: Scrollbars. +* scrolling vertically: Vertical Scrolling. +* search-backward: String Search. +* search-failed: String Search. +* search-forward: String Search. +* searching: Searching and Matching. +* searching and case: Searching and Case. +* searching for regexp: Regexp Search. +* second: List Elements. +* select-console: The Selected Console and Device. +* select-device: The Selected Console and Device. +* select-frame: Input Focus. +* select-frame-hook: Frame Hooks. +* select-window: Selecting Windows. +* selected frame: Input Focus. +* selected window: Basic Windows. +* selected-console: The Selected Console and Device. +* selected-device: The Selected Console and Device. +* selected-frame: Input Focus. +* selected-window: Selecting Windows. +* selecting a buffer: Current Buffer. +* selecting windows: Selecting Windows. +* selection (for X windows): X Selections. +* selection-pointer-glyph: Mouse Pointer. +* selective display: Selective Display. +* selective-display: Selective Display. +* selective-display-ellipses: Selective Display. +* self-evaluating form: Self-Evaluating Forms. +* self-insert-and-exit: Minibuffer Misc. +* self-insert-command: Commands for Insertion. +* self-insert-command override: Changing Key Bindings. +* self-insert-command, minor modes: Keymaps and Minor Modes. +* self-insertion: Commands for Insertion. +* send-string-to-terminal: Terminal Output. +* send-tooltalk-message: Elisp Interface for Sending Messages. +* sending signals: Signals to Processes. +* sending ToolTalk messages: Sending Messages. +* sentence-end: Standard Regexps. +* sentinel: Sentinels. +* sequence: Sequences Arrays Vectors. +* sequence length: Sequence Functions. +* sequencep: Sequence Functions. +* set: Setting Variables. +* set-annotation-action: Annotation Properties. +* set-annotation-data: Annotation Properties. +* set-annotation-down-glyph: Annotation Properties. +* set-annotation-face: Annotation Properties. +* set-annotation-glyph: Annotation Properties. +* set-annotation-layout: Annotation Properties. +* set-annotation-menu: Annotation Properties. +* set-auto-mode: Auto Major Mode. +* set-buffer: Current Buffer. +* set-buffer-auto-saved: Auto-Saving. +* set-buffer-major-mode: Auto Major Mode. +* set-buffer-menubar: Menubar. +* set-buffer-modified-p: Buffer Modification. +* set-case-syntax: Case Tables. +* set-case-syntax-delims: Case Tables. +* set-case-syntax-pair: Case Tables. +* set-case-table: Case Tables. +* set-category-table: Category Tables. +* set-charset-ccl-program: Charset Property Functions. +* set-coding-category-system: Detection of Textual Encoding. +* set-coding-priority-list: Detection of Textual Encoding. +* set-console-type-image-conversion-list: Image Instantiator Conversion. +* set-default: Default Value. +* set-default-file-modes: Changing File Attributes. +* set-default-gutter-position: Specifying a Gutter. +* set-default-toolbar-position: Specifying the Toolbar. +* set-device-baud-rate <1>: Terminal Output. +* set-device-baud-rate: Console and Device I/O. +* set-extent-begin-glyph: Extent Properties. +* set-extent-begin-glyph-layout: Extent Properties. +* set-extent-end-glyph: Extent Properties. +* set-extent-end-glyph-layout: Extent Properties. +* set-extent-endpoints: Extent Endpoints. +* set-extent-face: Extent Properties. +* set-extent-initial-redisplay-function: Extent Properties. +* set-extent-keymap: Extent Properties. +* set-extent-mouse-face: Extent Properties. +* set-extent-parent: Extent Parents. +* set-extent-priority: Extent Properties. +* set-extent-properties: Extent Properties. +* set-extent-property: Extent Properties. +* set-face-background: Face Convenience Functions. +* set-face-background-pixmap: Face Convenience Functions. +* set-face-font: Face Convenience Functions. +* set-face-foreground: Face Convenience Functions. +* set-face-property: Face Properties. +* set-face-underline-p: Face Convenience Functions. +* set-file-modes: Changing File Attributes. +* set-frame-configuration: Frame Configurations. +* set-frame-pointer: Mouse Pointer. +* set-frame-position: Size and Position. +* set-frame-properties: Property Access. +* set-frame-property: Property Access. +* set-frame-size: Size and Position. +* set-glyph-baseline: Glyph Convenience Functions. +* set-glyph-contrib-p: Glyph Convenience Functions. +* set-glyph-face: Glyph Convenience Functions. +* set-glyph-image: Glyph Convenience Functions. +* set-glyph-property: Glyph Properties. +* set-input-mode: Input Modes. +* set-keymap-default-binding: Inheritance and Keymaps. +* set-keymap-name: Creating Keymaps. +* set-keymap-parents: Inheritance and Keymaps. +* set-keymap-prompt: Other Keymap Functions. +* set-left-margin: Margins. +* set-mark: The Mark. +* set-marker: Changing Markers. +* set-match-data: Entire Match Data. +* set-menubar: Menubar. +* set-menubar-dirty-flag: Menubar. +* set-process-buffer: Process Buffers. +* set-process-filter: Filter Functions. +* set-process-sentinel: Sentinels. +* set-process-window-size: Process Window Size. +* set-recent-keys-ring-size: Recording Input. +* set-register: Registers. +* set-right-margin: Margins. +* set-specifier: Adding Specifications. +* set-standard-case-table: Case Tables. +* set-syntax-table: Syntax Table Functions. +* set-text-properties: Changing Properties. +* set-tooltalk-message-attribute: Elisp Interface for Sending Messages. +* set-visited-file-modtime: Modification Time. +* set-visited-file-name: Buffer File Name. +* set-weak-list-list: Weak Lists. +* set-window-buffer: Buffers and Windows. +* set-window-buffer-dedicated: Choosing Window. +* set-window-configuration: Window Configurations. +* set-window-dedicated-p: Choosing Window. +* set-window-hscroll: Horizontal Scrolling. +* set-window-point: Window Point. +* set-window-start: Window Start. +* setcar: Setcar. +* setcdr: Setcdr. +* setenv: System Environment. +* setplist: Object Plists. +* setprv: System Environment. +* setq: Setting Variables. +* setq-default: Default Value. +* sets: Sets And Lists. +* setting modes of files: Changing File Attributes. +* setting-constant: Constant Variables. +* seventh: List Elements. +* sexp motion: List Motion. +* shadowing of variables: Local Variables. +* shallow binding: Impl of Scope. +* shared-lisp-mode-map: Standard Keymaps. +* Shell mode modeline-format: Modeline Data. +* shell-command-history: Minibuffer History. +* shrink-window: Resizing Windows. +* shrink-window-horizontally: Resizing Windows. +* shrink-window-pixels: Resizing Windows. +* side effect: Intro Eval. +* signal: Signaling Errors. +* signal-error: Signaling Errors. +* signal-process: Signals to Processes. +* signaling errors: Signaling Errors. +* signals: Signals to Processes. +* sin: Math Functions. +* single-key-description: Describing Characters. +* sinh: Math Functions. +* sit-for: Waiting. +* site-init.el: Building XEmacs. +* site-load.el: Building XEmacs. +* site-run-file: Init File. +* site-start.el: Start-up Summary. +* sixth: List Elements. +* size of frame: Size and Position. +* size of window: Size of Window. +* skip-chars-backward: Skipping Characters. +* skip-chars-forward: Skipping Characters. +* skip-syntax-backward: Motion and Syntax. +* skip-syntax-forward: Motion and Syntax. +* skipping characters: Skipping Characters. +* skipping comments: Parsing Expressions. +* sleep-for: Waiting. +* Snarf-documentation: Accessing Documentation. +* sort: Rearrangement. +* sort-columns: Sorting. +* sort-fields: Sorting. +* sort-lines: Sorting. +* sort-numeric-fields: Sorting. +* sort-pages: Sorting. +* sort-paragraphs: Sorting. +* sort-regexp-fields: Sorting. +* sort-subr: Sorting. +* sorting lists: Rearrangement. +* sorting text: Sorting. +* sound: Beeping. +* sound-alist: Beeping. +* special: Major Mode Conventions. +* special form descriptions: A Sample Function Description. +* special form evaluation: Special Forms. +* special forms: Primitive Function Type. +* special forms (Edebug): Instrumenting. +* special forms for control structures: Control Structures. +* special-display-buffer-names: Choosing Window. +* special-display-frame-plist: Choosing Window. +* special-display-function: Choosing Window. +* special-display-popup-frame: Choosing Window. +* special-display-regexps: Choosing Window. +* specification (in a specifier): Specifiers In-Depth. +* specifier: Specifiers. +* specifier type: Specifier Type. +* specifier, domain: Specifiers In-Depth. +* specifier, fallback: Specifier Instancing. +* specifier, inst-list: Specifiers In-Depth. +* specifier, inst-pair: Specifiers In-Depth. +* specifier, instance: Specifiers In-Depth. +* specifier, instancing: Specifiers In-Depth. +* specifier, instantiator: Specifiers In-Depth. +* specifier, locale: Specifiers In-Depth. +* specifier, specification: Specifiers In-Depth. +* specifier, tag: Specifiers In-Depth. +* specifier, tag set: Specifiers In-Depth. +* specifier-fallback: Retrieving Specifications. +* specifier-instance: Specifier Instancing Functions. +* specifier-instance-from-inst-list: Specifier Instancing Functions. +* specifier-locale-type-from-locale: Other Specification Functions. +* specifier-spec-list: Retrieving Specifications. +* specifier-specs: Retrieving Specifications. +* specifier-tag-list: Specifier Tag Functions. +* specifier-tag-predicate: Specifier Tag Functions. +* specifier-type: Specifier Types. +* specifierp: Specifiers. +* speedups: Compilation Tips. +* splicing (with backquote): Backquote. +* split-height-threshold: Choosing Window. +* split-line: Commands for Insertion. +* split-path: Regexp Search. +* split-string: Regexp Search. +* split-window: Splitting Windows. +* split-window-horizontally: Splitting Windows. +* split-window-vertically: Splitting Windows. +* splitting windows: Splitting Windows. +* sqrt: Math Functions. +* stable sort: Rearrangement. +* standard regexps used in editing: Standard Regexps. +* standard-case-table: Case Tables. +* standard-category-table: Category Tables. +* standard-input: Input Functions. +* standard-output: Output Variables. +* standard-syntax-table: Standard Syntax Tables. +* standards of coding style: Tips. +* start up of XEmacs: Start-up Summary. +* start-process: Asynchronous Processes. +* start-process-shell-command: Asynchronous Processes. +* startup.el: Start-up Summary. +* stop points: Using Edebug. +* stop-process: Signals to Processes. +* stopping an infinite loop: Infinite Loops. +* stopping on events: Global Break Condition. +* store-match-data: Entire Match Data. +* stream (for printing): Output Streams. +* stream (for reading): Input Streams. +* string: Creating Strings. +* string equality: Text Comparison. +* string in keymap: Key Lookup. +* string input stream: Input Streams. +* string length: Sequence Functions. +* string length, maximum when printing: Output Variables. +* string properties: String Properties. +* string search: String Search. +* string to character: String Conversion. +* string to number: String Conversion. +* string to object: Input Functions. +* string, writing a doc string: Documentation Basics. +* string-equal: Text Comparison. +* string-lessp: Text Comparison. +* string-match: Regexp Search. +* string-modified-tick: Modifying Strings. +* string-to-char: String Conversion. +* string-to-int: String Conversion. +* string-to-number: String Conversion. +* string<: Text Comparison. +* string=: Text Comparison. +* stringp: Predicates for Strings. +* strings: Strings and Characters. +* strings, formatting them: Formatting Strings. +* strings, modifying: Modifying Strings. +* string quote: Syntax Class Table. +* subprocess: Processes. +* subr: What Is a Function. +* subrp: What Is a Function. +* subsidiary-coding-system: Basic Coding System Functions. +* subst-char-in-region: Substitution. +* substitute-command-keys: Keys in Documentation. +* substitute-in-file-name: File Name Expansion. +* substitute-key-definition: Changing Key Bindings. +* substituting keys in documentation: Keys in Documentation. +* substring: Creating Strings. +* subwindow type: Subwindow Type. +* subwindow-image-instance-p: Image Instance Types. +* subwindowp: Subwindows. +* suppress-keymap: Changing Key Bindings. +* suspend (cf. no-redraw-on-reenter): Refresh Screen. +* suspend evaluation: Recursive Editing. +* suspend-emacs: Suspending XEmacs. +* suspend-hook: Suspending XEmacs. +* suspend-resume-hook: Suspending XEmacs. +* suspending XEmacs: Suspending XEmacs. +* switch-to-buffer: Displaying Buffers. +* switch-to-buffer-other-window: Displaying Buffers. +* switches on command line: Command Line Arguments. +* switching to a buffer: Displaying Buffers. +* symbol: Symbols. +* symbol components: Symbol Components. +* symbol equality: Creating Symbols. +* symbol evaluation: Symbol Forms. +* symbol function indirection: Function Indirection. +* symbol in keymap: Key Lookup. +* symbol name hashing: Creating Symbols. +* symbol-function: Function Cells. +* symbol-name: Creating Symbols. +* symbol-plist: Object Plists. +* symbol-value: Accessing Variables. +* symbolp: Symbols. +* symbol constituent: Syntax Class Table. +* synchronous subprocess: Synchronous Processes. +* syntax classes: Syntax Descriptors. +* syntax descriptor: Syntax Descriptors. +* syntax error (Edebug): Backtracking. +* syntax flags: Syntax Flags. +* syntax for characters: Character Type. +* syntax table: Syntax Tables. +* syntax table example: Example Major Modes. +* syntax table internals: Syntax Table Internals. +* syntax tables in modes: Major Mode Conventions. +* syntax-table: Syntax Table Functions. +* syntax-table-p: Syntax Basics. +* system-configuration: System Environment. +* system-name: System Environment. +* system-type: System Environment. +* t: Constant Variables. +* t and truth: nil and t. +* t input stream: Input Streams. +* t output stream: Output Streams. +* tab: Character Type. +* tab deletion: Deletion. +* tab-stop-list: Indent Tabs. +* tab-to-tab-stop: Indent Tabs. +* tab-width: Usual Display. +* tabs stops for indentation: Indent Tabs. +* tag (in a specifier): Specifiers In-Depth. +* tag on run time stack: Catch and Throw. +* tag set (in a specifier): Specifiers In-Depth. +* tan: Math Functions. +* tanh: Math Functions. +* TCP: Network. +* temacs: Building XEmacs. +* temp-buffer-show-function: Temporary Displays. +* temp-directory: Unique File Names. +* tenth: List Elements. +* TERM environment variable: Terminal-Specific. +* term-file-prefix: Terminal-Specific. +* term-setup-hook: Terminal-Specific. +* Termcap: Terminal-Specific. +* terminal frame <1>: Frames. +* terminal frame: Basic Windows. +* terminal input: Terminal Input. +* terminal input modes: Input Modes. +* terminal output: Terminal Output. +* terminal-device: Console Types and Device Classes. +* terminal-specific initialization: Terminal-Specific. +* terminate keyboard macro: Peeking and Discarding. +* termscript file: Terminal Output. +* terpri: Output Functions. +* testing types: Type Predicates. +* text: Text. +* text files and binary files: Files and MS-DOS. +* text insertion: Insertion. +* text parsing: Syntax Tables. +* text properties: Text Properties. +* text properties in files: Saving Properties. +* text-char-description: Describing Characters. +* text-image-instance-p: Image Instance Types. +* text-mode-abbrev-table: Standard Abbrev Tables. +* text-mode-map: Standard Keymaps. +* text-mode-syntax-table: Standard Syntax Tables. +* text-pointer-glyph: Mouse Pointer. +* text-properties-at: Examining Properties. +* text-property-any: Property Search. +* text-property-not-all: Property Search. +* third: List Elements. +* this-command: Command Loop Info. +* this-command-keys: Command Loop Info. +* throw: Catch and Throw. +* throw example: Recursive Editing. +* tiled windows: Basic Windows. +* timeout-event-p: Event Predicates. +* timing programs: Compilation Tips. +* tips: Tips. +* toggle-read-only: Read Only Buffers. +* toolbar: Toolbar. +* toolbar button type: Toolbar Button Type. +* toolbar-buttons-captioned-p: Other Toolbar Variables. +* toolbar-make-button-list: Toolbar Descriptor Format. +* toolbar-map <1>: Standard Keymaps. +* toolbar-map: Active Keymaps. +* toolbar-pointer-glyph: Mouse Pointer. +* toolbar-specifier-p <1>: Specifier Types. +* toolbar-specifier-p: Specifying the Toolbar. +* ToolTalk: ToolTalk Support. +* ToolTalk message: Sending Messages. +* ToolTalk pattern: Receiving Messages. +* top-gutter: Specifying a Gutter. +* top-gutter-height: Other Gutter Variables. +* top-gutter-visible-p: Other Gutter Variables. +* top-level: Recursive Editing. +* top-level form: Loading. +* top-toolbar: Specifying the Toolbar. +* top-toolbar-height: Other Toolbar Variables. +* top-toolbar-visible-p: Other Toolbar Variables. +* tq-close: Transaction Queues. +* tq-create: Transaction Queues. +* tq-enqueue: Transaction Queues. +* tracing: Tracing. +* transaction queue: Transaction Queues. +* transcendental functions: Math Functions. +* translate-region: Substitution. +* translating input events: Translating Input. +* transpose-regions: Transposition. +* true: nil and t. +* truename (of file): Truenames. +* truncate: Numeric Conversions. +* truncate-lines: Truncation. +* truncate-partial-width-windows: Truncation. +* truncation-glyph: Redisplay Glyphs. +* truth value: nil and t. +* try-completion: Basic Completion. +* two's complement: Integer Basics. +* type: Lisp Data Types. +* type checking: Type Predicates. +* type predicates: Type Predicates. +* type-of: Type Predicates. +* unbinding keys: Key Binding Commands. +* undefined: Functions for Key Lookup. +* undefined in keymap: Key Lookup. +* undefined key: Keymap Terminology. +* undo avoidance: Substitution. +* undo-boundary: Undo. +* undo-limit: Maintaining Undo. +* undo-strong-limit: Maintaining Undo. +* unexec: Building XEmacs. +* unhandled-file-name-directory: Magic File Names. +* unintern: Creating Symbols. +* uninterned symbol: Creating Symbols. +* uninterned symbols, printing: Output Variables. +* unique extents: Duplicable Extents. +* universal-argument: Prefix Command Arguments. +* unload-feature: Unloading. +* unloading: Unloading. +* unlock-buffer: File Locks. +* unmap-frame-hook: Frame Hooks. +* unread-command-event: Peeking and Discarding. +* unread-command-events: Peeking and Discarding. +* unreading: Input Streams. +* unregister-tooltalk-pattern: Elisp Interface for Receiving Messages. +* unwind-protect: Cleanups. +* unwinding: Cleanups. +* up-list: List Motion. +* upcase: Character Case. +* upcase-region: Case Changes. +* upcase-word: Case Changes. +* update display: Refresh Screen. +* update-directory-autoloads: Autoload. +* update-file-autoloads: Autoload. +* upper case: Character Case. +* upper case key sequence: Key Sequence Input. +* use-global-map: Active Keymaps. +* use-hard-newlines: Filling. +* use-left-overflow: Margin Primitives. +* use-local-map: Active Keymaps. +* use-right-overflow: Margin Primitives. +* user name completion subroutines: User Name Completion. +* user option: Defining Variables. +* user-defined error: Error Symbols. +* user-full-name: User Identification. +* user-home-directory: User Identification. +* user-login-name: User Identification. +* user-mail-address: User Identification. +* user-name-all-completions: User Name Completion. +* user-name-completion: User Name Completion. +* user-name-completion-1: User Name Completion. +* user-real-login-name: User Identification. +* user-real-uid: User Identification. +* user-uid: User Identification. +* user-variable-p: Defining Variables. +* user-variable-p example: High-Level Completion. +* valid-char-table-type-p: Char Table Types. +* valid-char-table-value-p: Working With Char Tables. +* valid-device-class-p: Console Types and Device Classes. +* valid-device-type-p: Console Types and Device Classes. +* valid-glyph-type-p: Glyph Types. +* valid-image-instance-type-p: Image Instance Types. +* valid-image-instantiator-format-p: Image Specifiers. +* valid-inst-list-p: Specifier Validation Functions. +* valid-instantiator-p: Specifier Validation Functions. +* valid-plist-p: Property Lists. +* valid-spec-list-p: Specifier Validation Functions. +* valid-specifier-domain-p: Specifier Validation Functions. +* valid-specifier-locale-p: Specifier Validation Functions. +* valid-specifier-locale-type-p: Specifier Validation Functions. +* valid-specifier-tag-p <1>: Specifier Validation Functions. +* valid-specifier-tag-p: Specifier Tag Functions. +* valid-specifier-tag-set-p: Specifier Tag Functions. +* valid-specifier-type-p: Specifier Validation Functions. +* value cell: Symbol Components. +* value of expression: Evaluation. +* values: Eval. +* variable: Variables. +* variable aliases: Variable Aliases. +* variable definition: Defining Variables. +* variable descriptions: A Sample Variable Description. +* variable limit error: Local Variables. +* variable-alias: Variable Aliases. +* variable-documentation: Documentation Basics. +* variable-obsoleteness-doc: Obsoleteness. +* variables, buffer-local: Buffer-Local Variables. +* variables, indirect: Variable Aliases. +* vc-mode: Modeline Variables. +* vconcat: Vector Functions. +* vector <1>: Vector Functions. +* vector: Vectors. +* vector evaluation: Self-Evaluating Forms. +* vector length: Sequence Functions. +* vectorp: Vector Functions. +* verify-visited-file-modtime: Modification Time. +* version number (in file name): File Name Components. +* version-control: Numbered Backups. +* vertical scrolling: Vertical Scrolling. +* vertical tab: Character Type. +* vertical-motion: Screen Lines. +* vertical-motion-pixels: Screen Lines. +* view-file: Visiting Functions. +* view-mode-map: Standard Keymaps. +* view-register: Registers. +* visible frame: Visibility of Frames. +* visible-bell: Beeping. +* visible-frame-list: Finding All Frames. +* visited file: Buffer File Name. +* visited file mode: Auto Major Mode. +* visited-file-modtime: Modification Time. +* visiting files: Visiting Files. +* void function: Function Indirection. +* void function cell: Function Cells. +* void variable: Void Variables. +* void-function: Function Cells. +* void-variable: Void Variables. +* waiting: Waiting. +* waiting for command key input: Peeking and Discarding. +* waiting-for-user-input-p: Sentinels. +* wakeup: Subprocess Creation. +* walk-windows: Cyclic Window Ordering. +* weak hash table: Weak Hash Tables. +* weak list: Weak Lists. +* weak list type: Weak List Type. +* weak-list-list: Weak Lists. +* weak-list-p: Weak Lists. +* weak-list-type: Weak Lists. +* where-is-internal: Scanning Keymaps. +* while: Iteration. +* whitespace: Character Type. +* whitespace character: Syntax Class Table. +* widen: Narrowing. +* widening: Narrowing. +* window: Basic Windows. +* window configuration (Edebug): Edebug Display Update. +* window configurations: Window Configurations. +* window excursions: Excursions. +* window ordering, cyclic: Cyclic Window Ordering. +* window point: Window Point. +* window position <1>: Position of Window. +* window position: Window Point. +* window resizing: Resizing Windows. +* window size: Size of Window. +* window size, changing: Resizing Windows. +* window splitting: Splitting Windows. +* window system types: Window-System Types. +* window top line: Window Start. +* window-buffer: Buffers and Windows. +* window-configuration-p: Window Configurations. +* window-dedicated-p: Choosing Window. +* window-displayed-text-pixel-height: Size of Window. +* window-end: Window Start. +* window-frame: Frames and Windows. +* window-height: Size of Window. +* window-highest-p: Position of Window. +* window-hscroll: Horizontal Scrolling. +* window-left-margin-pixel-width: Margin Primitives. +* window-live-p: Deleting Windows. +* window-lowest-p: Position of Window. +* window-min-height: Resizing Windows. +* window-min-width: Resizing Windows. +* window-minibuffer-p: Minibuffer Misc. +* window-pixel-edges: Position of Window. +* window-pixel-height: Size of Window. +* window-pixel-width: Size of Window. +* window-point: Window Point. +* window-right-margin-pixel-width: Margin Primitives. +* window-setup-hook: Terminal-Specific. +* window-size-change-functions: Resizing Windows. +* window-start: Window Start. +* window-system objects: Faces and Window-System Objects. +* window-text-area-pixel-edges: Position of Window. +* window-text-area-pixel-height: Size of Window. +* window-text-area-pixel-width: Size of Window. +* window-width: Size of Window. +* windowp: Basic Windows. +* windows, controlling precisely: Buffers and Windows. +* with-current-buffer: Excursions. +* with-output-to-temp-buffer: Temporary Displays. +* with-selected-frame: Input Focus. +* with-temp-file: Excursions. +* word search: String Search. +* word-search-backward: String Search. +* word-search-forward: String Search. +* words-include-escapes: Word Motion. +* word constituent: Syntax Class Table. +* write-abbrev-file: Abbrev Files. +* write-char: Output Functions. +* write-contents-hooks: Saving Buffers. +* write-file: Saving Buffers. +* write-file-hooks: Saving Buffers. +* write-region: Writing to Files. +* write-region-annotate-functions: Saving Properties. +* writing a documentation string: Documentation Basics. +* wrong-number-of-arguments: Argument List. +* wrong-type-argument: Type Predicates. +* X: X-Windows. +* X resource type: X Resource Type. +* X window frame: Frames. +* x-allow-sendevents: X Miscellaneous. +* x-bitmap-file-path <1>: X Miscellaneous. +* x-bitmap-file-path: Image Specifiers. +* x-debug-events: X Miscellaneous. +* x-debug-mode: X Miscellaneous. +* x-disown-selection: X Selections. +* x-display-visual-class: Server Data. +* x-emacs-application-class: Resources. +* x-find-larger-font: Font Instance Size. +* x-find-smaller-font: Font Instance Size. +* x-font-size: Font Instance Size. +* x-get-cutbuffer: X Selections. +* x-get-resource: Resources. +* x-get-selection: X Selections. +* x-grab-keyboard: Grabs. +* x-grab-pointer: Grabs. +* x-library-search-path: X Miscellaneous. +* x-make-font-bold: Font Instance Characteristics. +* x-make-font-bold-italic: Font Instance Characteristics. +* x-make-font-italic: Font Instance Characteristics. +* x-make-font-unbold: Font Instance Characteristics. +* x-make-font-unitalic: Font Instance Characteristics. +* x-own-selection: X Selections. +* x-put-resource: Resources. +* x-server-vendor: Server Data. +* x-server-version: Server Data. +* x-set-frame-icon-pixmap: Frame Titles. +* x-store-cutbuffer: X Selections. +* x-ungrab-keyboard: Grabs. +* x-ungrab-pointer: Grabs. +* x-valid-keysym-name-p: X Miscellaneous. +* x-window-id: X Miscellaneous. +* X-Windows: X-Windows. +* XEmacs event standard notation: Describing Characters. +* xpm-color-symbols: Image Specifiers. +* y-or-n-p: Yes-or-No Queries. +* y-or-n-p-maybe-dialog-box: Yes-or-No Queries. +* yank: Yank Commands. +* yank suppression: Changing Key Bindings. +* yank-pop: Yank Commands. +* yes-or-no questions: Yes-or-No Queries. +* yes-or-no-p: Yes-or-No Queries. +* yes-or-no-p-dialog-box: Yes-or-No Queries. +* yes-or-no-p-maybe-dialog-box: Yes-or-No Queries. +* zero-length extent: Extent Endpoints. +* zerop: Predicates on Numbers. +* zmacs-activate-region: The Region. +* zmacs-activate-region-hook: The Region. +* zmacs-deactivate-region: The Region. +* zmacs-deactivate-region-hook: The Region. +* zmacs-region-stays: The Region. +* zmacs-regions: The Region. +* zmacs-update-region: The Region. +* zmacs-update-region-hook: The Region. +* | in regexp: Syntax of Regexps. + + diff --git a/info/lispref.info-48 b/info/lispref.info-48 new file mode 100644 index 0000000..9a7209c --- /dev/null +++ b/info/lispref.info-48 @@ -0,0 +1,3501 @@ +This is ../info/lispref.info, produced by makeinfo version 4.0 from +lispref/lispref.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Lispref: (lispref). XEmacs Lisp Reference Manual. +END-INFO-DIR-ENTRY + + Edition History: + + GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU +Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid +Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994 +XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995 +GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp +Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp +Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp +Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, +November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998 + + Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software +Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc. +Copyright (C) 1995, 1996 Ben Wing. + + 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 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 Foundation. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the section entitled "GNU General Public License" is 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 the section entitled "GNU General Public License" +may be included in a translation approved by the Free Software +Foundation instead of in the original English. + + +File: lispref.info, Node: Index, Prev: Standard Hooks, Up: Top + +Index +***** + +* Menu: + +* " in printing: Output Functions. +* " in strings: String Type. +* #$: Docs and Compilation. +* #@COUNT: Docs and Compilation. +* $ in display: Truncation. +* $ in regexp: Syntax of Regexps. +* %: Arithmetic Operations. +* % in format: Formatting Strings. +* & in replacement: Replacing Match. +* &define (Edebug): Specification List. +* ¬ (Edebug): Specification List. +* &optional: Argument List. +* &optional (Edebug): Specification List. +* &or (Edebug): Specification List. +* &rest: Argument List. +* &rest (Edebug): Specification List. +* ' for quoting: Quoting. +* ( in regexp: Syntax of Regexps. +* (...) in lists: Cons Cell Type. +* ) in regexp: Syntax of Regexps. +* *: Arithmetic Operations. +* * in interactive: Using Interactive. +* * in regexp: Syntax of Regexps. +* *? in regexp: Syntax of Regexps. +* *PQfn: Unimplemented libpq Functions. +* *PQoidStatus: Unimplemented libpq Functions. +* *PQsetdb: Unimplemented libpq Functions. +* *PQsetdbLogin: Unimplemented libpq Functions. +* *scratch*: Auto Major Mode. +* +: Arithmetic Operations. +* + in regexp: Syntax of Regexps. +* +? in regexp: Syntax of Regexps. +* , (with Backquote): Backquote. +* ,@ (with Backquote): Backquote. +* -: Arithmetic Operations. +* . in lists: Dotted Pair Notation. +* . in regexp: Syntax of Regexps. +* .emacs: Init File. +* .emacs customization: Major Mode Conventions. +* /: Arithmetic Operations. +* /=: Comparison of Numbers. +* 1+: Arithmetic Operations. +* 1-: Arithmetic Operations. +* ; in comment: Comments. +* <: Comparison of Numbers. +* <=: Comparison of Numbers. +* : Functions for Key Lookup. +* =: Comparison of Numbers. +* >: Comparison of Numbers. +* >=: Comparison of Numbers. +* ? in character constant: Character Type. +* ? in regexp: Syntax of Regexps. +* ?? in regexp: Syntax of Regexps. +* @ in interactive: Using Interactive. +* [ in regexp: Syntax of Regexps. +* [...] (Edebug): Specification List. +* \ in character constant: Character Type. +* \ in display: Truncation. +* \ in printing: Output Functions. +* \ in regexp: Syntax of Regexps. +* \ in replacement: Replacing Match. +* \ in strings: String Type. +* \ in symbols: Symbol Type. +* \' in regexp: Syntax of Regexps. +* \(?: in regexp: Syntax of Regexps. +* \< in regexp: Syntax of Regexps. +* \= in regexp: Syntax of Regexps. +* \> in regexp: Syntax of Regexps. +* \` in regexp: Syntax of Regexps. +* \a: Character Type. +* \b: Character Type. +* \B in regexp: Syntax of Regexps. +* \b in regexp: Syntax of Regexps. +* \e: Character Type. +* \f: Character Type. +* \n: Character Type. +* \n in print: Output Variables. +* \N in replacement: Replacing Match. +* \r: Character Type. +* \S in regexp: Syntax of Regexps. +* \s in regexp: Syntax of Regexps. +* \t: Character Type. +* \v: Character Type. +* \W in regexp: Syntax of Regexps. +* \w in regexp: Syntax of Regexps. +* \{n,m\} in regexp: Syntax of Regexps. +* ] in regexp: Syntax of Regexps. +* ^ in regexp: Syntax of Regexps. +* _ in interactive: Using Interactive. +* `: Backquote. +* ` (Edebug): Debugging Backquote. +* ` (list substitution): Backquote. +* abbrev: Abbrevs. +* abbrev table: Abbrevs. +* abbrev tables in modes: Major Mode Conventions. +* abbrev-all-caps: Abbrev Expansion. +* abbrev-expansion: Abbrev Expansion. +* abbrev-file-name: Abbrev Files. +* abbrev-mode: Abbrev Mode. +* abbrev-prefix-mark: Abbrev Expansion. +* abbrev-start-location: Abbrev Expansion. +* abbrev-start-location-buffer: Abbrev Expansion. +* abbrev-symbol: Abbrev Expansion. +* abbrev-table-name-list: Abbrev Tables. +* abbreviate-file-name: Directory Names. +* abbrevs-changed: Abbrev Files. +* abort-recursive-edit: Recursive Editing. +* aborting: Recursive Editing. +* abs: Arithmetic Operations. +* absolute file name: Relative File Names. +* accelerate-menu: Menu Accelerator Functions. +* accept-process-output: Accepting Output. +* accessibility of a file: Testing Accessibility. +* accessible portion (of a buffer): Narrowing. +* accessible-keymaps: Scanning Keymaps. +* acos: Math Functions. +* acosh: Math Functions. +* activate-menubar-hook: Menubar. +* activate-popup-menu-hook: Pop-Up Menus. +* active display table: Active Display Table. +* active keymap: Active Keymaps. +* active-minibuffer-window: Minibuffer Misc. +* add-abbrev: Defining Abbrevs. +* add-hook: Hooks. +* add-menu: Modifying Menus. +* add-menu-button: Modifying Menus. +* add-menu-item: Modifying Menus. +* add-name-to-file: Changing File Attributes. +* add-spec-list-to-specifier: Adding Specifications. +* add-spec-to-specifier: Adding Specifications. +* add-submenu: Modifying Menus. +* add-text-properties: Changing Properties. +* add-timeout: Timers. +* add-to-list: Setting Variables. +* add-tooltalk-message-arg: Elisp Interface for Sending Messages. +* add-tooltalk-pattern-arg: Elisp Interface for Receiving Messages. +* add-tooltalk-pattern-attribute: Elisp Interface for Receiving Messages. +* address field of register: Cons Cell Type. +* after-change-function: Change Hooks. +* after-change-functions: Change Hooks. +* after-find-file: Subroutines of Visiting. +* after-init-hook: Init File. +* after-insert-file-functions: Saving Properties. +* after-load-alist: Hooks for Loading. +* after-revert-hook: Reverting. +* after-save-hook: Saving Buffers. +* aliases, for variables: Variable Aliases. +* alist: Association Lists. +* alist-to-plist: Converting Plists To/From Alists. +* all-annotations: Locating Annotations. +* all-completions: Basic Completion. +* and: Combining Conditions. +* annotation: Annotations. +* annotation hooks: Annotation Hooks. +* annotation-action: Annotation Properties. +* annotation-data: Annotation Properties. +* annotation-down-glyph: Annotation Properties. +* annotation-face: Annotation Properties. +* annotation-glyph: Annotation Properties. +* annotation-layout: Annotation Properties. +* annotation-list: Locating Annotations. +* annotation-menu: Annotation Properties. +* annotation-side: Annotation Properties. +* annotation-visible: Annotation Properties. +* annotation-width: Annotation Properties. +* annotationp: Annotation Primitives. +* annotations-at: Locating Annotations. +* annotations-in-region: Locating Annotations. +* anonymous function: Anonymous Functions. +* anonymous lambda expressions (Edebug): Instrumenting. +* apostrophe for quoting: Quoting. +* append: Building Lists. +* append-to-file: Writing to Files. +* apply: Calling Functions. +* apply, and debugging: Internals of Debugger. +* apropos: Help Functions. +* aref: Array Functions. +* argument binding: Argument List. +* argument descriptors: Using Interactive. +* argument evaluation form: Using Interactive. +* argument prompt: Using Interactive. +* arguments, reading: Minibuffers. +* arith-error example: Handling Errors. +* arith-error in division: Arithmetic Operations. +* arithmetic shift: Bitwise Operations. +* array: Arrays. +* array elements: Array Functions. +* arrayp: Array Functions. +* ASCII character codes: Character Type. +* aset: Array Functions. +* ash: Bitwise Operations. +* asin: Math Functions. +* asinh: Math Functions. +* ask-user-about-lock: File Locks. +* ask-user-about-supersession-threat: Modification Time. +* asking the user questions: Yes-or-No Queries. +* assoc: Association Lists. +* association list: Association Lists. +* assq: Association Lists. +* asynchronous subprocess: Asynchronous Processes. +* atan: Math Functions. +* atanh: Math Functions. +* atom <1>: List-related Predicates. +* atom: Cons Cell Type. +* atomic extent: Atomic Extents. +* atoms: List-related Predicates. +* attributes of text: Text Properties. +* Auto Fill mode: Auto Filling. +* auto-fill-function: Auto Filling. +* auto-lower-frame: Raising and Lowering. +* auto-mode-alist: Auto Major Mode. +* auto-raise-frame: Raising and Lowering. +* auto-save-default: Auto-Saving. +* auto-save-file-format: Format Conversion. +* auto-save-file-name-p: Auto-Saving. +* auto-save-hook: Auto-Saving. +* auto-save-interval: Auto-Saving. +* auto-save-list-file-name: Auto-Saving. +* auto-save-mode: Auto-Saving. +* auto-save-timeout: Auto-Saving. +* auto-save-visited-file-name: Auto-Saving. +* auto-saving: Auto-Saving. +* autoload <1>: Domain Specification. +* autoload: Autoload. +* autoload errors: Autoload. +* automatically buffer-local: Intro to Buffer-Local. +* available fonts: Font Instance Names. +* back-to-indentation: Motion by Indent. +* background pixmap: Merging Faces. +* backquote (Edebug): Debugging Backquote. +* backquote (list substitution): Backquote. +* backslash in character constant: Character Type. +* backslash in strings: String Type. +* backslash in symbols: Symbol Type. +* backspace: Character Type. +* backtrace: Internals of Debugger. +* backtrace-debug: Internals of Debugger. +* backtrace-frame: Internals of Debugger. +* backtracking: Backtracking. +* backup file: Backup Files. +* backup files, how to make them: Rename or Copy. +* backup-buffer: Making Backups. +* backup-by-copying: Rename or Copy. +* backup-by-copying-when-linked: Rename or Copy. +* backup-by-copying-when-mismatch: Rename or Copy. +* backup-enable-predicate: Making Backups. +* backup-file-name-p: Backup Names. +* backup-inhibited: Making Backups. +* backward-char: Character Motion. +* backward-delete-char-untabify: Deletion. +* backward-list: List Motion. +* backward-prefix-chars: Motion and Syntax. +* backward-sexp: List Motion. +* backward-to-indentation: Motion by Indent. +* backward-word: Word Motion. +* balancing parentheses: Blinking. +* barf-if-buffer-read-only: Read Only Buffers. +* base buffer: Indirect Buffers. +* base64: Transformations. +* base64-decode-region: Transformations. +* base64-decode-string: Transformations. +* base64-encode-region: Transformations. +* base64-encode-string: Transformations. +* batch mode: Batch Mode. +* batch-byte-compile: Compilation Functions. +* batch-byte-recompile-directory: Compilation Functions. +* beep: Beeping. +* beeping: Beeping. +* before point, insertion: Insertion. +* before-change-function: Change Hooks. +* before-change-functions: Change Hooks. +* before-init-hook: Init File. +* before-revert-hook: Reverting. +* beginning of line: Text Lines. +* beginning of line in regexp: Syntax of Regexps. +* beginning-of-buffer: Buffer End Motion. +* beginning-of-defun: List Motion. +* beginning-of-line: Text Lines. +* bell: Beeping. +* bell character: Character Type. +* bell-volume: Beeping. +* binary files and text files: Files and MS-DOS. +* binary-process-input: MS-DOS Subprocesses. +* binary-process-output: MS-DOS Subprocesses. +* bind-text-domain: Level 3 Primitives. +* binding arguments: Argument List. +* binding local variables: Local Variables. +* binding of a key: Keymap Terminology. +* bit vector: Bit Vectors. +* bit vector length: Sequence Functions. +* bit-vector: Bit Vector Functions. +* bit-vector-p: Bit Vector Functions. +* bitp: Bit Vector Functions. +* bitwise and: Bitwise Operations. +* bitwise exclusive or: Bitwise Operations. +* bitwise not: Bitwise Operations. +* bitwise or: Bitwise Operations. +* blink-matching-open: Blinking. +* blink-matching-paren: Blinking. +* blink-matching-paren-delay: Blinking. +* blink-matching-paren-distance: Blinking. +* blink-paren-function: Blinking. +* blink-paren-hook: Blinking. +* blinking: Blinking. +* bobp: Near Point. +* body of function: Lambda Components. +* bold: Font Instance Characteristics. +* bolp: Near Point. +* bookmark-map: Standard Keymaps. +* boolean: nil and t. +* boolean-specifier-p: Specifier Types. +* bootstrapping XEmacs from temacs: Building XEmacs. +* bottom-gutter: Specifying a Gutter. +* bottom-gutter-height: Other Gutter Variables. +* bottom-gutter-visible-p: Other Gutter Variables. +* bottom-toolbar: Specifying the Toolbar. +* bottom-toolbar-height: Other Toolbar Variables. +* bottom-toolbar-visible-p: Other Toolbar Variables. +* boundp: Void Variables. +* box diagrams, for lists: Cons Cell Type. +* box representation for lists: Lists as Boxes. +* break: Debugger. +* breakpoints: Breakpoints. +* bucket (in obarray): Creating Symbols. +* buffer: Buffers. +* buffer contents: Text. +* buffer file name: Buffer File Name. +* buffer input stream: Input Streams. +* buffer list: The Buffer List. +* buffer modification: Buffer Modification. +* buffer names: Buffer Names. +* buffer output stream: Output Streams. +* buffer text notation: Buffer Text Notation. +* buffer, read-only: Read Only Buffers. +* buffer-auto-save-file-name: Auto-Saving. +* buffer-backed-up: Making Backups. +* buffer-base-buffer: Indirect Buffers. +* buffer-disable-undo: Maintaining Undo. +* buffer-enable-undo: Maintaining Undo. +* buffer-end: Point. +* buffer-file-format: Format Conversion. +* buffer-file-name: Buffer File Name. +* buffer-file-number: Buffer File Name. +* buffer-file-truename: Buffer File Name. +* buffer-file-type: Files and MS-DOS. +* buffer-flush-undo: Maintaining Undo. +* buffer-glyph-p: Glyph Types. +* buffer-indirect-children: Indirect Buffers. +* buffer-invisibility-spec: Invisible Text. +* buffer-list: The Buffer List. +* buffer-live-p: Killing Buffers. +* buffer-local variables: Buffer-Local Variables. +* buffer-local variables in modes: Major Mode Conventions. +* buffer-local-variables: Creating Buffer-Local. +* Buffer-menu-mode-map: Standard Keymaps. +* buffer-modified-p: Buffer Modification. +* buffer-modified-tick: Buffer Modification. +* buffer-name: Buffer Names. +* buffer-offer-save <1>: Killing Buffers. +* buffer-offer-save: Saving Buffers. +* buffer-read-only: Read Only Buffers. +* buffer-saved-size <1>: Point. +* buffer-saved-size: Auto-Saving. +* buffer-size: Point. +* buffer-string: Buffer Contents. +* buffer-substring: Buffer Contents. +* buffer-undo-list: Undo. +* bufferp: Buffer Basics. +* buffers menu: Buffers Menu. +* buffers, controlled in windows: Buffers and Windows. +* buffers, creating: Creating Buffers. +* buffers, killing: Killing Buffers. +* buffers-menu-filter: Menu Filters. +* buffers-menu-max-size: Buffers Menu. +* buffers-menu-switch-to-buffer-function: Buffers Menu. +* building lists: Building Lists. +* building XEmacs: Building XEmacs. +* built-in function: What Is a Function. +* bury-buffer: The Buffer List. +* busy-pointer-glyph: Mouse Pointer. +* button-event-p: Event Predicates. +* button-press-event-p: Event Predicates. +* button-release-event-p: Event Predicates. +* bvconcat: Bit Vector Functions. +* byte-code <1>: Compilation Functions. +* byte-code: Byte Compilation. +* byte-code function: Compiled-Function Objects. +* byte-code interpreter: Compilation Functions. +* byte-compile: Compilation Functions. +* byte-compile-dynamic: Dynamic Loading. +* byte-compile-dynamic-docstrings: Docs and Compilation. +* byte-compile-file: Compilation Functions. +* byte-compiling macros: Compiling Macros. +* byte-compiling require: Named Features. +* byte-recompile-directory: Compilation Functions. +* byte-recompile-directory-ignore-errors-p: Compilation Functions. +* bytes: Strings and Characters. +* c++-mode-map: Standard Keymaps. +* C-c: Prefix Keys. +* C-g: Quitting. +* C-h: Prefix Keys. +* C-M-x: Instrumenting. +* c-mode-abbrev-table: Standard Abbrev Tables. +* c-mode-map: Standard Keymaps. +* c-mode-syntax-table: Standard Syntax Tables. +* C-q: Flow Control. +* C-s: Flow Control. +* C-x: Prefix Keys. +* C-x 4: Prefix Keys. +* C-x 5: Prefix Keys. +* C-x a: Prefix Keys. +* C-x n: Prefix Keys. +* C-x r: Prefix Keys. +* caaaar: List Elements. +* caaadr: List Elements. +* caaar: List Elements. +* caadar: List Elements. +* caaddr: List Elements. +* caadr: List Elements. +* caar: List Elements. +* cadaar: List Elements. +* cadadr: List Elements. +* cadar: List Elements. +* caddar: List Elements. +* cadddr: List Elements. +* caddr: List Elements. +* cadr: List Elements. +* call stack: Internals of Debugger. +* call-interactively: Interactive Call. +* call-process: Synchronous Processes. +* call-process-region: Synchronous Processes. +* calling a function: Calling Functions. +* cancel-debug-on-entry: Function Debugging. +* canonicalize-inst-list: Adding Specifications. +* canonicalize-inst-pair: Adding Specifications. +* canonicalize-lax-plist: Working With Lax Plists. +* canonicalize-plist: Working With Normal Plists. +* canonicalize-spec: Adding Specifications. +* canonicalize-spec-list: Adding Specifications. +* canonicalize-tag-set: Specifier Tag Functions. +* capitalization: Character Case. +* capitalize: Character Case. +* capitalize-region: Case Changes. +* capitalize-word: Case Changes. +* car: List Elements. +* car-safe: List Elements. +* case changes: Case Changes. +* case in replacements: Replacing Match. +* case-fold-search: Searching and Case. +* case-replace: Searching and Case. +* case-table-p: Case Tables. +* catch: Catch and Throw. +* category-designator-p: Category Tables. +* category-table: Category Tables. +* category-table-p: Category Tables. +* category-table-value-p: Category Tables. +* CBREAK: Flow Control. +* ccl-elapsed-time: Calling CCL. +* ccl-execute: Calling CCL. +* ccl-execute-on-string: Calling CCL. +* ccl-reset-elapsed-time: Calling CCL. +* cdaaar: List Elements. +* cdaadr: List Elements. +* cdaar: List Elements. +* cdadar: List Elements. +* cdaddr: List Elements. +* cdadr: List Elements. +* cdar: List Elements. +* cddaar: List Elements. +* cddadr: List Elements. +* cddar: List Elements. +* cdddar: List Elements. +* cddddr: List Elements. +* cdddr: List Elements. +* cddr: List Elements. +* CDE dt: CDE dt. +* cdr: List Elements. +* cdr-safe: List Elements. +* ceiling: Numeric Conversions. +* centering point: Vertical Scrolling. +* cerror: Signaling Errors. +* change hooks: Change Hooks. +* change-major-mode-hook: Major Mode Conventions. +* changing key bindings: Changing Key Bindings. +* changing to another buffer: Current Buffer. +* changing window size: Resizing Windows. +* char table type: Char Table Type. +* char-after: Near Point. +* char-before: Near Point. +* char-charset: MULE Characters. +* char-equal: Text Comparison. +* char-int: Character Codes. +* char-int confoundance disease: Character Type. +* char-int-p: Character Codes. +* char-octet: MULE Characters. +* char-or-char-int-p: Character Codes. +* char-or-string-p: Predicates for Strings. +* char-syntax: Syntax Table Functions. +* char-table-p: Char Tables. +* char-table-type: Char Table Types. +* char-table-type-list: Char Table Types. +* char-to-string: String Conversion. +* char=: Text Comparison. +* character arrays: Strings and Characters. +* character case: Character Case. +* character descriptor: Character Descriptors. +* character insertion: Commands for Insertion. +* character printing: Describing Characters. +* character set (in regexp): Syntax of Regexps. +* character to string: String Conversion. +* character-to-event: Converting Events. +* characteristics of font instances: Font Instance Characteristics. +* characterp: Predicates for Characters. +* characters: Strings and Characters. +* characters for interactive codes: Interactive Codes. +* character quote: Syntax Class Table. +* charset type: Charset Type. +* charset-ccl-program: Charset Property Functions. +* charset-chars: Charset Property Functions. +* charset-description: Charset Property Functions. +* charset-dimension: Charset Property Functions. +* charset-direction: Charset Property Functions. +* charset-from-attributes: Basic Charset Functions. +* charset-iso-final-char: Charset Property Functions. +* charset-iso-graphic-plane: Charset Property Functions. +* charset-list: Basic Charset Functions. +* charset-name: Charset Property Functions. +* charset-property: Charset Property Functions. +* charset-registry: Charset Property Functions. +* charset-reverse-direction-charset: Basic Charset Functions. +* charset-width: Charset Property Functions. +* charsetp: Charsets. +* check-argument-type: Signaling Errors. +* check-gutter-button-syntax: Gutter Descriptor Format. +* check-toolbar-button-syntax: Toolbar Descriptor Format. +* check-valid-char-table-value: Working With Char Tables. +* check-valid-inst-list: Specifier Validation Functions. +* check-valid-instantiator: Specifier Validation Functions. +* check-valid-plist: Property Lists. +* check-valid-spec-list: Specifier Validation Functions. +* child process: Processes. +* children, of extent: Extent Parents. +* CL note--allocate more storage: Garbage Collection. +* CL note--case of letters: Symbol Type. +* CL note--default optional arg: Argument List. +* CL note--integers vrs eq: Comparison of Numbers. +* CL note--lack union, set: Sets And Lists. +* CL note--only throw in Emacs: Catch and Throw. +* CL note--rplaca vrs setcar: Modifying Lists. +* CL note--set local: Setting Variables. +* CL note--special forms compared: Special Forms. +* CL note--special variables: Variable Scoping. +* CL note--symbol in obarrays: Creating Symbols. +* cl-read: Reading in Edebug. +* cl-specs.el: Instrumenting. +* cl.el (Edebug): Instrumenting. +* cleanup forms: Cleanups. +* clear-abbrev-table: Abbrev Tables. +* clear-message: The Echo Area. +* clear-range-table: Working With Range Tables. +* clear-visited-file-modtime: Modification Time. +* close parenthesis: Blinking. +* close-database: Connecting to a Database. +* close parenthesis character: Syntax Class Table. +* closures not available: Extent. +* clrhash: Working With Hash Tables. +* codes, interactive, description of: Interactive Codes. +* coding standards: Tips. +* coding system type: Coding System Type. +* coding-category-list: Detection of Textual Encoding. +* coding-category-system: Detection of Textual Encoding. +* coding-priority-list: Detection of Textual Encoding. +* coding-system-base: Basic Coding System Functions. +* coding-system-doc-string: Coding System Property Functions. +* coding-system-list: Basic Coding System Functions. +* coding-system-name: Basic Coding System Functions. +* coding-system-p: Coding Systems. +* coding-system-property: Coding System Property Functions. +* coding-system-type: Coding System Property Functions. +* color instance type: Color Instance Type. +* color instances: Color Instances. +* color-instance-name: Color Instance Properties. +* color-instance-p: Color Instances. +* color-instance-rgb-components: Color Instance Properties. +* color-name: Color Convenience Functions. +* color-pixmap-image-instance-p: Image Instance Types. +* color-rgb-components: Color Convenience Functions. +* color-specifier-p <1>: Color Specifiers. +* color-specifier-p: Specifier Types. +* colorize-image-instance: Image Instance Functions. +* colors: Colors. +* columns: Columns. +* Command: Visibility of Frames. +* command: What Is a Function. +* command descriptions: A Sample Function Description. +* command history: Command History. +* command in keymap: Key Lookup. +* command line arguments: Command Line Arguments. +* command line options: Command Line Arguments. +* command loop: Command Loop. +* command loop, recursive: Recursive Editing. +* command-debug-status: Internals of Debugger. +* command-execute: Interactive Call. +* command-history: Command History. +* command-history-map: Standard Keymaps. +* command-line: Command Line Arguments. +* command-line-args: Command Line Arguments. +* command-line-functions: Command Line Arguments. +* command-line-processed: Command Line Arguments. +* command-switch-alist: Command Line Arguments. +* commandp: Interactive Call. +* commandp example: High-Level Completion. +* commands, defining: Defining Commands. +* comment syntax: Syntax Class Table. +* comments: Comments. +* comment ender: Syntax Class Table. +* comment starter: Syntax Class Table. +* Common Lisp: Lisp History. +* Common Lisp (Edebug): Instrumenting. +* compare-buffer-substrings: Comparing Text. +* comparing buffer text: Comparing Text. +* comparison of modification time: Modification Time. +* compilation: Byte Compilation. +* compilation functions: Compilation Functions. +* compile-defun: Compilation Functions. +* compiled function: Compiled-Function Objects. +* compiled-function-arglist: Compiled-Function Objects. +* compiled-function-constants: Compiled-Function Objects. +* compiled-function-doc-string: Compiled-Function Objects. +* compiled-function-domain: Compiled-Function Objects. +* compiled-function-instructions: Compiled-Function Objects. +* compiled-function-interactive: Compiled-Function Objects. +* compiled-function-p: What Is a Function. +* compiled-function-stack-depth: Compiled-Function Objects. +* complete key: Keymap Terminology. +* completing-read: Minibuffer Completion. +* completion: Completion. +* completion, file name: File Name Completion. +* completion, user name: User Name Completion. +* completion-auto-help: Completion Commands. +* completion-ignore-case: Basic Completion. +* completion-ignored-extensions: File Name Completion. +* complex arguments: Minibuffers. +* complex command: Command History. +* complex-buffers-menu-p: Buffers Menu. +* compose-region: Composite Characters. +* composite-char-string: Composite Characters. +* concat: Creating Strings. +* concatenating lists: Rearrangement. +* concatenating strings: Creating Strings. +* cond: Conditionals. +* condition name: Error Symbols. +* condition-case: Handling Errors. +* conditional evaluation: Conditionals. +* cons: Building Lists. +* cons cell as box: Lists as Boxes. +* cons cells: Building Lists. +* consing: Building Lists. +* console-device-list: Basic Console Functions. +* console-disable-input: Console and Device I/O. +* console-enable-input: Console and Device I/O. +* console-list: Basic Console Functions. +* console-live-p: Connecting to a Console or Device. +* console-type-image-conversion-list: Image Instantiator Conversion. +* consolep: Consoles and Devices. +* consoles: Consoles and Devices. +* consp: List-related Predicates. +* continuation lines: Truncation. +* continuation-glyph: Redisplay Glyphs. +* continue-process: Signals to Processes. +* control character printing: Describing Characters. +* control characters: Character Type. +* control characters in display: Usual Display. +* control characters, reading: Quoted Character Input. +* control structures: Control Structures. +* control-arrow-glyph: Redisplay Glyphs. +* Control-X-prefix: Prefix Keys. +* conventions for writing minor modes: Minor Mode Conventions. +* conversion of image instantiators: Image Instantiator Conversion. +* conversion of strings: String Conversion. +* copy-alist: Association Lists. +* copy-category-table: Category Tables. +* copy-coding-system: Basic Coding System Functions. +* copy-event: Working With Events. +* copy-extent: Detached Extents. +* copy-face: Basic Face Functions. +* copy-file: Changing File Attributes. +* copy-hash-table: Introduction to Hash Tables. +* copy-keymap: Creating Keymaps. +* copy-marker: Creating Markers. +* copy-range-table: Introduction to Range Tables. +* copy-region-as-kill: Kill Functions. +* copy-sequence: Sequence Functions. +* copy-specifier: Other Specification Functions. +* copy-syntax-table: Syntax Table Functions. +* copying alists: Association Lists. +* copying bit vectors: Bit Vector Functions. +* copying files: Changing File Attributes. +* copying lists: Building Lists. +* copying sequences: Sequence Functions. +* copying strings: Creating Strings. +* copying vectors: Vector Functions. +* cos: Math Functions. +* cosh: Math Functions. +* count-lines: Text Lines. +* count-loop: A Sample Function Description. +* counting columns: Columns. +* coverage testing: Coverage Testing. +* create-device-hook: Connecting to a Console or Device. +* create-file-buffer: Subroutines of Visiting. +* create-frame-hook: Frame Hooks. +* create-tooltalk-message: Elisp Interface for Sending Messages. +* create-tooltalk-pattern: Elisp Interface for Receiving Messages. +* creating buffers: Creating Buffers. +* creating keymaps: Creating Keymaps. +* ctl-arrow: Usual Display. +* ctl-x-4-map <1>: Standard Keymaps. +* ctl-x-4-map: Prefix Keys. +* ctl-x-5-map <1>: Standard Keymaps. +* ctl-x-5-map: Prefix Keys. +* ctl-x-map <1>: Standard Keymaps. +* ctl-x-map: Prefix Keys. +* cube-root: Math Functions. +* current binding: Local Variables. +* current buffer: Current Buffer. +* current buffer excursion: Excursions. +* current buffer mark: The Mark. +* current buffer point and mark (Edebug): Edebug Display Update. +* current buffer position: Point. +* current command: Command Loop Info. +* current stack frame: Using Debugger. +* current-buffer: Current Buffer. +* current-case-table: Case Tables. +* current-column: Columns. +* current-display-table: Active Display Table. +* current-fill-column: Margins. +* current-frame-configuration: Frame Configurations. +* current-global-map: Active Keymaps. +* current-indentation: Primitive Indent. +* current-input-mode: Input Modes. +* current-justification: Filling. +* current-keymaps: Active Keymaps. +* current-kill: Low-Level Kill Ring. +* current-left-margin: Margins. +* current-local-map: Active Keymaps. +* current-menubar: Menubar. +* current-message: The Echo Area. +* current-minor-mode-maps: Active Keymaps. +* current-mouse-event: Command Loop Info. +* current-prefix-arg: Prefix Command Arguments. +* current-time: Time of Day. +* current-time-string: Time of Day. +* current-time-zone: Time of Day. +* current-window-configuration: Window Configurations. +* cursor (mouse): Mouse Pointer. +* cursor-in-echo-area: The Echo Area. +* cust-print: Printing in Edebug. +* cut buffer: X Selections. +* cyclic ordering of windows: Cyclic Window Ordering. +* data type: Lisp Data Types. +* data-directory: Accessing Documentation. +* database: Databases. +* database type: Database Type. +* database-file-name: Other Database Functions. +* database-last-error: Other Database Functions. +* database-live-p: Connecting to a Database. +* database-subtype: Other Database Functions. +* database-type: Other Database Functions. +* databasep: Databases. +* deallocate-event: Working With Events. +* debug: Invoking the Debugger. +* debug-allocation: Garbage Collection. +* debug-allocation-backtrace: Garbage Collection. +* debug-ignored-errors: Error Debugging. +* debug-on-entry: Function Debugging. +* debug-on-error: Error Debugging. +* debug-on-error use: Processing of Errors. +* debug-on-next-call: Internals of Debugger. +* debug-on-quit: Infinite Loops. +* debug-on-signal: Error Debugging. +* debug-on-signal use: Handling Errors. +* debugger <1>: Internals of Debugger. +* debugger: Debugger. +* debugger command list: Debugger Commands. +* debugger-mode-map: Standard Keymaps. +* debugging errors: Error Debugging. +* debugging specific functions: Function Debugging. +* decode-big5-char: Big5 and Shift-JIS Functions. +* decode-coding-region: Encoding and Decoding Text. +* decode-shift-jis-char: Big5 and Shift-JIS Functions. +* decode-time: Time Conversion. +* decoding file formats: Format Conversion. +* decompose-region: Composite Characters. +* decrement field of register: Cons Cell Type. +* dedicated window: Choosing Window. +* deep binding: Impl of Scope. +* def-edebug-spec: Instrumenting Macro Calls. +* defalias: Defining Functions. +* default argument string: Interactive Codes. +* default init file: Init File. +* default value: Default Value. +* default-abbrev-mode: Abbrev Mode. +* default-boundp: Default Value. +* default-buffer-file-type: Files and MS-DOS. +* default-case-fold-search: Searching and Case. +* default-ctl-arrow: Usual Display. +* default-deselect-frame-hook: Raising and Lowering. +* default-directory: File Name Expansion. +* default-file-modes: Changing File Attributes. +* default-fill-column: Margins. +* default-frame-name: Frame Name. +* default-frame-plist: Initial Properties. +* default-gutter: Specifying a Gutter. +* default-gutter-height: Other Gutter Variables. +* default-gutter-position: Specifying a Gutter. +* default-gutter-visible-p: Other Gutter Variables. +* default-gutter-width: Other Gutter Variables. +* default-justification: Filling. +* default-major-mode: Auto Major Mode. +* default-menubar: Menubar. +* default-minibuffer-frame: Minibuffers and Frames. +* default-modeline-format: Modeline Variables. +* default-popup-menu: Pop-Up Menus. +* default-select-frame-hook: Raising and Lowering. +* default-text-properties: Examining Properties. +* default-toolbar: Specifying the Toolbar. +* default-toolbar-height: Other Toolbar Variables. +* default-toolbar-position: Specifying the Toolbar. +* default-toolbar-visible-p: Other Toolbar Variables. +* default-toolbar-width: Other Toolbar Variables. +* default-truncate-lines: Truncation. +* default-value: Default Value. +* default-x-device: Resources. +* default.el: Start-up Summary. +* defconst <1>: Domain Specification. +* defconst: Defining Variables. +* defcustom: Variable Definitions. +* defgroup: Group Definitions. +* define-abbrev: Defining Abbrevs. +* define-abbrev-table: Abbrev Tables. +* define-derived-mode: Derived Modes. +* define-error: Error Symbols. +* define-function: Defining Functions. +* define-key: Changing Key Bindings. +* define-obsolete-function-alias: Obsoleteness. +* define-obsolete-variable-alias: Obsoleteness. +* define-prefix-command: Prefix Keys. +* define-specifier-tag: Specifier Tag Functions. +* defining a function: Defining Functions. +* defining commands: Defining Commands. +* defining-kbd-macro: Keyboard Macros. +* definition of a symbol: Definitions. +* defmacro: Defining Macros. +* defsubst: Inline Functions. +* defun: Defining Functions. +* defun-prompt-regexp: List Motion. +* defvar <1>: Domain Specification. +* defvar: Defining Variables. +* defvaralias: Variable Aliases. +* delete: Sets And Lists. +* delete previous char: Deletion. +* delete-annotation: Annotation Primitives. +* delete-auto-save-file-if-necessary: Auto-Saving. +* delete-auto-save-files: Auto-Saving. +* delete-backward-char: Deletion. +* delete-blank-lines: User-Level Deletion. +* delete-char: Deletion. +* delete-device: Connecting to a Console or Device. +* delete-device-hook: Connecting to a Console or Device. +* delete-directory: Create/Delete Dirs. +* delete-exited-processes: Deleting Processes. +* delete-extent: Creating and Modifying Extents. +* delete-file: Changing File Attributes. +* delete-frame: Deleting Frames. +* delete-frame-hook: Frame Hooks. +* delete-horizontal-space: User-Level Deletion. +* delete-indentation: User-Level Deletion. +* delete-menu-item: Modifying Menus. +* delete-old-versions: Numbered Backups. +* delete-other-windows: Deleting Windows. +* delete-process: Deleting Processes. +* delete-region: Deletion. +* delete-to-left-margin: Margins. +* delete-window: Deleting Windows. +* delete-windows-on: Deleting Windows. +* deleting files: Changing File Attributes. +* deleting processes: Deleting Processes. +* deleting whitespace: User-Level Deletion. +* deleting windows: Deleting Windows. +* deletion of elements: Sets And Lists. +* deletion of frames: Deleting Frames. +* deletion vs killing: Deletion. +* delq: Sets And Lists. +* demibold: Font Instance Characteristics. +* describe-bindings: Scanning Keymaps. +* describe-bindings-internal: Scanning Keymaps. +* describe-buffer-case-table: Case Tables. +* describe-mode: Mode Help. +* describe-prefix-bindings: Help Functions. +* describe-tooltalk-message: Elisp Interface for Receiving Messages. +* description for interactive codes: Interactive Codes. +* description format: Format of Descriptions. +* deselect-frame-hook: Frame Hooks. +* destroy-tooltalk-message: Elisp Interface for Sending Messages. +* destroy-tooltalk-pattern: Elisp Interface for Receiving Messages. +* destructive-alist-to-plist: Converting Plists To/From Alists. +* destructive-plist-to-alist: Converting Plists To/From Alists. +* detach-extent: Detached Extents. +* detached extent: Detached Extents. +* detect-coding-region: Detection of Textual Encoding. +* device-baud-rate <1>: Terminal Output. +* device-baud-rate: Console and Device I/O. +* device-class: Console Types and Device Classes. +* device-frame-list <1>: Basic Device Functions. +* device-frame-list: Finding All Frames. +* device-list: Basic Device Functions. +* device-live-p: Connecting to a Console or Device. +* device-matches-specifier-tag-set-p: Specifier Tag Functions. +* device-matching-specifier-tag-list: Specifier Tag Functions. +* device-or-frame-p: Basic Device Functions. +* device-or-frame-type: Console Types and Device Classes. +* device-type: Console Types and Device Classes. +* device-x-display: Connecting to a Console or Device. +* devicep: Consoles and Devices. +* devices: Consoles and Devices. +* dgettext: Level 3 Primitives. +* diagrams, boxed, for lists: Cons Cell Type. +* dialog box: Dialog Boxes. +* digit-argument: Prefix Command Arguments. +* ding: Beeping. +* directory name: Directory Names. +* directory name abbreviation: Directory Names. +* directory part (of file name): File Name Components. +* directory-abbrev-alist: Directory Names. +* directory-file-name: Directory Names. +* directory-files: Contents of Directories. +* directory-oriented functions: Contents of Directories. +* dired-kept-versions: Numbered Backups. +* dired-mode-map: Standard Keymaps. +* disable undo: Maintaining Undo. +* disable-command: Disabling Commands. +* disable-menu-item: Modifying Menus. +* disable-timeout: Timers. +* disabled: Disabling Commands. +* disabled command: Disabling Commands. +* disabled-command-hook: Disabling Commands. +* disassemble: Disassembly. +* disassembled byte-code: Disassembly. +* discard input: Peeking and Discarding. +* discard-input: Peeking and Discarding. +* dispatch-event: Dispatching an Event. +* dispatching an event: Dispatching an Event. +* display columns: Size and Position. +* display lines: Size and Position. +* display order: Extent Endpoints. +* display table: Display Tables. +* display update: Refresh Screen. +* display-buffer: Choosing Window. +* display-buffer-function: Choosing Window. +* display-completion-list: Completion Commands. +* display-error: Processing of Errors. +* display-message: The Echo Area. +* display-warning: Warnings. +* display-warning-minimum-level: Warnings. +* display-warning-suppressed-classes: Warnings. +* displaying a buffer: Displaying Buffers. +* do-auto-save: Auto-Saving. +* DOC (documentation) file: Documentation Basics. +* doc-directory: Accessing Documentation. +* documentation: Accessing Documentation. +* documentation conventions: Documentation Basics. +* documentation for major mode: Mode Help. +* documentation notation: Evaluation Notation. +* documentation of function: Function Documentation. +* documentation strings: Documentation. +* documentation, keys in: Keys in Documentation. +* documentation-property: Accessing Documentation. +* domain: Level 3 Primitives. +* domain (in a specifier): Specifiers In-Depth. +* domain-of: Level 3 Primitives. +* dotted lists (Edebug): Specification List. +* dotted pair notation: Dotted Pair Notation. +* double-quote in strings: String Type. +* down-list: List Motion. +* downcase: Character Case. +* downcase-region: Case Changes. +* downcase-word: Case Changes. +* downcasing in lookup-key: Key Sequence Input. +* drag: Drag Interface. +* drag and drop: Drag and Drop. +* Drag API: Drag Interface. +* dribble file: Recording Input. +* drop: Drop Interface. +* Drop API: Drop Interface. +* dump-emacs: Building XEmacs. +* duplicable extent: Duplicable Extents. +* dynamic loading of documentation: Docs and Compilation. +* dynamic loading of functions: Dynamic Loading. +* dynamic scoping: Variable Scoping. +* echo area: The Echo Area. +* echo-keystrokes <1>: The Echo Area. +* echo-keystrokes: Command Loop Info. +* edebug: Embedded Breakpoints. +* Edebug: Edebug. +* Edebug execution modes: Edebug Execution Modes. +* Edebug mode: Edebug. +* Edebug specification list: Specification List. +* edebug-`: Debugging Backquote. +* edebug-all-defs <1>: Edebug Options. +* edebug-all-defs: Instrumenting. +* edebug-all-forms <1>: Edebug Options. +* edebug-all-forms: Instrumenting. +* edebug-continue-kbd-macro: Edebug Options. +* edebug-display-freq-count: Coverage Testing. +* edebug-eval-top-level-form: Instrumenting. +* edebug-global-break-condition <1>: Edebug Options. +* edebug-global-break-condition: Global Break Condition. +* edebug-initial-mode: Edebug Options. +* edebug-on-error <1>: Edebug Options. +* edebug-on-error: Trapping Errors. +* edebug-on-quit <1>: Edebug Options. +* edebug-on-quit: Trapping Errors. +* edebug-print-circle <1>: Edebug Options. +* edebug-print-circle: Printing in Edebug. +* edebug-print-length <1>: Edebug Options. +* edebug-print-length: Printing in Edebug. +* edebug-print-level <1>: Edebug Options. +* edebug-print-level: Printing in Edebug. +* edebug-print-trace-after <1>: Edebug Options. +* edebug-print-trace-after: Tracing. +* edebug-print-trace-before <1>: Edebug Options. +* edebug-print-trace-before: Tracing. +* edebug-save-displayed-buffer-points <1>: Edebug Options. +* edebug-save-displayed-buffer-points: Edebug Display Update. +* edebug-save-windows <1>: Edebug Options. +* edebug-save-windows: Edebug Display Update. +* edebug-set-global-break-condition: Global Break Condition. +* edebug-setup-hook: Edebug Options. +* edebug-test-coverage: Edebug Options. +* edebug-trace <1>: Edebug Options. +* edebug-trace: Tracing. +* edebug-tracing: Tracing. +* edebug-unwrap: Specification List. +* edebug-unwrap-results <1>: Edebug Options. +* edebug-unwrap-results: Debugging Backquote. +* edit-abbrevs-map: Standard Keymaps. +* edit-and-eval-command: Object from Minibuffer. +* edit-menu-filter: Menu Filters. +* edit-tab-stops-map: Standard Keymaps. +* editing types: Editing Types. +* editor command loop: Command Loop. +* eighth: List Elements. +* electric-buffer-menu-mode-map: Standard Keymaps. +* electric-future-map: A Sample Variable Description. +* electric-history-map: Standard Keymaps. +* element (of list): Lists. +* elements of sequences: Sequence Functions. +* elt: Sequence Functions. +* emacs-build-time: Building XEmacs. +* emacs-lisp-mode-map: Standard Keymaps. +* emacs-lisp-mode-syntax-table: Standard Syntax Tables. +* emacs-major-version: Building XEmacs. +* emacs-minor-version: Building XEmacs. +* emacs-pid: System Environment. +* emacs-version: Building XEmacs. +* EMACSLOADPATH environment variable: How Programs Do Loading. +* embedded breakpoints: Embedded Breakpoints. +* empty list: Cons Cell Type. +* enable-command: Disabling Commands. +* enable-flow-control: Flow Control. +* enable-flow-control-on: Flow Control. +* enable-local-eval: Auto Major Mode. +* enable-local-variables: Auto Major Mode. +* enable-menu-item: Modifying Menus. +* enable-recursive-minibuffers: Minibuffer Misc. +* encode-big5-char: Big5 and Shift-JIS Functions. +* encode-coding-region: Encoding and Decoding Text. +* encode-shift-jis-char: Big5 and Shift-JIS Functions. +* encode-time: Time Conversion. +* encoding file formats: Format Conversion. +* end of buffer marker: Creating Markers. +* end-of-buffer: Buffer End Motion. +* end-of-defun: List Motion. +* end-of-file: Input Functions. +* end-of-line: Text Lines. +* enlarge-window: Resizing Windows. +* enlarge-window-horizontally: Resizing Windows. +* enlarge-window-pixels: Resizing Windows. +* enqueue-eval-event: Reading One Event. +* environment: Intro Eval. +* environment variable access: System Environment. +* environment variables, subprocesses: Subprocess Creation. +* eobp: Near Point. +* eolp: Near Point. +* eq: Equality Predicates. +* equal: Equality Predicates. +* equality: Equality Predicates. +* erase-buffer: Deletion. +* error: Signaling Errors. +* error cleanup: Cleanups. +* error debugging: Error Debugging. +* error display: The Echo Area. +* error handler: Handling Errors. +* error in debug: Invoking the Debugger. +* error message notation: Error Messages. +* error name: Error Symbols. +* error symbol: Error Symbols. +* error-conditions: Error Symbols. +* error-message-string: Processing of Errors. +* errors: Errors. +* esc-map: Prefix Keys. +* ESC-prefix: Prefix Keys. +* escape <1>: Syntax Class Table. +* escape: Character Type. +* escape characters: Output Variables. +* escape characters in printing: Output Functions. +* escape sequence: Character Type. +* eval: Eval. +* eval, and debugging: Internals of Debugger. +* eval-and-compile: Eval During Compile. +* eval-buffer: Eval. +* eval-current-buffer (Edebug): Instrumenting. +* eval-defun (Edebug): Instrumenting. +* eval-event-p: Event Predicates. +* eval-expression (Edebug): Instrumenting. +* eval-minibuffer: Object from Minibuffer. +* eval-region: Eval. +* eval-region (Edebug): Instrumenting. +* eval-when-compile: Eval During Compile. +* evaluated expression argument: Interactive Codes. +* evaluation: Evaluation. +* evaluation error: Local Variables. +* evaluation list (Edebug): Eval List. +* evaluation notation: Evaluation Notation. +* evaluation of buffer contents: Eval. +* event printing: Describing Characters. +* event-buffer: Window-Level Event Position Info. +* event-button: Accessing Other Event Info. +* event-closest-point: Event Text Position Info. +* event-device: Accessing Other Event Info. +* event-frame: Frame-Level Event Position Info. +* event-function: Accessing Other Event Info. +* event-glyph-extent: Event Glyph Position Info. +* event-glyph-x-pixel: Event Glyph Position Info. +* event-glyph-y-pixel: Event Glyph Position Info. +* event-key: Accessing Other Event Info. +* event-live-p: Event Predicates. +* event-matches-key-specifier-p: Key Sequences. +* event-modifier-bits: Accessing Other Event Info. +* event-modifiers: Accessing Other Event Info. +* event-object: Accessing Other Event Info. +* event-over-border-p: Other Event Position Info. +* event-over-glyph-p: Event Glyph Position Info. +* event-over-modeline-p: Event Text Position Info. +* event-over-text-area-p: Event Text Position Info. +* event-over-toolbar-p: Event Toolbar Position Info. +* event-point: Event Text Position Info. +* event-process: Accessing Other Event Info. +* event-timestamp: Accessing Other Event Info. +* event-to-character: Converting Events. +* event-toolbar-button: Event Toolbar Position Info. +* event-type: Event Contents. +* event-window: Window-Level Event Position Info. +* event-window-x-pixel: Window-Level Event Position Info. +* event-window-y-pixel: Window-Level Event Position Info. +* event-x: Event Text Position Info. +* event-x-pixel: Frame-Level Event Position Info. +* event-y: Event Text Position Info. +* event-y-pixel: Frame-Level Event Position Info. +* eventp: Events. +* events: Events. +* events-to-keys: Converting Events. +* examining windows: Buffers and Windows. +* examples of using interactive: Interactive Examples. +* exchange-point-and-mark: The Mark. +* excursion: Excursions. +* exec-directory: Subprocess Creation. +* exec-path: Subprocess Creation. +* execute program: Subprocess Creation. +* execute with prefix argument: Interactive Call. +* execute-extended-command: Interactive Call. +* execute-kbd-macro: Keyboard Macros. +* executing-macro: Keyboard Macros. +* execution speed: Compilation Tips. +* exit: Recursive Editing. +* exit recursive editing: Recursive Editing. +* exit-minibuffer: Minibuffer Misc. +* exit-recursive-edit: Recursive Editing. +* exiting XEmacs: Getting Out. +* exp: Math Functions. +* expand-abbrev: Abbrev Expansion. +* expand-file-name: File Name Expansion. +* expansion of file names: File Name Expansion. +* expansion of macros: Expansion. +* expression: Intro Eval. +* expression prefix: Syntax Class Table. +* expt: Math Functions. +* extended-command-history: Minibuffer History. +* extent <1>: Extents. +* extent: Variable Scoping. +* extent children: Extent Parents. +* extent end position: Extent Endpoints. +* extent endpoint: Extent Endpoints. +* extent order: Extent Endpoints. +* extent parent: Extent Parents. +* extent priority: Intro to Extents. +* extent property: Extent Properties. +* extent replica: Duplicable Extents. +* extent start position: Extent Endpoints. +* extent, duplicable: Duplicable Extents. +* extent, unique: Duplicable Extents. +* extent-at: Finding Extents. +* extent-begin-glyph: Extent Properties. +* extent-begin-glyph-layout: Extent Properties. +* extent-children: Extent Parents. +* extent-descendants: Extent Parents. +* extent-detached-p: Detached Extents. +* extent-end-glyph: Extent Properties. +* extent-end-glyph-layout: Extent Properties. +* extent-end-position: Extent Endpoints. +* extent-face: Extent Properties. +* extent-in-region-p: Mapping Over Extents. +* extent-keymap: Extent Properties. +* extent-length: Extent Endpoints. +* extent-list: Finding Extents. +* extent-live-p: Creating and Modifying Extents. +* extent-mouse-face: Extent Properties. +* extent-object: Creating and Modifying Extents. +* extent-parent: Extent Parents. +* extent-priority: Extent Properties. +* extent-properties: Extent Properties. +* extent-property: Extent Properties. +* extent-start-position: Extent Endpoints. +* extentp: Extents. +* extents, locating: Finding Extents. +* extents, mapping: Mapping Over Extents. +* face type: Face Type. +* face-background: Face Convenience Functions. +* face-background-instance: Face Convenience Functions. +* face-background-pixmap: Face Convenience Functions. +* face-background-pixmap-instance: Face Convenience Functions. +* face-boolean-specifier-p: Specifier Types. +* face-differs-from-default-p: Other Face Display Functions. +* face-equal: Other Face Display Functions. +* face-font: Face Convenience Functions. +* face-font-instance: Face Convenience Functions. +* face-font-name: Face Convenience Functions. +* face-foreground: Face Convenience Functions. +* face-foreground-instance: Face Convenience Functions. +* face-list: Basic Face Functions. +* face-property: Face Properties. +* face-property-instance: Face Properties. +* face-underline-p: Face Convenience Functions. +* facep: Basic Face Functions. +* faces: Faces and Window-System Objects. +* fallback (in a specifier): Specifier Instancing. +* false: nil and t. +* fboundp: Function Cells. +* fceiling: Rounding Operations. +* featurep: Named Features. +* features: Named Features. +* fetch-bytecode: Dynamic Loading. +* ffloor: Rounding Operations. +* field width: Formatting Strings. +* fifth: List Elements. +* file accessibility: Testing Accessibility. +* file age: Testing Accessibility. +* file attributes: File Attributes. +* file format conversion: Format Conversion. +* file hard link: Changing File Attributes. +* file locks: File Locks. +* file mode specification error: Auto Major Mode. +* file modes and MS-DOS: Changing File Attributes. +* file modification time: Testing Accessibility. +* file name completion subroutines: File Name Completion. +* file name of buffer: Buffer File Name. +* file name of directory: Directory Names. +* file names: File Names. +* file names in directory: Contents of Directories. +* file open error: Subroutines of Visiting. +* file symbolic links: Kinds of Files. +* file types on MS-DOS: Files and MS-DOS. +* file with multiple names: Changing File Attributes. +* file-accessible-directory-p: Testing Accessibility. +* file-already-exists: Changing File Attributes. +* file-attributes: File Attributes. +* file-directory-p: Kinds of Files. +* file-error: How Programs Do Loading. +* file-executable-p: Testing Accessibility. +* file-exists-p: Testing Accessibility. +* file-local-copy: Magic File Names. +* file-locked: File Locks. +* file-locked-p: File Locks. +* file-menu-filter: Menu Filters. +* file-modes: File Attributes. +* file-name-absolute-p: Relative File Names. +* file-name-all-completions: File Name Completion. +* file-name-as-directory: Directory Names. +* file-name-buffer-file-type-alist: Files and MS-DOS. +* file-name-completion: File Name Completion. +* file-name-directory: File Name Components. +* file-name-history: Minibuffer History. +* file-name-nondirectory: File Name Components. +* file-name-sans-extension: File Name Components. +* file-name-sans-versions: File Name Components. +* file-newer-than-file-p: Testing Accessibility. +* file-newest-backup: Backup Names. +* file-nlinks: File Attributes. +* file-ownership-preserved-p: Testing Accessibility. +* file-precious-flag: Saving Buffers. +* file-readable-p: Testing Accessibility. +* file-regular-p: Kinds of Files. +* file-relative-name: File Name Expansion. +* file-supersession: Modification Time. +* file-symlink-p: Kinds of Files. +* file-truename: Truenames. +* file-writable-p: Testing Accessibility. +* fill-column: Margins. +* fill-individual-paragraphs: Filling. +* fill-individual-varying-indent: Filling. +* fill-paragraph: Filling. +* fill-paragraph-function: Filling. +* fill-prefix: Margins. +* fill-region: Filling. +* fill-region-as-paragraph: Filling. +* fillarray: Array Functions. +* filling a paragraph: Filling. +* filling, automatic: Auto Filling. +* filling, explicit: Filling. +* filter function: Filter Functions. +* find-backup-file-name: Backup Names. +* find-buffer-file-type: Files and MS-DOS. +* find-charset: Basic Charset Functions. +* find-charset-region: MULE Characters. +* find-charset-string: MULE Characters. +* find-coding-system: Basic Coding System Functions. +* find-file: Visiting Functions. +* find-file-binary: Files and MS-DOS. +* find-file-hooks: Visiting Functions. +* find-file-name-handler: Magic File Names. +* find-file-noselect: Visiting Functions. +* find-file-not-found-hooks: Visiting Functions. +* find-file-other-window: Visiting Functions. +* find-file-read-only: Visiting Functions. +* find-file-text: Files and MS-DOS. +* find-menu-item: Modifying Menus. +* finding files: Visiting Files. +* finding windows: Selecting Windows. +* first: List Elements. +* first-change-hook: Change Hooks. +* fixup-whitespace: User-Level Deletion. +* float: Numeric Conversions. +* float-output-format: Output Variables. +* floating-point numbers, printing: Output Variables. +* floatp: Predicates on Numbers. +* floor: Numeric Conversions. +* flow control characters: Flow Control. +* flush input: Peeking and Discarding. +* fmakunbound: Function Cells. +* focus-frame: Input Focus. +* following-char: Near Point. +* font instance characteristics: Font Instance Characteristics. +* font instance name: Font Instance Names. +* font instance size: Font Instance Size. +* font instance type: Font Instance Type. +* font-instance-name: Font Instance Names. +* font-instance-p: Font Instances. +* font-instance-properties: Font Instance Characteristics. +* font-instance-truename: Font Instance Names. +* font-name: Font Convenience Functions. +* font-properties: Font Convenience Functions. +* font-specifier-p <1>: Font Specifiers. +* font-specifier-p: Specifier Types. +* font-truename: Font Convenience Functions. +* fonts <1>: Fonts. +* fonts: Some Terms. +* fonts available: Font Instance Names. +* foo: A Sample Function Description. +* for: Argument Evaluation. +* force-cursor-redisplay: Refresh Screen. +* force-highlight-extent: Extents and Events. +* forcing redisplay: Waiting. +* format: Formatting Strings. +* format definition: Format Conversion. +* format of keymaps: Format of Keymaps. +* format of menus: Menu Format. +* format of the menubar: Menubar Format. +* format precision: Formatting Strings. +* format specification: Formatting Strings. +* format-alist: Format Conversion. +* format-buffers-menu-line: Buffers Menu. +* format-find-file: Format Conversion. +* format-insert-file: Format Conversion. +* format-time-string: Time Conversion. +* format-write-file: Format Conversion. +* formatting strings: Formatting Strings. +* formfeed: Character Type. +* forms: Intro Eval. +* forward-char: Character Motion. +* forward-comment: Parsing Expressions. +* forward-line: Text Lines. +* forward-list: List Motion. +* forward-sexp: List Motion. +* forward-to-indentation: Motion by Indent. +* forward-word: Word Motion. +* fourth: List Elements. +* frame: Frames. +* frame configuration: Frame Configurations. +* frame hooks: Frame Hooks. +* frame name: Frame Name. +* frame of terminal: Basic Windows. +* frame position: Size and Position. +* frame size: Size and Position. +* frame visibility: Visibility of Frames. +* frame-device: Basic Device Functions. +* frame-height: Size and Position. +* frame-highest-window: Frames and Windows. +* frame-icon-title-format: Frame Titles. +* frame-iconified-p: Visibility of Frames. +* frame-leftmost-window: Frames and Windows. +* frame-list: Finding All Frames. +* frame-live-p: Deleting Frames. +* frame-lowest-window: Frames and Windows. +* frame-name: Frame Name. +* frame-pixel-height: Size and Position. +* frame-pixel-width: Size and Position. +* frame-properties: Property Access. +* frame-property: Property Access. +* frame-rightmost-window: Frames and Windows. +* frame-root-window: Frames and Windows. +* frame-selected-window: Frames and Windows. +* frame-title-format: Frame Titles. +* frame-totally-visible-p: Visibility of Frames. +* frame-visible-p: Visibility of Frames. +* frame-width: Size and Position. +* framep: Frames. +* free list: Garbage Collection. +* frequency counts: Coverage Testing. +* fround: Rounding Operations. +* fset: Function Cells. +* ftp-login: Cleanups. +* ftruncate: Rounding Operations. +* funcall: Calling Functions. +* funcall, and debugging: Internals of Debugger. +* function <1>: Anonymous Functions. +* function: What Is a Function. +* function call: Function Forms. +* function call debugging: Function Debugging. +* function cell: Symbol Components. +* function cell in autoload: Autoload. +* function definition: Function Names. +* function descriptions: A Sample Function Description. +* function form evaluation: Function Forms. +* function input stream: Input Streams. +* function invocation: Calling Functions. +* function name: Function Names. +* function output stream: Output Streams. +* function quoting: Anonymous Functions. +* function-interactive: Using Interactive. +* function-key-map: Translating Input. +* function-obsoleteness-doc: Obsoleteness. +* functionals: Calling Functions. +* functions in modes: Major Mode Conventions. +* functions, making them interactive: Defining Commands. +* Fundamental mode: Major Modes. +* fundamental-mode: Auto Major Mode. +* fundamental-mode-abbrev-table: Standard Abbrev Tables. +* garbage collector: Garbage Collection. +* garbage-collect: Garbage Collection. +* gc-cons-threshold: Garbage Collection. +* gc-message: Garbage Collection. +* gc-pointer-glyph <1>: Garbage Collection. +* gc-pointer-glyph: Mouse Pointer. +* generate-new-buffer: Creating Buffers. +* generate-new-buffer-name: Buffer Names. +* generic-specifier-p: Specifier Types. +* get: Object Plists. +* get-buffer: Buffer Names. +* get-buffer-create: Creating Buffers. +* get-buffer-process: Process Buffers. +* get-buffer-window: Buffers and Windows. +* get-char-property: Examining Properties. +* get-char-table: Working With Char Tables. +* get-charset: Basic Charset Functions. +* get-coding-system: Basic Coding System Functions. +* get-database: Working With a Database. +* get-file-buffer: Buffer File Name. +* get-largest-window: Selecting Windows. +* get-lru-window: Selecting Windows. +* get-process: Process Information. +* get-range-char-table: Working With Char Tables. +* get-range-table: Working With Range Tables. +* get-register: Registers. +* get-text-property: Examining Properties. +* get-tooltalk-message-attribute: Elisp Interface for Sending Messages. +* getenv: System Environment. +* getf: Other Plists. +* gethash: Working With Hash Tables. +* gettext: Level 3 Primitives. +* global binding: Local Variables. +* global break condition: Global Break Condition. +* global keymap: Active Keymaps. +* global mark ring: The Mark. +* global variable: Global Variables. +* global-abbrev-table: Standard Abbrev Tables. +* global-key-binding: Functions for Key Lookup. +* global-map: Active Keymaps. +* global-mark-ring: The Mark. +* global-mode-string: Modeline Variables. +* global-popup-menu: Pop-Up Menus. +* global-set-key: Key Binding Commands. +* global-unset-key: Key Binding Commands. +* glyph type: Glyph Type. +* glyph-ascent: Glyph Dimensions. +* glyph-baseline: Glyph Convenience Functions. +* glyph-baseline-instance: Glyph Convenience Functions. +* glyph-contrib-p: Glyph Convenience Functions. +* glyph-contrib-p-instance: Glyph Convenience Functions. +* glyph-descent: Glyph Dimensions. +* glyph-face: Glyph Convenience Functions. +* glyph-height: Glyph Dimensions. +* glyph-image: Glyph Convenience Functions. +* glyph-image-instance: Glyph Convenience Functions. +* glyph-property: Glyph Properties. +* glyph-property-instance: Glyph Properties. +* glyph-type: Glyph Types. +* glyph-type-list: Glyph Types. +* glyph-width: Glyph Dimensions. +* glyphp: Glyphs. +* glyphs: Glyphs. +* goto-char: Character Motion. +* goto-line: Text Lines. +* gutter: Gutter. +* gutter-buttons-captioned-p: Other Gutter Variables. +* gutter-make-button-list: Gutter Descriptor Format. +* gutter-specifier-p: Specifying a Gutter. +* hack-local-variables: Auto Major Mode. +* handling errors: Handling Errors. +* hash notation: Printed Representation. +* hash table: Hash Tables. +* hash table type: Hash Table Type. +* hash table, weak: Weak Hash Tables. +* hash-table-count: Introduction to Hash Tables. +* hash-table-p: Hash Tables. +* hash-table-rehash-size: Introduction to Hash Tables. +* hash-table-rehash-threshold: Introduction to Hash Tables. +* hash-table-size: Introduction to Hash Tables. +* hash-table-test: Introduction to Hash Tables. +* hash-table-weakness: Introduction to Hash Tables. +* hashing: Creating Symbols. +* header comments: Library Headers. +* help for major mode: Mode Help. +* help-char: Help Functions. +* help-command: Help Functions. +* help-form: Help Functions. +* help-map <1>: Standard Keymaps. +* help-map: Help Functions. +* Helper-describe-bindings: Help Functions. +* Helper-help: Help Functions. +* Helper-help-map: Standard Keymaps. +* hide-annotation: Annotation Properties. +* highlight-extent: Extents and Events. +* history list: Minibuffer History. +* history of commands: Command History. +* HOME environment variable: Subprocess Creation. +* hooks: Hooks. +* hooks for loading: Hooks for Loading. +* hooks for text changes: Change Hooks. +* horizontal position: Columns. +* horizontal scrolling: Horizontal Scrolling. +* hscroll-glyph: Redisplay Glyphs. +* icon-glyph-p: Glyph Types. +* iconified frame: Visibility of Frames. +* iconify-frame: Visibility of Frames. +* identity: Calling Functions. +* IEEE floating point: Float Basics. +* if: Conditionals. +* ignore: Calling Functions. +* ignored-local-variables: Auto Major Mode. +* image instance type: Image Instance Type. +* image instance types: Image Instance Types. +* image instances: Image Instances. +* image instantiator conversion: Image Instantiator Conversion. +* image specifiers: Image Specifiers. +* image-instance-background: Image Instance Functions. +* image-instance-depth: Image Instance Functions. +* image-instance-domain: Image Instance Functions. +* image-instance-file-name: Image Instance Functions. +* image-instance-foreground: Image Instance Functions. +* image-instance-height: Image Instance Functions. +* image-instance-hotspot-x: Image Instance Functions. +* image-instance-hotspot-y: Image Instance Functions. +* image-instance-mask-file-name: Image Instance Functions. +* image-instance-name: Image Instance Functions. +* image-instance-p: Image Instances. +* image-instance-string: Image Instance Functions. +* image-instance-type: Image Instance Types. +* image-instance-type-list: Image Instance Types. +* image-instance-width: Image Instance Functions. +* image-instantiator-format-list: Image Specifiers. +* image-specifier-p <1>: Image Specifiers. +* image-specifier-p: Specifier Types. +* implicit progn: Sequencing. +* inc: Simple Macro. +* indent-according-to-mode: Mode-Specific Indent. +* indent-code-rigidly: Region Indent. +* indent-for-tab-command: Mode-Specific Indent. +* indent-line-function: Mode-Specific Indent. +* indent-region: Region Indent. +* indent-region-function: Region Indent. +* indent-relative: Relative Indent. +* indent-relative-maybe: Relative Indent. +* indent-rigidly: Region Indent. +* indent-tabs-mode: Primitive Indent. +* indent-to: Primitive Indent. +* indent-to-left-margin: Margins. +* indentation: Indentation. +* indenting with parentheses: Parsing Expressions. +* indirect buffers: Indirect Buffers. +* indirect specifications: Specification List. +* indirect variables: Variable Aliases. +* indirect-function: Function Indirection. +* indirect-variable: Variable Aliases. +* indirection: Function Indirection. +* infinite loops: Infinite Loops. +* infinite recursion: Local Variables. +* infinity: Float Basics. +* Info-edit-map: Standard Keymaps. +* Info-minibuffer-history: Minibuffer History. +* Info-mode-map: Standard Keymaps. +* inherit: Syntax Class Table. +* inheriting a keymap's bindings: Inheritance and Keymaps. +* inhibit-default-init: Init File. +* inhibit-file-name-handlers: Magic File Names. +* inhibit-file-name-operation: Magic File Names. +* inhibit-quit: Quitting. +* inhibit-read-only: Read Only Buffers. +* inhibit-startup-echo-area-message: Start-up Summary. +* inhibit-startup-message: Start-up Summary. +* init file: Init File. +* initial-frame-plist: Initial Properties. +* initial-gutter-spec: Other Gutter Variables. +* initial-major-mode: Auto Major Mode. +* initial-toolbar-spec: Other Toolbar Variables. +* initialization: Start-up Summary. +* inline functions: Inline Functions. +* innermost containing parentheses: Parsing Expressions. +* input events: Events. +* input focus: Input Focus. +* input modes: Input Modes. +* input stream: Input Streams. +* input-pending-p: Peeking and Discarding. +* insert: Insertion. +* insert-abbrev-table-description: Abbrev Tables. +* insert-before-markers: Insertion. +* insert-buffer: Commands for Insertion. +* insert-buffer-substring: Insertion. +* insert-char: Insertion. +* insert-default-directory: Reading File Names. +* insert-directory: Contents of Directories. +* insert-directory-program: Contents of Directories. +* insert-extent: Detached Extents. +* insert-file-contents: Reading from Files. +* insert-register: Registers. +* insert-string: Insertion. +* inserting killed text: Yank Commands. +* insertion before point: Insertion. +* insertion of text: Insertion. +* inside comment: Parsing Expressions. +* inside margin: Annotation Basics. +* inside string: Parsing Expressions. +* inst-list (in a specifier): Specifiers In-Depth. +* inst-pair (in a specifier): Specifiers In-Depth. +* installation-directory: System Environment. +* instance (in a specifier): Specifiers In-Depth. +* instancing (in a specifier): Specifiers In-Depth. +* instantiator (in a specifier): Specifiers In-Depth. +* int-char: Character Codes. +* int-to-string: String Conversion. +* integer to decimal: String Conversion. +* integer to hexadecimal: Formatting Strings. +* integer to octal: Formatting Strings. +* integer to string: String Conversion. +* integer-char-or-marker-p: Predicates on Markers. +* integer-or-char-p: Predicates for Characters. +* integer-or-marker-p: Predicates on Markers. +* integer-specifier-p: Specifier Types. +* integerp: Predicates on Numbers. +* integers: Numbers. +* interactive: Using Interactive. +* interactive call: Interactive Call. +* interactive code description: Interactive Codes. +* interactive commands (Edebug): Instrumenting. +* interactive completion: Interactive Codes. +* interactive function: Defining Commands. +* interactive, examples of using: Interactive Examples. +* interactive-p: Interactive Call. +* intern: Creating Symbols. +* intern-soft: Creating Symbols. +* internal-doc-file-name: Accessing Documentation. +* interning: Creating Symbols. +* interpreter: Evaluation. +* interpreter-mode-alist: Auto Major Mode. +* interprogram-cut-function: Low-Level Kill Ring. +* interprogram-paste-function: Low-Level Kill Ring. +* interrupt-process: Signals to Processes. +* invalid function: Function Indirection. +* invalid prefix key error: Changing Key Bindings. +* invalid-function: Function Indirection. +* invalid-read-syntax: Printed Representation. +* invalid-regexp: Syntax of Regexps. +* invert-face: Other Face Display Functions. +* invisible frame: Visibility of Frames. +* invisible text: Invisible Text. +* invisible-text-glyph: Redisplay Glyphs. +* invocation-directory: System Environment. +* invocation-name: System Environment. +* isearch-mode-map: Standard Keymaps. +* ISO Latin 1: Case Tables. +* ISO Latin-1 characters (input): Translating Input. +* iso-syntax: Case Tables. +* iso-transl: Translating Input. +* italic: Font Instance Characteristics. +* iteration: Iteration. +* itimer-edit-map: Standard Keymaps. +* joining lists: Rearrangement. +* just-one-space: User-Level Deletion. +* justify-current-line: Filling. +* kept-new-versions: Numbered Backups. +* kept-old-versions: Numbered Backups. +* key: Keymap Terminology. +* key binding: Keymap Terminology. +* key lookup: Key Lookup. +* key sequence: Key Sequence Input. +* key sequence error: Changing Key Bindings. +* key sequence input: Key Sequence Input. +* key sequences: Key Sequences. +* key translation function: Translating Input. +* key-binding: Functions for Key Lookup. +* key-description: Describing Characters. +* key-press-event-p: Event Predicates. +* key-translation-map: Translating Input. +* keyboard macro execution: Interactive Call. +* keyboard macro termination: Beeping. +* keyboard macros: Keyboard Macros. +* keyboard macros (Edebug): Edebug Execution Modes. +* keyboard menu accelerators: Menu Accelerators. +* keyboard-quit: Quitting. +* keymap: Keymaps. +* keymap entry: Key Lookup. +* keymap format: Format of Keymaps. +* keymap in keymap: Key Lookup. +* keymap inheritance: Inheritance and Keymaps. +* keymap parent: Inheritance and Keymaps. +* keymap-default-binding: Inheritance and Keymaps. +* keymap-fullness: Scanning Keymaps. +* keymap-name: Creating Keymaps. +* keymap-parents: Inheritance and Keymaps. +* keymap-prompt: Other Keymap Functions. +* keymapp: Format of Keymaps. +* keymaps in modes: Major Mode Conventions. +* keys in documentation strings: Keys in Documentation. +* keystroke: Keymap Terminology. +* keystroke command: What Is a Function. +* keywordp: Specification List. +* kill command repetition: Command Loop Info. +* kill ring: The Kill Ring. +* kill-all-local-variables: Creating Buffer-Local. +* kill-append: Low-Level Kill Ring. +* kill-buffer: Killing Buffers. +* kill-buffer-hook: Killing Buffers. +* kill-buffer-query-functions: Killing Buffers. +* kill-emacs: Killing XEmacs. +* kill-emacs-hook: Killing XEmacs. +* kill-emacs-query-functions: Killing XEmacs. +* kill-local-variable: Creating Buffer-Local. +* kill-new: Low-Level Kill Ring. +* kill-process: Signals to Processes. +* kill-region: Kill Functions. +* kill-ring: Internals of Kill Ring. +* kill-ring-max: Internals of Kill Ring. +* kill-ring-yank-pointer: Internals of Kill Ring. +* killing buffers: Killing Buffers. +* killing XEmacs: Killing XEmacs. +* lambda expression: Lambda Expressions. +* lambda expression in hook: Hooks. +* lambda in debug: Invoking the Debugger. +* lambda in keymap: Key Lookup. +* lambda list: Lambda Components. +* lambda-list (Edebug): Specification List. +* lambda-list-keywordp: Specification List. +* last-abbrev: Abbrev Expansion. +* last-abbrev-location: Abbrev Expansion. +* last-abbrev-text: Abbrev Expansion. +* last-command: Command Loop Info. +* last-command-char: Command Loop Info. +* last-command-event: Command Loop Info. +* last-input-char: Peeking and Discarding. +* last-input-event: Peeking and Discarding. +* last-kbd-macro: Keyboard Macros. +* Latin-1 character set (input): Translating Input. +* lax-plist-get: Working With Lax Plists. +* lax-plist-member: Working With Lax Plists. +* lax-plist-put: Working With Lax Plists. +* lax-plist-remprop: Working With Lax Plists. +* lax-plists-eq: Working With Lax Plists. +* lax-plists-equal: Working With Lax Plists. +* layout policy: Annotation Basics. +* layout types: Annotation Basics. +* lazy loading: Dynamic Loading. +* LDAP: LDAP Support. +* ldap-add: Low-level Operations on a LDAP Server. +* ldap-add-entries: The High-Level LDAP API. +* ldap-attribute-syntax-decoders: LDAP Internationalization Variables. +* ldap-attribute-syntax-encoders: LDAP Internationalization Variables. +* ldap-attribute-syntaxes-alist: LDAP Internationalization Variables. +* ldap-close: Opening and Closing a LDAP Connection. +* ldap-coding-system: LDAP Internationalization Variables. +* ldap-decode-address: Encoder/Decoder Functions. +* ldap-decode-attribute: LDAP Internationalization. +* ldap-decode-boolean: Encoder/Decoder Functions. +* ldap-decode-string: Encoder/Decoder Functions. +* ldap-default-attribute-decoder: LDAP Internationalization Variables. +* ldap-default-base: LDAP Variables. +* ldap-default-host: LDAP Variables. +* ldap-default-port: LDAP Variables. +* ldap-delete: Low-level Operations on a LDAP Server. +* ldap-delete-entries: The High-Level LDAP API. +* ldap-encode-address: Encoder/Decoder Functions. +* ldap-encode-boolean: Encoder/Decoder Functions. +* ldap-encode-string: Encoder/Decoder Functions. +* ldap-host: The LDAP Lisp Object. +* ldap-host-parameters-alist: LDAP Variables. +* ldap-ignore-attribute-codings: LDAP Internationalization Variables. +* ldap-live-p: The LDAP Lisp Object. +* ldap-modify: Low-level Operations on a LDAP Server. +* ldap-modify-entries: The High-Level LDAP API. +* ldap-open: Opening and Closing a LDAP Connection. +* ldap-search-basic: Low-level Operations on a LDAP Server. +* ldap-search-entries: The High-Level LDAP API. +* ldap-verbose: LDAP Variables. +* ldapp: The LDAP Lisp Object. +* left-gutter: Specifying a Gutter. +* left-gutter-visible-p: Other Gutter Variables. +* left-gutter-width: Other Gutter Variables. +* left-margin: Margins. +* left-margin-width: Margin Primitives. +* left-toolbar: Specifying the Toolbar. +* left-toolbar-visible-p: Other Toolbar Variables. +* left-toolbar-width: Other Toolbar Variables. +* length: Sequence Functions. +* let: Local Variables. +* let*: Local Variables. +* let-specifier: Adding Specifications. +* lexical binding (Edebug): Edebug Eval. +* lexical comparison: Text Comparison. +* library: Loading. +* library compilation: Compilation Functions. +* library header comments: Library Headers. +* line wrapping: Truncation. +* lines: Text Lines. +* lines in region: Text Lines. +* linking files: Changing File Attributes. +* Lisp debugger: Debugger. +* Lisp expression motion: List Motion. +* Lisp history: Lisp History. +* Lisp library: Loading. +* Lisp nesting error: Eval. +* Lisp object: Lisp Data Types. +* Lisp printer: Output Functions. +* Lisp reader: Streams Intro. +* lisp-interaction-mode-map: Standard Keymaps. +* lisp-mode-abbrev-table: Standard Abbrev Tables. +* lisp-mode-map: Standard Keymaps. +* lisp-mode.el: Example Major Modes. +* list <1>: Building Lists. +* list: Lists. +* list elements: List Elements. +* list form evaluation: Classifying Lists. +* list in keymap: Key Lookup. +* list length: Sequence Functions. +* list motion: List Motion. +* list structure: Cons Cells. +* list-buffers: The Buffer List. +* list-buffers-directory: Buffer File Name. +* list-fonts: Font Instance Names. +* list-processes: Process Information. +* listp: List-related Predicates. +* lists and cons cells: Cons Cells. +* lists as sets: Sets And Lists. +* lists represented as boxes: Lists as Boxes. +* literal evaluation: Self-Evaluating Forms. +* lmessage: The Echo Area. +* ln: Changing File Attributes. +* load: How Programs Do Loading. +* load error with require: Named Features. +* load errors: How Programs Do Loading. +* load-average: System Environment. +* load-default-sounds: Beeping. +* load-history: Unloading. +* load-ignore-elc-files: How Programs Do Loading. +* load-in-progress: How Programs Do Loading. +* load-path: How Programs Do Loading. +* load-read-function: How Programs Do Loading. +* load-sound-file: Beeping. +* load-warn-when-source-newer: How Programs Do Loading. +* load-warn-when-source-only: How Programs Do Loading. +* loading: Loading. +* loading hooks: Hooks for Loading. +* loadup.el: Building XEmacs. +* local binding: Local Variables. +* local keymap: Active Keymaps. +* local variables: Local Variables. +* local-abbrev-table: Standard Abbrev Tables. +* local-key-binding: Functions for Key Lookup. +* local-set-key: Key Binding Commands. +* local-unset-key: Key Binding Commands. +* local-variable-p: Creating Buffer-Local. +* local-write-file-hooks: Saving Buffers. +* locale (in a specifier): Specifiers In-Depth. +* locate-file: How Programs Do Loading. +* locate-file-clear-hashing: How Programs Do Loading. +* lock-buffer: File Locks. +* log: Math Functions. +* log-message-ignore-labels: The Echo Area. +* log-message-ignore-regexps: The Echo Area. +* log-message-max-size: The Echo Area. +* log-warning-minimum-level: Warnings. +* log-warning-suppressed-classes: Warnings. +* log10: Math Functions. +* logand: Bitwise Operations. +* logb: Float Basics. +* logical and: Bitwise Operations. +* logical exclusive or: Bitwise Operations. +* logical inclusive or: Bitwise Operations. +* logical not: Bitwise Operations. +* logical shift: Bitwise Operations. +* logior: Bitwise Operations. +* lognot: Bitwise Operations. +* logxor: Bitwise Operations. +* looking-at: Regexp Search. +* lookup-key: Functions for Key Lookup. +* loops, infinite: Infinite Loops. +* lower case: Character Case. +* lower-frame: Raising and Lowering. +* lowering a frame: Raising and Lowering. +* lsh: Bitwise Operations. +* lwarn: Warnings. +* M-x: Interactive Call. +* Maclisp: Lisp History. +* macro: What Is a Function. +* macro argument evaluation: Argument Evaluation. +* macro call: Expansion. +* macro call evaluation: Macro Forms. +* macro compilation: Compilation Functions. +* macro descriptions: A Sample Function Description. +* macro expansion: Expansion. +* macroexpand: Expansion. +* macros: Macros. +* magic file names: Magic File Names. +* mail-host-address: System Environment. +* major mode: Major Modes. +* major mode hook: Major Mode Conventions. +* major mode keymap: Active Keymaps. +* major-mode: Mode Help. +* make-abbrev-table: Abbrev Tables. +* make-annotation: Annotation Primitives. +* make-auto-save-file-name: Auto-Saving. +* make-backup-file-name: Backup Names. +* make-backup-files: Making Backups. +* make-bit-vector: Bit Vector Functions. +* make-boolean-specifier: Creating Specifiers. +* make-byte-code: Compiled-Function Objects. +* make-char: MULE Characters. +* make-char-table: Working With Char Tables. +* make-charset: Basic Charset Functions. +* make-coding-system: Basic Coding System Functions. +* make-color-specifier: Color Specifiers. +* make-composite-char: Composite Characters. +* make-device: Connecting to a Console or Device. +* make-directory: Create/Delete Dirs. +* make-display-table: Display Table Format. +* make-display-table-specifier: Creating Specifiers. +* make-event: Working With Events. +* make-extent: Creating and Modifying Extents. +* make-face: Basic Face Functions. +* make-face-boolean-specifier: Color Specifiers. +* make-file-part: Creating a Partial File. +* make-font-instance: Font Instances. +* make-font-specifier: Font Specifiers. +* make-frame: Creating Frames. +* make-frame-invisible: Visibility of Frames. +* make-frame-visible: Visibility of Frames. +* make-generic-specifier: Creating Specifiers. +* make-glyph: Creating Glyphs. +* make-glyph-internal: Creating Glyphs. +* make-gutter-size-specifier: Creating Gutter. +* make-gutter-specifier: Creating Gutter. +* make-gutter-visible-specifier: Creating Gutter. +* make-hash-table: Introduction to Hash Tables. +* make-icon-glyph: Creating Glyphs. +* make-image-instance: Image Instance Functions. +* make-image-specifier: Image Specifiers. +* make-indirect-buffer: Indirect Buffers. +* make-integer-specifier: Creating Specifiers. +* make-keymap: Creating Keymaps. +* make-list: Building Lists. +* make-local-hook: Hooks. +* make-local-variable: Creating Buffer-Local. +* make-marker: Creating Markers. +* make-natnum-specifier: Creating Specifiers. +* make-obsolete: Obsoleteness. +* make-obsolete-variable: Obsoleteness. +* make-pointer-glyph: Creating Glyphs. +* make-range-table: Introduction to Range Tables. +* make-reverse-direction-charset: Basic Charset Functions. +* make-sparse-keymap: Creating Keymaps. +* make-specifier: Creating Specifiers. +* make-specifier-and-init: Creating Specifiers. +* make-string: Creating Strings. +* make-symbol: Creating Symbols. +* make-symbolic-link: Changing File Attributes. +* make-syntax-table: Syntax Table Functions. +* make-temp-name: Unique File Names. +* make-toolbar-specifier: Creating Toolbar. +* make-tooltalk-message: Elisp Interface for Sending Messages. +* make-tooltalk-pattern: Elisp Interface for Receiving Messages. +* make-tty-device: Connecting to a Console or Device. +* make-variable-buffer-local: Creating Buffer-Local. +* make-vector: Vector Functions. +* make-weak-list: Weak Lists. +* make-x-device: Connecting to a Console or Device. +* makunbound: Void Variables. +* Manual-page-minibuffer-history: Minibuffer History. +* map-char-table: Working With Char Tables. +* map-database: Working With a Database. +* map-extent-children: Mapping Over Extents. +* map-extents: Mapping Over Extents. +* map-frame-hook: Frame Hooks. +* map-keymap: Scanning Keymaps. +* map-range-table: Working With Range Tables. +* map-specifier: Other Specification Functions. +* map-y-or-n-p: Multiple Queries. +* mapatoms: Creating Symbols. +* mapcar: Mapping Functions. +* mapcar-extents: Mapping Over Extents. +* mapconcat: Mapping Functions. +* maphash: Working With Hash Tables. +* mapping functions: Mapping Functions. +* margin: Annotation Basics. +* margin width: Margin Primitives. +* mark: The Mark. +* mark excursion: Excursions. +* mark ring: The Mark. +* mark, the: The Mark. +* mark-marker: The Mark. +* mark-ring: The Mark. +* mark-ring-max: The Mark. +* marker argument: Interactive Codes. +* marker garbage collection: Overview of Markers. +* marker input stream: Input Streams. +* marker output stream: Output Streams. +* marker relocation: Overview of Markers. +* marker-buffer: Information from Markers. +* marker-position: Information from Markers. +* markerp: Predicates on Markers. +* markers: Markers. +* markers as numbers: Overview of Markers. +* markers vs. extents: Overview of Markers. +* match data: Match Data. +* match-beginning: Simple Match Data. +* match-data: Entire Match Data. +* match-end: Simple Match Data. +* match-string: Simple Match Data. +* mathematical functions: Math Functions. +* max: Comparison of Numbers. +* max-lisp-eval-depth: Eval. +* max-specpdl-size: Local Variables. +* md5: Transformations. +* MD5 digests: Transformations. +* member: Sets And Lists. +* membership in a list: Sets And Lists. +* memory allocation: Garbage Collection. +* memq: Sets And Lists. +* menu: Menus. +* menu accelerators: Menu Accelerators. +* menu filters: Menu Filters. +* menu format: Menu Format. +* menu-accelerator-enabled: Menu Accelerator Functions. +* menu-accelerator-map: Menu Accelerator Functions. +* menu-accelerator-modifiers: Menu Accelerator Functions. +* menu-accelerator-prefix: Menu Accelerator Functions. +* menu-no-selection-hook: Menubar. +* menubar: Menubar. +* menubar format: Menubar Format. +* menubar-configuration: Menu Format. +* menubar-pointer-glyph: Mouse Pointer. +* menubar-show-keybindings: Menubar. +* message: The Echo Area. +* meta character printing: Describing Characters. +* meta-prefix-char: Functions for Key Lookup. +* min: Comparison of Numbers. +* minibuffer: Minibuffers. +* minibuffer history: Minibuffer History. +* minibuffer input: Recursive Editing. +* minibuffer window: Cyclic Window Ordering. +* minibuffer-complete: Completion Commands. +* minibuffer-complete-and-exit: Completion Commands. +* minibuffer-complete-word: Completion Commands. +* minibuffer-completion-confirm: Completion Commands. +* minibuffer-completion-help: Completion Commands. +* minibuffer-completion-predicate: Completion Commands. +* minibuffer-completion-table: Completion Commands. +* minibuffer-depth: Minibuffer Misc. +* minibuffer-exit-hook: Minibuffer Misc. +* minibuffer-frame-plist: Initial Properties. +* minibuffer-help-form: Minibuffer Misc. +* minibuffer-history: Minibuffer History. +* minibuffer-local-completion-map <1>: Standard Keymaps. +* minibuffer-local-completion-map: Completion Commands. +* minibuffer-local-isearch-map: Standard Keymaps. +* minibuffer-local-map <1>: Standard Keymaps. +* minibuffer-local-map: Text from Minibuffer. +* minibuffer-local-must-match-map <1>: Standard Keymaps. +* minibuffer-local-must-match-map: Completion Commands. +* minibuffer-prompt: Minibuffer Misc. +* minibuffer-prompt-width: Minibuffer Misc. +* minibuffer-scroll-window: Minibuffer Misc. +* minibuffer-setup-hook: Minibuffer Misc. +* minibuffer-window: Minibuffer Misc. +* minibuffer-window-active-p: Minibuffer Misc. +* minimum window size: Resizing Windows. +* minor mode: Minor Modes. +* minor mode conventions: Minor Mode Conventions. +* minor-mode-alist: Modeline Variables. +* minor-mode-key-binding: Functions for Key Lookup. +* minor-mode-map-alist: Active Keymaps. +* misc-user-event-p: Event Predicates. +* mod: Arithmetic Operations. +* mode: Modes. +* mode help: Mode Help. +* mode hook: Major Mode Conventions. +* mode loading: Major Mode Conventions. +* mode variable: Minor Mode Conventions. +* mode-class property: Major Mode Conventions. +* mode-name: Modeline Variables. +* mode-popup-menu: Pop-Up Menus. +* mode-specific-map <1>: Standard Keymaps. +* mode-specific-map: Prefix Keys. +* modeline: Modeline Format. +* modeline construct: Modeline Data. +* modeline-buffer-identification: Modeline Variables. +* modeline-format: Modeline Data. +* modeline-map <1>: Standard Keymaps. +* modeline-map: Active Keymaps. +* modeline-modified: Modeline Variables. +* modeline-pointer-glyph: Mouse Pointer. +* modeline-process: Modeline Variables. +* modification flag (of buffer): Buffer Modification. +* modification of lists: Rearrangement. +* modification time, comparison of: Modification Time. +* modify-syntax-entry: Syntax Table Functions. +* modulus: Arithmetic Operations. +* momentary-string-display: Temporary Displays. +* mono-pixmap-image-instance-p: Image Instance Types. +* motion-event-p: Event Predicates. +* mouse cursor: Mouse Pointer. +* mouse pointer: Mouse Pointer. +* mouse-event-p: Event Predicates. +* mouse-grabbed-buffer: Active Keymaps. +* mouse-highlight-priority: Extents and Events. +* move-marker: Changing Markers. +* move-to-column: Columns. +* move-to-left-margin: Margins. +* move-to-window-line: Screen Lines. +* MS-DOS and file modes: Changing File Attributes. +* MS-DOS file types: Files and MS-DOS. +* MSWindows OLE: MSWindows OLE. +* multilingual string formatting: Formatting Strings. +* multiple windows: Basic Windows. +* named function: Function Names. +* NaN: Float Basics. +* narrow-to-page: Narrowing. +* narrow-to-region: Narrowing. +* narrowing: Narrowing. +* natnum-specifier-p: Specifier Types. +* natnump: Predicates on Numbers. +* natural numbers: Predicates on Numbers. +* nconc: Rearrangement. +* negative infinity: Float Basics. +* negative-argument: Prefix Command Arguments. +* network connection: Network. +* new file message: Subroutines of Visiting. +* newline <1>: Commands for Insertion. +* newline: Character Type. +* newline and Auto Fill mode: Commands for Insertion. +* newline in print: Output Functions. +* newline in strings: String Type. +* newline-and-indent: Mode-Specific Indent. +* next input: Peeking and Discarding. +* next-command-event: Reading One Event. +* next-event: Reading One Event. +* next-extent: Finding Extents. +* next-frame: Finding All Frames. +* next-history-element: Minibuffer Misc. +* next-matching-history-element: Minibuffer Misc. +* next-property-change: Property Search. +* next-screen-context-lines: Vertical Scrolling. +* next-single-property-change: Property Search. +* next-window: Cyclic Window Ordering. +* nil: Constant Variables. +* nil and lists: Cons Cells. +* nil in keymap: Key Lookup. +* nil in lists: Cons Cell Type. +* nil input stream: Input Streams. +* nil output stream: Output Streams. +* nil, uses of: nil and t. +* ninth: List Elements. +* nlistp: List-related Predicates. +* no-catch: Catch and Throw. +* no-redraw-on-reenter: Refresh Screen. +* nondirectory part (of file name): File Name Components. +* noninteractive: Batch Mode. +* noninteractive use: Batch Mode. +* nonlocal exits: Nonlocal Exits. +* nonprinting characters, reading: Quoted Character Input. +* nontext-pointer-glyph: Mouse Pointer. +* normal-mode: Auto Major Mode. +* not: Combining Conditions. +* not-modified: Buffer Modification. +* nothing-image-instance-p: Image Instance Types. +* nreverse: Rearrangement. +* nth: List Elements. +* nthcdr: List Elements. +* null: List-related Predicates. +* number equality: Comparison of Numbers. +* number-char-or-marker-p: Predicates on Markers. +* number-or-marker-p: Predicates on Markers. +* number-to-string: String Conversion. +* numberp: Predicates on Numbers. +* numbers: Numbers. +* numeric prefix: Formatting Strings. +* numeric prefix argument: Prefix Command Arguments. +* numeric prefix argument usage: Interactive Codes. +* obarray: Creating Symbols. +* obarray in completion: Basic Completion. +* objc-mode-map: Standard Keymaps. +* object: Lisp Data Types. +* object to string: Output Functions. +* object-plist: Object Plists. +* oblique: Font Instance Characteristics. +* obsolete buffer: Modification Time. +* occur-mode-map: Standard Keymaps. +* octal character code: Character Type. +* octal character input: Quoted Character Input. +* octal-escape-glyph: Redisplay Glyphs. +* OffiX DND: OffiX DND. +* old-eq: Equality Predicates. +* one-window-p: Splitting Windows. +* only-global-abbrevs: Defining Abbrevs. +* open-database: Connecting to a Database. +* open-dribble-file: Recording Input. +* open-network-stream: Network. +* open-termscript: Terminal Output. +* open parenthesis character: Syntax Class Table. +* operating system environment: System Environment. +* option descriptions: A Sample Variable Description. +* optional arguments: Argument List. +* options on command line: Command Line Arguments. +* or: Combining Conditions. +* order of extents: Extent Endpoints. +* ordering of windows, cyclic: Cyclic Window Ordering. +* other-buffer: The Buffer List. +* other-window: Cyclic Window Ordering. +* other-window-scroll-buffer: Vertical Scrolling. +* Outline mode: Substitution. +* output from processes: Output from Processes. +* output stream: Output Streams. +* outside margin: Annotation Basics. +* overflow: Integer Basics. +* overlay arrow: Overlay Arrow. +* overlay-arrow-position: Overlay Arrow. +* overlay-arrow-string: Overlay Arrow. +* overriding-local-map <1>: Standard Keymaps. +* overriding-local-map: Active Keymaps. +* overriding-terminal-local-map: Active Keymaps. +* overwrite-mode: Commands for Insertion. +* padding: Formatting Strings. +* page-delimiter: Standard Regexps. +* paired delimiter: Syntax Class Table. +* paragraph-separate: Standard Regexps. +* paragraph-start: Standard Regexps. +* parent of a keymap: Inheritance and Keymaps. +* parent process: Processes. +* parent, of extent: Extent Parents. +* parenthesis: Cons Cell Type. +* parenthesis depth: Parsing Expressions. +* parenthesis matching: Blinking. +* parenthesis syntax: Syntax Class Table. +* parse state: Parsing Expressions. +* parse-partial-sexp: Parsing Expressions. +* parse-sexp-ignore-comments: Parsing Expressions. +* parsing: Syntax Tables. +* partial files: Partial Files. +* passwd-echo: Reading a Password. +* passwd-invert-frame-when-keyboard-grabbed: Reading a Password. +* passwords, reading: Reading a Password. +* PATH environment variable: Subprocess Creation. +* path-separator: System Environment. +* pausing: Waiting. +* peeking at input: Peeking and Discarding. +* percent symbol in modeline: Modeline Data. +* perform-replace: Search and Replace. +* performance analysis: Coverage Testing. +* permanent local variable: Creating Buffer-Local. +* permission: File Attributes. +* pg-coding-system: libpq Lisp Variables. +* pg:authtype: libpq Lisp Variables. +* pg:client-encoding: libpq Lisp Variables. +* pg:cost-heap: libpq Lisp Variables. +* pg:cost-index: libpq Lisp Variables. +* pg:database: libpq Lisp Variables. +* pg:date-style: libpq Lisp Variables. +* pg:geqo: libpq Lisp Variables. +* pg:host: libpq Lisp Variables. +* pg:options: libpq Lisp Variables. +* pg:port: libpq Lisp Variables. +* pg:realm: libpq Lisp Variables. +* pg:tty: libpq Lisp Variables. +* pg:tz: libpq Lisp Variables. +* pg:user: libpq Lisp Variables. +* pgres::polling-active: libpq Lisp Symbols and DataTypes. +* pgres::polling-failed: libpq Lisp Symbols and DataTypes. +* pgres::polling-ok: libpq Lisp Symbols and DataTypes. +* pgres::polling-reading: libpq Lisp Symbols and DataTypes. +* pgres::polling-writing: libpq Lisp Symbols and DataTypes. +* pipes: Asynchronous Processes. +* play-sound: Beeping. +* play-sound-file: Beeping. +* plist: Property Lists. +* plist, symbol: Symbol Properties. +* plist-get: Working With Normal Plists. +* plist-member: Working With Normal Plists. +* plist-put: Working With Normal Plists. +* plist-remprop: Working With Normal Plists. +* plist-to-alist: Converting Plists To/From Alists. +* plists-eq <1>: Other Plists. +* plists-eq: Working With Normal Plists. +* plists-equal <1>: Other Plists. +* plists-equal: Working With Normal Plists. +* point: Point. +* point excursion: Excursions. +* point in window: Window Point. +* point with narrowing: Point. +* point-marker: Creating Markers. +* point-max: Point. +* point-max-marker: Creating Markers. +* point-min: Point. +* point-min-marker: Creating Markers. +* pointer (mouse): Mouse Pointer. +* pointer-glyph-p: Glyph Types. +* pointer-image-instance-p: Image Instance Types. +* pop-global-mark: The Mark. +* pop-mark: The Mark. +* pop-to-buffer: Displaying Buffers. +* pop-up menu: Pop-Up Menus. +* pop-up-frame-function: Choosing Window. +* pop-up-frame-plist: Choosing Window. +* pop-up-frames: Choosing Window. +* pop-up-windows: Choosing Window. +* popup-buffer-menu: Pop-Up Menus. +* popup-dialog-box: Dialog Box Functions. +* popup-menu: Pop-Up Menus. +* popup-menu-titles: Pop-Up Menus. +* popup-menu-up-p: Pop-Up Menus. +* popup-menubar-menu: Pop-Up Menus. +* popup-mode-menu: Pop-Up Menus. +* pos-visible-in-window-p: Window Start. +* position (in buffer): Positions. +* position argument: Interactive Codes. +* position in window: Window Point. +* position of frame: Size and Position. +* position of window: Position of Window. +* positive infinity: Float Basics. +* posix-looking-at: POSIX Regexps. +* posix-search-backward: POSIX Regexps. +* posix-search-forward: POSIX Regexps. +* posix-string-match: POSIX Regexps. +* post-command-hook: Command Overview. +* post-gc-hook: Garbage Collection. +* PostgreSQL: PostgreSQL Support. +* pq-binary-tuples: libpq Lisp Symbols and DataTypes. +* pq-clear: Other libpq Functions. +* pq-client-encoding: Other libpq Functions. +* pq-cmd-status: libpq Lisp Symbols and DataTypes. +* pq-cmd-tuples: libpq Lisp Symbols and DataTypes. +* pq-conn-defaults: Other libpq Functions. +* pq-connect-poll: Asynchronous Interface Functions. +* pq-connect-start: Asynchronous Interface Functions. +* pq-connectdb: Synchronous Interface Functions. +* pq-consume-input: Asynchronous Interface Functions. +* pq-env-2-encoding: Other libpq Functions. +* pq-exec: Synchronous Interface Functions. +* pq-finish: Other libpq Functions. +* pq-flush: Asynchronous Interface Functions. +* pq-fmod: libpq Lisp Symbols and DataTypes. +* pq-fname: libpq Lisp Symbols and DataTypes. +* pq-fnumber: libpq Lisp Symbols and DataTypes. +* pq-fsize: libpq Lisp Symbols and DataTypes. +* pq-ftype: libpq Lisp Symbols and DataTypes. +* pq-get-is-null: libpq Lisp Symbols and DataTypes. +* pq-get-length: libpq Lisp Symbols and DataTypes. +* pq-get-result: Asynchronous Interface Functions. +* pq-get-value: libpq Lisp Symbols and DataTypes. +* pq-is-busy: Asynchronous Interface Functions. +* pq-is-nonblocking: Asynchronous Interface Functions. +* pq-lo-close: Unimplemented libpq Functions. +* pq-lo-creat: Unimplemented libpq Functions. +* pq-lo-export: Large Object Support. +* pq-lo-import: Large Object Support. +* pq-lo-lseek: Unimplemented libpq Functions. +* pq-lo-open: Unimplemented libpq Functions. +* pq-lo-read: Unimplemented libpq Functions. +* pq-lo-tell: Unimplemented libpq Functions. +* pq-lo-unlink: Unimplemented libpq Functions. +* pq-lo-write: Unimplemented libpq Functions. +* pq-make-empty-pgresult: libpq Lisp Symbols and DataTypes. +* pq-nfields: libpq Lisp Symbols and DataTypes. +* pq-notifies: Synchronous Interface Functions. +* pq-ntuples: libpq Lisp Symbols and DataTypes. +* pq-oid-value: libpq Lisp Symbols and DataTypes. +* pq-pgconn: libpq Lisp Symbols and DataTypes. +* pq-res-status: libpq Lisp Symbols and DataTypes. +* pq-reset: Synchronous Interface Functions. +* pq-reset-cancel: Asynchronous Interface Functions. +* pq-reset-poll: Asynchronous Interface Functions. +* pq-reset-start: Asynchronous Interface Functions. +* pq-result-error-message: libpq Lisp Symbols and DataTypes. +* pq-result-status: libpq Lisp Symbols and DataTypes. +* pq-send-query: Asynchronous Interface Functions. +* pq-set-client-encoding: Other libpq Functions. +* pq-set-nonblocking: Asynchronous Interface Functions. +* PQdisplayTuples: Unimplemented libpq Functions. +* PQmblen: Unimplemented libpq Functions. +* PQprint: Unimplemented libpq Functions. +* PQprintTuples: Unimplemented libpq Functions. +* PQsetenv: Synchronous Interface Functions. +* PQsetenvAbort: Asynchronous Interface Functions. +* PQsetenvPoll: Asynchronous Interface Functions. +* PQsetenvStart: Asynchronous Interface Functions. +* PQsocket: Unimplemented libpq Functions. +* PQtrace: Unimplemented libpq Functions. +* PQuntrace: Unimplemented libpq Functions. +* pre-abbrev-expand-hook: Abbrev Expansion. +* pre-command-hook: Command Overview. +* pre-gc-hook: Garbage Collection. +* preceding-char: Near Point. +* precision of formatted numbers: Formatting Strings. +* predicates: Type Predicates. +* prefix argument: Prefix Command Arguments. +* prefix argument unreading: Peeking and Discarding. +* prefix command: Prefix Keys. +* prefix key: Prefix Keys. +* prefix-arg: Prefix Command Arguments. +* prefix-help-command: Help Functions. +* prefix-numeric-value: Prefix Command Arguments. +* preventing backtracking: Specification List. +* preventing prefix key: Key Lookup. +* previous complete subexpression: Parsing Expressions. +* previous-extent: Finding Extents. +* previous-frame: Finding All Frames. +* previous-history-element: Minibuffer Misc. +* previous-matching-history-element: Minibuffer Misc. +* previous-property-change: Property Search. +* previous-single-property-change: Property Search. +* previous-window: Cyclic Window Ordering. +* primitive: What Is a Function. +* primitive type: Lisp Data Types. +* primitive types: Primitive Types. +* primitive-undo: Undo. +* prin1: Output Functions. +* prin1-to-string: Output Functions. +* princ: Output Functions. +* print: Output Functions. +* print example: Output Streams. +* print name cell: Symbol Components. +* print-escape-newlines: Output Variables. +* print-gensym: Output Variables. +* print-help-return-message: Help Functions. +* print-length: Output Variables. +* print-level: Output Variables. +* print-readably <1>: Output Variables. +* print-readably: Printing in Edebug. +* print-string-length: Output Variables. +* printed representation: Printed Representation. +* printed representation for characters: Character Type. +* printing: Streams Intro. +* printing (Edebug): Printing in Edebug. +* printing circular structures: Printing in Edebug. +* printing floating-point numbers: Output Variables. +* printing limits: Output Variables. +* printing notation: Printing Notation. +* printing readably: Output Variables. +* printing uninterned symbols: Output Variables. +* priority of an extent: Intro to Extents. +* process: Processes. +* process filter: Filter Functions. +* process input: Input to Processes. +* process output: Output from Processes. +* process sentinel: Sentinels. +* process signals: Signals to Processes. +* process window size: Process Window Size. +* process-buffer: Process Buffers. +* process-command: Process Information. +* process-connection-type: Asynchronous Processes. +* process-environment: System Environment. +* process-event-p: Event Predicates. +* process-exit-status: Process Information. +* process-filter: Filter Functions. +* process-id: Process Information. +* process-kill-without-query: Deleting Processes. +* process-kill-without-query-p: Process Information. +* process-list: Process Information. +* process-mark: Process Buffers. +* process-name: Process Information. +* process-send-eof: Input to Processes. +* process-send-region: Input to Processes. +* process-send-signal: Signals to Processes. +* process-send-string: Input to Processes. +* process-sentinel: Sentinels. +* process-status: Process Information. +* process-tty-name: Process Information. +* processp: Processes. +* profile.el: Compilation Tips. +* profiling: Compilation Tips. +* prog1: Sequencing. +* prog2: Sequencing. +* progn: Sequencing. +* program arguments: Subprocess Creation. +* program directories: Subprocess Creation. +* programmed completion: Programmed Completion. +* programming types: Programming Types. +* properties of strings: String Properties. +* properties of text: Text Properties. +* property list: Property Lists. +* property list cell (symbol): Symbol Components. +* property list, symbol: Symbol Properties. +* property lists vs association lists: Plists and Alists. +* property of an extent: Extent Properties. +* protected forms: Cleanups. +* provide: Named Features. +* providing features: Named Features. +* PTYs: Asynchronous Processes. +* punctuation character: Syntax Class Table. +* pure storage: Pure Storage. +* pure-bytes-used: Pure Storage. +* purecopy: Pure Storage. +* purify-flag: Pure Storage. +* push-mark: The Mark. +* put: Object Plists. +* put-char-table: Working With Char Tables. +* put-database: Working With a Database. +* put-range-table: Working With Range Tables. +* put-text-property: Changing Properties. +* putf: Other Plists. +* puthash: Working With Hash Tables. +* query-replace-history: Minibuffer History. +* query-replace-map <1>: Standard Keymaps. +* query-replace-map: Search and Replace. +* querying the user: Yes-or-No Queries. +* question mark in character constant: Character Type. +* quietly-read-abbrev-file: Abbrev Files. +* quit-flag: Quitting. +* quit-process: Signals to Processes. +* quitting: Quitting. +* quitting from infinite loop: Infinite Loops. +* quote: Quoting. +* quote character: Parsing Expressions. +* quoted character input: Quoted Character Input. +* quoted-insert suppression: Changing Key Bindings. +* quoting: Quoting. +* quoting characters in printing: Output Functions. +* quoting using apostrophe: Quoting. +* raise-frame: Raising and Lowering. +* raising a frame: Raising and Lowering. +* random: Random Numbers. +* random numbers: Random Numbers. +* range table type: Range Table Type. +* Range Tables: Range Tables. +* range-table-p: Range Tables. +* rassoc: Association Lists. +* rassq: Association Lists. +* raw prefix argument: Prefix Command Arguments. +* raw prefix argument usage: Interactive Codes. +* re-search-backward: Regexp Search. +* re-search-forward: Regexp Search. +* read: Input Functions. +* read command name: Interactive Call. +* read syntax: Printed Representation. +* read syntax for characters: Character Type. +* read-buffer: High-Level Completion. +* read-char: Reading One Event. +* read-command: High-Level Completion. +* read-expression: Object from Minibuffer. +* read-expression-history: Minibuffer History. +* read-expression-map: Standard Keymaps. +* read-file-name: Reading File Names. +* read-from-minibuffer: Text from Minibuffer. +* read-from-string: Input Functions. +* read-key-sequence: Key Sequence Input. +* read-minibuffer: Object from Minibuffer. +* read-only buffer: Read Only Buffers. +* read-only buffers in interactive: Using Interactive. +* read-passwd: Reading a Password. +* read-quoted-char: Quoted Character Input. +* read-quoted-char quitting: Quitting. +* read-shell-command-map: Standard Keymaps. +* read-string: Text from Minibuffer. +* read-variable: High-Level Completion. +* reading: Streams Intro. +* reading (Edebug): Reading in Edebug. +* reading interactive arguments: Interactive Codes. +* reading symbols: Creating Symbols. +* rearrangement of lists: Rearrangement. +* rebinding: Changing Key Bindings. +* receiving ToolTalk messages: Receiving Messages. +* recent-auto-save-p: Auto-Saving. +* recent-keys: Recording Input. +* recent-keys-ring-size: Recording Input. +* recenter: Vertical Scrolling. +* record command history: Interactive Call. +* recursion: Iteration. +* recursion-depth: Recursive Editing. +* recursive command loop: Recursive Editing. +* recursive editing level: Recursive Editing. +* recursive evaluation: Intro Eval. +* recursive-edit: Recursive Editing. +* redo: Undo. +* redraw-display: Refresh Screen. +* redraw-frame: Refresh Screen. +* redraw-modeline: Modeline Format. +* refresh display: Refresh Screen. +* regexp: Regular Expressions. +* regexp alternative: Syntax of Regexps. +* regexp grouping: Syntax of Regexps. +* regexp searching: Regexp Search. +* regexp-history: Minibuffer History. +* regexp-quote: Syntax of Regexps. +* regexps used standardly in editing: Standard Regexps. +* region argument: Interactive Codes. +* region, the: The Region. +* region-active-p: The Region. +* region-beginning: The Region. +* region-end: The Region. +* region-exists-p: The Region. +* register-alist: Registers. +* register-ccl-program: Calling CCL. +* register-tooltalk-pattern: Elisp Interface for Receiving Messages. +* registers: Registers. +* regular expression: Regular Expressions. +* regular expression searching: Regexp Search. +* reindent-then-newline-and-indent: Mode-Specific Indent. +* relabel-menu-item: Modifying Menus. +* relative file name: Relative File Names. +* remainder: Arithmetic Operations. +* remassoc: Association Lists. +* remassq: Association Lists. +* remhash: Working With Hash Tables. +* remove-database: Working With a Database. +* remove-face-property: Face Properties. +* remove-glyph-property: Glyph Properties. +* remove-hook: Hooks. +* remove-range-table: Working With Range Tables. +* remove-specifier: Other Specification Functions. +* remove-text-properties: Changing Properties. +* remprop: Object Plists. +* remrassoc: Association Lists. +* remrassq: Association Lists. +* rename-auto-save-file: Auto-Saving. +* rename-buffer: Buffer Names. +* rename-file: Changing File Attributes. +* renaming files: Changing File Attributes. +* repeated loading: Repeated Loading. +* replace bindings: Changing Key Bindings. +* replace characters: Substitution. +* replace-buffer-in-windows: Displaying Buffers. +* replace-match: Replacing Match. +* replacement: Search and Replace. +* repositioning format arguments: Formatting Strings. +* require: Named Features. +* require-final-newline: Saving Buffers. +* requiring features: Named Features. +* reset-char-table: Working With Char Tables. +* resize redisplay: Size and Position. +* rest arguments: Argument List. +* restriction (in a buffer): Narrowing. +* resume (cf. no-redraw-on-reenter): Refresh Screen. +* return: Character Type. +* return-tooltalk-message: Elisp Interface for Sending Messages. +* reveal-annotation: Annotation Properties. +* reverse: Building Lists. +* reversing a list: Rearrangement. +* revert-buffer: Reverting. +* revert-buffer-function: Reverting. +* revert-buffer-insert-file-contents-function: Reverting. +* right-gutter: Specifying a Gutter. +* right-gutter-visible-p: Other Gutter Variables. +* right-gutter-width: Other Gutter Variables. +* right-margin-width: Margin Primitives. +* right-toolbar: Specifying the Toolbar. +* right-toolbar-visible-p: Other Toolbar Variables. +* right-toolbar-width: Other Toolbar Variables. +* rm: Changing File Attributes. +* round: Numeric Conversions. +* rounding in conversions: Numeric Conversions. +* rounding without conversion: Rounding Operations. +* rplaca: Modifying Lists. +* rplacd: Modifying Lists. +* run time stack: Internals of Debugger. +* run-emacs-from-temacs: Building XEmacs. +* run-hooks: Hooks. +* runnable temacs: Building XEmacs. +* same-window-buffer-names: Choosing Window. +* same-window-regexps: Choosing Window. +* save-abbrevs: Abbrev Files. +* save-buffer: Saving Buffers. +* save-current-buffer: Excursions. +* save-excursion: Excursions. +* save-excursion (Edebug): Edebug Display Update. +* save-match-data: Saving Match Data. +* save-restriction: Narrowing. +* save-selected-frame: Input Focus. +* save-selected-window <1>: Excursions. +* save-selected-window: Selecting Windows. +* save-some-buffers: Saving Buffers. +* save-window-excursion: Window Configurations. +* saving text properties: Saving Properties. +* saving window information: Window Configurations. +* scan-lists: Parsing Expressions. +* scan-sexps: Parsing Expressions. +* scope: Variable Scoping. +* screen layout: Window Configuration Type. +* scroll-conservatively: Vertical Scrolling. +* scroll-down: Vertical Scrolling. +* scroll-left: Horizontal Scrolling. +* scroll-other-window: Vertical Scrolling. +* scroll-right: Horizontal Scrolling. +* scroll-step: Vertical Scrolling. +* scroll-up: Vertical Scrolling. +* scrollbar-pointer-glyph: Mouse Pointer. +* scrollbars: Scrollbars. +* scrolling vertically: Vertical Scrolling. +* search-backward: String Search. +* search-failed: String Search. +* search-forward: String Search. +* searching: Searching and Matching. +* searching and case: Searching and Case. +* searching for regexp: Regexp Search. +* second: List Elements. +* select-console: The Selected Console and Device. +* select-device: The Selected Console and Device. +* select-frame: Input Focus. +* select-frame-hook: Frame Hooks. +* select-window: Selecting Windows. +* selected frame: Input Focus. +* selected window: Basic Windows. +* selected-console: The Selected Console and Device. +* selected-device: The Selected Console and Device. +* selected-frame: Input Focus. +* selected-window: Selecting Windows. +* selecting a buffer: Current Buffer. +* selecting windows: Selecting Windows. +* selection (for X windows): X Selections. +* selection-pointer-glyph: Mouse Pointer. +* selective display: Selective Display. +* selective-display: Selective Display. +* selective-display-ellipses: Selective Display. +* self-evaluating form: Self-Evaluating Forms. +* self-insert-and-exit: Minibuffer Misc. +* self-insert-command: Commands for Insertion. +* self-insert-command override: Changing Key Bindings. +* self-insert-command, minor modes: Keymaps and Minor Modes. +* self-insertion: Commands for Insertion. +* send-string-to-terminal: Terminal Output. +* send-tooltalk-message: Elisp Interface for Sending Messages. +* sending signals: Signals to Processes. +* sending ToolTalk messages: Sending Messages. +* sentence-end: Standard Regexps. +* sentinel: Sentinels. +* sequence: Sequences Arrays Vectors. +* sequence length: Sequence Functions. +* sequencep: Sequence Functions. +* set: Setting Variables. +* set-annotation-action: Annotation Properties. +* set-annotation-data: Annotation Properties. +* set-annotation-down-glyph: Annotation Properties. +* set-annotation-face: Annotation Properties. +* set-annotation-glyph: Annotation Properties. +* set-annotation-layout: Annotation Properties. +* set-annotation-menu: Annotation Properties. +* set-auto-mode: Auto Major Mode. +* set-buffer: Current Buffer. +* set-buffer-auto-saved: Auto-Saving. +* set-buffer-major-mode: Auto Major Mode. +* set-buffer-menubar: Menubar. +* set-buffer-modified-p: Buffer Modification. +* set-case-syntax: Case Tables. +* set-case-syntax-delims: Case Tables. +* set-case-syntax-pair: Case Tables. +* set-case-table: Case Tables. +* set-category-table: Category Tables. +* set-charset-ccl-program: Charset Property Functions. +* set-coding-category-system: Detection of Textual Encoding. +* set-coding-priority-list: Detection of Textual Encoding. +* set-console-type-image-conversion-list: Image Instantiator Conversion. +* set-default: Default Value. +* set-default-file-modes: Changing File Attributes. +* set-default-gutter-position: Specifying a Gutter. +* set-default-toolbar-position: Specifying the Toolbar. +* set-device-baud-rate <1>: Terminal Output. +* set-device-baud-rate: Console and Device I/O. +* set-extent-begin-glyph: Extent Properties. +* set-extent-begin-glyph-layout: Extent Properties. +* set-extent-end-glyph: Extent Properties. +* set-extent-end-glyph-layout: Extent Properties. +* set-extent-endpoints: Extent Endpoints. +* set-extent-face: Extent Properties. +* set-extent-initial-redisplay-function: Extent Properties. +* set-extent-keymap: Extent Properties. +* set-extent-mouse-face: Extent Properties. +* set-extent-parent: Extent Parents. +* set-extent-priority: Extent Properties. +* set-extent-properties: Extent Properties. +* set-extent-property: Extent Properties. +* set-face-background: Face Convenience Functions. +* set-face-background-pixmap: Face Convenience Functions. +* set-face-font: Face Convenience Functions. +* set-face-foreground: Face Convenience Functions. +* set-face-property: Face Properties. +* set-face-underline-p: Face Convenience Functions. +* set-file-modes: Changing File Attributes. +* set-frame-configuration: Frame Configurations. +* set-frame-pointer: Mouse Pointer. +* set-frame-position: Size and Position. +* set-frame-properties: Property Access. +* set-frame-property: Property Access. +* set-frame-size: Size and Position. +* set-glyph-baseline: Glyph Convenience Functions. +* set-glyph-contrib-p: Glyph Convenience Functions. +* set-glyph-face: Glyph Convenience Functions. +* set-glyph-image: Glyph Convenience Functions. +* set-glyph-property: Glyph Properties. +* set-input-mode: Input Modes. +* set-keymap-default-binding: Inheritance and Keymaps. +* set-keymap-name: Creating Keymaps. +* set-keymap-parents: Inheritance and Keymaps. +* set-keymap-prompt: Other Keymap Functions. +* set-left-margin: Margins. +* set-mark: The Mark. +* set-marker: Changing Markers. +* set-match-data: Entire Match Data. +* set-menubar: Menubar. +* set-menubar-dirty-flag: Menubar. +* set-process-buffer: Process Buffers. +* set-process-filter: Filter Functions. +* set-process-sentinel: Sentinels. +* set-process-window-size: Process Window Size. +* set-recent-keys-ring-size: Recording Input. +* set-register: Registers. +* set-right-margin: Margins. +* set-specifier: Adding Specifications. +* set-standard-case-table: Case Tables. +* set-syntax-table: Syntax Table Functions. +* set-text-properties: Changing Properties. +* set-tooltalk-message-attribute: Elisp Interface for Sending Messages. +* set-visited-file-modtime: Modification Time. +* set-visited-file-name: Buffer File Name. +* set-weak-list-list: Weak Lists. +* set-window-buffer: Buffers and Windows. +* set-window-buffer-dedicated: Choosing Window. +* set-window-configuration: Window Configurations. +* set-window-dedicated-p: Choosing Window. +* set-window-hscroll: Horizontal Scrolling. +* set-window-point: Window Point. +* set-window-start: Window Start. +* setcar: Setcar. +* setcdr: Setcdr. +* setenv: System Environment. +* setplist: Object Plists. +* setq: Setting Variables. +* setq-default: Default Value. +* sets: Sets And Lists. +* setting modes of files: Changing File Attributes. +* setting-constant: Constant Variables. +* seventh: List Elements. +* sexp motion: List Motion. +* shadowing of variables: Local Variables. +* shallow binding: Impl of Scope. +* shared-lisp-mode-map: Standard Keymaps. +* Shell mode modeline-format: Modeline Data. +* shell-command-history: Minibuffer History. +* shrink-window: Resizing Windows. +* shrink-window-horizontally: Resizing Windows. +* shrink-window-pixels: Resizing Windows. +* side effect: Intro Eval. +* signal: Signaling Errors. +* signal-error: Signaling Errors. +* signal-process: Signals to Processes. +* signaling errors: Signaling Errors. +* signals: Signals to Processes. +* sin: Math Functions. +* single-key-description: Describing Characters. +* sinh: Math Functions. +* sit-for: Waiting. +* site-init.el: Building XEmacs. +* site-load.el: Building XEmacs. +* site-run-file: Init File. +* site-start.el: Start-up Summary. +* sixth: List Elements. +* size of frame: Size and Position. +* size of window: Size of Window. +* skip-chars-backward: Skipping Characters. +* skip-chars-forward: Skipping Characters. +* skip-syntax-backward: Motion and Syntax. +* skip-syntax-forward: Motion and Syntax. +* skipping characters: Skipping Characters. +* skipping comments: Parsing Expressions. +* sleep-for: Waiting. +* Snarf-documentation: Accessing Documentation. +* sort: Rearrangement. +* sort-columns: Sorting. +* sort-fields: Sorting. +* sort-lines: Sorting. +* sort-numeric-fields: Sorting. +* sort-pages: Sorting. +* sort-paragraphs: Sorting. +* sort-regexp-fields: Sorting. +* sort-subr: Sorting. +* sorting lists: Rearrangement. +* sorting text: Sorting. +* sound: Beeping. +* sound-alist: Beeping. +* special: Major Mode Conventions. +* special form descriptions: A Sample Function Description. +* special form evaluation: Special Forms. +* special forms: Primitive Function Type. +* special forms (Edebug): Instrumenting. +* special forms for control structures: Control Structures. +* special-display-buffer-names: Choosing Window. +* special-display-frame-plist: Choosing Window. +* special-display-function: Choosing Window. +* special-display-popup-frame: Choosing Window. +* special-display-regexps: Choosing Window. +* specification (in a specifier): Specifiers In-Depth. +* specifier: Specifiers. +* specifier type: Specifier Type. +* specifier, domain: Specifiers In-Depth. +* specifier, fallback: Specifier Instancing. +* specifier, inst-list: Specifiers In-Depth. +* specifier, inst-pair: Specifiers In-Depth. +* specifier, instance: Specifiers In-Depth. +* specifier, instancing: Specifiers In-Depth. +* specifier, instantiator: Specifiers In-Depth. +* specifier, locale: Specifiers In-Depth. +* specifier, specification: Specifiers In-Depth. +* specifier, tag: Specifiers In-Depth. +* specifier, tag set: Specifiers In-Depth. +* specifier-fallback: Retrieving Specifications. +* specifier-instance: Specifier Instancing Functions. +* specifier-instance-from-inst-list: Specifier Instancing Functions. +* specifier-locale-type-from-locale: Other Specification Functions. +* specifier-spec-list: Retrieving Specifications. +* specifier-specs: Retrieving Specifications. +* specifier-tag-list: Specifier Tag Functions. +* specifier-tag-predicate: Specifier Tag Functions. +* specifier-type: Specifier Types. +* specifierp: Specifiers. +* speedups: Compilation Tips. +* splicing (with backquote): Backquote. +* split-height-threshold: Choosing Window. +* split-line: Commands for Insertion. +* split-path: Regexp Search. +* split-string: Regexp Search. +* split-window: Splitting Windows. +* split-window-horizontally: Splitting Windows. +* split-window-vertically: Splitting Windows. +* splitting windows: Splitting Windows. +* sqrt: Math Functions. +* stable sort: Rearrangement. +* standard regexps used in editing: Standard Regexps. +* standard-case-table: Case Tables. +* standard-category-table: Category Tables. +* standard-input: Input Functions. +* standard-output: Output Variables. +* standard-syntax-table: Standard Syntax Tables. +* standards of coding style: Tips. +* start up of XEmacs: Start-up Summary. +* start-process: Asynchronous Processes. +* start-process-shell-command: Asynchronous Processes. +* startup.el: Start-up Summary. +* stop points: Using Edebug. +* stop-process: Signals to Processes. +* stopping an infinite loop: Infinite Loops. +* stopping on events: Global Break Condition. +* store-match-data: Entire Match Data. +* stream (for printing): Output Streams. +* stream (for reading): Input Streams. +* string: Creating Strings. +* string equality: Text Comparison. +* string in keymap: Key Lookup. +* string input stream: Input Streams. +* string length: Sequence Functions. +* string length, maximum when printing: Output Variables. +* string properties: String Properties. +* string search: String Search. +* string to character: String Conversion. +* string to number: String Conversion. +* string to object: Input Functions. +* string, writing a doc string: Documentation Basics. +* string-equal: Text Comparison. +* string-lessp: Text Comparison. +* string-match: Regexp Search. +* string-modified-tick: Modifying Strings. +* string-to-char: String Conversion. +* string-to-int: String Conversion. +* string-to-number: String Conversion. +* string<: Text Comparison. +* string=: Text Comparison. +* stringp: Predicates for Strings. +* strings: Strings and Characters. +* strings, formatting them: Formatting Strings. +* strings, modifying: Modifying Strings. +* string quote: Syntax Class Table. +* subprocess: Processes. +* subr: What Is a Function. +* subrp: What Is a Function. +* subsidiary-coding-system: Basic Coding System Functions. +* subst-char-in-region: Substitution. +* substitute-command-keys: Keys in Documentation. +* substitute-in-file-name: File Name Expansion. +* substitute-key-definition: Changing Key Bindings. +* substituting keys in documentation: Keys in Documentation. +* substring: Creating Strings. +* subwindow type: Subwindow Type. +* subwindow-image-instance-p: Image Instance Types. +* subwindowp: Subwindows. +* suppress-keymap: Changing Key Bindings. +* suspend (cf. no-redraw-on-reenter): Refresh Screen. +* suspend evaluation: Recursive Editing. +* suspend-emacs: Suspending XEmacs. +* suspend-hook: Suspending XEmacs. +* suspend-resume-hook: Suspending XEmacs. +* suspending XEmacs: Suspending XEmacs. +* switch-to-buffer: Displaying Buffers. +* switch-to-buffer-other-window: Displaying Buffers. +* switches on command line: Command Line Arguments. +* switching to a buffer: Displaying Buffers. +* symbol: Symbols. +* symbol components: Symbol Components. +* symbol equality: Creating Symbols. +* symbol evaluation: Symbol Forms. +* symbol function indirection: Function Indirection. +* symbol in keymap: Key Lookup. +* symbol name hashing: Creating Symbols. +* symbol-function: Function Cells. +* symbol-name: Creating Symbols. +* symbol-plist: Object Plists. +* symbol-value: Accessing Variables. +* symbolp: Symbols. +* symbol constituent: Syntax Class Table. +* synchronous subprocess: Synchronous Processes. +* syntax classes: Syntax Descriptors. +* syntax descriptor: Syntax Descriptors. +* syntax error (Edebug): Backtracking. +* syntax flags: Syntax Flags. +* syntax for characters: Character Type. +* syntax table: Syntax Tables. +* syntax table example: Example Major Modes. +* syntax table internals: Syntax Table Internals. +* syntax tables in modes: Major Mode Conventions. +* syntax-table: Syntax Table Functions. +* syntax-table-p: Syntax Basics. +* system-configuration: System Environment. +* system-name: System Environment. +* system-type: System Environment. +* t: Constant Variables. +* t and truth: nil and t. +* t input stream: Input Streams. +* t output stream: Output Streams. +* tab: Character Type. +* tab deletion: Deletion. +* tab-stop-list: Indent Tabs. +* tab-to-tab-stop: Indent Tabs. +* tab-width: Usual Display. +* tabs stops for indentation: Indent Tabs. +* tag (in a specifier): Specifiers In-Depth. +* tag on run time stack: Catch and Throw. +* tag set (in a specifier): Specifiers In-Depth. +* tan: Math Functions. +* tanh: Math Functions. +* TCP: Network. +* temacs: Building XEmacs. +* temp-buffer-show-function: Temporary Displays. +* temp-directory: Unique File Names. +* tenth: List Elements. +* TERM environment variable: Terminal-Specific. +* term-file-prefix: Terminal-Specific. +* term-setup-hook: Terminal-Specific. +* Termcap: Terminal-Specific. +* terminal frame <1>: Frames. +* terminal frame: Basic Windows. +* terminal input: Terminal Input. +* terminal input modes: Input Modes. +* terminal output: Terminal Output. +* terminal-device: Console Types and Device Classes. +* terminal-specific initialization: Terminal-Specific. +* terminate keyboard macro: Peeking and Discarding. +* termscript file: Terminal Output. +* terpri: Output Functions. +* testing types: Type Predicates. +* text: Text. +* text files and binary files: Files and MS-DOS. +* text insertion: Insertion. +* text parsing: Syntax Tables. +* text properties: Text Properties. +* text properties in files: Saving Properties. +* text-char-description: Describing Characters. +* text-image-instance-p: Image Instance Types. +* text-mode-abbrev-table: Standard Abbrev Tables. +* text-mode-map: Standard Keymaps. +* text-mode-syntax-table: Standard Syntax Tables. +* text-pointer-glyph: Mouse Pointer. +* text-properties-at: Examining Properties. +* text-property-any: Property Search. +* text-property-not-all: Property Search. +* third: List Elements. +* this-command: Command Loop Info. +* this-command-keys: Command Loop Info. +* throw: Catch and Throw. +* throw example: Recursive Editing. +* tiled windows: Basic Windows. +* timeout-event-p: Event Predicates. +* timing programs: Compilation Tips. +* tips: Tips. +* toggle-read-only: Read Only Buffers. +* toolbar: Toolbar. +* toolbar button type: Toolbar Button Type. +* toolbar-buttons-captioned-p: Other Toolbar Variables. +* toolbar-make-button-list: Toolbar Descriptor Format. +* toolbar-map <1>: Standard Keymaps. +* toolbar-map: Active Keymaps. +* toolbar-pointer-glyph: Mouse Pointer. +* toolbar-specifier-p <1>: Specifier Types. +* toolbar-specifier-p: Specifying the Toolbar. +* ToolTalk: ToolTalk Support. +* ToolTalk message: Sending Messages. +* ToolTalk pattern: Receiving Messages. +* top-gutter: Specifying a Gutter. +* top-gutter-height: Other Gutter Variables. +* top-gutter-visible-p: Other Gutter Variables. +* top-level: Recursive Editing. +* top-level form: Loading. +* top-toolbar: Specifying the Toolbar. +* top-toolbar-height: Other Toolbar Variables. +* top-toolbar-visible-p: Other Toolbar Variables. +* tq-close: Transaction Queues. +* tq-create: Transaction Queues. +* tq-enqueue: Transaction Queues. +* tracing: Tracing. +* transaction queue: Transaction Queues. +* transcendental functions: Math Functions. +* translate-region: Substitution. +* translating input events: Translating Input. +* transpose-regions: Transposition. +* true: nil and t. +* truename (of file): Truenames. +* truncate: Numeric Conversions. +* truncate-lines: Truncation. +* truncate-partial-width-windows: Truncation. +* truncation-glyph: Redisplay Glyphs. +* truth value: nil and t. +* try-completion: Basic Completion. +* two's complement: Integer Basics. +* type: Lisp Data Types. +* type checking: Type Predicates. +* type predicates: Type Predicates. +* type-of: Type Predicates. +* unbinding keys: Key Binding Commands. +* undefined: Functions for Key Lookup. +* undefined in keymap: Key Lookup. +* undefined key: Keymap Terminology. +* undo avoidance: Substitution. +* undo-boundary: Undo. +* undo-limit: Maintaining Undo. +* undo-strong-limit: Maintaining Undo. +* unexec: Building XEmacs. +* unhandled-file-name-directory: Magic File Names. +* unintern: Creating Symbols. +* uninterned symbol: Creating Symbols. +* uninterned symbols, printing: Output Variables. +* unique extents: Duplicable Extents. +* universal-argument: Prefix Command Arguments. +* unload-feature: Unloading. +* unloading: Unloading. +* unlock-buffer: File Locks. +* unmap-frame-hook: Frame Hooks. +* unread-command-event: Peeking and Discarding. +* unread-command-events: Peeking and Discarding. +* unreading: Input Streams. +* unregister-tooltalk-pattern: Elisp Interface for Receiving Messages. +* unwind-protect: Cleanups. +* unwinding: Cleanups. +* up-list: List Motion. +* upcase: Character Case. +* upcase-region: Case Changes. +* upcase-word: Case Changes. +* update display: Refresh Screen. +* update-directory-autoloads: Autoload. +* update-file-autoloads: Autoload. +* upper case: Character Case. +* upper case key sequence: Key Sequence Input. +* use-global-map: Active Keymaps. +* use-hard-newlines: Filling. +* use-left-overflow: Margin Primitives. +* use-local-map: Active Keymaps. +* use-right-overflow: Margin Primitives. +* user name completion subroutines: User Name Completion. +* user option: Defining Variables. +* user-defined error: Error Symbols. +* user-full-name: User Identification. +* user-home-directory: User Identification. +* user-login-name: User Identification. +* user-mail-address: User Identification. +* user-name-all-completions: User Name Completion. +* user-name-completion: User Name Completion. +* user-name-completion-1: User Name Completion. +* user-real-login-name: User Identification. +* user-real-uid: User Identification. +* user-uid: User Identification. +* user-variable-p: Defining Variables. +* user-variable-p example: High-Level Completion. +* valid-char-table-type-p: Char Table Types. +* valid-char-table-value-p: Working With Char Tables. +* valid-device-class-p: Console Types and Device Classes. +* valid-device-type-p: Console Types and Device Classes. +* valid-glyph-type-p: Glyph Types. +* valid-image-instance-type-p: Image Instance Types. +* valid-image-instantiator-format-p: Image Specifiers. +* valid-inst-list-p: Specifier Validation Functions. +* valid-instantiator-p: Specifier Validation Functions. +* valid-plist-p: Property Lists. +* valid-spec-list-p: Specifier Validation Functions. +* valid-specifier-domain-p: Specifier Validation Functions. +* valid-specifier-locale-p: Specifier Validation Functions. +* valid-specifier-locale-type-p: Specifier Validation Functions. +* valid-specifier-tag-p <1>: Specifier Validation Functions. +* valid-specifier-tag-p: Specifier Tag Functions. +* valid-specifier-tag-set-p: Specifier Tag Functions. +* valid-specifier-type-p: Specifier Validation Functions. +* value cell: Symbol Components. +* value of expression: Evaluation. +* values: Eval. +* variable: Variables. +* variable aliases: Variable Aliases. +* variable definition: Defining Variables. +* variable descriptions: A Sample Variable Description. +* variable limit error: Local Variables. +* variable-alias: Variable Aliases. +* variable-documentation: Documentation Basics. +* variable-obsoleteness-doc: Obsoleteness. +* variables, buffer-local: Buffer-Local Variables. +* variables, indirect: Variable Aliases. +* vc-mode: Modeline Variables. +* vconcat: Vector Functions. +* vector <1>: Vector Functions. +* vector: Vectors. +* vector evaluation: Self-Evaluating Forms. +* vector length: Sequence Functions. +* vectorp: Vector Functions. +* verify-visited-file-modtime: Modification Time. +* version number (in file name): File Name Components. +* version-control: Numbered Backups. +* vertical scrolling: Vertical Scrolling. +* vertical tab: Character Type. +* vertical-motion: Screen Lines. +* vertical-motion-pixels: Screen Lines. +* view-file: Visiting Functions. +* view-mode-map: Standard Keymaps. +* view-register: Registers. +* visible frame: Visibility of Frames. +* visible-bell: Beeping. +* visible-frame-list: Finding All Frames. +* visited file: Buffer File Name. +* visited file mode: Auto Major Mode. +* visited-file-modtime: Modification Time. +* visiting files: Visiting Files. +* void function: Function Indirection. +* void function cell: Function Cells. +* void variable: Void Variables. +* void-function: Function Cells. +* void-variable: Void Variables. +* waiting: Waiting. +* waiting for command key input: Peeking and Discarding. +* waiting-for-user-input-p: Sentinels. +* wakeup: Subprocess Creation. +* walk-windows: Cyclic Window Ordering. +* weak hash table: Weak Hash Tables. +* weak list: Weak Lists. +* weak list type: Weak List Type. +* weak-list-list: Weak Lists. +* weak-list-p: Weak Lists. +* weak-list-type: Weak Lists. +* where-is-internal: Scanning Keymaps. +* while: Iteration. +* whitespace: Character Type. +* whitespace character: Syntax Class Table. +* widen: Narrowing. +* widening: Narrowing. +* widget-image-instance-p: Image Instance Types. +* window: Basic Windows. +* window configuration (Edebug): Edebug Display Update. +* window configurations: Window Configurations. +* window excursions: Excursions. +* window ordering, cyclic: Cyclic Window Ordering. +* window point: Window Point. +* window position <1>: Position of Window. +* window position: Window Point. +* window resizing: Resizing Windows. +* window size: Size of Window. +* window size, changing: Resizing Windows. +* window splitting: Splitting Windows. +* window system types: Window-System Types. +* window top line: Window Start. +* window-buffer: Buffers and Windows. +* window-configuration-p: Window Configurations. +* window-dedicated-p: Choosing Window. +* window-displayed-text-pixel-height: Size of Window. +* window-end: Window Start. +* window-frame: Frames and Windows. +* window-height: Size of Window. +* window-highest-p: Position of Window. +* window-hscroll: Horizontal Scrolling. +* window-left-margin-pixel-width: Margin Primitives. +* window-live-p: Deleting Windows. +* window-lowest-p: Position of Window. +* window-min-height: Resizing Windows. +* window-min-width: Resizing Windows. +* window-minibuffer-p: Minibuffer Misc. +* window-pixel-edges: Position of Window. +* window-pixel-height: Size of Window. +* window-pixel-width: Size of Window. +* window-point: Window Point. +* window-right-margin-pixel-width: Margin Primitives. +* window-setup-hook: Terminal-Specific. +* window-size-change-functions: Resizing Windows. +* window-start: Window Start. +* window-system objects: Faces and Window-System Objects. +* window-text-area-pixel-edges: Position of Window. +* window-text-area-pixel-height: Size of Window. +* window-text-area-pixel-width: Size of Window. +* window-width: Size of Window. +* windowp: Basic Windows. +* windows, controlling precisely: Buffers and Windows. +* with-current-buffer: Excursions. +* with-output-to-temp-buffer: Temporary Displays. +* with-selected-frame: Input Focus. +* with-temp-file: Excursions. +* word search: String Search. +* word-search-backward: String Search. +* word-search-forward: String Search. +* words-include-escapes: Word Motion. +* word constituent: Syntax Class Table. +* write-abbrev-file: Abbrev Files. +* write-char: Output Functions. +* write-contents-hooks: Saving Buffers. +* write-file: Saving Buffers. +* write-file-hooks: Saving Buffers. +* write-region: Writing to Files. +* write-region-annotate-functions: Saving Properties. +* writing a documentation string: Documentation Basics. +* wrong-number-of-arguments: Argument List. +* wrong-type-argument: Type Predicates. +* X: X-Windows. +* X resource type: X Resource Type. +* X window frame: Frames. +* x-allow-sendevents: X Miscellaneous. +* x-bitmap-file-path <1>: X Miscellaneous. +* x-bitmap-file-path: Image Specifiers. +* x-debug-events: X Miscellaneous. +* x-debug-mode: X Miscellaneous. +* x-disown-selection: X Selections. +* x-display-visual-class: Server Data. +* x-emacs-application-class: Resources. +* x-find-larger-font: Font Instance Size. +* x-find-smaller-font: Font Instance Size. +* x-font-size: Font Instance Size. +* x-get-cutbuffer: X Selections. +* x-get-resource: Resources. +* x-get-selection: X Selections. +* x-grab-keyboard: Grabs. +* x-grab-pointer: Grabs. +* x-library-search-path: X Miscellaneous. +* x-make-font-bold: Font Instance Characteristics. +* x-make-font-bold-italic: Font Instance Characteristics. +* x-make-font-italic: Font Instance Characteristics. +* x-make-font-unbold: Font Instance Characteristics. +* x-make-font-unitalic: Font Instance Characteristics. +* x-own-selection: X Selections. +* x-put-resource: Resources. +* x-server-vendor: Server Data. +* x-server-version: Server Data. +* x-set-frame-icon-pixmap: Frame Titles. +* x-store-cutbuffer: X Selections. +* x-ungrab-keyboard: Grabs. +* x-ungrab-pointer: Grabs. +* x-valid-keysym-name-p: X Miscellaneous. +* x-window-id: X Miscellaneous. +* X-Windows: X-Windows. +* XEmacs event standard notation: Describing Characters. +* xpm-color-symbols: Image Specifiers. +* y-or-n-p: Yes-or-No Queries. +* y-or-n-p-maybe-dialog-box: Yes-or-No Queries. +* yank: Yank Commands. +* yank suppression: Changing Key Bindings. +* yank-pop: Yank Commands. +* yes-or-no questions: Yes-or-No Queries. +* yes-or-no-p: Yes-or-No Queries. +* yes-or-no-p-dialog-box: Yes-or-No Queries. +* yes-or-no-p-maybe-dialog-box: Yes-or-No Queries. +* zero-length extent: Extent Endpoints. +* zerop: Predicates on Numbers. +* zmacs-activate-region: The Region. +* zmacs-activate-region-hook: The Region. +* zmacs-deactivate-region: The Region. +* zmacs-deactivate-region-hook: The Region. +* zmacs-region-stays: The Region. +* zmacs-regions: The Region. +* zmacs-update-region: The Region. +* zmacs-update-region-hook: The Region. +* | in regexp: Syntax of Regexps. + + diff --git a/info/lispref.info-5 b/info/lispref.info-5 index 95a8a55..cadf18b 100644 --- a/info/lispref.info-5 +++ b/info/lispref.info-5 @@ -1,5 +1,5 @@ -This is ../info/lispref.info, produced by makeinfo version 4.0 from -lispref/lispref.texi. +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -62,7 +62,7 @@ integers; whether an integer was intended as a character or not is determined only by how it is used. *Note Character Type::. The length of a string (like any array) is fixed and independent of -the string contents, and cannot be altered. Strings in Lisp are _not_ +the string contents, and cannot be altered. Strings in Lisp are *not* terminated by a distinguished character code. (By contrast, strings in C are terminated by a character with ASCII code 0.) This means that any character, including the null character (ASCII code 0), is a valid @@ -71,22 +71,22 @@ element of a string. Since strings are considered arrays, you can operate on them with the general array functions. (*Note Sequences Arrays Vectors::.) For example, you can access or change individual characters in a string -using the functions `aref' and `aset' (*note Array Functions::). +using the functions `aref' and `aset' (*note Array Functions::.). Strings use an efficient representation for storing the characters in them, and thus take up much less memory than a vector of the same length. Sometimes you will see strings used to hold key sequences. This -exists for backward compatibility with Emacs 18, but should _not_ be +exists for backward compatibility with Emacs 18, but should *not* be used in new code, since many key chords can't be represented at all and others (in particular meta key chords) are confused with accented characters. Strings are useful for holding regular expressions. You can also -match regular expressions against strings (*note Regexp Search::). The -functions `match-string' (*note Simple Match Data::) and -`replace-match' (*note Replacing Match::) are useful for decomposing +match regular expressions against strings (*note Regexp Search::.). The +functions `match-string' (*note Simple Match Data::.) and +`replace-match' (*note Replacing Match::.) are useful for decomposing and modifying strings based on regular expression matching. Like a buffer, a string can contain extents in it. These extents are @@ -108,10 +108,10 @@ The Predicates for Strings For more information about general sequence and array predicates, see *Note Sequences Arrays Vectors::, and *Note Arrays::. - - Function: stringp object + - Function: stringp OBJECT This function returns `t' if OBJECT is a string, `nil' otherwise. - - Function: char-or-string-p object + - Function: char-or-string-p OBJECT This function returns `t' if OBJECT is a string or a character, `nil' otherwise. @@ -129,7 +129,7 @@ Creating Strings The following functions create strings, either from scratch, or by putting strings together, or by taking them apart. - - Function: string &rest characters + - Function: string &rest CHARACTERS This function returns a new string made up of CHARACTERS. (string ?X ?E ?m ?a ?c ?s) @@ -138,14 +138,13 @@ putting strings together, or by taking them apart. => "" Analogous functions operating on other data types include `list', - `cons' (*note Building Lists::), `vector' (*note Vectors::) and - `bit-vector' (*note Bit Vectors::). This function has not been + `cons' (*note Building Lists::.), `vector' (*note Vectors::.) and + `bit-vector' (*note Bit Vectors::.). This function has not been available in XEmacs prior to 21.0 and FSF Emacs prior to 20.3. - - Function: make-string length character - This function returns a new string consisting entirely of LENGTH - successive copies of CHARACTER. LENGTH must be a non-negative - integer. + - Function: make-string COUNT CHARACTER + This function returns a string made up of COUNT repetitions of + CHARACTER. If COUNT is negative, an error is signaled. (make-string 5 ?x) => "xxxxx" @@ -153,10 +152,10 @@ putting strings together, or by taking them apart. => "" Other functions to compare with this one include `char-to-string' - (*note String Conversion::), `make-vector' (*note Vectors::), and - `make-list' (*note Building Lists::). + (*note String Conversion::.), `make-vector' (*note Vectors::.), and + `make-list' (*note Building Lists::.). - - Function: substring string start &optional end + - Function: substring STRING START &optional END This function returns a new string which consists of those characters from STRING in the range from (and including) the character at the index START up to (but excluding) the character @@ -196,7 +195,7 @@ putting strings together, or by taking them apart. => "abcdefg" But we recommend `copy-sequence' for this purpose (*note Sequence - Functions::). + Functions::.). If the characters copied from STRING have duplicable extents or text properties, those are copied into the new string also. *Note @@ -208,11 +207,11 @@ putting strings together, or by taking them apart. either integer is out of range for STRING. Contrast this function with `buffer-substring' (*note Buffer - Contents::), which returns a string containing a portion of the + Contents::.), which returns a string containing a portion of the text in the current buffer. The beginning of a string is at index 0, but the beginning of a buffer is at index 1. - - Function: concat &rest sequences + - Function: concat &rest SEQUENCES This function returns a new string consisting of the characters in the arguments passed to it (along with their text properties, if any). The arguments may be strings, lists of numbers, or vectors @@ -243,8 +242,8 @@ putting strings together, or by taking them apart. representation of the integer. *Don't use this feature; we plan to eliminate it. If you already use this feature, change your programs now!* The proper way to convert an integer to a decimal - number in this way is with `format' (*note Formatting Strings::) or - `number-to-string' (*note String Conversion::). + number in this way is with `format' (*note Formatting Strings::.) + or `number-to-string' (*note String Conversion::.). (concat 137) => "137" @@ -262,7 +261,7 @@ File: lispref.info, Node: Predicates for Characters, Next: Character Codes, P The Predicates for Characters ============================= - - Function: characterp object + - Function: characterp OBJECT This function returns `t' if OBJECT is a character. Some functions that work on integers (e.g. the comparison functions @@ -276,7 +275,7 @@ The Predicates for Characters in the future; therefore, do not rely on them. Instead, convert the characters explicitly using `char-int'. - - Function: integer-or-char-p object + - Function: integer-or-char-p OBJECT This function returns `t' if OBJECT is an integer or character.  @@ -285,7 +284,7 @@ File: lispref.info, Node: Character Codes, Next: Text Comparison, Prev: Predi Character Codes =============== - - Function: char-int character + - Function: char-int CH This function converts a character into an equivalent integer. The resulting integer will always be non-negative. The integers in the range 0 - 255 map to characters as follows: @@ -308,17 +307,17 @@ Character Codes XEmacs, the order in which character sets were loaded, etc., and you should not depend on them. - - Function: int-char integer + - Function: int-char INTEGER This function converts an integer into the equivalent character. Not all integers correspond to valid characters; use `char-int-p' to determine whether this is the case. If the integer cannot be converted, `nil' is returned. - - Function: char-int-p object + - Function: char-int-p OBJECT This function returns `t' if OBJECT is an integer that can be converted into a character. - - Function: char-or-char-int-p object + - Function: char-or-char-int-p OBJECT This function returns `t' if OBJECT is a character or an integer that can be converted into one. @@ -328,11 +327,10 @@ File: lispref.info, Node: Text Comparison, Next: String Conversion, Prev: Cha Comparison of Characters and Strings ==================================== - - Function: char-equal character1 character2 &optional buffer + - Function: char-equal CHARACTER1 CHARACTER2 This function returns `t' if the arguments represent the same character, `nil' otherwise. This function ignores differences in - case if the value of `case-fold-search' is non-`nil' in BUFFER, - which defaults to the current buffer. + case if `case-fold-search' is non-`nil'. (char-equal ?x ?x) => t @@ -343,7 +341,7 @@ Comparison of Characters and Strings (char-equal ?x ?X)) => nil - - Function: char= character1 character2 + - Function: char= CHARACTER1 CHARACTER2 This function returns `t' if the arguments represent the same character, `nil' otherwise. Case is significant. @@ -358,7 +356,7 @@ Comparison of Characters and Strings (char-equal ?x ?X)) => nil - - Function: string= string1 string2 + - Function: string= STRING1 STRING2 This function returns `t' if the characters of the two strings match exactly; case is significant. @@ -370,10 +368,10 @@ Comparison of Characters and Strings => nil - - Function: string-equal string1 string2 + - Function: string-equal STRING1 STRING2 `string-equal' is another name for `string='. - - Function: string< string1 string2 + - Function: string< STRING1 STRING2 This function compares two strings a character at a time. First it scans both the strings at once to find the first pair of corresponding characters that do not match. If the lesser @@ -412,7 +410,7 @@ Comparison of Characters and Strings (string< "" "") => nil - - Function: string-lessp string1 string2 + - Function: string-lessp STRING1 STRING2 `string-lessp' is another name for `string<'. See also `compare-buffer-substrings' in *Note Comparing Text::, for @@ -428,8 +426,8 @@ Conversion of Characters and Strings This section describes functions for conversions between characters, strings and integers. `format' and `prin1-to-string' (*note Output -Functions::) can also convert Lisp objects into strings. -`read-from-string' (*note Input Functions::) can "convert" a string +Functions::.) can also convert Lisp objects into strings. +`read-from-string' (*note Input Functions::.) can "convert" a string representation of a Lisp object into an object. *Note Documentation::, for functions that produce textual @@ -437,7 +435,7 @@ descriptions of text characters and general input events (`single-key-description' and `text-char-description'). These functions are used primarily for making help messages. - - Function: char-to-string character + - Function: char-to-string CHARACTER This function returns a new string with a length of one character. The value of CHARACTER, modulo 256, is used to initialize the element of the string. @@ -454,7 +452,7 @@ functions are used primarily for making help messages. (make-string 1 ?x) => "x" - - Function: string-to-char string + - Function: string-to-char STRING This function returns the first character in STRING. If the string is empty, the function returns 0. (Under XEmacs 19, the value is also 0 when the first character of STRING is the null @@ -475,7 +473,7 @@ functions are used primarily for making help messages. This function may be eliminated in the future if it does not seem useful enough to retain. - - Function: number-to-string number + - Function: number-to-string NUMBER This function returns a string consisting of the printed representation of NUMBER, which may be an integer or a floating point number. The value starts with a sign if the argument is @@ -492,13 +490,13 @@ functions are used primarily for making help messages. See also the function `format' in *Note Formatting Strings::. - - Function: string-to-number string &optional base - This function returns the numeric value represented by STRING, - read in BASE. It skips spaces and tabs at the beginning of - STRING, then reads as much of STRING as it can interpret as a + - Function: string-to-number STRING &optional BASE + This function returns the numeric value of the characters in + STRING, read in BASE. It skips spaces and tabs at the beginning + of STRING, then reads as much of STRING as it can interpret as a number. (On some systems it ignores other whitespace at the - beginning, not just spaces and tabs.) If the first character - after the ignored whitespace is not a digit or a minus sign, this + beginning, not just spaces and tabs.) If the first character after + the ignored whitespace is not a digit or a minus sign, this function returns 0. If BASE is not specified, it defaults to ten. With BASE other @@ -532,7 +530,7 @@ character. string is created) and is incremented each time a change is made to that string. - - Function: string-modified-tick string + - Function: string-modified-tick STRING This function returns the tick counter for `string'.  @@ -541,14 +539,14 @@ File: lispref.info, Node: String Properties, Next: Formatting Strings, Prev: String Properties ================= - 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 "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 `put'. To retrieve a property from a string, use `get'. You can also use `remprop' to remove a -property from a string and `object-plist' to retrieve a list of all the +property from a string and `object-props' to retrieve a list of all the properties in a string.  @@ -567,7 +565,7 @@ In fact, the functions `message' and `error' provide the same formatting feature described here; they differ from `format' only in how they use the result of formatting. - - Function: format string &rest objects + - Function: format STRING &rest OBJECTS This function returns a new string that is made by copying STRING and then replacing any format specification in the copy with encodings of the corresponding OBJECTS. The arguments OBJECTS are @@ -749,11 +747,11 @@ truncated. In the third case, the padding is on the right. (format "The word `%7s' actually has %d letters in it." "foo" (length "foo")) => "The word ` foo' actually has 3 letters in it." - + (format "The word `%7s' actually has %d letters in it." "specification" (length "specification")) => "The word `specification' actually has 13 letters in it." - + (format "The word `%-7s' actually has %d letters in it." "foo" (length "foo")) => "The word `foo ' actually has 3 letters in it." @@ -795,7 +793,7 @@ that are passed to them as arguments. The examples below use the characters `X' and `x' which have ASCII codes 88 and 120 respectively. - - Function: downcase string-or-char &optional buffer + - Function: downcase STRING-OR-CHAR This function converts a character or a string to lower case. When the argument to `downcase' is a string, the function creates @@ -806,9 +804,6 @@ codes 88 and 120 respectively. XEmacs 19.) If the original character is lower case, or is not a letter, then the value equals the original character. - Optional second arg BUFFER specifies which buffer's case tables to - use, and defaults to the current buffer. - (downcase "The cat in the hat") => "the cat in the hat" @@ -816,7 +811,7 @@ codes 88 and 120 respectively. => ?x ;; Under XEmacs 20. => 120 ;; Under XEmacs 19. - - Function: upcase string-or-char &optional buffer + - Function: upcase STRING-OR-CHAR This function converts a character or a string to upper case. When the argument to `upcase' is a string, the function creates @@ -829,9 +824,6 @@ codes 88 and 120 respectively. case, or is not a letter, then the value equals the original character. - Optional second arg BUFFER specifies which buffer's case tables to - use, and defaults to the current buffer. - (upcase "The cat in the hat") => "THE CAT IN THE HAT" @@ -839,7 +831,7 @@ codes 88 and 120 respectively. => ?X ;; Under XEmacs 20. => 88 ;; Under XEmacs 19. - - Function: capitalize string-or-char &optional buffer + - Function: capitalize STRING-OR-CHAR This function capitalizes strings or characters. If STRING-OR-CHAR is a string, the function creates and returns a new string, whose contents are a copy of STRING-OR-CHAR in which each @@ -849,14 +841,11 @@ codes 88 and 120 respectively. The definition of a word is any sequence of consecutive characters that are assigned to the word constituent syntax class in the - current syntax table (*note Syntax Class Table::). + current syntax table (*note Syntax Class Table::.). When the argument to `capitalize' is a character, `capitalize' has the same result as `upcase'. - Optional second arg BUFFER specifies which buffer's case tables to - use, and defaults to the current buffer. - (capitalize "The cat in the hat") => "The Cat In The Hat" @@ -877,8 +866,8 @@ The Case Table table". A case table specifies the mapping between upper case and lower 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 (*note Case Changes::). You need a case table if you are using a -language which has letters other than the standard ASCII letters. +buffer (*note Case Changes::.). You need a case table if you are using +a language which has letters other than the standard ASCII letters. A case table is a list of this form: @@ -918,22 +907,21 @@ Changing the standard case table doesn't affect any existing buffers. Here are the functions for working with case tables: - - Function: case-table-p object + - Function: case-table-p OBJECT This predicate returns non-`nil' if OBJECT is a valid case table. - - Function: set-standard-case-table case-table - This function makes CASE-TABLE the standard case table, so that it - will apply to any buffers created subsequently. + - Function: set-standard-case-table TABLE + This function makes TABLE the standard case table, so that it will + apply to any buffers created subsequently. - Function: standard-case-table This returns the standard case table. - - Function: current-case-table &optional buffer - This function returns the case table of BUFFER, which defaults to - the current buffer. + - Function: current-case-table + This function returns the current buffer's case table. - - Function: set-case-table case-table - This sets the current buffer's case table to CASE-TABLE. + - Function: set-case-table TABLE + This sets the current buffer's case table to TABLE. The following three functions are convenient subroutines for packages that define non-ASCII character sets. They modify a string @@ -941,15 +929,15 @@ DOWNCASE-TABLE provided as an argument; this should be a string to be used as the DOWNCASE part of a case table. They also modify the standard syntax table. *Note Syntax Tables::. - - Function: set-case-syntax-pair uc lc downcase-table + - Function: set-case-syntax-pair UC LC DOWNCASE-TABLE This function specifies a pair of corresponding letters, one upper case and one lower case. - - Function: set-case-syntax-delims l r downcase-table + - Function: set-case-syntax-delims L R DOWNCASE-TABLE This function makes characters L and R a matching pair of case-invariant delimiters. - - Function: set-case-syntax char syntax downcase-table + - Function: set-case-syntax CHAR SYNTAX DOWNCASE-TABLE This function makes CHAR case-invariant, with syntax SYNTAX. - Command: describe-buffer-case-table @@ -996,7 +984,7 @@ assigned values are * a single character - - Function: char-table-p object + - Function: char-table-p OBJECT This function returns non-`nil' if OBJECT is a char table. * Menu: @@ -1038,13 +1026,13 @@ different sorts of values. The different char table types are character. Higher-level Lisp functions are provided for working with syntax tables. The valid values are integers. - - Function: char-table-type char-table - This function returns the type of char table CHAR-TABLE. + - Function: char-table-type TABLE + This function returns the type of char table TABLE. - Function: char-table-type-list This function returns a list of the recognized char table types. - - Function: valid-char-table-type-p type + - Function: valid-char-table-type-p TYPE This function returns `t' if TYPE if a recognized char table type.  @@ -1053,14 +1041,13 @@ File: lispref.info, Node: Working With Char Tables, Prev: Char Table Types, U Working With Char Tables ------------------------ - - Function: make-char-table type + - Function: make-char-table TYPE This function makes a new, empty char table of type TYPE. TYPE should be a symbol, one of `char', `category', `display', `generic', or `syntax'. - - Function: put-char-table range value char-table - This function sets the value for chars in RANGE to be VALUE in - CHAR-TABLE. + - Function: put-char-table RANGE VAL TABLE + This function sets the value for chars in RANGE to be VAL in TABLE. RANGE specifies one or more characters to be affected and should be one of the following: @@ -1074,31 +1061,31 @@ Working With Char Tables * A single character - VALUE must be a value appropriate for the type of CHAR-TABLE. + VAL must be a value appropriate for the type of TABLE. - - Function: get-char-table character char-table - This function finds the value for CHARACTER in CHAR-TABLE. + - Function: get-char-table CH TABLE + This function finds the value for char CH in TABLE. - - Function: get-range-char-table range char-table &optional multi - This function finds the value for a range in CHAR-TABLE. If there - is more than one value, MULTI is returned (defaults to `nil'). + - Function: get-range-char-table RANGE TABLE &optional MULTI + This function finds the value for a range in TABLE. If there is + more than one value, MULTI is returned (defaults to `nil'). - - Function: reset-char-table char-table - This function resets CHAR-TABLE to its default state. + - Function: reset-char-table TABLE + This function resets a char table to its default state. - - Function: map-char-table function char-table &optional range - This function maps FUNCTION over entries in CHAR-TABLE, calling it - with two args, each key and value in the table. + - Function: map-char-table FUNCTION TABLE &optional RANGE + This function maps FUNCTION over entries in TABLE, calling it with + two args, each key and value in the table. RANGE specifies a subrange to map over and is in the same format as the RANGE argument to `put-range-table'. If omitted or `t', it defaults to the entire table. - - Function: valid-char-table-value-p value char-table-type + - Function: valid-char-table-value-p VALUE CHAR-TABLE-TYPE This function returns non-`nil' if VALUE is a valid value for CHAR-TABLE-TYPE. - - Function: check-valid-char-table-value value char-table-type + - Function: check-valid-char-table-value VALUE CHAR-TABLE-TYPE This function signals an error if VALUE is not a valid value for CHAR-TABLE-TYPE. @@ -1235,18 +1222,18 @@ cons cell or is a list, or whether it is the distinguished object `nil'. (Many of these predicates can be defined in terms of the others, but they are used so often that it is worth having all of them.) - - Function: consp object + - Function: consp OBJECT This function returns `t' if OBJECT is a cons cell, `nil' - otherwise. `nil' is not a cons cell, although it _is_ a list. + otherwise. `nil' is not a cons cell, although it *is* a list. - - Function: atom object + - Function: atom OBJECT This function returns `t' if OBJECT is an atom, `nil' otherwise. All objects except cons cells are atoms. The symbol `nil' is an atom and is also a list; it is the only Lisp object that is both. (atom OBJECT) == (not (consp OBJECT)) - - Function: listp object + - Function: listp OBJECT This function returns `t' if OBJECT is a cons cell or `nil'. Otherwise, it returns `nil'. @@ -1255,13 +1242,13 @@ others, but they are used so often that it is worth having all of them.) (listp '()) => t - - Function: nlistp object + - Function: nlistp OBJECT This function is the opposite of `listp': it returns `t' if OBJECT is not a list. Otherwise, it returns `nil'. (listp OBJECT) == (not (nlistp OBJECT)) - - Function: null object + - Function: null OBJECT This function returns `t' if OBJECT is `nil', and returns `nil' otherwise. This function is identical to `not', but as a matter of clarity we use `null' when OBJECT is considered a list and diff --git a/info/lispref.info-6 b/info/lispref.info-6 index 4273b1d..ce764e8 100644 --- a/info/lispref.info-6 +++ b/info/lispref.info-6 @@ -1,5 +1,5 @@ -This is ../info/lispref.info, produced by makeinfo version 4.0 from -lispref/lispref.texi. +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -55,7 +55,7 @@ File: lispref.info, Node: List Elements, Next: Building Lists, Prev: List-rel Accessing Elements of Lists =========================== - - Function: car cons-cell + - Function: car CONS-CELL This function returns the value pointed to by the first pointer of the cons cell CONS-CELL. Expressed another way, this function returns the CAR of CONS-CELL. @@ -69,7 +69,7 @@ Accessing Elements of Lists (car '()) => nil - - Function: cdr cons-cell + - Function: cdr CONS-CELL This function returns the value pointed to by the second pointer of the cons cell CONS-CELL. Expressed another way, this function returns the CDR of CONS-CELL. @@ -83,7 +83,7 @@ Accessing Elements of Lists (cdr '()) => nil - - Function: car-safe object + - Function: car-safe OBJECT This function lets you take the CAR of a cons cell while avoiding errors for other data types. It returns the CAR of OBJECT if OBJECT is a cons cell, `nil' otherwise. This is in contrast to @@ -96,7 +96,7 @@ Accessing Elements of Lists (car x) nil)) - - Function: cdr-safe object + - Function: cdr-safe OBJECT This function lets you take the CDR of a cons cell while avoiding errors for other data types. It returns the CDR of OBJECT if OBJECT is a cons cell, `nil' otherwise. This is in contrast to @@ -109,7 +109,7 @@ Accessing Elements of Lists (cdr x) nil)) - - Function: nth n list + - Function: nth N LIST This function returns the Nth element of LIST. Elements are numbered starting with zero, so the CAR of LIST is element number zero. If the length of LIST is N or less, the value is `nil'. @@ -125,7 +125,7 @@ Accessing Elements of Lists (nth n x) == (car (nthcdr n x)) - - Function: nthcdr n list + - Function: nthcdr N LIST This function returns the Nth CDR of LIST. In other words, it removes the first N links of LIST and returns what follows. @@ -143,34 +143,34 @@ Accessing Elements of Lists access particular elements in a nested list. All of these can be rewritten in terms of the functions just described. - - Function: caar cons-cell - - Function: cadr cons-cell - - Function: cdar cons-cell - - Function: cddr cons-cell - - Function: caaar cons-cell - - Function: caadr cons-cell - - Function: cadar cons-cell - - Function: caddr cons-cell - - Function: cdaar cons-cell - - Function: cdadr cons-cell - - Function: cddar cons-cell - - Function: cdddr cons-cell - - Function: caaaar cons-cell - - Function: caaadr cons-cell - - Function: caadar cons-cell - - Function: caaddr cons-cell - - Function: cadaar cons-cell - - Function: cadadr cons-cell - - Function: caddar cons-cell - - Function: cadddr cons-cell - - Function: cdaaar cons-cell - - Function: cdaadr cons-cell - - Function: cdadar cons-cell - - Function: cdaddr cons-cell - - Function: cddaar cons-cell - - Function: cddadr cons-cell - - Function: cdddar cons-cell - - Function: cddddr cons-cell + - Function: caar CONS-CELL + - Function: cadr CONS-CELL + - Function: cdar CONS-CELL + - Function: cddr CONS-CELL + - Function: caaar CONS-CELL + - Function: caadr CONS-CELL + - Function: cadar CONS-CELL + - Function: caddr CONS-CELL + - Function: cdaar CONS-CELL + - Function: cdadr CONS-CELL + - Function: cddar CONS-CELL + - Function: cdddr CONS-CELL + - Function: caaaar CONS-CELL + - Function: caaadr CONS-CELL + - Function: caadar CONS-CELL + - Function: caaddr CONS-CELL + - Function: cadaar CONS-CELL + - Function: cadadr CONS-CELL + - Function: caddar CONS-CELL + - Function: cadddr CONS-CELL + - Function: cdaaar CONS-CELL + - Function: cdaadr CONS-CELL + - Function: cdadar CONS-CELL + - Function: cdaddr CONS-CELL + - Function: cddaar CONS-CELL + - Function: cddadr CONS-CELL + - Function: cdddar CONS-CELL + - Function: cddddr CONS-CELL Each of these functions is equivalent to one or more applications of `car' and/or `cdr'. For example, @@ -191,22 +191,22 @@ rewritten in terms of the functions just described. That is to say, read the a's and d's from right to left and apply a `car' or `cdr' for each a or d found, respectively. - - Function: first list + - Function: first LIST This is equivalent to `(nth 0 LIST)', i.e. the first element of LIST. (Note that this is also equivalent to `car'.) - - Function: second list + - Function: second LIST This is equivalent to `(nth 1 LIST)', i.e. the second element of LIST. - - Function: third list - - Function: fourth list - - Function: fifth list - - Function: sixth list - - Function: seventh list - - Function: eighth list - - Function: ninth list - - Function: tenth list + - Function: third LIST + - Function: fourth LIST + - Function: fifth LIST + - Function: sixth LIST + - Function: seventh LIST + - Function: eighth LIST + - Function: ninth LIST + - Function: tenth LIST These are equivalent to `(nth 2 LIST)' through `(nth 9 LIST)' respectively, i.e. the third through tenth elements of LIST. @@ -221,7 +221,7 @@ Lisp. `cons' is the fundamental list-building function; however, it is interesting to note that `list' is used more times in the source code for Emacs than `cons'. - - Function: cons object1 object2 + - Function: cons OBJECT1 OBJECT2 This function is the fundamental function used to build new list structure. It creates a new cons cell, making OBJECT1 the CAR, and OBJECT2 the CDR. It then returns the new cons cell. The @@ -245,7 +245,7 @@ for Emacs than `cons'. used in this example and the function named `list' described below; any symbol can serve both purposes. - - Function: list &rest objects + - Function: list &rest OBJECTS This function creates a list with OBJECTS as its elements. The resulting list is always `nil'-terminated. If no OBJECTS are given, the empty list is returned. @@ -257,17 +257,17 @@ for Emacs than `cons'. (list) => nil - - Function: make-list length object + - Function: make-list LENGTH OBJECT This function creates a list of length LENGTH, in which all the elements have the identical value OBJECT. Compare `make-list' - with `make-string' (*note Creating Strings::). + with `make-string' (*note Creating Strings::.). (make-list 3 'pigs) => (pigs pigs pigs) (make-list 0 'pigs) => nil - - Function: append &rest sequences + - Function: append &rest SEQUENCES This function returns a list containing all the elements of SEQUENCES. The SEQUENCES may be lists, vectors, or strings, but the last one should be a list. All arguments except the last one @@ -357,12 +357,12 @@ for Emacs than `cons'. of the original integers. *Don't use this feature; we plan to eliminate it. If you already use this feature, change your programs now!* The proper way to convert an integer to a decimal - number in this way is with `format' (*note Formatting Strings::) - or `number-to-string' (*note String Conversion::). + number in this way is with `format' (*note Formatting Strings::.) + or `number-to-string' (*note String Conversion::.). - - Function: reverse list + - Function: reverse LIST This function creates a new list whose elements are the elements of - LIST, but in reverse order. The original argument LIST is _not_ + LIST, but in reverse order. The original argument LIST is *not* altered. (setq x '(1 2 3 4)) @@ -403,9 +403,9 @@ Altering List Elements with `setcar' a list, `setcar' replaces one element of a list with a different element. - - Function: setcar cons-cell object - This function stores OBJECT as the new CAR of CONS-CELL, replacing - its previous CAR. It returns the value OBJECT. For example: + - Function: setcar CONS OBJECT + This function stores OBJECT as the new CAR of CONS, replacing its + previous CAR. It returns the value OBJECT. For example: (setq x '(1 2)) => (1 2) @@ -481,9 +481,9 @@ Altering the CDR of a List The lowest-level primitive for modifying a CDR is `setcdr': - - Function: setcdr cons-cell object - This function stores OBJECT as the new CDR of CONS-CELL, replacing - its previous CDR. It returns the value OBJECT. + - Function: setcdr CONS OBJECT + This function stores OBJECT as the new CDR of CONS, replacing its + previous CDR. It returns the value OBJECT. Here is an example of replacing the CDR of a list with a different list. All but the first element of the list are removed in favor of a @@ -535,7 +535,7 @@ list. Here is this result in box notation: - -------------- ------------- ------------- + -------------- ------------- ------------- | car | cdr | | car | cdr | | car | cdr | | a | o | -->| b | o------->| c | nil | | | | | | | | | | | | @@ -563,9 +563,9 @@ to them as arguments, to produce a new list that is the returned value. See `delq', in *Note Sets And Lists::, for another function that modifies cons cells. - - Function: nconc &rest lists + - Function: nconc &rest LISTS This function returns a list containing all the elements of LISTS. - Unlike `append' (*note Building Lists::), the LISTS are _not_ + Unlike `append' (*note Building Lists::.), the LISTS are *not* copied. Instead, the last CDR of each of the LISTS is changed to refer to the following list. The last of the LISTS is not altered. For example: @@ -595,21 +595,23 @@ modifies cons cells. (defun add-foo (x) ; We want this function to add (nconc '(foo) x)) ; `foo' to the front of its arg. - + (symbol-function 'add-foo) => (lambda (x) (nconc (quote (foo)) x)) - + (setq xx (add-foo '(1 2))) ; It seems to work. => (foo 1 2) + (setq xy (add-foo '(3 4))) ; What happened? => (foo 1 2 3 4) + (eq xx xy) => t - + (symbol-function 'add-foo) => (lambda (x) (nconc (quote (foo 1 2 3 4) x))) - - Function: nreverse list + - Function: nreverse LIST This function reverses the order of the elements of LIST. Unlike `reverse', `nreverse' alters its argument by reversing the CDRs in the cons cells forming the list. The cons cell that used to be @@ -644,7 +646,7 @@ modifies cons cells. | | | | ------------- ------------ - - Function: sort list predicate + - Function: sort LIST PREDICATE This function sorts LIST stably, though destructively, and returns the sorted list. It compares elements using PREDICATE. A stable sort is one in which elements with equal sort keys maintain their @@ -708,7 +710,7 @@ versions, `member' and `delete'. XEmacs Lisp does not have them. You can write them in Lisp if you wish. - - Function: memq object list + - Function: memq OBJECT LIST This function tests to see whether OBJECT is a member of LIST. If it is, `memq' returns a list starting with the first occurrence of OBJECT. Otherwise, it returns `nil'. The letter `q' in `memq' @@ -720,7 +722,7 @@ versions, `member' and `delete'. (memq '(2) '((1) (2))) ; `(2)' and `(2)' are not `eq'. => nil - - Function: delq object list + - Function: delq OBJECT LIST This function destructively removes all elements `eq' to OBJECT from LIST. The letter `q' in `delq' says that it uses `eq' to compare OBJECT against the elements of the list, like `memq'. @@ -732,7 +734,7 @@ after those elements: (delq 'a '(a b c)) == (cdr '(a b c)) When an element to be deleted appears in the middle of the list, -removing it involves changing the CDRs (*note Setcdr::). +removing it involves changing the CDRs (*note Setcdr::.). (setq sample-list '(a b c (4))) => (a b c (4)) @@ -764,7 +766,7 @@ and the `(4)' in the `sample-list' are not `eq': The following two functions are like `memq' and `delq' but use `equal' rather than `eq' to compare elements. They are new in Emacs 19. - - Function: member object list + - Function: member OBJECT LIST The function `member' tests to see whether OBJECT is a member of LIST, comparing members with OBJECT using `equal'. If OBJECT is a member, `member' returns a list starting with its first occurrence @@ -780,7 +782,7 @@ and the `(4)' in the `sample-list' are not `eq': (member "foo" '("foo" "bar")) => ("foo" "bar") - - Function: delete object list + - Function: delete OBJECT LIST This function destructively removes all elements `equal' to OBJECT from LIST. It is to `delq' as `member' is to `memq': it uses `equal' to compare elements with OBJECT, like `member'; when it @@ -818,7 +820,7 @@ key `maple' is associated with `seeds'. The associated values in an alist may be any Lisp objects; so may the keys. For example, in the following alist, the symbol `a' is associated with the number `1', and the string `"b"' is associated with -the _list_ `(2 3)', which is the CDR of the alist element: +the *list* `(2 3)', which is the CDR of the alist element: ((a . 1) ("b" 2 3)) @@ -845,7 +847,7 @@ the front of the list. When searching an association list for an association with a given key, the first one found is returned, if there is more than one. - In XEmacs Lisp, it is _not_ an error if an element of an association + In XEmacs Lisp, it is *not* an error if an element of an association list is not a cons cell. The alist search functions simply ignore such elements. Many other versions of Lisp signal errors in such cases. @@ -854,10 +856,10 @@ respects. A property list behaves like an association list in which each key can occur only once. *Note Property Lists::, for a comparison of property lists and association lists. - - Function: assoc key alist + - Function: assoc KEY ALIST This function returns the first association for KEY in ALIST. It compares KEY against the alist elements using `equal' (*note - Equality Predicates::). It returns `nil' if no association in + Equality Predicates::.). It returns `nil' if no association in ALIST has a CAR `equal' to KEY. For example: (setq trees '((pine . cones) (oak . acorns) (maple . seeds))) @@ -882,7 +884,7 @@ of property lists and association lists. (cdr (assoc 2 needles-per-cluster)) => ("Austrian Pine" "Red Pine") - - Function: rassoc value alist + - Function: rassoc VALUE ALIST This function returns the first association with value VALUE in ALIST. It returns `nil' if no association in ALIST has a CDR `equal' to VALUE. @@ -891,7 +893,7 @@ of property lists and association lists. ALIST association instead of the CAR. You can think of this as "reverse `assoc'", finding the key for a given value. - - Function: assq key alist + - Function: assq KEY ALIST This function is like `assoc' in that it returns the first association for KEY in ALIST, but it makes the comparison using `eq' instead of `equal'. `assq' returns `nil' if no association @@ -916,7 +918,7 @@ of property lists and association lists. (assoc "simple leaves" leaves) => ("simple leaves" . oak) - - Function: rassq value alist + - Function: rassq VALUE ALIST This function returns the first association with value VALUE in ALIST. It returns `nil' if no association in ALIST has a CDR `eq' to VALUE. @@ -948,9 +950,9 @@ of property lists and association lists. (lily white) == (lily . (white)) - - Function: remassoc key alist + - Function: remassoc KEY ALIST This function deletes by side effect any associations with key KEY - in ALIST--i.e. it removes any elements from ALIST whose `car' is + in ALIST - i.e. it removes any elements from ALIST whose `car' is `equal' to KEY. The modified ALIST is returned. If the first member of ALIST has a `car' that is `equal' to KEY, @@ -958,17 +960,17 @@ of property lists and association lists. `(setq foo (remassoc key foo))' to be sure of changing the value of `foo'. - - Function: remassq key alist + - Function: remassq KEY ALIST This function deletes by side effect any associations with key KEY - in ALIST--i.e. it removes any elements from ALIST whose `car' is + in ALIST - i.e. it removes any elements from ALIST whose `car' is `eq' to KEY. The modified ALIST is returned. This function is exactly like `remassoc', but comparisons between KEY and keys in ALIST are done using `eq' instead of `equal'. - - Function: remrassoc value alist + - Function: remrassoc VALUE ALIST This function deletes by side effect any associations with value - VALUE in ALIST--i.e. it removes any elements from ALIST whose + VALUE in ALIST - i.e. it removes any elements from ALIST whose `cdr' is `equal' to VALUE. The modified ALIST is returned. If the first member of ALIST has a `car' that is `equal' to VALUE, @@ -981,15 +983,15 @@ of property lists and association lists. as "reverse `remassoc'", removing an association based on its value instead of its key. - - Function: remrassq value alist + - Function: remrassq VALUE ALIST This function deletes by side effect any associations with value - VALUE in ALIST--i.e. it removes any elements from ALIST whose + VALUE in ALIST - i.e. it removes any elements from ALIST whose `cdr' is `eq' to VALUE. The modified ALIST is returned. This function is exactly like `remrassoc', but comparisons between VALUE and values in ALIST are done using `eq' instead of `equal'. - - Function: copy-alist alist + - Function: copy-alist ALIST This function returns a two-level deep copy of ALIST: it creates a new copy of each association, so that you can alter the associations of the new alist without changing the old one. @@ -1060,13 +1062,13 @@ association lists generally are not. compared with `eq', and "lax" plists, whose keys are compared with `equal', - - Function: valid-plist-p plist + - Function: valid-plist-p PLIST Given a plist, this function returns non-`nil' if its format is correct. If it returns `nil', `check-valid-plist' will signal an error when given the plist; that means it's a malformed or circular plist or has non-symbols as keywords. - - Function: check-valid-plist plist + - Function: check-valid-plist PLIST Given a plist, this function signals an error if there is anything wrong with it. This means that it's a malformed or circular plist. @@ -1082,28 +1084,26 @@ File: lispref.info, Node: Working With Normal Plists, Next: Working With Lax P Working With Normal Plists -------------------------- - - Function: plist-get plist property &optional default + - Function: plist-get PLIST PROP &optional DEFAULT This function extracts a value from a property list. The function - returns the value corresponding to the given PROPERTY, or DEFAULT - if PROPERTY is not one of the properties on the list. - - - Function: plist-put plist property value - This function changes the value in PLIST of PROPERTY to VALUE. If - PROPERTY is already a property on the list, its value is set to - VALUE, otherwise the new PROPERTY VALUE pair is added. The new - plist is returned; use `(setq x (plist-put x property value))' to - be sure to use the new value. The PLIST is modified by side - effects. - - - Function: plist-remprop plist property - This function removes from PLIST the property PROPERTY and its - value. The new plist is returned; use `(setq x (plist-remprop x - property))' to be sure to use the new value. The PLIST is - modified by side effects. + returns the value corresponding to the given PROP, or DEFAULT if + PROP is not one of the properties on the list. + + - Function: plist-put PLIST PROP VAL + This function changes the value in PLIST of PROP to VAL. If PROP + is already a property on the list, its value is set to VAL, + otherwise the new PROP VAL pair is added. The new plist is + returned; use `(setq x (plist-put x prop val))' to be sure to use + the new value. The PLIST is modified by side effects. + + - Function: plist-remprop PLIST PROP + This function removes from PLIST the property PROP and its value. + The new plist is returned; use `(setq x (plist-remprop x prop + val))' to be sure to use the new value. The PLIST is modified by + side effects. - - Function: plist-member plist property - This function returns `t' if PROPERTY has a value specified in - PLIST. + - Function: plist-member PLIST PROP + This function returns `t' if PROP has a value specified in PLIST. In the following functions, if optional arg NIL-MEANS-NOT-PRESENT is non-`nil', then a property with a `nil' value is ignored or removed. @@ -1111,16 +1111,16 @@ This feature is a virus that has infected old Lisp implementations (and thus E-Lisp, due to RMS's enamorment with old Lisps), but should not be used except for backward compatibility. - - Function: plists-eq a b &optional nil-means-not-present + - Function: plists-eq A B &optional NIL-MEANS-NOT-PRESENT This function returns non-`nil' if property lists A and B are `eq' (i.e. their values are `eq'). - - Function: plists-equal a b &optional nil-means-not-present + - Function: plists-equal A B &optional NIL-MEANS-NOT-PRESENT This function returns non-`nil' if property lists A and B are `equal' (i.e. their values are `equal'; their keys are still compared using `eq'). - - Function: canonicalize-plist plist &optional nil-means-not-present + - Function: canonicalize-plist PLIST &optional NIL-MEANS-NOT-PRESENT This function destructively removes any duplicate entries from a plist. In such cases, the first entry applies. @@ -1137,22 +1137,22 @@ Working With Lax Plists Recall that a "lax plist" is a property list whose keys are compared using `equal' instead of `eq'. - - Function: lax-plist-get lax-plist property &optional default + - Function: lax-plist-get LAX-PLIST PROP &optional DEFAULT This function extracts a value from a lax property list. The - function returns the value corresponding to the given PROPERTY, or - DEFAULT if PROPERTY is not one of the properties on the list. + function returns the value corresponding to the given PROP, or + DEFAULT if PROP is not one of the properties on the list. - - Function: lax-plist-put lax-plist property value - This function changes the value in LAX-PLIST of PROPERTY to VALUE. + - Function: lax-plist-put LAX-PLIST PROP VAL + This function changes the value in LAX-PLIST of PROP to VAL. - - Function: lax-plist-remprop lax-plist property - This function removes from LAX-PLIST the property PROPERTY and its + - Function: lax-plist-remprop LAX-PLIST PROP + This function removes from LAX-PLIST the property PROP and its value. The new plist is returned; use `(setq x (lax-plist-remprop - x property))' to be sure to use the new value. The LAX-PLIST is + x prop val))' to be sure to use the new value. The LAX-PLIST is modified by side effects. - - Function: lax-plist-member lax-plist property - This function returns `t' if PROPERTY has a value specified in + - Function: lax-plist-member LAX-PLIST PROP + This function returns `t' if PROP has a value specified in LAX-PLIST. In the following functions, if optional arg NIL-MEANS-NOT-PRESENT is @@ -1161,17 +1161,17 @@ This feature is a virus that has infected old Lisp implementations (and thus E-Lisp, due to RMS's enamorment with old Lisps), but should not be used except for backward compatibility. - - Function: lax-plists-eq a b &optional nil-means-not-present + - Function: lax-plists-eq A B &optional NIL-MEANS-NOT-PRESENT This function returns non-`nil' if lax property lists A and B are `eq' (i.e. their values are `eq'; their keys are still compared using `equal'). - - Function: lax-plists-equal a b &optional nil-means-not-present + - Function: lax-plists-equal A B &optional NIL-MEANS-NOT-PRESENT This function returns non-`nil' if lax property lists A and B are `equal' (i.e. their values are `equal'). - - Function: canonicalize-lax-plist lax-plist &optional - nil-means-not-present + - Function: canonicalize-lax-plist LAX-PLIST &optional + NIL-MEANS-NOT-PRESENT This function destructively removes any duplicate entries from a lax plist. In such cases, the first entry applies. @@ -1185,7 +1185,7 @@ File: lispref.info, Node: Converting Plists To/From Alists, Prev: Working With Converting Plists To/From Alists -------------------------------- - - Function: alist-to-plist alist + - Function: alist-to-plist ALIST This function converts association list ALIST into the equivalent property-list form. The plist is returned. This converts from @@ -1197,7 +1197,7 @@ Converting Plists To/From Alists The original alist is not modified. - - Function: plist-to-alist plist + - Function: plist-to-alist PLIST This function converts property list PLIST into the equivalent association-list form. The alist is returned. This converts from @@ -1214,11 +1214,11 @@ except that they destructively modify their arguments, using cons cells from the original list to form the new list rather than allocating new cons cells. - - Function: destructive-alist-to-plist alist + - Function: destructive-alist-to-plist ALIST This function destructively converts association list ALIST into the equivalent property-list form. The plist is returned. - - Function: destructive-plist-to-alist plist + - Function: destructive-plist-to-alist PLIST This function destructively converts property list PLIST into the equivalent association-list form. The alist is returned. @@ -1238,14 +1238,14 @@ lists of another function's buffers or markers. When that function is 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 +holding 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. Weak lists are similar to weak hash tables (*note Weak Hash -Tables::). +Tables::.). - - Function: weak-list-p object + - Function: weak-list-p OBJECT This function returns non-`nil' if OBJECT is a weak list. Weak lists come in one of four types: @@ -1266,18 +1266,18 @@ Tables::). Objects in the list disappear if they are conses and the cdr is not referenced outside of the list. - - Function: make-weak-list &optional type + - Function: make-weak-list &optional TYPE This function creates a new weak list of type TYPE. TYPE is a symbol (one of `simple', `assoc', `key-assoc', or `value-assoc', as described above) and defaults to `simple'. - - Function: weak-list-type weak + - Function: weak-list-type WEAK This function returns the type of the given weak-list object. - - Function: weak-list-list weak + - Function: weak-list-list WEAK This function returns the list contained in a weak-list object. - - Function: set-weak-list-list weak new-list + - Function: set-weak-list-list WEAK NEW-LIST This function changes the list contained in a weak-list object.  diff --git a/info/lispref.info-7 b/info/lispref.info-7 index f680a25..780fd80 100644 --- a/info/lispref.info-7 +++ b/info/lispref.info-7 @@ -1,5 +1,5 @@ -This is ../info/lispref.info, produced by makeinfo version 4.0 from -lispref/lispref.texi. +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -60,11 +60,11 @@ vector, or a string. The common property that all sequences have is that each is an ordered collection of elements. This section describes functions that accept any kind of sequence. - - Function: sequencep object + - Function: sequencep OBJECT Returns `t' if OBJECT is a list, vector, bit vector, or string, `nil' otherwise. - - Function: copy-sequence sequence + - Function: copy-sequence SEQUENCE Returns a copy of SEQUENCE. The copy is the same type of object as the original sequence, and it has the same elements in the same order. @@ -115,7 +115,7 @@ functions that accept any kind of sequence. (bit-vector 1 0 1 1 0 1 0 0) => #*10110100 - - Function: length sequence + - Function: length SEQUENCE Returns the number of elements in SEQUENCE. If SEQUENCE is a cons cell that is not a list (because the final CDR is not `nil'), a `wrong-type-argument' error is signaled. @@ -131,7 +131,7 @@ functions that accept any kind of sequence. (length #*01101) => 5 - - Function: elt sequence index + - Function: elt SEQUENCE INDEX This function returns the element of SEQUENCE indexed by INDEX. Legitimate values of INDEX are integers ranging from 0 up to one less than the length of SEQUENCE. If SEQUENCE is a list, then @@ -151,8 +151,8 @@ functions that accept any kind of sequence. (elt [1 2 3 4] -1) error-->Args out of range: [1 2 3 4], -1 - This function generalizes `aref' (*note Array Functions::) and - `nth' (*note List Elements::). + This function generalizes `aref' (*note Array Functions::.) and + `nth' (*note List Elements::.).  File: lispref.info, Node: Arrays, Next: Array Functions, Prev: Sequence Functions, Up: Sequences Arrays Vectors @@ -188,7 +188,7 @@ Type::, *Note Vector Type::, and *Note Bit Vector Type::. * The elements of an array may be referenced or changed with the functions `aref' and `aset', respectively (*note Array - Functions::). + Functions::.). In principle, if you wish to have an array of text characters, you could use either a string or a vector. In practice, we always choose @@ -233,7 +233,7 @@ Functions that Operate on Arrays In this section, we describe the functions that accept strings, vectors, and bit vectors. - - Function: arrayp object + - Function: arrayp OBJECT This function returns `t' if OBJECT is an array (i.e., a string, vector, or bit vector). @@ -244,7 +244,7 @@ vectors, and bit vectors. (arrayp #*101) => t - - Function: aref array index + - Function: aref ARRAY INDEX This function returns the INDEXth element of ARRAY. The first element is at index zero. @@ -263,7 +263,7 @@ vectors, and bit vectors. See also the function `elt', in *Note Sequence Functions::. - - Function: aset array index object + - Function: aset ARRAY INDEX OBJECT This function sets the INDEXth element of ARRAY to be OBJECT. It returns OBJECT. @@ -291,7 +291,7 @@ vectors, and bit vectors. If ARRAY is a string and OBJECT is not a character, a `wrong-type-argument' error results. - - Function: fillarray array object + - Function: fillarray ARRAY OBJECT This function fills the array ARRAY with OBJECT, so that each element of ARRAY is OBJECT. It returns ARRAY. @@ -364,7 +364,7 @@ Functions That Operate on Vectors Here are some functions that relate to vectors: - - Function: vectorp object + - Function: vectorp OBJECT This function returns `t' if OBJECT is a vector. (vectorp [a]) @@ -372,7 +372,7 @@ Functions That Operate on Vectors (vectorp "asdf") => nil - - Function: vector &rest objects + - Function: vector &rest OBJECTS This function creates and returns a vector whose elements are the arguments, OBJECTS. @@ -381,14 +381,14 @@ Functions That Operate on Vectors (vector) => [] - - Function: make-vector length object + - Function: make-vector LENGTH OBJECT This function returns a new vector consisting of LENGTH elements, each initialized to OBJECT. (setq sleepy (make-vector 9 'Z)) => [Z Z Z Z Z Z Z Z Z] - - Function: vconcat &rest sequences + - Function: vconcat &rest SEQUENCES This function returns a new vector containing all the elements of the SEQUENCES. The arguments SEQUENCES may be lists, vectors, or strings. If no SEQUENCES are given, an empty vector is returned. @@ -411,8 +411,8 @@ Functions That Operate on Vectors of the original integers. *Don't use this feature; we plan to eliminate it. If you already use this feature, change your programs now!* The proper way to convert an integer to a decimal - number in this way is with `format' (*note Formatting Strings::) - or `number-to-string' (*note String Conversion::). + number in this way is with `format' (*note Formatting Strings::.) + or `number-to-string' (*note String Conversion::.). For other concatenation functions, see `mapconcat' in *Note Mapping Functions::, `concat' in *Note Creating Strings::, `append' @@ -420,7 +420,7 @@ Functions That Operate on Vectors Functions::. The `append' function provides a way to convert a vector into a list -with the same elements (*note Building Lists::): +with the same elements (*note Building Lists::.): (setq avector [1 two (quote (three)) "four" [five]]) => [1 two (quote (three)) "four" [five]] @@ -458,7 +458,7 @@ Functions That Operate on Bit Vectors Here are some functions that relate to bit vectors: - - Function: bit-vector-p object + - Function: bit-vector-p OBJECT This function returns `t' if OBJECT is a bit vector. (bit-vector-p #*01) @@ -468,28 +468,27 @@ Functions That Operate on Bit Vectors (bit-vector-p "01") => nil - - Function: bitp object + - Function: bitp OBJECT This function returns `t' if OBJECT is either 0 or 1. - - Function: bit-vector &rest bits + - Function: bit-vector &rest OBJECTS This function creates and returns a bit vector whose elements are - the arguments BITS. Each argument must be a bit, i.e. one of the - two integers 0 or 1. + the arguments OBJECTS. The elements must be either of the two + integers 0 or 1. (bit-vector 0 0 0 1 0 0 0 0 1 0) => #*0001000010 (bit-vector) => #* - - Function: make-bit-vector length bit + - Function: make-bit-vector LENGTH OBJECT This function creates and returns a bit vector consisting of - LENGTH elements, each initialized to BIT, which must be one of the - two integers 0 or 1. + LENGTH elements, each initialized to OBJECT. (setq picket-fence (make-bit-vector 9 1)) => #*111111111 - - Function: bvconcat &rest sequences + - Function: bvconcat &rest SEQUENCES This function returns a new bit vector containing all the elements of the SEQUENCES. The arguments SEQUENCES may be lists, vectors, or bit vectors, all of whose elements are the integers 0 or 1. If @@ -513,7 +512,7 @@ Functions That Operate on Bit Vectors Building Lists::. The `append' function provides a way to convert a bit vector into a -list with the same elements (*note Building Lists::): +list with the same elements (*note Building Lists::.): (setq bv #*00001110) => #*00001110 @@ -536,7 +535,7 @@ Type::. You can test whether an arbitrary Lisp object is a symbol with `symbolp': - - Function: symbolp object + - Function: symbolp OBJECT This function returns `t' if OBJECT is a symbol, `nil' otherwise. * Menu: @@ -595,15 +594,15 @@ Symbols::.) In normal usage, the function cell usually contains a function or macro, as that is what the Lisp interpreter expects to see there (*note -Evaluation::). Keyboard macros (*note Keyboard Macros::), keymaps -(*note Keymaps::) and autoload objects (*note Autoloading::) are also +Evaluation::.). Keyboard macros (*note Keyboard Macros::.), keymaps +(*note Keymaps::.) and autoload objects (*note Autoloading::.) are also sometimes stored in the function cell of symbols. We often refer to "the function `foo'" when we really mean the function stored in the function cell of the symbol `foo'. We make the distinction only when necessary. The property list cell normally should hold a correctly formatted -property list (*note Property Lists::), as a number of functions expect +property list (*note Property Lists::.), as a number of functions expect to see a property list there. The function cell or the value cell may be "void", which means that @@ -628,17 +627,17 @@ the symbol `buffer-file-name': Because this symbol is the variable which holds the name of the file being visited in the current buffer, the value cell contents we see are -the name of the source file of this chapter of the XEmacs Lisp Reference -Manual. The property list cell contains the list -`(variable-documentation 29529)' which tells the documentation -functions where to find the documentation string for the variable -`buffer-file-name' in the `DOC' file. (29529 is the offset from the -beginning of the `DOC' file to where that documentation string begins.) -The function cell contains the function for returning the name of the -file. `buffer-file-name' names a primitive function, which has no read -syntax and prints in hash notation (*note Primitive Function Type::). A -symbol naming a function written in Lisp would have a lambda expression -(or a byte-code object) in this cell. +the name of the source file of this chapter of the XEmacs Lisp Manual. +The property list cell contains the list `(variable-documentation +29529)' which tells the documentation functions where to find the +documentation string for the variable `buffer-file-name' in the `DOC' +file. (29529 is the offset from the beginning of the `DOC' file to +where that documentation string begins.) The function cell contains +the function for returning the name of the file. `buffer-file-name' +names a primitive function, which has no read syntax and prints in hash +notation (*note Primitive Function Type::.). A symbol naming a +function written in Lisp would have a lambda expression (or a byte-code +object) in this cell.  File: lispref.info, Node: Definitions, Next: Creating Symbols, Prev: Symbol Components, Up: Symbols @@ -680,7 +679,7 @@ as a variable or function. Thus, you can make a symbol a global variable with `setq', whether you define it first or not. The real purpose of definitions is to guide programmers and programming tools. They inform programmers who read the code that certain symbols are -_intended_ to be used as variables, or as functions. In addition, +*intended* to be used as variables, or as functions. In addition, utilities such as `etags' and `make-docfile' recognize definitions, and add appropriate information to tag tables and the `DOC' file. *Note Accessing Documentation::. @@ -745,7 +744,7 @@ symbol in the obarray bucket. The results would be unpredictable. It is possible for two different symbols to have the same name in different obarrays; these symbols are not `eq' or `equal'. However, this normally happens only as part of the abbrev mechanism (*note -Abbrevs::). +Abbrevs::.). Common Lisp note: In Common Lisp, a single symbol may be interned in several obarrays. @@ -754,7 +753,7 @@ Abbrevs::). arguments. A `wrong-type-argument' error is signaled if the name is not a string, or if the obarray is not a vector. - - Function: symbol-name symbol + - Function: symbol-name SYMBOL This function returns the string that is SYMBOL's name. For example: @@ -765,7 +764,7 @@ not a string, or if the obarray is not a vector. the name of the symbol, but fails to update the obarray, so don't do it! - - Function: make-symbol name + - Function: make-symbol NAME This function returns a newly-allocated, uninterned symbol whose name is NAME (which must be a string). Its value and function definition are void, and its property list is `nil'. In the @@ -777,7 +776,7 @@ not a string, or if the obarray is not a vector. (eq sym 'foo) => nil - - Function: intern name &optional obarray + - Function: intern NAME &optional OBARRAY This function returns the interned symbol whose name is NAME. If there is no such symbol in the obarray OBARRAY, `intern' creates a new one, adds it to the obarray, and returns it. If OBARRAY is @@ -793,7 +792,7 @@ not a string, or if the obarray is not a vector. (eq sym 'foo) => nil - - Function: intern-soft name &optional obarray + - Function: intern-soft NAME &optional OBARRAY This function returns the symbol in OBARRAY whose name is NAME, or `nil' if OBARRAY has no symbol with that name. Therefore, you can use `intern-soft' to test whether a symbol with a given name is @@ -806,10 +805,13 @@ not a string, or if the obarray is not a vector. => frazzle (intern-soft "frazzle") ; That one cannot be found. => nil + (setq sym (intern "frazzle")) ; Create an interned one. => frazzle + (intern-soft "frazzle") ; That one can be found! => frazzle + (eq sym 'frazzle) ; And it is the same one. => t @@ -817,7 +819,7 @@ not a string, or if the obarray is not a vector. This variable is the standard obarray for use by `intern' and `read'. - - Function: mapatoms function &optional obarray + - Function: mapatoms FUNCTION &optional OBARRAY This function calls FUNCTION for each symbol in the obarray OBARRAY. It returns `nil'. If OBARRAY is omitted, it defaults to the value of `obarray', the standard obarray for ordinary symbols. @@ -835,7 +837,7 @@ not a string, or if the obarray is not a vector. See `documentation' in *Note Accessing Documentation::, for another example using `mapatoms'. - - Function: unintern symbol &optional obarray + - Function: unintern SYMBOL &optional OBARRAY This function deletes SYMBOL from the obarray OBARRAY. If `symbol' is not actually in the obarray, `unintern' does nothing. If OBARRAY is `nil', the current obarray is used. @@ -854,17 +856,17 @@ File: lispref.info, Node: Symbol Properties, Prev: Creating Symbols, Up: Symb Symbol Properties ================= - A "property list" ("plist" for short) is a list of paired elements, -often stored in the property list cell of a symbol. Each of the pairs + A "property list" ("plist" for short) is a list of paired elements +stored in the property list cell of a symbol. Each of the pairs associates a property name (usually a symbol) with a property or value. Property lists are generally used to record information about a symbol, such as its documentation as a variable, the name of the file 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 with them, and XEmacs provides a full complement of -functions for working with property lists. *Note Property Lists::. + 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. *Note Property Lists::. The property names and values in a property list can be any Lisp objects, but the names are usually symbols. They are compared using @@ -880,16 +882,16 @@ the other two elements are the corresponding values. * 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.  -File: lispref.info, Node: Plists and Alists, Next: Object Plists, Up: Symbol Properties +File: lispref.info, Node: Plists and Alists, Next: Symbol Plists, Up: Symbol Properties Property Lists and Association Lists ------------------------------------ - Association lists (*note Association Lists::) are very similar to + Association lists (*note Association Lists::.) are very similar to property lists. In contrast to association lists, the order of the pairs in the property list is not significant since the property names must be distinct. @@ -917,23 +919,15 @@ are pushed on the front of the list and later discarded; this is not possible with a property list.  -File: lispref.info, Node: Object Plists, Next: Other Plists, Prev: Plists and Alists, Up: Symbol Properties +File: lispref.info, Node: Symbol Plists, Next: Other Plists, Prev: Plists and Alists, Up: Symbol Properties -Property List Functions for Objects +Property List Functions for Symbols ----------------------------------- - Once upon a time, only symbols had property lists. Now, several -other object types, including strings, extents, faces and glyphs also -have property lists. - - - Function: symbol-plist symbol + - Function: symbol-plist SYMBOL This function returns the property list of SYMBOL. - - Function: object-plist object - This function returns the property list of OBJECT. If OBJECT is a - symbol, this is identical to `symbol-plist'. - - - Function: setplist symbol plist + - Function: setplist SYMBOL PLIST This function sets SYMBOL's property list to PLIST. Normally, PLIST should be a well-formed property list, but this is not enforced. @@ -946,22 +940,21 @@ have property lists. 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 (*note - Abbrevs::). But generally, its use is discouraged. Use `put' - instead. `setplist' can only be used with symbols, not other - object types. + Abbrevs::.). - - Function: get object property &optional default + - Function: get SYMBOL PROPERTY This function finds the value of the property named PROPERTY in - OBJECT's property list. If there is no such property, `default' - (which itself defaults to `nil') is returned. + SYMBOL's property list. If there is no such property, `nil' is + returned. Thus, there is no distinction between a value of `nil' + and the absence of the property. - PROPERTY is compared with the existing properties using `eq', so - any object is a legitimate property. + The name PROPERTY is compared with the existing property names + using `eq', so any object is a legitimate property. See `put' for an example. - - Function: put object property value - This function puts VALUE onto OBJECT's property list under the + - Function: put SYMBOL PROPERTY VALUE + This function puts VALUE onto SYMBOL's property list under the property name PROPERTY, replacing any previous property value. The `put' function returns VALUE. @@ -971,36 +964,26 @@ have property lists. => (a buzzing little bug) (get 'fly 'verb) => transitive - (object-plist 'fly) + (symbol-plist 'fly) => (verb transitive noun (a buzzing little bug)) - - Function: remprop object property - This function removes the entry for PROPERTY from the property - list of OBJECT. It returns `t' if the property was indeed found - and removed, or `nil' if there was no such property. (This - function was probably omitted from Emacs originally because, since - `get' did not allow a DEFAULT, it was very difficult to - distinguish between a missing property and a property whose value - was `nil'; thus, setting a property to `nil' was close enough to - `remprop' for most purposes.) -  -File: lispref.info, Node: Other Plists, Prev: Object Plists, Up: Symbol Properties +File: lispref.info, Node: Other Plists, Prev: Symbol Plists, Up: Symbol Properties -Property Lists Not Associated with Objects ------------------------------------------- +Property Lists Outside Symbols +------------------------------ These functions are useful for manipulating property lists that are stored in places other than symbols: - - Function: getf plist property &optional default + - Function: getf PLIST PROPERTY &optional DEFAULT This returns the value of the PROPERTY property stored in the property list PLIST. For example, (getf '(foo 4) 'foo) => 4 - - Macro: putf plist property value + - Function: putf PLIST PROPERTY VALUE This stores VALUE as the value of the PROPERTY property in the property list PLIST. It may modify PLIST destructively, or it may construct a new list structure without altering the old. The @@ -1014,13 +997,13 @@ stored in places other than symbols: (setq my-plist (putf my-plist 'quux '(a))) => (quux (a) bar t foo 5) - - Function: plists-eq a b + - Function: plists-eq A B This function returns non-`nil' if property lists A and B are `eq'. This means that the property lists have the same values for all the same properties, where comparison between values is done using `eq'. - - Function: plists-equal a b + - Function: plists-equal A B This function returns non-`nil' if property lists A and B are `equal'. @@ -1104,7 +1087,7 @@ function `car'. in it. *Note Functions::. The execution of the function may itself work by evaluating the function definition; or the function may be a Lisp primitive implemented in C, or it may be a byte-compiled function -(*note Byte Compilation::). +(*note Byte Compilation::.). The evaluation of forms takes place in a context called the "environment", which consists of the current values and bindings of all @@ -1113,14 +1096,14 @@ creating a new binding for it, the value of the binding in the current environment is used. *Note Variables::. Evaluation of a form may create new environments for recursive -evaluation by binding variables (*note Local Variables::). These +evaluation by binding variables (*note Local Variables::.). These environments are temporary and vanish by the time evaluation of the form is complete. The form may also make changes that persist; these changes are called "side effects". An example of a form that produces side effects is `(setq foo 1)'. The details of what evaluation means for each kind of form are -described below (*note Forms::). +described below (*note Forms::.). ---------- Footnotes ---------- @@ -1146,13 +1129,13 @@ ability to pass information to them as arguments. The functions and variables described in this section evaluate forms, specify limits to the evaluation process, or record recently returned -values. Loading a file also does evaluation (*note Loading::). +values. Loading a file also does evaluation (*note Loading::.). - - Function: eval form + - Function: eval FORM This is the basic function for performing evaluation. It evaluates FORM in the current environment and returns the result. How the evaluation proceeds depends on the type of the object (*note - Forms::). + Forms::.). Since `eval' is a function, the argument expression that appears in a call to `eval' is evaluated twice: once as preparation before @@ -1172,7 +1155,7 @@ values. Loading a file also does evaluation (*note Loading::). The number of currently active calls to `eval' is limited to `max-lisp-eval-depth' (see below). - - Command: eval-region start end &optional stream + - Command: eval-region START END &optional STREAM This function evaluates the forms in the current buffer in the region defined by the positions START and END. It reads forms from the region and calls `eval' on them until the end of the region is @@ -1187,7 +1170,7 @@ values. Loading a file also does evaluation (*note Loading::). `eval-region' always returns `nil'. - - Command: eval-buffer buffer &optional stream + - Command: eval-buffer BUFFER &optional STREAM This is like `eval-region' except that it operates on the whole contents of BUFFER. @@ -1202,7 +1185,7 @@ values. Loading a file also does evaluation (*note Loading::). This limit, with the associated error when it is exceeded, is one way that Lisp avoids infinite recursion on an ill-defined function. - The default value of this variable is 1000. If you set it to a + The default value of this variable is 500. If you set it to a value less than 100, Lisp will reset it to 100 if the given value is reached. @@ -1260,8 +1243,45 @@ starting with "all other types" which are self-evaluating forms. we find the real function via the symbol. * Function Forms:: Forms that call functions. * Macro Forms:: Forms that call macros. -* Special Forms:: ``Special forms'' are idiosyncratic primitives, +* Special Forms:: "Special forms" are idiosyncratic primitives, most of them extremely important. * Autoloading:: Functions set up to load files containing their real definitions. + +File: lispref.info, Node: Self-Evaluating Forms, Next: Symbol Forms, Up: Forms + +Self-Evaluating Forms +--------------------- + + A "self-evaluating form" is any form that is not a list or symbol. +Self-evaluating forms evaluate to themselves: the result of evaluation +is the same object that was evaluated. Thus, the number 25 evaluates to +25, and the string `"foo"' evaluates to the string `"foo"'. Likewise, +evaluation of a vector does not cause evaluation of the elements of the +vector--it returns the same vector with its contents unchanged. + + '123 ; An object, shown without evaluation. + => 123 + 123 ; Evaluated as usual--result is the same. + => 123 + (eval '123) ; Evaluated "by hand"--result is the same. + => 123 + (eval (eval '123)) ; Evaluating twice changes nothing. + => 123 + + It is common to write numbers, characters, strings, and even vectors +in Lisp code, taking advantage of the fact that they self-evaluate. +However, it is quite unusual to do this for types that lack a read +syntax, because there's no way to write them textually. It is possible +to construct Lisp expressions containing these types by means of a Lisp +program. Here is an example: + + ;; Build an expression containing a buffer object. + (setq buffer (list 'print (current-buffer))) + => (print #) + ;; Evaluate it. + (eval buffer) + -| # + => # + diff --git a/info/lispref.info-8 b/info/lispref.info-8 index 333739c..379f384 100644 --- a/info/lispref.info-8 +++ b/info/lispref.info-8 @@ -1,5 +1,5 @@ -This is ../info/lispref.info, produced by makeinfo version 4.0 from -lispref/lispref.texi. +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -50,43 +50,6 @@ may be included in a translation approved by the Free Software Foundation instead of in the original English.  -File: lispref.info, Node: Self-Evaluating Forms, Next: Symbol Forms, Up: Forms - -Self-Evaluating Forms ---------------------- - - A "self-evaluating form" is any form that is not a list or symbol. -Self-evaluating forms evaluate to themselves: the result of evaluation -is the same object that was evaluated. Thus, the number 25 evaluates to -25, and the string `"foo"' evaluates to the string `"foo"'. Likewise, -evaluation of a vector does not cause evaluation of the elements of the -vector--it returns the same vector with its contents unchanged. - - '123 ; An object, shown without evaluation. - => 123 - 123 ; Evaluated as usual--result is the same. - => 123 - (eval '123) ; Evaluated "by hand"--result is the same. - => 123 - (eval (eval '123)) ; Evaluating twice changes nothing. - => 123 - - It is common to write numbers, characters, strings, and even vectors -in Lisp code, taking advantage of the fact that they self-evaluate. -However, it is quite unusual to do this for types that lack a read -syntax, because there's no way to write them textually. It is possible -to construct Lisp expressions containing these types by means of a Lisp -program. Here is an example: - - ;; Build an expression containing a buffer object. - (setq buffer (list 'print (current-buffer))) - => (print #) - ;; Evaluate it. - (eval buffer) - -| # - => # - - File: lispref.info, Node: Symbol Forms, Next: Classifying Lists, Prev: Self-Evaluating Forms, Up: Forms Symbol Forms @@ -128,7 +91,7 @@ macro, or special form. The first step in evaluating a nonempty list is to examine its first element. This element alone determines what kind of form the list is and how the rest of the list is to be processed. The first element is -_not_ evaluated, as it would be in some Lisp dialects such as Scheme. +*not* evaluated, as it would be in some Lisp dialects such as Scheme.  File: lispref.info, Node: Function Indirection, Next: Function Forms, Prev: Classifying Lists, Up: Forms @@ -159,7 +122,7 @@ these types, the error `invalid-function' is signaled. The following example illustrates the symbol indirection process. We use `fset' to set the function cell of a symbol and `symbol-function' -to get the function cell contents (*note Function Cells::). +to get the function cell contents (*note Function Cells::.). Specifically, we store the symbol `car' into the function cell of `first', and the symbol `first' into the function cell of `erste'. @@ -170,10 +133,13 @@ Specifically, we store the symbol `car' into the function cell of (symbol-function 'car) => # + (fset 'first 'car) => car + (fset 'erste 'first) => first + (erste '(1 2 3)) ; Call the function referenced by `erste'. => 1 @@ -191,11 +157,11 @@ symbol function indirection when calling `erste'. The built-in function `indirect-function' provides an easy way to perform symbol function indirection explicitly. - - Function: indirect-function object - This function returns the meaning of OBJECT as a function. If - OBJECT is a symbol, then it finds OBJECT's function definition and - starts over with that value. If OBJECT is not a symbol, then it - returns OBJECT itself. + - Function: indirect-function FUNCTION + This function returns the meaning of FUNCTION as a function. If + FUNCTION is a symbol, then it finds FUNCTION's function definition + and starts over with that value. If FUNCTION is not a symbol, + then it returns FUNCTION itself. Here is how you could define `indirect-function' in Lisp: @@ -220,9 +186,9 @@ a "function call". For example, here is a call to the function `+': remaining elements of the list from left to right. The results are the actual argument values, one value for each list element. The next step is to call the function with this list of arguments, effectively using -the function `apply' (*note Calling Functions::). If the function is +the function `apply' (*note Calling Functions::.). If the function is written in Lisp, the arguments are used to bind the argument variables -of the function (*note Lambda Expressions::); then the forms in the +of the function (*note Lambda Expressions::.); then the forms in the function body are evaluated in order, and the value of the last body form becomes the value of the function call. @@ -234,7 +200,7 @@ Lisp Macro Evaluation If the first element of a list being evaluated is a macro object, then the list is a "macro call". When a macro call is evaluated, the -elements of the rest of the list are _not_ initially evaluated. +elements of the rest of the list are *not* initially evaluated. Instead, these elements themselves are used as the arguments of the macro. The macro definition computes a replacement form, called the "expansion" of the macro, to be evaluated in place of the original @@ -284,82 +250,82 @@ evaluated may depend on the results of evaluating other arguments. XEmacs Lisp with a reference to where each is described. `and' - *note Combining Conditions:: + *note Combining Conditions::. `catch' - *note Catch and Throw:: + *note Catch and Throw::. `cond' - *note Conditionals:: + *note Conditionals::. `condition-case' - *note Handling Errors:: + *note Handling Errors::. `defconst' - *note Defining Variables:: + *note Defining Variables::. `defmacro' - *note Defining Macros:: + *note Defining Macros::. `defun' - *note Defining Functions:: + *note Defining Functions::. `defvar' - *note Defining Variables:: + *note Defining Variables::. `function' - *note Anonymous Functions:: + *note Anonymous Functions::. `if' - *note Conditionals:: + *note Conditionals::. `interactive' - *note Interactive Call:: + *note Interactive Call::. `let' `let*' - *note Local Variables:: + *note Local Variables::. `or' - *note Combining Conditions:: + *note Combining Conditions::. `prog1' `prog2' `progn' - *note Sequencing:: + *note Sequencing::. `quote' - *note Quoting:: + *note Quoting::. `save-current-buffer' - *note Excursions:: + *note Excursions::. `save-excursion' - *note Excursions:: + *note Excursions::. `save-restriction' - *note Narrowing:: + *note Narrowing::. `save-selected-window' - *note Excursions:: + *note Excursions::. `save-window-excursion' - *note Window Configurations:: + *note Window Configurations::. `setq' - *note Setting Variables:: + *note Setting Variables::. `setq-default' - *note Creating Buffer-Local:: + *note Creating Buffer-Local::. `unwind-protect' - *note Nonlocal Exits:: + *note Nonlocal Exits::. `while' - *note Iteration:: + *note Iteration::. `with-output-to-temp-buffer' - *note Temporary Displays:: + *note Temporary Displays::. Common Lisp note: here are some comparisons of special forms in XEmacs Lisp and Common Lisp. `setq', `if', and `catch' are @@ -395,7 +361,7 @@ and lists, which are not self-evaluating objects, in a program. (It is not necessary to quote self-evaluating objects such as numbers, strings, and vectors.) - - Special Form: quote object + - Special Form: quote OBJECT This special form returns OBJECT, without evaluating it. Because `quote' is used so often in programs, Lisp provides a @@ -420,9 +386,9 @@ syntax `'x' is an abbreviation for `(quote x)'. => [(quote foo)] Other quoting constructs include `function' (*note Anonymous -Functions::), which causes an anonymous lambda expression written in -Lisp to be compiled, and ``' (*note Backquote::), which is used to quote -only part of a list, while computing and substituting other parts. +Functions::.), which causes an anonymous lambda expression written in +Lisp to be compiled, and ``' (*note Backquote::.), which is used to +quote only part of a list, while computing and substituting other parts.  File: lispref.info, Node: Control Structures, Next: Variables, Prev: Evaluation, Up: Top @@ -430,7 +396,7 @@ File: lispref.info, Node: Control Structures, Next: Variables, Prev: Evaluati Control Structures ****************** - A Lisp program consists of expressions or "forms" (*note Forms::). + A Lisp program consists of expressions or "forms" (*note Forms::.). We control the order of execution of the forms by enclosing them in "control structures". Control structures are special forms which control when, whether, or how many times to execute the forms they @@ -452,7 +418,7 @@ other varieties of sequencing, conditionals, iteration, and (controlled) jumps--all discussed below. The built-in control structures are special forms since their subforms are not necessarily evaluated or not evaluated sequentially. You can use macros to define your own control -structure constructs (*note Macros::). +structure constructs (*note Macros::.). * Menu: @@ -492,7 +458,7 @@ structures likewise contain an implicit `progn'. As a result, `progn' is not used as often as it used to be. It is needed now most often inside an `unwind-protect', `and', `or', or in the THEN-part of an `if'. - - Special Form: progn forms... + - Special Form: progn FORMS... This special form evaluates all of the FORMS, in textual order, returning the result of the final form. @@ -507,7 +473,7 @@ inside an `unwind-protect', `and', `or', or in the THEN-part of an `if'. Two other control constructs likewise evaluate a series of forms but return a different value: - - Special Form: prog1 form1 forms... + - Special Form: prog1 FORM1 FORMS... This special form evaluates FORM1 and all of the FORMS, in textual order, returning the result of FORM1. @@ -524,7 +490,7 @@ return a different value: (prog1 (car x) (setq x (cdr x))) - - Special Form: prog2 form1 form2 forms... + - Special Form: prog2 FORM1 FORM2 FORMS... This special form evaluates FORM1, FORM2, and all of the following FORMS, in textual order, returning the result of FORM2. @@ -546,7 +512,7 @@ Conditionals Lisp has two conditional forms: `if', which is much the same as in other languages, and `cond', which is a generalized case statement. - - Special Form: if condition then-form else-forms... + - Special Form: if CONDITION THEN-FORM ELSE-FORMS... `if' chooses between the THEN-FORM and the ELSE-FORMS based on the value of CONDITION. If the evaluated CONDITION is non-`nil', THEN-FORM is evaluated and the result returned. Otherwise, the @@ -566,7 +532,7 @@ languages, and `cond', which is a generalized case statement. 'very-false) => very-false - - Special Form: cond clause... + - Special Form: cond CLAUSE... `cond' chooses among an arbitrary number of alternatives. Each CLAUSE in the `cond' must be a list. The CAR of this list is the CONDITION; the remaining elements, if any, the BODY-FORMS. Thus, @@ -637,13 +603,13 @@ with `if' and `cond' to express complicated conditions. The constructs `and' and `or' can also be used individually as kinds of multiple conditional constructs. - - Function: not condition + - Function: not CONDITION This function tests for the falsehood of CONDITION. It returns `t' if CONDITION is `nil', and `nil' otherwise. The function `not' is identical to `null', and we recommend using the name `null' if you are testing for an empty list. - - Special Form: and conditions... + - Special Form: and CONDITIONS... The `and' special form tests whether all the CONDITIONS are true. It works by evaluating the CONDITIONS one by one in the order written. @@ -682,7 +648,7 @@ conditional constructs. == (cond (ARG1 (cond (ARG2 ARG3)))) - - Special Form: or conditions... + - Special Form: or CONDITIONS... The `or' special form tests whether at least one of the CONDITIONS is true. It works by evaluating all the CONDITIONS one by one in the order written. @@ -730,7 +696,7 @@ example, you might want to repeat some computation once for each element of a list, or once for each integer from 0 to N. You can do this in XEmacs Lisp with the special form `while': - - Special Form: while condition forms... + - Special Form: while CONDITION FORMS... `while' first evaluates CONDITION. If the result is non-`nil', it evaluates FORMS in textual order. Then it reevaluates CONDITION, and if the result is non-`nil', it evaluates FORMS again. This @@ -738,7 +704,8 @@ XEmacs Lisp with the special form `while': There is no limit on the number of iterations that may occur. The loop will continue until either CONDITION evaluates to `nil' or - until an error or `throw' jumps out of it (*note Nonlocal Exits::). + until an error or `throw' jumps out of it (*note Nonlocal + Exits::.). The value of a `while' form is always `nil'. @@ -819,12 +786,12 @@ innermost one takes precedence. `catch', including function calls. When binding constructs such as `let' or function calls are exited in this way, the bindings are unbound, just as they are when these constructs exit normally (*note -Local Variables::). Likewise, `throw' restores the buffer and position -saved by `save-excursion' (*note Excursions::), and the narrowing -status saved by `save-restriction' and the window selection saved by -`save-window-excursion' (*note Window Configurations::). It also runs -any cleanups established with the `unwind-protect' special form when it -exits that form (*note Cleanups::). +Local Variables::.). Likewise, `throw' restores the buffer and +position saved by `save-excursion' (*note Excursions::.), and the +narrowing status saved by `save-restriction' and the window selection +saved by `save-window-excursion' (*note Window Configurations::.). It +also runs any cleanups established with the `unwind-protect' special +form when it exits that form (*note Cleanups::.). The `throw' need not appear lexically within the `catch' that it jumps to. It can equally well be called from another function called @@ -832,14 +799,14 @@ within the `catch'. As long as the `throw' takes place chronologically after entry to the `catch', and chronologically before exit from it, it has access to that `catch'. This is why `throw' can be used in commands such as `exit-recursive-edit' that throw back to the editor -command loop (*note Recursive Editing::). +command loop (*note Recursive Editing::.). Common Lisp note: Most other versions of Lisp, including Common Lisp, have several ways of transferring control nonsequentially: `return', `return-from', and `go', for example. XEmacs Lisp has only `throw'. - - Special Form: catch tag body... + - Special Form: catch TAG BODY... `catch' establishes a return point for the `throw' function. The return point is distinguished from other such return points by TAG, which may be any Lisp object. The argument TAG is evaluated @@ -854,7 +821,7 @@ command loop (*note Recursive Editing::). the `catch' exits immediately; the value it returns is whatever was specified as the second argument of `throw'. - - Function: throw tag value + - Function: throw TAG VALUE The purpose of `throw' is to return from a return point previously established with `catch'. The argument TAG is used to choose among the various existing return points; it must be `eq' to the @@ -974,131 +941,19 @@ How to Signal an Error Most errors are signaled "automatically" within Lisp primitives which you call for other purposes, such as if you try to take the CAR of an integer or move forward a character at the end of the buffer; you -can also signal errors explicitly with the functions `error', `signal', -and others. +can also signal errors explicitly with the functions `error' and +`signal'. Quitting, which happens when the user types `C-g', is not considered an error, but it is handled almost like an error. *Note Quitting::. - XEmacs has a rich hierarchy of error symbols predefined via -`deferror'. - - error - syntax-error - invalid-read-syntax - list-formation-error - malformed-list - malformed-property-list - circular-list - circular-property-list - - invalid-argument - wrong-type-argument - args-out-of-range - wrong-number-of-arguments - invalid-function - no-catch - - invalid-state - void-function - cyclic-function-indirection - void-variable - cyclic-variable-indirection - - invalid-operation - invalid-change - setting-constant - editing-error - beginning-of-buffer - end-of-buffer - buffer-read-only - io-error - end-of-file - arith-error - range-error - domain-error - singularity-error - overflow-error - underflow-error - - The five most common errors you will probably use or base your new -errors off of are `syntax-error', `invalid-argument', `invalid-state', -`invalid-operation', and `invalid-change'. Note the semantic -differences: - - * `syntax-error' is for errors in complex structures: parsed strings, - lists, and the like. - - * `invalid-argument' is for errors in a simple value. Typically, the - entire value, not just one part of it, is wrong. - - * `invalid-state' means that some settings have been changed in such - a way that their current state is unallowable. More and more, - code is being written more carefully, and catches the error when - the settings are being changed, rather than afterwards. This - leads us to the next error: - - * `invalid-change' means that an attempt is being made to change some - settings into an invalid state. `invalid-change' is a type of - `invalid-operation'. - - * `invalid-operation' refers to all cases where code is trying to do - something that's disallowed. This includes file errors, buffer - errors (e.g. running off the end of a buffer), `invalid-change' as - just mentioned, and arithmetic errors. - - - Function: error datum &rest args - This function signals a non-continuable error. - - DATUM should normally be an error symbol, i.e. a symbol defined - using `define-error'. ARGS will be made into a list, and DATUM - and ARGS passed as the two arguments to `signal', the most basic - error handling function. - - This error is not continuable: you cannot continue execution after - the error using the debugger `r' command. See also `cerror'. - - The correct semantics of ARGS varies from error to error, but for - most errors that need to be generated in Lisp code, the first - argument should be a string describing the *context* of the error - (i.e. the exact operation being performed and what went wrong), - and the remaining arguments or \"frobs\" (most often, there is - one) specify the offending object(s) and/or provide additional - details such as the exact error when a file error occurred, e.g.: - - * the buffer in which an editing error occurred. - - * an invalid value that was encountered. (In such cases, the - string should describe the purpose or \"semantics\" of the - value [e.g. if the value is an argument to a function, the - name of the argument; if the value is the value corresponding - to a keyword, the name of the keyword; if the value is - supposed to be a list length, say this and say what the - purpose of the list is; etc.] as well as specifying why the - value is invalid, if that's not self-evident.) - - * the file in which an error occurred. (In such cases, there - should be a second frob, probably a string, specifying the - exact error that occurred. This does not occur in the string - that precedes the first frob, because that frob describes the - exact operation that was happening. - - For historical compatibility, DATUM can also be a string. In this - case, DATUM and ARGS are passed together as the arguments to - `format', and then an error is signalled using the error symbol - `error' and formatted string. Although this usage of `error' is - very common, it is deprecated because it totally defeats the - purpose of having structured errors. There is now a rich set of - defined errors to use. - - See also `cerror', `signal', and `signal-error'." + - Function: error FORMAT-STRING &rest ARGS + This function signals an error with an error message constructed by + applying `format' (*note String Conversion::.) to FORMAT-STRING + and ARGS. These examples show typical uses of `error': - (error 'syntax-error - "Dialog descriptor must supply at least one button" - descriptor) - (error "You have committed an error. Try something else.") error--> You have committed an error. @@ -1107,20 +962,19 @@ differences: (error "You have committed %d errors." 10) error--> You have committed 10 errors. + `error' works by calling `signal' with two arguments: the error + symbol `error', and a list containing the string returned by + `format'. + If you want to use your own string as an error message verbatim, don't just write `(error STRING)'. If STRING contains `%', it will be interpreted as a format specifier, with undesirable results. Instead, use `(error "%s" STRING)'. - - Function: cerror datum &rest args - This function behaves like `error', except that the error it - signals is continuable. That means that debugger commands `c' and - `r' can resume execution. - - - Function: signal error-symbol data - This function signals a continuable error named by ERROR-SYMBOL. - The argument DATA is a list of additional Lisp objects relevant to - the circumstances of the error. + - Function: signal ERROR-SYMBOL DATA + This function signals an error named by ERROR-SYMBOL. The + argument DATA is a list of additional Lisp objects relevant to the + circumstances of the error. The argument ERROR-SYMBOL must be an "error symbol"--a symbol bearing a property `error-conditions' whose value is a list of @@ -1128,51 +982,28 @@ differences: sorts of errors. The number and significance of the objects in DATA depends on - ERROR-SYMBOL. For example, with a `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. *Note Error Symbols::, for a description of error symbols. + ERROR-SYMBOL. For example, with a `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. + *Note Error Symbols::, for a description of error symbols. Both ERROR-SYMBOL and DATA are available to any error handlers that handle the error: `condition-case' binds a local variable to a list of the form `(ERROR-SYMBOL . DATA)' (*note Handling - Errors::). If the error is not handled, these two values are used - in printing the error message. + Errors::.). If the error is not handled, these two values are + used in printing the error message. - The function `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 `signal-error' instead. Note that - in FSF Emacs `signal' never returns. + The function `signal' never returns (though in older Emacs versions + it could sometimes return). (signal 'wrong-number-of-arguments '(x y)) error--> Wrong number of arguments: x, y - - (signal 'no-such-error '("My unknown error condition")) - error--> Peculiar error (no-such-error "My unknown error condition") - - - Function: signal-error error-symbol data - This function behaves like `signal', except that the error it - signals is not continuable. - - - Macro: check-argument-type predicate argument - This macro checks that ARGUMENT satisfies PREDICATE. If that is - not the case, it signals a continuable `wrong-type-argument' error - until the returned value satisfies PREDICATE, and assigns the - returned value to ARGUMENT. In other words, execution of the - program will not continue until PREDICATE is met. - - ARGUMENT is not evaluated, and should be a symbol. PREDICATE is - evaluated, and should name a function. - As shown in the following example, `check-argument-type' is useful - in low-level code that attempts to ensure the sanity of its data - before proceeding. + (signal 'no-such-error '("My unknown error condition.")) + error--> peculiar error: "My unknown error condition." - (defun cache-object-internal (object wlist) - ;; Before doing anything, make sure that WLIST is indeed - ;; a weak list, which is what we expect. - (check-argument-type 'weak-list-p wlist) - ...) + Common Lisp note: XEmacs Lisp has nothing like the Common Lisp + concept of continuable errors.  File: lispref.info, Node: Processing of Errors, Next: Handling Errors, Prev: Signaling Errors, Up: Errors @@ -1195,28 +1026,242 @@ the command loop has an implicit handler for all kinds of errors. The command loop's handler uses the error symbol and associated data to print an error message. - Errors in command loop are processed using the `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. - - - Function: display-error error-object stream - This function displays ERROR-OBJECT on STREAM. 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 `display-error' property, that function is invoked for printing - the actual error message. Otherwise, the error is printed as - `Error: arg1, arg2, ...'. - - - Function: error-message-string error-object - This function converts ERROR-OBJECT to an error message string, - and returns it. The message is equivalent to the one that would be - printed by `display-error', except that it is conveniently returned - in string form. - An error that has no explicit handler may call the Lisp debugger. The debugger is enabled if the variable `debug-on-error' (*note Error -Debugging::) is non-`nil'. Unlike error handlers, the debugger runs in -the environment of the error, so that you can examine values of +Debugging::.) is non-`nil'. Unlike error handlers, the debugger runs +in the environment of the error, so that you can examine values of variables precisely as they were at the time of the error. + +File: lispref.info, Node: Handling Errors, Next: Error Symbols, Prev: Processing of Errors, Up: Errors + +Writing Code to Handle Errors +............................. + + The usual effect of signaling an error is to terminate the command +that is running and return immediately to the XEmacs editor command +loop. You can arrange to trap errors occurring in a part of your +program by establishing an error handler, with the special form +`condition-case'. A simple example looks like this: + + (condition-case nil + (delete-file filename) + (error nil)) + +This deletes the file named FILENAME, catching any error and returning +`nil' if an error occurs. + + The second argument of `condition-case' is called the "protected +form". (In the example above, the protected form is a call to +`delete-file'.) The error handlers go into effect when this form +begins execution and are deactivated when this form returns. They +remain in effect for all the intervening time. In particular, they are +in effect during the execution of functions called by this form, in +their subroutines, and so on. This is a good thing, since, strictly +speaking, errors can be signaled only by Lisp primitives (including +`signal' and `error') called by the protected form, not by the +protected form itself. + + The arguments after the protected form are handlers. Each handler +lists one or more "condition names" (which are symbols) to specify +which errors it will handle. The error symbol specified when an error +is signaled also defines a list of condition names. A handler applies +to an error if they have any condition names in common. In the example +above, there is one handler, and it specifies one condition name, +`error', which covers all errors. + + The search for an applicable handler checks all the established +handlers starting with the most recently established one. Thus, if two +nested `condition-case' forms offer to handle the same error, the inner +of the two will actually handle it. + + When an error is handled, control returns to the handler. Before +this happens, XEmacs unbinds all variable bindings made by binding +constructs that are being exited and executes the cleanups of all +`unwind-protect' forms that are exited. Once control arrives at the +handler, the body of the handler is executed. + + After execution of the handler body, execution continues by returning +from the `condition-case' form. Because the protected form is exited +completely before execution of the handler, the handler cannot resume +execution at the point of the error, nor can it examine variable +bindings that were made within the protected form. All it can do is +clean up and proceed. + + `condition-case' is often used to trap errors that are predictable, +such as failure to open a file in a call to `insert-file-contents'. It +is also used to trap errors that are totally unpredictable, such as +when the program evaluates an expression read from the user. + + Error signaling and handling have some resemblance to `throw' and +`catch', but they are entirely separate facilities. An error cannot be +caught by a `catch', and a `throw' cannot be handled by an error +handler (though using `throw' when there is no suitable `catch' signals +an error that can be handled). + + - Special Form: condition-case VAR PROTECTED-FORM HANDLERS... + This special form establishes the error handlers HANDLERS around + the execution of PROTECTED-FORM. If PROTECTED-FORM executes + without error, the value it returns becomes the value of the + `condition-case' form; in this case, the `condition-case' has no + effect. The `condition-case' form makes a difference when an + error occurs during PROTECTED-FORM. + + Each of the HANDLERS is a list of the form `(CONDITIONS BODY...)'. + Here CONDITIONS is an error condition name to be handled, or a + list of condition names; BODY is one or more Lisp expressions to + be executed when this handler handles an error. Here are examples + of handlers: + + (error nil) + + (arith-error (message "Division by zero")) + + ((arith-error file-error) + (message + "Either division by zero or failure to open a file")) + + Each error that occurs has an "error symbol" that describes what + kind of error it is. The `error-conditions' property of this + symbol is a list of condition names (*note Error Symbols::.). + Emacs searches all the active `condition-case' forms for a handler + that specifies one or more of these condition names; the innermost + matching `condition-case' handles the error. Within this + `condition-case', the first applicable handler handles the error. + + After executing the body of the handler, the `condition-case' + returns normally, using the value of the last form in the handler + body as the overall value. + + The argument VAR is a variable. `condition-case' does not bind + this variable when executing the PROTECTED-FORM, only when it + handles an error. At that time, it binds VAR locally to a list of + the form `(ERROR-SYMBOL . DATA)', giving the particulars of the + error. The handler can refer to this list to decide what to do. + For example, if the error is for failure opening a file, the file + name is the second element of DATA--the third element of VAR. + + If VAR is `nil', that means no variable is bound. Then the error + symbol and associated data are not available to the handler. + + Here is an example of using `condition-case' to handle the error +that results from dividing by zero. The handler prints out a warning +message and returns a very large number. + + (defun safe-divide (dividend divisor) + (condition-case err + ;; Protected form. + (/ dividend divisor) + ;; The handler. + (arith-error ; Condition. + (princ (format "Arithmetic error: %s" err)) + 1000000))) + => safe-divide + + (safe-divide 5 0) + -| Arithmetic error: (arith-error) + => 1000000 + +The handler specifies condition name `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 `condition-case'. Thus, + + (safe-divide nil 3) + error--> Wrong type argument: integer-or-marker-p, nil + + Here is a `condition-case' that catches all kinds of errors, +including those signaled with `error': + + (setq baz 34) + => 34 + + (condition-case err + (if (eq baz 35) + t + ;; This is a call to the function `error'. + (error "Rats! The variable %s was %s, not 35" 'baz baz)) + ;; This is the handler; it is not a form. + (error (princ (format "The error was: %s" err)) + 2)) + -| The error was: (error "Rats! The variable baz was 34, not 35") + => 2 + + +File: lispref.info, Node: Error Symbols, Prev: Handling Errors, Up: Errors + +Error Symbols and Condition Names +................................. + + When you signal an error, you specify an "error symbol" to specify +the kind of error you have in mind. Each error has one and only one +error symbol to categorize it. This is the finest classification of +errors defined by the XEmacs Lisp language. + + These narrow classifications are grouped into a hierarchy of wider +classes called "error conditions", identified by "condition names". +The narrowest such classes belong to the error symbols themselves: each +error symbol is also a condition name. There are also condition names +for more extensive classes, up to the condition name `error' which +takes in all kinds of errors. Thus, each error has one or more +condition names: `error', the error symbol if that is distinct from +`error', and perhaps some intermediate classifications. + + In order for a symbol to be an error symbol, it must have an +`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 `error', should always be +members of this list.) Thus, the hierarchy of condition names is +defined by the `error-conditions' properties of the error symbols. + + In addition to the `error-conditions' list, the error symbol should +have an `error-message' property whose value is a string to be printed +when that error is signaled but not handled. If the `error-message' +property exists, but is not a string, the error message `peculiar +error' is used. + + Here is how we define a new error symbol, `new-error': + + (put 'new-error + 'error-conditions + '(error my-own-errors new-error)) + => (error my-own-errors new-error) + (put 'new-error 'error-message "A new error") + => "A new error" + +This error has three condition names: `new-error', the narrowest +classification; `my-own-errors', which we imagine is a wider +classification; and `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 `new-error' on its own; only an +explicit call to `signal' (*note Signaling Errors::.) in your code can +do this: + + (signal 'new-error '(x y)) + error--> A new error: x, y + + This error can be handled through any of the three condition names. +This example handles `new-error' and any other errors in the class +`my-own-errors': + + (condition-case foo + (bar nil t) + (my-own-errors nil)) + + The significant way that errors are classified is by their condition +names--the names used to match errors with handlers. An error symbol +serves only as a convenient way to specify the intended error message +and list of condition names. It would be cumbersome to give `signal' a +list of condition names rather than one error symbol. + + By contrast, using only error symbols without condition names would +seriously decrease the power of `condition-case'. Condition names make +it possible to categorize errors at various levels of generality when +you write an error handler. Using error symbols alone would eliminate +all but the narrowest level of classification. + + *Note Standard Errors::, for a list of all the standard error symbols +and their conditions. + diff --git a/info/lispref.info-9 b/info/lispref.info-9 index 5e15da6..579cb35 100644 --- a/info/lispref.info-9 +++ b/info/lispref.info-9 @@ -1,5 +1,5 @@ -This is ../info/lispref.info, produced by makeinfo version 4.0 from -lispref/lispref.texi. +This is Info file ../../info/lispref.info, produced by Makeinfo version +1.68 from the input file lispref.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -50,252 +50,6 @@ may be included in a translation approved by the Free Software Foundation instead of in the original English.  -File: lispref.info, Node: Handling Errors, Next: Error Symbols, Prev: Processing of Errors, Up: Errors - -Writing Code to Handle Errors -............................. - - The usual effect of signaling an error is to terminate the command -that is running and return immediately to the XEmacs editor command -loop. You can arrange to trap errors occurring in a part of your -program by establishing an error handler, with the special form -`condition-case'. A simple example looks like this: - - (condition-case nil - (delete-file filename) - (error nil)) - -This deletes the file named FILENAME, catching any error and returning -`nil' if an error occurs. - - The second argument of `condition-case' is called the "protected -form". (In the example above, the protected form is a call to -`delete-file'.) The error handlers go into effect when this form -begins execution and are deactivated when this form returns. They -remain in effect for all the intervening time. In particular, they are -in effect during the execution of functions called by this form, in -their subroutines, and so on. This is a good thing, since, strictly -speaking, errors can be signaled only by Lisp primitives (including -`signal' and `error') called by the protected form, not by the -protected form itself. - - The arguments after the protected form are handlers. Each handler -lists one or more "condition names" (which are symbols) to specify -which errors it will handle. The error symbol specified when an error -is signaled also defines a list of condition names. A handler applies -to an error if they have any condition names in common. In the example -above, there is one handler, and it specifies one condition name, -`error', which covers all errors. - - The search for an applicable handler checks all the established -handlers starting with the most recently established one. Thus, if two -nested `condition-case' forms offer to handle the same error, the inner -of the two will actually handle it. - - When an error is handled, control returns to the handler. Before -this happens, XEmacs unbinds all variable bindings made by binding -constructs that are being exited and executes the cleanups of all -`unwind-protect' forms that are exited. Once control arrives at the -handler, the body of the handler is executed. - - After execution of the handler body, execution continues by returning -from the `condition-case' form. Because the protected form is exited -completely before execution of the handler, the handler cannot resume -execution at the point of the error, nor can it examine variable -bindings that were made within the protected form. All it can do is -clean up and proceed. - - `condition-case' is often used to trap errors that are predictable, -such as failure to open a file in a call to `insert-file-contents'. It -is also used to trap errors that are totally unpredictable, such as -when the program evaluates an expression read from the user. - - Even when an error is handled, the debugger may still be called if -the variable `debug-on-signal' (*note Error Debugging::) is non-`nil'. -Note that this may yield unpredictable results with code that traps -expected errors as normal part of its operation. Do not set -`debug-on-signal' unless you know what you are doing. - - Error signaling and handling have some resemblance to `throw' and -`catch', but they are entirely separate facilities. An error cannot be -caught by a `catch', and a `throw' cannot be handled by an error -handler (though using `throw' when there is no suitable `catch' signals -an error that can be handled). - - - Special Form: condition-case var protected-form handlers... - This special form establishes the error handlers HANDLERS around - the execution of PROTECTED-FORM. If PROTECTED-FORM executes - without error, the value it returns becomes the value of the - `condition-case' form; in this case, the `condition-case' has no - effect. The `condition-case' form makes a difference when an - error occurs during PROTECTED-FORM. - - Each of the HANDLERS is a list of the form `(CONDITIONS BODY...)'. - Here CONDITIONS is an error condition name to be handled, or a - list of condition names; BODY is one or more Lisp expressions to - be executed when this handler handles an error. Here are examples - of handlers: - - (error nil) - - (arith-error (message "Division by zero")) - - ((arith-error file-error) - (message - "Either division by zero or failure to open a file")) - - Each error that occurs has an "error symbol" that describes what - kind of error it is. The `error-conditions' property of this - symbol is a list of condition names (*note Error Symbols::). Emacs - searches all the active `condition-case' forms for a handler that - specifies one or more of these condition names; the innermost - matching `condition-case' handles the error. Within this - `condition-case', the first applicable handler handles the error. - - After executing the body of the handler, the `condition-case' - returns normally, using the value of the last form in the handler - body as the overall value. - - The argument VAR is a variable. `condition-case' does not bind - this variable when executing the PROTECTED-FORM, only when it - handles an error. At that time, it binds VAR locally to a list of - the form `(ERROR-SYMBOL . DATA)', giving the particulars of the - error. The handler can refer to this list to decide what to do. - For example, if the error is for failure opening a file, the file - name is the second element of DATA--the third element of VAR. - - If VAR is `nil', that means no variable is bound. Then the error - symbol and associated data are not available to the handler. - - Here is an example of using `condition-case' to handle the error -that results from dividing by zero. The handler prints out a warning -message and returns a very large number. - - (defun safe-divide (dividend divisor) - (condition-case err - ;; Protected form. - (/ dividend divisor) - ;; The handler. - (arith-error ; Condition. - (princ (format "Arithmetic error: %s" err)) - 1000000))) - => safe-divide - - (safe-divide 5 0) - -| Arithmetic error: (arith-error) - => 1000000 - -The handler specifies condition name `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 `condition-case'. Thus, - - (safe-divide nil 3) - error--> Wrong type argument: integer-or-marker-p, nil - - Here is a `condition-case' that catches all kinds of errors, -including those signaled with `error': - - (setq baz 34) - => 34 - - (condition-case err - (if (eq baz 35) - t - ;; This is a call to the function `error'. - (error "Rats! The variable %s was %s, not 35" 'baz baz)) - ;; This is the handler; it is not a form. - (error (princ (format "The error was: %s" err)) - 2)) - -| The error was: (error "Rats! The variable baz was 34, not 35") - => 2 - - -File: lispref.info, Node: Error Symbols, Prev: Handling Errors, Up: Errors - -Error Symbols and Condition Names -................................. - - When you signal an error, you specify an "error symbol" to specify -the kind of error you have in mind. Each error has one and only one -error symbol to categorize it. This is the finest classification of -errors defined by the XEmacs Lisp language. - - These narrow classifications are grouped into a hierarchy of wider -classes called "error conditions", identified by "condition names". -The narrowest such classes belong to the error symbols themselves: each -error symbol is also a condition name. There are also condition names -for more extensive classes, up to the condition name `error' which -takes in all kinds of errors. Thus, each error has one or more -condition names: `error', the error symbol if that is distinct from -`error', and perhaps some intermediate classifications. - - In other words, each error condition "inherits" from another error -condition, with `error' sitting at the top of the inheritance hierarchy. - - - Function: define-error error-symbol error-message &optional - inherits-from - This function defines a new error, denoted by ERROR-SYMBOL. - ERROR-MESSAGE is an informative message explaining the error, and - will be printed out when an unhandled error occurs. ERROR-SYMBOL - is a sub-error of INHERITS-FROM (which defaults to `error'). - - `define-error' internally works by putting on ERROR-SYMBOL an - `error-message' property whose value is ERROR-MESSAGE, and an - `error-conditions' property that is a list of ERROR-SYMBOL - followed by each of its super-errors, up to and including `error'. - You will sometimes see code that sets this up directly rather than - calling `define-error', but you should _not_ do this yourself, - unless you wish to maintain compatibility with FSF Emacs, which - does not provide `define-error'. - - Here is how we define a new error symbol, `new-error', that belongs -to a range of errors called `my-own-errors': - - (define-error 'my-own-errors "A whole range of errors" 'error) - (define-error 'new-error "A new error" 'my-own-errors) - -`new-error' has three condition names: `new-error', the narrowest -classification; `my-own-errors', which we imagine is a wider -classification; and `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 -`new-error' before `my-own-errors' are defined will signal an error. - - 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 `new-error' on its own; only an -explicit call to `signal' (*note Signaling Errors::) in your code can -do this: - - (signal 'new-error '(x y)) - error--> A new error: x, y - - This error can be handled through any of the three condition names. -This example handles `new-error' and any other errors in the class -`my-own-errors': - - (condition-case foo - (bar nil t) - (my-own-errors nil)) - - The significant way that errors are classified is by their condition -names--the names used to match errors with handlers. An error symbol -serves only as a convenient way to specify the intended error message -and list of condition names. It would be cumbersome to give `signal' a -list of condition names rather than one error symbol. - - By contrast, using only error symbols without condition names would -seriously decrease the power of `condition-case'. Condition names make -it possible to categorize errors at various levels of generality when -you write an error handler. Using error symbols alone would eliminate -all but the narrowest level of classification. - - *Note Standard Errors::, for a list of all the standard error symbols -and their conditions. - - File: lispref.info, Node: Cleanups, Prev: Errors, Up: Nonlocal Exits Cleaning Up from Nonlocal Exits @@ -305,7 +59,7 @@ Cleaning Up from Nonlocal Exits put a data structure in an inconsistent state; it permits you to ensure the data are consistent in the event of an error or throw. - - Special Form: unwind-protect body cleanup-forms... + - Special Form: unwind-protect BODY CLEANUP-FORMS... `unwind-protect' executes the BODY with a guarantee that the CLEANUP-FORMS will be evaluated if control leaves BODY, no matter how that happens. The BODY may complete normally, or execute a @@ -319,14 +73,14 @@ the data are consistent in the event of an error or throw. Only the BODY is actually protected by the `unwind-protect'. If any of the CLEANUP-FORMS themselves exits nonlocally (e.g., via a - `throw' or an error), `unwind-protect' is _not_ guaranteed to + `throw' or an error), `unwind-protect' is *not* guaranteed to evaluate the rest of them. If the failure of one of the CLEANUP-FORMS has the potential to cause trouble, then protect it with another `unwind-protect' around that form. The number of currently active `unwind-protect' forms counts, together with the number of local variable bindings, against the - limit `max-specpdl-size' (*note Local Variables::). + limit `max-specpdl-size' (*note Local Variables::.). For example, here we make an invisible buffer for temporary use, and make sure to kill it before finishing: @@ -346,7 +100,7 @@ another `save-excursion' around the body, to ensure that the temporary buffer becomes current in time to kill it.) Here is an actual example taken from the file `ftp.el'. It creates -a process (*note Processes::) to try to establish a connection to a +a process (*note Processes::.) to try to establish a connection to a remote machine. As the function `ftp-login' is highly susceptible to numerous problems that the writer of the function cannot anticipate, it is protected with a form that guarantees deletion of the process in the @@ -493,7 +247,7 @@ variables; these last until exit from the `let' form. one) of the variable. When the life span of the local value is over, the previous value is restored. In the mean time, we say that the previous value is "shadowed" and "not visible". Both global and local -values may be shadowed (*note Scope::). +values may be shadowed (*note Scope::.). If you set a variable (such as with `setq') while it is local, this replaces the local value; it does not alter the global value, or @@ -523,7 +277,7 @@ binding. The special forms `let' and `let*' exist to create local bindings. - - Special Form: let (bindings...) forms... + - Special Form: let (BINDINGS...) FORMS... This special form binds variables according to BINDINGS and then evaluates all of the FORMS in textual order. The `let'-form returns the value of the last form in FORMS. @@ -534,7 +288,7 @@ binding. evaluating VALUE-FORM. If VALUE-FORM is omitted, `nil' is used. All of the VALUE-FORMs in BINDINGS are evaluated in the order they - appear and _before_ any of the symbols are bound. Here is an + appear and *before* any of the symbols are bound. Here is an example of this: `Z' is bound to the old value of `Y', which is 2, not the new value, 1. @@ -545,7 +299,7 @@ binding. (list Y Z)) => (1 2) - - Special Form: let* (bindings...) forms... + - Special Form: let* (BINDINGS...) FORMS... This special form is like `let', but it binds each variable right after computing its local value, before computing the local value for the next variable. Therefore, an expression in BINDINGS can @@ -563,27 +317,27 @@ binding. Here is a complete list of the other facilities that create local bindings: - * Function calls (*note Functions::). + * Function calls (*note Functions::.). - * Macro calls (*note Macros::). + * Macro calls (*note Macros::.). - * `condition-case' (*note Errors::). + * `condition-case' (*note Errors::.). Variables can also have buffer-local bindings (*note Buffer-Local -Variables::). These kinds of bindings work somewhat like ordinary local -bindings, but they are localized depending on "where" you are in Emacs, -rather than localized in time. +Variables::.). These kinds of bindings work somewhat like ordinary +local bindings, but they are localized depending on "where" you are in +Emacs, rather than localized in time. - Variable: max-specpdl-size This variable defines the limit on the total number of local variable bindings and `unwind-protect' cleanups (*note Nonlocal - Exits::) that are allowed before signaling an error (with data + Exits::.) that are allowed before signaling an error (with data `"Variable binding depth exceeds max-specpdl-size"'). This limit, with the associated error when it is exceeded, is one way that Lisp avoids infinite recursion on an ill-defined function. - The default value is 3000. + The default value is 600. `max-lisp-eval-depth' provides another limit on depth of nesting. *Note Eval::. @@ -602,13 +356,13 @@ value. Note that a value of `nil' is not the same as void. The symbol `nil' is a Lisp object and can be the value of a variable just as any -other object can be; but it is _a value_. A void variable does not +other object can be; but it is *a value*. A void variable does not have any value. After you have given a variable a value, you can make it void once more using `makunbound'. - - Function: makunbound symbol + - Function: makunbound SYMBOL This function makes the current binding of SYMBOL void. Subsequent attempts to use this symbol's value as a variable will signal the error `void-variable', unless or until you set it again. @@ -636,6 +390,7 @@ more using `makunbound'. (makunbound 'x) ; Void the local binding. x) error--> Symbol's value as variable is void: x + x ; The global binding is unchanged. => 1 @@ -644,7 +399,7 @@ more using `makunbound'. (makunbound 'x) ; Void the innermost-local binding. x)) ; And refer: it's void. error--> Symbol's value as variable is void: x - + (let ((x 2)) (let ((x 3)) (makunbound 'x)) ; Void inner binding, then remove it. @@ -658,20 +413,24 @@ always been void. You can use the function `boundp' to test whether a variable is currently void. - - Function: boundp variable + - Function: boundp VARIABLE `boundp' returns `t' if VARIABLE (a symbol) is not void; more precisely, if its current binding is not void. It returns `nil' otherwise. (boundp 'abracadabra) ; Starts out void. => nil + (let ((abracadabra 5)) ; Locally bind it. (boundp 'abracadabra)) => t + (boundp 'abracadabra) ; Still globally void. => nil + (setq abracadabra 5) ; Make it globally nonvoid. => 5 + (boundp 'abracadabra) => t @@ -686,7 +445,7 @@ with a "variable definition": a special form, either `defconst' or `defvar'. In XEmacs Lisp, definitions serve three purposes. First, they inform -people who read the code that certain symbols are _intended_ to be used +people who read the code that certain symbols are *intended* to be used a certain way (as variables). Second, they inform the Lisp system of these things, supplying a value and documentation. Third, they provide information to utilities such as `etags' and `make-docfile', which @@ -708,7 +467,7 @@ Users would like to be able to set user options in their init files, and override the default values given in the definitions. For this reason, user options must be defined with `defvar'. - - Special Form: defvar symbol [value [doc-string]] + - Special Form: defvar SYMBOL [VALUE [DOC-STRING]] This special form defines SYMBOL as a value and initializes it. The definition informs a person reading your code that SYMBOL is used as a variable that programs are likely to set or change. It @@ -736,7 +495,7 @@ reason, user options must be defined with `defvar'. for the variable. (This opportunity to specify documentation is one of the main benefits of defining the variable.) The documentation is stored in the symbol's `variable-documentation' - property. The XEmacs help functions (*note Documentation::) look + property. The XEmacs help functions (*note Documentation::.) look for this property. If the first character of DOC-STRING is `*', it means that this @@ -780,7 +539,7 @@ reason, user options must be defined with `defvar'. The `defvar' form returns SYMBOL, but it is normally used at top level in a file where its value does not matter. - - Special Form: defconst symbol [value [doc-string]] + - Special Form: defconst SYMBOL [VALUE [DOC-STRING]] This special form defines SYMBOL as a value and initializes it. It informs a person reading your code that SYMBOL has a global value, established here, that will not normally be changed or @@ -811,7 +570,7 @@ reason, user options must be defined with `defvar'. pi => 3 - - Function: user-variable-p variable + - Function: user-variable-p VARIABLE This function returns `t' if VARIABLE is a user option--a variable intended to be set by the user for customization--and `nil' otherwise. (Variables other than user options exist for the @@ -842,12 +601,12 @@ Accessing Variable Values ========================= The usual way to reference a variable is to write the symbol which -names it (*note Symbol Forms::). This requires you to specify the +names it (*note Symbol Forms::.). This requires you to specify the variable name when you write the program. Usually that is exactly what you want to do. Occasionally you need to choose at run time which variable to reference; then you can use `symbol-value'. - - Function: symbol-value symbol + - Function: symbol-value SYMBOL This function returns the value of SYMBOL. This is the value in the innermost local binding of the symbol, or its global value if it has no local bindings. @@ -886,7 +645,7 @@ How to Alter a Variable Value form `setq'. When you need to compute the choice of variable at run time, use the function `set'. - - Special Form: setq [symbol form]... + - Special Form: setq [SYMBOL FORM]... This special form is the most common method of changing a variable's value. Each SYMBOL is given a new value, which is the result of evaluating the corresponding FORM. The most-local @@ -917,7 +676,7 @@ time, use the function `set'. y (1+ x)) ; the value of `y' is computed. => 11 - - Function: set symbol value + - Function: set SYMBOL VALUE This function sets SYMBOL's value to VALUE, then returns VALUE. Since `set' is a function, the expression written for SYMBOL is evaluated to obtain the symbol to set. @@ -966,7 +725,7 @@ time, use the function `set'. One other function for setting a variable is designed to add an element to a list if it is not already present in the list. - - Function: add-to-list symbol element + - Function: add-to-list SYMBOL ELEMENT This function sets the variable SYMBOL by consing ELEMENT onto the old value, if ELEMENT is not already a member of that value. It returns the resulting list, whether updated or not. The value of @@ -1007,10 +766,10 @@ binding. The most recently established binding takes precedence over the others. Local bindings in XEmacs Lisp have "indefinite scope" and "dynamic -extent". "Scope" refers to _where_ textually in the source code the +extent". "Scope" refers to *where* textually in the source code the binding can be accessed. Indefinite scope means that any part of the program can potentially access the variable binding. "Extent" refers -to _when_, as the program is executing, the binding exists. Dynamic +to *when*, as the program is executing, the binding exists. Dynamic extent means that the binding lasts as long as the activation of the construct that established it. @@ -1063,7 +822,7 @@ established in `binder', depending on circumstances: (user)) * If we define `foo' as follows and call `binder', then the binding - made in `binder' _will not_ be seen in `user': + made in `binder' *will not* be seen in `user': (defun foo (x) (user)) @@ -1204,3 +963,254 @@ important customization method. * Default Value:: The default value is seen in buffers that don't have their own local values. + +File: lispref.info, Node: Intro to Buffer-Local, Next: Creating Buffer-Local, Up: Buffer-Local Variables + +Introduction to Buffer-Local Variables +-------------------------------------- + + A buffer-local variable has a buffer-local binding associated with a +particular buffer. The binding is in effect when that buffer is +current; otherwise, it is not in effect. If you set the variable while +a buffer-local binding is in effect, the new value goes in that binding, +so the global binding is unchanged; this means that the change is +visible in that buffer alone. + + A variable may have buffer-local bindings in some buffers but not in +others. The global binding is shared by all the buffers that don't have +their own bindings. Thus, if you set the variable in a buffer that does +not have a buffer-local binding for it, the new value is visible in all +buffers except those with buffer-local bindings. (Here we are assuming +that there are no `let'-style local bindings to complicate the issue.) + + The most common use of buffer-local bindings is for major modes to +change variables that control the behavior of commands. For example, C +mode and Lisp mode both set the variable `paragraph-start' to specify +that only blank lines separate paragraphs. They do this by making the +variable buffer-local in the buffer that is being put into C mode or +Lisp mode, and then setting it to the new value for that mode. + + The usual way to make a buffer-local binding is with +`make-local-variable', which is what major mode commands use. This +affects just the current buffer; all other buffers (including those yet +to be created) continue to share the global value. + + A more powerful operation is to mark the variable as "automatically +buffer-local" by calling `make-variable-buffer-local'. You can think +of this as making the variable local in all buffers, even those yet to +be created. More precisely, the effect is that setting the variable +automatically makes the variable local to the current buffer if it is +not already so. All buffers start out by sharing the global value of +the variable as usual, but any `setq' creates a buffer-local binding +for the current buffer. The new value is stored in the buffer-local +binding, leaving the (default) global binding untouched. The global +value can no longer be changed with `setq'; you need to use +`setq-default' to do that. + + Local variables in a file you edit are also represented by +buffer-local bindings for the buffer that holds the file within XEmacs. +*Note Auto Major Mode::. + + +File: lispref.info, Node: Creating Buffer-Local, Next: Default Value, Prev: Intro to Buffer-Local, Up: Buffer-Local Variables + +Creating and Deleting Buffer-Local Bindings +------------------------------------------- + + - Command: make-local-variable VARIABLE + This function creates a buffer-local binding in the current buffer + for VARIABLE (a symbol). Other buffers are not affected. The + value returned is VARIABLE. + + The buffer-local value of VARIABLE starts out as the same value + VARIABLE previously had. If VARIABLE was void, it remains void. + + ;; In buffer `b1': + (setq foo 5) ; Affects all buffers. + => 5 + (make-local-variable 'foo) ; Now it is local in `b1'. + => foo + foo ; That did not change + => 5 ; the value. + (setq foo 6) ; Change the value + => 6 ; in `b1'. + foo + => 6 + + ;; In buffer `b2', the value hasn't changed. + (save-excursion + (set-buffer "b2") + foo) + => 5 + + Making a variable buffer-local within a `let'-binding for that + variable does not work. This is because `let' does not distinguish + between different kinds of bindings; it knows only which variable + the binding was made for. + + *Please note:* do not use `make-local-variable' for a hook + variable. Instead, use `make-local-hook'. *Note Hooks::. + + - Command: make-variable-buffer-local VARIABLE + This function marks VARIABLE (a symbol) automatically + buffer-local, so that any subsequent attempt to set it will make it + local to the current buffer at the time. + + The value returned is VARIABLE. + + - Function: local-variable-p VARIABLE &optional BUFFER + This returns `t' if VARIABLE is buffer-local in buffer BUFFER + (which defaults to the current buffer); otherwise, `nil'. + + - Function: buffer-local-variables &optional BUFFER + This function returns a list describing the buffer-local variables + in buffer BUFFER. It returns an association list (*note + Association Lists::.) in which each association contains one + buffer-local variable and its value. When a buffer-local variable + is void in BUFFER, then it appears directly in the resulting list. + If BUFFER is omitted, the current buffer is used. + + (make-local-variable 'foobar) + (makunbound 'foobar) + (make-local-variable 'bind-me) + (setq bind-me 69) + (setq lcl (buffer-local-variables)) + ;; First, built-in variables local in all buffers: + => ((mark-active . nil) + (buffer-undo-list nil) + (mode-name . "Fundamental") + ... + ;; Next, non-built-in local variables. + ;; This one is local and void: + foobar + ;; This one is local and nonvoid: + (bind-me . 69)) + + Note that storing new values into the CDRs of cons cells in this + list does *not* change the local values of the variables. + + - Command: kill-local-variable VARIABLE + This function deletes the buffer-local binding (if any) for + VARIABLE (a symbol) in the current buffer. As a result, the + global (default) binding of VARIABLE becomes visible in this + buffer. Usually this results in a change in the value of + VARIABLE, since the global value is usually different from the + buffer-local value just eliminated. + + If you kill the local binding of a variable that automatically + becomes local when set, this makes the global value visible in the + current buffer. However, if you set the variable again, that will + once again create a local binding for it. + + `kill-local-variable' returns VARIABLE. + + This function is a command because it is sometimes useful to kill + one buffer-local variable interactively, just as it is useful to + create buffer-local variables interactively. + + - Function: kill-all-local-variables + This function eliminates all the buffer-local variable bindings of + the current buffer except for variables marked as "permanent". As + a result, the buffer will see the default values of most variables. + + This function also resets certain other information pertaining to + the buffer: it sets the local keymap to `nil', the syntax table to + the value of `standard-syntax-table', and the abbrev table to the + value of `fundamental-mode-abbrev-table'. + + Every major mode command begins by calling this function, which + has the effect of switching to Fundamental mode and erasing most + of the effects of the previous major mode. To ensure that this + does its job, the variables that major modes set should not be + marked permanent. + + `kill-all-local-variables' returns `nil'. + + A local variable is "permanent" if the variable name (a symbol) has a +`permanent-local' property that is non-`nil'. Permanent locals are +appropriate for data pertaining to where the file came from or how to +save it, rather than with how to edit the contents. + + +File: lispref.info, Node: Default Value, Prev: Creating Buffer-Local, Up: Buffer-Local Variables + +The Default Value of a Buffer-Local Variable +-------------------------------------------- + + The global value of a variable with buffer-local bindings is also +called the "default" value, because it is the value that is in effect +except when specifically overridden. + + The functions `default-value' and `setq-default' access and change a +variable's default value regardless of whether the current buffer has a +buffer-local binding. For example, you could use `setq-default' to +change the default setting of `paragraph-start' for most buffers; and +this would work even when you are in a C or Lisp mode buffer that has a +buffer-local value for this variable. + + The special forms `defvar' and `defconst' also set the default value +(if they set the variable at all), rather than any local value. + + - Function: default-value SYMBOL + This function returns SYMBOL's default value. This is the value + that is seen in buffers that do not have their own values for this + variable. If SYMBOL is not buffer-local, this is equivalent to + `symbol-value' (*note Accessing Variables::.). + + - Function: default-boundp SYMBOL + The function `default-boundp' tells you whether SYMBOL's default + value is nonvoid. If `(default-boundp 'foo)' returns `nil', then + `(default-value 'foo)' would get an error. + + `default-boundp' is to `default-value' as `boundp' is to + `symbol-value'. + + - Special Form: setq-default SYMBOL VALUE + This sets the default value of SYMBOL to VALUE. It does not + evaluate SYMBOL, but does evaluate VALUE. The value of the + `setq-default' form is VALUE. + + If a SYMBOL is not buffer-local for the current buffer, and is not + marked automatically buffer-local, `setq-default' has the same + effect as `setq'. If SYMBOL is buffer-local for the current + buffer, then this changes the value that other buffers will see + (as long as they don't have a buffer-local value), but not the + value that the current buffer sees. + + ;; In buffer `foo': + (make-local-variable 'local) + => local + (setq local 'value-in-foo) + => value-in-foo + (setq-default local 'new-default) + => new-default + local + => value-in-foo + (default-value 'local) + => new-default + + ;; In (the new) buffer `bar': + local + => new-default + (default-value 'local) + => new-default + (setq local 'another-default) + => another-default + (default-value 'local) + => another-default + + ;; Back in buffer `foo': + local + => value-in-foo + (default-value 'local) + => another-default + + - Function: set-default SYMBOL VALUE + This function is like `setq-default', except that SYMBOL is + evaluated. + + (set-default (car '(a b c)) 23) + => 23 + (default-value 'a) + => 23 + diff --git a/info/new-users-guide.info b/info/new-users-guide.info index c013101..ced6a25 100644 --- a/info/new-users-guide.info +++ b/info/new-users-guide.info @@ -1,5 +1,5 @@ -This is ../info/new-users-guide.info, produced by makeinfo version 4.0 -from new-users-guide/new-users-guide.texi. +This is Info file ../../info/new-users-guide.info, produced by Makeinfo +version 1.68 from the input file new-users-guide.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -18,59 +18,59 @@ preserved on all copies.  Indirect: -new-users-guide.info-1: 635 -new-users-guide.info-2: 50520 -new-users-guide.info-3: 100114 +new-users-guide.info-1: 648 +new-users-guide.info-2: 50484 +new-users-guide.info-3: 99987  Tag Table: (Indirect) -Node: Top635 -Node: Intro4613 -Node: Entering7196 -Node: Enter8710 -Node: Frame9392 -Node: Exiting11061 -Node: Mode Line12261 -Node: Echo Area14408 -Node: Windows and Menus15763 -Node: XEmacs Window16216 -Node: Pull-down Menus19837 -Node: File menu20716 -Node: Edit menu23975 -Node: Options Menu26501 -Node: Buffers Menu31286 -Node: Help menu31672 -Node: Edit32170 -Node: Insert33764 -Node: Cursor Position35092 -Node: Erase37163 -Node: Numeric Argument38317 -Node: Undo39501 -Node: Customization Basics40264 -Node: Customizing key Bindings41536 -Node: Customizing Menus45030 -Node: Help50520 -Node: The Help Menu51208 -Node: Modes56174 -Node: Major Modes57090 -Node: Minor Modes61041 -Node: Files65138 -Node: File Names65860 -Node: Visiting67663 -Node: Saving Files69787 -Node: Other Customizations73166 -Node: Setting Variables75650 -Node: Init File78861 -Node: Select and Move84346 -Node: Selecting Text85300 -Node: Mouse86813 -Node: Region Operation88138 -Node: Moving Text89398 -Node: Accumulating text90638 -Node: Search and Replace92959 -Node: Key Index96825 -Node: Command Index100114 -Node: Variable Index104216 -Node: Concept Index104793 +Node: Top648 +Node: Intro4626 +Node: Entering7209 +Node: Enter8723 +Node: Frame9405 +Node: Exiting11074 +Node: Mode Line12274 +Node: Echo Area14421 +Node: Windows and Menus15776 +Node: XEmacs Window16229 +Node: Pull-down Menus19850 +Node: File menu20729 +Node: Edit menu23988 +Node: Options Menu26515 +Node: Buffers Menu31297 +Node: Help menu31683 +Node: Edit32181 +Node: Insert33775 +Node: Cursor Position35103 +Node: Erase37174 +Node: Numeric Argument38328 +Node: Undo39512 +Node: Customization Basics40275 +Node: Customizing key Bindings41504 +Node: Customizing Menus44994 +Node: Help50484 +Node: The Help Menu51172 +Node: Modes56097 +Node: Major Modes57013 +Node: Minor Modes60962 +Node: Files65048 +Node: File Names65770 +Node: Visiting67573 +Node: Saving Files69697 +Node: Other Customizations73075 +Node: Setting Variables75544 +Node: Init File78753 +Node: Select and Move84222 +Node: Selecting Text85176 +Node: Mouse86689 +Node: Region Operation88014 +Node: Moving Text89274 +Node: Accumulating text90514 +Node: Search and Replace92834 +Node: Key Index96698 +Node: Command Index99987 +Node: Variable Index104089 +Node: Concept Index104666  End Tag Table diff --git a/info/new-users-guide.info-1 b/info/new-users-guide.info-1 new file mode 100644 index 0000000..043aa9b --- /dev/null +++ b/info/new-users-guide.info-1 @@ -0,0 +1,1272 @@ +This is Info file ../../info/new-users-guide.info, produced by Makeinfo +version 1.68 from the input file new-users-guide.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Intro: (new-users-guide). Introduction to the XEmacs Editor. +END-INFO-DIR-ENTRY + + This manual serves as an introduction to the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, 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. + + +File: new-users-guide.info, Node: Top, Next: Intro, Prev: (dir), Up: (dir) + + The Emacs Editor **************** + + Emacs is the extensible, customizable, self-documenting real-time +display editor. This Info file will help you get started on using +XEmacs. It corresponds to XEmacs version 19.13. + +* Menu: + +* Intro:: Introduction to XEmacs editor + +Indices, nodes containing large menus +* Key Index:: An item for each standard Emacs key sequence. +* Command Index:: An item for each command and function name +* Variable Index:: An item for each variable in User-Guide +* Concept Index:: An item for the concepts introduced + +Entering, Exiting and Editing Emacs +* Entering:: Starting Emacs from the shell and Exiting +* Windows and Menus:: Description of Pull-down menus +* Edit:: Basic Editing commands + +Other Features of XEmacs +* Customization Basics:: Customize Emacs menus and keybindings +* Help:: Help menu and other help commands +* Modes:: Major and Minor modes in XEmacs +* Files:: Visiting, Saving and Listing Files +* Other Customizations:: Customizing Variables, Modes, etc +* Select and Move:: Selecting text and moving text +* Search and Replace:: Searching and Replacing text + + + + -- The Detailed Node Listing -- + +Entering and Exiting Emacs + +* Enter:: Entering Emacs from the shell +* Frame:: Basic information about the XEmacs Frame +* Exiting:: Exiting Emacs +* Mode Line:: Interpreting the mode line. +* Echo Area:: Bottom of the frame where you interact + with Emacs. + +XEmacs Windows and Menus + +* XEmacs Window:: Manipulating XEmacs Windows +* Pull-down Menus:: Description of XEmacs Pull-down Menus + +Pull-down menus + +* File menu:: Items on the File Menu +* Edit menu:: Items on the Edit Menu +* Options Menu:: Items on the Options Menu +* Buffers Menu:: Items on the Buffers Menu +* Help menu:: The Help Menu at the extreme right on + the frame + +Basic Editing Commands + +* Insert:: Insert text in Emacs by simply typing at + the cursor position. +* Cursor Position:: Moving Around the cursor in the buffer, +* Erase:: Different commands for erasing text +* Numeric Argument:: Giving Numeric Arguments to commands +* Undo:: Undoing Changes made by mistake + +Customize key bindings and menus + +* Customizing key Bindings:: Changing Key Bindings +* Customizing Menus:: Adding, Deleting, Enabling and Disabling Menus + +Help + +* The Help Menu:: Items on the Help Menu + +Major and Minor Modes + +* Major Modes:: Choosing Major Modes +* Minor Modes:: Auto-Fill, Abbrev and other minor modes + +Emacs Files + +* File Names:: How to type and edit file name arguments. +* Visiting:: Visiting a file prepares Emacs to edit the file. +* Saving Files:: How to save Emacs files. + +Other Customizations + +* Setting Variables:: Customizing Emacs variables +* Init File:: Some examples of Lisp expressions in + .emacs file + +Selecting and Moving Text + +* Selecting Text:: Select a region of text by setting the Mark +* Mouse:: Selecting Text with Mouse +* Region Operation:: Various ways to operate on a selected text +* Moving Text:: Moving Text +* Accumulating text:: Accumulating Text from several buffers + +No sub menu for the node search and replace + + +File: new-users-guide.info, Node: Intro, Next: Key Index, Prev: Top, Up: Top + +Introduction +************ + + You are reading about XEmacs which is a self-documenting, +customizable, extensible real-time display editor. + + XEmacs is a "display" editor because normally the text being edited +is visible on the screen and is updated automatically as you type. +*Note Display: (xemacs)Frame. + + It is a "real-time" editor because the display is updated very +frequently, usually after each character or pair of characters you type. +This minimizes the amount of information you must keep in your head as +you edit. *Note Real-time: (xemacs)Basic. + + It is advanced because it provides facilities that go beyond simple +insertion and deletion: filling of text; automatic indentation of +programs; viewing two or more files at once; and dealing in terms of +characters, words, lines, sentences, paragraphs, and pages, as well as +expressions and comments in several different programming languages. +It is much easier to type one command meaning "go to the end of the +paragraph" than to find that spot with simple cursor keys. + + "Self-documenting" means that at any time you can type a special +character, `Control-h', to find out what your options are. You can +also use `C-h' to find out what a command does, or to find all the +commands relevant to a topic. *Note Help: (xemacs)Help. + + "Customizable" means you can change the definitions of Emacs +commands. For example, if you use a programming language in which +comments start with `<**' and end with `**>', you can tell the Emacs +comment manipulation commands to use those strings (*note Comments: +(xemacs)Comments.). Another sort of customization is rearrangement of +the command set. For example, you can set up the four basic cursor +motion commands (up, down, left and right) on keys in a diamond pattern +on the keyboard if you prefer. *Note Customization: +(xemacs)Customization. + + "Extensible" means you can go beyond simple customization and write +entirely new commands, programs in the Lisp language to be run by +Emacs's own Lisp interpreter. Emacs is an "on-line extensible" system: +it is divided into many functions that call each other. You can +redefine any function in the middle of an editing session and replace +any part of Emacs without making a separate copy of all of Emacs. Most +of the editing commands of Emacs are written in Lisp; the few +exceptions could have been written in Lisp but are written in C for +efficiency. Only a programmer can write an extension to Emacs, but +anybody can use it afterward. + + +File: new-users-guide.info, Node: Entering, Next: Windows and Menus, Prev: Concept Index, Up: Top + +Entering and Exiting Emacs +************************** + + While using Emacs you should be familiar with the following three +terms: + +Buffer + A buffer is a region of memory holding characters. It is the basic + editing unit; one buffer corresponds to one piece of text being + edited. You can have multiple buffers but you can edit only one + buffer at any one time. For more information, *Note Buffers: + (xemacs)Buffers. + +File + A file is a region of disk space holding characters. Emacs edits a + file by reading it into a buffer, editing that buffer and writing + out the buffer back to the file. To save your work permanently you + have to write it to a file. So after you load and work with a + file, you have to save it back. + +Windows + A window is a rectangular region in which a buffer is displayed. + You can open multiple windows with multiple buffers and edit them + by selecting the corresponding buffer. Initially, when you start + emacs, it will automatically open up a window for you. + +* Menu: + +* Enter:: Entering Emacs from the shell +* Frame:: Basic information about the XEmacs Frame +* Exiting:: Exiting Emacs +* Mode Line:: Interpreting the mode line. +* Echo Area:: Bottom of the frame where you interact + with Emacs. + + +File: new-users-guide.info, Node: Enter, Next: Frame, Prev: Entering, Up: Entering + +Entering Emacs +============== + + To enter Emacs type `xemacs' and press the Return key at the shell +i.e. `xemacs '. This will bring up an emacs window with +`*scratch*' as the default buffer because Emacs must always have a +buffer to work on. Then choose the Open... option from the File menu on +the menubar at the top of the frame. It will prompt you to enter a +filename. After you enter the filename, Emacs will read that file into +the current buffer. You can also type : + xemacs + directly which will bring up an Emacs frame with the "filename" as +the buffer. + + +File: new-users-guide.info, Node: Frame, Next: Exiting, Prev: Enter, Up: Entering + +Emacs Frame +=========== + + When you run XEmacs under X, a menu bar on top of the Emacs frame +provides access to pull-down menus of file, edit, and help-related +commands. The menus only provide convenient shortcuts, the options that +they provide are available via key commands. You can invoke those +commands from the keyboard also. For many of the options, their +corresponding key commands are displayed right besides them. The five +default menus on the menubar that you will see on the frame are File, +Edit, Options, Buffers and Help. *Note XEmacs Pull-down Menus: +(xemacs)XEmacs Pull-down Menus, for detailed information on the +functions provided by the pull-down menus. + + The Emacs frame has a rectangle shaped box at the extreme right and +you can drag it up or down to scroll the window accordingly. Clicking +on the arrows also serves the same purpose. + + The last line in your window is `the Mode line' which will give you +a description of what's going on in that particular window. *Note Mode +Line::, for more information. Below the mode line is the `Echo area'. +Emacs uses this area to interact with the user. *Note Echo Area::. + + If you wish to open another file in a new window after you enter +XEmacs, select Open in New Frame... from the File menu, which will +prompt you for a filename and open a new window with that filename as +the current buffer. If you want to open a new file in the same window, +select Open.. from the File menu. You need to enter XEmacs only once, +you can edit multiple files by opening several other frames or by +switching between buffers. + + +File: new-users-guide.info, Node: Exiting, Next: Mode Line, Prev: Frame, Up: Entering + +Exiting Emacs +============= + + There are two commands for exiting Emacs, one for "suspending" Emacs +and the other for "killing" Emacs. "Suspending" means stopping Emacs +temporarily and returning control to 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. +"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. + +`C-z' + Suspend Emacs (`suspend-emacs'). If used under the X window + system, this command will shrink the X window containing the Emacs + frame to an icon. Clicking on the icon will resume that Emacs + process again. *Note Exiting Emacs: (xemacs)Exiting Emacs. + +`C-x C-c' + Kill Emacs (`save-buffers-kill-emacs'). You can also select Exit + Emacs option from the File menu to kill that Emacs process. If you + haven't saved the file, Emacs will ask you if you wish to save the + file before killing that process. + + +File: new-users-guide.info, Node: Mode Line, Next: Echo Area, Prev: Exiting, Up: Entering + +The Mode Line +============= + + When you enter XEmacs, each text window's last line is a "mode line" +which describes what is going on in that window. Normally, the mode +line looks like : + + --CH-XEmacs: BUF (MAJOR MINOR)----POS------ + +This gives information about the buffer being displayed in the window: +the buffer's name, what major and minor modes are in use, whether the +buffer's text has been changed, and how far down the buffer you are +currently looking. + + The CH contains : +`**' + if the text in the buffer has been edited + +`--' + if the text in the buffer has not been edited + +`%%' + if the buffer is a read-only-buffer i.e. it cannot be edited + + BUF is the name of the window's chosen "buffer". If you are editing +a file (which is the selected buffer), the file name appears in BUF. +*Note Buffers: (xemacs)Buffers. + + POS contains : +`All' + if your entire file is visible on the screen. + +`Top' + if you are looking at the beginning of the file. + +`Bot' + if you are looking at the end of the file. + +`NN%' + NN will be a number corresponding to the percentage of the file + above the top of the screen, for example `52', which means that 52% + of the file is above the top of the screen. + + MAJOR is the name of the "major mode" in effect in the buffer. At +any time, each buffer is in one and only one major mode. The available +major modes include Fundamental mode (the least specialized), Text +mode, Lisp mode, and C mode. *Note Major Modes: (xemacs)Major Modes, +for details on how the modes differ and how you select one. + + MINOR is a list of some of the "minor modes" that are turned on in +the window's chosen buffer. For example, `Fill' means that Auto Fill +mode is on which means that lines are broken automatically when they +become too wide. *Note Minor Modes: (xemacs)Minor Modes, for more +information on various minor modes and how to enable them. + + You can also display time in the mode line. *Note The Mode Line: +(xemacs)The Mode Line, for more information regarding the mode line. + + +File: new-users-guide.info, Node: Echo Area, Prev: Mode Line, Up: Entering + +The Echo Area +============= + + The line at the bottom of the frame (below the mode line) is the +"echo area". Emacs uses this area to communicate with you: + + * The "echo area" will print out the characters that you type. For + example, if you choose the Open... option from the File menu you + might get the following in the echo area: + + Find file: /usr/lib/x11/ + + Now you need to give a file name to open, for example if the file + name is `myfile', you will type `myfile' after `/usr/lib/x11/' and + press the key. If you pause for more than a second while + typing, you will see the characters that you type in the "echo + area". + + * The "echo area" also prints error messages. For example, if you + misspell `usr' and type `/urs/lib/x11/myfile' in the + above example you might get an error message. Since Emacs will not + be able to find the `/urs' directory, the "echo area" will say: + + error--> Opening directory: no such file or directory, /urs/lib/x11/myfile + + This error message will be accompanied by a beep. Some XEmacs + commands will print informative messages in the "echo area". *Note + The Echo Area: (xemacs)The Echo Area, for more information on the + "echo area". + + +File: new-users-guide.info, Node: Windows and Menus, Next: Edit, Prev: Entering, Up: Top + +XEmacs Windows and Menus +************************ + + The first section of this chapter will show you how you can +manipulate XEmacs Windows and the other section will explain the +Pull-down Menus of an XEmacs window. + +* Menu: + +* XEmacs Window:: Manipulating XEmacs Windows +* Pull-down Menus:: Description of XEmacs Pull-down Menus + + +File: new-users-guide.info, Node: XEmacs Window, Next: Pull-down Menus, Prev: Windows and Menus, Up: Windows and Menus + +XEmacs Windows +============== + + When you use XEmacs under X, you can open multiple windows and each +window can display one buffer or multiple parts of one buffer. Each +window will have its own "mode line" and "echo area". At any one time +there is only one "selected window" and the buffer it displays is the +"selected buffer". There are some commands for manipulating windows: + +`M-C-v' + This command will scroll the window which is not "selected" + (`scroll-other-window'). + +`C-x 0' + This command will get rid of the selected window (`delete-window'). + That is a zero. If there is more than one Emacs frame, deleting the + sole remaining window on that frame deletes the frame as well. If + the current frame is the only frame, it is not deleted. + +`C-x 1' + This command will get rid of all the windows except the selected + one. (`delete-other-windows'). For example, if you use the + Describe variable option from the Help menu, the window will split + vertically and the bottom window will contain documentation for + that variable. After you are done looking at that variable's + documentation you might want to come back to your original single + window. Just type `C-x 1' after your cursor is in the top window + (the window which you want to keep) and hit . + +`C-x 2' + This command will split the selected window into two windows, one + above the other (`split-window-vertically'). Both the windows will + start out by displaying the same buffer. The window in which you + have your cursor will be your "selected window". + +`C-x 3' + This will split the selected window into two windows positioned + side by side (`split-window-horizontally'). A line of vertical + bars will separate the window. + +You can select a buffer in another window by using some other commands. +These commands all have a prefix key `C-x 4' +`C-x 4 b BUFNAME ' + This command will select a buffer BUFNAME in another window. This + runs `switch-to-buffer-other-window'. It will prompt you for a + buffername. + +`C-x 4 f FILENAME ' + Visit file FILENAME and select its buffer in another window. This + runs `find-file-other-window'. *Note Visiting: (xemacs)Visiting. + It will prompt you for a filename. + +`C-x 4 d DIRECTORY ' + Select a Dired buffer for directory DIRECTORY in another window. + This runs `dired-other-window'. *Note Dired: (xemacs)Dired. + +`C-x 4 m' + Start composing a mail message in another window. This runs + `mail-other-window', and its same-window version is `C-x m'. + *Note Sending Mail: (xemacs)Sending Mail, for information on how + to Send Mail using XEmacs. *Note Reading Mail With Rmail: + (xemacs)Reading Mail With Rmail, for information on reading mail + using Rmail. + + If you click the right button on the mouse on a mode line, you will +get a menu with following options: +Delete Window + Choosing this menu will remove the window above this modeline from + the frame. + +Delete Other Windows + Delete all windows on the frame except for the one above this + modeline. + +Split Window + Split the window above the mode line in half, creating another + window. + +Split Window Horizontally + Split the window above the mode line in half horizontally, so that + there will be two windows side-by-side. + +Balance Windows + Readjust the sizes of all windows on the frame until all windows + have roughly the same number of lines. + + +File: new-users-guide.info, Node: Pull-down Menus, Prev: XEmacs Window, Up: Windows and Menus + +XEmacs Pull-down Menus +====================== + + When you run XEmacs under X, each Emacs frame has a menu-bar at the +top which provides commands for editing, help and other options. All +these options are also available via key commands, the menus just +provide convenient short-cuts. The key commands are displayed right +besides some of the options. The following is a brief description of +the four default menus on the menu bar: + +* Menu: + +* File menu:: Items on the File menu +* Edit menu:: Items on the Edit menu +* Options Menu:: Items on the Options Menu +* Buffers Menu:: Items on the Buffers Menu +* Help menu:: The Help Menu at the extreme right on + the frame + + +File: new-users-guide.info, Node: File menu, Next: Edit menu, Prev: Pull-down Menus, Up: Pull-down Menus + +The File Menu +------------- + + The File menu bar contains the following items. To choose a +particular option, press the left mouse button and drag it to the item +you wish to select. Then release the button. + +Open... + This option will prompt you for a file name. You will get a + message in the echo area: + + Find File: + + After Find File, there might be a directory path also. After you + type the file name and press the file will be loaded into a + new buffer. + +Open in New Frame... + It prompts you for a file name and loads that file in a new buffer + in a new frame. You can open many frames for the same Emacs + session. You can delete the frame by selecting Delete Frame. + +Insert File... + Prompts you for a filename and inserts the contents of this + filename in your current buffer. Position your cursor at the place + you wish to insert the file and select this option. You will get + the following message in the echo area: + + Insert file: + + Insert the file name and press . + +Save + It saves the changes you have made to the buffer. If you have made + changes which are not saved yet, the option will appear dark, + otherwise it will be light and unselectable. If you do not wish to + save the changes, select Revert Buffer. + +Save As... + Prompts you for a filename and saves the current buffer in that + file. It loads the new file if the filename you specify is + different from the one you were working with. + +Print Buffer + Prints a hardcopy of the current or "selected" buffer. + +New Frame + Opens a new frame with *scratch* as the default buffer. It doesn't + prompt you for a filename. To open a file you need to go to that + frame and select Open... + +Split Frame + Splits the current window into two equal-sized windows with the + same buffer. To get back a single frame, select Un-Split (Keep + This). *Note XEmacs Window::, for more information about windows. + +Un-Split (Keep This) + If the frame contains multiple windows, it will remove all windows + except the selected one. + +Un-Split (Keep Others) + If the frame contains multiple windows, it will remove the selected + window and keep the other one. + +Revert Buffer + If you do not wish to save the changes you made to the file since + you opened it, select this option. It will restore the last saved + version of the file to the current buffer. + +Kill Buffer + It will kill the current buffer. If will prompt you if there are + unsaved changes. + +Exit Emacs + It will kill the Emacs "process" as opposed to simply killing the + "buffer". Before it kills the process, it will prompt you as to + which unsaved buffers you wish to save by going through the list + of the buffers. + +* Menu: + +* Edit menu:: Items on the Edit Menu +* Options Menu:: Items on the Options Menu +* Buffers Menu:: Items on the Buffers Menu +* Help menu:: The Help Menu at the extreme right on + the frame + + +File: new-users-guide.info, Node: Edit menu, Next: Options Menu, Prev: File menu, Up: Pull-down Menus + +The Edit Menu +------------- + + Most of the commands in this menu work on a block of text or a +selected region. The text will be highlighted as you select it. +Undo + Undoes the previous command. If you type something by mistake you + can use this command. For example, if you select Insert File... + from the File menu and insert a wrong file by mistake, you can + select this item and it will remove the inserted file. It undoes a + batch of text which is worth an emacs command. + +Cut + Removes the selected text block from the current buffer, makes it + the X clipboard selection, and places it in the kill ring (*note + Moving Text::.). Before executing this command, you have to select + a region using Emacs region selection commands or with the mouse. + *Note Selecting Text::. + +Copy + Makes a selected text block the X clipboard selection, and places + it in the kill ring. You can select text using one of the Emacs + region selection commands or by selecting a text region with the + mouse. *Note Selecting Text::, for more information. + +Paste + Inserts the current value of the X clipboard selection in the + current buffer. Note that this is not necessarily the same as the + Emacs `yank' command, because the Emacs kill ring and the X + clipboard selection are not the same thing. You can paste in text + you have placed in the clipboard using Copy or Cut. You can also + use Paste to insert text that was pasted into the clipboard from + other applications. *Note X Clipboard Selection: (xemacs)X + Clipboard Selection, for information on using Clipboard Selection. + +Clear + Removes the selected text block from the current buffer but does + not place it in the kill ring or the X clipboard selection. You + will not be able to get this text back. + +Start Macro Recording + After selecting this, Emacs will remember every keystroke you type + until End Macro Recording is selected. + +End Macro Recording + Selecting this tells emacs to stop remembering your keystrokes. + +Execute Last Macro + Selecting this item will cause emacs to re-interpret all of the + keystrokes which were saved between selections of the Start Macro + Recording and End Macro Recording menu items. You can now execute + the most recent keyboard macro. *Note Keyboard Macros: + (xemacs)Keyboard Macros, for further information. + + +File: new-users-guide.info, Node: Options Menu, Next: Buffers Menu, Prev: Edit menu, Up: Pull-down Menus + +The Options Menu +---------------- + + There are sub-menus for some of the menus which you will need to +select. If sub-menus exist for an item, they will be displayed +automatically when you drag the mouse on that item. The items in this +menu provide some fancy editing operations. + +Read Only + Selecting this item will cause the buffer to visit the file in a + read-only mode. Changes to the file will not be allowed. + +Case Sensitive Search + Selecting this item will cause searches to be case-sensitive. If + its not selected then searches will ignore case. This option is + local to the buffer. For example, if this item is selected and you + are searching for `Smile', then an occurrence of `smile' will not + be recognized because of the smaller case of `s'. + +Overstrike + After selecting this item, when you type letters they will replace + existing text on a one-to-one basis, rather than pushing it to the + right. At the end of a line, such characters extend the line. + Before a tab, such characters insert until the tab is filled in. + +Auto Delete Selection + Selecting this item will cause automatic deletion of the selected + region. After you select a region and hit the key, the + selected text will be deleted. The typed text will replace the + selection if the selection is active (i.e. if its highlighted). If + the option is not selected then the typed text is just inserted at + the cursor. + +Teach Extended Commands + After you select this item, any time you execute a command with + `M-x' which has a shorter keybinding, you will be shown the + alternate binding before the command executes. For example if you + type `M-x find-file-other-window' which performs the same function + as the Open in Other Window... in File menu you will see the + following message: + + M-x find-file-other-window (bound to keys: C-x 4 f, C-x 4 C-f) + +Syntax Highlighting + You can customize your `.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. *Note Customization: (xemacs)Customization, for more + information on customizing `.emacs' file. After selecting this + item, you will find your code a lot easier to read. When Fonts is + selected, different parts of the program will appear in different + Fonts. When Colors is selected, then the program will be displayed + in different colors. Selecting None causes the program to appear in + just one Font and Color. Selecting Less resets the Fonts and Colors + to a fast, minimal set of decorations. Selecting More resets the + Fonts and Colors to a larger set of decorations. For example, if + Less is selected (which is the default setting) then you might have + all comments in green color. It does not matter what the comments + contain. Whereas, if More is selected then a function name in the + comments themselves might appear in a different Color or Font. Even + though the comments themselves might appear in green color, a + function name "within" the comments might appear in red color. + +Paren Highlighting + After selecting Blink from this item, if you place the cursor on a + parenthesis, the matching parenthesis will blink. If you select + Highlight and place the cursor on a parenthesis, the whole + expression of the parenthesis under the cursor will be highlighted. + Selecting None will turn off the options (regarding Paren + Highlighting) which you had selected earlier. + +Font + You can select any Font for your program by choosing from one of + the available Fonts. The whole buffer will be converted to the + Font you select. + +Size + You can select any size for the text in your buffer (ranging from + 2 to 24) by selecting the appropriate option. + +Weight + You can choose either Bold or Medium for the weight of the text of + your buffer. + +Buffers Menu Length... + Prompts you for the number of buffers to display. Then it will + display that number of most recently selected buffers. + +Buffers Sub-Menus + After selection of this item the Buffers menu will contain several + commands, as submenus of each buffer line. If this item is + unselected, then there are no submenus for each buffer line, the + only command available will be selecting that buffer. + +Save Options + Selecting this item will save the current settings of your Options + menu to your `.emacs' file so that the next time you start XEmacs, + you won't need to select the options again. + + +File: new-users-guide.info, Node: Buffers Menu, Next: Help menu, Prev: Options Menu, Up: Pull-down Menus + +The Buffers Menu +---------------- + + The Buffers menu provides a selection of up to ten buffers and the +item List All Buffers, which provides a Buffer List. If you select +Buffers Sub-menus from the Options menu, you will get some sub-menus +for each of the buffer listing. + + +File: new-users-guide.info, Node: Help menu, Prev: Buffers Menu, Up: Pull-down Menus + +The Help Menu +------------- + + The Help Menu gives you access to Emacs Info and provides a menu +equivalent for some of the choices you have when using `C-h'. *Note +Help::, for more information. + + The Describe variable and Describe function will provide +documentation for the corresponding variable or function. The Help menu +also gives access to UNIX online manual pages via the UNIX Manual... +option. + + +File: new-users-guide.info, Node: Edit, Next: Customization Basics, Prev: Windows and Menus, Up: Top + +Basic Editing Commands +********************** + + This chapter will introduce you to some basic editing commands. You +can also learn the basic editing commands by typing `Control-h t' +(`help-with-tutorial' OR by selecting Emacs Tutorial from the Help menu +on the menu bar. Most of the Emacs commands will use the key +or the key. The following abbreviations will be used for the + and key in this manual: + +`C-' + This means that you should hold down the key while typing + `'. For example, if the command is `C-g', you should hold the + key and type . + +`M-' + This means that you should hold down the `META' key while typing + `'. If there is no `META' key on your keyboard, use the `ESC' + key instead. For example, if the command is `M-x', then type + `ESC', release it and type `x'. + + The following abbreviations will be used for some other keys: + + + Space bar. + + + Return key. + + + Linefeed key. + + + Tab. + + + Escape. + + + Shift. + +* Menu: + +* Insert:: Insert text in Emacs by simply typing at + the cursor position. +* Cursor Position:: Moving Around the cursor in the buffer, +* Erase:: Different commands for erasing text +* Numeric Argument:: Giving Numeric Arguments to commands +* Undo:: Undoing Changes made by mistake + + +File: new-users-guide.info, Node: Insert, Next: Cursor Position, Prev: Edit, Up: Edit + +Inserting Text +============== + + To insert printing characters into the text you are editing, just +type them. Emacs will automatically insert the characters that you type +into the buffer at the cursor. The cursor moves forward, but if you +prefer to have text characters replace (overwrite) existing text +characters, you can enable the Overstrike option from the Options menu +in the menu bar. + + To "delete" text you have just inserted, use . deletes +the character BEFORE the cursor (not the one that the cursor is on top +of or under; that is the character AFTER the cursor). The cursor and +all characters after it move backwards. Therefore, if you type a +printing character and then type , they cancel out. + + To end a line and start typing a new one, type . This inserts +a newline character in the buffer. If point is in the middle of a +line, splits the line. Typing when the cursor is at the +beginning of a line rubs out the newline before the line, thus joining +the line with the preceding line. + + Emacs automatically splits lines when they become too long, if you +turn on a special mode called "Auto Fill" mode. *Note Filling: +(xemacs)Filling, for information on using Auto Fill mode. + + +File: new-users-guide.info, Node: Cursor Position, Next: Erase, Prev: Insert, Up: Edit + +Moving Around +============= + + The following commands will allow you to move the cursor around the +screen. The actual function names corresponding to these commands are +given in parenthesis. You can also invoke these commands by typing `M-x +'. You can do this for any command in XEmacs. + +`C-b' + Move the cursor backward one character (`backward-char'). + +`C-f' + Move the cursor forward one character (`forward-char'). + +`C-p' + Move the cursor up one line vertically (`previous-line'). + +`C-n' + Move the cursor down one line vertically (`next-line'). + +`C-a' + Move the cursor to the beginning of the line (`beginning-of-line'). + +`C-e' + Move the cursor to the end of the line (`end-of-line'). + +`M-f' + Move the cursor forward one word (`forward-word'). + +`M-b' + Move the cursor backword one word (`backward-word'). + +`M-<' + Move the cursor to the top of the buffer (`beginning-of-buffer'). + +`M->' + Move the cursor to the end of the buffer (`end-of-buffer'). + +`M-x goto-char RET RET' + To enable this command type `M-x goto-char', and hit key. + In the "echo area" you will see: + + Goto char: + + You should then type in a number right after the colon and hit the + `RETURN' key again. After reading a number N this command will + move the cursor to character number N. Position 1 is the + beginning of the buffer. For example, if you type `M-x goto-char + RET 200 RET', then the cursor will move to the 200th character + starting from the beginning of the buffer. + +`M-x goto-line RET RET' + To enable this command type `M-x goto-line', and hit the + key. After you see `Goto line:' in the "echo area", type in a + number N and hit key again. This command will position + the cursor on the nth line starting from the beginning of the + buffer. + +`M-x what-line RET' + This command will display the current line number in the echo area. + + +File: new-users-guide.info, Node: Erase, Next: Numeric Argument, Prev: Cursor Position, Up: Edit + +Erasing Text +============ + +`' + If you press i.e. the "delete" key, it will delete the + character before the cursor (`delete-backward-char'). + +`C-d' + This will delete the character after the cursor (`delete-char'). + +`C-k' + Kill to the end of the line (`kill-line'). If you kill the line by + mistake you can "yank" or `paste' it back by typing `C-y'. *Note + Moving Text::, for more information on yanking. + +`M-d' + Kill forward to the end of the next word (`kill-word'). + +`M-' + Kill back to the beginning of the previous word + (`backward-kill-word'). + +`M-k' + Kill to the end of current sentence (`kill-sentence'). + +`M-z CHAR' + Kill up to next occurrence of CHAR (`zap-to-char'). To use this + command type `M-z'. You will see the following statement in the + echo area : + + Zap to char: + + Type any char and press the key. For example, if you type + `p' then the entire text starting from the position of the cursor + until the first occurrence of `p' is killed. + + +File: new-users-guide.info, Node: Numeric Argument, Next: Undo, Prev: Erase, Up: Edit + +Giving Numeric Arguments +======================== + + Any Emacs command can be given a "numeric argument". Some commands +interpret the argument as a repetition count. For example, if you want +to move forward ten characters, you could type `C-f' ten times. +However, a more efficient way to do this would be to give an argument +of ten to the key `C-f' (the command `forward-char', move forward one +character). Negative arguments are also allowed. Often they tell a +command to move or act backwards. For example, if you want to move down +ten lines, type the following: + C-u 10 C-n RET + +After you press key, the cursor will move ten lines downward. You +can also type: + M-10 C-n RET + +Both `C-u' and `M-' allow you to give numeric arguments. If you want to +move ten lines backward, you can also give negative arguments, like: + C-u -10 C-n RET + +OR you could also type: + M--10 C-n RET + +You can obviously use `C-b' to move backward rather than giving +negative arguments to `C-n'. *Note Numeric Arguments: (xemacs)Numeric +Arguments, for more information on numeric arguments. + + +File: new-users-guide.info, Node: Undo, Prev: Numeric Argument, Up: Edit + +Undoing Changes +=============== + + When you are editing a buffer, you might type something by mistake. +Emacs allows you to undo all changes you make to a buffer (but not more +than 8000 characters). Each buffer in Emacs keeps a record of the +changes made to it individually, so the undo command applies to the +current buffer. There are two undo commands: + +`C-x u' + Undo one batch of changes (usually, one command's worth). + (`undo'). + +`C-_' + The same as above, but this command might not be obvious to type + on some keyboards so it might be better to use the above command. + + *Note Undoing Changes: (xemacs)Undoing Changes, for more information +on undoing changes. + + +File: new-users-guide.info, Node: Customization Basics, Next: Help, Prev: Edit, Up: Top + +Customize key bindings and menus +******************************** + + When you start Emacs, it reads the file `~/.emacs' in your home +directory. You can use this file to initialize and customize Emacs to +your liking. This file should contain lisp-code. You can customize your +`.emacs' file to create new menus, disable menus, change key bindings, +enable a minor mode, etc. Any kind of customization affects only a +particular Emacs job that you do them in. If you want to save your +customizations `permanently' i.e. for future use also, you have to put +it in your `.emacs' file. After you make changes to your `.emacs' file +and save it, the changes will be effective only after you start Emacs +again i.e. for a new Emacs process. To try out some of the examples in +this section, highlight that region and evaluate the region by giving +the command `M-x eval-region'. You will be able to see the results of +your customizations in that Emacs session only (*note Lisp Eval: +(xemacs)Lisp Eval.). + +* Menu: + +* Customizing key Bindings:: Changing Key Bindings +* Customizing Menus:: Adding, Deleting, Enabling and Disabling Menus + + +File: new-users-guide.info, Node: Customizing key Bindings, Next: Customizing Menus, Prev: Customization Basics, Up: Customization Basics + +Customize key bindings +====================== + + Most of Emacs commands use key sequences. *Note Keystrokes: +(xemacs)Keystrokes, for more information about Keys and Commands. In +Emacs, the keys themselves carry no meaning unless they are bound to a +function. For example, `C-n' moves the cursor to the next line because +its bound to the function next-line. Similarly, `C-p' moves to the +previous line because its bound to the function previous-line. The +functions themselves define a particular behavior. You can customize +the key `C-n' to move to the previous line by binding it to +previous-line and `C-p' to move to the next line by binding it to +next-line. To bind keys to globally run commands you need to use the +following syntax in your .emacs file: + + `(global-set-key KEYS CMD)' + +Here, `global-set-key' is a function which will bind the "keys" to the +specified "cmd". For example, if you type the following in your .emacs +file: + + (global-set-key "\C-p" 'next-line) + (global-set-key "\C-n" 'previous-line) + +then `C-p' will move to the next line and `C-n' to the previous line. + + You can also disable a key binding, by using `nil' as the CMD in the +syntax stated above. Here, `nil' stands for `false' which means disable +a command or turn off a feature. If you want to enable a command or +turn on a particular feature use `t' which stands for `true'. For +example, if you do not wish `C-x C-c' to `Exit Emacs' you can type the +following expression in your `.emacs' file: + + (global-set-key "\C-x\C-c" nil) + +You might want to have this statement in your `.emacs' file because its +easy to hit this command by mistake and it could be annoying to exit +Emacs unintentionally. There is a Exit Emacs option in the File menu +which you might want to use instead. To make a particular key undefined +you can also use: + + (global-unset-key "\C-x\C-c") + +Now if you use the command `C-x C-c', you will get an error saying that +the command is undefined. + + Some other customizations you could try are: + * (global-set-key 'button3 'beginning-of-buffer) + + Now when you press the third button of your mouse, the cursor will + be placed at the `beginning-of-buffer'. + + * (global-set-key 'f1 'goto-line) + + If you press the key, you will be prompted for a line number. + After you type the line number and hit , the cursor will be + placed on that line number. + + * (global-set-key 'f2 'undo) + + Pressing will undo the last command. If you have a key + on your keyboard, try binding that key to the undo command. + + Another syntax for customizing key bindings is: `(define-key KEYMAP +KEYS DEF)' It defines KEYS to run DEF in the keymap KEYMAP. + + KEYMAP is a keymap object which records the bindings of keys to the +commands that they run. + + KEYS is the sequence of keystrokes to bind. + + DEF is anything that can be a key's definition: + + Look at the following two examples: + + (define-key global-map "\C-xl" 'make-symbolic-link) + (define-key c-mode-map "\C-xl" 'make-symbolic-link) + +Both the examples bind the key `C-xl' to run the function +`make-symbolic-link' (*note Misc File Ops: (xemacs)Misc File Ops.). +However, the second example will bind the key only for C mode. *Note +Major Modes: (xemacs)Major Modes, for more information on Major Modes +in XEmacs. + + +File: new-users-guide.info, Node: Customizing Menus, Prev: Customizing key Bindings, Up: Customization Basics + +Customizing Menus +================= + + You can customize any of the XEmacs Pull-down-Menus. You can create +your own menu, delete an existing one, enable a menu or disable a menu. +For more information on the default menus available to you, *Note +Pull-down Menus::. + + Some of the functions which are available to you for customization +are: + 1. add-menu-item: (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 unchanged. For example, if you add the following + example to your `.emacs' file or evaluate it (*note Customization + Basics::.), + + (add-menu-item '("Edit") "Replace String" replace-string t "Clear") + + a sub-menu Replace String will be created under Edit menu before + the sub-menu Clear. The Edit menu will now look like: + + Undo C-x u + Cut cut + Copy copy + Paste paste + Replace String + Clear + Start Macro Recording C-x( + End Macro Recording C-x) + Execute Last Macro C-xe + + Replace String will now execute the function `replace-string'. + Select this menu item. Emacs will prompt you for a string name to + be replaced. Type a string and hit . Now type a new string to + replace the old string and hit . All occurrences of the old + string will be replaced by the new string. In this example, + + `Edit' is the MENU-NAME which identifies the menu into which the + new menu item should be inserted. + + `Replace String' is the ITEM-NAME which names the menu item to be + added. + + `replace-string' is the FUNCTION i.e. the command to be invoked + when the menu item "Replace String" is selected. + + `t' is the ENABLED-P parameter which controls whether the menu + item is selectable or not. This parameter can be either `t' + (selectable), `nil' (not selectable), or a form to evaluate. This + form is evaluated just before the menu is displayed, and the menu + item will be selectable if the form returns non-`nil'. + + `Clear' is the &OPTIONAL BEFORE parameter which is the name of the + menu before which the new menu or sub-menu should be added. The + &OPTIONAL string means that this parameter is optional. You do not + need to specify this parameter. If you do not specify this + parameter in the example above, the Replace String menu item will + be added at the end of the list of sub-menus in the Edit menu i.e. + after Execute Last Macro. + + If you wish to add a new menu to the menubar, try: + + (add-menu-item nil "Bot" 'end-of-buffer t) + + This will create a new menu Bot on the menu bar. Selecting this + menu will take you to the end of the buffer. Using `nil' for the + parameter MENU-NAME will create a new menu. Your menu-bar will now + look like: + + File Edit Options Buffers Bot Help + + The following example will illustrate how you can add sub-menus to + the submenus themselves: + + (add-menu-item '("File" "Management") "Copy File" 'copy-file t) + (add-menu-item '("File" "Management") "Delete File" 'delete-file t) + (add-menu-item '("File" "Management") "Rename File" 'rename-file t) + + This will create a sub-menu Management under the File menu. When + you select the submenu Management, it will contain three submenus: + Copy File, Delete File and Rename File. + + 2. delete-menu-item: (MENU-PATH) This function will remove the menu + item defined by MENU-NAME from the menu hierarchy. Look at the + following examples and the comments just above them which specify + what the examples do. + + ;; deletes the "Replace String" menu item created earlier + (delete-menu-item '("Edit" "Replace String")) + + ;; deletes the "Bot" menu created earlier + (delete-menu-item '("Bot")) + + ;; deletes the sub-menu "Copy File" created earlier + (delete-menu-item '("File" "File Management" "Copy File")) + + ;; deletes the sub-menu "Delete File" created earlier + (delete-menu-item '("File" "Management" "Delete File")) + + ;; deletes the sub-menu "Rename File" created earlier + (delete-menu-item '("File" "Management" "Rename File")) + + 3. disable-menu-item: (MENU-NAME) Disables the specified menu item. + The following example + + (disable-menu-item '("File" "Management" "Copy File")) + + will make the Copy File item unselectable. This menu-item would + still be there but it will appear faded which would mean that it + cannot be selected. + + 4. enable-menu-item: (MENU-NAME) Enables the specified previously + disabled menu item. + + (enable-menu-item '("File" "Management" "Copy File")) + + This will enable the sub-menu Copy File, which was disabled by the + earlier command. + + 5. relabel-menu-item: (MENU-NAME NEW-NAME) Change the string of the + menu item specified by MENU-NAME to NEW-NAME. + + (relabel-menu-item '("File" "Open...") "Open File") + + This example will rename the Open... menu item from the File menu + to Open File. + + diff --git a/info/new-users-guide.info-2 b/info/new-users-guide.info-2 new file mode 100644 index 0000000..bbd6423 --- /dev/null +++ b/info/new-users-guide.info-2 @@ -0,0 +1,1246 @@ +This is Info file ../../info/new-users-guide.info, produced by Makeinfo +version 1.68 from the input file new-users-guide.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Intro: (new-users-guide). Introduction to the XEmacs Editor. +END-INFO-DIR-ENTRY + + This manual serves as an introduction to the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, 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. + + +File: new-users-guide.info, Node: Help, Next: Modes, Prev: Customization Basics, Up: Top + +Help +**** + + XEmacs provides a comprehensive Help facility. On the extreme right +of the menu-bar there is a Help menu. There are several help commands +provided by this menu. You can also use `C-h' for invoking the Help +facility. Type "?" for a list of keys you can type after typing `C-h'. +If you want more information on what your options are and what kind of +help you can get type "?" again. You will get a listing of all the keys +you can type and what they will do. Initially if you want help, type +`C-h' three times. + +* Menu: + +* The Help Menu:: Items on the Help menu + + +File: new-users-guide.info, Node: The Help Menu, Prev: Help, Up: Help + +Help menu +========= + + When you click on the Help menu with any of the mouse buttons you +will get the following menu items: + +Info + Selecting this item will take you to the Info page which is the + online documentation browsing system. You can simply click on the + highlighted items and "Info" will take you to the document + providing information about that topic. + +Describe Mode + After you select this item, you will get a documentation on the + major and minor modes which are enabled in the buffer you are + working with. *Note Modes::, for information on Modes. + +Hyper Apropos... + After you select this item, you will see the following message in + the echo area: + + List symbols matching regexp: + + If you type "mode" and hit , you will get a list of all the + symbols (like functions and commands). You can now get + documentation on any of the given symbols by "clicking" on any of + the symbols (i.e. drag your mouse on the appropriate symbol and + release the button). For example, if you "click" on the + 'auto-fill-mode' you will get the following message in the window + at the bottom: + + auto-fill-mode + + Function, Command: + + Toggle auto-fill mode. + With arg, turn auto-fill mode on if and only if arg is positive. + In auto-fill mode, inserting a space at a column beyond `fill-column' + automatically breaks the line at a previous space. + + Variable: + + value = nil + + variable not documented + +Command Apropos... + Selecting this item will prompt you for a string just like when you + select Hyper Apropos.... After you give a string name, you will get + a listing of all the functions and commands containing that string + name with a very short description about what that command does. + +Full Apropos... + After you select this item, you will be prompted for a string name + in the echo area: + + Apropos (regexp): + + Now you can give any string name, for example "mode" and hit + . You will get a listing of all the variables and commands + containing that string i.e "mode" with a short description of its + function. + +List Keybindings + Select this item and you will get a listing of all the keys and the + commands that they execute. Depending on which Major mode your + buffer is in, you will get a listing of the special keybindings + for that particular buffer also. For example, if you are in + "Texinfo" mode, part of your list will contain: + + 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 + + These keybindings apply only to "Texinfo" mode. *Note Modes::, for + more information on various modes. + +Describe Key... + After you select this item, you will be see the following message + in the echo area: + + Describe Key: + After you type a command key sequence, full documentation of that + command will be displayed. For example if you type `C-g', you will + see the following documentation for `C-g': + + keyboard-quit: + Signal a `quit' condition. + This means that `C-g' will quit whatever command you gave earlier. + +Describe Function... + This menu item provides documentation for a function. After you + select this item, it will prompt you for a function name in the + echo area: + + Describe function (default ): + + If you hit without giving a function name, you will get + documentation for that default function name, otherwise if you + type a function name and hit , you will get documentation for + the given function. + +Describe Variable... + You can get documentation on any variable by selecting this menu + item. It is similar to Describe Function and will prompt you for a + variable name. + +Unix Manual... + After you select this item you will be prompted for a Unix command + for which you wish to see the man page. You will see the following + message in the echo area: + + Manual entry: (default ) + + Now you can type any command, for example type `who' and press + . You will get the man page for the Unix command `who' which + lists who is on the system. + +Emacs Tutorial + Select this item and you will get a tutorial on Emacs. It is good + for new users. + +Emacs News + Select this item and you will get a lot of historical and current + news on Emacs ! + + For more information on the Help facility, *Note Help: (xemacs)Help. + + +File: new-users-guide.info, Node: Modes, Next: Files, Prev: Help, Up: Top + +Major and Minor Modes +********************* + + XEmacs is "language sensitive". It has several "major" and "minor" +modes. The major modes customize Emacs to edit text of a particular +sort. There are major modes for C, Lisp, Emacs Lisp, LaTeX, English +etc. Within each major mode, certain functions and keys are redefined +to "suit" that particular sort of text. The minor modes provide certain +features which can be turned off or on at any time. Emacs can only be +in one major mode at any time, but it can turn on several minor modes +at the same time. After you have selected any major or minor mode, you +can select Describe Mode from the Help menu and you will get +documentation about those modes. + +* Menu: + +* Major Modes:: Choosing Major Modes +* Minor Modes:: Auto-Fill, Abbrev and other minor modes + + +File: new-users-guide.info, Node: Major Modes, Next: Minor Modes, Prev: Modes, Up: Modes + +Major Modes +=========== + + Emacs has several major modes which customize Emacs to edit text of +various sorts. You can have only one major mode at any time. Within each +major mode, Emacs redefines certain functions (like cursor movement, +indentation and text killing) to suit the needs of the text being +edited. When you are editing a specific type of text you should switch +to the appropriate mode. If you are working with C code, you should +switch to C mode; if you are working with Lisp code, then switch to lisp +mode and if you are working with English text switch to Text mode. + + When you open a file to work on, Emacs usually selects the +appropriate mode. For example, if you open a file called `guide.c' then +Emacs will select the C mode because of the ".c" extension of the file. +To explicitly select a mode type the following command: + + ;;; selects lisp mode + M-x lisp-mode + + ;;; selects C mode + M-x c-mode + +To select any other mode, just add the major mode name before the +'-mode'. The current mode in which you are in will be displayed in +parenthesis in the mode-line at the bottom of the frame. All major +modes have some special keybindings and you can get a listing of those +keybindings by selecting List Keybindings from the Help menu on the +menu bar. + + Some of the available modes in XEmacs are : + +fundamental-mode + When you start XEmacs, usually you start with the default + "Fundamental" mode. This mode has no special definitions or + settings. + +nroff-mode + Use this mode when you have to format a text with nroff before it + can be available in readable form. It redefines some indentation + commands. *Note Nroff Mode: (xemacs)Nroff Mode, for information on + this mode. + +tex-mode + Use this mode if you are using the LaTeX text-formatter. It + provides commands for insertion of quotes, braces and other + characters. It also allows you to format the buffer for printing. + *Note TeX Mode: (xemacs)TeX Mode, for information on this mode. + +texinfo-mode + Texinfo is a documentation system that uses a single source file to + produce both printed output and on-line documentation. When you + use this mode, there will be some special keybindings for + inserting some characters and executing some commands. + + This info file which you are reading right now is produced by + 'Texinfo' + +outline-mode + Use this mode for editing outlines. When you enable this mode, you + can make part of the text temporarily invisible so that you can + see the overall structure of the outline. *Note Outline Mode: + (xemacs)Outline Mode, for information on this mode. + +c-mode + Use this mode for C programs. It will redefine some indentation + commands. *Note C Indent: (xemacs)C Indent. + +lisp-mode + Use this mode for Lisp programs. Look at the XEmacs User's Manual + for more information. + +fortran-mode + Use this mode for Fortran programs. This mode provides special + commands to move around and some other indentation commands. For + more information on this mode, *Note Fortran: (xemacs)Fortran. + +edit-picture + This is the picture mode which you can use to create a picture out + of text characters. *Note Picture: (xemacs)Picture, for more + information. + +asm-mode + Use asm-mode for editing files of assembler code. Look at the file + ` /usr/local/lib/xemacs-19.11/lisp/modes/asm.el' for more + information. + + There are some other modes and commands for working with other kinds +of text or programs. Emacs also provides commands for reading and +sending Mail. For more information on these features look at the XEmacs +Manual. Emacs also provides the functions of a desk calendar, with a +diary of past or planned events. For more information on the calendar +mode look at the manual for Calendar Mode and Diary. + + +File: new-users-guide.info, Node: Minor Modes, Prev: Major Modes, Up: Modes + +Minor Modes +=========== + + The minor modes in Emacs provide some optional features which you can +turn on or off. Any number of minor modes can be active at the same time +with any major mode. You can enable a minor mode in one buffer and +disable it in other mode. To enable a minor mode, for example the +font-lock mode type the following command: + + M-x font-lock-mode + +To enable the other minor modes, replace the "font-lock" with the name +of the minor mode. To disable the mode type the command again. A +positive argument will always turn the mode on. Whenever you type this +command, it will turn the mode on if it was off, OR it will turn it off +if it was on i.e. it toggles. Look at the mode-line at the bottom of the +frame. If it says FLock in parentheses, then it means that this mode is +on, otherwise it is off. + + The following are some of the minor modes available in XEmacs. To +enable any one of them type "M-x" in front of them. + +font-lock-mode + You can also choose this mode by selecting the Syntax Highlighting + menu item from the Options menu on the menu-bar at the top. If you + wish to have this mode enabled permanently, choose Save Options + from the Options menu. *Note Options Menu::, for more information + on the Options menu. You can also add statements in your `.emacs' + file. For each major mode in which you wish to enable this minor + mode, you need a statement in your `.emacs' file. The following + example shows how to enable the font-lock mode when the major mode + is c-mode. + + (add-hook 'c-mode-hook 'turn-on-font-lock) + + *Note Other Customizations::. + + When you enable this mode, the text will be displayed in different + colors and fonts depending on the type of the text. This makes the + text very easy to read and understand. For example, comments might + be displayed in red, variables in black, functions in blue and + other keywords in different colors and fonts. When you select More + from the Syntax Highlighting option, you get very detailed display + of colors and fonts; function names within comments themselves + might appear in a different font and color. + +auto-fill-mode + Enabling this mode will provide automatic word-wrapping. The + key will break lines i.e. insert newlines as you type to prevent + lines from becoming too long. + +overwrite-mode + When you enable this mode, the text that you type will replace the + existing text rather than moving it to the right (the default + case). You can enable this mode by selecting Overstrike menu-item + from the Options menu from the menu-bar. + +abbrev-mode + After you enable this mode, you can define words which will expand + into some different text i.e. you can define abbreviations. For + example, you might define "expand" to "expand will eventually + expand to this text". After this definition you will be able to + get "expand will eventually expand to this text" simply by typing + + expand + + *Note Abbrevs: (xemacs)Abbrevs, for more information on this mode + and on defining abbreviations. + +auto-save-mode + After you enable this mode in a buffer, the contents of that + buffer will be saved periodically. This will reduce the amount you + might lose in case of a system crash. + +line-number-mode + After you enable this mode, the line number at which your cursor is + present will be displayed continously in the mode line. + +blink-paren + To enable this command, just type + M-x blink-paren + + Do not add the "-mode" to it. You can also select the Paren + Highlighting option from the Options menu. After you enable this + command, put your cursor on one of the left parenthesis. The other + matching parenthesis will start blinking. *Note Options Menu::, + for more information on the Paren Highlighting option. + + For information on some other modes, look at the XEmacs User's Manual +and the associated files. + + +File: new-users-guide.info, Node: Files, Next: Other Customizations, Prev: Modes, Up: Top + +Files +***** + + The basic unit of stored data in Unix is the "file". To edit a file, +you must tell Emacs to read the file into a buffer. This is called +"visiting" the file. You can now edit the buffer and to save the +changes you must write the buffer back to the file. + + In addition to visiting and saving files, Emacs can delete, copy, +rename, and append to files, and operate on file directories. + +* Menu: + +* File Names:: How to type and edit file name arguments. +* Visiting:: Visiting a file prepares Emacs to edit the file. +* Saving Files:: How to save Emacs files. + + +File: new-users-guide.info, Node: File Names, Next: Visiting, Prev: Files, Up: Files + +File Names +========== + + Most of the Emacs commands that operate on a file require you to +specify a file name. For example, you might specify the file name +initially when you enter Emacs : + + xemacs myfile RET + +After you hit , you will enter XEmacs with "myfile" read into the +current buffer. If you do not specify the filename when entering Emacs, +you can use the Open... option from the File menu. You will be prompted +for a filename in the echo area: + + Find file: /usr/workspace/ + +Type in a file name which you want to open after the "/" and hit . +The specified file will be read into the current buffer. The +"/usr/workspace" might be the "default directory". When Emacs prompts +you for a file, it uses the default-directory unless you specify a +directory. You can see what the default directory of the current buffer +is by using the Describe Variable option from the Help menu. When Emacs +prompts you for the variable name to describe, type DEFAULT-DIRECTORY. +If you wish to open a file in some other directory, use or the + key to go back and type the path name of the new directory. + + You can create a new directory by typing `M-x make-directory'. This +command will prompt you for a directory name: + + Create directory: /usr/workspace/ + +After you type a directory name and press , a new directory with +the specified name will be created. If you do not wish to create a new +directory, then simply press `C-g' to quit the command. Similarly, you +can also remove a directory by using the command `remove-directory'. +The command `M-x pwd' will print the current buffer's default +directory. For more information on file names, *Note File Names: +(xemacs)File Names. + + +File: new-users-guide.info, Node: Visiting, Next: Saving Files, Prev: File Names, Up: Files + +Visiting Files +============== + + To edit a file in Emacs you need to "visit" it. "Visiting" a file +means copying its contents (or reading them) into the current buffer. +Emacs will create a new buffer for each file that you visit. The buffer +will be named after the file that you open. If you open a file +`/usr/workspace/myfile.texinfo', the buffer will be called +"myfile.texinfo". If a buffer with this name already exists, a unique +name will be constructed by appending `<2>', `<3>', etc. If this is the +second buffer with the same name, a "<2>" will be appended, "<3>" for a +third buffer and so on. The name of the buffer which is being displayed +in the window will be shown both at the top and bottom of the frame. +Once you are in XEmacs, you can use the following commands: + +`C-x C-f' + This command will visit a file (`find-file'). It will prompt you + for a file name to visit. The Open... option from the File menu + does the same thing: + + Find file: /usr/workspace/ + + Type in a filename and press . You will see a new buffer on + the screen with its name in the mode-line. If the filename you + specify already exists in Emacs, the buffer containing that file + will be selected. You will get an error message if the filename + does not exist. If you still press , a new buffer with the + given filename will be displayed on the screen. + +`C-x C-v' + This command (`find-alternate-file'), will visit a different file + instead of the one visited last. It is similar to `C-c C-f' except + that it kills the current buffer (after offering to save it). + +`C-x 5 C-f' + This command will visit a file in another frame + (`find-file-other-frame') without changing the current window or + frame. The Open in New Frame... from the File menu will do the + same thing. It will prompt you for a file name in the echo area. + After you type the file name and press , the specified file + will be read into a new buffer and displayed on a new frame. + + +File: new-users-guide.info, Node: Saving Files, Prev: Visiting, Up: Files + +Saving Files +============ + + The changes that you make after visiting a file will not be saved +unless you save the buffer. When you save the buffer, Emacs writes the +current contents of the buffer into the visited file. Some commands to +save buffers are: + +`C-x C-s' + This command will permanently save the current buffer in its + visited file (`save-buffer'). You will see the following message + in the echo area if you save a file called "myfile.texinfo" : + + Wrote /usr/workspace/myfile.texinfo + + Try using this command twice. You will get the above message the + first time you use this command, the second time you will get the + following message: + + (No changes need to be saved) + + This message indicates that you haven't made any changes since the + last time you saved the file. + +`C-x s' + This command will save all the buffers in their visited files + (`save-some-buffers'). It will prompt you for typing yes or no: + + Save file /usr/workspace/myfile.texinfo? (y or n) + + You will get the above message for all the buffers. Type "y" if + you want to save the buffer. + +`C-x C-w' + This command will prompt you for a file name and save the current + buffer in that file. (`write-file'). You will see the following + message in the echo area: + + Write file: /usr/workspace/ + + After you type in a file name, press . The buffer will be + saved in a new file. You can make copies of a particular file + using this command. + + You can also undo all the changes made since the file was visited or +saved by reading the text from the file again (called "reverting"). For +more information on this option, *Note Reverting: (xemacs)Reverting. + + When you save a file in Emacs, it destroys its old contents. However, +if you set the variable MAKE-BACKUP-FILES to non-NIL i.e. `t', Emacs +will create a "backup" file. Select the Describe variable option from +the Help menu and look at the documentation for this variable. Its +default value should be `t'. However, if its not then use `M-x +set-variable' to set it to `t' (*note Setting Variables::.). The backup +file will contain the contents from the last time you visited the file. +Emacs also provides options for creating numbered backups. For more +information on backups, *Note Backup: (xemacs)Backup. + + Emacs also saves all the files from time to time so that in case of a +system crash you don't lose lot of your work. You will see the message +`Auto-saving...' displayed in the echo area when the buffer is being +saved automatically. The auto saved files are named by putting the +character `#' in front and back. For example a file called +"myfile.texinfo" would be named as `#myfile.texinfo#'. For information +on controlling auto-saving and recovering data from auto-saving, *Note +Auto Save Files: (xemacs)Auto Save Files. + + Emacs provides protection from simultaneous editing which occurs if +two users are visiting the same file and trying to save their changes. +It will put a lock on a file which is being visited and modified. If +any other user tries to modify that file, it will inform the user about +the lock and provide some options. For more information on protection +against simultaneous editing, *Note Interlocking: (xemacs)Interlocking. + + +File: new-users-guide.info, Node: Other Customizations, Next: Select and Move, Prev: Files, Up: Top + +Other Customizations +******************** + + You can modify the behavior of Emacs in minor ways permanently by +putting your changes in your `.emacs' file. This file contains Lisp +function call expressions. Each of these expressions will consist of a +function name followed by arguments, all surrounded by parentheses. For +example, to turn on the auto-fill-mode (i.e. break lines automatically +when they become too long) , put the following line in your `.emacs' +file: + + (add-hook 'text-mode-hook + '(lambda() (auto-fill-mode 1))) + +Emacs has a function named "turn-on-auto-fill" which is defined as +"(lambda() (auto-fill-mode 1))". Therefore you can also write the above +as: + + (add-hook 'text-mode-hook 'turn-on-auto-fill) + +Emacs provides a number of hooks for the sake of customization. The hook +variables contain list of functions to be called with no arguments. To +turn on the auto-fill-mode, add the appropriate hook as shown in the +example above. + + Similarly, to enable the "font-lock mode" which displays your +program in different fonts and colors(*note Modes::.), put the +following in your `.emacs' file. The comments above the statement +explain what the statements do. + + ;;; enables the font-lock-mode in Lisp Mode + (add-hook 'lisp-mode-hook 'turn-on-font-lock) + + ;;; enables the font-lock-mode in Texinfo Mode + (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) + + To turn on the font-lock mode in other Major Modes like emacs-lisp, +just put the name of the mode with "-hook" appended to it as the middle +parameter in the above examples. You can also select the color that the +functions, comments or other keywords should be displayed in : + + ;;; the function names will now be displayed in blue color + (set-face-foreground 'font-lock-function-name-face "blue") + + ;;; the comments will be displayed in forest green + (set-face-foreground 'font-lock-comment-face "forest green") + +For other customizations regarding the font-lock face, look at the file +`/usr/local/lib/xemacs-19.11/etc/sample.emacs'. + +* Menu: + +* Setting Variables:: Customizing Emacs variables +* Init File:: Some examples of Lisp expressions in + .emacs file + + +File: new-users-guide.info, Node: Setting Variables, Next: Init File, Prev: Other Customizations, Up: Other Customizations + +Other Customizations +==================== + + In XEmacs, "variables" are used for internal record-keeping and +customizations. There are some variables called "options" which you can +use for customizations. To examine a variable use: + + ;;; print the value and documentation of the variable, use either of the + ;;; following commands + C-h v + M-x describe variable + + After you type any of the above commands, you will be prompted for a +variable name in the "echo area". Type in the name of the variable, for +example, type CASE-FOLD-SEARCH Your window will split into two +and you will see the following message in that window: + + case-fold-search's value is t + This value is specific to the current buffer. + + Documentation: + *Non-nil if searches should ignore case. + Automatically becomes buffer-local when set in any fashion. + +Since this variable's value is 't' searches will ignore case. If you +want case-sensitive-search (i.e. if you are searching for "Foo" and you +do not want "foo" to be included in the search, you need to set this +variable to "nil". In order to do that, use: + + M-x set-variable + +Emacs will prompt you for the variable which you wish to set. Type in +"case-fold-search" and hit . You will see the following message: + + Set case-fold-search to value: + +Type "nil" and hit . Now if you again use `M-x describe variable' +, you will see that the new value of case-fold-search will be "nil" and +your searches will be case-sensitive. This will be effective only for +that Emacs session. If you want to change the value of a variable +permanently put the following statement in your `.emacs' file : + + (setq case-fold-search nil) + +This statement will make searches case-sensitive only in the current +buffer which is the `.emacs' file. This will not be very useful. To +make searches case-sensitive globally in all buffers, use: + + (setq-default case-fold-search nil) + + If you want to change the value of any other variable, use : + + (setq ) + +"setq" will assign the "new value" to the "variable-name" . + + If you want a list of the "options" i.e. the variables available for +customization type: + + + ;;; displays a buffer listing names, values and documentation of options + M-x list-options + + ;;; displays options and allows you to edit those list of options + M-x edit-options + +Try these options. If you are using edit-options to edit a variable, +just point at the variable you wish to edit and use one of the following +commands: + +1 + Set the value of the variable to t (non-nil). + +0 + Set the value of the variable to nil. + +n + Move to the next variable. + +p + Move to the previous variable. + + There are some other options available to make the value of a +variable local to a buffer and then to switch to its global value. You +can also have a "local variables list" in a file which specifies the +values to use for certain Emacs variables when you edit that file. +*Note Variables: (xemacs)Variables, for information on these options. + + +File: new-users-guide.info, Node: Init File, Prev: Setting Variables, Up: Other Customizations + +Init File Examples +================== + + For customizing Emacs, you need to put Lisp expressions in your +`.emacs' file. The following are some useful Lisp expressions. If you +find any of them useful, just type them in your `.emacs' file: + + * The following expression will make in C mode insert a real + tab character if the cursor or point is in the middle of the line. + Now hitting the key will indent a line only if the cursor is + at the left margin or in the line's indentation: + + (setq c-tab-always-indent nil) + + The value of the variable C-TAB-ALWAYS-INDENT is usually `t' for + `true'. When this variable is true, then hitting the key + always indents the current line. + + * This expression will turn on the AUTO-FILL-MODE when you are in + text mode: + + (setq text-mode-hook 'turn-on-auto-fill) + + This mode will automatically break lines when you type a space so + that the lines don't become too long. The length of the lines is + controlled by the variable FILL-COLUMN. You can set this variable + to a value you wish. Look at the documentation for this variable + to see its default value. To change the value to 75 for example, + use: + + (setq-default fill-column 75) + + This will change the value of this variable globally. + + * The following expression will enable the use of EVAL-EXPRESSION + without confirmation: + + (put 'eval-expression 'disabled nil) + + Now when you use EVAL-EXPRESSION, it will print the value of the + expression you specify in the "echo area" without confirming with + you. + + * This expression will remove the binding of `C-x C-c', because its + easy to hit this key by mistake and you will exit Emacs + unintentionally. You can use the Exit Emacs option from the File + menu to exit Emacs. + + (global-set-key "\C-x\C-c" nil) + + Now if you type `C-x C-c', you won't exit Emacs. + + * The following expression will make the and the + key work in the same manner: + + (global-set-key 'backspace [delete]) + + * This expression will make searches case sensitive: + + (setq-default case-fold-search nil) + + If we use "setq" instead of "setq-default" then searches will be + case-sensitive only in the current buffer's local value. In this + case the buffer would be the `.emacs' file. Since this would not + be too helpful and we want to have case-sensitive searches in all + buffers, we have to use "setq-default". + + * This expression will enable the font-lock mode when you are using + texinfo mode: + + (add-hook 'texinfo-mode-hook 'turn-on-font-lock) + + *Note Minor Modes::, for information on font-lock mode. + + * Rebinds the key `C-x l' to run the function `make-symbolic-link': + + (global-set-key "\C-xl" 'make-symbolic-link) + + We use the single quote before "make-symbolic-link" because its a + function name. You can also use the following expression which + does the same thing: + + (define-key global-map "C-xl" 'make-symbolic-link) + + * The following expression will bind `C-x l' to run the function + `make-symbolic-link' in C mode only: + + (define-key c-mode-map "C-xl" 'make-symbolic-link) + + Instead of binding `C-xl' to run `make-symbolic-link', you can + bind the key to run this function: + + (define-key c-mode-map 'f1 'make-symbolic-link) + + Here, you have to use lower case for naming function keys like + . + + * You can bind the function `undo' i.e. `C-x u' to any key, for + example to : + + (global-set-key 'f2 'undo) + + * The following statement will display the current time in the + modeline of the buffer: + + (display-time) + + * This displays the current line number on which the cursor is + present in the modeline: + + (setq line-number-mode t) + + * If you don't want the text to be highlighted when you use commands + for marking regions so as to use the "kill" and "yank" commands + later, you can use the following expression in your `.emacs' file: + + (setq zmacs-regions nil) + + Now if you use a command like `C-x C-p' (`mark-page'), the text + will not be highlighted. + + * To control the number of buffers listed when you select the Buffers + menu, you need to set the variable BUFFERS-MENU-MAX-SIZE to + whatever value you wish. For example, if you want 20 buffers to be + listed when you select Buffers use: + + (setq buffers-menu-max-size 20) + + * If you want the window title area to display the full + directory/name of the current buffer's file, and not just the + name, use: + + (setq frame-title-format "%S: %f") + + * To get rid of the menu, use : + + (set-menubar nil) + + * If you want an extensive menu-bar use the following expression in + your `.emacs' file. + + (load "big-menubar") + + If you want to write your own menus, you can look at some of the + examples in + `/usr/local/lib/xemacs-20.0/lisp/packages/big-menubar.el' file. + + For more information on initializing your `.emacs' file, *Note Init +File: (xemacs)Init File. You should also look at +`/usr/local/lib/xemacs-20.0/etc/sample.emacs', which is a sample +`.emacs' file. It contains some of the commonly desired customizations +in Emacs. + + +File: new-users-guide.info, Node: Select and Move, Next: Search and Replace, Prev: Other Customizations, Up: Top + +Selecting and Moving Text +************************* + + Many Emacs commands operate on an arbitrary contiguous part of the +current buffer. You can select some part of the buffer and edit only +that part of the buffer. This selected buffer is called a "region". You +can select text in two ways: + + * You use special keys to select text by defining a region between + the cursor and "the mark" (which you set). + + * If you are running XEmacs under X, you can also select text with + the mouse. + +* Menu: + +* Selecting Text:: Select a region of text by setting the Mark +* Mouse:: Selecting Text with Mouse +* Region Operation:: Various ways to operate on a selected text +* Moving Text:: Moving Text +* Accumulating text:: Accumulating Text from several buffers + + +File: new-users-guide.info, Node: Selecting Text, Next: Mouse, Prev: Select and Move, Up: Select and Move + +Setting the Mark +================ + + To define a region you need to set "the mark" at one end of it and +move the cursor to the other end. Once you set the mark, it remains +there until you set it again to some other place. Each buffer has its +own "mark ring" (a place where Emacs remembers 16 previous locations of +the mark). To set "the mark", you can use the following commands: + +`C-' + This command will set "the mark" at the position of your cursor + (`set-mark-command'). You can move your cursor around and "the + mark" will stay there. + +`C-x C-x' + Interchange mark and point (`exchange-point-and-mark'). Since Emacs + will have only one cursor, after you move the cursor it will be + unable to show you where you set the "the mark". In order to see + "the mark" you can type the command `C-x C-x' which will put your + cursor on the position of your mark and your mark on the position + of your cursor. Use the command again to reset the positions of + your cursor and mark. + +`C-<' + This command will push the mark at the beginning of the buffer + without changing the position of your cursor. + +`C->' + This command will push the mark at the end of the buffer without + changing the position of your cursor. + +You can also give arguments to `C-<' or `C->'. *Note The Mark and the +Region: (xemacs)The Mark and the Region, for more information. + + +File: new-users-guide.info, Node: Mouse, Next: Region Operation, Prev: Selecting Text, Up: Select and Move + +Selecting Text with Mouse +========================= + + If you are using XEmacs under X, you can use the mouse to select +text. The selected text will always be highlighted, so just by looking +at the text you know what you have selected so far. To select a word +just double-click with the left-mouse-button on the word. To select a +whole line triple-click anywhere on the line with the +left-mouse-button. You can also use the Copy item from the Edit menu on +the menu-bar to select text. This kind of selection is called Clipboard +selection, *Note X Clipboard Selection: (xemacs)X Clipboard Selection, +for more information. To select an arbitrary region, follow these steps: + + 1. Move the mouse cursor over the character at the beginning of the + region of text you want to select. + + 2. Press and hold the left mouse button. + + 3. While holding the left mouse button down, drag the cursor to the + character at the end of the region of text you want to select. + + 4. Release the left mouse button. + The selected region of text is highlighted. + + *Note Selecting Text with the Mouse: (xemacs)Selecting Text with the +Mouse, for more information regarding the Mouse and additional mouse +operations. + + +File: new-users-guide.info, Node: Region Operation, Next: Moving Text, Prev: Mouse, Up: Select and Move + +Operating on the Region +======================= + + Once you have selected a region you can do a lot of things to the +text in the region: + * Kill the text with `C-w'. For example if you want to kill a + paragraph, position the cursor to the beginning of the paragraph + and type `C-SPC'. Then go to the end of the paragraph and type + `C-w'. The entire paragraph will be deleted. You can also select + the text with a mouse and type `C-w' to kill the entire region. + *Note Killing: (xemacs)Killing, for more information. + + * Save the text in a buffer or a file (*note Accumulating Text: + (xemacs)Accumulating Text.). + + * You can convert the case of the text with `C-x C-l' or `C-x C-u' + If you type `C-x C-u' the selected text will become all + upper-case. If you type `C-x C-l' the selected text will become all + lower-case. + + * Print hardcopy with `M-x print-region'. *Note Hardcopy: + (xemacs)Hardcopy, for more information. This command will print a + hardcopy of only the selected text. + + * Indent it with `C-x ' or `C-M-\' *Note Indentation: + (xemacs)Indentation, for more information. + + +File: new-users-guide.info, Node: Moving Text, Next: Accumulating text, Prev: Region Operation, Up: Select and Move + +Moving Text +=========== + + The most common way to move or copy text in Emacs is through +"killing" or `cutting' it and then "yanking" or `pasting' it. You can +also use the Cut or Copy option from the Edit menu for killing and +copying respectively. *Note Edit menu::, for reviewing the commands for +killing text. All the killed text in Emacs is recorded in the "kill +ring". Since there is only one kill ring in Emacs, you can kill text in +one buffer and yank it in another buffer. To `paste' or `yank' the +killed text you can use the following commands: +`C-y' + This command will yank or paste the last killed text (`yank'). + +`M-w' + Save region as last killed text without actually killing it + (`copy-region-as-kill'). You can use this command to copy a + selected region and then yank (or paste) it without actually + removing it from the buffer. + +`C-M-w' + Append next kill to last batch of killed text + (`append-next-kill'). This command will append whatever you killed + last to what you kill now. Then later you will be able to yank the + entire appended text from the "kill ring". + + +File: new-users-guide.info, Node: Accumulating text, Prev: Moving Text, Up: Select and Move + +Accumulating Text +================= + + The following commands can be used for accumulating text from +different buffers into one place or for copying one region of text into +many buffers: + +`M-x append-to-buffer' + Append region to contents of specified buffer + (`append-to-buffer'). After you type in this command and press + , Emacs will prompt you for a buffer name. You will see a + message in the echo area: + Append to buffer: (default ) + + After you type in a buffer name, a copy of the region will be + inserted at the location of the cursor into that buffer. If there + is no buffer with the name given by you, Emacs will create a new + buffer with that name. By default the cursor's position in the + is at the end. + +`M-x prepend-to-buffer' + Prepend region to contents of specified buffer. This command is + similar to the above command except that the cursor in the buffer + (by default) is at the beginning rather than at the end. + +`M-x copy-to-buffer' + Copy region into specified buffer, deleting that buffer's old + contents. This command will also prompt you for a buffer name. + +`M-x insert-buffer' + Insert contents of specified buffer into current buffer at point. + This command will prompt you for a buffername which you want to be + copied into the current buffer at the location of the cursor. + +`M-x append-to-file' + This command will prompt you for a filename and append the region + to the end of the contents of the specified file. + +*Note Accumulating Text: (xemacs)Accumulating Text, for more +information regarding this topic. + + You can also use "rectangle commands" for operating on rectangular +areas of text. *Note Rectangles: (xemacs)Rectangles, for more +information regarding rectangle commands. + + Emacs also provides "registers" which serve as temporary storage for +text or positions. Each register has a one character name and they can +store "regions", a "rectangle", or a "mark" i.e. a cursor position. +Whatever you store in register stays there until you store something +else in that register. To find out about commands which manipulate +registers *Note Registers: (xemacs)Registers. + + +File: new-users-guide.info, Node: Search and Replace, Prev: Select and Move, Up: Top + +Searching and Replacing +*********************** + + Emacs provides commands for searching for occurrences of a particular +string. The search is incremental i.e. it begins even before you +complete typing the whole string. All searches in Emacs ignore the case +of the text they are searching, i.e. if you are searching for "String", +then "string" will also be one of the selections. If you want a case +sensitive search select the Case Sensitive Search from the Option menu. +You can also set the variable CASE-FOLD-SEARCH to NIL for making +searches case-sensitive. For information on setting variables, *Note +Setting Variables::. The two commands for searching for strings in +XEmacs are: + +`C-s' + This command will prompt you for a string to search : + + I-search: + + If you type "myname" as the string to be searched, then Emacs will + start searching for "m", "my", "myn", etc as you go on typing the + whole string in the forward direction. The cursor will be on the + matching string which has been found so far. If you find the + correct match just hit or type `C-f' or `C-b' to set the + cursor's position. If you find a matching string "myname" but you + were looking for a different occurrence of it, use `C-s' again. If + the search is unable to find the string, it will give you an error + message. + +`C-r' + This command will perform an incremental search in the backward + direction. It will prompt you for a string name: + + I-search backward: + + After you start typing the string name, it will search for the + string in the same fashion as it does for `C-s' except that it + will search in the backward direction. If it cannot find the + string name, it will give you an error message. + + If you make a mistake while typing the string names when you use the +above commands, you can use the key to erase characters. Each + will erase the last character. At any time if you want to quit +the search, just type `C-g'. + + To do a non-incremental search i.e. to start the search only after +you have typed the whole string you can use the following commands: + +`C-s RET "string" RET' + This command will search for the specified string in the forward + direction and will give an error message if the string is not + found. + +`C-r RET "string" RET' + This command will search for the specified string in the backward + direction. + + For information on how Emacs searches for words and regular +expressions, *Note Search: (xemacs)Search. + + To replace all occurrences of a string in Emacs, you can use the +following command: + M-x replace-string + +After you type `M-x replace-string', you will be prompted for a string +name to replace: + + Replace string: + +After you type in a string name, for example "FOO" and press , you +will see another prompt: + + Replace string FOO with: + +Now type the string which you want to replace "FOO" with and press +. After all the occurrences are replaced you will see the message +"Done" in the echo area. If you want only some occurrences of the +string to be replaced, use `M-x query-replace RET RET + RET'. For more information, *Note Query Replace: +(xemacs)Query Replace. + + XEmacs also provides a utility for checking spellings. Use `M-x +ispell-buffer' to check for spellings in the whole buffer. You can also +check the spelling of a word or a region. You can use menus to check +for spellings: + +Evaluate the expression `(load "big-menubar")'. To evaluate this +expression you need to hit the or the key twice and type +in the expression in the echo area before hitting . You will get +an extensive menubar. Select the Spell Check menu item from the +Utilities menu for checking spellings. + + +File: new-users-guide.info, Node: Key Index, Next: Command Index, Prev: Intro, Up: Top + +Key (Character) Index +********************* + +* Menu: + +* C-<: Selecting Text. +* C->: Selecting Text. +* C-a: Cursor Position. +* C-b: Cursor Position. +* C-d: Erase. +* C-e: Cursor Position. +* C-fx: Cursor Position. +* C-g: The Help Menu. +* C-h d: The Help Menu. +* C-h k: The Help Menu. +* C-h t: Edit. +* C-k: Erase. +* C-M-\: Region Operation. +* C-n: Cursor Position. +* C-p: Cursor Position. +* C-r: Search and Replace. +* C-s: Search and Replace. +* C-SPC <1>: Selecting Text. +* C-SPC: Region Operation. +* C-t: Cursor Position. +* C-u: Numeric Argument. +* C-v: Cursor Position. +* C-w: Region Operation. +* C-x 0: XEmacs Window. +* C-x 1: XEmacs Window. +* C-x 2: XEmacs Window. +* C-x 3: XEmacs Window. +* C-x 4: XEmacs Window. +* C-x 4 b: XEmacs Window. +* C-x 4 d: XEmacs Window. +* C-x 4 f: XEmacs Window. +* C-x 4 m: XEmacs Window. +* C-x 5 C-f: Visiting. +* C-x C-c: Exiting. +* C-x C-f: Visiting. +* C-x C-l: Region Operation. +* C-x C-s: Saving Files. +* C-x C-u: Region Operation. +* C-x C-v: Visiting. +* C-x C-w: Saving Files. +* C-x C-x: Selecting Text. +* C-x s: Saving Files. +* C-x TAB: Region Operation. +* C-x u: Undo. +* C-y: Moving Text. +* C-z: Exiting. +* DEL: Insert. +* M--: Numeric Argument. +* M-<: Cursor Position. +* M->: Cursor Position. +* M-C-v: XEmacs Window. +* M-d: Erase. +* M-DEL: Erase. +* M-k: Erase. +* M-v: Cursor Position. +* M-z: Erase. +* RET: Insert. + diff --git a/info/new-users-guide.info-3 b/info/new-users-guide.info-3 new file mode 100644 index 0000000..bc0bf7c --- /dev/null +++ b/info/new-users-guide.info-3 @@ -0,0 +1,261 @@ +This is Info file ../../info/new-users-guide.info, produced by Makeinfo +version 1.68 from the input file new-users-guide.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* Intro: (new-users-guide). Introduction to the XEmacs Editor. +END-INFO-DIR-ENTRY + + This manual serves as an introduction to the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, 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. + + +File: new-users-guide.info, Node: Command Index, Next: Variable Index, Prev: Key Index, Up: Top + +Command and Function Index +************************** + +* Menu: + +* add-menu-item: Customizing Menus. +* append-to-buffer: Accumulating text. +* append-to-file: Accumulating text. +* auto-fill-mode <1>: Minor Modes. +* auto-fill-mode: Insert. +* backward-char: Cursor Position. +* backward-kill-word: Erase. +* backward-word: Cursor Position. +* beginning-of-buffer: Cursor Position. +* beginning-of-line: Cursor Position. +* copy-to-buffer: Accumulating text. +* delete-backward-char: Erase. +* delete-char: Erase. +* delete-menu-item: Customizing Menus. +* delete-other-windows <1>: Windows and Menus. +* delete-other-windows: XEmacs Window. +* delete-window <1>: XEmacs Window. +* delete-window: Windows and Menus. +* describe-variable: Setting Variables. +* dired-other-window: XEmacs Window. +* disable-menu-item: Customizing Menus. +* edit-options: Setting Variables. +* enable-menu-item: Customizing Menus. +* end-of-buffer: Cursor Position. +* end-of-line: Cursor Position. +* eval-expression: Init File. +* eval-region: Customization Basics. +* exchange-point-and-mark: Selecting Text. +* find-alternate-file: Visiting. +* find-file: Visiting. +* find-file-other-frame: Visiting. +* find-file-other-window: XEmacs Window. +* forward-char: Cursor Position. +* forward-word: Cursor Position. +* goto-char: Cursor Position. +* goto-line: Cursor Position. +* help-with-tutorial: Edit. +* isearch-backward: Search and Replace. +* isearch-forward: Search and Replace. +* kill-line: Erase. +* kill-sentence: Erase. +* kill-word: Erase. +* list-options: Setting Variables. +* mail-other-window: XEmacs Window. +* make-directory: File Names. +* make-symbolic-link: Customizing key Bindings. +* mark-beginning-of-buffer: Selecting Text. +* mark-end-of-buffer: Selecting Text. +* next-line: Cursor Position. +* prepend-to-buffer: Accumulating text. +* previous-line: Cursor Position. +* print-region: Region Operation. +* relabel-menu-items: Customizing Menus. +* remove-directory: File Names. +* replace-string: Search and Replace. +* save-buffer: Saving Files. +* save-buffers-kill-emacs: Exiting. +* save-some-buffers: Saving Files. +* scroll-other-window <1>: XEmacs Window. +* scroll-other-window: Windows and Menus. +* set-mark-command: Selecting Text. +* set-variable: Setting Variables. +* split-window-horizontally: XEmacs Window. +* split-window-vertically: XEmacs Window. +* suspend-emacs: Exiting. +* switch-to-buffer-other-window: XEmacs Window. +* transpose-chars: Cursor Position. +* write file: Saving Files. +* yank: Moving Text. +* zap-to-char: Erase. + + +File: new-users-guide.info, Node: Variable Index, Next: Concept Index, Prev: Command Index, Up: Top + +Variable Index +************** + +* Menu: + +* buffers-menu-max-size: Init File. +* case-fold-search: Search and Replace. +* default-directory: File Names. +* display-time: Init File. +* fill-column: Init File. +* frame-title-format: Init File. +* make-backup-files: Saving Files. +* zmacs-regions: Init File. + + +File: new-users-guide.info, Node: Concept Index, Next: Entering, Prev: Variable Index, Up: Top + +Concept Index +************* + +* Menu: + +* .emacs: Customization Basics. +* abbrev-mode: Minor Modes. +* accumulating text: Accumulating text. +* add menus: Customizing Menus. +* asm-mode: Major Modes. +* Auto Delete Selection menu item: Options Menu. +* auto saving: Saving Files. +* auto-save-mode: Minor Modes. +* binding keys: Customizing key Bindings. +* blink-paren: Minor Modes. +* buffer: Entering. +* Buffers menu: Buffers Menu. +* Buffers Menu Length... menu item: Options Menu. +* Buffers Sub-Menus menu item: Options Menu. +* c-mode: Major Modes. +* Case Sensitive Search menu item: Options Menu. +* Clear menu item: Edit menu. +* clipboard selection: Mouse. +* Copy menu item: Edit menu. +* copying text: Accumulating text. +* creating-directories: File Names. +* cursor control: Cursor Position. +* cursor position: Cursor Position. +* cursor shapes: Mouse. +* customize <1>: Customization Basics. +* customize: Other Customizations. +* customize menus: Customizing Menus. +* Cut menu item: Edit menu. +* Delete Frame menu item: File menu. +* delete menus: Customizing Menus. +* deleting: Erase. +* deleting menu items: Customizing Menus. +* deletion: Insert. +* digit argument: Numeric Argument. +* disable menus: Customizing Menus. +* disabling menu items: Customizing Menus. +* displaying time: Init File. +* echo area: Echo Area. +* edit-picture: Major Modes. +* enabling menu items: Customizing Menus. +* End Macro Recording menu item: Edit menu. +* entering Emacs: Enter. +* entering XEmacs: Enter. +* erasing: Erase. +* Execute Last Macro menu item: Edit menu. +* Exit Emacs menu item: File menu. +* exiting: Exiting. +* file: Entering. +* File menu: File menu. +* file names: File Names. +* files: Files. +* Font menu item: Options Menu. +* font-lock-mode <1>: Other Customizations. +* font-lock-mode: Minor Modes. +* fortran-mode: Major Modes. +* fundamental-mode: Major Modes. +* goto-line: Cursor Position. +* help <1>: Help. +* help: The Help Menu. +* Help menu: Help menu. +* hook: Other Customizations. +* init file examples: Init File. +* Insert File... menu item: File menu. +* insertion: Insert. +* key bindings: Customizing key Bindings. +* keystrokes: Customizing key Bindings. +* Kill Buffer menu item: File menu. +* kill ring: Moving Text. +* killing: Moving Text. +* killing Emacs: Exiting. +* line-number-mode: Minor Modes. +* lisp-mode: Major Modes. +* major modes: Major Modes. +* mark: Select and Move. +* menus: XEmacs Window. +* minor modes: Minor Modes. +* mistakes, correcting: Undo. +* mode line: Mode Line. +* modes: Modes. +* mouse selection: Mouse. +* moving text: Moving Text. +* negative argument: Numeric Argument. +* New Frame menu item: File menu. +* newline: Insert. +* nroff-mode: Major Modes. +* numeric argument: Numeric Argument. +* Open ... menu item: File menu. +* open another file: Frame. +* Open in New Frame... menu item: File menu. +* Options menu: Options Menu. +* outline-mode: Major Modes. +* overstrike: Insert. +* Overstrike menu item: Options Menu. +* overwrite-mode: Minor Modes. +* Paren Highlighting menu item: Options Menu. +* Paste menu item: Edit menu. +* pasting: Moving Text. +* primary selection: Mouse. +* Print Buffer menu item: File menu. +* pull-down-menus: XEmacs Window. +* Read Only menu item: Options Menu. +* rectangle commands: Accumulating text. +* region: Select and Move. +* registers: Accumulating text. +* relabelling menu items: Customizing Menus. +* removing-directories: File Names. +* replace: Search and Replace. +* Revert Buffer menu item: File menu. +* Save Buffer As ... menu item: File menu. +* Save Buffer menu item: File menu. +* Save Options: Options Menu. +* saving files: Saving Files. +* searching: Search and Replace. +* selected window: Windows and Menus. +* setting variables: Setting Variables. +* shrinking XEmacs frame: Exiting. +* simultaneous editing: Saving Files. +* Size menu item: Options Menu. +* Split Frame: File menu. +* Start Macro Recording menu item: Edit menu. +* suspending: Exiting. +* Syntax Highlighting menu item: Options Menu. +* Teach Extended Commands menu item: Options Menu. +* temporary storage: Accumulating text. +* tex-mode: Major Modes. +* texinfo-mode: Major Modes. +* top level: Mode Line. +* Un-split (Keep Others): File menu. +* Un-split (Keep This): File menu. +* undo: Undo. +* Undo menu item: Edit menu. +* visiting files: Visiting. +* Weight menu item: Options Menu. +* windows <1>: XEmacs Window. +* windows <2>: Entering. +* windows: Windows and Menus. +* yanking: Moving Text. + + diff --git a/info/standards.info b/info/standards.info index d7b69eb..edaa2b5 100644 --- a/info/standards.info +++ b/info/standards.info @@ -1,12 +1,12 @@ -This is ../info/standards.info, produced by makeinfo version 4.0 from -standards.texi. +This is Info file ../info/standards.info, produced by Makeinfo version +1.68 from the input file standards.texi. START-INFO-DIR-ENTRY * Standards: (standards). GNU coding standards. END-INFO-DIR-ENTRY - GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996, -1997, 1998, 1999, 2000 Free Software Foundation, Inc. + GNU Coding Standards 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 are @@ -24,72 +24,52 @@ translation approved by the Free Software Foundation.  Indirect: -standards.info-1: 980 -standards.info-2: 50916 -standards.info-3: 100599 -standards.info-4: 150168 +standards.info-1: 982 +standards.info-2: 49841 +standards.info-3: 95838  Tag Table: (Indirect) -Node: Top980 -Node: Preface1585 -Node: Legal Issues3105 -Node: Reading Non-Free Code3568 -Node: Contributions5291 -Node: Trademarks7440 -Node: Design Advice8498 -Node: Source Language9004 -Node: Compatibility11011 -Node: Using Extensions12634 -Node: Standard C14205 -Node: Program Behavior16571 -Node: Semantics17489 -Node: Libraries22177 -Node: Errors23417 -Node: User Interfaces25193 -Node: Graphical Interfaces26793 -Node: Command-Line Interfaces27823 -Node: Option Table33308 -Node: Memory Usage48312 -Node: File Usage49332 -Node: Writing C50075 -Node: Formatting50916 -Node: Comments54974 -Node: Syntactic Conventions58272 -Node: Names61679 -Node: System Portability63867 -Node: CPU Portability66247 -Node: System Functions69498 -Node: Internationalization74700 -Node: Mmap77848 -Node: Documentation78553 -Node: GNU Manuals79657 -Node: Doc Strings and Manuals84709 -Node: Manual Structure Details86257 -Node: License for Manuals87670 -Node: Manual Credits88639 -Node: Printed Manuals89027 -Node: NEWS File89708 -Node: Change Logs90380 -Node: Change Log Concepts91129 -Node: Style of Change Logs92984 -Node: Simple Changes95030 -Node: Conditional Changes96265 -Node: Indicating the Part Changed97678 -Node: Man Pages98196 -Node: Reading other Manuals99815 -Node: Managing Releases100599 -Node: Configuration101354 -Node: Makefile Conventions108254 -Node: Makefile Basics109013 -Node: Utilities in Makefiles112178 -Node: Command Variables114314 -Node: Directory Variables117882 -Node: Standard Targets128767 -Ref: Standard Targets-Footnote-1140018 -Node: Install Command Categories140118 -Node: Releases144691 -Node: References148774 -Node: Index150168 +Node: Top982 +Node: Preface1491 +Node: Intellectual Property2529 +Node: Reading Non-Free Code2885 +Node: Contributions4617 +Node: Design Advice6215 +Node: Compatibility6698 +Node: Using Extensions8342 +Node: ANSI C9844 +Node: Source Language11080 +Node: Program Behavior12214 +Node: Semantics12806 +Node: Libraries16560 +Node: Errors17795 +Node: User Interfaces19018 +Node: Memory Usage36043 +Node: Writing C37040 +Node: Formatting37750 +Node: Comments41022 +Node: Syntactic Conventions43815 +Node: Names46753 +Node: System Portability48065 +Node: CPU Portability49841 +Node: System Functions52002 +Node: Internationalization56903 +Node: Documentation59104 +Node: GNU Manuals59648 +Node: Manual Structure Details61690 +Node: NEWS File63095 +Node: Change Logs63776 +Node: Man Pages67978 +Node: Reading other Manuals69597 +Node: Managing Releases70381 +Node: Configuration71087 +Node: Makefile Conventions78027 +Node: Makefile Basics78551 +Node: Utilities in Makefiles81022 +Node: Command Variables82896 +Node: Directory Variables85732 +Node: Standard Targets95838 +Node: Releases105580  End Tag Table diff --git a/info/standards.info-1 b/info/standards.info-1 new file mode 100644 index 0000000..4ffe023 --- /dev/null +++ b/info/standards.info-1 @@ -0,0 +1,1973 @@ +This is Info file ../info/standards.info, produced by Makeinfo version +1.68 from the input file standards.texi. + +START-INFO-DIR-ENTRY +* Standards: (standards). GNU coding standards. +END-INFO-DIR-ENTRY + + GNU Coding Standards 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 are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, 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. + + +File: standards.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir) + +Version +******* + + Last updated 17 May 1996. + +* Menu: + +* 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 + + +File: standards.info, Node: Preface, Next: Intellectual Property, Prev: Top, Up: Top + +About the GNU Coding Standards +****************************** + + The GNU Coding Standards were written by Richard Stallman and other +GNU Project volunteers. Their purpose is to make the GNU system clean, +consistent, and easy to install. This document can also be read as a +guide to writing portable, robust and reliable programs. It focuses on +programs written in C, but many of the rules and principles are useful +even if you write in another programming language. The rules often +state reasons for writing in a certain way. + + Corrections or suggestions regarding this document should be sent to +`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 `standards.texi' or `make-stds.texi' files, but if you +don't have those files, please mail your suggestion anyway. + + This release of the GNU Coding Standards was last updated 17 May +1996. + + +File: standards.info, Node: Intellectual Property, Next: Design Advice, Prev: Preface, Up: Top + +Keeping Free Software Free +************************** + + This node discusses how you can make sure that GNU software remains +unencumbered. + +* Menu: + +* Reading Non-Free Code:: Referring to Proprietary Programs +* Contributions:: Accepting Contributions + + +File: standards.info, Node: Reading Non-Free Code, Next: Contributions, Up: Intellectual Property + +Referring to Proprietary Programs +================================= + + Don't in any circumstances refer to Unix source code for or during +your work on GNU! (Or to any other proprietary programs.) + + If you have a vague recollection of the internals of a Unix program, +this does not absolutely mean you can't write an imitation of it, but +do try to organize the imitation internally along different lines, +because this is likely to make the details of the Unix version +irrelevant and dissimilar to your results. + + For example, Unix utilities were generally optimized to minimize +memory use; if you go for speed instead, your program will be very +different. You could keep the entire input file in core and scan it +there instead of using stdio. Use a smarter algorithm discovered more +recently than the Unix program. Eliminate use of temporary files. Do +it in one pass instead of two (we did this in the assembler). + + Or, on the contrary, emphasize simplicity instead of speed. For some +applications, the speed of today's computers makes simpler algorithms +adequate. + + Or go for generality. For example, Unix programs often have static +tables or fixed-size strings, which make for arbitrary limits; use +dynamic allocation instead. Make sure your program handles NULs and +other funny characters in the input files. Add a programming language +for extensibility and write part of the program in that language. + + Or turn some parts of the program into independently usable +libraries. Or use a simple garbage collector instead of tracking +precisely when to free memory, or use a new GNU facility such as +obstacks. + + +File: standards.info, Node: Contributions, Prev: Reading Non-Free Code, Up: Intellectual Property + +Accepting Contributions +======================= + + 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. *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, 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 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 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. + + +File: standards.info, Node: Design Advice, Next: Program Behavior, Prev: Intellectual Property, Up: Top + +General Program Design +********************** + + This node discusses some of the issues you should take into account +when designing your program. + +* Menu: + +* Compatibility:: Compatibility with other implementations +* Using Extensions:: Using non-standard features +* ANSI C:: Using ANSI C features +* Source Language:: Using languages other than C + + +File: standards.info, Node: Compatibility, Next: Using Extensions, Up: Design Advice + +Compatibility with Other Implementations +======================================== + + With occasional exceptions, utility programs and libraries for GNU +should be upward compatible with those in Berkeley Unix, and upward +compatible with ANSI C if ANSI C specifies their behavior, and upward +compatible with POSIX if POSIX specifies their behavior. + + When these standards conflict, it is useful to offer compatibility +modes for each of them. + + ANSI C and POSIX prohibit many kinds of extensions. Feel free to +make the extensions anyway, and include a `--ansi', `--posix', or +`--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 POSIX if the +environment variable `POSIXLY_CORRECT' is defined (even if it is +defined with a null value). Please make your program recognize this +variable if appropriate. + + When a feature is used only by users (not by programs or command +files), and it is done poorly in Unix, feel free to replace it +completely with something totally different and better. (For example, +`vi' is replaced with Emacs.) But it is nice to offer a compatible +feature as well. (There is a free `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. + + +File: standards.info, Node: Using Extensions, Next: ANSI C, Prev: Compatibility, Up: Design Advice + +Using Non-standard Features +=========================== + + Many GNU facilities that already exist support a number of convenient +extensions over the comparable Unix facilities. Whether to use these +extensions in implementing your program is a difficult question. + + On the one hand, using the extensions can make a cleaner program. +On the other hand, people will not be able to build the program unless +the other GNU tools are available. This might cause the program to +work on fewer kinds of machines. + + With some extensions, it might be easy to provide both alternatives. +For example, you can define functions with a "keyword" `INLINE' and +define that as a macro to expand into either `inline' or nothing, +depending on the compiler. + + In general, perhaps it is best not to use the extensions if you can +straightforwardly do without them, but to use the extensions if they +are a big improvement. + + An exception to this rule are the large, established programs (such +as Emacs) which run on a great variety of systems. Such programs would +be broken by use of GNU extensions. + + Another exception is for programs that are used as part of +compilation: anything that must be compiled with other compilers in +order to bootstrap the GNU compilation facilities. If these require +the GNU compiler, then no one can compile them without having them +installed already. That would be no good. + + +File: standards.info, Node: ANSI C, Next: Source Language, Prev: Using Extensions, Up: Design Advice + +ANSI C and pre-ANSI C +===================== + + Do not ever use the "trigraph" feature of ANSI C. + + ANSI C is widespread enough now that it is ok to write new programs +that use ANSI C features (and therefore will not work in non-ANSI +compilers). And if a program is already written in ANSI C, there's no +need to convert it to support non-ANSI compilers. + + However, it is easy to support non-ANSI compilers in most programs, +so you might still consider doing so when you write a program. Instead +of writing function definitions in ANSI prototype form, + + int + foo (int x, int y) + ... + +write the definition in pre-ANSI style like this, + + int + foo (x, y) + int x, y; + ... + +and use a separate declaration to specify the argument prototype: + + int foo (int, int); + + You need such a declaration anyway, in a header file, to get the +benefit of ANSI C prototypes in all the files where the function is +called. And once you have it, you lose nothing by writing the function +definition in the pre-ANSI style. + + If you don't know non-ANSI C, there's no need to learn it; just +write in ANSI C. + + +File: standards.info, Node: Source Language, Prev: ANSI C, Up: Design Advice + +Using Languages Other Than C +============================ + + 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. So +please write in C. + + There are three exceptions for this rule: + + * 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 the program in Scheme or another language supported by + GUILE. + + * It is okay to use another language in a tool specifically intended + for use with that language. + + This is okay because the only people who want to build the tool + will be those who have installed the other language anyway. + + * If an application is not of extremely widespread interest, then + perhaps it's not important if the application is inconvenient to + install. + + +File: standards.info, Node: Program Behavior, Next: Writing C, Prev: Design Advice, Up: Top + +Program Behavior for All Programs +********************************* + + This node describes how to write robust software. It also describes +general standards for error messages, the command line interface, and +how libraries should behave. + +* Menu: + +* 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 + + +File: standards.info, Node: Semantics, Next: Libraries, Up: Program Behavior + +Writing Robust Programs +======================= + + Avoid arbitrary limits on the length or number of *any* data +structure, including file names, lines, files, and symbols, by +allocating all data structures dynamically. In most Unix utilities, +"long lines are silently truncated". This is not acceptable in a GNU +utility. + + Utilities reading files should not drop NUL characters, or any other +nonprinting characters *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 `perror' or +equivalent) in *every* error message resulting from a failing system +call, as well as the name of the file if any and the name of the +utility. Just "cannot open foo.c" or "stat failed" is not sufficient. + + Check every call to `malloc' or `realloc' to see if it returned +zero. Check `realloc' even if you are making the block smaller; in a +system that rounds block sizes to a power of 2, `realloc' may get a +different block if you ask for less space. + + In Unix, `realloc' can destroy the storage block if it returns zero. +GNU `realloc' does not have this bug: if it fails, the original block +is unchanged. Feel free to assume the bug is fixed. If you wish to +run your program on Unix, and wish to avoid lossage in this case, you +can use the GNU `malloc'. + + You must expect `free' to alter the contents of the block that was +freed. Anything you want to fetch from the block, you must fetch before +calling `free'. + + If `malloc' fails in a noninteractive program, make that a fatal +error. In an interactive program (one that reads commands from the +user), it is better to abort the command and return to the command +reader loop. This allows the user to kill other processes to free up +virtual memory, and then try the command again. + + Use `getopt_long' to decode arguments, unless the argument syntax +makes this unreasonable. + + When static storage is to be written in during program execution, use +explicit C code to initialize it. Reserve C initialized declarations +for data that will not be changed. + + Try to avoid low-level interfaces to obscure Unix data structures +(such 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 `readdir' or some other high-level interface. +These will be supported compatibly by GNU. + + By default, the GNU system will provide the signal handling +functions of BSD and of 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 +indicate the existence of bugs. Whoever wants to fix the bugs will have +to read the source code and run a debugger. So explain the problem with +comments in the source. The relevant data will be in variables, which +are easy to examine with the debugger, so there is no point moving them +elsewhere. + + Do not use a count of errors as the exit status for a program. +*That does not work*, because exit status values are limited to 8 bits +(0 through 255). A single run of the program might have 256 errors; if +you try to return 256 as the exit status, the parent process will see 0 +as the status, and it will appear that the program succeeded. + + If you make temporary files, check the `TMPDIR' environment +variable; if that variable is defined, use the specified directory +instead of `/tmp'. + + +File: standards.info, Node: Libraries, Next: Errors, Prev: Semantics, Up: Program Behavior + +Library Behavior +================ + + Try to make library functions reentrant. If they need to do dynamic +storage allocation, at least try to avoid any nonreentrancy aside from +that of `malloc' itself. + + Here are certain name conventions for libraries, to avoid name +conflicts. + + Choose a name prefix for the library, more than two characters long. +All external function and variable names should start with this prefix. +In addition, there should only be one of these in any given library +member. This usually means putting each one in a separate source file. + + An exception can be made when two external symbols are always used +together, so that no reasonable program could use one without the +other; then they can both go in the same file. + + External symbols that are not documented entry points for the user +should have names beginning with `_'. They should also contain the +chosen name prefix for the library, to prevent collisions with other +libraries. These can go in the same files with user entry points if +you like. + + Static functions and variables can be used as you like and need not +fit any naming convention. + + +File: standards.info, Node: Errors, Next: User Interfaces, Prev: Libraries, Up: Program Behavior + +Formatting Error Messages +========================= + + Error messages from compilers should look like this: + + SOURCE-FILE-NAME:LINENO: MESSAGE + + Error messages from other noninteractive programs should look like +this: + + PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE + +when there is an appropriate source file, or like this: + + PROGRAM: MESSAGE + +when there is no relevant source file. + + 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 +prompt or with the screen layout. (When the same program runs with +input from a source other than a terminal, it is not interactive and +would do best to print error messages using the noninteractive style.) + + The string MESSAGE should not begin with a capital letter when it +follows a program name and/or file name. Also, it should not end with +a period. + + Error messages from interactive programs, and other messages such as +usage messages, should start with a capital letter. But they should not +end with a period. + + +File: standards.info, Node: User Interfaces, Next: Memory Usage, Prev: Errors, Up: Program Behavior + +Standards for Command Line Interfaces +===================================== + + Please don't make the behavior of a utility depend on the name used +to invoke it. It is useful sometimes to make a link to a utility with +a different name, and that should not change what it does. + + Instead, use a run time option or a compilation switch or both to +select among the alternate behaviors. + + 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. + + 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 +pipe, then it is usually best to make the default behavior the one that +is useful with output to a terminal, and have an option for the other +behavior. + + Compatibility requires certain programs to depend on the type of +output device. It would be disastrous if `ls' or `sh' did not do so in +the way all users expect. In some of these cases, we supplement the +program with a preferred alternate version that does not depend on the +output device type. For example, we provide a `dir' program much like +`ls' except that its default output format is always multi-column +format. + + It is a good idea to follow the POSIX guidelines for the +command-line options of a program. The easiest way to do this is to use +`getopt' to parse them. Note that the GNU version of `getopt' will +normally permit options anywhere among the arguments unless the special +argument `--' is used. This is not what POSIX specifies; it is a GNU +extension. + + Please define long-named options that are equivalent to the +single-letter Unix-style options. We hope to make GNU more user +friendly this way. This is easy to do with the GNU function +`getopt_long'. + + One of the advantages of long-named options is that they can be +consistent from program to program. For example, users should be able +to expect the "verbose" option of any GNU program which has one, to be +spelled precisely `--verbose'. To achieve this uniformity, look at the +table of common long-option names when you choose the option names for +your program. The table appears below. + + If you use names not already in the table, please send +`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 `-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 `--version' which prints the +program's version number on standard output and exits successfully, and +an option `--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. + + Here is the table of long options used by GNU programs. + +`after-date' + `-N' in `tar'. + +`all' + `-a' in `du', `ls', `nm', `stty', `uname', and `unexpand'. + +`all-text' + `-a' in `diff'. + +`almost-all' + `-A' in `ls'. + +`append' + `-a' in `etags', `tee', `time'; `-r' in `tar'. + +`archive' + `-a' in `cp'. + +`archive-name' + `-n' in `shar'. + +`arglength' + `-l' in `m4'. + +`ascii' + `-a' in `diff'. + +`assign' + `-v' in `gawk'. + +`assume-new' + `-W' in Make. + +`assume-old' + `-o' in Make. + +`auto-check' + `-a' in `recode'. + +`auto-pager' + `-a' in `wdiff'. + +`auto-reference' + `-A' in `ptx'. + +`avoid-wraps' + `-n' in `wdiff'. + +`backward-search' + `-B' in `ctags'. + +`basename' + `-f' in `shar'. + +`batch' + Used in GDB. + +`baud' + Used in GDB. + +`before' + `-b' in `tac'. + +`binary' + `-b' in `cpio' and `diff'. + +`bits-per-code' + `-b' in `shar'. + +`block-size' + Used in `cpio' and `tar'. + +`blocks' + `-b' in `head' and `tail'. + +`break-file' + `-b' in `ptx'. + +`brief' + Used in various programs to make output shorter. + +`bytes' + `-c' in `head', `split', and `tail'. + +`c++' + `-C' in `etags'. + +`catenate' + `-A' in `tar'. + +`cd' + Used in various programs to specify the directory to use. + +`changes' + `-c' in `chgrp' and `chown'. + +`classify' + `-F' in `ls'. + +`colons' + `-c' in `recode'. + +`command' + `-c' in `su'; `-x' in GDB. + +`compare' + `-d' in `tar'. + +`compat' + Used in `gawk'. + +`compress' + `-Z' in `tar' and `shar'. + +`concatenate' + `-A' in `tar'. + +`confirmation' + `-w' in `tar'. + +`context' + Used in `diff'. + +`copyleft' + `-W copyleft' in `gawk'. + +`copyright' + `-C' in `ptx', `recode', and `wdiff'; `-W copyright' in `gawk'. + +`core' + Used in GDB. + +`count' + `-q' in `who'. + +`count-links' + `-l' in `du'. + +`create' + Used in `tar' and `cpio'. + +`cut-mark' + `-c' in `shar'. + +`cxref' + `-x' in `ctags'. + +`date' + `-d' in `touch'. + +`debug' + `-d' in Make and `m4'; `-t' in Bison. + +`define' + `-D' in `m4'. + +`defines' + `-d' in Bison and `ctags'. + +`delete' + `-D' in `tar'. + +`dereference' + `-L' in `chgrp', `chown', `cpio', `du', `ls', and `tar'. + +`dereference-args' + `-D' in `du'. + +`diacritics' + `-d' in `recode'. + +`dictionary-order' + `-d' in `look'. + +`diff' + `-d' in `tar'. + +`digits' + `-n' in `csplit'. + +`directory' + Specify the directory to use, in various programs. In `ls', it + means to show directories themselves rather than their contents. + In `rm' and `ln', it means to not treat links to directories + specially. + +`discard-all' + `-x' in `strip'. + +`discard-locals' + `-X' in `strip'. + +`dry-run' + `-n' in Make. + +`ed' + `-e' in `diff'. + +`elide-empty-files' + `-z' in `csplit'. + +`end-delete' + `-x' in `wdiff'. + +`end-insert' + `-z' in `wdiff'. + +`entire-new-file' + `-N' in `diff'. + +`environment-overrides' + `-e' in Make. + +`eof' + `-e' in `xargs'. + +`epoch' + Used in GDB. + +`error-limit' + Used in `makeinfo'. + +`error-output' + `-o' in `m4'. + +`escape' + `-b' in `ls'. + +`exclude-from' + `-X' in `tar'. + +`exec' + Used in GDB. + +`exit' + `-x' in `xargs'. + +`exit-0' + `-e' in `unshar'. + +`expand-tabs' + `-t' in `diff'. + +`expression' + `-e' in `sed'. + +`extern-only' + `-g' in `nm'. + +`extract' + `-i' in `cpio'; `-x' in `tar'. + +`faces' + `-f' in `finger'. + +`fast' + `-f' in `su'. + +`fatal-warnings' + `-E' in `m4'. + +`file' + `-f' in `info', `gawk', Make, `mt', and `tar'; `-n' in `sed'; `-r' + in `touch'. + +`field-separator' + `-F' in `gawk'. + +`file-prefix' + `-b' in Bison. + +`file-type' + `-F' in `ls'. + +`files-from' + `-T' in `tar'. + +`fill-column' + Used in `makeinfo'. + +`flag-truncation' + `-F' in `ptx'. + +`fixed-output-files' + `-y' in Bison. + +`follow' + `-f' in `tail'. + +`footnote-style' + Used in `makeinfo'. + +`force' + `-f' in `cp', `ln', `mv', and `rm'. + +`force-prefix' + `-F' in `shar'. + +`format' + Used in `ls', `time', and `ptx'. + +`freeze-state' + `-F' in `m4'. + +`fullname' + Used in GDB. + +`gap-size' + `-g' in `ptx'. + +`get' + `-x' in `tar'. + +`graphic' + `-i' in `ul'. + +`graphics' + `-g' in `recode'. + +`group' + `-g' in `install'. + +`gzip' + `-z' in `tar' and `shar'. + +`hashsize' + `-H' in `m4'. + +`header' + `-h' in `objdump' and `recode' + +`heading' + `-H' in `who'. + +`help' + Used to ask for brief usage information. + +`here-delimiter' + `-d' in `shar'. + +`hide-control-chars' + `-q' in `ls'. + +`idle' + `-u' in `who'. + +`ifdef' + `-D' in `diff'. + +`ignore' + `-I' in `ls'; `-x' in `recode'. + +`ignore-all-space' + `-w' in `diff'. + +`ignore-backups' + `-B' in `ls'. + +`ignore-blank-lines' + `-B' in `diff'. + +`ignore-case' + `-f' in `look' and `ptx'; `-i' in `diff' and `wdiff'. + +`ignore-errors' + `-i' in Make. + +`ignore-file' + `-i' in `ptx'. + +`ignore-indentation' + `-I' in `etags'. + +`ignore-init-file' + `-f' in Oleo. + +`ignore-interrupts' + `-i' in `tee'. + +`ignore-matching-lines' + `-I' in `diff'. + +`ignore-space-change' + `-b' in `diff'. + +`ignore-zeros' + `-i' in `tar'. + +`include' + `-i' in `etags'; `-I' in `m4'. + +`include-dir' + `-I' in Make. + +`incremental' + `-G' in `tar'. + +`info' + `-i', `-l', and `-m' in Finger. + +`initial' + `-i' in `expand'. + +`initial-tab' + `-T' in `diff'. + +`inode' + `-i' in `ls'. + +`interactive' + `-i' in `cp', `ln', `mv', `rm'; `-e' in `m4'; `-p' in `xargs'; + `-w' in `tar'. + +`intermix-type' + `-p' in `shar'. + +`jobs' + `-j' in Make. + +`just-print' + `-n' in Make. + +`keep-going' + `-k' in Make. + +`keep-files' + `-k' in `csplit'. + +`kilobytes' + `-k' in `du' and `ls'. + +`language' + `-l' in `etags'. + +`less-mode' + `-l' in `wdiff'. + +`level-for-gzip' + `-g' in `shar'. + +`line-bytes' + `-C' in `split'. + +`lines' + Used in `split', `head', and `tail'. + +`link' + `-l' in `cpio'. + +`lint' +`lint-old' + Used in `gawk'. + +`list' + `-t' in `cpio'; `-l' in `recode'. + +`list' + `-t' in `tar'. + +`literal' + `-N' in `ls'. + +`load-average' + `-l' in Make. + +`login' + Used in `su'. + +`machine' + No listing of which programs already use this; someone should + check to see if any actually do and tell `gnu@prep.ai.mit.edu'. + +`macro-name' + `-M' in `ptx'. + +`mail' + `-m' in `hello' and `uname'. + +`make-directories' + `-d' in `cpio'. + +`makefile' + `-f' in Make. + +`mapped' + Used in GDB. + +`max-args' + `-n' in `xargs'. + +`max-chars' + `-n' in `xargs'. + +`max-lines' + `-l' in `xargs'. + +`max-load' + `-l' in Make. + +`max-procs' + `-P' in `xargs'. + +`mesg' + `-T' in `who'. + +`message' + `-T' in `who'. + +`minimal' + `-d' in `diff'. + +`mixed-uuencode' + `-M' in `shar'. + +`mode' + `-m' in `install', `mkdir', and `mkfifo'. + +`modification-time' + `-m' in `tar'. + +`multi-volume' + `-M' in `tar'. + +`name-prefix' + `-a' in Bison. + +`nesting-limit' + `-L' in `m4'. + +`net-headers' + `-a' in `shar'. + +`new-file' + `-W' in Make. + +`no-builtin-rules' + `-r' in Make. + +`no-character-count' + `-w' in `shar'. + +`no-check-existing' + `-x' in `shar'. + +`no-common' + `-3' in `wdiff'. + +`no-create' + `-c' in `touch'. + +`no-defines' + `-D' in `etags'. + +`no-deleted' + `-1' in `wdiff'. + +`no-dereference' + `-d' in `cp'. + +`no-inserted' + `-2' in `wdiff'. + +`no-keep-going' + `-S' in Make. + +`no-lines' + `-l' in Bison. + +`no-piping' + `-P' in `shar'. + +`no-prof' + `-e' in `gprof'. + +`no-regex' + `-R' in `etags'. + +`no-sort' + `-p' in `nm'. + +`no-split' + Used in `makeinfo'. + +`no-static' + `-a' in `gprof'. + +`no-time' + `-E' in `gprof'. + +`no-timestamp' + `-m' in `shar'. + +`no-validate' + Used in `makeinfo'. + +`no-warn' + Used in various programs to inhibit warnings. + +`node' + `-n' in `info'. + +`nodename' + `-n' in `uname'. + +`nonmatching' + `-f' in `cpio'. + +`nstuff' + `-n' in `objdump'. + +`null' + `-0' in `xargs'. + +`number' + `-n' in `cat'. + +`number-nonblank' + `-b' in `cat'. + +`numeric-sort' + `-n' in `nm'. + +`numeric-uid-gid' + `-n' in `cpio' and `ls'. + +`nx' + Used in GDB. + +`old-archive' + `-o' in `tar'. + +`old-file' + `-o' in Make. + +`one-file-system' + `-l' in `tar', `cp', and `du'. + +`only-file' + `-o' in `ptx'. + +`only-prof' + `-f' in `gprof'. + +`only-time' + `-F' in `gprof'. + +`output' + In various programs, specify the output file name. + +`output-prefix' + `-o' in `shar'. + +`override' + `-o' in `rm'. + +`overwrite' + `-c' in `unshar'. + +`owner' + `-o' in `install'. + +`paginate' + `-l' in `diff'. + +`paragraph-indent' + Used in `makeinfo'. + +`parents' + `-p' in `mkdir' and `rmdir'. + +`pass-all' + `-p' in `ul'. + +`pass-through' + `-p' in `cpio'. + +`port' + `-P' in `finger'. + +`portability' + `-c' in `cpio' and `tar'. + +`posix' + Used in `gawk'. + +`prefix-builtins' + `-P' in `m4'. + +`prefix' + `-f' in `csplit'. + +`preserve' + Used in `tar' and `cp'. + +`preserve-environment' + `-p' in `su'. + +`preserve-modification-time' + `-m' in `cpio'. + +`preserve-order' + `-s' in `tar'. + +`preserve-permissions' + `-p' in `tar'. + +`print' + `-l' in `diff'. + +`print-chars' + `-L' in `cmp'. + +`print-data-base' + `-p' in Make. + +`print-directory' + `-w' in Make. + +`print-file-name' + `-o' in `nm'. + +`print-symdefs' + `-s' in `nm'. + +`printer' + `-p' in `wdiff'. + +`prompt' + `-p' in `ed'. + +`query-user' + `-X' in `shar'. + +`question' + `-q' in Make. + +`quiet' + Used in many programs to inhibit the usual output. *Please note:* + every program accepting `--quiet' should accept `--silent' as a + synonym. + +`quiet-unshar' + `-Q' in `shar' + +`quote-name' + `-Q' in `ls'. + +`rcs' + `-n' in `diff'. + +`re-interval' + Used in `gawk'. + +`read-full-blocks' + `-B' in `tar'. + +`readnow' + Used in GDB. + +`recon' + `-n' in Make. + +`record-number' + `-R' in `tar'. + +`recursive' + Used in `chgrp', `chown', `cp', `ls', `diff', and `rm'. + +`reference-limit' + Used in `makeinfo'. + +`references' + `-r' in `ptx'. + +`regex' + `-r' in `tac' and `etags'. + +`release' + `-r' in `uname'. + +`reload-state' + `-R' in `m4'. + +`relocation' + `-r' in `objdump'. + +`rename' + `-r' in `cpio'. + +`replace' + `-i' in `xargs'. + +`report-identical-files' + `-s' in `diff'. + +`reset-access-time' + `-a' in `cpio'. + +`reverse' + `-r' in `ls' and `nm'. + +`reversed-ed' + `-f' in `diff'. + +`right-side-defs' + `-R' in `ptx'. + +`same-order' + `-s' in `tar'. + +`same-permissions' + `-p' in `tar'. + +`save' + `-g' in `stty'. + +`se' + Used in GDB. + +`sentence-regexp' + `-S' in `ptx'. + +`separate-dirs' + `-S' in `du'. + +`separator' + `-s' in `tac'. + +`sequence' + Used by `recode' to chose files or pipes for sequencing passes. + +`shell' + `-s' in `su'. + +`show-all' + `-A' in `cat'. + +`show-c-function' + `-p' in `diff'. + +`show-ends' + `-E' in `cat'. + +`show-function-line' + `-F' in `diff'. + +`show-tabs' + `-T' in `cat'. + +`silent' + Used in many programs to inhibit the usual output. *Please note:* + every program accepting `--silent' should accept `--quiet' as a + synonym. + +`size' + `-s' in `ls'. + +`sort' + Used in `ls'. + +`source' + `-W source' in `gawk'. + +`sparse' + `-S' in `tar'. + +`speed-large-files' + `-H' in `diff'. + +`split-at' + `-E' in `unshar'. + +`split-size-limit' + `-L' in `shar'. + +`squeeze-blank' + `-s' in `cat'. + +`start-delete' + `-w' in `wdiff'. + +`start-insert' + `-y' in `wdiff'. + +`starting-file' + Used in `tar' and `diff' to specify which file within a directory + to start processing with. + +`statistics' + `-s' in `wdiff'. + +`stdin-file-list' + `-S' in `shar'. + +`stop' + `-S' in Make. + +`strict' + `-s' in `recode'. + +`strip' + `-s' in `install'. + +`strip-all' + `-s' in `strip'. + +`strip-debug' + `-S' in `strip'. + +`submitter' + `-s' in `shar'. + +`suffix' + `-S' in `cp', `ln', `mv'. + +`suffix-format' + `-b' in `csplit'. + +`sum' + `-s' in `gprof'. + +`summarize' + `-s' in `du'. + +`symbolic' + `-s' in `ln'. + +`symbols' + Used in GDB and `objdump'. + +`synclines' + `-s' in `m4'. + +`sysname' + `-s' in `uname'. + +`tabs' + `-t' in `expand' and `unexpand'. + +`tabsize' + `-T' in `ls'. + +`terminal' + `-T' in `tput' and `ul'. `-t' in `wdiff'. + +`text' + `-a' in `diff'. + +`text-files' + `-T' in `shar'. + +`time' + Used in `ls' and `touch'. + +`to-stdout' + `-O' in `tar'. + +`total' + `-c' in `du'. + +`touch' + `-t' in Make, `ranlib', and `recode'. + +`trace' + `-t' in `m4'. + +`traditional' + `-t' in `hello'; `-W traditional' in `gawk'; `-G' in `ed', `m4', + and `ptx'. + +`tty' + Used in GDB. + +`typedefs' + `-t' in `ctags'. + +`typedefs-and-c++' + `-T' in `ctags'. + +`typeset-mode' + `-t' in `ptx'. + +`uncompress' + `-z' in `tar'. + +`unconditional' + `-u' in `cpio'. + +`undefine' + `-U' in `m4'. + +`undefined-only' + `-u' in `nm'. + +`update' + `-u' in `cp', `ctags', `mv', `tar'. + +`usage' + Used in `gawk'; same as `--help'. + +`uuencode' + `-B' in `shar'. + +`vanilla-operation' + `-V' in `shar'. + +`verbose' + Print more information about progress. Many programs support this. + +`verify' + `-W' in `tar'. + +`version' + Print the version number. + +`version-control' + `-V' in `cp', `ln', `mv'. + +`vgrind' + `-v' in `ctags'. + +`volume' + `-V' in `tar'. + +`what-if' + `-W' in Make. + +`whole-size-limit' + `-l' in `shar'. + +`width' + `-w' in `ls' and `ptx'. + +`word-regexp' + `-W' in `ptx'. + +`writable' + `-T' in `who'. + +`zeros' + `-z' in `gprof'. + + +File: standards.info, Node: Memory Usage, Prev: User Interfaces, Up: Program Behavior + +Memory Usage +============ + + If it typically uses just a few meg of memory, don't bother making +any effort to reduce memory usage. For example, if it is impractical +for other reasons to operate on files more than a few meg long, it is +reasonable to read entire input files into core to operate on them. + + However, for programs such as `cat' or `tail', that can usefully +operate on very large files, it is important to avoid using a technique +that would artificially limit the size of files it can handle. If a +program works by lines and could be applied to arbitrary user-supplied +input files, it should keep only a line in memory, because this is not +very hard and users will want to be able to operate on input files that +are bigger than will fit in core all at once. + + If your program creates complicated data structures, just make them +in core and give a fatal error if `malloc' returns zero. + + +File: standards.info, Node: Writing C, Next: Documentation, Prev: Program Behavior, Up: Top + +Making The Best Use of C +************************ + + This node provides advice on how best to use the C language 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 +* CPU Portability:: Supporting the range of CPU types +* System Functions:: Portability and "standard" library functions +* Internationalization:: Techniques for internationalization + + +File: standards.info, Node: Formatting, Next: Comments, Up: Writing C + +Formatting Your Source Code +=========================== + + It is important to put the open-brace that starts the body of a C +function in column zero, and avoid putting any other open-brace or +open-parenthesis or open-bracket in column zero. Several tools look +for open-braces in column zero to find the beginnings of C functions. +These tools will not work on code not formatted that way. + + It is also important for function definitions to start the name of +the function in column zero. This helps people to search for function +definitions, and may also help certain tools recognize them. Thus, the +proper format is this: + + static char * + concat (s1, s2) /* Name starts in column zero here */ + char *s1, *s2; + { /* Open brace in column zero here */ + ... + } + +or, if you want to use ANSI C, format the definition like this: + + static char * + concat (char *s1, char *s2) + { + ... + } + + In ANSI C, if the arguments don't fit nicely on one line, split it +like this: + + int + lots_of_args (int an_integer, long a_long, short a_short, + double a_double, float a_float) + ... + + For the body of the function, we prefer code formatted like this: + + if (x < foo (y, z)) + haha = bar[4] + 5; + else + { + while (z) + { + haha += foo (z, z); + z--; + } + return ++x + bar (); + } + + We find it easier to read a program when it has spaces before the +open-parentheses and after the commas. Especially after the commas. + + When you split an expression into multiple lines, split it before an +operator, not after one. Here is the right way: + + if (foo_this_is_long && bar > win (x, y, z) + && remaining_condition) + + Try to avoid having two operators of different precedence at the same +level of indentation. For example, don't write this: + + mode = (inmode[j] == VOIDmode + || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]) + ? outmode[j] : inmode[j]); + + Instead, use extra parentheses so that the indentation shows the +nesting: + + mode = ((inmode[j] == VOIDmode + || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]))) + ? outmode[j] : inmode[j]); + + Insert extra parentheses so that Emacs will indent the code properly. +For example, the following indentation looks nice if you do it by hand, +but Emacs would mess it up: + + v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 + + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000; + + But adding a set of parentheses solves the problem: + + v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000 + + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000); + + Format do-while statements like this: + + do + { + a = foo (a); + } + while (a > 0); + + Please use formfeed characters (control-L) to divide the program into +pages at logical places (but not within a function). It does not matter +just how long the pages are, since they do not have to fit on a printed +page. The formfeeds should appear alone on lines by themselves. + + +File: standards.info, Node: Comments, Next: Syntactic Conventions, Prev: Formatting, Up: Writing C + +Commenting Your Work +==================== + + Every program should start with a comment saying briefly what it is +for. Example: `fmt - filter for simple filling of text'. + + 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 +words the meaning of the C argument declarations, if a C type is being +used in its customary fashion. If there is anything nonstandard about +its use (such as an argument of type `char *' which is really the +address of the second character of a string, not the first), or any +possible values that would not work the way one would expect (such as, +that strings containing newlines are not guaranteed to work), be sure +to say so. + + Also explain the significance of the return value, if there is one. + + Please put two spaces after the end of a sentence in your comments, +so that the Emacs sentence commands will work. Also, please write +complete sentences and capitalize the first word. If a lower-case +identifier comes at the beginning of a sentence, don't capitalize it! +Changing the spelling makes it a different identifier. If you don't +like starting a sentence with a lower case letter, write the sentence +differently (e.g., "The identifier lower-case is ..."). + + The comment on a function is much clearer if you use the argument +names to speak about the argument values. The variable name itself +should be lower case, but write it in upper case when you are speaking +about the value rather than the variable itself. Thus, "the inode +number NODE_NUM" rather than "an inode". + + There is usually no purpose in restating the name of the function in +the comment before it, because the reader can see that for himself. +There might be an exception when the comment is so long that the +function itself would be off the bottom of the screen. + + There should be a comment on each static variable as well, like this: + + /* Nonzero means truncate lines in the display; + zero means continue them. */ + int truncate_lines; + + Every `#endif' should have a comment, except in the case of short +conditionals (just a few lines) that are not nested. The comment should +state the condition of the conditional that is ending, *including its +sense*. `#else' should have a comment describing the condition *and +sense* of the code that follows. For example: + + #ifdef foo + ... + #else /* not foo */ + ... + #endif /* not foo */ + +but, by contrast, write the comments this way for a `#ifndef': + + #ifndef foo + ... + #else /* foo */ + ... + #endif /* foo */ + + +File: standards.info, Node: Syntactic Conventions, Next: Names, Prev: Comments, Up: Writing C + +Clean Use of C Constructs +========================= + + Please explicitly declare all arguments to functions. Don't omit +them just because they are `int's. + + Declarations of external functions and functions to appear later in +the source file should all go in one place near the beginning of the +file (somewhere before the first function definition in the file), or +else should go in a header file. Don't put `extern' declarations inside +functions. + + It used to be common practice to use the same local variables (with +names like `tem') over and over for different values within one +function. Instead of doing this, it is better declare a separate local +variable for each distinct purpose, and give it a name which is +meaningful. This not only makes programs easier to understand, it also +facilitates optimization by good compilers. You can also move the +declaration of each local variable into the smallest scope that includes +all its uses. This makes the program even cleaner. + + Don't use local variables or parameters that shadow global +identifiers. + + Don't declare multiple variables in one declaration that spans lines. +Start a new declaration on each line, instead. For example, instead of +this: + + int foo, + bar; + +write either this: + + int foo, bar; + +or this: + + int foo; + int bar; + +(If they are global variables, each should have a comment preceding it +anyway.) + + When you have an `if'-`else' statement nested in another `if' +statement, always put braces around the `if'-`else'. Thus, never write +like this: + + if (foo) + if (bar) + win (); + else + lose (); + +always like this: + + if (foo) + { + if (bar) + win (); + else + lose (); + } + + If you have an `if' statement nested inside of an `else' statement, +either write `else if' on one line, like this, + + if (foo) + ... + else if (bar) + ... + +with its `then'-part indented like the preceding `then'-part, or write +the nested `if' within braces like this: + + if (foo) + ... + else + { + if (bar) + ... + } + + Don't declare both a structure tag and variables or typedefs in the +same declaration. Instead, declare the structure tag separately and +then use it to declare the variables or typedefs. + + Try to avoid assignments inside `if'-conditions. For example, don't +write this: + + if ((foo = (char *) malloc (sizeof *foo)) == 0) + fatal ("virtual memory exhausted"); + +instead, write this: + + foo = (char *) malloc (sizeof *foo); + if (foo == 0) + fatal ("virtual memory exhausted"); + + Don't make the program ugly to placate `lint'. Please don't insert +any casts to `void'. Zero without a cast is perfectly fine as a null +pointer constant, except when calling a varargs function. + + +File: standards.info, Node: Names, Next: System Portability, Prev: Syntactic Conventions, Up: Writing C + +Naming Variables and Functions +============================== + + 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 `enum' constants, and for name-prefixes that +follow a uniform convention. + + For example, you should use names like `ignore_space_change_flag'; +don't use names like `iCantReadThis'. + + Variables that indicate whether command-line options have been +specified should be named after the meaning of the option, not after +the option-letter. A comment should state both the exact meaning of +the option and its letter. For example, + + /* Ignore changes in horizontal whitespace (-b). */ + int ignore_space_change_flag; + + When you want to define names with constant integer values, use +`enum' rather than `#define'. GDB knows about enumeration constants. + + Use file names of 14 characters or less, to avoid creating gratuitous +problems on older System V systems. You can use the program `doschk' +to test for this. `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. + + +File: standards.info, Node: System Portability, Next: CPU Portability, Prev: Names, Up: Writing C + +Portability between System Types +================================ + + In the Unix world, "portability" refers to porting to different Unix +versions. For a GNU program, this kind of portability is desirable, but +not paramount. + + The primary purpose of GNU software is to run on top of the GNU +kernel, compiled with the GNU C compiler, on various types of CPU. The +amount and kinds of variation among GNU systems on different CPUs will +be comparable to the variation among Linux-based GNU systems or among +BSD systems today. So the kinds of portability that are absolutely +necessary are quite limited. + + But many users do run GNU software on non-GNU Unix or Unix-like +systems. So supporting a variety of Unix-like systems is desirable, +although not paramount. + + The easiest way to achieve portability to most Unix-like systems is +to use Autoconf. It's unlikely that your program needs to know more +information about the host platform than Autoconf can provide, simply +because most of the programs that need such knowledge have already been +written. + + Avoid using the format of semi-internal data bases (e.g., +directories) when there is a higher-level alternative (`readdir'). + + As for systems that are not like Unix, such as MSDOS, Windows, the +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. + diff --git a/info/standards.info-2 b/info/standards.info-2 new file mode 100644 index 0000000..4473101 --- /dev/null +++ b/info/standards.info-2 @@ -0,0 +1,1089 @@ +This is Info file ../info/standards.info, produced by Makeinfo version +1.68 from the input file standards.texi. + +START-INFO-DIR-ENTRY +* Standards: (standards). GNU coding standards. +END-INFO-DIR-ENTRY + + GNU Coding Standards 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 are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, 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. + + +File: standards.info, Node: CPU Portability, Next: System Functions, Prev: System Portability, Up: Writing C + +Portability between CPUs +======================== + + Even GNU systems will differ because of differences among CPU +types--for example, difference in byte ordering and alignment +requirements. It is absolutely essential to handle these differences. +However, don't make any effort to cater to the possibility that an +`int' will be less than 32 bits. We don't support 16-bit machines in +GNU. + + Don't assume that the address of an `int' object is also the address +of its least-significant byte. This is false on big-endian machines. +Thus, don't make the following mistake: + + int c; + ... + while ((c = getchar()) != EOF) + write(file_descriptor, &c, 1); + + When calling functions, you need not worry about the difference +between pointers of various types, or between pointers and integers. +On most machines, there's no difference anyway. As for the few +machines where there is a difference, all of them support ANSI C, so +you can use prototypes (conditionalized to be active only in ANSI C) to +make the code work on those systems. + + In certain cases, it is ok to pass integer and pointer arguments +indiscriminately to the same function, and use no prototype on any +system. For example, many GNU programs have error-reporting functions +that pass their arguments along to `printf' and friends: + + error (s, a1, a2, a3) + char *s; + int a1, a2, a3; + { + fprintf (stderr, "error: "); + fprintf (stderr, s, a1, a2, a3); + } + +In practice, this works on all machines, and it is much simpler than any +"correct" alternative. Be sure *not* to use a prototype for such +functions. + + However, avoid casting pointers to integers unless you really need +to. 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. + + +File: standards.info, Node: System Functions, Next: Internationalization, Prev: CPU Portability, Up: Writing C + +Calling System Functions +======================== + + C implementations differ substantially. ANSI C reduces but does not +eliminate the incompatibilities; meanwhile, many users wish to compile +GNU software with pre-ANSI compilers. This chapter gives +recommendations for how to use the more or less standard C library +functions to avoid unnecessary loss of portability. + + * Don't use the value of `sprintf'. It returns the number of + characters written on some systems, but not on all systems. + + * Don't declare system functions explicitly. + + Almost any declaration for a system function is wrong on some + system. To minimize conflicts, leave it to the system header + files to declare system functions. If the headers don't declare a + function, let it remain undeclared. + + While it may seem unclean to use a function without declaring it, + in practice this works fine for most system library functions on + the systems where this really happens; thus, the disadvantage is + only theoretical. By contrast, actual declarations have + frequently caused actual conflicts. + + * If you must declare a system function, don't specify the argument + types. Use an old-style declaration, not an ANSI prototype. The + more you specify about the function, the more likely a conflict. + + * In particular, don't unconditionally declare `malloc' or `realloc'. + + Most GNU programs use those functions just once, in functions + conventionally named `xmalloc' and `xrealloc'. These functions + call `malloc' and `realloc', respectively, and check the results. + + Because `xmalloc' and `xrealloc' are defined in your program, you + can declare them in other files without any risk of type conflict. + + On most systems, `int' is the same length as a pointer; thus, the + calls to `malloc' and `realloc' work fine. For the few + exceptional systems (mostly 64-bit machines), you can use + *conditionalized* declarations of `malloc' and `realloc'--or put + these declarations in configuration files specific to those + systems. + + * The string functions require special treatment. Some Unix systems + have a header file `string.h'; others have `strings.h'. Neither + file name is portable. There are two things you can do: use + Autoconf to figure out which file to include, or don't include + either file. + + * If you don't include either strings file, you can't get + declarations for the string functions from the header file in the + usual way. + + That causes less of a problem than you might think. The newer ANSI + string functions should be avoided anyway because many systems + still don't support them. The string functions you can use are + these: + + strcpy strncpy strcat strncat + strlen strcmp strncmp + strchr strrchr + + The copy and concatenate functions work fine without a declaration + as long as you don't use their values. Using their values without + a declaration fails on systems where the width of a pointer + differs from the width of `int', and perhaps in other cases. It + is trivial to avoid using their values, so do that. + + The compare functions and `strlen' work fine without a declaration + on most systems, possibly all the ones that GNU software runs on. + You may find it necessary to declare them *conditionally* on a few + systems. + + The search functions must be declared to return `char *'. Luckily, + there is no variation in the data type they return. But there is + variation in their names. Some systems give these functions the + names `index' and `rindex'; other systems use the names `strchr' + and `strrchr'. Some systems support both pairs of names, but + neither pair works on all systems. + + You should pick a single pair of names and use it throughout your + program. (Nowadays, it is better to choose `strchr' and `strrchr' + for new programs, since those are the standard ANSI names.) + Declare both of those names as functions returning `char *'. On + systems which don't support those names, define them as macros in + terms of the other pair. For example, here is what to put at the + beginning of your file (or in a header) if you want to use the + names `strchr' and `strrchr' throughout: + + #ifndef HAVE_STRCHR + #define strchr index + #endif + #ifndef HAVE_STRRCHR + #define strrchr rindex + #endif + + char *strchr (); + char *strrchr (); + + Here we assume that `HAVE_STRCHR' and `HAVE_STRRCHR' are macros +defined in systems where the corresponding functions exist. One way to +get them properly defined is to use Autoconf. + + +File: standards.info, Node: Internationalization, Prev: System Functions, Up: Writing C + +Internationalization +==================== + + GNU has a library called GNU gettext that makes it easy to translate +the messages in a program into various languages. You should use this +library in every program. Use English for the messages as they appear +in the program, and let gettext provide the way to translate them into +other languages. + + Using GNU gettext involves putting a call to the `gettext' macro +around each string that might need translation--like this: + + printf (gettext ("Processing file `%s'...")); + +This permits GNU gettext to replace the string `"Processing file +`%s'..."' with a translated version. + + Once a program uses gettext, please make a point of writing calls to +`gettext' when you add new strings that call for translation. + + Using GNU gettext in a package involves specifying a "text domain +name" for the package. The text domain name is used to separate the +translations for this package from the translations for other packages. +Normally, the text domain name should be the same as the name of the +package--for example, `fileutils' for the GNU file utilities. + + 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: + + prinf ("%d file%s processed", nfiles, + nfiles > 1 ? "s" : ""); + +The problem with that example is that it assumes that plurals are made +by adding `s'. If you apply gettext to the format string, like this, + + prinf (gettext ("%d file%s processed"), nfiles, + nfiles > 1 ? "s" : ""); + +the message can use different words, but it will still be forced to use +`s' for the plural. Here is a better way: + + prinf ((nfiles > 1 ? "%d files processed" + : "%d file processed"), + nfiles); + +This way, you can apply gettext to each of the two strings +independently: + + prinf ((nfiles > 1 ? gettext ("%d files processed") + : gettext ("%d file processed")), + nfiles); + +This can handle any language, no matter how it forms the plural of the +word for "file." + + +File: standards.info, Node: Documentation, Next: Managing Releases, Prev: Writing C, Up: Top + +Documenting Programs +******************** + +* Menu: + +* GNU Manuals:: Writing proper manuals. +* Manual Structure Details:: Specific structure conventions. +* NEWS File:: NEWS files supplement manuals. +* Change Logs:: Recording Changes +* Man Pages:: Man pages are secondary. +* Reading other Manuals:: How far you can go in learning + from other manuals. + + +File: standards.info, Node: GNU Manuals, Next: Manual Structure Details, Up: Documentation + +GNU Manuals +=========== + + The preferred way to document part of the GNU system is to write a +manual in the Texinfo formatting language. See the Texinfo manual, +either the hardcopy, or the on-line version available through `info' or +the Emacs Info subsystem (`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. + + 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 +text, so that reading the chapter straight through makes sense. Do +likewise when structuring the book into chapters, and when structuring a +section into paragraphs. The watchword is, *at each point, address the +most fundamental and important issue raised by the preceding text.* + + If necessary, add extra chapters at the beginning of the manual which +are purely tutorial and cover the basics of the subject. These provide +the framework for a beginner to understand the rest of the manual. The +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; 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 file names. + + +File: standards.info, Node: Manual Structure Details, Next: NEWS File, Prev: GNU Manuals, Up: Documentation + +Manual Structure Details +======================== + + 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 `PROGRAM Invocation' or +`Invoking PROGRAM', where 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 +`@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 as the node for this purpose, regardless of the node's actual name. + + There will be automatic features for specifying a program name and +quickly reading just this part of its manual. + + If one manual describes several programs, it should have such a node +for each program described. + + +File: standards.info, Node: NEWS File, Next: Change Logs, Prev: Manual Structure Details, Up: Documentation + +The NEWS File +============= + + In addition to its manual, the package should have a file named +`NEWS' which contains a list of user-visible changes worth mentioning. +In each new release, add items to the front of the file and identify +the version they pertain to. Don't discard old items; leave them in +the file after the newer items. This way, a user upgrading from any +previous version can see what is new. + + If the `NEWS' file gets very long, move some of the older items into +a file named `ONEWS' and put a note at the end referring the user to +that file. + + +File: standards.info, Node: Change Logs, Next: Man Pages, Prev: NEWS File, Up: Documentation + +Change Logs +=========== + + Keep a change log to describe all the changes made to program source +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 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 `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 `ChangeLog' file. + + The easiest way to add an entry to `ChangeLog' is with the Emacs +command `M-x add-change-log-entry'. An entry should have an asterisk, +the name of the changed file, and then in parentheses the name of the +changed functions, variables or whatever, followed by a colon. Then +describe the changes you made to that function or variable. + + 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: + + * register.el (insert-register): Return nil. + (jump-to-register): Likewise. + + * sort.el (sort-subr): Return nil. + + * tex-mode.el (tex-bibtex-file, tex-file, tex-region): + Restart the tex shell if process is gone or stopped. + (tex-shell-running): New function. + + * expr.c (store_one_arg): Round size up for move_block_to_reg. + (expand_call): Round up when emitting USE insns. + * stmt.c (assign_parms): Round size up for move_block_from_reg. + + 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 `* +register.el ({insert,jump-to}-register)'; this is not a good idea, +since searching for `jump-to-register' or `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." + + When you change just comments or doc strings, it is enough to write +an 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 the +passage with the way the program actually works. + + +File: standards.info, Node: Man Pages, Next: Reading other Manuals, Prev: Change Logs, Up: Documentation + +Man Pages +========= + + In the GNU project, man pages are secondary. It is not necessary or +expected for every GNU program to have a man page, but some of them do. +It's your choice whether to include a man page in your program. + + When you make this decision, consider that supporting a man page +requires continual effort each time the program is changed. The time +you spend on the man page is time taken away from more useful work. + + For a simple program which changes little, updating the man page may +be a small job. Then there is little reason not to include a man page, +if you have one. + + For a large program that changes a great deal, updating a man page +may be a substantial burden. If a user offers to donate a man page, +you may find this gift costly to accept. It may be better to refuse +the man page unless the same person agrees to take full responsibility +for maintaining it--so that you can wash your hands of it entirely. If +this volunteer later ceases to do the job, then don't feel obliged to +pick it up yourself; it may be better to withdraw the man page from the +distribution until someone else agrees to update it. + + When a program changes only a little, you may feel that the +discrepancies are small enough that the man page remains useful without +updating. If so, put a prominent note near the beginning of the man +page explaining that you don't maintain it and that the Texinfo manual +is more authoritative. The note should say how to access the Texinfo +documentation. + + +File: standards.info, Node: Reading other Manuals, Prev: Man Pages, Up: Documentation + +Reading other Manuals +===================== + + There may be non-free books or documentation files that describe the +program you are documenting. + + It is ok to use these documents for reference, just as the author of +a new algebra textbook can read other books on algebra. A large portion +of any non-fiction book consists of facts, in this case facts about how +a certain program works, and these facts are necessarily the same for +everyone who writes about the subject. But be careful not to copy your +outline structure, wording, tables or examples from preexisting non-free +documentation. Copying from free documentation may be ok; please check +with the FSF about the individual case. + + +File: standards.info, Node: Managing Releases, Prev: Documentation, Up: Top + +The Release Process +******************* + + Making a release is more than just bundling up your source files in a +tar file and putting it up for FTP. You should set up your software so +that it can be configured to run on a variety of systems. Your Makefile +should conform to the GNU standards described below, and your directory +layout should also conform to the standards discussed below. Doing so +makes it easy to include your package into the larger framework of all +GNU software. + +* Menu: + +* Configuration:: How Configuration Should Work +* Makefile Conventions:: Makefile Conventions +* Releases:: Making Releases + + +File: standards.info, Node: Configuration, Next: Makefile Conventions, Up: Managing Releases + +How Configuration Should Work +============================= + + Each GNU distribution should come with a shell script named +`configure'. This script is given arguments which describe the kind of +machine and system you want to compile the program for. + + The `configure' script must record the configuration options so that +they affect compilation. + + One way to do this is to make a link from a standard name such as +`config.h' to the proper configuration file for the chosen system. If +you use this technique, the distribution should *not* contain a file +named `config.h'. This is so that people won't be able to build the +program without configuring it first. + + Another thing that `configure' can do is to edit the Makefile. If +you do this, the distribution should *not* contain a file named +`Makefile'. Instead, it should include a file `Makefile.in' which +contains the input used for editing. Once again, this is so that people +won't be able to build the program without configuring it first. + + If `configure' does write the `Makefile', then `Makefile' should +have a target named `Makefile' which causes `configure' to be rerun, +setting up the same configuration that was set up last time. The files +that `configure' reads should be listed as dependencies of `Makefile'. + + All the files which are output from the `configure' script should +have comments at the beginning explaining that they were generated +automatically using `configure'. This is so that users won't think of +trying to edit them by hand. + + The `configure' script should write a file named `config.status' +which describes which configuration options were specified when the +program was last configured. This file should be a shell script which, +if run, will recreate the same configuration. + + The `configure' script should accept an option of the form +`--srcdir=DIRNAME' to specify the directory where sources are found (if +it is not the current directory). This makes it possible to build the +program in a separate directory, so that the actual source directory is +not modified. + + If the user does not specify `--srcdir', then `configure' should +check both `.' and `..' to see if it can find the sources. If it finds +the sources in one of these places, it should use them from there. +Otherwise, it should report that it cannot find the sources, and should +exit with nonzero status. + + Usually the easy way to support `--srcdir' is by editing a +definition of `VPATH' into the Makefile. Some rules may need to refer +explicitly to the specified source directory. To make this possible, +`configure' can add to the Makefile a variable named `srcdir' whose +value is precisely the specified directory. + + The `configure' script should also take an argument which specifies +the type of system to build the program for. This argument should look +like this: + + CPU-COMPANY-SYSTEM + + For example, a Sun 3 might be `m68k-sun-sunos4.1'. + + The `configure' script needs to be able to decode all plausible +alternatives for how to describe a machine. Thus, `sun3-sunos4.1' +would be a valid alias. For many programs, `vax-dec-ultrix' would be +an alias for `vax-dec-bsd', simply because the differences between +Ultrix and BSD are rarely noticeable, but a few programs might need to +distinguish them. + + There is a shell script called `config.sub' that you can use as a +subroutine to validate system types and canonicalize aliases. + + Other options are permitted to specify in more detail the software +or hardware present on the machine, and include or exclude optional +parts of the package: + +`--enable-FEATURE[=PARAMETER]' + Configure the package to build and install an optional user-level + facility called FEATURE. This allows users to choose which + optional features to include. Giving an optional PARAMETER of + `no' should omit FEATURE, if it is built by default. + + No `--enable' option should *ever* cause one feature to replace + another. No `--enable' option should ever substitute one useful + behavior for another useful behavior. The only proper use for + `--enable' is for questions of whether to build part of the program + or exclude it. + +`--with-PACKAGE' + The package PACKAGE will be installed, so configure this package + to work with PACKAGE. + + Possible values of PACKAGE include `x', `x-toolkit', `gnu-as' (or + `gas'), `gnu-ld', `gnu-libc', and `gdb'. + + Do not use a `--with' option to specify the file name to use to + find certain files. That is outside the scope of what `--with' + options are for. + +`--nfp' + The target machine has no floating point processor. + +`--gas' + The target machine assembler is GAS, the GNU assembler. This is + obsolete; users should use `--with-gnu-as' instead. + +`--x' + The target machine has the X Window System installed. This is + obsolete; users should use `--with-x' instead. + + All `configure' scripts should accept all of these "detail" options, +whether or not they make any difference to the particular package at +hand. In particular, they should accept any option that starts with +`--with-' or `--enable-'. This is so users will be able to configure +an entire GNU source tree at once with a single set of options. + + You will note that the categories `--with-' and `--enable-' are +narrow: they *do not* provide a place for any sort of option you might +think of. That is deliberate. We want to limit the possible +configuration options in GNU software. We do not want GNU programs to +have idiosyncratic configuration options. + + Packages that perform part of the compilation process may support +cross-compilation. In such a case, the host and target machines for +the program may be different. The `configure' script should normally +treat the specified type of system as both the host and the target, +thus producing a program which works for the same type of machine that +it runs on. + + The way to build a cross-compiler, cross-assembler, or what have +you, is to specify the option `--host=HOSTTYPE' when running +`configure'. This specifies the host system without changing the type +of target system. The syntax for HOSTTYPE is the same as described +above. + + Bootstrapping a cross-compiler requires compiling it on a machine +other than the host it will run on. Compilation packages accept a +configuration option `--build=HOSTTYPE' for specifying the +configuration on which you will compile them, in case that is different +from the host. + + Programs for which cross-operation is not meaningful need not accept +the `--host' option, because configuring an entire operating system for +cross-operation is not a meaningful thing. + + Some programs have ways of configuring themselves automatically. If +your program is set up to do this, your `configure' script can simply +ignore most of its arguments. + + +File: standards.info, Node: Makefile Conventions, Next: Releases, Prev: Configuration, Up: Managing Releases + +Makefile Conventions +==================== + + This node describes conventions for writing the Makefiles for GNU +programs. + +* Menu: + +* Makefile Basics:: General Conventions for Makefiles +* Utilities in Makefiles:: Utilities in Makefiles +* Command Variables:: Variables for Specifying Commands +* Directory Variables:: Variables for Installation Directories +* Standard Targets:: Standard Targets for Users + + +File: standards.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions + +General Conventions for Makefiles +--------------------------------- + + Every Makefile should contain this line: + + SHELL = /bin/sh + +to avoid trouble on systems where the `SHELL' variable might be +inherited from the environment. (This is never a problem with GNU +`make'.) + + Different `make' programs have incompatible suffix lists and +implicit rules, and this sometimes creates confusion or misbehavior. So +it is a good idea to set the suffix list explicitly using only the +suffixes you need in the particular Makefile, like this: + + .SUFFIXES: + .SUFFIXES: .c .o + +The first line clears out the suffix list, the second introduces all +suffixes which may be subject to implicit rules in this Makefile. + + Don't assume that `.' is in the path for command execution. When +you need to run programs that are a part of your package during the +make, please make sure that it uses `./' if the program is built as +part of the make or `$(srcdir)/' if the file is an unchanging part of +the source code. Without one of these prefixes, the current search +path is used. + + The distinction between `./' and `$(srcdir)/' is important when +using the `--srcdir' option to `configure'. A rule of the form: + + foo.1 : foo.man sedscript + sed -e sedscript foo.man > foo.1 + +will fail when the current directory is not the source directory, +because `foo.man' and `sedscript' are not in the current directory. + + When using GNU `make', relying on `VPATH' to find the source file +will work in the case where there is a single dependency file, since +the `make' automatic variable `$<' will represent the source file +wherever it is. (Many versions of `make' set `$<' only in implicit +rules.) A Makefile target like + + foo.o : bar.c + $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o + +should instead be written as + + foo.o : bar.c + $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@ + +in order to allow `VPATH' to work correctly. When the target has +multiple dependencies, using an explicit `$(srcdir)' is the easiest way +to make the rule work well. For example, the target above for `foo.1' +is best written as: + + foo.1 : foo.man sedscript + sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@ + + Try to make the build and installation targets, at least (and all +their subtargets) work correctly with a parallel `make'. + + +File: standards.info, Node: Utilities in Makefiles, Next: Command Variables, Prev: Makefile Basics, Up: Makefile Conventions + +Utilities in Makefiles +---------------------- + + Write the Makefile commands (and any shell scripts, such as +`configure') to run in `sh', not in `csh'. Don't use any special +features of `ksh' or `bash'. + + The `configure' script and the Makefile rules for building and +installation should not use any utilities directly except these: + + cat cmp cp echo egrep expr false grep + ln mkdir mv pwd rm rmdir sed test touch true + + Stick to the generally supported options for these programs. For +example, don't use `mkdir -p', convenient as it may be, because most +systems don't support it. + + It is a good idea to avoid creating symbolic links in makefiles, +since a few systems don't support them. + + The Makefile rules for building and installation can also use +compilers and related programs, but should do so via `make' variables +so that the user can substitute alternatives. Here are some of the +programs we mean: + + ar bison cc flex install ld lex + make makeinfo ranlib texi2dvi yacc + + Use the following `make' variables: + + $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX) + $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC) + + When you use `ranlib', you should make sure nothing bad happens if +the system does not have `ranlib'. Arrange to ignore an error from +that command, and print a message before the command to tell the user +that failure of the `ranlib' command does not mean a problem. (The +Autoconf `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. + + It is ok to use other utilities in Makefile portions (or scripts) +intended only for particular systems where you know those utilities +exist. + + +File: standards.info, Node: Command Variables, Next: Directory Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions + +Variables for Specifying Commands +--------------------------------- + + Makefiles should provide variables for overriding certain commands, +options, and so on. + + In particular, you should run most utility programs via variables. +Thus, if you use Bison, have a variable named `BISON' whose default +value is set with `BISON = bison', and refer to it with `$(BISON)' +whenever you need to use Bison. + + File management utilities such as `ln', `rm', `mv', and so on, need +not be referred to through variables in this way, since users don't +need to replace them with other programs. + + Each program-name variable should come with an options variable that +is used to supply options to the program. Append `FLAGS' to the +program-name variable name to get the options variable name--for +example, `BISONFLAGS'. (The name `CFLAGS' is an exception to this +rule, but we keep it because it is standard.) Use `CPPFLAGS' in any +compilation command that runs the preprocessor, and use `LDFLAGS' in +any compilation command that does linking as well as in any direct use +of `ld'. + + If there are C compiler options that *must* be used for proper +compilation of certain files, do not include them in `CFLAGS'. Users +expect to be able to specify `CFLAGS' freely themselves. Instead, +arrange to pass the necessary options to the C compiler independently +of `CFLAGS', by writing them explicitly in the compilation commands or +by defining an implicit rule, like this: + + CFLAGS = -g + ALL_CFLAGS = -I. $(CFLAGS) + .c.o: + $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< + + Do include the `-g' option in `CFLAGS', because that is not +*required* for proper compilation. You can consider it a default that +is only recommended. If the package is set up so that it is compiled +with GCC by default, then you might as well include `-O' in the default +value of `CFLAGS' as well. + + Put `CFLAGS' last in the compilation command, after other variables +containing compiler options, so the user can use `CFLAGS' to override +the others. + + Every Makefile should define the variable `INSTALL', which is the +basic command for installing a file into the system. + + Every Makefile should also define the variables `INSTALL_PROGRAM' +and `INSTALL_DATA'. (The default for each of these should be +`$(INSTALL)'.) Then it should use those variables as the commands for +actual installation, for executables and nonexecutables respectively. +Use these variables as follows: + + $(INSTALL_PROGRAM) foo $(bindir)/foo + $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a + +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 +installed. + + +File: standards.info, Node: Directory Variables, Next: Standard Targets, Prev: Command Variables, Up: Makefile Conventions + +Variables for Installation Directories +-------------------------------------- + + Installation directories should always be named by variables, so it +is easy to install in a nonstandard place. The standard names for these +variables are described below. They are based on a standard filesystem +layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and +other modern operating systems. + + These two variables set the root for the installation. All the other +installation directories should be subdirectories of one of these two, +and nothing should be directly installed into these two directories. + +`prefix' + A prefix used in constructing the default values of the variables + listed below. The default value of `prefix' should be + `/usr/local'. When building the complete GNU system, the prefix + will be empty and `/usr' will be a symbolic link to `/'. (If you + are using Autoconf, write it as `@prefix@'.) + +`exec_prefix' + A prefix used in constructing the default values of some of the + variables listed below. The default value of `exec_prefix' should + be `$(prefix)'. (If you are using Autoconf, write it as + `@exec_prefix@'.) + + Generally, `$(exec_prefix)' is used for directories that contain + machine-specific files (such as executables and subroutine + libraries), while `$(prefix)' is used directly for other + directories. + + Executable programs are installed in one of the following +directories. + +`bindir' + The directory for installing executable programs that users can + run. This should normally be `/usr/local/bin', but write it as + `$(exec_prefix)/bin'. (If you are using Autoconf, write it as + `@bindir@'.) + +`sbindir' + The directory for installing executable programs that can be run + from the shell, but are only generally useful to system + administrators. This should normally be `/usr/local/sbin', but + write it as `$(exec_prefix)/sbin'. (If you are using Autoconf, + write it as `@sbindir@'.) + +`libexecdir' + The directory for installing executable programs to be run by other + programs rather than by users. This directory should normally be + `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'. + (If you are using Autoconf, write it as `@libexecdir@'.) + + Data files used by the program during its execution are divided into +categories in two ways. + + * Some files are normally modified by programs; others are never + normally modified (though users may edit some of these). + + * Some files are architecture-independent and can be shared by all + machines at a site; some are architecture-dependent and can be + shared only by machines of the same kind and operating system; + others may never be shared between two machines. + + This makes for six different possibilities. However, we want to +discourage the use of architecture-dependent files, aside from object +files and libraries. It is much cleaner to make other data files +architecture-independent, and it is generally not hard. + + Therefore, here are the variables Makefiles should use to specify +directories: + +`datadir' + The directory for installing read-only architecture independent + data files. This should normally be `/usr/local/share', but write + it as `$(prefix)/share'. (If you are using Autoconf, write it as + `@datadir@'.) As a special exception, see `$(infodir)' and + `$(includedir)' below. + +`sysconfdir' + The directory for installing read-only data files that pertain to a + single machine-that is to say, files for configuring a host. + Mailer and network configuration files, `/etc/passwd', and so + forth belong here. All the files in this directory should be + ordinary ASCII text files. This directory should normally be + `/usr/local/etc', but write it as `$(prefix)/etc'. (If you are + using Autoconf, write it as `@sysconfdir@'.) + + Do not install executables in this directory (they probably belong + in `$(libexecdir)' or `$(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 `$(localstatedir)'. + +`sharedstatedir' + The directory for installing architecture-independent data files + which the programs modify while they run. This should normally be + `/usr/local/com', but write it as `$(prefix)/com'. (If you are + using Autoconf, write it as `@sharedstatedir@'.) + +`localstatedir' + The directory for installing data files which the programs modify + while they run, and that pertain to one specific machine. Users + should never need to modify files in this directory to configure + the package's operation; put such configuration information in + separate files that go in `$(datadir)' or `$(sysconfdir)'. + `$(localstatedir)' should normally be `/usr/local/var', but write + it as `$(prefix)/var'. (If you are using Autoconf, write it as + `@localstatedir@'.) + +`libdir' + The directory for object files and libraries of object code. Do + not install executables here, they probably ought to go in + `$(libexecdir)' instead. The value of `libdir' should normally be + `/usr/local/lib', but write it as `$(exec_prefix)/lib'. (If you + are using Autoconf, write it as `@libdir@'.) + +`infodir' + The directory for installing the Info files for this package. By + default, it should be `/usr/local/info', but it should be written + as `$(prefix)/info'. (If you are using Autoconf, write it as + `@infodir@'.) + +`includedir' + The directory for installing header files to be included by user + programs with the C `#include' preprocessor directive. This + should normally be `/usr/local/include', but write it as + `$(prefix)/include'. (If you are using Autoconf, write it as + `@includedir@'.) + + Most compilers other than GCC do not look for header files in + `/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 are intended to work with other compilers. They should + install their header files in two places, one specified by + `includedir' and one specified by `oldincludedir'. + +`oldincludedir' + The directory for installing `#include' header files for use with + compilers other than GCC. This should normally be `/usr/include'. + (If you are using Autoconf, you can write it as `@oldincludedir@'.) + + The Makefile commands should check whether the value of + `oldincludedir' is empty. If it is, they should not try to use + it; they should cancel the second installation of the header files. + + A package should not replace an existing header in this directory + unless the header came from the same package. Thus, if your Foo + package provides a header file `foo.h', then it should install the + header file in the `oldincludedir' directory if either (1) there + is no `foo.h' there or (2) the `foo.h' that exists came from the + Foo package. + + To tell whether `foo.h' came from the Foo package, put a magic + string in the file--part of a comment--and `grep' for that string. + + Unix-style man pages are installed in one of the following: + +`mandir' + The top-level directory for installing the man pages (if any) for + this package. It will normally be `/usr/local/man', but you should + write it as `$(prefix)/man'. (If you are using Autoconf, write it + as `@mandir@'.) + +`man1dir' + The directory for installing section 1 man pages. Write it as + `$(mandir)/man1'. + +`man2dir' + The directory for installing section 2 man pages. Write it as + `$(mandir)/man2' + +`...' + *Don't make the primary documentation for any GNU software be a + man page. Write a manual in Texinfo instead. Man pages are just + for the sake of people running GNU software on Unix, which is a + secondary application only.* + +`manext' + The file name extension for the installed man page. This should + contain a period followed by the appropriate digit; it should + normally be `.1'. + +`man1ext' + The file name extension for installed section 1 man pages. + +`man2ext' + The file name extension for installed section 2 man pages. + +`...' + Use these names instead of `manext' if the package needs to + install man pages in more than one section of the manual. + + And finally, you should set the following variable: + +`srcdir' + The directory for the sources being compiled. The value of this + variable is normally inserted by the `configure' shell script. + (If you are using Autconf, use `srcdir = @srcdir@'.) + + For example: + + # Common prefix for installation directories. + # NOTE: This directory must exist when you start the install. + prefix = /usr/local + exec_prefix = $(prefix) + # Where to put the executable for the command `gcc'. + bindir = $(exec_prefix)/bin + # Where to put the directories used by the compiler. + libexecdir = $(exec_prefix)/libexec + # Where to put the Info files. + infodir = $(prefix)/info + + If your program installs a large number of files into one of the +standard user-specified directories, it might be useful to group them +into a subdirectory particular to that program. If you do this, you +should write the `install' rule to create these subdirectories. + + Do not expect the user to include the subdirectory name in the value +of any of the variables listed above. The idea of having a uniform set +of variable names for installation directories is to enable the user to +specify the exact same values for several different GNU packages. In +order for this to be useful, all the packages must be designed so that +they will work sensibly when the user does so. + diff --git a/info/standards.info-3 b/info/standards.info-3 new file mode 100644 index 0000000..426dd71 --- /dev/null +++ b/info/standards.info-3 @@ -0,0 +1,316 @@ +This is Info file ../info/standards.info, produced by Makeinfo version +1.68 from the input file standards.texi. + +START-INFO-DIR-ENTRY +* Standards: (standards). GNU coding standards. +END-INFO-DIR-ENTRY + + GNU Coding Standards 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 are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, 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. + + +File: standards.info, Node: Standard Targets, Prev: Directory Variables, Up: Makefile Conventions + +Standard Targets for Users +-------------------------- + + All GNU programs should have the following targets in their +Makefiles: + +`all' + Compile the entire program. This should be the default target. + This target need not rebuild any documentation files; Info files + should normally be included in the distribution, and DVI files + should be made only when explicitly asked for. + + By default, the Make rules should compile and link with `-g', so + that executable programs have debugging symbols. Users who don't + mind being helpless can strip the executables later if they wish. + +`install' + Compile the program and copy the executables, libraries, and so on + to the file names where they should reside for actual use. If + there is a simple test to verify that a program is properly + installed, this target should run that test. + + Do not strip executables when installing them. Devil-may-care + users can use the `install-strip' target to do that. + + If possible, write the `install' target rule so that it does not + modify anything in the directory where the program was built, + provided `make all' has just been done. This is convenient for + building the program under one user name and installing it under + another. + + The commands should create all the directories in which files are + to be installed, if they don't already exist. This includes the + directories specified as the values of the variables `prefix' and + `exec_prefix', as well as all subdirectories that are needed. One + way to do this is by means of an `installdirs' target as described + below. + + Use `-' before any command for installing a man page, so that + `make' will ignore any errors. This is in case there are systems + that don't have the Unix man page documentation system installed. + + The way to install Info files is to copy them into `$(infodir)' + with `$(INSTALL_DATA)' (*note Command Variables::.), and then run + the `install-info' program if it is present. `install-info' is a + program that edits the Info `dir' file to add or update the menu + entry for the given Info file; it is part of the Texinfo package. + Here is a sample rule to install an Info file: + + $(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 $@; \ + # Run install-info only if it exists. + # Use `if' instead of just prepending `-' to the + # line so we notice real errors from install-info. + # We use `$(SHELL) -c' because some shells do not + # fail gracefully when there is an unknown command. + if $(SHELL) -c 'install-info --version' \ + >/dev/null 2>&1; then \ + install-info --dir-file=$(infodir)/dir \ + $(infodir)/foo.info; \ + else true; fi + +`uninstall' + Delete all the installed files that the `install' target would + create (but not the noninstalled files such as `make all' would + create). + + This rule should not modify the directories where compilation is + done, only the directories where files are installed. + +`install-strip' + Like `install', but strip the executable files while installing + them. The definition of this target can be very simple: + + install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \ + install + + Normally we do not recommend stripping an executable unless you + are sure the program has no bugs. However, it can be reasonable + to install a stripped executable for actual execution while saving + the unstripped executable elsewhere in case there is a bug. + +`clean' + Delete all files from the current directory that are normally + created by building the program. Don't delete the files that + record the configuration. Also preserve files that could be made + by building, but normally aren't because the distribution comes + with them. + + Delete `.dvi' files here if they are not part of the distribution. + +`distclean' + Delete all files from the current directory that are created by + configuring or building the program. If you have unpacked the + source and built the program without creating any other files, + `make distclean' should leave only the files that were in the + distribution. + +`mostlyclean' + Like `clean', but may refrain from deleting a few files that people + normally don't want to recompile. For example, the `mostlyclean' + target for GCC does not delete `libgcc.a', because recompiling it + is rarely necessary and takes a lot of time. + +`maintainer-clean' + Delete almost everything from the current directory that can be + reconstructed with this Makefile. This typically includes + everything deleted by `distclean', plus more: C source files + produced by Bison, tags tables, Info files, and so on. + + The reason we say "almost everything" is that running the command + `make maintainer-clean' should not delete `configure' even if + `configure' can be remade using a rule in the Makefile. More + generally, `make maintainer-clean' should not delete anything that + needs to exist in order to run `configure' and then begin to build + the program. This is the only exception; `maintainer-clean' should + delete everything else that can be rebuilt. + + The `maintainer-clean' target is intended to be used by a + maintainer of the package, not by ordinary users. You may need + special tools to reconstruct some of the files that `make + maintainer-clean' deletes. Since these files are normally + included in the distribution, we don't take care to make them easy + to reconstruct. If you find you need to unpack the full + distribution again, don't blame us. + + To help make users aware of this, the commands for the special + `maintainer-clean' target should start with these two: + + @echo 'This command is intended for maintainers to use; it' + @echo 'deletes files that may need special tools to rebuild.' + +`TAGS' + Update a tags table for this program. + +`info' + Generate any Info files needed. The best way to write the rules + is as follows: + + info: foo.info + + foo.info: foo.texi chap1.texi chap2.texi + $(MAKEINFO) $(srcdir)/foo.texi + + You must define the variable `MAKEINFO' in the Makefile. It should + run the `makeinfo' program, which is part of the Texinfo + distribution. + +`dvi' + Generate DVI files for all Texinfo documentation. For example: + + dvi: foo.dvi + + foo.dvi: foo.texi chap1.texi chap2.texi + $(TEXI2DVI) $(srcdir)/foo.texi + + You must define the variable `TEXI2DVI' in the Makefile. It should + run the program `texi2dvi', which is part of the Texinfo + distribution.(1) Alternatively, write just the dependencies, and + allow GNU `make' to provide the command. + +`dist' + Create a distribution tar file for this program. The tar file + should be set up so that the file names in the tar file start with + a subdirectory name which is the name of the package it is a + distribution for. This name can include the version number. + + For example, the distribution tar file of GCC version 1.40 unpacks + into a subdirectory named `gcc-1.40'. + + The easiest way to do this is to create a subdirectory + appropriately named, use `ln' or `cp' to install the proper files + in it, and then `tar' that subdirectory. + + Compress the tar file with `gzip'. For example, the actual + distribution file for GCC version 1.40 is called `gcc-1.40.tar.gz'. + + The `dist' target should explicitly depend on all non-source files + that are in the distribution, to make sure they are up to date in + the distribution. *Note Making Releases: Releases. + +`check' + Perform self-tests (if any). The user must build the program + before running the tests, but need not install the program; you + should write the self-tests so that they work when the program is + built but not installed. + + The following targets are suggested as conventional names, for +programs in which they are useful. + +`installcheck' + Perform installation tests (if any). The user must build and + install the program before running the tests. You should not + assume that `$(bindir)' is in the search path. + +`installdirs' + It's useful to add a target named `installdirs' to create the + directories where files are installed, and their parent + directories. There is a script called `mkinstalldirs' which is + convenient for this; you can find it in the Texinfo package. You + can use a rule like this: + + # Make sure all installation directories (e.g. $(bindir)) + # actually exist by making them if necessary. + installdirs: mkinstalldirs + $(srcdir)/mkinstalldirs $(bindir) $(datadir) \ + $(libdir) $(infodir) \ + $(mandir) + + This rule should not modify the directories where compilation is + done. It should do nothing but create installation directories. + + ---------- Footnotes ---------- + + (1) `texi2dvi' uses TeX to do the real work of formatting. TeX is +not distributed with Texinfo. + + +File: standards.info, Node: Releases, Prev: Makefile Conventions, Up: Managing Releases + +Making Releases +=============== + + Package the distribution of Foo version 69.96 in a gzipped tar file +named `foo-69.96.tar.gz'. It should unpack into a subdirectory named +`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 part of the program in any way must be classified into "source +files" and "non-source files". Source files are written by humans and +never changed automatically; non-source files are produced from source +files by programs under the control of the Makefile. + + 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 +normally will never modify them. We commonly include non-source files +produced by Bison, `lex', TeX, and `makeinfo'; this helps avoid +unnecessary dependencies between our distributions, so that users can +install whichever packages they want to install. + + Non-source files that might actually be modified by building and +installing the program should *never* be included in the distribution. +So if you do distribute non-source files, always make sure they are up +to date when you make a new distribution. + + Make sure that the directory into which the distribution unpacks (as +well as any subdirectories) are all world-writable (octal mode 777). +This is so that old versions of `tar' which preserve the ownership and +permissions of the files from the tar archive will be able to extract +all the files even if the user is unprivileged. + + Make sure that all the files in the distribution are world-readable. + + 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 POSIX +standard, and refuse to open a longer name, rather than truncating as +they did in the past. + + Don't include any symbolic links in the distribution itself. If the +tar file contains symbolic links, then people cannot even unpack it on +systems that don't support symbolic links. Also, don't use multiple +names for one file in different directories, because certain file +systems cannot handle this and that prevents unpacking the distribution. + + Try to make sure that all the file names will be unique on MS-DOS. A +name on MS-DOS consists of up to 8 characters, optionally followed by a +period and up to three characters. MS-DOS will truncate extra +characters both before and after the period. Thus, `foobarhacker.c' +and `foobarhacker.o' are not ambiguous; they are truncated to +`foobarha.c' and `foobarha.o', which are distinct. + + Include in your distribution a copy of the `texinfo.tex' you used to +test print any `*.texinfo' or `*.texi' files. + + Likewise, if your program uses small GNU software packages like +regex, getopt, obstack, or termcap, include them in the distribution +file. Leaving them out would make the distribution file a little +smaller at the expense of possible inconvenience to a user who doesn't +know what other files to get. + + diff --git a/info/standards.info-4 b/info/standards.info-4 new file mode 100644 index 0000000..750a7b4 --- /dev/null +++ b/info/standards.info-4 @@ -0,0 +1,150 @@ +This is ../info/standards.info, produced by makeinfo version 4.0 from +standards.texi. + +START-INFO-DIR-ENTRY +* Standards: (standards). GNU coding standards. +END-INFO-DIR-ENTRY + + GNU Coding Standards Copyright (C) 1992, 1993, 1994, 1995, 1996, +1997, 1998, 1999, 2000 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. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, 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. + + +File: standards.info, Node: Index, Prev: References, Up: Top + +Index +***** + +* Menu: + +* #endif, commenting: Comments. +* --help option: Command-Line Interfaces. +* --version option: Command-Line Interfaces. +* -Wall compiler option: Syntactic Conventions. +* accepting contributions: Contributions. +* address for bug reports: Command-Line Interfaces. +* ANSI C standard: Standard C. +* arbitrary limits on data: Semantics. +* autoconf: System Portability. +* avoiding proprietary code: Reading Non-Free Code. +* behavior, dependent on program's name: User Interfaces. +* binary packages: Install Command Categories. +* bindir: Directory Variables. +* braces, in C source: Formatting. +* bug reports: Command-Line Interfaces. +* canonical name of a program: Command-Line Interfaces. +* casting pointers to integers: CPU Portability. +* change logs: Change Logs. +* change logs, conditional changes: Conditional Changes. +* change logs, style: Style of Change Logs. +* command-line arguments, decoding: Semantics. +* command-line interface: Command-Line Interfaces. +* commenting: Comments. +* compatibility with C and POSIX standards: Compatibility. +* compiler warnings: Syntactic Conventions. +* conditional changes, and change logs: Conditional Changes. +* conditionals, comments for: Comments. +* configure: Configuration. +* control-L: Formatting. +* conventions for makefiles: Makefile Conventions. +* corba: Graphical Interfaces. +* credits for manuals: Manual Credits. +* data types, and portability: CPU Portability. +* declaration for system functions: System Functions. +* documentation: Documentation. +* doschk: Names. +* downloading this manual: Preface. +* error messages: Semantics. +* error messages, formatting: Errors. +* exec_prefix: Directory Variables. +* expressions, splitting: Formatting. +* file usage: File Usage. +* file-name limitations: Names. +* formatting error messages: Errors. +* formatting source code: Formatting. +* formfeed: Formatting. +* function argument, declaring: Syntactic Conventions. +* function prototypes: Standard C. +* getopt: Command-Line Interfaces. +* gettext: Internationalization. +* gnome: Graphical Interfaces. +* graphical user interface: Graphical Interfaces. +* gtk: Graphical Interfaces. +* GUILE: Source Language. +* implicit int: Syntactic Conventions. +* impossible conditions: Semantics. +* internationalization: Internationalization. +* legal aspects: Legal Issues. +* legal papers: Contributions. +* libexecdir: Directory Variables. +* libraries: Libraries. +* library functions, and portability: System Functions. +* license for manuals: License for Manuals. +* lint: Syntactic Conventions. +* long option names: Option Table. +* long-named options: Command-Line Interfaces. +* makefile, conventions for: Makefile Conventions. +* malloc return value: Semantics. +* man pages: Man Pages. +* manual structure: Manual Structure Details. +* memory allocation failure: Semantics. +* memory usage: Memory Usage. +* message text, and internationalization: Internationalization. +* mmap: Mmap. +* multiple variables in a line: Syntactic Conventions. +* names of variables and functions: Names. +* NEWS file: NEWS File. +* non-POSIX systems, and portability: System Portability. +* non-standard extensions: Using Extensions. +* NUL characters: Semantics. +* open brace: Formatting. +* optional features, configure-time: Configuration. +* options for compatibility: Compatibility. +* output device and program's behavior: User Interfaces. +* packaging: Releases. +* portability, and data types: CPU Portability. +* portability, and library functions: System Functions. +* portability, between system types: System Portability. +* POSIX compatibility: Compatibility. +* POSIXLY_CORRECT, environment variable: Compatibility. +* post-installation commands: Install Command Categories. +* pre-installation commands: Install Command Categories. +* prefix: Directory Variables. +* program configuration: Configuration. +* program design: Design Advice. +* program name and its behavior: User Interfaces. +* program's canonical name: Command-Line Interfaces. +* programming languges: Source Language. +* proprietary programs: Reading Non-Free Code. +* README file: Releases. +* references to non-free material: References. +* releasing: Managing Releases. +* sbindir: Directory Variables. +* signal handling: Semantics. +* spaces before open-paren: Formatting. +* standard command-line options: Command-Line Interfaces. +* standards for makefiles: Makefile Conventions. +* string library functions: System Functions. +* syntactic conventions: Syntactic Conventions. +* table of long options: Option Table. +* temporary files: Semantics. +* temporary variables: Syntactic Conventions. +* texinfo.tex, in a distribution: Releases. +* TMPDIR environment variable: Semantics. +* trademarks: Trademarks. +* where to obtain standards.texi: Preface. + + diff --git a/info/term.info b/info/term.info index 1f84f9e..e81567a 100644 --- a/info/term.info +++ b/info/term.info @@ -1,5 +1,5 @@ -This is ../info/term.info, produced by makeinfo version 4.0 from -term.texi. +This is Info file ../info/term.info, produced by Makeinfo version 1.68 +from the input file term.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -142,7 +142,7 @@ screen state to what it was before the program started. Many people are used to this behavior from `xterm', and its also offered by the `term' emulator. - - Function: term-switch-to-alternate-sub-buffer set + - Function: term-switch-to-alternate-sub-buffer SET If SET is true, and we're not already using the alternate sub-buffer, switch to it. What this means is that the `term-home-marker' is saved (in the variable @@ -238,7 +238,7 @@ of output (since the last input sent to the inferior). It will enter "pager" mode, which feels a lot like the "more" program: Typing a space requests another screenful of output. Other commands request more or less output, or scroll backwards in the `term' buffer. In -pager mode, type `h' or `?' to display a help message listing all the +pager mode, type `h' or `?' to display a help message listing all the available pager mode commands. In either character or line mode, type `C-c p' to enable paging, and @@ -421,21 +421,21 @@ Miscellaneous escapes  Tag Table: -Node: Top201 -Node: term mode367 -Node: Overview1190 -Node: Output from the inferior1940 -Node: subbuffer3520 -Node: altsubbuffer4843 -Node: Input to the inferior5868 -Node: Connecting to remote computers7388 -Node: Paging9293 -Node: Terminal escapes9962 -Node: Cursor motion10830 -Node: Erasing11490 -Node: Inserting and deleting12285 -Node: Scrolling12675 -Node: Command hook13121 -Node: Miscellaneous escapes14157 +Node: Top227 +Node: term mode393 +Node: Overview1216 +Node: Output from the inferior1966 +Node: subbuffer3546 +Node: altsubbuffer4869 +Node: Input to the inferior5894 +Node: Connecting to remote computers7414 +Node: Paging9319 +Node: Terminal escapes9989 +Node: Cursor motion10857 +Node: Erasing11517 +Node: Inserting and deleting12312 +Node: Scrolling12702 +Node: Command hook13148 +Node: Miscellaneous escapes14184  End Tag Table diff --git a/info/termcap.info b/info/termcap.info index 5bbede1..fefb70c 100644 --- a/info/termcap.info +++ b/info/termcap.info @@ -1,5 +1,5 @@ -This is ../info/termcap.info, produced by makeinfo version 4.0 from -termcap.texi. +This is Info file ../info/termcap.info, produced by Makeinfo version +1.68 from the input file termcap.texi. START-INFO-DIR-ENTRY * Termcap: (termcap). Termcap library of the GNU system. @@ -25,57 +25,57 @@ translation approved by the Foundation.  Indirect: -termcap.info-1: 959 -termcap.info-2: 49216 -termcap.info-3: 92525 +termcap.info-1: 985 +termcap.info-2: 49255 +termcap.info-3: 92578  Tag Table: (Indirect) -Node: Top959 -Node: Introduction1604 -Node: Library3331 -Node: Preparation4348 -Node: Find5547 -Node: Interrogate9094 -Node: Initialize14401 -Node: Padding16039 -Node: Why Pad16700 -Node: Describe Padding18344 -Node: Output Padding19819 -Node: Parameters23432 -Node: Encode Parameters25090 -Node: Using Parameters31195 -Node: tparam31784 -Node: tgoto33849 -Node: Data Base36404 -Node: Format37281 -Node: Capability Format39372 -Node: Naming42422 -Node: Inheriting46990 -Node: Capabilities49216 -Node: Basic52059 -Node: Screen Size55903 -Node: Cursor Motion57643 -Node: Wrapping67293 -Node: Scrolling70117 -Node: Windows75137 -Node: Clearing75871 -Node: Insdel Line77635 -Node: Insdel Char82541 -Node: Standout92525 -Node: Underlining101582 -Node: Cursor Visibility104001 -Node: Bell104749 -Node: Keypad105298 -Node: Meta Key110019 -Node: Initialization110973 -Node: Pad Specs113337 -Node: Status Line115390 -Node: Half-Line117274 -Node: Printer118076 -Node: Summary119755 -Node: Var Index129960 -Node: Cap Index130684 -Node: Index137875 +Node: Top985 +Node: Introduction1630 +Node: Library3357 +Node: Preparation4374 +Node: Find5573 +Node: Interrogate9121 +Node: Initialize14429 +Node: Padding16069 +Node: Why Pad16730 +Node: Describe Padding18374 +Node: Output Padding19849 +Node: Parameters23464 +Node: Encode Parameters25123 +Node: Using Parameters31228 +Node: tparam31817 +Node: tgoto33882 +Node: Data Base36437 +Node: Format37315 +Node: Capability Format39406 +Node: Naming42459 +Node: Inheriting47028 +Node: Capabilities49255 +Node: Basic52097 +Node: Screen Size55941 +Node: Cursor Motion57681 +Node: Wrapping67338 +Node: Scrolling70163 +Node: Windows75183 +Node: Clearing75917 +Node: Insdel Line77681 +Node: Insdel Char82593 +Node: Standout92578 +Node: Underlining101637 +Node: Cursor Visibility104056 +Node: Bell104804 +Node: Keypad105353 +Node: Meta Key110074 +Node: Initialization111028 +Node: Pad Specs113392 +Node: Status Line115445 +Node: Half-Line117329 +Node: Printer118131 +Node: Summary119810 +Node: Var Index130016 +Node: Cap Index130740 +Node: Index137931  End Tag Table diff --git a/info/termcap.info-1 b/info/termcap.info-1 new file mode 100644 index 0000000..d24e7ac --- /dev/null +++ b/info/termcap.info-1 @@ -0,0 +1,1151 @@ +This is Info file ../info/termcap.info, produced by Makeinfo version +1.68 from the input file termcap.texi. + +START-INFO-DIR-ENTRY +* Termcap: (termcap). Termcap library of the GNU system. +END-INFO-DIR-ENTRY + + This file documents the termcap library of the GNU system. + + Copyright (C) 1988 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. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, 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 Foundation. + + +File: termcap.info, Node: Top, Next: Introduction, Prev: (DIR), Up: (DIR) + +* Menu: + +* Introduction::What is termcap? Why this manual? +* Library:: The termcap library functions. +* Data Base:: What terminal descriptions in `/etc/termcap' look like. +* Capabilities::Definitions of the individual terminal capabilities: + how to write them in descriptions, and how to use + their values to do display updating. +* Summary:: Brief table of capability names and their meanings. +* Var Index:: Index of C functions and variables. +* Cap Index:: Index of termcap capabilities. +* Index:: Concept index. + + +File: termcap.info, Node: Introduction, Next: Library, Prev: Top, Up: Top + +Introduction +************ + + "Termcap" is a library and data base that enables programs to use +display terminals in a terminal-independent manner. It originated in +Berkeley Unix. + + The termcap data base describes the capabilities of hundreds of +different display terminals in great detail. Some examples of the +information recorded for a terminal could include how many columns wide +it is, what string to send to move the cursor to an arbitrary position +(including how to encode the row and column numbers), how to scroll the +screen up one or several lines, and how much padding is needed for such +a scrolling operation. + + The termcap library is provided for easy access this data base in +programs that want to do terminal-independent character-based display +output. + + This manual describes the GNU version of the termcap library, which +has some extensions over the Unix version. All the extensions are +identified as such, so this manual also tells you how to use the Unix +termcap. + + The GNU version of the termcap library is available free as source +code, for use in free programs, and runs on Unix and VMS systems (at +least). You can find it in the GNU Emacs distribution in the files +`termcap.c' and `tparam.c'. + + This manual was written for the GNU project, whose goal is to +develop a complete free operating system upward-compatible with Unix +for user programs. The project is approximately two thirds complete. +For more information on the GNU project, including the GNU Emacs editor +and the mostly-portable optimizing C compiler, send one dollar to + + Free Software Foundation + 675 Mass Ave + Cambridge, MA 02139 + + +File: termcap.info, Node: Library, Next: Data Base, Prev: Introduction, Up: Top + +The Termcap Library +******************* + + The termcap library is the application programmer's interface to the +termcap data base. It contains functions for the following purposes: + + * Finding the description of the user's terminal type (`tgetent'). + + * Interrogating the description for information on various topics + (`tgetnum', `tgetflag', `tgetstr'). + + * Computing and performing padding (`tputs'). + + * Encoding numeric parameters such as cursor positions into the + terminal-specific form required for display commands (`tparam', + `tgoto'). + +* Menu: + +* Preparation:: Preparing to use the termcap library. +* Find:: Finding the description of the terminal being used. +* Interrogate:: Interrogating the description for particular capabilities. +* Initialize:: Initialization for output using termcap. +* Padding:: Outputting padding. +* Parameters:: Encoding parameters such as cursor positions. + + +File: termcap.info, Node: Preparation, Next: Find, Prev: Library, Up: Library + +Preparing to Use the Termcap Library +==================================== + + To use the termcap library in a program, you need two kinds of +preparation: + + * The compiler needs declarations of the functions and variables in + the library. + + On GNU systems, it suffices to include the header file `termcap.h' + in each source file that uses these functions and variables. + + On Unix systems, there is often no such header file. Then you must + explictly declare the variables as external. You can do likewise + for the functions, or let them be implicitly declared and cast + their values from type `int' to the appropriate type. + + We illustrate the declarations of the individual termcap library + functions with ANSI C prototypes because they show how to pass the + arguments. If you are not using the GNU C compiler, you probably + cannot use function prototypes, so omit the argument types and + names from your declarations. + + * The linker needs to search the library. Usually either + `-ltermcap' or `-ltermlib' as an argument when linking will do + this. + + +File: termcap.info, Node: Find, Next: Interrogate, Prev: Preparation, Up: Library + +Finding a Terminal Description: `tgetent' +========================================= + + An application program that is going to use termcap must first look +up the description of the terminal type in use. This is done by calling +`tgetent', whose declaration in ANSI Standard C looks like: + + int tgetent (char *BUFFER, char *TERMTYPE); + +This function finds the description and remembers it internally so that +you can interrogate it about specific terminal capabilities (*note +Interrogate::.). + + The argument TERMTYPE is a string which is the name for the type of +terminal to look up. Usually you would obtain this from the environment +variable `TERM' using `getenv ("TERM")'. + + If you are using the GNU version of termcap, you can alternatively +ask `tgetent' to allocate enough space. Pass a null pointer for +BUFFER, and `tgetent' itself allocates the storage using `malloc'. In +this case the returned value on success is the address of the storage, +cast to `int'. But normally there is no need for you to look at the +address. Do not free the storage yourself. + + With the Unix version of termcap, you must allocate space for the +description yourself and pass the address of the space as the argument +BUFFER. There is no way you can tell how much space is needed, so the +convention is to allocate a buffer 2048 characters long and assume that +is enough. (Formerly the convention was to allocate 1024 characters and +assume that was enough. But one day, for one kind of terminal, that was +not enough.) + + No matter how the space to store the description has been obtained, +termcap records its address internally for use when you later +interrogate the description with `tgetnum', `tgetstr' or `tgetflag'. If +the buffer was allocated by termcap, it will be freed by termcap too if +you call `tgetent' again. If the buffer was provided by you, you must +make sure that its contents remain unchanged for as long as you still +plan to interrogate the description. + + The return value of `tgetent' is -1 if there is some difficulty +accessing the data base of terminal types, 0 if the data base is +accessible but the specified type is not defined in it, and some other +value otherwise. + + Here is how you might use the function `tgetent': + + #ifdef unix + static char term_buffer[2048]; + #else + #define term_buffer 0 + #endif + + init_terminal_data () + { + char *termtype = getenv ("TERM"); + int success; + + if (termtype == 0) + fatal ("Specify a terminal type with `setenv TERM '.\n"); + + success = tgetent (term_buffer, termtype); + if (success < 0) + fatal ("Could not access the termcap data base.\n"); + if (success == 0) + fatal ("Terminal type `%s' is not defined.\n", termtype); + } + +Here we assume the function `fatal' prints an error message and exits. + + If the environment variable `TERMCAP' is defined, its value is used +to override the terminal type data base. The function `tgetent' checks +the value of `TERMCAP' automatically. If the value starts with `/' +then it is taken as a file name to use as the data base file, instead +of `/etc/termcap' which is the standard data base. If the value does +not start with `/' then it is itself used as the terminal description, +provided that the terminal type TERMTYPE is among the types it claims +to apply to. *Note Data Base::, for information on the format of a +terminal description. + + +File: termcap.info, Node: Interrogate, Next: Initialize, Prev: Find, Up: Library + +Interrogating the Terminal Description +====================================== + + Each piece of information recorded in a terminal description is +called a "capability". Each defined terminal capability has a +two-letter code name and a specific meaning. For example, the number +of columns is named `co'. *Note Capabilities::, for definitions of all +the standard capability names. + + Once you have found the proper terminal description with `tgetent' +(*note Find::.), your application program must "interrogate" it for +various terminal capabilities. You must specify the two-letter code of +the capability whose value you seek. + + Capability values can be numeric, boolean (capability is either +present or absent) or strings. Any particular capability always has +the same value type; for example, `co' always has a numeric value, +while `am' (automatic wrap at margin) is always a flag, and `cm' +(cursor motion command) always has a string value. The documentation +of each capability says which type of value it has. + + There are three functions to use to get the value of a capability, +depending on the type of value the capability has. Here are their +declarations in ANSI C: + + int tgetnum (char *NAME); + int tgetflag (char *NAME); + char *tgetstr (char *NAME, char **AREA); + +`tgetnum' + Use `tgetnum' to get a capability value that is numeric. The + argument NAME is the two-letter code name of the capability. If + the capability is present, `tgetnum' returns the numeric value + (which is nonnegative). If the capability is not mentioned in the + terminal description, `tgetnum' returns -1. + +`tgetflag' + Use `tgetflag' to get a boolean value. If the capability NAME is + present in the terminal description, `tgetflag' returns 1; + otherwise, it returns 0. + +`tgetstr' + Use `tgetstr' to get a string value. It returns a pointer to a + string which is the capability value, or a null pointer if the + capability is not present in the terminal description. + + There are two ways `tgetstr' can find space to store the string + value: + + * You can ask `tgetstr' to allocate the space. Pass a null + pointer for the argument AREA, and `tgetstr' will use + `malloc' to allocate storage big enough for the value. + Termcap will never free this storage or refer to it again; you + should free it when you are finished with it. + + This method is more robust, since there is no need to guess + how much space is needed. But it is supported only by the GNU + termcap library. + + * You can provide the space. Provide for the argument AREA the + address of a pointer variable of type `char *'. Before + calling `tgetstr', initialize the variable to point at + available space. Then `tgetstr' will store the string value + in that space and will increment the pointer variable to + point after the space that has been used. You can use the + same pointer variable for many calls to `tgetstr'. + + There is no way to determine how much space is needed for a + single string, and no way for you to prevent or handle + overflow of the area you have provided. However, you can be + sure that the total size of all the string values you will + obtain from the terminal description is no greater than the + size of the description (unless you get the same capability + twice). You can determine that size with `strlen' on the + buffer you provided to `tgetent'. See below for an example. + + Providing the space yourself is the only method supported by + the Unix version of termcap. + + Note that you do not have to specify a terminal type or terminal +description for the interrogation functions. They automatically use the +description found by the most recent call to `tgetent'. + + Here is an example of interrogating a terminal description for +various capabilities, with conditionals to select between the Unix and +GNU methods of providing buffer space. + + char *tgetstr (); + + char *cl_string, *cm_string; + int height; + int width; + int auto_wrap; + + char PC; /* For tputs. */ + char *BC; /* For tgoto. */ + char *UP; + + interrogate_terminal () + { + #ifdef UNIX + /* Here we assume that an explicit term_buffer + was provided to tgetent. */ + char *buffer + = (char *) malloc (strlen (term_buffer)); + #define BUFFADDR &buffer + #else + #define BUFFADDR 0 + #endif + + char *temp; + + /* Extract information we will use. */ + cl_string = tgetstr ("cl", BUFFADDR); + cm_string = tgetstr ("cm", BUFFADDR); + auto_wrap = tgetflag ("am"); + height = tgetnum ("li"); + width = tgetnum ("co"); + + /* Extract information that termcap functions use. */ + temp = tgetstr ("pc", BUFFADDR); + PC = temp ? *temp : 0; + BC = tgetstr ("le", BUFFADDR); + UP = tgetstr ("up", BUFFADDR); + } + +*Note Padding::, for information on the variable `PC'. *Note Using +Parameters::, for information on `UP' and `BC'. + + +File: termcap.info, Node: Initialize, Next: Padding, Prev: Interrogate, Up: Library + +Initialization for Use of Termcap +================================= + + Before starting to output commands to a terminal using termcap, an +application program should do two things: + + * Initialize various global variables which termcap library output + functions refer to. These include `PC' and `ospeed' for padding + (*note Output Padding::.) and `UP' and `BC' for cursor motion + (*note tgoto::.). + + * Tell the kernel to turn off alteration and padding of + horizontal-tab characters sent to the terminal. + + To turn off output processing in Berkeley Unix you would use `ioctl' +with code `TIOCLSET' to set the bit named `LLITOUT', and clear the bits +`ANYDELAY' using `TIOCSETN'. In POSIX or System V, you must clear the +bit named `OPOST'. Refer to the system documentation for details. + + If you do not set the terminal flags properly, some older terminals +will not work. This is because their commands may contain the +characters that normally signify newline, carriage return and +horizontal tab--characters which the kernel thinks it ought to modify +before output. + + When you change the kernel's terminal flags, you must arrange to +restore them to their normal state when your program exits. This +implies that the program must catch fatal signals such as `SIGQUIT' and +`SIGINT' and restore the old terminal flags before actually terminating. + + Modern terminals' commands do not use these special characters, so +if you do not care about problems with old terminals, you can leave the +kernel's terminal flags unaltered. + + +File: termcap.info, Node: Padding, Next: Parameters, Prev: Initialize, Up: Library + +Padding +======= + + "Padding" means outputting null characters following a terminal +display command that takes a long time to execute. The terminal +description says which commands require padding and how much; the +function `tputs', described below, outputs a terminal command while +extracting from it the padding information, and then outputs the +padding that is necessary. + +* Menu: + +* Why Pad:: Explanation of padding. +* Describe Padding:: The data base says how much padding a terminal needs. +* Output Padding:: Using `tputs' to output the needed padding. + + +File: termcap.info, Node: Why Pad, Next: Describe Padding, Prev: Padding, Up: Padding + +Why Pad, and How +---------------- + + Most types of terminal have commands that take longer to execute +than they do to send over a high-speed line. For example, clearing the +screen may take 20msec once the entire command is received. During +that time, on a 9600 bps line, the terminal could receive about 20 +additional output characters while still busy clearing the screen. +Every terminal has a certain amount of buffering capacity to remember +output characters that cannot be processed yet, but too many slow +commands in a row can cause the buffer to fill up. Then any additional +output that cannot be processed immediately will be lost. + + To avoid this problem, we normally follow each display command with +enough useless charaters (usually null characters) to fill up the time +that the display command needs to execute. This does the job if the +terminal throws away null characters without using up space in the +buffer (which most terminals do). If enough padding is used, no output +can ever be lost. The right amount of padding avoids loss of output +without slowing down operation, since the time used to transmit padding +is time that nothing else could be done. + + The number of padding characters needed for an operation depends on +the line speed. In fact, it is proportional to the line speed. A 9600 +baud line transmits about one character per msec, so the clear screen +command in the example above would need about 20 characters of padding. +At 1200 baud, however, only about 3 characters of padding are needed +to fill up 20msec. + + +File: termcap.info, Node: Describe Padding, Next: Output Padding, Prev: Why Pad, Up: Padding + +Specifying Padding in a Terminal Description +-------------------------------------------- + + In the terminal description, the amount of padding required by each +display command is recorded as a sequence of digits at the front of the +command. These digits specify the padding time in msec. They can be +followed optionally by a decimal point and one more digit, which is a +number of tenths of msec. + + Sometimes the padding needed by a command depends on the cursor +position. For example, the time taken by an "insert line" command is +usually proportional to the number of lines that need to be moved down +or cleared. An asterisk (`*') following the padding time says that the +time should be multiplied by the number of screen lines affected by the +command. + + :al=1.3*\E[L: + +is used to describe the "insert line" command for a certain terminal. +The padding required is 1.3 msec per line affected. The command itself +is ` [ L'. + + The padding time specified in this way tells `tputs' how many pad +characters to output. *Note Output Padding::. + + Two special capability values affect padding for all commands. +These are the `pc' and `pb'. The variable `pc' specifies the character +to pad with, and `pb' the speed below which no padding is needed. The +defaults for these variables, a null character and 0, are correct for +most terminals. *Note Pad Specs::. + + +File: termcap.info, Node: Output Padding, Prev: Describe Padding, Up: Padding + +Performing Padding with `tputs' +------------------------------- + + Use the termcap function `tputs' to output a string containing an +optional padding spec of the form described above (*note Describe +Padding::.). The function `tputs' strips off and decodes the padding +spec, outputs the rest of the string, and then outputs the appropriate +padding. Here is its declaration in ANSI C: + + char PC; + short ospeed; + + int tputs (char *STRING, int NLINES, int (*OUTFUN) ()); + + Here STRING is the string (including padding spec) to be output; +NLINES is the number of lines affected by the operation, which is used +to multiply the amount of padding if the padding spec ends with a `*'. +Finally, OUTFUN is a function (such as `fputchar') that is called to +output each character. When actually called, OUTFUN should expect one +argument, a character. + + The operation of `tputs' is controlled by two global variables, +`ospeed' and `PC'. The value of `ospeed' is supposed to be the +terminal output speed, encoded as in the `ioctl' system call which gets +the speed information. This is needed to compute the number of padding +characters. The value of `PC' is the character used for padding. + + You are responsible for storing suitable values into these variables +before using `tputs'. The value stored into the `PC' variable should be +taken from the `pc' capability in the terminal description (*note Pad +Specs::.). Store zero in `PC' if there is no `pc' capability. + + The argument NLINES requires some thought. Normally, it should be +the number of lines whose contents will be cleared or moved by the +command. For cursor motion commands, or commands that do editing +within one line, use the value 1. For most commands that affect +multiple lines, such as `al' (insert a line) and `cd' (clear from the +cursor to the end of the screen), NLINES should be the screen height +minus the current vertical position (origin 0). For multiple insert +and scroll commands such as `AL' (insert multiple lines), that same +value for NLINES is correct; the number of lines being inserted is not +correct. + + If a "scroll window" feature is used to reduce the number of lines +affected by a command, the value of NLINES should take this into +account. This is because the delay time required depends on how much +work the terminal has to do, and the scroll window feature reduces the +work. *Note Scrolling::. + + Commands such as `ic' and `dc' (insert or delete characters) are +problematical because the padding needed by these commands is +proportional to the number of characters affected, which is the number +of columns from the cursor to the end of the line. It would be nice to +have a way to specify such a dependence, and there is no need for +dependence on vertical position in these commands, so it is an obvious +idea to say that for these commands NLINES should really be the number +of columns affected. However, the definition of termcap clearly says +that NLINES is always the number of lines affected, even in this case, +where it is always 1. It is not easy to change this rule now, because +too many programs and terminal descriptions have been written to follow +it. + + Because NLINES is always 1 for the `ic' and `dc' strings, there is +no reason for them to use `*', but some of them do. These should be +corrected by deleting the `*'. If, some day, such entries have +disappeared, it may be possible to change to a more useful convention +for the NLINES argument for these operations without breaking any +programs. + + +File: termcap.info, Node: Parameters, Prev: Padding, Up: Library + +Filling In Parameters +===================== + + Some terminal control strings require numeric "parameters". For +example, when you move the cursor, you need to say what horizontal and +vertical positions to move it to. The value of the terminal's `cm' +capability, which says how to move the cursor, cannot simply be a +string of characters; it must say how to express the cursor position +numbers and where to put them within the command. + + The specifications of termcap include conventions as to which +string-valued capabilities require parameters, how many parameters, and +what the parameters mean; for example, it defines the `cm' string to +take two parameters, the vertical and horizontal positions, with 0,0 +being the upper left corner. These conventions are described where the +individual commands are documented. + + Termcap also defines a language used within the capability +definition for specifying how and where to encode the parameters for +output. This language uses character sequences starting with `%'. +(This is the same idea as `printf', but the details are different.) +The language for parameter encoding is described in this section. + + A program that is doing display output calls the functions `tparam' +or `tgoto' to encode parameters according to the specifications. These +functions produce a string containing the actual commands to be output +(as well a padding spec which must be processed with `tputs'; *note +Padding::.). + +* Menu: + +* Encode Parameters:: The language for encoding parameters. +* Using Parameters:: Outputting a string command with parameters. + + +File: termcap.info, Node: Encode Parameters, Next: Using Parameters, Prev: Parameters, Up: Parameters + +Describing the Encoding +----------------------- + + A terminal command string that requires parameters contains special +character sequences starting with `%' to say how to encode the +parameters. These sequences control the actions of `tparam' and +`tgoto'. + + The parameters values passed to `tparam' or `tgoto' are considered +to form a vector. A pointer into this vector determines the next +parameter to be processed. Some of the `%'-sequences encode one +parameter and advance the pointer to the next parameter. Other +`%'-sequences alter the pointer or alter the parameter values without +generating output. + + For example, the `cm' string for a standard ANSI terminal is written +as `\E[%i%d;%dH'. (`\E' stands for .) `cm' by convention always +requires two parameters, the vertical and horizontal goal positions, so +this string specifies the encoding of two parameters. Here `%i' +increments the two values supplied, and each `%d' encodes one of the +values in decimal. If the cursor position values 20,58 are encoded +with this string, the result is `\E[21;59H'. + + First, here are the `%'-sequences that generate output. Except for +`%%', each of them encodes one parameter and advances the pointer to +the following parameter. + +`%%' + Output a single `%'. This is the only way to represent a literal + `%' in a terminal command with parameters. `%%' does not use up a + parameter. + +`%d' + As in `printf', output the next parameter in decimal. + +`%2' + Like `%02d' in `printf': output the next parameter in decimal, and + always use at least two digits. + +`%3' + Like `%03d' in `printf': output the next parameter in decimal, and + always use at least three digits. Note that `%4' and so on are + *not* defined. + +`%.' + Output the next parameter as a single character whose ASCII code is + the parameter value. Like `%c' in `printf'. + +`%+CHAR' + Add the next parameter to the character CHAR, and output the + resulting character. For example, `%+ ' represents 0 as a space, + 1 as `!', etc. + + The following `%'-sequences specify alteration of the parameters +(their values, or their order) rather than encoding a parameter for +output. They generate no output; they are used only for their side +effects on the parameters. Also, they do not advance the "next +parameter" pointer except as explicitly stated. Only `%i', `%r' and +`%>' are defined in standard Unix termcap. The others are GNU +extensions. + +`%i' + Increment the next two parameters. This is used for terminals that + expect cursor positions in origin 1. For example, `%i%d,%d' would + output two parameters with `1' for 0, `2' for 1, etc. + +`%r' + Interchange the next two parameters. This is used for terminals + whose cursor positioning command expects the horizontal position + first. + +`%s' + Skip the next parameter. Do not output anything. + +`%b' + Back up one parameter. The last parameter used will become once + again the next parameter to be output, and the next output command + will use it. Using `%b' more than once, you can back up any + number of parameters, and you can refer to each parameter any + number of times. + +`%>C1C2' + Conditionally increment the next parameter. Here C1 and C2 are + characters which stand for their ASCII codes as numbers. If the + next parameter is greater than the ASCII code of C1, the ASCII + code of C2 is added to it. + +`%a OP TYPE POS' + Perform arithmetic on the next parameter, do not use it up, and do + not output anything. Here OP specifies the arithmetic operation, + while TYPE and POS together specify the other operand. + + Spaces are used above to separate the operands for clarity; the + spaces don't appear in the data base, where this sequence is + exactly five characters long. + + The character OP says what kind of arithmetic operation to + perform. It can be any of these characters: + + `=' + assign a value to the next parameter, ignoring its old value. + The new value comes from the other operand. + + `+' + add the other operand to the next parameter. + + `-' + subtract the other operand from the next parameter. + + `*' + multiply the next parameter by the other operand. + + `/' + divide the next parameter by the other operand. + + The "other operand" may be another parameter's value or a constant; + the character TYPE says which. It can be: + + `p' + Use another parameter. The character POS says which + parameter to use. Subtract 64 from its ASCII code to get the + position of the desired parameter relative to this one. Thus, + the character `A' as POS means the parameter after the next + one; the character `?' means the parameter before the next + one. + + `c' + Use a constant value. The character POS specifies the value + of the constant. The 0200 bit is cleared out, so that 0200 + can be used to represent zero. + + The following `%'-sequences are special purpose hacks to compensate +for the weird designs of obscure terminals. They modify the next +parameter or the next two parameters but do not generate output and do +not use up any parameters. `%m' is a GNU extension; the others are +defined in standard Unix termcap. + +`%n' + Exclusive-or the next parameter with 0140, and likewise the + parameter after next. + +`%m' + Complement all the bits of the next parameter and the parameter + after next. + +`%B' + Encode the next parameter in BCD. It alters the value of the + parameter by adding six times the quotient of the parameter by ten. + Here is a C statement that shows how the new value is computed: + + PARM = (PARM / 10) * 16 + PARM % 10; + +`%D' + Transform the next parameter as needed by Delta Data terminals. + This involves subtracting twice the remainder of the parameter by + 16. + + PARM -= 2 * (PARM % 16); + + +File: termcap.info, Node: Using Parameters, Prev: Encode Parameters, Up: Parameters + +Sending Display Commands with Parameters +---------------------------------------- + + The termcap library functions `tparam' and `tgoto' serve as the +analog of `printf' for terminal string parameters. The newer function +`tparam' is a GNU extension, more general but missing from Unix +termcap. The original parameter-encoding function is `tgoto', which is +preferable for cursor motion. + +* Menu: + +* tparam:: The general case, for GNU termcap only. +* tgoto:: The special case of cursor motion. + + +File: termcap.info, Node: tparam, Next: tgoto, Prev: Using Parameters, Up: Using Parameters + +`tparam' +........ + + The function `tparam' can encode display commands with any number of +parameters and allows you to specify the buffer space. It is the +preferred function for encoding parameters for all but the `cm' +capability. Its ANSI C declaration is as follows: + + char *tparam (char *CTLSTRING, char *BUFFER, int SIZE, int PARM1,...) + + The arguments are a control string CTLSTRING (the value of a terminal +capability, presumably), an output buffer BUFFER and SIZE, and any +number of integer parameters to be encoded. The effect of `tparam' is +to copy the control string into the buffer, encoding parameters +according to the `%' sequences in the control string. + + You describe the output buffer by its address, BUFFER, and its size +in bytes, SIZE. If the buffer is not big enough for the data to be +stored in it, `tparam' calls `malloc' to get a larger buffer. In +either case, `tparam' returns the address of the buffer it ultimately +uses. If the value equals BUFFER, your original buffer was used. +Otherwise, a new buffer was allocated, and you must free it after you +are done with printing the results. If you pass zero for SIZE and +BUFFER, `tparam' always allocates the space with `malloc'. + + All capabilities that require parameters also have the ability to +specify padding, so you should use `tputs' to output the string +produced by `tparam'. *Note Padding::. Here is an example. + + { + char *buf; + char buffer[40]; + + buf = tparam (command, buffer, 40, parm); + tputs (buf, 1, fputchar); + if (buf != buffer) + free (buf); + } + + If a parameter whose value is zero is encoded with `%.'-style +encoding, the result is a null character, which will confuse `tputs'. +This would be a serious problem, but luckily `%.' encoding is used only +by a few old models of terminal, and only for the `cm' capability. To +solve the problem, use `tgoto' rather than `tparam' to encode the `cm' +capability. + + +File: termcap.info, Node: tgoto, Prev: tparam, Up: Using Parameters + +`tgoto' +....... + + The special case of cursor motion is handled by `tgoto'. There are +two reasons why you might choose to use `tgoto': + + * For Unix compatibility, because Unix termcap does not have + `tparam'. + + * For the `cm' capability, since `tgoto' has a special feature to + avoid problems with null characters, tabs and newlines on certain + old terminal types that use `%.' encoding for that capability. + + Here is how `tgoto' might be declared in ANSI C: + + char *tgoto (char *CSTRING, int HPOS, int VPOS) + + There are three arguments, the terminal description's `cm' string and +the two cursor position numbers; `tgoto' computes the parametrized +string in an internal static buffer and returns the address of that +buffer. The next time you use `tgoto' the same buffer will be reused. + + Parameters encoded with `%.' encoding can generate null characters, +tabs or newlines. These might cause trouble: the null character because +`tputs' would think that was the end of the string, the tab because the +kernel or other software might expand it into spaces, and the newline +becaue the kernel might add a carriage-return, or padding characters +normally used for a newline. To prevent such problems, `tgoto' is +careful to avoid these characters. Here is how this works: if the +target cursor position value is such as to cause a problem (that is to +say, zero, nine or ten), `tgoto' increments it by one, then compensates +by appending a string to move the cursor back or up one position. + + The compensation strings to use for moving back or up are found in +global variables named `BC' and `UP'. These are actual external C +variables with upper case names; they are declared `char *'. It is up +to you to store suitable values in them, normally obtained from the +`le' and `up' terminal capabilities in the terminal description with +`tgetstr'. Alternatively, if these two variables are both zero, the +feature of avoiding nulls, tabs and newlines is turned off. + + It is safe to use `tgoto' for commands other than `cm' only if you +have stored zero in `BC' and `UP'. + + Note that `tgoto' reverses the order of its operands: the horizontal +position comes before the vertical position in the arguments to +`tgoto', even though the vertical position comes before the horizontal +in the parameters of the `cm' string. If you use `tgoto' with a +command such as `AL' that takes one parameter, you must pass the +parameter to `tgoto' as the "vertical position". + + +File: termcap.info, Node: Data Base, Next: Capabilities, Prev: Library, Up: Top + +The Format of the Data Base +*************************** + + The termcap data base of terminal descriptions is stored in the file +`/etc/termcap'. It contains terminal descriptions, blank lines, and +comments. + + A terminal description starts with one or more names for the +terminal type. The information in the description is a series of +"capability names" and values. The capability names have standard +meanings (*note Capabilities::.) and their values describe the terminal. + +* Menu: + +* Format:: Overall format of a terminal description. +* Capability Format:: Format of capabilities within a description. +* Naming:: Naming conventions for terminal types. +* Inheriting:: Inheriting part of a description from + a related terminal type. + + +File: termcap.info, Node: Format, Next: Capability Format, Prev: Data Base, Up: Data Base + +Terminal Description Format +=========================== + + Aside from comments (lines starting with `#', which are ignored), +each nonblank line in the termcap data base is a terminal description. +A terminal description is nominally a single line, but it can be split +into multiple lines by inserting the two characters `\ newline'. This +sequence is ignored wherever it appears in a description. + + The preferred way to split the description is between capabilities: +insert the four characters `: \ newline tab' immediately before any +colon. This allows each sub-line to start with some indentation. This +works because, after the `\ newline' are ignored, the result is `: tab +:'; the first colon ends the preceding capability and the second colon +starts the next capability. If you split with `\ newline' alone, you +may not add any indentation after them. + + Here is a real example of a terminal description: + + dw|vt52|DEC vt52:\ + :cr=^M:do=^J:nl=^J:bl=^G:\ + :le=^H:bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#24:\ + :nd=\EC:ta=^I:pt:sr=\EI:up=\EA:\ + :ku=\EA:kd=\EB:kr=\EC:kl=\ED:kb=^H: + + Each terminal description begins with several names for the terminal +type. The names are separated by `|' characters, and a colon ends the +last name. The first name should be two characters long; it exists +only for the sake of very old Unix systems and is never used in modern +systems. The last name should be a fully verbose name such as "DEC +vt52" or "Ann Arbor Ambassador with 48 lines". The other names should +include whatever the user ought to be able to specify to get this +terminal type, such as `vt52' or `aaa-48'. *Note Naming::, for +information on how to choose terminal type names. + + After the terminal type names come the terminal capabilities, +separated by colons and with a colon after the last one. Each +capability has a two-letter name, such as `cm' for "cursor motion +string" or `li' for "number of display lines". + + +File: termcap.info, Node: Capability Format, Next: Naming, Prev: Format, Up: Data Base + +Writing the Capabilities +======================== + + There are three kinds of capabilities: flags, numbers, and strings. +Each kind has its own way of being written in the description. Each +defined capability has by convention a particular kind of value; for +example, `li' always has a numeric value and `cm' always a string value. + + A flag capability is thought of as having a boolean value: the value +is true if the capability is present, false if not. When the +capability is present, just write its name between two colons. + + A numeric capability has a value which is a nonnegative number. +Write the capability name, a `#', and the number, between two colons. +For example, `...:li#48:...' is how you specify the `li' capability for +48 lines. + + A string-valued capability has a value which is a sequence of +characters. Usually these are the characters used to perform some +display operation. Write the capability name, a `=', and the +characters of the value, between two colons. For example, +`...:cm=\E[%i%d;%dH:...' is how the cursor motion command for a +standard ANSI terminal would be specified. + + Special characters in the string value can be expressed using +`\'-escape sequences as in C; in addition, `\E' stands for . `^' +is also a kind of escape character; `^' followed by CHAR stands for the +control-equivalent of CHAR. Thus, `^a' stands for the character +control-a, just like `\001'. `\' and `^' themselves can be represented +as `\\' and `\^'. + + To include a colon in the string, you must write `\072'. You might +ask, "Why can't `\:' be used to represent a colon?" The reason is that +the interrogation functions do not count slashes while looking for a +capability. Even if `:ce=ab\:cd:' were interpreted as giving the `ce' +capability the value `ab:cd', it would also appear to define `cd' as a +flag. + + The string value will often contain digits at the front to specify +padding (*note Padding::.) and/or `%'-sequences within to specify how +to encode parameters (*note Parameters::.). Although these things are +not to be output literally to the terminal, they are considered part of +the value of the capability. They are special only when the string +value is processed by `tputs', `tparam' or `tgoto'. By contrast, `\' +and `^' are considered part of the syntax for specifying the characters +in the string. + + Let's look at the VT52 example again: + + dw|vt52|DEC vt52:\ + :cr=^M:do=^J:nl=^J:bl=^G:\ + :le=^H:bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#24:\ + :nd=\EC:ta=^I:pt:sr=\EI:up=\EA:\ + :ku=\EA:kd=\EB:kr=\EC:kl=\ED:kb=^H: + + Here we see the numeric-valued capabilities `co' and `li', the flags +`bs' and `pt', and many string-valued capabilities. Most of the +strings start with represented as `\E'. The rest contain control +characters represented using `^'. The meanings of the individual +capabilities are defined elsewhere (*note Capabilities::.). + + +File: termcap.info, Node: Naming, Next: Inheriting, Prev: Capability Format, Up: Data Base + +Terminal Type Name Conventions +============================== + + There are conventions for choosing names of terminal types. For one +thing, all letters should be in lower case. The terminal type for a +terminal in its most usual or most fundamental mode of operation should +not have a hyphen in it. + + If the same terminal has other modes of operation which require +different terminal descriptions, these variant descriptions are given +names made by adding suffixes with hyphens. Such alternate descriptions +are used for two reasons: + + * When the terminal has a switch that changes its behavior. Since + the computer cannot tell how the switch is set, the user must tell + the computer by choosing the appropriate terminal type name. + + For example, the VT-100 has a setup flag that controls whether the + cursor wraps at the right margin. If this flag is set to "wrap", + you must use the terminal type `vt100-am'. Otherwise you must use + `vt100-nam'. Plain `vt100' is defined as a synonym for either + `vt100-am' or `vt100-nam' depending on the preferences of the + local site. + + The standard suffix `-am' stands for "automatic margins". + + * To give the user a choice in how to use the terminal. This is done + when the terminal has a switch that the computer normally controls. + + For example, the Ann Arbor Ambassador can be configured with many + screen sizes ranging from 20 to 60 lines. Fewer lines make bigger + characters but more lines let you see more of what you are editing. + As a result, users have different preferences. Therefore, termcap + provides terminal types for many screen sizes. If you choose type + `aaa-30', the terminal will be configured to use 30 lines; if you + choose `aaa-48', 48 lines will be used, and so on. + + Here is a list of standard suffixes and their conventional meanings: + +`-w' + Short for "wide". This is a mode that gives the terminal more + columns than usual. This is normally a user option. + +`-am' + "Automatic margins". This is an alternate description for use when + the terminal's margin-wrap switch is on; it contains the `am' + flag. The implication is that normally the switch is off and the + usual description for the terminal says that the switch is off. + +`-nam' + "No automatic margins". The opposite of `-am', this names an + alternative description which lacks the `am' flag. This implies + that the terminal is normally operated with the margin-wrap switch + turned on, and the normal description of the terminal says so. + +`-na' + "No arrows". This terminal description initializes the terminal to + keep its arrow keys in local mode. This is a user option. + +`-rv' + "Reverse video". This terminal description causes text output for + normal video to appear as reverse, and text output for reverse + video to come out as normal. Often this description differs from + the usual one by interchanging the two strings which turn reverse + video on and off. + + This is a user option; you can choose either the "reverse video" + variant terminal type or the normal terminal type, and termcap will + obey. + +`-s' + "Status". Says to enable use of a status line which ordinary + output does not touch (*note Status Line::.). + + Some terminals have a special line that is used only as a status + line. For these terminals, there is no need for an `-s' variant; + the status line commands should be defined by default. On other + terminals, enabling a status line means removing one screen line + from ordinary use and reducing the effective screen height. For + these terminals, the user can choose the `-s' variant type to + request use of a status line. + +`-NLINES' + Says to operate with NLINES lines on the screen, for terminals + such as the Ambassador which provide this as an option. Normally + this is a user option; by choosing the terminal type, you control + how many lines termcap will use. + +`-NPAGESp' + Says that the terminal has NPAGES pages worth of screen memory, + for terminals where this is a hardware option. + +`-unk' + Says that description is not for direct use, but only for + reference in `tc' capabilities. Such a description is a kind of + subroutine, because it describes the common characteristics of + several variant descriptions that would use other suffixes in + place of `-unk'. + + +File: termcap.info, Node: Inheriting, Prev: Naming, Up: Data Base + +Inheriting from Related Descriptions +==================================== + + When two terminal descriptions are similar, their identical parts do +not need to be given twice. Instead, one of the two can be defined in +terms of the other, using the `tc' capability. We say that one +description "refers to" the other, or "inherits from" the other. + + The `tc' capability must be the last one in the terminal description, +and its value is a string which is the name of another terminal type +which is referred to. For example, + + N9|aaa|ambassador|aaa-30|ann arbor ambassador/30 lines:\ + :ti=\E[2J\E[30;0;0;30p:\ + :te=\E[60;0;0;30p\E[30;1H\E[J:\ + :li#30:tc=aaa-unk: + +defines the terminal type `aaa-30' (also known as plain `aaa') in terms +of `aaa-unk', which defines everything about the Ambassador that is +independent of screen height. The types `aaa-36', `aaa-48' and so on +for other screen heights are likewise defined to inherit from `aaa-unk'. + + The capabilities overridden by `aaa-30' include `li', which says how +many lines there are, and `ti' and `te', which configure the terminal +to use that many lines. + + The effective terminal description for type `aaa' consists of the +text shown above followed by the text of the description of `aaa-unk'. +The `tc' capability is handled automatically by `tgetent', which finds +the description thus referenced and combines the two descriptions +(*note Find::.). Therefore, only the implementor of the terminal +descriptions needs to think about using `tc'. Users and application +programmers do not need to be concerned with it. + + Since the reference terminal description is used last, capabilities +specified in the referring description override any specifications of +the same capabilities in the reference description. + + The referring description can cancel out a capability without +specifying any new value for it by means of a special trick. Write the +capability in the referring description, with the character `@' after +the capability name, as follows: + + NZ|aaa-30-nam|ann arbor ambassador/30 lines/no automatic-margins:\ + :am@:tc=aaa-30: + diff --git a/info/termcap.info-2 b/info/termcap.info-2 new file mode 100644 index 0000000..156c7e7 --- /dev/null +++ b/info/termcap.info-2 @@ -0,0 +1,1003 @@ +This is Info file ../info/termcap.info, produced by Makeinfo version +1.68 from the input file termcap.texi. + +START-INFO-DIR-ENTRY +* Termcap: (termcap). Termcap library of the GNU system. +END-INFO-DIR-ENTRY + + This file documents the termcap library of the GNU system. + + Copyright (C) 1988 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. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, 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 Foundation. + + +File: termcap.info, Node: Capabilities, Next: Summary, Prev: Data Base, Up: Top + +Definitions of the Terminal Capabilities +**************************************** + + This section is divided into many subsections, each for one aspect of +use of display terminals. For writing a display program, you usually +need only check the subsections for the operations you want to use. +For writing a terminal description, you must read each subsection and +fill in the capabilities described there. + + String capabilities that are display commands may require numeric +parameters (*note Parameters::.). Most such capabilities do not use +parameters. When a capability requires parameters, this is explicitly +stated at the beginning of its definition. In simple cases, the first +or second sentence of the definition mentions all the parameters, in +the order they should be given, using a name in upper case for each +one. For example, the `rp' capability is a command that requires two +parameters; its definition begins as follows: + + String of commands to output a graphic character C, repeated N + times. + + In complex cases or when there are many parameters, they are +described explicitly. + + When a capability is described as obsolete, this means that programs +should not be written to look for it, but terminal descriptions should +still be written to provide it. + + When a capability is described as very obsolete, this means that it +should be omitted from terminal descriptions as well. + +* Menu: + +* Basic:: Basic characteristics. +* Screen Size:: Screen size, and what happens when it changes. +* Cursor Motion:: Various ways to move the cursor. +* Scrolling:: Pushing text up and down on the screen. +* Wrapping:: What happens if you write a character in the last column. +* Windows:: Limiting the part of the window that output affects. +* Clearing:: Erasing one or many lines. +* Insdel Line:: Making new blank lines in mid-screen; deleting lines. +* Insdel Char:: Inserting and deleting characters within a line. +* Standout:: Highlighting some of the text. +* Underlining:: Underlining some of the text. +* Cursor Visibility:: Making the cursor more or less easy to spot. +* Bell:: Attracts user's attention; not localized on the screen. +* Keypad:: Recognizing when function keys or arrows are typed. +* Meta Key:: acts like an extra shift key. +* Initialization:: Commands used to initialize or reset the terminal. +* Pad Specs:: Info for the kernel on how much padding is needed. +* Status Line:: A status line displays "background" information. +* Half-Line:: Moving by half-lines, for superscripts and subscripts. +* Printer:: Controlling auxiliary printers of display terminals. + + +File: termcap.info, Node: Basic, Next: Screen Size, Prev: Capabilities, Up: Capabilities + +Basic Characteristics +===================== + + This section documents the capabilities that describe the basic and +nature of the terminal, and also those that are relevant to the output +of graphic characters. + +`os' + Flag whose presence means that the terminal can overstrike. This + means that outputting a graphic character does not erase whatever + was present in the same character position before. The terminals + that can overstrike include printing terminals, storage tubes (all + obsolete nowadays), and many bit-map displays. + +`eo' + Flag whose presence means that outputting a space can erase an + overstrike. If this is not present and overstriking is supported, + output of a space has no effect except to move the cursor. + +`gn' + Flag whose presence means that this terminal type is a generic type + which does not really describe any particular terminal. Generic + types are intended for use as the default type assigned when the + user connects to the system, with the intention that the user + should specify what type he really has. One example of a generic + type is the type `network'. + + Since the generic type cannot say how to do anything interesting + with the terminal, termcap-using programs will always find that the + terminal is too weak to be supported if the user has failed to + specify a real terminal type in place of the generic one. The + `gn' flag directs these programs to use a different error message: + "You have not specified your real terminal type", rather than + "Your terminal is not powerful enough to be used". + +`hc' + Flag whose presence means this is a hardcopy terminal. + +`rp' + String of commands to output a graphic character C, repeated N + times. The first parameter value is the ASCII code for the desired + character, and the second parameter is the number of times to + repeat the character. Often this command requires padding + proportional to the number of times the character is repeated. + This effect can be had by using parameter arithmetic with + `%'-sequences to compute the amount of padding, then generating + the result as a number at the front of the string so that `tputs' + will treat it as padding. + +`hz' + Flag whose presence means that the ASCII character `~' cannot be + output on this terminal because it is used for display commands. + + Programs handle this flag by checking all text to be output and + replacing each `~' with some other character(s). If this is not + done, the screen will be thoroughly garbled. + + The old Hazeltine terminals that required such treatment are + probably very rare today, so you might as well not bother to + support this flag. + +`CC' + String whose presence means the terminal has a settable command + character. The value of the string is the default command + character (which is usually ). + + All the strings of commands in the terminal description should be + written to use the default command character. If you are writing + an application program that changes the command character, use the + `CC' capability to figure out how to translate all the display + commands to work with the new command character. + + Most programs have no reason to look at the `CC' capability. + +`xb' + Flag whose presence identifies Superbee terminals which are unable + to transmit the characters and `Control-C'. Programs which + support this flag are supposed to check the input for the code + sequences sent by the and keys, and pretend that + or `Control-C' (respectively) had been read. But this flag is + obsolete, and not worth supporting. + + +File: termcap.info, Node: Screen Size, Next: Cursor Motion, Prev: Basic, Up: Capabilities + +Screen Size +=========== + + A terminal description has two capabilities, `co' and `li', that +describe the screen size in columns and lines. But there is more to +the question of screen size than this. + + On some operating systems the "screen" is really a window and the +effective width can vary. On some of these systems, `tgetnum' uses the +actual width of the window to decide what value to return for the `co' +capability, overriding what is actually written in the terminal +description. On other systems, it is up to the application program to +check the actual window width using a system call. For example, on BSD +4.3 systems, the system call `ioctl' with code `TIOCGWINSZ' will tell +you the current screen size. + + On all window systems, termcap is powerless to advise the application +program if the user resizes the window. Application programs must deal +with this possibility in a system-dependent fashion. On some systems +the C shell handles part of the problem by detecting changes in window +size and setting the `TERMCAP' environment variable appropriately. +This takes care of application programs that are started subsequently. +It does not help application programs already running. + + On some systems, including BSD 4.3, all programs using a terminal get +a signal named `SIGWINCH' whenever the screen size changes. Programs +that use termcap should handle this signal by using `ioctl TIOCGWINSZ' +to learn the new screen size. + +`co' + Numeric value, the width of the screen in character positions. + Even hardcopy terminals normally have a `co' capability. + +`li' + Numeric value, the height of the screen in lines. + + +File: termcap.info, Node: Cursor Motion, Next: Wrapping, Prev: Screen Size, Up: Capabilities + +Cursor Motion +============= + + Termcap assumes that the terminal has a "cursor", a spot on the +screen where a visible mark is displayed, and that most display +commands take effect at the position of the cursor. It follows that +moving the cursor to a specified location is very important. + + There are many terminal capabilities for different cursor motion +operations. A terminal description should define as many as possible, +but most programs do not need to use most of them. One capability, +`cm', moves the cursor to an arbitrary place on the screen; this by +itself is sufficient for any application as long as there is no need to +support hardcopy terminals or certain old, weak displays that have only +relative motion commands. Use of other cursor motion capabilities is an +optimization, enabling the program to output fewer characters in some +common cases. + + If you plan to use the relative cursor motion commands in an +application program, you must know what the starting cursor position +is. To do this, you must keep track of the cursor position and update +the records each time anything is output to the terminal, including +graphic characters. In addition, it is necessary to know whether the +terminal wraps after writing in the rightmost column. *Note Wrapping::. + + One other motion capability needs special mention: `nw' moves the +cursor to the beginning of the following line, perhaps clearing all the +starting line after the cursor, or perhaps not clearing at all. This +capability is a least common denominator that is probably supported +even by terminals that cannot do most other things such as `cm' or `do'. +Even hardcopy terminals can support `nw'. + +`cm' + String of commands to position the cursor at line L, column C. + Both parameters are origin-zero, and are defined relative to the + screen, not relative to display memory. + + All display terminals except a few very obsolete ones support `cm', + so it is acceptable for an application program to refuse to + operate on terminals lacking `cm'. + +`ho' + String of commands to move the cursor to the upper left corner of + the screen (this position is called the "home position"). In + terminals where the upper left corner of the screen is not the + same as the beginning of display memory, this command must go to + the upper left corner of the screen, not the beginning of display + memory. + + Every display terminal supports this capability, and many + application programs refuse to operate if the `ho' capability is + missing. + +`ll' + String of commands to move the cursor to the lower left corner of + the screen. On some terminals, moving up from home position does + this, but programs should never assume that will work. Just + output the `ll' string (if it is provided); if moving to home + position and then moving up is the best way to get there, the `ll' + command will do that. + +`cr' + String of commands to move the cursor to the beginning of the line + it is on. If this capability is not specified, many programs + assume they can use the ASCII carriage return character for this. + +`le' + String of commands to move the cursor left one column. Unless the + `bw' flag capability is specified, the effect is undefined if the + cursor is at the left margin; do not use this command there. If + `bw' is present, this command may be used at the left margin, and + it wraps the cursor to the last column of the preceding line. + +`nd' + String of commands to move the cursor right one column. The + effect is undefined if the cursor is at the right margin; do not + use this command there, not even if `am' is present. + +`up' + String of commands to move the cursor vertically up one line. The + effect of sending this string when on the top line is undefined; + programs should never use it that way. + +`do' + String of commands to move the cursor vertically down one line. + The effect of sending this string when on the bottom line is + undefined; programs should never use it that way. + + The original idea was that this string would not contain a newline + character and therefore could be used without disabling the + kernel's usual habit of converting of newline into a + carriage-return newline sequence. But many terminal descriptions + do use newline in the `do' string, so this is not possible; a + program which sends the `do' string must disable output conversion + in the kernel (*note Initialize::.). + +`bw' + Flag whose presence says that `le' may be used in column zero to + move to the last column of the preceding line. If this flag is + not present, `le' should not be used in column zero. + +`nw' + String of commands to move the cursor to start of next line, + possibly clearing rest of line (following the cursor) before + moving. + +`DO', `UP', `LE', `RI' + Strings of commands to move the cursor N lines down vertically, up + vertically, or N columns left or right. Do not attempt to move + past any edge of the screen with these commands; the effect of + trying that is undefined. Only a few terminal descriptions provide + these commands, and most programs do not use them. + +`CM' + String of commands to position the cursor at line L, column C, + relative to display memory. Both parameters are origin-zero. + This capability is present only in terminals where there is a + difference between screen-relative and memory-relative addressing, + and not even in all such terminals. + +`ch' + String of commands to position the cursor at column C in the same + line it is on. This is a special case of `cm' in which the + vertical position is not changed. The `ch' capability is provided + only when it is faster to output than `cm' would be in this + special case. Programs should not assume most display terminals + have `ch'. + +`cv' + String of commands to position the cursor at line L in the same + column. This is a special case of `cm' in which the horizontal + position is not changed. The `cv' capability is provided only + when it is faster to output than `cm' would be in this special + case. Programs should not assume most display terminals have `cv'. + +`sc' + String of commands to make the terminal save the current cursor + position. Only the last saved position can be used. If this + capability is present, `rc' should be provided also. Most + terminals have neither. + +`rc' + String of commands to make the terminal restore the last saved + cursor position. If this capability is present, `sc' should be + provided also. Most terminals have neither. + +`ff' + String of commands to advance to the next page, for a hardcopy + terminal. + +`ta' + String of commands to move the cursor right to the next hardware + tab stop column. Missing if the terminal does not have any kind of + hardware tabs. Do not send this command if the kernel's terminal + modes say that the kernel is expanding tabs into spaces. + +`bt' + String of commands to move the cursor left to the previous hardware + tab stop column. Missing if the terminal has no such ability; many + terminals do not. Do not send this command if the kernel's + terminal modes say that the kernel is expanding tabs into spaces. + + The following obsolete capabilities should be included in terminal +descriptions when appropriate, but should not be looked at by new +programs. + +`nc' + Flag whose presence means the terminal does not support the ASCII + carriage return character as `cr'. This flag is needed because + old programs assume, when the `cr' capability is missing, that + ASCII carriage return can be used for the purpose. We use `nc' to + tell the old programs that carriage return may not be used. + + New programs should not assume any default for `cr', so they need + not look at `nc'. However, descriptions should contain `nc' + whenever they do not contain `cr'. + +`xt' + Flag whose presence means that the ASCII tab character may not be + used for cursor motion. This flag exists because old programs + assume, when the `ta' capability is missing, that ASCII tab can be + used for the purpose. We use `xt' to tell the old programs not to + use tab. + + New programs should not assume any default for `ta', so they need + not look at `xt' in connection with cursor motion. Note that `xt' + also has implications for standout mode (*note Standout::.). It + is obsolete in regard to cursor motion but not in regard to + standout. + + In fact, `xt' means that the terminal is a Teleray 1061. + +`bc' + Very obsolete alternative name for the `le' capability. + +`bs' + Flag whose presence means that the ASCII character backspace may be + used to move the cursor left. Obsolete; look at `le' instead. + +`nl' + Obsolete capability which is a string that can either be used to + move the cursor down or to scroll. The same string must scroll + when used on the bottom line and move the cursor when used on any + other line. New programs should use `do' or `sf', and ignore `nl'. + + If there is no `nl' capability, some old programs assume they can + use the newline character for this purpose. These programs follow + a bad practice, but because they exist, it is still desirable to + define the `nl' capability in a terminal description if the best + way to move down is *not* a newline. + + +File: termcap.info, Node: Wrapping, Next: Scrolling, Prev: Cursor Motion, Up: Capabilities + +Wrapping +======== + + "Wrapping" means moving the cursor from the right margin to the left +margin of the following line. Some terminals wrap automatically when a +graphic character is output in the last column, while others do not. +Most application programs that use termcap need to know whether the +terminal wraps. There are two special flag capabilities to describe +what the terminal does when a graphic character is output in the last +column. + +`am' + Flag whose presence means that writing a character in the last + column causes the cursor to wrap to the beginning of the next line. + + If `am' is not present, writing in the last column leaves the + cursor at the place where the character was written. + + Writing in the last column of the last line should be avoided on + terminals with `am', as it may or may not cause scrolling to occur + (*note Scrolling::.). Scrolling is surely not what you would + intend. + + If your program needs to check the `am' flag, then it also needs + to check the `xn' flag which indicates that wrapping happens in a + strange way. Many common terminals have the `xn' flag. + +`xn' + Flag whose presence means that the cursor wraps in a strange way. + At least two distinct kinds of strange behavior are known; the + termcap data base does not contain anything to distinguish the two. + + On Concept-100 terminals, output in the last column wraps the + cursor almost like an ordinary `am' terminal. But if the next + thing output is a newline, it is ignored. + + DEC VT-100 terminals (when the wrap switch is on) do a different + strange thing: the cursor wraps only if the next thing output is + another graphic character. In fact, the wrap occurs when the + following graphic character is received by the terminal, before the + character is placed on the screen. + + On both of these terminals, after writing in the last column a + following graphic character will be displayed in the first column + of the following line. But the effect of relative cursor motion + characters such as newline or backspace at such a time depends on + the terminal. The effect of erase or scrolling commands also + depends on the terminal. You can't assume anything about what + they will do on a terminal that has `xn'. So, to be safe, you + should never do these things at such a time on such a terminal. + + To be sure of reliable results on a terminal which has the `xn' + flag, output a `cm' absolute positioning command after writing in + the last column. Another safe thing to do is to output + carriage-return newline, which will leave the cursor at the + beginning of the following line. + + +File: termcap.info, Node: Scrolling, Next: Windows, Prev: Wrapping, Up: Capabilities + +Scrolling +========= + + "Scrolling" means moving the contents of the screen up or down one or +more lines. Moving the contents up is "forward scrolling"; moving them +down is "reverse scrolling". + + Scrolling happens after each line of output during ordinary output +on most display terminals. But in an application program that uses +termcap for random-access output, scrolling happens only when +explicitly requested with the commands in this section. + + Some terminals have a "scroll region" feature. This lets you limit +the effect of scrolling to a specified range of lines. Lines outside +the range are unaffected when scrolling happens. The scroll region +feature is available if either `cs' or `cS' is present. + +`sf' + String of commands to scroll the screen one line up, assuming it is + output with the cursor at the beginning of the bottom line. + +`sr' + String of commands to scroll the screen one line down, assuming it + is output with the cursor at the beginning of the top line. + +`SF' + String of commands to scroll the screen N lines up, assuming it is + output with the cursor at the beginning of the bottom line. + +`SR' + String of commands to scroll the screen N line down, assuming it + is output with the cursor at the beginning of the top line. + +`cs' + String of commands to set the scroll region. This command takes + two parameters, START and END, which are the line numbers + (origin-zero) of the first line to include in the scroll region + and of the last line to include in it. When a scroll region is + set, scrolling is limited to the specified range of lines; lines + outside the range are not affected by scroll commands. + + Do not try to move the cursor outside the scroll region. The + region remains set until explicitly removed. To remove the scroll + region, use another `cs' command specifying the full height of the + screen. + + The cursor position is undefined after the `cs' command is set, so + position the cursor with `cm' immediately afterward. + +`cS' + String of commands to set the scroll region using parameters in + different form. The effect is the same as if `cs' were used. + Four parameters are required: + + 1. Total number of lines on the screen. + + 2. Number of lines above desired scroll region. + + 3. Number of lines below (outside of) desired scroll region. + + 4. Total number of lines on the screen, the same as the first + parameter. + + This capability is a GNU extension that was invented to allow the + Ann Arbor Ambassador's scroll-region command to be described; it + could also be done by putting non-Unix `%'-sequences into a `cs' + string, but that would have confused Unix programs that used the + `cs' capability with the Unix termcap. Currently only GNU Emacs + uses the `cS' capability. + +`ns' + Flag which means that the terminal does not normally scroll for + ordinary sequential output. For modern terminals, this means that + outputting a newline in ordinary sequential output with the cursor + on the bottom line wraps to the top line. For some obsolete + terminals, other things may happen. + + The terminal may be able to scroll even if it does not normally do + so. If the `sf' capability is provided, it can be used for + scrolling regardless of `ns'. + +`da' + Flag whose presence means that lines scrolled up off the top of the + screen may come back if scrolling down is done subsequently. + + The `da' and `db' flags do not, strictly speaking, affect how to + scroll. But programs that scroll usually need to clear the lines + scrolled onto the screen, if these flags are present. + +`db' + Flag whose presence means that lines scrolled down off the bottom + of the screen may come back if scrolling up is done subsequently. + +`lm' + Numeric value, the number of lines of display memory that the + terminal has. A value of zero means that the terminal has more + display memory than can fit on the screen, but no fixed number of + lines. (The number of lines may depend on the amount of text in + each line.) + + Any terminal description that defines `SF' should also define `sf'; +likewise for `SR' and `sr'. However, many terminals can only scroll by +one line at a time, so it is common to find `sf' and not `SF', or `sr' +without `SR'. + + Therefore, all programs that use the scrolling facilities should be +prepared to work with `sf' in the case that `SF' is absent, and +likewise with `sr'. On the other hand, an application program that +uses only `sf' and not `SF' is acceptable, though slow on some +terminals. + + When outputting a scroll command with `tputs', the NLINES argument +should be the total number of lines in the portion of the screen being +scrolled. Very often these commands require padding proportional to +this number of lines. *Note Padding::. + + +File: termcap.info, Node: Windows, Next: Clearing, Prev: Scrolling, Up: Capabilities + +Windows +======= + + A "window", in termcap, is a rectangular portion of the screen to +which all display operations are restricted. Wrapping, clearing, +scrolling, insertion and deletion all operate as if the specified +window were all the screen there was. + +`wi' + String of commands to set the terminal output screen window. This + string requires four parameters, all origin-zero: + 1. The first line to include in the window. + + 2. The last line to include in the window. + + 3. The first column to include in the window. + + 4. The last column to include in the window. + + Most terminals do not support windows. + + +File: termcap.info, Node: Clearing, Next: Insdel Line, Prev: Windows, Up: Capabilities + +Clearing Parts of the Screen +============================ + + There are several terminal capabilities for clearing parts of the +screen to blank. All display terminals support the `cl' string, and +most display terminals support all of these capabilities. + +`cl' + String of commands to clear the entire screen and position the + cursor at the upper left corner. + +`cd' + String of commands to clear the line the cursor is on, and all the + lines below it, down to the bottom of the screen. This command + string should be used only with the cursor in column zero; their + effect is undefined if the cursor is elsewhere. + +`ce' + String of commands to clear from the cursor to the end of the + current line. + +`ec' + String of commands to clear N characters, starting with the + character that the cursor is on. This command string is expected + to leave the cursor position unchanged. The parameter N should + never be large enough to reach past the right margin; the effect + of such a large parameter would be undefined. + + Clear to end of line (`ce') is extremely important in programs that +maintain an updating display. Nearly all display terminals support this +operation, so it is acceptable for a an application program to refuse to +work if `ce' is not present. However, if you do not want this +limitation, you can accomplish clearing to end of line by outputting +spaces until you reach the right margin. In order to do this, you must +know the current horizontal position. Also, this technique assumes +that writing a space will erase. But this happens to be true on all +the display terminals that fail to support `ce'. + + +File: termcap.info, Node: Insdel Line, Next: Insdel Char, Prev: Clearing, Up: Capabilities + +Insert/Delete Line +================== + + "Inserting a line" means creating a blank line in the middle of the +screen, and pushing the existing lines of text apart. In fact, the +lines above the insertion point do not change, while the lines below +move down, and one is normally lost at the bottom of the screen. + + "Deleting a line" means causing the line to disappear from the +screen, closing up the gap by moving the lines below it upward. A new +line appears at the bottom of the screen. Usually this line is blank, +but on terminals with the `db' flag it may be a line previously moved +off the screen bottom by scrolling or line insertion. + + Insertion and deletion of lines is useful in programs that maintain +an updating display some parts of which may get longer or shorter. +They are also useful in editors for scrolling parts of the screen, and +for redisplaying after lines of text are killed or inserted. + + Many terminals provide commands to insert or delete a single line at +the cursor position. Some provide the ability to insert or delete +several lines with one command, using the number of lines to insert or +delete as a parameter. Always move the cursor to column zero before +using any of these commands. + +`al' + String of commands to insert a blank line before the line the + cursor is on. The existing line, and all lines below it, are + moved down. The last line in the screen (or in the scroll region, + if one is set) disappears and in most circumstances is discarded. + It may not be discarded if the `db' is present (*note + Scrolling::.). + + The cursor must be at the left margin before this command is used. + This command does not move the cursor. + +`dl' + String of commands to delete the line the cursor is on. The + following lines move up, and a blank line appears at the bottom of + the screen (or bottom of the scroll region). If the terminal has + the `db' flag, a nonblank line previously pushed off the screen + bottom may reappear at the bottom. + + The cursor must be at the left margin before this command is used. + This command does not move the cursor. + +`AL' + String of commands to insert N blank lines before the line that + the cursor is on. It is like `al' repeated N times, except that + it is as fast as one `al'. + +`DL' + String of commands to delete N lines starting with the line that + the cursor is on. It is like `dl' repeated N times, except that + it is as fast as one `dl'. + + Any terminal description that defines `AL' should also define `al'; +likewise for `DL' and `dl'. However, many terminals can only insert or +delete one line at a time, so it is common to find `al' and not `AL', +or `dl' without `DL'. + + Therefore, all programs that use the insert and delete facilities +should be prepared to work with `al' in the case that `AL' is absent, +and likewise with `dl'. On the other hand, it is acceptable to write +an application that uses only `al' and `dl' and does not look for `AL' +or `DL' at all. + + If a terminal does not support line insertion and deletion directly, +but does support a scroll region, the effect of insertion and deletion +can be obtained with scrolling. However, it is up to the individual +user program to check for this possibility and use the scrolling +commands to get the desired result. It is fairly important to implement +this alternate strategy, since it is the only way to get the effect of +line insertion and deletion on the popular VT100 terminal. + + Insertion and deletion of lines is affected by the scroll region on +terminals that have a settable scroll region. This is useful when it is +desirable to move any few consecutive lines up or down by a few lines. +*Note Scrolling::. + + The line pushed off the bottom of the screen is not lost if the +terminal has the `db' flag capability; instead, it is pushed into +display memory that does not appear on the screen. This is the same +thing that happens when scrolling pushes a line off the bottom of the +screen. Either reverse scrolling or deletion of a line can bring the +apparently lost line back onto the bottom of the screen. If the +terminal has the scroll region feature as well as `db', the pushed-out +line really is lost if a scroll region is in effect. + + When outputting an insert or delete command with `tputs', the NLINES +argument should be the total number of lines from the cursor to the +bottom of the screen (or scroll region). Very often these commands +require padding proportional to this number of lines. *Note Padding::. + + For `AL' and `DL' the NLINES argument should *not* depend on the +number of lines inserted or deleted; only the total number of lines +affected. This is because it is just as fast to insert two or N lines +with `AL' as to insert one line with `al'. + + +File: termcap.info, Node: Insdel Char, Next: Standout, Prev: Insdel Line, Up: Capabilities + +Insert/Delete Character +======================= + + "Inserting a character" means creating a blank space in the middle +of a line, and pushing the rest of the line rightward. The character +in the rightmost column is lost. + + "Deleting a character" means causing the character to disappear from +the screen, closing up the gap by moving the rest of the line leftward. +A blank space appears in the rightmost column. + + Insertion and deletion of characters is useful in programs that +maintain an updating display some parts of which may get longer or +shorter. It is also useful in editors for redisplaying the results of +editing within a line. + + Many terminals provide commands to insert or delete a single +character at the cursor position. Some provide the ability to insert +or delete several characters with one command, using the number of +characters to insert or delete as a parameter. + + Many terminals provide an insert mode in which outputting a graphic +character has the added effect of inserting a position for that +character. A special command string is used to enter insert mode and +another is used to exit it. The reason for designing a terminal with +an insert mode rather than an insert command is that inserting +character positions is usually followed by writing characters into +them. With insert mode, this is as fast as simply writing the +characters, except for the fixed overhead of entering and leaving +insert mode. However, when the line speed is great enough, padding may +be required for the graphic characters output in insert mode. + + Some terminals require you to enter insert mode and then output a +special command for each position to be inserted. Or they may require +special commands to be output before or after each graphic character to +be inserted. + + Deletion of characters is usually accomplished by a straightforward +command to delete one or several positions; but on some terminals, it +is necessary to enter a special delete mode before using the delete +command, and leave delete mode afterward. Sometimes delete mode and +insert mode are the same mode. + + Some terminals make a distinction between character positions in +which a space character has been output and positions which have been +cleared. On these terminals, the effect of insert or delete character +runs to the first cleared position rather than to the end of the line. +In fact, the effect may run to more than one line if there is no +cleared position to stop the shift on the first line. These terminals +are identified by the `in' flag capability. + + On terminals with the `in' flag, the technique of skipping over +characters that you know were cleared, and then outputting text later +on in the same line, causes later insert and delete character +operations on that line to do nonstandard things. A program that has +any chance of doing this must check for the `in' flag and must be +careful to write explicit space characters into the intermediate +columns when `in' is present. + + A plethora of terminal capabilities are needed to describe all of +this complexity. Here is a list of them all. Following the list, we +present an algorithm for programs to use to take proper account of all +of these capabilities. + +`im' + String of commands to enter insert mode. + + If the terminal has no special insert mode, but it can insert + characters with a special command, `im' should be defined with a + null value, because the `vi' editor assumes that insertion of a + character is impossible if `im' is not provided. + + New programs should not act like `vi'. They should pay attention + to `im' only if it is defined. + +`ei' + String of commands to leave insert mode. This capability must be + present if `im' is. + + On a few old terminals the same string is used to enter and exit + insert mode. This string turns insert mode on if it was off, and + off if it was on. You can tell these terminals because the `ei' + string equals the `im' string. If you want to support these + terminals, you must always remember accurately whether insert mode + is in effect. However, these terminals are obsolete, and it is + reasonable to refuse to support them. On all modern terminals, you + can safely output `ei' at any time to ensure that insert mode is + turned off. + +`ic' + String of commands to insert one character position at the cursor. + The cursor does not move. + + If outputting a graphic character while in insert mode is + sufficient to insert the character, then the `ic' capability + should be defined with a null value. + + If your terminal offers a choice of ways to insert--either use + insert mode or use a special command--then define `im' and do not + define `ic', since this gives the most efficient operation when + several characters are to be inserted. *Do not* define both + strings, for that means that *both* must be used each time + insertion is done. + +`ip' + String of commands to output following an inserted graphic + character in insert mode. Often it is used just for a padding + spec, when padding is needed after an inserted character (*note + Padding::.). + +`IC' + String of commands to insert N character positions at and after + the cursor. It has the same effect as repeating the `ic' string + and a space, N times. + + If `IC' is provided, application programs may use it without first + entering insert mode. + +`mi' + Flag whose presence means it is safe to move the cursor while in + insert mode and assume the terminal remains in insert mode. + +`in' + Flag whose presence means that the terminal distinguishes between + character positions in which space characters have been output and + positions which have been cleared. + + An application program can assume that the terminal can do character +insertion if *any one of* the capabilities `IC', `im', `ic' or `ip' is +provided. + + To insert N blank character positions, move the cursor to the place +to insert them and follow this algorithm: + + 1. If an `IC' string is provided, output it with parameter N and you + are finished. Otherwise (or if you don't want to bother to look + for an `IC' string) follow the remaining steps. + + 2. Output the `im' string, if there is one, unless the terminal is + already in insert mode. + + 3. Repeat steps 4 through 6, N times. + + 4. Output the `ic' string if any. + + 5. Output a space. + + 6. Output the `ip' string if any. + + 7. Output the `ei' string, eventually, to exit insert mode. There is + no need to do this right away. If the `mi' flag is present, you + can move the cursor and the cursor will remain in insert mode; + then you can do more insertion elsewhere without reentering insert + mode. + + To insert N graphic characters, position the cursor and follow this +algorithm: + + 1. If an `IC' string is provided, output it with parameter N, then + output the graphic characters, and you are finished. Otherwise + (or if you don't want to bother to look for an `IC' string) follow + the remaining steps. + + 2. Output the `im' string, if there is one, unless the terminal is + already in insert mode. + + 3. For each character to be output, repeat steps 4 through 6. + + 4. Output the `ic' string if any. + + 5. Output the next graphic character. + + 6. Output the `ip' string if any. + + 7. Output the `ei' string, eventually, to exit insert mode. There is + no need to do this right away. If the `mi' flag is present, you + can move the cursor and the cursor will remain in insert mode; + then you can do more insertion elsewhere without reentering insert + mode. + + Note that this is not the same as the original Unix termcap +specifications in one respect: it assumes that the `IC' string can be +used without entering insert mode. This is true as far as I know, and +it allows you be able to avoid entering and leaving insert mode, and +also to be able to avoid the inserted-character padding after the +characters that go into the inserted positions. + + Deletion of characters is less complicated; deleting one column is +done by outputting the `dc' string. However, there may be a delete +mode that must be entered with `dm' in order to make `dc' work. + +`dc' + String of commands to delete one character position at the cursor. + If `dc' is not present, the terminal cannot delete characters. + +`DC' + String of commands to delete N characters starting at the cursor. + It has the same effect as repeating the `dc' string N times. Any + terminal description that has `DC' also has `dc'. + +`dm' + String of commands to enter delete mode. If not present, there is + no delete mode, and `dc' can be used at any time (assuming there is + a `dc'). + +`ed' + String of commands to exit delete mode. This must be present if + `dm' is. + + To delete N character positions, position the cursor and follow these +steps: + + 1. If the `DC' string is present, output it with parameter N and you + are finished. Otherwise, follow the remaining steps. + + 2. Output the `dm' string, unless you know the terminal is already in + delete mode. + + 3. Output the `dc' string N times. + + 4. Output the `ed' string eventually. If the flag capability `mi' is + present, you can move the cursor and do more deletion without + leaving and reentering delete mode. + + As with the `IC' string, we have departed from the original termcap +specifications by assuming that `DC' works without entering delete mode +even though `dc' would not. + + If the `dm' and `im' capabilities are both present and have the same +value, it means that the terminal has one mode for both insertion and +deletion. It is useful for a program to know this, because then it can +do insertions after deletions, or vice versa, without leaving +insert/delete mode and reentering it. + diff --git a/info/termcap.info-3 b/info/termcap.info-3 new file mode 100644 index 0000000..973a2c1 --- /dev/null +++ b/info/termcap.info-3 @@ -0,0 +1,1432 @@ +This is Info file ../info/termcap.info, produced by Makeinfo version +1.68 from the input file termcap.texi. + +START-INFO-DIR-ENTRY +* Termcap: (termcap). Termcap library of the GNU system. +END-INFO-DIR-ENTRY + + This file documents the termcap library of the GNU system. + + Copyright (C) 1988 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. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, 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 Foundation. + + +File: termcap.info, Node: Standout, Next: Underlining, Prev: Insdel Char, Up: Capabilities + +Standout and Appearance Modes +============================= + + "Appearance modes" are modifications to the ways characters are +displayed. Typical appearance modes include reverse video, dim, bright, +blinking, underlined, invisible, and alternate character set. Each +kind of terminal supports various among these, or perhaps none. + + For each type of terminal, one appearance mode or combination of +them that looks good for highlighted text is chosen as the "standout +mode". The capabilities `so' and `se' say how to enter and leave +standout mode. Programs that use appearance modes only to highlight +some text generally use the standout mode so that they can work on as +many terminals as possible. Use of specific appearance modes other +than "underlined" and "alternate character set" is rare. + + Terminals that implement appearance modes fall into two general +classes as to how they do it. + + In some terminals, the presence or absence of any appearance mode is +recorded separately for each character position. In these terminals, +each graphic character written is given the appearance modes current at +the time it is written, and keeps those modes until it is erased or +overwritten. There are special commands to turn the appearance modes +on or off for characters to be written in the future. + + In other terminals, the change of appearance modes is represented by +a marker that belongs to a certain screen position but affects all +following screen positions until the next marker. These markers are +traditionally called "magic cookies". + + The same capabilities (`so', `se', `mb' and so on) for turning +appearance modes on and off are used for both magic-cookie terminals +and per-character terminals. On magic cookie terminals, these give the +commands to write the magic cookies. On per-character terminals, they +change the current modes that affect future output and erasure. Some +simple applications can use these commands without knowing whether or +not they work by means of cookies. + + However, a program that maintains and updates a display needs to know +whether the terminal uses magic cookies, and exactly what their effect +is. This information comes from the `sg' capability. + + The `sg' capability is a numeric capability whose presence indicates +that the terminal uses magic cookies for appearance modes. Its value is +the number of character positions that a magic cookie occupies. Usually +the cookie occupies one or more character positions on the screen, and +these character positions are displayed as blank, but in some terminals +the cookie has zero width. + + The `sg' capability describes both the magic cookie to turn standout +on and the cookie to turn it off. This makes the assumption that both +kinds of cookie have the same width on the screen. If that is not true, +the narrower cookie must be "widened" with spaces until it has the same +width as the other. + + On some magic cookie terminals, each line always starts with normal +display; in other words, the scope of a magic cookie never extends over +more than one line. But on other terminals, one magic cookie affects +all the lines below it unless explicitly canceled. Termcap does not +define any way to distinguish these two ways magic cookies can work. +To be safe, it is best to put a cookie at the beginning of each line. + + On some per-character terminals, standout mode or other appearance +modes may be canceled by moving the cursor. On others, moving the +cursor has no effect on the state of the appearance modes. The latter +class of terminals are given the flag capability `ms' ("can move in +standout"). All programs that might have occasion to move the cursor +while appearance modes are turned on must check for this flag; if it is +not present, they should reset appearance modes to normal before doing +cursor motion. + + A program that has turned on only standout mode should use `se' to +reset the standout mode to normal. A program that has turned on only +alternate character set mode should use `ae' to return it to normal. +If it is possible that any other appearance modes are turned on, use the +`me' capability to return them to normal. + + Note that the commands to turn on one appearance mode, including `so' +and `mb' ... `mr', if used while some other appearance modes are turned +on, may combine the two modes on some terminals but may turn off the +mode previously enabled on other terminals. This is because some +terminals do not have a command to set or clear one appearance mode +without changing the others. Programs should not attempt to use +appearance modes in combination except with `sa', and when switching +from one single mode to another should always turn off the previously +enabled mode and then turn on the new desired mode. + + On some old terminals, the `so' and `se' commands may be the same +command, which has the effect of turning standout on if it is off, or +off it is on. It is therefore risky for a program to output extra `se' +commands for good measure. Fortunately, all these terminals are +obsolete. + + Programs that update displays in which standout-text may be replaced +with non-standout text must check for the `xs' flag. In a per-character +terminal, this flag says that the only way to remove standout once +written is to clear that portion of the line with the `ce' string or +something even more powerful (*note Clearing::.); just writing new +characters at those screen positions will not change the modes in +effect there. In a magic cookie terminal, `xs' says that the only way +to remove a cookie is to clear a portion of the line that includes the +cookie; writing a different cookie at the same position does not work. + + Such programs must also check for the `xt' flag, which means that the +terminal is a Teleray 1061. On this terminal it is impossible to +position the cursor at the front of a magic cookie, so the only two +ways to remove a cookie are (1) to delete the line it is on or (2) to +position the cursor at least one character before it (possibly on a +previous line) and output the `se' string, which on these terminals +finds and removes the next `so' magic cookie on the screen. (It may +also be possible to remove a cookie which is not at the beginning of a +line by clearing that line.) The `xt' capability also has implications +for the use of tab characters, but in that regard it is obsolete (*note +Cursor Motion::.). + +`so' + String of commands to enter standout mode. + +`se' + String of commands to leave standout mode. + +`sg' + Numeric capability, the width on the screen of the magic cookie. + This capability is absent in terminals that record appearance modes + character by character. + +`ms' + Flag whose presence means that it is safe to move the cursor while + the appearance modes are not in the normal state. If this flag is + absent, programs should always reset the appearance modes to + normal before moving the cursor. + +`xs' + Flag whose presence means that the only way to reset appearance + modes already on the screen is to clear to end of line. On a + per-character terminal, you must clear the area where the modes + are set. On a magic cookie terminal, you must clear an area + containing the cookie. See the discussion above. + +`xt' + Flag whose presence means that the cursor cannot be positioned + right in front of a magic cookie, and that `se' is a command to + delete the next magic cookie following the cursor. See discussion + above. + +`mb' + String of commands to enter blinking mode. + +`md' + String of commands to enter double-bright mode. + +`mh' + String of commands to enter half-bright mode. + +`mk' + String of commands to enter invisible mode. + +`mp' + String of commands to enter protected mode. + +`mr' + String of commands to enter reverse-video mode. + +`me' + String of commands to turn off all appearance modes, including + standout mode and underline mode. On some terminals it also turns + off alternate character set mode; on others, it may not. This + capability must be present if any of `mb' ... `mr' is present. + +`as' + String of commands to turn on alternate character set mode. This + mode assigns some or all graphic characters an alternate picture + on the screen. There is no standard as to what the alternate + pictures look like. + +`ae' + String of commands to turn off alternate character set mode. + +`sa' + String of commands to turn on an arbitrary combination of + appearance modes. It accepts 9 parameters, each of which controls + a particular kind of appearance mode. A parameter should be 1 to + turn its appearance mode on, or zero to turn that mode off. Most + terminals do not support the `sa' capability, even among those + that do have various appearance modes. + + The nine parameters are, in order, STANDOUT, UNDERLINE, REVERSE, + BLINK, HALF-BRIGHT, DOUBLE-BRIGHT, BLANK, PROTECT, ALT CHAR SET. + + +File: termcap.info, Node: Underlining, Next: Cursor Visibility, Prev: Standout, Up: Capabilities + +Underlining +=========== + + Underlining on most terminals is a kind of appearance mode, much like +standout mode. Therefore, it may be implemented using magic cookies or +as a flag in the terminal whose current state affects each character +that is output. *Note Standout::, for a full explanation. + + The `ug' capability is a numeric capability whose presence indicates +that the terminal uses magic cookies for underlining. Its value is the +number of character positions that a magic cookie for underlining +occupies; it is used for underlining just as `sg' is used for standout. +Aside from the simplest applications, it is impossible to use +underlining correctly without paying attention to the value of `ug'. + +`us' + String of commands to turn on underline mode or to output a magic + cookie to start underlining. + +`ue' + String of commands to turn off underline mode or to output a magic + cookie to stop underlining. + +`ug' + Width of magic cookie that represents a change of underline mode; + or missing, if the terminal does not use a magic cookie for this. + +`ms' + Flag whose presence means that it is safe to move the cursor while + the appearance modes are not in the normal state. Underlining is + an appearance mode. If this flag is absent, programs should + always turn off underlining before moving the cursor. + + There are two other, older ways of doing underlining: there can be a +command to underline a single character, or the output of `_', the +ASCII underscore character, as an overstrike could cause a character to +be underlined. New programs need not bother to handle these +capabilities unless the author cares strongly about the obscure +terminals which support them. However, terminal descriptions should +provide these capabilities when appropriate. + +`uc' + String of commands to underline the character under the cursor, and + move the cursor right. + +`ul' + Flag whose presence means that the terminal can underline by + overstriking an underscore character (`_'); some terminals can do + this even though they do not support overstriking in general. An + implication of this flag is that when outputting new text to + overwrite old text, underscore characters must be treated + specially lest they underline the old text instead. + + +File: termcap.info, Node: Cursor Visibility, Next: Bell, Prev: Underlining, Up: Capabilities + +Cursor Visibility +================= + + Some terminals have the ability to make the cursor invisible, or to +enhance it. Enhancing the cursor is often done by programs that plan +to use the cursor to indicate to the user a position of interest that +may be anywhere on the screen--for example, the Emacs editor enhances +the cursor on entry. Such programs should always restore the cursor to +normal on exit. + +`vs' + String of commands to enhance the cursor. + +`vi' + String of commands to make the cursor invisible. + +`ve' + String of commands to return the cursor to normal. + + If you define either `vs' or `vi', you must also define `ve'. + + +File: termcap.info, Node: Bell, Next: Keypad, Prev: Cursor Visibility, Up: Capabilities + +Bell +==== + + Here we describe commands to make the terminal ask for the user to +pay attention to it. + +`bl' + String of commands to cause the terminal to make an audible sound. + If this capability is absent, the terminal has no way to make a + suitable sound. + +`vb' + String of commands to cause the screen to flash to attract + attention ("visible bell"). If this capability is absent, the + terminal has no way to do such a thing. + + +File: termcap.info, Node: Keypad, Next: Meta Key, Prev: Bell, Up: Capabilities + +Keypad and Function Keys +======================== + + Many terminals have arrow and function keys that transmit specific +character sequences to the computer. Since the precise sequences used +depend on the terminal, termcap defines capabilities used to say what +the sequences are. Unlike most termcap string-valued capabilities, +these are not strings of commands to be sent to the terminal, rather +strings that are received from the terminal. + + Programs that expect to use keypad keys should check, initially, for +a `ks' capability and send it, to make the keypad actually transmit. +Such programs should also send the `ke' string when exiting. + +`ks' + String of commands to make the function keys transmit. If this + capability is not provided, but the others in this section are, + programs may assume that the function keys always transmit. + +`ke' + String of commands to make the function keys work locally. This + capability is provided only if `ks' is. + +`kl' + String of input characters sent by typing the left-arrow key. If + this capability is missing, you cannot expect the terminal to have + a left-arrow key that transmits anything to the computer. + +`kr' + String of input characters sent by typing the right-arrow key. + +`ku' + String of input characters sent by typing the up-arrow key. + +`kd' + String of input characters sent by typing the down-arrow key. + +`kh' + String of input characters sent by typing the "home-position" key. + +`K1' ... `K5' + Strings of input characters sent by the five other keys in a 3-by-3 + array that includes the arrow keys, if the keyboard has such a + 3-by-3 array. Note that one of these keys may be the + "home-position" key, in which case one of these capabilities will + have the same value as the `kh' key. + +`k0' + String of input characters sent by function key 10 (or 0, if the + terminal has one labeled 0). + +`k1' ... `k9' + Strings of input characters sent by function keys 1 through 9, + provided for those function keys that exist. + +`kn' + Number: the number of numbered function keys, if there are more + than 10. + +`l0' ... `l9' + Strings which are the labels appearing on the keyboard on the keys + described by the capabilities `k0' ... `l9'. These capabilities + should be left undefined if the labels are `f0' or `f10' and `f1' + ... `f9'. + +`kH' + String of input characters sent by the "home down" key, if there is + one. + +`kb' + String of input characters sent by the "backspace" key, if there is + one. + +`ka' + String of input characters sent by the "clear all tabs" key, if + there is one. + +`kt' + String of input characters sent by the "clear tab stop this column" + key, if there is one. + +`kC' + String of input characters sent by the "clear screen" key, if + there is one. + +`kD' + String of input characters sent by the "delete character" key, if + there is one. + +`kL' + String of input characters sent by the "delete line" key, if there + is one. + +`kM' + String of input characters sent by the "exit insert mode" key, if + there is one. + +`kE' + String of input characters sent by the "clear to end of line" key, + if there is one. + +`kS' + String of input characters sent by the "clear to end of screen" + key, if there is one. + +`kI' + String of input characters sent by the "insert character" or "enter + insert mode" key, if there is one. + +`kA' + String of input characters sent by the "insert line" key, if there + is one. + +`kN' + String of input characters sent by the "next page" key, if there is + one. + +`kP' + String of input characters sent by the "previous page" key, if + there is one. + +`kF' + String of input characters sent by the "scroll forward" key, if + there is one. + +`kR' + String of input characters sent by the "scroll reverse" key, if + there is one. + +`kT' + String of input characters sent by the "set tab stop in this + column" key, if there is one. + +`ko' + String listing the other function keys the terminal has. This is a + very obsolete way of describing the same information found in the + `kH' ... `kT' keys. The string contains a list of two-character + termcap capability names, separated by commas. The meaning is + that for each capability name listed, the terminal has a key which + sends the string which is the value of that capability. For + example, the value `:ko=cl,ll,sf,sr:' says that the terminal has + four function keys which mean "clear screen", "home down", "scroll + forward" and "scroll reverse". + + +File: termcap.info, Node: Meta Key, Next: Initialization, Prev: Keypad, Up: Capabilities + +Meta Key +======== + + A Meta key is a key on the keyboard that modifies each character you +type by controlling the 0200 bit. This bit is on if and only if the +Meta key is held down when the character is typed. Characters typed +using the Meta key are called Meta characters. Emacs uses Meta +characters as editing commands. + +`km' + Flag whose presence means that the terminal has a Meta key. + +`mm' + String of commands to enable the functioning of the Meta key. + +`mo' + String of commands to disable the functioning of the Meta key. + + If the terminal has `km' but does not have `mm' and `mo', it means +that the Meta key always functions. If it has `mm' and `mo', it means +that the Meta key can be turned on or off. Send the `mm' string to +turn it on, and the `mo' string to turn it off. I do not know why one +would ever not want it to be on. + + +File: termcap.info, Node: Initialization, Next: Pad Specs, Prev: Meta Key, Up: Capabilities + +Initialization +============== + +`ti' + String of commands to put the terminal into whatever special modes + are needed or appropriate for programs that move the cursor + nonsequentially around the screen. Programs that use termcap to do + full-screen display should output this string when they start up. + +`te' + String of commands to undo what is done by the `ti' string. + Programs that output the `ti' string on entry should output this + string when they exit. + +`is' + String of commands to initialize the terminal for each login + session. + +`if' + String which is the name of a file containing the string of + commands to initialize the terminal for each session of use. + Normally `is' and `if' are not both used. + +`i1' +`i3' + Two more strings of commands to initialize the terminal for each + login session. The `i1' string (if defined) is output before `is' + or `if', and the `i3' string (if defined) is output after. + + The reason for having three separate initialization strings is to + make it easier to define a group of related terminal types with + slightly different initializations. Define two or three of the + strings in the basic type; then the other types can override one + or two of the strings. + +`rs' + String of commands to reset the terminal from any strange mode it + may be in. Normally this includes the `is' string (or other + commands with the same effects) and more. What would go in the + `rs' string but not in the `is' string are annoying or slow + commands to bring the terminal back from strange modes that nobody + would normally use. + +`it' + Numeric value, the initial spacing between hardware tab stop + columns when the terminal is powered up. Programs to initialize + the terminal can use this to decide whether there is a need to set + the tab stops. If the initial width is 8, well and good; if it is + not 8, then the tab stops should be set; if they cannot be set, + the kernel is told to convert tabs to spaces, and other programs + will observe this and do likewise. + +`ct' + String of commands to clear all tab stops. + +`st' + String of commands to set tab stop at current cursor column on all + lines. + + +File: termcap.info, Node: Pad Specs, Next: Status Line, Prev: Initialization, Up: Capabilities + +Padding Capabilities +==================== + + There are two terminal capabilities that exist just to explain the +proper way to obey the padding specifications in all the command string +capabilities. One, `pc', must be obeyed by all termcap-using programs. + +`pb' + Numeric value, the lowest baud rate at which padding is actually + needed. Programs may check this and refrain from doing any + padding at lower speeds. + +`pc' + String of commands for padding. The first character of this + string is to be used as the pad character, instead of using null + characters for padding. If `pc' is not provided, use null + characters. Every program that uses termcap must look up this + capability and use it to set the variable `PC' that is used by + `tputs'. *Note Padding::. + + Some termcap capabilities exist just to specify the amount of +padding that the kernel should give to cursor motion commands used in +ordinary sequential output. + +`dC' + Numeric value, the number of msec of padding needed for the + carriage-return character. + +`dN' + Numeric value, the number of msec of padding needed for the newline + (linefeed) character. + +`dB' + Numeric value, the number of msec of padding needed for the + backspace character. + +`dF' + Numeric value, the number of msec of padding needed for the + formfeed character. + +`dT' + Numeric value, the number of msec of padding needed for the tab + character. + + In some systems, the kernel uses the above capabilities; in other +systems, the kernel uses the paddings specified in the string +capabilities `cr', `sf', `le', `ff' and `ta'. Descriptions of +terminals which require such padding should contain the `dC' ... `dT' +capabilities and also specify the appropriate padding in the +corresponding string capabilities. Since no modern terminals require +padding for ordinary sequential output, you probably won't need to do +either of these things. + + +File: termcap.info, Node: Status Line, Next: Half-Line, Prev: Pad Specs, Up: Capabilities + +Status Line +=========== + + A "status line" is a line on the terminal that is not used for +ordinary display output but instead used for a special message. The +intended use is for a continuously updated description of what the +user's program is doing, and that is where the name "status line" comes +from, but in fact it could be used for anything. The distinguishing +characteristic of a status line is that ordinary output to the terminal +does not affect it; it changes only if the special status line commands +of this section are used. + +`hs' + Flag whose presence means that the terminal has a status line. If + a terminal description specifies that there is a status line, it + must provide the `ts' and `fs' capabilities. + +`ts' + String of commands to move the terminal cursor into the status + line. Usually these commands must specifically record the old + cursor position for the sake of the `fs' string. + +`fs' + String of commands to move the cursor back from the status line to + its previous position (outside the status line). + +`es' + Flag whose presence means that other display commands work while + writing the status line. In other words, one can clear parts of + it, insert or delete characters, move the cursor within it using + `ch' if there is a `ch' capability, enter and leave standout mode, + and so on. + +`ds' + String of commands to disable the display of the status line. This + may be absent, if there is no way to disable the status line + display. + +`ws' + Numeric value, the width of the status line. If this capability is + absent in a terminal that has a status line, it means the status + line is the same width as the other lines. + + Note that the value of `ws' is sometimes as small as 8. + + +File: termcap.info, Node: Half-Line, Next: Printer, Prev: Status Line, Up: Capabilities + +Half-Line Motion +================ + + Some terminals have commands for moving the cursor vertically by +half-lines, useful for outputting subscripts and superscripts. Mostly +it is hardcopy terminals that have such features. + +`hu' + String of commands to move the cursor up half a line. If the + terminal is a display, it is your responsibility to avoid moving + up past the top line; however, most likely the terminal that + supports this is a hardcopy terminal and there is nothing to be + concerned about. + +`hd' + String of commands to move the cursor down half a line. If the + terminal is a display, it is your responsibility to avoid moving + down past the bottom line, etc. + + +File: termcap.info, Node: Printer, Prev: Half-Line, Up: Capabilities + +Controlling Printers Attached to Terminals +========================================== + + Some terminals have attached hardcopy printer ports. They may be +able to copy the screen contents to the printer; they may also be able +to redirect output to the printer. Termcap does not have anything to +tell the program whether the redirected output appears also on the +screen; it does on some terminals but not all. + +`ps' + String of commands to cause the contents of the screen to be + printed. If it is absent, the screen contents cannot be printed. + +`po' + String of commands to redirect further output to the printer. + +`pf' + String of commands to terminate redirection of output to the + printer. This capability must be present in the description if + `po' is. + +`pO' + String of commands to redirect output to the printer for next N + characters of output, regardless of what they are. Redirection + will end automatically after N characters of further output. Until + then, nothing that is output can end redirection, not even the + `pf' string if there is one. The number N should not be more than + 255. + + One use of this capability is to send non-text byte sequences + (such as bit-maps) to the printer. + + Most terminals with printers do not support all of `ps', `po' and +`pO'; any one or two of them may be supported. To make a program that +can send output to all kinds of printers, it is necessary to check for +all three of these capabilities, choose the most convenient of the ones +that are provided, and use it in its own appropriate fashion. + + +File: termcap.info, Node: Summary, Next: Var Index, Prev: Capabilities, Up: Top + +Summary of Capability Names +*************************** + + Here are all the terminal capability names in alphabetical order +with a brief description of each. For cross references to their +definitions, see the index of capability names (*note Cap Index::.). + +`ae' + String to turn off alternate character set mode. + +`al' + String to insert a blank line before the cursor. + +`AL' + String to insert N blank lines before the cursor. + +`am' + Flag: output to last column wraps cursor to next line. + +`as' + String to turn on alternate character set mode.like. + +`bc' + Very obsolete alternative name for the `le' capability. + +`bl' + String to sound the bell. + +`bs' + Obsolete flag: ASCII backspace may be used for leftward motion. + +`bt' + String to move the cursor left to the previous hardware tab stop + column. + +`bw' + Flag: `le' at left margin wraps to end of previous line. + +`CC' + String to change terminal's command character. + +`cd' + String to clear the line the cursor is on, and following lines. + +`ce' + String to clear from the cursor to the end of the line. + +`ch' + String to position the cursor at column C in the same line. + +`cl' + String to clear the entire screen and put cursor at upper left + corner. + +`cm' + String to position the cursor at line L, column C. + +`CM' + String to position the cursor at line L, column C, relative to + display memory. + +`co' + Number: width of the screen. + +`cr' + String to move cursor sideways to left margin. + +`cs' + String to set the scroll region. + +`cS' + Alternate form of string to set the scroll region. + +`ct' + String to clear all tab stops. + +`cv' + String to position the cursor at line L in the same column. + +`da' + Flag: data scrolled off top of screen may be scrolled back. + +`db' + Flag: data scrolled off bottom of screen may be scrolled back. + +`dB' + Obsolete number: msec of padding needed for the backspace + character. + +`dc' + String to delete one character position at the cursor. + +`dC' + Obsolete number: msec of padding needed for the carriage-return + character. + +`DC' + String to delete N characters starting at the cursor. + +`dF' + Obsolete number: msec of padding needed for the formfeed character. + +`dl' + String to delete the line the cursor is on. + +`DL' + String to delete N lines starting with the cursor's line. + +`dm' + String to enter delete mode. + +`dN' + Obsolete number: msec of padding needed for the newline character. + +`do' + String to move the cursor vertically down one line. + +`DO' + String to move cursor vertically down N lines. + +`ds' + String to disable the display of the status line. + +`dT' + Obsolete number: msec of padding needed for the tab character. + +`ec' + String of commands to clear N characters at cursor. + +`ed' + String to exit delete mode. + +`ei' + String to leave insert mode. + +`eo' + Flag: output of a space can erase an overstrike. + +`es' + Flag: other display commands work while writing the status line. + +`ff' + String to advance to the next page, for a hardcopy terminal. + +`fs' + String to move the cursor back from the status line to its + previous position (outside the status line). + +`gn' + Flag: this terminal type is generic, not real. + +`hc' + Flag: hardcopy terminal. + +`hd' + String to move the cursor down half a line. + +`ho' + String to position cursor at upper left corner. + +`hs' + Flag: the terminal has a status line. + +`hu' + String to move the cursor up half a line. + +`hz' + Flag: terminal cannot accept `~' as output. + +`i1' + String to initialize the terminal for each login session. + +`i3' + String to initialize the terminal for each login session. + +`ic' + String to insert one character position at the cursor. + +`IC' + String to insert N character positions at the cursor. + +`if' + String naming a file of commands to initialize the terminal. + +`im' + String to enter insert mode. + +`in' + Flag: outputting a space is different from moving over empty + positions. + +`ip' + String to output following an inserted character in insert mode. + +`is' + String to initialize the terminal for each login session. + +`it' + Number: initial spacing between hardware tab stop columns. + +`k0' + String of input sent by function key 0 or 10. + +`k1 ... k9' + Strings of input sent by function keys 1 through 9. + +`K1 ... K5' + Strings sent by the five other keys in 3-by-3 array with arrows. + +`ka' + String of input sent by the "clear all tabs" key. + +`kA' + String of input sent by the "insert line" key. + +`kb' + String of input sent by the "backspace" key. + +`kC' + String of input sent by the "clear screen" key. + +`kd' + String of input sent by typing the down-arrow key. + +`kD' + String of input sent by the "delete character" key. + +`ke' + String to make the function keys work locally. + +`kE' + String of input sent by the "clear to end of line" key. + +`kF' + String of input sent by the "scroll forward" key. + +`kh' + String of input sent by typing the "home-position" key. + +`kH' + String of input sent by the "home down" key. + +`kI' + String of input sent by the "insert character" or "enter insert + mode" key. + +`kl' + String of input sent by typing the left-arrow key. + +`kL' + String of input sent by the "delete line" key. + +`km' + Flag: the terminal has a Meta key. + +`kM' + String of input sent by the "exit insert mode" key. + +`kn' + Numeric value, the number of numbered function keys. + +`kN' + String of input sent by the "next page" key. + +`ko' + Very obsolete string listing the terminal's named function keys. + +`kP' + String of input sent by the "previous page" key. + +`kr' + String of input sent by typing the right-arrow key. + +`kR' + String of input sent by the "scroll reverse" key. + +`ks' + String to make the function keys transmit. + +`kS' + String of input sent by the "clear to end of screen" key. + +`kt' + String of input sent by the "clear tab stop this column" key. + +`kT' + String of input sent by the "set tab stop in this column" key. + +`ku' + String of input sent by typing the up-arrow key. + +`l0' + String on keyboard labelling function key 0 or 10. + +`l1 ... l9' + Strings on keyboard labelling function keys 1 through 9. + +`le' + String to move the cursor left one column. + +`LE' + String to move cursor left N columns. + +`li' + Number: height of the screen. + +`ll' + String to position cursor at lower left corner. + +`lm' + Number: lines of display memory. + +`mb' + String to enter blinking mode. + +`md' + String to enter double-bright mode. + +`me' + String to turn off all appearance modes + +`mh' + String to enter half-bright mode. + +`mi' + Flag: cursor motion in insert mode is safe. + +`mk' + String to enter invisible mode. + +`mm' + String to enable the functioning of the Meta key. + +`mo' + String to disable the functioning of the Meta key. + +`mp' + String to enter protected mode. + +`mr' + String to enter reverse-video mode. + +`ms' + Flag: cursor motion in standout mode is safe. + +`nc' + Obsolete flag: do not use ASCII carriage-return on this terminal. + +`nd' + String to move the cursor right one column. + +`nl' + Obsolete alternative name for the `do' and `sf' capabilities. + +`ns' + Flag: the terminal does not normally scroll for sequential output. + +`nw' + String to move to start of next line, possibly clearing rest of + old line. + +`os' + Flag: terminal can overstrike. + +`pb' + Number: the lowest baud rate at which padding is actually needed. + +`pc' + String containing character for padding. + +`pf' + String to terminate redirection of output to the printer. + +`po' + String to redirect further output to the printer. + +`pO' + String to redirect N characters ofoutput to the printer. + +`ps' + String to print the screen on the attached printer. + +`rc' + String to move to last saved cursor position. + +`RI' + String to move cursor right N columns. + +`rp' + String to output character C repeated N times. + +`rs' + String to reset the terminal from any strange modes. + +`sa' + String to turn on an arbitrary combination of appearance modes. + +`sc' + String to save the current cursor position. + +`se' + String to leave standout mode. + +`sf' + String to scroll the screen one line up. + +`SF' + String to scroll the screen N lines up. + +`sg' + Number: width of magic standout cookie. Absent if magic cookies + are not used. + +`so' + String to enter standout mode. + +`sr' + String to scroll the screen one line down. + +`SR' + String to scroll the screen N line down. + +`st' + String to set tab stop at current cursor column on all lines. + programs. + +`ta' + String to move the cursor right to the next hardware tab stop + column. + +`te' + String to return terminal to settings for sequential output. + +`ti' + String to initialize terminal for random cursor motion. + +`ts' + String to move the terminal cursor into the status line. + +`uc' + String to underline one character and move cursor right. + +`ue' + String to turn off underline mode + +`ug' + Number: width of underlining magic cookie. Absent if underlining + doesn't use magic cookies. + +`ul' + Flag: underline by overstriking with an underscore. + +`up' + String to move the cursor vertically up one line. + +`UP' + String to move cursor vertically up N lines. + +`us' + String to turn on underline mode + +`vb' + String to make the screen flash. + +`ve' + String to return the cursor to normal. + +`vi' + String to make the cursor invisible. + +`vs' + String to enhance the cursor. + +`wi' + String to set the terminal output screen window. + +`ws' + Number: the width of the status line. + +`xb' + Flag: superbee terminal. + +`xn' + Flag: cursor wraps in a strange way. + +`xs' + Flag: clearing a line is the only way to clear the appearance + modes of positions in that line (or, only way to remove magic + cookies on that line). + +`xt' + Flag: Teleray 1061; several strange characteristics. + + +File: termcap.info, Node: Var Index, Next: Cap Index, Prev: Summary, Up: Top + +Variable and Function Index +*************************** + +* Menu: + +* BC: tgoto. +* ospeed: Output Padding. +* PC: Output Padding. +* tgetent: Find. +* tgetflag: Interrogate. +* tgetnum: Interrogate. +* tgetstr: Interrogate. +* tgoto: tgoto. +* tparam: tparam. +* tputs: Output Padding. +* UP: tgoto. + + +File: termcap.info, Node: Cap Index, Next: Index, Prev: Var Index, Up: Top + +Capability Index +**************** + +* Menu: + +* ae: Standout. +* AL: Insdel Line. +* al: Insdel Line. +* am: Wrapping. +* as: Standout. +* bc: Cursor Motion. +* bl: Bell. +* bs: Cursor Motion. +* bt: Cursor Motion. +* bw: Cursor Motion. +* CC: Basic. +* cd: Clearing. +* ce: Clearing. +* ch: Cursor Motion. +* cl: Clearing. +* cm: Cursor Motion. +* CM: Cursor Motion. +* co: Screen Size. +* cr: Cursor Motion. +* cS: Scrolling. +* cs: Scrolling. +* ct: Initialization. +* cv: Cursor Motion. +* da: Scrolling. +* dB: Pad Specs. +* db: Scrolling. +* dC: Pad Specs. +* DC: Insdel Char. +* dc: Insdel Char. +* dF: Pad Specs. +* DL: Insdel Line. +* dl: Insdel Line. +* dm: Insdel Char. +* dN: Pad Specs. +* DO: Cursor Motion. +* do: Cursor Motion. +* ds: Status Line. +* dT: Pad Specs. +* ec: Clearing. +* ed: Insdel Char. +* ei: Insdel Char. +* eo: Basic. +* es: Status Line. +* ff: Cursor Motion. +* fs: Status Line. +* gn: Basic. +* hc: Basic. +* hd: Half-Line. +* ho: Cursor Motion. +* hs: Status Line. +* hu: Half-Line. +* hz: Basic. +* i1: Initialization. +* i3: Initialization. +* IC: Insdel Char. +* ic: Insdel Char. +* if: Initialization. +* im: Insdel Char. +* in: Insdel Char. +* ip: Insdel Char. +* is: Initialization. +* it: Initialization. +* K1...K5: Keypad. +* k1...k9: Keypad. +* kA...kT: Keypad. +* ka...ku: Keypad. +* km: Meta Key. +* l0...l9: Keypad. +* le: Cursor Motion. +* LE: Cursor Motion. +* li: Screen Size. +* ll: Cursor Motion. +* lm: Scrolling. +* mb: Standout. +* md: Standout. +* me: Standout. +* mh: Standout. +* mi: Insdel Char. +* mk: Standout. +* mm: Meta Key. +* mo: Meta Key. +* mp: Standout. +* mr: Standout. +* ms <1>: Standout. +* ms: Underlining. +* nc: Cursor Motion. +* nd: Cursor Motion. +* nl: Cursor Motion. +* ns: Scrolling. +* nw: Cursor Motion. +* os: Basic. +* pb: Pad Specs. +* pc: Pad Specs. +* pf: Printer. +* pO: Printer. +* po: Printer. +* ps: Printer. +* rc: Cursor Motion. +* RI: Cursor Motion. +* rp: Basic. +* rs: Initialization. +* sa: Standout. +* sc: Cursor Motion. +* se: Standout. +* sf: Scrolling. +* SF: Scrolling. +* sg: Standout. +* so: Standout. +* sr: Scrolling. +* SR: Scrolling. +* st: Initialization. +* ta: Cursor Motion. +* te: Initialization. +* ti: Initialization. +* ts: Status Line. +* uc: Underlining. +* ue: Underlining. +* ug: Underlining. +* ul: Underlining. +* up: Cursor Motion. +* UP: Cursor Motion. +* us: Underlining. +* vb: Bell. +* ve: Cursor Visibility. +* vi: Cursor Visibility. +* vs: Cursor Visibility. +* wi: Windows. +* ws: Status Line. +* xb: Basic. +* xn: Wrapping. +* xs: Standout. +* xt <1>: Cursor Motion. +* xt: Standout. + + +File: termcap.info, Node: Index, Prev: Cap Index, Up: Top + +Concept Index +************* + +* Menu: + +* %: Encode Parameters. +* appearance modes: Standout. +* bell: Bell. +* clearing the screen: Clearing. +* command character: Basic. +* cursor motion: Cursor Motion. +* delete character: Insdel Char. +* delete line: Insdel Line. +* delete mode: Insdel Char. +* description format: Format. +* erasing: Clearing. +* generic terminal type: Basic. +* home position: Cursor Motion. +* inheritance: Inheriting. +* initialization: Initialization. +* insert character: Insdel Char. +* insert line: Insdel Line. +* insert mode: Insdel Char. +* line speed: Output Padding. +* magic cookie: Standout. +* meta key: Meta Key. +* names of terminal types: Naming. +* overstrike: Basic. +* padding <1>: Padding. +* padding: Pad Specs. +* parameters: Parameters. +* printer: Printer. +* repeat output: Basic. +* reset: Initialization. +* screen size <1>: Screen Size. +* screen size: Naming. +* scrolling: Scrolling. +* standout: Standout. +* status line: Status Line. +* Superbee: Basic. +* tab stops: Initialization. +* termcap: Introduction. +* terminal flags (kernel): Initialize. +* underlining: Underlining. +* visibility: Cursor Visibility. +* visible bell: Bell. +* window: Windows. +* wrapping <1>: Naming. +* wrapping: Wrapping. + + diff --git a/info/texinfo.info b/info/texinfo.info index 1f73e7f..2986f92 100644 --- a/info/texinfo.info +++ b/info/texinfo.info @@ -1,5 +1,5 @@ -This is ../info/texinfo.info, produced by makeinfo version 4.0 from -texinfo.texi. +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. INFO-DIR-SECTION Texinfo documentation system START-INFO-DIR-ENTRY @@ -34,317 +34,306 @@ translation approved by the Free Software Foundation.  Indirect: -texinfo.info-1: 1484 -texinfo.info-2: 48707 -texinfo.info-3: 96681 -texinfo.info-4: 146073 -texinfo.info-5: 196055 -texinfo.info-6: 245147 -texinfo.info-7: 293746 -texinfo.info-8: 343561 -texinfo.info-9: 392874 -texinfo.info-10: 435252 -texinfo.info-11: 481368 -texinfo.info-12: 519528 +texinfo.info-1: 1510 +texinfo.info-2: 48723 +texinfo.info-3: 96698 +texinfo.info-4: 146082 +texinfo.info-5: 196057 +texinfo.info-6: 245140 +texinfo.info-7: 294058 +texinfo.info-8: 343872 +texinfo.info-9: 393199 +texinfo.info-10: 435577 +texinfo.info-11: 481692 +texinfo.info-12: 519851  Tag Table: (Indirect) -Node: Top1484 -Node: Copying23799 -Node: Overview25804 -Node: Overview-Footnotes27233 -Ref: Overview-Footnote-127297 -Node: Using Texinfo27769 -Node: Info Files30256 -Node: Info Files-Footnotes34292 -Ref: Info Files-Footnote-134360 -Node: Printed Books34539 -Node: Printed Books-Footnotes37211 -Ref: Printed Books-Footnote-137285 -Node: Formatting Commands37495 -Node: Formatting Commands-Footnotes40322 -Ref: Formatting Commands-Footnote-140408 -Node: Conventions41024 -Node: Comments43586 -Node: Minimum45009 -Node: Six Parts47195 -Node: Short Sample48707 -Node: Acknowledgements52843 -Node: Texinfo Mode53678 -Node: Texinfo Mode Overview55050 -Node: Emacs Editing55826 -Node: Inserting57956 -Node: Showing the Structure62237 -Node: Updating Nodes and Menus64764 -Node: Updating Commands65837 -Node: Updating Requirements71898 -Node: Other Updating Commands74195 -Node: Info Formatting77463 -Node: Printing78721 -Node: Texinfo Mode Summary81066 -Node: Beginning a File85820 -Node: Four Parts86711 -Node: Sample Beginning88181 -Node: Header89801 -Node: First Line91153 -Node: Start of Header92142 -Node: setfilename92855 -Node: settitle94791 -Node: setchapternewpage96681 -Node: paragraphindent99442 -Node: End of Header100924 -Node: Info Summary and Permissions101763 -Node: Titlepage & Copyright Page102782 -Node: titlepage104388 -Node: titlepage-Footnotes106670 -Ref: titlepage-Footnote-1106736 -Node: titlefont center sp107010 -Node: title subtitle author108236 -Node: Copyright & Permissions110508 -Node: end titlepage112509 -Node: headings on off114215 -Node: The Top Node116260 -Node: Title of Top Node117415 -Node: Master Menu Parts118668 -Node: Software Copying Permissions120905 -Node: Ending a File122073 -Node: Printing Indices & Menus122921 -Node: Contents125230 -Node: File End127570 -Node: Structuring128243 -Node: Tree Structuring129900 -Node: Structuring Command Types131343 -Node: makeinfo top133670 -Node: chapter134203 -Node: unnumbered & appendix135227 -Node: majorheading & chapheading136066 -Node: section136887 -Node: unnumberedsec appendixsec heading137651 -Node: subsection138640 -Node: unnumberedsubsec appendixsubsec subheading139212 -Node: subsubsection140165 -Node: Raise/lower sections141715 -Node: Nodes143850 -Node: Two Paths144787 -Node: Node Menu Illustration146073 -Node: node149768 -Node: Node Names152464 -Node: Writing a Node153540 -Node: Node Line Tips155558 -Node: Node Line Requirements156352 -Node: First Node157953 -Node: makeinfo top command159392 -Node: Top Node Summary160571 -Node: makeinfo Pointer Creation162021 -Node: Menus163268 -Node: Menus-Footnotes164207 -Ref: Menus-Footnote-1164265 -Node: Menu Location164558 -Node: Writing a Menu166235 -Node: Menu Parts167201 -Node: Less Cluttered Menu Entry168359 -Node: Menu Example168984 -Node: Other Info Files170505 -Node: Cross References172373 -Node: References173330 -Node: Cross Reference Commands175077 -Node: Cross Reference Parts176136 -Node: xref178972 -Node: Reference Syntax179771 -Node: One Argument181425 -Node: Two Arguments182437 -Node: Three Arguments183552 -Node: Four and Five Arguments185943 -Node: Top Node Naming188355 -Node: ref189365 -Node: pxref190757 -Node: inforef193139 -Node: uref194432 -Node: Marking Text195431 -Node: Indicating196055 -Node: Useful Highlighting197960 -Node: code199349 -Node: kbd202387 -Node: key204257 -Node: samp205590 -Node: var207177 -Node: file208970 -Node: dfn209577 -Node: cite210487 -Node: url210941 -Node: email211505 -Node: Emphasis212317 -Node: emph & strong213217 -Node: Smallcaps214203 -Node: Fonts215530 -Node: Customized Highlighting216618 -Node: Customized Highlighting-Footnotes219433 -Ref: Customized Highlighting-Footnote-1219527 -Node: Quotations and Examples219653 -Node: Block Enclosing Commands221275 -Node: quotation223300 -Node: example224390 -Node: noindent226445 -Node: Lisp Example227909 -Node: Lisp Example-Footnotes228611 -Ref: Lisp Example-Footnote-1228683 -Node: smallexample & smalllisp228801 -Node: display230826 -Node: format231458 -Node: exdent231919 -Node: flushleft & flushright232999 -Node: cartouche234265 -Node: Lists and Tables235032 -Node: Introducing Lists235708 -Node: itemize237373 -Node: enumerate239520 -Node: Two-column Tables242025 -Node: table242714 -Node: ftable vtable245147 -Node: itemx246248 -Node: Multi-column Tables247259 -Node: Multitable Column Widths247930 -Node: Multitable Rows249384 -Node: Indices251165 -Node: Index Entries252315 -Node: Predefined Indices253448 -Node: Indexing Commands254445 -Node: Combining Indices258985 -Node: syncodeindex260348 -Node: synindex262010 -Node: New Indices262535 -Node: Insertions264360 -Node: Braces Atsigns265544 -Node: Inserting An Atsign266096 -Node: Inserting Braces266370 -Node: Inserting Space266733 -Node: Not Ending a Sentence267237 -Node: Ending a Sentence268591 -Node: Multiple Spaces269720 -Node: dmn270939 -Node: Inserting Accents272146 -Node: Dots Bullets273903 -Node: dots274725 -Node: bullet275249 -Node: TeX and copyright275646 -Node: tex276213 -Node: copyright symbol276629 -Node: pounds276889 -Node: minus277253 -Node: math278175 -Node: Glyphs278903 -Node: Glyphs Summary280016 -Node: result280644 -Node: expansion281129 -Node: Print Glyph282085 -Node: Error Glyph282962 -Node: Equivalence283795 -Node: Point Glyph284483 -Node: Images286040 -Node: Breaks287707 -Node: Break Commands289138 -Node: Line Breaks289979 -Node: - and hyphenation290997 -Node: w292247 -Node: sp292960 -Node: page293369 -Node: group293746 -Node: need295489 -Node: Definition Commands296219 -Node: Def Cmd Template297790 -Node: Optional Arguments300787 -Node: deffnx302375 -Node: Def Cmds in Detail303330 -Node: Functions Commands304440 -Node: Variables Commands307445 -Node: Typed Functions309531 -Node: Typed Variables313073 -Node: Abstract Objects315056 -Node: Data Types320281 -Node: Def Cmd Conventions321536 -Node: Sample Function Definition322099 -Node: Footnotes324983 -Node: Footnotes-Footnotes325371 -Ref: Footnotes-Footnote-1325437 -Node: Footnote Commands325717 -Node: Footnote Commands-Footnotes327214 -Ref: Footnote Commands-Footnote-1327296 -Node: Footnote Styles327332 -Node: Conditionals329918 -Node: Conditional Commands330729 -Node: Conditional Not Commands332222 -Node: Raw Formatter Commands332967 -Node: set clear value334797 -Node: ifset ifclear335598 -Node: value338777 -Node: value Example340189 -Node: Macros341767 -Node: Defining Macros342472 -Node: Invoking Macros343561 -Node: Format/Print Hardcopy344667 -Node: Use TeX346504 -Node: Format with tex/texindex347132 -Node: Format with texi2dvi350773 -Node: Print with lpr351364 -Node: Within Emacs352218 -Node: Texinfo Mode Printing353137 -Node: Compile-Command356547 -Node: Requirements Summary357435 -Node: Preparing for TeX358748 -Node: Overfull hboxes361535 -Node: smallbook363094 -Node: A4 Paper364612 -Node: Cropmarks and Magnification365837 -Node: Create an Info File367778 -Node: makeinfo advantages369081 -Node: Invoking makeinfo369997 -Node: makeinfo options370685 -Node: Pointer Validation376169 -Node: makeinfo in Emacs377513 -Node: texinfo-format commands380071 -Node: Batch Formatting381342 -Node: Tag and Split Files382558 -Node: Install an Info File385912 -Node: Directory file386730 -Node: New Info File388598 -Node: Other Info Directories389659 -Node: Installing Dir Entries392874 -Node: Invoking install-info394867 -Node: Command List397282 -Node: Tips435252 -Node: Sample Texinfo File446662 -Node: Sample Permissions448781 -Node: Inserting Permissions449824 -Node: ifinfo Permissions452130 -Node: Titlepage Permissions453751 -Node: Include Files455013 -Node: Using Include Files456100 -Node: texinfo-multiple-files-update458055 -Node: Include File Requirements460416 -Node: Sample Include File461661 -Node: Include Files Evolution463180 -Node: Headings465151 -Node: Headings Introduced465788 -Node: Heading Format467676 -Node: Heading Choice470128 -Node: Custom Headings471500 -Node: Catching Mistakes475828 -Node: makeinfo Preferred477117 -Node: Debugging with Info478022 -Node: Debugging with TeX481368 -Node: Using texinfo-show-structure485648 -Node: Using occur488747 -Node: Running Info-Validate490284 -Node: Using Info-validate491345 -Node: Unsplit493187 -Node: Tagifying494233 -Node: Splitting495085 -Node: Refilling Paragraphs496701 -Node: Refilling Paragraphs-Footnotes498355 -Ref: Refilling Paragraphs-Footnote-1498443 -Node: Command Syntax498606 -Node: Obtaining TeX501563 -Node: Command and Variable Index503676 -Node: Concept Index519528 +Node: Top1510 +Node: Copying23823 +Node: Overview25828 +Node: Overview-Footnotes27256 +Node: Using Texinfo27792 +Node: Info Files30275 +Node: Info Files-Footnotes34310 +Node: Printed Books34557 +Node: Printed Books-Footnotes37228 +Node: Formatting Commands37512 +Node: Formatting Commands-Footnotes40338 +Node: Conventions41040 +Node: Comments43602 +Node: Minimum45025 +Node: Six Parts47211 +Node: Short Sample48723 +Node: Acknowledgements52858 +Node: Texinfo Mode53693 +Node: Texinfo Mode Overview55065 +Node: Emacs Editing55841 +Node: Inserting57971 +Node: Showing the Structure62252 +Node: Updating Nodes and Menus64779 +Node: Updating Commands65852 +Node: Updating Requirements71913 +Node: Other Updating Commands74210 +Node: Info Formatting77478 +Node: Printing78736 +Node: Texinfo Mode Summary81082 +Node: Beginning a File85836 +Node: Four Parts86727 +Node: Sample Beginning88197 +Node: Header89817 +Node: First Line91169 +Node: Start of Header92158 +Node: setfilename92872 +Node: settitle94808 +Node: setchapternewpage96698 +Node: paragraphindent99459 +Node: End of Header100941 +Node: Info Summary and Permissions101780 +Node: Titlepage & Copyright Page102799 +Node: titlepage104405 +Node: titlepage-Footnotes106686 +Node: titlefont center sp107026 +Node: title subtitle author108252 +Node: Copyright & Permissions110524 +Node: end titlepage112525 +Node: headings on off114231 +Node: The Top Node116276 +Node: Title of Top Node117431 +Node: Master Menu Parts118684 +Node: Software Copying Permissions120921 +Node: Ending a File122089 +Node: Printing Indices & Menus122937 +Node: Contents125239 +Node: File End127579 +Node: Structuring128252 +Node: Tree Structuring129910 +Node: Structuring Command Types131353 +Node: makeinfo top133679 +Node: chapter134212 +Node: unnumbered & appendix135236 +Node: majorheading & chapheading136075 +Node: section136896 +Node: unnumberedsec appendixsec heading137660 +Node: subsection138649 +Node: unnumberedsubsec appendixsubsec subheading139221 +Node: subsubsection140174 +Node: Raise/lower sections141724 +Node: Nodes143859 +Node: Two Paths144796 +Node: Node Menu Illustration146082 +Node: node149777 +Node: Node Names152473 +Node: Writing a Node153549 +Node: Node Line Tips155567 +Node: Node Line Requirements156361 +Node: First Node157962 +Node: makeinfo top command159408 +Node: Top Node Summary160587 +Node: makeinfo Pointer Creation162037 +Node: Menus163284 +Node: Menus-Footnotes164222 +Node: Menu Location164573 +Node: Writing a Menu166250 +Node: Menu Parts167216 +Node: Less Cluttered Menu Entry168374 +Node: Menu Example168999 +Node: Other Info Files170520 +Node: Cross References172376 +Node: References173333 +Node: Cross Reference Commands175080 +Node: Cross Reference Parts176139 +Node: xref178975 +Node: Reference Syntax179774 +Node: One Argument181429 +Node: Two Arguments182441 +Node: Three Arguments183556 +Node: Four and Five Arguments185947 +Node: Top Node Naming188359 +Node: ref189369 +Node: pxref190759 +Node: inforef193141 +Node: uref194434 +Node: Marking Text195433 +Node: Indicating196057 +Node: Useful Highlighting197962 +Node: code199351 +Node: kbd202389 +Node: key204259 +Node: samp205592 +Node: var207179 +Node: file208972 +Node: dfn209579 +Node: cite210489 +Node: url210943 +Node: email211507 +Node: Emphasis212319 +Node: emph & strong213219 +Node: Smallcaps214205 +Node: Fonts215532 +Node: Customized Highlighting216620 +Node: Customized Highlighting-Footnotes219434 +Node: Quotations and Examples219654 +Node: Block Enclosing Commands221276 +Node: quotation223301 +Node: example224391 +Node: noindent226446 +Node: Lisp Example227911 +Node: Lisp Example-Footnotes228612 +Node: smallexample & smalllisp228802 +Node: display230827 +Node: format231459 +Node: exdent231920 +Node: flushleft & flushright233000 +Node: cartouche234266 +Node: Lists and Tables235033 +Node: Introducing Lists235709 +Node: itemize237371 +Node: enumerate239518 +Node: Two-column Tables242017 +Node: table242706 +Node: ftable vtable245140 +Node: itemx246241 +Node: Multi-column Tables247252 +Node: Multitable Column Widths247923 +Node: Multitable Rows249377 +Node: Indices251250 +Node: Index Entries252401 +Node: Predefined Indices253534 +Node: Indexing Commands254531 +Node: Combining Indices259072 +Node: syncodeindex260435 +Node: synindex262097 +Node: New Indices262622 +Node: Insertions264448 +Node: Braces Atsigns265632 +Node: Inserting An Atsign266184 +Node: Inserting Braces266458 +Node: Inserting Space266821 +Node: Not Ending a Sentence267325 +Node: Ending a Sentence268679 +Node: Multiple Spaces269808 +Node: dmn271028 +Node: Inserting Accents272236 +Node: Dots Bullets274212 +Node: dots275035 +Node: bullet275559 +Node: TeX and copyright275956 +Node: tex276523 +Node: copyright symbol276939 +Node: pounds277199 +Node: minus277563 +Node: math278485 +Node: Glyphs279214 +Node: Glyphs Summary280327 +Node: result280955 +Node: expansion281440 +Node: Print Glyph282396 +Node: Error Glyph283273 +Node: Equivalence284106 +Node: Point Glyph284794 +Node: Images286351 +Node: Breaks288018 +Node: Break Commands289449 +Node: Line Breaks290290 +Node: - and hyphenation291308 +Node: w292559 +Node: sp293272 +Node: page293681 +Node: group294058 +Node: need295801 +Node: Definition Commands296531 +Node: Def Cmd Template298102 +Node: Optional Arguments301099 +Node: deffnx302687 +Node: Def Cmds in Detail303642 +Node: Functions Commands304752 +Node: Variables Commands307757 +Node: Typed Functions309843 +Node: Typed Variables313385 +Node: Abstract Objects315368 +Node: Data Types320593 +Node: Def Cmd Conventions321848 +Node: Sample Function Definition322411 +Node: Footnotes325295 +Node: Footnotes-Footnotes325682 +Node: Footnote Commands326028 +Node: Footnote Commands-Footnotes327524 +Node: Footnote Styles327642 +Node: Conditionals330228 +Node: Conditional Commands331039 +Node: Conditional Not Commands332532 +Node: Raw Formatter Commands333277 +Node: set clear value335107 +Node: ifset ifclear335908 +Node: value339087 +Node: value Example340499 +Node: Macros342077 +Node: Defining Macros342783 +Node: Invoking Macros343872 +Node: Format/Print Hardcopy344978 +Node: Use TeX346815 +Node: Format with tex/texindex347443 +Node: Format with texi2dvi351086 +Node: Print with lpr351677 +Node: Within Emacs352531 +Node: Texinfo Mode Printing353450 +Node: Compile-Command356860 +Node: Requirements Summary357748 +Node: Preparing for TeX359061 +Node: Overfull hboxes361850 +Node: smallbook363409 +Node: A4 Paper364929 +Node: Cropmarks and Magnification366155 +Node: Create an Info File368097 +Node: makeinfo advantages369400 +Node: Invoking makeinfo370316 +Node: makeinfo options371004 +Node: Pointer Validation376493 +Node: makeinfo in Emacs377837 +Node: texinfo-format commands380395 +Node: Batch Formatting381667 +Node: Tag and Split Files382883 +Node: Install an Info File386237 +Node: Directory file387055 +Node: New Info File388923 +Node: Other Info Directories389984 +Node: Installing Dir Entries393199 +Node: Invoking install-info395192 +Node: Command List397607 +Node: Tips435577 +Node: Sample Texinfo File446987 +Node: Sample Permissions449105 +Node: Inserting Permissions450148 +Node: ifinfo Permissions452454 +Node: Titlepage Permissions454075 +Node: Include Files455337 +Node: Using Include Files456424 +Node: texinfo-multiple-files-update458379 +Node: Include File Requirements460740 +Node: Sample Include File461985 +Node: Include Files Evolution463504 +Node: Headings465475 +Node: Headings Introduced466112 +Node: Heading Format468000 +Node: Heading Choice470452 +Node: Custom Headings471824 +Node: Catching Mistakes476152 +Node: makeinfo Preferred477441 +Node: Debugging with Info478346 +Node: Debugging with TeX481692 +Node: Using texinfo-show-structure485973 +Node: Using occur489072 +Node: Running Info-Validate490609 +Node: Using Info-validate491670 +Node: Unsplit493512 +Node: Tagifying494558 +Node: Splitting495410 +Node: Refilling Paragraphs497026 +Node: Refilling Paragraphs-Footnotes498679 +Node: Command Syntax498930 +Node: Obtaining TeX501887 +Node: Command and Variable Index503999 +Node: Concept Index519851  End Tag Table diff --git a/info/texinfo.info-1 b/info/texinfo.info-1 index ffb02ba..bc542dc 100644 --- a/info/texinfo.info-1 +++ b/info/texinfo.info-1 @@ -1,5 +1,5 @@ -This is ../info/texinfo.info, produced by makeinfo version 4.0 from -texinfo.texi. +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. INFO-DIR-SECTION Texinfo documentation system START-INFO-DIR-ENTRY @@ -91,7 +91,7 @@ menu lists all the lower level nodes in the document. * Concept Index:: A menu covering many topics. - --- The Detailed Node Listing --- + -- The Detailed Node Listing -- Overview of Texinfo @@ -556,7 +556,7 @@ File: texinfo.info, Node: Overview, Next: Texinfo Mode, Prev: Copying, Up: T Overview of Texinfo ******************* - "Texinfo"(1) (*note Overview-Footnote-1::) is a documentation system + "Texinfo"(1) (*note Overview-Footnotes::) is a documentation system that uses a single source file to produce both on-line information and printed output. This means that instead of writing two different documents, one for the on-line help or other on-line information and @@ -604,8 +604,8 @@ menu-driven, on-line Info file with nodes, menus, cross references, and indices. You can, if you wish, make the chapters and sections of the printed document correspond to the nodes of the on-line information; and you use the same cross references and indices for both the Info -file and the printed work. `The XEmacs User's Manual' is a good -example of a Texinfo file, as is this manual. +file and the printed work. `The GNU Emacs Manual' is a good example of +a Texinfo file, as is this manual. To make a printed document, you process a Texinfo source file with the TeX typesetting program. This creates a DVI file that you can typeset @@ -679,7 +679,7 @@ Normally the order in this chain is the same as the order of the children in the parent's menu. Each child node records the parent node name as its `Up' pointer. The last child has no `Next' pointer, and the first child has the parent both as its `Previous' and as its `Up' -pointer.(1) (*note Info Files-Footnote-1::) +pointer.(1) (*note Info Files-Footnotes::) The book-like structuring of an Info file into nodes that correspond to chapters, sections, and the like is a matter of convention, not a @@ -735,7 +735,7 @@ Printed Books A Texinfo file can be formatted and typeset as a printed book or manual. To do this, you need TeX, a powerful, sophisticated typesetting -program written by Donald Knuth.(1) (*note Printed Books-Footnote-1::) +program written by Donald Knuth.(1) (*note Printed Books-Footnotes::) A Texinfo-based book is similar to any other typeset, printed work: it can have a title page, copyright page, table of contents, and preface, @@ -812,7 +812,7 @@ characters. Similarly, you can print the output generated by TeX on a wide variety of printers. Depending on what they do or what arguments(1) (*note Formatting -Commands-Footnote-1::) they take, you need to write @-commands on lines +Commands-Footnotes::) they take, you need to write @-commands on lines of their own or as part of sentences: * Write a command such as `@noindent' at the beginning of a line as diff --git a/info/texinfo.info-10 b/info/texinfo.info-10 new file mode 100644 index 0000000..7b4fbcc --- /dev/null +++ b/info/texinfo.info-10 @@ -0,0 +1,1219 @@ +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98 Free Software +Foundation, Inc. + + This edition is for Texinfo version 3.12. + + 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 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. + + +File: texinfo.info, Node: Tips, Next: Sample Texinfo File, Prev: Command List, Up: Top + +Tips and Hints +************** + + Here are some tips for writing Texinfo documentation: + + * Write in the present tense, not in the past or the future. + + * Write actively! For example, write "We recommend that ..." rather + than "It is recommended that ...". + + * Use 70 or 72 as your fill column. Longer lines are hard to read. + + * Include a copyright notice and copying permissions. + +Index, Index, Index! +.................... + + Write many index entries, in different ways. Readers like indices; +they are helpful and convenient. + + Although it is easiest to write index entries as you write the body of +the text, some people prefer to write entries afterwards. In either +case, write an entry before the paragraph to which it applies. This +way, an index entry points to the first page of a paragraph that is +split across pages. + + Here are more hints we have found valuable: + + * Write each index entry differently, so each entry refers to a + different place in the document. + + * Write index entries only where a topic is discussed significantly. + For example, it is not useful to index "debugging information" in + a chapter on reporting bugs. Someone who wants to know about + debugging information will certainly not find it in that chapter. + + * Consistently capitalize the first word of every concept index + entry, or else consistently use lower case. Terse entries often + call for lower case; longer entries for capitalization. Whichever + case convention you use, please use one or the other consistently! + Mixing the two styles looks bad. + + * Always capitalize or use upper case for those words in an index for + which this is proper, such as names of countries or acronyms. + Always use the appropriate case for case-sensitive names, such as + those in C or Lisp. + + * Write the indexing commands that refer to a whole section + immediately after the section command, and write the indexing + commands that refer to the paragraph before the paragraph. + + In the example that follows, a blank line comes after the index + entry for "Leaping": + + @section The Dog and the Fox + @cindex Jumping, in general + @cindex Leaping + + @cindex Dog, lazy, jumped over + @cindex Lazy dog jumped over + @cindex Fox, jumps over dog + @cindex Quick fox jumps over dog + The quick brown fox jumps over the lazy dog. + + (Note that the example shows entries for the same concept that are + written in different ways--`Lazy dog', and `Dog, lazy'--so readers + can look up the concept in different ways.) + +Blank Lines +........... + + * Insert a blank line between a sectioning command and the first + following sentence or paragraph, or between the indexing commands + associated with the sectioning command and the first following + sentence or paragraph, as shown in the tip on indexing. + Otherwise, a formatter may fold title and paragraph together. + + * Always insert a blank line before an `@table' command and after an + `@end table' command; but never insert a blank line after an + `@table' command or before an `@end table' command. + + For example, + + Types of fox: + + @table @samp + @item Quick + Jump over lazy dogs. + + @item Brown + Also jump over lazy dogs. + @end table + @noindent + On the other hand, ... + + Insert blank lines before and after `@itemize' ... `@end itemize' + and `@enumerate' ... `@end enumerate' in the same way. + +Complete Phrases +................ + + Complete phrases are easier to read than ... + + * Write entries in an itemized list as complete sentences; or at + least, as complete phrases. Incomplete expressions ... awkward + ... like this. + + * Write the prefatory sentence or phrase for a multi-item list or + table as a complete expression. Do not write "You can set:"; + instead, write "You can set these variables:". The former + expression sounds cut off. + +Editions, Dates and Versions +............................ + + Write the edition and version numbers and date in three places in +every manual: + + 1. In the first `@ifinfo' section, for people reading the Texinfo + file. + + 2. In the `@titlepage' section, for people reading the printed manual. + + 3. In the `Top' node, for people reading the Info file. + +Also, it helps to write a note before the first `@ifinfo' section to +explain what you are doing. + +For example: + + @c ===> NOTE! <== + @c Specify the edition and version numbers and date + @c in *three* places: + @c 1. First ifinfo section 2. title page 3. top node + @c To find the locations, search for !!set + + @ifinfo + @c !!set edition, date, version + This is Edition 4.03, January 1992, + of the @cite{GDB Manual} for GDB Version 4.3. + ... + +--or use `@set' and `@value' (*note `@value' Example: value Example.). + +Definition Commands +................... + + Definition commands are `@deffn', `@defun', `@defmac', and the like, +and enable you to write descriptions in a uniform format. + + * Write just one definition command for each entity you define with a + definition command. The automatic indexing feature creates an + index entry that leads the reader to the definition. + + * Use `@table' ... `@end table' in an appendix that contains a + summary of functions, not `@deffn' or other definition commands. + +Capitalization +.............. + + * Capitalize "Texinfo"; it is a name. Do not write the `x' or `i' + in upper case. + + * Capitalize "Info"; it is a name. + + * Write TeX using the `@TeX{}' command. Note the uppercase `T' and + `X'. This command causes the formatters to typeset the name + according to the wishes of Donald Knuth, who wrote TeX. + +Spaces +...... + + Do not use spaces to format a Texinfo file, except inside of +`@example' ... `@end example' and similar commands. + + For example, TeX fills the following: + + @kbd{C-x v} + @kbd{M-x vc-next-action} + Perform the next logical operation + on the version-controlled file + corresponding to the current buffer. + +so it looks like this: + + `C-x v' `M-x vc-next-action' Perform the next logical operation on + the version-controlled file corresponding to the current buffer. + +In this case, the text should be formatted with `@table', `@item', and +`@itemx', to create a table. + +@code, @samp, @var, and `---' +............................. + + * Use `@code' around Lisp symbols, including command names. For + example, + + The main function is @code{vc-next-action}, ... + + * Avoid putting letters such as `s' immediately after an `@code'. + Such letters look bad. + + * Use `@var' around meta-variables. Do not write angle brackets + around them. + + * Use three hyphens in a row, `---', to indicate a long dash. TeX + typesets these as a long dash and the Info formatters reduce three + hyphens to two. + +Periods Outside of Quotes +......................... + + Place periods and other punctuation marks *outside* of quotations, +unless the punctuation is part of the quotation. This practice goes +against publishing conventions in the United States, but enables the +reader to distinguish between the contents of the quotation and the +whole passage. + + For example, you should write the following sentence with the period +outside the end quotation marks: + + Evidently, `au' is an abbreviation for ``author''. + +since `au' does *not* serve as an abbreviation for `author.' (with a +period following the word). + +Introducing New Terms +..................... + + * Introduce new terms so that a reader who does not know them can + understand them from context; or write a definition for the term. + + For example, in the following, the terms "check in", "register" and + "delta" are all appearing for the first time; the example sentence + should be rewritten so they are understandable. + + The major function assists you in checking in a file to your + version control system and registering successive sets of + changes to it as deltas. + + * Use the `@dfn' command around a word being introduced, to indicate + that the reader should not expect to know the meaning already, and + should expect to learn the meaning from this passage. + +@pxref +...... + + Absolutely never use `@pxref' except in the special context for which +it is designed: inside parentheses, with the closing parenthesis +following immediately after the closing brace. One formatter +automatically inserts closing punctuation and the other does not. This +means that the output looks right both in printed output and in an Info +file, but only when the command is used inside parentheses. + +Invoking from a Shell +..................... + + You can invoke programs such as Emacs, GCC, and `gawk' from a shell. +The documentation for each program should contain a section that +describes this. Unfortunately, if the node names and titles for these +sections are all different, readers find it hard to search for the +section. + + Name such sections with a phrase beginning with the word +`Invoking ...', as in `Invoking Emacs'; this way users can find the +section easily. + +ANSI C Syntax +............. + + When you use `@example' to describe a C function's calling +conventions, use the ANSI C syntax, like this: + + void dld_init (char *@var{path}); + +And in the subsequent discussion, refer to the argument values by +writing the same argument names, again highlighted with `@var'. + + Avoid the obsolete style that looks like this: + + #include + + dld_init (path) + char *path; + + Also, it is best to avoid writing `#include' above the declaration +just to indicate that the function is declared in a header file. The +practice may give the misimpression that the `#include' belongs near +the declaration of the function. Either state explicitly which header +file holds the declaration or, better yet, name the header file used +for a group of functions at the beginning of the section that describes +the functions. + +Bad Examples +............ + + Here are several examples of bad writing to avoid: + + In this example, say, " ... you must `@dfn'{check in} the new +version." That flows better. + + When you are done editing the file, you must perform a + `@dfn'{check in}. + + In the following example, say, "... makes a unified interface such as +VC mode possible." + + SCCS, RCS and other version-control systems all perform similar + functions in broadly similar ways (it is this resemblance which + makes a unified control mode like this possible). + + And in this example, you should specify what `it' refers to: + + If you are working with other people, it assists in coordinating + everyone's changes so they do not step on each other. + +And Finally ... +............... + + * Pronounce TeX as if the `X' were a Greek `chi', as the last sound + in the name `Bach'. But pronounce Texinfo as in `speck': + "teckinfo". + + * Write notes for yourself at the very end of a Texinfo file after + the `@bye'. None of the formatters process text after the `@bye'; + it is as if the text were within `@ignore' ... `@end ignore'. + + +File: texinfo.info, Node: Sample Texinfo File, Next: Sample Permissions, Prev: Tips, Up: Top + +A Sample Texinfo File +********************* + + Here is a complete, short sample Texinfo file, without any commentary. +You can see this file, with comments, in the first chapter. *Note A +Short Sample Texinfo File: Short Sample. + + \input texinfo @c -*-texinfo-*- + @c %**start of header + @setfilename sample.info + @settitle Sample Document + @c %**end of header + + @setchapternewpage odd + + @ifinfo + This is a short example of a complete Texinfo file. + + Copyright 1990 Free Software Foundation, Inc. + @end ifinfo + + @titlepage + @sp 10 + @comment The title is printed in a large font. + @center @titlefont{Sample Title} + + @c The following two commands start the copyright page. + @page + @vskip 0pt plus 1filll + Copyright @copyright{} 1990 Free Software Foundation, Inc. + @end titlepage + + @node Top, First Chapter, , (dir) + @comment node-name, next, previous, up + + @menu + * First Chapter:: The first chapter is the + only chapter in this sample. + * Concept Index:: This index has two entries. + @end menu + + @node First Chapter, Concept Index, Top, Top + @comment node-name, next, previous, up + @chapter First Chapter + @cindex Sample index entry + + This is the contents of the first chapter. + @cindex Another sample index entry + + Here is a numbered list. + + @enumerate + @item + This is the first item. + + @item + This is the second item. + @end enumerate + + The @code{makeinfo} and @code{texinfo-format-buffer} + commands transform a Texinfo file such as this into + an Info file; and @TeX{} typesets it for a printed + manual. + + @node Concept Index, , First Chapter, Top + @comment node-name, next, previous, up + @unnumbered Concept Index + + @printindex cp + + @contents + @bye + + +File: texinfo.info, Node: Sample Permissions, Next: Include Files, Prev: Sample Texinfo File, Up: Top + +Sample Permissions +****************** + + Texinfo files should contain sections that tell the readers that they +have the right to copy and distribute the Texinfo file, the Info file, +and the printed manual. + + Also, if you are writing a manual about software, you should explain +that the software is free and either include the GNU General Public +License (GPL) or provide a reference to it. *Note Distribution: +(xemacs)Distrib, for an example of the text that could be used in the +software "Distribution", "General Public License", and "NO WARRANTY" +sections of a document. *Note Texinfo Copying Conditions: Copying, for +an example of a brief explanation of how the copying conditions provide +you with rights. + +* Menu: + +* Inserting Permissions:: How to put permissions in your document. +* ifinfo Permissions:: Sample `ifinfo' copying permissions. +* Titlepage Permissions:: Sample Titlepage copying permissions. + + +File: texinfo.info, Node: Inserting Permissions, Next: ifinfo Permissions, Prev: Sample Permissions, Up: Sample Permissions + +Inserting Permissions +===================== + + In a Texinfo file, the first `@ifinfo' section usually begins with a +line that says what the file documents. This is what a person reading +the unprocessed Texinfo file or using the advanced Info command `g *' +sees first. *note Advanced Info commands: (info)Expert, for more +information. (A reader using the regular Info commands usually starts +reading at the first node and skips this first section, which is not in +a node.) + + In the `@ifinfo' section, the summary sentence is followed by a +copyright notice and then by the copying permission notice. One of the +copying permission paragraphs is enclosed in `@ignore' and `@end +ignore' commands. This paragraph states that the Texinfo file can be +processed through TeX and printed, provided the printed manual carries +the proper copying permission notice. This paragraph is not made part +of the Info file since it is not relevant to the Info file; but it is a +mandatory part of the Texinfo file since it permits people to process +the Texinfo file in TeX and print the results. + + In the printed manual, the Free Software Foundation copying permission +notice follows the copyright notice and publishing information and is +located within the region delineated by the `@titlepage' and `@end +titlepage' commands. The copying permission notice is exactly the same +as the notice in the `@ifinfo' section except that the paragraph +enclosed in `@ignore' and `@end ignore' commands is not part of the +notice. + + To make it simple to insert a permission notice into each section of +the Texinfo file, sample permission notices for each section are +reproduced in full below. + + Note that you may need to specify the correct name of a section +mentioned in the permission notice. For example, in `The GDB Manual', +the name of the section referring to the General Public License is +called the "GDB General Public License", but in the sample shown below, +that section is referred to generically as the "GNU General Public +License". If the Texinfo file does not carry a copy of the General +Public License, leave out the reference to it, but be sure to include +the rest of the sentence. + + +File: texinfo.info, Node: ifinfo Permissions, Next: Titlepage Permissions, Prev: Inserting Permissions, Up: Sample Permissions + +`ifinfo' Copying Permissions +============================ + + In the `@ifinfo' section of a Texinfo file, the standard Free +Software Foundation permission notice reads as follows: + + This file documents ... + + Copyright 1998 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. + + +File: texinfo.info, Node: Titlepage Permissions, Prev: ifinfo Permissions, Up: Sample Permissions + +Titlepage Copying Permissions +============================= + + In the `@titlepage' section of a Texinfo file, the standard Free +Software Foundation copying permission notice follows the copyright +notice and publishing information. The standard phrasing is as follows: + + 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. + + +File: texinfo.info, Node: Include Files, Next: Headings, Prev: Sample Permissions, Up: Top + +Include Files +************* + + When TeX or an Info formatting command sees an `@include' command in +a Texinfo file, it processes the contents of the file named by the +command and incorporates them into the DVI or Info file being created. +Index entries from the included file are incorporated into the indices +of the output file. + + Include files let you keep a single large document as a collection of +conveniently small parts. + +* Menu: + +* Using Include Files:: How to use the `@include' command. +* texinfo-multiple-files-update:: How to create and update nodes and + menus when using included files. +* Include File Requirements:: What `texinfo-multiple-files-update' expects. +* Sample Include File:: A sample outer file with included files + within it; and a sample included file. +* Include Files Evolution:: How use of the `@include' command + has changed over time. + + +File: texinfo.info, Node: Using Include Files, Next: texinfo-multiple-files-update, Prev: Include Files, Up: Include Files + +How to Use Include Files +======================== + + To include another file within a Texinfo file, write the `@include' +command at the beginning of a line and follow it on the same line by +the name of a file to be included. For example: + + @include buffers.texi + + An included file should simply be a segment of text that you expect to +be included as is into the overall or "outer" Texinfo file; it should +not contain the standard beginning and end parts of a Texinfo file. In +particular, you should not start an included file with a line saying +`\input texinfo'; if you do, that phrase is inserted into the output +file as is. Likewise, you should not end an included file with an +`@bye' command; nothing after `@bye' is formatted. + + In the past, you were required to write an `@setfilename' line at the +beginning of an included file, but no longer. Now, it does not matter +whether you write such a line. If an `@setfilename' line exists in an +included file, it is ignored. + + Conventionally, an included file begins with an `@node' line that is +followed by an `@chapter' line. Each included file is one chapter. +This makes it easy to use the regular node and menu creating and +updating commands to create the node pointers and menus within the +included file. However, the simple Emacs node and menu creating and +updating commands do not work with multiple Texinfo files. Thus you +cannot use these commands to fill in the `Next', `Previous', and `Up' +pointers of the `@node' line that begins the included file. Also, you +cannot use the regular commands to create a master menu for the whole +file. Either you must insert the menus and the `Next', `Previous', and +`Up' pointers by hand, or you must use the GNU Emacs Texinfo mode +command, `texinfo-multiple-files-update', that is designed for +`@include' files. + + +File: texinfo.info, Node: texinfo-multiple-files-update, Next: Include File Requirements, Prev: Using Include Files, Up: Include Files + +`texinfo-multiple-files-update' +=============================== + + GNU Emacs Texinfo mode provides the `texinfo-multiple-files-update' +command. This command creates or updates `Next', `Previous', and `Up' +pointers of included files as well as those in the outer or overall +Texinfo file, and it creates or updates a main menu in the outer file. +Depending whether you call it with optional arguments, the command +updates only the pointers in the first `@node' line of the included +files or all of them: + +`M-x texinfo-multiple-files-update' + Called without any arguments: + + - Create or update the `Next', `Previous', and `Up' pointers of + the first `@node' line in each file included in an outer or + overall Texinfo file. + + - Create or update the `Top' level node pointers of the outer or + overall file. + + - Create or update a main menu in the outer file. + +`C-u M-x texinfo-multiple-files-update' + Called with `C-u' as a prefix argument: + + - Create or update pointers in the first `@node' line in each + included file. + + - Create or update the `Top' level node pointers of the outer + file. + + - Create and insert a master menu in the outer file. The + master menu is made from all the menus in all the included + files. + +`C-u 8 M-x texinfo-multiple-files-update' + Called with a numeric prefix argument, such as `C-u 8': + + - Create or update *all* the `Next', `Previous', and `Up' + pointers of all the included files. + + - Create or update *all* the menus of all the included files. + + - Create or update the `Top' level node pointers of the outer or + overall file. + + - And then create a master menu in the outer file. This is + similar to invoking `texinfo-master-menu' with an argument + when you are working with just one file. + + Note the use of the prefix argument in interactive use: with a regular +prefix argument, just `C-u', the `texinfo-multiple-files-update' +command inserts a master menu; with a numeric prefix argument, such as +`C-u 8', the command updates *every* pointer and menu in *all* the +files and then inserts a master menu. + + +File: texinfo.info, Node: Include File Requirements, Next: Sample Include File, Prev: texinfo-multiple-files-update, Up: Include Files + +Include File Requirements +========================= + + If you plan to use the `texinfo-multiple-files-update' command, the +outer Texinfo file that lists included files within it should contain +nothing but the beginning and end parts of a Texinfo file, and a number +of `@include' commands listing the included files. It should not even +include indices, which should be listed in an included file of their +own. + + Moreover, each of the included files must contain exactly one highest +level node (conventionally, `@chapter' or equivalent), and this node +must be the first node in the included file. Furthermore, each of +these highest level nodes in each included file must be at the same +hierarchical level in the file structure. Usually, each is an +`@chapter', an `@appendix', or an `@unnumbered' node. Thus, normally, +each included file contains one, and only one, chapter or +equivalent-level node. + + The outer file should contain only *one* node, the `Top' node. It +should *not* contain any nodes besides the single `Top' node. The +`texinfo-multiple-files-update' command will not process them. + + +File: texinfo.info, Node: Sample Include File, Next: Include Files Evolution, Prev: Include File Requirements, Up: Include Files + +Sample File with `@include' +=========================== + + Here is an example of a complete outer Texinfo file with `@include' +files within it before running `texinfo-multiple-files-update', which +would insert a main or master menu: + + \input texinfo @c -*-texinfo-*- + @setfilename include-example.info + @settitle Include Example + + @setchapternewpage odd + @titlepage + @sp 12 + @center @titlefont{Include Example} + @sp 2 + @center by Whom Ever + + @page + @vskip 0pt plus 1filll + Copyright @copyright{} 1998 Free Software Foundation, Inc. + @end titlepage + + @ifinfo + @node Top, First, , (dir) + @top Master Menu + @end ifinfo + + @include foo.texinfo + @include bar.texinfo + @include concept-index.texinfo + + @summarycontents + @contents + + @bye + + An included file, such as `foo.texinfo', might look like this: + + @node First, Second, , Top + @chapter First Chapter + + Contents of first chapter ... + + The full contents of `concept-index.texinfo' might be as simple as +this: + + @node Concept Index, , Second, Top + @unnumbered Concept Index + + @printindex cp + + The outer Texinfo source file for `The XEmacs Lisp Reference Manual' +is named `elisp.texi'. This outer file contains a master menu with 417 +entries and a list of 41 `@include' files. + + +File: texinfo.info, Node: Include Files Evolution, Prev: Sample Include File, Up: Include Files + +Evolution of Include Files +========================== + + When Info was first created, it was customary to create many small +Info files on one subject. Each Info file was formatted from its own +Texinfo source file. This custom meant that Emacs did not need to make +a large buffer to hold the whole of a large Info file when someone +wanted information; instead, Emacs allocated just enough memory for the +small Info file that contained the particular information sought. This +way, Emacs could avoid wasting memory. + + References from one file to another were made by referring to the file +name as well as the node name. (*Note Referring to Other Info Files: +Other Info Files. Also, see *Note `@xref' with Four and Five +Arguments: Four and Five Arguments.) + + Include files were designed primarily as a way to create a single, +large printed manual out of several smaller Info files. In a printed +manual, all the references were within the same document, so TeX could +automatically determine the references' page numbers. The Info +formatting commands used include files only for creating joint indices; +each of the individual Texinfo files had to be formatted for Info +individually. (Each, therefore, required its own `@setfilename' line.) + + However, because large Info files are now split automatically, it is +no longer necessary to keep them small. + + Nowadays, multiple Texinfo files are used mostly for large documents, +such as `The XEmacs Lisp Reference Manual', and for projects in which +several different people write different sections of a document +simultaneously. + + In addition, the Info formatting commands have been extended to work +with the `@include' command so as to create a single large Info file +that is split into smaller files if necessary. This means that you can +write menus and cross references without naming the different Texinfo +files. + + +File: texinfo.info, Node: Headings, Next: Catching Mistakes, Prev: Include Files, Up: Top + +Page Headings +************* + + Most printed manuals contain headings along the top of every page +except the title and copyright pages. Some manuals also contain +footings. (Headings and footings have no meaning to Info, which is not +paginated.) + +* Menu: + +* Headings Introduced:: Conventions for using page headings. +* Heading Format:: Standard page heading formats. +* Heading Choice:: How to specify the type of page heading. +* Custom Headings:: How to create your own headings and footings. + + +File: texinfo.info, Node: Headings Introduced, Next: Heading Format, Prev: Headings, Up: Headings + +Headings Introduced +=================== + + Texinfo provides standard page heading formats for manuals that are +printed on one side of each sheet of paper and for manuals that are +printed on both sides of the paper. Typically, you will use these +formats, but you can specify your own format if you wish. + + In addition, you can specify whether chapters should begin on a new +page, or merely continue the same page as the previous chapter; and if +chapters begin on new pages, you can specify whether they must be +odd-numbered pages. + + By convention, a book is printed on both sides of each sheet of paper. +When you open a book, the right-hand page is odd-numbered, and chapters +begin on right-hand pages--a preceding left-hand page is left blank if +necessary. Reports, however, are often printed on just one side of +paper, and chapters begin on a fresh page immediately following the end +of the preceding chapter. In short or informal reports, chapters often +do not begin on a new page at all, but are separated from the preceding +text by a small amount of whitespace. + + The `@setchapternewpage' command controls whether chapters begin on +new pages, and whether one of the standard heading formats is used. In +addition, Texinfo has several heading and footing commands that you can +use to generate your own heading and footing formats. + + In Texinfo, headings and footings are single lines at the tops and +bottoms of pages; you cannot create multiline headings or footings. +Each header or footer line is divided into three parts: a left part, a +middle part, and a right part. Any part, or a whole line, may be left +blank. Text for the left part of a header or footer line is set +flushleft; text for the middle part is centered; and, text for the +right part is set flushright. + + +File: texinfo.info, Node: Heading Format, Next: Heading Choice, Prev: Headings Introduced, Up: Headings + +Standard Heading Formats +======================== + + Texinfo provides two standard heading formats, one for manuals printed +on one side of each sheet of paper, and the other for manuals printed +on both sides of the paper. + + By default, nothing is specified for the footing of a Texinfo file, +so the footing remains blank. + + The standard format for single-sided printing consists of a header +line in which the left-hand part contains the name of the chapter, the +central part is blank, and the right-hand part contains the page number. + + A single-sided page looks like this: + + _______________________ + | | + | chapter page number | + | | + | Start of text ... | + | ... | + | | + + The standard format for two-sided printing depends on whether the page +number is even or odd. By convention, even-numbered pages are on the +left- and odd-numbered pages are on the right. (TeX will adjust the +widths of the left- and right-hand margins. Usually, widths are +correct, but during double-sided printing, it is wise to check that +pages will bind properly--sometimes a printer will produce output in +which the even-numbered pages have a larger right-hand margin than the +odd-numbered pages.) + + In the standard double-sided format, the left part of the left-hand +(even-numbered) page contains the page number, the central part is +blank, and the right part contains the title (specified by the +`@settitle' command). The left part of the right-hand (odd-numbered) +page contains the name of the chapter, the central part is blank, and +the right part contains the page number. + + Two pages, side by side as in an open book, look like this: + + _______________________ _______________________ + | | | | + | page number title | | chapter page number | + | | | | + | Start of text ... | | More text ... | + | ... | | ... | + | | | | + +The chapter name is preceded by the word "Chapter", the chapter number +and a colon. This makes it easier to keep track of where you are in the +manual. + + +File: texinfo.info, Node: Heading Choice, Next: Custom Headings, Prev: Heading Format, Up: Headings + +Specifying the Type of Heading +============================== + + TeX does not begin to generate page headings for a standard Texinfo +file until it reaches the `@end titlepage' command. Thus, the title +and copyright pages are not numbered. The `@end titlepage' command +causes TeX to begin to generate page headings according to a standard +format specified by the `@setchapternewpage' command that precedes the +`@titlepage' section. + + There are four possibilities: + +No `@setchapternewpage' command + Cause TeX to specify the single-sided heading format, with chapters + on new pages. This is the same as `@setchapternewpage on'. + +`@setchapternewpage on' + Specify the single-sided heading format, with chapters on new + pages. + +`@setchapternewpage off' + Cause TeX to start a new chapter on the same page as the last page + of the preceding chapter, after skipping some vertical whitespace. + Also cause TeX to typeset for single-sided printing. (You can + override the headers format with the `@headings double' command; + see *Note The `@headings' Command: headings on off.) + +`@setchapternewpage odd' + Specify the double-sided heading format, with chapters on new + pages. + +Texinfo lacks an `@setchapternewpage even' command. + + +File: texinfo.info, Node: Custom Headings, Prev: Heading Choice, Up: Headings + +How to Make Your Own Headings +============================= + + You can use the standard headings provided with Texinfo or specify +your own. By default, Texinfo has no footers, so if you specify them, +the available page size for the main text will be slightly reduced. + + Texinfo provides six commands for specifying headings and footings. +The `@everyheading' command and `@everyfooting' command generate page +headers and footers that are the same for both even- and odd-numbered +pages. The `@evenheading' command and `@evenfooting' command generate +headers and footers for even-numbered (left-hand) pages; and the +`@oddheading' command and `@oddfooting' command generate headers and +footers for odd-numbered (right-hand) pages. + + Write custom heading specifications in the Texinfo file immediately +after the `@end titlepage' command. Enclose your specifications +between `@iftex' and `@end iftex' commands since the +`texinfo-format-buffer' command may not recognize them. Also, you must +cancel the predefined heading commands with the `@headings off' command +before defining your own specifications. + + Here is how to tell TeX to place the chapter name at the left, the +page number in the center, and the date at the right of every header +for both even- and odd-numbered pages: + + @iftex + @headings off + @everyheading @thischapter @| @thispage @| @today{} + @end iftex + +You need to divide the left part from the central part and the central +part from the right part by inserting `@|' between parts. Otherwise, +the specification command will not be able to tell where the text for +one part ends and the next part begins. + + Each part can contain text or @-commands. The text is printed as if +the part were within an ordinary paragraph in the body of the page. +The @-commands replace themselves with the page number, date, chapter +name, or whatever. + + Here are the six heading and footing commands: + +`@everyheading LEFT @| CENTER @| RIGHT' +`@everyfooting LEFT @| CENTER @| RIGHT' + The `every' commands specify the format for both even- and + odd-numbered pages. These commands are for documents that are + printed on one side of each sheet of paper, or for documents in + which you want symmetrical headers or footers. + +`@evenheading LEFT @| CENTER @| RIGHT' +`@oddheading LEFT @| CENTER @| RIGHT' +`@evenfooting LEFT @| CENTER @| RIGHT' +`@oddfooting LEFT @| CENTER @| RIGHT' + The `even' and `odd' commands specify the format for even-numbered + pages and odd-numbered pages. These commands are for books and + manuals that are printed on both sides of each sheet of paper. + + Use the `@this...' series of @-commands to provide the names of +chapters and sections and the page number. You can use the `@this...' +commands in the left, center, or right portions of headers and footers, +or anywhere else in a Texinfo file so long as they are between `@iftex' +and `@end iftex' commands. + + Here are the `@this...' commands: + +`@thispage' + Expands to the current page number. + +`@thischaptername' + Expands to the name of the current chapter. + +`@thischapter' + Expands to the number and name of the current chapter, in the + format `Chapter 1: Title'. + +`@thistitle' + Expands to the name of the document, as specified by the + `@settitle' command. + +`@thisfile' + For `@include' files only: expands to the name of the current + `@include' file. If the current Texinfo source file is not an + `@include' file, this command has no effect. This command does + *not* provide the name of the current Texinfo source file unless + it is an `@include' file. (*Note Include Files::, for more + information about `@include' files.) + +You can also use the `@today{}' command, which expands to the current +date, in `1 Jan 1900' format. + + Other @-commands and text are printed in a header or footer just as +if they were in the body of a page. It is useful to incorporate text, +particularly when you are writing drafts: + + @iftex + @headings off + @everyheading @emph{Draft!} @| @thispage @| @thischapter + @everyfooting @| @| Version: 0.27: @today{} + @end iftex + + Beware of overlong titles: they may overlap another part of the +header or footer and blot it out. + + +File: texinfo.info, Node: Catching Mistakes, Next: Refilling Paragraphs, Prev: Headings, Up: Top + +Formatting Mistakes +******************* + + Besides mistakes in the content of your documentation, there are two +kinds of mistake you can make with Texinfo: you can make mistakes with +@-commands, and you can make mistakes with the structure of the nodes +and chapters. + + Emacs has two tools for catching the @-command mistakes and two for +catching structuring mistakes. + + For finding problems with @-commands, you can run TeX or a region +formatting command on the region that has a problem; indeed, you can +run these commands on each region as you write it. + + For finding problems with the structure of nodes and chapters, you +can use `C-c C-s' (`texinfo-show-structure') and the related `occur' +command and you can use the `M-x Info-validate' command. + +* Menu: + +* makeinfo Preferred:: `makeinfo' finds errors. +* Debugging with Info:: How to catch errors with Info formatting. +* Debugging with TeX:: How to catch errors with TeX formatting. +* Using texinfo-show-structure:: How to use `texinfo-show-structure'. +* Using occur:: How to list all lines containing a pattern. +* Running Info-Validate:: How to find badly referenced nodes. + + +File: texinfo.info, Node: makeinfo Preferred, Next: Debugging with Info, Prev: Catching Mistakes, Up: Catching Mistakes + +`makeinfo' Find Errors +====================== + + The `makeinfo' program does an excellent job of catching errors and +reporting them--far better than `texinfo-format-region' or +`texinfo-format-buffer'. In addition, the various functions for +automatically creating and updating node pointers and menus remove many +opportunities for human error. + + If you can, use the updating commands to create and insert pointers +and menus. These prevent many errors. Then use `makeinfo' (or its +Texinfo mode manifestations, `makeinfo-region' and `makeinfo-buffer') +to format your file and check for other errors. This is the best way +to work with Texinfo. But if you cannot use `makeinfo', or your +problem is very puzzling, then you may want to use the tools described +in this appendix. + + +File: texinfo.info, Node: Debugging with Info, Next: Debugging with TeX, Prev: makeinfo Preferred, Up: Catching Mistakes + +Catching Errors with Info Formatting +==================================== + + After you have written part of a Texinfo file, you can use the +`texinfo-format-region' or the `makeinfo-region' command to see whether +the region formats properly. + + Most likely, however, you are reading this section because for some +reason you cannot use the `makeinfo-region' command; therefore, the +rest of this section presumes that you are using +`texinfo-format-region'. + + If you have made a mistake with an @-command, `texinfo-format-region' +will stop processing at or after the error and display an error +message. To see where in the buffer the error occurred, switch to the +`*Info Region*' buffer; the cursor will be in a position that is after +the location of the error. Also, the text will not be formatted after +the place where the error occurred (or more precisely, where it was +detected). + + For example, if you accidentally end a menu with the command `@end +menus' with an `s' on the end, instead of with `@end menu', you will +see an error message that says: + + @end menus is not handled by texinfo + +The cursor will stop at the point in the buffer where the error occurs, +or not long after it. The buffer will look like this: + + ---------- Buffer: *Info Region* ---------- + * Menu: + + * Using texinfo-show-structure:: How to use + `texinfo-show-structure' + to catch mistakes. + * Running Info-Validate:: How to check for + unreferenced nodes. + @end menus + -!- + ---------- Buffer: *Info Region* ---------- + + The `texinfo-format-region' command sometimes provides slightly odd +error messages. For example, the following cross reference fails to +format: + + (@xref{Catching Mistakes, for more info.) + +In this case, `texinfo-format-region' detects the missing closing brace +but displays a message that says `Unbalanced parentheses' rather than +`Unbalanced braces'. This is because the formatting command looks for +mismatches between braces as if they were parentheses. + + Sometimes `texinfo-format-region' fails to detect mistakes. For +example, in the following, the closing brace is swapped with the +closing parenthesis: + + (@xref{Catching Mistakes), for more info.} + +Formatting produces: + (*Note for more info.: Catching Mistakes) + + The only way for you to detect this error is to realize that the +reference should have looked like this: + + (*Note Catching Mistakes::, for more info.) + + Incidentally, if you are reading this node in Info and type `f ' +(`Info-follow-reference'), you will generate an error message that says: + + No such node: "Catching Mistakes) The only way ... + +This is because Info perceives the example of the error as the first +cross reference in this node and if you type a immediately after +typing the Info `f' command, Info will attempt to go to the referenced +node. If you type `f catch ', Info will complete the node +name of the correctly written example and take you to the `Catching +Mistakes' node. (If you try this, you can return from the `Catching +Mistakes' node by typing `l' (`Info-last').) + diff --git a/info/texinfo.info-11 b/info/texinfo.info-11 new file mode 100644 index 0000000..94a7f31 --- /dev/null +++ b/info/texinfo.info-11 @@ -0,0 +1,848 @@ +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98 Free Software +Foundation, Inc. + + This edition is for Texinfo version 3.12. + + 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 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. + + +File: texinfo.info, Node: Debugging with TeX, Next: Using texinfo-show-structure, Prev: Debugging with Info, Up: Catching Mistakes + +Catching Errors with TeX Formatting +=================================== + + You can also catch mistakes when you format a file with TeX. + + Usually, you will want to do this after you have run +`texinfo-format-buffer' (or, better, `makeinfo-buffer') on the same +file, because `texinfo-format-buffer' sometimes displays error messages +that make more sense than TeX. (*Note Debugging with Info::, for more +information.) + + For example, TeX was run on a Texinfo file, part of which is shown +here: + + ---------- Buffer: texinfo.texi ---------- + name of the Texinfo file as an extension. The + @samp{??} are `wildcards' that cause the shell to + substitute all the raw index files. (@xref{sorting + indices, for more information about sorting + indices.)@refill + ---------- Buffer: texinfo.texi ---------- + +(The cross reference lacks a closing brace.) TeX produced the +following output, after which it stopped: + + ---------- Buffer: *tex-shell* ---------- + Runaway argument? + {sorting indices, for more information about sorting + indices.) @refill @ETC. + ! Paragraph ended before @xref was complete. + + @par + l.27 + + ? + ---------- Buffer: *tex-shell* ---------- + + In this case, TeX produced an accurate and understandable error +message: + + Paragraph ended before @xref was complete. + +`@par' is an internal TeX command of no relevance to Texinfo. `l.27' +means that TeX detected the problem on line 27 of the Texinfo file. +The `?' is the prompt TeX uses in this circumstance. + + Unfortunately, TeX is not always so helpful, and sometimes you must +truly be a Sherlock Holmes to discover what went wrong. + + In any case, if you run into a problem like this, you can do one of +three things. + + 1. You can tell TeX to continue running and ignore just this error by + typing at the `?' prompt. + + 2. You can tell TeX to continue running and to ignore all errors as + best it can by typing `r ' at the `?' prompt. + + This is often the best thing to do. However, beware: the one error + may produce a cascade of additional error messages as its + consequences are felt through the rest of the file. To stop TeX + when it is producing such an avalanche of error messages, type + `C-c' (or `C-c C-c', if you are running a shell inside Emacs). + + 3. You can tell TeX to stop this run by typing `x ' at the `?' + prompt. + + Please note that if you are running TeX inside Emacs, you need to +switch to the shell buffer and line at which TeX offers the `?' prompt. + + Sometimes TeX will format a file without producing error messages even +though there is a problem. This usually occurs if a command is not +ended but TeX is able to continue processing anyhow. For example, if +you fail to end an itemized list with the `@end itemize' command, TeX +will write a DVI file that you can print out. The only error message +that TeX will give you is the somewhat mysterious comment that + + (@end occurred inside a group at level 1) + +However, if you print the DVI file, you will find that the text of the +file that follows the itemized list is entirely indented as if it were +part of the last item in the itemized list. The error message is the +way TeX says that it expected to find an `@end' command somewhere in +the file; but that it could not determine where it was needed. + + Another source of notoriously hard-to-find errors is a missing `@end +group' command. If you ever are stumped by incomprehensible errors, +look for a missing `@end group' command first. + + If the Texinfo file lacks header lines, TeX may stop in the beginning +of its run and display output that looks like the following. The `*' +indicates that TeX is waiting for input. + + This is TeX, Version 3.14159 (Web2c 7.0) + (test.texinfo [1]) + * + +In this case, simply type `\end ' after the asterisk. Then write +the header lines in the Texinfo file and run the TeX command again. +(Note the use of the backslash, `\'. TeX uses `\' instead of `@'; and +in this circumstance, you are working directly with TeX, not with +Texinfo.) + + +File: texinfo.info, Node: Using texinfo-show-structure, Next: Using occur, Prev: Debugging with TeX, Up: Catching Mistakes + +Using `texinfo-show-structure' +============================== + + It is not always easy to keep track of the nodes, chapters, sections, +and subsections of a Texinfo file. This is especially true if you are +revising or adding to a Texinfo file that someone else has written. + + In GNU Emacs, in Texinfo mode, the `texinfo-show-structure' command +lists all the lines that begin with the @-commands that specify the +structure: `@chapter', `@section', `@appendix', and so on. With an +argument (`C-u' as prefix argument, if interactive), the command also +shows the `@node' lines. The `texinfo-show-structure' command is bound +to `C-c C-s' in Texinfo mode, by default. + + The lines are displayed in a buffer called the `*Occur*' buffer, +indented by hierarchical level. For example, here is a part of what was +produced by running `texinfo-show-structure' on this manual: + + Lines matching "^@\\(chapter \\|sect\\|subs\\|subh\\| + unnum\\|major\\|chapheading \\|heading \\|appendix\\)" + in buffer texinfo.texi. + ... + 4177:@chapter Nodes + 4198: @heading Two Paths + 4231: @section Node and Menu Illustration + 4337: @section The @code{@@node} Command + 4393: @subheading Choosing Node and Pointer Names + 4417: @subsection How to Write an @code{@@node} Line + 4469: @subsection @code{@@node} Line Tips + ... + + This says that lines 4337, 4393, and 4417 of `texinfo.texi' begin +with the `@section', `@subheading', and `@subsection' commands +respectively. If you move your cursor into the `*Occur*' window, you +can position the cursor over one of the lines and use the `C-c C-c' +command (`occur-mode-goto-occurrence'), to jump to the corresponding +spot in the Texinfo file. *Note Using Occur: (xemacs)Other Repeating +Search, for more information about `occur-mode-goto-occurrence'. + + The first line in the `*Occur*' window describes the "regular +expression" specified by TEXINFO-HEADING-PATTERN. This regular +expression is the pattern that `texinfo-show-structure' looks for. +*Note Using Regular Expressions: (xemacs)Regexps, for more information. + + When you invoke the `texinfo-show-structure' command, Emacs will +display the structure of the whole buffer. If you want to see the +structure of just a part of the buffer, of one chapter, for example, +use the `C-x n n' (`narrow-to-region') command to mark the region. +(*Note Narrowing: (xemacs)Narrowing.) This is how the example used +above was generated. (To see the whole buffer again, use `C-x n w' +(`widen').) + + If you call `texinfo-show-structure' with a prefix argument by typing +`C-u C-c C-s', it will list lines beginning with `@node' as well as the +lines beginning with the @-sign commands for `@chapter', `@section', +and the like. + + You can remind yourself of the structure of a Texinfo file by looking +at the list in the `*Occur*' window; and if you have mis-named a node +or left out a section, you can correct the mistake. + + +File: texinfo.info, Node: Using occur, Next: Running Info-Validate, Prev: Using texinfo-show-structure, Up: Catching Mistakes + +Using `occur' +============= + + Sometimes the `texinfo-show-structure' command produces too much +information. Perhaps you want to remind yourself of the overall +structure of a Texinfo file, and are overwhelmed by the detailed list +produced by `texinfo-show-structure'. In this case, you can use the +`occur' command directly. To do this, type + + M-x occur + +and then, when prompted, type a "regexp", a regular expression for the +pattern you want to match. (*Note Regular Expressions: +(xemacs)Regexps.) The `occur' command works from the current location +of the cursor in the buffer to the end of the buffer. If you want to +run `occur' on the whole buffer, place the cursor at the beginning of +the buffer. + + For example, to see all the lines that contain the word `@chapter' in +them, just type `@chapter'. This will produce a list of the chapters. +It will also list all the sentences with `@chapter' in the middle of +the line. + + If you want to see only those lines that start with the word +`@chapter', type `^@chapter' when prompted by `occur'. If you want to +see all the lines that end with a word or phrase, end the last word +with a `$'; for example, `catching mistakes$'. This can be helpful +when you want to see all the nodes that are part of the same chapter or +section and therefore have the same `Up' pointer. + + *Note Using Occur: (xemacs)Other Repeating Search, for more +information. + + +File: texinfo.info, Node: Running Info-Validate, Prev: Using occur, Up: Catching Mistakes + +Finding Badly Referenced Nodes +============================== + + You can use the `Info-validate' command to check whether any of the +`Next', `Previous', `Up' or other node pointers fail to point to a +node. This command checks that every node pointer points to an +existing node. The `Info-validate' command works only on Info files, +not on Texinfo files. + + The `makeinfo' program validates pointers automatically, so you do +not need to use the `Info-validate' command if you are using +`makeinfo'. You only may need to use `Info-validate' if you are unable +to run `makeinfo' and instead must create an Info file using +`texinfo-format-region' or `texinfo-format-buffer', or if you write an +Info file from scratch. + +* Menu: + +* Using Info-validate:: How to run `Info-validate'. +* Unsplit:: How to create an unsplit file. +* Tagifying:: How to tagify a file. +* Splitting:: How to split a file manually. + + +File: texinfo.info, Node: Using Info-validate, Next: Unsplit, Prev: Running Info-Validate, Up: Running Info-Validate + +Running `Info-validate' +----------------------- + + To use `Info-validate', visit the Info file you wish to check and +type: + + M-x Info-validate + +(Note that the `Info-validate' command requires an upper case `I'. You +may also need to create a tag table before running `Info-validate'. +*Note Tagifying::.) + + If your file is valid, you will receive a message that says "File +appears valid". However, if you have a pointer that does not point to +a node, error messages will be displayed in a buffer called `*problems +in info file*'. + + For example, `Info-validate' was run on a test file that contained +only the first node of this manual. One of the messages said: + + In node "Overview", invalid Next: Texinfo Mode + +This meant that the node called `Overview' had a `Next' pointer that +did not point to anything (which was true in this case, since the test +file had only one node in it). + + Now suppose we add a node named `Texinfo Mode' to our test case but +we do not specify a `Previous' for this node. Then we will get the +following error message: + + In node "Texinfo Mode", should have Previous: Overview + +This is because every `Next' pointer should be matched by a `Previous' +(in the node where the `Next' points) which points back. + + `Info-validate' also checks that all menu entries and cross references +point to actual nodes. + + Note that `Info-validate' requires a tag table and does not work with +files that have been split. (The `texinfo-format-buffer' command +automatically splits large files.) In order to use `Info-validate' on +a large file, you must run `texinfo-format-buffer' with an argument so +that it does not split the Info file; and you must create a tag table +for the unsplit file. + + +File: texinfo.info, Node: Unsplit, Next: Tagifying, Prev: Using Info-validate, Up: Running Info-Validate + +Creating an Unsplit File +------------------------ + + You can run `Info-validate' only on a single Info file that has a tag +table. The command will not work on the indirect subfiles that are +generated when a master file is split. If you have a large file +(longer than 70,000 bytes or so), you need to run the +`texinfo-format-buffer' or `makeinfo-buffer' command in such a way that +it does not create indirect subfiles. You will also need to create a +tag table for the Info file. After you have done this, you can run +`Info-validate' and look for badly referenced nodes. + + The first step is to create an unsplit Info file. To prevent +`texinfo-format-buffer' from splitting a Texinfo file into smaller Info +files, give a prefix to the `M-x texinfo-format-buffer' command: + + C-u M-x texinfo-format-buffer + +or else + + C-u C-c C-e C-b + +When you do this, Texinfo will not split the file and will not create a +tag table for it. + + +File: texinfo.info, Node: Tagifying, Next: Splitting, Prev: Unsplit, Up: Running Info-Validate + +Tagifying a File +---------------- + + After creating an unsplit Info file, you must create a tag table for +it. Visit the Info file you wish to tagify and type: + + M-x Info-tagify + +(Note the upper case `I' in `Info-tagify'.) This creates an Info file +with a tag table that you can validate. + + The third step is to validate the Info file: + + M-x Info-validate + +(Note the upper case `I' in `Info-validate'.) In brief, the steps are: + + C-u M-x texinfo-format-buffer + M-x Info-tagify + M-x Info-validate + + After you have validated the node structure, you can rerun +`texinfo-format-buffer' in the normal way so it will construct a tag +table and split the file automatically, or you can make the tag table +and split the file manually. + + +File: texinfo.info, Node: Splitting, Prev: Tagifying, Up: Running Info-Validate + +Splitting a File Manually +------------------------- + + You should split a large file or else let the `texinfo-format-buffer' +or `makeinfo-buffer' command do it for you automatically. (Generally +you will let one of the formatting commands do this job for you. *Note +Create an Info File::.) + + The split-off files are called the indirect subfiles. + + Info files are split to save memory. With smaller files, Emacs does +not have make such a large buffer to hold the information. + + If an Info file has more than 30 nodes, you should also make a tag +table for it. *Note Using Info-validate::, for information about +creating a tag table. (Again, tag tables are usually created +automatically by the formatting command; you only need to create a tag +table yourself if you are doing the job manually. Most likely, you +will do this for a large, unsplit file on which you have run +`Info-validate'.) + + Visit the Info file you wish to tagify and split and type the two +commands: + + M-x Info-tagify + M-x Info-split + +(Note that the `I' in `Info' is upper case.) + + When you use the `Info-split' command, the buffer is modified into a +(small) Info file which lists the indirect subfiles. This file should +be saved in place of the original visited file. The indirect subfiles +are written in the same directory the original file is in, with names +generated by appending `-' and a number to the original file name. + + The primary file still functions as an Info file, but it contains just +the tag table and a directory of subfiles. + + +File: texinfo.info, Node: Refilling Paragraphs, Next: Command Syntax, Prev: Catching Mistakes, Up: Top + +Refilling Paragraphs +******************** + + The `@refill' command refills and, optionally, indents the first line +of a paragraph.(1) (*note Refilling Paragraphs-Footnotes::) The +`@refill' command is no longer important, but we describe it here +because you once needed it. You will see it in many old Texinfo files. + + Without refilling, paragraphs containing long @-constructs may look +bad after formatting because the formatter removes @-commands and +shortens some lines more than others. In the past, neither the +`texinfo-format-region' command nor the `texinfo-format-buffer' command +refilled paragraphs automatically. The `@refill' command had to be +written at the end of every paragraph to cause these formatters to fill +them. (Both TeX and `makeinfo' have always refilled paragraphs +automatically.) Now, all the Info formatters automatically fill and +indent those paragraphs that need to be filled and indented. + + The `@refill' command causes `texinfo-format-region' and +`texinfo-format-buffer' to refill a paragraph in the Info file *after* +all the other processing has been done. For this reason, you can not +use `@refill' with a paragraph containing either `@*' or `@w{ ... }' +since the refilling action will override those two commands. + + The `texinfo-format-region' and `texinfo-format-buffer' commands now +automatically append `@refill' to the end of each paragraph that should +be filled. They do not append `@refill' to the ends of paragraphs that +contain `@*' or `@w{ ...}' and therefore do not refill or indent them. + + +File: texinfo.info, Node: Refilling Paragraphs-Footnotes, Up: Refilling Paragraphs + + (1) Perhaps the command should have been called the +`@refillandindent' command, but `@refill' is shorter and the name was +chosen before indenting was possible. + + +File: texinfo.info, Node: Command Syntax, Next: Obtaining TeX, Prev: Refilling Paragraphs, Up: Top + +@-Command Syntax +**************** + + The character `@' is used to start special Texinfo commands. (It has +the same meaning that `\' has in plain TeX.) Texinfo has four types of +@-command: + +1. Non-alphabetic commands. + These commands consist of an @ followed by a punctuation mark or + other character that is not part of the alphabet. Non-alphabetic + commands are almost always part of the text within a paragraph, + and never take any argument. The two characters (@ and the other + one) are complete in themselves; none is followed by braces. The + non-alphabetic commands are: `@.', `@:', `@*', `@SPACE', `@TAB', + `@NL', `@@', `@{', and `@}'. + +2. Alphabetic commands that do not require arguments. + These commands start with @ followed by a word followed by left- + and right-hand braces. These commands insert special symbols in + the document; they do not require arguments. For example, + `@dots{}' => `...', `@equiv{}' => `==', `@TeX{}' => `TeX', and + `@bullet{}' => `*'. + +3. Alphabetic commands that require arguments within braces. + These commands start with @ followed by a letter or a word, + followed by an argument within braces. For example, the command + `@dfn' indicates the introductory or defining use of a term; it is + used as follows: `In Texinfo, @@-commands are @dfn{mark-up} + commands.' + +4. Alphabetic commands that occupy an entire line. + These commands occupy an entire line. The line starts with @, + followed by the name of the command (a word); for example, + `@center' or `@cindex'. If no argument is needed, the word is + followed by the end of the line. If there is an argument, it is + separated from the command name by a space. Braces are not used. + + Thus, the alphabetic commands fall into classes that have different +argument syntaxes. You cannot tell to which class a command belongs by +the appearance of its name, but you can tell by the command's meaning: +if the command stands for a glyph, it is in class 2 and does not +require an argument; if it makes sense to use the command together with +other text as part of a paragraph, the command is in class 3 and must +be followed by an argument in braces; otherwise, it is in class 4 and +uses the rest of the line as its argument. + + The purpose of having a different syntax for commands of classes 3 and +4 is to make Texinfo files easier to read, and also to help the GNU +Emacs paragraph and filling commands work properly. There is only one +exception to this rule: the command `@refill', which is always used at +the end of a paragraph immediately following the final period or other +punctuation character. `@refill' takes no argument and does *not* +require braces. `@refill' never confuses the Emacs paragraph commands +because it cannot appear at the beginning of a line. + + +File: texinfo.info, Node: Obtaining TeX, Next: Command and Variable Index, Prev: Command Syntax, Up: Top + +How to Obtain TeX +***************** + + TeX is freely redistributable. You can obtain TeX for Unix systems +via anonymous ftp or on physical media. The core material consists of +the Web2c TeX distribution (`http://tug.org/web2c'). + + Instructions for retrieval by anonymous ftp and information on other +available distributions: + `ftp://tug.org/tex/unixtex.ftp' + `http://tug.org/unixtex.ftp' + + The Free Software Foundation provides a core distribution on its +Source Code CD-ROM suitable for printing Texinfo manuals; the +University of Washington maintains and supports a tape distribution; +the TeX Users Group co-sponsors a complete CD-ROM TeX distribution. + + * For the FSF Source Code CD-ROM, please contact: + + Free Software Foundation, Inc. + 59 Temple Place Suite 330 + Boston, MA 02111-1307 + USA + + Telephone: +1-617-542-5942 + Fax: (including Japan) +1-617-542-2652 + Free Dial Fax (in Japan): + 0031-13-2473 (KDD) + 0066-3382-0158 (IDC) + Electronic mail: `gnu@gnu.org' + + * To order a complete distribution on CD-ROM, please see + `http://tug.org/tex-live.html'. (This distribution is also + available by FTP; see the URL's above.) + + * To order a full distribution from the University of Washington on + either a 1/4in 4-track QIC-24 cartridge or a 4mm DAT cartridge, + send $210 to: + + Pierre A. MacKay + Denny Hall, Mail Stop DH-10 + University of Washington + Seattle, WA 98195 + USA + Telephone: +1-206-543-2268 + Electronic mail: `mackay@cs.washington.edu' + + Please make checks payable to the University of Washington. + Checks must be in U.S. dollars, drawn on a U.S. bank. Overseas + sites: please add to the base cost, if desired, $20.00 for + shipment via air parcel post, or $30.00 for shipment via courier. + + Many other TeX distributions are available; see `http://tug.org/'. + + +File: texinfo.info, Node: Command and Variable Index, Next: Concept Index, Prev: Obtaining TeX, Up: Top + +Command and Variable Index +************************** + + This is an alphabetical list of all the @-commands, assorted Emacs +Lisp functions, and several variables. To make the list easier to use, +the commands are listed without their preceding `@'. + +* Menu: + +* ! (end of sentence): Ending a Sentence. +* ": Inserting Accents. +* ': Inserting Accents. +* (newline): Multiple Spaces. +* (space): Multiple Spaces. +* (tab): Multiple Spaces. +* * (force line break): Line Breaks. +* ,: Inserting Accents. +* -: - and hyphenation. +* . (end of sentence): Ending a Sentence. +* : (suppress widening): Not Ending a Sentence. +* =: Inserting Accents. +* ? (end of sentence): Ending a Sentence. +* @ (single @): Inserting An Atsign. +* ^: Inserting Accents. +* `: Inserting Accents. +* aa: Inserting Accents. +* AA: Inserting Accents. +* AE: Inserting Accents. +* ae: Inserting Accents. +* afourpaper: A4 Paper. +* appendix: unnumbered & appendix. +* appendixsec: unnumberedsec appendixsec heading. +* appendixsection: unnumberedsec appendixsec heading. +* appendixsubsec: unnumberedsubsec appendixsubsec subheading. +* appendixsubsubsec: subsubsection. +* apply: Sample Function Definition. +* asis: table. +* author: title subtitle author. +* b (bold font): Fonts. +* buffer-end: Def Cmd Template. +* bullet: bullet. +* bye <1>: File End. +* bye: Ending a File. +* c (comment): Comments. +* cartouche: cartouche. +* center: titlefont center sp. +* centerchap: chapter. +* chapheading: majorheading & chapheading. +* chapter: chapter. +* cindex: Indexing Commands. +* cite: cite. +* clear: ifset ifclear. +* code: code. +* columnfractions: Multitable Column Widths. +* comment: Comments. +* contents: Contents. +* copyright <1>: Copyright & Permissions. +* copyright: copyright symbol. +* cropmarks: Cropmarks and Magnification. +* defcodeindex: New Indices. +* defcv: Abstract Objects. +* deffn: Functions Commands. +* deffnx: deffnx. +* defindex: New Indices. +* definfoenclose: Customized Highlighting. +* defivar: Abstract Objects. +* defmac: Functions Commands. +* defmethod: Abstract Objects. +* defop: Abstract Objects. +* defopt: Variables Commands. +* defspec: Functions Commands. +* deftp: Data Types. +* deftypefn: Typed Functions. +* deftypefun: Typed Functions. +* deftypevar: Typed Variables. +* deftypevr: Typed Variables. +* defun: Functions Commands. +* defvar: Variables Commands. +* defvr: Variables Commands. +* dfn: dfn. +* dircategory: Installing Dir Entries. +* direntry: Installing Dir Entries. +* display: display. +* dmn: dmn. +* dotaccent: Inserting Accents. +* dotless: Inserting Accents. +* dots: dots. +* email: email. +* emph: emph & strong. +* end <1>: Introducing Lists. +* end: Quotations and Examples. +* end titlepage: end titlepage. +* enumerate: enumerate. +* evenfooting: Custom Headings. +* evenheading: Custom Headings. +* everyfooting: Custom Headings. +* everyheading: Custom Headings. +* example: example. +* exclamdown: Inserting Accents. +* exdent: exdent. +* file: file. +* filll: Copyright & Permissions. +* finalout: Overfull hboxes. +* findex: Indexing Commands. +* flushleft: flushleft & flushright. +* flushright: flushleft & flushright. +* foobar: Optional Arguments. +* footnote: Footnotes. +* footnotestyle: Footnote Styles. +* format: format. +* forward-word: Def Cmd Template. +* ftable: ftable vtable. +* group: group. +* H: Inserting Accents. +* heading: unnumberedsec appendixsec heading. +* headings: headings on off. +* html: Raw Formatter Commands. +* hyphenation: - and hyphenation. +* i (italic font): Fonts. +* ifclear: ifset ifclear. +* ifhtml <1>: Raw Formatter Commands. +* ifhtml: Conditional Commands. +* ifinfo: Conditional Commands. +* ifnothtml: Conditional Not Commands. +* ifnotinfo: Conditional Not Commands. +* ifnottex: Conditional Not Commands. +* ifset: ifset ifclear. +* iftex: Conditional Commands. +* ignore: Comments. +* image: Images. +* include: Using Include Files. +* Info-validate: Running Info-Validate. +* inforef: inforef. +* input (TeX command): Minimum. +* isearch-backward: deffnx. +* isearch-forward: deffnx. +* item <1>: itemize. +* item <2>: Multitable Rows. +* item: table. +* itemize: itemize. +* itemx: itemx. +* kbd: kbd. +* kbdinputstyle: kbd. +* key: key. +* kindex: Indexing Commands. +* L: Inserting Accents. +* l: Inserting Accents. +* lisp: Lisp Example. +* lowersections: Raise/lower sections. +* macro: Defining Macros. +* mag (TeX command): Cropmarks and Magnification. +* majorheading: majorheading & chapheading. +* makeinfo-buffer: makeinfo in Emacs. +* makeinfo-kill-job: makeinfo in Emacs. +* makeinfo-recenter-output-buffer: makeinfo in Emacs. +* makeinfo-region: makeinfo in Emacs. +* math: math. +* menu: Menus. +* minus: minus. +* multitable: Multi-column Tables. +* need: need. +* next-error: makeinfo in Emacs. +* noindent: noindent. +* o: Inserting Accents. +* O: Inserting Accents. +* occur: Using occur. +* occur-mode-goto-occurrence: Showing the Structure. +* oddfooting: Custom Headings. +* oddheading: Custom Headings. +* oe: Inserting Accents. +* OE: Inserting Accents. +* page: page. +* paragraphindent: paragraphindent. +* pindex: Indexing Commands. +* pounds: pounds. +* printindex: Printing Indices & Menus. +* pxref: pxref. +* questiondown: Inserting Accents. +* quotation: quotation. +* r (Roman font): Fonts. +* raisesections: Raise/lower sections. +* ref: ref. +* refill: Refilling Paragraphs. +* ringaccent: Inserting Accents. +* samp: samp. +* sc (small caps font): Smallcaps. +* section: section. +* set: ifset ifclear. +* setchapternewpage: setchapternewpage. +* setfilename: setfilename. +* settitle: settitle. +* shortcontents: Contents. +* shorttitlepage: titlepage. +* smallbook: smallbook. +* smallexample: smallexample & smalllisp. +* smalllisp: smallexample & smalllisp. +* sp (line spacing): sp. +* sp (titlepage line spacing): titlefont center sp. +* ss: Inserting Accents. +* strong: emph & strong. +* subheading: unnumberedsubsec appendixsubsec subheading. +* subsection: subsection. +* subsubheading: subsubsection. +* subsubsection: subsubsection. +* subtitle: title subtitle author. +* summarycontents: Contents. +* syncodeindex: syncodeindex. +* synindex: synindex. +* t (typewriter font): Fonts. +* table: Two-column Tables. +* tex: Raw Formatter Commands. +* tex (command): tex. +* texinfo-all-menus-update: Updating Commands. +* texinfo-every-node-update: Updating Commands. +* texinfo-format-buffer <1>: texinfo-format commands. +* texinfo-format-buffer: Info Formatting. +* texinfo-format-region <1>: texinfo-format commands. +* texinfo-format-region: Info Formatting. +* texinfo-indent-menu-description: Other Updating Commands. +* texinfo-insert-@code: Inserting. +* texinfo-insert-@dfn: Inserting. +* texinfo-insert-@end: Inserting. +* texinfo-insert-@example: Inserting. +* texinfo-insert-@item: Inserting. +* texinfo-insert-@kbd: Inserting. +* texinfo-insert-@node: Inserting. +* texinfo-insert-@noindent: Inserting. +* texinfo-insert-@samp: Inserting. +* texinfo-insert-@table: Inserting. +* texinfo-insert-@var: Inserting. +* texinfo-insert-braces: Inserting. +* texinfo-insert-node-lines: Other Updating Commands. +* texinfo-make-menu: Updating Commands. +* texinfo-master-menu: Updating Commands. +* texinfo-multiple-files-update: texinfo-multiple-files-update. +* texinfo-multiple-files-update (in brief): Other Updating Commands. +* texinfo-sequential-node-update: Other Updating Commands. +* texinfo-show-structure <1>: Showing the Structure. +* texinfo-show-structure: Using texinfo-show-structure. +* texinfo-start-menu-description: Inserting. +* texinfo-tex-buffer: Printing. +* texinfo-tex-print: Printing. +* texinfo-tex-region: Printing. +* texinfo-update-node: Updating Commands. +* thischapter: Custom Headings. +* thischaptername: Custom Headings. +* thisfile: Custom Headings. +* thispage: Custom Headings. +* thistitle: Custom Headings. +* tieaccent: Inserting Accents. +* tindex: Indexing Commands. +* title: title subtitle author. +* titlefont: titlefont center sp. +* titlepage: titlepage. +* today: Custom Headings. +* top (@-command): makeinfo top command. +* u: Inserting Accents. +* ubaraccent: Inserting Accents. +* udotaccent: Inserting Accents. +* unmacro: Defining Macros. +* unnumbered: unnumbered & appendix. +* unnumberedsec: unnumberedsec appendixsec heading. +* unnumberedsubsec: unnumberedsubsec appendixsubsec subheading. +* unnumberedsubsubsec: subsubsection. +* up-list: Inserting. +* uref: uref. +* url: url. +* v: Inserting Accents. +* value: value. +* var: var. +* vindex: Indexing Commands. +* vskip: Copyright & Permissions. +* vtable: ftable vtable. +* w (prevent line break): w. +* xref: xref. +* { (single {): Inserting Braces. +* } (single }): Inserting Braces. +* ~: Inserting Accents. + diff --git a/info/texinfo.info-12 b/info/texinfo.info-12 new file mode 100644 index 0000000..84c76c7 --- /dev/null +++ b/info/texinfo.info-12 @@ -0,0 +1,641 @@ +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98 Free Software +Foundation, Inc. + + This edition is for Texinfo version 3.12. + + 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 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. + + +File: texinfo.info, Node: Concept Index, Prev: Command and Variable Index, Up: Top + +Concept Index +************* + +* Menu: + +* !: Inserting Accents. +* (dir) as Up node of Top node: First Node. +* -D VAR: makeinfo options. +* -delete: Invoking install-info. +* -dir-file=NAME: Invoking install-info. +* -entry=TEXT: Invoking install-info. +* -error-limit=LIMIT: makeinfo options. +* -fill-column=WIDTH: makeinfo options. +* -footnote-style=STYLE: makeinfo options. +* -force: makeinfo options. +* -help <1>: makeinfo options. +* -help: Invoking install-info. +* -I DIR: makeinfo options. +* -info-dir=DIR: Invoking install-info. +* -info-file=FILE: Invoking install-info. +* -item=TEXT: Invoking install-info. +* -no-headers: makeinfo options. +* -no-number-footnotes: makeinfo options. +* -no-pointer-validate: makeinfo options. +* -no-split: makeinfo options. +* -no-validate: makeinfo options. +* -no-warn: makeinfo options. +* -o FILE: makeinfo options. +* -output=FILE: makeinfo options. +* -P DIR: makeinfo options. +* -paragraph-indent=INDENT: makeinfo options. +* -quiet: Invoking install-info. +* -reference-limit=LIMIT: makeinfo options. +* -remove: Invoking install-info. +* -section=SEC: Invoking install-info. +* -verbose: makeinfo options. +* -version <1>: Invoking install-info. +* -version: makeinfo options. +* .cshrc initialization file: Preparing for TeX. +* .profile initialization file: Preparing for TeX. +* ?: Inserting Accents. +* @-command in nodename: Node Line Requirements. +* @-command list: Command List. +* @-command syntax: Command Syntax. +* @-commands: Formatting Commands. +* @include file sample: Sample Include File. +* @menu parts: Menu Parts. +* @node line writing: Writing a Node. +* A4 paper, printing on: A4 Paper. +* aa: Inserting Accents. +* AA: Inserting Accents. +* Abbreviations for keys: key. +* Accents, inserting: Inserting Accents. +* Acute accent: Inserting Accents. +* Adding a new info file: New Info File. +* AE: Inserting Accents. +* ae: Inserting Accents. +* Alphabetical @-command list: Command List. +* Another Info directory: Other Info Directories. +* Apostrophe in nodename: Node Line Requirements. +* Arguments, repeated and optional: Optional Arguments. +* Aspect ratio of images: Images. +* Automatic pointer creation with makeinfo: makeinfo Pointer Creation. +* Automatically insert nodes, menus: Updating Nodes and Menus. +* Backslash, and macros: Invoking Macros. +* Badly referenced nodes: Running Info-Validate. +* Batch formatting for Info: Batch Formatting. +* Beginning a Texinfo file: Beginning a File. +* Beginning line of a Texinfo file: First Line. +* Berry, Karl: Acknowledgements. +* Big points: Images. +* Black rectangle in hardcopy: Overfull hboxes. +* Blank lines: sp. +* Body of a macro: Defining Macros. +* Book characteristics, printed: Printed Books. +* Book, printing small: smallbook. +* Box with rounded corners: cartouche. +* Braces and argument syntax: Command Syntax. +* Braces, inserting: Braces Atsigns. +* Braces, when to use: Formatting Commands. +* Breaks in a line: Line Breaks. +* Breve accent: Inserting Accents. +* Buffer formatting and printing: Printing. +* Bullets, inserting: Dots Bullets. +* Case in nodename: Node Line Requirements. +* Catching errors with Info formatting: Debugging with Info. +* Catching errors with TeX formatting: Debugging with TeX. +* Catching mistakes: Catching Mistakes. +* Cedilla accent: Inserting Accents. +* Centimeters: Images. +* Chapter structuring: Structuring. +* Characteristics, printed books or manuals: Printed Books. +* Chassell, Robert J.: Acknowledgements. +* Check accent: Inserting Accents. +* Checking for badly referenced nodes: Running Info-Validate. +* Ciceros: Images. +* Circumflex accent: Inserting Accents. +* code, arg to @kbdinputstyle: kbd. +* colon last in INFOPATH: Other Info Directories. +* Column widths, defining for multitables: Multitable Column Widths. +* Combining indices: Combining Indices. +* Comma in nodename: Node Line Requirements. +* Command definitions: Sample Function Definition. +* Commands to insert special characters: Braces Atsigns. +* Commands using raw HTML: Raw Formatter Commands. +* Commands using raw TeX: Raw Formatter Commands. +* Commands, inserting them: Inserting. +* Comments: Comments. +* Compile command for formatting: Compile-Command. +* Conditionally visible text: Conditionals. +* Conditions for copying Texinfo: Copying. +* Contents, Table of: Contents. +* Contents-like outline of file structure: Showing the Structure. +* Conventions for writing definitions: Def Cmd Conventions. +* Conventions, syntactic: Conventions. +* Copying conditions: Copying. +* Copying permissions: Sample Permissions. +* Copying software: Software Copying Permissions. +* Copyright page: Copyright & Permissions. +* Correcting mistakes: Catching Mistakes. +* Create nodes, menus automatically: Updating Nodes and Menus. +* Creating an Info file: Create an Info File. +* Creating an unsplit file: Unsplit. +* Creating index entries: Indexing Commands. +* Creating indices: Indices. +* Creating pointers with makeinfo: makeinfo Pointer Creation. +* Cropmarks for printing: Cropmarks and Magnification. +* Cross reference parts: Cross Reference Parts. +* Cross references: Cross References. +* Cross references using @inforef: inforef. +* Cross references using @pxref: pxref. +* Cross references using @ref: ref. +* Cross references using @xref: xref. +* Customized highlighting: Customized Highlighting. +* Customizing of TeX for Texinfo: Preparing for TeX. +* Debugging the Texinfo structure: Catching Mistakes. +* Debugging with Info formatting: Debugging with Info. +* Debugging with TeX formatting: Debugging with TeX. +* Defining indexing entries: Indexing Commands. +* Defining macros: Defining Macros. +* Defining new indices: New Indices. +* Defining new Texinfo commands: Macros. +* Definition commands: Definition Commands. +* Definition conventions: Def Cmd Conventions. +* Definition template: Def Cmd Template. +* Definitions grouped together: deffnx. +* Description for menu, start: Inserting. +* Did^ot points: Images. +* Different cross reference commands: Cross Reference Commands. +* Dimension formatting: dmn. +* Dimensions and image sizes: Images. +* dir directory for Info installation: Install an Info File. +* dir file listing: New Info File. +* dir, created by install-info: Invoking install-info. +* Display formatting: display. +* distinct, arg to @kbdinputstyle: kbd. +* Distorting images: Images. +* Distribution: Software Copying Permissions. +* Dot accent: Inserting Accents. +* Dotless i, j: Inserting Accents. +* Dots, inserting <1>: dots. +* Dots, inserting: Dots Bullets. +* Double-colon menu entries: Less Cluttered Menu Entry. +* DVI file: Format with tex/texindex. +* Ellipsis, inserting: Dots Bullets. +* Emacs: Texinfo Mode. +* Emacs shell, format, print from: Within Emacs. +* Emphasizing text: Emphasis. +* Emphasizing text, font for: emph & strong. +* Enclosure command for Info: Customized Highlighting. +* End node footnote style: Footnote Styles. +* End of header line: End of Header. +* End titlepage starts headings: end titlepage. +* Ending a Sentence: Ending a Sentence. +* Ending a Texinfo file: Ending a File. +* Entries for an index: Indexing Commands. +* Entries, making index: Index Entries. +* Enumeration: enumerate. +* epsf.tex: Images. +* epsf.tex, installing: Preparing for TeX. +* Equivalence, indicating it: Equivalence. +* Error message, indicating it: Error Glyph. +* Errors, parsing: makeinfo in Emacs. +* Es-zet: Inserting Accents. +* European A4 paper: A4 Paper. +* Evaluation glyph: result. +* Example for a small book: smallexample & smalllisp. +* Example menu: Menu Example. +* example, arg to @kbdinputstyle: kbd. +* Examples, formatting them: example. +* Expansion, indicating it: expansion. +* File beginning: Beginning a File. +* File ending: Ending a File. +* File section structure, showing it: Showing the Structure. +* Filling paragraphs: Refilling Paragraphs. +* Final output: Overfull hboxes. +* Finding badly referenced nodes: Running Info-Validate. +* Fine-tuning, and hyphenation: - and hyphenation. +* First line of a Texinfo file: First Line. +* First node: First Node. +* Floating accents, inserting: Inserting Accents. +* Fonts for indices: syncodeindex. +* Fonts for printing, not for Info: Fonts. +* Footings: Headings. +* Footnotes: Footnotes. +* Format a dimension: dmn. +* Format and print hardcopy: Format/Print Hardcopy. +* Format and print in Texinfo mode: Texinfo Mode Printing. +* Format with the compile command: Compile-Command. +* Format, print from Emacs shell: Within Emacs. +* Formats for images: Images. +* Formatting a file for Info: Create an Info File. +* Formatting commands: Formatting Commands. +* Formatting examples: example. +* Formatting for Info: Info Formatting. +* Formatting for printing: Printing. +* Formatting headings and footings: Headings. +* Formatting requirements: Requirements Summary. +* Formatting with tex and texindex: Format with tex/texindex. +* Frequently used commands, inserting: Inserting. +* Function definitions: Sample Function Definition. +* General syntactic conventions: Conventions. +* Generating menus with indices: Printing Indices & Menus. +* German S: Inserting Accents. +* Globbing: Format with tex/texindex. +* Glyphs: Glyphs. +* GNU Emacs: Texinfo Mode. +* GNU Emacs shell, format, print from: Within Emacs. +* Going to other Info files' nodes: Other Info Files. +* Grave accent: Inserting Accents. +* Group (hold text together vertically): group. +* Grouping two definitions together: deffnx. +* Hardcopy, printing it: Format/Print Hardcopy. +* hboxes, overfull: Overfull hboxes. +* Header for Texinfo files: Header. +* Header of a Texinfo file: First Line. +* Headings: Headings. +* Headings, page, begin to appear: end titlepage. +* Height of images: Images. +* Highlighting text: Indicating. +* Highlighting, customized: Customized Highlighting. +* Hints: Tips. +* Holding text together vertically: group. +* HTML commands, using ordinary: Raw Formatter Commands. +* Hungariam umlaut accent: Inserting Accents. +* Hyphenation, helping TeX do: - and hyphenation. +* Hyphenation, preventing: w. +* i: Inserting Accents. +* If text conditionally visible: Conditionals. +* ifinfo permissions: ifinfo Permissions. +* Ignored before @setfilename: setfilename. +* Ignored text: Comments. +* Image formats: Images. +* Images, inserting: Images. +* Inches: Images. +* Include file requirements: Include File Requirements. +* Include file sample: Sample Include File. +* Include files: Include Files. +* Include files, and section levels: Raise/lower sections. +* Indentation undoing: exdent. +* Indenting paragraphs: paragraphindent. +* Index entries: Indexing Commands. +* Index entries, making: Index Entries. +* Index entry writing: Indexing Commands. +* Index font types: Indexing Commands. +* Indexing commands, predefined: Indexing Commands. +* Indexing table entries automatically: ftable vtable. +* Indicating commands, definitions, etc.: Indicating. +* Indicating evaluation: result. +* Indices: Indices. +* Indices, combining them: Combining Indices. +* Indices, defining new: New Indices. +* Indices, printing and menus: Printing Indices & Menus. +* Indices, sorting: Format/Print Hardcopy. +* Indices, two letter names: syncodeindex. +* Indirect subfiles: Tag and Split Files. +* Info batch formatting: Batch Formatting. +* Info file installation: Install an Info File. +* Info file requires @setfilename: setfilename. +* Info file, listing new one: New Info File. +* Info file, splitting manually: Splitting. +* Info files: Info Files. +* Info formatting: Info Formatting. +* Info installed in another directory: Other Info Directories. +* Info validating a large file: Using Info-validate. +* Info, creating an on-line file: Create an Info File. +* Info-directory-list: Other Info Directories. +* Info; other files' nodes: Other Info Files. +* INFOPATH: Other Info Directories. +* Initialization file for TeX input: Preparing for TeX. +* Insert nodes, menus automatically: Updating Nodes and Menus. +* Inserting @, braces: Braces Atsigns. +* Inserting accents: Inserting Accents. +* Inserting dots <1>: Dots Bullets. +* Inserting dots: dots. +* Inserting ellipsis: Dots Bullets. +* Inserting frequently used commands: Inserting. +* Inserting space: Inserting Space. +* Inserting special characters and symbols: Insertions. +* install-info: Invoking install-info. +* Installing an Info file: Install an Info File. +* Installing Info in another directory: Other Info Directories. +* Introduction, as part of file: Software Copying Permissions. +* Invoking macros: Invoking Macros. +* Itemization: itemize. +* j: Inserting Accents. +* keyboard input: kbd. +* Keys, recommended names: key. +* Knuth, Donald: Printed Books. +* l/: Inserting Accents. +* L/: Inserting Accents. +* Larger or smaller pages: Cropmarks and Magnification. +* Less cluttered menu entry: Less Cluttered Menu Entry. +* License agreement: Software Copying Permissions. +* Line breaks: Line Breaks. +* Line breaks, preventing: w. +* Line length, column widths as fraction of: Multitable Column Widths. +* Line spacing: sp. +* Lisp example: Lisp Example. +* Lisp example for a small book: smallexample & smalllisp. +* List of @-commands: Command List. +* Listing a new info file: New Info File. +* Lists and tables, making: Lists and Tables. +* Local variables: Compile-Command. +* Location of menus: Menu Location. +* Looking for badly referenced nodes: Running Info-Validate. +* lpr (DVI print command): Print with lpr. +* Macro definitions <1>: Sample Function Definition. +* Macro definitions: Defining Macros. +* Macro invocation: Invoking Macros. +* Macron accent: Inserting Accents. +* Macros: Macros. +* Macros, undefining: Defining Macros. +* Magnified printing: Cropmarks and Magnification. +* mailto link: email. +* makeinfo inside Emacs: makeinfo in Emacs. +* makeinfo options: makeinfo options. +* Making a printed manual: Format/Print Hardcopy. +* Making a tag table automatically: Tag and Split Files. +* Making a tag table manually: Unsplit. +* Making cross references: Cross References. +* Making line and page breaks: Breaks. +* Making lists and tables: Lists and Tables. +* Manual characteristics, printed: Printed Books. +* Marking text within a paragraph: Marking Text. +* Marking words and phrases: Marking Text. +* Master menu: The Top Node. +* Master menu parts: Master Menu Parts. +* Mathematical expressions <1>: Raw Formatter Commands. +* Mathematical expressions: math. +* Menu description, start: Inserting. +* Menu entries with two colons: Less Cluttered Menu Entry. +* Menu example: Menu Example. +* Menu location: Menu Location. +* Menu parts: Menu Parts. +* Menu writing: Writing a Menu. +* Menus: Menus. +* Menus generated with indices: Printing Indices & Menus. +* META key: key. +* Meta-syntactic chars for arguments: Optional Arguments. +* Millimeters: Images. +* Minimal requirements for formatting: Requirements Summary. +* Minimal Texinfo file (requirements): Minimum. +* Mistakes, catching: Catching Mistakes. +* Mode, using Texinfo: Texinfo Mode. +* Multiple spaces: Multiple Spaces. +* Multitable column widths: Multitable Column Widths. +* Multitable rows: Multitable Rows. +* Must have in Texinfo file: Minimum. +* Mutually recursive macros: Defining Macros. +* Names for indices: syncodeindex. +* Names of index files: Format with tex/texindex. +* Names recommended for keys: key. +* Naming a `Top' Node in references: Top Node Naming. +* Need space at page bottom: need. +* New index defining: New Indices. +* New info file, listing it in dir file: New Info File. +* New Texinfo commands, defining: Macros. +* Node line requirements: Node Line Requirements. +* Node line writing: Writing a Node. +* Node, `Top': The Top Node. +* Node, defined: node. +* Nodename must be unique: Node Line Requirements. +* Nodename, cannot contain: Node Line Requirements. +* Nodes for menus are short: Menu Location. +* Nodes in other Info files: Other Info Files. +* Nodes, catching mistakes: Catching Mistakes. +* Nodes, checking for badly referenced: Running Info-Validate. +* Not ending a sentence: Not Ending a Sentence. +* o/: Inserting Accents. +* O/: Inserting Accents. +* Obtaining TeX: Obtaining TeX. +* Occurrences, listing with @occur: Using occur. +* OE: Inserting Accents. +* oe: Inserting Accents. +* Optional and repeated arguments: Optional Arguments. +* Options for makeinfo: makeinfo options. +* Ordinary HTML commands, using: Raw Formatter Commands. +* Ordinary TeX commands, using: Raw Formatter Commands. +* Other Info files' nodes: Other Info Files. +* Outline of file structure, showing it: Showing the Structure. +* Overfull hboxes: Overfull hboxes. +* Overview of Texinfo: Overview. +* Page breaks: page. +* Page delimiter in Texinfo mode: Showing the Structure. +* Page headings: Headings. +* Page numbering: Headings. +* Page sizes for books: smallbook. +* page-delimiter: Showing the Structure. +* Pages, starting odd: setchapternewpage. +* Paper size, European A4: A4 Paper. +* Paragraph indentation: paragraphindent. +* Paragraph, marking text within: Marking Text. +* Parsing errors: makeinfo in Emacs. +* Part of file formatting and printing: Printing. +* Parts of a cross reference: Cross Reference Parts. +* Parts of a master menu: Master Menu Parts. +* Parts of a menu: Menu Parts. +* Periods, inserting: Not Ending a Sentence. +* Permissions: Sample Permissions. +* Permissions, printed: Copyright & Permissions. +* Picas: Images. +* Pictures, inserting: Images. +* Pinard, Franc,ois: Acknowledgements. +* plain TeX: Raw Formatter Commands. +* Point, indicating it in a buffer: Point Glyph. +* Pointer creation with makeinfo: makeinfo Pointer Creation. +* Pointer validation with makeinfo: Pointer Validation. +* Points (dimension): Images. +* Predefined indexing commands: Indexing Commands. +* Predefined names for indices: syncodeindex. +* Preparing to use TeX: Preparing for TeX. +* Preventing line and page breaks: Breaks. +* Previous node of Top node: First Node. +* Print and format in Texinfo mode: Texinfo Mode Printing. +* Print, format from Emacs shell: Within Emacs. +* Printed book and manual characteristics: Printed Books. +* Printed output, indicating it: Print Glyph. +* Printed permissions: Copyright & Permissions. +* Printing a region or buffer: Printing. +* Printing an index: Printing Indices & Menus. +* Printing cropmarks: Cropmarks and Magnification. +* Problems, catching: Catching Mistakes. +* Prototype row, column widths defined by: Multitable Column Widths. +* Quotations: quotation. +* Raising and lowering sections: Raise/lower sections. +* Raw formatter commands: Raw Formatter Commands. +* Recommended names for keys: key. +* Rectangle, ugly, black in hardcopy: Overfull hboxes. +* Recursion, mutual: Defining Macros. +* References: Cross References. +* References using @inforef: inforef. +* References using @pxref: pxref. +* References using @ref: ref. +* References using @xref: xref. +* Referring to other Info files: Other Info Files. +* Refilling paragraphs: Refilling Paragraphs. +* Region formatting and printing: Printing. +* Region printing in Texinfo mode: Texinfo Mode Printing. +* Repeated and optional arguments: Optional Arguments. +* Required in Texinfo file: Minimum. +* Requirements for formatting: Requirements Summary. +* Requirements for include files: Include File Requirements. +* Requirements for updating commands: Updating Requirements. +* Result of an expression: result. +* ridt.eps: Images. +* Ring accent: Inserting Accents. +* Rows, of a multitable: Multitable Rows. +* Running an Info formatter: Info Formatting. +* Running Info-validate: Using Info-validate. +* Running makeinfo in Emacs: makeinfo in Emacs. +* Sample @include file: Sample Include File. +* Sample function definition: Sample Function Definition. +* Sample Texinfo file: Short Sample. +* Sample Texinfo file, no comments: Sample Texinfo File. +* Scaled points: Images. +* Section structure of a file, showing it: Showing the Structure. +* Sections, raising and lowering: Raise/lower sections. +* Sentence ending punctuation: Ending a Sentence. +* Sentence non-ending punctuation: Not Ending a Sentence. +* Separate footnote style: Footnote Styles. +* Sharp S: Inserting Accents. +* Shell formatting with tex and texindex: Format with tex/texindex. +* Shell, format, print from: Within Emacs. +* Shell, running makeinfo in: makeinfo in Emacs. +* Short nodes for menus: Menu Location. +* Showing the section structure of a file: Showing the Structure. +* Showing the structure of a file: Using texinfo-show-structure. +* Site-wide Texinfo configuration file: Preparing for TeX. +* Size of printed book: smallbook. +* slanted typewriter font, for @kbd: kbd. +* Small book example: smallexample & smalllisp. +* Small book size: smallbook. +* Small caps font: Smallcaps. +* Software copying permissions: Software Copying Permissions. +* Sorting indices: Format/Print Hardcopy. +* Spaces (blank lines): sp. +* Spacing, inserting: Inserting Space. +* Special characters, commands to insert: Braces Atsigns. +* Special insertions: Insertions. +* Special typesetting commands: Dots Bullets. +* Specifying index entries: Indexing Commands. +* Splitting an Info file manually: Splitting. +* ss: Inserting Accents. +* Stallman, Richard M.: Acknowledgements. +* Start of header line: Start of Header. +* Starting chapters: setchapternewpage. +* Structure of a file, showing it: Showing the Structure. +* Structure, catching mistakes in: Catching Mistakes. +* Structuring of chapters: Structuring. +* Subsection-like commands: unnumberedsubsec appendixsubsec subheading. +* Subsub commands: subsubsection. +* Syntactic conventions: Conventions. +* Syntax, optional & repeated arguments: Optional Arguments. +* tab: Multitable Rows. +* Table of contents: Contents. +* Tables and lists, making: Lists and Tables. +* Tables with indexes: ftable vtable. +* Tables, making multi-column: Multi-column Tables. +* Tables, making two-column: Two-column Tables. +* Tabs; don't use!: Conventions. +* Tag table, making automatically: Tag and Split Files. +* Tag table, making manually: Unsplit. +* Template for a definition: Def Cmd Template. +* TeX commands, using ordinary: Raw Formatter Commands. +* TeX index sorting: Format/Print Hardcopy. +* TeX input initialization: Preparing for TeX. +* TeX, how to obtain: Obtaining TeX. +* texi2dvi: Format with tex/texindex. +* texi2dvi (shell script): Format with texi2dvi. +* texindex <1>: Format/Print Hardcopy. +* texindex: Format with tex/texindex. +* Texinfo commands, defining new: Macros. +* Texinfo file beginning: Beginning a File. +* Texinfo file ending: Ending a File. +* Texinfo file header: Header. +* Texinfo file minimum: Minimum. +* Texinfo file section structure, showing it: Showing the Structure. +* Texinfo mode: Texinfo Mode. +* Texinfo overview: Overview. +* Texinfo printed book characteristics: Printed Books. +* texinfo.cnf <1>: A4 Paper. +* texinfo.cnf: setfilename. +* texinfo.cnf installation: Preparing for TeX. +* texinfo.tex, installing: Preparing for TeX. +* TEXINPUTS: Preparing for TeX. +* TEXINPUTS environment variable: Preparing for TeX. +* Text, conditionally visible: Conditionals. +* Thin space between number, dimension: dmn. +* Tie-after accent: Inserting Accents. +* Tilde accent: Inserting Accents. +* Tips: Tips. +* Title page: titlepage. +* Titlepage end starts headings: end titlepage. +* Titlepage permissions: Titlepage Permissions. +* Top node: The Top Node. +* Top node is first: First Node. +* Top node naming for references: Top Node Naming. +* Top node summary: Top Node Summary. +* Tree structuring: Tree Structuring. +* Two `First' Lines for @deffn: deffnx. +* Two letter names for indices: syncodeindex. +* Two named items for @table: itemx. +* Two part menu entry: Less Cluttered Menu Entry. +* Typesetting commands for dots, etc.: Dots Bullets. +* Umlaut accent: Inserting Accents. +* Uncluttered menu entry: Less Cluttered Menu Entry. +* Undefining macros: Defining Macros. +* Underbar accent: Inserting Accents. +* Underdot accent: Inserting Accents. +* Uniform resource locator, indicating: url. +* Uniform resource locator, referring to: uref. +* Unique nodename requirement: Node Line Requirements. +* Unprocessed text: Comments. +* Unsplit file creation: Unsplit. +* Up node of Top node: First Node. +* Updating nodes and menus: Updating Nodes and Menus. +* Updating requirements: Updating Requirements. +* URL, indicating: url. +* URL, referring to: uref. +* Usage tips: Tips. +* user input: kbd. +* User options, marking: Variables Commands. +* User-defined Texinfo commands: Macros. +* Validating a large file: Using Info-validate. +* Validation of pointers: Pointer Validation. +* Value of an expression, indicating: result. +* version number, finding: Invoking install-info. +* Vertical whitespace (vskip): Copyright & Permissions. +* Vertically holding text together: group. +* Visibility of conditional text: Conditionals. +* Weisshaus, Melissa: Acknowledgements. +* Whitespace, inserting <1>: Inserting Space. +* Whitespace, inserting: Multiple Spaces. +* Width of images: Images. +* Widths, defining multitable column: Multitable Column Widths. +* Wildcards: Format with tex/texindex. +* Words and phrases, marking them: Marking Text. +* Writing a menu: Writing a Menu. +* Writing an @node line: Writing a Node. +* Writing index entries: Indexing Commands. +* Zuhn, David D.: Acknowledgements. + + diff --git a/info/texinfo.info-13 b/info/texinfo.info-13 new file mode 100644 index 0000000..723db70 --- /dev/null +++ b/info/texinfo.info-13 @@ -0,0 +1,795 @@ +This is ../info/texinfo.info, produced by makeinfo version 4.0 from +texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Update info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Print Texinfo documents. +* texindex: (texinfo)Format with tex/texindex. Sort Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both online information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98, 99 Free Software +Foundation, Inc. + + This edition is for Texinfo version 4.0, 28 September 1999. + + 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 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. + + +File: texinfo.info, Node: Concept Index, Prev: Command and Variable Index, Up: Top + +Concept Index +************* + +* Menu: + +* !: Inserting Accents. +* (dir) as Up node of Top node: First Node. +* --commands-in-node-names: makeinfo options. +* --delete: Invoking install-info. +* --dir-file=NAME: Invoking install-info. +* --entry=TEXT: Invoking install-info. +* --error-limit=LIMIT: makeinfo options. +* --fill-column=WIDTH: makeinfo options. +* --footnote-style=STYLE: makeinfo options. +* --force: makeinfo options. +* --help <1>: Invoking install-info. +* --help: makeinfo options. +* --info-dir=DIR: Invoking install-info. +* --info-file=FILE: Invoking install-info. +* --item=TEXT: Invoking install-info. +* --no-headers: makeinfo options. +* --no-number-footnotes: makeinfo options. +* --no-pointer-validate: makeinfo options. +* --no-split: makeinfo options. +* --no-validate: makeinfo options. +* --no-warn: makeinfo options. +* --number-sections: makeinfo options. +* --output=FILE: makeinfo options. +* --paragraph-indent=INDENT: makeinfo options. +* --quiet: Invoking install-info. +* --reference-limit=LIMIT: makeinfo options. +* --remove: Invoking install-info. +* --section=SEC: Invoking install-info. +* --verbose: makeinfo options. +* --version <1>: Invoking install-info. +* --version: makeinfo options. +* -D DIR: Invoking install-info. +* -d NAME: Invoking install-info. +* -D VAR: makeinfo options. +* -e LIMIT: makeinfo options. +* -e TEXT: Invoking install-info. +* -F: makeinfo options. +* -f WIDTH: makeinfo options. +* -h <1>: Invoking install-info. +* -h: makeinfo options. +* -I DIR: makeinfo options. +* -i FILE: Invoking install-info. +* -o FILE: makeinfo options. +* -P DIR: makeinfo options. +* -p INDENT: makeinfo options. +* -r: Invoking install-info. +* -r LIMIT: makeinfo options. +* -s SEC: Invoking install-info. +* -s STYLE: makeinfo options. +* -V <1>: makeinfo options. +* -V: Invoking install-info. +* .cshrc initialization file: Preparing for TeX. +* .profile initialization file: Preparing for TeX. +* /L: Inserting Accents. +* /l: Inserting Accents. +* /o: Inserting Accents. +* /O: Inserting Accents. +* : last in INFOPATH: Other Info Directories. +* : dots. +* Dots, inserting: Dots Bullets. +* Double-colon menu entries: Less Cluttered Menu Entry. +* Dumping a .fmt file: Preparing for TeX. +* DVI file: Format with tex/texindex. +* Ellipsis, inserting: Dots Bullets. +* Emacs: Texinfo Mode. +* Emacs shell, format, print from: Within Emacs. +* Emphasizing text: Emphasis. +* Emphasizing text, font for: emph & strong. +* Encoding, declaring: documentencoding. +* End node footnote style: Footnote Styles. +* End of header line: End of Header. +* End titlepage starts headings: end titlepage. +* Ending a Sentence: Ending a Sentence. +* Ending a Texinfo file: Ending a File. +* Entries for an index: Indexing Commands. +* Entries, making index: Index Entries. +* Enumeration: enumerate. +* Environment indentation: exampleindent. +* epsf.tex: Images. +* epsf.tex, installing: Preparing for TeX. +* Equivalence, indicating it: Equivalence. +* Error message, indicating it: Error Glyph. +* Errors, parsing: makeinfo in Emacs. +* Es-zet: Inserting Accents. +* European A4 paper: A4 Paper. +* Evaluation glyph: result. +* Example for a small book: small. +* Example indentation: exampleindent. +* Example menu: Menu Example. +* example, arg to @kbdinputstyle: kbd. +* Examples, formatting them: example. +* Expanding macros: Invoking Macros. +* Expansion, indicating it: expansion. +* Expressions in a program, indicating: code. +* F.B.I., as acronym: acronym. +* File beginning: Beginning a File. +* File ending: Ending a File. +* File section structure, showing it: Showing the Structure. +* Filling paragraphs: Refilling Paragraphs. +* Final output: Overfull hboxes. +* Finding badly referenced nodes: Running Info-Validate. +* Fine-tuning, and hyphenation: - and hyphenation. +* First line of a Texinfo file: First Line. +* First node: First Node. +* Floating accents, inserting: Inserting Accents. +* Flooding: pxref. +* Fonts for indices: syncodeindex. +* Fonts for printing, not for Info: Fonts. +* Footings: Headings. +* Footnotes: Footnotes. +* Format a dimension: dmn. +* Format and print hardcopy: Hardcopy. +* Format and print in Texinfo mode: Texinfo Mode Printing. +* Format file, dumping: Preparing for TeX. +* Format with the compile command: Compile-Command. +* Format, print from Emacs shell: Within Emacs. +* Formats for images: Images. +* Formatting a file for Info: Creating an Info File. +* Formatting commands: Formatting Commands. +* Formatting examples: example. +* Formatting for Info: Info Formatting. +* Formatting for printing: Printing. +* Formatting headings and footings: Headings. +* Formatting requirements: Requirements Summary. +* Formatting with tex and texindex: Format with tex/texindex. +* Frequently used commands, inserting: Inserting. +* Function definitions: Sample Function Definition. +* General syntactic conventions: Conventions. +* Generating menus with indices: Printing Indices & Menus. +* Generating plain text files: makeinfo options. +* German S: Inserting Accents. +* GIF, unsupported due to patents: Images. +* Globbing: Format with tex/texindex. +* Glyphs: Glyphs. +* GNU Emacs: Texinfo Mode. +* GNU Emacs shell, format, print from: Within Emacs. +* Going to other Info files' nodes: Other Info Files. +* Grave accent: Inserting Accents. +* Group (hold text together vertically): group. +* Grouping two definitions together: deffnx. +* Hardcopy, printing it: Hardcopy. +* hboxes, overfull: Overfull hboxes. +* Header for Texinfo files: Header. +* Header of a Texinfo file: First Line. +* Headings: Headings. +* Headings, page, begin to appear: end titlepage. +* Height of images: Images. +* Height of text area: pagesizes. +* help2man: Using Texinfo. +* Highlighting text: Indicating. +* Highlighting, customized: definfoenclose. +* Hints: Tips. +* History of Texinfo: Acknowledgements and History. +* Holding text together vertically: group. +* href, producing HTML: uref. +* HTML: makeinfo html. +* HTML commands, using ordinary: Raw Formatter Commands. +* http-equiv, and charset: documentencoding. +* Hungarian umlaut accent: Inserting Accents. +* Hurricanes: ref. +* Hyphenation patterns, language-dependent: documentlanguage. +* Hyphenation, helping TeX do: - and hyphenation. +* Hyphenation, preventing: w. +* i: Inserting Accents. +* If text conditionally visible: Conditionals. +* ifinfo permissions: ifinfo Permissions. +* Ignored before @setfilename: setfilename. +* Ignored text: Comments. +* Image formats: Images. +* Images, inserting: Images. +* Inches: Images. +* Include file requirements: Include File Requirements. +* Include file sample: Sample Include File. +* Include files: Include Files. +* Include files, and section levels: Raise/lower sections. +* Indentation undoing: exdent. +* Indenting environments: exampleindent. +* Indenting paragraphs: paragraphindent. +* Index entries: Indexing Commands. +* Index entries, making: Index Entries. +* Index entry writing: Indexing Commands. +* Index file names: Format with tex/texindex. +* Index font types: Indexing Commands. +* Indexing commands, predefined: Indexing Commands. +* Indexing table entries automatically: ftable vtable. +* Indicating commands, definitions, etc.: Indicating. +* Indicating evaluation: result. +* Indices: Indices. +* Indices, combining them: Combining Indices. +* Indices, defining new: New Indices. +* Indices, printing and menus: Printing Indices & Menus. +* Indices, sorting: Hardcopy. +* Indices, two letter names: syncodeindex. +* Indirect subfiles: Tag and Split Files. +* Info batch formatting: Batch Formatting. +* Info file installation: Install an Info File. +* Info file requires @setfilename: setfilename. +* Info file, listing a new: New Info File. +* Info file, splitting manually: Splitting. +* Info files: Info Files. +* Info formatting: Info Formatting. +* Info installed in another directory: Other Info Directories. +* Info validating a large file: Using Info-validate. +* Info, creating an online file: Creating an Info File. +* Info-directory-list: Other Info Directories. +* Info; other files' nodes: Other Info Files. +* INFOPATH: Other Info Directories. +* Initialization file for TeX input: Preparing for TeX. +* Input encoding, declaring: documentencoding. +* Insert nodes, menus automatically: Updating Nodes and Menus. +* Inserting @, braces: Braces Atsigns. +* Inserting accents: Inserting Accents. +* Inserting dots <1>: Dots Bullets. +* Inserting dots: dots. +* Inserting ellipsis: Dots Bullets. +* Inserting frequently used commands: Inserting. +* Inserting space: Inserting Space. +* Inserting special characters and symbols: Insertions. +* INSTALL file, generating: makeinfo options. +* install-info: Invoking install-info. +* Installing an Info file: Install an Info File. +* Installing Info in another directory: Other Info Directories. +* Internationalization: Internationalization. +* Introduction to Texinfo: Using Texinfo. +* Introduction, as part of file: Software Copying Permissions. +* Invalid characters in node names: Node Line Requirements. +* Invoking macros: Invoking Macros. +* ISO 639 codes: documentlanguage. +* Itemization: itemize. +* j: Inserting Accents. +* JPEG image format: Images. +* Keyboard input: kbd. +* Keys, recommended names: key. +* Keywords, indicating: code. +* Knuth, Donald: Printed Books. +* Language codes: documentlanguage. +* Language, declaring: documentlanguage. +* Larger or smaller pages: Cropmarks and Magnification. +* Legal paper, printing on: pagesizes. +* Less cluttered menu entry: Less Cluttered Menu Entry. +* License agreement: Software Copying Permissions. +* Line breaks: Line Breaks. +* Line breaks, preventing: w. +* Line length, column widths as fraction of: Multitable Column Widths. +* Line spacing: sp. +* Lisp example: lisp. +* Lisp example for a small book: small. +* List of @-commands: Command List. +* Listing a new info file: New Info File. +* Lists and tables, making: Lists and Tables. +* Local variables: Compile-Command. +* Location of menus: Menu Location. +* Looking for badly referenced nodes: Running Info-Validate. +* lpr (DVI print command): Print with lpr. +* lpr-d, replacements on MS-DOS/MS-Windows: Print with lpr. +* Macro definitions <1>: Sample Function Definition. +* Macro definitions: Defining Macros. +* Macro details: Macro Details. +* Macro invocation: Invoking Macros. +* Macron accent: Inserting Accents. +* Macros: Defining New Texinfo Commands. +* Macros, undefining: Defining Macros. +* Magnified printing: Cropmarks and Magnification. +* mailto link: email. +* makeinfo: Using Texinfo. +* makeinfo inside Emacs: makeinfo in Emacs. +* makeinfo options: makeinfo options. +* Making a printed manual: Hardcopy. +* Making a tag table automatically: Tag and Split Files. +* Making a tag table manually: Unsplit. +* Making cross references: Cross References. +* Making line and page breaks: Breaks. +* Making lists and tables: Lists and Tables. +* Man page output, not supported: Using Texinfo. +* Man page, reference to: uref. +* Manual characteristics, printed: Printed Books. +* Margins on page, not controllable: pagesizes. +* Marking text within a paragraph: Marking Text. +* Marking words and phrases: Marking Text. +* Master menu: The Top Node. +* Master menu parts: Master Menu Parts. +* Mathematical expressions <1>: math. +* Mathematical expressions: Raw Formatter Commands. +* Menu description, start: Inserting. +* Menu entries with two colons: Less Cluttered Menu Entry. +* Menu example: Menu Example. +* Menu location: Menu Location. +* Menu parts: Menu Parts. +* Menu writing: Writing a Menu. +* Menus: Menus. +* Menus generated with indices: Printing Indices & Menus. +* meta HTML tag, and charset: documentencoding. +* META key: key. +* Meta-syntactic chars for arguments: Optional Arguments. +* Millimeters: Images. +* Minimal requirements for formatting: Requirements Summary. +* Minimal Texinfo file (requirements): Minimum. +* Mistakes, catching: Catching Mistakes. +* Mode, using Texinfo: Texinfo Mode. +* Multiple spaces: Multiple Spaces. +* Multitable column widths: Multitable Column Widths. +* Multitable rows: Multitable Rows. +* Must have in Texinfo file: Minimum. +* Mutually recursive macros: Defining Macros. +* Names for indices: syncodeindex. +* Names of index files: Format with tex/texindex. +* Names recommended for keys: key. +* Naming a `Top' Node in references: Top Node Naming. +* NASA, as acronym: acronym. +* Navigation links, omitting: makeinfo options. +* Need space at page bottom: need. +* New index defining: New Indices. +* New info file, listing it in dir file: New Info File. +* New Texinfo commands, defining: Defining New Texinfo Commands. +* Node line requirements: Node Line Requirements. +* Node line writing: Writing a Node. +* Node name must be unique: Node Line Requirements. +* Node name, should not contain @-commands: Node Line Requirements. +* Node names, choosing: Node Names. +* Node, `Top': The Top Node. +* Node, defined: node. +* Nodes for menus are short: Menu Location. +* Nodes in other Info files: Other Info Files. +* Nodes, catching mistakes: Catching Mistakes. +* Nodes, checking for badly referenced: Running Info-Validate. +* Non-breakable space: w. +* Not ending a sentence: Not Ending a Sentence. +* O'Dea, Brendan: Using Texinfo. +* Obtaining TeX: Obtaining TeX. +* Occurrences, listing with @occur: Using occur. +* OE: Inserting Accents. +* oe: Inserting Accents. +* Optional and repeated arguments: Optional Arguments. +* Options for makeinfo: makeinfo options. +* Ordinary HTML commands, using: Raw Formatter Commands. +* Ordinary TeX commands, using: Raw Formatter Commands. +* Other Info files' nodes: Other Info Files. +* Outline of file structure, showing it: Showing the Structure. +* Output file splitting: makeinfo options. +* Output formats, supporting more: Using Texinfo. +* Overfull hboxes: Overfull hboxes. +* Overview of Texinfo: Overview. +* Page breaks: page. +* Page delimiter in Texinfo mode: Showing the Structure. +* Page headings: Headings. +* Page numbering: Headings. +* Page sizes for books: smallbook. +* Page sizes, customized: pagesizes. +* page-delimiter: Showing the Structure. +* Pages, starting odd: setchapternewpage. +* Paper size, European A4: A4 Paper. +* Paragraph indentation: paragraphindent. +* Paragraph, marking text within: Marking Text. +* Paragraphs, filling: Refilling Paragraphs. +* Parameters to macros: Defining Macros. +* Parsing errors: makeinfo in Emacs. +* Part of file formatting and printing: Printing. +* Parts of a cross reference: Cross Reference Parts. +* Parts of a master menu: Master Menu Parts. +* Parts of a menu: Menu Parts. +* PDF output: PDF Output. +* pdftex: PDF Output. +* pdftex, and images: Images. +* Period in nodename: Node Line Requirements. +* Periods, inserting: Not Ending a Sentence. +* Permissions: Sample Permissions. +* Permissions, printed: Copyright & Permissions. +* Picas: Images. +* Pictures, inserting: Images. +* Pinard, Franc,ois: Acknowledgements and History. +* plain TeX: Raw Formatter Commands. +* Plain text output: makeinfo options. +* PNG image format: Images. +* Point, indicating in a buffer: Point Glyph. +* Pointer creation with makeinfo: makeinfo Pointer Creation. +* Pointer validation with makeinfo: Pointer Validation. +* Pointer validation, suppressing <1>: Format with tex/texindex. +* Pointer validation, suppressing: makeinfo options. +* Points (dimension): Images. +* Predefined indexing commands: Indexing Commands. +* Predefined names for indices: syncodeindex. +* Preparing for TeX: Preparing for TeX. +* Preventing line and page breaks: Breaks. +* Previous node of Top node: First Node. +* Print and format in Texinfo mode: Texinfo Mode Printing. +* Print, format from Emacs shell: Within Emacs. +* Printed book and manual characteristics: Printed Books. +* Printed output, indicating it: Print Glyph. +* Printed permissions: Copyright & Permissions. +* Printing a region or buffer: Printing. +* Printing an index: Printing Indices & Menus. +* Printing cropmarks: Cropmarks and Magnification. +* Printing DVI files, on MS-DOS/MS-Windows: Print with lpr. +* Printing hardcopy: Hardcopy. +* Problems, catching: Catching Mistakes. +* Program names, indicating: command. +* Prototype row, column widths defined by: Multitable Column Widths. +* Quotations: quotation. +* Raising and lowering sections: Raise/lower sections. +* Raw formatter commands: Raw Formatter Commands. +* Recommended names for keys: key. +* Rectangle, black in hardcopy: Overfull hboxes. +* Recursion, mutual: Defining Macros. +* Recursive macro invocations: Defining Macros. +* Reference to @-commands: Command List. +* References: Cross References. +* References using @inforef: inforef. +* References using @pxref: pxref. +* References using @ref: ref. +* References using @xref: xref. +* Referring to other Info files: Other Info Files. +* Refilling paragraphs: Refilling Paragraphs. +* Region formatting and printing: Printing. +* Region printing in Texinfo mode: Texinfo Mode Printing. +* Reid, Brian: Acknowledgements and History. +* Repeated and optional arguments: Optional Arguments. +* Reporting bugs: Reporting Bugs. +* Required in Texinfo file: Minimum. +* Requirements for formatting: Requirements Summary. +* Requirements for include files: Include File Requirements. +* Requirements for updating commands: Updating Requirements. +* Reserved words, indicating: code. +* Result of an expression: result. +* ridt.eps: Images. +* Ring accent: Inserting Accents. +* Rows, of a multitable: Multitable Rows. +* Running an Info formatter: Info Formatting. +* Running Info-validate: Using Info-validate. +* Running macros: Invoking Macros. +* Running makeinfo in Emacs: makeinfo in Emacs. +* Sample @include file: Sample Include File. +* Sample function definition: Sample Function Definition. +* Sample permissions: Sample Permissions. +* Sample Texinfo file: Short Sample. +* Sample Texinfo file, no comments: Sample Texinfo File. +* Scaled points: Images. +* Schwab, Andreas: Acknowledgements and History. +* Scribe: Acknowledgements and History. +* Sea surges: ref. +* Section structure of a file, showing it: Showing the Structure. +* Sections, raising and lowering: Raise/lower sections. +* Sentence ending punctuation: Ending a Sentence. +* Sentence non-ending punctuation: Not Ending a Sentence. +* Separate footnote style: Footnote Styles. +* SGML-tools output format: Using Texinfo. +* Sharp S: Inserting Accents. +* Shell formatting with tex and texindex: Format with tex/texindex. +* Shell printing, on MS-DOS/MS-Windows: Print with lpr. +* Shell, format, print from: Within Emacs. +* Shell, running makeinfo in: makeinfo in Emacs. +* Short nodes for menus: Menu Location. +* Short table of contents: Contents. +* Showing the section structure of a file: Showing the Structure. +* Showing the structure of a file: Using texinfo-show-structure. +* Site-wide Texinfo configuration file: Preparing for TeX. +* Size of printed book: smallbook. +* slanted typewriter font, for @kbd: kbd. +* Small book example: small. +* Small book size: smallbook. +* Small caps font: Smallcaps. +* Software copying permissions: Software Copying Permissions. +* Sorting indices: Hardcopy. +* Source file: Using Texinfo. +* Space, inserting horizontal: Multiple Spaces. +* Space, inserting vertical: sp. +* Spaces in macros: Defining Macros. +* Spaces, in menus: Writing a Menu. +* Spacing, inserting: Inserting Space. +* Special characters, commands to insert: Braces Atsigns. +* Special insertions: Insertions. +* Special typesetting commands: Dots Bullets. +* Specifying index entries: Indexing Commands. +* Splitting an Info file manually: Splitting. +* Splitting of output files: makeinfo options. +* ss: Inserting Accents. +* Stallman, Richard M.: Acknowledgements and History. +* Start of header line: Start of Header. +* Starting chapters: setchapternewpage. +* Structure of a file, showing it: Showing the Structure. +* Structure, catching mistakes in: Catching Mistakes. +* Structuring of chapters: Structuring. +* Subsection-like commands: unnumberedsubsec appendixsubsec subheading. +* Subsub commands: subsubsection. +* Suggestions for Texinfo, making: Reporting Bugs. +* Syntactic conventions: Conventions. +* Syntactic tokens, indicating: code. +* Syntax, of @-commands: Command Syntax. +* Syntax, optional & repeated arguments: Optional Arguments. +* Table of contents: Contents. +* Table of contents, after title page: Contents. +* Tables and lists, making: Lists and Tables. +* Tables with indexes: ftable vtable. +* Tables, making multi-column: Multi-column Tables. +* Tables, making two-column: Two-column Tables. +* Tabs; don't use!: Conventions. +* Tag table, making automatically: Tag and Split Files. +* Tag table, making manually: Unsplit. +* Targets for cross-references, arbitrary: anchor. +* Template for a definition: Def Cmd Template. +* TeX commands, using ordinary: Raw Formatter Commands. +* TeX index sorting: Hardcopy. +* TeX input initialization: Preparing for TeX. +* TeX, how to obtain: Obtaining TeX. +* texi2dvi: Format with tex/texindex. +* texi2dvi (shell script): Format with texi2dvi. +* texi2roff, unsupported software: Printed Books. +* texindex <1>: Hardcopy. +* texindex: Format with tex/texindex. +* Texinfo commands, defining new: Defining New Texinfo Commands. +* Texinfo file beginning: Beginning a File. +* Texinfo file ending: Ending a File. +* Texinfo file header: Header. +* Texinfo file minimum: Minimum. +* Texinfo file section structure, showing it: Showing the Structure. +* Texinfo mode: Texinfo Mode. +* Texinfo overview: Overview. +* Texinfo printed book characteristics: Printed Books. +* Texinfo, introduction to: Using Texinfo. +* texinfo.cnf: setfilename. +* texinfo.cnf installation: Preparing for TeX. +* texinfo.tex, installing: Preparing for TeX. +* TEXINPUTS: Preparing for TeX. +* TEXINPUTS environment variable: Preparing for TeX. +* Text width and height: pagesizes. +* Text, conditionally visible: Conditionals. +* Text, marking up: Marking Text. +* Thin space between number, dimension: dmn. +* Tie-after accent: Inserting Accents. +* Tied space: w. +* Tilde accent: Inserting Accents. +* Tips: Tips. +* Title page: titlepage. +* Title page, bastard: titlepage. +* Titlepage end starts headings: end titlepage. +* Titlepage permissions: Titlepage Permissions. +* Titlepage, for plain text: Titlepage & Copyright Page. +* Top node: The Top Node. +* Top node is first: First Node. +* Top node naming for references: Top Node Naming. +* Top node summary: Top Node Summary. +* Tree structuring: Tree Structuring. +* Two `First' Lines for @deffn: deffnx. +* Two letter names for indices: syncodeindex. +* Two named items for @table: itemx. +* Two part menu entry: Less Cluttered Menu Entry. +* txi-CC.tex: documentlanguage. +* Typesetting commands for dots, etc.: Dots Bullets. +* Ugly black rectangles in hardcopy: Overfull hboxes. +* Umlaut accent: Inserting Accents. +* Unbreakable space: w. +* Uncluttered menu entry: Less Cluttered Menu Entry. +* Undefining macros: Defining Macros. +* Underbar accent: Inserting Accents. +* Underdot accent: Inserting Accents. +* Uniform resource locator, indicating: url. +* Uniform resource locator, referring to: uref. +* Unique nodename requirement: Node Line Requirements. +* Unprocessed text: Comments. +* Unsplit file creation: Unsplit. +* Up node of Top node: First Node. +* Updating nodes and menus: Updating Nodes and Menus. +* Updating requirements: Updating Requirements. +* URI syntax for Info: Info Files. +* URL, indicating: url. +* URL, referring to: uref. +* Usage tips: Tips. +* user input: kbd. +* User options, marking: Variables Commands. +* User-defined Texinfo commands: Defining New Texinfo Commands. +* Using Texinfo in general: Using Texinfo. +* Validating a large file: Using Info-validate. +* Validation of pointers: Pointer Validation. +* Value of an expression, indicating: result. +* version number, finding: Invoking install-info. +* Vertical whitespace (vskip): Copyright & Permissions. +* Vertically holding text together: group. +* Visibility of conditional text: Conditionals. +* Weinberg, Zack: Acknowledgements and History. +* Weisshaus, Melissa: Acknowledgements and History. +* Whitespace in macros: Defining Macros. +* Whitespace, inserting: Multiple Spaces. +* Width of images: Images. +* Width of text area: pagesizes. +* Widths, defining multitable column: Multitable Column Widths. +* Wildcards: Format with tex/texindex. +* Words and phrases, marking them: Marking Text. +* Writing a menu: Writing a Menu. +* Writing an @node line: Writing a Node. +* Writing index entries: Indexing Commands. +* Zaretskii, Eli: Acknowledgements and History. +* Zuhn, David D.: Acknowledgements and History. + + diff --git a/info/texinfo.info-2 b/info/texinfo.info-2 index fc54512..1697d67 100644 --- a/info/texinfo.info-2 +++ b/info/texinfo.info-2 @@ -1,5 +1,5 @@ -This is ../info/texinfo.info, produced by makeinfo version 4.0 from -texinfo.texi. +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. INFO-DIR-SECTION Texinfo documentation system START-INFO-DIR-ENTRY @@ -44,7 +44,7 @@ titlepage', look more intimidating than they are. Most of the material is standard boilerplate; when you write a manual, simply insert the names for your own manual in this segment. (*Note Beginning a File::.) -In the following, the sample text is _indented_; comments on it are +In the following, the sample text is *indented*; comments on it are not. The complete file, without any comments, is shown in *Note Sample Texinfo File::. @@ -160,7 +160,6 @@ The Results Here is what the contents of the first chapter of the sample look like: - This is the contents of the first chapter. Here is a numbered list. @@ -372,7 +371,7 @@ first letter of the @-command: however, more mnemonic; hence the two keybindings. (Also, you can move out from between braces by typing `C-f'.) - To put a command such as `@code{...}' around an _existing_ word, + To put a command such as `@code{...}' around an *existing* word, position the cursor in front of the word and type `C-u 1 C-c C-c c'. This makes it easy to edit existing plain text. The value of the prefix argument tells Emacs how many words following point to include @@ -520,7 +519,7 @@ or an `@ifinfo' line. followed by a node with an `@chapter' or equivalent-level command. Note that the menu updating commands will not create a main or master menu for a Texinfo file that has only `@chapter'-level nodes! The menu -updating commands only create menus _within_ nodes for lower level +updating commands only create menus *within* nodes for lower level nodes. To create a menu of chapters, you must provide a `Top' node. The menu updating commands remove menu entries that refer to other @@ -786,7 +785,7 @@ an Info file: or M-x makeinfo-buffer - For TeX or the Info formatting commands to work, the file _must_ + For TeX or the Info formatting commands to work, the file *must* include a line that has `@setfilename' in its header. *Note Create an Info File::, for details about Info formatting. @@ -803,7 +802,7 @@ print the file. Optionally, you may also create indices. To do this, you must run the `texindex' command after first running the `tex' typesetting command; and then you must run the `tex' command again. Or else run the `texi2dvi' command which automatically creates indices as -needed (*note Format with texi2dvi::). +needed (*note Format with texi2dvi::.). Often, when you are writing a document, you want to typeset and print only part of a file to see what it will look like. You can use the @@ -837,7 +836,7 @@ only part of a file to see what it will look like. You can use the `texinfo-tex-buffer' or `texinfo-tex-region'. For `texinfo-tex-region' or `texinfo-tex-buffer' to work, the file -_must_ start with a `\input texinfo' line and must include an +*must* start with a `\input texinfo' line and must include an `@settitle' line. The file must end with `@bye' on a line by itself. (When you use `texinfo-tex-region', you must surround the `@settitle' line with start-of-header and end-of-header lines.) @@ -1182,7 +1181,7 @@ Start of Header Follow the start-of-header line with `@setfilename' and `@settitle' lines and, optionally, with other command lines, such as `@smallbook' or `@footnotestyle'; and then by an end-of-header line (*note End of -Header::). +Header::.). With these lines, you can format part of a Texinfo file for Info or typeset part for printing. diff --git a/info/texinfo.info-3 b/info/texinfo.info-3 new file mode 100644 index 0000000..e95f8a8 --- /dev/null +++ b/info/texinfo.info-3 @@ -0,0 +1,1308 @@ +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98 Free Software +Foundation, Inc. + + This edition is for Texinfo version 3.12. + + 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 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. + + +File: texinfo.info, Node: setchapternewpage, Next: paragraphindent, Prev: settitle, Up: Header + +`@setchapternewpage' +-------------------- + + In a book or a manual, text is usually printed on both sides of the +paper, chapters start on right-hand pages, and right-hand pages have +odd numbers. But in short reports, text often is printed only on one +side of the paper. Also in short reports, chapters sometimes do not +start on new pages, but are printed on the same page as the end of the +preceding chapter, after a small amount of vertical whitespace. + + You can use the `@setchapternewpage' command with various arguments +to specify how TeX should start chapters and whether it should typeset +pages for printing on one or both sides of the paper (single-sided or +double-sided printing). + + Write the `@setchapternewpage' command at the beginning of a line +followed by its argument. + + For example, you would write the following to cause each chapter to +start on a fresh odd-numbered page: + + @setchapternewpage odd + + You can specify one of three alternatives with the +`@setchapternewpage' command: + +`@setchapternewpage off' + Cause TeX to typeset a new chapter on the same page as the last + chapter, after skipping some vertical whitespace. Also, cause TeX + to format page headers for single-sided printing. (You can + override the headers format with the `@headings double' command; + see *Note The `@headings' Command: headings on off.) + +`@setchapternewpage on' + Cause TeX to start new chapters on new pages and to typeset page + headers for single-sided printing. This is the form most often + used for short reports. + + This alternative is the default. + +`@setchapternewpage odd' + Cause TeX to start new chapters on new, odd-numbered pages + (right-handed pages) and to typeset for double-sided printing. + This is the form most often used for books and manuals. + +Texinfo does not have an `@setchapternewpage even' command. + +(You can countermand or modify an `@setchapternewpage' command with an +`@headings' command. *Note The `@headings' Command: headings on off.) + + At the beginning of a manual or book, pages are not numbered--for +example, the title and copyright pages of a book are not numbered. By +convention, table of contents pages are numbered with roman numerals +and not in sequence with the rest of the document. + + Since an Info file does not have pages, the `@setchapternewpage' +command has no effect on it. + + Usually, you do not write an `@setchapternewpage' command for +single-sided printing, but accept the default which is to typeset for +single-sided printing and to start new chapters on new pages. Usually, +you write an `@setchapternewpage odd' command for double-sided printing. + + +File: texinfo.info, Node: paragraphindent, Next: End of Header, Prev: setchapternewpage, Up: Header + +Paragraph Indenting +------------------- + + The Info formatting commands may insert spaces at the beginning of the +first line of each paragraph, thereby indenting that paragraph. You +can use the `@paragraphindent' command to specify the indentation. +Write an `@paragraphindent' command at the beginning of a line followed +by either `asis' or a number. The template is: + + @paragraphindent INDENT + + The Info formatting commands indent according to the value of INDENT: + + * If the value of INDENT is `asis', the Info formatting commands do + not change the existing indentation. + + * If the value of INDENT is zero, the Info formatting commands delete + existing indentation. + + * If the value of INDENT is greater than zero, the Info formatting + commands indent the paragraph by that number of spaces. + + The default value of INDENT is `asis'. + + Write the `@paragraphindent' command before or shortly after the +end-of-header line at the beginning of a Texinfo file. (If you write +the command between the start-of-header and end-of-header lines, the +region formatting commands indent paragraphs as specified.) + + A peculiarity of the `texinfo-format-buffer' and +`texinfo-format-region' commands is that they do not indent (nor fill) +paragraphs that contain `@w' or `@*' commands. *Note Refilling +Paragraphs::, for a detailed description of what goes on. + + +File: texinfo.info, Node: End of Header, Prev: paragraphindent, Up: Header + +End of Header +------------- + + Follow the header lines with an end-of-header line. An end-of-header +line looks like this: + + @c %**end of header + + If you include the `@setchapternewpage' command between the +start-of-header and end-of-header lines, TeX will typeset a region as +that command specifies. Similarly, if you include an `@smallbook' +command between the start-of-header and end-of-header lines, TeX will +typeset a region in the "small" book format. + + The reason for the odd string of characters (`%**') is so that the +`texinfo-tex-region' command does not accidentally find something that +it should not when it is looking for the header. + + The start-of-header line and the end-of-header line are Texinfo mode +variables that you can change. + + +File: texinfo.info, Node: Info Summary and Permissions, Next: Titlepage & Copyright Page, Prev: Header, Up: Beginning a File + +Summary and Copying Permissions for Info +======================================== + + The title page and the copyright page appear only in the printed copy +of the manual; therefore, the same information must be inserted in a +section that appears only in the Info file. This section usually +contains a brief description of the contents of the Info file, a +copyright notice, and copying permissions. + + The copyright notice should read: + + Copyright YEAR COPYRIGHT-OWNER + +and be put on a line by itself. + + Standard text for the copyright permissions is contained in an +appendix to this manual; see *Note `ifinfo' Copying Permissions: ifinfo +Permissions, for the complete text. + + The permissions text appears in an Info file *before* the first node. +This mean that a reader does *not* see this text when reading the file +using Info, except when using the advanced Info command `g *'. + + +File: texinfo.info, Node: Titlepage & Copyright Page, Next: The Top Node, Prev: Info Summary and Permissions, Up: Beginning a File + +The Title and Copyright Pages +============================= + + A manual's name and author are usually printed on a title page. +Sometimes copyright information is printed on the title page as well; +more often, copyright information is printed on the back of the title +page. + + The title and copyright pages appear in the printed manual, but not +in the Info file. Because of this, it is possible to use several +slightly obscure TeX typesetting commands that cannot be used in an +Info file. In addition, this part of the beginning of a Texinfo file +contains the text of the copying permissions that will appear in the +printed manual. + + *Note Titlepage Copying Permissions: Titlepage Permissions, for the +standard text for the copyright permissions. + +* Menu: + +* titlepage:: Create a title for the printed document. +* titlefont center sp:: The `@titlefont', `@center', + and `@sp' commands. +* title subtitle author:: The `@title', `@subtitle', + and `@author' commands. +* Copyright & Permissions:: How to write the copyright notice and + include copying permissions. +* end titlepage:: Turn on page headings after the title and + copyright pages. +* headings on off:: An option for turning headings on and off + and double or single sided printing. + + +File: texinfo.info, Node: titlepage, Next: titlefont center sp, Prev: Titlepage & Copyright Page, Up: Titlepage & Copyright Page + +`@titlepage' +------------ + + Start the material for the title page and following copyright page +with `@titlepage' on a line by itself and end it with `@end titlepage' +on a line by itself. + + The `@end titlepage' command starts a new page and turns on page +numbering. (*Note Page Headings: Headings, for details about how to +generate page headings.) All the material that you want to appear on +unnumbered pages should be put between the `@titlepage' and `@end +titlepage' commands. By using the `@page' command you can force a page +break within the region delineated by the `@titlepage' and `@end +titlepage' commands and thereby create more than one unnumbered page. +This is how the copyright page is produced. (The `@titlepage' command +might perhaps have been better named the `@titleandadditionalpages' +command, but that would have been rather long!) + + When you write a manual about a computer program, you should write the +version of the program to which the manual applies on the title page. +If the manual changes more frequently than the program or is +independent of it, you should also include an edition number(1) (*note +titlepage-Footnotes::) for the manual. This helps readers keep track +of which manual is for which version of the program. (The `Top' node +should also contain this information; see *Note `@top': makeinfo top.) + + Texinfo provides two main methods for creating a title page. One +method uses the `@titlefont', `@sp', and `@center' commands to generate +a title page in which the words on the page are centered. + + The second method uses the `@title', `@subtitle', and `@author' +commands to create a title page with black rules under the title and +author lines and the subtitle text set flush to the right hand side of +the page. With this method, you do not specify any of the actual +formatting of the title page. You specify the text you want, and +Texinfo does the formatting. You may use either method. + + For extremely simple applications, Texinfo also provides a command +`@shorttitlepage' which takes a single argument as the title. The +argument is typeset on a page by itself and followed by a blank page. + + +File: texinfo.info, Node: titlepage-Footnotes, Up: titlepage + + (1) We have found that it is helpful to refer to versions of manuals +as `editions' and versions of programs as `versions'; otherwise, we +find we are liable to confuse each other in conversation by referring +to both the documentation and the software with the same words. + + +File: texinfo.info, Node: titlefont center sp, Next: title subtitle author, Prev: titlepage, Up: Titlepage & Copyright Page + +`@titlefont', `@center', and `@sp' +---------------------------------- + + You can use the `@titlefont', `@sp', and `@center' commands to create +a title page for a printed document. (This is the first of the two +methods for creating a title page in Texinfo.) + + Use the `@titlefont' command to select a large font suitable for the +title itself. + + For example: + + @titlefont{Texinfo} + + Use the `@center' command at the beginning of a line to center the +remaining text on that line. Thus, + + @center @titlefont{Texinfo} + +centers the title, which in this example is "Texinfo" printed in the +title font. + + Use the `@sp' command to insert vertical space. For example: + + @sp 2 + +This inserts two blank lines on the printed page. (*Note `@sp': sp, +for more information about the `@sp' command.) + + A template for this method looks like this: + + @titlepage + @sp 10 + @center @titlefont{NAME-OF-MANUAL-WHEN-PRINTED} + @sp 2 + @center SUBTITLE-IF-ANY + @sp 2 + @center AUTHOR + ... + @end titlepage + + The spacing of the example fits an 8 1/2 by 11 inch manual. + + +File: texinfo.info, Node: title subtitle author, Next: Copyright & Permissions, Prev: titlefont center sp, Up: Titlepage & Copyright Page + +`@title', `@subtitle', and `@author' +------------------------------------ + + You can use the `@title', `@subtitle', and `@author' commands to +create a title page in which the vertical and horizontal spacing is +done for you automatically. This contrasts with the method described in +the previous section, in which the `@sp' command is needed to adjust +vertical spacing. + + Write the `@title', `@subtitle', or `@author' commands at the +beginning of a line followed by the title, subtitle, or author. + + The `@title' command produces a line in which the title is set flush +to the left-hand side of the page in a larger than normal font. The +title is underlined with a black rule. + + The `@subtitle' command sets subtitles in a normal-sized font flush +to the right-hand side of the page. + + The `@author' command sets the names of the author or authors in a +middle-sized font flush to the left-hand side of the page on a line +near the bottom of the title page. The names are underlined with a +black rule that is thinner than the rule that underlines the title. +(The black rule only occurs if the `@author' command line is followed +by an `@page' command line.) + + There are two ways to use the `@author' command: you can write the +name or names on the remaining part of the line that starts with an +`@author' command: + + @author by Jane Smith and John Doe + +or you can write the names one above each other by using two (or more) +`@author' commands: + + @author Jane Smith + @author John Doe + +(Only the bottom name is underlined with a black rule.) + + A template for this method looks like this: + + @titlepage + @title NAME-OF-MANUAL-WHEN-PRINTED + @subtitle SUBTITLE-IF-ANY + @subtitle SECOND-SUBTITLE + @author AUTHOR + @page + ... + @end titlepage + +Contrast this form with the form of a title page written using the +`@sp', `@center', and `@titlefont' commands: + + @titlepage + @sp 10 + @center @titlefont{Name of Manual When Printed} + @sp 2 + @center Subtitle, If Any + @sp 1 + @center Second subtitle + @sp 2 + @center Author + @page + ... + @end titlepage + + +File: texinfo.info, Node: Copyright & Permissions, Next: end titlepage, Prev: title subtitle author, Up: Titlepage & Copyright Page + +Copyright Page and Permissions +------------------------------ + + By international treaty, the copyright notice for a book should be +either on the title page or on the back of the title page. The +copyright notice should include the year followed by the name of the +organization or person who owns the copyright. + + When the copyright notice is on the back of the title page, that page +is customarily not numbered. Therefore, in Texinfo, the information on +the copyright page should be within `@titlepage' and `@end titlepage' +commands. + + Use the `@page' command to cause a page break. To push the copyright +notice and the other text on the copyright page towards the bottom of +the page, you can write a somewhat mysterious line after the `@page' +command that reads like this: + + @vskip 0pt plus 1filll + +This is a TeX command that is not supported by the Info formatting +commands. The `@vskip' command inserts whitespace. The `0pt plus +1filll' means to put in zero points of mandatory whitespace, and as +much optional whitespace as needed to push the following text to the +bottom of the page. Note the use of three `l's in the word `filll'; +this is the correct usage in TeX. + + In a printed manual, the `@copyright{}' command generates a `c' +inside a circle. (In Info, it generates `(C)'.) The copyright notice +itself has the following legally defined sequence: + + Copyright (C) YEAR COPYRIGHT-OWNER + + It is customary to put information on how to get a manual after the +copyright notice, followed by the copying permissions for the manual. + + Note that permissions must be given here as well as in the summary +segment within `@ifinfo' and `@end ifinfo' that immediately follows the +header since this text appears only in the printed manual and the +`ifinfo' text appears only in the Info file. + + *Note Sample Permissions::, for the standard text. + + +File: texinfo.info, Node: end titlepage, Next: headings on off, Prev: Copyright & Permissions, Up: Titlepage & Copyright Page + +Heading Generation +------------------ + + An `@end titlepage' command on a line by itself not only marks the +end of the title and copyright pages, but also causes TeX to start +generating page headings and page numbers. + + To repeat what is said elsewhere, Texinfo has two standard page +heading formats, one for documents which are printed on one side of +each sheet of paper (single-sided printing), and the other for +documents which are printed on both sides of each sheet (double-sided +printing). (*Note `@setchapternewpage': setchapternewpage.) You can +specify these formats in different ways: + + * The conventional way is to write an `@setchapternewpage' command + before the title page commands, and then have the `@end titlepage' + command start generating page headings in the manner desired. + (*Note `@setchapternewpage': setchapternewpage.) + + * Alternatively, you can use the `@headings' command to prevent page + headings from being generated or to start them for either single or + double-sided printing. (Write an `@headings' command immediately + after the `@end titlepage' command. *Note The `@headings' + Command: headings on off, for more information.) + + * Or, you may specify your own page heading and footing format. + *Note Page Headings: Headings, for detailed information about page + headings and footings. + + Most documents are formatted with the standard single-sided or +double-sided format, using `@setchapternewpage odd' for double-sided +printing and no `@setchapternewpage' command for single-sided printing. + + +File: texinfo.info, Node: headings on off, Prev: end titlepage, Up: Titlepage & Copyright Page + +The `@headings' Command +----------------------- + + The `@headings' command is rarely used. It specifies what kind of +page headings and footings to print on each page. Usually, this is +controlled by the `@setchapternewpage' command. You need the +`@headings' command only if the `@setchapternewpage' command does not +do what you want, or if you want to turn off pre-defined page headings +prior to defining your own. Write an `@headings' command immediately +after the `@end titlepage' command. + + You can use `@headings' as follows: + +`@headings off' + Turn off printing of page headings. + +`@headings single' + Turn on page headings appropriate for single-sided printing. + +`@headings double' + Turn on page headings appropriate for double-sided printing. The + two commands, `@headings on' and `@headings double', are + synonymous. + +`@headings singleafter' +`@headings doubleafter' + Turn on `single' or `double' headings, respectively, after the + current page is output. + +`@headings on' + Turn on page headings: `single' if `@setchapternewpage on', + `double' otherwise. + + For example, suppose you write `@setchapternewpage off' before the +`@titlepage' command to tell TeX to start a new chapter on the same +page as the end of the last chapter. This command also causes TeX to +typeset page headers for single-sided printing. To cause TeX to +typeset for double sided printing, write `@headings double' after the +`@end titlepage' command. + + You can stop TeX from generating any page headings at all by writing +`@headings off' on a line of its own immediately after the line +containing the `@end titlepage' command, like this: + + @end titlepage + @headings off + +The `@headings off' command overrides the `@end titlepage' command, +which would otherwise cause TeX to print page headings. + + You can also specify your own style of page heading and footing. +*Note Page Headings: Headings, for more information. + + +File: texinfo.info, Node: The Top Node, Next: Software Copying Permissions, Prev: Titlepage & Copyright Page, Up: Beginning a File + +The `Top' Node and Master Menu +============================== + + The `Top' node is the node from which you enter an Info file. + + A `Top' node should contain a brief description of the Info file and +an extensive, master menu for the whole Info file. This helps the +reader understand what the Info file is about. Also, you should write +the version number of the program to which the Info file applies; or, +at least, the edition number. + + The contents of the `Top' node should appear only in the Info file; +none of it should appear in printed output, so enclose it between +`@ifinfo' and `@end ifinfo' commands. (TeX does not print either an +`@node' line or a menu; they appear only in Info; strictly speaking, +you are not required to enclose these parts between `@ifinfo' and `@end +ifinfo', but it is simplest to do so. *Note Conditionally Visible +Text: Conditionals.) + +* Menu: + +* Title of Top Node:: Sketch what the file is about. +* Master Menu Parts:: A master menu has three or more parts. + + +File: texinfo.info, Node: Title of Top Node, Next: Master Menu Parts, Prev: The Top Node, Up: The Top Node + +`Top' Node Title +---------------- + + Sometimes, you will want to place an `@top' sectioning command line +containing the title of the document immediately after the `@node Top' +line (*note The `@top' Sectioning Command: makeinfo top command., for +more information). + + For example, the beginning of the Top node of this manual contains an +`@top' sectioning command, a short description, and edition and version +information. It looks like this: + + ... + @end titlepage + + @ifinfo + @node Top, Copying, , (dir) + @top Texinfo + + Texinfo is a documentation system... + + This is edition... + ... + @end ifinfo + + @menu + * Copying:: Texinfo is freely + redistributable. + * Overview:: What is Texinfo? + ... + @end menu + + In a `Top' node, the `Previous', and `Up' nodes usually refer to the +top level directory of the whole Info system, which is called `(dir)'. +The `Next' node refers to the first node that follows the main or master +menu, which is usually the copying permissions, introduction, or first +chapter. + + +File: texinfo.info, Node: Master Menu Parts, Prev: Title of Top Node, Up: The Top Node + +Parts of a Master Menu +---------------------- + + A "master menu" is a detailed main menu listing all the nodes in a +file. + + A master menu is enclosed in `@menu' and `@end menu' commands and +does not appear in the printed document. + + Generally, a master menu is divided into parts. + + * The first part contains the major nodes in the Texinfo file: the + nodes for the chapters, chapter-like sections, and the appendices. + + * The second part contains nodes for the indices. + + * The third and subsequent parts contain a listing of the other, + lower level nodes, often ordered by chapter. This way, rather + than go through an intermediary menu, an inquirer can go directly + to a particular node when searching for specific information. + These menu items are not required; add them if you think they are a + convenience. If you do use them, put `@detailmenu' before the + first one, and `@end detailmenu' after the last; otherwise, + `makeinfo' will get confused. + + Each section in the menu can be introduced by a descriptive line. So +long as the line does not begin with an asterisk, it will not be +treated as a menu entry. (*Note Writing a Menu::, for more +information.) + + For example, the master menu for this manual looks like the following +(but has many more entries): + + @menu + * Copying:: Texinfo is freely + redistributable. + * Overview:: What is Texinfo? + * Texinfo Mode:: Special features in GNU Emacs. + ... + ... + * Command and Variable Index:: + An entry for each @-command. + * Concept Index:: An entry for each concept. + + @detailmenu + --- The Detailed Node Listing --- + + Overview of Texinfo + + * Info Files:: What is an Info file? + * Printed Manuals:: Characteristics of + a printed manual. + ... + ... + + Using Texinfo Mode + + * Info on a Region:: Formatting part of a file + for Info. + ... + ... + @end detailmenu + @end menu + + +File: texinfo.info, Node: Software Copying Permissions, Prev: The Top Node, Up: Beginning a File + +Software Copying Permissions +============================ + + If the Texinfo file has a section containing the "General Public +License" and the distribution information and a warranty disclaimer for +the software that is documented, this section usually follows the `Top' +node. The General Public License is very important to Project GNU +software. It ensures that you and others will continue to have a right +to use and share the software. + + The copying and distribution information and the disclaimer are +followed by an introduction or else by the first chapter of the manual. + + Although an introduction is not a required part of a Texinfo file, it +is very helpful. Ideally, it should state clearly and concisely what +the file is about and who would be interested in reading it. In +general, an introduction would follow the licensing and distribution +information, although sometimes people put it earlier in the document. +Usually, an introduction is put in an `@unnumbered' section. (*Note +The `@unnumbered' and `@appendix' Commands: unnumbered & appendix.) + + +File: texinfo.info, Node: Ending a File, Next: Structuring, Prev: Beginning a File, Up: Top + +Ending a Texinfo File +********************* + + The end of a Texinfo file should include the commands that create +indices and generate detailed and summary tables of contents. And it +must include the `@bye' command that marks the last line processed by +TeX. + + For example: + + @node Concept Index, , Variables Index, Top + @c node-name, next, previous, up + @unnumbered Concept Index + + @printindex cp + + @contents + @bye + +* Menu: + +* Printing Indices & Menus:: How to print an index in hardcopy and + generate index menus in Info. +* Contents:: How to create a table of contents. +* File End:: How to mark the end of a file. + + +File: texinfo.info, Node: Printing Indices & Menus, Next: Contents, Prev: Ending a File, Up: Ending a File + +Index Menus and Printing an Index +================================= + + To print an index means to include it as part of a manual or Info +file. This does not happen automatically just because you use +`@cindex' or other index-entry generating commands in the Texinfo file; +those just cause the raw data for the index to be accumulated. To +generate an index, you must include the `@printindex' command at the +place in the document where you want the index to appear. Also, as +part of the process of creating a printed manual, you must run a +program called `texindex' (*note Format/Print Hardcopy::.) to sort the +raw data to produce a sorted index file. The sorted index file is what +is actually used to print the index. + + Texinfo offers six different types of predefined index: the concept +index, the function index, the variables index, the keystroke index, the +program index, and the data type index (*note Predefined Indices::.). +Each index type has a two-letter name: `cp', `fn', `vr', `ky', `pg', +and `tp'. You may merge indices, or put them into separate sections +(*note Combining Indices::.); or you may define your own indices (*note +Defining New Indices: New Indices.). + + The `@printindex' command takes a two-letter index name, reads the +corresponding sorted index file and formats it appropriately into an +index. + + The `@printindex' command does not generate a chapter heading for the +index. Consequently, you should precede the `@printindex' command with +a suitable section or chapter command (usually `@unnumbered') to supply +the chapter heading and put the index into the table of contents. +Precede the `@unnumbered' command with an `@node' line. + + For example: + + @node Variable Index, Concept Index, Function Index, Top + @comment node-name, next, previous, up + @unnumbered Variable Index + + @printindex vr + + @node Concept Index, , Variable Index, Top + @comment node-name, next, previous, up + @unnumbered Concept Index + + @printindex cp + + @summarycontents + @contents + @bye + +(Readers often prefer that the concept index come last in a book, since +that makes it easiest to find.) + + +File: texinfo.info, Node: Contents, Next: File End, Prev: Printing Indices & Menus, Up: Ending a File + +Generating a Table of Contents +============================== + + The `@chapter', `@section', and other structuring commands supply the +information to make up a table of contents, but they do not cause an +actual table to appear in the manual. To do this, you must use the +`@contents' and `@summarycontents' commands: + +`@contents' + Generate a table of contents in a printed manual, including all + chapters, sections, subsections, etc., as well as appendices and + unnumbered chapters. (Headings generated by the `@heading' series + of commands do not appear in the table of contents.) The + `@contents' command should be written on a line by itself. + +`@shortcontents' +`@summarycontents' + (`@summarycontents' is a synonym for `@shortcontents'; the two + commands are exactly the same.) + + Generate a short or summary table of contents that lists only the + chapters (and appendices and unnumbered chapters). Omit sections, + subsections and subsubsections. Only a long manual needs a short + table of contents in addition to the full table of contents. + + Write the `@shortcontents' command on a line by itself right + *before* the `@contents' command. + + The table of contents commands automatically generate a chapter-like +heading at the top of the first table of contents page. Write the table +of contents commands at the very end of a Texinfo file, just before the +`@bye' command, following any index sections--anything in the Texinfo +file after the table of contents commands will be omitted from the +table of contents. + + When you print a manual with a table of contents, the table of +contents are printed last and numbered with roman numerals. You need +to place those pages in their proper place, after the title page, +yourself. (This is the only collating you need to do for a printed +manual. The table of contents is printed last because it is generated +after the rest of the manual is typeset.) + + Here is an example of where to write table of contents commands: + + INDICES... + @shortcontents + @contents + @bye + + Since an Info file uses menus instead of tables of contents, the Info +formatting commands ignore the `@contents' and `@shortcontents' +commands. + + +File: texinfo.info, Node: File End, Prev: Contents, Up: Ending a File + +`@bye' File Ending +================== + + An `@bye' command terminates TeX or Info formatting. None of the +formatting commands see any of the file following `@bye'. The `@bye' +command should be on a line by itself. + + If you wish, you may follow the `@bye' line with notes. These notes +will not be formatted and will not appear in either Info or a printed +manual; it is as if text after `@bye' were within `@ignore' ... `@end +ignore'. Also, you may follow the `@bye' line with a local variables +list. *Note Using Local Variables and the Compile Command: +Compile-Command, for more information. + + +File: texinfo.info, Node: Structuring, Next: Nodes, Prev: Ending a File, Up: Top + +Chapter Structuring +******************* + + The "chapter structuring" commands divide a document into a hierarchy +of chapters, sections, subsections, and subsubsections. These commands +generate large headings; they also provide information for the table of +contents of a printed manual (*note Generating a Table of Contents: +Contents.). + + The chapter structuring commands do not create an Info node structure, +so normally you should put an `@node' command immediately before each +chapter structuring command (*note Nodes::.). The only time you are +likely to use the chapter structuring commands without using the node +structuring commands is if you are writing a document that contains no +cross references and will never be transformed into Info format. + + It is unlikely that you will ever write a Texinfo file that is +intended only as an Info file and not as a printable document. If you +do, you might still use chapter structuring commands to create a +heading at the top of each node--but you don't need to. + +* Menu: + +* Tree Structuring:: A manual is like an upside down tree ... +* Structuring Command Types:: How to divide a manual into parts. +* makeinfo top:: The `@top' command, part of the `Top' node. +* chapter:: +* unnumbered & appendix:: +* majorheading & chapheading:: +* section:: +* unnumberedsec appendixsec heading:: +* subsection:: +* unnumberedsubsec appendixsubsec subheading:: +* subsubsection:: Commands for the lowest level sections. +* Raise/lower sections:: How to change commands' hierarchical level. + + +File: texinfo.info, Node: Tree Structuring, Next: Structuring Command Types, Prev: Structuring, Up: Structuring + +Tree Structure of Sections +========================== + + A Texinfo file is usually structured like a book with chapters, +sections, subsections, and the like. This structure can be visualized +as a tree (or rather as an upside-down tree) with the root at the top +and the levels corresponding to chapters, sections, subsection, and +subsubsections. + + Here is a diagram that shows a Texinfo file with three chapters, each +of which has two sections. + + Top + | + ------------------------------------- + | | | + Chapter 1 Chapter 2 Chapter 3 + | | | + -------- -------- -------- + | | | | | | + Section Section Section Section Section Section + 1.1 1.2 2.1 2.2 3.1 3.2 + + In a Texinfo file that has this structure, the beginning of Chapter 2 +looks like this: + + @node Chapter 2, Chapter 3, Chapter 1, top + @chapter Chapter 2 + + The chapter structuring commands are described in the sections that +follow; the `@node' and `@menu' commands are described in following +chapters. (*Note Nodes::, and see *Note Menus::.) + + +File: texinfo.info, Node: Structuring Command Types, Next: makeinfo top, Prev: Tree Structuring, Up: Structuring + +Types of Structuring Commands +============================= + + The chapter structuring commands fall into four groups or series, each +of which contains structuring commands corresponding to the +hierarchical levels of chapters, sections, subsections, and +subsubsections. + + The four groups are the `@chapter' series, the `@unnumbered' series, +the `@appendix' series, and the `@heading' series. + + Each command produces titles that have a different appearance on the +printed page or Info file; only some of the commands produce titles +that are listed in the table of contents of a printed book or manual. + + * The `@chapter' and `@appendix' series of commands produce numbered + or lettered entries both in the body of a printed work and in its + table of contents. + + * The `@unnumbered' series of commands produce unnumbered entries + both in the body of a printed work and in its table of contents. + The `@top' command, which has a special use, is a member of this + series (*note `@top': makeinfo top.). + + * The `@heading' series of commands produce unnumbered headings that + do not appear in a table of contents. The heading commands never + start a new page. + + * The `@majorheading' command produces results similar to using the + `@chapheading' command but generates a larger vertical whitespace + before the heading. + + * When an `@setchapternewpage' command says to do so, the + `@chapter', `@unnumbered', and `@appendix' commands start new + pages in the printed manual; the `@heading' commands do not. + + Here are the four groups of chapter structuring commands: + + No new pages + Numbered Unnumbered Lettered and numbered Unnumbered + In contents In contents In contents Not in contents + + @top @majorheading + @chapter @unnumbered @appendix @chapheading + @section @unnumberedsec @appendixsec @heading + @subsection @unnumberedsubsec @appendixsubsec @subheading + @subsubsection @unnumberedsubsubsec @appendixsubsubsec @subsubheading + + +File: texinfo.info, Node: makeinfo top, Next: chapter, Prev: Structuring Command Types, Up: Structuring + +`@top' +====== + + The `@top' command is a special sectioning command that you use only +after an `@node Top' line at the beginning of a Texinfo file. The +`@top' command tells the `makeinfo' formatter which node is the `Top' +node. It has the same typesetting effect as `@unnumbered' (*note +`@unnumbered': (`@appendix')unnumbered & appendix.). For detailed +information, see *Note The `@top' Command: makeinfo top command. + + +File: texinfo.info, Node: chapter, Next: unnumbered & appendix, Prev: makeinfo top, Up: Structuring + +`@chapter' +========== + + `@chapter' identifies a chapter in the document. Write the command +at the beginning of a line and follow it on the same line by the title +of the chapter. + + For example, this chapter in this manual is entitled "Chapter +Structuring"; the `@chapter' line looks like this: + + @chapter Chapter Structuring + + In TeX, the `@chapter' command creates a chapter in the document, +specifying the chapter title. The chapter is numbered automatically. + + In Info, the `@chapter' command causes the title to appear on a line +by itself, with a line of asterisks inserted underneath. Thus, in +Info, the above example produces the following output: + + Chapter Structuring + ******************* + + Texinfo also provides a command `@centerchap', which is analogous to +`@unnumbered', but centers its argument in the printed output. This +kind of stylistic choice is not usually offered by Texinfo. + + +File: texinfo.info, Node: unnumbered & appendix, Next: majorheading & chapheading, Prev: chapter, Up: Structuring + +`@unnumbered', `@appendix' +========================== + + Use the `@unnumbered' command to create a chapter that appears in a +printed manual without chapter numbers of any kind. Use the +`@appendix' command to create an appendix in a printed manual that is +labelled by letter instead of by number. + + For Info file output, the `@unnumbered' and `@appendix' commands are +equivalent to `@chapter': the title is printed on a line by itself with +a line of asterisks underneath. (*Note `@chapter': chapter.) + + To create an appendix or an unnumbered chapter, write an `@appendix' +or `@unnumbered' command at the beginning of a line and follow it on +the same line by the title, as you would if you were creating a chapter. + + +File: texinfo.info, Node: majorheading & chapheading, Next: section, Prev: unnumbered & appendix, Up: Structuring + +`@majorheading', `@chapheading' +=============================== + + The `@majorheading' and `@chapheading' commands put chapter-like +headings in the body of a document. + + However, neither command causes TeX to produce a numbered heading or +an entry in the table of contents; and neither command causes TeX to +start a new page in a printed manual. + + In TeX, an `@majorheading' command generates a larger vertical +whitespace before the heading than an `@chapheading' command but is +otherwise the same. + + In Info, the `@majorheading' and `@chapheading' commands are +equivalent to `@chapter': the title is printed on a line by itself with +a line of asterisks underneath. (*Note `@chapter': chapter.) + + +File: texinfo.info, Node: section, Next: unnumberedsec appendixsec heading, Prev: majorheading & chapheading, Up: Structuring + +`@section' +========== + + In a printed manual, an `@section' command identifies a numbered +section within a chapter. The section title appears in the table of +contents. In Info, an `@section' command provides a title for a +segment of text, underlined with `='. + + This section is headed with an `@section' command and looks like this +in the Texinfo file: + + @section @code{@@section} + + To create a section, write the `@section' command at the beginning of +a line and follow it on the same line by the section title. + + Thus, + + @section This is a section + +produces + + This is a section + ================= + +in Info. + + +File: texinfo.info, Node: unnumberedsec appendixsec heading, Next: subsection, Prev: section, Up: Structuring + +`@unnumberedsec', `@appendixsec', `@heading' +============================================ + + The `@unnumberedsec', `@appendixsec', and `@heading' commands are, +respectively, the unnumbered, appendix-like, and heading-like +equivalents of the `@section' command. (*Note `@section': section.) + +`@unnumberedsec' + The `@unnumberedsec' command may be used within an unnumbered + chapter or within a regular chapter or appendix to provide an + unnumbered section. + +`@appendixsec' +`@appendixsection' + `@appendixsection' is a longer spelling of the `@appendixsec' + command; the two are synonymous. + + Conventionally, the `@appendixsec' or `@appendixsection' command + is used only within appendices. + +`@heading' + You may use the `@heading' command anywhere you wish for a + section-style heading that will not appear in the table of + contents. + + +File: texinfo.info, Node: subsection, Next: unnumberedsubsec appendixsubsec subheading, Prev: unnumberedsec appendixsec heading, Up: Structuring + +The `@subsection' Command +========================= + + Subsections are to sections as sections are to chapters. (*Note +`@section': section.) In Info, subsection titles are underlined with +`-'. For example, + + @subsection This is a subsection + +produces + + This is a subsection + -------------------- + + In a printed manual, subsections are listed in the table of contents +and are numbered three levels deep. + + +File: texinfo.info, Node: unnumberedsubsec appendixsubsec subheading, Next: subsubsection, Prev: subsection, Up: Structuring + +The `@subsection'-like Commands +=============================== + + The `@unnumberedsubsec', `@appendixsubsec', and `@subheading' +commands are, respectively, the unnumbered, appendix-like, and +heading-like equivalents of the `@subsection' command. (*Note +`@subsection': subsection.) + + In Info, the `@subsection'-like commands generate a title underlined +with hyphens. In a printed manual, an `@subheading' command produces a +heading like that of a subsection except that it is not numbered and +does not appear in the table of contents. Similarly, an +`@unnumberedsubsec' command produces an unnumbered heading like that of +a subsection and an `@appendixsubsec' command produces a +subsection-like heading labelled with a letter and numbers; both of +these commands produce headings that appear in the table of contents. + + +File: texinfo.info, Node: subsubsection, Next: Raise/lower sections, Prev: unnumberedsubsec appendixsubsec subheading, Up: Structuring + +The `subsub' Commands +===================== + + The fourth and lowest level sectioning commands in Texinfo are the +`subsub' commands. They are: + +`@subsubsection' + Subsubsections are to subsections as subsections are to sections. + (*Note `@subsection': subsection.) In a printed manual, + subsubsection titles appear in the table of contents and are + numbered four levels deep. + +`@unnumberedsubsubsec' + Unnumbered subsubsection titles appear in the table of contents of + a printed manual, but lack numbers. Otherwise, unnumbered + subsubsections are the same as subsubsections. In Info, unnumbered + subsubsections look exactly like ordinary subsubsections. + +`@appendixsubsubsec' + Conventionally, appendix commands are used only for appendices and + are lettered and numbered appropriately in a printed manual. They + also appear in the table of contents. In Info, appendix + subsubsections look exactly like ordinary subsubsections. + +`@subsubheading' + The `@subsubheading' command may be used anywhere that you need a + small heading that will not appear in the table of contents. In + Info, subsubheadings look exactly like ordinary subsubsection + headings. + + In Info, `subsub' titles are underlined with periods. For example, + + @subsubsection This is a subsubsection + +produces + + This is a subsubsection + ....................... + + +File: texinfo.info, Node: Raise/lower sections, Prev: subsubsection, Up: Structuring + +`@raisesections' and `@lowersections' +===================================== + + The `@raisesections' and `@lowersections' commands raise and lower +the hierarchical level of chapters, sections, subsections and the like. +The `@raisesections' command changes sections to chapters, subsections +to sections, and so on. The `@lowersections' command changes chapters +to sections, sections to subsections, and so on. + + An `@lowersections' command is useful if you wish to include text +that is written as an outer or standalone Texinfo file in another +Texinfo file as an inner, included file. If you write the command at +the beginning of the file, all your `@chapter' commands are formatted +as if they were `@section' commands, all your `@section' command are +formatted as if they were `@subsection' commands, and so on. + + `@raisesections' raises a command one level in the chapter +structuring hierarchy: + + Change To + + @subsection @section, + @section @chapter, + @heading @chapheading, + etc. + + `@lowersections' lowers a command one level in the chapter +structuring hierarchy: + + Change To + + @chapter @section, + @subsection @subsubsection, + @heading @subheading, + etc. + + An `@raisesections' or `@lowersections' command changes only those +structuring commands that follow the command in the Texinfo file. +Write an `@raisesections' or `@lowersections' command on a line of its +own. + + An `@lowersections' command cancels an `@raisesections' command, and +vice versa. Typically, the commands are used like this: + + @lowersections + @include somefile.texi + @raisesections + + Without the `@raisesections', all the subsequent sections in your +document will be lowered. + + Repeated use of the commands continue to raise or lower the +hierarchical level a step at a time. + + An attempt to raise above `chapters' reproduces chapter commands; an +attempt to lower below `subsubsections' reproduces subsubsection +commands. + + +File: texinfo.info, Node: Nodes, Next: Menus, Prev: Structuring, Up: Top + +Nodes +***** + + "Nodes" are the primary segments of a Texinfo file. They do not +themselves impose a hierarchic or any other kind of structure on a file. +Nodes contain "node pointers" that name other nodes, and can contain +"menus" which are lists of nodes. In Info, the movement commands can +carry you to a pointed-to node or to a node listed in a menu. Node +pointers and menus provide structure for Info files just as chapters, +sections, subsections, and the like, provide structure for printed +books. + +* Menu: + +* Two Paths:: Different commands to structure + Info output and printed output. +* Node Menu Illustration:: A diagram, and sample nodes and menus. +* node:: How to write a node, in detail. +* makeinfo Pointer Creation:: How to create node pointers with `makeinfo'. + + +File: texinfo.info, Node: Two Paths, Next: Node Menu Illustration, Prev: Nodes, Up: Nodes + +Two Paths +========= + + The node and menu commands and the chapter structuring commands are +independent of each other: + + * In Info, node and menu commands provide structure. The chapter + structuring commands generate headings with different kinds of + underlining--asterisks for chapters, hyphens for sections, and so + on; they do nothing else. + + * In TeX, the chapter structuring commands generate chapter and + section numbers and tables of contents. The node and menu + commands provide information for cross references; they do nothing + else. + + You can use node pointers and menus to structure an Info file any way +you want; and you can write a Texinfo file so that its Info output has a +different structure than its printed output. However, most Texinfo +files are written such that the structure for the Info output +corresponds to the structure for the printed output. It is not +convenient to do otherwise. + + Generally, printed output is structured in a tree-like hierarchy in +which the chapters are the major limbs from which the sections branch +out. Similarly, node pointers and menus are organized to create a +matching structure in the Info output. + diff --git a/info/texinfo.info-4 b/info/texinfo.info-4 new file mode 100644 index 0000000..04bcd4c --- /dev/null +++ b/info/texinfo.info-4 @@ -0,0 +1,1398 @@ +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98 Free Software +Foundation, Inc. + + This edition is for Texinfo version 3.12. + + 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 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. + + +File: texinfo.info, Node: Node Menu Illustration, Next: node, Prev: Two Paths, Up: Nodes + +Node and Menu Illustration +========================== + + Here is a copy of the diagram shown earlier that illustrates a Texinfo +file with three chapters, each of which contains two sections. + + Note that the "root" is at the top of the diagram and the "leaves" +are at the bottom. This is how such a diagram is drawn conventionally; +it illustrates an upside-down tree. For this reason, the root node is +called the `Top' node, and `Up' node pointers carry you closer to the +root. + + Top + | + ------------------------------------- + | | | + Chapter 1 Chapter 2 Chapter 3 + | | | + -------- -------- -------- + | | | | | | + Section Section Section Section Section Section + 1.1 1.2 2.1 2.2 3.1 3.2 + + Write the beginning of the node for Chapter 2 like this: + + @node Chapter 2, Chapter 3, Chapter 1, top + @comment node-name, next, previous, up + +This `@node' line says that the name of this node is "Chapter 2", the +name of the `Next' node is "Chapter 3", the name of the `Previous' node +is "Chapter 1", and the name of the `Up' node is "Top". + + *Please Note:* `Next' refers to the next node at the same + hierarchical level in the manual, not necessarily to the next node + within the Texinfo file. In the Texinfo file, the subsequent node + may be at a lower level--a section-level node may follow a + chapter-level node, and a subsection-level node may follow a + section-level node. `Next' and `Previous' refer to nodes at the + *same* hierarchical level. (The `Top' node contains the exception + to this rule. Since the `Top' node is the only node at that + level, `Next' refers to the first following node, which is almost + always a chapter or chapter-level node.) + + To go to Sections 2.1 and 2.2 using Info, you need a menu inside +Chapter 2. (*Note Menus::.) You would write the menu just before the +beginning of Section 2.1, like this: + + @menu + * Sect. 2.1:: Description of this section. + * Sect. 2.2:: + @end menu + + Write the node for Sect. 2.1 like this: + + @node Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2 + @comment node-name, next, previous, up + + In Info format, the `Next' and `Previous' pointers of a node usually +lead to other nodes at the same level--from chapter to chapter or from +section to section (sometimes, as shown, the `Previous' pointer points +up); an `Up' pointer usually leads to a node at the level above (closer +to the `Top' node); and a `Menu' leads to nodes at a level below (closer +to `leaves'). (A cross reference can point to a node at any level; see +*Note Cross References::.) + + Usually, an `@node' command and a chapter structuring command are +used in sequence, along with indexing commands. (You may follow the +`@node' line with a comment line that reminds you which pointer is +which.) + + Here is the beginning of the chapter in this manual called "Ending a +Texinfo File". This shows an `@node' line followed by a comment line, +an `@chapter' line, and then by indexing lines. + + @node Ending a File, Structuring, Beginning a File, Top + @comment node-name, next, previous, up + @chapter Ending a Texinfo File + @cindex Ending a Texinfo file + @cindex Texinfo file ending + @cindex File ending + + +File: texinfo.info, Node: node, Next: makeinfo Pointer Creation, Prev: Node Menu Illustration, Up: Nodes + +The `@node' Command +=================== + + A "node" is a segment of text that begins at an `@node' command and +continues until the next `@node' command. The definition of node is +different from that for chapter or section. A chapter may contain +sections and a section may contain subsections; but a node cannot +contain subnodes; the text of a node continues only until the next +`@node' command in the file. A node usually contains only one chapter +structuring command, the one that follows the `@node' line. On the +other hand, in printed output nodes are used only for cross references, +so a chapter or section may contain any number of nodes. Indeed, a +chapter usually contains several nodes, one for each section, +subsection, and subsubsection. + + To create a node, write an `@node' command at the beginning of a +line, and follow it with four arguments, separated by commas, on the +rest of the same line. These arguments are the name of the node, and +the names of the `Next', `Previous', and `Up' pointers, in that order. +You may insert spaces before each pointer if you wish; the spaces are +ignored. You must write the name of the node, and the names of the +`Next', `Previous', and `Up' pointers, all on the same line. Otherwise, +the formatters fail. (*note info: (info)Top, for more information +about nodes in Info.) + + Usually, you write one of the chapter-structuring command lines +immediately after an `@node' line--for example, an `@section' or +`@subsection' line. (*Note Types of Structuring Commands: Structuring +Command Types.) + + *Please note:* The GNU Emacs Texinfo mode updating commands work + only with Texinfo files in which `@node' lines are followed by + chapter structuring lines. *Note Updating Requirements::. + + TeX uses `@node' lines to identify the names to use for cross +references. For this reason, you must write `@node' lines in a Texinfo +file that you intend to format for printing, even if you do not intend +to format it for Info. (Cross references, such as the one at the end +of this sentence, are made with `@xref' and its related commands; see +*Note Cross References::.) + +* Menu: + +* Node Names:: How to choose node and pointer names. +* Writing a Node:: How to write an `@node' line. +* Node Line Tips:: Keep names short. +* Node Line Requirements:: Keep names unique, without @-commands. +* First Node:: How to write a `Top' node. +* makeinfo top command:: How to use the `@top' command. +* Top Node Summary:: Write a brief description for readers. + + +File: texinfo.info, Node: Node Names, Next: Writing a Node, Prev: node, Up: node + +Choosing Node and Pointer Names +------------------------------- + + The name of a node identifies the node. The pointers enable you to +reach other nodes and consist of the names of those nodes. + + Normally, a node's `Up' pointer contains the name of the node whose +menu mentions that node. The node's `Next' pointer contains the name +of the node that follows that node in that menu and its `Previous' +pointer contains the name of the node that precedes it in that menu. +When a node's `Previous' node is the same as its `Up' node, both node +pointers name the same node. + + Usually, the first node of a Texinfo file is the `Top' node, and its +`Up' and `Previous' pointers point to the `dir' file, which contains +the main menu for all of Info. + + The `Top' node itself contains the main or master menu for the manual. +Also, it is helpful to include a brief description of the manual in the +`Top' node. *Note First Node::, for information on how to write the +first node of a Texinfo file. + + +File: texinfo.info, Node: Writing a Node, Next: Node Line Tips, Prev: Node Names, Up: node + +How to Write an `@node' Line +---------------------------- + + The easiest way to write an `@node' line is to write `@node' at the +beginning of a line and then the name of the node, like this: + + @node NODE-NAME + + If you are using GNU Emacs, you can use the update node commands +provided by Texinfo mode to insert the names of the pointers; or you +can leave the pointers out of the Texinfo file and let `makeinfo' +insert node pointers into the Info file it creates. (*Note Texinfo +Mode::, and *Note makeinfo Pointer Creation::.) + + Alternatively, you can insert the `Next', `Previous', and `Up' +pointers yourself. If you do this, you may find it helpful to use the +Texinfo mode keyboard command `C-c C-c n'. This command inserts +`@node' and a comment line listing the names of the pointers in their +proper order. The comment line helps you keep track of which arguments +are for which pointers. This comment line is especially useful if you +are not familiar with Texinfo. + + The template for a node line with `Next', `Previous', and `Up' +pointers looks like this: + + @node NODE-NAME, NEXT, PREVIOUS, UP + + If you wish, you can ignore `@node' lines altogether in your first +draft and then use the `texinfo-insert-node-lines' command to create +`@node' lines for you. However, we do not recommend this practice. It +is better to name the node itself at the same time that you write a +segment so you can easily make cross references. A large number of +cross references are an especially important feature of a good Info +file. + + After you have inserted an `@node' line, you should immediately write +an @-command for the chapter or section and insert its name. Next (and +this is important!), put in several index entries. Usually, you will +find at least two and often as many as four or five ways of referring +to the node in the index. Use them all. This will make it much easier +for people to find the node. + + +File: texinfo.info, Node: Node Line Tips, Next: Node Line Requirements, Prev: Writing a Node, Up: node + +`@node' Line Tips +----------------- + + Here are three suggestions: + + * Try to pick node names that are informative but short. + + In the Info file, the file name, node name, and pointer names are + all inserted on one line, which may run into the right edge of the + window. (This does not cause a problem with Info, but is ugly.) + + * Try to pick node names that differ from each other near the + beginnings of their names. This way, it is easy to use automatic + name completion in Info. + + * By convention, node names are capitalized just as they would be for + section or chapter titles--initial and significant words are + capitalized; others are not. + + +File: texinfo.info, Node: Node Line Requirements, Next: First Node, Prev: Node Line Tips, Up: node + +`@node' Line Requirements +------------------------- + + Here are several requirements for `@node' lines: + + * All the node names for a single Info file must be unique. + + Duplicates confuse the Info movement commands. This means, for + example, that if you end every chapter with a summary, you must + name each summary node differently. You cannot just call each one + "Summary". You may, however, duplicate the titles of chapters, + sections, and the like. Thus you can end each chapter in a book + with a section called "Summary", so long as the node names for + those sections are all different. + + * A pointer name must be the name of a node. + + The node to which a pointer points may come before or after the + node containing the pointer. + + * You cannot use any of the Texinfo @-commands in a node name; + @-commands confuse Info. + + Thus, the beginning of the section called `@chapter' looks like + this: + + @node chapter, unnumbered & appendix, makeinfo top, Structuring + @comment node-name, next, previous, up + @section @code{@@chapter} + @findex chapter + + * You cannot use commas or apostrophes within a node name; these + confuse TeX or the Info formatters. + + For example, the following is a section title: + + @code{@@unnumberedsec}, @code{@@appendixsec}, @code{@@heading} + + The corresponding node name is: + + unnumberedsec appendixsec heading + + * Case is significant. + + +File: texinfo.info, Node: First Node, Next: makeinfo top command, Prev: Node Line Requirements, Up: node + +The First Node +-------------- + + The first node of a Texinfo file is the "Top" node, except in an +included file (*note Include Files::.). The Top node contains the main +or master menu for the document, and a short summary of the document +(*note Top Node Summary::.). + + The Top node (which must be named `top' or `Top') should have as its +`Up' node the name of a node in another file, where there is a menu +that leads to this file. Specify the file name in parentheses. If the +file is to be installed directly in the Info directory file, use +`(dir)' as the parent of the Top node; this is short for `(dir)top', +and specifies the Top node in the `dir' file, which contains the main +menu for the Info system as a whole. For example, the `@node Top' line +of this manual looks like this: + + @node Top, Copying, , (dir) + +(You can use the Texinfo updating commands or the `makeinfo' utility to +insert these pointers automatically.) + + Do not define the `Previous' node of the Top node to be `(dir)', as +it causes confusing behavior for users: if you are in the Top node and +hits to go backwards, you wind up in the middle of the some other +entry in the `dir' file, which has nothing to do with what you were +reading. + + *Note Install an Info File::, for more information about installing +an Info file in the `info' directory. + + +File: texinfo.info, Node: makeinfo top command, Next: Top Node Summary, Prev: First Node, Up: node + +The `@top' Sectioning Command +----------------------------- + + A special sectioning command, `@top', has been created for use with +the `@node Top' line. The `@top' sectioning command tells `makeinfo' +that it marks the `Top' node in the file. It provides the information +that `makeinfo' needs to insert node pointers automatically. Write the +`@top' command at the beginning of the line immediately following the +`@node Top' line. Write the title on the remaining part of the same +line as the `@top' command. + + In Info, the `@top' sectioning command causes the title to appear on a +line by itself, with a line of asterisks inserted underneath. + + In TeX and `texinfo-format-buffer', the `@top' sectioning command is +merely a synonym for `@unnumbered'. Neither of these formatters +require an `@top' command, and do nothing special with it. You can use +`@chapter' or `@unnumbered' after the `@node Top' line when you use +these formatters. Also, you can use `@chapter' or `@unnumbered' when +you use the Texinfo updating commands to create or update pointers and +menus. + + +File: texinfo.info, Node: Top Node Summary, Prev: makeinfo top command, Up: node + +The `Top' Node Summary +---------------------- + + You can help readers by writing a summary in the `Top' node, after the +`@top' line, before the main or master menu. The summary should +briefly describe the document. In Info, this summary will appear just +before the master menu. In a printed manual, this summary will appear +on a page of its own. + + If you do not want the summary to appear on a page of its own in a +printed manual, you can enclose the whole of the `Top' node, including +the `@node Top' line and the `@top' sectioning command line or other +sectioning command line between `@ifinfo' and `@end ifinfo'. This +prevents any of the text from appearing in the printed output. (*note +Conditionally Visible Text: Conditionals.). You can repeat the brief +description from the `Top' node within `@iftex' ... `@end iftex' at the +beginning of the first chapter, for those who read the printed manual. +This saves paper and may look neater. + + You should write the version number of the program to which the manual +applies in the summary. This helps the reader keep track of which +manual is for which version of the program. If the manual changes more +frequently than the program or is independent of it, you should also +include an edition number for the manual. (The title page should also +contain this information: see *Note `@titlepage': titlepage.) + + +File: texinfo.info, Node: makeinfo Pointer Creation, Prev: node, Up: Nodes + +Creating Pointers with `makeinfo' +================================= + + The `makeinfo' program has a feature for automatically creating node +pointers for a hierarchically organized file that lacks them. + + When you take advantage of this feature, you do not need to write the +`Next', `Previous', and `Up' pointers after the name of a node. +However, you must write a sectioning command, such as `@chapter' or +`@section', on the line immediately following each truncated `@node' +line. You cannot write a comment line after a node line; the section +line must follow it immediately. + + In addition, you must follow the `Top' `@node' line with a line +beginning with `@top' to mark the `Top' node in the file. *Note `@top': +makeinfo top. + + Finally, you must write the name of each node (except for the `Top' +node) in a menu that is one or more hierarchical levels above the +node's hierarchical level. + + This node pointer insertion feature in `makeinfo' is an alternative +to the menu and pointer creation and update commands in Texinfo mode. +(*Note Updating Nodes and Menus::.) It is especially helpful to people +who do not use GNU Emacs for writing Texinfo documents. + + +File: texinfo.info, Node: Menus, Next: Cross References, Prev: Nodes, Up: Top + +Menus +***** + + "Menus" contain pointers to subordinate nodes.(1) (*note +Menus-Footnotes::) In Info, you use menus to go to such nodes. Menus +have no effect in printed manuals and do not appear in them. + + By convention, a menu is put at the end of a node since a reader who +uses the menu may not see text that follows it. + + A node that has a menu should *not* contain much text. If you have a +lot of text and a menu, move most of the text into a new subnode--all +but a few lines. + +* Menu: + +* Menu Location:: Put a menu in a short node. +* Writing a Menu:: What is a menu? +* Menu Parts:: A menu entry has three parts. +* Less Cluttered Menu Entry:: Two part menu entry. +* Menu Example:: Two and three part menu entries. +* Other Info Files:: How to refer to a different Info file. + + +File: texinfo.info, Node: Menus-Footnotes, Up: Menus + + (1) Menus can carry you to any node, regardless of the hierarchical +structure; even to nodes in a different Info file. However, the GNU +Emacs Texinfo mode updating commands work only to create menus of +subordinate nodes. Conventionally, cross references are used to refer +to other nodes. + + +File: texinfo.info, Node: Menu Location, Next: Writing a Menu, Prev: Menus, Up: Menus + +Menus Need Short Nodes +====================== + + A reader can easily see a menu that is close to the beginning of the +node. The node should be short. As a practical matter, you should +locate a menu within 20 lines of the beginning of the node. Otherwise, +a reader with a terminal that displays only a few lines may miss the +menu and its associated text. + + The short text before a menu may look awkward in a printed manual. To +avoid this, you can write a menu near the beginning of its node and +follow the menu by an `@node' line, and then an `@heading' line located +within `@ifinfo' and `@end ifinfo'. This way, the menu, `@node' line, +and title appear only in the Info file, not the printed document. + + For example, the preceding two paragraphs follow an Info-only menu, +`@node' line, and heading, and look like this: + + @menu + * Menu Location:: Put a menu in a short node. + * Writing a Menu:: What is a menu? + * Menu Parts:: A menu entry has three parts. + * Less Cluttered Menu Entry:: Two part menu entry. + * Menu Example:: Two and three part entries. + * Other Info Files:: How to refer to a different + Info file. + @end menu + + @node Menu Location, Writing a Menu, , Menus + @ifinfo + @heading Menus Need Short Nodes + @end ifinfo + + The Texinfo file for this document contains more than a dozen +examples of this procedure. One is at the beginning of this chapter; +another is at the beginning of the "Cross References" chapter. + + +File: texinfo.info, Node: Writing a Menu, Next: Menu Parts, Prev: Menu Location, Up: Menus + +Writing a Menu +============== + + A menu consists of an `@menu' command on a line by itself followed by +menu entry lines or menu comment lines and then by an `@end menu' +command on a line by itself. + + A menu looks like this: + + @menu + Larger Units of Text + + * Files:: All about handling files. + * Multiples: Buffers. Multiple buffers; editing + several files at once. + @end menu + + In a menu, every line that begins with an `* ' is a "menu entry". +(Note the space after the asterisk.) A line that does not start with +an `* ' may also appear in a menu. Such a line is not a menu entry but +is a menu comment line that appears in the Info file. In the example +above, the line `Larger Units of Text' is a menu comment line; the two +lines starting with `* ' are menu entries. + + +File: texinfo.info, Node: Menu Parts, Next: Less Cluttered Menu Entry, Prev: Writing a Menu, Up: Menus + +The Parts of a Menu +=================== + + A menu entry has three parts, only the second of which is required: + + 1. The menu entry name (optional). + + 2. The name of the node (required). + + 3. A description of the item (optional). + + The template for a menu entry looks like this: + + * MENU-ENTRY-NAME: NODE-NAME. DESCRIPTION + + Follow the menu entry name with a single colon and follow the node +name with tab, comma, period, or newline. + + In Info, a user selects a node with the `m' (`Info-menu') command. +The menu entry name is what the user types after the `m' command. + + The third part of a menu entry is a descriptive phrase or sentence. +Menu entry names and node names are often short; the description +explains to the reader what the node is about. A useful description +complements the node name rather than repeats it. The description, +which is optional, can spread over two or more lines; if it does, some +authors prefer to indent the second line while others prefer to align it +with the first (and all others). It's up to you. + + +File: texinfo.info, Node: Less Cluttered Menu Entry, Next: Menu Example, Prev: Menu Parts, Up: Menus + +Less Cluttered Menu Entry +========================= + + When the menu entry name and node name are the same, you can write +the name immediately after the asterisk and space at the beginning of +the line and follow the name with two colons. + + For example, write + + * Name:: DESCRIPTION + +instead of + + * Name: Name. DESCRIPTION + + You should use the node name for the menu entry name whenever +possible, since it reduces visual clutter in the menu. + + +File: texinfo.info, Node: Menu Example, Next: Other Info Files, Prev: Less Cluttered Menu Entry, Up: Menus + +A Menu Example +============== + + A menu looks like this in Texinfo: + + @menu + * menu entry name: Node name. A short description. + * Node name:: This form is preferred. + @end menu + +This produces: + + * menu: + + * menu entry name: Node name. A short description. + * Node name:: This form is preferred. + + Here is an example as you might see it in a Texinfo file: + + @menu + Larger Units of Text + + * Files:: All about handling files. + * Multiples: Buffers. Multiple buffers; editing + several files at once. + @end menu + +This produces: + + * menu: + Larger Units of Text + + * Files:: All about handling files. + * Multiples: Buffers. Multiple buffers; editing + several files at once. + + In this example, the menu has two entries. `Files' is both a menu +entry name and the name of the node referred to by that name. +`Multiples' is the menu entry name; it refers to the node named +`Buffers'. The line `Larger Units of Text' is a comment; it appears in +the menu, but is not an entry. + + Since no file name is specified with either `Files' or `Buffers', +they must be the names of nodes in the same Info file (*note Referring +to Other Info Files: Other Info Files.). + + +File: texinfo.info, Node: Other Info Files, Prev: Menu Example, Up: Menus + +Referring to Other Info Files +============================= + + You can create a menu entry that enables a reader in Info to go to a +node in another Info file by writing the file name in parentheses just +before the node name. In this case, you should use the three-part menu +entry format, which saves the reader from having to type the file name. + + The format looks like this: + + @menu + * FIRST-ENTRY-NAME:(FILENAME)NODENAME. DESCRIPTION + * SECOND-ENTRY-NAME:(FILENAME)SECOND-NODE. DESCRIPTION + @end menu + + For example, to refer directly to the `Outlining' and `Rebinding' +nodes in the `Emacs Manual', you would write a menu like this: + + @menu + * Outlining: (emacs)Outline Mode. The major mode for + editing outlines. + * Rebinding: (emacs)Rebinding. How to redefine the + meaning of a key. + @end menu + + If you do not list the node name, but only name the file, then Info +presumes that you are referring to the `Top' node. + + The `dir' file that contains the main menu for Info has menu entries +that list only file names. These take you directly to the `Top' nodes +of each Info document. (*Note Install an Info File::.) + + For example: + + * Info: (info). Documentation browsing system. + * Emacs: (emacs). The extensible, self-documenting + text editor. + +(The `dir' top level directory for the Info system is an Info file, not +a Texinfo file, but a menu entry looks the same in both types of file.) + + Note that the GNU Emacs Texinfo mode menu updating commands only work +with nodes within the current buffer, so you cannot use them to create +menus that refer to other files. You must write such menus by hand. + + +File: texinfo.info, Node: Cross References, Next: Marking Text, Prev: Menus, Up: Top + +Cross References +**************** + + "Cross references" are used to refer the reader to other parts of the +same or different Texinfo files. In Texinfo, nodes are the places to +which cross references can refer. + +* Menu: + +* References:: What cross references are for. +* Cross Reference Commands:: A summary of the different commands. +* Cross Reference Parts:: A cross reference has several parts. +* xref:: Begin a reference with `See' ... +* Top Node Naming:: How to refer to the beginning of another file. +* ref:: A reference for the last part of a sentence. +* pxref:: How to write a parenthetical cross reference. +* inforef:: How to refer to an Info-only file. +* uref:: How to refer to a uniform resource locator. + + +File: texinfo.info, Node: References, Next: Cross Reference Commands, Prev: Cross References, Up: Cross References + +What References Are For +======================= + + Often, but not always, a printed document should be designed so that +it can be read sequentially. People tire of flipping back and forth to +find information that should be presented to them as they need it. + + However, in any document, some information will be too detailed for +the current context, or incidental to it; use cross references to +provide access to such information. Also, an on-line help system or a +reference manual is not like a novel; few read such documents in +sequence from beginning to end. Instead, people look up what they +need. For this reason, such creations should contain many cross +references to help readers find other information that they may not +have read. + + In a printed manual, a cross reference results in a page reference, +unless it is to another manual altogether, in which case the cross +reference names that manual. + + In Info, a cross reference results in an entry that you can follow +using the Info `f' command. (*note Some advanced Info commands: +(info)Help-Adv.) + + The various cross reference commands use nodes to define cross +reference locations. This is evident in Info, in which a cross +reference takes you to the specified node. TeX also uses nodes to +define cross reference locations, but the action is less obvious. When +TeX generates a DVI file, it records nodes' page numbers and uses the +page numbers in making references. Thus, if you are writing a manual +that will only be printed, and will not be used on-line, you must +nonetheless write `@node' lines to name the places to which you make +cross references. + + +File: texinfo.info, Node: Cross Reference Commands, Next: Cross Reference Parts, Prev: References, Up: Cross References + +Different Cross Reference Commands +================================== + + There are four different cross reference commands: + +`@xref' + Used to start a sentence in the printed manual saying `See ...' + or an Info cross-reference saying `*Note NAME: NODE.'. + +`@ref' + Used within or, more often, at the end of a sentence; same as + `@xref' for Info; produces just the reference in the printed + manual without a preceding `See'. + +`@pxref' + Used within parentheses to make a reference that suits both an Info + file and a printed book. Starts with a lower case `see' within the + printed manual. (`p' is for `parenthesis'.) + +`@inforef' + Used to make a reference to an Info file for which there is no + printed manual. + +(The `@cite' command is used to make references to books and manuals +for which there is no corresponding Info file and, therefore, no node +to which to point. *Note `@cite': cite.) + + +File: texinfo.info, Node: Cross Reference Parts, Next: xref, Prev: Cross Reference Commands, Up: Cross References + +Parts of a Cross Reference +========================== + + A cross reference command requires only one argument, which is the +name of the node to which it refers. But a cross reference command may +contain up to four additional arguments. By using these arguments, you +can provide a cross reference name for Info, a topic description or +section title for the printed output, the name of a different Info +file, and the name of a different printed manual. + + Here is a simple cross reference example: + + @xref{Node name}. + +which produces + + *Note Node name::. + +and + + See Section NNN [Node name], page PPP. + + Here is an example of a full five-part cross reference: + + @xref{Node name, Cross Reference Name, Particular Topic, + info-file-name, A Printed Manual}, for details. + +which produces + + *Note Cross Reference Name: (info-file-name)Node name, + for details. + +in Info and + + See section "Particular Topic" in A Printed Manual, for details. + +in a printed book. + + The five possible arguments for a cross reference are: + + 1. The node name (required). This is the node to which the cross + reference takes you. In a printed document, the location of the + node provides the page reference only for references within the + same document. + + 2. The cross reference name for the Info reference, if it is to be + different from the node name. If you include this argument, it + becomes the first part of the cross reference. It is usually + omitted. + + 3. A topic description or section name. Often, this is the title of + the section. This is used as the name of the reference in the + printed manual. If omitted, the node name is used. + + 4. The name of the Info file in which the reference is located, if it + is different from the current file. You need not include any + `.info' suffix on the file name, since Info readers try appending + it automatically. + + 5. The name of a printed manual from a different Texinfo file. + + The template for a full five argument cross reference looks like this: + + @xref{NODE-NAME, CROSS-REFERENCE-NAME, TITLE-OR-TOPIC, + INFO-FILE-NAME, PRINTED-MANUAL-TITLE}. + + Cross references with one, two, three, four, and five arguments are +described separately following the description of `@xref'. + + Write a node name in a cross reference in exactly the same way as in +the `@node' line, including the same capitalization; otherwise, the +formatters may not find the reference. + + You can write cross reference commands within a paragraph, but note +how Info and TeX format the output of each of the various commands: +write `@xref' at the beginning of a sentence; write `@pxref' only +within parentheses, and so on. + + +File: texinfo.info, Node: xref, Next: Top Node Naming, Prev: Cross Reference Parts, Up: Cross References + +`@xref' +======= + + The `@xref' command generates a cross reference for the beginning of +a sentence. The Info formatting commands convert it into an Info cross +reference, which the Info `f' command can use to bring you directly to +another node. The TeX typesetting commands convert it into a page +reference, or a reference to another book or manual. + +* Menu: + +* Reference Syntax:: What a reference looks like and requires. +* One Argument:: `@xref' with one argument. +* Two Arguments:: `@xref' with two arguments. +* Three Arguments:: `@xref' with three arguments. +* Four and Five Arguments:: `@xref' with four and five arguments. + + +File: texinfo.info, Node: Reference Syntax, Next: One Argument, Prev: xref, Up: xref + +What a Reference Looks Like and Requires +---------------------------------------- + + Most often, an Info cross reference looks like this: + + *Note NODE-NAME::. + +or like this + + *Note CROSS-REFERENCE-NAME: NODE-NAME. + +In TeX, a cross reference looks like this: + + See Section SECTION-NUMBER [NODE-NAME], page PAGE. + +or like this + + See Section SECTION-NUMBER [TITLE-OR-TOPIC], page PAGE. + + The `@xref' command does not generate a period or comma to end the +cross reference in either the Info file or the printed output. You +must write that period or comma yourself; otherwise, Info will not +recognize the end of the reference. (The `@pxref' command works +differently. *Note `@pxref': pxref.) + + *Please note:* A period or comma *must* follow the closing brace + of an `@xref'. It is required to terminate the cross reference. + This period or comma will appear in the output, both in the Info + file and in the printed manual. + + `@xref' must refer to an Info node by name. Use `@node' to define +the node (*note Writing a Node::.). + + `@xref' is followed by several arguments inside braces, separated by +commas. Whitespace before and after these commas is ignored. + + A cross reference requires only the name of a node; but it may contain +up to four additional arguments. Each of these variations produces a +cross reference that looks somewhat different. + + *Please note:* Commas separate arguments in a cross reference; + avoid including them in the title or other part lest the formatters + mistake them for separators. + + +File: texinfo.info, Node: One Argument, Next: Two Arguments, Prev: Reference Syntax, Up: xref + +`@xref' with One Argument +------------------------- + + The simplest form of `@xref' takes one argument, the name of another +node in the same Info file. The Info formatters produce output that +the Info readers can use to jump to the reference; TeX produces output +that specifies the page and section number for you. + +For example, + + @xref{Tropical Storms}. + +produces + + *Note Tropical Storms::. + +and + + See Section 3.1 [Tropical Storms], page 24. + +(Note that in the preceding example the closing brace is followed by a +period.) + + You can write a clause after the cross reference, like this: + + @xref{Tropical Storms}, for more info. + +which produces + + *Note Tropical Storms::, for more info. + + See Section 3.1 [Tropical Storms], page 24, for more info. + +(Note that in the preceding example the closing brace is followed by a +comma, and then by the clause, which is followed by a period.) + + +File: texinfo.info, Node: Two Arguments, Next: Three Arguments, Prev: One Argument, Up: xref + +`@xref' with Two Arguments +-------------------------- + + With two arguments, the second is used as the name of the Info cross +reference, while the first is still the name of the node to which the +cross reference points. + +The template is like this: + + @xref{NODE-NAME, CROSS-REFERENCE-NAME}. + +For example, + + @xref{Electrical Effects, Lightning}. + +produces: + + *Note Lightning: Electrical Effects. + +and + + See Section 5.2 [Electrical Effects], page 57. + +(Note that in the preceding example the closing brace is followed by a +period; and that the node name is printed, not the cross reference +name.) + + You can write a clause after the cross reference, like this: + + @xref{Electrical Effects, Lightning}, for more info. + +which produces + *Note Lightning: Electrical Effects, for more info. + +and + + See Section 5.2 [Electrical Effects], page 57, for more info. + +(Note that in the preceding example the closing brace is followed by a +comma, and then by the clause, which is followed by a period.) + + +File: texinfo.info, Node: Three Arguments, Next: Four and Five Arguments, Prev: Two Arguments, Up: xref + +`@xref' with Three Arguments +---------------------------- + + A third argument replaces the node name in the TeX output. The third +argument should be the name of the section in the printed output, or +else state the topic discussed by that section. Often, you will want to +use initial upper case letters so it will be easier to read when the +reference is printed. Use a third argument when the node name is +unsuitable because of syntax or meaning. + + Remember to avoid placing a comma within the title or topic section of +a cross reference, or within any other section. The formatters divide +cross references into arguments according to the commas; a comma within +a title or other section will divide it into two arguments. In a +reference, you need to write a title such as "Clouds, Mist, and Fog" +without the commas. + + Also, remember to write a comma or period after the closing brace of a +`@xref' to terminate the cross reference. In the following examples, a +clause follows a terminating comma. + +The template is like this: + + @xref{NODE-NAME, CROSS-REFERENCE-NAME, TITLE-OR-TOPIC}. + +For example, + + @xref{Electrical Effects, Lightning, Thunder and Lightning}, + for details. + +produces + + *Note Lightning: Electrical Effects, for details. + +and + + See Section 5.2 [Thunder and Lightning], page 57, for details. + + If a third argument is given and the second one is empty, then the +third argument serves both. (Note how two commas, side by side, mark +the empty second argument.) + + @xref{Electrical Effects, , Thunder and Lightning}, + for details. + +produces + + *Note Thunder and Lightning: Electrical Effects, for details. + +and + + See Section 5.2 [Thunder and Lightning], page 57, for details. + + As a practical matter, it is often best to write cross references with +just the first argument if the node name and the section title are the +same, and with the first and third arguments if the node name and title +are different. + + Here are several examples from `The GNU Awk User's Guide': + + @xref{Sample Program}. + @xref{Glossary}. + @xref{Case-sensitivity, ,Case-sensitivity in Matching}. + @xref{Close Output, , Closing Output Files and Pipes}, + for more information. + @xref{Regexp, , Regular Expressions as Patterns}. + + +File: texinfo.info, Node: Four and Five Arguments, Prev: Three Arguments, Up: xref + +`@xref' with Four and Five Arguments +------------------------------------ + + In a cross reference, a fourth argument specifies the name of another +Info file, different from the file in which the reference appears, and +a fifth argument specifies its title as a printed manual. + + Remember that a comma or period must follow the closing brace of an +`@xref' command to terminate the cross reference. In the following +examples, a clause follows a terminating comma. + +The template is: + + @xref{NODE-NAME, CROSS-REFERENCE-NAME, TITLE-OR-TOPIC, + INFO-FILE-NAME, PRINTED-MANUAL-TITLE}. + +For example, + + @xref{Electrical Effects, Lightning, Thunder and Lightning, + weather, An Introduction to Meteorology}, for details. + +produces + + *Note Lightning: (weather)Electrical Effects, for details. + +The name of the Info file is enclosed in parentheses and precedes the +name of the node. + +In a printed manual, the reference looks like this: + + See section "Thunder and Lightning" in An Introduction to + Meteorology, for details. + +The title of the printed manual is typeset in italics; and the +reference lacks a page number since TeX cannot know to which page a +reference refers when that reference is to another manual. + + Often, you will leave out the second argument when you use the long +version of `@xref'. In this case, the third argument, the topic +description, will be used as the cross reference name in Info. + +The template looks like this: + + @xref{NODE-NAME, , TITLE-OR-TOPIC, INFO-FILE-NAME, + PRINTED-MANUAL-TITLE}, for details. + +which produces + + *Note TITLE-OR-TOPIC: (INFO-FILE-NAME)NODE-NAME, for details. + +and + + See section TITLE-OR-TOPIC in PRINTED-MANUAL-TITLE, for details. + +For example, + + @xref{Electrical Effects, , Thunder and Lightning, + weather, An Introduction to Meteorology}, for details. + +produces + + *Note Thunder and Lightning: (weather)Electrical Effects, + for details. + +and + + See section "Thunder and Lightning" in An Introduction to + Meteorology, for details. + + On rare occasions, you may want to refer to another Info file that is +within a single printed manual--when multiple Texinfo files are +incorporated into the same TeX run but make separate Info files. In +this case, you need to specify only the fourth argument, and not the +fifth. + + +File: texinfo.info, Node: Top Node Naming, Next: ref, Prev: xref, Up: Cross References + +Naming a `Top' Node +=================== + + In a cross reference, you must always name a node. This means that in +order to refer to a whole manual, you must identify the `Top' node by +writing it as the first argument to the `@xref' command. (This is +different from the way you write a menu entry; see *Note Referring to +Other Info Files: Other Info Files.) At the same time, to provide a +meaningful section topic or title in the printed cross reference +(instead of the word `Top'), you must write an appropriate entry for +the third argument to the `@xref' command. + +Thus, to make a cross reference to `The GNU Make Manual', write: + + @xref{Top, , Overview, make, The GNU Make Manual}. + +which produces + + *Note Overview: (make)Top. + +and + + See section "Overview" in The GNU Make Manual. + +In this example, `Top' is the name of the first node, and `Overview' is +the name of the first section of the manual. + + +File: texinfo.info, Node: ref, Next: pxref, Prev: Top Node Naming, Up: Cross References + +`@ref' +====== + + `@ref' is nearly the same as `@xref' except that it does not generate +a `See' in the printed output, just the reference itself. This makes +it useful as the last part of a sentence. + +For example, + + For more information, see @ref{Hurricanes}. + +produces + + For more information, see *Note Hurricanes. + +and + + For more information, see Section 8.2 [Hurricanes], page 123. + + The `@ref' command sometimes leads writers to express themselves in a +manner that is suitable for a printed manual but looks awkward in the +Info format. Bear in mind that your audience will be using both the +printed and the Info format. + +For example, + + Sea surges are described in @ref{Hurricanes}. + +produces + + Sea surges are described in Section 6.7 [Hurricanes], page 72. + +in a printed document, and the following in Info: + + Sea surges are described in *Note Hurricanes::. + + *Caution:* You *must* write a period or comma immediately after an + `@ref' command with two or more arguments. Otherwise, Info will + not find the end of the cross reference entry and its attempt to + follow the cross reference will fail. As a general rule, you + should write a period or comma after every `@ref' command. This + looks best in both the printed and the Info output. + + +File: texinfo.info, Node: pxref, Next: inforef, Prev: ref, Up: Cross References + +`@pxref' +======== + + The parenthetical reference command, `@pxref', is nearly the same as +`@xref', but you use it *only* inside parentheses and you do *not* type +a comma or period after the command's closing brace. The command +differs from `@xref' in two ways: + + 1. TeX typesets the reference for the printed manual with a lower case + `see' rather than an upper case `See'. + + 2. The Info formatting commands automatically end the reference with a + closing colon or period. + + Because one type of formatting automatically inserts closing +punctuation and the other does not, you should use `@pxref' *only* +inside parentheses as part of another sentence. Also, you yourself +should not insert punctuation after the reference, as you do with +`@xref'. + + `@pxref' is designed so that the output looks right and works right +between parentheses both in printed output and in an Info file. In a +printed manual, a closing comma or period should not follow a cross +reference within parentheses; such punctuation is wrong. But in an +Info file, suitable closing punctuation must follow the cross reference +so Info can recognize its end. `@pxref' spares you the need to use +complicated methods to put a terminator into one form of the output and +not the other. + +With one argument, a parenthetical cross reference looks like this: + + ... storms cause flooding (@pxref{Hurricanes}) ... + +which produces + + ... storms cause flooding (*Note Hurricanes::) ... + +and + + ... storms cause flooding (see Section 6.7 [Hurricanes], page 72) + ... + + With two arguments, a parenthetical cross reference has this template: + + ... (@pxref{NODE-NAME, CROSS-REFERENCE-NAME}) ... + +which produces + + ... (*Note CROSS-REFERENCE-NAME: NODE-NAME.) ... + +and + + ... (see Section NNN [NODE-NAME], page PPP) ... + + `@pxref' can be used with up to five arguments just like `@xref' +(*note `@xref': xref.). + + *Please note:* Use `@pxref' only as a parenthetical reference. Do + not try to use `@pxref' as a clause in a sentence. It will look + bad in either the Info file, the printed output, or both. + + Also, parenthetical cross references look best at the ends of + sentences. Although you may write them in the middle of a + sentence, that location breaks up the flow of text. + + +File: texinfo.info, Node: inforef, Next: uref, Prev: pxref, Up: Cross References + +`@inforef' +========== + + `@inforef' is used for cross references to Info files for which there +are no printed manuals. Even in a printed manual, `@inforef' generates +a reference directing the user to look in an Info file. + + The command takes either two or three arguments, in the following +order: + + 1. The node name. + + 2. The cross reference name (optional). + + 3. The Info file name. + +Separate the arguments with commas, as with `@xref'. Also, you must +terminate the reference with a comma or period after the `}', as you do +with `@xref'. + +The template is: + + @inforef{NODE-NAME, CROSS-REFERENCE-NAME, INFO-FILE-NAME}, + +Thus, + + @inforef{Expert, Advanced Info commands, info}, + for more information. + +produces + + *Note Advanced Info commands: (info)Expert, + for more information. + +and + + See Info file `info', node `Expert', for more information. + +Similarly, + + @inforef{Expert, , info}, for more information. + +produces + + *Note (info)Expert::, for more information. + +and + + See Info file `info', node `Expert', for more information. + + The converse of `@inforef' is `@cite', which is used to refer to +printed works for which no Info form exists. *Note `@cite': cite. + + +File: texinfo.info, Node: uref, Prev: inforef, Up: Cross References + +`@uref{URL[, DISPLAYED-TEXT]}' +============================== + + `@uref' produces a reference to a uniform resource locator (URL). It +takes one mandatory argument, the URL, and one optional argument, the +text to display (the default is the URL itself). In HTML output, +`@uref' produces a link you can follow. For example: + + The official GNU ftp site is + @uref{ftp://ftp.gnu.ai.mit.edu/pub/gnu} + +produces (in text): + The official GNU ftp site is + `ftp://ftp.gnu.ai.mit.edu/pub/gnu' + +whereas + The official + @uref{ftp://ftp.gnu.ai.mit.edu/pub/gnu, + GNU ftp site} holds programs and texts. + +produces (in text): + The official GNU ftp site (ftp://ftp.gnu.ai.mit.edu/pub/gnu) holds + programs and texts. + +and (in HTML): + The official GNU ftp + site holds programs and texts. + + To merely indicate a URL, use `@url' (*note `@url': url.). + + +File: texinfo.info, Node: Marking Text, Next: Quotations and Examples, Prev: Cross References, Up: Top + +Marking Words and Phrases +************************* + + In Texinfo, you can mark words and phrases in a variety of ways. The +Texinfo formatters use this information to determine how to highlight +the text. You can specify, for example, whether a word or phrase is a +defining occurrence, a metasyntactic variable, or a symbol used in a +program. Also, you can emphasize text. + +* Menu: + +* Indicating:: How to indicate definitions, files, etc. +* Emphasis:: How to emphasize text. + diff --git a/info/texinfo.info-5 b/info/texinfo.info-5 new file mode 100644 index 0000000..e7fea89 --- /dev/null +++ b/info/texinfo.info-5 @@ -0,0 +1,1444 @@ +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98 Free Software +Foundation, Inc. + + This edition is for Texinfo version 3.12. + + 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 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. + + +File: texinfo.info, Node: Indicating, Next: Emphasis, Prev: Marking Text, Up: Marking Text + +Indicating Definitions, Commands, etc. +====================================== + + Texinfo has commands for indicating just what kind of object a piece +of text refers to. For example, metasyntactic variables are marked by +`@var', and code by `@code'. Since the pieces of text are labelled by +commands that tell what kind of object they are, it is easy to change +the way the Texinfo formatters prepare such text. (Texinfo is an +*intentional* formatting language rather than a *typesetting* +formatting language.) + + For example, in a printed manual, code is usually illustrated in a +typewriter font; `@code' tells TeX to typeset this text in this font. +But it would be easy to change the way TeX highlights code to use +another font, and this change would not effect how keystroke examples +are highlighted. If straight typesetting commands were used in the body +of the file and you wanted to make a change, you would need to check +every single occurrence to make sure that you were changing code and +not something else that should not be changed. + +* Menu: + +* Useful Highlighting:: Highlighting provides useful information. +* code:: How to indicate code. +* kbd:: How to show keyboard input. +* key:: How to specify keys. +* samp:: How to show a literal sequence of characters. +* var:: How to indicate a metasyntactic variable. +* file:: How to indicate the name of a file. +* dfn:: How to specify a definition. +* cite:: How to refer to a book that is not in Info. +* url:: How to indicate a world wide web reference. +* email:: How to indicate an electronic mail address. + + +File: texinfo.info, Node: Useful Highlighting, Next: code, Prev: Indicating, Up: Indicating + +Highlighting Commands are Useful +-------------------------------- + + The highlighting commands can be used to generate useful information +from the file, such as lists of functions or file names. It is +possible, for example, to write a program in Emacs Lisp (or a keyboard +macro) to insert an index entry after every paragraph that contains +words or phrases marked by a specified command. You could do this to +construct an index of functions if you had not already made the entries. + + The commands serve a variety of purposes: + +`@code{SAMPLE-CODE}' + Indicate text that is a literal example of a piece of a program. + +`@kbd{KEYBOARD-CHARACTERS}' + Indicate keyboard input. + +`@key{KEY-NAME}' + Indicate the conventional name for a key on a keyboard. + +`@samp{TEXT}' + Indicate text that is a literal example of a sequence of + characters. + +`@var{METASYNTACTIC-VARIABLE}' + Indicate a metasyntactic variable. + +`@url{UNIFORM-RESOURCE-LOCATOR}' + Indicate a uniform resource locator for the World Wide Web. + +`@file{FILE-NAME}' + Indicate the name of a file. + +`@email{EMAIL-ADDRESS[, DISPLAYED-TEXT]}' + Indicate an electronic mail address. + +`@dfn{TERM}' + Indicate the introductory or defining use of a term. + +`@cite{REFERENCE}' + Indicate the name of a book. + + +File: texinfo.info, Node: code, Next: kbd, Prev: Useful Highlighting, Up: Indicating + +`@code'{SAMPLE-CODE} +-------------------- + + Use the `@code' command to indicate text that is a piece of a program +and which consists of entire syntactic tokens. Enclose the text in +braces. + + Thus, you should use `@code' for an expression in a program, for the +name of a variable or function used in a program, or for a keyword. +Also, you should use `@code' for the name of a program, such as `diff', +that is a name used in the machine. (You should write the name of a +program in the ordinary text font if you regard it as a new English +word, such as `Emacs' or `Bison'.) + + Use `@code' for environment variables such as `TEXINPUTS', and other +variables. + + Use `@code' for command names in command languages that resemble +programming languages, such as Texinfo or the shell. For example, +`@code' and `@samp' are produced by writing `@code{@@code}' and +`@code{@@samp}' in the Texinfo source, respectively. + + Note, however, that you should not use `@code' for shell options such +as `-c' when such options stand alone. (Use `@samp'.) Also, an entire +shell command often looks better if written using `@samp' rather than +`@code'. In this case, the rule is to choose the more pleasing format. + + It is incorrect to alter the case of a word inside an `@code' command +when it appears at the beginning of a sentence. Most computer +languages are case sensitive. In C, for example, `Printf' is different +from the identifier `printf', and most likely is a misspelling of it. +Even in languages which are not case sensitive, it is confusing to a +human reader to see identifiers spelled in different ways. Pick one +spelling and always use that. If you do not want to start a sentence +with a command written all in lower case, you should rearrange the +sentence. + + Do not use the `@code' command for a string of characters shorter +than a syntactic token. If you are writing about `TEXINPU', which is +just a part of the name for the `TEXINPUTS' environment variable, you +should use `@samp'. + + In particular, you should not use the `@code' command when writing +about the characters used in a token; do not, for example, use `@code' +when you are explaining what letters or printable symbols can be used +in the names of functions. (Use `@samp'.) Also, you should not use +`@code' to mark text that is considered input to programs unless the +input is written in a language that is like a programming language. +For example, you should not use `@code' for the keystroke commands of +GNU Emacs (use `@kbd' instead) although you may use `@code' for the +names of the Emacs Lisp functions that the keystroke commands invoke. + + In the printed manual, `@code' causes TeX to typeset the argument in +a typewriter face. In the Info file, it causes the Info formatting +commands to use single quotation marks around the text. + + For example, + + Use @code{diff} to compare two files. + +produces this in the printed manual: + + Use `diff' to compare two files. + + +File: texinfo.info, Node: kbd, Next: key, Prev: code, Up: Indicating + +`@kbd'{KEYBOARD-CHARACTERS} +--------------------------- + + Use the `@kbd' command for characters of input to be typed by users. +For example, to refer to the characters `M-a', write + + @kbd{M-a} + +and to refer to the characters `M-x shell', write + + @kbd{M-x shell} + + The `@kbd' command has the same effect as `@code' in Info, but by +default produces a different font (slanted typewriter instead of normal +typewriter) in the printed manual, so users can distinguish the +characters they are supposed to type from those the computer outputs. + + Since the usage of `@kbd' varies from manual to manual, you can +control the font switching with the `@kbdinputstyle' command. This +command has no effect on Info output. Write this command at the +beginning of a line with a single word as an argument, one of the +following: +`code' + Always use the same font for `@kbd' as `@code'. + +`example' + Use the distinguishing font for `@kbd' only in `@example' and + similar environments. + +`example' + (the default) Always use the distinguishing font for `@kbd'. + + You can embed another @-command inside the braces of an `@kbd' +command. Here, for example, is the way to describe a command that +would be described more verbosely as "press an `r' and then press the + key": + + @kbd{r @key{RET}} + +This produces: `r ' + + You also use the `@kbd' command if you are spelling out the letters +you type; for example: + + To give the @code{logout} command, + type the characters @kbd{l o g o u t @key{RET}}. + +This produces: + + To give the `logout' command, type the characters `l o g o u t + '. + + (Also, this example shows that you can add spaces for clarity. If you +really want to mention a space character as one of the characters of +input, write `@key{SPC}' for it.) + + +File: texinfo.info, Node: key, Next: samp, Prev: kbd, Up: Indicating + +`@key'{KEY-NAME} +---------------- + + Use the `@key' command for the conventional name for a key on a +keyboard, as in: + + @key{RET} + + You can use the `@key' command within the argument of an `@kbd' +command when the sequence of characters to be typed includes one or +more keys that are described by name. + + For example, to produce `C-x ' you would type: + + @kbd{C-x @key{ESC}} + + Here is a list of the recommended names for keys: + + SPC + Space + + RET + Return + + LFD + Linefeed (however, since most keyboards nowadays do not have + a Linefeed key, it might be better to call this character + `C-j'. + + TAB + Tab + + BS + Backspace + + ESC + Escape + + DEL + Delete + + SHIFT + Shift + + CTRL + Control + + META + Meta + + There are subtleties to handling words like `meta' or `ctrl' that are +names of modifier keys. When mentioning a character in which the +modifier key is used, such as `Meta-a', use the `@kbd' command alone; +do not use the `@key' command; but when you are referring to the +modifier key in isolation, use the `@key' command. For example, write +`@kbd{Meta-a}' to produce `Meta-a' and `@key{META}' to produce . + + +File: texinfo.info, Node: samp, Next: var, Prev: key, Up: Indicating + +`@samp'{TEXT} +------------- + + Use the `@samp' command to indicate text that is a literal example or +`sample' of a sequence of characters in a file, string, pattern, etc. +Enclose the text in braces. The argument appears within single +quotation marks in both the Info file and the printed manual; in +addition, it is printed in a fixed-width font. + + To match @samp{foo} at the end of the line, + use the regexp @samp{foo$}. + +produces + + To match `foo' at the end of the line, use the regexp `foo$'. + + Any time you are referring to single characters, you should use +`@samp' unless `@kbd' or `@key' is more appropriate. Use `@samp' for +the names of command-line options (except in an `@table', where `@code' +seems to read more easily). Also, you may use `@samp' for entire +statements in C and for entire shell commands--in this case, `@samp' +often looks better than `@code'. Basically, `@samp' is a catchall for +whatever is not covered by `@code', `@kbd', or `@key'. + + Only include punctuation marks within braces if they are part of the +string you are specifying. Write punctuation marks outside the braces +if those punctuation marks are part of the English text that surrounds +the string. In the following sentence, for example, the commas and +period are outside of the braces: + + In English, the vowels are @samp{a}, @samp{e}, + @samp{i}, @samp{o}, @samp{u}, and sometimes + @samp{y}. + +This produces: + + In English, the vowels are `a', `e', `i', `o', `u', and sometimes + `y'. + + +File: texinfo.info, Node: var, Next: file, Prev: samp, Up: Indicating + +`@var'{METASYNTACTIC-VARIABLE} +------------------------------ + + Use the `@var' command to indicate metasyntactic variables. A +"metasyntactic variable" is something that stands for another piece of +text. For example, you should use a metasyntactic variable in the +documentation of a function to describe the arguments that are passed +to that function. + + Do not use `@var' for the names of particular variables in +programming languages. These are specific names from a program, so +`@code' is correct for them. For example, the Emacs Lisp variable +`texinfo-tex-command' is not a metasyntactic variable; it is properly +formatted using `@code'. + + The effect of `@var' in the Info file is to change the case of the +argument to all upper case; in the printed manual, to italicize it. + + For example, + + To delete file @var{filename}, + type @code{rm @var{filename}}. + +produces + + To delete file FILENAME, type `rm FILENAME'. + +(Note that `@var' may appear inside `@code', `@samp', `@file', etc.) + + Write a metasyntactic variable all in lower case without spaces, and +use hyphens to make it more readable. Thus, the Texinfo source for the +illustration of how to begin a Texinfo manual looks like this: + + \input texinfo + @@setfilename @var{info-file-name} + @@settitle @var{name-of-manual} + +This produces: + + \input texinfo + @setfilename INFO-FILE-NAME + @settitle NAME-OF-MANUAL + + In some documentation styles, metasyntactic variables are shown with +angle brackets, for example: + + ..., type rm + +However, that is not the style that Texinfo uses. (You can, of course, +modify the sources to TeX and the Info formatting commands to output +the `<...>' format if you wish.) + + +File: texinfo.info, Node: file, Next: dfn, Prev: var, Up: Indicating + +`@file'{FILE-NAME} +------------------ + + Use the `@file' command to indicate text that is the name of a file, +buffer, or directory, or is the name of a node in Info. You can also +use the command for file name suffixes. Do not use `@file' for symbols +in a programming language; use `@code'. + + Currently, `@file' is equivalent to `@samp' in its effects. For +example, + + The @file{.el} files are in + the @file{/usr/local/emacs/lisp} directory. + +produces + + The `.el' files are in the `/usr/local/emacs/lisp' directory. + + +File: texinfo.info, Node: dfn, Next: cite, Prev: file, Up: Indicating + +`@dfn'{TERM} +------------ + + Use the `@dfn' command to identify the introductory or defining use +of a technical term. Use the command only in passages whose purpose is +to introduce a term which will be used again or which the reader ought +to know. Mere passing mention of a term for the first time does not +deserve `@dfn'. The command generates italics in the printed manual, +and double quotation marks in the Info file. For example: + + Getting rid of a file is called @dfn{deleting} it. + +produces + + Getting rid of a file is called "deleting" it. + + As a general rule, a sentence containing the defining occurrence of a +term should be a definition of the term. The sentence does not need to +say explicitly that it is a definition, but it should contain the +information of a definition--it should make the meaning clear. + + +File: texinfo.info, Node: cite, Next: url, Prev: dfn, Up: Indicating + +`@cite'{REFERENCE} +------------------ + + Use the `@cite' command for the name of a book that lacks a companion +Info file. The command produces italics in the printed manual, and +quotation marks in the Info file. + + (If a book is written in Texinfo, it is better to use a cross +reference command since a reader can easily follow such a reference in +Info. *Note `@xref': xref.) + + +File: texinfo.info, Node: url, Next: email, Prev: cite, Up: Indicating + +`@url'{UNIFORM-RESOURCE-LOCATOR} +-------------------------------- + + Use the `@url' to indicate a uniform resource locator on the World +Wide Web. This is analogous to `@file', `@var', etc., and is purely +for markup purposes. It does not produce a link you can follow in HTML +output (the `@uref' command does, *note `@uref': uref.). It is useful +for example URL's which do not actually exist. For example: + + For example, the url might be + @url{http://host.domain.org/path}. + + +File: texinfo.info, Node: email, Prev: url, Up: Indicating + +`@email'{EMAIL-ADDRESS[, DISPLAYED-TEXT]} +----------------------------------------- + + Use the `@email' command to indicate an electronic mail address. It +takes one mandatory argument, the address, and one optional argument, +the text to display (the default is the address itself). + + In Info and TeX, the address is shown in angle brackets, preceded by +the text to display if any. In HTML output, `@email' produces a +`mailto' link that usually brings up a mail composition window. For +example: + + Send bug reports to @email{bug-texinfo@@gnu.org}. + Send suggestions to the @email{bug-texinfo@@gnu.org, same place}. + +produces + Send bug reports to . + Send suggestions to the same place . + + +File: texinfo.info, Node: Emphasis, Prev: Indicating, Up: Marking Text + +Emphasizing Text +================ + + Usually, Texinfo changes the font to mark words in the text according +to what category the words belong to; an example is the `@code' command. +Most often, this is the best way to mark words. However, sometimes you +will want to emphasize text without indicating a category. Texinfo has +two commands to do this. Also, Texinfo has several commands that +specify the font in which TeX will typeset text. These commands have +no affect on Info and only one of them, the `@r' command, has any +regular use. + +* Menu: + +* emph & strong:: How to emphasize text in Texinfo. +* Smallcaps:: How to use the small caps font. +* Fonts:: Various font commands for printed output. +* Customized Highlighting:: How to define highlighting commands. + + +File: texinfo.info, Node: emph & strong, Next: Smallcaps, Prev: Emphasis, Up: Emphasis + +`@emph'{TEXT} and `@strong'{TEXT} +--------------------------------- + + The `@emph' and `@strong' commands are for emphasis; `@strong' is +stronger. In printed output, `@emph' produces *italics* and `@strong' +produces *bold*. + + For example, + + @quotation + @strong{Caution:} @samp{rm * .[^.]*} removes @emph{all} + files in the directory. + @end quotation + +produces: + + *Caution*: `rm * .[^.]*' removes *all* + files in the directory. + + The `@strong' command is seldom used except to mark what is, in +effect, a typographical element, such as the word `Caution' in the +preceding example. + + In the Info file, both `@emph' and `@strong' put asterisks around the +text. + + *Caution:* Do not use `@emph' or `@strong' with the word `Note'; + Info will mistake the combination for a cross reference. Use a + phrase such as *Please note* or *Caution* instead. + + +File: texinfo.info, Node: Smallcaps, Next: Fonts, Prev: emph & strong, Up: Emphasis + +`@sc'{TEXT}: The Small Caps Font +-------------------------------- + + Use the `@sc' command to set text in the printed output in a small +caps font and set text in the Info file in upper case letters. + + Write the text between braces in lower case, like this: + + The @sc{acm} and @sc{ieee} are technical societies. + +This produces: + + The ACM and IEEE are technical societies. + + TeX typesets the small caps font in a manner that prevents the +letters from `jumping out at you on the page'. This makes small caps +text easier to read than text in all upper case. The Info formatting +commands set all small caps text in upper case. + + If the text between the braces of an `@sc' command is upper case, TeX +typesets in full-size capitals. Use full-size capitals sparingly. + + You may also use the small caps font for a jargon word such as ATO (a +NASA word meaning `abort to orbit'). + + There are subtleties to using the small caps font with a jargon word +such as CDR, a word used in Lisp programming. In this case, you should +use the small caps font when the word refers to the second and +subsequent elements of a list (the CDR of the list), but you should use +`@code' when the word refers to the Lisp function of the same spelling. + + +File: texinfo.info, Node: Fonts, Next: Customized Highlighting, Prev: Smallcaps, Up: Emphasis + +Fonts for Printing, Not Info +---------------------------- + + Texinfo provides four font commands that specify font changes in the +printed manual but have no effect in the Info file. `@i' requests +italic font (in some versions of TeX, a slanted font is used), `@b' +requests bold face, `@t' requests the fixed-width, typewriter-style +font used by `@code', and `@r' requests a roman font, which is the +usual font in which text is printed. All four commands apply to an +argument that follows, surrounded by braces. + + Only the `@r' command has much use: in example programs, you can use +the `@r' command to convert code comments from the fixed-width font to +a roman font. This looks better in printed output. + + For example, + + @lisp + (+ 2 2) ; @r{Add two plus two.} + @end lisp + +produces + + (+ 2 2) ; Add two plus two. + + If possible, you should avoid using the other three font commands. If +you need to use one, it probably indicates a gap in the Texinfo +language. + + +File: texinfo.info, Node: Customized Highlighting, Prev: Fonts, Up: Emphasis + +Customized Highlighting +----------------------- + + You can use regular TeX commands inside of `@iftex' ... `@end iftex' +to create your own customized highlighting commands for Texinfo. The +easiest way to do this is to equate your customized commands with +pre-existing commands, such as those for italics. Such new commands +work only with TeX. + + You can use the `@definfoenclose' command inside of `@ifinfo' ... +`@end ifinfo' to define commands for Info with the same names as new +commands for TeX. `@definfoenclose' creates new commands for Info that +mark text by enclosing it in strings that precede and follow the text. +(1) (*note Customized Highlighting-Footnotes::) + + Here is how to create a new @-command called `@phoo' that causes TeX +to typeset its argument in italics and causes Info to display the +argument between `//' and `\\'. + + For TeX, write the following to equate the `@phoo' command with the +existing `@i' italics command: + + @iftex + @global@let@phoo=@i + @end iftex + +This defines `@phoo' as a command that causes TeX to typeset the +argument to `@phoo' in italics. `@global@let' tells TeX to equate the +next argument with the argument that follows the equals sign. + + For Info, write the following to tell the Info formatters to enclose +the argument between `//' and `\\': + + @ifinfo + @definfoenclose phoo, //, \\ + @end ifinfo + +Write the `@definfoenclose' command on a line and follow it with three +arguments separated by commas (commas are used as separators in an +`@node' line in the same way). + + * The first argument to `@definfoenclose' is the @-command name + *without* the `@'; + + * the second argument is the Info start delimiter string; and, + + * the third argument is the Info end delimiter string. + +The latter two arguments enclose the highlighted text in the Info file. +A delimiter string may contain spaces. Neither the start nor end +delimiter is required. However, if you do not provide a start +delimiter, you must follow the command name with two commas in a row; +otherwise, the Info formatting commands will misinterpret the end +delimiter string as a start delimiter string. + + After you have defined `@phoo' both for TeX and for Info, you can +then write `@phoo{bar}' to see `//bar\\' in Info and see `bar' in +italics in printed output. + + Note that each definition applies to its own formatter: one for TeX, +the other for Info. + + Here is another example: + + @ifinfo + @definfoenclose headword, , : + @end ifinfo + @iftex + @global@let@headword=@b + @end iftex + +This defines `@headword' as an Info formatting command that inserts +nothing before and a colon after the argument and as a TeX formatting +command to typeset its argument in bold. + + +File: texinfo.info, Node: Customized Highlighting-Footnotes, Up: Customized Highlighting + + (1) Currently, `@definfoenclose' works only with +`texinfo-format-buffer' and `texinfo-format-region', not with +`makeinfo'. + + +File: texinfo.info, Node: Quotations and Examples, Next: Lists and Tables, Prev: Marking Text, Up: Top + +Quotations and Examples +*********************** + + Quotations and examples are blocks of text consisting of one or more +whole paragraphs that are set off from the bulk of the text and treated +differently. They are usually indented. + + In Texinfo, you always begin a quotation or example by writing an +@-command at the beginning of a line by itself, and end it by writing +an `@end' command that is also at the beginning of a line by itself. +For instance, you begin an example by writing `@example' by itself at +the beginning of a line and end the example by writing `@end example' +on a line by itself, at the beginning of that line. + +* Menu: + +* Block Enclosing Commands:: Use different constructs for + different purposes. +* quotation:: How to write a quotation. +* example:: How to write an example in a fixed-width font. +* noindent:: How to prevent paragraph indentation. +* Lisp Example:: How to illustrate Lisp code. +* smallexample & smalllisp:: Forms for the `@smallbook' option. +* display:: How to write an example in the current font. +* format:: How to write an example that does not narrow + the margins. +* exdent:: How to undo the indentation of a line. +* flushleft & flushright:: How to push text flushleft or flushright. +* cartouche:: How to draw cartouches around examples. + + +File: texinfo.info, Node: Block Enclosing Commands, Next: quotation, Prev: Quotations and Examples, Up: Quotations and Examples + +The Block Enclosing Commands +============================ + + Here are commands for quotations and examples: + +`@quotation' + Indicate text that is quoted. The text is filled, indented, and + printed in a roman font by default. + +`@example' + Illustrate code, commands, and the like. The text is printed in a + fixed-width font, and indented but not filled. + +`@lisp' + Illustrate Lisp code. The text is printed in a fixed-width font, + and indented but not filled. + +`@smallexample' + Illustrate code, commands, and the like. Similar to `@example', + except that in TeX this command typesets text in a smaller font + for the smaller `@smallbook' format than for the 8.5 by 11 inch + format. + +`@smalllisp' + Illustrate Lisp code. Similar to `@lisp', except that in TeX this + command typesets text in a smaller font for the smaller + `@smallbook' format than for the 8.5 by 11 inch format. + +`@display' + Display illustrative text. The text is indented but not filled, + and no font is specified (so, by default, the font is roman). + +`@format' + Print illustrative text. The text is not indented and not filled + and no font is specified (so, by default, the font is roman). + + The `@exdent' command is used within the above constructs to undo the +indentation of a line. + + The `@flushleft' and `@flushright' commands are used to line up the +left or right margins of unfilled text. + + The `@noindent' command may be used after one of the above constructs +to prevent the following text from being indented as a new paragraph. + + You can use the `@cartouche' command within one of the above +constructs to highlight the example or quotation by drawing a box with +rounded corners around it. (The `@cartouche' command affects only the +printed manual; it has no effect in the Info file; see *Note Drawing +Cartouches Around Examples: cartouche.) + + +File: texinfo.info, Node: quotation, Next: example, Prev: Block Enclosing Commands, Up: Quotations and Examples + +`@quotation' +============ + + The text of a quotation is processed normally except that: + + * the margins are closer to the center of the page, so the whole of + the quotation is indented; + + * the first lines of paragraphs are indented no more than other + lines; + + * in the printed output, interparagraph spacing is reduced. + + This is an example of text written between an `@quotation' command + and an `@end quotation' command. An `@quotation' command is most + often used to indicate text that is excerpted from another (real + or hypothetical) printed work. + + Write an `@quotation' command as text on a line by itself. This line +will disappear from the output. Mark the end of the quotation with a +line beginning with and containing only `@end quotation'. The `@end +quotation' line will likewise disappear from the output. Thus, the +following, + + @quotation + This is + a foo. + @end quotation + +produces + + This is a foo. + + +File: texinfo.info, Node: example, Next: noindent, Prev: quotation, Up: Quotations and Examples + +`@example' +========== + + The `@example' command is used to indicate an example that is not +part of the running text, such as computer input or output. + + This is an example of text written between an + `@example' command + and an `@end example' command. + The text is indented but not filled. + + In the printed manual, the text is typeset in a + fixed-width font, and extra spaces and blank lines are + significant. In the Info file, an analogous result is + obtained by indenting each line with five spaces. + + Write an `@example' command at the beginning of a line by itself. +This line will disappear from the output. Mark the end of the example +with an `@end example' command, also written at the beginning of a line +by itself. The `@end example' will disappear from the output. + + For example, + + @example + mv foo bar + @end example + +produces + + mv foo bar + + Since the lines containing `@example' and `@end example' will +disappear, you should put a blank line before the `@example' and +another blank line after the `@end example'. (Remember that blank +lines between the beginning `@example' and the ending `@end example' +will appear in the output.) + + *Caution:* Do not use tabs in the lines of an example (or anywhere + else in Texinfo, for that matter)! TeX treats tabs as single + spaces, and that is not what they look like. This is a problem + with TeX. (If necessary, in Emacs, you can use `M-x untabify' to + convert tabs in a region to multiple spaces.) + + Examples are often, logically speaking, "in the middle" of a +paragraph, and the text continues after an example should not be +indented. The `@noindent' command prevents a piece of text from being +indented as if it were a new paragraph. (*Note noindent::.) + + (The `@code' command is used for examples of code that are embedded +within sentences, not set off from preceding and following text. *Note +`@code': code.) + + +File: texinfo.info, Node: noindent, Next: Lisp Example, Prev: example, Up: Quotations and Examples + +`@noindent' +=========== + + An example or other inclusion can break a paragraph into segments. +Ordinarily, the formatters indent text that follows an example as a new +paragraph. However, you can prevent this by writing `@noindent' at the +beginning of a line by itself preceding the continuation text. + + For example: + + @example + This is an example + @end example + + @noindent + This line is not indented. As you can see, the + beginning of the line is fully flush left with the line + that follows after it. (This whole example is between + @code{@@display} and @code{@@end display}.) + +produces + + This is an example + + + This line is not indented. As you can see, the + beginning of the line is fully flush left with the line + that follows after it. (This whole example is between + `@display' and `@end display'.) + + To adjust the number of blank lines properly in the Info file output, +remember that the line containing `@noindent' does not generate a blank +line, and neither does the `@end example' line. + + In the Texinfo source file for this manual, each line that says +`produces' is preceded by a line containing `@noindent'. + + Do not put braces after an `@noindent' command; they are not +necessary, since `@noindent' is a command used outside of paragraphs +(*note Command Syntax::.). + + +File: texinfo.info, Node: Lisp Example, Next: smallexample & smalllisp, Prev: noindent, Up: Quotations and Examples + +`@lisp' +======= + + The `@lisp' command is used for Lisp code. It is synonymous with the +`@example' command. + + This is an example of text written between an + `@lisp' command and an `@end lisp' command. + + Use `@lisp' instead of `@example' to preserve information regarding +the nature of the example. This is useful, for example, if you write a +function that evaluates only and all the Lisp code in a Texinfo file. +Then you can use the Texinfo file as a Lisp library.(1) (*note Lisp +Example-Footnotes::) + + Mark the end of `@lisp' with `@end lisp' on a line by itself. + + +File: texinfo.info, Node: Lisp Example-Footnotes, Up: Lisp Example + + (1) It would be straightforward to extend Texinfo to work in a +similar fashion for C, Fortran, or other languages. + + +File: texinfo.info, Node: smallexample & smalllisp, Next: display, Prev: Lisp Example, Up: Quotations and Examples + +`@smallexample' and `@smalllisp' +================================ + + In addition to the regular `@example' and `@lisp' commands, Texinfo +has two other "example-style" commands. These are the `@smallexample' +and `@smalllisp' commands. Both these commands are designed for use +with the `@smallbook' command that causes TeX to produce a printed +manual in a 7 by 9.25 inch format rather than the regular 8.5 by 11 +inch format. + + In TeX, the `@smallexample' and `@smalllisp' commands typeset text in +a smaller font for the smaller `@smallbook' format than for the 8.5 by +11 inch format. Consequently, many examples containing long lines fit +in a narrower, `@smallbook' page without needing to be shortened. Both +commands typeset in the normal font size when you format for the 8.5 by +11 inch size; indeed, in this situation, the `@smallexample' and +`@smalllisp' commands are defined to be the `@example' and `@lisp' +commands. + + In Info, the `@smallexample' and `@smalllisp' commands are equivalent +to the `@example' and `@lisp' commands, and work exactly the same. + + Mark the end of `@smallexample' or `@smalllisp' with `@end +smallexample' or `@end smalllisp', respectively. + + This is an example of text written between `@smallexample' and + `@end smallexample'. In Info and in an 8.5 by 11 inch manual, + this text appears in its normal size; but in a 7 by 9.25 inch manual, + this text appears in a smaller font. + + The `@smallexample' and `@smalllisp' commands make it easier to +prepare smaller format manuals without forcing you to edit examples by +hand to fit them onto narrower pages. + + As a general rule, a printed document looks better if you write all +the examples in a chapter consistently in `@example' or in +`@smallexample'. Only occasionally should you mix the two formats. + + *Note Printing "Small" Books: smallbook, for more information about +the `@smallbook' command. + + +File: texinfo.info, Node: display, Next: format, Prev: smallexample & smalllisp, Up: Quotations and Examples + +`@display' +========== + + The `@display' command begins a kind of example. It is like the +`@example' command except that, in a printed manual, `@display' does +not select the fixed-width font. In fact, it does not specify the font +at all, so that the text appears in the same font it would have +appeared in without the `@display' command. + + This is an example of text written between an `@display' command + and an `@end display' command. The `@display' command + indents the text, but does not fill it. + + +File: texinfo.info, Node: format, Next: exdent, Prev: display, Up: Quotations and Examples + +`@format' +========= + + The `@format' command is similar to `@example' except that, in the +printed manual, `@format' does not select the fixed-width font and does +not narrow the margins. + +This is an example of text written between an `@format' command +and an `@end format' command. As you can see +from this example, +the `@format' command does not fill the text. + + +File: texinfo.info, Node: exdent, Next: flushleft & flushright, Prev: format, Up: Quotations and Examples + +`@exdent': Undoing a Line's Indentation +======================================= + + The `@exdent' command removes any indentation a line might have. The +command is written at the beginning of a line and applies only to the +text that follows the command that is on the same line. Do not use +braces around the text. In a printed manual, the text on an `@exdent' +line is printed in the roman font. + + `@exdent' is usually used within examples. Thus, + + @example + This line follows an @@example command. + @exdent This line is exdented. + This line follows the exdented line. + The @@end example comes on the next line. + @end group + +produces + + This line follows an @example command. +This line is exdented. + This line follows the exdented line. + The @end example comes on the next line. + + In practice, the `@exdent' command is rarely used. Usually, you +un-indent text by ending the example and returning the page to its +normal width. + + +File: texinfo.info, Node: flushleft & flushright, Next: cartouche, Prev: exdent, Up: Quotations and Examples + +`@flushleft' and `@flushright' +============================== + + The `@flushleft' and `@flushright' commands line up the ends of lines +on the left and right margins of a page, but do not fill the text. The +commands are written on lines of their own, without braces. The +`@flushleft' and `@flushright' commands are ended by `@end flushleft' +and `@end flushright' commands on lines of their own. + + For example, + + @flushleft + This text is + written flushleft. + @end flushleft + +produces + + This text is + written flushleft. + + `@flushright' produces the type of indentation often used in the +return address of letters. For example, + + @flushright + Here is an example of text written + flushright. The @code{@flushright} command + right justifies every line but leaves the + left end ragged. + @end flushright + +produces + + Here is an example of text written + flushright. The `@flushright' command + right justifies every line but leaves the + left end ragged. + + +File: texinfo.info, Node: cartouche, Prev: flushleft & flushright, Up: Quotations and Examples + +Drawing Cartouches Around Examples +================================== + + In a printed manual, the `@cartouche' command draws a box with +rounded corners around its contents. You can use this command to +further highlight an example or quotation. For instance, you could +write a manual in which one type of example is surrounded by a cartouche +for emphasis. + + The `@cartouche' command affects only the printed manual; it has no +effect in the Info file. + + For example, + + @example + @cartouche + % pwd + /usr/local/share/emacs + @end cartouche + @end example + +surrounds the two-line example with a box with rounded corners, in the +printed manual. + + +File: texinfo.info, Node: Lists and Tables, Next: Indices, Prev: Quotations and Examples, Up: Top + +Lists and Tables +**************** + + Texinfo has several ways of making lists and tables. Lists can be +bulleted or numbered; two-column tables can highlight the items in the +first column; multi-column tables are also supported. + +* Menu: + +* Introducing Lists:: Texinfo formats lists for you. +* itemize:: How to construct a simple list. +* enumerate:: How to construct a numbered list. +* Two-column Tables:: How to construct a two-column table. +* Multi-column Tables:: How to construct generalized tables. + + +File: texinfo.info, Node: Introducing Lists, Next: itemize, Prev: Lists and Tables, Up: Lists and Tables + +Introducing Lists +================= + + Texinfo automatically indents the text in lists or tables, and numbers +an enumerated list. This last feature is useful if you modify the +list, since you do not need to renumber it yourself. + + Numbered lists and tables begin with the appropriate @-command at the +beginning of a line, and end with the corresponding `@end' command on a +line by itself. The table and itemized-list commands also require that +you write formatting information on the same line as the beginning +@-command. + + Begin an enumerated list, for example, with an `@enumerate' command +and end the list with an `@end enumerate' command. Begin an itemized +list with an `@itemize' command, followed on the same line by a +formatting command such as `@bullet', and end the list with an `@end +itemize' command. + + Precede each element of a list with an `@item' or `@itemx' command. + +Here is an itemized list of the different kinds of table and lists: + + * Itemized lists with and without bullets. + + * Enumerated lists, using numbers or letters. + + * Two-column tables with highlighting. + +Here is an enumerated list with the same items: + + 1. Itemized lists with and without bullets. + + 2. Enumerated lists, using numbers or letters. + + 3. Two-column tables with highlighting. + +And here is a two-column table with the same items and their @-commands: + +`@itemize' + Itemized lists with and without bullets. + +`@enumerate' + Enumerated lists, using numbers or letters. + +`@table' +`@ftable' +`@vtable' + Two-column tables with indexing. + + +File: texinfo.info, Node: itemize, Next: enumerate, Prev: Introducing Lists, Up: Lists and Tables + +Making an Itemized List +======================= + + The `@itemize' command produces sequences of indented paragraphs, +with a bullet or other mark inside the left margin at the beginning of +each paragraph for which such a mark is desired. + + Begin an itemized list by writing `@itemize' at the beginning of a +line. Follow the command, on the same line, with a character or a +Texinfo command that generates a mark. Usually, you will write +`@bullet' after `@itemize', but you can use `@minus', or any character +or any special symbol that results in a single character in the Info +file. (When you write `@bullet' or `@minus' after an `@itemize' +command, you may omit the `{}'.) + + Write the text of the indented paragraphs themselves after the +`@itemize', up to another line that says `@end itemize'. + + Before each paragraph for which a mark in the margin is desired, write +a line that says just `@item'. Do not write any other text on this +line. + + Usually, you should put a blank line before an `@item'. This puts a +blank line in the Info file. (TeX inserts the proper interline +whitespace in either case.) Except when the entries are very brief, +these blank lines make the list look better. + + Here is an example of the use of `@itemize', followed by the output +it produces. Note that `@bullet' produces an `*' in Info and a round +dot in TeX. + + @itemize @bullet + @item + Some text for foo. + + @item + Some text + for bar. + @end itemize + +This produces: + + * Some text for foo. + + * Some text for bar. + + Itemized lists may be embedded within other itemized lists. Here is a +list marked with dashes embedded in a list marked with bullets: + + @itemize @bullet + @item + First item. + + @itemize @minus + @item + Inner item. + + @item + Second inner item. + @end itemize + + @item + Second outer item. + @end itemize + +This produces: + + * First item. + + - Inner item. + + - Second inner item. + + * Second outer item. + + +File: texinfo.info, Node: enumerate, Next: Two-column Tables, Prev: itemize, Up: Lists and Tables + +Making a Numbered or Lettered List +================================== + + `@enumerate' is like `@itemize' (*note `@itemize': itemize.), except +that the labels on the items are successive integers or letters instead +of bullets. + + Write the `@enumerate' command at the beginning of a line. The +command does not require an argument, but accepts either a number or a +letter as an option. Without an argument, `@enumerate' starts the list +with the number `1'. With a numeric argument, such as `3', the command +starts the list with that number. With an upper or lower case letter, +such as `a' or `A', the command starts the list with that letter. + + Write the text of the enumerated list in the same way you write an +itemized list: put `@item' on a line of its own before the start of +each paragraph that you want enumerated. Do not write any other text +on the line beginning with `@item'. + + You should put a blank line between entries in the list. This +generally makes it easier to read the Info file. + + Here is an example of `@enumerate' without an argument: + + @enumerate + @item + Underlying causes. + + @item + Proximate causes. + @end enumerate + +This produces: + + 1. Underlying causes. + + 2. Proximate causes. + + Here is an example with an argument of `3': + + @enumerate 3 + @item + Predisposing causes. + + @item + Precipitating causes. + + @item + Perpetuating causes. + @end enumerate + +This produces: + + 3. Predisposing causes. + + 4. Precipitating causes. + + 5. Perpetuating causes. + + Here is a brief summary of the alternatives. The summary is +constructed using `@enumerate' with an argument of `a'. + + a. `@enumerate' + + Without an argument, produce a numbered list, starting with the + number 1. + + b. `@enumerate POSITIVE-INTEGER' + + With a (positive) numeric argument, start a numbered list with that + number. You can use this to continue a list that you interrupted + with other text. + + c. `@enumerate UPPER-CASE-LETTER' + + With an upper case letter as argument, start a list in which each + item is marked by a letter, beginning with that upper case letter. + + d. `@enumerate LOWER-CASE-LETTER' + + With a lower case letter as argument, start a list in which each + item is marked by a letter, beginning with that lower case letter. + + You can also nest enumerated lists, as in an outline. + + +File: texinfo.info, Node: Two-column Tables, Next: Multi-column Tables, Prev: enumerate, Up: Lists and Tables + +Making a Two-column Table +========================= + + `@table' is similar to `@itemize' (*note `@itemize': itemize.), but +allows you to specify a name or heading line for each item. The +`@table' command is used to produce two-column tables, and is +especially useful for glossaries, explanatory exhibits, and +command-line option summaries. + +* Menu: + +* table:: How to construct a two-column table. +* ftable vtable:: Automatic indexing for two-column tables. +* itemx:: How to put more entries in the first column. + + +File: texinfo.info, Node: table, Next: ftable vtable, Prev: Two-column Tables, Up: Two-column Tables + +Using the `@table' Command +-------------------------- + + Use the `@table' command to produce two-column tables. + + Write the `@table' command at the beginning of a line and follow it +on the same line with an argument that is a Texinfo "indicating" +command such as `@code', `@samp', `@var', or `@kbd' (*note +Indicating::.). Although these commands are usually followed by +arguments in braces, in this case you use the command name without an +argument because `@item' will supply the argument. This command will +be applied to the text that goes into the first column of each item and +determines how it will be highlighted. For example, `@code' will cause +the text in the first column to be highlighted with an `@code' command. +(We recommend `@code' for `@table''s of command-line options.) + + You may also choose to use the `@asis' command as an argument to +`@table'. `@asis' is a command that does nothing; if you use this +command after `@table', TeX and the Info formatting commands output the +first column entries without added highlighting ("as is"). + + (The `@table' command may work with other commands besides those +listed here. However, you can only use commands that normally take +arguments in braces.) + + Begin each table entry with an `@item' command at the beginning of a +line. Write the first column text on the same line as the `@item' +command. Write the second column text on the line following the +`@item' line and on subsequent lines. (You do not need to type +anything for an empty second column entry.) You may write as many +lines of supporting text as you wish, even several paragraphs. But +only text on the same line as the `@item' will be placed in the first +column. + + Normally, you should put a blank line before an `@item' line. This +puts a blank like in the Info file. Except when the entries are very +brief, a blank line looks better. + + The following table, for example, highlights the text in the first +column with an `@samp' command: + + @table @samp + @item foo + This is the text for + @samp{foo}. + + @item bar + Text for @samp{bar}. + @end table + +This produces: + +`foo' + This is the text for `foo'. + +`bar' + Text for `bar'. + + If you want to list two or more named items with a single block of +text, use the `@itemx' command. (*Note `@itemx': itemx.) + diff --git a/info/texinfo.info-6 b/info/texinfo.info-6 new file mode 100644 index 0000000..5b8991a --- /dev/null +++ b/info/texinfo.info-6 @@ -0,0 +1,1423 @@ +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98 Free Software +Foundation, Inc. + + This edition is for Texinfo version 3.12. + + 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 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. + + +File: texinfo.info, Node: ftable vtable, Next: itemx, Prev: table, Up: Two-column Tables + +`@ftable' and `@vtable' +----------------------- + + The `@ftable' and `@vtable' commands are the same as the `@table' +command except that `@ftable' automatically enters each of the items in +the first column of the table into the index of functions and `@vtable' +automatically enters each of the items in the first column of the table +into the index of variables. This simplifies the task of creating +indices. Only the items on the same line as the `@item' commands are +indexed, and they are indexed in exactly the form that they appear on +that line. *Note Creating Indices: Indices, for more information about +indices. + + Begin a two-column table using `@ftable' or `@vtable' by writing the +@-command at the beginning of a line, followed on the same line by an +argument that is a Texinfo command such as `@code', exactly as you +would for an `@table' command; and end the table with an `@end ftable' +or `@end vtable' command on a line by itself. + + See the example for `@table' in the previous section. + + +File: texinfo.info, Node: itemx, Prev: ftable vtable, Up: Two-column Tables + +`@itemx' +-------- + + Use the `@itemx' command inside a table when you have two or more +first column entries for the same item, each of which should appear on a +line of its own. Use `@itemx' for all but the first entry; `@itemx' +should always follow an `@item' command. The `@itemx' command works +exactly like `@item' except that it does not generate extra vertical +space above the first column text. + + For example, + + @table @code + @item upcase + @itemx downcase + These two functions accept a character or a string as + argument, and return the corresponding upper case (lower + case) character or string. + @end table + +This produces: + +`upcase' +`downcase' + These two functions accept a character or a string as argument, + and return the corresponding upper case (lower case) character or + string. + +(Note also that this example illustrates multi-line supporting text in +a two-column table.) + + +File: texinfo.info, Node: Multi-column Tables, Prev: Two-column Tables, Up: Lists and Tables + +Multi-column Tables +=================== + + `@multitable' allows you to construct tables with any number of +columns, with each column having any width you like. + + You define the column widths on the `@multitable' line itself, and +write each row of the actual table following an `@item' command, with +columns separated by an `@tab' command. Finally, `@end multitable' +completes the table. Details in the sections below. + +* Menu: + +* Multitable Column Widths:: Defining multitable column widths. +* Multitable Rows:: Defining multitable rows, with examples. + + +File: texinfo.info, Node: Multitable Column Widths, Next: Multitable Rows, Prev: Multi-column Tables, Up: Multi-column Tables + +Multitable Column Widths +------------------------ + + You can define the column widths for a multitable in two ways: as +fractions of the line length; or with a prototype row. Mixing the two +methods is not supported. In either case, the widths are defined +entirely on the same line as the `@multitable' command. + + 1. To specify column widths as fractions of the line length, write + `@columnfractions' and the decimal numbers (presumably less than + 1) after the `@multitable' command, as in: + + @multitable @columnfractions .33 .33 .33 + + The fractions need not add up exactly to 1.0, as these do not. + This allows you to produce tables that do not need the full line + length. + + 2. To specify a prototype row, write the longest entry for each column + enclosed in braces after the `@multitable' command. For example: + + @multitable {some text for column one} {for column two} + + The first column will then have the width of the typeset `some + text for column one', and the second column the width of `for + column two'. + + The prototype entries need not appear in the table itself. + + Although we used simple text in this example, the prototype + entries can contain Texinfo commands; markup commands such as + `@code' are particularly likely to be useful. + + + +File: texinfo.info, Node: Multitable Rows, Prev: Multitable Column Widths, Up: Multi-column Tables + +Multitable Rows +--------------- + + After the `@multitable' command defining the column widths (see the +previous section), you begin each row in the body of a multitable with +`@item', and separate the column entries with `@tab'. Line breaks are +not special within the table body, and you may break input lines in +your source file as necessary. + + Here is a complete example of a multi-column table (the text is from +`The GNU Emacs Manual', *note Splitting Windows: (xemacs)Split Window.): + + @multitable @columnfractions .15 .45 .4 + @item Key @tab Command @tab Description + @item C-x 2 + @tab @code{split-window-vertically} + @tab Split the selected window into two windows, + with one above the other. + @item C-x 3 + @tab @code{split-window-horizontally} + @tab Split the selected window into two windows + positioned side by side. + @item C-Mouse-2 + @tab + @tab In the mode line or scroll bar of a window, + split that window. + @end multitable + +produces: + +Key Command Description +C-x 2 `split-window-vertically' Split the selected window + into two windows, with one + above the other. +C-x 3 `split-window-horizontally' Split the selected window + into two windows positioned + side by side. +C-Mouse-2 In the mode line or scroll + bar of a window, split that + window. + + +File: texinfo.info, Node: Indices, Next: Insertions, Prev: Lists and Tables, Up: Top + +Creating Indices +**************** + + Using Texinfo, you can generate indices without having to sort and +collate entries manually. In an index, the entries are listed in +alphabetical order, together with information on how to find the +discussion of each entry. In a printed manual, this information +consists of page numbers. In an Info file, this information is a menu +entry leading to the first node referenced. + + Texinfo provides several predefined kinds of index: an index for +functions, an index for variables, an index for concepts, and so on. +You can combine indices or use them for other than their canonical +purpose. If you wish, you can define your own indices. + +* Menu: + +* Index Entries:: Choose different words for index entries. +* Predefined Indices:: Use different indices for different kinds + of entry. +* Indexing Commands:: How to make an index entry. +* Combining Indices:: How to combine indices. +* New Indices:: How to define your own indices. + + +File: texinfo.info, Node: Index Entries, Next: Predefined Indices, Prev: Indices, Up: Indices + +Making Index Entries +==================== + + When you are making index entries, it is good practice to think of the +different ways people may look for something. Different people *do +not* think of the same words when they look something up. A helpful +index will have items indexed under all the different words that people +may use. For example, one reader may think it obvious that the +two-letter names for indices should be listed under "Indices, +two-letter names", since the word "Index" is the general concept. But +another reader may remember the specific concept of two-letter names +and search for the entry listed as "Two letter names for indices". A +good index will have both entries and will help both readers. + + Like typesetting, the construction of an index is a highly skilled, +professional art, the subtleties of which are not appreciated until you +need to do it yourself. + + *Note Printing Indices & Menus::, for information about printing an +index at the end of a book or creating an index menu in an Info file. + + +File: texinfo.info, Node: Predefined Indices, Next: Indexing Commands, Prev: Index Entries, Up: Indices + +Predefined Indices +================== + + Texinfo provides six predefined indices: + + * A "concept index" listing concepts that are discussed. + + * A "function index" listing functions (such as entry points of + libraries). + + * A "variables index" listing variables (such as global variables of + libraries). + + * A "keystroke index" listing keyboard commands. + + * A "program index" listing names of programs. + + * A "data type index" listing data types (such as structures defined + in header files). + +Not every manual needs all of these, and most manuals use two or three +of them. This manual has two indices: a concept index and an @-command +index (that is actually the function index but is called a command +index in the chapter heading). Two or more indices can be combined +into one using the `@synindex' or `@syncodeindex' commands. *Note +Combining Indices::. + + +File: texinfo.info, Node: Indexing Commands, Next: Combining Indices, Prev: Predefined Indices, Up: Indices + +Defining the Entries of an Index +================================ + + The data to make an index come from many individual indexing commands +scattered throughout the Texinfo source file. Each command says to add +one entry to a particular index; after formatting, the index will give +the current page number or node name as the reference. + + An index entry consists of an indexing command at the beginning of a +line followed, on the rest of the line, by the entry. + + For example, this section begins with the following five entries for +the concept index: + + @cindex Defining indexing entries + @cindex Index entries + @cindex Entries for an index + @cindex Specifying index entries + @cindex Creating index entries + + Each predefined index has its own indexing command--`@cindex' for the +concept index, `@findex' for the function index, and so on. + + Concept index entries consist of text. The best way to write an index +is to choose entries that are terse yet clear. If you can do this, the +index often looks better if the entries are not capitalized, but +written just as they would appear in the middle of a sentence. +(Capitalize proper names and acronyms that always call for upper case +letters.) This is the case convention we use in most GNU manuals' +indices. + + If you don't see how to make an entry terse yet clear, make it longer +and clear--not terse and confusing. If many of the entries are several +words long, the index may look better if you use a different convention: +to capitalize the first word of each entry. But do not capitalize a +case-sensitive name such as a C or Lisp function name or a shell +command; that would be a spelling error. + + Whichever case convention you use, please use it consistently! + + Entries in indices other than the concept index are symbol names in +programming languages, or program names; these names are usually +case-sensitive, so use upper and lower case as required for them. + + By default, entries for a concept index are printed in a small roman +font and entries for the other indices are printed in a small `@code' +font. You may change the way part of an entry is printed with the +usual Texinfo commands, such as `@file' for file names and `@emph' for +emphasis (*note Marking Text::.). + + The six indexing commands for predefined indices are: + +`@cindex CONCEPT' + Make an entry in the concept index for CONCEPT. + +`@findex FUNCTION' + Make an entry in the function index for FUNCTION. + +`@vindex VARIABLE' + Make an entry in the variable index for VARIABLE. + +`@kindex KEYSTROKE' + Make an entry in the key index for KEYSTROKE. + +`@pindex PROGRAM' + Make an entry in the program index for PROGRAM. + +`@tindex DATA TYPE' + Make an entry in the data type index for DATA TYPE. + + *Caution:* Do not use a colon in an index entry. In Info, a colon + separates the menu entry name from the node name. An extra colon + confuses Info. *Note The Parts of a Menu: Menu Parts, for more + information about the structure of a menu entry. + + If you write several identical index entries in different places in a +Texinfo file, the index in the printed manual will list all the pages to +which those entries refer. However, the index in the Info file will +list *only* the node that references the *first* of those index +entries. Therefore, it is best to write indices in which each entry +refers to only one place in the Texinfo file. Fortunately, this +constraint is a feature rather than a loss since it means that the index +will be easy to use. Otherwise, you could create an index that lists +several pages for one entry and your reader would not know to which page +to turn. If you have two identical entries for one topic, change the +topics slightly, or qualify them to indicate the difference. + + You are not actually required to use the predefined indices for their +canonical purposes. For example, suppose you wish to index some C +preprocessor macros. You could put them in the function index along +with actual functions, just by writing `@findex' commands for them; +then, when you print the "Function Index" as an unnumbered chapter, you +could give it the title `Function and Macro Index' and all will be +consistent for the reader. Or you could put the macros in with the +data types by writing `@tindex' commands for them, and give that index +a suitable title so the reader will understand. (*Note Printing +Indices & Menus::.) + + +File: texinfo.info, Node: Combining Indices, Next: New Indices, Prev: Indexing Commands, Up: Indices + +Combining Indices +================= + + Sometimes you will want to combine two disparate indices such as +functions and concepts, perhaps because you have few enough of one of +them that a separate index for them would look silly. + + You could put functions into the concept index by writing `@cindex' +commands for them instead of `@findex' commands, and produce a +consistent manual by printing the concept index with the title +`Function and Concept Index' and not printing the `Function Index' at +all; but this is not a robust procedure. It works only if your +document is never included as part of another document that is designed +to have a separate function index; if your document were to be included +with such a document, the functions from your document and those from +the other would not end up together. Also, to make your function names +appear in the right font in the concept index, you would need to +enclose every one of them between the braces of `@code'. + +* Menu: + +* syncodeindex:: How to merge two indices, using `@code' + font for the merged-from index. +* synindex:: How to merge two indices, using the + default font of the merged-to index. + + +File: texinfo.info, Node: syncodeindex, Next: synindex, Prev: Combining Indices, Up: Combining Indices + +`@syncodeindex' +--------------- + + When you want to combine functions and concepts into one index, you +should index the functions with `@findex' and index the concepts with +`@cindex', and use the `@syncodeindex' command to redirect the function +index entries into the concept index. + + The `@syncodeindex' command takes two arguments; they are the name of +the index to redirect, and the name of the index to redirect it to. +The template looks like this: + + @syncodeindex FROM TO + + For this purpose, the indices are given two-letter names: + +`cp' + concept index + +`fn' + function index + +`vr' + variable index + +`ky' + key index + +`pg' + program index + +`tp' + data type index + + Write an `@syncodeindex' command before or shortly after the +end-of-header line at the beginning of a Texinfo file. For example, to +merge a function index with a concept index, write the following: + + @syncodeindex fn cp + +This will cause all entries designated for the function index to merge +in with the concept index instead. + + To merge both a variables index and a function index into a concept +index, write the following: + + @syncodeindex vr cp + @syncodeindex fn cp + + The `@syncodeindex' command puts all the entries from the `from' +index (the redirected index) into the `@code' font, overriding whatever +default font is used by the index to which the entries are now +directed. This way, if you direct function names from a function index +into a concept index, all the function names are printed in the `@code' +font as you would expect. + + +File: texinfo.info, Node: synindex, Prev: syncodeindex, Up: Combining Indices + +`@synindex' +----------- + + The `@synindex' command is nearly the same as the `@syncodeindex' +command, except that it does not put the `from' index entries into the +`@code' font; rather it puts them in the roman font. Thus, you use +`@synindex' when you merge a concept index into a function index. + + *Note Printing Indices & Menus::, for information about printing an +index at the end of a book or creating an index menu in an Info file. + + +File: texinfo.info, Node: New Indices, Prev: Combining Indices, Up: Indices + +Defining New Indices +==================== + + In addition to the predefined indices, you may use the `@defindex' +and `@defcodeindex' commands to define new indices. These commands +create new indexing @-commands with which you mark index entries. The +`@defindex 'command is used like this: + + @defindex NAME + + The name of an index should be a two letter word, such as `au'. For +example: + + @defindex au + + This defines a new index, called the `au' index. At the same time, +it creates a new indexing command, `@auindex', that you can use to make +index entries. Use the new indexing command just as you would use a +predefined indexing command. + + For example, here is a section heading followed by a concept index +entry and two `au' index entries. + + @section Cognitive Semantics + @cindex kinesthetic image schemas + @auindex Johnson, Mark + @auindex Lakoff, George + +(Evidently, `au' serves here as an abbreviation for "author".) Texinfo +constructs the new indexing command by concatenating the name of the +index with `index'; thus, defining an `au' index leads to the automatic +creation of an `@auindex' command. + + Use the `@printindex' command to print the index, as you do with the +predefined indices. For example: + + @node Author Index, Subject Index, , Top + @unnumbered Author Index + + @printindex au + + The `@defcodeindex' is like the `@defindex' command, except that, in +the printed output, it prints entries in an `@code' font instead of a +roman font. Thus, it parallels the `@findex' command rather than the +`@cindex' command. + + You should define new indices within or right after the end-of-header +line of a Texinfo file, before any `@synindex' or `@syncodeindex' +commands (*note Header::.). + + +File: texinfo.info, Node: Insertions, Next: Breaks, Prev: Indices, Up: Top + +Special Insertions +****************** + + Texinfo provides several commands for inserting characters that have +special meaning in Texinfo, such as braces, and for other graphic +elements that do not correspond to simple characters you can type. + +* Menu: + +* Braces Atsigns:: How to insert braces, `@'. +* Inserting Space:: How to insert the right amount of space + within a sentence. +* Inserting Accents:: How to insert accents and special characters. +* Dots Bullets:: How to insert dots and bullets. +* TeX and copyright:: How to insert the TeX logo + and the copyright symbol. +* pounds:: How to insert the pounds currency symbol. +* minus:: How to insert a minus sign. +* math:: How to format a mathematical expression. +* Glyphs:: How to indicate results of evaluation, + expansion of macros, errors, etc. +* Images:: How to include graphics. + + +File: texinfo.info, Node: Braces Atsigns, Next: Inserting Space, Prev: Insertions, Up: Insertions + +Inserting @ and Braces +====================== + + `@' and curly braces are special characters in Texinfo. To insert +these characters so they appear in text, you must put an `@' in front +of these characters to prevent Texinfo from misinterpreting them. + + Do not put braces after any of these commands; they are not necessary. + +* Menu: + +* Inserting An Atsign:: How to insert `@'. +* Inserting Braces:: How to insert `{' and `}'. + + +File: texinfo.info, Node: Inserting An Atsign, Next: Inserting Braces, Prev: Braces Atsigns, Up: Braces Atsigns + +Inserting `@' with @@ +--------------------- + + `@@' stands for a single `@' in either printed or Info output. + + Do not put braces after an `@@' command. + + +File: texinfo.info, Node: Inserting Braces, Prev: Inserting An Atsign, Up: Braces Atsigns + +Inserting `{' and `}'with @{ and @} +----------------------------------- + + `@{' stands for a single `{' in either printed or Info output. + + `@}' stands for a single `}' in either printed or Info output. + + Do not put braces after either an `@{' or an `@}' command. + + +File: texinfo.info, Node: Inserting Space, Next: Inserting Accents, Prev: Braces Atsigns, Up: Insertions + +Inserting Space +=============== + + The following sections describe commands that control spacing of +various kinds within and after sentences. + +* Menu: + +* Not Ending a Sentence:: Sometimes a . doesn't end a sentence. +* Ending a Sentence:: Sometimes it does. +* Multiple Spaces:: Inserting multiple spaces. +* dmn:: How to format a dimension. + + +File: texinfo.info, Node: Not Ending a Sentence, Next: Ending a Sentence, Prev: Inserting Space, Up: Inserting Space + +Not Ending a Sentence +--------------------- + + Depending on whether a period or exclamation point or question mark is +inside or at the end of a sentence, less or more space is inserted after +a period in a typeset manual. Since it is not always possible for +Texinfo to determine when a period ends a sentence and when it is used +in an abbreviation, special commands are needed in some circumstances. +(Usually, Texinfo can guess how to handle periods, so you do not need to +use the special commands; you just enter a period as you would if you +were using a typewriter, which means you put two spaces after the +period, question mark, or exclamation mark that ends a sentence.) + + Use the `@:' command after a period, question mark, exclamation mark, +or colon that should not be followed by extra space. For example, use +`@:' after periods that end abbreviations which are not at the ends of +sentences. + + For example, + + The s.o.p.@: has three parts ... + The s.o.p. has three parts ... + +produces + + The s.o.p. has three parts ... + The s.o.p. has three parts ... + +(Incidentally, `s.o.p.' is an abbreviation for "Standard Operating +Procedure".) + + `@:' has no effect on the Info output. Do not put braces after `@:'. + + +File: texinfo.info, Node: Ending a Sentence, Next: Multiple Spaces, Prev: Not Ending a Sentence, Up: Inserting Space + +Ending a Sentence +----------------- + + Use `@.' instead of a period, `@!' instead of an exclamation point, +and `@?' instead of a question mark at the end of a sentence that ends +with a single capital letter. Otherwise, TeX will think the letter is +an abbreviation and will not insert the correct end-of-sentence +spacing. Here is an example: + + Give it to M.I.B. and to M.E.W@. Also, give it to R.J.C@. + Give it to M.I.B. and to M.E.W. Also, give it to R.J.C. + +produces + + Give it to M.I.B. and to M.E.W. Also, give it to R.J.C. + Give it to M.I.B. and to M.E.W. Also, give it to R.J.C. + + In the Info file output, `@.' is equivalent to a simple `.'; likewise +for `@!' and `@?'. + + The meanings of `@:' and `@.' in Texinfo are designed to work well +with the Emacs sentence motion commands (*note Sentences: +(xemacs)Sentences.). This made it necessary for them to be +incompatible with some other formatting systems that use @-commands. + + Do not put braces after any of these commands. + + +File: texinfo.info, Node: Multiple Spaces, Next: dmn, Prev: Ending a Sentence, Up: Inserting Space + +Multiple Spaces +--------------- + + Ordinarily, TeX collapses multiple whitespace characters (space, tab, +and newline) into a single space. Info output, on the other hand, +preserves whitespace as you type it, except for changing a newline into +a space; this is why it is important to put two spaces at the end of +sentences in Texinfo documents. + + Occasionally, you may want to actually insert several consecutive +spaces, either for purposes of example (what your program does with +multiple spaces as input), or merely for purposes of appearance in +headings or lists. Texinfo supports three commands: `@SPACE', `@TAB', +and `@NL', all of which insert a single space into the output. (Here, +`@SPACE' represents an `@' character followed by a space, i.e., `@ ', +and `TAB' and `NL' represent the tab character and end-of-line, i.e., +when `@' is the last character on a line.) + + For example, + Spacey@ @ @ @ + example. + +produces + + Spacey example. + + Other possible uses of `@SPACE' have been subsumed by `@multitable' +(*note Multi-column Tables::.). + + Do not follow any of these commands with braces. + + +File: texinfo.info, Node: dmn, Prev: Multiple Spaces, Up: Inserting Space + +`@dmn'{DIMENSION}: Format a Dimension +------------------------------------- + + At times, you may want to write `12pt' or `8.5in' with little or no +space between the number and the abbreviation for the dimension. You +can use the `@dmn' command to do this. On seeing the command, TeX +inserts just enough space for proper typesetting; the Info formatting +commands insert no space at all, since the Info file does not require +it. + + To use the `@dmn' command, write the number and then follow it +immediately, with no intervening space, by `@dmn', and then by the +dimension within braces. For example, + + A4 paper is 8.27@dmn{in} wide. + +produces + + A4 paper is 8.27in wide. + + Not everyone uses this style. Some people prefer `8.27 in.@:' or +`8.27 inches' to `8.27@dmn{in}' in the Texinfo file. In these cases, +however, the formatters may insert a line break between the number and +the dimension, so use `@w' (*note w::.). Also, if you write a period +after an abbreviation within a sentence, you should write `@:' after +the period to prevent TeX from inserting extra whitespace, as shown +here. *Note Inserting Space::. + + +File: texinfo.info, Node: Inserting Accents, Next: Dots Bullets, Prev: Inserting Space, Up: Insertions + +Inserting Accents +================= + + Here is a table with the commands Texinfo provides for inserting +floating accents. The commands with non-alphabetic names do not take +braces around their argument (which is taken to be the next character). +(Exception: `@,' *does* take braces around its argument.) This is so +as to make the source as convenient to type and read as possible, since +accented characters are very common in some languages. + +Command Output What +@"o "o umlaut accent +@'o 'o acute accent +@,{c} c, cedilla accent +@=o =o macron/overbar accent +@^o ^o circumflex accent +@`o `o grave accent +@~o ~o tilde accent +@dotaccent{o} .o overdot accent +@H{o} ''o long Hungarian umlaut +@ringaccent{o} *o ring accent +@tieaccent{oo} [oo tie-after accent +@u{o} (o breve accent +@ubaraccent{o} o_ underbar accent +@udotaccent{o} o-. underdot accent +@v{o} ' or `==>'. Likewise, there are commands to insert +glyphs to indicate printed output, error messages, equivalence of +expressions, and the location of point. + + The glyph-insertion commands do not need to be used within an +example, but most often they are. Every glyph-insertion command is +followed by a pair of left- and right-hand braces. + +* Menu: + +* Glyphs Summary:: +* result:: How to show the result of expression. +* expansion:: How to indicate an expansion. +* Print Glyph:: How to indicate printed output. +* Error Glyph:: How to indicate an error message. +* Equivalence:: How to indicate equivalence. +* Point Glyph:: How to indicate the location of point. + + +File: texinfo.info, Node: Glyphs Summary, Next: result, Prev: Glyphs, Up: Glyphs + +Glyphs Summary +-------------- + + Here are the different glyph commands: + +=> + `@result{}' points to the result of an expression. + +==> + `@expansion{}' shows the results of a macro expansion. + +-| + `@print{}' indicates printed output. + +error--> + `@error{}' indicates that the following text is an error message. + +== + `@equiv{}' indicates the exact equivalence of two forms. + +-!- + `@point{}' shows the location of point. + +* Menu: + +* result:: +* expansion:: +* Print Glyph:: +* Error Glyph:: +* Equivalence:: +* Point Glyph:: + + +File: texinfo.info, Node: result, Next: expansion, Prev: Glyphs Summary, Up: Glyphs + +`@result{}' (=>): Indicating Evaluation +--------------------------------------- + + Use the `@result{}' command to indicate the result of evaluating an +expression. + + The `@result{}' command is displayed as `=>' in Info and as a double +stemmed arrow in the printed output. + + Thus, the following, + + (cdr '(1 2 3)) + => (2 3) + +may be read as "`(cdr '(1 2 3))' evaluates to `(2 3)'". + + +File: texinfo.info, Node: expansion, Next: Print Glyph, Prev: result, Up: Glyphs + +`@expansion{}' (==>): Indicating an Expansion +--------------------------------------------- + + When an expression is a macro call, it expands into a new expression. +You can indicate the result of the expansion with the `@expansion{}' +command. + + The `@expansion{}' command is displayed as `==>' in Info and as a +long arrow with a flat base in the printed output. + + For example, the following + + @lisp + (third '(a b c)) + @expansion{} (car (cdr (cdr '(a b c)))) + @result{} c + @end lisp + +produces + + (third '(a b c)) + ==> (car (cdr (cdr '(a b c)))) + => c + +which may be read as: + + `(third '(a b c))' expands to `(car (cdr (cdr '(a b c))))'; the + result of evaluating the expression is `c'. + +Often, as in this case, an example looks better if the `@expansion{}' +and `@result{}' commands are indented five spaces. + + +File: texinfo.info, Node: Print Glyph, Next: Error Glyph, Prev: expansion, Up: Glyphs + +`@print{}' (-|): Indicating Printed Output +------------------------------------------ + + Sometimes an expression will print output during its execution. You +can indicate the printed output with the `@print{}' command. + + The `@print{}' command is displayed as `-|' in Info and similarly, as +a horizontal dash butting against a vertical bar, in the printed output. + + In the following example, the printed text is indicated with `-|', +and the value of the expression follows on the last line. + + (progn (print 'foo) (print 'bar)) + -| foo + -| bar + => bar + +In a Texinfo source file, this example is written as follows: + + @lisp + (progn (print 'foo) (print 'bar)) + @print{} foo + @print{} bar + @result{} bar + @end lisp + + +File: texinfo.info, Node: Error Glyph, Next: Equivalence, Prev: Print Glyph, Up: Glyphs + +`@error{}' (error-->): Indicating an Error Message +-------------------------------------------------- + + A piece of code may cause an error when you evaluate it. You can +designate the error message with the `@error{}' command. + + The `@error{}' command is displayed as `error-->' in Info and as the +word `error' in a box in the printed output. + + Thus, + + @lisp + (+ 23 'x) + @error{} Wrong type argument: integer-or-marker-p, x + @end lisp + +produces + + (+ 23 'x) + error--> Wrong type argument: integer-or-marker-p, x + +This indicates that the following error message is printed when you +evaluate the expression: + + Wrong type argument: integer-or-marker-p, x + + `error-->' itself is not part of the error message. + + +File: texinfo.info, Node: Equivalence, Next: Point Glyph, Prev: Error Glyph, Up: Glyphs + +`@equiv{}' (==): Indicating Equivalence +--------------------------------------- + + Sometimes two expressions produce identical results. You can +indicate the exact equivalence of two forms with the `@equiv{}' command. + + The `@equiv{}' command is displayed as `==' in Info and as a three +parallel horizontal lines in the printed output. + + Thus, + + @lisp + (make-sparse-keymap) @equiv{} (list 'keymap) + @end lisp + +produces + + (make-sparse-keymap) == (list 'keymap) + +This indicates that evaluating `(make-sparse-keymap)' produces +identical results to evaluating `(list 'keymap)'. + + +File: texinfo.info, Node: Point Glyph, Prev: Equivalence, Up: Glyphs + +`@point{}' (-!-): Indicating Point in a Buffer +---------------------------------------------- + + Sometimes you need to show an example of text in an Emacs buffer. In +such examples, the convention is to include the entire contents of the +buffer in question between two lines of dashes containing the buffer +name. + + You can use the `@point{}' command to show the location of point in +the text in the buffer. (The symbol for point, of course, is not part +of the text in the buffer; it indicates the place *between* two +characters where point is located.) + + The `@point{}' command is displayed as `-!-' in Info and as a small +five pointed star in the printed output. + + The following example shows the contents of buffer `foo' before and +after evaluating a Lisp command to insert the word `changed'. + + ---------- Buffer: foo ---------- + This is the -!-contents of foo. + ---------- Buffer: foo ---------- + + (insert "changed ") + => nil + ---------- Buffer: foo ---------- + This is the changed -!-contents of foo. + ---------- Buffer: foo ---------- + + In a Texinfo source file, the example is written like this: + + @example + ---------- Buffer: foo ---------- + This is the @point{}contents of foo. + ---------- Buffer: foo ---------- + + (insert "changed ") + @result{} nil + ---------- Buffer: foo ---------- + This is the changed @point{}contents of foo. + ---------- Buffer: foo ---------- + @end example + + +File: texinfo.info, Node: Images, Prev: Glyphs, Up: Insertions + +Inserting Images +================ + + You can insert an image in an external file with the `@image' command: + + @image{FILENAME, [WIDTH], [HEIGHT]} + + The FILENAME argument is mandatory, and must not have an extension, +because the different processors support different formats: TeX reads +the file `FILENAME.eps' (Encapsulated PostScript format); `makeinfo' +uses `FILENAME.txt' verbatim for Info output (more or less as if it was +an `@example'). HTML output requires `FILENAME.jpg'. + + The optional WIDTH and HEIGHT arguments specify the size to scale the +image to (they are ignored for Info output). If they are both +specified, the image is presented in its natural size (given in the +file); if only one is specified, the other is scaled proportionately; +and if both are specified, both are respected, thus possibly distorting +the original image by changing its aspect ratio. + + The WIDTH and HEIGHT may be specified using any valid TeX dimension, +namely: + +pt + point (72.27pt = 1in) + +pc + pica (1pc = 12pt) + +bp + big point (72bp = 1in) + +in + inch + +cm + centimeter (2.54cm = 1in) + +mm + millimeter (10mm = 1cm) + +dd + did^ot point (1157dd = 1238pt) + +cc + cicero (1cc = 12dd) + +sp + scaled point (65536sp = 1pt) + + For example, the following will scale a file `ridt.eps' to one inch +vertically, with the width scaled proportionately: + + @image{ridt,,1in} + + For `@image' to work with TeX, the file `epsf.tex' must be installed +somewhere that TeX can find it. This file is included in the Texinfo +distribution and is available from `ftp://ftp.tug.org/tex/epsf.tex'. + + +File: texinfo.info, Node: Breaks, Next: Definition Commands, Prev: Insertions, Up: Top + +Making and Preventing Breaks +**************************** + + Usually, a Texinfo file is processed both by TeX and by one of the +Info formatting commands. Line, paragraph, or page breaks sometimes +occur in the `wrong' place in one or other form of output. You must +ensure that text looks right both in the printed manual and in the Info +file. + + For example, in a printed manual, page breaks may occur awkwardly in +the middle of an example; to prevent this, you can hold text together +using a grouping command that keeps the text from being split across +two pages. Conversely, you may want to force a page break where none +would occur normally. Fortunately, problems like these do not often +arise. When they do, use the break, break prevention, or pagination +commands. + +* Menu: + +* Break Commands:: Cause and prevent splits. +* Line Breaks:: How to force a single line to use two lines. +* - and hyphenation:: How to tell TeX about hyphenation points. +* w:: How to prevent unwanted line breaks. +* sp:: How to insert blank lines. +* page:: How to force the start of a new page. +* group:: How to prevent unwanted page breaks. +* need:: Another way to prevent unwanted page breaks. + + +File: texinfo.info, Node: Break Commands, Next: Line Breaks, Prev: Breaks, Up: Breaks + +The Break Commands +================== + + The break commands create or allow line and paragraph breaks: + +`@*' + Force a line break. + +`@sp N' + Skip N blank lines. + +`@-' + Insert a discretionary hyphen. + +`@hyphenation{HY-PHEN-A-TED WORDS}' + Define hyphen points in HY-PHEN-A-TED WORDS. + + The line-break-prevention command holds text together all on one line: + +`@w{TEXT}' + Prevent TEXT from being split and hyphenated across two lines. + + The pagination commands apply only to printed output, since Info +files do not have pages. + +`@page' + Start a new page in the printed manual. + +`@group' + Hold text together that must appear on one printed page. + +`@need MILS' + Start a new printed page if not enough space on this one. + + +File: texinfo.info, Node: Line Breaks, Next: - and hyphenation, Prev: Break Commands, Up: Breaks + +`@*': Generate Line Breaks +========================== + + The `@*' command forces a line break in both the printed manual and +in Info. + + For example, + + This line @* is broken @*in two places. + +produces + + This line + is broken + in two places. + +(Note that the space after the first `@*' command is faithfully carried +down to the next line.) + + The `@*' command is often used in a file's copyright page: + + This is edition 2.0 of the Texinfo documentation,@* + and is for ... + +In this case, the `@*' command keeps TeX from stretching the line +across the whole page in an ugly manner. + + *Please note:* Do not write braces after an `@*' command; they are + not needed. + + Do not write an `@refill' command at the end of a paragraph + containing an `@*' command; it will cause the paragraph to be + refilled after the line break occurs, negating the effect of the + line break. + + +File: texinfo.info, Node: - and hyphenation, Next: w, Prev: Line Breaks, Up: Breaks + +`@-' and `@hyphenation': Helping TeX hyphenate +============================================== + + Although TeX's hyphenation algorithm is generally pretty good, it +does miss useful hyphenation points from time to time. (Or, far more +rarely, insert an incorrect hyphenation.) So, for documents with an +unusual vocabulary or when fine-tuning for a printed edition, you may +wish to help TeX out. Texinfo supports two commands for this: + +`@-' + Insert a discretionary hyphen, i.e., a place where TeX can (but + does not have to) hyphenate. This is especially useful when you + notice an overfull hbox is due to TeX missing a hyphenation (*note + Overfull hboxes::.). TeX will not insert any hyphenation points + in a word containing `@-'. + +`@hyphenation{HY-PHEN-A-TED WORDS}' + Tell TeX how to hyphenate HY-PHEN-A-TED WORDS. As shown, you put + a `-' at each hyphenation point. For example: + @hyphenation{man-u-script man-u-scripts} + + TeX only uses the specified hyphenation points when the words + match exactly, so give all necessary variants. + + Info output is not hyphenated, so these commands have no effect there. + + +File: texinfo.info, Node: w, Next: sp, Prev: - and hyphenation, Up: Breaks + +`@w'{TEXT}: Prevent Line Breaks +=============================== + + `@w{TEXT}' outputs TEXT and prohibits line breaks within TEXT. + + You can use the `@w' command to prevent TeX from automatically +hyphenating a long name or phrase that happens to fall near the end of a +line. + + You can copy GNU software from @w{@samp{ftp.gnu.ai.mit.edu}}. + +produces + + You can copy GNU software from `ftp.gnu.ai.mit.edu'. + + *Caution:* Do not write an `@refill' command at the end of a + paragraph containing an `@w' command; it will cause the paragraph + to be refilled and may thereby negate the effect of the `@w' + command. + + +File: texinfo.info, Node: sp, Next: page, Prev: w, Up: Breaks + +`@sp' N: Insert Blank Lines +=========================== + + A line beginning with and containing only `@sp N' generates N blank +lines of space in both the printed manual and the Info file. `@sp' +also forces a paragraph break. For example, + + @sp 2 + +generates two blank lines. + + The `@sp' command is most often used in the title page. + + +File: texinfo.info, Node: page, Next: group, Prev: sp, Up: Breaks + +`@page': Start a New Page +========================= + + A line containing only `@page' starts a new page in a printed manual. +The command has no effect on Info files since they are not paginated. +An `@page' command is often used in the `@titlepage' section of a +Texinfo file to start the copyright page. + diff --git a/info/texinfo.info-7 b/info/texinfo.info-7 new file mode 100644 index 0000000..4ae5118 --- /dev/null +++ b/info/texinfo.info-7 @@ -0,0 +1,1400 @@ +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98 Free Software +Foundation, Inc. + + This edition is for Texinfo version 3.12. + + 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 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. + + +File: texinfo.info, Node: group, Next: need, Prev: page, Up: Breaks + +`@group': Prevent Page Breaks +============================= + + The `@group' command (on a line by itself) is used inside an +`@example' or similar construct to begin an unsplittable vertical +group, which will appear entirely on one page in the printed output. +The group is terminated by a line containing only `@end group'. These +two lines produce no output of their own, and in the Info file output +they have no effect at all. + + Although `@group' would make sense conceptually in a wide variety of +contexts, its current implementation works reliably only within +`@example' and variants, and within `@display', `@format', `@flushleft' +and `@flushright'. *Note Quotations and Examples::. (What all these +commands have in common is that each line of input produces a line of +output.) In other contexts, `@group' can cause anomalous vertical +spacing. + + This formatting requirement means that you should write: + + @example + @group + ... + @end group + @end example + +with the `@group' and `@end group' commands inside the `@example' and +`@end example' commands. + + The `@group' command is most often used to hold an example together +on one page. In this Texinfo manual, more than 100 examples contain +text that is enclosed between `@group' and `@end group'. + + If you forget to end a group, you may get strange and unfathomable +error messages when you run TeX. This is because TeX keeps trying to +put the rest of the Texinfo file onto the one page and does not start +to generate error messages until it has processed considerable text. +It is a good rule of thumb to look for a missing `@end group' if you +get incomprehensible error messages in TeX. + + +File: texinfo.info, Node: need, Prev: group, Up: Breaks + +`@need MILS': Prevent Page Breaks +================================= + + A line containing only `@need N' starts a new page in a printed +manual if fewer than N mils (thousandths of an inch) remain on the +current page. Do not use braces around the argument N. The `@need' +command has no effect on Info files since they are not paginated. + + This paragraph is preceded by an `@need' command that tells TeX to +start a new page if fewer than 800 mils (eight-tenths inch) remain on +the page. It looks like this: + + @need 800 + This paragraph is preceded by ... + + The `@need' command is useful for preventing orphans (single lines at +the bottoms of printed pages). + + +File: texinfo.info, Node: Definition Commands, Next: Footnotes, Prev: Breaks, Up: Top + +Definition Commands +******************* + + The `@deffn' command and the other "definition commands" enable you +to describe functions, variables, macros, commands, user options, +special forms and other such artifacts in a uniform format. + + In the Info file, a definition causes the entity +category--`Function', `Variable', or whatever--to appear at the +beginning of the first line of the definition, followed by the entity's +name and arguments. In the printed manual, the command causes TeX to +print the entity's name and its arguments on the left margin and print +the category next to the right margin. In both output formats, the +body of the definition is indented. Also, the name of the entity is +entered into the appropriate index: `@deffn' enters the name into the +index of functions, `@defvr' enters it into the index of variables, and +so on. + + A manual need not and should not contain more than one definition for +a given name. An appendix containing a summary should use `@table' +rather than the definition commands. + +* Menu: + +* Def Cmd Template:: How to structure a description using a + definition command. +* Optional Arguments:: How to handle optional and repeated arguments. +* deffnx:: How to group two or more `first' lines. +* Def Cmds in Detail:: All the definition commands. +* Def Cmd Conventions:: Conventions for writing definitions. +* Sample Function Definition:: + + +File: texinfo.info, Node: Def Cmd Template, Next: Optional Arguments, Prev: Definition Commands, Up: Definition Commands + +The Template for a Definition +============================= + + The `@deffn' command is used for definitions of entities that +resemble functions. To write a definition using the `@deffn' command, +write the `@deffn' command at the beginning of a line and follow it on +the same line by the category of the entity, the name of the entity +itself, and its arguments (if any). Then write the body of the +definition on succeeding lines. (You may embed examples in the body.) +Finally, end the definition with an `@end deffn' command written on a +line of its own. (The other definition commands follow the same +format.) + + The template for a definition looks like this: + + @deffn CATEGORY NAME ARGUMENTS... + BODY-OF-DEFINITION + @end deffn + +For example, + + @deffn Command forward-word count + This command moves point forward @var{count} words + (or backward if @var{count} is negative). ... + @end deffn + +produces + + - Command: forward-word COUNT + This function moves point forward COUNT words (or backward if + COUNT is negative). ... + + Capitalize the category name like a title. If the name of the +category contains spaces, as in the phrase `Interactive Command', write +braces around it. For example: + + @deffn {Interactive Command} isearch-forward + ... + @end deffn + +Otherwise, the second word will be mistaken for the name of the entity. + + Some of the definition commands are more general than others. The +`@deffn' command, for example, is the general definition command for +functions and the like--for entities that may take arguments. When you +use this command, you specify the category to which the entity belongs. +The `@deffn' command possesses three predefined, specialized +variations, `@defun', `@defmac', and `@defspec', that specify the +category for you: "Function", "Macro", and "Special Form" respectively. +(In Lisp, a special form is an entity much like a function.) The +`@defvr' command also is accompanied by several predefined, specialized +variations for describing particular kinds of variables. + + The template for a specialized definition, such as `@defun', is +similar to the template for a generalized definition, except that you +do not need to specify the category: + + @defun NAME ARGUMENTS... + BODY-OF-DEFINITION + @end defun + +Thus, + + @defun buffer-end flag + This function returns @code{(point-min)} if @var{flag} + is less than 1, @code{(point-max)} otherwise. + ... + @end defun + +produces + + - Function: buffer-end FLAG + This function returns `(point-min)' if FLAG is less than 1, + `(point-max)' otherwise. ... + +*Note Sample Function Definition: Sample Function Definition, for a +more detailed example of a function definition, including the use of +`@example' inside the definition. + + The other specialized commands work like `@defun'. + + +File: texinfo.info, Node: Optional Arguments, Next: deffnx, Prev: Def Cmd Template, Up: Definition Commands + +Optional and Repeated Arguments +=============================== + + Some entities take optional or repeated arguments, which may be +specified by a distinctive glyph that uses square brackets and +ellipses. For example, a special form often breaks its argument list +into separate arguments in more complicated ways than a straightforward +function. + + An argument enclosed within square brackets is optional. Thus, +[OPTIONAL-ARG] means that OPTIONAL-ARG is optional. An argument +followed by an ellipsis is optional and may be repeated more than once. +Thus, REPEATED-ARGS... stands for zero or more arguments. Parentheses +are used when several arguments are grouped into additional levels of +list structure in Lisp. + + Here is the `@defspec' line of an example of an imaginary special +form: + + - Special Form: foobar (VAR [FROM TO [INC]]) BODY... + +In this example, the arguments FROM and TO are optional, but must both +be present or both absent. If they are present, INC may optionally be +specified as well. These arguments are grouped with the argument VAR +into a list, to distinguish them from BODY, which includes all +remaining elements of the form. + + In a Texinfo source file, this `@defspec' line is written like this +(except it would not be split over two lines, as it is in this example). + + @defspec foobar (@var{var} [@var{from} @var{to} + [@var{inc}]]) @var{body}@dots{} + +The function is listed in the Command and Variable Index under `foobar'. + + +File: texinfo.info, Node: deffnx, Next: Def Cmds in Detail, Prev: Optional Arguments, Up: Definition Commands + +Two or More `First' Lines +========================= + + To create two or more `first' or header lines for a definition, follow +the first `@deffn' line by a line beginning with `@deffnx'. The +`@deffnx' command works exactly like `@deffn' except that it does not +generate extra vertical white space between it and the preceding line. + + For example, + + @deffn {Interactive Command} isearch-forward + @deffnx {Interactive Command} isearch-backward + These two search commands are similar except ... + @end deffn + +produces + + - Interactive Command: isearch-forward + - Interactive Command: isearch-backward + These two search commands are similar except ... + + Each of the other definition commands has an `x' form: `@defunx', +`@defvrx', `@deftypefunx', etc. + + The `x' forms work just like `@itemx'; see *Note `@itemx': itemx. + + +File: texinfo.info, Node: Def Cmds in Detail, Next: Def Cmd Conventions, Prev: deffnx, Up: Definition Commands + +The Definition Commands +======================= + + Texinfo provides more than a dozen definition commands, all of which +are described in this section. + + The definition commands automatically enter the name of the entity in +the appropriate index: for example, `@deffn', `@defun', and `@defmac' +enter function names in the index of functions; `@defvr' and `@defvar' +enter variable names in the index of variables. + + Although the examples that follow mostly illustrate Lisp, the commands +can be used for other programming languages. + +* Menu: + +* Functions Commands:: Commands for functions and similar entities. +* Variables Commands:: Commands for variables and similar entities. +* Typed Functions:: Commands for functions in typed languages. +* Typed Variables:: Commands for variables in typed languages. +* Abstract Objects:: Commands for object-oriented programming. +* Data Types:: The definition command for data types. + + +File: texinfo.info, Node: Functions Commands, Next: Variables Commands, Prev: Def Cmds in Detail, Up: Def Cmds in Detail + +Functions and Similar Entities +------------------------------ + + This section describes the commands for describing functions and +similar entities: + +`@deffn CATEGORY NAME ARGUMENTS...' + The `@deffn' command is the general definition command for + functions, interactive commands, and similar entities that may take + arguments. You must choose a term to describe the category of + entity being defined; for example, "Function" could be used if the + entity is a function. The `@deffn' command is written at the + beginning of a line and is followed on the same line by the + category of entity being described, the name of this particular + entity, and its arguments, if any. Terminate the definition with + `@end deffn' on a line of its own. + + For example, here is a definition: + + @deffn Command forward-char nchars + Move point forward @var{nchars} characters. + @end deffn + + This shows a rather terse definition for a "command" named + `forward-char' with one argument, NCHARS. + + `@deffn' prints argument names such as NCHARS in italics or upper + case, as if `@var' had been used, because we think of these names + as metasyntactic variables--they stand for the actual argument + values. Within the text of the description, write an argument name + explicitly with `@var' to refer to the value of the argument. In + the example above, we used `@var{nchars}' in this way. + + The template for `@deffn' is: + + @deffn CATEGORY NAME ARGUMENTS... + BODY-OF-DEFINITION + @end deffn + +`@defun NAME ARGUMENTS...' + The `@defun' command is the definition command for functions. + `@defun' is equivalent to `@deffn Function ...'. + + For example, + + @defun set symbol new-value + Change the value of the symbol @var{symbol} + to @var{new-value}. + @end defun + + shows a rather terse definition for a function `set' whose + arguments are SYMBOL and NEW-VALUE. The argument names on the + `@defun' line automatically appear in italics or upper case as if + they were enclosed in `@var'. Terminate the definition with `@end + defun' on a line of its own. + + The template is: + + @defun FUNCTION-NAME ARGUMENTS... + BODY-OF-DEFINITION + @end defun + + `@defun' creates an entry in the index of functions. + +`@defmac NAME ARGUMENTS...' + The `@defmac' command is the definition command for macros. + `@defmac' is equivalent to `@deffn Macro ...' and works like + `@defun'. + +`@defspec NAME ARGUMENTS...' + The `@defspec' command is the definition command for special + forms. (In Lisp, a special form is an entity much like a function, + *note Special Forms: (lispref)Special Forms..) `@defspec' is + equivalent to `@deffn {Special Form} ...' and works like `@defun'. + + +File: texinfo.info, Node: Variables Commands, Next: Typed Functions, Prev: Functions Commands, Up: Def Cmds in Detail + +Variables and Similar Entities +------------------------------ + + Here are the commands for defining variables and similar entities: + +`@defvr CATEGORY NAME' + The `@defvr' command is a general definition command for something + like a variable--an entity that records a value. You must choose + a term to describe the category of entity being defined; for + example, "Variable" could be used if the entity is a variable. + Write the `@defvr' command at the beginning of a line and followed + it on the same line by the category of the entity and the name of + the entity. + + Capitalize the category name like a title. If the name of the + category contains spaces, as in the name "User Option", enclose it + in braces. Otherwise, the second word will be mistaken for the + name of the entity. For example, + + @defvr {User Option} fill-column + This buffer-local variable specifies + the maximum width of filled lines. + ... + @end defvr + + Terminate the definition with `@end defvr' on a line of its own. + + The template is: + + @defvr CATEGORY NAME + BODY-OF-DEFINITION + @end defvr + + `@defvr' creates an entry in the index of variables for NAME. + +`@defvar NAME' + The `@defvar' command is the definition command for variables. + `@defvar' is equivalent to `@defvr Variable ...'. + + For example: + + @defvar kill-ring + ... + @end defvar + + The template is: + + @defvar NAME + BODY-OF-DEFINITION + @end defvar + + `@defvar' creates an entry in the index of variables for NAME. + +`@defopt NAME' + The `@defopt' command is the definition command for "user + options", i.e., variables intended for users to change according to + taste; Emacs has many such (*note Variables: (xemacs)Variables.). + `@defopt' is equivalent to `@defvr {User Option} ...' and works + like `@defvar'. + + +File: texinfo.info, Node: Typed Functions, Next: Typed Variables, Prev: Variables Commands, Up: Def Cmds in Detail + +Functions in Typed Languages +---------------------------- + + The `@deftypefn' command and its variations are for describing +functions in languages in which you must declare types of variables and +functions, such as C and C++. + +`@deftypefn CATEGORY DATA-TYPE NAME ARGUMENTS...' + The `@deftypefn' command is the general definition command for + functions and similar entities that may take arguments and that are + typed. The `@deftypefn' command is written at the beginning of a + line and is followed on the same line by the category of entity + being described, the type of the returned value, the name of this + particular entity, and its arguments, if any. + + For example, + + @deftypefn {Library Function} int foobar + (int @var{foo}, float @var{bar}) + ... + @end deftypefn + + (where the text before the "...", shown above as two lines, would + actually be a single line in a real Texinfo file) produces the + following in Info: + + -- Library Function: int foobar (int FOO, float BAR) + ... + + This means that `foobar' is a "library function" that returns an + `int', and its arguments are FOO (an `int') and BAR (a `float'). + + The argument names that you write in `@deftypefn' are not subject + to an implicit `@var'--since the actual names of the arguments in + `@deftypefn' are typically scattered among data type names and + keywords, Texinfo cannot find them without help. Instead, you + must write `@var' explicitly around the argument names. In the + example above, the argument names are `foo' and `bar'. + + The template for `@deftypefn' is: + + @deftypefn CATEGORY DATA-TYPE NAME ARGUMENTS ... + BODY-OF-DESCRIPTION + @end deftypefn + + Note that if the CATEGORY or DATA TYPE is more than one word then + it must be enclosed in braces to make it a single argument. + + If you are describing a procedure in a language that has packages, + such as Ada, you might consider using `@deftypefn' in a manner + somewhat contrary to the convention described in the preceding + paragraphs. + + For example: + + @deftypefn stacks private push + (@var{s}:in out stack; + @var{n}:in integer) + ... + @end deftypefn + + (The `@deftypefn' arguments are shown split into three lines, but + would be a single line in a real Texinfo file.) + + In this instance, the procedure is classified as belonging to the + package `stacks' rather than classified as a `procedure' and its + data type is described as `private'. (The name of the procedure + is `push', and its arguments are S and N.) + + `@deftypefn' creates an entry in the index of functions for NAME. + +`@deftypefun DATA-TYPE NAME ARGUMENTS...' + The `@deftypefun' command is the specialized definition command + for functions in typed languages. The command is equivalent to + `@deftypefn Function ...'. + + Thus, + + @deftypefun int foobar (int @var{foo}, float @var{bar}) + ... + @end deftypefun + + produces the following in Info: + + -- Function: int foobar (int FOO, float BAR) + ... + + The template is: + + @deftypefun TYPE NAME ARGUMENTS... + BODY-OF-DESCRIPTION + @end deftypefun + + `@deftypefun' creates an entry in the index of functions for NAME. + + +File: texinfo.info, Node: Typed Variables, Next: Abstract Objects, Prev: Typed Functions, Up: Def Cmds in Detail + +Variables in Typed Languages +---------------------------- + + Variables in typed languages are handled in a manner similar to +functions in typed languages. *Note Typed Functions::. The general +definition command `@deftypevr' corresponds to `@deftypefn' and the +specialized definition command `@deftypevar' corresponds to +`@deftypefun'. + +`@deftypevr CATEGORY DATA-TYPE NAME' + The `@deftypevr' command is the general definition command for + something like a variable in a typed language--an entity that + records a value. You must choose a term to describe the category + of the entity being defined; for example, "Variable" could be used + if the entity is a variable. + + The `@deftypevr' command is written at the beginning of a line and + is followed on the same line by the category of the entity being + described, the data type, and the name of this particular entity. + + For example: + + @deftypevr {Global Flag} int enable + ... + @end deftypevr + + produces the following in Info: + + -- Global Flag: int enable + ... + + The template is: + + @deftypevr CATEGORY DATA-TYPE NAME + BODY-OF-DESCRIPTION + @end deftypevr + + `@deftypevr' creates an entry in the index of variables for NAME. + +`@deftypevar DATA-TYPE NAME' + The `@deftypevar' command is the specialized definition command + for variables in typed languages. `@deftypevar' is equivalent to + `@deftypevr Variable ...'. + + For example: + + @deftypevar int fubar + ... + @end deftypevar + + produces the following in Info: + + -- Variable: int fubar + ... + + The template is: + + @deftypevar DATA-TYPE NAME + BODY-OF-DESCRIPTION + @end deftypevar + + `@deftypevar' creates an entry in the index of variables for NAME. + + +File: texinfo.info, Node: Abstract Objects, Next: Data Types, Prev: Typed Variables, Up: Def Cmds in Detail + +Object-Oriented Programming +--------------------------- + + Here are the commands for formatting descriptions about abstract +objects, such as are used in object-oriented programming. A class is a +defined type of abstract object. An instance of a class is a +particular object that has the type of the class. An instance variable +is a variable that belongs to the class but for which each instance has +its own value. + + In a definition, if the name of a class is truly a name defined in the +programming system for a class, then you should write an `@code' around +it. Otherwise, it is printed in the usual text font. + +`@defcv CATEGORY CLASS NAME' + The `@defcv' command is the general definition command for + variables associated with classes in object-oriented programming. + The `@defcv' command is followed by three arguments: the category + of thing being defined, the class to which it belongs, and its + name. Thus, + + @defcv {Class Option} Window border-pattern + ... + @end defcv + + illustrates how you would write the first line of a definition of + the `border-pattern' class option of the class `Window'. + + The template is + + @defcv CATEGORY CLASS NAME + ... + @end defcv + + `@defcv' creates an entry in the index of variables. + +`@defivar CLASS NAME' + The `@defivar' command is the definition command for instance + variables in object-oriented programming. `@defivar' is + equivalent to `@defcv {Instance Variable} ...' + + The template is: + + @defivar CLASS INSTANCE-VARIABLE-NAME + BODY-OF-DEFINITION + @end defivar + + `@defivar' creates an entry in the index of variables. + +`@defop CATEGORY CLASS NAME ARGUMENTS...' + The `@defop' command is the general definition command for + entities that may resemble methods in object-oriented programming. + These entities take arguments, as functions do, but are associated + with particular classes of objects. + + For example, some systems have constructs called "wrappers" that + are associated with classes as methods are, but that act more like + macros than like functions. You could use `@defop Wrapper' to + describe one of these. + + Sometimes it is useful to distinguish methods and "operations". + You can think of an operation as the specification for a method. + Thus, a window system might specify that all window classes have a + method named `expose'; we would say that this window system + defines an `expose' operation on windows in general. Typically, + the operation has a name and also specifies the pattern of + arguments; all methods that implement the operation must accept + the same arguments, since applications that use the operation do + so without knowing which method will implement it. + + Often it makes more sense to document operations than methods. For + example, window application developers need to know about the + `expose' operation, but need not be concerned with whether a given + class of windows has its own method to implement this operation. + To describe this operation, you would write: + + @defop Operation windows expose + + The `@defop' command is written at the beginning of a line and is + followed on the same line by the overall name of the category of + operation, the name of the class of the operation, the name of the + operation, and its arguments, if any. + + The template is: + + @defop CATEGORY CLASS NAME ARGUMENTS... + BODY-OF-DEFINITION + @end defop + + `@defop' creates an entry, such as ``expose' on `windows'', in the + index of functions. + +`@defmethod CLASS NAME ARGUMENTS...' + The `@defmethod' command is the definition command for methods in + object-oriented programming. A method is a kind of function that + implements an operation for a particular class of objects and its + subclasses. In the Lisp Machine, methods actually were functions, + but they were usually defined with `defmethod'. + + `@defmethod' is equivalent to `@defop Method ...'. The command is + written at the beginning of a line and is followed by the name of + the class of the method, the name of the method, and its + arguments, if any. + + For example, + + @defmethod `bar-class' bar-method argument + ... + @end defmethod + + illustrates the definition for a method called `bar-method' of the + class `bar-class'. The method takes an argument. + + The template is: + + @defmethod CLASS METHOD-NAME ARGUMENTS... + BODY-OF-DEFINITION + @end defmethod + + `@defmethod' creates an entry, such as ``bar-method' on + `bar-class'', in the index of functions. + +`@deftypemethod CLASS DATA-TYPE NAME ARGUMENTS...' + The `@deftypemethod' command is the definition command for methods + in object-oriented typed languages, such as C++ and Java. It is + similar to the `@defmethod' command with the addition of the + DATA-TYPE parameter to specify the return type of the method. + + +File: texinfo.info, Node: Data Types, Prev: Abstract Objects, Up: Def Cmds in Detail + +Data Types +---------- + + Here is the command for data types: + +`@deftp CATEGORY NAME ATTRIBUTES...' + The `@deftp' command is the generic definition command for data + types. The command is written at the beginning of a line and is + followed on the same line by the category, by the name of the type + (which is a word like `int' or `float'), and then by names of + attributes of objects of that type. Thus, you could use this + command for describing `int' or `float', in which case you could + use `data type' as the category. (A data type is a category of + certain objects for purposes of deciding which operations can be + performed on them.) + + In Lisp, for example, "pair" names a particular data type, and an + object of that type has two slots called the CAR and the CDR. + Here is how you would write the first line of a definition of + `pair'. + + @deftp {Data type} pair car cdr + ... + @end deftp + + The template is: + + @deftp CATEGORY NAME-OF-TYPE ATTRIBUTES... + BODY-OF-DEFINITION + @end deftp + + `@deftp' creates an entry in the index of data types. + + +File: texinfo.info, Node: Def Cmd Conventions, Next: Sample Function Definition, Prev: Def Cmds in Detail, Up: Definition Commands + +Conventions for Writing Definitions +=================================== + + When you write a definition using `@deffn', `@defun', or one of the +other definition commands, please take care to use arguments that +indicate the meaning, as with the COUNT argument to the `forward-word' +function. Also, if the name of an argument contains the name of a +type, such as INTEGER, take care that the argument actually is of that +type. + + +File: texinfo.info, Node: Sample Function Definition, Prev: Def Cmd Conventions, Up: Definition Commands + +A Sample Function Definition +============================ + + A function definition uses the `@defun' and `@end defun' commands. +The name of the function follows immediately after the `@defun' command +and it is followed, on the same line, by the parameter list. + + Here is a definition from *Note Calling Functions: (lispref)Calling +Functions. + + - Function: apply FUNCTION &rest ARGUMENTS + `apply' calls FUNCTION with ARGUMENTS, just like `funcall' + but with one difference: the last of ARGUMENTS is a list of + arguments to give to FUNCTION, rather than a single argument. + We also say that this list is "appended" to the other + arguments. + + `apply' returns the result of calling FUNCTION. As with + `funcall', FUNCTION must either be a Lisp function or a + primitive function; special forms and macros do not make + sense in `apply'. + + (setq f 'list) + => list + (apply f 'x 'y 'z) + error--> Wrong type argument: listp, z + (apply '+ 1 2 '(3 4)) + => 10 + (apply '+ '(1 2 3 4)) + => 10 + + (apply 'append '((a b c) nil (x y z) nil)) + => (a b c x y z) + + An interesting example of using `apply' is found in the + description of `mapcar'. + + In the Texinfo source file, this example looks like this: + + @defun apply function &rest arguments + + @code{apply} calls @var{function} with + @var{arguments}, just like @code{funcall} but with one + difference: the last of @var{arguments} is a list of + arguments to give to @var{function}, rather than a single + argument. We also say that this list is @dfn{appended} + to the other arguments. + + @code{apply} returns the result of calling + @var{function}. As with @code{funcall}, + @var{function} must either be a Lisp function or a + primitive function; special forms and macros do not make + sense in @code{apply}. + + @example + (setq f 'list) + @result{} list + (apply f 'x 'y 'z) + @error{} Wrong type argument: listp, z + (apply '+ 1 2 '(3 4)) + @result{} 10 + (apply '+ '(1 2 3 4)) + @result{} 10 + + (apply 'append '((a b c) nil (x y z) nil)) + @result{} (a b c x y z) + @end example + + An interesting example of using @code{apply} is found + in the description of @code{mapcar}.@refill + @end defun + +In this manual, this function is listed in the Command and Variable +Index under `apply'. + + Ordinary variables and user options are described using a format like +that for functions except that variables do not take arguments. + + +File: texinfo.info, Node: Footnotes, Next: Conditionals, Prev: Definition Commands, Up: Top + +Footnotes +********* + + A "footnote" is for a reference that documents or elucidates the +primary text.(1) (*note Footnotes-Footnotes::) + +* Menu: + +* Footnote Commands:: How to write a footnote in Texinfo. +* Footnote Styles:: Controlling how footnotes appear in Info. + + +File: texinfo.info, Node: Footnotes-Footnotes, Up: Footnotes + + (1) A footnote should complement or expand upon the primary text, but +a reader should not need to read a footnote to understand the primary +text. For a thorough discussion of footnotes, see `The Chicago Manual +of Style', which is published by the University of Chicago Press. + + +File: texinfo.info, Node: Footnote Commands, Next: Footnote Styles, Prev: Footnotes, Up: Footnotes + +Footnote Commands +================= + + In Texinfo, footnotes are created with the `@footnote' command. This +command is followed immediately by a left brace, then by the text of +the footnote, and then by a terminating right brace. Footnotes may be +of any length (they will be broken across pages if necessary), but are +usually short. The template is: + + ordinary text@footnote{TEXT OF FOOTNOTE} + + As shown here, the `@footnote' command should come right after the +text being footnoted, with no intervening space; otherwise, the +formatters the footnote mark might end up starting up a line. + + For example, this clause is followed by a sample footnote(1) (*note +Footnote Commands-Footnotes::); in the Texinfo source, it looks like +this: + + ...a sample footnote@footnote{Here is the sample + footnote.}; in the Texinfo source... + + *Warning:* Don't use footnotes in the argument of the `@item' command +for a `@table' table. This doesn't work, and because of limitations of +TeX, there is no way to fix it. You must put the footnote into the +body text of the table. + + In a printed manual or book, the reference mark for a footnote is a +small, superscripted number; the text of the footnote appears at the +bottom of the page, below a horizontal line. + + In Info, the reference mark for a footnote is a pair of parentheses +with the footnote number between them, like this: `(1)'. + + +File: texinfo.info, Node: Footnote Commands-Footnotes, Up: Footnote Commands + + (1) Here is the sample footnote. + + +File: texinfo.info, Node: Footnote Styles, Prev: Footnote Commands, Up: Footnotes + +Footnote Styles +=============== + + Info has two footnote styles, which determine where the text of the +footnote is located: + + * In the `End' node style, all the footnotes for a single node are + placed at the end of that node. The footnotes are separated from + the rest of the node by a line of dashes with the word `Footnotes' + within it. Each footnote begins with an `(N)' reference mark. + + Here is an example of a single footnote in the end of node style: + + --------- Footnotes --------- + + (1) Here is a sample footnote. + + * In the `Separate' node style, all the footnotes for a single node + are placed in an automatically constructed node of their own. In + this style, a "footnote reference" follows each `(N)' reference + mark in the body of the node. The footnote reference is actually + a cross reference which you use to reach the footnote node. + + The name of the node containing the footnotes is constructed by + appending `-Footnotes' to the name of the node that contains the + footnotes. (Consequently, the footnotes' node for the `Footnotes' + node is `Footnotes-Footnotes'!) The footnotes' node has an `Up' + node pointer that leads back to its parent node. + + Here is how the first footnote in this manual looks after being + formatted for Info in the separate node style: + + File: texinfo.info Node: Overview-Footnotes, Up: Overview + + (1) Note that the first syllable of "Texinfo" is + pronounced like "speck", not "hex". ... + + A Texinfo file may be formatted into an Info file with either footnote +style. + + Use the `@footnotestyle' command to specify an Info file's footnote +style. Write this command at the beginning of a line followed by an +argument, either `end' for the end node style or `separate' for the +separate node style. + + For example, + + @footnotestyle end + +or + @footnotestyle separate + + Write an `@footnotestyle' command before or shortly after the +end-of-header line at the beginning of a Texinfo file. (If you include +the `@footnotestyle' command between the start-of-header and +end-of-header lines, the region formatting commands will format +footnotes as specified.) + + If you do not specify a footnote style, the formatting commands use +their default style. Currently, `texinfo-format-buffer' and +`texinfo-format-region' use the `separate' style and `makeinfo' uses +the `end' style. + + This chapter contains two footnotes. + + +File: texinfo.info, Node: Conditionals, Next: Macros, Prev: Footnotes, Up: Top + +Conditionally Visible Text +************************** + + Sometimes it is good to use different text for a printed manual and +its corresponding Info file. In this case, you can use the +"conditional commands" to specify which text is for the printed manual +and which is for the Info file. + +* Menu: + +* Conditional Commands:: Specifying text for HTML, Info, or TeX. +* Conditional Not Commands:: Specifying text for not HTML, Info, or TeX. +* Raw Formatter Commands:: Using raw TeX or HTML commands. +* set clear value:: Designating which text to format (for + all output formats); and how to set a + flag to a string that you can insert. + + +File: texinfo.info, Node: Conditional Commands, Next: Conditional Not Commands, Prev: Conditionals, Up: Conditionals + +Conditional Commands +==================== + + `@ifinfo' begins segments of text that should be ignored by TeX when +it typesets the printed manual. The segment of text appears only in +the Info file. The `@ifinfo' command should appear on a line by +itself; end the Info-only text with a line containing `@end ifinfo' by +itself. At the beginning of a Texinfo file, the Info permissions are +contained within a region marked by `@ifinfo' and `@end ifinfo'. (*Note +Info Summary and Permissions::.) + + The `@iftex' and `@end iftex' commands are similar to the `@ifinfo' +and `@end ifinfo' commands, except that they specify text that will +appear in the printed manual but not in the Info file. Likewise for +`@ifhtml' and `@end ifhtml', which specify text to appear only in HTML +output. + + For example, + + @iftex + This text will appear only in the printed manual. + @end iftex + @ifinfo + However, this text will appear only in Info. + @end ifinfo + +The preceding example produces the following line: However, this text +will appear only in Info. + +Note how you only see one of the two lines, depending on whether you +are reading the Info version or the printed version of this manual. + + The `@titlepage' command is a special variant of `@iftex' that is +used for making the title and copyright pages of the printed manual. +(*Note `@titlepage': titlepage.) + + +File: texinfo.info, Node: Conditional Not Commands, Next: Raw Formatter Commands, Prev: Conditional Commands, Up: Conditionals + +Conditional Not Commands +======================== + + You can specify text to be included in any output format *other* than +some given one with the `@ifnot...' commands: + @ifnothtml ... @end ifnothtml + @ifnotinfo ... @end ifnotinfo + @ifnottex ... @end ifnottex + +(The `@ifnot...' command and the `@end' command must actually appear on +lines by themselves.) + + If the output file is not being made for the given format, the region +is included. Otherwise, it is ignored. + + The regions delimited by these commands are ordinary Texinfo source as +with `@iftex', not raw formatter source as with `@tex'. + + +File: texinfo.info, Node: Raw Formatter Commands, Next: set clear value, Prev: Conditional Not Commands, Up: Conditionals + +Raw Formatter Commands +====================== + + Inside a region delineated by `@iftex' and `@end iftex', you can +embed some raw TeX commands. Info will ignore these commands since +they are only in that part of the file which is seen by TeX. You can +write the TeX commands as you would write them in a normal TeX file, +except that you must replace the `\' used by TeX with an `@'. For +example, in the `@titlepage' section of a Texinfo file, you can use the +TeX command `@vskip' to format the copyright page. (The `@titlepage' +command causes Info to ignore the region automatically, as it does with +the `@iftex' command.) + + However, many features of plain TeX will not work, as they are +overridden by Texinfo features. + + You can enter plain TeX completely, and use `\' in the TeX commands, +by delineating a region with the `@tex' and `@end tex' commands. (The +`@tex' command also causes Info to ignore the region, like the `@iftex' +command.) The sole exception is that `@' chracter still introduces a +command, so that `@end tex' can be recognized properly. + + For example, here is a mathematical expression written in plain TeX: + + @tex + $$ \chi^2 = \sum_{i=1}^N + \left (y_i - (a + b x_i) + \over \sigma_i\right)^2 $$ + @end tex + +The output of this example will appear only in a printed manual. If +you are reading this in Info, you will not see the equation that appears +in the printed manual. + + Analogously, you can use `@ifhtml ... @end ifhtml' to delimit a +region to be included in HTML output only, and `@html ... @end ifhtml' +for a region of raw HTML (again, except that `@' is still the escape +character, so the `@end' command can be recognized.) + + +File: texinfo.info, Node: set clear value, Prev: Raw Formatter Commands, Up: Conditionals + +`@set', `@clear', and `@value' +============================== + + You can direct the Texinfo formatting commands to format or ignore +parts of a Texinfo file with the `@set', `@clear', `@ifset', and +`@ifclear' commands. + + In addition, you can use the `@set FLAG' command to set the value of +FLAG to a string of characters; and use `@value{FLAG}' to insert that +string. You can use `@set', for example, to set a date and use +`@value' to insert the date in several places in the Texinfo file. + +* Menu: + +* ifset ifclear:: Format a region if a flag is set. +* value:: Replace a flag with a string. +* value Example:: An easy way to update edition information. + + +File: texinfo.info, Node: ifset ifclear, Next: value, Prev: set clear value, Up: set clear value + +`@ifset' and `@ifclear' +----------------------- + + When a FLAG is set, the Texinfo formatting commands format text +between subsequent pairs of `@ifset FLAG' and `@end ifset' commands. +When the FLAG is cleared, the Texinfo formatting commands do *not* +format the text. + + Use the `@set FLAG' command to turn on, or "set", a FLAG; a "flag" +can be any single word. The format for the command looks like this: + + @set FLAG + + Write the conditionally formatted text between `@ifset FLAG' and +`@end ifset' commands, like this: + + @ifset FLAG + CONDITIONAL-TEXT + @end ifset + + For example, you can create one document that has two variants, such +as a manual for a `large' and `small' model: + + You can use this machine to dig up shrubs + without hurting them. + + @set large + + @ifset large + It can also dig up fully grown trees. + @end ifset + + Remember to replant promptly ... + +In the example, the formatting commands will format the text between +`@ifset large' and `@end ifset' because the `large' flag is set. + + Use the `@clear FLAG' command to turn off, or "clear", a flag. +Clearing a flag is the opposite of setting a flag. The command looks +like this: + + @clear FLAG + +Write the command on a line of its own. + + When FLAG is cleared, the Texinfo formatting commands do *not* format +the text between `@ifset FLAG' and `@end ifset'; that text is ignored +and does not appear in either printed or Info output. + + For example, if you clear the flag of the preceding example by writing +an `@clear large' command after the `@set large' command (but before +the conditional text), then the Texinfo formatting commands ignore the +text between the `@ifset large' and `@end ifset' commands. In the +formatted output, that text does not appear; in both printed and Info +output, you see only the lines that say, "You can use this machine to +dig up shrubs without hurting them. Remember to replant promptly ...". + + If a flag is cleared with an `@clear FLAG' command, then the +formatting commands format text between subsequent pairs of `@ifclear' +and `@end ifclear' commands. But if the flag is set with `@set FLAG', +then the formatting commands do *not* format text between an `@ifclear' +and an `@end ifclear' command; rather, they ignore that text. An +`@ifclear' command looks like this: + + @ifclear FLAG + + In brief, the commands are: + +`@set FLAG' + Tell the Texinfo formatting commands that FLAG is set. + +`@clear FLAG' + Tell the Texinfo formatting commands that FLAG is cleared. + +`@ifset FLAG' + If FLAG is set, tell the Texinfo formatting commands to format the + text up to the following `@end ifset' command. + + If FLAG is cleared, tell the Texinfo formatting commands to ignore + text up to the following `@end ifset' command. + +`@ifclear FLAG' + If FLAG is set, tell the Texinfo formatting commands to ignore the + text up to the following `@end ifclear' command. + + If FLAG is cleared, tell the Texinfo formatting commands to format + the text up to the following `@end ifclear' command. + + +File: texinfo.info, Node: value, Next: value Example, Prev: ifset ifclear, Up: set clear value + +`@value' +-------- + + You can use the `@set' command to specify a value for a flag, which +is expanded by the `@value' command. The value is a string a +characters. + + Write the `@set' command like this: + + @set foo This is a string. + +This sets the value of `foo' to "This is a string." + + The Texinfo formatters replace an `@value{FLAG}' command with the +string to which FLAG is set. + + Thus, when `foo' is set as shown above, the Texinfo formatters convert + + @value{foo} +to + This is a string. + + You can write an `@value' command within a paragraph; but you must +write an `@set' command on a line of its own. + + If you write the `@set' command like this: + + @set foo + +without specifying a string, the value of `foo' is an empty string. + + If you clear a previously set flag with an `@clear FLAG' command, a +subsequent `@value{flag}' command is invalid and the string is replaced +with an error message that says `{No value for "FLAG"}'. + + For example, if you set `foo' as follows: + + @set how-much very, very, very + +then the formatters transform + + It is a @value{how-much} wet day. +into + It is a very, very, very wet day. + + If you write + + @clear how-much + +then the formatters transform + + It is a @value{how-much} wet day. +into + It is a {No value for "how-much"} wet day. + + +File: texinfo.info, Node: value Example, Prev: value, Up: set clear value + +`@value' Example +---------------- + + You can use the `@value' command to limit the number of places you +need to change when you record an update to a manual. Here is how it +is done in `The GNU Make Manual': + +Set the flags: + + @set EDITION 0.35 Beta + @set VERSION 3.63 Beta + @set UPDATED 14 August 1992 + @set UPDATE-MONTH August 1992 + +Write text for the first `@ifinfo' section, for people reading the +Texinfo file: + + This is Edition @value{EDITION}, + last updated @value{UPDATED}, + of @cite{The GNU Make Manual}, + for @code{make}, Version @value{VERSION}. + +Write text for the title page, for people reading the printed manual: + + @title GNU Make + @subtitle A Program for Directing Recompilation + @subtitle Edition @value{EDITION}, ... + @subtitle @value{UPDATE-MONTH} + +(On a printed cover, a date listing the month and the year looks less +fussy than a date listing the day as well as the month and year.) + +Write text for the Top node, for people reading the Info file: + + This is Edition @value{EDITION} + of the @cite{GNU Make Manual}, + last updated @value{UPDATED} + for @code{make} Version @value{VERSION}. + + After you format the manual, the text in the first `@ifinfo' section +looks like this: + + This is Edition 0.35 Beta, last updated 14 August 1992, + of `The GNU Make Manual', for `make', Version 3.63 Beta. + + When you update the manual, change only the values of the flags; you +do not need to rewrite the three sections. + + +File: texinfo.info, Node: Macros, Next: Format/Print Hardcopy, Prev: Conditionals, Up: Top + +Macros: Defining New Texinfo Commands +************************************* + + A Texinfo "macro" allows you to define a new Texinfo command as any +sequence of text and/or existing commands (including other macros). The +macro can have any number of "parameters"--text you supply each time +you use the macro. (This has nothing to do with the `@defmac' command, +which is for documenting macros in the subject of the manual; *note Def +Cmd Template::..) + +* Menu: + +* Defining Macros:: Both defining and undefining new commands. +* Invoking Macros:: Using a macro, once you've defined it. + + +File: texinfo.info, Node: Defining Macros, Next: Invoking Macros, Prev: Macros, Up: Macros + +Defining Macros +=============== + + You use the Texinfo `@macro' command to define a macro. For example: + + @macro MACRO-NAME{PARAM1, PARAM2, ...} + TEXT ... \PARAM1\ ... + @end macro + + The "parameters" PARAM1, PARAM2, ... correspond to arguments supplied +when the macro is subsequently used in the document (see the next +section). + + If a macro needs no parameters, you can define it either with an empty +list (`@macro foo {}') or with no braces at all (`@macro foo'). + + The definition or "body" of the macro can contain any Texinfo +commands, including previously-defined macros. (It is not possible to +have mutually recursive Texinfo macros.) In the body, instances of a +parameter name surrounded by backslashes, as in `\PARAM1\' in the +example above, are replaced by the corresponding argument from the +macro invocation. + + You can undefine a macro FOO with `@unmacro FOO'. It is not an error +to undefine a macro that is already undefined. For example: + + @unmacro foo + diff --git a/info/texinfo.info-8 b/info/texinfo.info-8 new file mode 100644 index 0000000..1f59eb6 --- /dev/null +++ b/info/texinfo.info-8 @@ -0,0 +1,1265 @@ +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98 Free Software +Foundation, Inc. + + This edition is for Texinfo version 3.12. + + 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 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. + + +File: texinfo.info, Node: Invoking Macros, Prev: Defining Macros, Up: Macros + +Invoking Macros +=============== + + After a macro is defined (see the previous section), you can use +("invoke") it in your document like this: + + @MACRO-NAME {ARG1, ARG2, ...} + +and the result will be just as if you typed the body of MACRO-NAME at +that spot. For example: + + @macro foo {p, q} + Together: \p\ & \q\. + @end macro + @foo{a, b} + +produces: + + Together: a & b. + + Thus, the arguments and parameters are separated by commas and +delimited by braces; any whitespace after (but not before) a comma is +ignored. To insert a comma, brace, or backslash in an argument, +prepend a backslash, as in + + @MACRO-NAME {\\\{\}\,} + +which will pass the (almost certainly error-producing) argument `\{},' +to MACRO-NAME. + + If the macro is defined to take a single argument, and is invoked +without any braces, the entire rest of the line after the macro name is +supplied as the argument. For example: + + @macro bar {p} + Twice: \p\, \p\. + @end macro + @bar aah + +produces: + + Twice: aah, aah. + + +File: texinfo.info, Node: Format/Print Hardcopy, Next: Create an Info File, Prev: Macros, Up: Top + +Format and Print Hardcopy +************************* + + There are three major shell commands for making a printed manual from +a Texinfo file: one for converting the Texinfo file into a file that +will be printed, a second for sorting indices, and a third for printing +the formatted document. When you use the shell commands, you can either +work directly in the operating system shell or work within a shell +inside GNU Emacs. + + If you are using GNU Emacs, you can use commands provided by Texinfo +mode instead of shell commands. In addition to the three commands to +format a file, sort the indices, and print the result, Texinfo mode +offers key bindings for commands to recenter the output buffer, show the +print queue, and delete a job from the print queue. + +* Menu: + +* Use TeX:: Use TeX to format for hardcopy. +* Format with tex/texindex:: How to format in a shell. +* Format with texi2dvi:: A simpler way to use the shell. +* Print with lpr:: How to print. +* Within Emacs:: How to format and print from an Emacs shell. +* Texinfo Mode Printing:: How to format and print in Texinfo mode. +* Compile-Command:: How to print using Emacs's compile command. +* Requirements Summary:: TeX formatting requirements summary. +* Preparing for TeX:: What you need to do to use TeX. +* Overfull hboxes:: What are and what to do with overfull hboxes. +* smallbook:: How to print small format books and manuals. +* A4 Paper:: How to print on European A4 paper. +* Cropmarks and Magnification:: How to print marks to indicate the size + of pages and how to print scaled up output. + + +File: texinfo.info, Node: Use TeX, Next: Format with tex/texindex, Prev: Format/Print Hardcopy, Up: Format/Print Hardcopy + +Use TeX +======= + + The typesetting program called TeX is used for formatting a Texinfo +file. TeX is a very powerful typesetting program and, if used right, +does an exceptionally good job. (*Note How to Obtain TeX: Obtaining +TeX, for information on how to obtain TeX.) + + The `makeinfo', `texinfo-format-region', and `texinfo-format-buffer' +commands read the very same @-commands in the Texinfo file as does TeX, +but process them differently to make an Info file; see *Note Create an +Info File::. + + +File: texinfo.info, Node: Format with tex/texindex, Next: Format with texi2dvi, Prev: Use TeX, Up: Format/Print Hardcopy + +Format using `tex' and `texindex' +================================= + + Format the Texinfo file with the shell command `tex' followed by the +name of the Texinfo file. For example: + + tex foo.texi + +TeX will produce a "DVI file" as well as several auxiliary files +containing information for indices, cross references, etc. The DVI +file (for "DeVice Independent" file) can be printed on virtually any +printe (see the following sections). + + The `tex' formatting command itself does not sort the indices; it +writes an output file of unsorted index data. (The `texi2dvi' command +automatically generates indices; see *Note Format using `texi2dvi': +Format with texi2dvi.) To generate a printed index after running the +`tex' command, you first need a sorted index to work from. The +`texindex' command sorts indices. (The source file `texindex.c' comes +as part of the standard Texinfo distribution, among other places.) + + The `tex' formatting command outputs unsorted index files under names +that obey a standard convention: the name of your main input file with +any `.tex' (or similar, *note tex invocation: (web2c)tex invocation.) +extension removed, followed by the two letter names of indices. For +example, the raw index output files for the input file `foo.texinfo' +would be `foo.cp', `foo.vr', `foo.fn', `foo.tp', `foo.pg' and `foo.ky'. +Those are exactly the arguments to give to `texindex'. + + Instead of specifying all the unsorted index file names explicitly, +you can use `??' as shell wildcards and give the command in this form: + + texindex foo.?? + +This command will run `texindex' on all the unsorted index files, +including any that you have defined yourself using `@defindex' or +`@defcodeindex'. (You may execute `texindex foo.??' even if there are +similarly named files with two letter extensions that are not index +files, such as `foo.el'. The `texindex' command reports but otherwise +ignores such files.) + + For each file specified, `texindex' generates a sorted index file +whose name is made by appending `s' to the input file name. The +`@printindex' command knows to look for a file of that name (*note +Printing Indices & Menus::.). `texindex' does not alter the raw index +output file. + + After you have sorted the indices, you need to rerun the `tex' +formatting command on the Texinfo file. This regenerates the DVI file, +this time with up-to-date index entries. + + Finally, you may need to run `tex' one more time, to get the page +numbers in the cross-references correct. + + To summarize, this is a four step process: + + 1. Run `tex' on your Texinfo file. This generates a DVI file (with + undefined cross-references and no indices), and the raw index files + (with two letter extensions). + + 2. Run `texindex' on the raw index files. This creates the + corresponding sorted index files (with three letter extensions). + + 3. Run `tex' again on your Texinfo file. This regenerates the DVI + file, this time with indices and defined cross-references, but + with page numbers for the cross-references from last time, + generally incorrect. + + 4. Run `tex' one last time. This time the correct page numbers are + written for the cross-references. + + Alternatively, it's a one-step process: run `texi2dvi'. + + You need not run `texindex' each time after you run `tex'. If you do +not, on the next run, the `tex' formatting command will use whatever +sorted index files happen to exist from the previous use of `texindex'. +This is usually ok while you are debugging. + + +File: texinfo.info, Node: Format with texi2dvi, Next: Print with lpr, Prev: Format with tex/texindex, Up: Format/Print Hardcopy + +Format using `texi2dvi' +======================= + + The `texi2dvi' command automatically runs both `tex' and `texindex' +as many times as necessary to produce a DVI file with up-to-date, +sorted indices. It simplifies the `tex'--`texindex'--`tex' sequence +described in the previous section. + + The syntax for `texi2dvi' is like this (where `prompt$' is your shell +prompt): + + prompt$ texi2dvi FILENAME... + + For a list of options, run `texi2dvi --help'. + + +File: texinfo.info, Node: Print with lpr, Next: Within Emacs, Prev: Format with texi2dvi, Up: Format/Print Hardcopy + +Shell Print Using `lpr -d' +========================== + + The precise command to print a DVI file depends on your system +installation, but `lpr -d' is common. The command may require the DVI +file name without any extension or with a `.dvi' extension. (If it is +`lpr', you must include the `.dvi'.) + + The following commands, for example, will (probably) suffice to sort +the indices, format, and print the `Bison Manual': + + tex bison.texinfo + texindex bison.?? + tex bison.texinfo + lpr -d bison.dvi + +(Remember that the shell commands may be different at your site; but +these are commonly used versions.) + + Using the `texi2dvi' shell script, you simply need type: + + texi2dvi bison.texinfo + lpr -d bison.dvi + + +File: texinfo.info, Node: Within Emacs, Next: Texinfo Mode Printing, Prev: Print with lpr, Up: Format/Print Hardcopy + +From an Emacs Shell +=================== + + You can give formatting and printing commands from a shell within GNU +Emacs. To create a shell within Emacs, type `M-x shell'. In this +shell, you can format and print the document. *Note Format and Print +Hardcopy: Format/Print Hardcopy, for details. + + You can switch to and from the shell buffer while `tex' is running +and do other editing. If you are formatting a long document on a slow +machine, this can be very convenient. + + You can also use `texi2dvi' from an Emacs shell. For example, here +is how to use `texi2dvi' to format and print `Using and Porting GNU CC' +from a shell within Emacs: + + texi2dvi gcc.texinfo + lpr -d gcc.dvi + + *Note Texinfo Mode Printing::, for more information about formatting +and printing in Texinfo mode. + + +File: texinfo.info, Node: Texinfo Mode Printing, Next: Compile-Command, Prev: Within Emacs, Up: Format/Print Hardcopy + +Formatting and Printing in Texinfo Mode +======================================= + + Texinfo mode provides several predefined key commands for TeX +formatting and printing. These include commands for sorting indices, +looking at the printer queue, killing the formatting job, and +recentering the display of the buffer in which the operations occur. + +`C-c C-t C-b' +`M-x texinfo-tex-buffer' + Run `texi2dvi' on the current buffer. + +`C-c C-t C-r' +`M-x texinfo-tex-region' + Run TeX on the current region. + +`C-c C-t C-i' +`M-x texinfo-texindex' + Sort the indices of a Texinfo file formatted with + `texinfo-tex-region'. + +`C-c C-t C-p' +`M-x texinfo-tex-print' + Print a DVI file that was made with `texinfo-tex-region' or + `texinfo-tex-buffer'. + +`C-c C-t C-q' +`M-x tex-show-print-queue' + Show the print queue. + +`C-c C-t C-d' +`M-x texinfo-delete-from-print-queue' + Delete a job from the print queue; you will be prompted for the job + number shown by a preceding `C-c C-t C-q' command + (`texinfo-show-tex-print-queue'). + +`C-c C-t C-k' +`M-x tex-kill-job' + Kill the currently running TeX job started by `texinfo-tex-region' + or `texinfo-tex-buffer', or any other process running in the + Texinfo shell buffer. + +`C-c C-t C-x' +`M-x texinfo-quit-job' + Quit a TeX formatting job that has stopped because of an error by + sending an to it. When you do this, TeX preserves a record of + what it did in a `.log' file. + +`C-c C-t C-l' +`M-x tex-recenter-output-buffer' + Redisplay the shell buffer in which the TeX printing and formatting + commands are run to show its most recent output. + + Thus, the usual sequence of commands for formatting a buffer is as +follows (with comments to the right): + + C-c C-t C-b Run `texi2dvi' on the buffer. + C-c C-t C-p Print the DVI file. + C-c C-t C-q Display the printer queue. + + The Texinfo mode TeX formatting commands start a subshell in Emacs +called the `*tex-shell*'. The `texinfo-tex-command', +`texinfo-texindex-command', and `tex-dvi-print-command' commands are +all run in this shell. + + You can watch the commands operate in the `*tex-shell*' buffer, and +you can switch to and from and use the `*tex-shell*' buffer as you +would any other shell buffer. + + The formatting and print commands depend on the values of several +variables. The default values are: + + Variable Default value + + texinfo-texi2dvi-command "texi2dvi" + texinfo-tex-command "tex" + texinfo-texindex-command "texindex" + texinfo-delete-from-print-queue-command "lprm" + texinfo-tex-trailer "@bye" + tex-start-of-header "%**start" + tex-end-of-header "%**end" + tex-dvi-print-command "lpr -d" + tex-show-queue-command "lpq" + + You can change the values of these variables with the `M-x +edit-options' command (*note Editing Variable Values: (xemacs)Edit +Options.), with the `M-x set-variable' command (*note Examining and +Setting Variables: (xemacs)Examining.), or with your `.emacs' +initialization file (*note Init File: (xemacs)Init File.). + + +File: texinfo.info, Node: Compile-Command, Next: Requirements Summary, Prev: Texinfo Mode Printing, Up: Format/Print Hardcopy + +Using the Local Variables List +============================== + + Yet another way to apply the TeX formatting command to a Texinfo file +is to put that command in a "local variables list" at the end of the +Texinfo file. You can then specify the `tex' or `texi2dvi' commands as +a `compile-command' and have Emacs run it by typing `M-x compile'. +This creates a special shell called the `*compilation*' buffer in which +Emacs runs the compile command. For example, at the end of the +`gdb.texinfo' file, after the `@bye', you could put the following: + + Local Variables: + compile-command: "texi2dvi gdb.texinfo" + End: + +This technique is most often used by programmers who also compile +programs this way; see *Note Compilation: (xemacs)Compilation. + + +File: texinfo.info, Node: Requirements Summary, Next: Preparing for TeX, Prev: Compile-Command, Up: Format/Print Hardcopy + +TeX Formatting Requirements Summary +=================================== + + Every Texinfo file that is to be input to TeX must begin with a +`\input' command and must contain an `@setfilename' command: + + \input texinfo + @setfilename ARG-NOT-USED-BY-@TEX{} + +The first command instructs TeX to load the macros it needs to process +a Texinfo file and the second command opens auxiliary files. + + Every Texinfo file must end with a line that terminates TeX's +processing and forces out unfinished pages: + + @bye + + Strictly speaking, these lines are all a Texinfo file needs to be +processed successfully by TeX. + + Usually, however, the beginning includes an `@settitle' command to +define the title of the printed manual, an `@setchapternewpage' +command, a title page, a copyright page, and permissions. Besides an +`@bye', the end of a file usually includes indices and a table of +contents. (And of course most manuals contain a body of text as well.) + +For more information, see +*Note `@settitle': settitle, +*Note `@setchapternewpage': setchapternewpage, +*Note Page Headings: Headings, +*Note Titlepage & Copyright Page::, +*Note Printing Indices & Menus::, and +*Note Contents::. + + +File: texinfo.info, Node: Preparing for TeX, Next: Overfull hboxes, Prev: Requirements Summary, Up: Format/Print Hardcopy + +Preparing to Use TeX +==================== + +TeX needs to know where to find the `texinfo.tex' file that you have +told it to input with the `\input texinfo' command at the beginning of +the first line. The `texinfo.tex' file tells TeX how to handle +@-commands; it is included in all standard GNU distributions. + + Usually, the `texinfo.tex' file is put under the default directory +that contains TeX macros +(`/usr/local/share/texmf/tex/texinfo/texinfo.tex' by default) when GNU +Emacs or other GNU software is installed. In this case, TeX will find +the file and you do not need to do anything special. Alternatively, +you can put `texinfo.tex' in the current directory when you run TeX, +and TeX will find it there. + + Also, you should install `epsf.tex' in the same place as +`texinfo.tex', if it is not already installed from another +distribution. This file is needed to support the `@image' command +(*note Images::.). + + Optionally, you may create an additional `texinfo.cnf', and install +it as well. This file is read by TeX at the `@setfilename' command +(*note `@setfilename': setfilename.). You can put any commands you +like there according to local site-wide conventions, and they will be +read by TeX when processing any Texinfo document. For example, if +`texinfo.cnf' contains the a single line `@afourpaper' (*note A4 +Paper::.), then all Texinfo documents will be processed with that page +size in effect. If you have nothing to put in `texinfo.cnf', you do +not need to create it. + + If neither of the above locations for these system files suffice for +you, you can specify the directories explicitly. For `texinfo.tex', +you can do this by writing the complete path for the file after the +`\input' command. Another way, that works for both `texinfo.tex' and +`texinfo.cnf' (and any other file TeX might read), is to set the +`TEXINPUTS' environment variable in your `.cshrc' or `.profile' file. + + Which you use of `.cshrc' or `.profile' depends on whether you use a +Bourne shell-compatible (`sh', `bash', `ksh', ...) or C +shell-compatible (`csh', `tcsh') command interpreter. The latter read +the `.cshrc' file for initialization information, and the former read +`.profile'. + + In a `.cshrc' file, you could use the following `csh' command +sequence: + + setenv TEXINPUTS .:/home/me/mylib:/usr/lib/tex/macros + + In a `.profile' file, you could use the following `sh' command +sequence: + + TEXINPUTS=.:/home/me/mylib:/usr/lib/tex/macros + export TEXINPUTS + +This would cause TeX to look for `\input' file first in the current +directory, indicated by the `.', then in a hypothetical user's +`me/mylib' directory, and finally in a system directory. + + +File: texinfo.info, Node: Overfull hboxes, Next: smallbook, Prev: Preparing for TeX, Up: Format/Print Hardcopy + +Overfull "hboxes" +================= + + TeX is sometimes unable to typeset a line without extending it into +the right margin. This can occur when TeX comes upon what it +interprets as a long word that it cannot hyphenate, such as an +electronic mail network address or a very long title. When this +happens, TeX prints an error message like this: + + Overfull \hbox (20.76302pt too wide) + +(In TeX, lines are in "horizontal boxes", hence the term, "hbox". The +backslash, `\', is the TeX equivalent of `@'.) + + TeX also provides the line number in the Texinfo source file and the +text of the offending line, which is marked at all the places that TeX +knows how to hyphenate words. *Note Catching Errors with TeX +Formatting: Debugging with TeX, for more information about typesetting +errors. + + If the Texinfo file has an overfull hbox, you can rewrite the sentence +so the overfull hbox does not occur, or you can decide to leave it. A +small excursion into the right margin often does not matter and may not +even be noticeable. + + However, unless told otherwise, TeX will print a large, ugly, black +rectangle beside the line that contains the overfull hbox. This is so +you will notice the location of the problem if you are correcting a +draft. + + To prevent such a monstrosity from marring your final printout, write +the following in the beginning of the Texinfo file on a line of its own, +before the `@titlepage' command: + + @finalout + + +File: texinfo.info, Node: smallbook, Next: A4 Paper, Prev: Overfull hboxes, Up: Format/Print Hardcopy + +Printing "Small" Books +====================== + + By default, TeX typesets pages for printing in an 8.5 by 11 inch +format. However, you can direct TeX to typeset a document in a 7 by +9.25 inch format that is suitable for bound books by inserting the +following command on a line by itself at the beginning of the Texinfo +file, before the title page: + + @smallbook + +(Since regular sized books are often about 7 by 9.25 inches, this +command might better have been called the `@regularbooksize' command, +but it came to be called the `@smallbook' command by comparison to the +8.5 by 11 inch format.) + + If you write the `@smallbook' command between the start-of-header and +end-of-header lines, the Texinfo mode TeX region formatting command, +`texinfo-tex-region', will format the region in "small" book size +(*note Start of Header::.). + + The Free Software Foundation distributes printed copies of `The GNU +Emacs Manual' and other manuals in the "small" book size. *Note +`@smallexample' and `@smalllisp': smallexample & smalllisp, for +information about commands that make it easier to produce examples for +a smaller manual. + + Alternatively, to avoid embedding this physical paper size in your +document, use `texi2dvi' to format your document (*note Format with +texi2dvi::.), and supply `-t @smallbook' as an argument. Then other +people do not have to change the document source file to format it +differently. + + +File: texinfo.info, Node: A4 Paper, Next: Cropmarks and Magnification, Prev: smallbook, Up: Format/Print Hardcopy + +Printing on A4 Paper +==================== + + You can tell TeX to typeset a document for printing on European size +A4 paper with the `@afourpaper' command. Write the command on a line +by itself between `@iftex' and `@end iftex' lines near the beginning of +the Texinfo file, before the title page: + + For example, this is how you would write the header for this manual: + + \input texinfo @c -*-texinfo-*- + @c %**start of header + @setfilename texinfo + @settitle Texinfo + @syncodeindex vr fn + @iftex + @afourpaper + @end iftex + @c %**end of header + + Alternatively, to avoid embedding this physical paper size in your +document, use `texi2dvi' to format your document (*note Format with +texi2dvi::.), and supply `-t @afourpaper' as an argument. Then other +people do not have to change the document source file to format it +differently. + + Another alternative: put the `@afourpaper' command in the file +`texinfo.cnf' that TeX will read. (No need for `@iftex' there.) This +will automatically typeset all the Texinfo documents at your site with +that paper size in effect. + + +File: texinfo.info, Node: Cropmarks and Magnification, Prev: A4 Paper, Up: Format/Print Hardcopy + +Cropmarks and Magnification +=========================== + + You can attempt to direct TeX to print cropmarks at the corners of +pages with the `@cropmarks' command. Write the `@cropmarks' command on +a line by itself between `@iftex' and `@end iftex' lines near the +beginning of the Texinfo file, before the title page, like this: + + @iftex + @cropmarks + @end iftex + + This command is mainly for printers that typeset several pages on one +sheet of film; but you can attempt to use it to mark the corners of a +book set to 7 by 9.25 inches with the `@smallbook' command. (Printers +will not produce cropmarks for regular sized output that is printed on +regular sized paper.) Since different printing machines work in +different ways, you should explore the use of this command with a +spirit of adventure. You may have to redefine the command in the +`texinfo.tex' definitions file. + + You can attempt to direct TeX to typeset pages larger or smaller than +usual with the `\mag' TeX command. Everything that is typeset is +scaled proportionally larger or smaller. (`\mag' stands for +"magnification".) This is *not* a Texinfo @-command, but is a plain +TeX command that is prefixed with a backslash. You have to write this +command between `@tex' and `@end tex' (*note Raw Formatter Commands::.). + + Follow the `\mag' command with an `=' and then a number that is 1000 +times the magnification you desire. For example, to print pages at 1.2 +normal size, write the following near the beginning of the Texinfo +file, before the title page: + + @tex + \mag=1200 + @end tex + + With some printing technologies, you can print normal-sized copies +that look better than usual by using a larger-than-normal master. + + Depending on your system, `\mag' may not work or may work only at +certain magnifications. Be prepared to experiment. + + +File: texinfo.info, Node: Create an Info File, Next: Install an Info File, Prev: Format/Print Hardcopy, Up: Top + +Creating an Info File +********************* + + `makeinfo' is a utility that converts a Texinfo file into an Info +file; `texinfo-format-region' and `texinfo-format-buffer' are GNU Emacs +functions that do the same. + + A Texinfo file must contain an `@setfilename' line near its +beginning, otherwise the Info formatting commands will fail. + + For information on installing the Info file in the Info system, see +*Note Install an Info File::. + +* Menu: + +* makeinfo advantages:: `makeinfo' provides better error checking. +* Invoking makeinfo:: How to run `makeinfo' from a shell. +* makeinfo options:: Specify fill-column and other options. +* Pointer Validation:: How to check that pointers point somewhere. +* makeinfo in Emacs:: How to run `makeinfo' from Emacs. +* texinfo-format commands:: Two Info formatting commands written + in Emacs Lisp are an alternative + to `makeinfo'. +* Batch Formatting:: How to format for Info in Emacs Batch mode. +* Tag and Split Files:: How tagged and split files help Info + to run better. + + +File: texinfo.info, Node: makeinfo advantages, Next: Invoking makeinfo, Prev: Create an Info File, Up: Create an Info File + +`makeinfo' Preferred +==================== + + The `makeinfo' utility creates an Info file from a Texinfo source +file more quickly than either of the Emacs formatting commands and +provides better error messages. We recommend it. `makeinfo' is a C +program that is independent of Emacs. You do not need to run Emacs to +use `makeinfo', which means you can use `makeinfo' on machines that are +too small to run Emacs. You can run `makeinfo' in any one of three +ways: from an operating system shell, from a shell inside Emacs, or by +typing a key command in Texinfo mode in Emacs. + + The `texinfo-format-region' and the `texinfo-format-buffer' commands +are useful if you cannot run `makeinfo'. Also, in some circumstances, +they format short regions or buffers more quickly than `makeinfo'. + + +File: texinfo.info, Node: Invoking makeinfo, Next: makeinfo options, Prev: makeinfo advantages, Up: Create an Info File + +Running `makeinfo' from a Shell +=============================== + + To create an Info file from a Texinfo file, type `makeinfo' followed +by the name of the Texinfo file. Thus, to create the Info file for +Bison, type the following to the shell: is the prompt): + + makeinfo bison.texinfo + + (You can run a shell inside Emacs by typing `M-x shell'.) + + Sometimes you will want to specify options. For example, if you wish +to discover which version of `makeinfo' you are using, type: + + makeinfo --version + + *Note makeinfo options::, for more information. + + +File: texinfo.info, Node: makeinfo options, Next: Pointer Validation, Prev: Invoking makeinfo, Up: Create an Info File + +Options for `makeinfo' +====================== + + The `makeinfo' command takes a number of options. Most often, +options are used to set the value of the fill column and specify the +footnote style. Each command line option is a word preceded by `--' or +a letter preceded by `-'. You can use abbreviations for the long +option names as long as they are unique. + + For example, you could use the following shell command to create an +Info file for `bison.texinfo' in which each line is filled to only 68 +columns: + + makeinfo --fill-column=68 bison.texinfo + + You can write two or more options in sequence, like this: + + makeinfo --no-split --fill-column=70 ... + +This would keep the Info file together as one possibly very long file +and would also set the fill column to 70. + + The options are: + +`-D VAR' + Cause the variable VAR to be defined. This is equivalent to `@set + VAR' in the Texinfo file (*note set clear value::.). + +`--error-limit=LIMIT' + Set the maximum number of errors that `makeinfo' will report + before exiting (on the assumption that continuing would be + useless); default 100. + +`--fill-column=WIDTH' + Specify the maximum number of columns in a line; this is the + right-hand edge of a line. Paragraphs that are filled will be + filled to this width. (Filling is the process of breaking up and + connecting lines so that lines are the same length as or shorter + than the number specified as the fill column. Lines are broken + between words.) The default value is 72. + +`--footnote-style=STYLE' + Set the footnote style to STYLE, either `end' for the end node + style (the default) or `separate' for the separate node style. + The value set by this option overrides the value set in a Texinfo + file by an `@footnotestyle' command (*note Footnotes::.). When the + footnote style is `separate', `makeinfo' makes a new node + containing the footnotes found in the current node. When the + footnote style is `end', `makeinfo' places the footnote references + at the end of the current node. + +`--force' + Ordinarily, if the input file has errors, the output files are not + created. With this option, they are preserved. + +`--help' + Print a usage message listing all available options, then exit + successfully. + +`-I DIR' + Add `dir' to the directory search list for finding files that are + included using the `@include' command. By default, `makeinfo' + searches only the current directory. + +`--no-headers' + Do not include menus or node lines in the output. This results in + an ASCII file that you cannot read in Info since it does not + contain the requisite nodes or menus. It is primarily useful to + extract certain pieces of a manual into separate files to be + included in a distribution, such as `INSTALL' files. + +`--no-split' + Suppress the splitting stage of `makeinfo'. By default, large + output files (where the size is greater than 70k bytes) are split + into smaller subfiles, each one approximately 50k bytes. + +`--no-pointer-validate' +`--no-validate' + Suppress the pointer-validation phase of `makeinfo'. Normally, + after a Texinfo file is processed, some consistency checks are + made to ensure that cross references can be resolved, etc. *Note + Pointer Validation::. + +`--no-warn' + Suppress warning messages (but *not* error messages). You might + want this if the file you are creating has examples of Texinfo + cross references within it, and the nodes that are referenced do + not actually exist. + +`--no-number-footnotes' + Suppress automatic footnote numbering. By default, `makeinfo' + numbers each footnote sequentially in a single node, resetting the + current footnote number to 1 at the start of each node. + +`--output=FILE' +`-o FILE' + Specify that the output should be directed to FILE and not to the + file name specified in the `@setfilename' command found in the + Texinfo source (*note setfilename::.). If FILE is `-', output + goes to standard output and `--no-split' is implied. + +`-P DIR' + Prepend `dir' to the directory search list for `@include'. See + `-I' for more details. + +`--paragraph-indent=INDENT' + Set the paragraph indentation style to INDENT. The value set by + this option overrides the value set in a Texinfo file by an + `@paragraphindent' command (*note paragraphindent::.). The value + of INDENT is interpreted as follows: + + `asis' + Preserve any existing indentation at the starts of paragraphs. + + `0' or `none' + Delete any existing indentation. + + NUM + Indent each paragraph by that number of spaces. + +`--reference-limit=LIMIT' + Set the value of the number of references to a node that + `makeinfo' will make without reporting a warning. If a node has + more than this number of references in it, `makeinfo' will make the + references but also report a warning. The default is 1000. + +`-U VAR' + Cause VAR to be undefined. This is equivalent to `@clear VAR' in + the Texinfo file (*note set clear value::.). + +`--verbose' + Cause `makeinfo' to display messages saying what it is doing. + Normally, `makeinfo' only outputs messages if there are errors or + warnings. + +`--version' + Print the version number, then exit successfully. + + +File: texinfo.info, Node: Pointer Validation, Next: makeinfo in Emacs, Prev: makeinfo options, Up: Create an Info File + +Pointer Validation +================== + + If you do not suppress pointer-validation, `makeinfo' will check the +validity of the final Info file. Mostly, this means ensuring that +nodes you have referenced really exist. Here is a complete list of what +is checked: + + 1. If a `Next', `Previous', or `Up' node reference is a reference to a + node in the current file and is not an external reference such as + to `(dir)', then the referenced node must exist. + + 2. In every node, if the `Previous' node is different from the `Up' + node, then the `Previous' node must also be pointed to by a `Next' + node. + + 3. Every node except the `Top' node must have an `Up' pointer. + + 4. The node referenced by an `Up' pointer must contain a reference to + the current node in some manner other than through a `Next' + reference. This includes menu entries and cross references. + + 5. If the `Next' reference of a node is not the same as the `Next' + reference of the `Up' reference, then the node referenced by the + `Next' pointer must have a `Previous' pointer that points back to + the current node. This rule allows the last node in a section to + point to the first node of the next chapter. + + +File: texinfo.info, Node: makeinfo in Emacs, Next: texinfo-format commands, Prev: Pointer Validation, Up: Create an Info File + +Running `makeinfo' inside Emacs +=============================== + + You can run `makeinfo' in GNU Emacs Texinfo mode by using either the +`makeinfo-region' or the `makeinfo-buffer' commands. In Texinfo mode, +the commands are bound to `C-c C-m C-r' and `C-c C-m C-b' by default. + +`C-c C-m C-r' +`M-x makeinfo-region' + Format the current region for Info. + +`C-c C-m C-b' +`M-x makeinfo-buffer' + Format the current buffer for Info. + + When you invoke either `makeinfo-region' or `makeinfo-buffer', Emacs +prompts for a file name, offering the name of the visited file as the +default. You can edit the default file name in the minibuffer if you +wish, before pressing to start the `makeinfo' process. + + The Emacs `makeinfo-region' and `makeinfo-buffer' commands run the +`makeinfo' program in a temporary shell buffer. If `makeinfo' finds +any errors, Emacs displays the error messages in the temporary buffer. + + You can parse the error messages by typing `C-x `' (`next-error'). +This causes Emacs to go to and position the cursor on the line in the +Texinfo source that `makeinfo' thinks caused the error. *Note Running +`make' or Compilers Generally: (xemacs)Compilation, for more +information about using the `next-error' command. + + In addition, you can kill the shell in which the `makeinfo' command +is running or make the shell buffer display its most recent output. + +`C-c C-m C-k' +`M-x makeinfo-kill-job' + Kill the current running `makeinfo' job created by + `makeinfo-region' or `makeinfo-buffer'. + +`C-c C-m C-l' +`M-x makeinfo-recenter-output-buffer' + Redisplay the `makeinfo' shell buffer to display its most recent + output. + +(Note that the parallel commands for killing and recentering a TeX job +are `C-c C-t C-k' and `C-c C-t C-l'. *Note Texinfo Mode Printing::.) + + You can specify options for `makeinfo' by setting the +`makeinfo-options' variable with either the `M-x edit-options' or the +`M-x set-variable' command, or by setting the variable in your `.emacs' +initialization file. + + For example, you could write the following in your `.emacs' file: + + (setq makeinfo-options + "--paragraph-indent=0 --no-split + --fill-column=70 --verbose") + +For more information, see +*Note Editing Variable Values: (xemacs)Edit Options, +*Note Examining and Setting Variables: (xemacs)Examining, +*Note Init File: (xemacs)Init File, and +*Note Options for `makeinfo': makeinfo options. + + +File: texinfo.info, Node: texinfo-format commands, Next: Batch Formatting, Prev: makeinfo in Emacs, Up: Create an Info File + +The `texinfo-format...' Commands +================================ + +In GNU Emacs in Texinfo mode, you can format part or all of a Texinfo +file with the `texinfo-format-region' command. This formats the +current region and displays the formatted text in a temporary buffer +called `*Info Region*'. + + Similarly, you can format a buffer with the `texinfo-format-buffer' +command. This command creates a new buffer and generates the Info file +in it. Typing `C-x C-s' will save the Info file under the name +specified by the `@setfilename' line which must be near the beginning +of the Texinfo file. + +`C-c C-e C-r' +``texinfo-format-region'' + Format the current region for Info. + +`C-c C-e C-b' +``texinfo-format-buffer'' + Format the current buffer for Info. + + The `texinfo-format-region' and `texinfo-format-buffer' commands +provide you with some error checking, and other functions can provide +you with further help in finding formatting errors. These procedures +are described in an appendix; see *Note Catching Mistakes::. However, +the `makeinfo' program is often faster and provides better error +checking (*note makeinfo in Emacs::.). + + +File: texinfo.info, Node: Batch Formatting, Next: Tag and Split Files, Prev: texinfo-format commands, Up: Create an Info File + +Batch Formatting +================ + + You can format Texinfo files for Info using `batch-texinfo-format' +and Emacs Batch mode. You can run Emacs in Batch mode from any shell, +including a shell inside of Emacs. (*Note Command Line Switches and +Arguments: (xemacs)Command Switches.) + + Here is a shell command to format all the files that end in +`.texinfo' in the current directory: + + emacs -batch -funcall batch-texinfo-format *.texinfo + +Emacs processes all the files listed on the command line, even if an +error occurs while attempting to format some of them. + + Run `batch-texinfo-format' only with Emacs in Batch mode as shown; it +is not interactive. It kills the Batch mode Emacs on completion. + + `batch-texinfo-format' is convenient if you lack `makeinfo' and want +to format several Texinfo files at once. When you use Batch mode, you +create a new Emacs process. This frees your current Emacs, so you can +continue working in it. (When you run `texinfo-format-region' or +`texinfo-format-buffer', you cannot use that Emacs for anything else +until the command finishes.) + + +File: texinfo.info, Node: Tag and Split Files, Prev: Batch Formatting, Up: Create an Info File + +Tag Files and Split Files +========================= + + If a Texinfo file has more than 30,000 bytes, `texinfo-format-buffer' +automatically creates a tag table for its Info file; `makeinfo' always +creates a tag table. With a "tag table", Info can jump to new nodes +more quickly than it can otherwise. + + In addition, if the Texinfo file contains more than about 70,000 +bytes, `texinfo-format-buffer' and `makeinfo' split the large Info file +into shorter "indirect" subfiles of about 50,000 bytes each. Big files +are split into smaller files so that Emacs does not need to make a +large buffer to hold the whole of a large Info file; instead, Emacs +allocates just enough memory for the small, split off file that is +needed at the time. This way, Emacs avoids wasting memory when you run +Info. (Before splitting was implemented, Info files were always kept +short and "include files" were designed as a way to create a single, +large printed manual out of the smaller Info files. *Note Include +Files::, for more information. Include files are still used for very +large documents, such as `The XEmacs Lisp Reference Manual', in which +each chapter is a separate file.) + + When a file is split, Info itself makes use of a shortened version of +the original file that contains just the tag table and references to +the files that were split off. The split off files are called +"indirect" files. + + The split off files have names that are created by appending `-1', +`-2', `-3' and so on to the file name specified by the `@setfilename' +command. The shortened version of the original file continues to have +the name specified by `@setfilename'. + + At one stage in writing this document, for example, the Info file was +saved as `test-texinfo' and that file looked like this: + + Info file: test-texinfo, -*-Text-*- + produced by texinfo-format-buffer + from file: new-texinfo-manual.texinfo + + ^_ + Indirect: + test-texinfo-1: 102 + test-texinfo-2: 50422 + test-texinfo-3: 101300 + ^_^L + Tag table: + (Indirect) + Node: overview^?104 + Node: info file^?1271 + Node: printed manual^?4853 + Node: conventions^?6855 + ... + +(But `test-texinfo' had far more nodes than are shown here.) Each of +the split off, indirect files, `test-texinfo-1', `test-texinfo-2', and +`test-texinfo-3', is listed in this file after the line that says +`Indirect:'. The tag table is listed after the line that says `Tag +table:'. + + In the list of indirect files, the number following the file name +records the cumulative number of bytes in the preceding indirect files, +not counting the file list itself, the tag table, or the permissions +text in each file. In the tag table, the number following the node name +records the location of the beginning of the node, in bytes from the +beginning. + + If you are using `texinfo-format-buffer' to create Info files, you +may want to run the `Info-validate' command. (The `makeinfo' command +does such a good job on its own, you do not need `Info-validate'.) +However, you cannot run the `M-x Info-validate' node-checking command +on indirect files. For information on how to prevent files from being +split and how to validate the structure of the nodes, see *Note Using +Info-validate::. + + +File: texinfo.info, Node: Install an Info File, Next: Command List, Prev: Create an Info File, Up: Top + +Installing an Info File +*********************** + + Info files are usually kept in the `info' directory. You can read +Info files using the standalone Info program or the Info reader built +into Emacs. (*note info: (info)Top, for an introduction to Info.) + +* Menu: + +* Directory file:: The top level menu for all Info files. +* New Info File:: Listing a new info file. +* Other Info Directories:: How to specify Info files that are + located in other directories. +* Installing Dir Entries:: How to specify what menu entry to add + to the Info directory. +* Invoking install-info:: `install-info' options. + + +File: texinfo.info, Node: Directory file, Next: New Info File, Prev: Install an Info File, Up: Install an Info File + +The `dir' File +============== + + For Info to work, the `info' directory must contain a file that +serves as a top level directory for the Info system. By convention, +this file is called `dir'. (You can find the location of this file +within Emacs by typing `C-h i' to enter Info and then typing `C-x C-f' +to see the pathname to the `info' directory.) + + The `dir' file is itself an Info file. It contains the top level +menu for all the Info files in the system. The menu looks like this: + + * Menu: + + * Info: (info). Documentation browsing system. + * Emacs: (emacs). The extensible, self-documenting + text editor. + * Texinfo: (texinfo). With one source file, make + either a printed manual using + TeX or an Info file. + ... + + Each of these menu entries points to the `Top' node of the Info file +that is named in parentheses. (The menu entry does not need to specify +the `Top' node, since Info goes to the `Top' node if no node name is +mentioned. *Note Nodes in Other Info Files: Other Info Files.) + + Thus, the `Info' entry points to the `Top' node of the `info' file +and the `Emacs' entry points to the `Top' node of the `emacs' file. + + In each of the Info files, the `Up' pointer of the `Top' node refers +back to the `dir' file. For example, the line for the `Top' node of +the Emacs manual looks like this in Info: + + File: emacs Node: Top, Up: (DIR), Next: Distrib + +(Note that in this case, the `dir' file name is written in upper case +letters--it can be written in either upper or lower case. Info has a +feature that it will change the case of the file name to lower case if +it cannot find the name as written.) + + +File: texinfo.info, Node: New Info File, Next: Other Info Directories, Prev: Directory file, Up: Install an Info File + +Listing a New Info File +======================= + + To add a new Info file to your system, you must write a menu entry to +add to the menu in the `dir' file in the `info' directory. For +example, if you were adding documentation for GDB, you would write the +following new entry: + + * GDB: (gdb). The source-level C debugger. + +The first part of the menu entry is the menu entry name, followed by a +colon. The second part is the name of the Info file, in parentheses, +followed by a period. The third part is the description. + + The name of an Info file often has a `.info' extension. Thus, the +Info file for GDB might be called either `gdb' or `gdb.info'. The Info +reader programs automatically try the file name both with and without +`.info'; so it is better to avoid clutter and not to write `.info' +explicitly in the menu entry. For example, the GDB menu entry should +use just `gdb' for the file name, not `gdb.info'. + + +File: texinfo.info, Node: Other Info Directories, Next: Installing Dir Entries, Prev: New Info File, Up: Install an Info File + +Info Files in Other Directories +=============================== + + If an Info file is not in the `info' directory, there are three ways +to specify its location: + + * Write the pathname in the `dir' file as the second part of the + menu. + + * If you are using Emacs, list the name of the file in a second `dir' + file, in its directory; and then add the name of that directory to + the `Info-directory-list' variable in your personal or site + initialization file. + + This tells Emacs where to look for `dir' files. Emacs merges the + files named `dir' from each of the listed directories. (In Emacs + version 18, you can set the `Info-directory' variable to the name + of only one directory.) + + * Specify the Info directory name in the `INFOPATH' environment + variable in your `.profile' or `.cshrc' initialization file. + (Only you and others who set this environment variable will be + able to find Info files whose location is specified this way.) + + For example, to reach a test file in the `/home/bob/manuals' +directory, you could add an entry like this to the menu in the `dir' +file: + + * Test: (/home/bob/manuals/info-test). Bob's own test file. + +In this case, the absolute file name of the `info-test' file is written +as the second part of the menu entry. + + Alternatively, you could write the following in your `.emacs' file: + + (setq Info-directory-list + '("/home/bob/manuals" + "/usr/local/info")) + + This tells Emacs to merge the `dir' file from the `/home/bob/manuals' +directory with the `dir' file from the `/usr/local/info' directory. +Info will list the `/home/bob/manuals/info-test' file as a menu entry +in the `/home/bob/manuals/dir' file. + + Finally, you can tell Info where to look by setting the `INFOPATH' +environment variable in your `.cshrc' or `.profile' file. If you use a +Bourne-compatible shell such as `sh' or `bash' for your shell command +interpreter, you set the `INFOPATH' environment variable in the +`.profile' initialization file; but if you use `csh' or `tcsh', you +must set the variable in the `.cshrc' initialization file. The two +types of shells use different syntax. + + * In a `.cshrc' file, you could set the `INFOPATH' variable as + follows: + + setenv INFOPATH .:~/manuals:/usr/local/emacs/info + + * In a `.profile' file, you would achieve the same effect by writing: + + INFOPATH=.:$HOME/manuals:/usr/local/emacs/info + export INFOPATH + +The `.' indicates the current directory as usual. Emacs uses the +`INFOPATH' environment variable to initialize the value of Emacs's own +`Info-directory-list' variable. + + However you set `INFOPATH', if its last character is a colon, this is +replaced by the default (compiled-in) path. This gives you a way to +augment the default path with new directories without having to list all +the standard places. For example (using `sh' syntax: + + INFOPATH=/local/info: + export INFOPATH + +will search `/local/info' first, then the standard directories. +Leading or doubled colons are not treated specially. + diff --git a/info/texinfo.info-9 b/info/texinfo.info-9 new file mode 100644 index 0000000..d344328 --- /dev/null +++ b/info/texinfo.info-9 @@ -0,0 +1,1143 @@ +This is Info file ../info/texinfo.info, produced by Makeinfo version +1.68 from the input file texinfo.texi. + +INFO-DIR-SECTION Texinfo documentation system +START-INFO-DIR-ENTRY +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +END-INFO-DIR-ENTRY + + This file documents Texinfo, a documentation system that can produce +both on-line information and a printed manual from a single source file. + + Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98 Free Software +Foundation, Inc. + + This edition is for Texinfo version 3.12. + + 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 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. + + +File: texinfo.info, Node: Installing Dir Entries, Next: Invoking install-info, Prev: Other Info Directories, Up: Install an Info File + +Installing Info Directory Files +=============================== + + When you install an Info file onto your system, you can use the +program `install-info' to update the Info directory file `dir'. +Normally the makefile for the package runs `install-info', just after +copying the Info file into its proper installed location. + + In order for the Info file to work with `install-info', you should +use the commands `@dircategory' and `@direntry' in the Texinfo source +file. Use `@direntry' to specify the menu entry to add to the Info +directory file, and use `@dircategory' to specify which part of the +Info directory to put it in. Here is how these commands are used in +this manual: + + @dircategory Texinfo documentation system + @direntry + * Texinfo: (texinfo). The GNU documentation format. + * install-info: (texinfo)Invoking install-info. ... + ... + @end direntry + + Here's what this produces in the Info file: + + INFO-DIR-SECTION Texinfo documentation system + START-INFO-DIR-ENTRY + * Texinfo: (texinfo). The GNU documentation format. + * install-info: (texinfo)Invoking install-info. ... + ... + END-INFO-DIR-ENTRY + +The `install-info' program sees these lines in the Info file, and that +is how it knows what to do. + + Always use the `@direntry' and `@dircategory' commands near the +beginning of the Texinfo input, before the first `@node' command. If +you use them later on in the input, `install-info' will not notice them. + + If you use `@dircategory' more than once in the Texinfo source, each +usage specifies one category; the new menu entry is added to the Info +directory file in each of the categories you specify. If you use +`@direntry' more than once, each usage specifies one menu entry; each +of these menu entries is added to the directory in each of the +specified categories. + + +File: texinfo.info, Node: Invoking install-info, Prev: Installing Dir Entries, Up: Install an Info File + +Invoking install-info +===================== + + `install-info' inserts menu entries from an Info file into the +top-level `dir' file in the Info system (see the previous sections for +an explanation of how the `dir' file works). It's most often run as +part of software installation, or when constructing a dir file for all +manuals on a system. Synopsis: + + install-info [OPTION]... [INFO-FILE [DIR-FILE]] + + If INFO-FILE or DIR-FILE are not specified, the various options +(described below) that define them must be. There are no compile-time +defaults, and standard input is never used. `install-info' can read +only one info file and write only one dir file per invocation. + + If DIR-FILE (however specified) does not exist, `install-info' +creates it if possible (with no entries). + + Options: + +`--delete' + Delete the entries in INFO-FILE from DIR-FILE. The file name in + the entry in DIR-FILE must be INFO-FILE (except for an optional + `.info' in either one). Don't insert any new entries. + +`--dir-file=NAME' + Specify file name of the Info directory file. This is equivalent + to using the DIR-FILE argument. + +`--entry=TEXT' + Insert TEXT as an Info directory entry; TEXT should have the form + of an Info menu item line plus zero or more extra lines starting + with whitespace. If you specify more than one entry, they are all + added. If you don't specify any entries, they are determined from + information in the Info file itself. + +`--help' + Display a usage message listing basic usage and all available + options, then exit successfully. + +`--info-file=FILE' + Specify Info file to install in the directory. This is equivalent + to using the INFO-FILE argument. + +`--info-dir=DIR' + Equivalent to `--dir-file=DIR/dir'. + +`--item=TEXT' + Same as `--entry=TEXT'. An Info directory entry is actually a + menu item. + +`--quiet' + Suppress warnings. + +`--remove' + Same as `--delete'. + +`--section=SEC' + Put this file's entries in section SEC of the directory. If you + specify more than one section, all the entries are added in each + of the sections. If you don't specify any sections, they are + determined from information in the Info file itself. + +`--version' + Display version information and exit successfully. + + +File: texinfo.info, Node: Command List, Next: Tips, Prev: Install an Info File, Up: Top + +@-Command List +************** + + Here is an alphabetical list of the @-commands in Texinfo. Square +brackets, [ ], indicate optional arguments; an ellipsis, `...', +indicates repeated text. + +`@WHITESPACE' + An `@' followed by a space, tab, or newline produces a normal, + stretchable, interword space. *Note Multiple Spaces::. + +`@!' + Generate an exclamation point that really does end a sentence + (usually after an end-of-sentence capital letter). *Note Ending a + Sentence::. + +`@"' +`@'' + Generate an umlaut or acute accent, respectively, over the next + character, as in "o and 'o. *Note Inserting Accents::. + +`@*' + Force a line break. Do not end a paragraph that uses `@*' with an + `@refill' command. *Note Line Breaks::. + +`@,{C}' + Generate a cedilla accent under C, as in c,. *Note Inserting + Accents::. + +`@-' + Insert a discretionary hyphenation point. *Note - and + hyphenation::. + +`@.' + Produce a period that really does end a sentence (usually after an + end-of-sentence capital letter). *Note Ending a Sentence::. + +`@:' + Indicate to TeX that an immediately preceding period, question + mark, exclamation mark, or colon does not end a sentence. Prevent + TeX from inserting extra whitespace as it does at the end of a + sentence. The command has no effect on the Info file output. + *Note Not Ending a Sentence::. + +`@=' + Generate a macro (bar) accent over the next character, as in =o. + *Note Inserting Accents::. + +`@?' + Generate a question mark that really does end a sentence (usually + after an end-of-sentence capital letter). *Note Ending a + Sentence::. + +`@@' + Stands for an at sign, `@'. *Note Inserting @ and braces: Braces + Atsigns. + +`@^' +`@`' + Generate a circumflex (hat) or grave accent, respectively, over + the next character, as in ^o. *Note Inserting Accents::. + +`@{' + Stands for a left brace, `{'. *Note Inserting @ and braces: + Braces Atsigns. + +`@}' + Stands for a right-hand brace, `}'. + *Note Inserting @ and braces: Braces Atsigns. + +`@=' + Generate a tilde accent over the next character, as in ~N. *Note + Inserting Accents::. + +`@AA{}' +`@aa{}' + Generate the uppercase and lowercase Scandinavian A-ring letters, + respectively: AA, aa. *Note Inserting Accents::. + +`@AE{}' +`@ae{}' + Generate the uppercase and lowercase AE ligatures, respectively: + AE, ae. *Note Inserting Accents::. + +`@afourpaper' + Change page dimensions for the A4 paper size. Only allowed inside + `@iftex' ... `@end iftex'. *Note A4 Paper::. + +`@appendix TITLE' + Begin an appendix. The title appears in the table of contents of + a printed manual. In Info, the title is underlined with + asterisks. *Note The `@unnumbered' and `@appendix' Commands: + unnumbered & appendix. + +`@appendixsec TITLE' +`@appendixsection TITLE' + Begin an appendix section within an appendix. The section title + appears in the table of contents of a printed manual. In Info, + the title is underlined with equal signs. `@appendixsection' is a + longer spelling of the `@appendixsec' command. *Note Section + Commands: unnumberedsec appendixsec heading. + +`@appendixsubsec TITLE' + Begin an appendix subsection within an appendix. The title appears + in the table of contents of a printed manual. In Info, the title + is underlined with hyphens. *Note Subsection Commands: + unnumberedsubsec appendixsubsec subheading. + +`@appendixsubsubsec TITLE' + Begin an appendix subsubsection within an appendix subsection. The + title appears in the table of contents of a printed manual. In + Info, the title is underlined with periods. *Note The `subsub' + Commands: subsubsection. + +`@asis' + Used following `@table', `@ftable', and `@vtable' to print the + table's first column without highlighting ("as is"). *Note Making + a Two-column Table: Two-column Tables. + +`@author AUTHOR' + Typeset AUTHOR flushleft and underline it. *Note The `@title' and + `@author' Commands: title subtitle author. + +`@b{TEXT}' + Print TEXT in bold font. No effect in Info. *Note Fonts::. + +`@bullet{}' + Generate a large round dot, or the closest possible thing to one. + *Note `@bullet': bullet. + +`@bye' + Stop formatting a file. The formatters do not see the contents of + a file following an `@bye' command. *Note Ending a File::. + +`@c COMMENT' + Begin a comment in Texinfo. The rest of the line does not appear + in either the Info file or the printed manual. A synonym for + `@comment'. *Note Comments: Comments. + +`@cartouche' + Highlight an example or quotation by drawing a box with rounded + corners around it. Pair with `@end cartouche'. No effect in + Info. *Note Drawing Cartouches Around Examples: cartouche.) + +`@center LINE-OF-TEXT' + Center the line of text following the command. *Note `@center': + titlefont center sp. + +`@centerchap LINE-OF-TEXT' + Like `@chapter', but centers the chapter title. *Note `@chapter': + chapter. + +`@chapheading TITLE' + Print a chapter-like heading in the text, but not in the table of + contents of a printed manual. In Info, the title is underlined + with asterisks. *Note `@majorheading' and `@chapheading': + majorheading & chapheading. + +`@chapter TITLE' + Begin a chapter. The chapter title appears in the table of + contents of a printed manual. In Info, the title is underlined + with asterisks. *Note `@chapter': chapter. + +`@cindex ENTRY' + Add ENTRY to the index of concepts. *Note Defining the Entries of + an Index: Index Entries. + +`@cite{REFERENCE}' + Highlight the name of a book or other reference that lacks a + companion Info file. *Note `@cite': cite. + +`@clear FLAG' + Unset FLAG, preventing the Texinfo formatting commands from + formatting text between subsequent pairs of `@ifset FLAG' and + `@end ifset' commands, and preventing `@value{FLAG}' from + expanding to the value to which FLAG is set. *Note `@set' + `@clear' `@value': set clear value. + +`@code{SAMPLE-CODE}' + Highlight text that is an expression, a syntactically complete + token of a program, or a program name. *Note `@code': code. + +`@comment COMMENT' + Begin a comment in Texinfo. The rest of the line does not appear + in either the Info file or the printed manual. A synonym for `@c'. + *Note Comments: Comments. + +`@contents' + Print a complete table of contents. Has no effect in Info, which + uses menus instead. *Note Generating a Table of Contents: + Contents. + +`@copyright{}' + Generate a copyright symbol. *Note `@copyright': copyright symbol. + +`@defcodeindex INDEX-NAME' + Define a new index and its indexing command. Print entries in an + `@code' font. *Note Defining New Indices: New Indices. + +`@defcv CATEGORY CLASS NAME' +`@defcvx CATEGORY CLASS NAME' + Format a description for a variable associated with a class in + object-oriented programming. Takes three arguments: the category + of thing being defined, the class to which it belongs, and its + name. *Note Definition Commands::, and *Note Def Cmds in Detail: + deffnx. + +`@deffn CATEGORY NAME ARGUMENTS...' +`@deffnx CATEGORY NAME ARGUMENTS...' + Format a description for a function, interactive command, or + similar entity that may take arguments. `@deffn' takes as + arguments the category of entity being described, the name of this + particular entity, and its arguments, if any. *Note Definition + Commands::. + +`@defindex INDEX-NAME' + Define a new index and its indexing command. Print entries in a + roman font. *Note Defining New Indices: New Indices. + +`@definfoenclose NEW-COMMAND, BEFORE, AFTER,' + Create new @-command for Info that marks text by enclosing it in + strings that precede and follow the text. Write definition inside + of `@ifinfo' ... `@end ifinfo'. *Note Customized Highlighting::. + +`@defivar CLASS INSTANCE-VARIABLE-NAME' +`@defivarx CLASS INSTANCE-VARIABLE-NAME' + This command formats a description for an instance variable in + object-oriented programming. The command is equivalent to `@defcv + {Instance Variable} ...'. *Note Definition Commands::, and *Note + Def Cmds in Detail: deffnx. + +`@defmac MACRO-NAME ARGUMENTS...' +`@defmacx MACRO-NAME ARGUMENTS...' + Format a description for a macro. The command is equivalent to + `@deffn Macro ...'. *Note Definition Commands::, and *Note Def + Cmds in Detail: deffnx. + +`@defmethod CLASS METHOD-NAME ARGUMENTS...' +`@defmethodx CLASS METHOD-NAME ARGUMENTS...' + Format a description for a method in object-oriented programming. + The command is equivalent to `@defop Method ...'. Takes as + arguments the name of the class of the method, the name of the + method, and its arguments, if any. *Note Definition Commands::, + and *Note Def Cmds in Detail: deffnx. + +`@defop CATEGORY CLASS NAME ARGUMENTS...' +`@defopx CATEGORY CLASS NAME ARGUMENTS...' + Format a description for an operation in object-oriented + programming. `@defop' takes as arguments the overall name of the + category of operation, the name of the class of the operation, the + name of the operation, and its arguments, if any. *Note + Definition Commands::, and *Note Def Cmds in Detail: deffnx. + +`@defopt OPTION-NAME' +`@defoptx OPTION-NAME' + Format a description for a user option. The command is equivalent + to `@defvr {User Option} ...'. *Note Definition Commands::, and + *Note Def Cmds in Detail: deffnx. + +`@defspec SPECIAL-FORM-NAME ARGUMENTS...' +`@defspecx SPECIAL-FORM-NAME ARGUMENTS...' + Format a description for a special form. The command is + equivalent to `@deffn {Special Form} ...'. *Note Definition + Commands::, and *Note Def Cmds in Detail: deffnx. + +`@deftp CATEGORY NAME-OF-TYPE ATTRIBUTES...' +`@deftpx CATEGORY NAME-OF-TYPE ATTRIBUTES...' + Format a description for a data type. `@deftp' takes as arguments + the category, the name of the type (which is a word like `int' or + `float'), and then the names of attributes of objects of that type. + *Note Definition Commands::, and *Note Def Cmds in Detail: deffnx. + +`@deftypefn CLASSIFICATION DATA-TYPE NAME ARGUMENTS...' +`@deftypefnx CLASSIFICATION DATA-TYPE NAME ARGUMENTS...' + Format a description for a function or similar entity that may take + arguments and that is typed. `@deftypefn' takes as arguments the + classification of entity being described, the type, the name of the + entity, and its arguments, if any. *Note Definition Commands::, + and *Note Def Cmds in Detail: deffnx. + +`@deftypefun DATA-TYPE FUNCTION-NAME ARGUMENTS...' +`@deftypefunx DATA-TYPE FUNCTION-NAME ARGUMENTS...' + Format a description for a function in a typed language. The + command is equivalent to `@deftypefn Function ...'. *Note + Definition Commands::, and *Note Def Cmds in Detail: deffnx. + +`@deftypemethod CLASS DATA-TYPE METHOD-NAME ARGUMENTS...' +`@deftypemethodx CLASS DATA-TYPE METHOD-NAME ARGUMENTS...' + Format a description for a typed method in object-oriented + programming. Takes as arguments the name of the class of the + method, the return type of the method, the name of the method, and + its arguments, if any. *Note Definition Commands::, and *Note Def + Cmds in Detail: deffnx. + +`@deftypevr CLASSIFICATION DATA-TYPE NAME' +`@deftypevrx CLASSIFICATION DATA-TYPE NAME' + Format a description for something like a variable in a typed + language--an entity that records a value. Takes as arguments the + classification of entity being described, the type, and the name + of the entity. *Note Definition Commands::, and *Note Def Cmds in + Detail: deffnx. + +`@deftypevar DATA-TYPE VARIABLE-NAME' +`@deftypevarx DATA-TYPE VARIABLE-NAME' + Format a description for a variable in a typed language. The + command is equivalent to `@deftypevr Variable ...'. *Note + Definition Commands::, and *Note Def Cmds in Detail: deffnx. + +`@defun FUNCTION-NAME ARGUMENTS...' +`@defunx FUNCTION-NAME ARGUMENTS...' + Format a description for functions. The command is equivalent to + `@deffn Function ...'. *Note Definition Commands::, and *Note Def + Cmds in Detail: deffnx. + +`@defvar VARIABLE-NAME' +`@defvarx VARIABLE-NAME' + Format a description for variables. The command is equivalent to + `@defvr Variable ...'. *Note Definition Commands::, and *Note Def + Cmds in Detail: deffnx. + +`@defvr CATEGORY NAME' +`@defvrx CATEGORY NAME' + Format a description for any kind of variable. `@defvr' takes as + arguments the category of the entity and the name of the entity. + *Note Definition Commands::, and *Note Def Cmds in Detail: deffnx. + +`@detailmenu{}' + Avoid `makeinfo' confusion stemming from the detailed node listing + in a master menu. *Note Master Menu Parts::. + +`@dfn{TERM}' + Highlight the introductory or defining use of a term. *Note + `@dfn': dfn. + +`@dircategory DIRPART' + Specify a part of the Info directory menu where this file's entry + should go. *Note Installing Dir Entries::. + +`@direntry' + Begin the Info directory menu entry for this file. *Note + Installing Dir Entries::. + +`@display' + Begin a kind of example. Indent text, do not fill, do not select a + new font. Pair with `@end display'. *Note `@display': display. + +`@dmn{DIMENSION}' + Format a unit of measure, as in 12pt. Causes TeX to insert a thin + space before DIMENSION. No effect in Info. *Note `@dmn': dmn. + +`@dotaccent{C}' + Generate a dot accent over the character C, as in .oo. *Note + Inserting Accents::. + +`@dots{}' + Insert an ellipsis: `...'. *Note `@dots{}': dots. + +`@email{ADDRESS[, DISPLAYED-TEXT]}' + Indicate an electronic mail address. *Note `@email': email. + +`@emph{TEXT}' + Highlight TEXT; text is displayed in *italics* in printed output, + and surrounded by asterisks in Info. *Note Emphasizing Text: + Emphasis. + +`@end ENVIRONMENT' + Ends ENVIRONMENT, as in `@end example'. *Note @-commands: + Formatting Commands. + +`@enddots{}' + Generate an end-of-sentence of ellipsis, like this .... *Note + `@dots{}': dots. + +`@enumerate [NUMBER-OR-LETTER]' + Begin a numbered list, using `@item' for each entry. Optionally, + start list with NUMBER-OR-LETTER. Pair with `@end enumerate'. + *Note `@enumerate': enumerate. + +`@equiv{}' + Indicate to the reader the exact equivalence of two forms with a + glyph: `=='. *Note Equivalence::. + +`@error{}' + Indicate to the reader with a glyph that the following text is an + error message: `error-->'. *Note Error Glyph::. + +`@evenfooting [LEFT] @| [CENTER] @| [RIGHT]' +`@evenheading [LEFT] @| [CENTER] @| [RIGHT]' + Specify page footings resp. headings for even-numbered (left-hand) + pages. Only allowed inside `@iftex'. *Note How to Make Your Own + Headings: Custom Headings. + +`@everyfooting [LEFT] @| [CENTER] @| [RIGHT]' +`@everyheading [LEFT] @| [CENTER] @| [RIGHT]' + Specify page footings resp. headings for every page. Not relevant + to Info. *Note How to Make Your Own Headings: Custom Headings. + +`@example' + Begin an example. Indent text, do not fill, and select + fixed-width font. Pair with `@end example'. *Note `@example': + example. + +`@exclamdown{}' + Produce an upside-down exclamation point. *Note Inserting + Accents::. + +`@exdent LINE-OF-TEXT' + Remove any indentation a line might have. *Note Undoing the + Indentation of a Line: exdent. + +`@expansion{}' + Indicate the result of a macro expansion to the reader with a + special glyph: `==>'. *Note ==> Indicating an Expansion: + expansion. + +`@file{FILENAME}' + Highlight the name of a file, buffer, node, or directory. *Note + `@file': file. + +`@finalout' + Prevent TeX from printing large black warning rectangles beside + over-wide lines. *Note Overfull hboxes::. + +`@findex ENTRY' + Add ENTRY to the index of functions. *Note Defining the Entries + of an Index: Index Entries. + +`@flushleft' +`@flushright' + Left justify every line but leave the right end ragged. Leave + font as is. Pair with `@end flushleft'. `@flushright' analogous. + *Note `@flushleft' and `@flushright': flushleft & flushright. + +`@footnote{TEXT-OF-FOOTNOTE}' + Enter a footnote. Footnote text is printed at the bottom of the + page by TeX; Info may format in either `End' node or `Separate' + node style. *Note Footnotes::. + +`@footnotestyle STYLE' + Specify an Info file's footnote style, either `end' for the end + node style or `separate' for the separate node style. *Note + Footnotes::. + +`@format' + Begin a kind of example. Like `@example' or `@display', but do + not narrow the margins and do not select the fixed-width font. + Pair with `@end format'. *Note `@example': example. + +`@ftable FORMATTING-COMMAND' + Begin a two-column table, using `@item' for each entry. + Automatically enter each of the items in the first column into the + index of functions. Pair with `@end ftable'. The same as + `@table', except for indexing. *Note `@ftable' and `@vtable': + ftable vtable. + +`@group' + Hold text together that must appear on one printed page. Pair with + `@end group'. Not relevant to Info. *Note `@group': group. + +`@H{C}' + Generate the long Hungarian umlaut accent over C, as in ''o. + +`@heading TITLE' + Print an unnumbered section-like heading in the text, but not in + the table of contents of a printed manual. In Info, the title is + underlined with equal signs. *Note Section Commands: + unnumberedsec appendixsec heading. + +`@headings ON-OFF-SINGLE-DOUBLE' + Turn page headings on or off, and/or specify single-sided or + double-sided page headings for printing. *Note The `@headings' + Command: headings on off. + +`@html' + Enter HTML completely. Pair with `@end html'. *Note Raw + Formatter Commands::. + +`@hyphenation{HY-PHEN-A-TED WORDS}' + Explicitly define hyphenation points. *Note `@-' and + `@hyphenation': - and hyphenation. + +`@i{TEXT}' + Print TEXT in italic font. No effect in Info. *Note Fonts::. + +`@ifclear FLAG' + If FLAG is cleared, the Texinfo formatting commands format text + between `@ifclear FLAG' and the following `@end ifclear' command. + *Note `@set' `@clear' `@value': set clear value. + +`@ifhtml' +`@ifinfo' + Begin a stretch of text that will be ignored by TeX when it + typesets the printed manual. The text appears only in the HTML + resp. Info file. Pair with `@end ifhtml' resp. `@end ifinfo'. + *Note Conditionals::. + +`@ifnothtml' +`@ifnotinfo' +`@ifnottex' + Begin a stretch of text that will be ignored in one output format + but not the others. The text appears only in the format not + specified. Pair with `@end ifnothtml' resp. `@end ifnotinfo' resp. + `@end ifnotinfo'. *Note Conditionals::. + +`@ifset FLAG' + If FLAG is set, the Texinfo formatting commands format text + between `@ifset FLAG' and the following `@end ifset' command. + *Note `@set' `@clear' `@value': set clear value. + +`@iftex' + Begin a stretch of text that will not appear in the Info file, but + will be processed only by TeX. Pair with `@end iftex'. *Note + Conditionally Visible Text: Conditionals. + +`@ignore' + Begin a stretch of text that will not appear in either the Info + file or the printed output. Pair with `@end ignore'. *Note + Comments and Ignored Text: Comments. + +`@image{FILENAME, [WIDTH], [HEIGHT]}' + Include graphics image in external FILENAME scaled to the given + WIDTH and/or HEIGHT. *Note Images::. + +`@include FILENAME' + Incorporate the contents of the file FILENAME into the Info file + or printed document. *Note Include Files::. + +`@inforef{NODE-NAME, [ENTRY-NAME], INFO-FILE-NAME}' + Make a cross reference to an Info file for which there is no + printed manual. *Note Cross references using `@inforef': inforef. + +`\input MACRO-DEFINITIONS-FILE' + Use the specified macro definitions file. This command is used + only in the first line of a Texinfo file to cause TeX to make use + of the `texinfo' macro definitions file. The backslash in `\input' + is used instead of an `@' because TeX does not recognize `@' until + after it has read the definitions file. *Note The Texinfo File + Header: Header. + +`@item' + Indicate the beginning of a marked paragraph for `@itemize' and + `@enumerate'; indicate the beginning of the text of a first column + entry for `@table', `@ftable', and `@vtable'. *Note Lists and + Tables::. + +`@itemize MARK-GENERATING-CHARACTER-OR-COMMAND' + Produce a sequence of indented paragraphs, with a mark inside the + left margin at the beginning of each paragraph. Pair with `@end + itemize'. *Note `@itemize': itemize. + +`@itemx' + Like `@item' but do not generate extra vertical space above the + item text. *Note `@itemx': itemx. + +`@kbd{KEYBOARD-CHARACTERS}' + Indicate text that is characters of input to be typed by users. + *Note `@kbd': kbd. + +`@kbdinputstyle STYLE' + Specify when `@kbd' should use a font distinct from `@code'. + *Note `@kbd': kbd. + +`@key{KEY-NAME}' + Indicate a name for a key on a keyboard. *Note `@key': key. + +`@kindex ENTRY' + Add ENTRY to the index of keys. *Note Defining the Entries of an + Index: Index Entries. + +`@L{}' +`@l{}' + Generate the uppercase and lowercase Polish suppressed-L letters, + respectively: L/, l/. + +`@lisp' + Begin an example of Lisp code. Indent text, do not fill, and + select fixed-width font. Pair with `@end lisp'. *Note `@lisp': + Lisp Example. + +`@lowersections' + Change subsequent chapters to sections, sections to subsections, + and so on. *Note `@raisesections' and `@lowersections': + Raise/lower sections. + +`@macro MACRO-NAME {PARAMS}' + Define a new Texinfo command `@MACRO-NAME{PARAMS}'. Only + supported by `makeinfo' and `texi2dvi'. *Note Defining Macros::. + +`@majorheading TITLE' + Print a chapter-like heading in the text, but not in the table of + contents of a printed manual. Generate more vertical whitespace + before the heading than the `@chapheading' command. In Info, the + chapter heading line is underlined with asterisks. *Note + `@majorheading' and `@chapheading': majorheading & chapheading. + +`@math{MATHEMATICAL-EXPRESSION}' + Format a mathematical expression. *Note `@math' - Inserting + Mathematical Expressions: math. + +`@menu' + Mark the beginning of a menu of nodes in Info. No effect in a + printed manual. Pair with `@end menu'. *Note Menus::. + +`@minus{}' + Generate a minus sign, `-'. *Note `@minus': minus. + +`@multitable COLUMN-WIDTH-SPEC' + Begin a multi-column table. Pair with `@end multitable'. *Note + Multitable Column Widths::. + +`@need N' + Start a new page in a printed manual if fewer than N mils + (thousandths of an inch) remain on the current page. *Note + `@need': need. + +`@node NAME, NEXT, PREVIOUS, UP' + Define the beginning of a new node in Info, and serve as a locator + for references for TeX. *Note `@node': node. + +`@noindent' + Prevent text from being indented as if it were a new paragraph. + *Note `@noindent': noindent. + +`@O{}' +`@o{}' + Generate the uppercase and lowercase O-with-slash letters, + respectively: O/, o/. + +`@oddfooting [LEFT] @| [CENTER] @| [RIGHT]' +`@oddheading [LEFT] @| [CENTER] @| [RIGHT]' + Specify page footings resp. headings for odd-numbered (right-hand) + pages. Only allowed inside `@iftex'. *Note How to Make Your Own + Headings: Custom Headings. + +`@OE{}' +`@oe{}' + Generate the uppercase and lowercase OE ligatures, respectively: + OE, oe. *Note Inserting Accents::. + +`@page' + Start a new page in a printed manual. No effect in Info. *Note + `@page': page. + +`@paragraphindent INDENT' + Indent paragraphs by INDENT number of spaces; delete indentation + if the value of INDENT is 0; and do not change indentation if + INDENT is `asis'. *Note Paragraph Indenting: paragraphindent. + +`@pindex ENTRY' + Add ENTRY to the index of programs. *Note Defining the Entries of + an Index: Index Entries. + +`@point{}' + Indicate the position of point in a buffer to the reader with a + glyph: `-!-'. *Note Indicating Point in a Buffer: Point Glyph. + +`@pounds{}' + Generate the pounds sterling currency sign. *Note `@pounds{}': + pounds. + +`@print{}' + Indicate printed output to the reader with a glyph: `-|'. *Note + Print Glyph::. + +`@printindex INDEX-NAME' + Print an alphabetized two-column index in a printed manual or + generate an alphabetized menu of index entries for Info. *Note + Printing Indices & Menus::. + +`@pxref{NODE-NAME, [ENTRY], [TOPIC-OR-TITLE], [INFO-FILE], [MANUAL]}' + Make a reference that starts with a lower case `see' in a printed + manual. Use within parentheses only. Do not follow command with a + punctuation mark--the Info formatting commands automatically insert + terminating punctuation as needed. Only the first argument is + mandatory. *Note `@pxref': pxref. + +`@questiondown{}' + Generate an upside-down question mark. *Note Inserting Accents::. + +`@quotation' + Narrow the margins to indicate text that is quoted from another + real or imaginary work. Write command on a line of its own. Pair + with `@end quotation'. *Note `@quotation': quotation. + +`@r{TEXT}' + Print TEXT in roman font. No effect in Info. *Note Fonts::. + +`@raisesections' + Change subsequent sections to chapters, subsections to sections, + and so on. *Note `@raisesections' and `@lowersections': + Raise/lower sections. + +`@ref{NODE-NAME, [ENTRY], [TOPIC-OR-TITLE], [INFO-FILE], [MANUAL]}' + Make a reference. In a printed manual, the reference does not + start with a `See'. Follow command with a punctuation mark. Only + the first argument is mandatory. *Note `@ref': ref. + +`@refill' + In Info, refill and indent the paragraph after all the other + processing has been done. No effect on TeX, which always refills. + This command is no longer needed, since all formatters now + automatically refill. *Note Refilling Paragraphs::. + +`@result{}' + Indicate the result of an expression to the reader with a special + glyph: `=>'. *Note `@result': result. + +`@ringaccent{C}' + Generate a ring accent over the next character, as in *o. *Note + Inserting Accents::. + +`@samp{TEXT}' + Highlight TEXT that is a literal example of a sequence of + characters. Used for single characters, for statements, and often + for entire shell commands. *Note `@samp': samp. + +`@sc{TEXT}' + Set TEXT in a printed output in THE SMALL CAPS FONT and set text + in the Info file in uppercase letters. *Note Smallcaps::. + +`@section TITLE' + Begin a section within a chapter. In a printed manual, the section + title is numbered and appears in the table of contents. In Info, + the title is underlined with equal signs. *Note `@section': + section. + +`@set FLAG [STRING]' + Make FLAG active, causing the Texinfo formatting commands to + format text between subsequent pairs of `@ifset FLAG' and `@end + ifset' commands. Optionally, set value of FLAG to STRING. *Note + `@set' `@clear' `@value': set clear value. + +`@setchapternewpage ON-OFF-ODD' + Specify whether chapters start on new pages, and if so, whether on + odd-numbered (right-hand) new pages. *Note `@setchapternewpage': + setchapternewpage. + +`@setfilename INFO-FILE-NAME' + Provide a name to be used by the Info file. This command is + essential for TeX formatting as well, even though it produces no + output. *Note `@setfilename': setfilename. + +`@settitle TITLE' + Provide a title for page headers in a printed manual. *Note + `@settitle': settitle. + +`@shortcontents' + Print a short table of contents. Not relevant to Info, which uses + menus rather than tables of contents. A synonym for + `@summarycontents'. *Note Generating a Table of Contents: + Contents. + +`@shorttitlepage{TITLE}' + Generate a minimal title page. *Note `@titlepage': titlepage. + +`@smallbook' + Cause TeX to produce a printed manual in a 7 by 9.25 inch format + rather than the regular 8.5 by 11 inch format. *Note Printing + Small Books: smallbook. Also, see *Note `@smallexample' and + `@smalllisp': smallexample & smalllisp. + +`@smallexample' + Indent text to indicate an example. Do not fill, select + fixed-width font. In `@smallbook' format, print text in a smaller + font than with `@example'. Pair with `@end smallexample'. *Note + `@smallexample' and `@smalllisp': smallexample & smalllisp. + +`@smalllisp' + Begin an example of Lisp code. Indent text, do not fill, select + fixed-width font. In `@smallbook' format, print text in a smaller + font. Pair with `@end smalllisp'. *Note `@smallexample' and + `@smalllisp': smallexample & smalllisp. + +`@sp N' + Skip N blank lines. *Note `@sp': sp. + +`@ss{}' + Generate the German sharp-S es-zet letter, ss. *Note Inserting + Accents::. + +`@strong TEXT' + Emphasize TEXT by typesetting it in a *bold* font for the printed + manual and by surrounding it with asterisks for Info. *Note + Emphasizing Text: emph & strong. + +`@subheading TITLE' + Print an unnumbered subsection-like heading in the text, but not in + the table of contents of a printed manual. In Info, the title is + underlined with hyphens. *Note `@unnumberedsubsec' + `@appendixsubsec' `@subheading': unnumberedsubsec appendixsubsec + subheading. + +`@subsection TITLE' + Begin a subsection within a section. In a printed manual, the + subsection title is numbered and appears in the table of contents. + In Info, the title is underlined with hyphens. *Note + `@subsection': subsection. + +`@subsubheading TITLE' + Print an unnumbered subsubsection-like heading in the text, but + not in the table of contents of a printed manual. In Info, the + title is underlined with periods. *Note The `subsub' Commands: + subsubsection. + +`@subsubsection TITLE' + Begin a subsubsection within a subsection. In a printed manual, + the subsubsection title is numbered and appears in the table of + contents. In Info, the title is underlined with periods. *Note + The `subsub' Commands: subsubsection. + +`@subtitle TITLE' + In a printed manual, set a subtitle in a normal sized font flush to + the right-hand side of the page. Not relevant to Info, which does + not have title pages. *Note `@title' `@subtitle' and `@author' + Commands: title subtitle author. + +`@summarycontents' + Print a short table of contents. Not relevant to Info, which uses + menus rather than tables of contents. A synonym for + `@shortcontents'. *Note Generating a Table of Contents: Contents. + +`@syncodeindex FROM-INDEX INTO-INDEX' + Merge the index named in the first argument into the index named in + the second argument, printing the entries from the first index in + `@code' font. *Note Combining Indices::. + +`@synindex FROM-INDEX INTO-INDEX' + Merge the index named in the first argument into the index named in + the second argument. Do not change the font of FROM-INDEX + entries. *Note Combining Indices::. + +`@t{TEXT}' + Print TEXT in a fixed-width, typewriter-like font. No effect in + Info. *Note Fonts::. + +`@tab' + Separate columns in a multitable. *Note Multitable Rows::. + +`@table FORMATTING-COMMAND' + Begin a two-column table, using `@item' for each entry. Write + each first column entry on the same line as `@item'. First column + entries are printed in the font resulting from FORMATTING-COMMAND. + Pair with `@end table'. *Note Making a Two-column Table: + Two-column Tables. Also see *Note `@ftable' and `@vtable': ftable + vtable, and *Note `@itemx': itemx. + +`@TeX{}' + Insert the logo TeX. *Note Inserting TeX and (C): TeX and + copyright. + +`@tex' + Enter TeX completely. Pair with `@end tex'. *Note Raw Formatter + Commands::. + +`@thischapter' +`@thischaptername' +`@thisfile' +`@thispage' +`@thistitle' + Only allowed in a heading or footing. Stands for the number and + name of the current chapter (in the format `Chapter 1: Title'), + the chapter name only, the filename, the current page number, and + the title of the document, respectively. *Note How to Make Your + Own Headings: Custom Headings. + +`@tieaccent{CC}' + Generate a tie-after accent over the next two characters CC, as in + `[oo'. *Note Inserting Accents::. + +`@tindex ENTRY' + Add ENTRY to the index of data types. *Note Defining the Entries + of an Index: Index Entries. + +`@title TITLE' + In a printed manual, set a title flush to the left-hand side of the + page in a larger than normal font and underline it with a black + rule. Not relevant to Info, which does not have title pages. + *Note The `@title' `@subtitle' and `@author' Commands: title + subtitle author. + +`@titlefont{TEXT}' + In a printed manual, print TEXT in a larger than normal font. Not + relevant to Info, which does not have title pages. *Note The + `@titlefont' `@center' and `@sp' Commands: titlefont center sp. + +`@titlepage' + Indicate to Texinfo the beginning of the title page. Write + command on a line of its own. Pair with `@end titlepage'. + Nothing between `@titlepage' and `@end titlepage' appears in Info. + *Note `@titlepage': titlepage. + +`@today{}' + Insert the current date, in `1 Jan 1900' style. *Note How to Make + Your Own Headings: Custom Headings. + +`@top TITLE' + In a Texinfo file to be formatted with `makeinfo', identify the + topmost `@node' line in the file, which must be written on the line + immediately preceding the `@top' command. Used for `makeinfo''s + node pointer insertion feature. The title is underlined with + asterisks. Both the `@node' line and the `@top' line normally + should be enclosed by `@ifinfo' and `@end ifinfo'. In TeX and + `texinfo-format-buffer', the `@top' command is merely a synonym + for `@unnumbered'. *Note Creating Pointers with `makeinfo': + makeinfo Pointer Creation. + +`@u{C}' +`@ubaraccent{C}' +`@udotaccent{C}' + Generate a breve, underbar, or underdot accent, respectively, over + or under the character C, as in (o, o_, o-.. *Note Inserting + Accents::. + +`@unnumbered TITLE' + In a printed manual, begin a chapter that appears without chapter + numbers of any kind. The title appears in the table of contents + of a printed manual. In Info, the title is underlined with + asterisks. *Note `@unnumbered' and `@appendix': unnumbered & + appendix. + +`@unnumberedsec TITLE' + In a printed manual, begin a section that appears without section + numbers of any kind. The title appears in the table of contents + of a printed manual. In Info, the title is underlined with equal + signs. *Note Section Commands: unnumberedsec appendixsec heading. + +`@unnumberedsubsec TITLE' + In a printed manual, begin an unnumbered subsection within a + chapter. The title appears in the table of contents of a printed + manual. In Info, the title is underlined with hyphens. *Note + `@unnumberedsubsec' `@appendixsubsec' `@subheading': + unnumberedsubsec appendixsubsec subheading. + +`@unnumberedsubsubsec TITLE' + In a printed manual, begin an unnumbered subsubsection within a + chapter. The title appears in the table of contents of a printed + manual. In Info, the title is underlined with periods. *Note The + `subsub' Commands: subsubsection. + +`@uref{URL[, DISPLAYED-TEXT}' + Define a cross reference to an external uniform resource locator + for the World Wide Web. *Note `@url': url. + +`@url{URL}' + Indicate text that is a uniform resource locator for the World Wide + Web. *Note `@url': url. + +`@v{C}' + Generate check accent over the character C, as in ' - - Command: widget-forward &optional count + - Command: widget-forward &optional COUNT Move point COUNT buttons or editing fields forward. `' - - Command: widget-backward &optional count + - Command: widget-backward &optional COUNT Move point COUNT buttons or editing fields backward.  @@ -291,69 +291,69 @@ User Interface::). (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)) @@ -369,14 +369,14 @@ object. This object can be queried and manipulated by other widget functions, until it is deleted with `widget-delete'. After the widgets have been created, `widget-setup' must be called to enable them. - - Function: widget-create type [ keyword argument ]... + - Function: widget-create TYPE [ KEYWORD ARGUMENT ]... Create and return a widget of type TYPE. The syntax for the TYPE argument is described in *Note Basic Types::. The keyword arguments can be used to overwrite the keyword arguments that are part of TYPE. - - Function: widget-delete widget + - Function: widget-delete WIDGET Delete WIDGET and remove it from the buffer. - Function: widget-setup @@ -416,7 +416,7 @@ Basic Types NAME ::= (NAME [KEYWORD ARGUMENT]... ARGS) | NAME - where NAME is a widget name, KEYWORD is the name of a property, + Where, NAME is a widget name, KEYWORD is the name of a property, ARGUMENT is the value of the property, and ARGS are interpreted in a widget specific way. @@ -444,12 +444,12 @@ widget specific way. `%{' `%}' - The text inside will be displayed in the face specified by + The text inside will be displayed with the face specified by `:sample-face'. `%v' - This will be replaced with the buffer representation of the - widget's value. What this is depends on the widget type. + This will be replaces with the buffer representation of the + widgets value. What this is depends on the widget type. `%d' Insert the string specified by `:doc' here. @@ -480,18 +480,17 @@ widget specific way. Text around %[ %] in the format. These can be - _nil_ + *nil* No text is inserted. - _a string_ + *a string* The string is inserted literally. - _a symbol_ + *a symbol* The value of the symbol is expanded according to this table. `:doc' - The string inserted by the `%d' or `%h' escape in the format - string. + The string inserted by the `%d' escape in the format string. `:tag' The string inserted by the `%t' escape in the format string. @@ -539,14 +538,14 @@ widget specific way. specified value. `:validate' - A function which takes a widget as an argument, and returns nil if - the widget's current value is valid for the widget. Otherwise it + A function which takes a widget as an argument, and return nil if + the widgets current value is valid for the widget. Otherwise, it should return the widget containing the invalid data, and set that - widget's `:error' property to a string explaining the error. + widgets `:error' property to a string explaining the error. The following predefined function can be used: - - Function: widget-children-validate widget + - Function: widget-children-validate WIDGET All the `:children' of WIDGET must be valid. `:tab-order' @@ -686,10 +685,8 @@ widget will match all string values. The following extra properties are recognized. `:size' - The minimum width of the editable field. - By default the field will reach to the end of the line. If the - content is too large, the displayed representation will expand to - contain it. The content is not truncated to size. + The width of the editable field. + By default the field will reach to the end of the line. `:value-face' Face used for highlighting the editable field. Default is @@ -708,7 +705,7 @@ widget will match all string values. `:keymap' Keymap used in the editable field. The default value is `widget-field-keymap', which allows you to use all the normal - editing commands, even if the buffer's major mode suppress some of + editing commands, even if the buffers major mode suppress some of them. Pressing return invokes the function specified by `:action'.  @@ -731,9 +728,10 @@ The `menu-choice' Widget TYPE ::= (menu-choice [KEYWORD ARGUMENT]... TYPE ... ) - The TYPE argument represents each possible choice. The widget's -value will be that of the chosen TYPE argument. This widget will match -any value matching at least one of the specified TYPE arguments. + The TYPE arguments represents each possible choice. The widgets +value of will be the value of the chosen TYPE argument. This widget +will match any value that matches at least one of the specified TYPE +arguments. `:void' Widget type used as a fallback when the value does not match any @@ -763,9 +761,10 @@ The `radio-button-choice' Widget TYPE ::= (radio-button-choice [KEYWORD ARGUMENT]... TYPE ... ) - The TYPE argument represents each possible choice. The widget's -value will be that of the chosen TYPE argument. This widget will match -any value matching at least one of the specified TYPE arguments. + The TYPE arguments represents each possible choice. The widgets +value of will be the value of the chosen TYPE argument. This widget +will match any value that matches at least one of the specified TYPE +arguments. The following extra properties are recognized. @@ -801,7 +800,7 @@ any value matching at least one of the specified TYPE arguments. widget after it has been created with the function `widget-radio-add-item'. - - Function: widget-radio-add-item widget type + - Function: widget-radio-add-item WIDGET TYPE Add to `radio-button-choice' widget WIDGET a new radio button item of type TYPE. @@ -849,8 +848,8 @@ The `toggle' Widget TYPE ::= (toggle [KEYWORD ARGUMENT]...) - The widget has two possible states, `on' and `off', which correspond -to a `t' or `nil' value respectively. + The widget has two possible states, `on' and `off', which +corresponds to a `t' or `nil' value. The following extra properties are recognized. @@ -891,10 +890,10 @@ The `checklist' Widget TYPE ::= (checklist [KEYWORD ARGUMENT]... TYPE ... ) - The TYPE arguments represents each checklist item. The widget's -value will be a list containing the values of all ticked TYPE -arguments. The checklist widget will match a list whose elements all -match at least one of the specified TYPE arguments. + The TYPE arguments represents each checklist item. The widgets +value of will be a list containing the value of each ticked TYPE +argument. The checklist widget will match a list whose elements all +matches at least one of the specified TYPE arguments. The following extra properties are recognized. @@ -911,11 +910,11 @@ match at least one of the specified TYPE arguments. Insert a literal `%'. `: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 `: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. `button-args' A list of keywords to pass to the checkboxes. Useful for setting @@ -1171,11 +1170,11 @@ files, you can use the following widget specification: t)' or `(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. +certainly 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. - Widget: choice - Allows you to edit a sexp which may have one of a fixed set of + Allows you to edit a sexp which may have one of fixed set of types. It is currently implemented with the `choice-menu' basic widget, and has a similar syntax. @@ -1199,15 +1198,15 @@ Properties You can examine or set the value of a widget by using the widget object that was returned by `widget-create'. - - Function: widget-value widget + - Function: widget-value WIDGET Return the current value contained in WIDGET. It is an error to call this function on an uninitialized widget. - - Function: widget-value-set widget value + - Function: widget-value-set WIDGET VALUE Set the value contained in WIDGET to VALUE. It is an error to call this function with an invalid VALUE. - *Important:* You _must_ call `widget-setup' after modifying the + *Important:* You *must* call `widget-setup' after modifying the value of a widget before the user is allowed to edit the widget again. It is enough to call `widget-setup' once if you modify multiple widgets. This is currently only necessary if the widget contains an @@ -1218,22 +1217,22 @@ widget objects, for example a reference to the item being edited, it can be done with `widget-put' and `widget-get'. The property names must begin with a `:'. - - Function: widget-put widget property value + - Function: widget-put WIDGET PROPERTY VALUE In WIDGET set PROPERTY to VALUE. PROPERTY should be a symbol, while VALUE can be anything. - - Function: widget-get widget property + - Function: widget-get WIDGET PROPERTY In WIDGET return the value for PROPERTY. PROPERTY should be a symbol, the value is what was last set by `widget-put' for PROPERTY. - - Function: widget-member widget property + - Function: widget-member WIDGET PROPERTY Non-nil if WIDGET has a value (even nil) for property PROPERTY. Occasionally it can be useful to know which kind of widget you have, i.e. the name of the widget type you gave when the widget was created. - - Function: widget-type widget + - Function: widget-type WIDGET Return the name of WIDGET, a symbol. Widgets can be in two states: active, which means they are @@ -1252,9 +1251,9 @@ following code: ;; Make WIDGET active. (widget-apply WIDGET :activate) - 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 `:parent' link) have been deactivated. To make sure a -widget is really active, you must therefore activate both itself and +widget is really active, you must therefore activate both itself, and all its ancestors. (while widget @@ -1262,11 +1261,11 @@ all its ancestors. (setq widget (widget-get widget :parent))) You can check if a widget has been made inactive by examining the -value of the `:inactive' keyword. If this is non-nil, the widget itself -has been deactivated. This is different from using the `:active' -keyword, in that the latter tells you if the widget *or* any of its -ancestors have been deactivated. Do not attempt to set the `:inactive' -keyword directly. Use the `:activate' `:deactivate' keywords instead. +value of `:inactive' keyword. If this is non-nil, the widget itself has +been deactivated. This is different from using the `:active' keyword, +in that the later tell you if the widget *or* any of its ancestors have +been deactivated. Do not attempt to set the `:inactive' keyword +directly. Use the `:activate' `:deactivated' keywords instead.  File: widget.info, Node: Defining New Widgets, Next: Widget Browser, Prev: Widget Properties, Up: Top @@ -1275,11 +1274,11 @@ Defining New Widgets ==================== You can define specialized widgets with `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 +you to create a shorthand for more complex widgets, including specifying +component widgets and default new default values for the keyword arguments. - - Function: widget-define name class doc &rest args + - Function: widget-define NAME CLASS DOC &rest ARGS Define a new widget type named NAME from `class'. NAME and class should both be symbols, `class' should be one of @@ -1287,7 +1286,7 @@ arguments. The third argument 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: * (widget-create NAME) @@ -1295,9 +1294,9 @@ arguments. * (apply widget-create CLASS ARGS) - Using `widget-define' just stores the definition of the widget type -in the `widget-type' property of NAME, which is what `widget-create' -uses. + Using `widget-define' does just store the definition of the widget +type in the `widget-type' property of NAME, which is what +`widget-create' uses. If you just want to specify defaults for keywords with no complex conversions, you can use `identity' as your conversion function. @@ -1308,20 +1307,20 @@ new widgets: 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 + called for the widget type and all the widgets parent types, most derived first. The following predefined functions can be used here: - - Function: widget-types-convert-widget widget + - Function: widget-types-convert-widget WIDGET Convert `:args' as widget types in WIDGET. - - Function: widget-value-convert-widget widget + - Function: widget-value-convert-widget WIDGET Initialize `:value' from `:args' in WIDGET. `: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 + takes two arguments, a widget and an external value, and returns the internal value. The function is called on the present `:value' when the widget is created, and on any value set later with `widget-value-set'. @@ -1335,8 +1334,8 @@ new widgets: `: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. `:delete' Function to delete a widget. The function takes one argument, a @@ -1344,18 +1343,18 @@ new widgets: `:value-create' Function to expand the `%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. `:value-delete' - Should remove the representation of the widget's value from the + 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. + delete nested widgets if such has been used. The following predefined function can be used here: - - Function: widget-children-value-delete widget + - Function: widget-children-value-delete WIDGET Delete all `:children' and `:buttons' in WIDGET. `:value-get' @@ -1364,7 +1363,7 @@ new widgets: The following predefined function can be used here: - - Function: widget-value-value-get widget + - Function: widget-value-value-get WIDGET Return the `:value' property of WIDGET. `:format-handler' @@ -1374,8 +1373,8 @@ new widgets: non-standard escapes. You should end up calling `widget-default-format-handler' to handle - unknown escape sequences. It will handle the `%h' and any future - escape sequences as well as give an error for unknown escapes. + unknown escape sequences, which will handle the `%h' and any future + escape sequences, as well as give an error for unknown escapes. `:action' Function to handle user initiated events. By default, `:notify' @@ -1383,7 +1382,7 @@ new widgets: The following predefined function can be used here: - - Function: widget-parent-action widget &optional event + - Function: widget-parent-action WIDGET &optional EVENT Tell `:parent' of WIDGET to handle the `:action'. Optional EVENT is the event that triggered the action. @@ -1392,9 +1391,9 @@ new widgets: should take four arguments, WIDGET, PROMPT, VALUE, and UNBOUND and should return a value for widget entered by the user. PROMPT is the prompt to use. VALUE is the default value to use, unless - UNBOUND is non-nil. In this case there is no default value. The + 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. + this widget, and does not have to check that it matches. If you want to define a new widget from scratch, use the `default' widget as its base. @@ -1451,12 +1450,12 @@ File: widget.info, Node: Utilities, Next: Widget Wishlist, Prev: Widget Minor Utilities. ========== - - Function: widget-prompt-value widget prompt [ value unbound ] + - Function: widget-prompt-value WIDGET PROMPT [ VALUE UNBOUND ] Prompt for a value matching WIDGET, using PROMPT. The current value is assumed to be VALUE, unless UNBOUND is non-nil. - - Function: widget-get-sibling widget + - Function: widget-get-sibling WIDGET Get the item WIDGET is assumed to toggle. This is only meaningful for radio buttons or checkboxes in a list. @@ -1515,40 +1514,39 @@ Wishlist symbol, it should pop up a menu. -  Tag Table: -Node: Top211 -Node: Introduction591 -Node: User Interface4075 -Node: Programming Example8970 -Node: Setting Up the Buffer13120 -Node: Basic Types14837 -Node: link20895 -Node: url-link21409 -Node: info-link21721 -Node: push-button22012 -Node: editable-field22585 -Node: text24068 -Node: menu-choice24366 -Node: radio-button-choice25219 -Node: item26786 -Node: choice-item27174 -Node: toggle27672 -Node: checkbox28409 -Node: checklist28715 -Node: editable-list30159 -Node: group31341 -Node: Sexp Types31628 -Node: constants31941 -Node: generic33020 -Node: atoms33553 -Node: composite35500 -Node: Widget Properties37970 -Node: Defining New Widgets41035 -Node: Widget Browser46335 -Node: Widget Minor Mode47193 -Node: Utilities47750 -Node: Widget Wishlist48231 +Node: Top227 +Node: Introduction607 +Node: User Interface4090 +Node: Programming Example8985 +Node: Setting Up the Buffer12302 +Node: Basic Types14019 +Node: link20064 +Node: url-link20578 +Node: info-link20890 +Node: push-button21181 +Node: editable-field21754 +Node: text23093 +Node: menu-choice23391 +Node: radio-button-choice24256 +Node: item25835 +Node: choice-item26223 +Node: toggle26721 +Node: checkbox27446 +Node: checklist27752 +Node: editable-list29196 +Node: group30378 +Node: Sexp Types30665 +Node: constants30978 +Node: generic32057 +Node: atoms32590 +Node: composite34537 +Node: Widget Properties37003 +Node: Defining New Widgets40066 +Node: Widget Browser45366 +Node: Widget Minor Mode46224 +Node: Utilities46781 +Node: Widget Wishlist47262  End Tag Table diff --git a/info/xemacs-faq.info b/info/xemacs-faq.info index 96e328c..cf12847 100644 --- a/info/xemacs-faq.info +++ b/info/xemacs-faq.info @@ -1,268 +1,248 @@ -This is ../info/xemacs-faq.info, produced by makeinfo version 4.0 from -xemacs-faq.texi. +This is Info file ../info/xemacs-faq.info, produced by Makeinfo version +1.68 from the input file xemacs-faq.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY -* FAQ: (xemacs-faq). XEmacs FAQ. +* FAQ: (xemacs-faq). XEmacs FAQ. END-INFO-DIR-ENTRY  Indirect: -xemacs-faq.info-1: 205 -xemacs-faq.info-2: 50095 -xemacs-faq.info-3: 99803 -xemacs-faq.info-4: 149685 -xemacs-faq.info-5: 199368 +xemacs-faq.info-1: 221 +xemacs-faq.info-2: 48809 +xemacs-faq.info-3: 95901 +xemacs-faq.info-4: 145739 +xemacs-faq.info-5: 195532  Tag Table: (Indirect) -Node: Top205 -Node: Introduction16756 -Node: Q1.0.120222 -Node: Q1.0.221123 -Node: Q1.0.321668 -Node: Q1.0.421930 -Node: Q1.0.523322 -Node: Q1.0.624011 -Node: Q1.0.725014 -Node: Q1.0.825262 -Node: Q1.0.925477 -Node: Q1.0.1025755 -Node: Q1.0.1125998 -Node: Q1.0.1226385 -Node: Q1.0.1326753 -Node: Q1.0.1427002 -Node: Q1.1.127514 -Node: Q1.1.228556 -Node: Q1.1.328949 -Node: Q1.2.129900 -Node: Q1.2.231056 -Node: Q1.2.331490 -Node: Q1.3.132574 -Node: Q1.3.233225 -Node: Q1.3.333689 -Node: Q1.3.433930 -Node: Q1.3.534703 -Node: Q1.3.637108 -Node: Q1.3.738639 -Node: Q1.4.139574 -Node: Q1.4.241325 -Node: Q1.4.341696 -Node: Q1.4.442115 -Node: Q1.4.543655 -Node: Q1.4.643959 -Node: Installation44952 -Node: Q2.0.147527 -Node: Q2.0.248327 -Node: Q2.0.350095 -Node: Q2.0.451393 -Node: Q2.0.551985 -Node: Q2.0.652333 -Node: Q2.0.752714 -Node: Q2.0.853095 -Node: Q2.0.954672 -Node: Q2.0.1056110 -Node: Q2.0.1156954 -Node: Q2.0.1257895 -Node: Q2.0.1359419 -Node: Q2.0.1459908 -Node: Q2.1.160966 -Node: Q2.1.263687 -Node: Q2.1.364917 -Node: Q2.1.466210 -Node: Q2.1.567009 -Node: Q2.1.667371 -Node: Q2.1.767848 -Node: Q2.1.868201 -Node: Q2.1.969735 -Node: Q2.1.1070176 -Node: Q2.1.1170933 -Node: Q2.1.1271798 -Node: Q2.1.1372753 -Node: Q2.1.1473784 -Node: Q2.1.1574895 -Node: Q2.1.1681845 -Node: Q2.1.1782539 -Node: Q2.1.1883136 -Node: Q2.1.1983263 -Node: Q2.1.2083802 -Node: Q2.1.2184184 -Node: Q2.1.2284377 -Node: Q2.1.2385674 -Node: Q2.1.2486342 -Node: Q2.1.2586814 -Node: Customization87449 -Node: Q3.0.192303 -Node: Q3.0.293099 -Node: Q3.0.393534 -Node: Q3.0.493961 -Node: Q3.0.594794 -Node: Q3.0.695575 -Node: Q3.0.796155 -Node: Q3.0.896738 -Node: Q3.0.997696 -Node: Q3.1.198257 -Node: Q3.1.298994 -Node: Q3.1.399425 -Node: Q3.1.499614 -Node: Q3.1.599803 -Node: Q3.1.6100197 -Node: Q3.1.7100916 -Node: Q3.1.8103140 -Node: Q3.2.1103682 -Node: Q3.2.2105365 -Node: Q3.2.3106164 -Node: Q3.2.4106776 -Node: Q3.2.5107481 -Node: Q3.2.6107948 -Node: Q3.3.1108873 -Node: Q3.3.2109132 -Node: Q3.3.3109795 -Node: Q3.3.4110186 -Node: Q3.3.5110980 -Node: Q3.4.1112461 -Node: Q3.4.2113038 -Node: Q3.5.1113433 -Node: Q3.5.2114882 -Node: Q3.5.3115310 -Node: Q3.5.4116148 -Node: Q3.5.5116750 -Node: Q3.5.6117901 -Node: Q3.5.7118885 -Node: Q3.5.8120289 -Node: Q3.5.9120534 -Node: Q3.5.10121325 -Node: Q3.5.11121961 -Node: Q3.6.1122514 -Node: Q3.6.2123270 -Node: Q3.6.3123709 -Node: Q3.7.1124128 -Node: Q3.7.2125016 -Node: Q3.7.3125675 -Node: Q3.7.4126097 -Node: Q3.7.5126440 -Node: Q3.7.6126908 -Node: Q3.7.7127644 -Node: Q3.7.8128675 -Node: Q3.8.1129094 -Node: Q3.8.2129390 -Node: Q3.8.3129863 -Node: Q3.8.4130490 -Node: Q3.8.5131209 -Node: Q3.9.1131994 -Node: Q3.9.2132793 -Node: Q3.9.3133391 -Node: Q3.9.4134053 -Node: Q3.10.1134766 -Node: Q3.10.2135605 -Node: Q3.10.3136620 -Node: Q3.10.4137358 -Node: Q3.10.5137741 -Node: Subsystems138793 -Node: Q4.0.1141280 -Node: Q4.0.2141805 -Node: Q4.0.3142363 -Node: Q4.0.4142684 -Node: Q4.0.5142926 -Node: Q4.0.6143157 -Node: Q4.0.7143745 -Node: Q4.0.8144070 -Node: Q4.0.9145297 -Node: Q4.0.10147335 -Node: Q4.0.11147824 -Node: Q4.0.12148702 -Node: Q4.1.1149685 -Node: Q4.1.2150088 -Node: Q4.1.3150415 -Node: Q4.2.1150724 -Node: Q4.2.2151354 -Node: Q4.2.3151594 -Node: Q4.2.4152138 -Node: Q4.3.1152791 -Node: Q4.3.2153375 -Node: Q4.3.3154856 -Node: Q4.3.4155128 -Node: Q4.3.5155805 -Node: Q4.4.1156433 -Node: Q4.4.2157919 -Node: Q4.5.1159123 -Node: Q4.6.1159892 -Node: Q4.7.1165152 -Node: Q4.7.2166107 -Node: Q4.7.3166404 -Node: Q4.7.4166590 -Node: Q4.7.5167474 -Node: Q4.7.6169115 -Node: Miscellaneous169404 -Node: Q5.0.1172823 -Node: Q5.0.2173558 -Node: Q5.0.3174422 -Node: Q5.0.4174833 -Node: Q5.0.5176124 -Node: Q5.0.6178114 -Node: Q5.0.7178771 -Node: Q5.0.8179376 -Node: Q5.0.9179905 -Node: Q5.0.10180439 -Node: Q5.0.11180687 -Node: Q5.0.12180936 -Node: Q5.0.13181863 -Node: Q5.0.14182557 -Node: Q5.0.15183322 -Node: Q5.0.16183619 -Node: Q5.0.17184141 -Node: Q5.0.18184461 -Node: Q5.0.19184655 -Node: Q5.0.20185079 -Node: Q5.1.1185994 -Node: Q5.1.2188063 -Node: Q5.1.3188799 -Node: Q5.1.4192193 -Node: Q5.1.5192728 -Node: Q5.1.6194852 -Node: Q5.1.7196338 -Node: Q5.1.8197931 -Node: Q5.1.9198483 -Node: Q5.1.10199368 -Node: Q5.1.11200499 -Node: Q5.2.1201046 -Node: Q5.2.2201637 -Node: Q5.2.3201981 -Node: Q5.2.4202216 -Node: Q5.3.1203126 -Node: Q5.3.2204357 -Node: Q5.3.3204602 -Node: Q5.3.4205086 -Node: Q5.3.5205763 -Node: Q5.3.6206632 -Node: Q5.3.7206877 -Node: Q5.3.8209067 -Node: Q5.3.9209314 -Node: Q5.3.10210267 -Node: Q5.3.11212351 -Node: Q5.3.12213942 -Node: MS Windows215216 -Node: Q6.0.1216712 -Node: Q6.0.2217467 -Node: Q6.0.3217997 -Node: Q6.0.4218264 -Node: Q6.1.1220417 -Node: Q6.1.2221288 -Node: Q6.1.3221743 -Node: Q6.1.4222025 -Node: Q6.1.5222403 -Node: Q6.1.6223283 -Node: Q6.2.1225589 -Node: Q6.2.2226490 -Node: Q6.2.3226902 -Node: Q6.3.1227443 -Node: Q6.3.2228758 -Node: Q6.3.3231939 -Node: Q6.4.1232441 -Node: Current Events233776 -Node: Q7.0.1234430 -Node: Q7.0.2235069 -Node: Q7.0.3236142 -Node: Q7.0.4236370 +Node: Top221 +Node: Introduction15614 +Node: Q1.0.119134 +Node: Q1.0.219670 +Node: Q1.0.320106 +Node: Q1.0.420364 +Node: Q1.0.521796 +Node: Q1.0.622485 +Node: Q1.0.723616 +Node: Q1.0.824015 +Node: Q1.0.924211 +Node: Q1.0.1024489 +Node: Q1.0.1125938 +Node: Q1.0.1226395 +Node: Q1.0.1326763 +Node: Q1.0.1426998 +Node: Q1.1.127542 +Node: Q1.1.228737 +Node: Q1.1.329112 +Node: Q1.2.130060 +Node: Q1.2.231120 +Node: Q1.2.331550 +Node: Q1.3.132501 +Node: Q1.3.236419 +Node: Q1.3.337128 +Node: Q1.3.437370 +Node: Q1.3.538134 +Node: Q1.3.640549 +Node: Q1.3.742044 +Node: Q1.4.142979 +Node: Q1.4.243849 +Node: Q1.4.344190 +Node: Q1.4.444832 +Node: Q1.4.546372 +Node: Q1.4.646676 +Node: Q1.4.747684 +Node: Installation48809 +Node: Q2.0.151217 +Node: Q2.0.252090 +Node: Q2.0.359300 +Node: Q2.0.460598 +Node: Q2.0.561187 +Node: Q2.0.661555 +Node: Q2.0.761936 +Node: Q2.0.862317 +Node: Q2.0.963892 +Node: Q2.0.1065330 +Node: Q2.0.1166174 +Node: Q2.0.1267115 +Node: Q2.0.1368638 +Node: Q2.0.1469296 +Node: Q2.1.169864 +Node: Q2.1.272606 +Node: Q2.1.373783 +Node: Q2.1.475076 +Node: Q2.1.575875 +Node: Q2.1.676237 +Node: Q2.1.776714 +Node: Q2.1.877067 +Node: Q2.1.978583 +Node: Q2.1.1079005 +Node: Q2.1.1179762 +Node: Q2.1.1280627 +Node: Q2.1.1381582 +Node: Q2.1.1482613 +Node: Q2.1.1583721 +Node: Q2.1.1689678 +Node: Q2.1.1790356 +Node: Q2.1.1890953 +Node: Q2.1.1992750 +Node: Q2.1.2093280 +Node: Q2.1.2193662 +Node: Q2.1.2293952 +Node: Q2.1.2395249 +Node: Customization95901 +Node: Q3.0.1100795 +Node: Q3.0.2101501 +Node: Q3.0.3102065 +Node: Q3.0.4102482 +Node: Q3.0.5103315 +Node: Q3.0.6104096 +Node: Q3.0.7104676 +Node: Q3.0.8105340 +Node: Q3.0.9106186 +Node: Q3.1.1106747 +Node: Q3.1.2107484 +Node: Q3.1.3107915 +Node: Q3.1.4108500 +Node: Q3.1.5109036 +Node: Q3.1.6109420 +Node: Q3.1.7110101 +Node: Q3.1.8112325 +Node: Q3.2.1112864 +Node: Q3.2.2114272 +Node: Q3.2.3115071 +Node: Q3.2.4115673 +Node: Q3.2.5116707 +Node: Q3.2.6117174 +Node: Q3.3.1118136 +Node: Q3.3.2118529 +Node: Q3.3.3119160 +Node: Q3.3.4119541 +Node: Q3.3.5120635 +Node: Q3.4.1122129 +Node: Q3.4.2122772 +Node: Q3.5.1123284 +Node: Q3.5.2124739 +Node: Q3.5.3125157 +Node: Q3.5.4125998 +Node: Q3.5.5126830 +Node: Q3.5.6127970 +Node: Q3.5.7128960 +Node: Q3.5.8130312 +Node: Q3.5.9131059 +Node: Q3.5.10131839 +Node: Q3.5.11132472 +Node: Q3.6.1133025 +Node: Q3.6.2133765 +Node: Q3.6.3134193 +Node: Q3.7.1134693 +Node: Q3.7.2135581 +Node: Q3.7.3136240 +Node: Q3.7.4136662 +Node: Q3.7.5137005 +Node: Q3.7.6137473 +Node: Q3.7.7138188 +Node: Q3.7.8139208 +Node: Q3.8.1139627 +Node: Q3.8.2140087 +Node: Q3.8.3140550 +Node: Q3.8.4141156 +Node: Q3.8.5141875 +Node: Q3.9.1142660 +Node: Q3.9.2143600 +Node: Q3.9.3144198 +Node: Q3.9.4144860 +Node: Q3.10.1145739 +Node: Q3.10.2146557 +Node: Q3.10.3147338 +Node: Q3.10.4148066 +Node: Q3.10.5148449 +Node: Subsystems149459 +Node: Q4.0.1151874 +Node: Q4.0.2152399 +Node: Q4.0.3152957 +Node: Q4.0.4153278 +Node: Q4.0.5153520 +Node: Q4.0.6153751 +Node: Q4.0.7154329 +Node: Q4.0.8154654 +Node: Q4.0.9155881 +Node: Q4.0.10157919 +Node: Q4.0.11158373 +Node: Q4.0.12159223 +Node: Q4.1.1160196 +Node: Q4.1.2160599 +Node: Q4.1.3160926 +Node: Q4.2.1161235 +Node: Q4.2.2161865 +Node: Q4.2.3162105 +Node: Q4.2.4162649 +Node: Q4.3.1163302 +Node: Q4.3.2163886 +Node: Q4.3.3165602 +Node: Q4.3.4165871 +Node: Q4.3.5166560 +Node: Q4.4.1167188 +Node: Q4.5.1168695 +Node: Q4.6.1169464 +Node: Q4.7.1174724 +Node: Q4.7.2175679 +Node: Q4.7.3175976 +Node: Q4.7.4176322 +Node: Q4.7.5177206 +Node: Q4.7.6178848 +Node: Miscellaneous179397 +Node: Q5.0.1182823 +Node: Q5.0.2183557 +Node: Q5.0.3184411 +Node: Q5.0.4185113 +Node: Q5.0.5186053 +Node: Q5.0.6188033 +Node: Q5.0.7188690 +Node: Q5.0.8189295 +Node: Q5.0.9189814 +Node: Q5.0.10190328 +Node: Q5.0.11190576 +Node: Q5.0.12191137 +Node: Q5.0.13192054 +Node: Q5.0.14192738 +Node: Q5.0.15193503 +Node: Q5.0.16193804 +Node: Q5.0.17194316 +Node: Q5.0.18194581 +Node: Q5.0.19195107 +Node: Q5.0.20195532 +Node: Q5.1.1196447 +Node: Q5.1.2198516 +Node: Q5.1.3199252 +Node: Q5.1.4202646 +Node: Q5.1.5203181 +Node: Q5.1.6205275 +Node: Q5.1.7206664 +Node: Q5.1.8208265 +Node: Q5.1.9208817 +Node: Q5.1.10209702 +Node: Q5.1.11210833 +Node: Q5.2.1211379 +Node: Q5.2.2211950 +Node: Q5.2.3212367 +Node: Q5.2.4212602 +Node: Q5.3.1213512 +Node: Q5.3.2214733 +Node: Q5.3.3215509 +Node: Q5.3.4215993 +Node: Q5.3.5216660 +Node: Q5.3.6217529 +Node: Q5.3.7217774 +Node: Q5.3.8219964 +Node: Q5.3.9220211 +Node: Q5.3.10221164 +Node: Q5.3.11223359 +Node: Q5.3.12224908 +Node: Current Events226182 +Node: Q6.0.1226839 +Node: Q6.0.2227478 +Node: Q6.0.3228552 +Node: Q6.0.4228780  End Tag Table diff --git a/info/xemacs-faq.info-1 b/info/xemacs-faq.info-1 index 1e6f304..4b06ab8 100644 --- a/info/xemacs-faq.info-1 +++ b/info/xemacs-faq.info-1 @@ -1,9 +1,9 @@ -This is ../info/xemacs-faq.info, produced by makeinfo version 4.0 from -xemacs-faq.texi. +This is Info file ../info/xemacs-faq.info, produced by Makeinfo version +1.68 from the input file xemacs-faq.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY -* FAQ: (xemacs-faq). XEmacs FAQ. +* FAQ: (xemacs-faq). XEmacs FAQ. END-INFO-DIR-ENTRY  @@ -17,14 +17,20 @@ Introduction This is the guide to the XEmacs Frequently Asked Questions list--a compendium of questions and answers pertaining to one of the finest -programs ever written. XEmacs is much more than just a Text Editor. +programs ever written. It is much more than just a Text Editor. - This FAQ is freely redistributable. This FAQ is distributed in the -hope that it will be useful, but WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + This FAQ is freely redistributable. I take no liability for the +correctness and safety of any procedures or advice given here. This +FAQ is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. If you have a Web browser, the official hypertext version is at -`http://www.xemacs.org/faq/xemacs-faq.html' +`http://www.xemacs.org/faq/xemacs-faq.html'. + + This version is somewhat nicer than the unofficial hypertext versions +that are archived at Utrecht, Oxford, Smart Pages, and other FAQ +archives. * Menu: @@ -33,11 +39,10 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * Customization:: Customization and Options. * Subsystems:: Major Subsystems. * Miscellaneous:: The Miscellaneous Stuff. -* MS Windows:: XEmacs on Microsoft Windows. * Current Events:: What the Future Holds. - --- The Detailed Node Listing --- + -- The Detailed Node Listing -- Introduction, Policy, Credits @@ -47,7 +52,7 @@ Introduction, Policy, Credits * Q1.0.4:: Why Another Version of Emacs? * Q1.0.5:: Why Haven't XEmacs and GNU Emacs Merged? * Q1.0.6:: Where can I get help? -* Q1.0.7:: Where are the mailing lists archived? +* Q1.0.7:: Where is the mailing list archived? * Q1.0.8:: How do you pronounce XEmacs? * Q1.0.9:: What does XEmacs look like? * Q1.0.10:: Is there a port of XEmacs to Microsoft ('95 or NT)? @@ -67,21 +72,22 @@ Credits: * Q1.2.3:: Who contributed to the FAQ in the past? Internationalization: -* Q1.3.1:: What is the status of internationalization support aka MULE (including Asian language support? -* Q1.3.2:: How can I help with internationalization? +* Q1.3.1:: What is the status of XEmacs v20? +* Q1.3.2:: What is the status of Asian-language support, aka MULE? * Q1.3.3:: How do I type non-ASCII characters? * Q1.3.4:: Can XEmacs messages come out in a different language? -* Q1.3.5:: Please explain the various input methods in MULE/XEmacs -* Q1.3.6:: How do I portably code for MULE/XEmacs? +* Q1.3.5:: Please explain the various input methods in MULE/XEmacs 20.0 +* Q1.3.6:: How do I portably code for MULE/XEmacs 20.0? * Q1.3.7:: How about Cyrillic Modes? Getting Started: -* Q1.4.1:: What is an `init.el' or `.emacs' and is there a sample one? -* Q1.4.2:: Can I use the same `init.el'/`.emacs' with the other Emacs? +* Q1.4.1:: What is a `.emacs' and is there a sample one? +* Q1.4.2:: Can I use the same `.emacs' with the other Emacs? * Q1.4.3:: Any good XEmacs tutorials around? * 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 @@ -97,8 +103,8 @@ Installation and Trouble Shooting * Q2.0.10:: After I run configure I find a coredump, is something wrong? * Q2.0.11:: XEmacs can't resolve host names. * Q2.0.12:: Why can't I strip XEmacs? -* Q2.0.13:: I don't need no steenkin' packages. Do I? (NEW) -* Q2.0.14:: How do I figure out which packages to install? (NEW) +* Q2.0.13:: 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! @@ -114,18 +120,16 @@ Trouble Shooting: * Q2.1.11:: Can't instantiate image error... in toolbar * Q2.1.12:: Regular Expression Problems on DEC OSF1. * Q2.1.13:: HP/UX 10.10 and `create_process' failure -* Q2.1.14:: C-g doesn't work for me. Is it broken? +* Q2.1.14:: `C-g' doesn't work for me. Is it broken? * Q2.1.15:: How to debug an XEmacs problem with a debugger. * Q2.1.16:: XEmacs crashes in `strcat' on HP/UX 10. * Q2.1.17:: `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:: `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) -* Q2.1.25:: After upgrading, XEmacs won't do `foo' any more! (NEW) Customization and Options @@ -142,15 +146,15 @@ Customization and Options 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:: `(set-screen-width)' worked in 19.6, but not in 19.13? +* Q3.1.4:: Specifying `Emacs*EmacsScreen.geometry' in `.emacs' does not work in 19.15? * Q3.1.5:: How can I get the icon to just say `XEmacs'? * Q3.1.6:: How can I have the window title area display the full path? * Q3.1.7:: `xemacs -name junk' doesn't work? * Q3.1.8:: `-iconic' doesn't work. Textual Fonts & Colors: -* Q3.2.1:: How can I set color options from `init.el'/`.emacs'? +* Q3.2.1:: How can I set color options from `.emacs'? * Q3.2.2:: How do I set the text, menu and modeline fonts? * Q3.2.3:: How can I set the colors when highlighting a region? * Q3.2.4:: How can I limit color map usage? @@ -172,11 +176,11 @@ The Keyboard: * Q3.5.1:: How can I bind complex functions (or macros) to keys? * Q3.5.2:: How can I stop down-arrow from adding empty lines to the bottom of my buffers? * Q3.5.3:: How do I bind C-. and C-; to scroll one line up and down? -* Q3.5.4:: Globally binding Delete? +* Q3.5.4:: Globally binding `Delete'? * Q3.5.5:: Scrolling one line at a time. -* Q3.5.6:: How to map Help key alone on Sun type4 keyboard? +* Q3.5.6:: How to map `Help' key alone on Sun type4 keyboard? * Q3.5.7:: How can you type in special characters in XEmacs? -* Q3.5.8:: [This question intentionally left blank] +* Q3.5.8:: Why does `(global-set-key [delete-forward] 'delete-char)' complain? * Q3.5.9:: How do I make the Delete key delete forward? * Q3.5.10:: Can I turn on "sticky" modifier keys? * Q3.5.11:: How do I map the arrow keys? @@ -194,7 +198,7 @@ The Mouse and Highlighting: * Q3.7.5:: Why does cut-and-paste not work between XEmacs and a cmdtool? * Q3.7.6:: How I can set XEmacs up so that it pastes where the text cursor is? * Q3.7.7:: How do I select a rectangular region? -* Q3.7.8:: Why does M-w take so long? +* Q3.7.8:: Why does `M-w' take so long? The Menubar and Toolbar: * Q3.8.1:: How do I get rid of the menu (or menubar)? @@ -207,13 +211,13 @@ Scrollbars: * Q3.9.1:: How can I disable the scrollbar? * Q3.9.2:: How can one use resources to change scrollbar colors? * Q3.9.3:: Moving the scrollbar can move the point; can I disable this? -* Q3.9.4:: How can I turn off automatic horizontal scrolling in specific modes? +* Q3.9.4:: How can I get automatic horizontal scrolling? Text Selections: * Q3.10.1:: How can I turn off or change highlighted selections? * Q3.10.2:: How do I get that typing on an active region removes it? * Q3.10.3:: Can I turn off the highlight during isearch? -* Q3.10.4:: How do I turn off highlighting after C-x C-p (mark-page)? +* Q3.10.4:: How do I turn off highlighting after `C-x C-p' (mark-page)? * Q3.10.5:: The region disappears when I hit the end of buffer while scrolling. Major Subsystems @@ -251,7 +255,6 @@ Other Mail & News: 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? @@ -262,7 +265,7 @@ Infodock: 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? @@ -272,21 +275,21 @@ The Miscellaneous Stuff * Q5.0.1:: How can I do source code highlighting using font-lock? * Q5.0.2:: I do not like cc-mode. How do I use the old c-mode? * Q5.0.3:: How do I get `More' Syntax Highlighting on by default? -* Q5.0.4:: How can I enable auto-indent and/or Filladapt? +* Q5.0.4:: How can I enable auto-indent? * Q5.0.5:: How can I get XEmacs to come up in text/auto-fill mode by default? * Q5.0.6:: How do I start up a second shell buffer? * Q5.0.7:: Telnet from shell filters too much. * 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:: [This question intentionally left blank] +* 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? @@ -297,7 +300,7 @@ Emacs Lisp Programming Techniques: * Q5.1.4:: What is the performance hit of `let'? * Q5.1.5:: What is the recommended use of `setq'? * Q5.1.6:: What is the typical misuse of `setq' ? -* Q5.1.7:: I like the `do' form of cl, does it slow things down? +* Q5.1.7:: I like the the `do' form of cl, does it slow things down? * Q5.1.8:: I like recursion, does it slow things down? * Q5.1.9:: How do I put a glyph as annotation in a buffer? * Q5.1.10:: `map-extents' won't traverse all of my extents! @@ -311,9 +314,9 @@ Sound: Miscellaneous: * Q5.3.1:: How do you make XEmacs indent CL if-clauses correctly? -* Q5.3.2:: [This question intentionally left blank] +* Q5.3.2:: Fontifying hangs when editing a postscript file. * Q5.3.3:: How can I print WYSIWYG a font-locked buffer? -* Q5.3.4:: Getting M-x lpr to work with postscript printer. +* Q5.3.4:: Getting `M-x lpr' to work with postscript printer. * Q5.3.5:: How do I specify the paths that XEmacs uses for finding files? * Q5.3.6:: [This question intentionally left blank] * Q5.3.7:: Can I have the end of the buffer delimited in some way? @@ -323,41 +326,12 @@ Miscellaneous: * 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 binaries available? -* Q6.0.4:: Can I build XEmacs on MS Windows with support for X or Cygwin? - -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 `init.el'/`.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) +What the Future Holds -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. +* 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.  File: xemacs-faq.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top @@ -372,22 +346,24 @@ considering XEmacs for their own use, or has just obtained it and is wondering what to do next. It is also useful as a reference to available resources. - The previous maintainer of the FAQ was Anthony Rossini -, who started it, after getting tired -of hearing JWZ complain about repeatedly having to answer questions. -Ben Wing and 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 maintainer of the FAQ was Anthony Rossini , who started it, after getting tired of hearing JWZ complain +about repeatedly having to answer questions. Ben Wing +and 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 -Steven L. Baur . It was converted back to texinfo by -Hrvoje Niksic . The FAQ was then maintained by -Andreas Kaempf , who passed it on to ChristianNyb/o. +Steven L. Baur . It was converted back to +texinfo by Hrvoje Niksic . + + The FAQ was then maintained by Andreas Kaempf , +who passed it on to Christian Nybo/ , the current FAQ +maintainer. If you notice any errors or items which should be added or amended to -this FAQ please send email to Sandra Wambold . Include +this FAQ please send email to Christian Nybo/ . Include `XEmacs FAQ' on the Subject: line. * Menu: @@ -399,7 +375,7 @@ Introduction: * Q1.0.4:: Why Another Version of Emacs? * Q1.0.5:: Why Haven't XEmacs and GNU Emacs Merged? * Q1.0.6:: Where can I get help? -* Q1.0.7:: Where are the mailing lists archived? +* Q1.0.7:: Where is the mailing list archived? * Q1.0.8:: How do you pronounce XEmacs? * Q1.0.9:: What does XEmacs look like? * Q1.0.10:: Is there a port of XEmacs to Microsoft ('95 or NT)? @@ -419,21 +395,22 @@ Credits: * Q1.2.3:: Who contributed to the FAQ in the past? Internationalization: -* Q1.3.1:: What is the status of internationalization support aka MULE (including Asian language support? -* Q1.3.2:: How can I help with internationalization? +* Q1.3.1:: What is the status of XEmacs v20? +* Q1.3.2:: What is the status of Asian-language support, aka MULE? * Q1.3.3:: How do I type non-ASCII characters? * Q1.3.4:: Can XEmacs messages come out in a different language? -* Q1.3.5:: Please explain the various input methods in MULE/XEmacs -* Q1.3.6:: How do I portably code for MULE/XEmacs? +* Q1.3.5:: Please explain the various input methods in MULE/XEmacs 20.0 +* Q1.3.6:: How do I portably code for MULE/XEmacs 20.0? * Q1.3.7:: How about Cyrillic Modes? Getting Started: -* Q1.4.1:: What is an `init.el' or `.emacs' and is there a sample one? -* Q1.4.2:: Can I use the same `init.el'/`.emacs' with the other Emacs? +* Q1.4.1:: What is a `.emacs' and is there a sample one? +* Q1.4.2:: Can I use the same `.emacs' with the other Emacs? * Q1.4.3:: Any good XEmacs tutorials around? * 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?  File: xemacs-faq.info, Node: Q1.0.1, Next: Q1.0.2, Prev: Introduction, Up: Introduction @@ -444,17 +421,12 @@ File: xemacs-faq.info, Node: Q1.0.1, Next: Q1.0.2, Prev: Introduction, Up: I Q1.0.1: What is XEmacs? ----------------------- - XEmacs is a highly customizable open source text editor and -application development system. It is protected under the GNU Public -License and related to other versions of Emacs, in particular GNU -Emacs. Its emphasis is on modern graphical user interface support and -an open software development model, similar to Linux. XEmacs has an -active development community numbering in the hundreds, and runs on -Windows 95 and NT, Linux and nearly every other version of Unix in -existence. Support for XEmacs has been supplied by Sun Microsystems, -University of Illinois, Lucid, ETL/Electrotechnical Laboratory, Amdahl -Corporation, BeOpen, and others, as well as the unpaid time of a great -number of individual developers. + An alternative to GNU Emacs, originally based on an early alpha +version of FSF's version 19, and has diverged quite a bit since then. +XEmacs was known as Lucid Emacs through version 19.10. Almost all +features of GNU Emacs are supported in XEmacs. The maintainers of +XEmacs actively track changes to GNU Emacs while also working to add +new features.  File: xemacs-faq.info, Node: Q1.0.2, Next: Q1.0.3, Prev: Q1.0.1, Up: Introduction @@ -462,10 +434,8 @@ File: xemacs-faq.info, Node: Q1.0.2, Next: Q1.0.3, Prev: Q1.0.1, Up: Introdu Q1.0.2: What is the current version of XEmacs? ---------------------------------------------- - XEmacs versions 21.1.* are releases made from the current stable -sources. XEmacs versions 21.2.* are releases made from the development -sources. Check at `http://www.xemacs.org' for the current minor -version. + XEmacs 20.4 is a minor upgrade from 20.3, containing many bugfixes. +It was released in February 1998. XEmacs 19.16 was the last release of v19, released in November, 1997, which was also the last version without international language support. @@ -476,7 +446,7 @@ File: xemacs-faq.info, Node: Q1.0.3, Next: Q1.0.4, Prev: Q1.0.2, Up: Introdu 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: `ftp://ftp.xemacs.org/pub/xemacs/' @@ -488,7 +458,7 @@ Q1.0.4: Why Another Version of Emacs? For a detailed description of the differences between GNU Emacs and XEmacs and a detailed history of XEmacs, check out the - NEWS file (http://www.xemacs.org/About/XEmacsVsGNUemacs.html) + NEWS file (http://www.xemacs.org/NEWS.html) However, here is a list of some of the reasons why we think you might consider using it: @@ -498,7 +468,7 @@ consider using it: * The XEmacs maintainers are generally more receptive to suggestions than the GNU Emacs maintainers. - * Many more bundled packages than GNU Emacs. + * Many more bundled packages than GNU Emacs * Binaries are available for many common operating systems. @@ -509,7 +479,7 @@ consider using it: * Better Motif compliance. * Some internationalization support (including full MULE support, if - compiled with it). + compiled with it.) * Variable-width fonts. @@ -531,6 +501,7 @@ consider using it: * Completely compatible (at the C level) with the Xt-based toolkits. + * First production Web Browser supporting Style Sheets.  File: xemacs-faq.info, Node: Q1.0.5, Next: Q1.0.6, Prev: Q1.0.4, Up: Introduction @@ -555,30 +526,40 @@ Q1.0.6: Where can I get help? ----------------------------- Probably the easiest way, if everything is installed, is to use -Info, by pressing `C-h i', or looking for an Info item on the Help -Menu. `M-x apropos' can be used to look for particular commands. +info, by pressing `C-h i', or selecting `Manuals->Info' from the Help +Menu. + + Also, `M-x apropos' will look for commands for you. - For items not found in the manual, try reading this FAQ and reading -the Usenet group comp.emacs.xemacs. + Try reading this FAQ, examining the regular GNU Emacs FAQ (which can +be found with the Emacs 19 distribution) as well as at +`http://www.eecs.nwu.edu/emacs/faq/' and reading the Usenet group +comp.emacs.xemacs. - If you choose to post to a newsgroup, *please use -comp.emacs.xemacs*. Please do not post XEmacs related questions to + If that does not help, try posting your question to +comp.emacs.xemacs. Please *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 with `subscribe' in the body of -the message. Send to the list at . list. To -cancel a subscription, you *must* use the xemacs-request address. Send -a message with a subject of `unsubscribe' to be removed. +message with a subject of `subscribe' to +for subscription information and to send messages +to the list. + + To cancel a subscription, you *must* use the xemacs-request address. +Send a message with a subject of `unsubscribe' to be removed.  File: xemacs-faq.info, Node: Q1.0.7, Next: Q1.0.8, Prev: Q1.0.6, Up: Introduction -Q1.0.7: Where are the mailing lists archived? ---------------------------------------------- +Q1.0.7: Where is the mailing list archived? +------------------------------------------- - The archives can be found at `http://list-archive.xemacs.org' + The mailing list was archived in the directory + `ftp://ftp.xemacs.org/pub/mlists/'. + + However, this archive is out of date. The current mailing list +server supports an `archive' feature, which may be utilized.  File: xemacs-faq.info, Node: Q1.0.8, Next: Q1.0.9, Prev: Q1.0.7, Up: Introduction @@ -586,7 +567,7 @@ File: xemacs-faq.info, Node: Q1.0.8, Next: Q1.0.9, Prev: Q1.0.7, Up: Introdu Q1.0.8: How do you pronounce XEmacs? ------------------------------------ - The most common pronounciation is `Eks eemax'. + I pronounce it `Eks eemax'.  File: xemacs-faq.info, Node: Q1.0.9, Next: Q1.0.10, Prev: Q1.0.8, Up: Introduction @@ -603,7 +584,30 @@ File: xemacs-faq.info, Node: Q1.0.10, Next: Q1.0.11, Prev: Q1.0.9, Up: Intro Q1.0.10: Is there a port of XEmacs to Microsoft ('95 or NT)? ------------------------------------------------------------ - Yes, *Note MS Windows::. + Thanks to efforts of many people, coordinated by David Hobley and 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 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 +. + + If you are willing to contribute or want to follow the progress, +mail to 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 the Altrasoft web site (http://www.altrasoft.com/) for more details or contact Altrasoft directly at 1-888-ALTSOFT. + + The closest existing port is "Win-Emacs", which is based on Lucid +Emacs 19.6. Available from `http://www.pearlsoft.com/'. + + There's a port of GNU Emacs (not XEmacs) at + `http://www.cs.washington.edu/homes/voelker/ntemacs.html'.  File: xemacs-faq.info, Node: Q1.0.11, Next: Q1.0.12, Prev: Q1.0.10, Up: Introduction @@ -611,9 +615,12 @@ File: xemacs-faq.info, Node: Q1.0.11, Next: Q1.0.12, Prev: Q1.0.10, Up: Intr Q1.0.11: Is there a port of XEmacs to the Macintosh? ---------------------------------------------------- - Yes, there is a port of XEmacs 19.14, tested on MacOS 7.6.1 and MacOS -8.5.1 by Pitts Jarvis . It's available at -`http://homepage.mac.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 +Emacs 18.59 (ftp://ftp.cs.cornell.edu/pub/parmet/).  File: xemacs-faq.info, Node: Q1.0.12, Next: Q1.0.13, Prev: Q1.0.11, Up: Introduction @@ -631,19 +638,21 @@ File: xemacs-faq.info, Node: Q1.0.13, Next: Q1.0.14, Prev: Q1.0.12, Up: Intr Q1.0.13: Is there a port of XEmacs to OS/2? ------------------------------------------- - No, but Alexander Nikolaev is working on it. + No, and there is no news of anyone working on it.  File: xemacs-faq.info, Node: Q1.0.14, Next: Q1.1.1, Prev: Q1.0.13, Up: Introduction -Q1.0.14: Where can I obtain a printed copy of the XEmacs User's Manual? ------------------------------------------------------------------------ +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. + 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. - HTML and Postscript versions of XEmacs manuals may be available from -the XEmacs web site in the future. Send requests to . + Web: `http://www.xemacs.com' + E-mail: + Tel: +1 408 243 3300  File: xemacs-faq.info, Node: Q1.1.1, Next: Q1.1.2, Prev: Q1.0.14, Up: Introduction @@ -655,19 +664,24 @@ 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 XEmacs FAQ -maintainers . +should be up to date. + + Changes are displayed on a monthly basis. "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 Christian Nybo/ . Please make sure that `XEmacs FAQ' appears on the Subject: line. If you think you have a better way of answering a question, or think a -question should be included, we'd like to hear about it. Questions and -answers included into the FAQ will be edited for spelling and grammar +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 -previous FAQ maintainers. Answers quoted from Usenet news articles will -always be attributed, regardless of the author. +either from versions of the FAQ dated before May 1996, or are from one +of the four people listed at the top of this document. Answers quoted +from Usenet news articles will always be attributed, regardless of the +author.  File: xemacs-faq.info, Node: Q1.1.2, Next: Q1.1.3, Prev: Q1.1.1, Up: Introduction @@ -675,8 +689,8 @@ File: xemacs-faq.info, Node: Q1.1.2, Next: Q1.1.3, Prev: Q1.1.1, Up: Introdu Q1.1.2: How do I become a Beta Tester? -------------------------------------- - Send an email message to with the -line `subscribe' in the body of the message. + Send an email message to with a +subject line of `subscribe'. Be prepared to get your hands dirty, as beta testers are expected to identify problems as best they can. @@ -687,7 +701,7 @@ File: xemacs-faq.info, Node: Q1.1.3, Next: Q1.2.1, Prev: Q1.1.2, Up: Introdu Q1.1.3: How do I contribute to XEmacs itself? --------------------------------------------- - Ben Wing writes: + Ben Wing writes: BTW if you have a wish list of things that you want added, you have to speak up about it! More specifically, you can do the @@ -720,36 +734,30 @@ Q1.2.1: Who wrote XEmacs? ------------------------- XEmacs is the result of the time and effort of many people. The -developers responsible for recent releases are: +developers responsible for the 19.16/20.x releases are: * Martin Buchholz - * Steven Turnbull - - * Ben Wing - - * Hrvoje Niksic + * Steve Baur + * Hrvoje Niksic - The developers responsible for older releases were: - - * Steve Baur + The developers responsible for the 19.14 release are: * Chuck Thompson - * Jamie Zawinski - - * Richard Mlynarik + Chuck was Mr. XEmacs from 19.11 through 19.14, and is responsible + for XEmacs becoming a widely distributed program over the Internet. - Steve Baur was the primary maintainer for 19.15 through 21.0. + * Ben Wing - Chuck Thompson and Ben Wing were the maintainers for 19.11 through - 19.14 and heavy code contributors for 19.8 through 19.10. + * Jamie Zawinski - Jamie Zawinski was the maintainer for 19.0 through 19.10 (the - entire history of Lucid Emacs). Richard Mlynarik was a heavy code - contributor to 19.6 through 19.8. + Jamie Zawinski was Mr. Lucid Emacs from 19.0 through 19.10, the + last release actually named Lucid Emacs. Richard Mlynarik was + crucial to most of those releases. + * Richard Mlynarik Along with many other contributors, partially enumerated in the `About XEmacs' option in the Help menu. @@ -765,11 +773,10 @@ this version of the FAQ (listed in alphabetical order): * SL Baur - * Hrvoje Niksic + * Hrvoje Niksic * Aki Vehtari -  File: xemacs-faq.info, Node: Q1.2.3, Next: Q1.3.1, Prev: Q1.2.2, Up: Introduction @@ -781,20 +788,14 @@ crash some time ago. * Curtis.N.Bingham - * Georges Brun-Cottan - * Richard Caley * Richard Cognot - * Mark Daku - * William G. Dubuque * Eric Eide - * Alain Fauconnet - * Chris Flatters * Evelyn Ginsparg @@ -823,25 +824,92 @@ File: xemacs-faq.info, Node: Q1.3.1, Next: Q1.3.2, Prev: Q1.2.3, Up: Introdu 1.3: Internationalization ========================= -Q1.3.1: What is the status of internationalization support aka MULE (including Asian language support? ------------------------------------------------------------------------------------------------------- +Q1.3.1: What is the status of XEmacs v20? +----------------------------------------- - Both the stable and development versions of XEmacs include -internationalization support (aka MULE). MULE currently works on UNIX -and Linux systems; work for supporting MULE on Windows operating systems -is in progress. Binaries compiled without MULE support run faster than -MULE capable XEmacsen. + XEmacs v20 is the version of XEmacs that includes MULE +(Asian-language) support. XEmacs 20.0 was released in February 1997, +followed by XEmacs 20.2 in May, XEmacs 20.3 in November and XEmacs 20.4 +in February 1998. When compiled without MULE support, 20.4 is +approximately as stable as 19.16, and probably faster (due to +additional optimization work.) + + As of XEmacs 20.3, version 20 is *the* supported version of XEmacs. +This means that 19.16 will optionally receive stability fixes (if any), +but that all the real development work will be done on the v20 tree. + + The incompatible changes in XEmacs 20 include the additional +byte-codes, new primitive data types (`character', `char-table', and +`range-table'). This means that the character-integer equivalence +inherent to all the previous Emacs and XEmacs releases no longer +applies. + + However, to avoid breaking old code, many functions that should +normally accept characters work with integers, and vice versa. For more +information, see the Lisp reference manual. Here is a relevant excerpt, +for your convenience. + + In XEmacs version 19, and in all versions of FSF GNU Emacs, a + "character" in XEmacs Lisp is nothing more than an integer. This + is yet another holdover from XEmacs Lisp's derivation from + vintage-1980 Lisps; modern versions of Lisp consider this + equivalence a bad idea, and have separate character types. In + XEmacs version 20, the modern convention is followed, and + characters are their own primitive types. (This change was + necessary in order for MULE, i.e. Asian-language, support to be + correctly implemented.) + + Even in XEmacs version 20, remnants of the equivalence between + characters and integers still exist; this is termed the "char-int + confoundance disease". In particular, many functions such as `eq', + `equal', and `memq' have equivalent functions (`old-eq', + `old-equal', `old-memq', etc.) that pretend like characters are + integers are the same. Byte code compiled under any version 19 + Emacs will have all such functions mapped to their `old-' + equivalents when the byte code is read into XEmacs 20. This is to + preserve compatibility - Emacs 19 converts all constant characters + to the equivalent integer during byte-compilation, and thus there + is no other way to preserve byte-code compatibility even if the + code has specifically been written with the distinction between + characters and integers in mind. + + Every character has an equivalent integer, called the "character + code". For example, the character `A' is represented as the + integer 65, following the standard ASCII representation of + characters. If XEmacs was not compiled with 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 *not* rely on this, + because it will not work under XEmacs with MULE support.) When + 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 ASCII characters in combination with certain + modifiers. XEmacs does not use this (a more general mechanism is + used that does not distinguish between ASCII keys and other keys), + so you will never find character codes above 255 in a non-MULE + XEmacs. + + Individual characters are not often used in programs. It is far + more common to work with *strings*, which are sequences composed of + characters.  File: xemacs-faq.info, Node: Q1.3.2, Next: Q1.3.3, Prev: Q1.3.1, Up: Introduction -Q1.3.2: How can I help with internationalization? -------------------------------------------------- +Q1.3.2: What is the status of Asian-language support, aka MULE? +--------------------------------------------------------------- + + 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. - If you would like to help, you may want to join the - 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. + 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 +. *Note Q1.1.2::. @@ -851,7 +919,7 @@ File: xemacs-faq.info, Node: Q1.3.3, Next: Q1.3.4, Prev: Q1.3.2, Up: Introdu Q1.3.3: How do I type non-ASCII characters? ------------------------------------------- - See question 3.5.7 (*note Q3.5.7::) in part 3 of this FAQ. + See question 3.5.7 (*note Q3.5.7::.) in part 3 of this FAQ.  File: xemacs-faq.info, Node: Q1.3.4, Next: Q1.3.5, Prev: Q1.3.3, Up: Introduction @@ -860,13 +928,13 @@ Q1.3.4: Can XEmacs messages come out in a different language? ------------------------------------------------------------- The message-catalog support has mostly been written but doesn't -currently work. The first release of XEmacs 20 will _not_ support it. -However, menubar localization _does_ work. To enable it, add to your -`Emacs' file entries like this: +currently work. The first release of XEmacs 20 will *not* support it. +However, menubar localization *does* work, even in 19.14. To enable +it, add to your `Emacs' file entries like this: - 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 The name of the resource is derived from the non-localized entry by removing punctuation and capitalizing as above. @@ -874,8 +942,8 @@ removing punctuation and capitalizing as above.  File: xemacs-faq.info, Node: Q1.3.5, Next: Q1.3.6, Prev: Q1.3.4, Up: Introduction -Q1.3.5: Please explain the various input methods in MULE/XEmacs ---------------------------------------------------------------- +Q1.3.5: Please explain the various input methods in MULE/XEmacs 20.0 +-------------------------------------------------------------------- MORIOKA Tomohiko writes: @@ -924,8 +992,8 @@ Q1.3.5: Please explain the various input methods in MULE/XEmacs  File: xemacs-faq.info, Node: Q1.3.6, Next: Q1.3.7, Prev: Q1.3.5, Up: Introduction -Q1.3.6: How do I portably code for MULE/XEmacs? ------------------------------------------------ +Q1.3.6: How do I portably code for MULE/XEmacs 20? +-------------------------------------------------- MORIOKA Tomohiko writes: @@ -955,12 +1023,12 @@ Q1.3.6: How do I portably code for MULE/XEmacs? (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 ) @@ -997,44 +1065,28 @@ File: xemacs-faq.info, Node: Q1.4.1, Next: Q1.4.2, Prev: Q1.3.7, Up: Introdu 1.4: Getting Started, Backing up & Recovery =========================================== -Q1.4.1: What is an `init.el' or `.emacs' and is there a sample one? -------------------------------------------------------------------- - - The `init.el' or `.emacs' file is used to customize XEmacs to your -tastes. Starting in 21.4, the preferred location for the init file is -`~/.xemacs/init.el'; in previous versions, it was `~/.emacs'. 21.4 -still accepts the old location, but the first time you run it, it will -ask to migrate your file to the new location. If you answer yes, the -file will be moved, and a "compatibility" `.emacs' file will be placed -in the old location so that you can still run older versions of XEmacs, -and versions of GNU Emacs, which expect the old location. The `.emacs' -file present is just a stub that loads the real file in -`~/.xemacs/init.el'. - - No two init files are alike, nor are they expected to be alike, but -that's the point. The XEmacs distribution contains an excellent starter -example in the `etc/' directory called `sample.init.el' (starting in -21.4) or `sample.emacs' in older versions. Copy this file from there -to `~/.xemacs/init.el' (starting in 21.4) or `~/.emacs' in older -versions, where `~' means your home directory, of course. Then edit it -to suit. - - You may bring the `sample.init.el' or `sample.emacs' file into an -XEmacs buffer from the menubar. (The menu entry for it is always under -the `Help' menu, but its location under that has changed in various -versions. Recently, look under the `Samples' submenu.) To determine -the location of the `etc/' directory type the command `C-h v -data-directory '. +Q1.4.1: What is a `.emacs' and is there a sample one? +----------------------------------------------------- + + The `.emacs' file is used to customize XEmacs to your tastes. No +two are alike, nor are they expected to be alike, but that's the point. +The XEmacs distribution contains an excellent starter example in the etc +directory called `sample.emacs'. Copy this file from there to your +home directory and rename it `.emacs'. Then edit it to suit. + + Starting with 19.14, you may bring the `sample.emacs' into an XEmacs +buffer by selecting `Help->Samples->Sample .emacs' from the menubar. +To determine the location of the `etc' directory type the command `C-h +v data-directory '.  File: xemacs-faq.info, Node: Q1.4.2, Next: Q1.4.3, Prev: Q1.4.1, Up: Introduction -Q1.4.2: Can I use the same `init.el'/`.emacs' with the other Emacs? -------------------------------------------------------------------- +Q1.4.2: Can I use the same `.emacs' with the other Emacs? +--------------------------------------------------------- - Yes. The sample `init.el'/`.emacs' included in the XEmacs -distribution will show you how to handle different versions and flavors -of Emacs. + Yes. The sample `.emacs' included in the XEmacs distribution will +show you how to handle different versions and flavors of Emacs.  File: xemacs-faq.info, Node: Q1.4.3, Next: Q1.4.4, Prev: Q1.4.2, Up: Introduction @@ -1047,6 +1099,13 @@ Q1.4.3: Any good tutorials around? available in a non-english language, type `C-u C-h t TAB', type the first letters of your preferred language, then type . + There's an Emacs Lisp tutorial at + + `ftp://prep.ai.mit.edu/pub/gnu/emacs-lisp-intro-1.04.tar.gz'. + + Erik Sundermann has made a tutorial web page +at `http://petaxp.rug.ac.be/~erik/xemacs/'. +  File: xemacs-faq.info, Node: Q1.4.4, Next: Q1.4.5, Prev: Q1.4.3, Up: Introduction @@ -1096,7 +1155,7 @@ Q1.4.5: And how do I bind it to a key? Or interactively, `M-x global-set-key' and follow the prompts.  -File: xemacs-faq.info, Node: Q1.4.6, Prev: Q1.4.5, Up: Introduction +File: xemacs-faq.info, Node: Q1.4.6, Next: Q1.4.7, Prev: Q1.4.5, Up: Introduction Q1.4.6: What's the difference between a macro and a function? ------------------------------------------------------------- @@ -1119,120 +1178,32 @@ another matter, entirely. A keyboard macro is a key bound to several other keys. Refer to manual for details.  -File: xemacs-faq.info, Node: Installation, Next: Customization, Prev: Introduction, Up: Top - -2 Installation and Trouble Shooting -*********************************** - - This is part 2 of the XEmacs Frequently Asked Questions list. This -section is devoted to Installation, Maintenance and Trouble Shooting. - -* Menu: - -Installation: -* Q2.0.1:: Running XEmacs without installing. -* Q2.0.2:: XEmacs is too big. -* Q2.0.3:: Compiling XEmacs with Netaudio. -* Q2.0.4:: Problems with Linux and ncurses. -* Q2.0.5:: Do I need X11 to run XEmacs? -* Q2.0.6:: I'm having strange crashes. What do I do? -* Q2.0.7:: Libraries in non-standard locations. -* Q2.0.8:: can't resolve symbol _h_errno -* Q2.0.9:: Where do I find external libraries? -* Q2.0.10:: After I run configure I find a coredump, is something wrong? -* Q2.0.11:: XEmacs can't resolve host names. -* Q2.0.12:: Why can't I strip XEmacs? -* Q2.0.13:: I don't need no steenkin' packages. Do I? (NEW) -* Q2.0.14:: I don't want to install a million .els one at a time! (NEW) - -Trouble Shooting: -* Q2.1.1:: XEmacs just crashed on me! -* Q2.1.2:: Cryptic Minibuffer messages. -* Q2.1.3:: Translation Table Syntax messages at Startup. -* Q2.1.4:: Startup warnings about deducing proper fonts? -* Q2.1.5:: XEmacs cannot connect to my X Terminal. -* Q2.1.6:: XEmacs just locked up my Linux X server. -* Q2.1.7:: HP Alt key as Meta. -* Q2.1.8:: got (wrong-type-argument color-instance-p nil)! -* Q2.1.9:: XEmacs causes my OpenWindows 3.0 server to crash. -* Q2.1.10:: Warnings from incorrect key modifiers. -* Q2.1.11:: Can't instantiate image error... in toolbar -* Q2.1.12:: Regular Expression Problems on DEC OSF1. -* Q2.1.13:: HP/UX 10.10 and `create_process' failure -* Q2.1.14:: C-g doesn't work for me. Is it broken? -* Q2.1.15:: How to debug an XEmacs problem with a debugger. -* Q2.1.16:: XEmacs crashes in `strcat' on HP/UX 10. -* Q2.1.17:: `Marker does not point anywhere'. -* Q2.1.18:: [This question intentionally left blank] -* Q2.1.19:: XEmacs does not follow the local timezone. -* Q2.1.20:: `Symbol's function definition is void: hkey-help-show.' -* Q2.1.21:: [This question intentionally left blank] -* Q2.1.22:: XEmacs seems to take a really long time to do some things. -* Q2.1.23:: Movemail on Linux does not work for XEmacs 19.15 and later. -* Q2.1.24:: XEmacs won't start without network. (NEW) -* Q2.1.25:: After upgrading, XEmacs won't do `foo' any more! (NEW) - - -File: xemacs-faq.info, Node: Q2.0.1, Next: Q2.0.2, Prev: Installation, Up: Installation - -2.0: Installation -================= - -Q2.0.1: Running XEmacs without installing ------------------------------------------ - - How can I just try XEmacs without installing it? - - XEmacs will run in place without requiring installation and copying -of the Lisp directories, and without having to specify a special -build-time flag. It's the copying of the Lisp directories that -requires so much space. XEmacs is largely written in Lisp. - - A good method is to make a shell alias for xemacs: - - alias xemacs=/i/xemacs-20.2/src/xemacs - - (You will obviously use whatever directory you downloaded the source -tree to instead of `/i/xemacs-20.2'). - - This will let you run XEmacs without massive copying. - - -File: xemacs-faq.info, Node: Q2.0.2, Next: Q2.0.3, Prev: Q2.0.1, Up: Installation - -Q2.0.2: XEmacs is too big -------------------------- - - The space required by the installation directories can be reduced -dramatically if desired. Gzip all the .el files. Remove all the -packages you'll never want to use. Remove the TexInfo manuals. Remove -the Info (and use just hardcopy versions of the manual). Remove most -of the stuff in etc. Remove or gzip all the source code. Gzip or -remove the C source code. Configure it so that copies are not made of -the support lisp. - - These are all Emacs Lisp source code and bytecompiled object code. -You may safely gzip everything named *.el here. You may remove any -package you don't use. _Nothing bad will happen if you delete a package -that you do not use_. You must be sure you do not use it though, so be -conservative at first. - - Possible candidates for deletion include w3, games, hyperbole, mh-e, -hm-html-menus, vm, viper, oobr, gnus, etc. Ask yourself, _Do I ever -want to use this package?_ If the answer is no, then it is a candidate -for removal. - - First, gzip all the .el files. Then go about package by package and -start gzipping the .elc files. Then run XEmacs and do whatever it is -you normally do. If nothing bad happens, then delete the directory. Be -conservative about deleting directories, and it would be handy to have a -backup around in case you get too zealous. - - `prim', `modes', `packages', and `utils' are four directories you -definitely do *not* want to delete, although certain packages can be -removed from them if you do not use them. - - Online texinfo sources in the `info' can either be compressed them -or remove them. In either case, `C-h i' (info mode) will no longer -work. +File: xemacs-faq.info, Node: Q1.4.7, Prev: Q1.4.6, Up: Introduction + +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: + + (add-spec-list-to-specifier (face-property 'searchm-field 'font) + '((global (nil)))) + + 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 `.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: + + (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))) + ... + )) diff --git a/info/xemacs-faq.info-2 b/info/xemacs-faq.info-2 index 256d1ad..5f5d1e5 100644 --- a/info/xemacs-faq.info-2 +++ b/info/xemacs-faq.info-2 @@ -1,12 +1,258 @@ -This is ../info/xemacs-faq.info, produced by makeinfo version 4.0 from -xemacs-faq.texi. +This is Info file ../info/xemacs-faq.info, produced by Makeinfo version +1.68 from the input file xemacs-faq.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY -* FAQ: (xemacs-faq). XEmacs FAQ. +* FAQ: (xemacs-faq). XEmacs FAQ. END-INFO-DIR-ENTRY  +File: xemacs-faq.info, Node: Installation, Next: Customization, Prev: Introduction, Up: Top + +2 Installation and Trouble Shooting +*********************************** + + This is part 2 of the XEmacs Frequently Asked Questions list. This +section is devoted to Installation, Maintenance and Trouble Shooting. + +* Menu: + +Installation: +* Q2.0.1:: Running XEmacs without installing. +* Q2.0.2:: XEmacs is too big. +* Q2.0.3:: Compiling XEmacs with Netaudio. +* Q2.0.4:: Problems with Linux and ncurses. +* Q2.0.5:: Do I need X11 to run XEmacs? +* Q2.0.6:: I'm having strange crashes. What do I do? +* Q2.0.7:: Libraries in non-standard locations. +* Q2.0.8:: can't resolve symbol _h_errno +* Q2.0.9:: Where do I find external libraries? +* 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! +* Q2.1.2:: Cryptic Minibuffer messages. +* Q2.1.3:: Translation Table Syntax messages at Startup. +* Q2.1.4:: Startup warnings about deducing proper fonts? +* Q2.1.5:: XEmacs cannot connect to my X Terminal. +* Q2.1.6:: XEmacs just locked up my Linux X server. +* Q2.1.7:: HP Alt key as Meta. +* Q2.1.8:: got (wrong-type-argument color-instance-p nil)! +* Q2.1.9:: XEmacs causes my OpenWindows 3.0 server to crash. +* Q2.1.10:: Warnings from incorrect key modifiers. +* Q2.1.11:: Can't instantiate image error... in toolbar +* Q2.1.12:: Regular Expression Problems on DEC OSF1. +* Q2.1.13:: HP/UX 10.10 and `create_process' failure +* Q2.1.14:: `C-g' doesn't work for me. Is it broken? +* Q2.1.15:: How to debug an XEmacs problem with a debugger. +* Q2.1.16:: XEmacs crashes in `strcat' on HP/UX 10. +* Q2.1.17:: `Marker does not point anywhere'. +* Q2.1.18:: 19.14 hangs on HP/UX 10.10. +* Q2.1.19:: XEmacs does not follow the local timezone. +* Q2.1.20:: `Symbol's function definition is void: hkey-help-show.' +* 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. + + +File: xemacs-faq.info, Node: Q2.0.1, Next: Q2.0.2, Prev: Installation, Up: Installation + +2.0: Installation +================= + +Q2.0.1: Running XEmacs without installing +----------------------------------------- + + The `INSTALL' file says that up to 108 MB of space is needed +temporarily during installation! How can I just try it out? + + XEmacs will run in place without requiring installation and copying +of the Lisp directories, and without having to specify a special +build-time flag. It's the copying of the Lisp directories that +requires so much space. XEmacs is largely written in Lisp. + + A good method is to make a shell alias for xemacs: + + alias xemacs=/i/xemacs-20.2/src/xemacs + + (You will obviously use whatever directory you downloaded the source +tree to instead of `/i/xemacs-20.2'). + + This will let you run XEmacs without massive copying. + + +File: xemacs-faq.info, Node: Q2.0.2, Next: Q2.0.3, Prev: Q2.0.1, Up: Installation + +Q2.0.2: XEmacs is too big +------------------------- + + Although this entry has been written for XEmacs 19.13, most of it +still stands true. + + Steve Baur writes: + + The 45MB of space required by the installation directories can be + reduced dramatically if desired. Gzip all the .el files. Remove + all the packages you'll never want to use (or even ones you do + like the two obsolete mailcrypts and Gnus 4 in 19.13). Remove the + TexInfo manuals. Remove the Info (and use just hardcopy versions + of the manual). Remove most of the stuff in etc. Remove or gzip + all the source code. Gzip or remove the C source code. Configure + it so that copies are not made of the support lisp. I'm not + advocating any of these things, just pointing out ways to reduce + the disk requirements if desired. + + Now examine the space used by directory: + + 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 + + You need to keep these. XEmacs isn't stripped by default in + installation, you should consider stripping. That will save you + about 5MB right there. + + 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 + + These are support directories for various packages. In general + they match a directory under + ./xemacs-19.13/lib/xemacs-19.13/lisp/. If you do not require the + package, you may delete or gzip the support too. + + 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 + + These are all Emacs Lisp source code and bytecompiled object code. + You may safely gzip everything named *.el here. You may remove + any package you don't use. *Nothing bad will happen if you delete + a package that you do not use*. You must be sure you do not use + it though, so be conservative at first. + + Possible candidates for deletion include w3 (newer versions exist, + or you may just use Lynx or Netscape for web browsing), games, + hyperbole, mh-e, hm-html-menus (better packages exist), vm, viper, + oobr, gnus (new versions exist), etc. Ask yourself, *Do I ever + want to use this package?* If the answer is no, then it is a + candidate for removal. + + First, gzip all the .el files. Then go about package by package + and start gzipping the .elc files. Then run XEmacs and do + whatever it is you normally do. If nothing bad happens, then + delete the directory. Be conservative about deleting directories, + and it would be handy to have a backup tape around in case you get + too zealous. + + `prim', `modes', `packages', and `utils' are four directories you + definitely do *not* want to delete, although certain packages can + be removed from them if you do not use them. + + 1972 /usr/local/lib/xemacs-19.13/info + + These are online texinfo sources. You may either gzip them or + remove them. In either case, `C-h i' (info mode) will no longer + work. + + 20778 /usr/local/lib/xemacs-19.13 + + The 20MB achieved is less than half of what the full distribution + takes up, *and* can be achieved without deleting a single file. + + Giacomo Boffi provides this procedure: + + Substitute `/usr/local/lib/' with the path where the xemacs tree is + rooted, then use this script: + + #!/bin/sh + + r=/usr/local/lib/xemacs-19.13/lisp + + cd $r ; rm -f cmpr ; touch cmpr + + du -s . + + for d in * ; do + if test -d $d ; then + cd $d + for f in *.el ; do + # compress (remove) only (ONLY) the sources that have a + # corresponding compiled file --- do not (DO NOT) + # touch other sources + if test -f ${f}c ; then gzip -v9 $f >> $r/cmpr ; fi + done + cd .. + fi + done + + du -s . + + A step beyond would be substituting `rm -f' for `gzip -v9', but + you have to be desperate for removing the sources (remember that + emacs can access compressed files transparently). + + Also, a good megabyte could easily be trimmed from the $r/../etc + directory, e.g., the termcap files, some O+NEWS, others that I + don't remember as well. + + XEmacs 21.0 will unbundle the lisp hierarchy and allow the + installer to choose exactly how much support code gets installed. + + File: xemacs-faq.info, Node: Q2.0.3, Next: Q2.0.4, Prev: Q2.0.2, Up: Installation Q2.0.3: Compiling XEmacs with Netaudio. @@ -49,7 +295,7 @@ libc 5.2.18, XEmacs 20.0b20 is unable to open a tty device: Initialization error: Terminal type `xterm' undefined (or can't access database?) - Ben Wing writes: + Ben Wing writes: Your ncurses configuration is messed up. Your /usr/lib/terminfo is a bad pointer, perhaps to a CD-ROM that is not inserted. @@ -61,8 +307,8 @@ Q2.0.5: Do I need X11 to run XEmacs? ------------------------------------ No. The name "XEmacs" is unfortunate in the sense that it is *not* -an X Window System-only version of Emacs. XEmacs has full color -support on a color-capable character terminal. +an X Window System-only version of Emacs. Starting with 19.14 XEmacs +has full color support on a color-capable character terminal.  File: xemacs-faq.info, Node: Q2.0.6, Next: Q2.0.7, Prev: Q2.0.5, Up: Installation @@ -102,17 +348,17 @@ ELF libraries are out of date. You have the following options: `_h_errno^@' with `h_errno^@^@'. Any version of Emacs will suffice. If you don't understand how to do this, don't do it. - 3. Rebuild XEmacs yourself--any working ELF version of libc should be + 3. Rebuild XEmacs yourself - any working ELF version of libc should be O.K. - Hrvoje Niksic writes: + Hrvoje Niksic writes: Why not use a Perl one-liner for No. 2? perl -pi -e 's/_h_errno\0/h_errno\0\0/g' \ /usr/local/bin/xemacs-19.14 - NB: You _must_ patch `/usr/local/bin/xemacs-19.14', and not + NB: You *must* patch `/usr/local/bin/xemacs-19.14', and not `xemacs' because `xemacs' is a link to `xemacs-19.14'; the Perl `-i' option will cause unwanted side-effects if applied to a symbolic link. @@ -163,8 +409,8 @@ PNG Compface `ftp://ftp.cs.indiana.edu/pub/faces/compface/'. This library has been frozen for about 6 years, and is distributed without version - numbers. _It should be compiled with the same options that X11 was - compiled with on your system_. The version of this library at + numbers. *It should be compiled with the same options that X11 was + compiled with on your system*. The version of this library at XEmacs.org includes the `xbm2xface.pl' script, written by , which may be useful when generating your own xface. @@ -235,7 +481,7 @@ Q2.0.12: Why can't I strip XEmacs? obviously heavily system dependent. And on some systems, it leads to an executable which, although valid, cannot be stripped without damage. If memory serves, this is especially the case for AIX - binaries. On other architectures it might work OK. + binaries. On other architecture it might work OK. The Right Way to strip the emacs binary is to strip temacs prior to dumping xemacs. This will always work, although you can do that @@ -262,44 +508,39 @@ Q2.0.12: Why can't I strip XEmacs?  File: xemacs-faq.info, Node: Q2.0.13, Next: Q2.0.14, Prev: Q2.0.12, Up: Installation -Q2.0.13: I don't need no steenkin' packages. Do I? (NEW) ---------------------------------------------------------- +Q2.0.13: Problems linking with Gcc on Solaris +--------------------------------------------- - Strictly speaking, 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_. + There are known difficulties linking with Gnu ld on Solaris. A +typical error message might look like: - -File: xemacs-faq.info, Node: Q2.0.14, Next: Q2.1.1, Prev: Q2.0.13, Up: Installation + unexec(): dlopen(../dynodump/dynodump.so): ld.so.1: ./temacs: + fatal: relocation error: + symbol not found: main: referenced in ../dynodump/dynodump.so -Q2.0.12: How do I figure out which packages to install? (NEW) -------------------------------------------------------------- + Martin Buchholz writes: - Many people really liked the old way that packages were bundled and -do not want to mess with packages at all. You can grab all the -packages at once like you used to with old XEmacs versions. Download -the file + You need to specify `-fno-gnu-linker' as part of your flags to pass + to ld. Future releases of XEmacs will try to do this + automatically. - `xemacs-sumo.tar.gz' - - For an XEmacs compiled with Mule you also need + +File: xemacs-faq.info, Node: Q2.0.14, Next: Q2.1.1, Prev: Q2.0.13, Up: Installation - `xemacs-mule-sumo.tar.gz' +Q2.0.14: Make on HP/UX 9 fails after linking temacs +--------------------------------------------------- - from the `packages' directory on your XEmacs mirror archive. N.B. -They are called 'Sumo Tarballs' for good reason. They are currently -about 15MB and 2.3MB (gzipped) respectively. + Problem when building xemacs-19.16 on hpux 9: - Install them by + Richard Cognot writes: - `cd $prefix/lib/xemacs ; gunzip -c | tar xf -' + make on hpux fails after linking temacs with a message: - See README.packages for more detailed installation instructions. + "make: don't know how to make .y." - As the Sumo tarballs are not regenerated as often as the individual -packages, it is recommended that you use the automatic package tools -afterwards to pick up any recent updates. + 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.  File: xemacs-faq.info, Node: Q2.1.1, Next: Q2.1.2, Prev: Q2.0.14, Up: Installation @@ -318,8 +559,8 @@ you try to edit those files, you will be informed that a more recent auto-save file exists. You can use `M-x recover-file' to retrieve the auto-saved version of the file. - You can use the command `M-x recover-session' after a crash to pick -up where you left off. + Starting with 19.14, you may use the command `M-x recover-session' +after a crash to pick up where you left off. Now, XEmacs is not perfect, and there may occasionally be times, or particular sequences of actions, that cause it to crash. If you can @@ -389,11 +630,10 @@ backtrace by doing the following: 3. Reproduce the error. - Depending on the version of XEmacs, you may either select View->Show -Message Log (recent versions), Edit->Show Messages (some earlier -versions) or Help->Recent Keystrokes/Messages (other earlier versions) -from the menubar to see the most recent messages. This command is bound -to `C-h l' by default. + Depending on the version of XEmacs, you may either select Edit->Show +Messages (19.13 and earlier) or Help->Recent Keystrokes/Messages (19.14 +and later) from the menubar to see the most recent messages. This +command is bound to `C-h l' by default.  File: xemacs-faq.info, Node: Q2.1.3, Next: Q2.1.4, Prev: Q2.1.2, Up: Installation @@ -508,10 +748,10 @@ Q2.1.8: got (wrong-type-argument color-instance-p nil) color backgrounds and foregrounds into your `.../app-defaults/Emacs' like: - *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. Natalie Kershaw adds: @@ -536,8 +776,7 @@ Q2.1.9: XEmacs causes my OpenWindows 3.0 server to crash. The OpenWindows 3.0 server is incredibly buggy. Your best bet is to replace it with one from the generic MIT X11 release. You might also -try disabling parts of your `init.el'/`.emacs', like those that enable -background pixmaps. +try disabling parts of your `.emacs', like enabling background pixmaps.  File: xemacs-faq.info, Node: Q2.1.10, Next: Q2.1.11, Prev: Q2.1.9, Up: Installation @@ -650,7 +889,7 @@ File: xemacs-faq.info, Node: Q2.1.14, Next: Q2.1.15, Prev: Q2.1.13, Up: Inst Q2.1.14: `C-g' doesn't work for me. Is it broken? -------------------------------------------------- - Ben Wing writes: + Ben Wing writes: `C-g' does work for most people in most circumstances. If it doesn't, there are only two explanations: @@ -666,7 +905,7 @@ Q2.1.14: `C-g' doesn't work for me. Is it broken? Morten Welinder writes: - On some (but _not_ all) machines a hung XEmacs can be revived by + On some (but *not* all) machines a hung XEmacs can be revived by `kill -FPE '. This is a hack, of course, not a solution. This technique works on a Sun4 running 4.1.3_U1. To see if it works for you, start another XEmacs and test with that first. If @@ -731,55 +970,17 @@ debugger. Here are some hints: you've got is a core dump, all is not lost. If you're using GDB, there are some macros in the 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: - - `pobj' - Usage: pobj lisp_object - Print the internal C representation of a lisp object. - - `xtype' - Usage: xtype lisp_object - Print the Lisp type of a lisp object. - - `lbt' - Usage: lbt - Print the current Lisp stack trace. Requires a running - xemacs process. - - `ldp' - Usage: ldp lisp_object - Print a Lisp Object value using the Lisp printer. Requires a - running xemacs process. - - `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. - - `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. - - `check-xemacs' - Usage: check-xemacs - Run the test suite. Equivalent to 'make check'. - - `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. + `src/gdbinit' in the XEmacs source distribution that should make it + easier for you to decode Lisp objects. Copy this file to + `~/.gdbinit', or `source' it from `~/.gdbinit', and use the macros + defined therein. In particular, use the `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 `ldp' and `lbt' + are provided for conveniently calling `debug_print' and + `debug_backtrace'. If you are using Sun's `dbx' debugger, there is an equivalent file - `src/.dbxrc', which defines the same commands for dbx. + `src/dbxrc' to copy to or source from `~/.dbxrc'. * If you're using a debugger to get a C stack backtrace and you're seeing stack traces with some of the innermost frames mangled, it @@ -818,18 +1019,19 @@ debugger. Here are some hints: authors, or to comp.os.linux.development.system). Again, you'll have to use the narrowing-down process described above. - d. You will get a Lisp backtrace output when XEmacs crashes, so - you'll have something useful. + d. If you compiled 19.14 with `--debug' (or by default in later + versions), you will get a Lisp backtrace output when XEmacs + crashes, so you'll have something useful. * 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. - - * In versions of XEmacs before 21.2.27, `src/.gdbinit' was named - `src/gdbinit'. This had the disadvantage of not being sourced - automatically by gdb, so you had to set that up yourself. + will also need gdb 4.17. Earlier releases of gdb can't handle the + debug information generated by the newer compilers. + * The above information on using `src/gdbinit' works for XEmacs-21.0 + and above. For older versions of XEmacs, there are different + `gdbinit' files provided in the `src' directory. Use the one + corresponding to the configure options used when building XEmacs.  File: xemacs-faq.info, Node: Q2.1.16, Next: Q2.1.17, Prev: Q2.1.15, Up: Installation @@ -837,8 +1039,8 @@ File: xemacs-faq.info, Node: Q2.1.16, Next: Q2.1.17, Prev: Q2.1.15, Up: Inst Q2.1.16: XEmacs crashes in `strcat' on HP/UX 10 ----------------------------------------------- - From the problems database (through the former address -http://support.mayfield.hp.com/): + >From the problems database (through +`http://support.mayfield.hp.com/'): Problem Report: 5003302299 Status: Open @@ -875,8 +1077,44 @@ reported (and fixed).  File: xemacs-faq.info, Node: Q2.1.18, Next: Q2.1.19, Prev: Q2.1.17, Up: Installation -Q2.1.18: removed ----------------- +Q2.1.18: 19.14 hangs on HP/UX 10.10. +------------------------------------ + + Richard Cognot writes: + + 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, `(while t)' was not + interrupted by `C-g'. I defined `BROKEN_SIGIO' and recompiled on + 10.10, and... the hang is now gone. + + As far as configure goes, this will be a bit tricky: `BROKEN_SIGIO' + is needed on 10.10, but *not* on 10.01: if I run my 10.01 binary + on a 10.01 machine, without `BROKEN_SIGIO' being defined, `C-g' + works as expected. + + Richard Cognot adds: + + Apparently somebody has found the reason why there is this `poll: + interrupted...' message for each event. For some reason, libcurses + reimplements a `select()' system call, in a highly broken fashion. + The fix is to add a -lc to the link line *before* the -lxcurses. + XEmacs will then use the right version of `select()'. + + Alain Fauconnet writes: + + The *real* solution is to *not* link -lcurses in! I just changed + -lcurses to -ltermcap in the Makefile and it fixed: + + 1. The `poll: interrupted system call' message. + + 2. 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 *hang*. Actually they would wait forever for + emacs to read the socket which connects stdout...  File: xemacs-faq.info, Node: Q2.1.19, Next: Q2.1.20, Prev: Q2.1.18, Up: Installation @@ -890,8 +1128,8 @@ under which it is running. The solution is to add: (set-time-zone-rule "MET") - to your `init.el'/`.emacs' or the `site-start.el' file if you can. -Replace `MET' with your local timezone. + to your `.emacs' or the `site-start.el' file if you can. Replace +`MET' with your local timezone.  File: xemacs-faq.info, Node: Q2.1.20, Next: Q2.1.21, Prev: Q2.1.19, Up: Installation @@ -908,8 +1146,11 @@ Q2.1.20: `Symbol's function definition is void: hkey-help-show.'  File: xemacs-faq.info, Node: Q2.1.21, Next: Q2.1.22, Prev: Q2.1.20, Up: Installation -Q2.1.21: [This question intentionally left blank] -------------------------------------------------- +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.  File: xemacs-faq.info, Node: Q2.1.22, Next: Q2.1.23, Prev: Q2.1.21, Up: Installation @@ -947,7 +1188,7 @@ Q2.1.22: XEmacs seems to take a really long time to do some things or in some other strange cases.  -File: xemacs-faq.info, Node: Q2.1.23, Next: Q2.1.24, Prev: Q2.1.22, Up: Installation +File: xemacs-faq.info, Node: Q2.1.23, Prev: Q2.1.22, Up: Installation Q2.1.23: Movemail on Linux does not work for XEmacs 19.15 and later. --------------------------------------------------------------------- @@ -964,345 +1205,3 @@ and 20.x. I am using Linux. #define MAIL_USE_FLOCK - -File: xemacs-faq.info, Node: Q2.1.24, Next: Q2.1.25, Prev: Q2.1.23, Up: Installation - -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 -`/etc/hosts' file. The file should contain an entry like: - - 127.0.0.1 localhost - - Add that line, and XEmacs will be happy. - - -File: xemacs-faq.info, Node: Q2.1.25, Prev: Q2.1.24, Up: Installation - -Q2.1.25:: After upgrading, XEmacs won't do `foo' any more! (NEW) ------------------------------------------------------------------ - - You have been used to doing `foo', but now when you invoke it (or -click the toolbar button or select the menu item), nothing (or an error) -happens. The simplest explanation is that you are missing a package -that is essential to you. You can either track it down and install it -(there is a list of packages and brief descriptions of their contents in -`etc/PACKAGES'), or install the `Sumo Tarball' (see *note Q2.0.14::). - - -File: xemacs-faq.info, Node: Customization, Next: Subsystems, Prev: Installation, Up: Top - -3 Customization and Options -*************************** - - This is part 3 of the XEmacs Frequently Asked Questions list. This -section is devoted to Customization and screen settings. - -* Menu: - -Customization---Emacs Lisp and `init.el'/`.emacs': -* Q3.0.1:: What version of Emacs am I running? -* Q3.0.2:: How do I evaluate Elisp expressions? -* Q3.0.3:: `(setq tab-width 6)' behaves oddly. -* Q3.0.4:: How can I add directories to the `load-path'? -* Q3.0.5:: How to check if a lisp function is defined? -* Q3.0.6:: Can I force the output of `(face-list)' to a buffer? -* Q3.0.7:: Font selections don't get saved after `Save Options'. -* Q3.0.8:: How do I make a single minibuffer frame? -* Q3.0.9:: What is `Customize'? - -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.5:: How can I get the icon to just say `XEmacs'? -* Q3.1.6:: How can I have the window title area display the full path? -* Q3.1.7:: `xemacs -name junk' doesn't work? -* Q3.1.8:: `-iconic' doesn't work. - -Textual Fonts & Colors: -* Q3.2.1:: How can I set color options from `init.el'/`.emacs'? -* Q3.2.2:: How do I set the text, menu and modeline fonts? -* Q3.2.3:: How can I set the colors when highlighting a region? -* Q3.2.4:: How can I limit color map usage? -* Q3.2.5:: My tty supports color, but XEmacs doesn't use them. -* Q3.2.6:: Can I have pixmap backgrounds in XEmacs? - -The Modeline: -* Q3.3.1:: How can I make the modeline go away? -* Q3.3.2:: How do you have XEmacs display the line number in the modeline? -* Q3.3.3:: How do I get XEmacs to put the time of day on the modeline? -* Q3.3.4:: How do I turn off current chapter from AUC TeX modeline? -* Q3.3.5:: How can one change the modeline color based on the mode used? - -3.4 Multiple Device Support: -* Q3.4.1:: How do I open a frame on another screen of my multi-headed display? -* Q3.4.2:: Can I really connect to a running XEmacs after calling up over a modem? How? - -3.5 The Keyboard: -* Q3.5.1:: How can I bind complex functions (or macros) to keys? -* Q3.5.2:: How can I stop down-arrow from adding empty lines to the bottom of my buffers? -* Q3.5.3:: How do I bind C-. and C-; to scroll one line up and down? -* Q3.5.4:: Globally binding Delete? -* Q3.5.5:: Scrolling one line at a time. -* Q3.5.6:: How to map Help key alone on Sun type4 keyboard? -* Q3.5.7:: How can you type in special characters in XEmacs? -* Q3.5.8:: [This question intentionally left blank] -* Q3.5.9:: How do I make the Delete key delete forward? -* Q3.5.10:: Can I turn on "sticky" modifier keys? -* Q3.5.11:: How do I map the arrow keys? - -The Cursor: -* Q3.6.1:: Is there a way to make the bar cursor thicker? -* Q3.6.2:: Is there a way to get back the old block cursor where the cursor covers the character in front of the point? -* Q3.6.3:: Can I make the cursor blink? - -The Mouse and Highlighting: -* Q3.7.1:: How can I turn off Mouse pasting? -* Q3.7.2:: How do I set control/meta/etc modifiers on mouse buttons? -* Q3.7.3:: Clicking the left button does not do anything in buffer list. -* Q3.7.4:: How can I get a list of buffers when I hit mouse button 3? -* Q3.7.5:: Why does cut-and-paste not work between XEmacs and a cmdtool? -* Q3.7.6:: How I can set XEmacs up so that it pastes where the text cursor is? -* Q3.7.7:: How do I select a rectangular region? -* Q3.7.8:: Why does M-w take so long? - -The Menubar and Toolbar: -* Q3.8.1:: How do I get rid of the menu (or menubar)? -* Q3.8.2:: Can I customize the basic menubar? -* Q3.8.3:: How do I control how many buffers are listed in the menu `Buffers' list? -* Q3.8.4:: Resources like `Emacs*menubar*font' are not working? -* Q3.8.5:: How can I bind a key to a function to toggle the toolbar? - -Scrollbars: -* Q3.9.1:: How can I disable the scrollbar? -* Q3.9.2:: How can one use resources to change scrollbar colors? -* Q3.9.3:: Moving the scrollbar can move the point; can I disable this? -* Q3.9.4:: How can I turn off automatic horizontal scrolling in specific modes? - -Text Selections: -* Q3.10.1:: How can I turn off or change highlighted selections? -* Q3.10.2:: How do I get that typing on an active region removes it? -* Q3.10.3:: Can I turn off the highlight during isearch? -* Q3.10.4:: How do I turn off highlighting after C-x C-p (mark-page)? -* Q3.10.5:: The region disappears when I hit the end of buffer while scrolling. - - -File: xemacs-faq.info, Node: Q3.0.1, Next: Q3.0.2, Prev: Customization, Up: Customization - -3.0: Customization - Emacs Lisp and `init.el'/`.emacs' -====================================================== - -Q3.0.1: What version of Emacs am I running? -------------------------------------------- - - How can `init.el'/`.emacs' determine which of the family of Emacsen -I am using? - - To determine if you are currently running GNU Emacs 18, GNU Emacs 19, -XEmacs 19, XEmacs 20, or Epoch, and use appropriate code, check out the -example given in `etc/sample.init.el' (`etc/sample.emacs' in XEmacs -versions prior to 21.4). There are other nifty things in there as well! - - For all new code, all you really need to do is: - - (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)) - - -File: xemacs-faq.info, Node: Q3.0.2, Next: Q3.0.3, Prev: Q3.0.1, Up: Customization - -Q3.0.2: How can I evaluate Emacs-Lisp expressions? --------------------------------------------------- - - I know I can evaluate Elisp expressions from `*scratch*' buffer with -`C-j' after the expression. How do I do it from another buffer? - - Press `M-:' (the default binding of `eval-expression'), and enter -the expression to the minibuffer. - - -File: xemacs-faq.info, Node: Q3.0.3, Next: Q3.0.4, Prev: Q3.0.2, Up: Customization - -Q3.0.3: `(setq tab-width 6)' behaves oddly. -------------------------------------------- - - If you put `(setq tab-width 6)' in your `init.el'/`.emacs' file it -does not work! Is there a reason for this? If you do it at the EVAL -prompt it works fine!! How strange. - - Use `setq-default' instead, since `tab-width' is all-buffer-local. - - -File: xemacs-faq.info, Node: Q3.0.4, Next: Q3.0.5, Prev: Q3.0.3, Up: Customization - -Q3.0.4: How can I add directories to the `load-path'? ------------------------------------------------------ - - Here are two ways to do that, one that puts your directories at the -front of the load-path, the other at the end: - - ;;; Add things at the beginning of the load-path, do not add - ;;; duplicate directories: - (pushnew "bar" load-path :test 'equal) - - (pushnew "foo" load-path :test 'equal) - - ;;; Add things at the end, unconditionally - (setq load-path (nconc load-path '("foo" "bar"))) - - keith (k.p.) hanlan writes: - - To add directories using Unix shell metacharacters use - `expand-file-name' like this: - - (push (expand-file-name "~keithh/.emacsdir") load-path) - - -File: xemacs-faq.info, Node: Q3.0.5, Next: Q3.0.6, Prev: Q3.0.4, Up: Customization - -Q3.0.5: How to check if a lisp function is defined? ---------------------------------------------------- - - Use the following elisp: - - (fboundp 'foo) - - It's almost always a mistake to test `emacs-version' or any similar -variables. - - Instead, use feature-tests, such as `featurep', `boundp', `fboundp', -or even simple behavioral tests, eg.: - - (defvar foo-old-losing-code-p - (condition-case nil (progn (losing-code t) nil) - (wrong-number-of-arguments t))) - - There is an incredible amount of broken code out there which could -work much better more often in more places if it did the above instead -of trying to divine its environment from the value of one variable. - - -File: xemacs-faq.info, Node: Q3.0.6, Next: Q3.0.7, Prev: Q3.0.5, Up: Customization - -Q3.0.6: Can I force the output of `(face-list)' to a buffer? ------------------------------------------------------------- - - It would be good having it in a buffer, as the output of -`(face-list)' is too wide to fit to a minibuffer. - - Evaluate the expression in the `*scratch*' buffer with point after -the rightmost paren and typing `C-j'. - - If the minibuffer smallness is the only problem you encounter, you -can simply press `C-h l' to get the former minibuffer contents in a -buffer. - - -File: xemacs-faq.info, Node: Q3.0.7, Next: Q3.0.8, Prev: Q3.0.6, Up: Customization - -Q3.0.7: Font selections in don't get saved after `Save Options'. ----------------------------------------------------------------- - - John Mann writes: - - You have to go to Options->Frame Appearance and unselect - `Frame-Local Font Menu'. If this option is selected, font changes - are only applied to the _current_ frame and do _not_ get saved - when you save options. - - Also, set the following in your `init.el'/`.emacs': - - (setq options-save-faces t) - - -File: xemacs-faq.info, Node: Q3.0.8, Next: Q3.0.9, Prev: Q3.0.7, Up: Customization - -Q3.0.8: How do I get a single minibuffer frame? ------------------------------------------------ - - Vin Shelton writes: - - (setq initial-frame-plist '(minibuffer nil)) - (setq default-frame-plist '(minibuffer nil)) - (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))) - (frame-notice-user-settings) - - *Please note:* The single minibuffer frame may not be to everyone's -taste, and there any number of other XEmacs options settings that may -make it difficult or inconvenient to use. - - -File: xemacs-faq.info, Node: Q3.0.9, Next: Q3.1.1, Prev: Q3.0.8, Up: Customization - -Q3.0.9: What is `Customize'? ----------------------------- - - Starting with XEmacs 20.2 there is new system 'Customize' for -customizing XEmacs options. - - You can access `Customize' from the `Options' menu or invoking one -of customize commands by typing eg. `M-x customize', `M-x -customize-face', `M-x customize-variable' or `M-x customize-apropos'. - - Starting with XEmacs 20.3 there is also new `browser' mode for -Customize. Try it out with `M-x customize-browse' - - -File: xemacs-faq.info, Node: Q3.1.1, Next: Q3.1.2, Prev: Q3.0.9, Up: Customization - -3.1: X Window System & Resources -================================ - -Q3.1.1: Where is a list of X resources? ---------------------------------------- - - Search through the `NEWS' file for `X Resources'. A fairly -comprehensive list is given after it. - - In addition, an `app-defaults' file is supplied, `etc/Emacs.ad' -listing the defaults. The file `etc/sample.Xdefaults' gives a set of -defaults that you might consider. It is essentially the same as -`etc/Emacs.ad' but some entries are slightly altered. Be careful about -installing the contents of this file into your `.Xdefaults' or -`.Xresources' file if you use GNU Emacs under X11 as well. - - -File: xemacs-faq.info, Node: Q3.1.2, Next: Q3.1.3, Prev: Q3.1.1, Up: Customization - -Q3.1.2: How can I detect a color display? ------------------------------------------ - - You can test the return value of the function `(device-class)', as -in: - - (when (eq (device-class) 'color) - (set-face-foreground 'font-lock-comment-face "Grey") - (set-face-foreground 'font-lock-string-face "Red") - .... - ) - - -File: xemacs-faq.info, Node: Q3.1.3, Next: Q3.1.4, Prev: Q3.1.2, Up: Customization - -Q3.1.3: [This question intentionally left blank] ------------------------------------------------- - - -File: xemacs-faq.info, Node: Q3.1.4, Next: Q3.1.5, Prev: Q3.1.3, Up: Customization - -Q3.1.4: [This question intentionally left blank] ------------------------------------------------- - diff --git a/info/xemacs-faq.info-3 b/info/xemacs-faq.info-3 new file mode 100644 index 0000000..36d1e07 --- /dev/null +++ b/info/xemacs-faq.info-3 @@ -0,0 +1,1396 @@ +This is Info file ../info/xemacs-faq.info, produced by Makeinfo version +1.68 from the input file xemacs-faq.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* FAQ: (xemacs-faq). XEmacs FAQ. +END-INFO-DIR-ENTRY + + +File: xemacs-faq.info, Node: Customization, Next: Subsystems, Prev: Installation, Up: Top + +3 Customization and Options +*************************** + + This is part 3 of the XEmacs Frequently Asked Questions list. This +section is devoted to Customization and screen settings. + +* Menu: + +Customization--Emacs Lisp and `.emacs': +* Q3.0.1:: What version of Emacs am I running? +* Q3.0.2:: How do I evaluate Elisp expressions? +* Q3.0.3:: `(setq tab-width 6)' behaves oddly. +* Q3.0.4:: How can I add directories to the `load-path'? +* Q3.0.5:: How to check if a lisp function is defined? +* Q3.0.6:: Can I force the output of `(face-list)' to a buffer? +* Q3.0.7:: Font selections don't get saved after `Save Options'. +* Q3.0.8:: How do I make a single minibuffer frame? +* Q3.0.9:: What is `Customize'? + +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:: `(set-screen-width)' worked in 19.6, but not in 19.13? +* Q3.1.4:: Specifying `Emacs*EmacsScreen.geometry' in `.emacs' does not work in 19.15? +* Q3.1.5:: How can I get the icon to just say `XEmacs'? +* Q3.1.6:: How can I have the window title area display the full path? +* Q3.1.7:: `xemacs -name junk' doesn't work? +* Q3.1.8:: `-iconic' doesn't work. + +Textual Fonts & Colors: +* Q3.2.1:: How can I set color options from `.emacs'? +* Q3.2.2:: How do I set the text, menu and modeline fonts? +* Q3.2.3:: How can I set the colors when highlighting a region? +* Q3.2.4:: How can I limit color map usage? +* Q3.2.5:: My tty supports color, but XEmacs doesn't use them. +* Q3.2.6:: Can I have pixmap backgrounds in XEmacs? + +The Modeline: +* Q3.3.1:: How can I make the modeline go away? +* Q3.3.2:: How do you have XEmacs display the line number in the modeline? +* Q3.3.3:: How do I get XEmacs to put the time of day on the modeline? +* Q3.3.4:: How do I turn off current chapter from AUC TeX modeline? +* Q3.3.5:: How can one change the modeline color based on the mode used? + +3.4 Multiple Device Support: +* Q3.4.1:: How do I open a frame on another screen of my multi-headed display? +* Q3.4.2:: Can I really connect to a running XEmacs after calling up over a modem? How? + +3.5 The Keyboard: +* Q3.5.1:: How can I bind complex functions (or macros) to keys? +* Q3.5.2:: How can I stop down-arrow from adding empty lines to the bottom of my buffers? +* Q3.5.3:: How do I bind C-. and C-; to scroll one line up and down? +* Q3.5.4:: Globally binding `Delete'? +* Q3.5.5:: Scrolling one line at a time. +* Q3.5.6:: How to map `Help' key alone on Sun type4 keyboard? +* Q3.5.7:: How can you type in special characters in XEmacs? +* Q3.5.8:: Why does `(global-set-key [delete-forward] 'delete-char)' complain? +* Q3.5.9:: How do I make the Delete key delete forward? +* Q3.5.10:: Can I turn on "sticky" modifier keys? +* Q3.5.11:: How do I map the arrow keys? + +The Cursor: +* Q3.6.1:: Is there a way to make the bar cursor thicker? +* Q3.6.2:: Is there a way to get back the old block cursor where the cursor covers the character in front of the point? +* Q3.6.3:: Can I make the cursor blink? + +The Mouse and Highlighting: +* Q3.7.1:: How can I turn off Mouse pasting? +* Q3.7.2:: How do I set control/meta/etc modifiers on mouse buttons? +* Q3.7.3:: Clicking the left button does not do anything in buffer list. +* Q3.7.4:: How can I get a list of buffers when I hit mouse button 3? +* Q3.7.5:: Why does cut-and-paste not work between XEmacs and a cmdtool? +* Q3.7.6:: How I can set XEmacs up so that it pastes where the text cursor is? +* Q3.7.7:: How do I select a rectangular region? +* Q3.7.8:: Why does `M-w' take so long? + +The Menubar and Toolbar: +* Q3.8.1:: How do I get rid of the menu (or menubar)? +* Q3.8.2:: Can I customize the basic menubar? +* Q3.8.3:: How do I control how many buffers are listed in the menu `Buffers' list? +* Q3.8.4:: Resources like `Emacs*menubar*font' are not working? +* Q3.8.5:: How can I bind a key to a function to toggle the toolbar? + +Scrollbars: +* Q3.9.1:: How can I disable the scrollbar? +* Q3.9.2:: How can one use resources to change scrollbar colors? +* Q3.9.3:: Moving the scrollbar can move the point; can I disable this? +* Q3.9.4:: How can I get automatic horizontal scrolling? + +Text Selections: +* Q3.10.1:: How can I turn off or change highlighted selections? +* Q3.10.2:: How do I get that typing on an active region removes it? +* Q3.10.3:: Can I turn off the highlight during isearch? +* Q3.10.4:: How do I turn off highlighting after `C-x C-p' (mark-page)? +* Q3.10.5:: The region disappears when I hit the end of buffer while scrolling. + + +File: xemacs-faq.info, Node: Q3.0.1, Next: Q3.0.2, Prev: Customization, Up: Customization + +3.0: Customization - Emacs Lisp and .emacs +========================================== + +Q3.0.1: What version of Emacs am I running? +------------------------------------------- + + How can `.emacs' determine which of the family of Emacsen I am using? + + To determine if you are currently running GNU Emacs 18, GNU Emacs 19, +XEmacs 19, XEmacs 20, or Epoch, and use appropriate code, check out the +example given in `etc/sample.emacs'. There are other nifty things in +there as well! + + For all new code, all you really need to do is: + + (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)) + + +File: xemacs-faq.info, Node: Q3.0.2, Next: Q3.0.3, Prev: Q3.0.1, Up: Customization + +Q3.0.2: How can I evaluate Emacs-Lisp expressions? +-------------------------------------------------- + + I know I can evaluate Elisp expressions from `*scratch*' buffer with +`C-j' after the expression. How do I do it from another buffer? + + Press `M-:' (the default binding of `eval-expression'), and enter +the expression to the minibuffer. In XEmacs prior to 19.15 +`eval-expression' used to be a disabled command by default. If this is +the case, upgrade your XEmacs. + + +File: xemacs-faq.info, Node: Q3.0.3, Next: Q3.0.4, Prev: Q3.0.2, Up: Customization + +Q3.0.3: `(setq tab-width 6)' behaves oddly. +------------------------------------------- + + If you put `(setq tab-width 6)' in your `.emacs' file it does not +work! Is there a reason for this? If you do it at the EVAL prompt it +works fine!! How strange. + + Use `setq-default' instead, since `tab-width' is all-buffer-local. + + +File: xemacs-faq.info, Node: Q3.0.4, Next: Q3.0.5, Prev: Q3.0.3, Up: Customization + +Q3.0.4: How can I add directories to the `load-path'? +----------------------------------------------------- + + Here are two ways to do that, one that puts your directories at the +front of the load-path, the other at the end: + + ;;; Add things at the beginning of the load-path, do not add + ;;; duplicate directories: + (pushnew "bar" load-path :test 'equal) + + (pushnew "foo" load-path :test 'equal) + + ;;; Add things at the end, unconditionally + (setq load-path (nconc load-path '("foo" "bar"))) + + keith (k.p.) hanlan writes: + + To add directories using Unix shell metacharacters use + `expand-file-name' like this: + + (push (expand-file-name "~keithh/.emacsdir") load-path) + + +File: xemacs-faq.info, Node: Q3.0.5, Next: Q3.0.6, Prev: Q3.0.4, Up: Customization + +Q3.0.5: How to check if a lisp function is defined? +--------------------------------------------------- + + Use the following elisp: + + (fboundp 'foo) + + It's almost always a mistake to test `emacs-version' or any similar +variables. + + Instead, use feature-tests, such as `featurep', `boundp', `fboundp', +or even simple behavioral tests, eg.: + + (defvar foo-old-losing-code-p + (condition-case nil (progn (losing-code t) nil) + (wrong-number-of-arguments t))) + + There is an incredible amount of broken code out there which could +work much better more often in more places if it did the above instead +of trying to divine its environment from the value of one variable. + + +File: xemacs-faq.info, Node: Q3.0.6, Next: Q3.0.7, Prev: Q3.0.5, Up: Customization + +Q3.0.6: Can I force the output of `(face-list)' to a buffer? +------------------------------------------------------------ + + It would be good having it in a buffer, as the output of +`(face-list)' is too wide to fit to a minibuffer. + + Evaluate the expression in the `*scratch*' buffer with point after +the rightmost paren and typing `C-j'. + + If the minibuffer smallness is the only problem you encounter, you +can simply press `C-h l' to get the former minibuffer contents in a +buffer. + + +File: xemacs-faq.info, Node: Q3.0.7, Next: Q3.0.8, Prev: Q3.0.6, Up: Customization + +Q3.0.7: Font selections in don't get saved after `Save Options'. +---------------------------------------------------------------- + + For XEmacs 19.14 and previous: + + John Mann writes: + + You have to go to Options->Frame Appearance and unselect + `Frame-Local Font Menu'. If this option is selected, font changes + are only applied to the *current* frame and do *not* get saved + when you save options. + + For XEmacs 19.15 and later: + + Implement the above as well as set the following in your `.emacs' + + (setq options-save-faces t) + + +File: xemacs-faq.info, Node: Q3.0.8, Next: Q3.0.9, Prev: Q3.0.7, Up: Customization + +Q3.0.8: How do I get a single minibuffer frame? +----------------------------------------------- + + Vin Shelton writes: + + (setq initial-frame-plist '(minibuffer nil)) + (setq default-frame-plist '(minibuffer nil)) + (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))) + (frame-notice-user-settings) + + *Please note:* The single minibuffer frame may not be to everyone's +taste, and there any number of other XEmacs options settings that may +make it difficult or inconvenient to use. + + +File: xemacs-faq.info, Node: Q3.0.9, Next: Q3.1.1, Prev: Q3.0.8, Up: Customization + +Q3.0.9: What is `Customize'? +---------------------------- + + Starting with XEmacs 20.2 there is new system 'Customize' for +customizing XEmacs options. + + You can access `Customize' from the `Options' menu or invoking one +of customize commands by typing eg. `M-x customize', `M-x +customize-face', `M-x customize-variable' or `M-x customize-apropos'. + + Starting with XEmacs 20.3 there is also new `browser' mode for +Customize. Try it out with `M-x customize-browse' + + +File: xemacs-faq.info, Node: Q3.1.1, Next: Q3.1.2, Prev: Q3.0.9, Up: Customization + +3.1: X Window System & Resources +================================ + +Q3.1.1: Where is a list of X resources? +--------------------------------------- + + Search through the `NEWS' file for `X Resources'. A fairly +comprehensive list is given after it. + + In addition, an `app-defaults' file is supplied, `etc/Emacs.ad' +listing the defaults. The file `etc/sample.Xdefaults' gives a set of +defaults that you might consider. It is essentially the same as +`etc/Emacs.ad' but some entries are slightly altered. Be careful about +installing the contents of this file into your `.Xdefaults' or +`.Xresources' file if you use GNU Emacs under X11 as well. + + +File: xemacs-faq.info, Node: Q3.1.2, Next: Q3.1.3, Prev: Q3.1.1, Up: Customization + +Q3.1.2: How can I detect a color display? +----------------------------------------- + + You can test the return value of the function `(device-class)', as +in: + + (when (eq (device-class) 'color) + (set-face-foreground 'font-lock-comment-face "Grey") + (set-face-foreground 'font-lock-string-face "Red") + .... + ) + + +File: xemacs-faq.info, Node: Q3.1.3, Next: Q3.1.4, Prev: Q3.1.2, Up: Customization + +Q3.1.3: `(set-screen-width)' worked in 19.6, but not in 19.13? +-------------------------------------------------------------- + + In Lucid Emacs 19.6 I did `(set-screen-width CHARACTERS)' and +`(set-screen-height LINES)' in my `.emacs' instead of specifying +`Emacs*EmacsScreen.geometry' in my `.Xdefaults' but this does not work +in XEmacs 19.13. + + These two functions now take frame arguments: + + (set-frame-width (selected-frame) CHARACTERS) + (set-frame-height (selected-frame) LINES) + + +File: xemacs-faq.info, Node: Q3.1.4, Next: Q3.1.5, Prev: Q3.1.3, Up: Customization + +Q3.1.4: Specifying `Emacs*EmacsScreen.geometry' in `.emacs' does not work in 19.15? +----------------------------------------------------------------------------------- + + In XEmacs 19.11 I specified `Emacs*EmacsScreen.geometry' in my +`.emacs' but this does not work in XEmacs 19.15. + + We have switched from using the term "screen" to using the term +"frame". + + The correct entry for your `.Xdefaults' is now: + + Emacs*EmacsFrame.geometry + + +File: xemacs-faq.info, Node: Q3.1.5, Next: Q3.1.6, Prev: Q3.1.4, Up: Customization + +Q3.1.5: How can I get the icon to just say `XEmacs'? +---------------------------------------------------- + + I'd like the icon to just say `XEmacs', and not include the name of +the current file in it. + + Add the following line to your `.emacs': + + (setq frame-icon-title-format "XEmacs") + + +File: xemacs-faq.info, Node: Q3.1.6, Next: Q3.1.7, Prev: Q3.1.5, Up: Customization + +Q3.1.6: How can I have the window title area display the full path? +------------------------------------------------------------------- + + I'd like to have the window title area display the full +directory/name of the current buffer file and not just the name. + + Add the following line to your `.emacs': + + (setq frame-title-format "%S: %f") + + A more sophisticated title might be: + + (setq frame-title-format + '("%S: " (buffer-file-name "%f" + (dired-directory dired-directory "%b")))) + + That is, use the file name, or the dired-directory, or the buffer +name. + + +File: xemacs-faq.info, Node: Q3.1.7, Next: Q3.1.8, Prev: Q3.1.6, Up: Customization + +Q3.1.7: `xemacs -name junk' doesn't work? +----------------------------------------- + + When I run `xterm -name junk', I get an xterm whose class name +according to xprop, is `junk'. This is the way it's supposed to work, +I think. When I run `xemacs -name junk' the class name is not set to +`junk'. It's still `emacs'. What does `xemacs -name' really do? The +reason I ask is that my window manager (fvwm) will make a window sticky +and I use XEmacs to read my mail. I want that XEmacs window to be +sticky, without having to use the window manager's function to set the +window sticky. What gives? + + `xemacs -name' sets the application name for the program (that is, +the thing which normally comes from `argv[0]'). Using `-name' is the +same as making a copy of the executable with that new name. The +`WM_CLASS' property on each frame is set to the frame-name, and the +application-class. So, if you did `xemacs -name FOO' and then created +a frame named BAR, you'd get an X window with WM_CLASS = `( "BAR", +"Emacs")'. However, the resource hierarchy for this widget would be: + + Name: FOO .shell .container .BAR + Class: Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame + + instead of the default + + Name: xemacs.shell .container .emacs + Class: Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame + + It is arguable that the first element of WM_CLASS should be set to +the application-name instead of the frame-name, but I think that's less +flexible, since it does not give you the ability to have multiple frames +with different WM_CLASS properties. Another possibility would be for +the default frame name to come from the application name instead of +simply being `emacs'. However, at this point, making that change would +be troublesome: it would mean that many users would have to make yet +another change to their resource files (since the default frame name +would suddenly change from `emacs' to `xemacs', or whatever the +executable happened to be named), so we'd rather avoid it. + + To make a frame with a particular name use: + + (make-frame '((name . "the-name"))) + + +File: xemacs-faq.info, Node: Q3.1.8, Next: Q3.2.1, Prev: Q3.1.7, Up: Customization + +Q3.1.8: `-iconic' doesn't work. +------------------------------- + + When I start up XEmacs using `-iconic' it doesn't work right. Using +`-unmapped' on the command line, and setting the `initiallyUnmapped' X +Resource don't seem to help much either... + + Ben Wing writes: + + Ugh, this stuff is such an incredible mess that I've about given up + getting it to work. The principal problem is numerous + window-manager bugs... + + +File: xemacs-faq.info, Node: Q3.2.1, Next: Q3.2.2, Prev: Q3.1.8, Up: Customization + +3.2: Textual Fonts & Colors +=========================== + +Q3.2.1: How can I set color options from `.emacs'? +-------------------------------------------------- + + How can I set the most commonly used color options from my `.emacs' +instead of from my `.Xdefaults'? + + Like this: + + (set-face-background 'default "bisque") ; frame background + (set-face-foreground 'default "black") ; normal text + (set-face-background 'zmacs-region "red") ; When selecting w/ + ; 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 + (set-face-foreground 'highlight "yellow") + (set-face-background 'modeline "blue") ; Line at bottom + ; 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 + (set-face-foreground 'isearch "red") + (setq x-pointer-foreground-color "black") ; Adds to bg color, + ; so keep black + (setq x-pointer-background-color "blue") ; This is color + ; you really + ; want ptr/crsr + + +File: xemacs-faq.info, Node: Q3.2.2, Next: Q3.2.3, Prev: Q3.2.1, Up: Customization + +Q3.2.2: How do I set the text, menu and modeline fonts? +------------------------------------------------------- + + Note that you should use `Emacs.' and not `Emacs*' when setting face +values. + + In `.Xdefaults': + + Emacs.default.attributeFont: -*-*-medium-r-*-*-*-120-*-*-m-*-*-* + Emacs*menubar*font: fixed + Emacs.modeline.attributeFont: fixed + + This is confusing because modeline is a face, and can be found listed +with all faces in the current mode by using `M-x set-face-font (enter) +?'. It uses the face specification of `attributeFont', while menubar +is a normal X thing that uses the specification `font'. With Motif it +may be necessary to use `fontList' instead of `font'. + + +File: xemacs-faq.info, Node: Q3.2.3, Next: Q3.2.4, Prev: Q3.2.2, Up: Customization + +Q3.2.3: How can I set the colors when highlighting a region? +------------------------------------------------------------ + + How can I set the background/foreground colors when highlighting a +region? + + You can change the face `zmacs-region' either in your `.Xdefaults': + + Emacs.zmacs-region.attributeForeground: firebrick + Emacs.zmacs-region.attributeBackground: lightseagreen + + or in your `.emacs': + + (set-face-background 'zmacs-region "red") + (set-face-foreground 'zmacs-region "yellow") + + +File: xemacs-faq.info, Node: Q3.2.4, Next: Q3.2.5, Prev: Q3.2.3, Up: Customization + +Q3.2.4: How can I limit color map usage? +---------------------------------------- + + I'm using Netscape (or another color grabber like XEmacs); is there +anyway to limit the number of available colors in the color map? + + XEmacs 19.13 didn't have such a mechanism (unlike netscape, or other +color-hogs). One solution is to start XEmacs prior to netscape, since +this will prevent Netscape from grabbing all colors (but Netscape will +complain). You can use the flags for Netscape, like -mono, -ncols <#> +or -install (for mono, limiting to <#> colors, or for using a private +color map). Since Netscape will take the entire colormap and never +release it, the only reasonable way to run it is with `-install'. + + If you have the money, another solution would be to use a truecolor +or direct color video. + + Starting with XEmacs 19.14, XEmacs uses the closest available color +if the colormap is full, so it's O.K. now to start Netscape first. + + +File: xemacs-faq.info, Node: Q3.2.5, Next: Q3.2.6, Prev: Q3.2.4, Up: Customization + +Q3.2.5: My tty supports color, but XEmacs doesn't use them. +----------------------------------------------------------- + + XEmacs tries to automatically determine whether your tty supports +color, but sometimes guesses wrong. In that case, you can make XEmacs +Do The Right Thing using this Lisp code: + + (if (eq 'tty (device-type)) + (set-device-class nil 'color)) + + +File: xemacs-faq.info, Node: Q3.2.6, Next: Q3.3.1, Prev: Q3.2.5, Up: Customization + +Q3.2.6: Can I have pixmap backgrounds in XEmacs? +------------------------------------------------ + + Juan Villacis writes: + + There are several ways to do it. For example, you could specify a + default pixmap image to use in your `~/.Xresources', e.g., + + Emacs*EmacsFrame.default.attributeBackgroundPixmap: /path/to/image.xpm + + and then reload ~/.Xresources and restart XEmacs. Alternatively, + since each face can have its own pixmap background, a better way + would be to set a face's pixmap within your XEmacs init file, e.g., + + (set-face-background-pixmap 'default "/path/to/image.xpm") + (set-face-background-pixmap 'bold "/path/to/another_image.xpm") + + and so on. You can also do this interactively via `M-x + edit-faces'. + + +3.3: The Modeline +================= + + +File: xemacs-faq.info, Node: Q3.3.1, Next: Q3.3.2, Prev: Q3.2.6, Up: Customization + +Q3.3.1: How can I make the modeline go away? +-------------------------------------------- + + (set-specifier has-modeline-p nil) + + Starting with XEmacs 19.14 the modeline responds to mouse clicks, so +if you haven't liked or used the modeline in the past, you might want to +try the new version out. + + +File: xemacs-faq.info, Node: Q3.3.2, Next: Q3.3.3, Prev: Q3.3.1, Up: Customization + +Q3.3.2: How do you have XEmacs display the line number in the modeline? +----------------------------------------------------------------------- + + Add the following line to your `.emacs' file to display the line +number: + + (line-number-mode 1) + + Use the following to display the column number: + + (column-number-mode 1) + + Or select from the `Options' menu +`Customize->Emacs->Editing->Basics->Line Number Mode' and/or +`Customize->Emacs->Editing->Basics->Column Number Mode' + + Or type `M-x customize editing-basics '. + + +File: xemacs-faq.info, Node: Q3.3.3, Next: Q3.3.4, Prev: Q3.3.2, Up: Customization + +Q3.3.3: How do I get XEmacs to put the time of day on the modeline? +------------------------------------------------------------------- + + Add the following line to your `.emacs' file to display the time: + + (display-time) + + See `Customize' from the `Options' menu for customization. + + +File: xemacs-faq.info, Node: Q3.3.4, Next: Q3.3.5, Prev: Q3.3.3, Up: Customization + +Q3.3.4: How do I turn off current chapter from AUC TeX modeline? +---------------------------------------------------------------- + + With AUC TeX, fast typing is hard because the current chapter, +section etc. are given in the modeline. How can I turn this off? + + It's not AUC TeX, it comes from `func-menu' in `func-menu.el'. Add +this code to your `.emacs' to turn it off: + + (setq fume-display-in-modeline-p nil) + + Or just add a hook to `TeX-mode-hook' to turn it off only for TeX +mode: + + (add-hook 'TeX-mode-hook + '(lambda () (setq fume-display-in-modeline-p nil))) + + David Hughes writes: + + If you have 19.14 or later, try this instead; you'll still get the + function name displayed in the modeline, but it won't attempt to + keep track when you modify the file. To refresh when it gets out + of synch, you simply need click on the `Rescan Buffer' option in + the function-menu. + + (setq-default fume-auto-rescan-buffer-p nil) + + +File: xemacs-faq.info, Node: Q3.3.5, Next: Q3.4.1, Prev: Q3.3.4, Up: Customization + +Q3.3.5: How can one change the modeline color based on the mode used? +--------------------------------------------------------------------- + + You can use something like the following: + + (add-hook 'lisp-mode-hook + (lambda () + (set-face-background 'modeline "red" (current-buffer)))) + + Then, when editing a Lisp file (i.e. when in Lisp mode), the modeline +colors change from the default set in your `.emacs'. The change will +only be made in the buffer you just entered (which contains the Lisp +file you are editing) and will not affect the modeline colors anywhere +else. + + Notes: + + * The hook is the mode name plus `-hook'. eg. c-mode-hook, + c++-mode-hook, emacs-lisp-mode-hook (used for your `.emacs' or a + `xx.el' file), lisp-interaction-mode-hook (the `*scratch*' + buffer), text-mode-hook, etc. + + * Be sure to use `add-hook', not `(setq c-mode-hook xxxx)', + otherwise you will erase anything that anybody has already put on + the hook. + + * You can also do `(set-face-font 'modeline FONT)', eg. + `(set-face-font 'modeline "*bold-r-normal*140-100-100*" + (current-buffer))' if you wish the modeline font to vary based on + the current mode. + + This works in 19.15 as well, but there are additional modeline faces, +`modeline-buffer-id', `modeline-mousable', and +`modeline-mousable-minor-mode', which you may want to customize. + + +File: xemacs-faq.info, Node: Q3.4.1, Next: Q3.4.2, Prev: Q3.3.5, Up: Customization + +3.4: Multiple Device Support +============================ + +Q3.4.1: How do I open a frame on another screen of my multi-headed display? +--------------------------------------------------------------------------- + + The support for this was revamped for 19.14. Use the command `M-x +make-frame-on-display'. This command is also on the File menu in the +menubar. + + XEmacs 19.14 and later also have the command `make-frame-on-tty' +which will establish a connection to any tty-like device. Opening the +TTY devices should be left to `gnuclient', though. + + +File: xemacs-faq.info, Node: Q3.4.2, Next: Q3.5.1, Prev: Q3.4.1, Up: Customization + +Q3.4.2: Can I really connect to a running XEmacs after calling up over a modem? How? +------------------------------------------------------------------------------------- + + If you're not running at least XEmacs 19.14, you can't. Otherwise +check out the `gnuattach' program supplied with XEmacs. Starting with +XEmacs 20.3, `gnuattach' and `gnudoit' functionality is provided by +`gnuclient'. + + Also *Note Q5.0.12::. + + +File: xemacs-faq.info, Node: Q3.5.1, Next: Q3.5.2, Prev: Q3.4.2, Up: Customization + +3.5: The Keyboard +================= + +Q3.5.1: How can I bind complex functions (or macros) to keys? +------------------------------------------------------------- + + As an example, say you want the `paste' key on a Sun keyboard to +insert the current Primary X selection at point. You can accomplish this +with: + + (define-key global-map [f18] 'x-insert-selection) + + However, this only works if there is a current X selection (the +selection will be highlighted). The functionality I like is for the +`paste' key to insert the current X selection if there is one, +otherwise insert the contents of the clipboard. To do this you need to +pass arguments to `x-insert-selection'. This is done by wrapping the +call in a 'lambda form: + + (global-set-key [f18] + (lambda () (interactive) (x-insert-selection t nil))) + + This binds the f18 key to a "generic" functional object. The +interactive spec is required because only interactive functions can be +bound to keys. + + For the FAQ example you could use: + + (global-set-key [(control ?.)] + (lambda () (interactive) (scroll-up 1))) + (global-set-key [(control ? ;)] + (lambda () (interactive) (scroll-up -1))) + + This is fine if you only need a few functions within the lambda body. +If you're doing more it's cleaner to define a separate function as in +question 3.5.3 (*note Q3.5.3::.). + + +File: xemacs-faq.info, Node: Q3.5.2, Next: Q3.5.3, Prev: Q3.5.1, Up: Customization + +Q3.5.2: How can I stop down-arrow from adding empty lines to the bottom of my buffers? +-------------------------------------------------------------------------------------- + + Add the following line to your `.emacs' file: + + (setq next-line-add-newlines nil) + + This has been the default setting in XEmacs for some time. + + +File: xemacs-faq.info, Node: Q3.5.3, Next: Q3.5.4, Prev: Q3.5.2, Up: Customization + +Q3.5.3: How do I bind C-. and C-; to scroll one line up and down? +----------------------------------------------------------------- + + Add the following (Thanks to Richard Mlynarik +and Wayne Newberry ) to `.emacs': + + (defun scroll-up-one-line () + (interactive) + (scroll-up 1)) + + (defun scroll-down-one-line () + (interactive) + (scroll-down 1)) + + (global-set-key [(control ?.)] 'scroll-up-one-line) ; C-. + (global-set-key [(control ? ;)] 'scroll-down-one-line) ; C-; + + The key point is that you can only bind simple functions to keys; you +can not bind a key to a function that you're also passing arguments to. +(*note Q3.5.1::. for a better answer). + + +File: xemacs-faq.info, Node: Q3.5.4, Next: Q3.5.5, Prev: Q3.5.3, Up: Customization + +Q3.5.4: Globally binding `Delete'? +---------------------------------- + + I cannot manage to globally bind my `Delete' key to something other +than the default. How does one do this? + + (defun foo () + (interactive) + (message "You hit DELETE")) + + (global-set-key 'delete 'foo) + + However, some modes explicitly bind `Delete', so you would need to +add a hook that does `local-set-key' for them. If what you want to do +is make the Backspace and Delete keys work more PC/Motif-like, then +take a look at the `delbs.el' package. + + New in XEmacs 19.14 is a variable called `key-translation-map' which +makes it easier to bind `Delete'. `delbs.el' is a good example of how +to do this correctly. + + Also *Note Q3.5.10::. + + +File: xemacs-faq.info, Node: Q3.5.5, Next: Q3.5.6, Prev: Q3.5.4, Up: Customization + +Q3.5.5: Scrolling one line at a time. +------------------------------------- + + Can the cursor keys scroll the screen a line at a time, rather than +the default half page jump? I tend it to find it disorienting. + + Try this: + + (defun scroll-one-line-up (&optional arg) + "Scroll the selected window up (forward in the text) one line (or N lines)." + (interactive "p") + (scroll-up (or arg 1))) + + (defun scroll-one-line-down (&optional arg) + "Scroll the selected window down (backward in the text) one line (or N)." + (interactive "p") + (scroll-down (or arg 1))) + + (global-set-key [up] 'scroll-one-line-up) + (global-set-key [down] 'scroll-one-line-down) + + The following will also work but will affect more than just the +cursor keys (i.e. `C-n' and `C-p'): + + (setq scroll-step 1) + + Starting with XEmacs-20.3 you can also change this with Customize. +Select from the `Options' menu +`Customize->Emacs->Environment->Windows->Scroll Step...' or type `M-x +customize windows '. + + +File: xemacs-faq.info, Node: Q3.5.6, Next: Q3.5.7, Prev: Q3.5.5, Up: Customization + +Q3.5.6: How to map `Help' key alone on Sun type4 keyboard? +---------------------------------------------------------- + + The following works in GNU Emacs 19: + + (global-set-key [help] 'help-command);; Help + + The following works in XEmacs 19.15 with the addition of shift: + + (global-set-key [(shift help)] 'help-command);; Help + + But it doesn't work alone. This is in the file `PROBLEMS' which +should have come with your XEmacs installation: *Emacs ignores the +`help' key when running OLWM*. + + OLWM grabs the `help' key, and retransmits it to the appropriate +client using `XSendEvent'. Allowing Emacs to react to synthetic events +is a security hole, so this is turned off by default. You can enable +it by setting the variable `x-allow-sendevents' to t. You can also +cause fix this by telling OLWM to not grab the help key, with the null +binding `OpenWindows.KeyboardCommand.Help:'. + + +File: xemacs-faq.info, Node: Q3.5.7, Next: Q3.5.8, Prev: Q3.5.6, Up: Customization + +Q3.5.7: How can you type in special characters in XEmacs? +--------------------------------------------------------- + + One way is to use the package `x-compose'. Then you can use +sequences like `Compose " a' to get ä, etc. + + Another way is to use the `iso-insert' package, provided in XEmacs +19.15 and later. Then you can use sequences like `C-x 8 " a' to get ä, +etc. + + Glynn Clements writes: + + It depends upon your X server. + + Generally, the simplest way is to define a key as Multi_key with + xmodmap, e.g. + xmodmap -e 'keycode 0xff20 = Multi_key' + + You will need to pick an appropriate keycode. Use xev to find out + the keycodes for each key. + + [NB: On a `Windows' keyboard, recent versions of XFree86 + automatically define the right `Windows' key as Multi_key'.] + + Once you have Multi_key defined, you can use e.g. + Multi a ' => á + Multi e " => ë + Multi c , => ç + + etc. + + Also, recent versions of XFree86 define various AltGr- + combinations as dead keys, i.e. + AltGr [ => dead_diaeresis + AltGr ] => dead_tilde + AltGr ; => dead_acute + etc. + + Running `xmodmap -pk' will list all of the defined keysyms. + + +File: xemacs-faq.info, Node: Q3.5.8, Next: Q3.5.9, Prev: Q3.5.7, Up: Customization + +Q3.5.8: Why does `(global-set-key [delete-forward] 'delete-char)' complain? +--------------------------------------------------------------------------- + + Why does `(define-key global-map [ delete-forward ] 'delete-char)' +complain of not being able to bind an unknown key? + + Try this instead: + + (define-key global-map [delete_forward] 'delete-char) + + and it will work. + + What you are seeing above is a bug due to code that is trying to +check for GNU Emacs syntax like: + + (define-key global-map [C-M-a] 'delete-char) + + which otherwise would cause no errors but would not result in the +expected behavior. + + This bug has been fixed in 19.14. + + +File: xemacs-faq.info, Node: Q3.5.9, Next: Q3.5.10, Prev: Q3.5.8, Up: Customization + +Q3.5.9: How do I make the Delete key delete forward? +---------------------------------------------------- + + With XEmacs-20.2 use the `delbs' package: + + (require 'delbs) + + This will give you the functions `delbs-enable-delete-forward' to +set things up, and `delbs-disable-delete-forward' to revert to "normal" +behavior. Note that `delbackspace' package is obsolete. + + Starting with XEmacs-20.3 better solution is to set variable +`delete-key-deletes-forward' to t. You can also change this with +Customize. Select from the `Options' menu +`Customize->Emacs->Editing->Basics->Delete Key Deletes Forward' or type +`M-x customize editing-basics '. + + Also *Note Q3.5.4::. + + +File: xemacs-faq.info, Node: Q3.5.10, Next: Q3.5.11, Prev: Q3.5.9, Up: Customization + +Q3.5.10: Can I turn on "sticky" modifier keys? +---------------------------------------------- + + Yes, with `(setq modifier-keys-are-sticky t)'. This will give the +effect of being able to press and release Shift and have the next +character typed come out in upper case. This will affect all the other +modifier keys like Control and Meta as well. + + Ben Wing writes: + + One thing about the sticky modifiers is that if you move the mouse + out of the frame and back in, it cancels all currently "stuck" + modifiers. + + +File: xemacs-faq.info, Node: Q3.5.11, Next: Q3.6.1, Prev: Q3.5.10, Up: Customization + +Q3.5.11: How do I map the arrow keys? +------------------------------------- + + Say you want to map `C-' to forward-word: + + Sam Steingold writes: + + ; both XEmacs and Emacs + (define-key global-map [(control right)] 'forward-word) + or + ; Emacs only + (define-key global-map [C-right] 'forward-word) + or + ; ver > 20, both + (define-key global-map (kbd "C-") 'forward-word) + + +File: xemacs-faq.info, Node: Q3.6.1, Next: Q3.6.2, Prev: Q3.5.11, Up: Customization + +3.6: The Cursor +=============== + +Q3.6.1: Is there a way to make the bar cursor thicker? +------------------------------------------------------ + + I'd like to have the bar cursor a little thicker, as I tend to +"lose" it often. + + For a 1 pixel bar cursor, use: + + (setq bar-cursor t) + + For a 2 pixel bar cursor, use: + + (setq bar-cursor 'anything-else) + + Starting with XEmacs-20.3 you can also change these with Customize. +Select from the `Options' menu +`Customize->Emacs->Environment->Display->Bar Cursor...' or type `M-x +customize display '. + + You can use a color to make it stand out better: + + Emacs*cursorColor: Red + + +File: xemacs-faq.info, Node: Q3.6.2, Next: Q3.6.3, Prev: Q3.6.1, Up: Customization + +Q3.6.2: Is there a way to get back the block cursor? +---------------------------------------------------- + + (setq bar-cursor nil) + + Starting with XEmacs-20.3 you can also change this with Customize. +Select from the `Options' menu +`Customize->Emacs->Environment->Display->Bar Cursor...' or type `M-x +customize display '. + + +File: xemacs-faq.info, Node: Q3.6.3, Next: Q3.7.1, Prev: Q3.6.2, Up: Customization + +Q3.6.3: Can I make the cursor blink? +------------------------------------ + + If you are running a version of XEmacs older than 19.14, no. +Otherwise you can do the following: + + (blink-cursor-mode) + + This function toggles between a steady cursor and a blinking cursor. +You may also set this mode from the menu bar by selecting `Options => +Frame Appearance => Blinking Cursor'. Remember to save options. + + +File: xemacs-faq.info, Node: Q3.7.1, Next: Q3.7.2, Prev: Q3.6.3, Up: Customization + +3.7: The Mouse and Highlighting +=============================== + +Q3.7.1: How can I turn off Mouse pasting? +----------------------------------------- + + I keep hitting the middle mouse button by accident and getting stuff +pasted into my buffer so how can I turn this off? + + Here is an alternative binding, whereby the middle mouse button +selects (but does not cut) the expression under the mouse. Clicking +middle on a left or right paren will select to the matching one. Note +that you can use `define-key' or `global-set-key'. + + (defun mouse-set-point-and-select (event) + "Sets the point at the mouse location, then marks following form" + (interactive "@e") + (mouse-set-point event) + (mark-sexp 1)) + (define-key global-map [button2] 'mouse-set-point-and-select) + + +File: xemacs-faq.info, Node: Q3.7.2, Next: Q3.7.3, Prev: Q3.7.1, Up: Customization + +Q3.7.2: How do I set control/meta/etc modifiers on mouse buttons? +----------------------------------------------------------------- + + Use, for instance, `[(meta button1)]'. For example, here is a common +setting for Common Lisp programmers who use the bundled `ilisp' +package, whereby meta-button1 on a function name will find the file +where the function name was defined, and put you at that location in +the source file. + + [Inside a function that gets called by the lisp-mode-hook and +ilisp-mode-hook] + + (local-set-key [(meta button1)] 'edit-definitions-lisp) + + +File: xemacs-faq.info, Node: Q3.7.3, Next: Q3.7.4, Prev: Q3.7.2, Up: Customization + +Q3.7.3: Clicking the left button does not do anything in buffer list. +--------------------------------------------------------------------- + + I do `C-x C-b' to get a list of buffers and the entries get +highlighted when I move the mouse over them but clicking the left mouse +does not do anything. + + Use the middle mouse button. + + +File: xemacs-faq.info, Node: Q3.7.4, Next: Q3.7.5, Prev: Q3.7.3, Up: Customization + +Q3.7.4: How can I get a list of buffers when I hit mouse button 3? +------------------------------------------------------------------ + + The following code will replace the default popup on button3: + + (global-set-key [button3] 'popup-buffer-menu) + + +File: xemacs-faq.info, Node: Q3.7.5, Next: Q3.7.6, Prev: Q3.7.4, Up: Customization + +Q3.7.5: Why does cut-and-paste not work between XEmacs and a cmdtool? +--------------------------------------------------------------------- + + We don't know. It's a bug. There does seem to be a work-around, +however. Try running xclipboard first. It appears to fix the problem +even if you exit it. (This should be mostly fixed in 19.13, but we +haven't yet verified that). + + +File: xemacs-faq.info, Node: Q3.7.6, Next: Q3.7.7, Prev: Q3.7.5, Up: Customization + +Q3.7.6: How I can set XEmacs up so that it pastes where the text cursor is? +--------------------------------------------------------------------------- + + By default XEmacs pastes X selections where the mouse pointer is. +How do I disable this? + + Examine the function `mouse-yank', by typing `C-h f mouse-yank +'. + + To get XEmacs to paste at the text cursor, add this your `.emacs': + + (setq mouse-yank-at-point t) + + Starting with XEmacs-20.2 you can also change this with Customize. +Select from the `Options' menu `Customize->Emacs->Editing->Mouse->Yank +At Point...' or type `M-x customize mouse '. + + +File: xemacs-faq.info, Node: Q3.7.7, Next: Q3.7.8, Prev: Q3.7.6, Up: Customization + +Q3.7.7: How do I select a rectangular region? +--------------------------------------------- + + Just select the region normally, then use the rectangle commands +(e.g. `kill-rectangle' on it. The region does not highlight as a +rectangle, but the commands work just fine. + + To actually sweep out rectangular regions with the mouse you can use +`mouse-track-do-rectangle' which is assigned to `M-button1'. Then use +rectangle commands. + + You can also do the following to change default behavior to sweep out +rectangular regions: + + (setq mouse-track-rectangle-p t) + + Starting with XEmacs-20.2 you can also change this with Customize. +Select from the `Options' menu `Customize->Emacs->Editing->Mouse->Track +Rectangle...' or type `M-x customize mouse '. + + mouse-track-do-rectangle: (event) + -- an interactive compiled Lisp function. + Like `mouse-track' but selects rectangles instead of regions. + + +File: xemacs-faq.info, Node: Q3.7.8, Next: Q3.8.1, Prev: Q3.7.7, Up: Customization + +Q3.7.8: Why does `M-w' take so long? +------------------------------------ + + It actually doesn't. It leaves the region visible for a second so +that you can see what area is being yanked. If you start working, +though, it will immediately complete its operation. In other words, it +will only delay for a second if you let it. + + +File: xemacs-faq.info, Node: Q3.8.1, Next: Q3.8.2, Prev: Q3.7.8, Up: Customization + +3.8: The Menubar and Toolbar +============================ + +Q3.8.1: How do I get rid of the menu (or menubar)? +-------------------------------------------------- + + If you are running XEmacs 19.13 and earlier, add this command to your +`.emacs'. + + (set-menubar nil) + + Starting with XEmacs 19.14 the preferred method is: + + (set-specifier menubar-visible-p nil) + + +File: xemacs-faq.info, Node: Q3.8.2, Next: Q3.8.3, Prev: Q3.8.1, Up: Customization + +Q3.8.2: Can I customize the basic menubar? +------------------------------------------ + + For an extensive menubar, add this line to your `.emacs': + + (load "big-menubar") + + If you'd like to write your own, this file provides as good a set of +examples as any to start from. The file is located in +`lisp/packages/big-menubar.el' in the XEmacs installation directory. + + +File: xemacs-faq.info, Node: Q3.8.3, Next: Q3.8.4, Prev: Q3.8.2, Up: Customization + +Q3.8.3: How do I control how many buffers are listed in the menu `Buffers List'? +-------------------------------------------------------------------------------- + + Add the following to your `.emacs' (suit to fit): + + (setq buffers-menu-max-size 20) + + For no limit, use an argument of `nil'. + + Starting with XEmacs-20.3 you can also change this with Customize. +Select from the `Options' menu +`Customize->Emacs->Environment->Menu->Buffers Menu->Max Size...' or +type `M-x customize buffers-menu '. + + +File: xemacs-faq.info, Node: Q3.8.4, Next: Q3.8.5, Prev: Q3.8.3, Up: Customization + +Q3.8.4: Resources like `Emacs*menubar*font' are not working? +------------------------------------------------------------ + + I am trying to use a resource like `Emacs*menubar*font' to set the +font of the menubar but it's not working. + + If you are using the real Motif menubar, this resource is not +recognized; you have to say: + + Emacs*menubar*fontList: FONT + + If you are using the Lucid menubar, the former resource will be +recognized only if the latter resource is unset. This means that the +resource + + *fontList: FONT + + will override + + Emacs*menubar*font: FONT + + even though the latter is more specific. + + +File: xemacs-faq.info, Node: Q3.8.5, Next: Q3.9.1, Prev: Q3.8.4, Up: Customization + +Q3.8.5: How can I bind a key to a function to toggle the toolbar? +----------------------------------------------------------------- + + Try something like: + + (defun my-toggle-toolbar () + (interactive) + (set-specifier default-toolbar-visible-p + (not (specifier-instance default-toolbar-visible-p)))) + (global-set-key "\C-xT" 'my-toggle-toolbar) + + There are redisplay bugs in 19.14 that may make the preceding result +in a messed-up display, especially for frames with multiple windows. +You may need to resize the frame before XEmacs completely realizes the +toolbar is really gone. + + Thanks to Martin Buchholz for the correct code. + + +File: xemacs-faq.info, Node: Q3.9.1, Next: Q3.9.2, Prev: Q3.8.5, Up: Customization + +3.9: Scrollbars +=============== + +Q3.9.1: How can I disable the scrollbar? +---------------------------------------- + + To disable them for all frames, add the following line to your +`.Xdefaults': + + Emacs.scrollBarWidth: 0 + + Or select from the `Options' menu `Frame Appearance->Scrollbars'. +Remember to save options. + + To turn the scrollbar off on a per-frame basis, use the following +function: + + (set-specifier scrollbar-width 0 (selected-frame)) + + You can actually turn the scrollbars on at any level you want by +substituting for (selected-frame) in the above command. For example, to +turn the scrollbars off only in a single buffer: + + (set-specifier scrollbar-width 0 (current-buffer)) + + In XEmacs versions prior to 19.14, you had to use the hairier +construct: + + (set-specifier scrollbar-width (cons (selected-frame) 0)) + + +File: xemacs-faq.info, Node: Q3.9.2, Next: Q3.9.3, Prev: Q3.9.1, Up: Customization + +Q3.9.2: How can one use resources to change scrollbar colors? +------------------------------------------------------------- + + Here's a recap of how to use resources to change your scrollbar +colors: + + ! Motif scrollbars + + Emacs*XmScrollBar.Background: skyblue + Emacs*XmScrollBar.troughColor: lightgray + + ! Athena scrollbars + + Emacs*Scrollbar.Foreground: skyblue + Emacs*Scrollbar.Background: lightgray + + Note the capitalization of `Scrollbar' for the Athena widget. + + +File: xemacs-faq.info, Node: Q3.9.3, Next: Q3.9.4, Prev: Q3.9.2, Up: Customization + +Q3.9.3: Moving the scrollbar can move the point; can I disable this? +-------------------------------------------------------------------- + + When I move the scrollbar in an XEmacs window, it moves the point as +well, which should not be the default behavior. Is this a bug or a +feature? Can I disable it? + + The current behavior is a feature, not a bug. Point remains at the +same buffer position as long as that position does not scroll off the +screen. In that event, point will end up in either the upper-left or +lower-left hand corner. + + This cannot be changed. + + +File: xemacs-faq.info, Node: Q3.9.4, Next: Q3.10.1, Prev: Q3.9.3, Up: Customization + +Q3.9.4: How can I get automatic horizontal scrolling? +----------------------------------------------------- + + By the same token, how can I turn it off in specific modes? + + To do this, add to your `.emacs' file: + + (require 'auto-show) + + Then do `(setq truncate-lines t)' in the mode-hooks for any modes in +which you want lines truncated. + + More precisely: If `truncate-lines' is nil, horizontal scrollbars +will never appear. Otherwise, they will appear only if the value of +`scrollbar-height' for that buffer/window/etc. is non-zero. If you do + + (set-specifier scrollbar-height 0) + + then horizontal scrollbars will not appear in truncated buffers +unless the package specifically asked for them. + + Automatic horizontal scrolling is now standard, starting with 19.14. + diff --git a/info/xemacs-faq.info-4 b/info/xemacs-faq.info-4 new file mode 100644 index 0000000..ddfcd27 --- /dev/null +++ b/info/xemacs-faq.info-4 @@ -0,0 +1,1366 @@ +This is Info file ../info/xemacs-faq.info, produced by Makeinfo version +1.68 from the input file xemacs-faq.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* FAQ: (xemacs-faq). XEmacs FAQ. +END-INFO-DIR-ENTRY + + +File: xemacs-faq.info, Node: Q3.10.1, Next: Q3.10.2, Prev: Q3.9.4, Up: Customization + +3.10: Text Selections +===================== + +Q3.10.1: How can I turn off or change highlighted selections? +------------------------------------------------------------- + + The `zmacs' mode allows for what some might call gratuitous +highlighting for selected regions (either by setting mark or by using +the mouse). This is the default behavior. To turn off, add the +following line to your `.emacs' file: + + (setq zmacs-regions nil) + + Starting with XEmacs-20.2 you can also change this with Customize. +Select from the `Options' menu `Customize->Emacs->Editing->Basics->Zmacs +Regions' or type `M-x customize editing-basics '. + + To change the face for selection, look at `Options->Customize' on +the menubar. + + +File: xemacs-faq.info, Node: Q3.10.2, Next: Q3.10.3, Prev: Q3.10.1, Up: Customization + +Q3.10.2: How do I get that typing on an active region removes it? +----------------------------------------------------------------- + + I want to change things so that if I select some text and start +typing, the typed text replaces the selected text, similar to Motif. + + You want to use something called "pending delete". Pending delete +is what happens when you select a region (with the mouse or keyboard) +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 line to your `.emacs': + + (turn-on-pending-delete) + + Note that this will work with both Backspace and Delete. + + +File: xemacs-faq.info, Node: Q3.10.3, Next: Q3.10.4, Prev: Q3.10.2, Up: Customization + +Q3.10.3: Can I turn off the highlight during isearch? +----------------------------------------------------- + + I do not like my text highlighted while I am doing isearch as I am +not able to see what's underneath. How do I turn it off? + + Put the following in your `.emacs': + + (setq isearch-highlight nil) + + Starting with XEmacs-20.2 you can also change this with Customize. +Type `M-x customize-variable isearch-highlight '. + + Note also that isearch-highlight affects query-replace and ispell. +Instead of disabling isearch-highlight you may find that a better +solution consists of customizing the `isearch' face. + + +File: xemacs-faq.info, Node: Q3.10.4, Next: Q3.10.5, Prev: Q3.10.3, Up: Customization + +Q3.10.4: How do I turn off highlighting after `C-x C-p' (mark-page)? +-------------------------------------------------------------------- + + Put this in your `.emacs': + + (setq zmacs-regions nil) + + *Warning: This command turns off all region highlighting.* + + Also *Note Q3.10.1::. + + +File: xemacs-faq.info, Node: Q3.10.5, Prev: Q3.10.4, Up: Customization + +Q3.10.5: The region disappears when I hit the end of buffer while scrolling. +---------------------------------------------------------------------------- + + This has been fixed by default starting with XEmacs-20.3. + + With older versions you can turn this feature (if it indeed is a +feature) off like this: + + (defadvice scroll-up (around scroll-up freeze) + (interactive "_P") + (let ((zmacs-region-stays t)) + (if (interactive-p) + (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)))) + ad-do-it))) + + Thanks to T. V. Raman for assistance in deriving +this answer. + + +File: xemacs-faq.info, Node: Subsystems, Next: Miscellaneous, Prev: Customization, Up: Top + +4 Major Subsystems +****************** + + This is part 4 of the XEmacs Frequently Asked Questions list. This +section is devoted to major XEmacs subsystems. + +* Menu: + +Reading Mail with VM: +* Q4.0.1:: How do I set up VM to retrieve remote mail using POP? +* Q4.0.2:: How do I get VM to filter mail for me? +* Q4.0.3:: How can I get VM to automatically check for new mail? +* Q4.0.4:: [This question intentionally left blank] +* Q4.0.5:: How do I get my outgoing mail archived? +* Q4.0.6:: I have various addresses at which I receive mail. How can I tell VM to ignore them when doing a "reply-all"? +* Q4.0.7:: Is there a mailing list or FAQ for VM? +* Q4.0.8:: Remote mail reading with VM. +* Q4.0.9:: rmail or VM gets an error incorporating new mail. +* Q4.0.10:: How do I make VM stay in a single frame? +* Q4.0.11:: How do I make VM or mh-e display graphical smilies? +* Q4.0.12:: Customization of VM not covered in the manual or here. + +Web browsing with W3: +* Q4.1.1:: What is W3? +* Q4.1.2:: How do I run W3 from behind a firewall? +* Q4.1.3:: Is it true that W3 supports style sheets and tables? + +Reading Netnews and Mail with Gnus: +* Q4.2.1:: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus,argh! +* Q4.2.2:: [This question intentionally left blank] +* Q4.2.3:: How do I make Gnus stay within a single frame? +* Q4.2.4:: How do I customize the From: line? + +Other Mail & News: +* Q4.3.1:: How can I read and/or compose MIME messages? +* Q4.3.2:: What is TM and where do I get it? +* Q4.3.3:: Why isn't this `movemail' program working? +* Q4.3.4:: Movemail is also distributed by Netscape? Can that cause problems? +* Q4.3.5:: Where do I find pstogif (required by tm)? + +Sparcworks, EOS, and WorkShop: +* Q4.4.1:: What is SPARCworks, EOS, and WorkShop + +Energize: +* Q4.5.1:: What is/was Energize? + +Infodock: +* Q4.6.1:: What is Infodock? + +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:: 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? + + +File: xemacs-faq.info, Node: Q4.0.1, Next: Q4.0.2, Prev: Subsystems, Up: Subsystems + +4.0: Reading Mail with VM +========================= + +Q4.0.1: How do I set up VM to retrieve mail from a remote site using POP? +------------------------------------------------------------------------- + + Use `vm-spool-files', like this for example: + + (setq vm-spool-files '("/var/spool/mail/wing" + "netcom23.netcom.com:110:pass:wing:MYPASS")) + + Of course substitute your actual password for MYPASS. + + +File: xemacs-faq.info, Node: Q4.0.2, Next: Q4.0.3, Prev: Q4.0.1, Up: Subsystems + +Q4.0.2: How do I get VM to filter mail for me? +---------------------------------------------- + + One possibility is to use procmail to split your mail before it gets +to VM. I prefer this personally, since there are many strange and +wonderful things one can do with procmail. Procmail may be found at +`ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/'. + + Also see the Mail Filtering FAQ at: +`ftp://rtfm.mit.edu/pub/usenet/news.answers/mail/filtering-faq'. + + +File: xemacs-faq.info, Node: Q4.0.3, Next: Q4.0.4, Prev: Q4.0.2, Up: Subsystems + +Q4.0.3: How can I get VM to automatically check for new mail? +------------------------------------------------------------- + + John Turner writes: + + Use the following: + + (setq vm-auto-get-new-mail 60) + + +File: xemacs-faq.info, Node: Q4.0.4, Next: Q4.0.5, Prev: Q4.0.3, Up: Subsystems + +Q4.0.4: [This question intentionally left blank] +------------------------------------------------ + + Obsolete question, left blank to avoid renumbering. + + +File: xemacs-faq.info, Node: Q4.0.5, Next: Q4.0.6, Prev: Q4.0.4, Up: Subsystems + +Q4.0.5: How do I get my outgoing mail archived? +----------------------------------------------- + + (setq mail-archive-file-name "~/outbox") + + +File: xemacs-faq.info, Node: Q4.0.6, Next: Q4.0.7, Prev: Q4.0.5, Up: Subsystems + +Q4.0.6: I have various addresses at which I receive mail. How can I tell VM to ignore them when doing a "reply-all"? +--------------------------------------------------------------------------------------------------------------------- + + Set `vm-reply-ignored-addresses' to a list, like + + (setq vm-reply-ignored-addresses + '("wing@nuspl@nvwls.cc.purdue.edu,netcom[0-9]*.netcom.com" + "wing@netcom.com" "wing@666.com")) + + Note that each string is a regular expression. + + +File: xemacs-faq.info, Node: Q4.0.7, Next: Q4.0.8, Prev: Q4.0.6, Up: Subsystems + +Q4.0.7: Is there a mailing list or FAQ for VM? +---------------------------------------------- + + A FAQ for VM exists at `http://www.cyberpass.net/~gorkab/vmfaq.htm'. + + VM has its own newsgroups gnu.emacs.vm.info and gnu.emacs.vm.bug. + + +File: xemacs-faq.info, Node: Q4.0.8, Next: Q4.0.9, Prev: Q4.0.7, Up: Subsystems + +Q4.0.8: Remote mail reading with VM. +------------------------------------ + + My mailbox lives at the office on a big honkin server. My regular +INBOX lives on my honkin desktop machine. I now can PPP to the office +from home which is far from honking... I'd like to be able to read +mail at home without storing it here and I'd like to use xemacs and VM +at home... Is there a recommended setup? + + Joseph J. Nuspl Jr. writes: + + There are several ways to do this. + + 1. Set your display to your home machine and run dxpc or one of + the other X compressors. + + 2. NFS mount your desktop machine on your home machine and + modify your pop command on your home machine to rsh to your + desktop machine and actually do the pop get's. + + 3. Run a POP server on your desktop machine as well and do a + sort of two tiered POP get. + + William Perry adds: + + Or you could run a pop script periodically on your desktop + machine, and just use ange-ftp or NFS to get to your mailbox. I + used to do this all the time back at IU. + + +File: xemacs-faq.info, Node: Q4.0.9, Next: Q4.0.10, Prev: Q4.0.8, Up: Subsystems + +Q4.0.9: rmail or VM gets an error incorporating new mail. +--------------------------------------------------------- + + Quoting the XEmacs PROBLEMS file: + + rmail and VM get new mail from `/usr/spool/mail/$USER' using a + program called `movemail'. This program interlocks with + `/bin/mail' using the protocol defined by `/bin/mail'. + + There are two different protocols in general use. One of them + uses the `flock' system call. The other involves creating a lock + file; `movemail' must be able to write in `/usr/spool/mail' in + order to do this. You control which one is used by defining, or + not defining, the macro `MAIL_USE_FLOCK' in `config.h' or the m- + or s- file it includes. + + *IF YOU DON'T USE THE FORM OF INTERLOCKING THAT IS NORMAL ON YOUR + SYSTEM, YOU CAN LOSE MAIL!* + + If your system uses the lock file protocol, and fascist + restrictions prevent ordinary users from writing the lock files in + `/usr/spool/mail', you may need to make `movemail' setgid to a + suitable group such as `mail'. You can use these commands (as + root): + + chgrp mail movemail + chmod 2755 movemail + + If your system uses the lock file protocol, and fascist + restrictions prevent ordinary users from writing the lock files in + `/usr/spool/mail', you may need to make `movemail' setgid to a + suitable group such as `mail'. To do this, use the following + commands (as root) after doing the make install. + + chgrp mail movemail + chmod 2755 movemail + + Installation normally copies movemail from the build directory to + an installation directory which is usually under `/usr/local/lib'. + The installed copy of `movemail' is usually in the directory + `/usr/local/lib/emacs/VERSION/TARGET'. You must change the group + and mode of the installed copy; changing the group and mode of the + build directory copy is ineffective. + + +File: xemacs-faq.info, Node: Q4.0.10, Next: Q4.0.11, Prev: Q4.0.9, Up: Subsystems + +Q4.0.10: How do I make VM stay in a single frame? +------------------------------------------------- + + John.John S Cooper writes: + + ; Don't use multiple frames + (setq vm-frame-per-composition nil) + (setq vm-frame-per-folder nil) + (setq vm-frame-per-edit nil) + (setq vm-frame-per-summary nil) + + +File: xemacs-faq.info, Node: Q4.0.11, Next: Q4.0.12, Prev: Q4.0.10, Up: Subsystems + +Q4.0.11: How do I make VM or mh-e display graphical smilies? +------------------------------------------------------------ + + For mh-e use the following: + + (add-hook 'mh-show-mode-hook '(lambda () + (smiley-region (point-min) + (point-max)))) + + WJCarpenter writes: For VM use the following: + (autoload 'smiley-region "smiley" nil t) + (add-hook 'vm-select-message-hook + '(lambda () + (smiley-region (point-min) + (point-max)))) + + For tm use the following: + (autoload 'smiley-buffer "smiley" nil t) + (add-hook 'mime-viewer/plain-text-preview-hook 'smiley-buffer) + + +File: xemacs-faq.info, Node: Q4.0.12, Next: Q4.1.1, Prev: Q4.0.11, Up: Subsystems + +Q4.0.12: Customization of VM not covered in the manual, or here. +---------------------------------------------------------------- + + giacomo boffi writes: + + The meta-answer is to look into the file `vm-vars.el', in the vm + directory of the lisp library. + + `vm-vars.el' contains, initializes and carefully describes, with + examples of usage, the plethora of user options that *fully* + control VM's behavior. + + Enter vm-vars, `forward-search' for toolbar, find the variables + that control the toolbar placement, appearance, existence, copy to + your `.emacs' or `.vm' and modify according to the detailed + instructions. + + The above also applies to all the various features of VM: search + for some keywords, maybe the first you conjure isn't appropriate, + find the appropriate variables, copy and experiment. + + +File: xemacs-faq.info, Node: Q4.1.1, Next: Q4.1.2, Prev: Q4.0.12, Up: Subsystems + +4.1: Web browsing with W3 +========================= + +Q4.1.1: What is W3? +------------------- + + W3 is an advanced graphical browser written in Emacs lisp that runs +on XEmacs. It has full support for cascaded style sheets, and more... + + It has a home web page at +`http://www.cs.indiana.edu/elisp/w3/docs.html'. + + +File: xemacs-faq.info, Node: Q4.1.2, Next: Q4.1.3, Prev: Q4.1.1, Up: Subsystems + +Q4.1.2: How do I run W3 from behind a firewall? +----------------------------------------------- + + There is a long, well-written, detailed section in the W3 manual that +describes how to do this. Look in the section entitled "Firewalls". + + +File: xemacs-faq.info, Node: Q4.1.3, Next: Q4.2.1, Prev: Q4.1.2, Up: Subsystems + +Q4.1.3: Is it true that W3 supports style sheets and tables? +------------------------------------------------------------ + + Yes, and much more. W3, as distributed with the latest XEmacs is a +full-featured web browser. + + +File: xemacs-faq.info, Node: Q4.2.1, Next: Q4.2.2, Prev: Q4.1.3, Up: Subsystems + +4.2: Reading Netnews and Mail with Gnus +======================================= + +Q4.2.1: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, Quassia Gnus, argh! +-------------------------------------------------------------------------------- + + The Gnus numbering issues are not meant for mere mortals to know +them. If you feel you *must* enter the muddy waters of Gnus, visit the +excellent FAQ, maintained by Justin Sheehy, at: + + `http://www.ccs.neu.edu/software/contrib/gnus/' + + See also Gnus home page + `http://www.gnus.org/' + + +File: xemacs-faq.info, Node: Q4.2.2, Next: Q4.2.3, Prev: Q4.2.1, Up: Subsystems + +Q4.2.2: This question intentionally left blank. +----------------------------------------------- + + Obsolete question, left blank to avoid renumbering. + + +File: xemacs-faq.info, Node: Q4.2.3, Next: Q4.2.4, Prev: Q4.2.2, Up: Subsystems + +Q4.2.3: How do I make Gnus stay within a single frame? +------------------------------------------------------ + + The toolbar code to start Gnus opens the new frame--and it's a +feature rather than a bug. If you don't like it, but would still like +to click on the seemly icon, use the following code: + + (defun toolbar-news () + (gnus)) + + It will redefine the callback function of the icon to just call +`gnus', without all the fancy frame stuff. + + +File: xemacs-faq.info, Node: Q4.2.4, Next: Q4.3.1, Prev: Q4.2.3, Up: Subsystems + +Q4.2.4: How do I customize the From: line? +------------------------------------------ + + How do I change the `From:' line? I have set gnus-user-from-line to + Gail Gurman + , but XEmacs Gnus doesn't use it. Instead it uses + Gail Mara Gurman + and then complains that it's incorrect. Also, as you perhaps can see, +my Message-ID is screwy. How can I change that? + +Lars Magne Ingebrigtsen writes: + + Set `user-mail-address' to `gail.gurman@sybase.com' or + `mail-host-address' to `sybase.com'. + + +File: xemacs-faq.info, Node: Q4.3.1, Next: Q4.3.2, Prev: Q4.2.4, Up: Subsystems + +4.3: Other Mail & News +====================== + +Q4.3.1: How can I read and/or compose MIME messages? +---------------------------------------------------- + + VM supports MIME natively. + + You probably want to use the Tools for MIME (tm). *Note Q4.3.2::, +for details. + + Trey Jackson has an Emacs & MIME web page at +`http://bmrc.berkeley.edu/~trey/emacs/mime.html'. + + Another possibility is RMIME. You may find RMIME at +`http://www.cinti.net/~rmoody/rmime/index.html'. + + +File: xemacs-faq.info, Node: Q4.3.2, Next: Q4.3.3, Prev: Q4.3.1, Up: Subsystems + +Q4.3.2: What is TM and where do I get it? +----------------------------------------- + + TM stands for "Tools for MIME" and not Tiny MIME. TM integrates +with all major XEmacs packages like Gnus (all flavors), VM, MH-E, and +mailcrypt. It provides totally transparent and trouble-free MIME +support. When appropriate a message will be decoded in place in an +XEmacs buffer. + + TM now comes as a package with XEmacs 19.16 and XEmacs 20.2. + + TM was written by MORIOKA Tomohiko and +KOBAYASHI Shuhei . + + It is based on the work of UMEDA Masanobu +, the original writer of GNUS. + + The following information is from the `README': + + "tm" is a MIME package for GNU Emacs. tm has following functions: + + * MIME style multilingual header. + + * MIME message viewer (mime/viewer-mode). + + * MIME message composer (mime/editor-mode). + + * MIME extenders for mh-e, GNUS, RMAIL and VM. + + tm is available from following anonymous ftp sites: + * `ftp://ftp.jaist.ac.jp/pub/GNU/elisp/mime/' (Japan). + + * `ftp://ftp.nis.co.jp/pub/gnu/emacs-lisp/tm/' (Japan). + + * `ftp://ftp.nisiq.net/pub/gnu/emacs-lisp/tm/' (US). + + * `ftp://ftp.miranova.com/pub/gnus/jaist.ac.jp/' (US). + + * `ftp://ftp.unicamp.br/pub/mail/mime/tm/' (Brasil). + + * `ftp://ftp.th-darmstadt.de/pub/editors/GNU-Emacs/lisp/mime/' + (Germany). + + * `ftp://ftp.tnt.uni-hannover.de/pub/editors/xemacs/contrib/' + (Germany). + + Don't let the installation procedure & instructions stop you from +trying this package out--it's much simpler than it looks, and once +installed, trivial to use. + + +File: xemacs-faq.info, Node: Q4.3.3, Next: Q4.3.4, Prev: Q4.3.2, Up: Subsystems + +Q4.3.3: Why isn't this `movemail' program working? +-------------------------------------------------- + + Ben Wing writes: + + It wasn't chown'ed/chmod'd correctly. + + +File: xemacs-faq.info, Node: Q4.3.4, Next: Q4.3.5, Prev: Q4.3.3, Up: Subsystems + +Q4.3.4: Movemail is also distributed by Netscape? Can that cause problems? +--------------------------------------------------------------------------- + + Steve Baur writes: + + Yes. Always use the movemail installed with your XEmacs. Failure + to do so can result in lost mail. + + Please refer to Jamie Zawinski's notes at +`http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/movemail.html'. +In particular, this document will show you how to make Netscape use the +version of movemail configured for your system by the person who built +XEmacs. + + +File: xemacs-faq.info, Node: Q4.3.5, Next: Q4.4.1, Prev: Q4.3.4, Up: Subsystems + +Q4.3.5: Where do I find pstogif (required by tm)? +------------------------------------------------- + + pstogif is part of the latex2html package. + + Jan Vroonhof writes: + + latex2html is best found at the CTAN hosts and their mirrors in +`tex-archive/support/latex2html'. + + CTAN hosts are: + + * `ftp://ftp.tex.ac.uk/tex-archive/support/latex2html/'. + + * `ftp://ftp.dante.de/tex-archive/support/latex2html/'. + + There is a good mirror at ftp.cdrom.com; +`ftp://ftp.cdrom.com/pub/tex/ctan/support/latex2html/'. + + +File: xemacs-faq.info, Node: Q4.4.1, Next: Q4.5.1, Prev: Q4.3.5, Up: Subsystems + +4.4: Sparcworks, EOS, and WorkShop +================================== + +Q4.4.1: What is SPARCworks, EOS, and WorkShop? +---------------------------------------------- + + John Turner writes: + + SPARCworks is SunSoft's development environment, comprising + compilers (C, C++, FORTRAN 77, Fortran 90, Ada, and Pascal), a + debugger, and other tools such as TeamWare (for configuration + management), MakeTool, etc. + + See `http://www.sun.com/software/Developer-products/' for more info. + + EOS stands for "Era on SPARCworks", but I don't know what Era stands +for. + + EOS is the integration of XEmacs with the SPARCworks debugger. It +allows one to use an XEmacs frame to view code (complete with +fontification, etc.), set breakpoints, print variables, etc., while +using the SPARCworks debugger. It works very well and I use it all the +time. + + Chuck Thompson writes: + + Era stood for "Emacs Rewritten Again". It was what we were + calling the modified version of Lucid Emacs for Sun when I was + dragged, er, allowed to work on this wonderful editor. + + Martin Buchholz writes: + + EOS is being replaced with a new graphical development environment + called Sun WorkShop, which is currently (07/96) in Alpha Test. + For more details, check out + + + + + + + + `http://www.sun.com/software/Products/Developer-products/programs.html'. + + +File: xemacs-faq.info, Node: Q4.5.1, Next: Q4.6.1, Prev: Q4.4.1, Up: Subsystems + +4.5: Energize +============= + +Q4.5.1: What is/was Energize? +----------------------------- + + David N Gray writes: + The files in `lisp/energize' are to enable Emacs to interface with + the "Energize Programming System", a C and C++ development + environment, which was a product of Lucid, Inc. Tragically, Lucid + went out of business in 1994, so although Energize is still a + great system, if you don't already have it, there isn't any way to + get it now. (Unless you happen to be in Japan; INS Engineering + may still be selling it there. Tartan bought the rights to sell + it in the rest of the world, but never did so.) + + +File: xemacs-faq.info, Node: Q4.6.1, Next: Q4.7.1, Prev: Q4.5.1, Up: Subsystems + +4.6: Infodock +============= + +Q4.6.1: What is Infodock? +------------------------- + + InfoDock is an integrated productivity toolset, mainly aimed at +technical people. It is developed and supported by InfoDock +Associates, a firm that offers custom support and development for +InfoDock, XEmacs and GNU Emacs. ( `http://www.infodock.com', +, +1 408 243 3300). + + InfoDock is built atop the XEmacs variant of GNU Emacs and so has +all of the power of Emacs, but with an easier to use and more +comprehensive menu-based user interface. The bottom portion of this +text describes how it differs from XEmacs and GNU Emacs from the Free +Software Foundation. + + InfoDock is aimed at people who want a free, turn-key productivity +environment. Although InfoDock is customizable, it is not intended for +people who like basic versions of Emacs which need to be customized +extensively for local use; standard Emacs distributions are better for +such uses. InfoDock is for those people who want a complete, +pre-customized environment in one package, which they need not touch +more than once or twice a year to update to new revisions. + + InfoDock is pre-built for SPARC SunOS/Solaris systems, PA-RISC HP-UX, +and Intel Linux systems. It is intended for use on a color display, +although most features will work on monochrome monitors. Simply unpack +InfoDock according to the instructions in the ID-INSTALL file and you +are ready to run. + + The InfoDock Manual is concise, yet sufficient as a user guide for +users who have never used an Emacs-type editor before. For users who +are already familiar with Emacs, it supplements the information in the +GNU Emacs Manual. + + InfoDock menus are much more extensive and more mature than standard +Emacs menus. Each menu offers a `Manual' item which displays +documentation associated with the menu's functions. + +Four types of menubars are provided: + 1. An extensive menubar providing access to global InfoDock commands. + + 2. Mode-specific menubars tailored to the current major mode. + + 3. A simple menubar for basic editing to help novices get started + with InfoDock. + + 4. The standard XEmacs menubar. + + Most modes also include mode-specific popup menus. Additionally, +region and rectangle popup menus are included. + + `Hyperbole', the everyday information manager, is a core part of +InfoDock. This provides context-sensitive mouse keys, a rolodex-type +contact manager, programmable hypertext buttons, and an autonumbered +outliner with embedded hyperlink anchors. + + The `OO-Browser', a multi-language object-oriented code browser, is a +standard part of InfoDock. + + InfoDock saves a more extensive set of user options than other Emacs +versions. + + InfoDock inserts a useful file header in many file types, showing the +author, summary, and last modification time of each file. A summary +program can then be used to summarize all of the files in a directory, +for easy MANIFEST file creation. + + Your working set of buffers is automatically saved and restored (if +you answer yes to a prompt) between InfoDock sessions. + + Refined color choices for code highlighting are provided for both +dark and light background display frames. + + The `C-z' key prefix performs frame-based commands which parallel the +`C-x' key prefix for window-based commands. + + The Smart Menu system is included for producing command menus on dumb +terminals. + + Lisp libraries are better categorized according to function. + + Extensions and improvements to many areas of Emacs are included, +such as: paragraph filling, mail reading with Rmail, shell handling, +outlining, code highlighting and browsing, and man page browsing. + + InfoDock questions, answers and discussion should go to the mail list +. Use to be +added or removed from the list. Always include your InfoDock version +number when sending help requests. + + InfoDock is available across the Internet via anonymous FTP. To get +it, first move to a directory into which you want the InfoDock archive +files placed. We will call this . + + cd + + Ftp to ftp.xemacs.org (Internet Host ID = 128.174.252.16): + + prompt> ftp ftp.xemacs.org + + Login as `anonymous' with your own @ as a +password. + + Name (ftp.xemacs.org): anonymous + 331 Guest login ok, send your complete e-mail address as password. + Password: -@ + 230 Guest login ok, access restrictions apply. + + Move to the location of the InfoDock archives: + + ftp> cd pub/infodock + + Set your transfer mode to binary: + + ftp> bin + 200 Type set to I. + + Turn off prompting: + + ftp> prompt + Interactive mode off. + + Retrieve the InfoDock archives that you want, either by using a `get +' for each file you want or by using the following to get a +complete distribution, including all binaries: + + ftp> mget ID-INSTALL + ftp> mget id-* + + Close the FTP connection: + + ftp> quit + 221 Goodbye. + + Read the `ID-INSTALL' file which you just retrieved for step-by-step +installation instructions. + + +File: xemacs-faq.info, Node: Q4.7.1, Next: Q4.7.2, Prev: Q4.6.1, Up: Subsystems + +4.7: Other Unbundled Packages +============================= + +Q4.7.1: What is AUC TeX? Where do you get it? +---------------------------------------------- + + AUC TeX is a package written by Per Abrahamsen . +Starting with XEmacs 19.16, AUC TeX is bundled with XEmacs. The +following information is from the `README' and website. + + AUC TeX is an extensible package that supports writing and formatting +TeX files for most variants of GNU Emacs. Many different macro packages +are supported, including AMS TeX, LaTeX, and TeXinfo. + + The most recent version is always available by ftp at +`ftp://sunsite.auc.dk/packages/auctex/auctex.tar.gz'. + + In case you don't have access to anonymous ftp, you can get it by an +email request to . + + WWW users may want to check out the AUC TeX page at +`http://sunsite.auc.dk/auctex/'. + + +File: xemacs-faq.info, Node: Q4.7.2, Next: Q4.7.3, Prev: Q4.7.1, Up: Subsystems + +Q4.7.2: Are there any Emacs Lisp Spreadsheets? +---------------------------------------------- + + Yes. Check out "dismal" (which stands for Dis' Mode Ain't Lotus) at +`ftp://cs.nyu.edu/pub/local/fox/dismal/'. + + +File: xemacs-faq.info, Node: Q4.7.3, Next: Q4.7.4, Prev: Q4.7.2, Up: Subsystems + +Q4.7.3: Byte compiling AUC TeX on XEmacs 19.14. +----------------------------------------------- + + Georges Brun-Cottan writes: + + When byte compiling auctex-9.4g, you must use the command: + + xemacs -batch -l lpath.el + + +File: xemacs-faq.info, Node: Q4.7.4, Next: Q4.7.5, Prev: Q4.7.3, Up: Subsystems + +Q4.7.4: Problems installing AUC TeX. +------------------------------------ + + Jan Vroonhof writes: + + AUC TeX works fine on both stock Emacs and XEmacs has been doing + so for a very very long time. This is mostly due to the work of + Per Abrahamsen (clap clap) in particular his + `easymenu' package. Which leads to what is probably the problem... + + Most problems with AUC TeX are one of two things: + + * The TeX-lisp-directory in `tex-site.el' and the makefile don't + match. + + Fix: make sure you configure AUC TeX properly *before* installing. + + * You have an old version of easymenu.el in your path. + + Fix: use `locate-library' and remove old versions to make sure it + *only* finds the one that came with XEmacs. + + +File: xemacs-faq.info, Node: Q4.7.5, Next: Q4.7.6, Prev: Q4.7.4, Up: Subsystems + +Q4.7.5: Is there a reason for an Emacs package not to be included in XEmacs? +---------------------------------------------------------------------------- + + The reason for an Emacs package not to be included in XEmacs is +usually one or more of the following: + + 1. The package has not been ported to XEmacs. This will typically + happen when it uses GNU-Emacs-specific features, which make it + fail under XEmacs. + + Porting a package to XEmacs can range from a trivial amount of + change to a partial or full rewrite. Fortunately, the authors of + modern packages usually choose to support both Emacsen themselves. + + 2. The package has been decided not to be appropriate for XEmacs. It + may have an equivalent or better replacement within XEmacs, in + which case the developers may choose not to burden themselves with + supporting an additional package. + + 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. + + 3. The package simply hasn't been noted by the XEmacs development. If + that's the case, the messages like yours are very useful for + attracting our attention. + + 4. The package was noted by the developers, but they simply haven't + yet gotten around to including/porting it. Wait for the next + release or, even better, offer your help. It will be gladly + accepted and appreciated. + + +File: xemacs-faq.info, Node: Q4.7.6, Prev: Q4.7.5, Up: Subsystems + +Q4.7.5: Is there a MatLab mode? +------------------------------- + + Is there any way I can get syntax highlighting for MatLab .m files? +Can I "teach" emacs what words are MatLab commands, comments, etc. ? + + Ulrich Elsner writes: + One way to do this (and much more) is by using the + matlab mode + (ftp://ftp.mathworks.com/pub/contrib/v5/tools/matlab.el). + + Instructions on how to install this mode are included in this file. + + +File: xemacs-faq.info, Node: Miscellaneous, Next: Current Events, Prev: Subsystems, Up: Top + +5 The Miscellaneous Stuff +************************* + + This is part 5 of the XEmacs Frequently Asked Questions list. This +section is devoted to anything that doesn't fit neatly into the other +sections. + +* Menu: + +Major & Minor Modes: +* Q5.0.1:: How can I do source code highlighting using font-lock? +* Q5.0.2:: I do not like cc-mode. How do I use the old c-mode? +* Q5.0.3:: How do I get `More' Syntax Highlighting on by default? +* Q5.0.4:: How can I enable auto-indent? +* Q5.0.5:: How can I get XEmacs to come up in text/auto-fill mode by default? +* Q5.0.6:: How do I start up a second shell buffer? +* Q5.0.7:: Telnet from shell filters too much. +* 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:: 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:: 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? + +Emacs Lisp Programming Techniques: +* Q5.1.1:: The difference in key sequences between XEmacs and GNU Emacs? +* Q5.1.2:: Can I generate "fake" keyboard events? +* Q5.1.3:: Could you explain `read-kbd-macro' in more detail? +* Q5.1.4:: What is the performance hit of `let'? +* Q5.1.5:: What is the recommended use of `setq'? +* Q5.1.6:: What is the typical misuse of `setq'? +* Q5.1.7:: I like the the `do' form of cl, does it slow things down? +* Q5.1.8:: I like recursion, does it slow things down? +* Q5.1.9:: How do I put a glyph as annotation in a buffer? +* Q5.1.10:: `map-extents' won't traverse all of my extents! +* Q5.1.11:: My elisp program is horribly slow. Is there an easy way to find out where it spends time? + +Sound: +* Q5.2.1:: How do I turn off the sound? +* Q5.2.2:: How do I get funky sounds instead of a boring beep? +* Q5.2.3:: What's NAS, how do I get it? +* Q5.2.4:: Sunsite sounds don't play. + +Miscellaneous: +* Q5.3.1:: How do you make XEmacs indent CL if-clauses correctly? +* Q5.3.2:: Fontifying hangs when editing a postscript file. +* Q5.3.3:: How can I print WYSIWYG a font-locked buffer? +* Q5.3.4:: Getting `M-x lpr' to work with postscript printer. +* Q5.3.5:: How do I specify the paths that XEmacs uses for finding files? +* Q5.3.6:: [This question intentionally left blank] +* Q5.3.7:: Can I have the end of the buffer delimited in some way? +* Q5.3.8:: How do I insert today's date into a buffer? +* Q5.3.9:: Are only certain syntactic character classes available for abbrevs? +* Q5.3.10:: How can I get those oh-so-neat X-Face lines? +* Q5.3.11:: How do I add new Info directories? +* Q5.3.12:: What do I need to change to make printing work? + + +File: xemacs-faq.info, Node: Q5.0.1, Next: Q5.0.2, Prev: Miscellaneous, Up: Miscellaneous + +5.0: Major & Minor Modes +======================== + +Q5.0.1: How can I do source code highlighting using font-lock? +-------------------------------------------------------------- + + For most modes, font-lock is already set up and just needs to be +turned on. This can be done by `M-x font-lock-mode', or by having +XEmacs automatically start it by adding lines like: + + (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock) + (add-hook 'dired-mode-hook 'turn-on-font-lock) + + to your `.emacs'. See the file `etc/sample.emacs' for more examples. + + See also `Syntax Highlighting' from the `Options' menu. Remember to +save options. + + +File: xemacs-faq.info, Node: Q5.0.2, Next: Q5.0.3, Prev: Q5.0.1, Up: Miscellaneous + +Q5.0.2: I do not like cc-mode. How do I use the old c-mode? +------------------------------------------------------------ + + Well, first off, consider if you really want to do this. cc-mode is +much more powerful than the old c-mode. If you're having trouble +getting your old offsets to work, try using `c-set-offset' instead. +You might also consider using the package `cc-compat'. + + But, if you still insist, add the following lines to your `.emacs': + + (fmakunbound 'c-mode) + (makunbound 'c-mode-map) + (fmakunbound 'c++-mode) + (makunbound 'c++-mode-map) + (makunbound 'c-style-alist) + (load-library "old-c-mode") + (load-library "old-c++-mode") + + This must be done before any other reference is made to either +c-mode or c++-mode. + + +File: xemacs-faq.info, Node: Q5.0.3, Next: Q5.0.4, Prev: Q5.0.2, Up: Miscellaneous + +Q5.0.3: How do I get `More' Syntax Highlighting on by default? +-------------------------------------------------------------- + + Use the following code in your `.emacs': + + (setq-default font-lock-maximum-decoration t) + + In versions of XEmacs prior to 19.14, you had to use a kludgy +solution like this: + + (setq c-font-lock-keywords c-font-lock-keywords-2 + c++-font-lock-keywords c++-font-lock-keywords-2 + lisp-font-lock-keywords lisp-font-lock-keywords-2) + + It will work for C, C++ and Lisp. + + See also `Syntax Highlighting' from the `Options' menu. Remember to +save options. + + +File: xemacs-faq.info, Node: Q5.0.4, Next: Q5.0.5, Prev: Q5.0.3, Up: Miscellaneous + +Q5.0.4: How can I enable auto-indent? +------------------------------------- + + Put the following line in your `.emacs': + + (setq indent-line-function 'indent-relative-maybe) + + If you want to get fancy, try the `filladapt' package available +standard with XEmacs. Put this into your `.emacs': + + (require 'filladapt) + (add-hook 'text-mode-hook 'turn-on-filladapt-mode) + ;;; and others ... + + You can customize filling and adaptive filling with Customize. +Select from the `Options' menu +`Customize->Emacs->->Editing->Fill->Fill...' or type `M-x customize + fill '. + + Note that well-behaving text-lookalike modes will run +`text-mode-hook' by default (e.g. that's what Message does). For the +nasty ones, you'll have to provide the `add-hook's yourself. + + Please note that the `fa-extras' package is no longer useful. + + +File: xemacs-faq.info, Node: Q5.0.5, Next: Q5.0.6, Prev: Q5.0.4, Up: Miscellaneous + +Q5.0.5: How can I get XEmacs to come up in text/auto-fill mode by default? +-------------------------------------------------------------------------- + + Try the following lisp in your `.emacs': + + (setq default-major-mode 'text-mode) + (setq text-mode-hook 'turn-on-auto-fill) + + *WARNING*: note that changing the value of `default-major-mode' from +`fundamental-mode' can break a large amount of built-in code that +expects newly created buffers to be in `fundamental-mode'. (Changing +from `fundamental-mode' to `text-mode' might not wreak too much havoc, +but changing to something more exotic like a lisp-mode would break many +Emacs packages). + + Note that Emacs by default starts up in buffer `*scratch*' in +`initial-major-mode', which defaults to `lisp-interaction-mode'. Thus +adding the following form to your Emacs init file will cause the +initial `*scratch*' buffer to be put into auto-fill'ed `text-mode': + + (setq initial-major-mode + (lambda () + (text-mode) + (turn-on-auto-fill))) + + Note that after your init file is loaded, if +`inhibit-startup-message' is `nil' (the default) and the startup buffer +is `*scratch*' then the startup message will be inserted into +`*scratch*'; it will be removed after a timeout by erasing the entire +`*scratch*' buffer. Keep in mind this default usage of `*scratch*' if +you desire any prior manipulation of `*scratch*' from within your Emacs +init file. In particular, anything you insert into `*scratch*' from +your init file will be later erased. Also, if you change the mode of +the `*scratch*' buffer, be sure that this will not interfere with +possible later insertion of the startup message (e.g. if you put +`*scratch*' into a nonstandard mode that has automatic font lock rules, +then the startup message might get fontified in a strange foreign +manner, e.g. as code in some programming language). + + +File: xemacs-faq.info, Node: Q5.0.6, Next: Q5.0.7, Prev: Q5.0.5, Up: Miscellaneous + +Q5.0.6: How do I start up a second shell buffer? +------------------------------------------------ + + In the `*shell*' buffer: + + M-x rename-buffer *shell-1* + M-x shell RET + + This will then start a second shell. The key is that no buffer named +`*shell*' can exist. It might be preferable to use `M-x +rename-uniquely' to rename the `*shell*' buffer instead of `M-x +rename-buffer'. + + Alternately, you can set the variable `shell-multiple-shells'. If +the value of this variable is non-nil, each time shell mode is invoked, +a new shell is made + + +File: xemacs-faq.info, Node: Q5.0.7, Next: Q5.0.8, Prev: Q5.0.6, Up: Miscellaneous + +Q5.0.7: Telnet from shell filters too much +------------------------------------------ + + I'm using the Emacs `M-x shell' function, and I would like to invoke +and use a telnet session within it. Everything works fine except that +now all `^M''s are filtered out by Emacs. Fixes? + + Use `M-x rsh' or `M-x telnet' to open remote sessions rather than +doing rsh or telnet within the local shell buffer. Starting with +XEmacs-20.3 you can also use `M-x ssh' to open secure remote session if +you have `ssh' installed. + + +File: xemacs-faq.info, Node: Q5.0.8, Next: Q5.0.9, Prev: Q5.0.7, Up: Miscellaneous + +Q5.0.8: Why does edt emulation not work? +---------------------------------------- + + We don't know, but you can use tpu-edt emulation instead, which works +fine and is a little fancier than the standard edt emulation. To do +this, add the following line to your `.emacs': + + (tpu-edt) + + If you don't want it to replace `C-h' with an edt-style help menu +add this as well: + + (global-set-key [(control h)] 'help-for-help) + + +File: xemacs-faq.info, Node: Q5.0.9, Next: Q5.0.10, Prev: Q5.0.8, Up: Miscellaneous + +Q5.0.9: How can I emulate VI and use it as my default mode? +----------------------------------------------------------- + + Our recommended VI emulator is viper. To make viper-mode the default, +add this to your `.emacs': + + (viper-mode) + + Michael Kifer writes: + + This should be added as close to the top of `.emacs' as you can get + it, otherwise some minor modes may not get viper-ized. + + +File: xemacs-faq.info, Node: Q5.0.10, Next: Q5.0.11, Prev: Q5.0.9, Up: Miscellaneous + +Q5.0.10: [This question intentionally left blank] +------------------------------------------------- + + Obsolete question, left blank to avoid renumbering + + +File: xemacs-faq.info, Node: Q5.0.11, Next: Q5.0.12, Prev: Q5.0.10, Up: Miscellaneous + +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 `.emacs' will turn it on for all buffers: + + (setq-default filladapt-mode t) + + Use `turn-on-filladapt-mode' to turn Filladapt on in particular +major modes, like this: + + (add-hook 'text-mode-hook 'turn-on-filladapt-mode) + + +File: xemacs-faq.info, Node: Q5.0.12, Next: Q5.0.13, Prev: Q5.0.11, Up: Miscellaneous + +Q5.0.12: How do I disable gnuserv from opening a new frame? +----------------------------------------------------------- + + If you set the `gnuserv-frame' variable to the frame that should be +used to display buffers that are pulled up, a new frame will not be +created. For example, you could put + + (setq gnuserv-frame (selected-frame)) + + early on in your `.emacs', to ensure that the first frame created is +the one used for your gnuserv buffers. + + Starting in 19.15, there is an option to set the gnuserv target to +the current frame. See `Options->"Other Window" Location->Make current +frame gnuserv target' + + Starting with XEmacs-20.3 you can also change this with Customize. +Select from the `Options' menu +`Customize->Emacs->Environment->Gnuserv->Gnuserv Frame...' or type `M-x +customize gnuserv '. + + +File: xemacs-faq.info, Node: Q5.0.13, Next: Q5.0.14, Prev: Q5.0.12, Up: Miscellaneous + +Q5.0.13: How do I start gnuserv so that each subsequent XEmacs is a client? +--------------------------------------------------------------------------- + + Put the following in your `.emacs' file to start the server: + + (gnuserv-start) + + Start your first XEmacs as usual. After that, you can do: + + gnuclient randomfilename + + from the command line to get your existing XEmacs process to open a +new frame and visit randomfilename in that window. When you're done +editing randomfilename, hit `C-x #' to kill the buffer and get rid of +the frame. + + See also man page of gnuclient. + + +File: xemacs-faq.info, Node: Q5.0.14, Next: Q5.0.15, Prev: Q5.0.13, Up: Miscellaneous + +Q5.0.14: Strange things are happening in Shell Mode. +---------------------------------------------------- + + Sometimes (i.e. it's not repeatable, and I can't work out why it +happens) when I'm typing into shell mode, I hit return and only a +portion of the command is given to the shell, and a blank prompt is +returned. If I hit return again, the rest of the previous command is +given to the shell. + + Martin Buchholz writes: + + There is a known problem with interaction between `csh' and the + `filec' option and XEmacs. You should add the following to your + `.cshrc': + + if ( "$TERM" == emacs || "$TERM" == unknown ) unset filec + + +File: xemacs-faq.info, Node: Q5.0.15, Next: Q5.0.16, Prev: Q5.0.14, Up: Miscellaneous + +Q5.0.15: Where do I get the latest CC Mode? +------------------------------------------- + + Barry A. Warsaw writes: + + This can be had from `http://www.python.org/ftp/emacs/'. + + +File: xemacs-faq.info, Node: Q5.0.16, Next: Q5.0.17, Prev: Q5.0.15, Up: Miscellaneous + +Q5.0.16: I find auto-show-mode disconcerting. How do I turn it off? +-------------------------------------------------------------------- + + `auto-show-mode' controls whether or not a horizontal scrollbar +magically appears when a line is too long to be displayed. This is +enabled by default. To turn it off, put the following in your `.emacs': + + (setq auto-show-mode nil) + (setq-default auto-show-mode nil) + + +File: xemacs-faq.info, Node: Q5.0.17, Next: Q5.0.18, Prev: Q5.0.16, Up: Miscellaneous + +Q5.0.17: How can I get two instances of info? +--------------------------------------------- + + You can't. The `info' package does not provide for multiple info +buffers. + + +File: xemacs-faq.info, Node: Q5.0.18, Next: Q5.0.19, Prev: Q5.0.17, Up: Miscellaneous + +Q5.0.18: I upgraded to XEmacs 19.14 and gnuserv stopped working. +---------------------------------------------------------------- + + Mark Daku writes: + + 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 `lib/xemacs-19.14/hppa1.1-hp-hpux9.05/gnuserv'. + Shouldn't it have been put in `bin/hppa1.1-hp-hpux9.0'? + + +File: xemacs-faq.info, Node: Q5.0.19, Next: Q5.0.20, Prev: Q5.0.18, Up: Miscellaneous + +Q5.0.19: Is there something better than LaTeX mode? +--------------------------------------------------- + + David Kastrup writes: + + The standard TeX modes leave much to be desired, and are somewhat + leniently maintained. Serious TeX users use AUC TeX (*note + Q4.7.1::.). + diff --git a/info/xemacs-faq.info-5 b/info/xemacs-faq.info-5 new file mode 100644 index 0000000..f7ed4c3 --- /dev/null +++ b/info/xemacs-faq.info-5 @@ -0,0 +1,903 @@ +This is Info file ../info/xemacs-faq.info, produced by Makeinfo version +1.68 from the input file xemacs-faq.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* FAQ: (xemacs-faq). XEmacs FAQ. +END-INFO-DIR-ENTRY + + +File: xemacs-faq.info, Node: Q5.0.20, Next: Q5.1.1, Prev: Q5.0.19, Up: Miscellaneous + +Q5.0.20: Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient? +--------------------------------------------------------------------------------------------------------- + + Jan Vroonhof writes: + Here is one of the solutions, we have this in a script called + `etc/editclient.sh'. + #!/bin/sh + if gnuclient -batch -eval t >/dev/null 2>&1 + then + exec gnuclient ${1+"$@"} + else + xemacs -unmapped -f gnuserv-start & + until gnuclient -batch -eval t >/dev/null 2>&1 + do + sleep 1 + done + exec gnuclient ${1+"$@"} + fi + + Note that there is a known problem when running XEmacs and + 'gnuclient -nw' on the same TTY. + + +File: xemacs-faq.info, Node: Q5.1.1, Next: Q5.1.2, Prev: Q5.0.20, Up: Miscellaneous + +5.1: Emacs Lisp Programming Techniques +====================================== + +Q5.1.1: What is the difference in key sequences between XEmacs and GNU Emacs? +----------------------------------------------------------------------------- + + Erik Naggum writes; + + Emacs has a legacy of keyboards that produced characters with + modifier bits, and therefore map a variety of input systems into + this scheme even today. XEmacs is instead optimized for X events. + This causes an incompatibility in the way key sequences are + specified, but both Emacs and XEmacs will accept a key sequence as + a vector of lists of modifiers that ends with a key, e.g., to bind + `M-C-a', you would say `[(meta control a)]' in both Emacsen. + XEmacs has an abbreviated form for a single key, just (meta + control a). Emacs has an abbreviated form for the Control and the + Meta modifiers to string-characters (the ASCII characters), as in + `\M-\C-a'. XEmacs users need to be aware that the abbreviated + form works only for one-character key sequences, while Emacs users + need to be aware that the string-character is rather limited. + Specifically, the string-character can accommodate only 256 + different values, 128 of which have the Meta modifier and 128 of + which have not. In each of these blocks, only 32 characters have + the Control modifier. Whereas `[(meta control A)]' differs from + `[(meta control a)]' because the case differs, `\M-\C-a' and + `\M-\C-A' do not. Programmers are advised to use the full common + form, both because it is more readable and less error-prone, and + because it is supported by both Emacsen. + + Another (even safer) way to be sure of the key-sequences is to use +the `read-kbd-macro' function, which takes a string like `C-c ', +and converts it to the internal key representation of the Emacs you +use. The function is available both on XEmacs and GNU Emacs. + + +File: xemacs-faq.info, Node: Q5.1.2, Next: Q5.1.3, Prev: Q5.1.1, Up: Miscellaneous + +Q5.1.2: Can I generate "fake" keyboard events? +---------------------------------------------- + + I wonder if there is an interactive function that can generate +"fake" keyboard events. This way, I could simply map them inside +XEmacs. + + This seems to work: + + (defun cg--generate-char-event (ch) + "Generate an event, as if ch has been typed" + (dispatch-event (character-to-event ch))) + + ;; Backspace and Delete stuff + (global-set-key [backspace] + (lambda () (interactive) (cg--generate-char-event 127))) + (global-set-key [unknown_keysym_0x4] + (lambda () (interactive) (cg--generate-char-event 4))) + + +File: xemacs-faq.info, Node: Q5.1.3, Next: Q5.1.4, Prev: Q5.1.2, Up: Miscellaneous + +Q5.1.3: Could you explain `read-kbd-macro' in more detail? +---------------------------------------------------------- + + The `read-kbd-macro' function returns the internal Emacs +representation of a human-readable string (which is its argument). +Thus: + + (read-kbd-macro "C-c C-a") + => [(control ?c) (control ?a)] + + (read-kbd-macro "C-c C-. ") + => [(control ?c) (control ?.) up] + + In GNU Emacs the same forms will be evaluated to what GNU Emacs +understands internally--the sequences `"\C-x\C-c"' and `[3 67108910 +up]', respectively. + + The exact "human-readable" syntax is defined in the docstring of +`edmacro-mode'. I'll repeat it here, for completeness. + + Format of keyboard macros during editing: + + Text is divided into "words" separated by whitespace. Except for + the words described below, the characters of each word go directly + as characters of the macro. The whitespace that separates words is + ignored. Whitespace in the macro must be written explicitly, as in + `foo bar '. + + * The special words `RET', `SPC', `TAB', `DEL', `LFD', `ESC', + and `NUL' represent special control characters. The words + must be written in uppercase. + + * A word in angle brackets, e.g., `', `', or + `', represents a function key. (Note that in the standard + configuration, the function key `' and the control key + are synonymous.) You can use angle brackets on the + words , , etc., but they are not required there. + + * Keys can be written by their ASCII code, using a backslash + followed by up to six octal digits. This is the only way to + represent keys with codes above \377. + + * One or more prefixes `M-' (meta), `C-' (control), `S-' + (shift), `A-' (alt), `H-' (hyper), and `s-' (super) may + precede a character or key notation. For function keys, the + prefixes may go inside or outside of the brackets: `C-' + == `'. The prefixes may be written in any order: + `M-C-x' == `C-M-x'. + + Prefixes are not allowed on multi-key words, e.g., `C-abc', + except that the Meta prefix is allowed on a sequence of + digits and optional minus sign: `M--123' == `M-- M-1 M-2 M-3'. + + * The `^' notation for control characters also works: `^M' == + `C-m'. + + * Double angle brackets enclose command names: `<>' + is shorthand for `M-x next-line '. + + * Finally, `REM' or `;;' causes the rest of the line to be + ignored as a comment. + + Any word may be prefixed by a multiplier in the form of a decimal + number and `*': `3*' == ` ', and + `10*foo' == `foofoofoofoofoofoofoofoofoofoo'. + + Multiple text keys can normally be strung together to form a word, + but you may need to add whitespace if the word would look like one + of the above notations: `; ; ;' is a keyboard macro with three + semicolons, but `;;;' is a comment. Likewise, `\ 1 2 3' is four + keys but `\123' is a single key written in octal, and `< right >' + is seven keys but `' is a single function key. When in + doubt, use whitespace. + + +File: xemacs-faq.info, Node: Q5.1.4, Next: Q5.1.5, Prev: Q5.1.3, Up: Miscellaneous + +Q5.1.4: What is the performance hit of `let'? +--------------------------------------------- + + In most cases, not noticeable. Besides, there's no avoiding +`let'--you have to bind your local variables, after all. Some pose a +question whether to nest `let's, or use one `let' per function. I +think because of clarity and maintenance (and possible future +implementation), `let'-s should be used (nested) in a way to provide +the clearest code. + + +File: xemacs-faq.info, Node: Q5.1.5, Next: Q5.1.6, Prev: Q5.1.4, Up: Miscellaneous + +Q5.1.5: What is the recommended use of `setq'? +---------------------------------------------- + + * Global variables + + You will typically `defvar' your global variable to a default + value, and use `setq' to set it later. + + It is never a good practice to `setq' user variables (like + `case-fold-search', etc.), as it ignores the user's choice + unconditionally. Note that `defvar' doesn't change the value of a + variable if it was bound previously. If you wish to change a + user-variable temporarily, use `let': + + (let ((case-fold-search nil)) + ... ; code with searches that must be case-sensitive + ...) + + You will notice the user-variables by their docstrings beginning + with an asterisk (a convention). + + * Local variables + + Bind them with `let', which will unbind them (or restore their + previous value, if they were bound) after exiting from the `let' + form. Change the value of local variables with `setq' or whatever + you like (e.g. `incf', `setf' and such). The `let' form can even + return one of its local variables. + + Typical usage: + + ;; iterate through the elements of the list returned by + ;; `hairy-function-that-returns-list' + (let ((l (hairy-function-that-returns-list))) + (while l + ... do something with (car l) ... + (setq l (cdr l)))) + + Another typical usage includes building a value simply to work + with it. + + ;; Build the mode keymap out of the key-translation-alist + (let ((inbox (file-truename (expand-file-name box))) + (i 0)) + ... code dealing with inbox ... + inbox) + + This piece of code uses the local variable `inbox', which becomes + unbound (or regains old value) after exiting the form. The form + also returns the value of `inbox', which can be reused, for + instance: + + (setq foo-processed-inbox + (let .....)) + + +File: xemacs-faq.info, Node: Q5.1.6, Next: Q5.1.7, Prev: Q5.1.5, Up: Miscellaneous + +Q5.1.6: What is the typical misuse of `setq' ? +---------------------------------------------- + + A typical misuse is probably `setq'ing a variable that was meant to +be local. Such a variable will remain bound forever, never to be +garbage-collected. For example, the code doing: + + (defun my-function (whatever) + (setq a nil) + ... build a large list ... + ... and exit ...) + + does a bad thing, as `a' will keep consuming memory, never to be +unbound. The correct thing is to do it like this: + + (defun my-function (whatever) + (let (a) ; default initialization is to nil + ... build a large list ... + ... and exit, unbinding `a' in the process ...) + + Not only is this prettier syntactically, but it makes it possible for +Emacs to garbage-collect the objects which `a' used to reference. + + Note that even global variables should not be `setq'ed without +`defvar'ing them first, because the byte-compiler issues warnings. The +reason for the warning is the following: + + (defun flurgoze nil) ; ok, global internal variable + ... + + (setq flurghoze t) ; ops! a typo, but semantically correct. + ; however, the byte-compiler warns. + + While compiling toplevel forms: + ** assignment to free variable flurghoze + + +File: xemacs-faq.info, Node: Q5.1.7, Next: Q5.1.8, Prev: Q5.1.6, Up: Miscellaneous + +Q5.1.7: I like the the `do' form of cl, does it slow things down? +----------------------------------------------------------------- + + It shouldn't. Here is what Dave Gillespie has to say about cl.el +performance: + + Many of the advanced features of this package, such as `defun*', + `loop', and `setf', are implemented as Lisp macros. In + byte-compiled code, these complex notations will be expanded into + equivalent Lisp code which is simple and efficient. For example, + the forms + + (incf i n) + (push x (car p)) + + are expanded at compile-time to the Lisp forms + + (setq i (+ i n)) + (setcar p (cons x (car p))) + + which are the most efficient ways of doing these respective + operations in Lisp. Thus, there is no performance penalty for + using the more readable `incf' and `push' forms in your compiled + code. + + *Interpreted* code, on the other hand, must expand these macros + every time they are executed. For this reason it is strongly + recommended that code making heavy use of macros be compiled. (The + features labelled "Special Form" instead of "Function" in this + manual are macros.) A loop using `incf' a hundred times will + execute considerably faster if compiled, and will also + garbage-collect less because the macro expansion will not have to + be generated, used, and thrown away a hundred times. + + You can find out how a macro expands by using the `cl-prettyexpand' + function. + + +File: xemacs-faq.info, Node: Q5.1.8, Next: Q5.1.9, Prev: Q5.1.7, Up: Miscellaneous + +Q5.1.8: I like recursion, does it slow things down? +--------------------------------------------------- + + Yes. Emacs byte-compiler cannot do much to optimize recursion. But +think well whether this is a real concern in Emacs. Much of the Emacs +slowness comes from internal mechanisms such as redisplay, or from the +fact that it is an interpreter. + + Please try not to make your code much uglier to gain a very small +speed gain. It's not usually worth it. + + +File: xemacs-faq.info, Node: Q5.1.9, Next: Q5.1.10, Prev: Q5.1.8, Up: Miscellaneous + +Q5.1.9: How do I put a glyph as annotation in a buffer? +------------------------------------------------------- + + Here is a solution that will insert the glyph annotation at the +beginning of buffer: + + (make-annotation (make-glyph '([FORMAT :file FILE] + [string :data "fallback-text"])) + (point-min) + 'text + (current-buffer)) + + Replace `FORMAT' with an unquoted symbol representing the format of +the image (e.g. `xpm', `xbm', `gif', `jpeg', etc.) Instead of `FILE', +use the image file name (e.g. +`/usr/local/lib/xemacs-20.2/etc/recycle.xpm'). + + You can turn this to a function (that optionally prompts you for a +file name), and inserts the glyph at `(point)' instead of `(point-min)'. + + +File: xemacs-faq.info, Node: Q5.1.10, Next: Q5.1.11, Prev: Q5.1.9, Up: Miscellaneous + +Q5.1.10: `map-extents' won't traverse all of my extents! +-------------------------------------------------------- + + I tried to use `map-extents' to do an operation on all the extents +in a region. However, it seems to quit after processing a random number +of extents. Is it buggy? + + No. The documentation of `map-extents' states that it will iterate +across the extents as long as FUNCTION returns `nil'. Unexperienced +programmers often forget to return `nil' explicitly, which results in +buggy code. For instance, the following code is supposed to delete all +the extents in a buffer, and issue as many `fubar!' messages. + + (map-extents (lambda (ext ignore) + (delete-extent ext) + (message "fubar!"))) + + Instead, it will delete only the first extent, and stop right there - +because `message' will return a non-nil value. The correct code is: + + (map-extents (lambda (ext ignore) + (delete-extent ext) + (message "fubar!") + nil)) + + +File: xemacs-faq.info, Node: Q5.1.11, Next: Q5.2.1, Prev: Q5.1.10, Up: Miscellaneous + +Q5.1.11: My elisp program is horribly slow. Is there +----------------------------------------------------- + + an easy way to find out where it spends time? + + zHrvoje Niksic writes: + Under XEmacs 20.4 and later you can use `M-x + profile-key-sequence', press a key (say in the Gnus Group + buffer), and get the results using `M-x profile-results'. It + should give you an idea of where the time is being spent. + + +File: xemacs-faq.info, Node: Q5.2.1, Next: Q5.2.2, Prev: Q5.1.11, Up: Miscellaneous + +Q5.2.1: How do I turn off the sound? +------------------------------------ + + Add the following line to your `.emacs': + + (setq bell-volume 0) + (setq sound-alist nil) + + 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. +Select from the `Options' menu +`Customize->Emacs->Environment->Sound->Sound...' or type `M-x customize + sound '. + + +File: xemacs-faq.info, Node: Q5.2.2, Next: Q5.2.3, Prev: Q5.2.1, Up: Miscellaneous + +Q5.2.2: How do I get funky sounds instead of a boring beep? +----------------------------------------------------------- + + Make sure your XEmacs was compiled with sound support, and then put +this in your `.emacs': + + (load-default-sounds) + + The sound support in XEmacs 19.14 was greatly improved over previous +versions. + + +File: xemacs-faq.info, Node: Q5.2.3, Next: Q5.2.4, Prev: Q5.2.2, Up: Miscellaneous + +Q5.2.3: What's NAS, how do I get it? +------------------------------------ + + *Note Q2.0.3::, for an explanation of the "Network Audio System". + + +File: xemacs-faq.info, Node: Q5.2.4, Next: Q5.3.1, Prev: Q5.2.3, Up: Miscellaneous + +Q5.2.4: Sunsite sounds don't play. +---------------------------------- + + I'm having some trouble with sounds I've downloaded from sunsite. +They play when I run them through `showaudio' or cat them directly to +`/dev/audio', but XEmacs refuses to play them. + + Markus Gutschke writes: + + [Many of] These files have an (erroneous) 24byte header that tells + about the format that they have been recorded in. If you cat them + to `/dev/audio', the header will be ignored and the default + behavior for /dev/audio will be used. This happens to be 8kHz + uLaw. It is probably possible to fix the header by piping through + `sox' and passing explicit parameters for specifying the sampling + format; you then need to perform a 'null' conversion from SunAudio + to SunAudio. + + +File: xemacs-faq.info, Node: Q5.3.1, Next: Q5.3.2, Prev: Q5.2.4, Up: Miscellaneous + +5.3: Miscellaneous +================== + +Q5.3.1: How do you make XEmacs indent CL if-clauses correctly? +-------------------------------------------------------------- + + I'd like XEmacs to indent all the clauses of a Common Lisp `if' the +same amount instead of indenting the 3rd clause differently from the +first two. + + One way is to add, to `.emacs': + + (put 'if 'lisp-indent-function nil) + + However, note that the package `cl-indent' that comes with XEmacs +sets up this kind of indentation by default. `cl-indent' also knows +about many other CL-specific forms. To use `cl-indent', one can do +this: + + (load "cl-indent") + (setq lisp-indent-function (function common-lisp-indent-function)) + + One can also customize `cl-indent.el' so it mimics the default `if' +indentation `then' indented more than the `else'. Here's how: + + (put 'if 'common-lisp-indent-function '(nil nil &body)) + + Also, a new version (1.2) of `cl-indent.el' was posted to +comp.emacs.xemacs on 12/9/94. This version includes more documentation +than previous versions. This may prove useful if you need to customize +any indent-functions. + + +File: xemacs-faq.info, Node: Q5.3.2, Next: Q5.3.3, Prev: Q5.3.1, Up: Miscellaneous + +Q5.3.2: Fontifying hang when editing a postscript file. +------------------------------------------------------- + + When I try to edit a postscript file it gets stuck saying: +`fontifying 'filename' (regexps....)' and it just sits there. If I +press `C-c' in the window where XEmacs was started, it suddenly becomes +alive again. + + This was caused by a bug in the Postscript font-lock regular +expressions. It was fixed in 19.13. For earlier versions of XEmacs, +have a look at your `.emacs' file. You will probably have a line like: + + (add-hook 'postscript-mode-hook 'turn-on-font-lock) + + Take it out, restart XEmacs, and it won't try to fontify your +postscript files anymore. + + +File: xemacs-faq.info, Node: Q5.3.3, Next: Q5.3.4, Prev: Q5.3.2, Up: Miscellaneous + +Q5.3.3: How can I print WYSIWYG a font-locked buffer? +----------------------------------------------------- + + Font-lock looks nice. How can I print (WYSIWYG) the highlighted +document? + + The package `ps-print', which is now included with XEmacs, provides +the ability to do this. The source code contains complete instructions +on its use, in `/lisp/packages/ps-print.el'. + + +File: xemacs-faq.info, Node: Q5.3.4, Next: Q5.3.5, Prev: Q5.3.3, Up: Miscellaneous + +Q5.3.4: Getting `M-x lpr' to work with postscript printer. +---------------------------------------------------------- + + My printer is a Postscript printer and `lpr' only works for +Postscript files, so how do I get `M-x lpr-region' and `M-x lpr-buffer' +to work? + + Put something like this in your `.emacs': + + (setq lpr-command "a2ps") + (setq lpr-switches '("-p" "-1")) + + If you don't use a2ps to convert ASCII to postscript (why not, it's +free?), replace with the command you do use. Note also that some +versions of a2ps require a `-Pprinter' to ensure spooling. + + +File: xemacs-faq.info, Node: Q5.3.5, Next: Q5.3.6, Prev: Q5.3.4, Up: Miscellaneous + +Q5.3.5: How do I specify the paths that XEmacs uses for finding files? +---------------------------------------------------------------------- + + You can specify what paths to use by using a number of different +flags when running configure. See the section MAKE VARIABLES in the +top-level file INSTALL in the XEmacs distribution for a listing of +those flags. + + Most of the time, however, the simplest fix is: *do not* specify +paths as you might for GNU Emacs. XEmacs can generally determine the +necessary paths dynamically at run time. The only path that generally +needs to be specified is the root directory to install into. That can +be specified by passing the `--prefix' flag to configure. For a +description of the XEmacs install tree, please consult the `NEWS' file. + + +File: xemacs-faq.info, Node: Q5.3.6, Next: Q5.3.7, Prev: Q5.3.5, Up: Miscellaneous + +Q5.3.6: [This question intentionally left blank] +------------------------------------------------ + + Obsolete question, left blank to avoid renumbering. + + +File: xemacs-faq.info, Node: Q5.3.7, Next: Q5.3.8, Prev: Q5.3.6, Up: Miscellaneous + +Q5.3.7: Can I have the end of the buffer delimited in some way? +--------------------------------------------------------------- + + Say, with: `[END]'? + + Try this: + + (let ((ext (make-extent (point-min) (point-max)))) + (set-extent-property ext 'start-closed t) + (set-extent-property ext 'end-closed t) + (set-extent-property ext 'detachable nil) + (set-extent-end-glyph ext (make-glyph [string :data "[END]"]))) + + Since this is XEmacs, you can specify an icon to be shown on +window-system devices. To do so, change the `make-glyph' call to +something like this: + + (make-glyph '([xpm :file "~/something.xpm"] + [string :data "[END]"])) + + You can inline the XPM definition yourself by specifying `:data' +instead of `:file'. Here is such a full-featured version that works on +both X and TTY devices: + + (let ((ext (make-extent (point-min) (point-max)))) + (set-extent-property ext 'start-closed t) + (set-extent-property ext 'end-closed t) + (set-extent-property ext 'detachable nil) + (set-extent-end-glyph ext (make-glyph '([xpm :data "\ + /* XPM */ + static char* eye = { + \"20 11 7 2\", + \"__ c None\" + \"_` c #7f7f7f\", + \"_a c #fefefe\", + \"_b c #7f0000\", + \"_c c #fefe00\", + \"_d c #fe0000\", + \"_e c #bfbfbf\", + \"___________`_`_`___b_b_b_b_________`____\", + \"_________`_`_`___b_c_c_c_b_b____________\", + \"_____`_`_`_e___b_b_c_c_c___b___b_______`\", + \"___`_`_e_a___b_b_d___b___b___b___b______\", + \"_`_`_e_a_e___b_b_d_b___b___b___b___b____\", + \"_`_`_a_e_a___b_b_d___b___b___b___b___b__\", + \"_`_`_e_a_e___b_b_d_b___b___b___b___b_b__\", + \"___`_`_e_a___b_b_b_d_c___b___b___d_b____\", + \"_____`_`_e_e___b_b_b_d_c___b_b_d_b______\", + \"_`_____`_`_`_`___b_b_b_d_d_d_d_b________\", + \"___`_____`_`_`_`___b_b_b_b_b_b__________\", + } ;"] + [string :data "[END]"])))) + + Note that you might want to make this a function, and put it to a +hook. We leave that as an exercise for the reader. + + +File: xemacs-faq.info, Node: Q5.3.8, Next: Q5.3.9, Prev: Q5.3.7, Up: Miscellaneous + +Q5.3.8: How do I insert today's date into a buffer? +--------------------------------------------------- + + Like this: + + (insert (current-time-string)) + + +File: xemacs-faq.info, Node: Q5.3.9, Next: Q5.3.10, Prev: Q5.3.8, Up: Miscellaneous + +Q5.3.9: Are only certain syntactic character classes available for abbrevs? +--------------------------------------------------------------------------- + + Markus Gutschke writes: + + Yes, abbrevs only expands word-syntax strings. While XEmacs does + not prevent you from defining (e.g. with `C-x a g' or `C-x a l') + abbrevs that contain special characters, it will refuse to expand + them. So you need to ensure, that the abbreviation contains + letters and digits only. This means that `xd', `d5', and `5d' are + valid abbrevs, but `&d', and `x d' are not. + + If this sounds confusing to you, (re-)read the online + documentation for abbrevs (`C-h i m XEmacs m Abbrevs + '), and then come back and read this question/answer again. + + Starting with XEmacs 20.3 this restriction has been lifted. + + +File: xemacs-faq.info, Node: Q5.3.10, Next: Q5.3.11, Prev: Q5.3.9, Up: Miscellaneous + +Q5.3.10: How can I get those oh-so-neat X-Face lines? +----------------------------------------------------- + + Firstly there is an ftp site which describes X-faces and has the +associated tools mentioned below, at +`ftp://ftp.cs.indiana.edu:/pub/faces/'. + + Then the steps are + + 1. Create 48x48x1 bitmap with your favorite tool + + 2. Convert to "icon" format using one of xbm2ikon, pbmtoicon, etc., + and then compile the face. + + 3. cat file.xbm | xbm2ikon |compface > file.face + + 4. Then be sure to quote things that are necessary for emacs strings: + + cat ./file.face | sed 's/\\/\\\\/g' + | sed 's/\"/\\\"/g' > ./file.face.quoted + + 5. Then set up emacs to include the file as a mail header - there + were a couple of suggestions here--either something like: + + (setq mail-default-headers + "X-Face: ") + + Or, alternatively, as: + + (defun mail-insert-x-face () + (save-excursion + (goto-char (point-min)) + (search-forward mail-header-separator) + (beginning-of-line) + (insert "X-Face:") + (insert-file-contents "~/.face"))) + + (add-hook 'mail-setup-hook 'mail-insert-x-face) + + However, 2 things might be wrong: + + Some versions of pbmtoicon produces some header lines that is not +expected by the version of compface that I grabbed. So I found I had to +include a `tail +3' in the pipeline like this: + + cat file.xbm | xbm2ikon | tail +3 |compface > file.face + + Some people have also found that if one uses the `(insert-file)' +method, one should NOT quote the face string using the sed script . + + It might also be helpful to use Stig's script +(included in the compface distribution at XEmacs.org) to do the +conversion. For convenience xbm2xface is available for anonymous FTP at +`ftp://ftp.miranova.com/pub/xemacs/xbm2xface.pl'. + + Contributors for this item: + + Paul Emsley, Ricardo Marek, Amir J. Katz, Glen McCort, Heinz Uphoff, +Peter Arius, Paul Harrison, and Vegard Vesterheim + + +File: xemacs-faq.info, Node: Q5.3.11, Next: Q5.3.12, Prev: Q5.3.10, Up: Miscellaneous + +Q5.3.11: How do I add new Info directories? +------------------------------------------- + + You use something like: + + (setq Info-directory-list (cons + (expand-file-name "~/info") + Info-default-directory-list)) + + David Masterson writes: + + Emacs Info and XEmacs Info do many things differently. If you're + trying to support a number of versions of Emacs, here are some + notes to remember: + + 1. Emacs Info scans `Info-directory-list' from right-to-left + while XEmacs Info reads it from left-to-right, so append to + the *correct* end of the list. + + 2. Use `Info-default-directory-list' to initialize + `Info-directory-list' *if* it is available at startup, but not + all Emacsen define it. + + 3. Emacs Info looks for a standard `dir' file in each of the + directories scanned from #1 and magically concatenates them + together. + + 4. XEmacs Info looks for a `localdir' file (which consists of + just the menu entries from a `dir' file) in each of the + directories scanned from #1 (except the first), does a simple + concatenation of them, and magically attaches the resulting + list to the end of the menu in the `dir' file in the first + directory. + + Another alternative is to convert the documentation to HTML with + texi2html and read it from a web browser like Lynx or W3. + + +File: xemacs-faq.info, Node: Q5.3.12, Prev: Q5.3.11, Up: Miscellaneous + +Q5.3.12: What do I need to change to make printing work? +-------------------------------------------------------- + + For regular printing there are two variables that can be customized. + +`lpr-command' + This should be set to a command that takes standard input and sends + it to a printer. Something like: + + (setq lpr-command "lp") + +`lpr-switches' + This should be set to a list that contains whatever the print + command requires to do its job. Something like: + + (setq lpr-switches '("-depson")) + + For postscript printing there are three analogous variables to +customize. + +`ps-lpr-command' + This should be set to a command that takes postscript on standard + input and directs it to a postscript printer. + +`ps-lpr-switches' + This should be set to a list of switches required for + `ps-lpr-command' to do its job. + +`ps-print-color-p' + This boolean variable should be set `t' if printing will be done in + color, otherwise it should be set to `nil'. + + NOTE: It is an undocumented limitation in XEmacs that postscript +printing (the `Pretty Print Buffer' menu item) *requires* a window +system environment. It cannot be used outside of X11. + + +File: xemacs-faq.info, Node: Current Events, Prev: Miscellaneous, Up: Top + +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: + +* 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. + + +File: xemacs-faq.info, Node: Q6.0.1, Next: Q6.0.2, Prev: Current Events, Up: Current Events + +6.0: Changes +============ + +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 +major mode for editing Tex and LaTeX, and a lot of other stuff). Many +bugs from 20.0 have been fixed for this release. 20.2 also contains a +new system for customizing XEmacs options, invoked via `M-x customize'. + + XEmacs 20.2 is the development release (20.0 was beta), and is no +longer considered unstable. + + +File: xemacs-faq.info, Node: Q6.0.2, Next: Q6.0.3, Prev: Q6.0.1, Up: Current Events + +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, +additional support for Mule (Multi-language extensions to Emacs), many +more customizations, multiple frames on TTY-s, support for multiple info +directories, an enhanced gnuclient, improvements to regexp matching, +increased MIME support, and many, many synches with GNU Emacs 20. + + 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 +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. + + +File: xemacs-faq.info, Node: Q6.0.3, Next: Q6.0.4, Prev: Q6.0.2, Up: Current Events + +Q6.0.3: What's new in XEmacs 20.4? +---------------------------------- + + XEmacs 20.4 is a bugfix release with no user-visible changes. + + +File: xemacs-faq.info, Node: Q6.0.4, Prev: Q6.0.3, Up: Current Events + +Q6.0.4: Procedural changes in XEmacs development. +------------------------------------------------- + + 1. Discussion about the development of XEmacs occurs on the + xemacs-beta mailing list. Subscriptions to this list will now be + fully automated instead of being handled by hand. Send a mail + message to with `subscribe' as the + BODY of the message to join the list. Please note this is a + developers mailing list for people who have an active interest in + the development process. + + The discussion of NT XEmacs development is taking place on a + separate mailing list. Send mail to + to subscribe. + + 2. Due to the long development cycle in between releases, it has been + decided that intermediate versions will be made available in + source only form for the truly interested. + + XEmacs 19.16 was the last 19 release, basically consisting of + 19.15 plus the collected bugfixes. + + 3. As of December 1996, Steve Baur has + become the lead maintainer of XEmacs. + + diff --git a/info/xemacs.info b/info/xemacs.info index 0a3a6df..bb32bf7 100644 --- a/info/xemacs.info +++ b/info/xemacs.info @@ -1,5 +1,5 @@ -This is ../info/xemacs.info, produced by makeinfo version 4.0 from -xemacs/xemacs.texi. +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -31,409 +31,367 @@ translation approved by the author instead of in the original English.  Indirect: -xemacs.info-1: 1350 -xemacs.info-2: 49148 -xemacs.info-3: 97130 -xemacs.info-4: 146370 -xemacs.info-5: 195521 -xemacs.info-6: 243181 -xemacs.info-7: 283264 -xemacs.info-8: 333227 -xemacs.info-9: 380697 -xemacs.info-10: 429215 -xemacs.info-11: 477039 -xemacs.info-12: 526210 -xemacs.info-13: 575703 -xemacs.info-14: 620063 -xemacs.info-15: 669495 -xemacs.info-16: 718900 -xemacs.info-17: 768577 -xemacs.info-18: 816830 -xemacs.info-19: 866461 -xemacs.info-20: 891448 -xemacs.info-21: 923102 -xemacs.info-22: 972506 -xemacs.info-23: 1015092 +xemacs.info-1: 1372 +xemacs.info-2: 47958 +xemacs.info-3: 95918 +xemacs.info-4: 144030 +xemacs.info-5: 192248 +xemacs.info-6: 241615 +xemacs.info-7: 290442 +xemacs.info-8: 339995 +xemacs.info-9: 385290 +xemacs.info-10: 433122 +xemacs.info-11: 482303 +xemacs.info-12: 528200 +xemacs.info-13: 577026 +xemacs.info-14: 625173 +xemacs.info-15: 673936 +xemacs.info-16: 723464 +xemacs.info-17: 772031 +xemacs.info-18: 815954 +xemacs.info-19: 857130 +xemacs.info-20: 905126 +xemacs.info-21: 945846  Tag Table: (Indirect) -Node: Top1350 -Node: License22942 -Node: Distrib36224 -Node: Intro37888 -Node: Frame40759 -Node: Point44804 -Node: Echo Area46771 -Node: Mode Line49148 -Node: GUI Components53579 -Node: Menubar Basics54860 -Node: Scrollbar Basics56776 -Node: Mode Line Basics57669 -Node: Toolbar Basics58501 -Node: Gutter Basics59168 -Node: Inhibiting61222 -Node: Customizing63593 -Node: XEmacs under X63842 -Node: XEmacs under MS Windows67056 -Node: Keystrokes67471 -Node: Intro to Keystrokes68315 -Node: Representing Keystrokes70418 -Node: Key Sequences71775 -Node: String Key Sequences75116 -Node: Meta Key75499 -Node: Super and Hyper Keys76972 -Node: Character Representation83217 -Node: Commands84237 -Node: Pull-down Menus87086 -Node: File Menu90435 -Node: Edit Menu94257 -Node: Apps Menu96640 -Node: Options Menu97130 -Node: Buffers Menu101148 -Node: Tools Menu101455 -Node: Help Menu101946 -Node: Menu Customization102347 -Node: Entering Emacs106577 -Node: Exiting109474 -Node: Command Switches113947 -Node: Startup Paths123969 -Node: Basic131299 -Node: Inserting Text132703 -Node: Moving Point135699 -Node: Erasing139305 -Node: Basic Files140610 -Node: Basic Help142532 -Node: Blank Lines143127 -Node: Continuation Lines144703 -Node: Position Info146370 -Node: Arguments149786 -Node: Undo153885 -Node: Minibuffer156832 -Node: Minibuffer File159442 -Node: Minibuffer Edit161247 -Node: Completion164188 -Node: Completion Example166119 -Node: Completion Commands167214 -Node: Strict Completion170190 -Node: Completion Options171971 -Node: Minibuffer History173479 -Node: Repetition176663 -Node: M-x179508 -Node: Help184602 -Node: Help Summary186012 -Node: Key Help188798 -Node: Name Help189757 -Node: Apropos192402 -Node: Library Keywords195521 -Node: Help Mode197842 -Node: Misc Help198339 -Node: Mark201487 -Node: Setting Mark203341 -Node: Using Region206463 -Node: Marking Objects207200 -Node: Mark Ring209038 -Node: Mouse Selection210754 -Node: Additional Mouse Operations212761 -Node: Killing216965 -Node: Yanking222601 -Node: Kill Ring223404 -Node: Appending Kills225006 -Node: Earlier Kills227043 -Node: Using X Selections229656 -Node: X Clipboard Selection230906 -Node: X Selection Commands233083 -Node: X Cut Buffers234169 -Node: Active Regions235528 -Node: Accumulating Text240108 -Node: Rectangles243181 -Node: Registers246700 -Node: RegPos248154 -Node: RegText249310 -Node: RegRect250416 -Node: RegConfig251295 -Node: RegNumbers252235 -Node: RegFiles252953 -Node: Bookmarks253611 -Node: Display256983 -Node: Scrolling258478 -Node: Horizontal Scrolling262621 -Node: Selective Display263816 -Node: Display Vars265035 -Node: Search267713 -Node: Incremental Search268906 -Node: Non-Incremental Search277834 -Node: Word Search279276 -Node: Regexp Search280894 -Node: Regexps283264 -Node: Search Case297261 -Node: Replace298042 -Node: Unconditional Replace298990 -Node: Regexp Replace300125 -Node: Replacement and Case301060 -Node: Query Replace302040 -Node: Other Repeating Search305267 -Node: Fixit306522 -Node: Kill Errors307102 -Node: Transpose308435 -Node: Fixing Case310839 -Node: Spelling311485 -Node: Files312946 -Node: File Names314256 -Node: Visiting318593 -Node: Saving325425 -Node: Backup330348 -Node: Backup Names331744 -Node: Backup Deletion333227 -Node: Backup Copying334377 -Node: Interlocking336083 -Node: Reverting340211 -Node: Auto Save342123 -Node: Auto Save Files343090 -Node: Auto Save Control344931 -Node: Recover346769 -Node: Version Control347924 -Node: Concepts of VC349962 -Node: Editing with VC351572 -Node: Variables for Check-in/out356828 -Node: Log Entries358727 -Node: Change Logs and VC359907 -Node: Old Versions363174 -Node: VC Status365177 -Node: Renaming and VC366891 -Node: Snapshots367570 -Node: Making Snapshots368071 -Node: Snapshot Caveats369364 -Node: Version Headers371173 -Node: ListDir373872 -Node: Comparing Files375921 -Node: Dired377454 -Node: Dired Enter378125 -Node: Dired Edit378950 -Node: Dired Deletion380697 -Node: Dired Immed383920 -Node: Misc File Ops385196 -Node: Buffers387684 -Node: Select Buffer389842 -Node: List Buffers391637 -Node: Misc Buffer393395 -Node: Kill Buffer395038 -Node: Several Buffers396168 -Node: Windows400035 -Node: Basic Window400746 -Node: Split Window402465 -Node: Other Window404598 -Node: Pop Up Window407029 -Node: Change Window408534 -Node: Mule411442 -Node: Mule Intro412705 -Node: Language Environments413721 -Node: Input Methods415828 -Node: Select Input Method419548 -Node: Coding Systems421703 -Node: Recognize Coding425889 -Node: Specify Coding429215 -Node: Major Modes434146 -Node: Choosing Modes436365 -Node: Indentation438755 -Node: Indentation Commands440850 -Node: Tab Stops443579 -Node: Just Spaces445428 -Node: Text446243 -Node: Text Mode448226 -Node: Nroff Mode450305 -Node: TeX Mode451948 -Node: TeX Editing454200 -Node: TeX Print457634 -Node: Outline Mode460853 -Node: Outline Format462334 -Node: Outline Motion465134 -Node: Outline Visibility466687 -Node: Words469608 -Node: Sentences472555 -Node: Paragraphs474751 -Node: Pages477039 -Node: Filling479639 -Node: Auto Fill480210 -Node: Fill Commands482357 -Node: Fill Prefix484522 -Node: Case486710 -Node: Programs488738 -Node: Program Modes491288 -Node: Lists493520 -Node: Defuns499360 -Node: Grinding502013 -Node: Basic Indent502641 -Node: Multi-line Indent504662 -Node: Lisp Indent506278 -Node: C Indent509728 -Node: Matching514968 -Node: Comments516490 -Node: Balanced Editing522942 -Node: Lisp Completion523956 -Node: Documentation524971 -Node: Change Log526210 -Node: Tags528788 -Node: Tag Syntax530545 -Node: Create Tags Table535245 -Node: Etags Regexps539305 -Node: Select Tags Table543963 -Node: Find Tag547736 -Node: Tags Search550700 -Node: List Tags554156 -Node: Fortran555185 -Node: Fortran Motion556261 -Node: Fortran Indent557081 -Node: ForIndent Commands557766 -Node: ForIndent Num558911 -Node: ForIndent Conv560185 -Node: ForIndent Vars560961 -Node: Fortran Comments562129 -Node: Fortran Columns565727 -Node: Fortran Abbrev567150 -Node: Asm Mode568059 -Node: Running568611 -Node: Compilation569580 -Node: Lisp Modes574430 -Node: Lisp Libraries575703 -Node: Loading576257 -Node: Compiling Libraries580717 -Node: Mocklisp583608 -Node: Lisp Eval584285 -Node: Lisp Debug587925 -Node: Lisp Interaction593352 -Node: External Lisp594707 -Node: Packages596781 -Node: Package Terminology597690 -Node: Installing Packages599300 -Node: Sumo602210 -Node: Manually603091 -Node: Automatically604461 -Node: Which Packages609024 -Node: Removing Packages609833 -Node: Building Packages610529 -Node: Local.rules File613169 -Node: Creating Packages615023 -Node: Available Packages620063 -Node: Abbrevs626778 -Node: Defining Abbrevs628977 -Node: Expanding Abbrevs631424 -Node: Editing Abbrevs634126 -Node: Saving Abbrevs635999 -Node: Dynamic Abbrevs637954 -Node: Picture639256 -Node: Basic Picture641689 -Node: Insert in Picture643974 -Node: Tabs in Picture645396 -Node: Rectangles in Picture646917 -Node: Sending Mail648825 -Node: Mail Format650536 -Node: Mail Headers651886 -Node: Mail Mode658294 -Node: Reading Mail661907 -Node: Calendar/Diary663482 -Node: Calendar Motion665156 -Node: Calendar Unit Motion666039 -Node: Move to Beginning or End668362 -Node: Specified Dates669495 -Node: Scroll Calendar670383 -Node: Mark and Region672174 -Node: General Calendar674080 -Node: LaTeX Calendar675688 -Node: Holidays677702 -Node: Sunrise/Sunset680804 -Node: Lunar Phases683843 -Node: Other Calendars685228 -Node: Calendar Systems686715 -Node: To Other Calendar689826 -Node: From Other Calendar691817 -Node: Mayan Calendar694122 -Node: Diary697317 -Node: Diary Commands699066 -Node: Format of Diary File702389 -Node: Date Formats705259 -Node: Adding to Diary707833 -Node: Special Diary Entries709464 -Node: Calendar Customization714803 -Node: Calendar Customizing715665 -Node: Holiday Customizing718900 -Node: Date Display Format725387 -Node: Time Display Format726345 -Node: Daylight Savings727483 -Node: Diary Customizing730671 -Node: Hebrew/Islamic Entries735292 -Node: Fancy Diary Display738632 -Node: Included Diary Files740548 -Node: Sexp Diary Entries741529 -Node: Appt Customizing746619 -Node: Sorting747665 -Node: Shell752471 -Node: Single Shell753764 -Node: Interactive Shell755378 -Node: Shell Mode759143 -Node: Terminal emulator761634 -Node: Term Mode763943 -Node: Paging in Term764857 -Node: Narrowing765655 -Node: Hardcopy767605 -Node: Recursive Edit768577 -Node: Dissociated Press771564 -Node: CONX774127 -Node: Amusements775151 -Node: Emulation775631 -Node: Customization777491 -Node: Minor Modes779307 -Node: Variables780939 -Node: Examining782895 -Node: Easy Customization784356 -Node: Customization Groups785370 -Node: Changing an Option788299 -Node: Face Customization794569 -Node: Specific Customization796333 -Node: Edit Options798940 -Node: Locals800524 -Node: File Variables803703 -Node: Keyboard Macros808253 -Node: Basic Kbd Macro810424 -Node: Save Kbd Macro812356 -Node: Kbd Macro Query814014 -Node: Key Bindings815956 -Node: Keymaps816830 -Node: Rebinding820680 -Node: Interactive Rebinding821379 -Node: Programmatic Rebinding823568 -Node: Key Bindings Using Strings826375 -Node: Disabling828002 -Node: Syntax829781 -Node: Syntax Entry830662 -Node: Syntax Change834746 -Node: Init File836915 -Node: Init Syntax838379 -Node: Init Examples840730 -Node: Terminal Init844920 -Node: Audible Bell846657 -Node: Faces850088 -Node: Frame Components854930 -Node: X Resources855375 -Node: Geometry Resources857034 -Node: Iconic Resources859482 -Node: Resource List859954 -Node: Face Resources866461 -Node: Widgets870138 -Node: Menubar Resources871077 -Node: Quitting872591 -Node: Lossage875569 -Node: Stuck Recursive876213 -Node: Screen Garbled876919 -Node: Text Garbled878053 -Node: Unasked-for Search878692 -Node: Emergency Escape879477 -Node: Total Frustration881256 -Node: Bugs881887 -Node: Glossary891448 -Node: Manifesto923102 -Node: Key Index946579 -Node: Command Index972506 -Node: Variable Index1015092 -Node: Concept Index1031178 +Node: Top1372 +Node: License22524 +Node: Distrib35806 +Node: Intro37470 +Node: Frame40341 +Node: Point43613 +Node: Echo Area45580 +Node: Mode Line47958 +Node: XEmacs under X52389 +Node: Keystrokes55567 +Node: Intro to Keystrokes56411 +Node: Representing Keystrokes58514 +Node: Key Sequences59871 +Node: String Key Sequences63211 +Node: Meta Key63594 +Node: Super and Hyper Keys65067 +Node: Character Representation71291 +Node: Commands72311 +Node: Pull-down Menus75160 +Node: File Menu78509 +Node: Edit Menu82331 +Node: Apps Menu84716 +Node: Options Menu85206 +Node: Buffers Menu89186 +Node: Tools Menu89493 +Node: Help Menu89984 +Node: Menu Customization90385 +Node: Entering Emacs94615 +Node: Exiting95918 +Node: Command Switches99010 +Node: Startup Paths108199 +Node: Basic115775 +Node: Blank Lines125258 +Node: Continuation Lines126684 +Node: Position Info128118 +Node: Arguments131252 +Node: Undo134389 +Node: Minibuffer137336 +Node: Minibuffer File139820 +Node: Minibuffer Edit141457 +Node: Completion144030 +Node: Repetition150905 +Node: M-x153697 +Node: Help158791 +Node: Mark168713 +Node: Setting Mark170567 +Node: Using Region173689 +Node: Marking Objects174434 +Node: Mark Ring176275 +Node: Mouse Selection177991 +Node: Additional Mouse Operations179999 +Node: Killing184203 +Node: Yanking189843 +Node: Kill Ring190646 +Node: Appending Kills192248 +Node: Earlier Kills194285 +Node: Using X Selections196898 +Node: X Clipboard Selection198148 +Node: X Selection Commands200325 +Node: X Cut Buffers201411 +Node: Active Regions202770 +Node: Accumulating Text207350 +Node: Rectangles210423 +Node: Registers213942 +Node: RegPos214977 +Node: RegText215880 +Node: RegRect216964 +Node: Display217704 +Node: Scrolling219199 +Node: Horizontal Scrolling223342 +Node: Selective Display224538 +Node: Display Vars225757 +Node: Search228435 +Node: Incremental Search229628 +Node: Non-Incremental Search238555 +Node: Word Search239997 +Node: Regexp Search241615 +Node: Regexps243151 +Node: Search Case253452 +Node: Replace254233 +Node: Unconditional Replace255181 +Node: Regexp Replace256317 +Node: Replacement and Case257252 +Node: Query Replace258232 +Node: Other Repeating Search261465 +Node: Fixit262720 +Node: Kill Errors263300 +Node: Transpose264633 +Node: Fixing Case267038 +Node: Spelling267684 +Node: Files269145 +Node: File Names270453 +Node: Visiting274791 +Node: Saving281481 +Node: Backup286404 +Node: Backup Names287800 +Node: Backup Deletion289283 +Node: Backup Copying290442 +Node: Interlocking292149 +Node: Reverting296277 +Node: Auto Save298190 +Node: Auto Save Files299157 +Node: Auto Save Control300998 +Node: Recover302837 +Node: Version Control303992 +Node: Concepts of VC306030 +Node: Editing with VC307640 +Node: Variables for Check-in/out312896 +Node: Log Entries314795 +Node: Change Logs and VC315975 +Node: Old Versions319243 +Node: VC Status321247 +Node: Renaming and VC322961 +Node: Snapshots323642 +Node: Making Snapshots324143 +Node: Snapshot Caveats325437 +Node: Version Headers327246 +Node: ListDir329945 +Node: Comparing Files331994 +Node: Dired333527 +Node: Dired Enter334198 +Node: Dired Edit335023 +Node: Dired Deletion336770 +Node: Dired Immed339995 +Node: Misc File Ops341271 +Node: Buffers343760 +Node: Select Buffer345920 +Node: List Buffers347717 +Node: Misc Buffer349463 +Node: Kill Buffer351107 +Node: Several Buffers352237 +Node: Windows356103 +Node: Basic Window356814 +Node: Split Window358533 +Node: Other Window360666 +Node: Pop Up Window363096 +Node: Change Window364603 +Node: Mule367511 +Node: Mule Intro368774 +Node: Language Environments369790 +Node: Input Methods371898 +Node: Select Input Method375618 +Node: Coding Systems377773 +Node: Recognize Coding381961 +Node: Specify Coding385290 +Node: Major Modes390221 +Node: Choosing Modes392443 +Node: Indentation394833 +Node: Indentation Commands396928 +Node: Tab Stops399657 +Node: Just Spaces401506 +Node: Text402321 +Node: Text Mode404304 +Node: Nroff Mode406385 +Node: TeX Mode408029 +Node: TeX Editing410281 +Node: TeX Print413716 +Node: Outline Mode416936 +Node: Outline Format418417 +Node: Outline Motion421217 +Node: Outline Visibility422770 +Node: Words425691 +Node: Sentences428638 +Node: Paragraphs430834 +Node: Pages433122 +Node: Filling435722 +Node: Auto Fill436293 +Node: Fill Commands438441 +Node: Fill Prefix440607 +Node: Case442795 +Node: Programs444823 +Node: Program Modes447381 +Node: Lists449613 +Node: Defuns455453 +Node: Grinding458106 +Node: Basic Indent458734 +Node: Multi-line Indent460755 +Node: Lisp Indent462371 +Node: C Indent465821 +Node: Matching471061 +Node: Comments472583 +Node: Balanced Editing479035 +Node: Lisp Completion480049 +Node: Documentation481064 +Node: Change Log482303 +Node: Tags484881 +Node: Tag Syntax486458 +Node: Create Tags Table489832 +Node: Select Tags Table495930 +Node: Find Tag499672 +Node: Tags Search502636 +Node: List Tags506093 +Node: Fortran507122 +Node: Fortran Motion508198 +Node: Fortran Indent509018 +Node: ForIndent Commands509703 +Node: ForIndent Num510848 +Node: ForIndent Conv512122 +Node: ForIndent Vars512898 +Node: Fortran Comments514066 +Node: Fortran Columns517665 +Node: Fortran Abbrev519088 +Node: Asm Mode519998 +Node: Running520550 +Node: Compilation521520 +Node: Lisp Modes526371 +Node: Lisp Libraries527645 +Node: Loading528200 +Node: Compiling Libraries532660 +Node: Mocklisp535551 +Node: Lisp Eval536228 +Node: Lisp Debug539868 +Node: Lisp Interaction545294 +Node: External Lisp546649 +Node: Packages548724 +Node: Package Terminology549465 +Node: Using Packages550823 +Node: Building Packages559612 +Node: Abbrevs562134 +Node: Defining Abbrevs564334 +Node: Expanding Abbrevs566781 +Node: Editing Abbrevs569483 +Node: Saving Abbrevs571351 +Node: Dynamic Abbrevs573291 +Node: Picture574593 +Node: Basic Picture577026 +Node: Insert in Picture579313 +Node: Tabs in Picture580735 +Node: Rectangles in Picture582256 +Node: Sending Mail584165 +Node: Mail Format585876 +Node: Mail Headers587226 +Node: Mail Mode593636 +Node: Reading Mail597249 +Node: Calendar/Diary598824 +Node: Calendar Motion600496 +Node: Calendar Unit Motion601379 +Node: Move to Beginning or End603702 +Node: Specified Dates604835 +Node: Scroll Calendar605724 +Node: Mark and Region607515 +Node: General Calendar609422 +Node: LaTeX Calendar611030 +Node: Holidays613044 +Node: Sunrise/Sunset616147 +Node: Lunar Phases619190 +Node: Other Calendars620575 +Node: Calendar Systems622062 +Node: To Other Calendar625173 +Node: From Other Calendar627164 +Node: Mayan Calendar629470 +Node: Diary632666 +Node: Diary Commands634416 +Node: Format of Diary File637725 +Node: Date Formats640595 +Node: Adding to Diary643169 +Node: Special Diary Entries644800 +Node: Calendar Customization650140 +Node: Calendar Customizing651002 +Node: Holiday Customizing654222 +Node: Date Display Format660690 +Node: Time Display Format661648 +Node: Daylight Savings662786 +Node: Diary Customizing665974 +Node: Hebrew/Islamic Entries670596 +Node: Fancy Diary Display673936 +Node: Included Diary Files675833 +Node: Sexp Diary Entries676814 +Node: Appt Customizing681904 +Node: Sorting682950 +Node: Shell687756 +Node: Single Shell689049 +Node: Interactive Shell690648 +Node: Shell Mode694413 +Node: Terminal emulator696904 +Node: Term Mode699214 +Node: Paging in Term700128 +Node: Narrowing700926 +Node: Hardcopy702876 +Node: Recursive Edit703848 +Node: Dissociated Press706835 +Node: CONX709398 +Node: Amusements710422 +Node: Emulation710902 +Node: Customization712746 +Node: Minor Modes714470 +Node: Variables716102 +Node: Examining718060 +Node: Easy Customization719521 +Node: Customization Groups720535 +Node: Changing an Option723464 +Node: Face Customization729720 +Node: Specific Customization731485 +Node: Edit Options734092 +Node: Locals735676 +Node: File Variables738855 +Node: Keyboard Macros743382 +Node: Basic Kbd Macro745553 +Node: Save Kbd Macro747485 +Node: Kbd Macro Query749157 +Node: Key Bindings751099 +Node: Keymaps751973 +Node: Rebinding755823 +Node: Interactive Rebinding756519 +Node: Programmatic Rebinding758711 +Node: Key Bindings Using Strings761518 +Node: Disabling763124 +Node: Syntax764896 +Node: Syntax Entry765777 +Node: Syntax Change769861 +Node: Init File772031 +Node: Init Syntax773539 +Node: Init Examples775892 +Node: Terminal Init780083 +Node: Audible Bell781793 +Node: Faces785224 +Node: X Resources790061 +Node: Geometry Resources791682 +Node: Iconic Resources794130 +Node: Resource List794602 +Node: Face Resources801109 +Node: Widgets804786 +Node: Menubar Resources805725 +Node: Quitting806658 +Node: Lossage809637 +Node: Stuck Recursive810280 +Node: Screen Garbled810986 +Node: Text Garbled812120 +Node: Unasked-for Search812759 +Node: Emergency Escape813544 +Node: Total Frustration815323 +Node: Bugs815954 +Node: Glossary825489 +Node: Manifesto857130 +Node: Key Index880606 +Node: Command Index905126 +Node: Variable Index945846 +Node: Concept Index961797  End Tag Table diff --git a/info/xemacs.info-1 b/info/xemacs.info-1 index b45fedf..e3b1285 100644 --- a/info/xemacs.info-1 +++ b/info/xemacs.info-1 @@ -1,5 +1,5 @@ -This is ../info/xemacs.info, produced by makeinfo version 4.0 from -xemacs/xemacs.texi. +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -32,8 +32,7 @@ translation approved by the author instead of in the original English.  File: xemacs.info, Node: Top, Next: License, Up: (dir) -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 and @@ -70,8 +69,7 @@ Important General Concepts * Command Switches:: Hairy startup options. * Startup Paths:: - How XEmacs finds Directories and Files. -* Packages:: How XEmacs organizes its high-level functionality. + How XEmacs finds Directories and Files Fundamental Editing Commands * Basic:: The most basic editing commands. @@ -81,7 +79,7 @@ Fundamental Editing Commands * Help:: Commands for asking XEmacs about its commands. Important Text-Changing Commands -* Mark:: The mark: how to delimit a ``region'' of text. +* Mark:: The mark: how to delimit a "region" of text. * Mouse Selection:: Selecting text with the mouse. * Additional Mouse Operations:: @@ -110,6 +108,7 @@ Advanced Features * Text:: Commands and modes for editing English. * Programs:: Commands and modes for editing programs. * Running:: Compiling, running and debugging programs. +* Packages:: How to add new packages to XEmacs. * Abbrevs:: How to define text abbreviations to reduce the number of characters you must type. * Picture:: Editing pictures made up of characters @@ -140,7 +139,7 @@ Recovery from Problems. Here are some other nodes which are really inferiors of the ones already listed, mentioned here so you can get to them in one step: - --- The Detailed Node Listing --- + -- The Detailed Node Listing -- The Organization of the Frame @@ -175,16 +174,6 @@ Pull-down Menus * Menu Customization:: Adding and removing menu items and related operations. -Packages - -* Packages:: Introduction to XEmacs Packages. -* Package Terminology:: Understanding different kinds of packages. -* Installing Packages:: How to install packages. -* Building Packages:: Building packages from sources. -* Local.rules File:: An important part of building packages. -* Creating Packages:: The basics. -* Available Packages:: A brief directory of packaged LISP. - Basic Editing Commands * Blank Lines:: Commands to make or delete blank lines. @@ -222,13 +211,9 @@ Using X Selections 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 @@ -272,7 +257,7 @@ File Handling * Version Control:: Version control systems (RCS and SCCS). * ListDir:: Listing the contents of a file directory. * Comparing Files:: Finding where two files differ. -* Dired:: ``Editing'' a directory to delete, rename, etc. +* Dired:: "Editing" a directory to delete, rename, etc. the files in it. * Misc File Ops:: Other things you can do on files. @@ -454,6 +439,13 @@ Lisp Libraries * Compiling Libraries:: Compiling a library makes it load and run faster. * Mocklisp:: Converting Mocklisp to Lisp so XEmacs can run it. +Packages + +* Packages:: Introduction to XEmacs Packages. +* Package Terminology:: Understanding different kinds of packages. +* Using Packages:: How to install and use packages. +* Building Packages:: Building packages from sources. + Abbrevs * Defining Abbrevs:: Defining an abbrev, so it will expand when typed. @@ -495,7 +487,8 @@ Customization 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 `.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 @@ -529,7 +522,7 @@ The Syntax Table * 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, `~/.emacs' * Init Syntax:: Syntax of constants in Emacs Lisp. * Init Examples:: How to do some things with an init file. @@ -541,7 +534,7 @@ Dealing with XEmacs Trouble * Screen Garbled:: Garbage on the screen. * Text Garbled:: Garbage in the text. * Unasked-for Search:: Spontaneous entry to incremental search. -* Emergency Escape:: Emergency escape--- +* Emergency Escape:: Emergency escape-- What to do if XEmacs stops responding. * Total Frustration:: When you are at your wits' end. @@ -887,9 +880,9 @@ commands relevant to a topic. *Note Help::. "Customizable" means you can change the definitions of XEmacs commands. For example, if you use a programming language in which comments start with `<**' and end with `**>', you can tell the XEmacs -comment manipulation commands to use those strings (*note Comments::). -Another sort of customization is rearrangement of the command set. For -example, you can set up the four basic cursor motion commands (up, +comment manipulation commands to use those strings (*note Comments::.). +Another sort of customization is rearrangement of the command set. +For example, you can set up the four basic cursor motion commands (up, down, left and right) on keys in a diamond pattern on the keyboard if you prefer. *Note Customization::. @@ -934,35 +927,24 @@ Window look at two buffers a the same time. * Below each text window's last line is a "mode line" (*note Mode - Line::), which describes what is going on in that window. The + Line::.), which describes what is going on in that window. The mode line is in inverse video if the terminal supports that. If there are several XEmacs windows in one frame, each window has its own mode line. * At the bottom of each XEmacs frame is the "echo area" or - "minibuffer window"(*note Echo Area::). It is used by XEmacs to + "minibuffer window"(*note Echo Area::.). It is used by XEmacs to exchange information with the user. There is only one echo area per XEmacs frame. - * If you are running XEmacs under a graphical windowing system, a - menu bar at the top of the frame makes shortcuts to several of the - commands available (*note Pull-down Menus::). - - * 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.) - - * 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.) + * 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 (*note Pull-down Menus::.). You can subdivide the XEmacs frame into multiple text windows, and -use each window for a different file (*note Windows::). Multiple XEmacs -windows are tiled vertically on the XEmacs frame. The upper XEmacs -window is separated from the lower window by its mode line. +use each window for a different file (*note Windows::.). Multiple +XEmacs windows are tiled vertically on the XEmacs frame. The upper +XEmacs window is separated from the lower window by its mode line. When there are multiple, tiled XEmacs windows on a single XEmacs frame, the XEmacs window receiving input from the keyboard has the @@ -982,11 +964,8 @@ visible in all XEmacs windows containing that buffer. * Point:: The place in the text where editing commands operate. * Echo Area:: Short messages appear at the bottom of the frame. * Mode Line:: Interpreting the mode line. -* GUI Components:: Menubar, toolbars, gutters. * XEmacs under X:: Some information on using XEmacs under the X Window System. -* XEmacs under MS Windows:: Some information on using XEmacs under - Microsoft Windows.  File: xemacs.info, Node: Point, Next: Echo Area, Prev: Frame, Up: Frame @@ -1049,7 +1028,7 @@ The Echo Area as you type it. This behavior is designed to give confident users fast response, while giving hesitant users maximum feedback. You can change this behavior by setting a variable (*note Display - Vars::). + Vars::.). * If you issue a command that cannot be executed, XEmacs may print an "error message" in the echo area. Error messages are diff --git a/info/xemacs.info-10 b/info/xemacs.info-10 new file mode 100644 index 0000000..082ad0c --- /dev/null +++ b/info/xemacs.info-10 @@ -0,0 +1,1174 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Pages, Next: Filling, Prev: Paragraphs, Up: Text + +Pages +===== + + Files are often thought of as divided into "pages" by the "formfeed" +character (ASCII Control-L, octal code 014). For example, if a file is +printed on a line printer, each "page" of the file starts on a new page +of paper. Emacs treats a page-separator character just like any other +character. It can be inserted with `C-q C-l' or deleted with . +You are free to paginate your file or not. However, since pages are +often meaningful divisions of the file, commands are provided to move +over them and operate on them. + +`C-x [' + Move point to previous page boundary (`backward-page'). + +`C-x ]' + Move point to next page boundary (`forward-page'). + +`C-x C-p' + Put point and mark around this page (or another page) + (`mark-page'). + +`C-x l' + Count the lines in this page (`count-lines-page'). + + The `C-x [' (`backward-page') command moves point to immediately +after the previous page delimiter. If point is already right after a +page delimiter, the command skips that one and stops at the previous +one. A numeric argument serves as a repeat count. The `C-x ]' +(`forward-page') command moves forward past the next page delimiter. + + The `C-x C-p' command (`mark-page') puts point at the beginning of +the current page and the mark at the end. The page delimiter at the end +is included (the mark follows it). The page delimiter at the front is +excluded (point follows it). You can follow this command by `C-w' to +kill a page you want to move elsewhere. If you insert the page after a +page delimiter, at a place where `C-x ]' or `C-x [' would take you, the +page will be properly delimited before and after once again. + + A numeric argument to `C-x C-p' is used to specify which page to go +to, relative to the current one. Zero means the current page. One +means the next page, and -1 means the previous one. + + The `C-x l' command (`count-lines-page') can help you decide where +to break a page in two. It prints the total number of lines in the +current page in the echo area, then divides the lines into those +preceding the current line and those following it, for example + + Page has 96 (72+25) lines + +Notice that the sum is off by one; this is correct if point is not at +the beginning of a line. + + The variable `page-delimiter' should have as its value a regexp that +matches the beginning of a line that separates pages. This defines +where pages begin. The normal value of this variable is `"^\f"', which +matches a formfeed character at the beginning of a line. + + +File: xemacs.info, Node: Filling, Next: Case, Prev: Pages, Up: Text + +Filling Text +============ + + If you use Auto Fill mode, Emacs "fills" text (breaks it up into +lines that fit in a specified width) as you insert it. When you alter +existing text it is often no longer be properly filled afterwards and +you can use explicit commands for filling. + +* Menu: + +* Auto Fill:: Auto Fill mode breaks long lines automatically. +* Fill Commands:: Commands to refill paragraphs and center lines. +* Fill Prefix:: Filling when every line is indented or in a comment, etc. + + +File: xemacs.info, Node: Auto Fill, Next: Fill Commands, Prev: Filling, Up: Filling + +Auto Fill Mode +-------------- + + "Auto Fill" mode is a minor mode in which lines are broken +automatically when they become too wide. Breaking happens only when +you type a or . + +`M-x auto-fill-mode' + Enable or disable Auto Fill mode. + +`' +`' + In Auto Fill mode, break lines when appropriate. + + `M-x auto-fill-mode' turns Auto Fill mode on if it was off, or off +if it was on. With a positive numeric argument the command always turns +Auto Fill mode on, and with a negative argument it always turns it off. +The presence of the word `Fill' in the mode line, inside the +parentheses, indicates that Auto Fill mode is in effect. Auto Fill mode +is a minor mode; you can turn it on or off for each buffer individually. +*Note Minor Modes::. + + In Auto Fill mode, lines are broken automatically at spaces when +they get longer than desired. Line breaking and rearrangement takes +place only when you type or . To insert a space or newline +without permitting line-breaking, type `C-q ' or `C-q ' +(recall that a newline is really a linefeed). `C-o' inserts a newline +without line breaking. + + Auto Fill mode works well with Lisp mode: when it makes a new line in +Lisp mode, it indents that line with . If a line ending in a Lisp +comment gets too long, the text of the comment is split into two +comment lines. Optionally, new comment delimiters are inserted at the +end of the first line and the beginning of the second, so that each line +is a separate comment. The variable `comment-multi-line' controls the +choice (*note Comments::.). + + Auto Fill mode does not refill entire paragraphs. It can break +lines but cannot merge lines. Editing in the middle of a paragraph can +result in a paragraph that is not correctly filled. The easiest way to +make the paragraph properly filled again is using an explicit fill +commands. + + Many users like Auto Fill mode and want to use it in all text files. +The section on init files explains how you can arrange this permanently +for yourself. *Note Init File::. + + +File: xemacs.info, Node: Fill Commands, Next: Fill Prefix, Prev: Auto Fill, Up: Filling + +Explicit Fill Commands +---------------------- + +`M-q' + Fill current paragraph (`fill-paragraph'). + +`M-g' + Fill each paragraph in the region (`fill-region'). + +`C-x f' + Set the fill column (`set-fill-column'). + +`M-x fill-region-as-paragraph' + Fill the region, considering it as one paragraph. + +`M-s' + Center a line. + + To refill a paragraph, use the command `Meta-q' (`fill-paragraph'). +It causes the paragraph containing point, or the one after point if +point is between paragraphs, to be refilled. All line breaks are +removed, and new ones are inserted where necessary. `M-q' can be +undone with `C-_'. *Note Undo::. + + To refill many paragraphs, use `M-g' (`fill-region'), which divides +the region into paragraphs and fills each of them. + + `Meta-q' and `Meta-g' use the same criteria as `Meta-h' for finding +paragraph boundaries (*note Paragraphs::.). For more control, you can +use `M-x fill-region-as-paragraph', which refills everything between +point and mark. This command recognizes only blank lines as paragraph +separators. + + A numeric argument to `M-g' or `M-q' causes it to "justify" the text +as well as filling it. Extra spaces are inserted to make the right +margin line up exactly at the fill column. To remove the extra spaces, +use `M-q' or `M-g' with no argument. + + The variable `auto-fill-inhibit-regexp' takes as a value a regexp to +match lines that should not be auto-filled. + + The command `Meta-s' (`center-line') centers the current line within +the current fill column. With an argument, it centers several lines +individually and moves past them. + + The maximum line width for filling is in the variable `fill-column'. +Altering the value of `fill-column' makes it local to the current +buffer; until then, the default value--initially 70--is in effect. +*Note Locals::. + + The easiest way to set `fill-column' is to use the command `C-x f' +(`set-fill-column'). With no argument, it sets `fill-column' to the +current horizontal position of point. With a numeric argument, it uses +that number as the new fill column. + + +File: xemacs.info, Node: Fill Prefix, Prev: Fill Commands, Up: Filling + +The Fill Prefix +--------------- + + To fill a paragraph in which each line starts with a special marker +(which might be a few spaces, giving an indented paragraph), use the +"fill prefix" feature. The fill prefix is a string which is not +included in filling. Emacs expects every line to start with a fill +prefix. + +`C-x .' + Set the fill prefix (`set-fill-prefix'). + +`M-q' + Fill a paragraph using current fill prefix (`fill-paragraph'). + +`M-x fill-individual-paragraphs' + Fill the region, considering each change of indentation as + starting a new paragraph. + + To specify a fill prefix, move to a line that starts with the desired +prefix, put point at the end of the prefix, and give the command +`C-x .' (`set-fill-prefix'). That's a period after the `C-x'. To turn +off the fill prefix, specify an empty prefix: type `C-x .' with point +at the beginning of a line. + + When a fill prefix is in effect, the fill commands remove the fill +prefix from each line before filling and insert it on each line after +filling. Auto Fill mode also inserts the fill prefix inserted on new +lines it creates. Lines that do not start with the fill prefix are +considered to start paragraphs, both in `M-q' and the paragraph +commands; this is just right if you are using paragraphs with hanging +indentation (every line indented except the first one). Lines which are +blank or indented once the prefix is removed also separate or start +paragraphs; this is what you want if you are writing multi-paragraph +comments with a comment delimiter on each line. + + The fill prefix is stored in the variable `fill-prefix'. Its value +is a string, or `nil' when there is no fill prefix. This is a +per-buffer variable; altering the variable affects only the current +buffer, but there is a default value which you can change as well. +*Note Locals::. + + Another way to use fill prefixes is through `M-x +fill-individual-paragraphs'. This function divides the region into +groups of consecutive lines with the same amount and kind of +indentation and fills each group as a paragraph, using its indentation +as a fill prefix. + + +File: xemacs.info, Node: Case, Prev: Filling, Up: Text + +Case Conversion Commands +======================== + + Emacs has commands for converting either a single word or any +arbitrary range of text to upper case or to lower case. + +`M-l' + Convert following word to lower case (`downcase-word'). + +`M-u' + Convert following word to upper case (`upcase-word'). + +`M-c' + Capitalize the following word (`capitalize-word'). + +`C-x C-l' + Convert region to lower case (`downcase-region'). + +`C-x C-u' + Convert region to upper case (`upcase-region'). + + The word conversion commands are used most frequently. `Meta-l' +(`downcase-word') converts the word after point to lower case, moving +past it. Thus, repeating `Meta-l' converts successive words. `Meta-u' +(`upcase-word') converts to all capitals instead, while `Meta-c' +(`capitalize-word') puts the first letter of the word into upper case +and the rest into lower case. The word conversion commands convert +several words at once if given an argument. They are especially +convenient for converting a large amount of text from all upper case to +mixed case: you can move through the text using `M-l', `M-u', or `M-c' +on each word as appropriate, occasionally using `M-f' instead to skip a +word. + + When given a negative argument, the word case conversion commands +apply to the appropriate number of words before point, but do not move +point. This is convenient when you have just typed a word in the wrong +case: you can give the case conversion command and continue typing. + + If a word case conversion command is given in the middle of a word, +it applies only to the part of the word which follows point. This is +just like what `Meta-d' (`kill-word') does. With a negative argument, +case conversion applies only to the part of the word before point. + + The other case conversion commands are `C-x C-u' (`upcase-region') +and `C-x C-l' (`downcase-region'), which convert everything between +point and mark to the specified case. Point and mark do not move. + + +File: xemacs.info, Node: Programs, Next: Running, Prev: Text, Up: Top + +Editing Programs +**************** + + Emacs has many commands designed to understand the syntax of +programming languages such as Lisp and C. These commands can: + + * Move over or kill balanced expressions or "sexps" (*note Lists::.). + + * Move over or mark top-level balanced expressions ("defuns", in + Lisp; functions, in C). + + * Show how parentheses balance (*note Matching::.). + + * Insert, kill, or align comments (*note Comments::.). + + * Follow the usual indentation conventions of the language (*note + Grinding::.). + + The commands available for words, sentences, and paragraphs are +useful in editing code even though their canonical application is for +editing human language text. Most symbols contain words (*note +Words::.); sentences can be found in strings and comments (*note +Sentences::.). Paragraphs per se are not present in code, but the +paragraph commands are useful anyway, because Lisp mode and C mode +define paragraphs to begin and end at blank lines (*note +Paragraphs::.). Judicious use of blank lines to make the program +clearer also provides interesting chunks of text for the paragraph +commands to work on. + + The selective display feature is useful for looking at the overall +structure of a function (*note Selective Display::.). This feature +causes only the lines that are indented less than a specified amount to +appear on the screen. + +* Menu: + +* Program Modes:: Major modes for editing programs. +* Lists:: Expressions with balanced parentheses. + There are editing commands to operate on them. +* Defuns:: Each program is made up of separate functions. + There are editing commands to operate on them. +* Grinding:: Adjusting indentation to show the nesting. +* Matching:: Insertion of a close-delimiter flashes matching open. +* Comments:: Inserting, illing and aligning comments. +* 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. +* Change Log:: Maintaining a change history for your program. +* Tags:: Go direct to any function in your program in one + command. Tags remembers which file it is in. +* Fortran:: Fortran mode and its special features. +* Asm Mode:: Asm mode and its special features. + + +File: xemacs.info, Node: Program Modes, Next: Lists, Prev: Programs, Up: Programs + +Major Modes for Programming Languages +===================================== + + Emacs has several major modes for the programming languages Lisp, +Scheme (a variant of Lisp), C, Fortran, and Muddle. Ideally, a major +mode should be implemented for each programming language you might want +to edit with Emacs; but often the mode for one language can serve for +other syntactically similar languages. The language modes that exist +are those that someone decided to take the trouble to write. + + There are several variants of Lisp mode, which differ in the way they +interface to Lisp execution. *Note Lisp Modes::. + + Each of the programming language modes defines the key to run +an indentation function that knows the indentation conventions of that +language and updates the current line's indentation accordingly. For +example, in C mode is bound to `c-indent-line'. is +normally defined to do followed by ; thus it, too, indents +in a mode-specific fashion. + + In most programming languages, indentation is likely to vary from +line to line. So the major modes for those languages rebind to +treat a tab as if it were the equivalent number of spaces (using the +command `backward-delete-char-untabify'). This makes it possible to +rub out indentation one column at a time without worrying whether it is +made up of spaces or tabs. In these modes, use `C-b C-d' to delete a +tab character before point. + + Programming language modes define paragraphs to be separated only by +blank lines, so that the paragraph commands remain useful. Auto Fill +mode, if enabled in a programming language major mode, indents the new +lines which it creates. + + Turning on a major mode calls a user-supplied function called the +"mode hook", which is the value of a Lisp variable. For example, +turning on C mode calls the value of the variable `c-mode-hook' if that +value exists and is non-`nil'. Mode hook variables for other +programming language modes include `lisp-mode-hook', +`emacs-lisp-mode-hook', `lisp-interaction-mode-hook', +`scheme-mode-hook', and `muddle-mode-hook'. The mode hook function +receives no arguments. + + +File: xemacs.info, Node: Lists, Next: Defuns, Prev: Program Modes, Up: Programs + +Lists and Sexps +=============== + + By convention, Emacs keys for dealing with balanced expressions are +usually `Control-Meta-' characters. They tend to be analogous in +function to their `Control-' and `Meta-' equivalents. These commands +are usually thought of as pertaining to expressions in programming +languages, but can be useful with any language in which some sort of +parentheses exist (including English). + + The commands fall into two classes. Some commands deal only with +"lists" (parenthetical groupings). They see nothing except +parentheses, brackets, braces (depending on what must balance in the +language you are working with), and escape characters that might be used +to quote those. + + The other commands deal with expressions or "sexps". The word `sexp' +is derived from "s-expression", the term for a symbolic expression in +Lisp. In Emacs, the notion of `sexp' is not limited to Lisp. It +refers to an expression in the language your program is written in. +Each programming language has its own major mode, which customizes the +syntax tables so that expressions in that language count as sexps. + + Sexps typically include symbols, numbers, and string constants, as +well as anything contained in parentheses, brackets, or braces. + + In languages that use prefix and infix operators, such as C, it is +not possible for all expressions to be sexps. For example, C mode does +not recognize `foo + bar' as an sexp, even though it is a C expression; +it recognizes `foo' as one sexp and `bar' as another, with the `+' as +punctuation between them. This is a fundamental ambiguity: both `foo + +bar' and `foo' are legitimate choices for the sexp to move over if +point is at the `f'. Note that `(foo + bar)' is a sexp in C mode. + + Some languages have obscure forms of syntax for expressions that +nobody has bothered to make Emacs understand properly. + +`C-M-f' + Move forward over an sexp (`forward-sexp'). + +`C-M-b' + Move backward over an sexp (`backward-sexp'). + +`C-M-k' + Kill sexp forward (`kill-sexp'). + +`C-M-u' + Move up and backward in list structure (`backward-up-list'). + +`C-M-d' + Move down and forward in list structure (`down-list'). + +`C-M-n' + Move forward over a list (`forward-list'). + +`C-M-p' + Move backward over a list (`backward-list'). + +`C-M-t' + Transpose expressions (`transpose-sexps'). + +`C-M-@' + Put mark after following expression (`mark-sexp'). + + To move forward over an sexp, use `C-M-f' (`forward-sexp'). If the +first significant character after point is an opening delimiter (`(' in +Lisp; `(', `[', or `{' in C), `C-M-f' moves past the matching closing +delimiter. If the character begins a symbol, string, or number, +`C-M-f' moves over that. If the character after point is a closing +delimiter, `C-M-f' just moves past it. (This last is not really moving +across an sexp; it is an exception which is included in the definition +of `C-M-f' because it is as useful a behavior as anyone can think of +for that situation.) + + The command `C-M-b' (`backward-sexp') moves backward over a sexp. +The detailed rules are like those above for `C-M-f', but with +directions reversed. If there are any prefix characters (single quote, +back quote, and comma, in Lisp) preceding the sexp, `C-M-b' moves back +over them as well. + + `C-M-f' or `C-M-b' with an argument repeats that operation the +specified number of times; with a negative argument, it moves in the +opposite direction. + + In languages such as C where the comment-terminator can be +recognized, the sexp commands move across comments as if they were +whitespace. In Lisp and other languages where comments run until the +end of a line, it is very difficult to ignore comments when parsing +backwards; therefore, in such languages the sexp commands treat the +text of comments as if it were code. + + Killing an sexp at a time can be done with `C-M-k' (`kill-sexp'). +`C-M-k' kills the characters that `C-M-f' would move over. + + The "list commands", `C-M-n' (`forward-list') and `C-M-p' +(`backward-list'), move over lists like the sexp commands but skip over +any number of other kinds of sexps (symbols, strings, etc). In some +situations, these commands are useful because they usually ignore +comments, since the comments usually do not contain any lists. + + `C-M-n' and `C-M-p' stay at the same level in parentheses, when that +is possible. To move up one (or N) levels, use `C-M-u' +(`backward-up-list'). `C-M-u' moves backward up past one unmatched +opening delimiter. A positive argument serves as a repeat count; a +negative argument reverses direction of motion and also requests +repetition, so it moves forward and up one or more levels. + + To move down in list structure, use `C-M-d' (`down-list'). In Lisp +mode, where `(' is the only opening delimiter, this is nearly the same +as searching for a `('. An argument specifies the number of levels of +parentheses to go down. + + `C-M-t' (`transpose-sexps') drags the previous sexp across the next +one. An argument serves as a repeat count, and a negative argument +drags backwards (thus canceling out the effect of `C-M-t' with a +positive argument). An argument of zero, rather than doing nothing, +transposes the sexps ending after point and the mark. + + To make the region be the next sexp in the buffer, use `C-M-@' +(`mark-sexp') which sets the mark at the same place that `C-M-f' would +move to. `C-M-@' takes arguments like `C-M-f'. In particular, a +negative argument is useful for putting the mark at the beginning of +the previous sexp. + + The list and sexp commands' understanding of syntax is completely +controlled by the syntax table. Any character can, for example, be +declared to be an opening delimiter and act like an open parenthesis. +*Note Syntax::. + + +File: xemacs.info, Node: Defuns, Next: Grinding, Prev: Lists, Up: Programs + +Defuns +====== + + In Emacs, a parenthetical grouping at the top level in the buffer is +called a "defun". The name derives from the fact that most top-level +lists in Lisp are instances of the special form `defun', but Emacs +calls any top-level parenthetical grouping counts a defun regardless of +its contents or the programming language. For example, in C, the body +of a function definition is a defun. + +`C-M-a' + Move to beginning of current or preceding defun + (`beginning-of-defun'). + +`C-M-e' + Move to end of current or following defun (`end-of-defun'). + +`C-M-h' + Put region around whole current or following defun (`mark-defun'). + + The commands to move to the beginning and end of the current defun +are `C-M-a' (`beginning-of-defun') and `C-M-e' (`end-of-defun'). + + To operate on the current defun, use `C-M-h' (`mark-defun') which +puts point at the beginning and the mark at the end of the current or +next defun. This is the easiest way to prepare for moving the defun to +a different place. In C mode, `C-M-h' runs the function +`mark-c-function', which is almost the same as `mark-defun', but which +backs up over the argument declarations, function name, and returned +data type so that the entire C function is inside the region. + + To compile and evaluate the current defun, use `M-x compile-defun'. +This function prints the results in the minibuffer. If you include an +argument, it inserts the value in the current buffer after the defun. + + Emacs assumes that any open-parenthesis found in the leftmost column +is the start of a defun. Therefore, never put an open-parenthesis at +the left margin in a Lisp file unless it is the start of a top level +list. Never put an open-brace or other opening delimiter at the +beginning of a line of C code unless it starts the body of a function. +The most likely problem case is when you want an opening delimiter at +the start of a line inside a string. To avoid trouble, put an escape +character (`\' in C and Emacs Lisp, `/' in some other Lisp dialects) +before the opening delimiter. It will not affect the contents of the +string. + + The original Emacs found defuns by moving upward a level of +parentheses until there were no more levels to go up. This required +scanning back to the beginning of the buffer for every function. To +speed this up, Emacs was changed to assume that any `(' (or other +character assigned the syntactic class of opening-delimiter) at the +left margin is the start of a defun. This heuristic is nearly always +right; however, it mandates the convention described above. + + +File: xemacs.info, Node: Grinding, Next: Matching, Prev: Defuns, Up: Programs + +Indentation for Programs +======================== + + The best way to keep a program properly indented ("ground") is to +use Emacs to re-indent it as you change the program. Emacs has commands +to indent properly either a single line, a specified number of lines, or +all of the lines inside a single parenthetical grouping. + +* Menu: + +* Basic Indent:: +* Multi-line Indent:: Commands to reindent many lines at once. +* Lisp Indent:: Specifying how each Lisp function should be indented. +* C Indent:: Choosing an indentation style for C code. + + +File: xemacs.info, Node: Basic Indent, Next: Multi-line Indent, Prev: Grinding, Up: Grinding + +Basic Program Indentation Commands +---------------------------------- + +`' + Adjust indentation of current line. + +`' + Equivalent to followed by (`newline-and-indent'). + + The basic indentation command is , which gives the current line +the correct indentation as determined from the previous lines. The +function that runs depends on the major mode; it is +`lisp-indent-line' in Lisp mode, `c-indent-line' in C mode, etc. These +functions understand different syntaxes for different languages, but +they all do about the same thing. in any programming language +major mode inserts or deletes whitespace at the beginning of the +current line, independent of where point is in the line. If point is +inside the whitespace at the beginning of the line, leaves it at +the end of that whitespace; otherwise, leaves point fixed with +respect to the characters around it. + + Use `C-q ' to insert a tab at point. + + When entering a large amount of new code, use +(`newline-and-indent'), which is equivalent to a followed by a +. creates a blank line, then gives it the appropriate +indentation. + + indents the second and following lines of the body of a +parenthetical grouping each under the preceding one; therefore, if you +alter one line's indentation to be nonstandard, the lines below tend to +follow it. This is the right behavior in cases where the standard +result of does not look good. + + Remember that Emacs assumes that an open-parenthesis, open-brace, or +other opening delimiter at the left margin (including the indentation +routines) is the start of a function. You should therefore never have +an opening delimiter in column zero that is not the beginning of a +function, not even inside a string. This restriction is vital for +making the indentation commands fast. *Note Defuns::, for more +information on this behavior. + + +File: xemacs.info, Node: Multi-line Indent, Next: Lisp Indent, Prev: Basic Indent, Up: Grinding + +Indenting Several Lines +----------------------- + + Several commands are available to re-indent several lines of code +which have been altered or moved to a different level in a list +structure. + +`C-M-q' + Re-indent all the lines within one list (`indent-sexp'). + +`C-u ' + Shift an entire list rigidly sideways so that its first line is + properly indented. + +`C-M-\' + Re-indent all lines in the region (`indent-region'). + + To re-indent the contents of a single list, position point before the +beginning of it and type `C-M-q'. This key is bound to `indent-sexp' in +Lisp mode, `indent-c-exp' in C mode, and bound to other suitable +functions in other modes. The indentation of the line the sexp starts +on is not changed; therefore, only the relative indentation within the +list, and not its position, is changed. To correct the position as +well, type a before `C-M-q'. + + If the relative indentation within a list is correct but the +indentation of its beginning is not, go to the line on which the list +begins and type `C-u '. When you give a numeric argument, +it moves all the lines in the group, starting on the current line, +sideways the same amount that the current line moves. The command does +not move lines that start inside strings, or C preprocessor lines when +in C mode. + + Another way to specify a range to be re-indented is with point and +mark. The command `C-M-\' (`indent-region') applies to every +line whose first character is between point and mark. + + +File: xemacs.info, Node: Lisp Indent, Next: C Indent, Prev: Multi-line Indent, Up: Grinding + +Customizing Lisp Indentation +---------------------------- + + The indentation pattern for a Lisp expression can depend on the +function called by the expression. For each Lisp function, you can +choose among several predefined patterns of indentation, or define an +arbitrary one with a Lisp program. + + The standard pattern of indentation is as follows: the second line +of the expression is indented under the first argument, if that is on +the same line as the beginning of the expression; otherwise, the second +line is indented underneath the function name. Each following line is +indented under the previous line whose nesting depth is the same. + + If the variable `lisp-indent-offset' is non-`nil', it overrides the +usual indentation pattern for the second line of an expression, so that +such lines are always indented `lisp-indent-offset' more columns than +the containing list. + + Certain functions override the standard pattern. Functions whose +names start with `def' always indent the second line by +`lisp-body-indention' extra columns beyond the open-parenthesis +starting the expression. + + Individual functions can override the standard pattern in various +ways, according to the `lisp-indent-function' property of the function +name. (Note: `lisp-indent-function' was formerly called +`lisp-indent-hook'). There are four possibilities for this property: + +`nil' + This is the same as no property; the standard indentation pattern + is used. + +`defun' + The pattern used for function names that start with `def' is used + for this function also. + +a number, NUMBER + The first NUMBER arguments of the function are "distinguished" + arguments; the rest are considered the "body" of the expression. + A line in the expression is indented according to whether the + first argument on it is distinguished or not. If the argument is + part of the body, the line is indented `lisp-body-indent' more + columns than the open-parenthesis starting the containing + expression. If the argument is distinguished and is either the + first or second argument, it is indented twice that many extra + columns. If the argument is distinguished and not the first or + second argument, the standard pattern is followed for that line. + +a symbol, SYMBOL + SYMBOL should be a function name; that function is called to + calculate the indentation of a line within this expression. The + function receives two arguments: + STATE + The value returned by `parse-partial-sexp' (a Lisp primitive + for indentation and nesting computation) when it parses up to + the beginning of this line. + + POS + The position at which the line being indented begins. + + It should return either a number, which is the number of columns of + indentation for that line, or a list whose first element is such a + number. The difference between returning a number and returning a + list is that a number says that all following lines at the same + nesting level should be indented just like this one; a list says + that following lines might call for different indentations. This + makes a difference when the indentation is computed by `C-M-q'; if + the value is a number, `C-M-q' need not recalculate indentation + for the following lines until the end of the list. + + +File: xemacs.info, Node: C Indent, Prev: Lisp Indent, Up: Grinding + +Customizing C Indentation +------------------------- + + Two variables control which commands perform C indentation and when. + + If `c-auto-newline' is non-`nil', newlines are inserted both before +and after braces that you insert and after colons and semicolons. +Correct C indentation is done on all the lines that are made this way. + + If `c-tab-always-indent' is non-`nil', the command in C mode +does indentation only if point is at the left margin or within the +line's indentation. If there is non-whitespace to the left of point, + just inserts a tab character in the buffer. Normally, this +variable is `nil', and always reindents the current line. + + C does not have anything analogous to particular function names for +which special forms of indentation are desirable. However, it has a +different need for customization facilities: many different styles of C +indentation are in common use. + + There are six variables you can set to control the style that Emacs C +mode will use. + +`c-indent-level' + Indentation of C statements within surrounding block. The + surrounding block's indentation is the indentation of the line on + which the open-brace appears. + +`c-continued-statement-offset' + Extra indentation given to a substatement, such as the then-clause + of an `if' or body of a `while'. + +`c-brace-offset' + Extra indentation for lines that start with an open brace. + +`c-brace-imaginary-offset' + An open brace following other text is treated as if it were this + far to the right of the start of its line. + +`c-argdecl-indent' + Indentation level of declarations of C function arguments. + +`c-label-offset' + Extra indentation for a line that is a label, case, or default. + + The variable `c-indent-level' controls the indentation for C +statements with respect to the surrounding block. In the example: + + { + foo (); + +the difference in indentation between the lines is `c-indent-level'. +Its standard value is 2. + + If the open-brace beginning the compound statement is not at the +beginning of its line, the `c-indent-level' is added to the indentation +of the line, not the column of the open-brace. For example, + + if (losing) { + do_this (); + +One popular indentation style is that which results from setting +`c-indent-level' to 8 and putting open-braces at the end of a line in +this way. Another popular style prefers to put the open-brace on a +separate line. + + In fact, the value of the variable `c-brace-imaginary-offset' is +also added to the indentation of such a statement. Normally this +variable is zero. Think of this variable as the imaginary position of +the open brace, relative to the first non-blank character on the line. +By setting the variable to 4 and `c-indent-level' to 0, you can get +this style: + + if (x == y) { + do_it (); + } + + When `c-indent-level' is zero, the statements inside most braces +line up exactly under the open brace. An exception are braces in column +zero, like those surrounding a function's body. The statements inside +those braces are not placed at column zero. Instead, `c-brace-offset' +and `c-continued-statement-offset' (see below) are added to produce a +typical offset between brace levels, and the statements are indented +that far. + + `c-continued-statement-offset' controls the extra indentation for a +line that starts within a statement (but not within parentheses or +brackets). These lines are usually statements inside other statements, +like the then-clauses of `if' statements and the bodies of `while' +statements. The `c-continued-statement-offset' parameter determines +the difference in indentation between the two lines in: + + if (x == y) + do_it (); + +The default value for `c-continued-statement-offset' is 2. Some +popular indentation styles correspond to a value of zero for +`c-continued-statement-offset'. + + `c-brace-offset' is the extra indentation given to a line that +starts with an open-brace. Its standard value is zero; compare: + + if (x == y) + { + +with: + + if (x == y) + do_it (); + +If you set `c-brace-offset' to 4, the first example becomes: + + if (x == y) + { + + `c-argdecl-indent' controls the indentation of declarations of the +arguments of a C function. It is absolute: argument declarations +receive exactly `c-argdecl-indent' spaces. The standard value is 5 and +results in code like this: + + char * + index (string, char) + char *string; + int char; + + `c-label-offset' is the extra indentation given to a line that +contains a label, a case statement, or a `default:' statement. Its +standard value is -2 and results in code like this: + + switch (c) + { + case 'x': + +If `c-label-offset' were zero, the same code would be indented as: + + switch (c) + { + case 'x': + +This example assumes that the other variables above also have their +default values. + + Using the indentation style produced by the default settings of the +variables just discussed and putting open braces on separate lines +produces clear and readable files. For an example, look at any of the C +source files of XEmacs. + + +File: xemacs.info, Node: Matching, Next: Comments, Prev: Grinding, Up: Programs + +Automatic Display of Matching Parentheses +========================================= + + The Emacs parenthesis-matching feature shows you automatically how +parentheses match in the text. Whenever a self-inserting character that +is a closing delimiter is typed, the cursor moves momentarily to the +location of the matching opening delimiter, provided that is visible on +the screen. If it is not on the screen, some text starting with that +opening delimiter is displayed in the echo area. Either way, you see +the grouping you are closing off. + + In Lisp, automatic matching applies only to parentheses. In C, it +also applies to braces and brackets. Emacs knows which characters to +regard as matching delimiters based on the syntax table set by the major +mode. *Note Syntax::. + + If the opening delimiter and closing delimiter are mismatched--as in +`[x)'--the echo area displays a warning message. The correct matches +are specified in the syntax table. + + Two variables control parenthesis matching displays. +`blink-matching-paren' turns the feature on or off. The default is `t' +(match display is on); `nil' turns it off. +`blink-matching-paren-distance' specifies how many characters back +Emacs searches to find a matching opening delimiter. If the match is +not found in the specified region, scanning stops, and nothing is +displayed. This prevents wasting lots of time scanning when there is no +match. The default is 4000. + + +File: xemacs.info, Node: Comments, Next: Balanced Editing, Prev: Matching, Up: Programs + +Manipulating Comments +===================== + + The comment commands insert, kill and align comments. + +`M-;' + Insert or align comment (`indent-for-comment'). + +`C-x ;' + Set comment column (`set-comment-column'). + +`C-u - C-x ;' + Kill comment on current line (`kill-comment'). + +`M-' + Like followed by inserting and aligning a comment + (`indent-new-comment-line'). + + The command that creates a comment is `Meta-;' +(`indent-for-comment'). If there is no comment already on the line, a +new comment is created and aligned at a specific column called the +"comment column". Emacs creates the comment by inserting the string at +the value of `comment-start'; see below. Point is left after that +string. If the text of the line extends past the comment column, +indentation is done to a suitable boundary (usually, at least one space +is inserted). If the major mode has specified a string to terminate +comments, that string is inserted after point, to keep the syntax valid. + + You can also use `Meta-;' to align an existing comment. If a line +already contains the string that starts comments, `M-;' just moves +point after it and re-indents it to the conventional place. Exception: +comments starting in column 0 are not moved. + + Some major modes have special rules for indenting certain kinds of +comments in certain contexts. For example, in Lisp code, comments which +start with two semicolons are indented as if they were lines of code, +instead of at the comment column. Comments which start with three +semicolons are supposed to start at the left margin. Emacs understands +these conventions by indenting a double-semicolon comment using +and by not changing the indentation of a triple-semicolon comment at +all. + + ;; This function is just an example. + ;;; Here either two or three semicolons are appropriate. + (defun foo (x) + ;;; And now, the first part of the function: + ;; The following line adds one. + (1+ x)) ; This line adds one. + + In C code, a comment preceded on its line by nothing but whitespace +is indented like a line of code. + + Even when an existing comment is properly aligned, `M-;' is still +useful for moving directly to the start of the comment. + + `C-u - C-x ;' (`kill-comment') kills the comment on the current +line, if there is one. The indentation before the start of the comment +is killed as well. If there does not appear to be a comment in the +line, nothing happens. To reinsert the comment on another line, move +to the end of that line, type first `C-y', and then `M-;' to realign +the comment. Note that `C-u - C-x ;' is not a distinct key; it is `C-x +;' (`set-comment-column') with a negative argument. That command is +programmed to call `kill-comment' when called with a negative argument. +However, `kill-comment' is a valid command which you could bind +directly to a key if you wanted to. + +Multiple Lines of Comments +-------------------------- + + If you are typing a comment and want to continue it on another line, +use the command `Meta-' (`indent-new-comment-line'), which +terminates the comment you are typing, creates a new blank line +afterward, and begins a new comment indented under the old one. If +Auto Fill mode is on and you go past the fill column while typing, the +comment is continued in just this fashion. If point is not at the end +of the line when you type `M-', the text on the rest of the line +becomes part of the new comment line. + +Options Controlling Comments +---------------------------- + + The comment column is stored in the variable `comment-column'. You +can explicitly set it to a number. Alternatively, the command `C-x ;' +(`set-comment-column') sets the comment column to the column point is +at. `C-u C-x ;' sets the comment column to match the last comment +before point in the buffer, and then calls `Meta-;' to align the +current line's comment under the previous one. Note that `C-u - C-x ;' +runs the function `kill-comment' as described above. + + `comment-column' is a per-buffer variable; altering the variable +affects only the current buffer. You can also change the default value. +*Note Locals::. Many major modes initialize this variable for the +current buffer. + + The comment commands recognize comments based on the regular +expression that is the value of the variable `comment-start-skip'. +This regexp should not match the null string. It may match more than +the comment starting delimiter in the strictest sense of the word; for +example, in C mode the value of the variable is `"/\\*+ *"', which +matches extra stars and spaces after the `/*' itself. (Note that `\\' +is needed in Lisp syntax to include a `\' in the string, which is needed +to deny the first star its special meaning in regexp syntax. *Note +Regexps::.) + + When a comment command makes a new comment, it inserts the value of +`comment-start' to begin it. The value of `comment-end' is inserted +after point and will follow the text you will insert into the comment. +In C mode, `comment-start' has the value `"/* "' and `comment-end' has +the value `" */"'. + + `comment-multi-line' controls how `M-' +(`indent-new-comment-line') behaves when used inside a comment. If +`comment-multi-line' is `nil', as it normally is, then `M-' +terminates the comment on the starting line and starts a new comment on +the new following line. If `comment-multi-line' is not `nil', then +`M-' sets up the new following line as part of the same comment +that was found on the starting line. This is done by not inserting a +terminator on the old line and not inserting a starter on the new line. +In languages where multi-line comments are legal, the value you choose +for this variable is a matter of taste. + + The variable `comment-indent-hook' should contain a function that is +called to compute the indentation for a newly inserted comment or for +aligning an existing comment. Major modes set this variable +differently. The function is called with no arguments, but with point +at the beginning of the comment, or at the end of a line if a new +comment is to be inserted. The function should return the column in +which the comment ought to start. For example, in Lisp mode, the +indent hook function bases its decision on the number of semicolons +that begin an existing comment and on the code in the preceding lines. + + +File: xemacs.info, Node: Balanced Editing, Next: Lisp Completion, Prev: Comments, Up: Programs + +Editing Without Unbalanced Parentheses +====================================== + +`M-(' + Put parentheses around next sexp(s) (`insert-parentheses'). + +`M-)' + Move past next close parenthesis and re-indent + (`move-over-close-and-reindent'). + + The commands `M-(' (`insert-parentheses') and `M-)' +(`move-over-close-and-reindent') are designed to facilitate a style of +editing which keeps parentheses balanced at all times. `M-(' inserts a +pair of parentheses, either together as in `()', or, if given an +argument, around the next several sexps, and leaves point after the open +parenthesis. Instead of typing `( F O O )', you can type `M-( F O O', +which has the same effect except for leaving the cursor before the +close parenthesis. You can then type `M-)', which moves past the close +parenthesis, deletes any indentation preceding it (in this example +there is none), and indents with after it. + + +File: xemacs.info, Node: Lisp Completion, Next: Documentation, Prev: Balanced Editing, Up: Programs + +Completion for Lisp Symbols +=========================== + + Completion usually happens in the minibuffer. An exception is +completion for Lisp symbol names, which is available in all buffers. + + The command `M-' (`lisp-complete-symbol') takes the partial +Lisp symbol before point to be an abbreviation, and compares it against +all non-trivial Lisp symbols currently known to Emacs. Any additional +characters that they all have in common are inserted at point. +Non-trivial symbols are those that have function definitions, values, or +properties. + + If there is an open-parenthesis immediately before the beginning of +the partial symbol, only symbols with function definitions are +considered as completions. + + If the partial name in the buffer has more than one possible +completion and they have no additional characters in common, a list of +all possible completions is displayed in another window. + + +File: xemacs.info, Node: Documentation, Next: Change Log, Prev: Lisp Completion, Up: Programs + +Documentation Commands +====================== + + As you edit Lisp code to be run in Emacs, you can use the commands +`C-h f' (`describe-function') and `C-h v' (`describe-variable') to +print documentation of functions and variables you want to call. These +commands use the minibuffer to read the name of a function or variable +to document, and display the documentation in a window. + + For extra convenience, these commands provide default arguments +based on the code in the neighborhood of point. `C-h f' sets the +default to the function called in the innermost list containing point. +`C-h v' uses the symbol name around or adjacent to point as its default. + + The `M-x manual-entry' command gives you access to documentation on +Unix commands, system calls, and libraries. The command reads a topic +as an argument, and displays the Unix manual page for that topic. +`manual-entry' always searches all 8 sections of the manual and +concatenates all the entries it finds. For example, the topic +`termcap' finds the description of the termcap library from section 3, +followed by the description of the termcap data base from section 5. + diff --git a/info/xemacs.info-11 b/info/xemacs.info-11 new file mode 100644 index 0000000..c9ba3be --- /dev/null +++ b/info/xemacs.info-11 @@ -0,0 +1,1133 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Change Log, Next: Tags, Prev: Documentation, Up: Programs + +Change Logs +=========== + + The Emacs command `M-x add-change-log-entry' helps you keep a record +of when and why you have changed a program. It assumes that you have a +file in which you write a chronological sequence of entries describing +individual changes. The default is to store the change entries in a +file called `ChangeLog' in the same directory as the file you are +editing. The same `ChangeLog' file therefore records changes for all +the files in a directory. + + A change log entry starts with a header line that contains your name +and the current date. Except for these header lines, every line in the +change log starts with a tab. One entry can describe several changes; +each change starts with a line starting with a tab and a star. `M-x +add-change-log-entry' visits the change log file and creates a new entry +unless the most recent entry is for today's date and your name. In +either case, it adds a new line to start the description of another +change just after the header line of the entry. When `M-x +add-change-log-entry' is finished, all is prepared for you to edit in +the description of what you changed and how. You must then save the +change log file yourself. + + The change log file is always visited in Indented Text mode, which +means that and auto-filling indent each new line like the previous +line. This is convenient for entering the contents of an entry, which +must be indented. *Note Text Mode::. + + Here is an example of the formatting conventions used in the change +log for Emacs: + + Wed Jun 26 19:29:32 1985 Richard M. Stallman (rms at mit-prep) + + * xdisp.c (try_window_id): + If C-k is done at end of next-to-last line, + this fn updates window_end_vpos and cannot leave + window_end_pos nonnegative (it is zero, in fact). + If display is preempted before lines are output, + this is inconsistent. Fix by setting + blank_end_of_window to nonzero. + + Tue Jun 25 05:25:33 1985 Richard M. Stallman (rms at mit-prep) + + * cmds.c (Fnewline): + Call the auto fill hook if appropriate. + + * xdisp.c (try_window_id): + If point is found by compute_motion after xp, record that + permanently. If display_text_line sets point position wrong + (case where line is killed, point is at eob and that line is + not displayed), set it again in final compute_motion. + + +File: xemacs.info, Node: Tags, Next: Fortran, Prev: Change Log, Up: Programs + +Tags Tables +=========== + + A "tags table" is a description of how a multi-file program is +broken up into files. It lists the names of the component files and the +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 `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 "tags table files". The +conventional name for a tags table file is `TAGS'. + + Each entry in the tags table records the name of one tag, the name +of the file that the tag is defined in (implicitly), and the position +in that file of the tag's definition. + + Just what names from the described files are recorded in the tags +table depends on the programming language of the described file. They +normally include all functions and subroutines, and may also include +global variables, data types, and anything else convenient. Each name +recorded is called a "tag". + +* Menu: + +* Tag Syntax:: Tag syntax for various types of code and text files. +* Create Tags Table:: Creating a tags table with `etags'. +* Select Tags Table:: How to visit a tags table. +* 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. + + +File: xemacs.info, Node: Tag Syntax, Next: Create Tags Table, Up: Tags + +Source File Tag Syntax +---------------------- + + Here is how tag syntax is defined for the most popular languages: + + * In C code, any C function or typedef is a tag, and so are + definitions of `struct', `union' and `enum'. `#define' macro + definitions and `enum' constants are also tags, unless you specify + `--no-defines' when making the tags table. Similarly, global + variables are tags, unless you specify `--no-globals'. Use of + `--no-globals' and `--no-defines' can make the tags table file + much smaller. + + * 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 `--members' option. Tags for variables + and functions in classes are named `CLASS::VARIABLE' and + `CLASS::FUNCTION'. + + * In Java code, tags include all the constructs recognized in C++, + plus the `extends' and `implements' constructs. Tags for variables + and functions in classes are named `CLASS.VARIABLE' and + `CLASS.FUNCTION'. + + * In LaTeX text, the argument of any of the commands `\chapter', + `\section', `\subsection', `\subsubsection', `\eqno', `\label', + `\ref', `\cite', `\bibitem', `\part', `\appendix', `\entry', or + `\index', is a tag. + + Other commands can make tags as well, if you specify them in the + environment variable `TEXTAGS' before invoking `etags'. The value + of this environment variable should be a colon-separated list of + commands names. For example, + + TEXTAGS="def:newcommand:newenvironment" + export TEXTAGS + + specifies (using Bourne shell syntax) that the commands `\def', + `\newcommand' and `\newenvironment' also define tags. + + * In Lisp code, any function defined with `defun', any variable + defined with `defvar' or `defconst', and in general the first + argument of any expression that starts with `(def' in column zero, + is a tag. + + * In Scheme code, tags include anything defined with `def' or with a + construct whose name starts with `def'. They also include + variables set with `set!' at top level in the file. + + Several other languages are also supported: + + * In assembler code, labels appearing at the beginning of a line, + followed by a colon, are tags. + + * In Bison or Yacc input files, each rule defines as a tag the + nonterminal it constructs. The portions of the file that contain + C code are parsed as C code. + + * In Cobol code, paragraphs names are the tags, i.e. any word + starting in column 8 and followed by a full stop. + + * In Erlang code, the tags are the functions, records, and macros + defined in the file. + + * In Fortran code, functions and subroutines are tags. + + * In Objective C code, tags include Objective C definitions for + classes, class categories, methods and protocols. + + * In Pascal code, the tags are the functions and procedures defined + in the file. + + * In Perl code, the tags are the procedures defined by the `sub' + keyword. + + * In Postscript code, the tags are the functions. + + * In Prolog code, a tag name appears at the left margin. + + You can also generate tags based on regexp matching (*note Create +Tags Table::.) to handle other formats and languages. + + +File: xemacs.info, Node: Create Tags Table, Next: Select Tags Table, Prev: Tag Syntax, Up: Tags + +Creating Tags Tables +-------------------- + + The `etags' program is used to create a tags table file. It knows +the syntax of several languages, as described in *Note Tag Syntax::. +Here is how to run `etags': + + etags INPUTFILES... + +The `etags' program reads the specified files, and writes a tags table +named `TAGS' in the current working directory. `etags' recognizes the +language used in an input file based on its file name and contents. +You can specify the language with the `--language=NAME' option, +described below. + + If the tags table data become outdated due to changes in the files +described in the table, the way to update the tags table is the same +way it was made in the first place. It is not necessary to do this +often. + + If the tags table fails to record a tag, or records it for the wrong +file, then Emacs cannot possibly find its definition. However, if the +position recorded in the tags table becomes a little bit wrong (due to +some editing in the file that the tag definition is in), the only +consequence is a slight delay in finding the tag. Even if the stored +position is very wrong, Emacs will still find the tag, but it must +search the entire file for it. + + So you should update a tags table when you define new tags that you +want to have listed, or when you move tag definitions from one file to +another, or when changes become substantial. Normally there is no need +to update the tags table after each edit, or even every day. + + One tags table can effectively include another. Specify the included +tags file name with the `--include=FILE' option when creating the file +that is to include it. The latter file then acts as if it contained +all the files specified in the included file, as well as the files it +directly contains. + + If you specify the source files with relative file names when you run +`etags', the tags file will contain file names relative to the +directory where the tags file was initially written. This way, you can +move an entire directory tree containing both the tags file and the +source files, and the tags file will still refer correctly to the source +files. + + If you specify absolute file names as arguments to `etags', then 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 +`/', or with `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 +have a limit on its length. The simplest way to circumvent this limit +is to tell `etags' to read the file names from its standard input, by +typing a dash in place of the file names, like this: + + find . -name "*.[chCH]" -print | etags - + + Use the option `--language=NAME' to specify the language explicitly. +You can intermix these options with file names; each one applies to +the file names that follow it. Specify `--language=auto' to tell +`etags' to resume guessing the language from the file names and file +contents. Specify `--language=none' to turn off language-specific +processing entirely; then `etags' recognizes tags by regexp matching +alone. `etags --help' prints the list of the languages `etags' knows, +and the file name rules for guessing the language. + + The `--regex' option provides a general way of recognizing tags +based on regexp matching. You can freely intermix it with file names. +Each `--regex' option adds to the preceding ones, and applies only to +the following files. The syntax is: + + --regex=/TAGREGEXP[/NAMEREGEXP]/ + +where TAGREGEXP is used to match the lines to tag. It is always +anchored, that is, it behaves as if preceded by `^'. If you want to +account for indentation, just match any initial number of blanks by +beginning your regular expression with `[ \t]*'. In the regular +expressions, `\' quotes the next character, and `\t' stands for the tab +character. Note that `etags' does not handle the other C escape +sequences for special characters. + + The syntax of regular expressions in `etags' is the same as in +Emacs, augmented with the "interval operator", which works as in `grep' +and `ed'. The syntax of an interval operator is `\{M,N\}', and its +meaning is to match the preceding expression at least M times and up to +N times. + + You should not match more characters with 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 TAGREGEXP, you may +find useful to add a NAMEREGEXP, in order to narrow the tag scope. You +can find some examples below. + + The `-R' option deletes all the regexps defined with `--regex' +options. It applies to the file names following it, as you can see +from the following example: + + etags --regex=/REG1/ voo.doo --regex=/REG2/ \ + bar.ber -R --lang=lisp los.er + +Here `etags' chooses the parsing language for `voo.doo' and `bar.ber' +according to their contents. `etags' also uses REG1 to recognize +additional tags in `voo.doo', and both REG1 and REG2 to recognize +additional tags in `bar.ber'. `etags' uses the Lisp tags rules, and no +regexp matching, to recognize tags in `los.er'. + + Here are some more examples. The regexps are quoted to protect them +from shell interpretation. + +Tag the `DEFVAR' macros in the emacs source files: + + --regex='/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/' + +Tag VHDL files (this example is a single long line, broken here for +formatting reasons): + + --language=none + --regex='/[ \t]*\(ARCHITECTURE\|CONFIGURATION\) +[^ ]* +OF/' + --regex='/[ \t]*\(ATTRIBUTE\|ENTITY\|FUNCTION\|PACKAGE\ + \( BODY\)?\|PROCEDURE\|PROCESS\|TYPE\)[ \t]+\([^ \t(]+\)/\3/' + +Tag TCL files (this last example shows the usage of a NAMEREGEXP): + + --lang=none --regex='/proc[ \t]+\([^ \t]+\)/\1/' + + For a list of the other available `etags' options, execute `etags +--help'. + + +File: xemacs.info, Node: Select Tags Table, Next: Find Tag, Prev: Create Tags Table, Up: Tags + +Selecting a Tags Table +---------------------- + + At any time Emacs has one "selected" tags table, and all the commands +for working with tags tables use the selected one. To select a tags +table, use the variable `tag-table-alist'. + + The value of `tag-table-alist' is a list that determines which +`TAGS' files should be active for a given buffer. This is not really +an association list, in that all elements are checked. The car of each +element of this list is a pattern against which the buffers file name +is compared; if it matches, then the cdr of the list should be the name +of the tags table to use. If more than one element of this list +matches the buffers file name, all of the associated tags tables are +used. Earlier ones are searched first. + + If the car of elements of this list are strings, they are treated as +regular-expressions against which the file is compared (like the +`auto-mode-alist'). If they are not strings, they are evaluated. If +they evaluate to non-`nil', the current buffer is considered to match. + + If the cdr of the elements of this list are strings, they are +assumed to name a tags file. If they name a directory, the string +`tags' is appended to them to get the file name. If they are not +strings, they are evaluated and must return an appropriate string. + + For 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/") + )) + + The example defines the tags table alist in the following way: + + * Anything in the directory `/usr/src/public/perl/' should use the + `TAGS' file `/usr/src/public/perl/perl-3.0/TAGS'. + + * Files ending in `.el' should use the `TAGS' file + `/usr/local/emacs/src/TAGS'. + + * Anything in or below the directory `/jbw/gnu/' should use the + `TAGS' file `/usr15/degree/stud/jbw/gnu/TAGS'. + + If you had a file called `/usr/jbw/foo.el', it would use both `TAGS' +files, +`/usr/local/emacs/src/TAGS' and `/usr15/degree/stud/jbw/gnu/TAGS' (in +that order), because it matches both patterns. + + If the buffer-local variable `buffer-tag-table' is set, it names a +tags table that is searched before all others when `find-tag' is +executed from this buffer. + + If there is a file called `TAGS' in the same directory as the file +in question, then that tags file will always be used as well (after the +`buffer-tag-table' but before the tables specified by this list). + + If the variable `tags-file-name' is set, the `TAGS' file it names +will apply to all buffers (for backwards compatibility.) It is searched +first. + + If the value of the variable `tags-always-build-completion-table' is +`t', the tags file will always be added to the completion table without +asking first, regardless of the size of the tags file. + + The function `M-x visit-tags-table', is largely made obsolete by the +variable `tag-table-alist', tells tags commands to use the tags table +file FILE first. The FILE should be the name of a file created with +the `etags' program. A directory name is also acceptable; it means the +file `TAGS' in that directory. The function only stores the file name +you provide in the variable `tags-file-name'. Emacs does not actually +read in the tags table contents until you try to use them. You can set +the variable explicitly instead of using `visit-tags-table'. The value +of the variable `tags-file-name' is the name of the tags table used by +all buffers. This is for backward compatibility, and is largely +supplanted by the variable `tag-table-alist'. + + +File: xemacs.info, Node: Find Tag, Next: Tags Search, Prev: Select Tags Table, Up: Tags + +Finding a Tag +------------- + + The most important thing that a tags table enables you to do is to +find the definition of a specific tag. + +`M-. TAG &OPTIONAL OTHER-WINDOW' + Find first definition of TAG (`find-tag'). + +`C-u M-.' + Find next alternate definition of last tag specified. + +`C-x 4 . TAG' + Find first definition of TAG, but display it in another window + (`find-tag-other-window'). + + `M-.' (`find-tag') is the command to find the definition of a +specified tag. It searches through the tags table for that tag, as a +string, then uses the tags table information to determine the file in +which the definition is used and the approximate character position of +the definition in the file. Then `find-tag' visits the file, moves +point to the approximate character position, and starts searching +ever-increasing distances away for the text that should appear at the +beginning of the definition. + + If an empty argument is given (by typing ), the sexp in the +buffer before or around point is used as the name of the tag to find. +*Note Lists::, for information on sexps. + + The argument to `find-tag' need not be the whole tag name; it can be +a substring of a tag name. However, there can be many tag names +containing the substring you specify. Since `find-tag' works by +searching the text of the tags table, it finds the first tag in the +table that the specified substring appears in. To find other tags that +match the substring, give `find-tag' a numeric argument, as in `C-u +M-.'. This does not read a tag name, but continues searching the tag +table's text for another tag containing the same substring last used. +If your keyboard has a real key, `M-0 M-.' is an easier +alternative to `C-u M-.'. + + If the optional second argument OTHER-WINDOW is non-`nil', it uses +another window to display the tag. Multiple active tags tables and +completion are supported. + + Variables of note include the following: + +`tag-table-alist' + Controls which tables apply to which buffers. + +`tags-file-name' + Stores a default tags table. + +`tags-build-completion-table' + Controls completion behavior. + +`buffer-tag-table' + Specifies a buffer-local table. + +`make-tags-files-invisible' + Sets whether tags tables should be very hidden. + +`tag-mark-stack-max' + Specifies how many tags-based hops to remember. + + Like most commands that can switch buffers, `find-tag' has another +similar command that displays the new buffer in another window. `C-x 4 +.' invokes the function `find-tag-other-window'. (This key sequence +ends with a period.) + + Emacs comes with a tags table file `TAGS' (in the directory +containing Lisp libraries) that includes all the Lisp libraries and all +the C sources of Emacs. By specifying this file with `visit-tags-table' +and then using `M-.' you can quickly look at the source of any Emacs +function. + + +File: xemacs.info, Node: Tags Search, Next: List Tags, Prev: Find Tag, Up: Tags + +Searching and Replacing with Tags Tables +---------------------------------------- + + The commands in this section visit and search all the files listed +in the selected tags table, one by one. For these commands, the tags +table serves only to specify a sequence of files to search. A related +command is `M-x grep' (*note Compilation::.). + +`M-x tags-search REGEXP ' + Search for REGEXP through the files in the selected tags table. + +`M-x tags-query-replace REGEXP REPLACEMENT ' + Perform a `query-replace-regexp' on each file in the selected tags + table. + +`M-,' + Restart one of the commands above, from the current location of + point (`tags-loop-continue'). + + `M-x tags-search' reads a regexp using the minibuffer, then searches +for matches in all the files in the selected tags table, one file at a +time. It displays the name of the file being searched so you can +follow its progress. As soon as it finds an occurrence, `tags-search' +returns. + + Having found one match, you probably want to find all the rest. To +find one more match, type `M-,' (`tags-loop-continue') to resume the +`tags-search'. This searches the rest of the current buffer, followed +by the remaining files of the tags table. + + `M-x tags-query-replace' performs a single `query-replace-regexp' +through all the files in the tags table. It reads a regexp to search +for and a string to replace with, just like ordinary `M-x +query-replace-regexp'. It searches much like `M-x tags-search', but +repeatedly, processing matches according to your input. *Note +Replace::, for more information on query replace. + + It is possible to get through all the files in the tags table with a +single invocation of `M-x tags-query-replace'. But often it is useful +to exit temporarily, which you can do with any input event that has no +special query replace meaning. You can resume the query replace +subsequently by typing `M-,'; this command resumes the last tags search +or replace command that you did. + + The commands in this section carry out much broader searches than the +`find-tag' family. The `find-tag' commands search only for definitions +of tags that match your substring or regexp. The commands +`tags-search' and `tags-query-replace' find every occurrence of the +regexp, as ordinary search commands and replace commands do in the +current buffer. + + These commands create buffers only temporarily for the files that +they have to search (those which are not already visited in Emacs +buffers). Buffers in which no match is found are quickly killed; the +others continue to exist. + + It may have struck you that `tags-search' is a lot like `grep'. You +can also run `grep' itself as an inferior of Emacs and have Emacs show +you the matching lines one by one. This works much like running a +compilation; finding the source locations of the `grep' matches works +like finding the compilation errors. *Note Compilation::. + + If you wish to process all the files in a selected tags table, but +`M-x tags-search' and `M-x tags-query-replace' are not giving you the +desired result, you can use `M-x next-file'. + +`C-u M-x next-file' + With a numeric argument, regardless of its value, visit the first + file in the tags table and prepare to advance sequentially by + files. + +`M-x next-file' + Visit the next file in the selected tags table. + + +File: xemacs.info, Node: List Tags, Prev: Tags Search, Up: Tags + +Tags Table Inquiries +-------------------- + +`M-x list-tags' + Display a list of the tags defined in a specific program file. + +`M-x tags-apropos' + Display a list of all tags matching a specified regexp. + + `M-x list-tags' reads the name of one of the files described by the +selected tags table, and displays a list of all the tags defined in that +file. The "file name" argument is really just a string to compare +against the names recorded in the tags table; it is read as a string +rather than a file name. Therefore, completion and defaulting are not +available, and you must enter the string the same way it appears in the +tag table. Do not include a directory as part of the file name unless +the file name recorded in the tags table contains that directory. + + `M-x tags-apropos' is like `apropos' for tags. It reads a regexp, +then finds all the tags in the selected tags table whose entries match +that regexp, and displays the tag names found. + + +File: xemacs.info, Node: Fortran, Next: Asm Mode, Prev: Tags, Up: Programs + +Fortran Mode +============ + + Fortran mode provides special motion commands for Fortran statements +and subprograms, and indentation commands that understand Fortran +conventions of nesting, line numbers, and continuation statements. + + Special commands for comments are provided because Fortran comments +are unlike those of other languages. + + Built-in abbrevs optionally save typing when you insert Fortran +keywords. + + Use `M-x fortran-mode' to switch to this major mode. Doing so calls +the value of `fortran-mode-hook' as a function of no arguments if that +variable has a non-`nil' value. + +* Menu: + +* Motion: Fortran Motion. Moving point by statements or subprograms. +* Indent: Fortran Indent. Indentation commands for Fortran. +* Comments: Fortran Comments. Inserting and aligning comments. +* Columns: Fortran Columns. Measuring columns for valid Fortran. +* Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords. + + Fortran mode was contributed by Michael Prange. + + +File: xemacs.info, Node: Fortran Motion, Next: Fortran Indent, Prev: Fortran, Up: Fortran + +Motion Commands +--------------- + + Fortran mode provides special commands to move by subprograms +(functions and subroutines) and by statements. There is also a command +to put the region around one subprogram, which is convenient for +killing it or moving it. + +`C-M-a' + Move to beginning of subprogram + (`beginning-of-fortran-subprogram'). + +`C-M-e' + Move to end of subprogram (`end-of-fortran-subprogram'). + +`C-M-h' + Put point at beginning of subprogram and mark at end + (`mark-fortran-subprogram'). + +`C-c C-n' + Move to beginning of current or next statement (`fortran-next- + statement'). + +`C-c C-p' + Move to beginning of current or previous statement (`fortran- + previous-statement'). + + +File: xemacs.info, Node: Fortran Indent, Next: Fortran Comments, Prev: Fortran Motion, Up: Fortran + +Fortran Indentation +------------------- + + Special commands and features are available for indenting Fortran +code. They make sure various syntactic entities (line numbers, comment +line indicators, and continuation line flags) appear in the columns +that are required for standard Fortran. + +* Menu: + +* Commands: ForIndent Commands. Commands for indenting Fortran. +* Numbers: ForIndent Num. How line numbers auto-indent. +* Conv: ForIndent Conv. Conventions you must obey to avoid trouble. +* Vars: ForIndent Vars. Variables controlling Fortran indent style. + + +File: xemacs.info, Node: ForIndent Commands, Next: ForIndent Num, Prev: Fortran Indent, Up: Fortran Indent + +Fortran Indentation Commands +............................ + +`' + Indent the current line (`fortran-indent-line'). + +`M-' + Break the current line and set up a continuation line. + +`C-M-q' + Indent all the lines of the subprogram point is in + (`fortran-indent-subprogram'). + + is redefined by Fortran mode to reindent the current line for +Fortran (`fortran-indent-line'). Line numbers and continuation markers +are indented to their required columns, and the body of the statement +is independently indented, based on its nesting in the program. + + The key `C-M-q' is redefined as `fortran-indent-subprogram', a +command that reindents all the lines of the Fortran subprogram +(function or subroutine) containing point. + + The key `M-' is redefined as `fortran-split-line', a command to +split a line in the appropriate fashion for Fortran. In a non-comment +line, the second half becomes a continuation line and is indented +accordingly. In a comment line, both halves become separate comment +lines. + + +File: xemacs.info, Node: ForIndent Num, Next: ForIndent Conv, Prev: ForIndent Commands, Up: Fortran Indent + +Line Numbers and Continuation +............................. + + If a number is the first non-whitespace in the line, it is assumed +to be a line number and is moved to columns 0 through 4. (Columns are +always counted from 0 in XEmacs.) If the text on the line starts with +the conventional Fortran continuation marker `$', it is moved to column +5. If the text begins with any non whitespace character in column 5, +it is assumed to be an unconventional continuation marker and remains +in column 5. + + Line numbers of four digits or less are normally indented one space. +This amount is controlled by the variable `fortran-line-number-indent', +which is the maximum indentation a line number can have. Line numbers +are indented to right-justify them to end in column 4 unless that would +require more than the maximum indentation. The default value of the +variable is 1. + + Simply inserting a line number is enough to indent it according to +these rules. As each digit is inserted, the indentation is recomputed. +To turn off this feature, set the variable +`fortran-electric-line-number' to `nil'. Then inserting line numbers +is like inserting anything else. + + +File: xemacs.info, Node: ForIndent Conv, Next: ForIndent Vars, Prev: ForIndent Num, Up: Fortran Indent + +Syntactic Conventions +..................... + + Fortran mode assumes that you follow certain conventions that +simplify the task of understanding a Fortran program well enough to +indent it properly: + + * Two nested `do' loops never share a `continue' statement. + + * The same character appears in column 5 of all continuation lines. + It is the value of the variable `fortran-continuation-char'. By + default, this character is `$'. + +If you fail to follow these conventions, the indentation commands may +indent some lines unaesthetically. However, a correct Fortran program +will retain its meaning when reindented even if the conventions are not +followed. + + +File: xemacs.info, Node: ForIndent Vars, Prev: ForIndent Conv, Up: Fortran Indent + +Variables for Fortran Indentation +................................. + + Several additional variables control how Fortran indentation works. + +`fortran-do-indent' + Extra indentation within each level of `do' statement (the default + is 3). + +`fortran-if-indent' + Extra indentation within each level of `if' statement (the default + is 3). + +`fortran-continuation-indent' + Extra indentation for bodies of continuation lines (the default is + 5). + +`fortran-check-all-num-for-matching-do' + If this is `nil', indentation assumes that each `do' statement + ends on a `continue' statement. Therefore, when computing + indentation for a statement other than `continue', it can save + time by not checking for a `do' statement ending there. If this + is non-`nil', indenting any numbered statement must check for a + `do' that ends there. The default is `nil'. + +`fortran-minimum-statement-indent' + Minimum indentation for Fortran statements. For standard Fortran, + this is 6. Statement bodies are always indented at least this + much. + + +File: xemacs.info, Node: Fortran Comments, Next: Fortran Columns, Prev: Fortran Indent, Up: Fortran + +Comments +-------- + + The usual Emacs comment commands assume that a comment can follow a +line of code. In Fortran, the standard comment syntax requires an +entire line to be just a comment. Therefore, Fortran mode replaces the +standard Emacs comment commands and defines some new variables. + + Fortran mode can also handle a non-standard comment syntax where +comments start with `!' and can follow other text. Because only some +Fortran compilers accept this syntax, Fortran mode will not insert such +comments unless you have specified to do so in advance by setting the +variable `comment-start' to `"!"' (*note Variables::.). + +`M-;' + Align comment or insert new comment (`fortran-comment-indent'). + +`C-x ;' + Applies to nonstandard `!' comments only. + +`C-c ;' + Turn all lines of the region into comments, or (with arg) turn + them back into real code (`fortran-comment-region'). + + `M-;' in Fortran mode is redefined as the command +`fortran-comment-indent'. Like the usual `M-;' command, it recognizes +an existing comment and aligns its text appropriately. If there is no +existing comment, a comment is inserted and aligned. + + Inserting and aligning comments is not the same in Fortran mode as in +other modes. When a new comment must be inserted, a full-line comment +is inserted if the current line is blank. On a non-blank line, a +non-standard `!' comment is inserted if you previously specified you +wanted to use them. Otherwise a full-line comment is inserted on a new +line before the current line. + + Non-standard `!' comments are aligned like comments in other +languages, but full-line comments are aligned differently. In a +standard full-line comment, the comment delimiter itself must always +appear in column zero. What can be aligned is the text within the +comment. You can choose from three styles of alignment by setting the +variable `fortran-comment-indent-style' to one of these values: + +`fixed' + The text is aligned at a fixed column, which is the value of + `fortran-comment-line-column'. This is the default. + +`relative' + The text is aligned as if it were a line of code, but with an + additional `fortran-comment-line-column' columns of indentation. + +`nil' + Text in full-line columns is not moved automatically. + + You can also specify the character to be used to indent within +full-line comments by setting the variable `fortran-comment-indent-char' +to the character you want to use. + + Fortran mode introduces two variables `comment-line-start' and +`comment-line-start-skip', which do for full-line comments what +`comment-start' and `comment-start-skip' do for ordinary text-following +comments. Normally these are set properly by Fortran mode, so you do +not need to change them. + + The normal Emacs comment command `C-x ;' has not been redefined. It +can therefore be used if you use `!' comments, but is useless in +Fortran mode otherwise. + + The command `C-c ;' (`fortran-comment-region') turns all the lines +of the region into comments by inserting the string `C$$$' at the front +of each one. With a numeric arg, the region is turned back into live +code by deleting `C$$$' from the front of each line. You can control +the string used for the comments by setting the variable +`fortran-comment-region'. Note that here we have an example of a +command and a variable with the same name; the two uses of the name +never conflict because in Lisp and in Emacs it is always clear from the +context which one is referred to. + + +File: xemacs.info, Node: Fortran Columns, Next: Fortran Abbrev, Prev: Fortran Comments, Up: Fortran + +Columns +------- + +`C-c C-r' + Displays a "column ruler" momentarily above the current line + (`fortran-column-ruler'). + +`C-c C-w' + Splits the current window horizontally so that it is 72 columns + wide. This may help you avoid going over that limit + (`fortran-window-create'). + + The command `C-c C-r' (`fortran-column-ruler') shows a column ruler +above the current line. The comment ruler consists of two lines of +text that show you the locations of columns with special significance +in Fortran programs. Square brackets show the limits of the columns for +line numbers, and curly brackets show the limits of the columns for the +statement body. Column numbers appear above them. + + Note that the column numbers count from zero, as always in XEmacs. +As a result, the numbers may not be those you are familiar with; but the +actual positions in the line are standard Fortran. + + The text used to display the column ruler is the value of the +variable `fortran-comment-ruler'. By changing this variable, you can +change the display. + + For even more help, use `C-c C-w' (`fortran-window-create'), a +command which splits the current window horizontally, resulting in a +window 72 columns wide. When you edit in this window, you can +immediately see when a line gets too wide to be correct Fortran. + + +File: xemacs.info, Node: Fortran Abbrev, Prev: Fortran Columns, Up: Fortran + +Fortran Keyword Abbrevs +----------------------- + + Fortran mode provides many built-in abbrevs for common keywords and +declarations. These are the same sort of abbrevs that you can define +yourself. To use them, you must turn on Abbrev mode. *note Abbrevs::.. + + The built-in abbrevs are unusual in one way: they all start with a +semicolon. You cannot normally use semicolon in an abbrev, but Fortran +mode makes this possible by changing the syntax of semicolon to "word +constituent". + + For example, one built-in Fortran abbrev is `;c' for `continue'. If +you insert `;c' and then insert a punctuation character such as a space +or a newline, the `;c' changes automatically to `continue', provided +Abbrev mode is enabled. + + Type `;?' or `;C-h' to display a list of all built-in Fortran +abbrevs and what they stand for. + + +File: xemacs.info, Node: Asm Mode, Prev: Fortran, Up: Programs + +Asm Mode +======== + + Asm mode is a major mode for editing files of assembler code. It +defines these commands: + +`' + `tab-to-tab-stop'. + +`' + Insert a newline and then indent using `tab-to-tab-stop'. + +`:' + Insert a colon and then remove the indentation from before the + label preceding colon. Then do `tab-to-tab-stop'. + +`;' + Insert or align a comment. + + The variable `asm-comment-char' specifies which character starts +comments in assembler syntax. + + +File: xemacs.info, Node: Running, Next: Packages, Prev: Programs, Up: Top + +Compiling and Testing Programs +****************************** + + The previous chapter discusses the Emacs commands that are useful for +making changes in programs. This chapter deals with commands that +assist in the larger process of developing and maintaining programs. + +* Menu: + +* Compilation:: Compiling programs in languages other than Lisp + (C, Pascal, etc.) +* Modes: Lisp Modes. Various modes for editing Lisp programs, with + different facilities for running the Lisp programs. +* Libraries: Lisp Libraries. Creating Lisp programs to run in Emacs. +* Eval: Lisp Eval. Executing a single Lisp expression in Emacs. +* Debug: Lisp Debug. Debugging Lisp programs running in Emacs. +* Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer. +* External Lisp:: Communicating through Emacs with a separate Lisp. + + +File: xemacs.info, Node: Compilation, Next: Lisp Modes, Prev: Running, Up: Running + +Running "make", or Compilers Generally +====================================== + + Emacs can run compilers for non-interactive languages like C and +Fortran as inferior processes, feeding the error log into an Emacs +buffer. It can also parse the error messages and visit the files in +which errors are found, moving point to the line where the error +occurred. + +`M-x compile' + Run a compiler asynchronously under Emacs, with error messages to + `*compilation*' buffer. + +`M-x grep' + Run `grep' asynchronously under Emacs, with matching lines listed + in the buffer named `*compilation*'. + +`M-x kill-compilation' + Kill the process made by the `M-x compile' command. + +`M-x kill-grep' + Kill the running compilation or `grep' subprocess. + +`C-x `' + Visit the next compiler error message or `grep' match. + + To run `make' or another compiler, type `M-x compile'. This command +reads a shell command line using the minibuffer, then executes the +specified command line in an inferior shell with output going to the +buffer named `*compilation*'. By default, the current buffer's default +directory is used as the working directory for the execution of the +command; therefore, the makefile comes from this directory. + + When the shell command line is read, the minibuffer appears +containing a default command line (the command you used the last time +you typed `M-x compile'). If you type just , the same command +line is used again. The first `M-x compile' provides `make -k' as the +default. The default is taken from the variable `compile-command'; if +the appropriate compilation command for a file is something other than +`make -k', it can be useful to have the file specify a local value for +`compile-command' (*note File Variables::.). + + When you start a compilation, the buffer `*compilation*' is +displayed in another window but not selected. Its mode line displays +the word `run' or `exit' in the parentheses to tell you whether +compilation is finished. You do not have to keep this buffer visible; +compilation continues in any case. + + To kill the compilation process, type `M-x-kill-compilation'. The +mode line of the `*compilation*' buffer changes to say `signal' instead +of `run'. Starting a new compilation also kills any running +compilation, as only one can occur at any time. Starting a new +compilation prompts for confirmation before actually killing a +compilation that is running. + + To parse the compiler error messages, type `C-x `' (`next-error'). +The character following `C-x' is the grave accent, not the single +quote. The command displays the buffer `*compilation*' in one window +and the buffer in which the next error occurred in another window. +Point in that buffer is moved to the line where the error was found. +The corresponding error message is scrolled to the top of the window in +which `*compilation*' is displayed. + + The first time you use `C-x `' after the start of a compilation, it +parses all the error messages, visits all the files that have error +messages, and creates markers pointing at the lines the error messages +refer to. It then moves to the first error message location. +Subsequent uses of `C-x `' advance down the data set up by the first +use. When the preparsed error messages are exhausted, the next `C-x `' +checks for any more error messages that have come in; this is useful if +you start editing compiler errors while compilation is still going on. +If no additional error messages have come in, `C-x `' reports an error. + + `C-u C-x `' discards the preparsed error message data and parses the +`*compilation*' buffer again, then displays the first error. This way, +you can process the same set of errors again. + + Instead of running a compiler, you can run `grep' and see the lines +on which matches were found. To do this, type `M-x grep' with an +argument line that contains the same arguments you would give to +`grep': a `grep'-style regexp (usually in single quotes to quote the +shell's special characters) followed by filenames, which may use +wildcard characters. The output from `grep' goes in the +`*compilation*' buffer. You can use `C-x `' to find the lines that +match as if they were compilation errors. + + Note: a shell is used to run the compile command, but the shell is +not run in interactive mode. In particular, this means that the shell +starts up with no prompt. If you find your usual shell prompt making an +unsightly appearance in the `*compilation*' buffer, it means you have +made a mistake in your shell's initialization file (`.cshrc' or `.shrc' +or ...) by setting the prompt unconditionally. The shell +initialization file should set the prompt only if there already is a +prompt. Here's how to do it in `csh': + + if ($?prompt) set prompt = ... + + +File: xemacs.info, Node: Lisp Modes, Next: Lisp Libraries, Prev: Compilation, Up: Running + +Major Modes for Lisp +==================== + + Emacs has four different major modes for Lisp. They are the same in +terms of editing commands, but differ in the commands for executing Lisp +expressions. + +Emacs-Lisp mode + The mode for editing source files of programs to run in Emacs Lisp. + This mode defines `C-M-x' to evaluate the current defun. *Note + Lisp Libraries::. + +Lisp Interaction mode + The mode for an interactive session with Emacs Lisp. It defines + to evaluate the sexp before point and insert its value in the + buffer. *Note Lisp Interaction::. + +Lisp mode + The mode for editing source files of programs that run in other + dialects of Lisp than Emacs Lisp. This mode defines `C-M-x' to + send the current defun to an inferior Lisp process. *Note + External Lisp::. + +Inferior Lisp mode + The mode for an interactive session with an inferior Lisp process. + This mode combines the special features of Lisp mode and Shell mode + (*note Shell Mode::.). + +Scheme mode + Like Lisp mode but for Scheme programs. + +Inferior Scheme mode + The mode for an interactive session with an inferior Scheme + process. + + +File: xemacs.info, Node: Lisp Libraries, Next: Lisp Eval, Prev: Lisp Modes, Up: Running + +Libraries of Lisp Code for Emacs +================================ + + Lisp code for Emacs editing commands is stored in files whose names +conventionally end in `.el'. This ending tells Emacs to edit them in +Emacs-Lisp mode (*note Lisp Modes::.). + +* Menu: + +* Loading:: Loading libraries of Lisp code into Emacs for use. +* Compiling Libraries:: Compiling a library makes it load and run faster. +* Mocklisp:: Converting Mocklisp to Lisp so XEmacs can run it. + diff --git a/info/xemacs.info-12 b/info/xemacs.info-12 new file mode 100644 index 0000000..f5b2a5c --- /dev/null +++ b/info/xemacs.info-12 @@ -0,0 +1,1172 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Loading, Next: Compiling Libraries, Prev: Lisp Libraries, Up: Lisp Libraries + +Loading Libraries +----------------- + +`M-x load-file FILE' + Load the file FILE of Lisp code. + +`M-x load-library LIBRARY' + Load the library named LIBRARY. + +`M-x locate-library LIBRARY &optional NOSUFFIX' + Show the full path name of Emacs library LIBRARY. + + To execute a file of Emacs Lisp, use `M-x load-file'. This command +reads the file name you provide in the minibuffer, then executes the +contents of that file as Lisp code. It is not necessary to visit the +file first; in fact, this command reads the file as found on disk, not +the text in an Emacs buffer. + + Once a file of Lisp code is installed in the Emacs Lisp library +directories, users can load it using `M-x load-library'. Programs can +load it by calling `load-library', or with `load', a more primitive +function that is similar but accepts some additional arguments. + + `M-x load-library' differs from `M-x load-file' in that it searches +a sequence of directories and tries three file names in each directory. +The three names are: first, the specified name with `.elc' appended; +second, the name with `.el' appended; third, the specified name alone. +A `.elc' file would be the result of compiling the Lisp file into byte +code; if possible, it is loaded in preference to the Lisp file itself +because the compiled file loads and runs faster. + + Because the argument to `load-library' is usually not in itself a +valid file name, file name completion is not available. In fact, when +using this command, you usually do not know exactly what file name will +be used. + + The sequence of directories searched by `M-x load-library' is +specified by the variable `load-path', a list of strings that are +directory names. The elements of this list may not begin with "`~'", +so you must call `expand-file-name' on them before adding them to the +list. The default value of the list contains the directory where the +Lisp code for Emacs itself is stored. If you have libraries of your +own, put them in a single directory and add that directory to +`load-path'. `nil' in this list stands for the current default +directory, but it is probably not a good idea to put `nil' in the list. +If you start wishing that `nil' were in the list, you should probably +use `M-x load-file' for this case. + + The variable is initialized by the EMACSLOADPATH environment +variable. If no value is specified, the variable takes the default value +specified in the file `paths.h' when Emacs was built. If a path isn't +specified in `paths.h', a default value is obtained from the file +system, near the directory in which the Emacs executable resides. + + Like `M-x load-library', `M-x locate-library' searches the +directories in `load-path' to find the file that `M-x load-library' +would load. If the optional second argument NOSUFFIX is non-`nil', the +suffixes `.elc' or `.el' are not added to the specified name LIBRARY +(like calling `load' instead of `load-library'). + + You often do not have to give any command to load a library, because +the commands defined in the library are set up to "autoload" that +library. Running any of those commands causes `load' to be called to +load the library; this replaces the autoload definitions with the real +ones from the library. + + If autoloading a file does not finish, either because of an error or +because of a `C-g' quit, all function definitions made by the file are +undone automatically. So are any calls to `provide'. As a +consequence, the entire file is loaded a second time if you use one of +the autoloadable commands again. This prevents problems when the +command is no longer autoloading but is working incorrectly because the +file was only partially loaded. Function definitions are undone only +for autoloading; explicit calls to `load' do not undo anything if +loading is not completed. + + The variable `after-load-alist' takes an alist of expressions to be +evaluated when particular files are loaded. Each element has the form +`(FILENAME forms...)'. When `load' is run and the filename argument is +FILENAME, the forms in the corresponding element are executed at the +end of loading. + + FILENAME must match exactly. Normally FILENAME is the name of a +library, with no directory specified, since that is how load is +normally called. An error in `forms' does not undo the load, but it +does prevent execution of the rest of the `forms'. + + +File: xemacs.info, Node: Compiling Libraries, Next: Mocklisp, Prev: Loading, Up: Lisp Libraries + +Compiling Libraries +------------------- + + Emacs Lisp code can be compiled into byte-code which loads faster, +takes up less space when loaded, and executes faster. + +`M-x batch-byte-compile' + Run byte-compile-file on the files remaining on the command line. + +`M-x byte-compile-buffer &optional BUFFER' + Byte-compile and evaluate contents of BUFFER (default is current + buffer). + +`M-x byte-compile-file' + Compile a file of Lisp code named FILENAME into a file of byte + code. + +`M-x byte-compile-and-load-file FILENAME' + Compile a file of Lisp code named FILENAME into a file of byte + code and load it. + +`M-x byte-recompile-directory DIRECTORY' + Recompile every `.el' file in DIRECTORY that needs recompilation. + +`M-x disassemble' + Print disassembled code for OBJECT on (optional) STREAM. + +`M-x make-obsolete FUNCTION NEW' + Make the byte-compiler warn that FUNCTION is obsolete and NEW + should be used instead. + + `byte-compile-file' creates a byte-code compiled file from an +Emacs-Lisp source file. The default argument for this function is the +file visited in the current buffer. The function reads the specified +file, compiles it into byte code, and writes an output file whose name +is made by appending `c' to the input file name. Thus, the file +`rmail.el' would be compiled into `rmail.elc'. To compile a file of +Lisp code named FILENAME into a file of byte code and then load it, use +`byte-compile-and-load-file'. To compile and evaluate Lisp code in a +given buffer, use `byte-compile-buffer'. + + To recompile all changed Lisp files in a directory, use `M-x +byte-recompile-directory'. Specify just the directory name as an +argument. Each `.el' file that has been byte-compiled before is +byte-compiled again if it has changed since the previous compilation. +A numeric argument to this command tells it to offer to compile each +`.el' file that has not been compiled yet. You must answer `y' or `n' +to each offer. + + You can use the function `batch-byte-compile' to invoke Emacs +non-interactively from the shell to do byte compilation. When you use +this function, the files to be compiled are specified with command-line +arguments. Use a shell command of the form: + + emacs -batch -f batch-byte-compile FILES... + + Directory names may also be given as arguments; in that case, +`byte-recompile-directory' is invoked on each such directory. +`batch-byte-compile' uses all remaining command-line arguments as file +or directory names, then kills the Emacs process. + + `M-x disassemble' explains the result of byte compilation. Its +argument is a function name. It displays the byte-compiled code in a +help window in symbolic form, one instruction per line. If the +instruction refers to a variable or constant, that is shown, too. + + +File: xemacs.info, Node: Mocklisp, Prev: Compiling Libraries, Up: Lisp Libraries + +Converting Mocklisp to Lisp +--------------------------- + + XEmacs can run Mocklisp files by converting them to Emacs Lisp first. +To convert a Mocklisp file, visit it and then type `M-x +convert-mocklisp-buffer'. Then save the resulting buffer of Lisp file +in a file whose name ends in `.el' and use the new file as a Lisp +library. + + You cannot currently byte-compile converted Mocklisp code. The +reason is that converted Mocklisp code uses some special Lisp features +to deal with Mocklisp's incompatible ideas of how arguments are +evaluated and which values signify "true" or "false". + + +File: xemacs.info, Node: Lisp Eval, Next: Lisp Debug, Prev: Lisp Libraries, Up: Running + +Evaluating Emacs-Lisp Expressions +================================= + + Lisp programs intended to be run in Emacs should be edited in +Emacs-Lisp mode; this will happen automatically for file names ending in +`.el'. By contrast, Lisp mode itself should be used for editing Lisp +programs intended for other Lisp systems. Emacs-Lisp mode can be +selected with the command `M-x emacs-lisp-mode'. + + For testing of Lisp programs to run in Emacs, it is useful to be able +to evaluate part of the program as it is found in the Emacs buffer. For +example, if you change the text of a Lisp function definition and then +evaluate the definition, Emacs installs the change for future calls to +the function. Evaluation of Lisp expressions is also useful in any +kind of editing task for invoking non-interactive functions (functions +that are not commands). + +`M-' + Read a Lisp expression in the minibuffer, evaluate it, and print + the value in the minibuffer (`eval-expression'). + +`C-x C-e' + Evaluate the Lisp expression before point, and print the value in + the minibuffer (`eval-last-sexp'). + +`C-M-x' + Evaluate the defun containing point or after point, and print the + value in the minibuffer (`eval-defun'). + +`M-x eval-region' + Evaluate all the Lisp expressions in the region. + +`M-x eval-current-buffer' + Evaluate all the Lisp expressions in the buffer. + + `M-' (`eval-expression') is the most basic command for +evaluating a Lisp expression interactively. It reads the expression +using the minibuffer, so you can execute any expression on a buffer +regardless of what the buffer contains. When evaluation is complete, +the current buffer is once again the buffer that was current when +`M-' was typed. + + `M-' can easily confuse users, especially on keyboards with +autorepeat, where it can result from holding down the key for too +long. Therefore, `eval-expression' is normally a disabled command. +Attempting to use this command asks for confirmation and gives you the +option of enabling it; once you enable the command, you are no longer +required to confirm. *Note Disabling::. + + In Emacs-Lisp mode, the key `C-M-x' is bound to the function +`eval-defun', which parses the defun containing point or following point +as a Lisp expression and evaluates it. The value is printed in the echo +area. This command is convenient for installing in the Lisp environment +changes that you have just made in the text of a function definition. + + The command `C-x C-e' (`eval-last-sexp') performs a similar job but +is available in all major modes, not just Emacs-Lisp mode. It finds +the sexp before point, reads it as a Lisp expression, evaluates it, and +prints the value in the echo area. It is sometimes useful to type in an +expression and then, with point still after it, type `C-x C-e'. + + If `C-M-x' or `C-x C-e' are given a numeric argument, they print the +value by inserting it into the current buffer at point, rather than in +the echo area. The argument value does not matter. + + The most general command for evaluating Lisp expressions from a +buffer is `eval-region'. `M-x eval-region' parses the text of the +region as one or more Lisp expressions, evaluating them one by one. +`M-x eval-current-buffer' is similar, but it evaluates the entire +buffer. This is a reasonable way to install the contents of a file of +Lisp code that you are just ready to test. After finding and fixing a +bug, use `C-M-x' on each function that you change, to keep the Lisp +world in step with the source file. + + +File: xemacs.info, Node: Lisp Debug, Next: Lisp Interaction, Prev: Lisp Eval, Up: Running + +The Emacs-Lisp Debugger +======================= + + XEmacs contains a debugger for Lisp programs executing inside it. +This debugger is normally not used; many commands frequently get Lisp +errors when invoked in inappropriate contexts (such as `C-f' at the end +of the buffer) and it would be unpleasant to enter a special debugging +mode in this case. When you want to make Lisp errors invoke the +debugger, you must set the variable `debug-on-error' to non-`nil'. +Quitting with `C-g' is not considered an error, and `debug-on-error' +has no effect on the handling of `C-g'. However, if you set +`debug-on-quit' to be non-`nil', `C-g' will invoke the debugger. This +can be useful for debugging an infinite loop; type `C-g' once the loop +has had time to reach its steady state. `debug-on-quit' has no effect +on errors. + + You can make Emacs enter the debugger when a specified function is +called or at a particular place in Lisp code. Use `M-x debug-on-entry' +with argument FUN-NAME to have Emacs enter the debugger as soon as +FUN-NAME is called. Use `M-x cancel-debug-on-entry' to make the +function stop entering the debugger when called. (Redefining the +function also does this.) To enter the debugger from some other place +in Lisp code, you must insert the expression `(debug)' there and +install the changed code with `C-M-x'. *Note Lisp Eval::. + + When the debugger is entered, it displays the previously selected +buffer in one window and a buffer named `*Backtrace*' in another +window. The backtrace buffer contains one line for each level of Lisp +function execution currently going on. At the beginning of the buffer +is a message describing the reason that the debugger was invoked, for +example, an error message if it was invoked due to an error. + + The backtrace buffer is read-only and is in Backtrace mode, a special +major mode in which letters are defined as debugger commands. The +usual Emacs editing commands are available; you can switch windows to +examine the buffer that was being edited at the time of the error, and +you can switch buffers, visit files, and perform any other editing +operations. However, the debugger is a recursive editing level (*note +Recursive Edit::.); it is a good idea to return to the backtrace buffer +and explictly exit the debugger when you don't want to use it any more. +Exiting the debugger kills the backtrace buffer. + + The contents of the backtrace buffer show you the functions that are +executing and the arguments that were given to them. It also allows you +to specify a stack frame by moving point to the line describing that +frame. The frame whose line point is on is considered the "current +frame". Some of the debugger commands operate on the current frame. +Debugger commands are mainly used for stepping through code one +expression at a time. Here is a list of them: + +`c' + Exit the debugger and continue execution. In most cases, + execution of the program continues as if the debugger had never + been entered (aside from the effect of any variables or data + structures you may have changed while inside the debugger). This + includes entry to the debugger due to function entry or exit, + explicit invocation, and quitting or certain errors. Most errors + cannot be continued; trying to continue an error usually causes + the same error to occur again. + +`d' + Continue execution, but enter the debugger the next time a Lisp + function is called. This allows you to step through the + subexpressions of an expression, and see what the subexpressions + do and what values they compute. + + When you enter the debugger this way, Emacs flags the stack frame + for the function call from which you entered. The same function + is then called when you exit the frame. To cancel this flag, use + `u'. + +`b' + Set up to enter the debugger when the current frame is exited. + Frames that invoke the debugger on exit are flagged with stars. + +`u' + Don't enter the debugger when the current frame is exited. This + cancels a `b' command on a frame. + +`e' + Read a Lisp expression in the minibuffer, evaluate it, and print + the value in the echo area. This is equivalent to the command + `M-', except that `e' is not normally disabled like `M-'. + +`q' + Terminate the program being debugged; return to top-level Emacs + command execution. + + If the debugger was entered due to a `C-g' but you really want to + quit, not to debug, use the `q' command. + +`r' + Return a value from the debugger. The value is computed by + reading an expression with the minibuffer and evaluating it. + + The value returned by the debugger makes a difference when the + debugger was invoked due to exit from a Lisp call frame (as + requested with `b'); then the value specified in the `r' command + is used as the value of that frame. + + The debugger's return value also matters with many errors. For + example, `wrong-type-argument' errors will use the debugger's + return value instead of the invalid argument; `no-catch' errors + will use the debugger value as a throw tag instead of the tag that + was not found. If an error was signaled by calling the Lisp + function `signal', the debugger's return value is returned as the + value of `signal'. + + +File: xemacs.info, Node: Lisp Interaction, Next: External Lisp, Prev: Lisp Debug, Up: Running + +Lisp Interaction Buffers +======================== + + The buffer `*scratch*', which is selected when Emacs starts up, is +provided for evaluating Lisp expressions interactively inside Emacs. +Both the expressions you evaluate and their output goes in the buffer. + + The `*scratch*' buffer's major mode is Lisp Interaction mode, which +is the same as Emacs-Lisp mode except for one command, . In +Emacs-Lisp mode, is an indentation command. In Lisp Interaction +mode, is bound to `eval-print-last-sexp'. This function reads +the Lisp expression before point, evaluates it, and inserts the value +in printed representation before point. + + The way to use the `*scratch*' buffer is to insert Lisp expressions +at the end, ending each one with so that it will be evaluated. +The result is a complete typescript of the expressions you have +evaluated and their values. + + The rationale for this feature is that Emacs must have a buffer when +it starts up, but that buffer is not useful for editing files since a +new buffer is made for every file that you visit. The Lisp interpreter +typescript is the most useful thing I can think of for the initial +buffer to do. `M-x lisp-interaction-mode' will put any buffer in Lisp +Interaction mode. + + +File: xemacs.info, Node: External Lisp, Prev: Lisp Interaction, Up: Running + +Running an External Lisp +======================== + + Emacs has facilities for running programs in other Lisp systems. +You can run a Lisp process as an inferior of Emacs, and pass +expressions to it to be evaluated. You can also pass changed function +definitions directly from the Emacs buffers in which you edit the Lisp +programs to the inferior Lisp process. + + To run an inferior Lisp process, type `M-x run-lisp'. This runs the +program named `lisp', the same program you would run by typing `lisp' +as a shell command, with both input and output going through an Emacs +buffer named `*lisp*'. In other words, any "terminal output" from Lisp +will go into the buffer, advancing point, and any "terminal input" for +Lisp comes from text in the buffer. To give input to Lisp, go to the +end of the buffer and type the input, terminated by . The +`*lisp*' buffer is in Inferior Lisp mode, which has all the special +characteristics of Lisp mode and Shell mode (*note Shell Mode::.). + + Use Lisp mode to run the source files of programs in external Lisps. +You can select this mode with `M-x lisp-mode'. It is used automatically +for files whose names end in `.l' or `.lisp', as most Lisp systems +usually expect. + + When you edit a function in a Lisp program you are running, the +easiest way to send the changed definition to the inferior Lisp process +is the key `C-M-x'. In Lisp mode, this key runs the function +`lisp-send-defun', which finds the defun around or following point and +sends it as input to the Lisp process. (Emacs can send input to any +inferior process regardless of what buffer is current.) + + Contrast the meanings of `C-M-x' in Lisp mode (for editing programs +to be run in another Lisp system) and Emacs-Lisp mode (for editing Lisp +programs to be run in Emacs): in both modes it has the effect of +installing the function definition that point is in, but the way of +doing so is different according to where the relevant Lisp environment +is found. *Note Lisp Modes::. + + +File: xemacs.info, Node: Packages, Next: Abbrevs, Prev: Running, Up: Top + +Packages +======== + + 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 +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. + +* Menu: + +* Package Terminology:: Understanding different kinds of packages. +* Using Packages:: How to install and use packages. +* Building Packages:: Building packages from sources. + + +File: xemacs.info, Node: Package Terminology, Next: Using Packages, Up: Packages + +Package Flavors +--------------- + + There are two main flavors of packages. + + * Regular Packages A regular package is one in which multiple files + are involved and one may not in general safely remove any of them. + + * Single-File Packages A single-file package is an aggregate + collection of thematically related but otherwise independent lisp + files. These files are bundled together for download convenience + and individual files may be deleted at will without any loss of + functionality. + +Package Distributions +--------------------- + + XEmacs Lisp packages are distributed in two ways, depending on the +intended use. Binary Packages are for installers and end-users and may +be installed directly into an XEmacs package directory. Source Packages +are for developers and include all files necessary for rebuilding +bytecompiled lisp and creating tarballs for distribution. + +Binary Packages +--------------- + + Binary packages may be installed directly into an XEmacs package +hierarchy. + +Source Packages +--------------- + + Source packages contain all of the Package author's (where +appropriate in regular packages) source code plus all of the files +necessary to build distribution tarballs (Unix Tar format files, +gzipped for space savings). + + +File: xemacs.info, Node: Using Packages, Next: Building Packages, Prev: Package Terminology, Up: Packages + +Getting Started +--------------- + + When you first download XEmacs 21, you will usually first grab the +"core distribution", a file called `xemacs-21.0.tar.gz'. (Replace the +21.0 by the current version number.) The core distribution contains +the sources of XEmacs and a minimal set of Emacs Lisp files, which are +in the subdirectory named `lisp'. This subdirectory used to contain +all Emacs Lisp files distributed with XEmacs. Now, to conserve disk +space, most non-essential packages were made optional. + +Choosing the Packages You Need +------------------------------ + + The available packages can currently be found in the same ftp +directory where you grabbed the core distribution from, and are located +in the subdirectory `packages/binary-packages'. Package file names +follow the naming convention `--pkg.tar.gz'. + + If you have EFS *Note (EFS)::, packages can be installed over the +network. Alternatively, if you have copies of the packages locally, +you can install packages from a local disk or CDROM. + + The file `etc/PACKAGES' in the core distribution contains a list of +the packages available at the time of the XEmacs release. Packages are +also listed on the `Options' menu under: + + Options->Customize->Emacs->Packages + + However, don't select any of these menu picks unless you actually +want to install the given package (and have properly configured your +system to do so). + + You can also get a list of available packages, and whether or not +they are installed, using the visual package browser and installer. +You can access it via the menus: + + Options->Manage Packages->List & Install + + Or, you can get to it via the keyboard: + + M-x pui-list-packages + + Hint to system administrators of multi-user systems: it might be a +good 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 `package-get-package-provider' function. Eg., if you know +that you need `thingatpt', type: + + M-x package-get-package-provider RET thingatpt + + which will return something like (fsf-compat "1.06"). You can the use +one of the methods above for installing the package you want. + +XEmacs and Installing Packages +------------------------------ + + Normally, packages are installed over the network, using EFS *Note +(EFS)::. However, you may not have network access, or you may 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 `.emacs' file: + + (setq package-get-remote (cons (list nil "/my/path/to/package/binaries") + package-get-remote)) + + Here, you'd change `/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). + + If you are installing from a temporary, one-time directory, you can +also add these directory names to `package-get-remote' using: + + M-x pui-add-install-directory + + Note, however, that any directories added using this function are not +saved; this information will be lost when you quit XEmacs. + + If you're going to install over the network, you only have to insure +that EFS *Note (EFS):: works, and that it can get outside a firewall, if +you happen to be behind one. You shouldn't have to do anything else; +XEmacs already knows where to go. However you can add your own mirrors +to this list. See `package-get-remote'. + + The easiest way to install a package is to use the visual package +browser and installer, using the menu pick: + + Options->Manage Packages->List & Install + or + Options->Manage Packages->Using Custom->Select-> ... + + You can also access it using the keyboard: + + M-x pui-list-packages + + The visual package browser will then display a list of all packages. +Help information will be displayed at the very bottom of the buffer; you +may have to scroll down to see it. You can also press `?' to get the +same help. From this buffer, you can tell the package status by the +character in the first column: + +`-' + The package has not been installed. + +`*' + The package has been installed, but a newer version is available. + The current version is out-of-date. + +`+' + The package has been marked for installation/update. + + If there is no character in the first column, the package has been +installed and is up-to-date. + + From here, you can select or unselect packages for installation using +the key, the `Mouse-2' button or selecting "Select" from the +(Popup) Menu. Once you've finished selecting the packages, you can +press the `x' key (or use the menu) to actually install the packages. +Note that you will have to restart XEmacs for XEmacs to recognize any +new packages. + + Key summary: + +`?' + Display simple help. + +`' +`' + Toggle between selecting and unselecting a package for + installation. + +`x' + Install selected packages. + +`' + View, in the minibuffer, additional information about the package, + such as the package date (not the build date) and the package + author. Moving the mouse over a package name will also do the + same thing. + +`v' + Toggle between verbose and non-verbose package display. + +`g' + Refresh the package display. + +`q' + Kill the package buffer. + + Moving the mouse over a package will also cause additional +information about the package to be displayed in the minibuffer. + +Other package installation interfaces +------------------------------------- + + For an alternative package interface, you can select packages from +the customize menus, under: + + Options->Customize->Emacs->Packages-> ... + or + Options->Manage Packages->Using Custom->Select-> ... + + Set their state to on, and then do: + + Options->Manage Packages->Using Custom->Update Packages + + This will automatically retrieve the packages you have selected from +the XEmacs ftp site or your local disk, and install them into XEmacs. +Additionally it will update any packages you already have installed to +the newest version. Note that if a package is newly installed you will +have to restart XEmacs for the change to take effect. + + You can also install packages using a semi-manual interface: + + M-x package-get-all + + Enter the name of the package (e.g., `prog-modes'), and XEmacs will +search for the latest version (as listed in the lisp file +`lisp/package-get-base.el'), and install it and any packages that it +depends upon. + +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 `$HOME' directory: + + ~/.xemacs/mule-packages + ~/.xemacs/xemacs-packages + + 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 +package while XEmacs is running could cause strange errors in XEmacs; +it's best to exit XEmacs before upgrading an existing package. + + To install binary packages manually: + + 1. Download the package(s) that you want to install. Each binary + package will typically be a gzip'd tarball. + + 2. Decide where to install the packages: in the system package + directory, or in `~/.xemacs/mule-packages' or + `~/.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 `$HOME' + directory, create the directory, `~/.xemacs/mule-packages' or + `~/.xemacs/xemacs-packages', respectively. + + 3. Next, `cd' to the directory under which you want to install the + package(s). + + 4. From this directory, uncompress and extract each of the gzip'd + tarballs that you downloaded in step 1. Unix and Cygnus cygwin + users will typically do this using the commands: + + gunzip < package.tar.gz | tar xvf - + + Above, replace `package.tar.gz' with the filename of the package + that you downloaded in step 1. + + Of course, if you use GNU `tar', you could also use: + + tar xvzf package.tar.gz + + 5. That's it. Quit and restart XEmacs to get it to recognize any new + or changed packages. + + + +File: xemacs.info, Node: Building Packages, Prev: Using Packages, Up: Packages + + Source packages are available from the `packages/source-packages' +subdirectory of your favorite XEmacs distribution site. Alternatively, +they are available via CVS from `cvs.xemacs.org'. Look at +`http://cvs.xemacs.org' for instructions. + +Prerequisites for Building Source Packages +------------------------------------------ + + You must have GNU `cp', GNU `install' (or a BSD compatible `install' +program) GNU `make' (3.75 or later preferred), `makeinfo' (1.68 from +`texinfo-3.11' or later required), GNU `tar' and XEmacs 21.0. The +source packages will untar into a correct directory structure. At the +top level you must have `XEmacs.rules' and `package-compile.el'. These +files are available from the XEmacs FTP site from the same place you +obtained your source package distributions. + +What You Can Do With Source Packages +------------------------------------ + + NB: A global build operation doesn't exist yet as of 13 January +1998. + + Source packages are most useful for creating XEmacs package tarballs +for installation into your own XEmacs installations or for distributing +to others. + + Supported operations from `make' are: + +`clean' + Remove all built files except `auto-autoloads.el' and + `custom-load.el'. + +`distclean' + Remove XEmacs backups as well as the files deleted by `make clean'. + +`all' + Bytecompile all files, build and bytecompile byproduct files like + `auto-autoloads.el' and `custom-load.el'. Create info version of + TeXinfo documentation if present. + +`srckit' + Usually aliased to `make srckit-std'. This does a `make + distclean' and creates a package source tarball in the staging + directory. This is generally only of use for package maintainers. + +`binkit' + May be aliased to `binkit-sourceonly', `binkit-sourceinfo', + `binkit-sourcedata', or `binkit-sourcedatainfo'. `sourceonly' + indicates there is nothing to install in a data directory or info + directory. `sourceinfo' indicates that source and info files are + to be installed. `sourcedata' indicates that source and etc + (data) files are to be installed. `sourcedatainfo' indicates + source, etc (data), and info files are to be installed. A few + packages have needs beyond the basic templates so this is not yet + complete. + +`dist' + Runs the rules `srckit' followed by `binkit'. This is primarily + of use by XEmacs maintainers producing files for distribution. + + +File: xemacs.info, Node: Abbrevs, Next: Picture, Prev: Packages, Up: Top + +Abbrevs +******* + + An "abbrev" is a word which "expands" into some different text. +Abbrevs are defined by the user to expand in specific ways. For +example, you might define `foo' as an abbrev expanding to `find outer +otter'. With this abbrev defined, you would be able to get `find outer +otter ' into the buffer by typing `f o o '. + + Abbrevs expand only when Abbrev mode (a minor mode) is enabled. +Disabling Abbrev mode does not cause abbrev definitions to be discarded, +but they do not expand until Abbrev mode is enabled again. The command +`M-x abbrev-mode' toggles Abbrev mode; with a numeric argument, it +turns Abbrev mode on if the argument is positive, off otherwise. *Note +Minor Modes::. `abbrev-mode' is also a variable; Abbrev mode is on +when the variable is non-`nil'. The variable `abbrev-mode' +automatically becomes local to the current buffer when it is set. + + Abbrev definitions can be "mode-specific"--active only in one major +mode. Abbrevs can also have "global" definitions that are active in +all major modes. The same abbrev can have a global definition and +various mode-specific definitions for different major modes. A +mode-specific definition for the current major mode overrides a global +definition. + + You can define Abbrevs interactively during an editing session. You +can also save lists of abbrev definitions in files and reload them in +later sessions. Some users keep extensive lists of abbrevs that they +load in every session. + + A second kind of abbreviation facility is called the "dynamic +expansion". Dynamic abbrev expansion happens only when you give an +explicit command and the result of the expansion depends only on the +current contents of the buffer. *Note Dynamic Abbrevs::. + +* Menu: + +* Defining Abbrevs:: Defining an abbrev, so it will expand when typed. +* Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion. +* Editing Abbrevs:: Viewing or editing the entire list of defined abbrevs. +* Saving Abbrevs:: Saving the entire list of abbrevs for another session. +* Dynamic Abbrevs:: Abbreviations for words already in the buffer. + + +File: xemacs.info, Node: Defining Abbrevs, Next: Expanding Abbrevs, Prev: Abbrevs, Up: Abbrevs + +Defining Abbrevs +================ + +`C-x a g' + Define an abbrev to expand into some text before point + (`add-global-abbrev'). + +`C-x a l' + Similar, but define an abbrev available only in the current major + mode (`add-mode-abbrev'). + +`C-x a i g' + Define a word in the buffer as an abbrev + (`inverse-add-global-abbrev'). + +`C-x a i l' + Define a word in the buffer as a mode-specific abbrev + (`inverse-add-mode-abbrev'). + +`M-x kill-all-abbrevs' + After this command, no abbrev definitions remain in effect. + + The usual way to define an abbrev is to enter the text you want the +abbrev to expand to, position point after it, and type `C-x a g' +(`add-global-abbrev'). This reads the abbrev itself using the +minibuffer, and then defines it as an abbrev for one or more words +before point. Use a numeric argument to say how many words before point +should be taken as the expansion. For example, to define the abbrev +`foo' as in the example above, insert the text `find outer otter', then +type +`C-u 3 C-x a g f o o '. + + An argument of zero to `C-x a g' means to use the contents of the +region as the expansion of the abbrev being defined. + + The command `C-x a l' (`add-mode-abbrev') is similar, but defines a +mode-specific abbrev. Mode-specific abbrevs are active only in a +particular major mode. `C-x a l' defines an abbrev for the major mode +in effect at the time `C-x a l' is typed. The arguments work the same +way they do for `C-x a g'. + + If the text of an abbrev you want is already in the buffer instead of +the expansion, use command `C-x a i g' (`inverse-add-global-abbrev') +instead of `C-x a g', or use `C-x a i l' (`inverse-add-mode-abbrev') +instead of `C-x a l'. These commands are called "inverse" because they +invert the meaning of the argument found in the buffer and the argument +read using the minibuffer. + + To change the definition of an abbrev, just add the new definition. +You will be asked to confirm if the abbrev has a prior definition. To +remove an abbrev definition, give a negative argument to `C-x a g' or +`C-x a l'. You must choose the command to specify whether to kill a +global definition or a mode-specific definition for the current mode, +since those two definitions are independent for one abbrev. + + `M-x kill-all-abbrevs' removes all existing abbrev definitions. + + +File: xemacs.info, Node: Expanding Abbrevs, Next: Editing Abbrevs, Prev: Defining Abbrevs, Up: Abbrevs + +Controlling Abbrev Expansion +============================ + + An abbrev expands whenever it is in a buffer just before point and +you type a self-inserting punctuation character (, comma, etc.). +Most often an abbrev is used by inserting the abbrev followed by +punctuation. + + Abbrev expansion preserves case; thus, `foo' expands into `find +outer otter', `Foo' into `Find outer otter', and `FOO' into `FIND OUTER +OTTER' or `Find Outer Otter' according to the variable +`abbrev-all-caps' (a non-`nil' value chooses the first of the two +expansions). + + Two commands are available to control abbrev expansion: + +`M-'' + Separate a prefix from a following abbrev to be expanded + (`abbrev-prefix-mark'). + +`C-x a e' + Expand the abbrev before point (`expand-abbrev'). This is + effective even when Abbrev mode is not enabled. + +`M-x unexpand-abbrev' + Undo last abbrev expansion. + +`M-x expand-region-abbrevs' + Expand some or all abbrevs found in the region. + + You may wish to expand an abbrev with a prefix attached. For +example, if `cnst' expands into `construction', you may want to use it +to enter `reconstruction'. It does not work to type `recnst', because +that is not necessarily a defined abbrev. Instead, you can use the +command `M-'' (`abbrev-prefix-mark') between the prefix `re' and the +abbrev `cnst'. First, insert `re'. Then type `M-''; this inserts a +minus sign in the buffer to indicate that it has done its work. Then +insert the abbrev `cnst'. The buffer now contains `re-cnst'. Now +insert a punctuation character to expand the abbrev `cnst' into +`construction'. The minus sign is deleted at this point by `M-''. The +resulting text is the desired `reconstruction'. + + If you actually want the text of the abbrev in the buffer, rather +than its expansion, insert the following punctuation with `C-q'. Thus, +`foo C-q -' leaves `foo-' in the buffer. + + If you expand an abbrev by mistake, you can undo the expansion +(replace the expansion by the original abbrev text) with `M-x +unexpand-abbrev'. You can also use `C-_' (`undo') to undo the +expansion; but that will first undo the insertion of the punctuation +character. + + `M-x expand-region-abbrevs' searches through the region for defined +abbrevs, and offers to replace each one it finds with its expansion. +This command is useful if you have typed text using abbrevs but forgot +to turn on Abbrev mode first. It may also be useful together with a +special set of abbrev definitions for making several global +replacements at once. The command is effective even if Abbrev mode is +not enabled. + + +File: xemacs.info, Node: Editing Abbrevs, Next: Saving Abbrevs, Prev: Expanding Abbrevs, Up: Abbrevs + +Examining and Editing Abbrevs +============================= + +`M-x list-abbrevs' + Print a list of all abbrev definitions. + +`M-x edit-abbrevs' + Edit a list of abbrevs; you can add, alter, or remove definitions. + + The output from `M-x list-abbrevs' looks like this: + + (lisp-mode-abbrev-table) + "dk" 0 "define-key" + (global-abbrev-table) + "dfn" 0 "definition" + +(Some blank lines of no semantic significance, and some other abbrev +tables, have been omitted.) + + A line containing a name in parentheses is the header for abbrevs in +a particular abbrev table; `global-abbrev-table' contains all the global +abbrevs, and the other abbrev tables that are named after major modes +contain the mode-specific abbrevs. + + Within each abbrev table, each non-blank line defines one abbrev. +The word at the beginning is the abbrev. The number that appears is +the number of times the abbrev has been expanded. Emacs keeps track of +this to help you see which abbrevs you actually use, in case you want +to eliminate those that you don't use often. The string at the end of +the line is the expansion. + + `M-x edit-abbrevs' allows you to add, change or kill abbrev +definitions by editing a list of them in an Emacs buffer. The list has +the format described above. The buffer of abbrevs is called +`*Abbrevs*', and is in Edit-Abbrevs mode. This mode redefines the key +`C-c C-c' to install the abbrev definitions as specified in the buffer. +The `edit-abbrevs-redefine' command does this. Any abbrevs not +described in the buffer are eliminated when this is done. + + `edit-abbrevs' is actually the same as `list-abbrevs', except that +it selects the buffer `*Abbrevs*' whereas `list-abbrevs' merely +displays it in another window. + + +File: xemacs.info, Node: Saving Abbrevs, Next: Dynamic Abbrevs, Prev: Editing Abbrevs, Up: Abbrevs + +Saving Abbrevs +============== + + These commands allow you to keep abbrev definitions between editing +sessions. + +`M-x write-abbrev-file' + Write a file describing all defined abbrevs. + +`M-x read-abbrev-file' + Read such an abbrev file and define abbrevs as specified there. + +`M-x quietly-read-abbrev-file' + Similar, but do not display a message about what is going on. + +`M-x define-abbrevs' + Define abbrevs from buffer. + +`M-x insert-abbrevs' + Insert all abbrevs and their expansions into the buffer. + + Use `M-x write-abbrev-file' to save abbrev definitions for use in a +later session. The command reads a file name using the minibuffer and +writes a description of all current abbrev definitions into the +specified file. The text stored in the file looks like the output of +`M-x list-abbrevs'. + + `M-x read-abbrev-file' prompts for a file name using the minibuffer +and reads the specified file, defining abbrevs according to its +contents. `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 `.emacs' file. If you give an empty argument to either of these +functions, the file name Emacs uses is the value of the variable +`abbrev-file-name', which is by default `"~/.abbrev_defs"'. + + Emacs offers to save abbrevs automatically if you have changed any of +them, whenever it offers to save all files (for `C-x s' or `C-x C-c'). +Set the variable `save-abbrevs' to `nil' to inhibit this feature. + + The commands `M-x insert-abbrevs' and `M-x define-abbrevs' are +similar to the previous commands but work on text in an Emacs buffer. +`M-x insert-abbrevs' inserts text into the current buffer before point, +describing all current abbrev definitions; `M-x define-abbrevs' parses +the entire current buffer and defines abbrevs accordingly. + + +File: xemacs.info, Node: Dynamic Abbrevs, Prev: Saving Abbrevs, Up: Abbrevs + +Dynamic Abbrev Expansion +======================== + + The abbrev facility described above operates automatically as you +insert text, but all abbrevs must be defined explicitly. By contrast, +"dynamic abbrevs" allow the meanings of abbrevs to be determined +automatically from the contents of the buffer, but dynamic abbrev +expansion happens only when you request it explicitly. + +`M-/' + Expand the word in the buffer before point as a "dynamic abbrev", + by searching in the buffer for words starting with that + abbreviation (`dabbrev-expand'). + + For example, if the buffer contains `does this follow ' and you type +`f o M-/', the effect is to insert `follow' because that is the last +word in the buffer that starts with `fo'. A numeric argument to `M-/' +says to take the second, third, etc. distinct expansion found looking +backward from point. Repeating `M-/' searches for an alternative +expansion by looking farther back. After the entire buffer before +point has been considered, the buffer after point is searched. + + Dynamic abbrev expansion is completely independent of Abbrev mode; +the expansion of a word with `M-/' is completely independent of whether +it has a definition as an ordinary abbrev. + + +File: xemacs.info, Node: Picture, Next: Sending Mail, Prev: Abbrevs, Up: Top + +Editing Pictures +**************** + + If you want to create a picture made out of text characters (for +example, a picture of the division of a register into fields, as a +comment in a program), use the command `edit-picture' to enter Picture +mode. + + In Picture mode, editing is based on the "quarter-plane" model of +text. In this model, the text characters lie studded on an area that +stretches infinitely far to the right and downward. The concept of the +end of a line does not exist in this model; the most you can say is +where the last non-blank character on the line is found. + + Of course, Emacs really always considers text as a sequence of +characters, and lines really do have ends. But in Picture mode most +frequently-used keys are rebound to commands that simulate the +quarter-plane model of text. They do this by inserting spaces or by +converting tabs to spaces. + + Most of the basic editing commands of Emacs are redefined by Picture +mode to do essentially the same thing but in a quarter-plane way. In +addition, Picture mode defines various keys starting with the `C-c' +prefix to run special picture editing commands. + + One of these keys, `C-c C-c', is pretty important. Often a picture +is part of a larger file that is usually edited in some other major +mode. `M-x edit-picture' records the name of the previous major mode. +You can then use the `C-c C-c' command (`picture-mode-exit') to restore +that mode. `C-c C-c' also deletes spaces from the ends of lines, +unless you give it a numeric argument. + + The commands used in Picture mode all work in other modes (provided +the `picture' library is loaded), but are only bound to keys in +Picture mode. Note that the descriptions below talk of moving "one +column" and so on, but all the picture mode commands handle numeric +arguments as their normal equivalents do. + + Turning on Picture mode calls the value of the variable +`picture-mode-hook' as a function, with no arguments, if that value +exists and is non-`nil'. + +* Menu: + +* Basic Picture:: Basic concepts and simple commands of Picture Mode. +* Insert in Picture:: Controlling direction of cursor motion + after "self-inserting" characters. +* Tabs in Picture:: Various features for tab stops and indentation. +* Rectangles in Picture:: Clearing and superimposing rectangles. + diff --git a/info/xemacs.info-13 b/info/xemacs.info-13 new file mode 100644 index 0000000..d59e716 --- /dev/null +++ b/info/xemacs.info-13 @@ -0,0 +1,1206 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Basic Picture, Next: Insert in Picture, Prev: Picture, Up: Picture + +Basic Editing in Picture Mode +============================= + + Most keys do the same thing in Picture mode that they usually do, +but do it in a quarter-plane style. For example, `C-f' is rebound to +run `picture-forward-column', which moves point one column to the +right, by inserting a space if necessary, so that the actual end of the +line makes no difference. `C-b' is rebound to run +`picture-backward-column', which always moves point left one column, +converting a tab to multiple spaces if necessary. `C-n' and `C-p' are +rebound to run `picture-move-down' and `picture-move-up', which can +either insert spaces or convert tabs as necessary to make sure that +point stays in exactly the same column. `C-e' runs +`picture-end-of-line', which moves to after the last non-blank +character on the line. There was no need to change `C-a', as the choice +of screen model does not affect beginnings of lines. + + Insertion of text is adapted to the quarter-plane screen model +through the use of Overwrite mode (*note Minor Modes::.). +Self-inserting characters replace existing text, column by column, +rather than pushing existing text to the right. runs +`picture-newline', which just moves to the beginning of the following +line so that new text will replace that line. + + Text is erased instead of deleted and killed. +(`picture-backward-clear-column') replaces the preceding character with +a space rather than removing it. `C-d' (`picture-clear-column') does +the same in a forward direction. `C-k' (`picture-clear-line') really +kills the contents of lines, but never removes the newlines from a +buffer. + + To do actual insertion, you must use special commands. `C-o' +(`picture-open-line') creates a blank line, but does so after the +current line; it never splits a line. `C-M-o', `split-line', makes +sense in Picture mode, so it remains unchanged. +(`picture-duplicate-line') inserts another line with the same contents +below the current line. + + To actually delete parts of the picture, use `C-w', or with `C-c +C-d' (which is defined as `delete-char', as `C-d' is in other modes), +or with one of the picture rectangle commands (*note Rectangles in +Picture::.). + + +File: xemacs.info, Node: Insert in Picture, Next: Tabs in Picture, Prev: Basic Picture, Up: Picture + +Controlling Motion After Insert +=============================== + + Since "self-inserting" characters just overwrite and move point in +Picture mode, there is no essential restriction on how point should be +moved. Normally point moves right, but you can specify any of the eight +orthogonal or diagonal directions for motion after a "self-inserting" +character. This is useful for drawing lines in the buffer. + +`C-c <' + Move left after insertion (`picture-movement-left'). + +`C-c >' + Move right after insertion (`picture-movement-right'). + +`C-c ^' + Move up after insertion (`picture-movement-up'). + +`C-c .' + Move down after insertion (`picture-movement-down'). + +`C-c `' + Move up and left ("northwest") after insertion + (`picture-movement-nw'). + +`C-c '' + Move up and right ("northeast") after insertion + (`picture-movement-ne'). + +`C-c /' + Move down and left ("southwest") after insertion + (`picture-movement-sw'). + +`C-c \' + Move down and right ("southeast") after insertion + (`picture-movement-se'). + + Two motion commands move based on the current Picture insertion +direction. The command `C-c C-f' (`picture-motion') moves in the same +direction as motion after "insertion" currently does, while `C-c C-b' +(`picture-motion-reverse') moves in the opposite direction. + + +File: xemacs.info, Node: Tabs in Picture, Next: Rectangles in Picture, Prev: Insert in Picture, Up: Picture + +Picture Mode Tabs +================= + + Two kinds of tab-like action are provided in Picture mode. +Context-based tabbing is done with `M-' (`picture-tab-search'). +With no argument, it moves to a point underneath the next "interesting" +character that follows whitespace in the previous non-blank line. +"Next" here means "appearing at a horizontal position greater than the +one point starts out at". With an argument, as in `C-u M-', the +command moves to the next such interesting character in the current +line. `M-' does not change the text; it only moves point. +"Interesting" characters are defined by the variable +`picture-tab-chars', which contains a string of characters considered +interesting. Its default value is `"!-~"'. + + itself runs `picture-tab', which operates based on the current +tab stop settings; it is the Picture mode equivalent of +`tab-to-tab-stop'. Without arguments it just moves point, but with a +numeric argument it clears the text that it moves over. + + The context-based and tab-stop-based forms of tabbing are brought +together by the command `C-c ' (`picture-set-tab-stops'.) This +command sets the tab stops to the positions which `M-' would +consider significant in the current line. If you use this command with +, you can get the effect of context-based tabbing. But `M-' +is more convenient in the cases where it is sufficient. + + +File: xemacs.info, Node: Rectangles in Picture, Prev: Tabs in Picture, Up: Picture + +Picture Mode Rectangle Commands +=============================== + + Picture mode defines commands for working on rectangular pieces of +the text in ways that fit with the quarter-plane model. The standard +rectangle commands may also be useful (*note Rectangles::.). + +`C-c C-k' + Clear out the region-rectangle (`picture-clear-rectangle'). With + argument, kill it. + +`C-c C-w R' + Similar but save rectangle contents in register R first + (`picture-clear-rectangle-to-register'). + +`C-c C-y' + Copy last killed rectangle into the buffer by overwriting, with + upper left corner at point (`picture-yank-rectangle'). With + argument, insert instead. + +`C-c C-x R' + Similar, but use the rectangle in register R + (`picture-yank-rectangle-from-register'). + + The picture rectangle commands `C-c C-k' (`picture-clear-rectangle') +and `C-c C-w' (`picture-clear-rectangle-to-register') differ from the +standard rectangle commands in that they normally clear the rectangle +instead of deleting it; this is analogous with the way `C-d' is changed +in Picture mode. + + However, deletion of rectangles can be useful in Picture mode, so +these commands delete the rectangle if given a numeric argument. + + The Picture mode commands for yanking rectangles differ from the +standard ones in overwriting instead of inserting. This is the same +way that Picture mode insertion of other text is different from other +modes. `C-c C-y' (`picture-yank-rectangle') inserts (by overwriting) +the rectangle that was most recently killed, while `C-c C-x' +(`picture-yank-rectangle-from-register') does for the rectangle found +in a specified register. + + Since most region commands in Picture mode operate on rectangles, +when you select a region of text with the mouse in Picture mode, it is +highlighted as a rectangle. + + +File: xemacs.info, Node: Sending Mail, Next: Reading Mail, Prev: Picture, Up: Top + +Sending Mail +************ + + To send a message in Emacs, start by typing the command (`C-x m') to +select and initialize the `*mail*' buffer. You can then edit the text +and headers of the message in the mail buffer, and type the command +(`C-c C-c') to send the message. + +`C-x m' + Begin composing a message to send (`mail'). + +`C-x 4 m' + Likewise, but display the message in another window + (`mail-other-window'). + +`C-c C-c' + In Mail mode, send the message and switch to another buffer + (`mail-send-and-exit'). + + The command `C-x m' (`mail') selects a buffer named `*mail*' and +initializes it with the skeleton of an outgoing message. `C-x 4 m' +(`mail-other-window') selects the `*mail*' buffer in a different +window, leaving the previous current buffer visible. + + Because the buffer for mail composition is an ordinary Emacs buffer, +you can switch to other buffers while in the middle of composing mail, +and switch back later (or never). If you use the `C-x m' command again +when you have been composing another message but have not sent it, a +new mail buffer will be created; in this way, you can compose multiple +messages at once. You can switch back to and complete an unsent +message by using the normal buffer selection mechanisms. + + `C-u C-x m' is another way to switch back to a message in progress: +it will search for an existing, unsent mail message buffer and select +it. + +* Menu: + +* Format: Mail Format. Format of the mail being composed. +* Headers: Mail Headers. Details of allowed mail header fields. +* Mode: Mail Mode. Special commands for editing mail being composed. + + +File: xemacs.info, Node: Mail Format, Next: Mail Headers, Prev: Sending Mail, Up: Sending Mail + +The Format of the Mail Buffer +============================= + + In addition to the "text" or contents, a message has "header +fields", which say who sent it, when, to whom, why, and so on. Some +header fields, such as the date and sender, are created automatically +after the message is sent. Others, such as the recipient names, must +be specified by you in order to send the message properly. + + Mail mode provides a few commands to help you edit some header +fields, and some are preinitialized in the buffer automatically at +times. You can insert or edit any header fields using ordinary editing +commands. + + The line in the buffer that says: + + --text follows this line-- + +is a special delimiter that separates the headers you have specified +from the text. Whatever follows this line is the text of the message; +the headers precede it. The delimiter line itself does not appear in +the message actually sent. The text used for the delimiter line is +controlled by the variable `mail-header-separator'. + + Here is an example of what the headers and text in the `*mail*' +buffer might look like. + + To: rms@mc + CC: mly@mc, rg@oz + Subject: The XEmacs User's Manual + --Text follows this line-- + Please ignore this message. + + +File: xemacs.info, Node: Mail Headers, Next: Mail Mode, Prev: Mail Format, Up: Sending Mail + +Mail Header Fields +================== + + There are several header fields you can use in the `*mail*' buffer. +Each header field starts with a field name at the beginning of a line, +terminated by a colon. It does not matter whether you use upper or +lower case in the field name. After the colon and optional whitespace +comes the contents of the field. + +`To' + This field contains the mailing addresses of the message. + +`Subject' + The contents of the `Subject' field should be a piece of text that + says what the message is about. Subject fields are useful because + most mail-reading programs can provide a summary of messages, + listing the subject of each message but not its text. + +`CC' + This field contains additional mailing addresses to send the + message to, but whose readers should not regard the message as + addressed to them. + +`BCC' + This field contains additional mailing addresses to send the + message to, but which should not appear in the header of the + message actually sent. + +`FCC' + This field contains the name of one file (in Unix mail file + format) to which a copy of the message should be appended when the + message is sent. + +`From' + Use the `From' field to say who you are, when the account you are + using to send the mail is not your own. The contents of the + `From' field should be a valid mailing address, since replies will + normally go there. + +`Reply-To' + Use the `Reply-To' field to direct replies to a different address, + not your own. `From' and `Reply-To' have the same effect on where + replies go, but they convey a different meaning to the person who + reads the message. + +`In-Reply-To' + This field contains a piece of text describing a message you are + replying to. Some mail systems can use the information to + correlate related pieces of mail. This field is normally filled + in by your mail handling package when you are replying to a + message and you never need to think about it. + +The `To', `CC', `BCC' and `FCC' fields can appear any number of times, +to specify many places to send the message. + +The `To', `CC', and `BCC', fields can have continuation lines. All the +lines starting with whitespace, following the line on which the field +starts, are considered part of the field. For example, + + To: foo@here, this@there, + me@gnu.cambridge.mass.usa.earth.spiral3281 + +If you have a `~/.mailrc' file, Emacs scans it for mail aliases the +first time you try to send mail in an Emacs session. Emacs expands +aliases found in the `To', `CC', and `BCC' fields where appropriate. +You can set the variable `mail-abbrev-mailrc-file' to the name of the +file with mail aliases. If `nil', `~/.mailrc' is used. + + Your `.mailrc' file ensures that word-abbrevs are defined for each +of your mail aliases when point is in a `To', `CC', `BCC', or `From' +field. The aliases are defined in your `.mailrc' file or in a file +specified by the MAILRC environment variable if it exists. Your mail +aliases expand any time you type a word-delimiter at the end of an +abbreviation. + + 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, 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 `.mailrc' and a new local user is given a userid which +conflicts with one of your aliases. + + Your mail alias abbrevs are in effect only when point is in an +appropriate header field. The mail aliases will not expand in the body +of the message, or in other header fields. The default mode-specific +abbrev table `mail-mode-abbrev-table' is used instead if defined. That +means if you have been using mail-mode specific abbrevs, this code will +not adversely affect you. You can control which header fields the +abbrevs are used in by changing the variable `mail-abbrev-mode-regexp'. + + If auto-fill mode is on, abbrevs wrap at commas instead of at word +boundaries, and header continuation lines will be properly indented. + + You can also insert a mail alias with +`mail-interactive-insert-alias'. This function, which is bound to `C-c +C-a', prompts you for an alias (with completion) and inserts its +expansion at point. + + In this version of Emacs, it is possible to have lines like the +following in your `.mailrc' file: + + alias someone "John Doe " + + That is, if you want an address to have embedded spaces, simply +surround it with double-quotes. The quotes are necessary because the +format of the `.mailrc' file uses spaces as address delimiters. + + Aliases in the `.mailrc' file may be nested. For example, assume you +define aliases like: + alias group1 fred ethel + alias group2 larry curly moe + alias everybody group1 group2 + + When you now type `everybody' on the `To' line, it will expand to: + fred, ethyl, larry, curly, moe + + Aliases may contain forward references; the alias of `everybody' in +the example above can precede the aliases of `group1' and `group2'. + + In this version of Emacs, you can use the `source' `.mailrc' command +for reading aliases from some other file as well. + + Aliases may contain hyphens, as in `"alias foo-bar foo@bar"', even +though word-abbrevs normally cannot contain hyphens. + + To read in the contents of another `.mailrc'-type file from Emacs, +use the command `M-x merge-mail-aliases'. The `rebuild-mail-aliases' +command is similar, but deletes existing aliases first. + + If you want multiple addresses separated by a string other than `,' +(a comma), then set the variable `mail-alias-seperator-string' to it. +This has to be a comma bracketed by whitespace if you want any kind of +reasonable behavior. + + If the variable `mail-archive-file-name' is non-`nil', it should be +a string naming a file. Each time you start to edit a message to send, +an `FCC' field is entered for that file. Unless you remove the `FCC' +field, every message is written into that file when it is sent. + + +File: xemacs.info, Node: Mail Mode, Prev: Mail Headers, Up: Sending Mail + +Mail Mode +========= + + The major mode used in the `*mail*' buffer is Mail mode. Mail mode +is similar to Text mode, but several commands are provided on the `C-c' +prefix. These commands all deal specifically with editing or sending +the message. + +`C-c C-s' + Send the message, and leave the `*mail*' buffer selected + (`mail-send'). + +`C-c C-c' + Send the message, and select some other buffer + (`mail-send-and-exit'). + +`C-c C-f C-t' + Move to the `To' header field, creating one if there is none + (`mail-to'). + +`C-c C-f C-s' + Move to the `Subject' header field, creating one if there is none + (`mail-subject'). + +`C-c C-f C-c' + Move to the `CC' header field, creating one if there is none + (`mail-cc'). + +`C-c C-w' + Insert the file `~/.signature' at the end of the message text + (`mail-signature'). + +`C-c C-y' + Yank the selected message (`mail-yank-original'). + +`C-c C-q' + Fill all paragraphs of yanked old messages, each individually + (`mail-fill-yanked-message'). + +`' + Pops up a menu of useful mail-mode commands. + + There are two ways to send a message. `C-c C-c' +(`mail-send-and-exit') is the usual way to send the message. It sends +the message and then deletes the window (if there is another window) or +switches to another buffer. It puts the `*mail*' buffer at the lowest +priority for automatic reselection, since you are finished with using +it. `C-c C-s' (`mail-send') sends the message and marks the `*mail*' +buffer unmodified, but leaves that buffer selected so that you can +modify the message (perhaps with new recipients) and send it again. + + Mail mode provides some other special commands that are useful for +editing the headers and text of the message before you send it. There +are three commands defined to move point to particular header fields, +all based on the prefix `C-c C-f' (`C-f' is for "field"). They are +`C-c C-f C-t' (`mail-to') to move to the `To' field, `C-c C-f C-s' +(`mail-subject') for the `Subject' field, and `C-c C-f C-c' (`mail-cc') +for the `CC' field. These fields have special motion commands because +they are edited most frequently. + + `C-c C-w' (`mail-signature') adds a standard piece of text at the +end of the message to say more about who you are. The text comes from +the file `.signature' in your home directory. + + When you use an Rmail command to send mail from the Rmail mail +reader, you can use `C-c C-y' `mail-yank-original' inside the `*mail*' +buffer to insert the text of the message you are replying to. Normally +Rmail indents each line of that message four spaces and eliminates most +header fields. A numeric argument specifies the number of spaces to +indent. An argument of just `C-u' says not to indent at all and not to +eliminate anything. `C-c C-y' always uses the current message from the +`RMAIL' buffer, so you can insert several old messages by selecting one +in `RMAIL', switching to `*mail*' and yanking it, then switching back +to `RMAIL' to select another. + + After using `C-c C-y', you can use the command `C-c C-q' +(`mail-fill-yanked-message') to fill the paragraphs of the yanked old +message or messages. One use of `C-c C-q' fills all such paragraphs, +each one separately. + + Clicking the right mouse button in a mail buffer pops up a menu of +the above commands, for easy access. + + Turning on Mail mode (which `C-x m' does automatically) calls the +value of `text-mode-hook', if it is not void or `nil', and then calls +the value of `mail-mode-hook' if that is not void or `nil'. + + +File: xemacs.info, Node: Reading Mail, Next: Calendar/Diary, Prev: Sending Mail, Up: Top + +Reading Mail +************ + + XEmacs provides three separate mail-reading packages. Each one +comes with its own manual, which is included standard with the XEmacs +distribution. + + The recommended mail-reading package for new users is VM. VM works +with standard Unix-mail-format folders and was designed as a replacement +for the older Rmail. + + XEmacs also provides a sophisticated and comfortable front-end to the +MH mail-processing system, called `mh-e'. Unlike in other mail +programs, folders in MH are stored as file-system directories, with +each message occupying one (numbered) file. This facilitates working +with mail using shell commands, and many other features of MH are also +designed to integrate well with the shell and with shell scripts. Keep +in mind, however, that in order to use mh-e you must have the MH +mail-processing system installed on your computer. + + Finally, XEmacs provides the Rmail package. Rmail is (currently) the +only mail reading package distributed with FSF GNU Emacs, and is +powerful in its own right. However, it stores mail folders in a special +format called `Babyl', that is incompatible with all other +frequently-used mail programs. A utility program is provided for +converting Babyl folders to standard Unix-mail format; however, unless +you already have mail in Babyl-format folders, you should consider +using VM or mh-e instead. (If at times you have to use FSF Emacs, it is +not hard to obtain and install VM for that editor.) + + +File: xemacs.info, Node: Calendar/Diary, Next: Sorting, Prev: Reading Mail, Up: Top + +Calendar Mode and the Diary +=========================== + + Emacs provides the functions of a desk calendar, with a diary of +planned or past events. To enter the calendar, type `M-x calendar'; +this displays a three-month calendar centered on the current month, with +point on the current date. With a numeric argument, as in `C-u M-x +calendar', it prompts you for the month and year to be the center of the +three-month calendar. The calendar uses its own buffer, whose major +mode is Calendar mode. + + `Button2' in the calendar brings up a menu of operations on a +particular date; `Buttons3' brings up a menu of commonly used calendar +features that are independent of any particular date. To exit the +calendar, type `q'. *Note Customizing the Calendar and Diary: +(elisp)Calendar, for customization information about the calendar and +diary. + +* Menu: + +* Calendar Motion:: Moving through the calendar; selecting a date. +* Scroll Calendar:: Bringing earlier or later months onto the screen. +* Mark and Region:: Remembering dates, the mark ring. +* General Calendar:: Exiting or recomputing the calendar. +* LaTeX Calendar:: Print a calendar using LaTeX. +* Holidays:: Displaying dates of holidays. +* Sunrise/Sunset:: Displaying local times of sunrise and sunset. +* Lunar Phases:: Displaying phases of the moon. +* Other Calendars:: Converting dates to other calendar systems. +* Diary:: Displaying events from your diary. +* Calendar Customization:: Altering the behavior of the features above. + + +File: xemacs.info, Node: Calendar Motion, Next: Scroll Calendar, Prev: Calendar/Diary, Up: Calendar/Diary + +Movement in the Calendar +------------------------ + + Calendar mode lets you move through the calendar in logical units of +time such as days, weeks, months, and years. If you move outside the +three months originally displayed, the calendar display "scrolls" +automatically through time to make the selected date visible. Moving to +a date lets you view its holidays or diary entries, or convert it to +other calendars; moving longer time periods is also useful simply to +scroll the calendar. + +* Menu: + +* Calendar Unit Motion:: Moving by days, weeks, months, and years. +* Move to Beginning or End:: Moving to start/end of weeks, months, and years. +* Specified Dates:: Moving to the current date or another + specific date. + + +File: xemacs.info, Node: Calendar Unit Motion, Next: Move to Beginning or End, Prev: Calendar Motion, Up: Calendar Motion + +Motion by Integral Days, Weeks, Months, Years +............................................. + + The commands for movement in the calendar buffer parallel the +commands for movement in text. You can move forward and backward by +days, weeks, months, and years. + +`C-f' + Move point one day forward (`calendar-forward-day'). + +`C-b' + Move point one day backward (`calendar-backward-day'). + +`C-n' + Move point one week forward (`calendar-forward-week'). + +`C-p' + Move point one week backward (`calendar-backward-week'). + +`M-}' + Move point one month forward (`calendar-forward-month'). + +`M-{' + Move point one month backward (`calendar-backward-month'). + +`C-x ]' + Move point one year forward (`calendar-forward-year'). + +`C-x [' + Move point one year backward (`calendar-backward-year'). + + The day and week commands are natural analogues of the usual Emacs +commands for moving by characters and by lines. Just as `C-n' usually +moves to the same column in the following line, in Calendar mode it +moves to the same day in the following week. And `C-p' moves to the +same day in the previous week. + + The arrow keys are equivalent to `C-f', `C-b', `C-n' and `C-p', just +as they normally are in other modes. + + The commands for motion by months and years work like those for +weeks, but move a larger distance. The month commands `M-}' and `M-{' +move forward or backward by an entire month's time. The year commands +`C-x ]' and `C-x [' move forward or backward a whole year. + + The easiest way to remember these commands is to consider months and +years analogous to paragraphs and pages of text, respectively. But the +commands themselves are not quite analogous. The ordinary Emacs +paragraph commands move to the beginning or end of a paragraph, whereas +these month and year commands move by an entire month or an entire +year, which usually involves skipping across the end of a month or year. + + All these commands accept a numeric argument as a repeat count. For +convenience, the digit keys and the minus sign specify numeric +arguments in Calendar mode even without the Meta modifier. For example, +`100 C-f' moves point 100 days forward from its present location. + + +File: xemacs.info, Node: Move to Beginning or End, Next: Specified Dates, Prev: Calendar Unit Motion, Up: Calendar Motion + +Beginning or End of Week, Month or Year +....................................... + + A week (or month, or year) is not just a quantity of days; we think +of weeks (months, years) as starting on particular dates. So Calendar +mode provides commands to move to the beginning or end of a week, month +or year: + +`C-a' + Move point to start of week (`calendar-beginning-of-week'). + +`C-e' + Move point to end of week (`calendar-end-of-week'). + +`M-a' + Move point to start of month (`calendar-beginning-of-month'). + +`M-e' + Move point to end of month (`calendar-end-of-month'). + +`M-<' + Move point to start of year (`calendar-beginning-of-year'). + +`M->' + Move point to end of year (`calendar-end-of-year'). + + These commands also take numeric arguments as repeat counts, with the +repeat count indicating how many weeks, months, or years to move +backward or forward. + + By default, weeks begin on Sunday. To make them begin on Monday +instead, set the variable `calendar-week-start-day' to 1. + + +File: xemacs.info, Node: Specified Dates, Prev: Move to Beginning or End, Up: Calendar Motion + +Particular Dates +................ + + Calendar mode provides commands for moving to a particular date +specified in various ways. + +`g d' + Move point to specified date (`calendar-goto-date'). + +`o' + Center calendar around specified month (`calendar-other-month'). + +`.' + Move point to today's date (`calendar-goto-today'). + + `g d' (`calendar-goto-date') prompts for a year, a month, and a day +of the month, and then moves to that date. Because the calendar +includes all dates from the beginning of the current era, you must type +the year in its entirety; that is, type `1990', not `90'. + + `o' (`calendar-other-month') prompts for a month and year, then +centers the three-month calendar around that month. + + You can return to today's date with `.' (`calendar-goto-today'). + + +File: xemacs.info, Node: Scroll Calendar, Next: Mark and Region, Prev: Calendar Motion, Up: Calendar/Diary + +Scrolling the Calendar through Time +----------------------------------- + + The calendar display scrolls automatically through time when you +move out of the visible portion. You can also scroll it manually. +Imagine that the calendar window contains a long strip of paper with +the months on it. Scrolling it means moving the strip so that new +months become visible in the window. + +`C-x <' + Scroll calendar one month forward (`scroll-calendar-left'). + +`C-x >' + Scroll calendar one month backward (`scroll-calendar-right'). + +`C-v' +`' + Scroll calendar three months forward + (`scroll-calendar-left-three-months'). + +`M-v' +`' + Scroll calendar three months backward + (`scroll-calendar-right-three-months'). + + The most basic calendar scroll commands scroll by one month at a +time. This means that there are two months of overlap between the +display before the command and the display after. `C-x <' scrolls the +calendar contents one month to the left; that is, it moves the display +forward in time. `C-x >' scrolls the contents to the right, which +moves backwards in time. + + The commands `C-v' and `M-v' scroll the calendar by an entire +"screenful"--three months--in analogy with the usual meaning of these +commands. `C-v' makes later dates visible and `M-v' makes earlier +dates visible. These commands take a numeric argument as a repeat +count; in particular, since `C-u' multiplies the next command by four, +typing `C-u C-v' scrolls the calendar forward by a year and typing `C-u +M-v' scrolls the calendar backward by a year. + + The function keys and are equivalent to `C-v' and +`M-v', just as they are in other modes. + + +File: xemacs.info, Node: Mark and Region, Next: General Calendar, Prev: Scroll Calendar, Up: Calendar/Diary + +The Mark and the Region +----------------------- + + The concept of the mark applies to the calendar just as to any other +buffer, but it marks a *date*, not a *position* in the buffer. The +region consists of the days between the mark and point (including the +starting and stopping dates). + +`C-SPC' + Set the mark to today's date (`calendar-set-mark'). + +`C-@' + The same. + +`C-x C-x' + Interchange mark and point (`calendar-exchange-point-and-mark'). + +`M-=' + Display the number of days in the current region + (`calendar-count-days-region'). + + You set the mark in the calendar, as in any other buffer, by using +`C-@' or `C-SPC' (`calendar-set-mark'). You return to the marked date +with the command `C-x C-x' (`calendar-exchange-point-and-mark') which +puts the mark where point was and point where mark was. The calendar +is scrolled as necessary, if the marked date was not visible on the +screen. This does not change the extent of the region. + + To determine the number of days in the region, type `M-=' +(`calendar-count-days-region'). The numbers of days printed is +*inclusive*; that is, it includes the days specified by mark and point. + + The main use of the mark in the calendar is to remember dates that +you may want to go back to. To make this feature more useful, the mark +ring (*note Mark Ring::.) operates exactly as in other buffers: Emacs +remembers 16 previous locations of the mark. To return to a marked +date, type `C-u C-SPC' (or `C-u C-@'); this is the command +`calendar-set-mark' given a numeric argument. It moves point to where +the mark was, restores the mark from the ring of former marks, and +stores the previous point at the end of the mark ring. So, repeated +use of this command moves point through all the old marks on the ring, +one by one. + + +File: xemacs.info, Node: General Calendar, Next: LaTeX Calendar, Prev: Mark and Region, Up: Calendar/Diary + +Miscellaneous Calendar Commands +------------------------------- + +`p d' + Display day-in-year (`calendar-print-day-of-year'). + +`?' + Briefly describe calendar commands (`describe-calendar-mode'). + +`C-c C-l' + Regenerate the calendar window (`redraw-calendar'). + +`SPC' + Scroll the next window (`scroll-other-window'). + +`q' + Exit from calendar (`exit-calendar'). + + If you want to know how many days have elapsed since the start of +the year, or the number of days remaining in the year, type the `p d' +command (`calendar-print-day-of-year'). This displays both of those +numbers in the echo area. + + To display a brief description of the calendar commands, type `?' +(`describe-calendar-mode'). For a fuller description, type `C-h m'. + + You can use `SPC' (`scroll-other-window') to scroll the other +window. This is handy when you display a list of holidays or diary +entries in another window. + + If the calendar window text gets corrupted, type `C-c C-l' +(`redraw-calendar') to redraw it. (This can only happen if you use +non-Calendar-mode editing commands.) + + In Calendar mode, you can use `SPC' (`scroll-other-window') to +scroll the other window. This is handy when you display a list of +holidays or diary entries in another window. + + To exit from the calendar, type `q' (`exit-calendar'). This buries +all buffers related to the calendar, selecting other buffers. (If a +frame contains a dedicated calendar window, exiting from the calendar +iconifies that frame.) + + +File: xemacs.info, Node: LaTeX Calendar, Next: Holidays, Prev: General Calendar, Up: Calendar/Diary + +LaTeX Calendar +============== + + The Calendar LaTeX commands produce a buffer of LaTeX code that +prints as a calendar. Depending on the command you use, the printed +calendar covers the day, week, month or year that point is in. + +`t m' + Generate a one-month calendar (`cal-tex-cursor-month'). + +`t M' + Generate a sideways-printing one-month calendar + (`cal-tex-cursor-month-landscape'). + +`t d' + Generate a one-day calendar (`cal-tex-cursor-day'). + +`t w 1' + Generate a one-page calendar for one week (`cal-tex-cursor-week'). + +`t w 2' + Generate a two-page calendar for one week (`cal-tex-cursor-week2'). + +`t w 3' + Generate an ISO-style calendar for one week + (`cal-tex-cursor-week-iso'). + +`t w 4' + Generate a calendar for one Monday-starting week + (`cal-tex-cursor-week-monday'). + +`t f w' + Generate a Filofax-style two-weeks-at-a-glance calendar + (`cal-tex-cursor-filofax-2week'). + +`t f W' + Generate a Filofax-style one-week-at-a-glance calendar + (`cal-tex-cursor-filofax-week'). + +`t y' + Generate a calendar for one year (`cal-tex-cursor-year'). + +`t Y' + Generate a sideways-printing calendar for one year + (`cal-tex-cursor-year-landscape'). + +`t f y' + Generate a Filofax-style calendar for one year + (`cal-tex-cursor-filofax-year'). + + Some of these commands print the calendar sideways (in "landscape +mode"), so it can be wider than it is long. Some of them use Filofax +paper size (3.75in x 6.75in). All of these commands accept a prefix +argument which specifies how many days, weeks, months or years to print +(starting always with the selected one). + + If the variable `cal-tex-holidays' is non-`nil' (the default), then +the printed calendars show the holidays in `calendar-holidays'. If the +variable `cal-tex-diary' is non-`nil' (the default is `nil'), diary +entries are included also (in weekly and monthly calendars only). + + +File: xemacs.info, Node: Holidays, Next: Sunrise/Sunset, Prev: LaTeX Calendar, Up: Calendar/Diary + +Holidays +-------- + + The Emacs calendar knows about all major and many minor holidays, +and can display them. + +`h' + Display holidays for the selected date + (`calendar-cursor-holidays'). + +`Button2 Holidays' + Display any holidays for the date you click on. + +`x' + Mark holidays in the calendar window (`mark-calendar-holidays'). + +`u' + Unmark calendar window (`calendar-unmark'). + +`a' + List all holidays for the displayed three months in another window + (`list-calendar-holidays'). + +`M-x holidays' + List all holidays for three months around today's date in another + window. + +`M-x list-holidays' + List holidays in another window for a specified range of years. + + To see if any holidays fall on a given date, position point on that +date in the calendar window and use the `h' command. Alternatively, +click on that date with `Button2' and then choose `Holidays' from the +menu that appears. Either way, this displays the holidays for that +date, in the echo area if they fit there, otherwise in a separate +window. + + To view the distribution of holidays for all the dates shown in the +calendar, use the `x' command. This displays the dates that are +holidays in a different face (or places a `*' after these dates, if +display with multiple faces is not available). The command applies both +to the currently visible months and to other months that subsequently +become visible by scrolling. To turn marking off and erase the current +marks, type `u', which also erases any diary marks (*note Diary::.). + + To get even more detailed information, use the `a' command, which +displays a separate buffer containing a list of all holidays in the +current three-month range. You can use in the calendar window to +scroll that list. + + The command `M-x holidays' displays the list of holidays for the +current month and the preceding and succeeding months; this works even +if you don't have a calendar window. If you want the list of holidays +centered around a different month, use `C-u M-x holidays', which +prompts for the month and year. + + The holidays known to Emacs include United States holidays and the +major Christian, Jewish, and Islamic holidays; also the solstices and +equinoxes. + + The command `M-x list-holidays' displays the list of holidays for a +range of years. This function asks you for the starting and stopping +years, and allows you to choose all the holidays or one of several +categories of holidays. You can use this command even if you don't have +a calendar window. + + The dates used by Emacs for holidays are based on *current +practice*, not historical fact. Historically, for instance, the start +of daylight savings time and even its existence have varied from year to +year, but present United States law mandates that daylight savings time +begins on the first Sunday in April. When the daylight savings rules +are set up for the United States, Emacs always uses the present +definition, even though it is wrong for some prior years. + + +File: xemacs.info, Node: Sunrise/Sunset, Next: Lunar Phases, Prev: Holidays, Up: Calendar/Diary + +Times of Sunrise and Sunset +--------------------------- + + Special calendar commands can tell you, to within a minute or two, +the times of sunrise and sunset for any date. + +`S' + Display times of sunrise and sunset for the selected date + (`calendar-sunrise-sunset'). + +`Button2 Sunrise/Sunset' + Display times of sunrise and sunset for the date you click on. + +`M-x sunrise-sunset' + Display times of sunrise and sunset for today's date. + +`C-u M-x sunrise-sunset' + Display times of sunrise and sunset for a specified date. + + Within the calendar, to display the *local times* of sunrise and +sunset in the echo area, move point to the date you want, and type `S'. +Alternatively, click `Button2' on the date, then choose +`Sunrise/Sunset' from the menu that appears. The command `M-x +sunrise-sunset' is available outside the calendar to display this +information for today's date or a specified date. To specify a date +other than today, use `C-u M-x sunrise-sunset', which prompts for the +year, month, and day. + + You can display the times of sunrise and sunset for any location and +any date with `C-u C-u M-x sunrise-sunset'. This asks you for a +longitude, latitude, number of minutes difference from Coordinated +Universal Time, and date, and then tells you the times of sunrise and +sunset for that location on that date. + + Because the times of sunrise and sunset depend on the location on +earth, you need to tell Emacs your latitude, longitude, and location +name before using these commands. Here is an example of what to set: + + (setq calendar-latitude 40.1) + (setq calendar-longitude -88.2) + (setq calendar-location-name "Urbana, IL") + +Use one decimal place in the values of `calendar-latitude' and +`calendar-longitude'. + + Your time zone also affects the local time of sunrise and sunset. +Emacs usually gets time zone information from the operating system, but +if these values are not what you want (or if the operating system does +not supply them), you must set them yourself. Here is an example: + + (setq calendar-time-zone -360) + (setq calendar-standard-time-zone-name "CST") + (setq calendar-daylight-time-zone-name "CDT") + +The value of `calendar-time-zone' is the number of minutes difference +between your local standard time and Coordinated Universal Time +(Greenwich time). The values of `calendar-standard-time-zone-name' and +`calendar-daylight-time-zone-name' are the abbreviations used in your +time zone. Emacs displays the times of sunrise and sunset *corrected +for daylight savings time*. *Note Daylight Savings::, 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 `.emacs' file. And +when you install Emacs on a machine, you can create a `default.el' file +which sets them properly for the typical location of most users of that +machine. *Note Init File::. + + +File: xemacs.info, Node: Lunar Phases, Next: Other Calendars, Prev: Sunrise/Sunset, Up: Calendar/Diary + +Phases of the Moon +------------------ + + These calendar commands display the dates and times of the phases of +the moon (new moon, first quarter, full moon, last quarter). This +feature is useful for debugging problems that "depend on the phase of +the moon." + +`M' + Display the dates and times for all the quarters of the moon for + the three-month period shown (`calendar-phases-of-moon'). + +`M-x phases-of-moon' + Display dates and times of the quarters of the moon for three + months around today's date. + + Within the calendar, use the `M' command to display a separate +buffer of the phases of the moon for the current three-month range. The +dates and times listed are accurate to within a few minutes. + + Outside the calendar, use the command `M-x phases-of-moon' to +display the list of the phases of the moon for the current month and the +preceding and succeeding months. For information about a different +month, use `C-u M-x phases-of-moon', which prompts for the month and +year. + + The dates and times given for the phases of the moon are given in +local time (corrected for daylight savings, when appropriate); but if +the variable `calendar-time-zone' is void, Coordinated Universal Time +(the Greenwich time zone) is used. *Note Daylight Savings::. + + +File: xemacs.info, Node: Other Calendars, Next: Calendar Systems, Prev: Lunar Phases, Up: Calendar/Diary + +Conversion To and From Other Calendars +-------------------------------------- + + The Emacs calendar displayed is *always* the Gregorian calendar, +sometimes called the "new style" calendar, which is used in most of the +world today. However, this calendar did not exist before the sixteenth +century and was not widely used before the eighteenth century; it did +not fully displace the Julian calendar and gain universal acceptance +until the early twentieth century. The Emacs calendar can display any +month since January, year 1 of the current era, but the calendar +displayed is the Gregorian, even for a date at which the Gregorian +calendar did not exist. + + While Emacs cannot display other calendars, it can convert dates to +and from several other calendars. + +* Menu: + +* Calendar Systems:: The calendars Emacs understands + (aside from Gregorian). +* To Other Calendar:: Converting the selected date to various calendars. +* From Other Calendar:: Moving to a date specified in another calendar. +* Mayan Calendar:: Moving to a date specified in a Mayan calendar. + + If you are interested in these calendars, you can convert dates one +at a time. Put point on the desired date of the Gregorian calendar and +press the appropriate keys. The `p' is a mnemonic for "print" since +Emacs "prints' the equivalent date in the echo area. + + +File: xemacs.info, Node: Calendar Systems, Next: To Other Calendar, Prev: Other Calendars, Up: Other Calendars + +Supported Calendar Systems +========================== + + The ISO commercial calendar is used largely in Europe. + + The Julian calendar, named after Julius Caesar, was the one used in +Europe throughout medieval times, and in many countries up until the +nineteenth century. + + Astronomers use a simple counting of days elapsed since noon, Monday, +January 1, 4713 B.C. on the Julian calendar. The number of days elapsed +is called the *Julian day number* or the *Astronomical day number*. + + The Hebrew calendar is used by tradition in the Jewish religion. The +Emacs calendar program uses the Hebrew calendar to determine the dates +of Jewish holidays. Hebrew calendar dates begin and end at sunset. + + The Islamic calendar is used in many predominantly Islamic countries. +Emacs uses it to determine the dates of Islamic holidays. There is no +universal agreement in the Islamic world about the calendar; Emacs uses +a widely accepted version, but the precise dates of Islamic holidays +often depend on proclamation by religious authorities, not on +calculations. As a consequence, the actual dates of observance can vary +slightly from the dates computed by Emacs. Islamic calendar dates begin +and end at sunset. + + The French Revolutionary calendar was created by the Jacobins after +the 1789 revolution, to represent a more secular and nature-based view +of the annual cycle, and to install a 10-day week in a rationalization +measure similar to the metric system. The French government officially +abandoned this calendar at the end of 1805. + + The Maya of Central America used three separate, overlapping calendar +systems, the *long count*, the *tzolkin*, and the *haab*. Emacs knows +about all three of these calendars. Experts dispute the exact +correlation between the Mayan calendar and our calendar; Emacs uses the +Goodman-Martinez-Thompson correlation in its calculations. + + The Copts use a calendar based on the ancient Egyptian solar +calendar. Their calendar consists of twelve 30-day months followed by +an extra five-day period. Once every fourth year they add a leap day +to this extra period to make it six days. The Ethiopic calendar is +identical in structure, but has different year numbers and month names. + + The Persians use a solar calendar based on a design of Omar Khayyam. +Their calendar consists of twelve months of which the first six have 31 +days, the next five have 30 days, and the last has 29 in ordinary years +and 30 in leap years. Leap years occur in a complicated pattern every +four or five years. + + The Chinese calendar is a complicated system of lunar months arranged +into solar years. The years go in cycles of sixty, each year containing +either twelve months in an ordinary year or thirteen months in a leap +year; each month has either 29 or 30 days. Years, ordinary months, and +days are named by combining one of ten "celestial stems" with one of +twelve "terrestrial branches" for a total of sixty names that are +repeated in a cycle of sixty. + diff --git a/info/xemacs.info-14 b/info/xemacs.info-14 new file mode 100644 index 0000000..25967a3 --- /dev/null +++ b/info/xemacs.info-14 @@ -0,0 +1,1186 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: To Other Calendar, Next: From Other Calendar, Prev: Calendar Systems, Up: Other Calendars + +Converting To Other Calendars +============================= + + The following commands describe the selected date (the date at point) +in various other calendar systems: + +`Button2 Other Calendars' + Display the date that you click on, expressed in various other + calendars. + +`p c' + Display ISO commercial calendar equivalent for selected day + (`calendar-print-iso-date'). + +`p j' + Display Julian date for selected day + (`calendar-print-julian-date'). + +`p a' + Display astronomical (Julian) day number for selected day + (`calendar-print-astro-day-number'). + +`p h' + Display Hebrew date for selected day + (`calendar-print-hebrew-date'). + +`p i' + Display Islamic date for selected day + (`calendar-print-islamic-date'). + +`p f' + Display French Revolutionary date for selected day + (`calendar-print-french-date'). + +`p C' + Display Chinese date for selected day + (`calendar-print-chinese-date'). + +`p k' + Display Coptic date for selected day + (`calendar-print-coptic-date'). + +`p e' + Display Ethiopic date for selected day + (`calendar-print-ethiopic-date'). + +`p p' + Display Persian date for selected day + (`calendar-print-persian-date'). + +`p m' + Display Mayan date for selected day (`calendar-print-mayan-date'). + + If you are using X, the easiest way to translate a date into other +calendars is to click on it with `Button2', then choose `Other +Calendars' from the menu that appears. This displays the equivalent +forms of the date in all the calendars Emacs understands, in the form of +a menu. (Choosing an alternative from this menu doesn't actually do +anything--the menu is used only for display.) + + Put point on the desired date of the Gregorian calendar, then type +the appropriate keys. The `p' is a mnemonic for "print" since Emacs +"prints" the equivalent date in the echo area. + + +File: xemacs.info, Node: From Other Calendar, Next: Mayan Calendar, Prev: To Other Calendar, Up: Other Calendars + +Converting From Other Calendars +=============================== + + You can use the other supported calendars to specify a date to move +to. This section describes the commands for doing this using calendars +other than Mayan; for the Mayan calendar, see the following section. + +`g c' + Move to a date specified in the ISO commercial calendar + (`calendar-goto-iso-date'). + +`g j' + Move to a date specified in the Julian calendar + (`calendar-goto-julian-date'). + +`g a' + Move to a date specified in astronomical (Julian) day number + (`calendar-goto-astro-day-number'). + +`g h' + Move to a date specified in the Hebrew calendar + (`calendar-goto-hebrew-date'). + +`g i' + Move to a date specified in the Islamic calendar + (`calendar-goto-islamic-date'). + +`g f' + Move to a date specified in the French Revolutionary calendar + (`calendar-goto-french-date'). + +`g C' + Move to a date specified in the Chinese calendar + (`calendar-goto-chinese-date'). + +`g p' + Move to a date specified in the Persian calendar + (`calendar-goto-persian-date'). + +`g k' + Move to a date specified in the Coptic calendar + (`calendar-goto-coptic-date'). + +`g e' + Move to a date specified in the Ethiopic calendar + (`calendar-goto-ethiopic-date'). + + These commands ask you for a date on the other calendar, move point +to the Gregorian calendar date equivalent to that date, and display the +other calendar's date in the echo area. Emacs uses strict completion +(*note Completion::.) whenever it asks you to type a month name, so you +don't have to worry about the spelling of Hebrew, Islamic, or French +names. + + One common question concerning the Hebrew calendar is the computation +of the anniversary of a date of death, called a "yahrzeit." The Emacs +calendar includes a facility for such calculations. If you are in the +calendar, the command `M-x list-yahrzeit-dates' asks you for a range of +years and then displays a list of the yahrzeit dates for those years +for the date given by point. If you are not in the calendar, this +command first asks you for the date of death and the range of years, +and then displays the list of yahrzeit dates. + + +File: xemacs.info, Node: Mayan Calendar, Next: Diary, Prev: From Other Calendar, Up: Other Calendars + +Converting from the Mayan Calendar +---------------------------------- + + Here are the commands to select dates based on the Mayan calendar: + +`g m l' + Move to a date specified by the long count calendar + (`calendar-goto-mayan-long-count-date'). + +`g m n t' + Move to the next occurrence of a place in the tzolkin calendar + (`calendar-next-tzolkin-date'). + +`g m p t' + Move to the previous occurrence of a place in the tzolkin calendar + (`calendar-previous-tzolkin-date'). + +`g m n h' + Move to the next occurrence of a place in the haab calendar + (`calendar-next-haab-date'). + +`g m p h' + Move to the previous occurrence of a place in the haab calendar + (`calendar-previous-haab-date'). + +`g m n c' + Move to the next occurrence of a place in the calendar round + (`calendar-next-calendar-round-date'). + +`g m p c' + Move to the previous occurrence of a place in the calendar round + (`calendar-previous-calendar-round-date'). + + To understand these commands, you need to understand the Mayan +calendars. The "long count" is a counting of days with these units: + + 1 kin = 1 day 1 uinal = 20 kin 1 tun = 18 uinal + 1 katun = 20 tun 1 baktun = 20 katun + +Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11 +tun, 16 uinal, and 6 kin. The Emacs calendar can handle Mayan long +count dates as early as 7.17.18.13.1, but no earlier. When you use the +`g m l' command, type the Mayan long count date with the baktun, katun, +tun, uinal, and kin separated by periods. + + The Mayan tzolkin calendar is a cycle of 260 days formed by a pair of +independent cycles of 13 and 20 days. Since this cycle repeats +endlessly, Emacs provides commands to move backward and forward to the +previous or next point in the cycle. Type `g m p t' to go to the +previous tzolkin date; Emacs asks you for a tzolkin date and moves point +to the previous occurrence of that date. Similarly, type `g m n t' to +go to the next occurrence of a tzolkin date. + + The Mayan haab calendar is a cycle of 365 days arranged as 18 months +of 20 days each, followed a 5-day monthless period. Like the tzolkin +cycle, this cycle repeats endlessly, and there are commands to move +backward and forward to the previous or next point in the cycle. Type +`g m p h' to go to the previous haab date; Emacs asks you for a haab +date and moves point to the previous occurrence of that date. +Similarly, type `g m n h' to go to the next occurrence of a haab date. + + The Maya also used the combination of the tzolkin date and the haab +date. This combination is a cycle of about 52 years called a *calendar +round*. If you type `g m p c', Emacs asks you for both a haab and a +tzolkin date and then moves point to the previous occurrence of that +combination. Use `g m n c' to move point to the next occurrence of a +combination. These commands signal an error if the haab/tzolkin date +combination you have typed is impossible. + + Emacs uses strict completion (*note Completion::.) whenever it asks +you to type a Mayan name, so you don't have to worry about spelling. + + +File: xemacs.info, Node: Diary, Next: Calendar Customization, Prev: Mayan Calendar, Up: Calendar/Diary + +The Diary +--------- + + The Emacs diary keeps track of appointments or other events on a +daily basis, in conjunction with the calendar. To use the diary +feature, you must first create a "diary file" containing a list of +events and their dates. Then Emacs can automatically pick out and +display the events for today, for the immediate future, or for any +specified date. + + By default, Emacs uses `~/diary' as the diary file. This is the +same file that the `calendar' utility uses. A sample `~/diary' file is: + + 12/22/1988 Twentieth wedding anniversary!! + &1/1. Happy New Year! + 10/22 Ruth's birthday. + * 21, *: Payday + Tuesday--weekly meeting with grad students at 10am + Supowit, Shen, Bitner, and Kapoor to attend. + 1/13/89 Friday the thirteenth!! + &thu 4pm squash game with Lloyd. + mar 16 Dad's birthday + April 15, 1989 Income tax due. + &* 15 time cards due. + +This example uses extra spaces to align the event descriptions of most +of the entries. Such formatting is purely a matter of taste. + + Although you probably will start by creating a diary manually, Emacs +provides a number of commands to let you view, add, and change diary +entries. You can also share diary entries with other users (*note +Included Diary Files::.). + +* Menu: + +* Diary Commands:: Viewing diary entries and associated calendar dates. +* Format of Diary File:: Entering events in your diary. +* Date Formats:: Various ways you can specify dates. +* Adding to Diary:: Commands to create diary entries. +* Special Diary Entries:: Anniversaries, blocks of dates, cyclic entries, etc. + + +File: xemacs.info, Node: Diary Commands, Next: Format of Diary File, Prev: Diary, Up: Diary + +Commands Displaying Diary Entries +--------------------------------- + + Once you have created a `~/diary' file, you can use the calendar to +view it. You can also view today's events outside of Calendar mode. + +`d' + Display all diary entries for the selected date + (`view-diary-entries'). + +`Button2 Diary' + Display all diary entries for the date you click on. + +`s' + Display the entire diary file (`show-all-diary-entries'). + +`m' + Mark all visible dates that have diary entries + (`mark-diary-entries'). + +`u' + Unmark the calendar window (`calendar-unmark'). + +`M-x print-diary-entries' + Print hard copy of the diary display as it appears. + +`M-x diary' + Display all diary entries for today's date. + +`M-x diary-mail-entries' + Mail yourself email reminders about upcoming diary entries. + + Displaying the diary entries with `d' shows in a separate window the +diary entries for the selected date in the calendar. The mode line of +the new window shows the date of the diary entries and any holidays +that fall on that date. If you specify a numeric argument with `d', it +shows all the diary entries for that many successive days. Thus, `2 d' +displays all the entries for the selected date and for the following +day. + + Another way to display the diary entries for a date is to click +`Button2' on the date, and then choose `Diary' from the menu that +appears. + + To get a broader view of which days are mentioned in the diary, use +the `m' command. This displays the dates that have diary entries in a +different face (or places a `+' after these dates, if display with +multiple faces is not available). The command applies both to the +currently visible months and to other months that subsequently become +visible by scrolling. To turn marking off and erase the current marks, +type `u', which also turns off holiday marks (*note Holidays::.). + + To see the full diary file, rather than just some of the entries, use +the `s' command. + + Display of selected diary entries uses the selective display feature +to hide entries that don't apply. + + The diary buffer as you see it is an illusion, so simply printing the +buffer does not print what you see on your screen. There is a special +command to print hard copy of the diary buffer *as it appears*; this +command is `M-x print-diary-entries'. It sends the data directly to +the printer. You can customize it like `lpr-region' (*note +Hardcopy::.). + + The command `M-x diary' displays the diary entries for the current +date, independently of the calendar display, and optionally for the next +few days as well; the variable `number-of-diary-entries' specifies how +many days to include (*note Customization::.). + + If you put `(diary)' in your `.emacs' file, this automatically +displays a window with the day's diary entries, when you enter Emacs. +The mode line of the displayed window shows the date and any holidays +that fall on that date. + + Many users like to receive notice of events in their diary as email. +To send such mail to yourself, use the command `M-x +diary-mail-entries'. A prefix argument specifies how many days +(starting with today) to check; otherwise, the variable +`diary-mail-days' says how many days. + + +File: xemacs.info, Node: Format of Diary File, Next: Date Formats, Prev: Diary Commands, Up: Diary + +The Diary File +-------------- + + Your "diary file" is a file that records events associated with +particular dates. The name of the diary file is specified by the +variable `diary-file'; `~/diary' is the default. The `calendar' +utility program supports a subset of the format allowed by the Emacs +diary facilities, so you can use that utility to view the diary file, +with reasonable results aside from the entries it cannot understand. + + Each entry in the diary file describes one event and consists of one +or more lines. An entry always begins with a date specification at the +left margin. The rest of the entry is simply text to describe the +event. If the entry has more than one line, then the lines after the +first must begin with whitespace to indicate they continue a previous +entry. Lines that do not begin with valid dates and do not continue a +preceding entry are ignored. + + You can inhibit the marking of certain diary entries in the calendar +window; to do this, insert an ampersand (`&') at the beginning of the +entry, before the date. This has no effect on display of the entry in +the diary window; it affects only marks on dates in the calendar +window. Nonmarking entries are especially useful for generic entries +that would otherwise mark many different dates. + + If the first line of a diary entry consists only of the date or day +name with no following blanks or punctuation, then the diary window +display doesn't include that line; only the continuation lines appear. +For example, this entry: + + 02/11/1989 + Bill B. visits Princeton today + 2pm Cognitive Studies Committee meeting + 2:30-5:30 Liz at Lawrenceville + 4:00pm Dentist appt + 7:30pm Dinner at George's + 8:00-10:00pm concert + +appears in the diary window without the date line at the beginning. +This style of entry looks neater when you display just a single day's +entries, but can cause confusion if you ask for more than one day's +entries. + + You can edit the diary entries as they appear in the window, but it +is important to remember that the buffer displayed contains the *entire* +diary file, with portions of it concealed from view. This means, for +instance, that the `C-f' (`forward-char') command can put point at what +appears to be the end of the line, but what is in reality the middle of +some concealed line. + + *Be careful when editing the diary entries!* Inserting additional +lines or adding/deleting characters in the middle of a visible line +cannot cause problems, but editing at the end of a line may not do what +you expect. Deleting a line may delete other invisible entries that +follow it. Before editing the diary, it is best to display the entire +file with `s' (`show-all-diary-entries'). + + +File: xemacs.info, Node: Date Formats, Next: Adding to Diary, Prev: Format of Diary File, Up: Diary + +Date Formats +------------ + + Here are some sample diary entries, illustrating different ways of +formatting a date. The examples all show dates in American order +(month, day, year), but Calendar mode supports European order (day, +month, year) as an option. + + 4/20/93 Switch-over to new tabulation system + apr. 25 Start tabulating annual results + 4/30 Results for April are due + */25 Monthly cycle finishes + Friday Don't leave without backing up files + + The first entry appears only once, on April 20, 1993. The second and +third appear every year on the specified dates, and the fourth uses a +wildcard (asterisk) for the month, so it appears on the 25th of every +month. The final entry appears every week on Friday. + + You can use just numbers to express a date, as in `MONTH/DAY' or +`MONTH/DAY/YEAR'. This must be followed by a nondigit. In the date +itself, MONTH and DAY are numbers of one or two digits. The optional +YEAR is also a number, and may be abbreviated to the last two digits; +that is, you can use `11/12/1989' or `11/12/89'. + + Dates can also have the form `MONTHNAME DAY' or `MONTHNAME DAY, +YEAR', where the month's name can be spelled in full or abbreviated to +three characters (with or without a period). Case is not significant. + + A date may be "generic"; that is, partially unspecified. Then the +entry applies to all dates that match the specification. If the date +does not contain a year, it is generic and applies to any year. +Alternatively, MONTH, DAY, or YEAR can be a `*'; this matches any +month, day, or year, respectively. Thus, a diary entry `3/*/*' matches +any day in March of any year; so does `march *'. + + If you prefer the European style of writing dates--in which the day +comes before the month--type `M-x european-calendar' while in the +calendar, or set the variable `european-calendar-style' to `t' *before* +using any calendar or diary command. This mode interprets all dates in +the diary in the European manner, and also uses European style for +displaying diary dates. (Note that there is no comma after the +MONTHNAME in the European style.) To go back to the (default) American +style of writing dates, type `M-x american-calendar'. + + You can use the name of a day of the week as a generic date which +applies to any date falling on that day of the week. You can abbreviate +the day of the week to three letters (with or without a period) or spell +it in full; case is not significant. + + +File: xemacs.info, Node: Adding to Diary, Next: Special Diary Entries, Prev: Date Formats, Up: Diary + +Commands to Add to the Diary +---------------------------- + + While in the calendar, there are several commands to create diary +entries: + +`i d' + Add a diary entry for the selected date (`insert-diary-entry'). + +`i w' + Add a diary entry for the selected day of the week + (`insert-weekly-diary-entry'). + +`i m' + Add a diary entry for the selected day of the month + (`insert-monthly-diary-entry'). + +`i y' + Add a diary entry for the selected day of the year + (`insert-yearly-diary-entry'). + + You can make a diary entry for a specific date by selecting that date +in the calendar window and typing the `i d' command. This command +displays the end of your diary file in another window and inserts the +date; you can then type the rest of the diary entry. + + If you want to make a diary entry that applies to a specific day of +the week, select that day of the week (any occurrence will do) and type +`i w'. This inserts the day-of-week as a generic date; you can then +type the rest of the diary entry. You can make a monthly diary entry in +the same fashion. Select the day of the month, use the `i m' command, +and type rest of the entry. Similarly, you can insert a yearly diary +entry with the `i y' command. + + All of the above commands make marking diary entries by default. To +make a nonmarking diary entry, give a numeric argument to the command. +For example, `C-u i w' makes a nonmarking weekly diary entry. + + When you modify the diary file, be sure to save the file before +exiting Emacs. + + +File: xemacs.info, Node: Special Diary Entries, Prev: Adding to Diary, Up: Diary + +Special Diary Entries +--------------------- + + In addition to entries based on calendar dates, the diary file can +contain "sexp entries" for regular events such as anniversaries. These +entries are based on Lisp expressions (sexps) that Emacs evaluates as +it scans the diary file. Instead of a date, a sexp entry contains `%%' +followed by a Lisp expression which must begin and end with +parentheses. The Lisp expression determines which dates the entry +applies to. + + Calendar mode provides commands to insert certain commonly used sexp +entries: + +`i a' + Add an anniversary diary entry for the selected date + (`insert-anniversary-diary-entry'). + +`i b' + Add a block diary entry for the current region + (`insert-block-diary-entry'). + +`i c' + Add a cyclic diary entry starting at the date + (`insert-cyclic-diary-entry'). + + If you want to make a diary entry that applies to the anniversary of +a specific date, move point to that date and use the `i a' command. +This displays the end of your diary file in another window and inserts +the anniversary description; you can then type the rest of the diary +entry. The entry looks like this: + + The effect of `i a' is to add a `diary-anniversary' sexp to your +diary file. You can also add one manually, for instance: + + %%(diary-anniversary 10 31 1948) Arthur's birthday + +This entry applies to October 31 in any year after 1948; `10 31 1948' +specifies the date. (If you are using the European calendar style, the +month and day are interchanged.) The reason this expression requires a +beginning year is that advanced diary functions can use it to calculate +the number of elapsed years. + + A "block" diary entry applies to a specified range of consecutive +dates. Here is a block diary entry that applies to all dates from June +24, 1990 through July 10, 1990: + + %%(diary-block 6 24 1990 7 10 1990) Vacation + +The `6 24 1990' indicates the starting date and the `7 10 1990' +indicates the stopping date. (Again, if you are using the European +calendar style, the month and day are interchanged.) + + To insert a block entry, place point and the mark on the two dates +that begin and end the range, and type `i b'. This command displays +the end of your diary file in another window and inserts the block +description; you can then type the diary entry. + + "Cyclic" diary entries repeat after a fixed interval of days. To +create one, select the starting date and use the `i c' command. The +command prompts for the length of interval, then inserts the entry, +which looks like this: + + %%(diary-cyclic 50 3 1 1990) Renew medication + +This entry applies to March 1, 1990 and every 50th day following; `3 1 +1990' specifies the starting date. (If you are using the European +calendar style, the month and day are interchanged.) + + All three of these commands make marking diary entries. To insert a +nonmarking entry, give a numeric argument to the command. For example, +`C-u i a' makes a nonmarking anniversary diary entry. + + Marking sexp diary entries in the calendar is *extremely* +time-consuming, since every date visible in the calendar window must be +individually checked. So it's a good idea to make sexp diary entries +nonmarking (with `&') when possible. + + Another sophisticated kind of sexp entry, a "floating" diary entry, +specifies a regularly occurring event by offsets specified in days, +weeks, and months. It is comparable to a crontab entry interpreted by +the `cron' utility. Here is a nonmarking, floating diary entry that +applies to the last Thursday in November: + + &%%(diary-float 11 4 -1) American Thanksgiving + +The 11 specifies November (the eleventh month), the 4 specifies Thursday +(the fourth day of the week, where Sunday is numbered zero), and the -1 +specifies "last" (1 would mean "first", 2 would mean "second", -2 would +mean "second-to-last", and so on). The month can be a single month or +a list of months. Thus you could change the 11 above to `'(1 2 3)' and +have the entry apply to the last Thursday of January, February, and +March. If the month is `t', the entry applies to all months of the +year. + + The sexp feature of the diary allows you to specify diary entries +based on any Emacs Lisp expression. You can use the library of built-in +functions or you can write your own functions. The built-in functions +include the ones shown in this section, plus a few others (*note Sexp +Diary Entries::.). + + The generality of sexps lets you specify any diary entry that you can +describe algorithmically. Suppose you get paid on the 21st of the month +if it is a weekday, and to the Friday before if the 21st is on a +weekend. The diary entry + + &%%(let ((dayname (calendar-day-of-week date)) + (day (car (cdr date)))) + (or (and (= day 21) (memq dayname '(1 2 3 4 5))) + (and (memq day '(19 20)) (= dayname 5))) + ) Pay check deposited + +to just those dates. This example illustrates how the sexp can depend +on the variable `date'; this variable is a list (MONTH DAY YEAR) that +gives the Gregorian date for which the diary entries are being found. +If the value of the sexp is `t', the entry applies to that date. If +the sexp evaluates to `nil', the entry does *not* apply to that date. + + +File: xemacs.info, Node: Calendar Customization, Prev: Diary, Up: Calendar/Diary + +Customizing the Calendar and Diary +---------------------------------- + + There are many customizations that you can use to make the calendar +and diary suit your personal tastes. + +* Menu: + +* Calendar Customizing:: Defaults you can set. +* Holiday Customizing:: Defining your own holidays. +* Date Display Format:: Changing the format. +* Time Display Format:: Changing the format. +* Daylight Savings:: Changing the default. +* Diary Customizing:: Defaults you can set. +* Hebrew/Islamic Entries:: How to obtain them. +* Fancy Diary Display:: Enhancing the diary display, sorting entries. +* Included Diary Files:: Sharing a common diary file. +* Sexp Diary Entries:: Fancy things you can do. +* Appt Customizing:: Customizing appointment reminders. + + +File: xemacs.info, Node: Calendar Customizing, Next: Holiday Customizing, Up: Calendar Customization + +Customizing the Calendar +........................ + + If you set the variable `view-diary-entries-initially' to `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 +`.emacs' file: + + (setq view-diary-entries-initially t) + (calendar) + +this displays both the calendar and diary windows whenever you start +Emacs. + + Similarly, if you set the variable +`view-calendar-holidays-initially' to `t', entering the calendar +automatically displays a list of holidays for the current three-month +period. The holiday list appears in a separate window. + + You can set the variable `mark-diary-entries-in-calendar' to `t' in +order to mark any dates with diary entries. This takes effect whenever +the calendar window contents are recomputed. There are two ways of +marking these dates: by changing the face (*note Faces::.), if the +display supports that, or by placing a plus sign (`+') beside the date +otherwise. + + Similarly, setting the variable `mark-holidays-in-calendar' to `t' +marks holiday dates, either with a change of face or with an asterisk +(`*'). + + The variable `calendar-holiday-marker' specifies how to mark a date +as being a holiday. Its value may be a character to insert next to the +date, or a face name to use for displaying the date. Likewise, the +variable `diary-entry-marker' specifies how to mark a date that has +diary entries. The calendar creates faces named `holiday-face' and +`diary-face' for these purposes; those symbols are the default values +of these variables, when Emacs supports multiple faces on your terminal. + + The variable `calendar-load-hook' is a normal hook run when the +calendar package is first loaded (before actually starting to display +the calendar). + + Starting the calendar runs the normal hook +`initial-calendar-window-hook'. Recomputation of the calendar display +does not run this hook. But if you leave the calendar with the `q' +command and reenter it, the hook runs again. + + The variable `today-visible-calendar-hook' is a normal hook run +after the calendar buffer has been prepared with the calendar when the +current date is visible in the window. One use of this hook is to +replace today's date with asterisks; to do that, use the hook function +`calendar-star-date'. + + (add-hook 'today-visible-calendar-hook 'calendar-star-date) + +Another standard hook function marks the current date, either by +changing its face or by adding an asterisk. Here's how to use it: + + (add-hook 'today-visible-calendar-hook 'calendar-mark-today) + +The variable `calendar-today-marker' specifies how to mark today's +date. Its value should be a character to insert next to the date or a +face name to use for displaying the date. A face named +`calendar-today-face' is provided for this purpose; that symbol is the +default for this variable when Emacs supports multiple faces on your +terminal. + +A similar normal hook, `today-invisible-calendar-hook' is run if the +current date is *not* visible in the window. + + +File: xemacs.info, Node: Holiday Customizing, Next: Date Display Format, Prev: Calendar Customizing, Up: Calendar Customization + +Customizing the Holidays +........................ + + Emacs knows about holidays defined by entries on one of several +lists. You can customize these lists of holidays to your own needs, +adding or deleting holidays. The lists of holidays that Emacs uses are +for general holidays (`general-holidays'), local holidays +(`local-holidays'), Christian holidays (`christian-holidays'), Hebrew +(Jewish) holidays (`hebrew-holidays'), Islamic (Moslem) holidays +(`islamic-holidays'), and other holidays (`other-holidays'). + + The general holidays are, by default, holidays common throughout the +United States. To eliminate these holidays, set `general-holidays' to +`nil'. + + There are no default local holidays (but sites may supply some). You +can set the variable `local-holidays' to any list of holidays, as +described below. + + By default, Emacs does not include all the holidays of the religions +that it knows, only those commonly found in secular calendars. For a +more extensive collection of religious holidays, you can set any (or +all) of the variables `all-christian-calendar-holidays', +`all-hebrew-calendar-holidays', or `all-islamic-calendar-holidays' to +`t'. If you want to eliminate the religious holidays, set any or all +of the corresponding variables `christian-holidays', `hebrew-holidays', +and `islamic-holidays' to `nil'. + + You can set the variable `other-holidays' to any list of holidays. +This list, normally empty, is intended for individual use. + + Each of the lists (`general-holidays', `local-holidays', +`christian-holidays', `hebrew-holidays', `islamic-holidays', and +`other-holidays') is a list of "holiday forms", each holiday form +describing a holiday (or sometimes a list of holidays). + + Here is a table of the possible kinds of holiday form. Day numbers +and month numbers count starting from 1, but "dayname" numbers count +Sunday as 0. The element STRING is always the name of the holiday, as +a string. + +`(holiday-fixed MONTH DAY STRING)' + A fixed date on the Gregorian calendar. MONTH and DAY are + numbers, STRING is the name of the holiday. + +`(holiday-float MONTH DAYNAME K STRING)' + The Kth DAYNAME in MONTH on the Gregorian calendar (DAYNAME=0 for + Sunday, and so on); negative K means count back from the end of + the month. STRING is the name of the holiday. + +`(holiday-hebrew MONTH DAY STRING)' + A fixed date on the Hebrew calendar. MONTH and DAY are numbers, + STRING is the name of the holiday. + +`(holiday-islamic MONTH DAY STRING)' + A fixed date on the Islamic calendar. MONTH and DAY are numbers, + STRING is the name of the holiday. + +`(holiday-julian MONTH DAY STRING)' + A fixed date on the Julian calendar. MONTH and DAY are numbers, + STRING is the name of the holiday. + +`(holiday-sexp SEXP STRING)' + A date calculated by the Lisp expression SEXP. The expression + should use the variable `year' to compute and return the date of a + holiday, or `nil' if the holiday doesn't happen this year. The + value of SEXP must represent the date as a list of the form + `(MONTH DAY YEAR)'. STRING is the name of the holiday. + +`(if CONDITION HOLIDAY-FORM &optional HOLIDAY-FORM)' + A holiday that happens only if CONDITION is true. + +`(FUNCTION [ARGS])' + A list of dates calculated by the function FUNCTION, called with + arguments ARGS. + + 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 `.emacs' file: + + (setq other-holidays '((holiday-fixed 7 14 "Bastille Day"))) + +The holiday form `(holiday-fixed 7 14 "Bastille Day")' specifies the +fourteenth day of the seventh month (July). + + Many holidays occur on a specific day of the week, at a specific time +of month. Here is a holiday form describing Hurricane Supplication Day, +celebrated in the Virgin Islands on the fourth Monday in August: + + (holiday-float 8 1 4 "Hurricane Supplication Day") + +Here the 8 specifies August, the 1 specifies Monday (Sunday is 0, +Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in +the month (1 specifies the first occurrence, 2 the second occurrence, +-1 the last occurrence, -2 the second-to-last occurrence, and so on). + + You can specify holidays that occur on fixed days of the Hebrew, +Islamic, and Julian calendars too. For example, + + (setq other-holidays + '((holiday-hebrew 10 2 "Last day of Hanukkah") + (holiday-islamic 3 12 "Mohammed's Birthday") + (holiday-julian 4 2 "Jefferson's Birthday"))) + +adds the last day of Hanukkah (since the Hebrew months are numbered with +1 starting from Nisan), the Islamic feast celebrating Mohammed's +birthday (since the Islamic months are numbered from 1 starting with +Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the +Julian calendar. + + To include a holiday conditionally, use either Emacs Lisp's `if' or +the `holiday-sexp' form. For example, American presidential elections +occur on the first Tuesday after the first Monday in November of years +divisible by 4: + + (holiday-sexp (if (= 0 (% year 4)) + (calendar-gregorian-from-absolute + (1+ (calendar-dayname-on-or-before + 1 (+ 6 (calendar-absolute-from-gregorian + (list 11 1 year)))))) + "US Presidential Election")) + +or + + (if (= 0 (% displayed-year 4)) + (fixed 11 + (extract-calendar-day + (calendar-gregorian-from-absolute + (1+ (calendar-dayname-on-or-before + 1 (+ 6 (calendar-absolute-from-gregorian + (list 11 1 displayed-year))))))) + "US Presidential Election")) + + Some holidays just don't fit into any of these forms because special +calculations are involved in their determination. In such cases you +must write a Lisp function to do the calculation. To include eclipses, +for example, add `(eclipses)' to `other-holidays' and write an Emacs +Lisp function `eclipses' that returns a (possibly empty) list of the +relevant Gregorian dates among the range visible in the calendar +window, with descriptive strings, like this: + + (((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... ) + + +File: xemacs.info, Node: Date Display Format, Next: Time Display Format, Prev: Holiday Customizing, Up: Calendar Customization + +Date Display Format +................... + + You can customize the manner of displaying dates in the diary, in +mode lines, and in messages by setting `calendar-date-display-form'. +This variable holds a list of expressions that can involve the variables +`month', `day', and `year', which are all numbers in string form, and +`monthname' and `dayname', which are both alphabetic strings. In the +American style, the default value of this list is as follows: + + ((if dayname (concat dayname ", ")) monthname " " day ", " year) + +while in the European style this value is the default: + + ((if dayname (concat dayname ", ")) day " " monthname " " year) + + + The ISO standard date representation is this: + + (year "-" month "-" day) + +This specifies a typical American format: + + (month "/" day "/" (substring year -2)) + + +File: xemacs.info, Node: Time Display Format, Next: Daylight Savings, Prev: Date Display Format, Up: Calendar Customization + +Time Display Format +................... + + The calendar and diary by default display times of day in the +conventional American style with the hours from 1 through 12, minutes, +and either `am' or `pm'. If you prefer the European style, also known +in the US as military, in which the hours go from 00 to 23, you can +alter the variable `calendar-time-display-form'. This variable is a +list of expressions that can involve the variables `12-hours', +`24-hours', and `minutes', which are all numbers in string form, and +`am-pm' and `time-zone', which are both alphabetic strings. The +default value of `calendar-time-display-form' is as follows: + + (12-hours ":" minutes am-pm + (if time-zone " (") time-zone (if time-zone ")")) + +Here is a value that provides European style times: + + (24-hours ":" minutes + (if time-zone " (") time-zone (if time-zone ")")) + +gives military-style times like `21:07 (UT)' if time zone names are +defined, and times like `21:07' if they are not. + + +File: xemacs.info, Node: Daylight Savings, Next: Diary Customizing, Prev: Time Display Format, Up: Calendar Customization + +Daylight Savings Time +..................... + + Emacs understands the difference between standard time and daylight +savings time--the times given for sunrise, sunset, solstices, +equinoxes, and the phases of the moon take that into account. The rules +for daylight savings time vary from place to place and have also varied +historically from year to year. To do the job properly, Emacs needs to +know which rules to use. + + Some operating systems keep track of the rules that apply to the +place where you are; on these systems, Emacs gets the information it +needs from the system automatically. If some or all of this +information is missing, Emacs fills in the gaps with the rules +currently used in Cambridge, Massachusetts. If the resulting rules are +not what you want, you can tell Emacs the rules to use by setting +certain variables. + + If the default choice of rules is not appropriate for your location, +you can tell Emacs the rules to use by setting the variables +`calendar-daylight-savings-starts' and +`calendar-daylight-savings-ends'. Their values should be Lisp +expressions that refer to the variable `year', and evaluate to the +Gregorian date on which daylight savings time starts or (respectively) +ends, in the form of a list `(MONTH DAY YEAR)'. The values should be +`nil' if your area does not use daylight savings time. + + Emacs uses these expressions to determine the starting date of +daylight savings time for the holiday list and for correcting times of +day in the solar and lunar calculations. + + The values for Cambridge, Massachusetts are as follows: + + (calendar-nth-named-day 1 0 4 year) + (calendar-nth-named-day -1 0 10 year) + +That is, the first 0th day (Sunday) of the fourth month (April) in the +year specified by `year', and the last Sunday of the tenth month +(October) of that year. If daylight savings time were changed to start +on October 1, you would set `calendar-daylight-savings-starts' to this: + + (list 10 1 year) + + For a more complex example, suppose daylight savings time begins on +the first of Nisan on the Hebrew calendar. You should set +`calendar-daylight-savings-starts' to this value: + + (calendar-gregorian-from-absolute + (calendar-absolute-from-hebrew + (list 1 1 (+ year 3760)))) + +because Nisan is the first month in the Hebrew calendar and the Hebrew +year differs from the Gregorian year by 3760 at Nisan. + + If there is no daylight savings time at your location, or if you want +all times in standard time, set `calendar-daylight-savings-starts' and +`calendar-daylight-savings-ends' to `nil'. + + The variable `calendar-daylight-time-offset' specifies the +difference between daylight savings time and standard time, measured in +minutes. The value for Cambridge, Massachusetts is 60. + + The two variables `calendar-daylight-savings-starts-time' and +`calendar-daylight-savings-ends-time' specify the number of minutes +after midnight local time when the transition to and from daylight +savings time should occur. For Cambridge, Massachusetts both variables' +values are 120. + + +File: xemacs.info, Node: Diary Customizing, Next: Hebrew/Islamic Entries, Prev: Daylight Savings, Up: Calendar Customization + +Customizing the Diary +..................... + + Ordinarily, the mode line of the diary buffer window indicates any +holidays that fall on the date of the diary entries. The process of +checking for holidays can take several seconds, so including holiday +information delays the display of the diary buffer noticeably. If you'd +prefer to have a faster display of the diary buffer but without the +holiday information, set the variable `holidays-in-diary-buffer' to +`nil'. + + The variable `number-of-diary-entries' controls the number of days +of diary entries to be displayed at one time. It affects the initial +display when `view-diary-entries-initially' is `t', as well as the +command `M-x diary'. For example, the default value is 1, which says +to display only the current day's diary entries. If the value is 2, +both the current day's and the next day's entries are displayed. The +value can also be a vector of seven elements: for example, if the value +is `[0 2 2 2 2 4 1]' then no diary entries appear on Sunday, the +current date's and the next day's diary entries appear Monday through +Thursday, Friday through Monday's entries appear on Friday, while on +Saturday only that day's entries appear. + + The variable `print-diary-entries-hook' is a normal hook run after +preparation of a temporary buffer containing just the diary entries +currently visible in the diary buffer. (The other, irrelevant diary +entries are really absent from the temporary buffer; in the diary +buffer, they are merely hidden.) The default value of this hook does +the printing with the command `lpr-buffer'. If you want to use a +different command to do the printing, just change the value of this +hook. Other uses might include, for example, rearranging the lines into +order by day and time. + + You can customize the form of dates in your diary file, if neither +the standard American nor European styles suits your needs, by setting +the variable `diary-date-forms'. This variable is a list of patterns +for recognizing a date. Each date pattern is a list whose elements may +be regular expressions (*note Regexps::.) or the symbols `month', +`day', `year', `monthname', and `dayname'. All these elements serve as +patterns that match certain kinds of text in the diary file. In order +for the date pattern, as a whole, to match, all of its elements must +match consecutively. + + A regular expression in a date pattern matches in its usual fashion, +using the standard syntax table altered so that `*' is a word +constituent. + + The symbols `month', `day', `year', `monthname', and `dayname' match +the month number, day number, year number, month name, and day name of +the date being considered. The symbols that match numbers allow +leading zeros; those that match names allow three-letter abbreviations +and capitalization. All the symbols can match `*'; since `*' in a +diary entry means "any day", "any month", and so on, it should match +regardless of the date being considered. + + The default value of `diary-date-forms' in the American style is +this: + + ((month "/" day "[^/0-9]") + (month "/" day "/" year "[^0-9]") + (monthname " *" day "[^,0-9]") + (monthname " *" day ", *" year "[^0-9]") + (dayname "\\W")) + +Emacs matches of the diary entries with the date forms is done with the +standard syntax table from Fundamental mode (*note Syntax Tables: +(lispref)Syntax Tables.), but with the `*' changed so that it is a word +constituent. + + The date patterns in the list must be *mutually exclusive* and must +not match any portion of the diary entry itself, just the date and one +character of whitespace. If, to be mutually exclusive, the pattern +must match a portion of the diary entry text--beyond the whitespace +that ends the date--then the first element of the date pattern *must* +be `backup'. This causes the date recognizer to back up to the +beginning of the current word of the diary entry, after finishing the +match. Even if you use `backup', the date pattern must absolutely not +match more than a portion of the first word of the diary entry. The +default value of `diary-date-forms' in the European style is this list: + + ((day "/" month "[^/0-9]") + (day "/" month "/" year "[^0-9]") + (backup day " *" monthname "\\W+\\<[^*0-9]") + (day " *" monthname " *" year "[^0-9]") + (dayname "\\W")) + +Notice the use of `backup' in the third pattern, because it needs to +match part of a word beyond the date itself to distinguish it from the +fourth pattern. + + +File: xemacs.info, Node: Hebrew/Islamic Entries, Next: Fancy Diary Display, Prev: Diary Customizing, Up: Calendar Customization + +Hebrew- and Islamic-Date Diary Entries +...................................... + + Your diary file can have entries based on Hebrew or Islamic dates, as +well as entries based on the world-standard Gregorian calendar. +However, because recognition of such entries is time-consuming and most +people don't use them, you must explicitly enable their use. If you +want the diary to recognize Hebrew-date diary entries, for example, you +must do this: + + (add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries) + (add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries) + +If you want Islamic-date entries, do this: + + (add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries) + (add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries) + + Hebrew- and Islamic-date diary entries have the same formats as +Gregorian-date diary entries, except that `H' precedes a Hebrew date +and `I' precedes an Islamic date. Moreover, because the Hebrew and +Islamic month names are not uniquely specified by the first three +letters, you may not abbreviate them. For example, a diary entry for +the Hebrew date Heshvan 25 could look like this: + + HHeshvan 25 Happy Hebrew birthday! + +and would appear in the diary for any date that corresponds to Heshvan +25 on the Hebrew calendar. And here is Islamic-date diary entry that +matches Dhu al-Qada 25: + + IDhu al-Qada 25 Happy Islamic birthday! + +and would appear in the diary for any date that corresponds to Dhu +al-Qada 25 on the Islamic calendar. + + As with Gregorian-date diary entries, Hebrew- and Islamic-date +entries are nonmarking if they are preceded with an ampersand (`&'). + + Here is a table of commands used in the calendar to create diary +entries that match the selected date and other dates that are similar +in the Hebrew or Islamic calendar: + +`i h d' + Add a diary entry for the Hebrew date corresponding to the + selected date (`insert-hebrew-diary-entry'). + +`i h m' + Add a diary entry for the day of the Hebrew month corresponding to + the selected date (`insert-monthly-hebrew-diary-entry'). This + diary entry matches any date that has the same Hebrew + day-within-month as the selected date. + +`i h y' + Add a diary entry for the day of the Hebrew year corresponding to + the selected date (`insert-yearly-hebrew-diary-entry'). This diary + entry matches any date which has the same Hebrew month and + day-within-month as the selected date. + +`i i d' + Add a diary entry for the Islamic date corresponding to the + selected date (`insert-islamic-diary-entry'). + +`i i m' + Add a diary entry for the day of the Islamic month corresponding + to the selected date (`insert-monthly-islamic-diary-entry'). + +`i i y' + Add a diary entry for the day of the Islamic year corresponding to + the selected date (`insert-yearly-islamic-diary-entry'). + + These commands work much like the corresponding commands for ordinary +diary entries: they apply to the date that point is on in the calendar +window, and what they do is insert just the date portion of a diary +entry at the end of your diary file. You must then insert the rest of +the diary entry. + diff --git a/info/xemacs.info-15 b/info/xemacs.info-15 new file mode 100644 index 0000000..79ce826 --- /dev/null +++ b/info/xemacs.info-15 @@ -0,0 +1,1214 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Fancy Diary Display, Next: Included Diary Files, Prev: Hebrew/Islamic Entries, Up: Calendar Customization + +Fancy Diary Display +................... + + Diary display works by preparing the diary buffer and then running +the hook `diary-display-hook'. The default value of this hook +(`simple-diary-display') hides the irrelevant diary entries and then +displays the buffer. However, if you specify the hook as follows, + + (add-hook 'diary-display-hook 'fancy-diary-display) + +this enables fancy diary display. It displays diary entries and +holidays by copying them into a special buffer that exists only for the +sake of display. Copying to a separate buffer provides an opportunity +to change the displayed text to make it prettier--for example, to sort +the entries by the dates they apply to. + + As with simple diary display, you can print a hard copy of the buffer +with `print-diary-entries'. To print a hard copy of a day-by-day diary +for a week by positioning point on Sunday of that week, type `7 d' and +then do `M-x print-diary-entries'. As usual, the inclusion of the +holidays slows down the display slightly; you can speed things up by +setting the variable `holidays-in-diary-buffer' to `nil'. + + Ordinarily, the fancy diary buffer does not show days for which +there are no diary entries, even if that day is a holiday. If you want +such days to be shown in the fancy diary buffer, set the variable +`diary-list-include-blanks' to `t'. + + If you use the fancy diary display, you can use the normal hook +`list-diary-entries-hook' to sort each day's diary entries by their +time of day. Add this line to your `.emacs' file: + + (add-hook 'list-diary-entries-hook 'sort-diary-entries t) + +For each day, this sorts diary entries that begin with a recognizable +time of day according to their times. Diary entries without times come +first within each day. + + +File: xemacs.info, Node: Included Diary Files, Next: Sexp Diary Entries, Prev: Fancy Diary Display, Up: Calendar Customization + +Included Diary Files +.................... + + Fancy diary display also has the ability to process included diary +files. This permits a group of people to share a diary file for events +that apply to all of them. Lines in the diary file of this form: + + #include "FILENAME" + +includes the diary entries from the file FILENAME in the fancy diary +buffer. The include mechanism is recursive, so that included files can +include other files, and so on; you must be careful not to have a cycle +of inclusions, of course. Here is how to enable the include facility: + + (add-hook 'list-diary-entries-hook 'include-other-diary-files) + (add-hook 'mark-diary-entries-hook 'mark-included-diary-files) + + The include mechanism works only with the fancy diary display, +because ordinary diary display shows the entries directly from your +diary file. + + +File: xemacs.info, Node: Sexp Diary Entries, Next: Appt Customizing, Prev: Included Diary Files, Up: Calendar Customization + +Sexp Entries and the Fancy Diary Display +........................................ + + Sexp diary entries allow you to do more than just have complicated +conditions under which a diary entry applies. If you use the fancy +diary display, sexp entries can generate the text of the entry depending +on the date itself. For example, an anniversary diary entry can insert +the number of years since the anniversary date into the text of the +diary entry. Thus the `%d' in this dairy entry: + + %%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old) + +gets replaced by the age, so on October 31, 1990 the entry appears in +the fancy diary buffer like this: + + Arthur's birthday (42 years old) + +If the diary file instead contains this entry: + + %%(diary-anniversary 10 31 1948) Arthur's %d%s birthday + +the entry in the fancy diary buffer for October 31, 1990 appears like +this: + + Arthur's 42nd birthday + + Similarly, cyclic diary entries can interpolate the number of +repetitions that have occurred: + + %%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time) + +looks like this: + + Renew medication (5th time) + +in the fancy diary display on September 8, 1990. + + The generality of sexp diary entries lets you specify any diary entry +that you can describe algorithmically. A sexp diary entry contains an +expression that computes whether the entry applies to any given date. +If its value is non-`nil', the entry applies to that date; otherwise, +it does not. The expression can use the variable `date' to find the +date being considered; its value is a list (MONTH DAY YEAR) that refers +to the Gregorian calendar. + + Suppose you get paid on the 21st of the month if it is a weekday, and +on the Friday before if the 21st is on a weekend. Here is how to write +a sexp diary entry that matches those dates: + + &%%(let ((dayname (calendar-day-of-week date)) + (day (car (cdr date)))) + (or (and (= day 21) (memq dayname '(1 2 3 4 5))) + (and (memq day '(19 20)) (= dayname 5))) + ) Pay check deposited + +applies to just those dates. This example illustrates how the sexp can +depend on the variable `date'; this variable is a list (MONTH DAY YEAR) +that gives the Gregorian date for which the diary entries are being +found. If the value of the expression is `t', the entry applies to +that date. If the expression evaluates to `nil', the entry does *not* +apply to that date. + + The following sexp diary entries take advantage of the ability (in +the fancy diary display) to concoct diary entries whose text varies +based on the date: + +`%%(diary-sunrise-sunset)' + Make a diary entry for the local times of today's sunrise and + sunset. + +`%%(diary-phases-of-moon)' + Make a diary entry for the phases (quarters) of the moon. + +`%%(diary-day-of-year)' + Make a diary entry with today's day number in the current year and + the number of days remaining in the current year. + +`%%(diary-iso-date)' + Make a diary entry with today's equivalent ISO commercial date. + +`%%(diary-julian-date)' + Make a diary entry with today's equivalent date on the Julian + calendar. + +`%%(diary-astro-day-number)' + Make a diary entry with today's equivalent astronomical (Julian) + day number. + +`%%(diary-hebrew-date)' + Make a diary entry with today's equivalent date on the Hebrew + calendar. + +`%%(diary-islamic-date)' + Make a diary entry with today's equivalent date on the Islamic + calendar. + +`%%(diary-french-date)' + Make a diary entry with today's equivalent date on the French + Revolutionary calendar. + +`%%(diary-mayan-date)' + Make a diary entry with today's equivalent date on the Mayan + calendar. + +Thus including the diary entry + + &%%(diary-hebrew-date) + +causes every day's diary display to contain the equivalent date on the +Hebrew calendar, if you are using the fancy diary display. (With simple +diary display, the line `&%%(diary-hebrew-date)' appears in the diary +for any date, but does nothing particularly useful.) + + These functions can be used to construct sexp diary entries based on +the Hebrew calendar in certain standard ways: + +`%%(diary-rosh-hodesh)' + Make a diary entry that tells the occurrence and ritual + announcement of each new Hebrew month. + +`%%(diary-parasha)' + Make a Saturday diary entry that tells the weekly synagogue + scripture reading. + +`%%(diary-sabbath-candles)' + Make a Friday diary entry that tells the *local time* of Sabbath + candle lighting. + +`%%(diary-omer)' + Make a diary entry that gives the omer count, when appropriate. + +`%%(diary-yahrzeit MONTH DAY YEAR) NAME' + Make a diary entry marking the anniversary of a date of death. + The date is the *Gregorian* (civil) date of death. The diary + entry appears on the proper Hebrew calendar anniversary and on the + day before. (In the European style, the order of the parameters + is changed to DAY, MONTH, YEAR.) + + +File: xemacs.info, Node: Appt Customizing, Prev: Sexp Diary Entries, Up: Calendar Customization + +Customizing Appointment Reminders +................................. + + You can specify exactly how Emacs reminds you of an appointment, and +how far in advance it begins doing so, by setting these variables: + +`appt-message-warning-time' + The time in minutes before an appointment that the reminder + begins. The default is 10 minutes. + +`appt-audible' + If this is `t' (the default), Emacs rings the terminal bell for + appointment reminders. + +`appt-visible' + If this is `t' (the default), Emacs displays the appointment + message in echo area. + +`appt-display-mode-line' + If this is `t' (the default), Emacs displays the number of minutes + to the appointment on the mode line. + +`appt-msg-window' + If this is `t' (the default), Emacs displays the appointment + message in another window. + +`appt-display-duration' + The number of seconds an appointment message is displayed. The + default is 5 seconds. + + +File: xemacs.info, Node: Sorting, Next: Shell, Prev: Calendar/Diary, Up: Top + +Sorting Text +============ + + XEmacs provides several commands for sorting text in a buffer. All +operate on the contents of the region (the text between point and the +mark). They divide the text of the region into many "sort records", +identify a "sort key" for each record, and then reorder the records +using the order determined by the sort keys. The records are ordered so +that their keys are in alphabetical order, or, for numerical sorting, in +numerical order. In alphabetical sorting, all upper-case letters `A' +through `Z' come before lower-case `a', in accordance with the ASCII +character sequence. + + The sort commands differ in how they divide the text into sort +records and in which part of each record they use as the sort key. +Most of the commands make each line a separate sort record, but some +commands use paragraphs or pages as sort records. Most of the sort +commands use each entire sort record as its own sort key, but some use +only a portion of the record as the sort key. + +`M-x sort-lines' + Divide the region into lines and sort by comparing the entire text + of a line. A prefix argument means sort in descending order. + +`M-x sort-paragraphs' + Divide the region into paragraphs and sort by comparing the entire + text of a paragraph (except for leading blank lines). A prefix + argument means sort in descending order. + +`M-x sort-pages' + Divide the region into pages and sort by comparing the entire text + of a page (except for leading blank lines). A prefix argument + means sort in descending order. + +`M-x sort-fields' + Divide the region into lines and sort by comparing the contents of + one field in each line. Fields are defined as separated by + whitespace, so the first run of consecutive non-whitespace + characters in a line constitutes field 1, the second such run + constitutes field 2, etc. + + You specify which field to sort by with a numeric argument: 1 to + sort by field 1, etc. A negative argument means sort in descending + order. Thus, minus 2 means sort by field 2 in reverse-alphabetical + order. + +`M-x sort-numeric-fields' + Like `M-x sort-fields', except the specified field is converted to + a number for each line and the numbers are compared. `10' comes + before `2' when considered as text, but after it when considered + as a number. + +`M-x sort-columns' + Like `M-x sort-fields', except that the text within each line used + for comparison comes from a fixed range of columns. An explanation + is given below. + + For example, if the buffer contains: + + On systems where clash detection (locking of files being edited) is + implemented, XEmacs also checks the first time you modify a buffer + whether the file has changed on disk since it was last visited or + saved. If it has, you are asked to confirm that you want to change + the buffer. + +then if you apply `M-x sort-lines' to the entire buffer you get: + + On systems where clash detection (locking of files being edited) is + implemented, XEmacs also checks the first time you modify a buffer + saved. If it has, you are asked to confirm that you want to change + the buffer. + whether the file has changed on disk since it was last visited or + +where the upper case `O' comes before all lower case letters. If you +apply instead `C-u 2 M-x sort-fields' you get: + + saved. If it has, you are asked to confirm that you want to change + implemented, XEmacs also checks the first time you modify a buffer + the buffer. + On systems where clash detection (locking of files being edited) is + whether the file has changed on disk since it was last visited or + +where the sort keys were `If', `XEmacs', `buffer', `systems', and `the'. + + `M-x sort-columns' requires more explanation. You specify the +columns by putting point at one of the columns and the mark at the other +column. Because this means you cannot put point or the mark at the +beginning of the first line to sort, this command uses an unusual +definition of `region': all of the line point is in is considered part +of the region, and so is all of the line the mark is in. + + For example, to sort a table by information found in columns 10 to +15, you could put the mark on column 10 in the first line of the table, +and point on column 15 in the last line of the table, and then use this +command. Or you could put the mark on column 15 in the first line and +point on column 10 in the last line. + + This can be thought of as sorting the rectangle specified by point +and the mark, except that the text on each line to the left or right of +the rectangle moves along with the text inside the rectangle. *Note +Rectangles::. + + +File: xemacs.info, Node: Shell, Next: Narrowing, Prev: Sorting, Up: Top + +Running Shell Commands from XEmacs +================================== + + XEmacs has commands for passing single command lines to inferior +shell processes; it can also run a shell interactively with input and +output to an XEmacs buffer `*shell*'. + +`M-!' + Run a specified shell command line and display the output + (`shell-command'). + +`M-|' + Run a specified shell command line with region contents as input; + optionally replace the region with the output + (`shell-command-on-region'). + +`M-x shell' + Run a subshell with input and output through an XEmacs buffer. + You can then give commands interactively. + +`M-x term' + Run a subshell with input and output through an XEmacs buffer. + You can then give commands interactively. Full terminal emulation + is available. + +* Menu: + +* Single Shell:: How to run one shell command and return. +* Interactive Shell:: Permanent shell taking input via XEmacs. +* Shell Mode:: Special XEmacs commands used with permanent shell. +* Terminal emulator:: An XEmacs window as a terminal emulator. +* Term Mode:: Special XEmacs commands used in Term mode. +* Paging in Term:: Paging in the terminal emulator. + + +File: xemacs.info, Node: Single Shell, Next: Interactive Shell, Prev: Shell, Up: Shell + +Single Shell Commands +--------------------- + + `M-!' (`shell-command') reads a line of text using the minibuffer +and creates an inferior shell to execute the line as a command. +Standard input from the command comes from the null device. If the +shell command produces any output, the output goes to an XEmacs buffer +named `*Shell Command Output*', which is displayed in another window +but not selected. A numeric argument, as in `M-1 M-!', directs this +command to insert any output into the current buffer. In that case, +point is left before the output and the mark is set after the output. + + `M-|' (`shell-command-on-region') is like `M-!' but passes the +contents of the region as input to the shell command, instead of no +input. If a numeric argument is used to direct output to the current +buffer, then the old region is deleted first and the output replaces it +as the contents of the region. + + Both `M-!' and `M-|' use `shell-file-name' to specify the shell to +use. This variable is initialized based on your `SHELL' environment +variable when you start XEmacs. If the file name does not specify a +directory, the directories in the list `exec-path' are searched; this +list is initialized based on the `PATH' environment variable when you +start XEmacs. You can override either or both of these default +initializations in your `.emacs' file. + + When you use `M-!' and `M-|', XEmacs has to wait until the shell +command completes. You can quit with `C-g'; that terminates the shell +command. + + +File: xemacs.info, Node: Interactive Shell, Next: Shell Mode, Prev: Single Shell, Up: Shell + +Interactive Inferior Shell +-------------------------- + + To run a subshell interactively with its typescript in an XEmacs +buffer, use `M-x shell'. This creates (or reuses) a buffer named +`*shell*' and runs a subshell with input coming from and output going +to that buffer. That is to say, any "terminal output" from the subshell +will go into the buffer, advancing point, and any "terminal input" for +the subshell comes from text in the buffer. To give input to the +subshell, go to the end of the buffer and type the input, terminated by +. + + XEmacs does not wait for the subshell to do anything. You can switch +windows or buffers and edit them while the shell is waiting, or while +it is running a command. Output from the subshell waits until XEmacs +has time to process it; this happens whenever XEmacs is waiting for +keyboard input or for time to elapse. + + To get multiple subshells, change the name of buffer `*shell*' to +something different by using `M-x rename-buffer'. The next use of `M-x +shell' creates a new buffer `*shell*' with its own subshell. By +renaming this buffer as well you can create a third one, and so on. +All the subshells run independently and in parallel. + + The file name used to load the subshell is the value of the variable +`explicit-shell-file-name', if that is non-`nil'. Otherwise, the +environment variable `ESHELL' is used, or the environment variable +`SHELL' if there is no `ESHELL'. If the file name specified is +relative, the directories in the list `exec-path' are searched (*note +Single Shell Commands: Single Shell.). + + As soon as the subshell is started, it is sent as input the contents +of the file `~/.emacs_SHELLNAME', if that file exists, where SHELLNAME +is the name of the file that the shell was loaded from. For example, +if you use `csh', the file sent to it is `~/.emacs_csh'. + + `cd', `pushd', and `popd' commands given to the inferior shell are +watched by XEmacs so it can keep the `*shell*' buffer's default +directory the same as the shell's working directory. These commands +are recognized syntactically by examining lines of input that are sent. +If you use aliases for these commands, you can tell XEmacs to +recognize them also. For example, if the value of the variable +`shell-pushd-regexp' matches the beginning of a shell command line, +that line is regarded as a `pushd' command. Change this variable when +you add aliases for `pushd'. Likewise, `shell-popd-regexp' and +`shell-cd-regexp' are used to recognize commands with the meaning of +`popd' and `cd'. + + `M-x shell-resync-dirs' queries the shell and resynchronizes XEmacs' +idea of what the current directory stack is. `M-x +shell-dirtrack-toggle' turns directory tracking on and off. + + XEmacs keeps a history of the most recent commands you have typed in +the `*shell*' buffer. If you are at the beginning of a shell command +line and type , the previous shell input is inserted into the +buffer before point. Immediately typing again deletes that input +and inserts the one before it. By repeating you can move +backward through your commands until you find one you want to repeat. +You may then edit the command before typing if you wish. +moves forward through the command history, in case you moved backward +past the one you wanted while using . If you type the first few +characters of a previous command and then type , the most recent +shell input starting with those characters is inserted. This can be +very convenient when you are repeating a sequence of shell commands. +The variable `input-ring-size' controls how many commands are saved in +your input history. The default is 30. + + +File: xemacs.info, Node: Shell Mode, Next: Terminal emulator, Prev: Interactive Shell, Up: Shell + +Shell Mode +---------- + + The shell buffer uses Shell mode, which defines several special keys +attached to the `C-c' prefix. They are chosen to resemble the usual +editing and job control characters present in shells that are not under +XEmacs, except that you must type `C-c' first. Here is a list of the +special key bindings of Shell mode: + +`' + At end of buffer send line as input; otherwise, copy current line + to end of buffer and send it (`send-shell-input'). When a line is + copied, any text at the beginning of the line that matches the + variable `shell-prompt-pattern' is left out; this variable's value + should be a regexp string that matches the prompts that you use in + your subshell. + +`C-c C-d' + Send end-of-file as input, probably causing the shell or its + current subjob to finish (`shell-send-eof'). + +`C-d' + If point is not at the end of the buffer, delete the next + character just like most other modes. If point is at the end of + the buffer, send end-of-file as input, instead of generating an + error as in other modes (`comint-delchar-or-maybe-eof'). + +`C-c C-u' + Kill all text that has yet to be sent as input + (`kill-shell-input'). + +`C-c C-w' + Kill a word before point (`backward-kill-word'). + +`C-c C-c' + Interrupt the shell or its current subjob if any + (`interrupt-shell-subjob'). + +`C-c C-z' + Stop the shell or its current subjob if any (`stop-shell-subjob'). + +`C-c C-\' + Send quit signal to the shell or its current subjob if any + (`quit-shell-subjob'). + +`C-c C-o' + Delete last batch of output from shell (`kill-output-from-shell'). + +`C-c C-r' + Scroll top of last batch of output to top of window + (`show-output-from-shell'). + +`C-c C-y' + Copy the previous bunch of shell input and insert it into the + buffer before point (`copy-last-shell-input'). No final newline + is inserted, and the input copied is not resubmitted until you type + . + +`M-p' + Move backward through the input history. Search for a matching + command if you have typed the beginning of a command + (`comint-previous-input'). + +`M-n' + Move forward through the input history. Useful when you are using + quickly and go past the desired command + (`comint-next-input'). + +`' + Complete the file name preceding point (`comint-dynamic-complete'). + + +File: xemacs.info, Node: Terminal emulator, Next: Term Mode, Prev: Shell Mode, Up: Shell + +Interactive Inferior Shell with Terminal Emulator +------------------------------------------------- + + To run a subshell in a terminal emulator, putting its typescript in +an XEmacs buffer, use `M-x term'. This creates (or reuses) a buffer +named `*term*' and runs a subshell with input coming from your keyboard +and output going to that buffer. + + All the normal keys that you type are sent without any interpretation +by XEmacs directly to the subshell, as "terminal input." Any "echo" of +your input is the responsibility of the subshell. (The exception is +the terminal escape character, which by default is `C-c'. *note Term +Mode::..) Any "terminal output" from the subshell goes into the buffer, +advancing point. + + Some programs (such as XEmacs itself) need to control the appearance +on the terminal screen in detail. They do this by sending special +control codes. The exact control codes needed vary from terminal to +terminal, but nowadays most terminals and terminal emulators (including +xterm) understand the so-called "ANSI escape sequences" (first +popularized by the Digital's VT100 family of terminal). The term mode +also understands these escape sequences, and for each control code does +the appropriate thing to change the buffer so that the appearance of +the window will match what it would be on a real terminal. Thus you +can actually run XEmacs inside an XEmacs Term window! + + XEmacs does not wait for the subshell to do anything. You can switch +windows or buffers and edit them while the shell is waiting, or while +it is running a command. Output from the subshell waits until XEmacs +has time to process it; this happens whenever XEmacs is waiting for +keyboard input or for time to elapse. + + To make multiple terminal emulators, rename the buffer `*term*' to +something different using `M-x rename-uniquely', just as with Shell +mode. + + The file name used to load the subshell is determined the same way +as for Shell mode. + + Unlike Shell mode, Term mode does not track the current directory by +examining your input. Instead, if you use a programmable shell, you +can have it tell Term what the current directory is. This is done +automatically by bash for version 1.15 and later. + + +File: xemacs.info, Node: Term Mode, Next: Paging in Term, Prev: Terminal emulator, Up: Shell + +Term Mode +--------- + + Term uses Term mode, which has two input modes: In line mode, Term +basically acts like Shell mode. *Note Shell Mode::. In Char mode, +each character is sent directly to the inferior subshell, except for +the Term escape character, normally `C-c'. + + To switch between line and char mode, use these commands: + findex term-char-mode + +`C-c C-k' + Switch to line mode. Do nothing if already in line mode. + +`C-c C-j' + Switch to char mode. Do nothing if already in char mode. + + The following commands are only available in Char mode: +`C-c C-c' + Send a literal to the sub-shell. + +`C-c C-x' + A prefix command to conveniently access the global commands. + For example, `C-c C-x o' invokes the global binding of `C-x o', + which is normally `other-window'. + + +File: xemacs.info, Node: Paging in Term, Prev: Term Mode, Up: Shell + +Paging in the terminal emulator +------------------------------- + + Term mode has a pager feature. When the pager is enabled, term mode +will pause at the end of each screenful. + +`C-c C-q' + Toggles the pager feature: Disables the pager if it is enabled, + and vice versa. This works in both line and char modes. If the + pager enabled, the mode-line contains the word `page'. + + If the pager is enabled, and Term receives more than a screenful of +output since your last input, Term will enter More break mode. This is +indicated by `**MORE**' in the mode-line. Type a `Space' to display +the next screenful of output. Type `?' to see your other options. The +interface is similar to the Unix `more' program. + + +File: xemacs.info, Node: Narrowing, Next: Hardcopy, Prev: Shell, Up: Top + +Narrowing +========= + + "Narrowing" means focusing in on some portion of the buffer, making +the rest temporarily invisible and inaccessible. Cancelling the +narrowing and making the entire buffer once again visible is called +"widening". The amount of narrowing in effect in a buffer at any time +is called the buffer's "restriction". + +`C-x n n' + Narrow down to between point and mark (`narrow-to-region'). + +`C-x n w' + Widen to make the entire buffer visible again (`widen'). + + Narrowing sometimes makes it easier to concentrate on a single +subroutine or paragraph by eliminating clutter. It can also be used to +restrict the range of operation of a replace command or repeating +keyboard macro. The word `Narrow' appears in the mode line whenever +narrowing is in effect. When you have narrowed to a part of the +buffer, that part appears to be all there is. You can't see the rest, +can't move into it (motion commands won't go outside the visible part), +and can't change it in any way. However, the invisible text is not +gone; if you save the file, it will be saved. + + The primary narrowing command is `C-x n n' (`narrow-to-region'). It +sets the current buffer's restrictions so that the text in the current +region remains visible but all text before the region or after the +region is invisible. Point and mark do not change. + + Because narrowing can easily confuse users who do not understand it, +`narrow-to-region' is normally a disabled command. Attempting to use +this command asks for confirmation and gives you the option of enabling +it; once you enable the command, confirmation will no longer be +required. *Note Disabling::. + + To undo narrowing, use `C-x n w' (`widen'). This makes all text in +the buffer accessible again. + + Use the `C-x =' command to get information on what part of the +buffer you narrowed down. *Note Position Info::. + + +File: xemacs.info, Node: Hardcopy, Next: Recursive Edit, Prev: Narrowing, Up: Top + +Hardcopy Output +=============== + + The XEmacs commands for making hardcopy derive their names from the +Unix commands `print' and `lpr'. + +`M-x print-buffer' + Print hardcopy of current buffer using Unix command `print' + (`lpr -p'). This command adds page headings containing the file + name and page number. + +`M-x lpr-buffer' + Print hardcopy of current buffer using Unix command `lpr'. This + command does not add page headings. + +`M-x print-region' + Like `print-buffer', but prints only the current region. + +`M-x lpr-region' + Like `lpr-buffer', but prints only the current region. + + All the hardcopy commands pass extra switches to the `lpr' program +based on the value of the variable `lpr-switches'. Its value should be +a list of strings, each string a switch starting with `-'. For +example, the value could be `("-Pfoo")' to print on printer `foo'. + + +File: xemacs.info, Node: Recursive Edit, Next: Dissociated Press, Prev: Hardcopy, Up: Top + +Recursive Editing Levels +======================== + + A "recursive edit" is a situation in which you are using XEmacs +commands to perform arbitrary editing while in the middle of another +XEmacs command. For example, when you type `C-r' inside a +`query-replace', you enter a recursive edit in which you can change the +current buffer. When you exit from the recursive edit, you go back to +the `query-replace'. + + "Exiting" a recursive edit means returning to the unfinished +command, which continues execution. For example, exiting the recursive +edit requested by `C-r' in `query-replace' causes query replacing to +resume. Exiting is done with `C-M-c' (`exit-recursive-edit'). + + You can also "abort" a recursive edit. This is like exiting, but +also quits the unfinished command immediately. Use the command `C-]' +(`abort-recursive-edit') for this. *Note Quitting::. + + The mode line shows you when you are in a recursive edit by +displaying square brackets around the parentheses that always surround +the major and minor mode names. Every window's mode line shows the +square brackets, since XEmacs as a whole, rather than any particular +buffer, is in a recursive edit. + + It is possible to be in recursive edits within recursive edits. For +example, after typing `C-r' in a `query-replace', you might type a +command that entered the debugger. In such a case, two or more sets of +square brackets appear in the mode line(s). Exiting the inner +recursive edit (here with the debugger `c' command) resumes the +query-replace command where it called the debugger. After the end of +the query-replace command, you would be able to exit the first +recursive edit. Aborting exits only one level of recursive edit; it +returns to the command level of the previous recursive edit. You can +then abort that one as well. + + The command `M-x top-level' aborts all levels of recursive edits, +returning immediately to the top level command reader. + + The text you edit inside the recursive edit need not be the same text +that you were editing at top level. If the command that invokes the +recursive edit selects a different buffer first, that is the buffer you +will edit recursively. You can switch buffers within the recursive edit +in the normal manner (as long as the buffer-switching keys have not been +rebound). While you could theoretically do the rest of your editing +inside the recursive edit, including visiting files, this could have +surprising effects (such as stack overflow) from time to time. It is +best if you always exit or abort a recursive edit when you no longer +need it. + + In general, XEmacs tries to avoid using recursive edits. It is +usually preferable to allow users to switch among the possible editing +modes in any order they like. With recursive edits, the only way to get +to another state is to go "back" to the state that the recursive edit +was invoked from. + + +File: xemacs.info, Node: Dissociated Press, Next: CONX, Prev: Recursive Edit, Up: Top + +Dissociated Press +================= + + `M-x dissociated-press' is a command for scrambling a file of text +either word by word or character by character. Starting from a buffer +of straight English, it produces extremely amusing output. The input +comes from the current XEmacs buffer. Dissociated Press writes its +output in a buffer named `*Dissociation*', and redisplays that buffer +after every couple of lines (approximately) to facilitate reading it. + + `dissociated-press' asks every so often whether to continue +operating. Answer `n' to stop it. You can also stop at any time by +typing `C-g'. The dissociation output remains in the `*Dissociation*' +buffer for you to copy elsewhere if you wish. + + Dissociated Press operates by jumping at random from one point in the +buffer to another. In order to produce plausible output rather than +gibberish, it insists on a certain amount of overlap between the end of +one run of consecutive words or characters and the start of the next. +That is, if it has just printed out `president' and then decides to +jump to a different point in the file, it might spot the `ent' in +`pentagon' and continue from there, producing `presidentagon'. Long +sample texts produce the best results. + + A positive argument to `M-x dissociated-press' tells it to operate +character by character, and specifies the number of overlap characters. +A negative argument tells it to operate word by word and specifies the +number of overlap words. In this mode, whole words are treated as the +elements to be permuted, rather than characters. No argument is +equivalent to an argument of two. For your againformation, the output +goes only into the buffer `*Dissociation*'. The buffer you start with +is not changed. + + Dissociated Press produces nearly the same results as a Markov chain +based on a frequency table constructed from the sample text. It is, +however, an independent, ignoriginal invention. Dissociated Press +techniquitously copies several consecutive characters from the sample +between random choices, whereas a Markov chain would choose randomly for +each word or character. This makes for more plausible sounding results +and runs faster. + + It is a mustatement that too much use of Dissociated Press can be a +developediment to your real work. Sometimes to the point of outragedy. +And keep dissociwords out of your documentation, if you want it to be +well userenced and properbose. Have fun. Your buggestions are welcome. + + +File: xemacs.info, Node: CONX, Next: Amusements, Prev: Dissociated Press, Up: Top + +CONX +==== + + Besides producing a file of scrambled text with Dissociated Press, +you can generate random sentences by using CONX. + +`M-x conx' + Generate random sentences in the `*conx*' buffer. + +`M-x conx-buffer' + Absorb the text in the current buffer into the `conx' database. + +`M-x conx-init' + Forget the current word-frequency tree. + +`M-x conx-load' + Load a `conx' database that has been previously saved with `M-x + conx-save'. + +`M-x conx-region' + Absorb the text in the current buffer into the `conx' database. + +`M-x conx-save' + Save the current `conx' database to a file for future retrieval. + + Copy text from a buffer using `M-x conx-buffer' or `M-x conx-region' +and then type `M-x conx'. Output is continuously generated until you +type <^G>. You can save the `conx' database to a file with `M-x +conx-save', which you can retrieve with `M-x conx-load'. To clear the +database, use `M-x conx-init'. + + +File: xemacs.info, Node: Amusements, Next: Emulation, Prev: CONX, Up: Top + +Other Amusements +================ + + If you are a little bit bored, you can try `M-x hanoi'. If you are +considerably bored, give it a numeric argument. If you are very, very +bored, try an argument of 9. Sit back and watch. + + When you are frustrated, try the famous Eliza program. Just do `M-x +doctor'. End each input by typing `RET' twice. + + When you are feeling strange, type `M-x yow'. + + +File: xemacs.info, Node: Emulation, Next: Customization, Prev: Amusements, Up: Top + +Emulation +========= + + XEmacs can be programmed to emulate (more or less) most other +editors. Standard facilities can emulate these: + +Viper (a vi emulator) + In XEmacs, Viper is the preferred emulation of vi within XEmacs. + Viper is designed to allow you to take advantage of the best + features of XEmacs while still doing your basic editing in a + familiar, vi-like fashion. Viper provides various different + levels of vi emulation, from a quite complete emulation that + allows almost no access to native XEmacs commands, to an "expert" + mode that combines the most useful vi commands with the most + useful XEmacs commands. + + To start Viper, put the command + + (viper-mode) + + in your `.emacs' file. + + Viper comes with a separate manual that is provided standard with + the XEmacs distribution. + +EDT (DEC VMS editor) + Turn on EDT emulation with `M-x edt-emulation-on'. `M-x + edt-emulation-off' restores normal Emacs command bindings. + + Most of the EDT emulation commands are keypad keys, and most + standard Emacs key bindings are still available. The EDT + emulation rebindings are done in the global keymap, so there is no + problem switching buffers or major modes while in EDT emulation. + +Gosling Emacs + Turn on emulation of Gosling Emacs (aka Unipress Emacs) with `M-x + set-gosmacs-bindings'. This redefines many keys, mostly on the + `C-x' and `ESC' prefixes, to work as they do in Gosmacs. `M-x + set-gnu-bindings' returns to normal XEmacs by rebinding the same + keys to the definitions they had at the time `M-x + set-gosmacs-bindings' was done. + + It is also possible to run Mocklisp code written for Gosling Emacs. + *Note Mocklisp::. + + +File: xemacs.info, Node: Customization, Next: Quitting, Prev: Emulation, Up: Top + +Customization +************* + + This chapter talks about various topics relevant to adapting the +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 `.emacs' file or other +appropriate file to do the customization in each session. *Note Init +File::. + +* Menu: + +* Minor Modes:: Each minor mode is one feature you can turn on + independently of any others. +* Variables:: Many Emacs commands examine Emacs variables + to decide what to do; by setting variables, + you can control their functioning. +* Keyboard Macros:: A keyboard macro records a sequence of keystrokes + to be replayed with a single command. +* Key Bindings:: The keymaps say what command each key runs. + 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 `.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. + + +File: xemacs.info, Node: Minor Modes, Next: Variables, Up: Customization + +Minor Modes +=========== + + Minor modes are options which you can use or not. For example, Auto +Fill mode is a minor mode in which breaks lines between words as +you type. All the minor modes are independent of each other and of the +selected major mode. Most minor modes inform you in the mode line when +they are on; for example, `Fill' in the mode line means that Auto Fill +mode is on. + + Append `-mode' to the name of a minor mode to get the name of a +command function that turns the mode on or off. Thus, the command to +enable or disable Auto Fill mode is called `M-x auto-fill-mode'. These +commands are usually invoked with `M-x', but you can bind keys to them +if you wish. With no argument, the function turns the mode on if it was +off and off if it was on. This is known as "toggling". A positive +argument always turns the mode on, and an explicit zero argument or a +negative argument always turns it off. + + Auto Fill mode allows you to enter filled text without breaking lines +explicitly. Emacs inserts newlines as necessary to prevent lines from +becoming too long. *Note Filling::. + + Overwrite mode causes ordinary printing characters to replace +existing text instead of moving it to the right. For example, if point +is in front of the `B' in `FOOBAR', and you type a `G' in Overwrite +mode, it changes to `FOOGAR', instead of `FOOGBAR'. + + Abbrev mode allows you to define abbreviations that automatically +expand as you type them. For example, `amd' might expand to `abbrev +mode'. *Note Abbrevs::, for full information. + + +File: xemacs.info, Node: Variables, Next: Keyboard Macros, Prev: Minor Modes, Up: Customization + +Variables +========= + + A "variable" is a Lisp symbol which has a value. Variable names can +contain any characters, but by convention they are words separated by +hyphens. A variable can also have a documentation string, which +describes what kind of value it should have and how the value will be +used. + + Lisp allows any variable to have any kind of value, but most +variables that Emacs uses require a value of a certain type. Often the +value has to be a string or a number. Sometimes we say that a certain +feature is turned on if a variable is "non-`nil'," meaning that if the +variable's value is `nil', the feature is off, but the feature is on +for any other value. The conventional value to turn on the +feature--since you have to pick one particular value when you set the +variable--is `t'. + + Emacs uses many Lisp variables for internal recordkeeping, as any +Lisp program must, but the most interesting variables for you are the +ones that exist for the sake of customization. Emacs does not +(usually) change the values of these variables; instead, you set the +values, and thereby alter and control the behavior of certain Emacs +commands. These variables are called "options". Most options are +documented in this manual and appear in the Variable Index (*note +Variable Index::.). + + One example of a variable which is an option is `fill-column', which +specifies the position of the right margin (as a number of characters +from the left margin) to be used by the fill commands (*note +Filling::.). + +* Menu: + +* Examining:: Examining or setting one variable's value. +* Easy Customization:: Convenient and easy customization of variables. +* Edit Options:: Examining or editing list of all variables' values. +* Locals:: Per-buffer values of variables. +* File Variables:: How files can specify variable values. + + +File: xemacs.info, Node: Examining, Next: Easy Customization, Up: Variables + +Examining and Setting Variables +------------------------------- + +`C-h v' +`M-x describe-variable' + Print the value and documentation of a variable. + +`M-x set-variable' + Change the value of a variable. + + To examine the value of a single variable, use `C-h v' +(`describe-variable'), which reads a variable name using the +minibuffer, with completion. It prints both the value and the +documentation of the variable. + + C-h v fill-column + +prints something like: + + fill-column's value is 75 + + Documentation: + *Column beyond which automatic line-wrapping should happen. + Automatically becomes local when set in any fashion. + +The star at the beginning of the documentation indicates that this +variable is an option. `C-h v' is not restricted to options; it allows +any variable name. + + If you know which option you want to set, you can use `M-x +set-variable' to set it. This prompts for the variable name in the +minibuffer (with completion), and then prompts for a Lisp expression +for the new value using the minibuffer a second time. For example, + + M-x set-variable fill-column 75 + +sets `fill-column' to 75, as if you had executed the Lisp expression +`(setq fill-column 75)'. + + Setting variables in this way, like all means of customizing Emacs +except where explicitly stated, affects only the current Emacs session. + + +File: xemacs.info, Node: Easy Customization, Next: Edit Options, Prev: Examining, Up: Variables + +Easy Customization Interface +---------------------------- + + A convenient way to find the user option variables that you want to +change, and then change them, is with `M-x customize'. This command +creates a "customization buffer" with which you can browse through the +Emacs user options in a logically organized structure, then edit and +set their values. You can also use the customization buffer to save +settings permanently. (Not all Emacs user options are included in this +structure as of yet, but we are adding the rest.) + +* Menu: + +* Groups: Customization Groups. + How options are classified in a structure. +* Changing an Option:: How to edit a value and set an option. +* Face Customization:: How to edit the attributes of a face. +* Specific Customization:: Making a customization buffer for specific + options, faces, or groups. + + +File: xemacs.info, Node: Customization Groups, Next: Changing an Option, Up: Easy Customization + +Customization Groups +.................... + + For customization purposes, user options are organized into "groups" +to help you find them. Groups are collected into bigger groups, all +the way up to a master group called `Emacs'. + + `M-x customize' creates a customization buffer that shows the +top-level `Emacs' group and the second-level groups immediately under +it. It looks like this, in part: + + /- Emacs group: ---------------------------------------------------\ + [State]: visible group members are all at standard settings. + Customization of the One True Editor. + See also [Manual]. + + [Open] Editing group + Basic text editing facilities. + + [Open] External group + Interfacing to external utilities. + + MORE SECOND-LEVEL GROUPS + + \- Emacs group end ------------------------------------------------/ + +This says that the buffer displays the contents of the `Emacs' group. +The other groups are listed because they are its contents. But they +are listed differently, without indentation and dashes, because *their* +contents are not included. Each group has a single-line documentation +string; the `Emacs' group also has a `[State]' line. + + Most of the text in the customization buffer is read-only, but it +typically includes some "editable fields" that you can edit. There are +also "active fields"; this means a field that does something when you +"invoke" it. To invoke an active field, either click on it with +`Mouse-1', or move point to it and type . + + For example, the phrase `[Open]' that appears in a second-level +group is an active field. Invoking the `[Open]' field for a group +opens up a new customization buffer, which shows that group and its +contents. This field is a kind of hypertext link to another group. + + The `Emacs' group does not include any user options itself, but +other groups do. By examining various groups, you will eventually find +the options and faces that belong to the feature you are interested in +customizing. Then you can use the customization buffer to set them. + + You can view the structure of customization groups on a larger scale +with `M-x customize-browse'. This command creates a special kind of +customization buffer which shows only the names of the groups (and +options and faces), and their structure. + + In this buffer, you can show the contents of a group by invoking +`[+]'. When the group contents are visible, this button changes to +`[-]'; invoking that hides the group contents. + + Each group, option or face name in this buffer has an active field +which says `[Group]', `[Option]' or `[Face]'. Invoking that active +field creates an ordinary customization buffer showing just that group +and its contents, just that option, or just that face. This is the way +to set values in it. + diff --git a/info/xemacs.info-16 b/info/xemacs.info-16 new file mode 100644 index 0000000..457a018 --- /dev/null +++ b/info/xemacs.info-16 @@ -0,0 +1,1193 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Changing an Option, Next: Face Customization, Prev: Customization Groups, Up: Easy Customization + +Changing an Option +.................. + + Here is an example of what a user option looks like in the +customization buffer: + + Kill Ring Max: [Hide] 30 + [State]: this option is unchanged from its standard setting. + Maximum length of kill ring before oldest elements are thrown away. + + The text following `[Hide]', `30' in this case, indicates the +current value of the option. If you see `[Show]' instead of `[Hide]', +it means that the value is hidden; the customization buffer initially +hides values that take up several lines. Invoke `[Show]' to show the +value. + + The line after the option name indicates the "customization state" +of the option: in the example above, it says you have not changed the +option yet. The word `[State]' at the beginning of this line is +active; you can get a menu of various operations by invoking it with +`Mouse-1' or . These operations are essential for customizing the +variable. + + The line after the `[State]' line displays the beginning of the +option's documentation string. If there are more lines of +documentation, this line ends with `[More]'; invoke this to show the +full documentation string. + + To enter a new value for `Kill Ring Max', move point to the value +and edit it textually. For example, you can type `M-d', then insert +another number. + + When you begin to alter the text, you will see the `[State]' line +change to say that you have edited the value: + + [State]: you have edited the value as text, but not set the option. + + Editing the value does not actually set the option variable. To do +that, you must "set" the option. To do this, invoke the word `[State]' +and choose `Set for Current Session'. + + The state of the option changes visibly when you set it: + + [State]: you have set this option, but not saved it for future sessions. + + You don't have to worry about specifying a value that is not valid; +setting the option checks for validity and will not really install an +unacceptable value. + + While editing a value or field that is a file name, directory name, +command name, or anything else for which completion is defined, you can +type `M-' (`widget-complete') to do completion. + + Some options have a small fixed set of possible legitimate values. +These options don't let you edit the value textually. Instead, an +active field `[Value Menu]' appears before the value; invoke this field +to edit the value. For a boolean "on or off" value, the active field +says `[Toggle]', and it changes to the other value. `[Value Menu]' and +`[Toggle]' edit the buffer; the changes take effect when you use the +`Set for Current Session' operation. + + Some options have values with complex structure. For example, the +value of `load-path' is a list of directories. Here is how it appears +in the customization buffer: + + Load Path: + [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/site-lisp + [INS] [DEL] [Current dir?]: /usr/local/share/emacs/site-lisp + [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/leim + [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/lisp + [INS] [DEL] [Current dir?]: /build/emacs/e19/lisp + [INS] [DEL] [Current dir?]: /build/emacs/e19/lisp/gnus + [INS] + [State]: this item has been changed outside the customization buffer. + List of directories to search for files to load.... + +Each directory in the list appears on a separate line, and each line has +several editable or active fields. + + You can edit any of the directory names. To delete a directory from +the list, invoke `[DEL]' on that line. To insert a new directory in +the list, invoke `[INS]' at the point where you want to insert it. + + You can also invoke `[Current dir?]' to switch between including a +specific named directory in the path, and including `nil' in the path. +(`nil' in a search path means "try the current directory.") + + Two special commands, and `S-', are useful for moving +through the customization buffer. (`widget-forward') moves +forward to the next active or editable field; `S-' +(`widget-backward') moves backward to the previous active or editable +field. + + Typing on an editable field also moves forward, just like +. The reason for this is that people have a tendency to type + when they are finished editing a field. If you have occasion to +insert a newline in an editable field, use `C-o' or `C-q C-j', + + Setting the option changes its value in the current Emacs session; +"saving" the value changes it for future sessions as well. This works +by writing code into your `~/.emacs' file so as to set the option +variable again each time you start Emacs. To save the option, invoke +`[State]' and select the `Save for Future Sessions' operation. + + You can also restore the option to its standard value by invoking +`[State]' and selecting the `Reset' operation. There are actually +three reset operations: + +`Reset to Current' + If you have made some modifications and not yet set the option, + this restores the text in the customization buffer to match the + actual value. + +`Reset to Saved' + This restores the value of the option to the last saved value, and + updates the text accordingly. + +`Reset to Standard Settings' + This sets the option to its standard value, and updates the text + accordingly. This also eliminates any saved value for the option, + so that you will get the standard value in future Emacs sessions. + + The state of a group indicates whether anything in that group has +been edited, set or saved. You can select `Set for Current Session', +`Save for Future Sessions' and the various kinds of `Reset' operation +for the group; these operations on the group apply to all options in +the group and its subgroups. + + Near the top of the customization buffer there are two lines +containing several active fields: + + [Set] [Save] [Reset] [Done] + +Invoking `[Done]' buries this customization buffer. Each of the other +fields performs an operation--set, save or reset--on each of the items +in the buffer that could meaningfully be set, saved or reset. + + +File: xemacs.info, Node: Face Customization, Next: Specific Customization, Prev: Changing an Option, Up: Easy Customization + +Customizing Faces +................. + + In addition to user options, some customization groups also include +faces. When you show the contents of a group, both the user options and +the faces in the group appear in the customization buffer. Here is an +example of how a face looks: + + Custom Changed Face: (sample) + [State]: this face is unchanged from its standard setting. + Face used when the customize item has been changed. + Parent groups: [Custom Magic Faces] + Attributes: [ ] Bold: [Toggle] off (nil) + [ ] Italic: [Toggle] off (nil) + [ ] Underline: [Toggle] off (nil) + [ ] Foreground: white (sample) + [ ] Background: blue (sample) + [ ] Inverse: [Toggle] off (nil) + [ ] Stipple: + [ ] Font Family: + [ ] Size: + [ ] Strikethru: off + + Each face attribute has its own line. The `[X]' field before the +attribute name indicates whether the attribute is "enabled"; `X' means +that it is. You can enable or disable the attribute by invoking that +field. When the attribute is enabled, you can change the attribute +value in the usual ways. + + Setting, saving and resetting a face work like the same operations +for options (*note Changing an Option::.). + + A face can specify different appearances for different types of +display. For example, a face can make text red on a color display, but +use a bold font on a monochrome display. To specify multiple +appearances for a face, select `Show Display Types' in the menu you get +from invoking `[State]'. + + +File: xemacs.info, Node: Specific Customization, Prev: Face Customization, Up: Easy Customization + +Customizing Specific Items +.......................... + + Instead of finding the options you want to change by moving down +through the structure of groups, you can specify the particular option, +face or group that you want to customize. + +`M-x customize-option OPTION ' + Set up a customization buffer with just one option, OPTION. + +`M-x customize-face FACE ' + Set up a customization buffer with just one face, FACE. + +`M-x customize-group GROUP ' + Set up a customization buffer with just one group, GROUP. + +`M-x customize-apropos REGEXP ' + Set up a customization buffer with all the options, faces and + groups that match REGEXP. + +`M-x customize-saved' + Set up a customization buffer containing all options and faces + that you have saved with customization buffers. + +`M-x customize-customized' + Set up a customization buffer containing all options and faces + that you have customized but not saved. + + If you want to alter a particular user option variable with the +customization buffer, and you know its name, you can use the command +`M-x customize-option' and specify the option name. This sets up the +customization buffer with just one option--the one that you asked for. +Editing, setting and saving the value work as described above, but only +for the specified option. + + Likewise, you can modify a specific face, chosen by name, using `M-x +customize-face'. + + You can also set up the customization buffer with a specific group, +using `M-x customize-group'. The immediate contents of the chosen +group, including option variables, faces, and other groups, all appear +as well. However, these subgroups' own contents start out hidden. You +can show their contents in the usual way, by invoking `[Show]'. + + To control more precisely what to customize, you can use `M-x +customize-apropos'. You specify a regular expression as argument; then +all options, faces and groups whose names match this regular expression +are set up in the customization buffer. If you specify an empty regular +expression, this includes *all* groups, options and faces in the +customization buffer (but that takes a long time). + + If you change option values and then decide the change was a mistake, +you can use two special commands to revisit your previous changes. Use +`customize-saved' to look at the options and faces that you have saved. +Use `M-x customize-customized' to look at the options and faces that +you have set but not saved. + + +File: xemacs.info, Node: Edit Options, Next: Locals, Prev: Easy Customization, Up: Variables + +Editing Variable Values +----------------------- + +`M-x list-options' + Display a buffer listing names, values, and documentation of all + options. + +`M-x edit-options' + Change option values by editing a list of options. + + `M-x list-options' displays a list of all Emacs option variables in +an Emacs buffer named `*List Options*'. Each option is shown with its +documentation and its current value. Here is what a portion of it might +look like: + + ;; exec-path: + ("." "/usr/local/bin" "/usr/ucb" "/bin" "/usr/bin" "/u2/emacs/etc") + *List of directories to search programs to run in subprocesses. + Each element is a string (directory name) + or nil (try the default directory). + ;; + ;; fill-column: + 75 + *Column beyond which automatic line-wrapping should happen. + Automatically becomes local when set in any fashion. + ;; + + `M-x edit-options' goes one step further and immediately selects the +`*List Options*' buffer; this buffer uses the major mode Options mode, +which provides commands that allow you to point at an option and change +its value: + +`s' + Set the variable point is in or near to a new value read using the + minibuffer. + +`x' + Toggle the variable point is in or near: if the value was `nil', + it becomes `t'; otherwise it becomes `nil'. + +`1' + Set the variable point is in or near to `t'. + +`0' + Set the variable point is in or near to `nil'. + +`n' +`p' + Move to the next or previous variable. + + +File: xemacs.info, Node: Locals, Next: File Variables, Prev: Edit Options, Up: Variables + +Local Variables +--------------- + +`M-x make-local-variable' + Make a variable have a local value in the current buffer. + +`M-x kill-local-variable' + Make a variable use its global value in the current buffer. + +`M-x make-variable-buffer-local' + Mark a variable so that setting it will make it local to the + buffer that is current at that time. + + You can make any variable "local" to a specific Emacs buffer. This +means that the variable's value in that buffer is independent of its +value in other buffers. A few variables are always local in every +buffer. All other Emacs variables have a "global" value which is in +effect in all buffers that have not made the variable local. + + Major modes always make the variables they set local to the buffer. +This is why changing major modes in one buffer has no effect on other +buffers. + + `M-x make-local-variable' reads the name of a variable and makes it +local to the current buffer. Further changes in this buffer will not +affect others, and changes in the global value will not affect this +buffer. + + `M-x make-variable-buffer-local' reads the name of a variable and +changes the future behavior of the variable so that it automatically +becomes local when it is set. More precisely, once you have marked a +variable in this way, the usual ways of setting the variable will +automatically invoke `make-local-variable' first. We call such +variables "per-buffer" variables. + + Some important variables have been marked per-buffer already. They +include `abbrev-mode', `auto-fill-function', `case-fold-search', +`comment-column', `ctl-arrow', `fill-column', `fill-prefix', +`indent-tabs-mode', `left-margin', +`mode-line-format', `overwrite-mode', `selective-display-ellipses', +`selective-display', `tab-width', and `truncate-lines'. Some other +variables are always local in every buffer, but they are used for +internal purposes. + + Note: the variable `auto-fill-function' was formerly named +`auto-fill-hook'. + + If you want a variable to cease to be local to the current buffer, +call `M-x kill-local-variable' and provide the name of a variable to +the prompt. The global value of the variable is again in effect in +this buffer. Setting the major mode kills all the local variables of +the buffer. + + To set the global value of a variable, regardless of whether the +variable has a local value in the current buffer, you can use the Lisp +function `setq-default'. It works like `setq'. If there is a local +value in the current buffer, the local value is not affected by +`setq-default'; thus, the new global value may not be visible until you +switch to another buffer, as in the case of: + + (setq-default fill-column 75) + +`setq-default' is the only way to set the global value of a variable +that has been marked with `make-variable-buffer-local'. + + Programs can look at a variable's default value with `default-value'. +This function takes a symbol as an argument and returns its default +value. The argument is evaluated; usually you must quote it +explicitly, as in the case of: + + (default-value 'fill-column) + + +File: xemacs.info, Node: File Variables, Prev: Locals, Up: Variables + +Local Variables in Files +------------------------ + + A file can contain a "local variables list", which specifies the +values to use for certain Emacs variables when that file is edited. +Visiting the file checks for a local variables list and makes each +variable in the list local to the buffer in which the file is visited, +with the value specified in the file. + + A local variables list goes near the end of the file, in the last +page. (It is often best to put it on a page by itself.) The local +variables list starts with a line containing the string `Local +Variables:', and ends with a line containing the string `End:'. In +between come the variable names and values, one set per line, as +`VARIABLE: VALUE'. The VALUEs are not evaluated; they are used +literally. + + The line which starts the local variables list does not have to say +just `Local Variables:'. If there is other text before `Local +Variables:', that text is called the "prefix", and if there is other +text after, that is called the "suffix". If a prefix or suffix are +present, each entry in the local variables list should have the prefix +before it and the suffix after it. This includes the `End:' line. The +prefix and suffix are included to disguise the local variables list as +a comment so the compiler or text formatter will ignore it. If you do +not need to disguise the local variables list as a comment in this way, +there is no need to include a prefix or a suffix. + + Two "variable" names are special in a local variables list: a value +for the variable `mode' sets the major mode, and a value for the +variable `eval' is simply evaluated as an expression and the value is +ignored. These are not real variables; setting them in any other +context does not have the same effect. If `mode' is used in a local +variables list, it should be the first entry in the list. + + Here is an example of a local variables list: + ;;; Local Variables: *** + ;;; mode:lisp *** + ;;; comment-column:0 *** + ;;; comment-start: ";;; " *** + ;;; comment-end:"***" *** + ;;; End: *** + + Note that the prefix is `;;; ' and the suffix is ` ***'. Note also +that comments in the file begin with and end with the same strings. +Presumably the file contains code in a language which is enough like +Lisp for Lisp mode to be useful but in which comments start and end +differently. The prefix and suffix are used in the local variables +list to make the list look like several lines of comments when the +compiler or interpreter for that language reads the file. + + The start of the local variables list must be no more than 3000 +characters from the end of the file, and must be in the last page if the +file is divided into pages. Otherwise, Emacs will not notice it is +there. The purpose is twofold: a stray `Local Variables:' not in the +last page does not confuse Emacs, and Emacs never needs to search a +long file that contains no page markers and has no local variables list. + + You may be tempted to turn on Auto Fill mode with a local variable +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 +`.emacs' file to turn it on (when appropriate) for you alone (*note +Init File::.). Don't try to use a local variable list that would +impose your taste on everyone working with the file. + + XEmacs allows you to specify local variables in the first line of a +file, in addition to specifying them in the `Local Variables' section +at the end of a file. + + If the first line of a file contains two occurrences of ``-*-'', +XEmacs uses the information between them to determine what the major +mode and variable settings should be. For example, these are all legal: + + ;;; -*- mode: emacs-lisp -*- + ;;; -*- mode: postscript; version-control: never -*- + ;;; -*- tags-file-name: "/foo/bar/TAGS" -*- + + For historical reasons, the syntax ``-*- modename -*-'' is allowed +as well; for example, you can use: + + ;;; -*- emacs-lisp -*- + + The variable `enable-local-variables' controls the use of local +variables lists in files you visit. The value can be `t', `nil', or +something else. A value of `t' means local variables lists are obeyed; +`nil' means they are ignored; anything else means query. + + The command `M-x normal-mode' always obeys local variables lists and +ignores this variable. + + +File: xemacs.info, Node: Keyboard Macros, Next: Key Bindings, Prev: Variables, Up: Customization + +Keyboard Macros +=============== + + A "keyboard macro" is a command defined by the user to abbreviate a +sequence of keys. For example, if you discover that you are about to +type `C-n C-d' forty times, you can speed your work by defining a +keyboard macro to invoke `C-n C-d' and calling it with a repeat count +of forty. + +`C-x (' + Start defining a keyboard macro (`start-kbd-macro'). + +`C-x )' + End the definition of a keyboard macro (`end-kbd-macro'). + +`C-x e' + Execute the most recent keyboard macro (`call-last-kbd-macro'). + +`C-u C-x (' + Re-execute last keyboard macro, then add more keys to its + definition. + +`C-x q' + When this point is reached during macro execution, ask for + confirmation (`kbd-macro-query'). + +`M-x name-last-kbd-macro' + Give a command name (for the duration of the session) to the most + recently defined keyboard macro. + +`M-x insert-kbd-macro' + Insert in the buffer a keyboard macro's definition, as Lisp code. + + Keyboard macros differ from other Emacs commands in that they are +written in the Emacs command language rather than in Lisp. This makes +it easier for the novice to write them and makes them more convenient as +temporary hacks. However, the Emacs command language is not powerful +enough as a programming language to be useful for writing anything +general or complex. For such things, Lisp must be used. + + You define a keyboard macro by executing the commands which are its +definition. Put differently, as you are defining a keyboard macro, the +definition is being executed for the first time. This way, you see +what the effects of your commands are, and don't have to figure them +out in your head. When you are finished, the keyboard macro is defined +and also has been executed once. You can then execute the same set of +commands again by invoking the macro. + +* Menu: + +* Basic Kbd Macro:: Defining and running keyboard macros. +* Save Kbd Macro:: Giving keyboard macros names; saving them in files. +* Kbd Macro Query:: Keyboard macros that do different things each use. + + +File: xemacs.info, Node: Basic Kbd Macro, Next: Save Kbd Macro, Up: Keyboard Macros + +Basic Use +--------- + + To start defining a keyboard macro, type `C-x (' +(`start-kbd-macro'). From then on, anything you type continues to be +executed, but also becomes part of the definition of the macro. `Def' +appears in the mode line to remind you of what is going on. When you +are finished, the `C-x )' command (`end-kbd-macro') terminates the +definition, without becoming part of it. + + For example, + + C-x ( M-f foo C-x ) + +defines a macro to move forward a word and then insert `foo'. + + You can give `C-x )' a repeat count as an argument, in which case it +repeats the macro that many times right after defining it, but defining +the macro counts as the first repetition (since it is executed as you +define it). If you give `C-x )' an argument of 4, it executes the +macro immediately 3 additional times. An argument of zero to `C-x e' +or `C-x )' means repeat the macro indefinitely (until it gets an error +or you type `C-g'). + + Once you have defined a macro, you can invoke it again with the `C-x +e' command (`call-last-kbd-macro'). You can give the command a repeat +count numeric argument to execute the macro many times. + + To repeat an operation at regularly spaced places in the text, +define a macro and include as part of the macro the commands to move to +the next place you want to use it. For example, if you want to change +each line, you should position point at the start of a line, and define +a macro to change that line and leave point at the start of the next +line. Repeating the macro will then operate on successive lines. + + After you have terminated the definition of a keyboard macro, you +can add to the end of its definition by typing `C-u C-x ('. This is +equivalent to plain `C-x (' followed by retyping the whole definition +so far. As a consequence it re-executes the macro as previously +defined. + + +File: xemacs.info, Node: Save Kbd Macro, Next: Kbd Macro Query, Prev: Basic Kbd Macro, Up: Keyboard Macros + +Naming and Saving Keyboard Macros +--------------------------------- + + To save a keyboard macro for longer than until you define the next +one, you must give it a name using `M-x name-last-kbd-macro'. This +reads a name as an argument using the minibuffer and defines that name +to execute the macro. The macro name is a Lisp symbol, and defining it +in this way makes it a valid command name for calling with `M-x' or for +binding a key to with `global-set-key' (*note Keymaps::.). If you +specify a name that has a prior definition other than another keyboard +macro, Emacs prints an error message and nothing is changed. + + Once a macro has a command name, you can save its definition in a +file. You can then use it in another editing session. First visit the +file you want to save the definition in. Then use the command: + + M-x insert-kbd-macro MACRONAME + +This inserts some Lisp code that, when executed later, will define the +same macro with the same definition it has now. You need not +understand Lisp code to do this, because `insert-kbd-macro' writes the +Lisp code for you. Then save the file. You can load the file with +`load-file' (*note Lisp Libraries::.). If the file you save in is your +initialization file `~/.emacs' (*note Init File::.), then the macro +will be defined each time you run Emacs. + + If you give `insert-kbd-macro' a prefix argument, it creates +additional Lisp code to record the keys (if any) that you have bound to +the keyboard macro, so that the macro is reassigned the same keys when +you load the file. + + +File: xemacs.info, Node: Kbd Macro Query, Prev: Save Kbd Macro, Up: Keyboard Macros + +Executing Macros With Variations +-------------------------------- + + You can use `C-x q' (`kbd-macro-query'), to get an effect similar to +that of `query-replace'. The macro asks you each time whether to make +a change. When you are defining the macro, type `C-x q' at the point +where you want the query to occur. During macro definition, the `C-x +q' does nothing, but when you invoke the macro, `C-x q' reads a +character from the terminal to decide whether to continue. + + The special answers to a `C-x q' query are , , `C-d', +`C-l', and `C-r'. Any other character terminates execution of the +keyboard macro and is then read as a command. means to continue. + means to skip the remainder of this repetition of the macro, +starting again from the beginning in the next repetition. `C-d' means +to skip the remainder of this repetition and cancel further repetition. +`C-l' redraws the frame and asks you again for a character to specify +what to do. `C-r' enters a recursive editing level, in which you can +perform editing that is not part of the macro. When you exit the +recursive edit using `C-M-c', you are asked again how to continue with +the keyboard macro. If you type a at this time, the rest of the +macro definition is executed. It is up to you to leave point and the +text in a state such that the rest of the macro will do what you want. + + `C-u C-x q', which is `C-x q' with a numeric argument, performs a +different function. It enters a recursive edit reading input from the +keyboard, both when you type it during the definition of the macro and +when it is executed from the macro. During definition, the editing you +do inside the recursive edit does not become part of the macro. During +macro execution, the recursive edit gives you a chance to do some +particularized editing. *Note Recursive Edit::. + + +File: xemacs.info, Node: Key Bindings, Next: Syntax, Prev: Keyboard Macros, Up: Customization + +Customizing Key Bindings +======================== + + This section deals with the "keymaps" that define the bindings +between keys and functions, and shows how you can customize these +bindings. + + A command is a Lisp function whose definition provides for +interactive use. Like every Lisp function, a command has a function +name, which is a Lisp symbol whose name usually consists of lower case +letters and hyphens. + +* Menu: + +* Keymaps:: Definition of the keymap data structure. + Names of Emacs's standard keymaps. +* Rebinding:: How to redefine one key's meaning conveniently. +* Disabling:: Disabling a command means confirmation is required + before it can be executed. This is done to protect + beginners from surprises. + + +File: xemacs.info, Node: Keymaps, Next: Rebinding, Up: Key Bindings + +Keymaps +------- + + The bindings between characters and command functions are recorded in +data structures called "keymaps". Emacs has many of these. One, the +"global" keymap, defines the meanings of the single-character keys that +are defined regardless of major mode. It is the value of the variable +`global-map'. + + Each major mode has another keymap, its "local keymap", which +contains overriding definitions for the single-character keys that are +redefined in that mode. Each buffer records which local keymap is +installed for it at any time, and the current buffer's local keymap is +the only one that directly affects command execution. The local keymaps +for Lisp mode, C mode, and many other major modes always exist even when +not in use. They are the values of the variables `lisp-mode-map', +`c-mode-map', and so on. For less frequently used major modes, the +local keymap is sometimes constructed only when the mode is used for the +first time in a session, to save space. + + There are local keymaps for the minibuffer, too; they contain various +completion and exit commands. + + * `minibuffer-local-map' is used for ordinary input (no completion). + + * `minibuffer-local-ns-map' is similar, except that exits just + like . This is used mainly for Mocklisp compatibility. + + * `minibuffer-local-completion-map' is for permissive completion. + + * `minibuffer-local-must-match-map' is for strict completion and for + cautious completion. + + * `repeat-complex-command-map' is for use in `C-x '. + + * `isearch-mode-map' contains the bindings of the special keys which + are bound in the pseudo-mode entered with `C-s' and `C-r'. + + Finally, each prefix key has a keymap which defines the key sequences +that start with it. For example, `ctl-x-map' is the keymap used for +characters following a `C-x'. + + * `ctl-x-map' is the variable name for the map used for characters + that follow `C-x'. + + * `help-map' is used for characters that follow `C-h'. + + * `esc-map' is for characters that follow . All Meta characters + are actually defined by this map. + + * `ctl-x-4-map' is for characters that follow `C-x 4'. + + * `mode-specific-map' is for characters that follow `C-c'. + + The definition of a prefix key is the keymap to use for looking up +the following character. Sometimes the definition is actually a Lisp +symbol whose function definition is the following character keymap. The +effect is the same, but it provides a command name for the prefix key +that you can use as a description of what the prefix key is for. Thus +the binding of `C-x' is the symbol `Ctl-X-Prefix', whose function +definition is the keymap for `C-x' commands, the value of `ctl-x-map'. + + Prefix key definitions can appear in either the global map or a +local map. The definitions of `C-c', `C-x', `C-h', and as prefix +keys appear in the global map, so these prefix keys are always +available. Major modes can locally redefine a key as a prefix by +putting a prefix key definition for it in the local map. + + A mode can also put a prefix definition of a global prefix character +such as `C-x' into its local map. This is how major modes override the +definitions of certain keys that start with `C-x'. This case is +special, because the local definition does not entirely replace the +global one. When both the global and local definitions of a key are +other keymaps, the next character is looked up in both keymaps, with +the local definition overriding the global one. The character after the +`C-x' is looked up in both the major mode's own keymap for redefined +`C-x' commands and in `ctl-x-map'. If the major mode's own keymap for +`C-x' commands contains `nil', the definition from the global keymap +for `C-x' commands is used. + + +File: xemacs.info, Node: Rebinding, Next: Disabling, Prev: Keymaps, Up: Key Bindings + +Changing Key Bindings +--------------------- + + You can redefine an Emacs key by changing its entry in a keymap. +You can change the global keymap, in which case the change is effective +in all major modes except those that have their own overriding local +definitions for the same key. Or you can change the current buffer's +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 + + +File: xemacs.info, Node: Interactive Rebinding, Next: Programmatic Rebinding, Up: Rebinding + +Changing Key Bindings Interactively +................................... + +`M-x global-set-key KEY CMD ' + Defines KEY globally to run CMD. + +`M-x local-set-key KEYS CMD ' + Defines KEY locally (in the major mode now in effect) to run CMD. + +`M-x local-unset-key KEYS ' + Removes the local binding of KEY. + + CMD is a symbol naming an interactively-callable function. + + When called interactively, KEY is the next complete key sequence +that you type. When called as a function, KEY is a string, a vector of +events, or a vector of key-description lists as described in the +`define-key' function description. The binding goes in the current +buffer's local map, which is shared with other buffers in the same +major mode. + + The following example: + + M-x global-set-key C-f next-line + +redefines `C-f' to move down a line. The fact that CMD is read second +makes it serve as a kind of confirmation for KEY. + + These functions offer no way to specify a particular prefix keymap as +the one to redefine in, but that is not necessary, as you can include +prefixes in KEY. KEY is read by reading characters one by one until +they amount to a complete key (that is, not a prefix key). Thus, if +you type `C-f' for KEY, Emacs enters the minibuffer immediately to read +CMD. But if you type `C-x', another character is read; if that +character is `4', another character is read, and so on. For example, + + M-x global-set-key C-x 4 $ spell-other-window + +redefines `C-x 4 $' to run the (fictitious) command +`spell-other-window'. + + The most general way to modify a keymap is the function +`define-key', used in Lisp code (such as your `.emacs' file). +`define-key' takes three arguments: the keymap, the key to modify in +it, and the new definition. *Note Init File::, for an example. +`substitute-key-definition' is used similarly; it takes three +arguments, an old definition, a new definition, and a keymap, and +redefines in that keymap all keys that were previously defined with the +old definition to have the new definition instead. + + +File: xemacs.info, Node: Programmatic Rebinding, Next: Key Bindings Using Strings, Prev: Interactive Rebinding, Up: Rebinding + +Changing Key Bindings Programmatically +...................................... + + You can use the functions `global-set-key' and `define-key' to +rebind keys under program control. + +``(global-set-key KEYS CMD)'' + Defines KEYS globally to run CMD. + +``(define-key KEYMAP KEYS DEF)'' + Defines KEYS to run DEF in the keymap KEYMAP. + + KEYMAP is a keymap object. + + KEYS is the sequence of keystrokes to bind. + + DEF is anything that can be a key's definition: + + * `nil', meaning key is undefined in this keymap + + * A command, that is, a Lisp function suitable for interactive + calling + + * A string or key sequence vector, which is treated as a keyboard + macro + + * A keymap to define a prefix key + + * A symbol so that when the key is looked up, the symbol stands for + its function definition, which should at that time be one of the + above, or another symbol whose function definition is used, and so + on + + * A cons, `(string . defn)', meaning that DEFN is the definition + (DEFN should be a valid definition in its own right) + + * A cons, `(keymap . char)', meaning use the definition of CHAR in + map KEYMAP + + For backward compatibility, XEmacs allows you to specify key +sequences as strings. However, the preferred method is to use the +representations of key sequences as vectors of keystrokes. *Note +Keystrokes::, for more information about the rules for constructing key +sequences. + + Emacs allows you to abbreviate representations for key sequences in +most places where there is no ambiguity. Here are some rules for +abbreviation: + + * The keysym by itself is equivalent to a list of just that keysym, + i.e., `f1' is equivalent to `(f1)'. + + * A keystroke by itself is equivalent to a vector containing just + that keystroke, i.e., `(control a)' is equivalent to `[(control + a)]'. + + * You can use ASCII codes for keysyms that have them. i.e., `65' is + equivalent to `A'. (This is not so much an abbreviation as an + alternate representation.) + + Here are some examples of programmatically binding keys: + + + ;;; Bind `my-command' to + (global-set-key 'f1 'my-command) + + ;;; Bind `my-command' to Shift-f1 + (global-set-key '(shift f1) 'my-command) + + ;;; Bind `my-command' to C-c Shift-f1 + (global-set-key '[(control c) (shift f1)] 'my-command) + + ;;; Bind `my-command' to the middle mouse button. + (global-set-key 'button2 'my-command) + + ;;; Bind `my-command' to + ;;; in the keymap that is in force when you are running `dired'. + (define-key dired-mode-map '(meta control button3) 'my-command) + + +File: xemacs.info, Node: Key Bindings Using Strings, Prev: Programmatic Rebinding, Up: Rebinding + +Using Strings for Changing Key Bindings +....................................... + + For backward compatibility, you can still use strings to represent +key sequences. Thus you can use commands like the following: + + ;;; Bind `end-of-line' to C-f + (global-set-key "\C-f" 'end-of-line) + + Note, however, that in some cases you may be binding more than one +key sequence by using a single command. This situation can arise +because in ASCII, `C-i' and have the same representation. +Therefore, when Emacs sees: + + (global-set-key "\C-i" 'end-of-line) + + it is unclear whether the user intended to bind `C-i' or . The +solution XEmacs adopts is to bind both of these key sequences. + + After binding a command to two key sequences with a form like: + + (define-key global-map "\^X\^I" 'command-1) + + it is possible to redefine only one of those sequences like so: + + (define-key global-map [(control x) (control i)] 'command-2) + (define-key global-map [(control x) tab] 'command-3) + + This applies only when running under a window system. If you are +talking to Emacs through an ASCII-only channel, you do not get any of +these features. + + Here is a table of pairs of key sequences that behave in a similar +fashion: + + control h backspace + control l clear + control i tab + control m return + control j linefeed + control [ escape + control @ control space + + +File: xemacs.info, Node: Disabling, Prev: Rebinding, Up: Key Bindings + +Disabling Commands +------------------ + + Disabling a command marks it as requiring confirmation before it can +be executed. The purpose of disabling a command is to prevent +beginning users from executing it by accident and being confused. + + The direct mechanism for disabling a command is to have a non-`nil' +`disabled' property on the Lisp symbol for the command. These +properties are normally set by the user's `.emacs' file with Lisp +expressions such as: + + (put 'delete-region 'disabled t) + + If the value of the `disabled' property is a string, that string is +included in the message printed when the command is used: + + (put 'delete-region 'disabled + "Text deleted this way cannot be yanked back!\n") + + You can disable a command either by editing the `.emacs' file +directly or with the command `M-x disable-command', which edits the +`.emacs' file for you. *Note Init File::. + + When you attempt to invoke a disabled command interactively in Emacs, +a window is displayed containing the command's name, its documentation, +and some instructions on what to do next; then Emacs asks for input +saying whether to execute the command as requested, 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 `.emacs' file. +You can use `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 +invoke it; it also applies if the command is invoked using `M-x'. +Disabling a command has no effect on calling it as a function from Lisp +programs. + + +File: xemacs.info, Node: Syntax, Next: Init File, Prev: Key Bindings, Up: Customization + +The Syntax Table +================ + + All the Emacs commands which parse words or balance parentheses are +controlled by the "syntax table". The syntax table specifies which +characters are opening delimiters, which are parts of words, which are +string quotes, and so on. Actually, each major mode has its own syntax +table (though sometimes related major modes use the same one) which it +installs in each buffer that uses that major mode. The syntax table +installed in the current buffer is the one that all commands use, so we +call it "the" syntax table. A syntax table is a Lisp object, a vector +of length 256 whose elements are numbers. + +* Menu: + +* Entry: Syntax Entry. What the syntax table records for each character. +* Change: Syntax Change. How to change the information. + + +File: xemacs.info, Node: Syntax Entry, Next: Syntax Change, Up: Syntax + +Information About Each Character +-------------------------------- + + The syntax table entry for a character is a number that encodes six +pieces of information: + + * The syntactic class of the character, represented as a small + integer + + * The matching delimiter, for delimiter characters only (the + matching delimiter of `(' is `)', and vice versa) + + * A flag saying whether the character is the first character of a + two-character comment starting sequence + + * A flag saying whether the character is the second character of a + two-character comment starting sequence + + * A flag saying whether the character is the first character of a + two-character comment ending sequence + + * A flag saying whether the character is the second character of a + two-character comment ending sequence + + The syntactic classes are stored internally as small integers, but +are usually described to or by the user with characters. For example, +`(' is used to specify the syntactic class of opening delimiters. Here +is a table of syntactic classes, with the characters that specify them. + +` ' + The class of whitespace characters. + +`w' + The class of word-constituent characters. + +`_' + The class of characters that are part of symbol names but not + words. This class is represented by `_' because the character `_' + has this class in both C and Lisp. + +`.' + The class of punctuation characters that do not fit into any other + special class. + +`(' + The class of opening delimiters. + +`)' + The class of closing delimiters. + +`'' + The class of expression-adhering characters. These characters are + part of a symbol if found within or adjacent to one, and are part + of a following expression if immediately preceding one, but are + like whitespace if surrounded by whitespace. + +`"' + The class of string-quote characters. They match each other in + pairs, and the characters within the pair all lose their syntactic + significance except for the `\' and `/' classes of escape + characters, which can be used to include a string-quote inside the + string. + +`$' + The class of self-matching delimiters. This is intended for TeX's + `$', which is used both to enter and leave math mode. Thus, a + pair of matching `$' characters surround each piece of math mode + TeX input. A pair of adjacent `$' characters act like a single + one for purposes of matching. + +`/' + The class of escape characters that always just deny the following + character its special syntactic significance. The character after + one of these escapes is always treated as alphabetic. + +`\' + The class of C-style escape characters. In practice, these are + treated just like `/'-class characters, because the extra + possibilities for C escapes (such as being followed by digits) + have no effect on where the containing expression ends. + +`<' + The class of comment-starting characters. Only single-character + comment starters (such as `;' in Lisp mode) are represented this + way. + +`>' + The class of comment-ending characters. Newline has this syntax in + Lisp mode. + + The characters flagged as part of two-character comment delimiters +can have other syntactic functions most of the time. For example, `/' +and `*' in C code, when found separately, have nothing to do with +comments. The comment-delimiter significance overrides when the pair of +characters occur together in the proper order. Only the list and sexp +commands use the syntax table to find comments; the commands +specifically for comments have other variables that tell them where to +find comments. Moreover, the list and sexp commands notice comments +only if `parse-sexp-ignore-comments' is non-`nil'. This variable is set +to `nil' in modes where comment-terminator sequences are liable to +appear where there is no comment, for example, in Lisp mode where the +comment terminator is a newline but not every newline ends a comment. + + +File: xemacs.info, Node: Syntax Change, Prev: Syntax Entry, Up: Syntax + +Altering Syntax Information +--------------------------- + + It is possible to alter a character's syntax table entry by storing +a new number in the appropriate element of the syntax table, but it +would be hard to determine what number to use. Emacs therefore +provides a command that allows you to specify the syntactic properties +of a character in a convenient way. + + `M-x modify-syntax-entry' is the command to change a character's +syntax. It can be used interactively and is also used by major modes +to initialize their own syntax tables. Its first argument is the +character to change. The second argument is a string that specifies the +new syntax. When called from Lisp code, there is a third, optional +argument, which specifies the syntax table in which to make the change. +If not supplied, or if this command is called interactively, the third +argument defaults to the current buffer's syntax table. + + 1. The first character in the string specifies the syntactic class. + It is one of the characters in the previous table (*note Syntax + Entry::.). + + 2. The second character is the matching delimiter. For a character + that is not an opening or closing delimiter, this should be a + space, and may be omitted if no following characters are needed. + + 3. The remaining characters are flags. The flag characters allowed + are: + + `1' + Flag this character as the first of a two-character comment + starting sequence. + + `2' + Flag this character as the second of a two-character comment + starting sequence. + + `3' + Flag this character as the first of a two-character comment + ending sequence. + + `4' + Flag this character as the second of a two-character comment + ending sequence. + + Use `C-h s' (`describe-syntax') to display a description of the +contents of the current syntax table. The description of each +character includes both the string you have to pass to +`modify-syntax-entry' to set up that character's current syntax, and +some English to explain that string if necessary. + diff --git a/info/xemacs.info-17 b/info/xemacs.info-17 new file mode 100644 index 0000000..375032b --- /dev/null +++ b/info/xemacs.info-17 @@ -0,0 +1,1138 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Init File, Next: Audible Bell, Prev: Syntax, Up: Customization + +The Init File, .emacs +===================== + + When you start Emacs, it normally loads the file `.emacs' in your +home directory. This file, if it exists, should contain Lisp code. It +is called your initialization file or "init file". Use the command +line switch `-q' to tell Emacs whether to load an init file (*note +Entering Emacs::.). Use the command line switch `-user-init-file' +(*note Command Switches::.) to tell Emacs to load a different file +instead of `~/.emacs'. + + When the `.emacs' file is read, the variable `user-init-file' says +which init file was loaded. + + At some sites there is a "default init file", which is the library +named `default.el', found via the standard search path for libraries. +The Emacs distribution contains no such library; your site may create +one for local customizations. If this library exists, it is loaded +whenever you start Emacs. But your init file, if any, is loaded first; +if it sets `inhibit-default-init' non-`nil', then `default' is not +loaded. + + If you have a large amount of code in your `.emacs' file, you should +move it into another file named `SOMETHING.el', byte-compile it (*note +Lisp Libraries::.), and load that file from your `.emacs' file using +`load'. + +* Menu: + +* Init Syntax:: Syntax of constants in Emacs Lisp. +* Init Examples:: How to do some things with an init file. +* Terminal Init:: Each terminal type can have an init file. + + +File: xemacs.info, Node: Init Syntax, Next: Init Examples, Up: Init File + +Init File Syntax +---------------- + + The `.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, `(setq fill-column 60)' +represents a call to the function `setq' which is used to set the +variable `fill-column' (*note Filling::.) to 60. + + The second argument to `setq' is an expression for the new value of +the variable. This can be a constant, a variable, or a function call +expression. In `.emacs', constants are used most of the time. They +can be: + +Numbers + Integers are written in decimal, with an optional initial minus + sign. + + If a sequence of digits is followed by a period and another + sequence of digits, it is interpreted as a floating point number. + + The number prefixes `#b', `#o', and `#x' are supported to + represent numbers in binary, octal, and hexadecimal notation (or + radix). + +Strings + Lisp string syntax is the same as C string syntax with a few extra + features. Use a double-quote character to begin and end a string + constant. + + Newlines and special characters may be present literally in + strings. They can also be represented as backslash sequences: + `\n' for newline, `\b' for backspace, `\r' for return, `\t' for + tab, `\f' for formfeed (control-l), `\e' for escape, `\\' for a + backslash, `\"' for a double-quote, or `\OOO' for the character + whose octal code is OOO. Backslash and double-quote are the only + characters for which backslash sequences are mandatory. + + You can use `\C-' as a prefix for a control character, as in + `\C-s' for ASCII Control-S, and `\M-' as a prefix for a Meta + character, as in `\M-a' for Meta-A or `\M-\C-a' for Control-Meta-A. + +Characters + Lisp character constant syntax consists of a `?' followed by + either a character or an escape sequence starting with `\'. + Examples: `?x', `?\n', `?\"', `?\)'. Note that strings and + characters are not interchangeable in Lisp; some contexts require + one and some contexts require the other. + +True + `t' stands for `true'. + +False + `nil' stands for `false'. + +Other Lisp objects + Write a single-quote (') followed by the Lisp object you want. + + +File: xemacs.info, Node: Init Examples, Next: Terminal Init, Prev: Init Syntax, Up: Init File + +Init File Examples +------------------ + + Here are some examples of doing certain commonly desired things with +Lisp expressions: + + * Make in C mode just insert a tab if point is in the middle + of a line. + + (setq c-tab-always-indent nil) + + Here we have a variable whose value is normally `t' for `true' and + the alternative is `nil' for `false'. + + * Make searches case sensitive by default (in all buffers that do not + override this). + + (setq-default case-fold-search nil) + + This sets the default value, which is effective in all buffers + that do not have local values for the variable. Setting + `case-fold-search' with `setq' affects only the current buffer's + local value, which is probably not what you want to do in an init + file. + + * Make Text mode the default mode for new buffers. + + (setq default-major-mode 'text-mode) + + Note that `text-mode' is used because it is the command for + entering the mode we want. A single-quote is written before it to + make a symbol constant; otherwise, `text-mode' would be treated as + a variable name. + + * Turn on Auto Fill mode automatically in Text mode and related + modes. + + (setq text-mode-hook + '(lambda () (auto-fill-mode 1))) + + Here we have a variable whose value should be a Lisp function. The + function we supply is a list starting with `lambda', and a single + quote is written in front of it to make it (for the purpose of this + `setq') a list constant rather than an expression. Lisp functions + are not explained here; for mode hooks it is enough to know that + `(auto-fill-mode 1)' is an expression that will be executed when + Text mode is entered. You could replace it with any other + expression that you like, or with several expressions in a row. + + (setq text-mode-hook 'turn-on-auto-fill) + + This is another way to accomplish the same result. + `turn-on-auto-fill' is a symbol whose function definition is + `(lambda () (auto-fill-mode 1))'. + + * Load the installed Lisp library named `foo' (actually a file + `foo.elc' or `foo.el' in a standard Emacs directory). + + (load "foo") + + When the argument to `load' is a relative pathname, not starting + with `/' or `~', `load' searches the directories in `load-path' + (*note Loading::.). + + * Load the compiled Lisp file `foo.elc' from your home directory. + + (load "~/foo.elc") + + Here an absolute file name is used, so no searching is done. + + * Rebind the key `C-x l' to run the function `make-symbolic-link'. + + (global-set-key "\C-xl" 'make-symbolic-link) + + or + + (define-key global-map "\C-xl" 'make-symbolic-link) + + Note once again the single-quote used to refer to the symbol + `make-symbolic-link' instead of its value as a variable. + + * Do the same thing for C mode only. + + (define-key c-mode-map "\C-xl" 'make-symbolic-link) + + * Bind the function key to a command in C mode. Note that the + names of function keys must be lower case. + + (define-key c-mode-map 'f1 'make-symbolic-link) + + * Bind the shifted version of to a command. + + (define-key c-mode-map '(shift f1) 'make-symbolic-link) + + * Redefine all keys which now run `next-line' in Fundamental mode to + run `forward-line' instead. + + (substitute-key-definition 'next-line 'forward-line + global-map) + + * Make `C-x C-v' undefined. + + (global-unset-key "\C-x\C-v") + + One reason to undefine a key is so that you can make it a prefix. + Simply defining `C-x C-v ANYTHING' would make `C-x C-v' a prefix, + but `C-x C-v' must be freed of any non-prefix definition first. + + * Make `$' have the syntax of punctuation in Text mode. Note the + use of a character constant for `$'. + + (modify-syntax-entry ?\$ "." text-mode-syntax-table) + + * Enable the use of the command `eval-expression' without + confirmation. + + (put 'eval-expression 'disabled nil) + + +File: xemacs.info, Node: Terminal Init, Prev: Init Examples, Up: Init File + +Terminal-Specific Initialization +-------------------------------- + + Each terminal type can have a Lisp library to be loaded into Emacs +when it is run on that type of terminal. For a terminal type named +TERMTYPE, the library is called `term/TERMTYPE' and it is found by +searching the directories `load-path' as usual and trying the suffixes +`.elc' and `.el'. Normally it appears in the subdirectory `term' of +the directory where most Emacs libraries are kept. + + The usual purpose of the terminal-specific library is to define the +escape sequences used by the terminal's function keys using the library +`keypad.el'. See the file `term/vt100.el' for an example of how this +is done. + + When the terminal type contains a hyphen, only the part of the name +before the first hyphen is significant in choosing the library name. +Thus, terminal types `aaa-48' and `aaa-30-rv' both use the library +`term/aaa'. The code in the library can use `(getenv "TERM")' to find +the full terminal type name. + + The library's name is constructed by concatenating the value of the +variable `term-file-prefix' and the terminal type. Your `.emacs' file +can prevent the loading of the terminal-specific library by setting +`term-file-prefix' to `nil'. + + The value of the variable `term-setup-hook', if not `nil', is called +as a function of no arguments at the end of Emacs initialization, after +both your `.emacs' file and any terminal-specific library have been +read. You can set the value in the `.emacs' file to override part of +any of the terminal-specific libraries and to define initializations +for terminals that do not have a library. + + +File: xemacs.info, Node: Audible Bell, Next: Faces, Prev: Init File, Up: Customization + +Changing the Bell Sound +======================= + + You can now change how the audible bell sounds using the variable +`sound-alist'. + + `sound-alist''s value is an list associating symbols with, among +other things, strings of audio-data. When `ding' is called with one of +the symbols, the associated sound data is played instead of the +standard beep. This only works if you are logged in on the console of a +machine with audio hardware. To listen to a sound of the provided type, +call the function `play-sound' with the argument SOUND. You can also +set the volume of the sound with the optional argument VOLUME. + + Each element of `sound-alist' is a list describing a sound. The +first element of the list is the name of the sound being defined. +Subsequent elements of the list are alternating keyword/value pairs: + +`sound' + A string of raw sound data, or the name of another sound to play. + The symbol `t' here means use the default X beep. + +`volume' + An integer from 0-100, defaulting to `bell-volume'. + +`pitch' + If using the default X beep, the pitch (Hz) to generate. + +`duration' + If using the default X beep, the duration (milliseconds). + + For compatibility, elements of `sound-alist' may also be of the form: + + ( SOUND-NAME . ) + ( SOUND-NAME ) + + You should probably add things to this list by calling the function +`load-sound-file'. + + Note that you can only play audio data if running on the console +screen of a machine with audio hardware which emacs understands, which +at this time means a Sun SparcStation, SGI, or HP9000s700. + + Also note that the pitch, duration, and volume options are available +everywhere, but most X servers ignore the `pitch' option. + + The variable `bell-volume' should be an integer from 0 to 100, with +100 being loudest, which controls how loud the sounds emacs makes +should be. Elements of the `sound-alist' may override this value. +This variable applies to the standard X bell sound as well as sound +files. + + If the symbol `t' is in place of a sound-string, Emacs uses the +default X beep. This allows you to define beep-types of different +volumes even when not running on the console. + + You can add things to this list by calling the function +`load-sound-file', which reads in an audio-file and adds its data to +the sound-alist. You can specify the sound with the SOUND-NAME argument +and the file into which the sounds are loaded with the FILENAME +argument. The optional VOLUME argument sets the volume. + + `load-sound-file (FILENAME SOUND-NAME &optional VOLUME)' + + To load and install some sound files as beep-types, use the function +`load-default-sounds' (note that this only works if you are on display +0 of a machine with audio hardware). + + The following beep-types are used by Emacs itself. Other Lisp +packages may use other beep types, but these are the ones that the C +kernel of Emacs uses. + +`auto-save-error' + An auto-save does not succeed + +`command-error' + The Emacs command loop catches an error + +`undefined-key' + You type a key that is undefined + +`undefined-click' + You use an undefined mouse-click combination + +`no-completion' + Completion was not possible + +`y-or-n-p' + You type something other than the required `y' or `n' + +`yes-or-no-p' + You type something other than `yes' or `no' + + +File: xemacs.info, Node: Faces, Next: X Resources, Prev: Audible Bell, Up: Customization + +Faces +===== + + XEmacs has objects called extents and faces. An "extent" is a +region of text and a "face" is a collection of textual attributes, such +as fonts and colors. Every extent is displayed in some face; +therefore, changing the properties of a face immediately updates the +display of all associated extents. Faces can be frame-local: you can +have a region of text that displays with completely different +attributes when its buffer is viewed from a different X window. + + The display attributes of faces may be specified either in Lisp or +through the X resource manager. + +Customizing Faces +----------------- + + You can change the face of an extent with the functions in this +section. All the functions prompt for a FACE as an argument; use +completion for a list of possible values. + +`M-x invert-face' + Swap the foreground and background colors of the given FACE. + +`M-x make-face-bold' + Make the font of the given FACE bold. When called from a program, + returns `nil' if this is not possible. + +`M-x make-face-bold-italic' + Make the font of the given FACE bold italic. When called from a + program, returns `nil' if not possible. + +`M-x make-face-italic' + Make the font of the given FACE italic. When called from a + program, returns `nil' if not possible. + +`M-x make-face-unbold' + Make the font of the given FACE non-bold. When called from a + program, returns `nil' if not possible. + +`M-x make-face-unitalic' + Make the font of the given FACE non-italic. When called from a + program, returns `nil' if not possible. + +`M-x make-face-larger' + Make the font of the given FACE a little larger. When called from + a program, returns `nil' if not possible. + +`M-x make-face-smaller' + Make the font of the given FACE a little smaller. When called + from a program, returns `nil' if not possible. + +`M-x set-face-background' + Change the background color of the given FACE. + +`M-x set-face-background-pixmap' + Change the background pixmap of the given FACE. + +`M-x set-face-font' + Change the font of the given FACE. + +`M-x set-face-foreground' + Change the foreground color of the given FACE. + +`M-x set-face-underline-p' + Change whether the given FACE is underlined. + + You can exchange the foreground and background color of the selected +FACE with the function `invert-face'. If the face does not specify both +foreground and background, then its foreground and background are set +to the background and foreground of the default face. When calling +this from a program, you can supply the optional argument FRAME to +specify which frame is affected; otherwise, all frames are affected. + + You can set the background color of the specified FACE with the +function `set-face-background'. The argument `color' should be a +string, the name of a color. When called from a program, if the +optional FRAME argument is provided, the face is changed only in that +frame; otherwise, it is changed in all frames. + + You can set the background pixmap of the specified FACE with the +function `set-face-background-pixmap'. The pixmap argument NAME should +be a string, the name of a file of pixmap data. The directories listed +in the `x-bitmap-file-path' variable are searched. The bitmap may also +be a list of the form `(WIDTH HEIGHT DATA)', where WIDTH and HEIGHT are +the size in pixels, and DATA is a string containing the raw bits of the +bitmap. If the optional FRAME argument is provided, the face is +changed only in that frame; otherwise, it is changed in all frames. + + The variable `x-bitmap-file-path' takes as a value a list of the +directories in which X bitmap files may be found. If the value is +`nil', the list is initialized from the `*bitmapFilePath' resource. + + If the environment variable XBMLANGPATH is set, then it is consulted +before the `x-bitmap-file-path' variable. + + You can set the font of the specified FACE with the function +`set-face-font'. The FONT argument should be a string, the name of a +font. When called from a program, if the optional FRAME argument is +provided, the face is changed only in that frame; otherwise, it is +changed in all frames. + + You can set the foreground color of the specified FACE with the +function `set-face-foreground'. The argument COLOR should be a string, +the name of a color. If the optional FRAME argument is provided, the +face is changed only in that frame; otherwise, it is changed in all +frames. + + You can set underline the specified FACE with the function +`set-face-underline-p'. The argument UNDERLINE-P can be used to make +underlining an attribute of the face or not. If the optional FRAME +argument is provided, the face is changed only in that frame; +otherwise, it is changed in all frames. + + +File: xemacs.info, Node: X Resources, Prev: Faces, Up: Customization + +X Resources +=========== + + Historically, XEmacs has used the X resource application class +`Emacs' for its resources. Unfortunately, GNU Emacs uses the same +application class, and resources are not compatible between the two +Emacsen. This sharing of the application class often leads to trouble +if you want to run both variants. + + Starting with XEmacs 21, XEmacs uses the class `XEmacs' if it finds +any XEmacs resources in the resource database when the X connection is +initialized. Otherwise, it will use the class `Emacs' for backwards +compatability. The variable X-EMACS-APPLICATION-CLASS may be consulted +to determine the application class being used. + + The examples in this section assume the application class is `Emacs'. + + The Emacs resources are generally set per-frame. Each Emacs frame +can have its own name or the same name as another, depending on the +name passed to the `make-frame' function. + + You can specify resources for all frames with the syntax: + + Emacs*parameter: value + +or + + Emacs*EmacsFrame.parameter:value + +You can specify resources for a particular frame with the syntax: + + Emacs*FRAME-NAME.parameter: value + +* 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. + + +File: xemacs.info, Node: Geometry Resources, Next: Iconic Resources, Up: X Resources + +Geometry Resources +------------------ + + To make the default size of all Emacs frames be 80 columns by 55 +lines, do this: + + Emacs*EmacsFrame.geometry: 80x55 + +To set the geometry of a particular frame named `fred', do this: + + Emacs*fred.geometry: 80x55 + +Important! Do not use the following syntax: + + Emacs*geometry: 80x55 + +You should never use `*geometry' with any X application. It does not +say "make the geometry of Emacs be 80 columns by 55 lines." It really +says, "make Emacs and all subwindows thereof be 80x55 in whatever units +they care to measure in." In particular, that is both telling the +Emacs text pane to be 80x55 in characters, and telling the menubar pane +to be 80x55 pixels, which is surely not what you want. + + As a special case, this geometry specification also works (and sets +the default size of all Emacs frames to 80 columns by 55 lines): + + Emacs.geometry: 80x55 + +since that is the syntax used with most other applications (since most +other applications have only one top-level window, unlike Emacs). In +general, however, the top-level shell (the unmapped ApplicationShell +widget named `Emacs' that is the parent of the shell widgets that +actually manage the individual frames) does not have any interesting +resources on it, and you should set the resources on the frames instead. + + The `-geometry' command-line argument sets only the geometry of the +initial frame created by Emacs. + + A more complete explanation of geometry-handling is + + * The `-geometry' command-line option sets the `Emacs.geometry' + resource, that is, the geometry of the ApplicationShell. + + * For the first frame created, the size of the frame is taken from + the ApplicationShell if it is specified, otherwise from the + geometry of the frame. + + * For subsequent frames, the order is reversed: First the frame, and + then the ApplicationShell. + + * For the first frame created, the position of the frame is taken + from the ApplicationShell (`Emacs.geometry') if it is specified, + otherwise from the geometry of the frame. + + * For subsequent frames, the position is taken only from the frame, + and never from the ApplicationShell. + + This is rather complicated, but it does seem to provide the most +intuitive behavior with respect to the default sizes and positions of +frames created in various ways. + + +File: xemacs.info, Node: Iconic Resources, Next: Resource List, Prev: Geometry Resources, Up: X Resources + +Iconic Resources +---------------- + + Analogous to `-geometry', the `-iconic' command-line option sets the +iconic flag of the ApplicationShell (`Emacs.iconic') and always applies +to the first frame created regardless of its name. However, it is +possible to set the iconic flag on particular frames (by name) by using +the `Emacs*FRAME-NAME.iconic' resource. + + +File: xemacs.info, Node: Resource List, Next: Face Resources, Prev: Iconic Resources, Up: X Resources + +Resource List +------------- + + Emacs frames accept the following resources: + +`geometry' (class `Geometry'): string + Initial geometry for the frame. *Note Geometry Resources::, for a + complete discussion of how this works. + +`iconic' (class `Iconic'): boolean + Whether this frame should appear in the iconified state. + +`internalBorderWidth' (class `InternalBorderWidth'): int + How many blank pixels to leave between the text and the edge of the + window. + +`interline' (class `Interline'): int + How many pixels to leave between each line (may not be + implemented). + +`menubar' (class `Menubar'): boolean + Whether newly-created frames should initially have a menubar. Set + to true by default. + +`initiallyUnmapped' (class `InitiallyUnmapped'): boolean + Whether XEmacs should leave the initial frame unmapped when it + starts up. This is useful if you are starting XEmacs as a server + (e.g. in conjunction with gnuserv or the external client widget). + You can also control this with the `-unmapped' command-line option. + +`barCursor' (class `BarColor'): boolean + Whether the cursor should be displayed as a bar, or the + traditional box. + +`cursorColor' (class `CursorColor'): color-name + The color of the text cursor. + +`scrollBarWidth' (class `ScrollBarWidth'): integer + How wide the vertical scrollbars should be, in pixels; 0 means no + vertical scrollbars. You can also use a resource specification of + the form `*scrollbar.width', or the usual toolkit scrollbar + resources: `*XmScrollBar.width' (Motif), `*XlwScrollBar.width' + (Lucid), or `*Scrollbar.thickness' (Athena). We don't recommend + that you use the toolkit resources, though, because they're + dependent on how exactly your particular build of XEmacs was + configured. + +`scrollBarHeight' (class `ScrollBarHeight'): integer + How high the horizontal scrollbars should be, in pixels; 0 means no + horizontal scrollbars. You can also use a resource specification + of the form `*scrollbar.height', or the usual toolkit scrollbar + resources: `*XmScrollBar.height' (Motif), `*XlwScrollBar.height' + (Lucid), or `*Scrollbar.thickness' (Athena). We don't recommend + that you use the toolkit resources, though, because they're + dependent on how exactly your particular build of XEmacs was + configured. + +`scrollBarPlacement' (class `ScrollBarPlacement'): string + Where the horizontal and vertical scrollbars should be positioned. + This should be one of the four strings `BOTTOM_LEFT', + `BOTTOM_RIGHT', `TOP_LEFT', and `TOP_RIGHT'. Default is + `BOTTOM_RIGHT' for the Motif and Lucid scrollbars and + `BOTTOM_LEFT' for the Athena scrollbars. + +`topToolBarHeight' (class `TopToolBarHeight'): integer +`bottomToolBarHeight' (class `BottomToolBarHeight'): integer +`leftToolBarWidth' (class `LeftToolBarWidth'): integer +`rightToolBarWidth' (class `RightToolBarWidth'): integer + Height and width of the four possible toolbars. + +`topToolBarShadowColor' (class `TopToolBarShadowColor'): color-name +`bottomToolBarShadowColor' (class `BottomToolBarShadowColor'): color-name + Color of the top and bottom shadows for the toolbars. NOTE: These + resources do *not* have anything to do with the top and bottom + toolbars (i.e. the toolbars at the top and bottom of the frame)! + Rather, they affect the top and bottom shadows around the edges of + all four kinds of toolbars. + +`topToolBarShadowPixmap' (class `TopToolBarShadowPixmap'): pixmap-name +`bottomToolBarShadowPixmap' (class `BottomToolBarShadowPixmap'): pixmap-name + Pixmap of the top and bottom shadows for the toolbars. If set, + these resources override the corresponding color resources. NOTE: + These resources do *not* have anything to do with the top and + bottom toolbars (i.e. the toolbars at the top and bottom of the + frame)! Rather, they affect the top and bottom shadows around the + edges of all four kinds of toolbars. + +`toolBarShadowThickness' (class `ToolBarShadowThickness'): integer + Thickness of the shadows around the toolbars, in pixels. + +`visualBell' (class `VisualBell'): boolean + Whether XEmacs should flash the screen rather than making an + audible beep. + +`bellVolume' (class `BellVolume'): integer + Volume of the audible beep. + +`useBackingStore' (class `UseBackingStore'): boolean + Whether XEmacs should set the backing-store attribute of the X + windows it creates. This increases the memory usage of the X + server but decreases the amount of X traffic necessary to update + the screen, and is useful when the connection to the X server goes + over a low-bandwidth line such as a modem connection. + + Emacs devices accept the following resources: + +`textPointer' (class `Cursor'): cursor-name + The cursor to use when the mouse is over text. This resource is + used to initialize the variable `x-pointer-shape'. + +`selectionPointer' (class `Cursor'): cursor-name + The cursor to use when the mouse is over a selectable text region + (an extent with the `highlight' property; for example, an Info + cross-reference). This resource is used to initialize the variable + `x-selection-pointer-shape'. + +`spacePointer' (class `Cursor'): cursor-name + The cursor to use when the mouse is over a blank space in a buffer + (that is, after the end of a line or after the end-of-file). This + resource is used to initialize the variable + `x-nontext-pointer-shape'. + +`modeLinePointer' (class `Cursor'): cursor-name + The cursor to use when the mouse is over a modeline. This + resource is used to initialize the variable `x-mode-pointer-shape'. + +`gcPointer' (class `Cursor'): cursor-name + The cursor to display when a garbage-collection is in progress. + This resource is used to initialize the variable + `x-gc-pointer-shape'. + +`scrollbarPointer' (class `Cursor'): cursor-name + The cursor to use when the mouse is over the scrollbar. This + resource is used to initialize the variable + `x-scrollbar-pointer-shape'. + +`pointerColor' (class `Foreground'): color-name +`pointerBackground' (class `Background'): color-name + The foreground and background colors of the mouse cursor. These + resources are used to initialize the variables + `x-pointer-foreground-color' and `x-pointer-background-color'. + + +File: xemacs.info, Node: Face Resources, Next: Widgets, Prev: Resource List, Up: X Resources + +Face Resources +-------------- + + The attributes of faces are also per-frame. They can be specified as: + + Emacs.FACE_NAME.parameter: value + +or + + Emacs*FRAME_NAME.FACE_NAME.parameter: value + +Faces accept the following resources: + +`attributeFont' (class `AttributeFont'): font-name + The font of this face. + +`attributeForeground' (class `AttributeForeground'): color-name +`attributeBackground' (class `AttributeBackground'): color-name + The foreground and background colors of this face. + +`attributeBackgroundPixmap' (class `AttributeBackgroundPixmap'): file-name + The name of an XBM file (or XPM file, if your version of Emacs + supports XPM), to use as a background stipple. + +`attributeUnderline' (class `AttributeUnderline'): boolean + Whether text in this face should be underlined. + + All text is displayed in some face, defaulting to the face named +`default'. To set the font of normal text, use +`Emacs*default.attributeFont'. To set it in the frame named `fred', use +`Emacs*fred.default.attributeFont'. + + These are the names of the predefined faces: + +`default' + Everything inherits from this. + +`bold' + If this is not specified in the resource database, Emacs tries to + find a bold version of the font of the default face. + +`italic' + If this is not specified in the resource database, Emacs tries to + find an italic version of the font of the default face. + +`bold-italic' + If this is not specified in the resource database, Emacs tries to + find a bold-italic version of the font of the default face. + +`modeline' + This is the face that the modeline is displayed in. If not + specified in the resource database, it is determined from the + default face by reversing the foreground and background colors. + +`highlight' + This is the face that highlighted extents (for example, Info + cross-references and possible completions, when the mouse passes + over them) are displayed in. + +`left-margin' +`right-margin' + These are the faces that the left and right annotation margins are + displayed in. + +`zmacs-region' + This is the face that mouse selections are displayed in. + +`isearch' + This is the face that the matched text being searched for is + displayed in. + +`info-node' + This is the face of info menu items. If unspecified, it is copied + from `bold-italic'. + +`info-xref' + This is the face of info cross-references. If unspecified, it is + copied from `bold'. (Note that, when the mouse passes over a + cross-reference, the cross-reference's face is determined from a + combination of the `info-xref' and `highlight' faces.) + + Other packages might define their own faces; to see a list of all +faces, use any of the interactive face-manipulation commands such as +`set-face-font' and type `?' when you are prompted for the name of a +face. + + If the `bold', `italic', and `bold-italic' faces are not specified +in the resource database, then XEmacs attempts to derive them from the +font of the default face. It can only succeed at this if you have +specified the default font using the XLFD (X Logical Font Description) +format, which looks like + + *-courier-medium-r-*-*-*-120-*-*-*-*-*-* + +If you use any of the other, less strict font name formats, some of +which look like + + lucidasanstypewriter-12 + fixed + 9x13 + + then XEmacs won't be able to guess the names of the bold and italic +versions. All X fonts can be referred to via XLFD-style names, so you +should use those forms. See the man pages for `X(1)', `xlsfonts(1)', +and `xfontsel(1)'. + + +File: xemacs.info, Node: Widgets, Next: Menubar Resources, Prev: Face Resources, Up: X Resources + +Widgets +------- + + There are several structural widgets between the terminal EmacsFrame +widget and the top level ApplicationShell; the exact names and types of +these widgets change from release to release (for example, they changed +between 19.8 and 19.9, 19.9 and 19.10, and 19.10 and 19.12) and are +subject to further change in the future, so you should avoid mentioning +them in your resource database. The above-mentioned syntaxes should be +forward- compatible. As of 19.13, the exact widget hierarchy is as +follows: + + INVOCATION-NAME "shell" "container" FRAME-NAME + x-emacs-application-class "EmacsShell" "EmacsManager" "EmacsFrame" + + where INVOCATION-NAME is the terminal component of the name of the +XEmacs executable (usually `xemacs'), and `x-emacs-application-class' +is generally `Emacs'. + + +File: xemacs.info, Node: Menubar Resources, Prev: Widgets, Up: X Resources + +Menubar Resources +----------------- + + As the menubar is implemented as a widget which is not a part of +XEmacs proper, it does not use the fac" mechanism for specifying fonts +and colors: It uses whatever resources are appropriate to the type of +widget which is used to implement it. + + If Emacs was compiled to use only the Motif-lookalike menu widgets, +then one way to specify the font of the menubar would be + + Emacs*menubar*font: *-courier-medium-r-*-*-*-120-*-*-*-*-*-* + + If the Motif library is being used, then one would have to use + + Emacs*menubar*fontList: *-courier-medium-r-*-*-*-120-*-*-*-*-*-* + + because the Motif library uses the `fontList' resource name instead +of `font', which has subtly different semantics. + + The same is true of the scrollbars: They accept whichever resources +are appropriate for the toolkit in use. + + +File: xemacs.info, Node: Quitting, Next: Lossage, Prev: Customization, Up: Top + +Quitting and Aborting +===================== + +`C-g' + Quit. Cancel running or partially typed command. + +`C-]' + Abort innermost recursive editing level and cancel the command + which invoked it (`abort-recursive-edit'). + +`M-x top-level' + Abort all recursive editing levels that are currently executing. + +`C-x u' + Cancel an already-executed command, usually (`undo'). + + There are two ways of cancelling commands which are not finished +executing: "quitting" with `C-g', and "aborting" with `C-]' or `M-x +top-level'. Quitting is cancelling a partially typed command or one +which is already running. Aborting is getting out of a recursive +editing level and cancelling the command that invoked the recursive +edit. + + Quitting with `C-g' is used for getting rid of a partially typed +command or a numeric argument that you don't want. It also stops a +running command in the middle in a relatively safe way, so you can use +it if you accidentally start executing a command that takes a long +time. In particular, it is safe to quit out of killing; either your +text will ALL still be there, or it will ALL be in the kill ring (or +maybe both). Quitting an incremental search does special things +documented under searching; in general, it may take two successive +`C-g' characters to get out of a search. `C-g' works by setting the +variable `quit-flag' to `t' the instant `C-g' is typed; Emacs Lisp +checks this variable frequently and quits if it is non-`nil'. `C-g' is +only actually executed as a command if it is typed while Emacs is +waiting for input. + + If you quit twice in a row before the first `C-g' is recognized, you +activate the "emergency escape" feature and return to the shell. *Note +Emergency Escape::. + + You can use `C-]' (`abort-recursive-edit') to get out of a recursive +editing level and cancel the command which invoked it. Quitting with +`C-g' does not do this, and could not do this because it is used to +cancel a partially typed command within the recursive editing level. +Both operations are useful. For example, if you are in the Emacs +debugger (*note Lisp Debug::.) and have typed `C-u 8' to enter a +numeric argument, you can cancel that argument with `C-g' and remain in +the debugger. + + The command `M-x top-level' is equivalent to "enough" `C-]' commands +to get you out of all the levels of recursive edits that you are in. +`C-]' only gets you out one level at a time, but `M-x top-level' goes +out all levels at once. Both `C-]' and `M-x top-level' are like all +other commands and unlike `C-g' in that they are effective only when +Emacs is ready for a command. `C-]' is an ordinary key and has its +meaning only because of its binding in the keymap. *Note Recursive +Edit::. + + `C-x u' (`undo') is not strictly speaking a way of cancelling a +command, but you can think of it as cancelling a command already +finished executing. *Note Undo::. + + +File: xemacs.info, Node: Lossage, Next: Bugs, Prev: Quitting, Up: Top + +Dealing With Emacs Trouble +========================== + + This section describes various conditions in which Emacs fails to +work, and how to recognize them and correct them. + +* Menu: + +* Stuck Recursive:: `[...]' in mode line around the parentheses. +* Screen Garbled:: Garbage on the screen. +* Text Garbled:: Garbage in the text. +* Unasked-for Search:: Spontaneous entry to incremental search. +* Emergency Escape:: Emergency escape-- + What to do if Emacs stops responding. +* Total Frustration:: When you are at your wits' end. + + +File: xemacs.info, Node: Stuck Recursive, Next: Screen Garbled, Prev: Lossage, Up: Lossage + +Recursive Editing Levels +------------------------ + + Recursive editing levels are important and useful features of Emacs, +but they can seem like malfunctions to the user who does not understand +them. + + If the mode line has square brackets `[...]' around the parentheses +that contain the names of the major and minor modes, you have entered a +recursive editing level. If you did not do this on purpose, or if you +don't understand what that means, you should just get out of the +recursive editing level. To do so, type `M-x top-level'. This is +called getting back to top level. *Note Recursive Edit::. + + +File: xemacs.info, Node: Screen Garbled, Next: Text Garbled, Prev: Stuck Recursive, Up: Lossage + +Garbage on the Screen +--------------------- + + If the data on the screen looks wrong, the first thing to do is see +whether the text is actually wrong. Type `C-l', to redisplay the +entire screen. If the text appears correct after this, the problem was +entirely in the previous screen update. + + Display updating problems often result from an incorrect termcap +entry for the terminal you are using. The file `etc/TERMS' in the Emacs +distribution gives the fixes for known problems of this sort. +`INSTALL' contains general advice for these problems in one of its +sections. Very likely there is simply insufficient padding for certain +display operations. To investigate the possibility that you have this +sort of problem, try Emacs on another terminal made by a different +manufacturer. If problems happen frequently on one kind of terminal but +not another kind, the real problem is likely to be a bad termcap entry, +though it could also be due to a bug in Emacs that appears for terminals +that have or lack specific features. + + +File: xemacs.info, Node: Text Garbled, Next: Unasked-for Search, Prev: Screen Garbled, Up: Lossage + +Garbage in the Text +------------------- + + If `C-l' shows that the text is wrong, try undoing the changes to it +using `C-x u' until it gets back to a state you consider correct. Also +try `C-h l' to find out what command you typed to produce the observed +results. + + If a large portion of text appears to be missing at the beginning or +end of the buffer, check for the word `Narrow' in the mode line. If it +appears, the text is still present, but marked off-limits. To make it +visible again, type `C-x n w'. *Note Narrowing::. + + +File: xemacs.info, Node: Unasked-for Search, Next: Emergency Escape, Prev: Text Garbled, Up: Lossage + +Spontaneous Entry to Incremental Search +--------------------------------------- + + If Emacs spontaneously displays `I-search:' at the bottom of the +screen, it means that the terminal is sending `C-s' and `C-q' according +to the poorly designed xon/xoff "flow control" protocol. You should +try to prevent this by putting the terminal in a mode where it will not +use flow control, or by giving it enough padding that it will never +send a `C-s'. If that cannot be done, you must tell Emacs to expect +flow control to be used, until you can get a properly designed terminal. + + Information on how to do these things can be found in the file +`INSTALL' in the Emacs distribution. + + +File: xemacs.info, Node: Emergency Escape, Next: Total Frustration, Prev: Unasked-for Search, Up: Lossage + +Emergency Escape +---------------- + + Because at times there have been bugs causing Emacs to loop without +checking `quit-flag', a special feature causes Emacs to be suspended +immediately if you type a second `C-g' while the flag is already set, +so you can always get out of XEmacs. Normally Emacs recognizes and +clears `quit-flag' (and quits!) quickly enough to prevent this from +happening. + + When you resume Emacs after a suspension caused by multiple `C-g', it +asks two questions before going back to what it had been doing: + + Auto-save? (y or n) + Abort (and dump core)? (y or n) + +Answer each one with `y' or `n' followed by . + + Saying `y' to `Auto-save?' causes immediate auto-saving of all +modified buffers in which auto-saving is enabled. + + Saying `y' to `Abort (and dump core)?' causes an illegal instruction +to be executed, dumping core. This is to enable a wizard to figure out +why Emacs was failing to quit in the first place. Execution does not +continue after a core dump. If you answer `n', execution does +continue. With luck, Emacs will ultimately check `quit-flag' and quit +normally. If not, and you type another `C-g', it is suspended again. + + If Emacs is not really hung, but is just being slow, you may invoke +the double `C-g' feature without really meaning to. In that case, +simply resume and answer `n' to both questions, and you will arrive at +your former state. Presumably the quit you requested will happen soon. + + The double-`C-g' feature may be turned off when Emacs is running +under a window system, since the window system always enables you to +kill Emacs or to create another window and run another program. + + +File: xemacs.info, Node: Total Frustration, Prev: Emergency Escape, Up: Lossage + +Help for Total Frustration +-------------------------- + + If using Emacs (or something else) becomes terribly frustrating and +none of the techniques described above solve the problem, Emacs can +still help you. + + First, if the Emacs you are using is not responding to commands, type +`C-g C-g' to get out of it and then start a new one. + + Second, type `M-x doctor '. + + The doctor will make you feel better. Each time you say something to +the doctor, you must end it by typing . This lets the +doctor know you are finished. + diff --git a/info/xemacs.info-18 b/info/xemacs.info-18 new file mode 100644 index 0000000..896c487 --- /dev/null +++ b/info/xemacs.info-18 @@ -0,0 +1,1002 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Bugs, Prev: Lossage, Up: Top + +Reporting Bugs +============== + + Sometimes you will encounter a bug in Emacs. Although we cannot +promise we can or will fix the bug, and we might not even agree that it +is a bug, we want to hear about bugs you encounter in case we do want +to fix them. + + To make it possible for us to fix a bug, you must report it. In +order to do so effectively, you must know when and how to do it. + +When Is There a Bug +------------------- + + If Emacs executes an illegal instruction, or dies with an operating +system error message that indicates a problem in the program (as +opposed to something like "disk full"), then it is certainly a bug. + + If Emacs updates the display in a way that does not correspond to +what is in the buffer, then it is certainly a bug. If a command seems +to do the wrong thing but the problem corrects itself if you type +`C-l', it is a case of incorrect display updating. + + Taking forever to complete a command can be a bug, but you must make +certain that it was really Emacs's fault. Some commands simply take a +long time. Type `C-g' and then `C-h l' to see whether the input Emacs +received was what you intended to type; if the input was such that you +KNOW it should have been processed quickly, report a bug. If you don't +know whether the command should take a long time, find out by looking +in the manual or by asking for assistance. + + If a command you are familiar with causes an Emacs error message in a +case where its usual definition ought to be reasonable, it is probably a +bug. + + If a command does the wrong thing, that is a bug. But be sure you +know for certain what it ought to have done. If you aren't familiar +with the command, or don't know for certain how the command is supposed +to work, then it might actually be working right. Rather than jumping +to conclusions, show the problem to someone who knows for certain. + + Finally, a command's intended definition may not be best for editing +with. This is a very important sort of problem, but it is also a +matter of judgment. Also, it is easy to come to such a conclusion out +of ignorance of some of the existing features. It is probably best not +to complain about such a problem until you have checked the +documentation in the usual ways, feel confident that you understand it, +and know for certain that what you want is not available. If you are +not sure what the command is supposed to do after a careful reading of +the manual, check the index and glossary for any terms that may be +unclear. If you still do not understand, this indicates a bug in the +manual. The manual's job is to make everything clear. It is just as +important to report documentation bugs as program bugs. + + If the online documentation string of a function or variable +disagrees with the manual, one of them must be wrong, so report the bug. + +How to Report a Bug +------------------- + + When you decide that there is a bug, it is important to report it +and to report it in a way which is useful. What is most useful is an +exact description of what commands you type, starting with the shell +command to run Emacs, until the problem happens. Always include the +version number of Emacs that you are using; type `M-x emacs-version' to +print this. + + The most important principle in reporting a bug is to report FACTS, +not hypotheses or categorizations. It is always easier to report the +facts, but people seem to prefer to strain to posit explanations and +report them instead. If the explanations are based on guesses about +how Emacs is implemented, they will be useless; we will have to try to +figure out what the facts must have been to lead to such speculations. +Sometimes this is impossible. But in any case, it is unnecessary work +for us. + + For example, suppose that you type `C-x C-f /glorp/baz.ugh ', +visiting a file which (you know) happens to be rather large, and Emacs +prints out `I feel pretty today'. The best way to report the bug is +with a sentence like the preceding one, because it gives all the facts +and nothing but the facts. + + Do not assume that the problem is due to the size of the file and +say, "When I visit a large file, Emacs prints out `I feel pretty +today'." This is what we mean by "guessing explanations". The problem +is just as likely to be due to the fact that there is a `z' in the file +name. If this is so, then when we got your report, we would try out +the problem with some "large file", probably with no `z' in its name, +and not find anything wrong. There is no way in the world that we +could guess that we should try visiting a file with a `z' in its name. + + Alternatively, the problem might be due to the fact that the file +starts with exactly 25 spaces. For this reason, you should make sure +that you inform us of the exact contents of any file that is needed to +reproduce the bug. What if the problem only occurs when you have typed +the `C-x a l' command previously? This is why we ask you to give the +exact sequence of characters you typed since starting to use Emacs. + + You should not even say "visit a file" instead of `C-x C-f' unless +you know that it makes no difference which visiting command is used. +Similarly, rather than saying "if I have three characters on the line," +say "after I type ` A B C C-p'," if that is the way you +entered the text. + + If you are not in Fundamental mode when the problem occurs, you +should say what mode you are in. + + If the manifestation of the bug is an Emacs error message, it is +important to report not just the text of the error message but a +backtrace showing how the Lisp program in Emacs arrived at the error. +To make the backtrace, you must execute the Lisp expression `(setq +debug-on-error t)' before the error happens (that is to say, you must +execute that expression and then make the bug happen). This causes the +Lisp debugger to run (*note Lisp Debug::.). The debugger's backtrace +can be copied as text into the bug report. This use of the debugger is +possible only if you know how to make the bug happen again. Do note +the error message the first time the bug happens, so if you can't make +it happen again, you can report at least that. + + Check whether any programs you have loaded into the Lisp world, +including your `.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 `.emacs' file (start Emacs +with the `-q' switch to prevent loading the init file). If the problem +does 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 not a bug in those programs by complaining to their +maintainers first. After they verify that they are using Emacs in a +way that is supposed to work, they should report the bug. + + If you can tell us a way to cause the problem without visiting any +files, please do so. This makes it much easier to debug. If you do +need files, make sure you arrange for us to see their exact contents. +For example, it can often matter whether there are spaces at the ends +of lines, or a newline after the last line in the buffer (nothing ought +to care whether the last line is terminated, but tell that to the bugs). + + The easy way to record the input to Emacs precisely is to write a +dribble file; execute the Lisp expression: + + (open-dribble-file "~/dribble") + +using `Meta-' or from the `*scratch*' buffer just after starting +Emacs. From then on, all Emacs input will be written in the specified +dribble file until the Emacs process is killed. + + For possible display bugs, it is important to report the terminal +type (the value of environment variable `TERM'), the complete termcap +entry for the terminal from `/etc/termcap' (since that file is not +identical on all machines), and the output that Emacs actually sent to +the terminal. The way to collect this output is to execute the Lisp +expression: + + (open-termscript "~/termscript") + +using `Meta-' or from the `*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 `.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. + + The newsgroup `comp.emacs.xemacs' may be used for bug reports, other +discussions and requests for assistance. + + If you don't have access to this newgroup, you can subscribe to the +mailing list version: the newsgroup is bidirectionally gatewayed into +the mailing list `xemacs@xemacs.org'. + + To be added or removed from this mailing list, send mail to +`xemacs-request@xemacs.org'. Do not send requests for addition to the +mailing list itself. + + The mailing lists and newsgroups are archived on our anonymous FTP +server, `ftp.xemacs.org', and at various other archive sites around the +net. You should also check the `FAQ' in `/pub/xemacs' on our anonymous +FTP server. It provides some introductory information and help for +initial configuration problems. + + +File: xemacs.info, Node: Glossary, Next: Manifesto, Prev: Intro, Up: Top + +Glossary +******** + +Abbrev + An abbrev is a text string which expands into a different text + string when present in the buffer. For example, you might define + a short word as an abbrev for a long phrase that you want to insert + frequently. *Note Abbrevs::. + +Aborting + Aborting means getting out of a recursive edit (q.v.). You can use + the commands `C-]' and `M-x top-level' for this. *Note Quitting::. + +Auto Fill mode + Auto Fill mode is a minor mode in which text you insert is + automatically broken into lines of fixed width. *Note Filling::. + +Auto Saving + Auto saving means that Emacs automatically stores the contents of + an Emacs buffer in a specially-named file so the information will + not be lost if the buffer is lost due to a system error or user + error. *Note Auto Save::. + +Backup File + A backup file records the contents that a file had before the + current editing session. Emacs creates backup files automatically + to help you track down or cancel changes you later regret. *Note + Backup::. + +Balance Parentheses + Emacs can balance parentheses manually or automatically. Manual + balancing is done by the commands to move over balanced expressions + (*note Lists::.). Automatic balancing is done by blinking the + parenthesis that matches one just inserted (*note Matching Parens: + Matching.). + +Bind + To bind a key is to change its binding (q.v.). *Note Rebinding::. + +Binding + A key gets its meaning in Emacs by having a binding which is a + command (q.v.), a Lisp function that is run when the key is typed. + *Note Binding: Commands. Customization often involves rebinding a + character to a different command function. The bindings of all + keys are recorded in the keymaps (q.v.). *Note Keymaps::. + +Blank Lines + Blank lines are lines that contain only whitespace. Emacs has + several commands for operating on the blank lines in a buffer. + +Buffer + The buffer is the basic editing unit; one buffer corresponds to one + piece of text being edited. You can have several buffers, but at + any time you are editing only one, the `selected' buffer, though + several buffers can be visible when you are using multiple + windows. *Note Buffers::. + +Buffer Selection History + Emacs keeps a buffer selection history which records how recently + each Emacs buffer was selected. Emacs uses this list when + choosing a buffer to select. *Note Buffers::. + +C- + `C' in the name of a character is an abbreviation for Control. + *Note C-: Keystrokes. + +C-M- + `C-M-' in the name of a character is an abbreviation for + Control-Meta. *Note C-M-: Keystrokes. + +Case Conversion + Case conversion means changing text from upper case to lower case + or vice versa. *Note Case::, for the commands for case conversion. + +Characters + Characters form the contents of an Emacs buffer; also, Emacs + commands are invoked by keys (q.v.), which are sequences of one or + more characters. *Note Keystrokes::. + +Command + A command is a Lisp function specially defined to be able to serve + as a key binding in Emacs. When you type a key (q.v.), Emacs + looks up its binding (q.v.) in the relevant keymaps (q.v.) to find + the command to run. *Note Commands::. + +Command Name + A command name is the name of a Lisp symbol which is a command + (*note Commands::.). You can invoke any command by its name using + `M-x' (*note M-x::.). + +Comments + A comment is text in a program which is intended only for the + people reading the program, and is marked specially so that it + will be ignored when the program is loaded or compiled. Emacs + offers special commands for creating, aligning, and killing + comments. *Note Comments::. + +Compilation + Compilation is the process of creating an executable program from + source code. Emacs has commands for compiling files of Emacs Lisp + code (*note Lisp Libraries::.) and programs in C and other + languages (*note Compilation::.). + +Complete Key + A complete key is a character or sequence of characters which, + when typed by the user, fully specifies one action to be performed + by Emacs. For example, `X' and `Control-f' and `Control-x m' are + keys. Keys derive their meanings from being bound (q.v.) to + commands (q.v.). Thus, `X' is conventionally bound to a command + to insert `X' in the buffer; `C-x m' is conventionally bound to a + command to begin composing a mail message. *Note Keystrokes::. + +Completion + When Emacs automatically fills an abbreviation for a name into the + entire name, that process is called completion. Completion is + done for minibuffer (q.v.) arguments when the set of possible + valid inputs is known; for example, on command names, buffer + names, and file names. Completion occurs when you type , + , or . *Note Completion::. + +Continuation Line + When a line of text is longer than the width of the frame, it + takes up more than one screen line when displayed. We say that the + text line is continued, and all screen lines used for it after the + first are called continuation lines. *Note Continuation: Basic. + +Control-Character + ASCII characters with octal codes 0 through 037, and also code + 0177, do not have graphic images assigned to them. These are the + control characters. Any control character can be typed by holding + down the key and typing some other character; some have + special keys on the keyboard. , , , , and + are all control characters. *Note Keystrokes::. + +Copyleft + A copyleft is a notice giving the public legal permission to + redistribute a program or other work of art. Copylefts are used + by leftists to enrich the public just as copyrights are used by + rightists to gain power over the public. + +Current Buffer + The current buffer in Emacs is the Emacs buffer on which most + editing commands operate. You can select any Emacs buffer as the + current one. *Note Buffers::. + +Current Line + The line point is on (*note Point::.). + +Current Paragraph + The paragraph that point is in. If point is between paragraphs, + the current paragraph is the one that follows point. *Note + Paragraphs::. + +Current Defun + The defun (q.v.) that point is in. If point is between defuns, the + current defun is the one that follows point. *Note Defuns::. + +Cursor + The cursor is the rectangle on the screen which indicates the + position called point (q.v.) at which insertion and deletion takes + place. The cursor is on or under the character that follows + point. Often people speak of `the cursor' when, strictly + speaking, they mean `point'. *Note Cursor: Basic. + +Customization + Customization is making minor changes in the way Emacs works. It + is often done by setting variables (*note Variables::.) or by + rebinding keys (*note Keymaps::.). + +Default Argument + The default for an argument is the value that is used if you do not + specify one. When Emacs prompts you in the minibuffer for an + argument, the default argument is used if you just type . + *Note Minibuffer::. + +Default Directory + When you specify a file name that does not start with `/' or `~', + it is interpreted relative to the current buffer's default + directory. *Note Default Directory: Minibuffer File. + +Defun + A defun is a list at the top level of parenthesis or bracket + structure in a program. It is so named because most such lists in + Lisp programs are calls to the Lisp function `defun'. *Note + Defuns::. + + + The character runs the command that deletes one character of + text. *Note DEL: Basic. + +Deletion + Deleting text means erasing it without saving it. Emacs deletes + text only when it is expected not to be worth saving (all + whitespace, or only one character). The alternative is killing + (q.v.). *Note Deletion: Killing. + +Deletion of Files + Deleting a file means removing it from the file system. *Note + Misc File Ops::. + +Deletion of Messages + Deleting a message means flagging it to be eliminated from your + mail file. Until the mail file is expunged, you can undo this by + undeleting the message. + +Deletion of Frames + When working under the multi-frame X-based version of XEmacs, you + can delete individual frames using the Close menu item from the + File menu. + +Deletion of Windows + When you delete a subwindow of an Emacs frame, you eliminate it + from the frame. Other windows expand to use up the space. The + deleted window can never come back, but no actual text is lost. + *Note Windows::. + +Directory + Files in the Unix file system are grouped into file directories. + *Note Directories: ListDir. + +Dired + Dired is the Emacs facility that displays the contents of a file + directory and allows you to "edit the directory", performing + operations on the files in the directory. *Note Dired::. + +Disabled Command + A disabled command is one that you may not run without special + confirmation. Commands are usually disabled because they are + confusing for beginning users. *Note Disabling::. + +Dribble File + A file into which Emacs writes all the characters that the user + types on the keyboard. Dribble files are used to make a record for + debugging Emacs bugs. Emacs does not make a dribble file unless + you tell it to. *Note Bugs::. + +Echo Area + The area at the bottom of the Emacs frame which is used for + echoing the arguments to commands, for asking questions, and for + printing brief messages (including error messages). *Note Echo + Area::. + +Echoing + Echoing refers to acknowledging the receipt of commands by + displaying them (in the echo area). Emacs never echoes + single-character keys; longer keys echo only if you pause while + typing them. + +Error + An error occurs when an Emacs command cannot execute in the current + circumstances. When an error occurs, execution of the command + stops (unless the command has been programmed to do otherwise) and + Emacs reports the error by printing an error message (q.v.). + Type-ahead is discarded. Then Emacs is ready to read another + editing command. + +Error Messages + Error messages are single lines of output printed by Emacs when the + user asks for something impossible to do (such as killing text + forward when point is at the end of the buffer). They appear in + the echo area, accompanied by a beep. + + + is a character used as a prefix for typing Meta characters on + keyboards lacking a key. Unlike the key (which, + like the key, is held down while another character is + typed), the key is pressed and released, and applies to the + next character typed. + +Fill Prefix + The fill prefix is a string that Emacs enters at the beginning of + each line when it performs filling. It is not regarded as part of + the text to be filled. *Note Filling::. + +Filling + Filling text means moving text from line to line so that all the + lines are approximately the same length. *Note Filling::. + +Frame + When running Emacs on a TTY terminal, "frame" means the terminal's + screen. When running Emacs under X, you can have multiple frames, + 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. + +Global + Global means `independent of the current environment; in effect + throughout Emacs'. It is the opposite of local (q.v.). Examples + of the use of `global' appear below. + +Global Abbrev + A global definition of an abbrev (q.v.) is effective in all major + modes that do not have local (q.v.) definitions for the same + abbrev. *Note Abbrevs::. + +Global Keymap + The global keymap (q.v.) contains key bindings that are in effect + unless local key bindings in a major mode's local keymap (q.v.) + override them.*Note Keymaps::. + +Global Substitution + Global substitution means replacing each occurrence of one string + by another string through a large amount of text. *Note Replace::. + +Global Variable + The global value of a variable (q.v.) takes effect in all buffers + that do not have their own local (q.v.) values for the variable. + *Note Variables::. + +Graphic Character + Graphic characters are those assigned pictorial images rather than + just names. All the non-Meta (q.v.) characters except for the + Control (q.v.) character are graphic characters. These include + letters, digits, punctuation, and spaces; they do not include + or . In Emacs, typing a graphic character inserts that + character (in ordinary editing modes). *Note Basic Editing: Basic. + +Grinding + Grinding means adjusting the indentation in a program to fit the + nesting structure. *Note Grinding: Indentation. + +Hardcopy + Hardcopy means printed output. Emacs has commands for making + printed listings of text in Emacs buffers. *Note Hardcopy::. + + + You can type at any time to ask what options you have, or + to ask what any command does. is really `Control-h'. + *Note Help::. + +Inbox + An inbox is a file in which mail is delivered by the operating + system. Some mail handlers transfers mail from inboxes to mail + files (q.v.) in which the mail is then stored permanently or until + explicitly deleted. + +Indentation + Indentation means blank space at the beginning of a line. Most + programming languages have conventions for using indentation to + illuminate the structure of the program, and Emacs has special + features to help you set up the correct indentation. *Note + Indentation::. + +Insertion + Insertion means copying text into the buffer, either from the + keyboard or from some other place in Emacs. + +Justification + Justification means adding extra spaces to lines of text to make + them come exactly to a specified width. *Note Justification: + Filling. + +Keyboard Macros + Keyboard macros are a way of defining new Emacs commands from + sequences of existing ones, with no need to write a Lisp program. + *Note Keyboard Macros::. + +Key + A key is a sequence of characters that, when input to Emacs, + specify or begin to specify a single action for Emacs to perform. + That is, the sequence is considered a single unit. If the key is + enough to specify one action, it is a complete key (q.v.); if it + is less than enough, it is a prefix key (q.v.). *Note + Keystrokes::. + +Keymap + The keymap is the data structure that records the bindings (q.v.) + of keys to the commands that they run. For example, the keymap + binds the character `C-n' to the command function `next-line'. + *Note Keymaps::. + +Kill Ring + The kill ring is the place where all text you have killed recently + is saved. You can re-insert any of the killed text still in the + ring; this is called yanking (q.v.). *Note Yanking::. + +Killing + Killing means erasing text and saving it on the kill ring so it + can be yanked (q.v.) later. Some other systems call this + "cutting." Most Emacs commands to erase text do killing, as + opposed to deletion (q.v.). *Note Killing::. + +Killing Jobs + Killing a job (such as, an invocation of Emacs) means making it + cease to exist. Any data within it, if not saved in a file, is + lost. *Note Exiting::. + +List + A list is, approximately, a text string beginning with an open + parenthesis and ending with the matching close parenthesis. In C + mode and other non-Lisp modes, groupings surrounded by other kinds + of matched delimiters appropriate to the language, such as braces, + are also considered lists. Emacs has special commands for many + operations on lists. *Note Lists::. + +Local + Local means `in effect only in a particular context'; the relevant + kind of context is a particular function execution, a particular + buffer, or a particular major mode. Local is the opposite of + `global' (q.v.). Specific uses of `local' in Emacs terminology + appear below. + +Local Abbrev + A local abbrev definition is effective only if a particular major + mode is selected. In that major mode, it overrides any global + definition for the same abbrev. *Note Abbrevs::. + +Local Keymap + A local keymap is used in a particular major mode; the key bindings + (q.v.) in the current local keymap override global bindings of the + same keys. *Note Keymaps::. + +Local Variable + A local value of a variable (q.v.) applies to only one buffer. + *Note Locals::. + +M- + `M-' in the name of a character is an abbreviation for , one + of the modifier keys that can accompany any character. *Note + Keystrokes::. + +M-C- + `M-C-' in the name of a character is an abbreviation for + Control-Meta; it means the same thing as `C-M-'. If your terminal + lacks a real key, you type a Control-Meta character by + typing and then typing the corresponding Control character. + *Note C-M-: Keystrokes. + +M-x + `M-x' is the key which is used to call an Emacs command by name. + You use it to call commands that are not bound to keys. *Note + M-x::. + +Mail + Mail means messages sent from one user to another through the + computer system, to be read at the recipient's convenience. Emacs + has commands for composing and sending mail, and for reading and + editing the mail you have received. *Note Sending Mail::. + +Major Mode + The major modes are a mutually exclusive set of options each of + which configures Emacs for editing a certain sort of text. + Ideally, each programming language has its own major mode. *Note + Major Modes::. + +Mark + The mark points to a position in the text. It specifies one end + of the region (q.v.), point being the other end. Many commands + operate on the whole region, that is, all the text from point to + the mark. *Note Mark::. + +Mark Ring + The mark ring is used to hold several recent previous locations of + the mark, just in case you want to move back to them. *Note Mark + Ring::. + +Message + See `mail'. + +Meta + Meta is the name of a modifier bit which a command character may + have. It is present in a character if the character is typed with + the key held down. Such characters are given names that + start with `Meta-'. For example, `Meta-<' is typed by holding down + and at the same time typing `<' (which itself is done, on + most terminals, by holding down and typing `,'). *Note + Meta: Keystrokes. + +Meta Character + A Meta character is one whose character code includes the Meta bit. + +Minibuffer + The minibuffer is the window that Emacs displays inside the echo + area (q.v.) when it prompts you for arguments to commands. *Note + Minibuffer::. + +Minor Mode + A minor mode is an optional feature of Emacs which can be switched + on or off independent of the major mode. Each minor mode has a + command to turn it on or off. *Note Minor Modes::. + +Mode Line + The mode line is the line at the bottom of each text window (q.v.), + which gives status information on the buffer displayed in that + window. *Note Mode Line::. + +Modified Buffer + A buffer (q.v.) is modified if its text has been changed since the + last time the buffer was saved (or since it was created, if it has + never been saved). *Note Saving::. + +Moving Text + Moving text means erasing it from one place and inserting it in + another. This is done by killing (q.v.) and then yanking (q.v.). + *Note Killing::. + +Named Mark + A named mark is a register (q.v.) in its role of recording a + location in text so that you can move point to that location. + *Note Registers::. + +Narrowing + Narrowing means creating a restriction (q.v.) that limits editing + in the current buffer to only a part of the text in the buffer. + Text outside that part is inaccessible to the user until the + boundaries are widened again, but it is still there, and saving + the file saves the invisible text. *Note Narrowing::. + +Newline + characters in the buffer terminate lines of text and are + called newlines. *Note Newline: Keystrokes. + +Numeric Argument + A numeric argument is a number, specified before a command, to + change the effect of the command. Often the numeric argument + serves as a repeat count. *Note Arguments::. + +Option + An option is a variable (q.v.) that allows you to customize Emacs + by giving it a new value. *Note Variables::. + +Overwrite Mode + Overwrite mode is a minor mode. When it is enabled, ordinary text + characters replace the existing text after point rather than + pushing it to the right. *Note Minor Modes::. + +Page + A page is a unit of text, delimited by formfeed characters (ASCII + Control-L, code 014) coming at the beginning of a line. Some Emacs + commands are provided for moving over and operating on pages. + *Note Pages::. + +Paragraphs + Paragraphs are the medium-size unit of English text. There are + special Emacs commands for moving over and operating on paragraphs. + *Note Paragraphs::. + +Parsing + We say that Emacs parses words or expressions in the text being + edited. Really, all it knows how to do is find the other end of a + word or expression. *Note Syntax::. + +Point + Point is the place in the buffer at which insertion and deletion + occur. Point is considered to be between two characters, not at + one character. The terminal's cursor (q.v.) indicates the + location of point. *Note Point: Basic. + +Prefix Key + A prefix key is a key (q.v.) whose sole function is to introduce a + set of multi-character keys. `Control-x' is an example of a prefix + key; any two-character sequence starting with `C-x' is also a + legitimate key. *Note Keystrokes::. + +Prompt + A prompt is text printed to ask the user for input. Printing a + prompt is called prompting. Emacs prompts always appear in the + echo area (q.v.). One kind of prompting happens when the + minibuffer is used to read an argument (*note Minibuffer::.); the + echoing which happens when you pause in the middle of typing a + multi-character key is also a kind of prompting (*note Echo + Area::.). + +Quitting + Quitting means cancelling a partially typed command or a running + command, using `C-g'. *Note Quitting::. + +Quoting + Quoting means depriving a character of its usual special + significance. In Emacs this is usually done with `Control-q'. + What constitutes special significance depends on the context and + on convention. For example, an "ordinary" character as an Emacs + command inserts itself; so in this context, a special character is + any character that does not normally insert itself (such as , + for example), and quoting it makes it insert itself as if it were + not special. Not all contexts allow quoting. *Note Quoting: + Basic. + +Read-only Buffer + A read-only buffer is one whose text you are not allowed to change. + Normally Emacs makes buffers read-only when they contain text which + has a special significance to Emacs, such asDired buffers. + Visiting a file that is write-protected also makes a read-only + buffer. *Note Buffers::. + +Recursive Editing Level + A recursive editing level is a state in which part of the + execution of a command involves asking the user to edit some text. + This text may or may not be the same as the text to which the + command was applied. The mode line indicates recursive editing + levels with square brackets (`[' and `]'). *Note Recursive Edit::. + +Redisplay + Redisplay is the process of correcting the image on the screen to + correspond to changes that have been made in the text being edited. + *Note Redisplay: Frame. + +Regexp + See `regular expression'. + +Region + The region is the text between point (q.v.) and the mark (q.v.). + Many commands operate on the text of the region. *Note Region: + Mark. + +Registers + Registers are named slots in which text or buffer positions or + rectangles can be saved for later use. *Note Registers::. + +Regular Expression + A regular expression is a pattern that can match various text + strings; for example, `l[0-9]+' matches `l' followed by one or more + digits. *Note Regexps::. + +Replacement + See `global substitution'. + +Restriction + A buffer's restriction is the amount of text, at the beginning or + the end of the buffer, that is temporarily invisible and + inaccessible. Giving a buffer a nonzero amount of restriction is + called narrowing (q.v.). *Note Narrowing::. + + + is the character than runs the command to insert a newline + into the text. It is also used to terminate most arguments read + in the minibuffer (q.v.). *Note Return: Keystrokes. + +Saving + Saving a buffer means copying its text into the file that was + visited (q.v.) in that buffer. To actually change a file you have + edited in Emacs, you have to save it. *Note Saving::. + +Scrolling + Scrolling means shifting the text in the Emacs window to make a + different part ot the buffer visible. *Note Scrolling: Display. + +Searching + Searching means moving point to the next occurrence of a specified + string. *Note Search::. + +Selecting + Selecting a buffer means making it the current (q.v.) buffer. + *Note Selecting: Buffers. + +Self-documentation + Self-documentation is the feature of Emacs which can tell you what + any command does, or can give you a list of all commands related + to a topic you specify. You ask for self-documentation with the + help character, `C-h'. *Note Help::. + +Sentences + Emacs has commands for moving by or killing by sentences. *Note + Sentences::. + +Sexp + An sexp (short for `s-expression,' itself short for `symbolic + expression') is the basic syntactic unit of Lisp in its textual + form: either a list, or Lisp atom. Many Emacs commands operate on + sexps. The term `sexp' is generalized to languages other than + Lisp to mean a syntactically recognizable expression. *Note + Sexps: Lists. + +Simultaneous Editing + Simultaneous editing means two users modifying the same file at + once. If simultaneous editing is not detected, you may lose your + work. Emacs detects all cases of simultaneous editing and warns + the user to investigate them. *Note Simultaneous Editing: + Interlocking. + +String + A string is a kind of Lisp data object which contains a sequence of + characters. Many Emacs variables are intended to have strings as + values. The Lisp syntax for a string consists of the characters in + the string with a `"' before and another `"' after. Write a `"' + that is part of the string as `\"' and a `\' that is part of the + string as `\\'. You can include all other characters, including + newline, just by writing them inside the string. You can also + include escape sequences as in C, such as `\n' for newline or + `\241' using an octal character code. + +String Substitution + See `global substitution'. + +Syntax Table + The syntax table tells Emacs which characters are part of a word, + which characters balance each other like parentheses, etc. *Note + Syntax::. + +Tag Table + A tag table is a file that serves as an index to the function + definitions in one or more other files. *Note Tags::. + +Termscript File + A termscript file contains a record of all characters Emacs sent to + the terminal. It is used for tracking down bugs in Emacs + redisplay. Emacs does not make a termscript file unless + explicitly instructed to do so. *Note Bugs::. + +Text + Text has two meanings (*note Text::.): + + * Data consisting of a sequence of characters, as opposed to + binary numbers, images, graphics commands, executable + programs, and the like. The contents of an Emacs buffer are + always text in this sense. + + * Data consisting of written human language, as opposed to + programs, or something that follows the stylistic conventions + of human language. + +Top Level + Top level is the normal state of Emacs, in which you are editing + the text of the file you have visited. You are at top level + whenever you are not in a recursive editing level (q.v.) or the + minibuffer (q.v.), and not in the middle of a command. You can + get back to top level by aborting (q.v.) and quitting (q.v.). + *Note Quitting::. + +Transposition + Transposing two units of text means putting each one into the place + formerly occupied by the other. There are Emacs commands to + transpose two adjacent characters, words, sexps (q.v.), or lines + (*note Transpose::.). + +Truncation + Truncating text lines in the display means leaving out any text on + a line that does not fit within the right margin of the window + displaying it. See also `continuation line'. *Note Truncation: + Basic. + +Undoing + Undoing means making your previous editing go in reverse, bringing + back the text that existed earlier in the editing session. *Note + Undo::. + +Variable + A variable is Lisp object that can store an arbitrary value. + Emacs uses some variables for internal purposes, and has others + (known as `options' (q.v.)) you can set to control the behavior of + Emacs. The variables used in Emacs that you are likely to be + interested in are listed in the Variables Index of this manual. + *Note Variables::, for information on variables. + +Visiting + Visiting a file means loading its contents into a buffer (q.v.) + where they can be edited. *Note Visiting::. + +Whitespace + Whitespace is any run of consecutive formatting characters (spaces, + tabs, newlines, and backspaces). + +Widening + Widening is removing any restriction (q.v.) on the current buffer; + it is the opposite of narrowing (q.v.). *Note Narrowing::. + +Window + Emacs divides the frame into one or more windows, each of which can + display the contents of one buffer (q.v.) at any time. *Note + Frame::, for basic information on how Emacs uses the frame. *Note + Windows::, for commands to control the use of windows. Note that if + you are running Emacs under X, terminology can be confusing: Each + Emacs frame occupies a separate X window and can, in turn, be + divided into different subwindows. + +Word Abbrev + Synonymous with `abbrev'. + +Word Search + Word search is searching for a sequence of words, considering the + punctuation between them as insignificant. *Note Word Search::. + +Yanking + Yanking means reinserting text previously killed. It can be used + to undo a mistaken kill, or for copying or moving text. Some other + systems call this "pasting". *Note Yanking::. + diff --git a/info/xemacs.info-19 b/info/xemacs.info-19 new file mode 100644 index 0000000..cc37b6d --- /dev/null +++ b/info/xemacs.info-19 @@ -0,0 +1,962 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Manifesto, Next: Key Index, Prev: Glossary, Up: Top + +The GNU Manifesto +***************** + +What's GNU? GNU's Not Unix! +============================ + + GNU, which stands for GNU's Not Unix, is the name for the complete +Unix-compatible software system which I am writing so that I can give it +away free to everyone who can use it. Several other volunteers are +helping me. Contributions of time, money, programs, and equipment are +greatly needed. + + So far we have an Emacs text editor with Lisp for writing editor +commands, a source level debugger, a yacc-compatible parser generator, +a linker, and around 35 utilities. A shell (command interpreter) is +nearly completed. A new portable optimizing C compiler has compiled +itself and may be released this year. An initial kernel exists, but +many more features are needed to emulate Unix. When the kernel and +compiler are finished, it will be possible to distribute a GNU system +suitable for program development. We will use TeX as our text +formatter, but an nroff is being worked on. We will use the free, +portable X window system as well. After this we will add a portable +Common Lisp, an Empire game, a spreadsheet, and hundreds of other +things, plus online documentation. We hope to supply, eventually, +everything useful that normally comes with a Unix system, and more. + + GNU will be able to run Unix programs, but will not be identical to +Unix. We will make all improvements that are convenient, based on our +experience with other operating systems. In particular, we plan to +have longer filenames, file version numbers, a crashproof file system, +filename completion perhaps, terminal-independent display support, and +perhaps eventually a Lisp-based window system through which several +Lisp programs and ordinary Unix programs can share a screen. Both C +and Lisp will be available as system programming languages. We will +try to support UUCP, MIT Chaosnet, and Internet protocols for +communication. + + GNU is aimed initially at machines in the 68000/16000 class with +virtual memory, because they are the easiest machines to make it run +on. The extra effort to make it run on smaller machines will be left +to someone who wants to use it on them. + + To avoid horrible confusion, please pronounce the `G' in the word +`GNU' when it is the name of this project. + +Why I Must Write GNU +==================== + + I consider that the golden rule requires that if I like a program I +must share it with other people who like it. Software sellers want to +divide the users and conquer them, making each user agree not to share +with others. I refuse to break solidarity with other users in this +way. I cannot in good conscience sign a nondisclosure agreement or a +software license agreement. For years I worked within the Artificial +Intelligence Lab to resist such tendencies and other inhospitalities, +but eventually they had gone too far: I could not remain in an +institution where such things are done for me against my will. + + So that I can continue to use computers without dishonor, I have +decided to put together a sufficient body of free software so that I +will be able to get along without any software that is not free. I +have resigned from the AI lab to deny MIT any legal excuse to prevent +me from giving GNU away. + +Why GNU Will Be Compatible With Unix +==================================== + + Unix is not my ideal system, but it is not too bad. The essential +features of Unix seem to be good ones, and I think I can fill in what +Unix lacks without spoiling them. And a system compatible with Unix +would be convenient for many other people to adopt. + +How GNU Will Be Available +========================= + + GNU is not in the public domain. Everyone will be permitted to +modify and redistribute GNU, but no distributor will be allowed to +restrict its further redistribution. That is to say, proprietary +modifications will not be allowed. I want to make sure that all +versions of GNU remain free. + +Why Many Other Programmers Want to Help +======================================= + + I have found many other programmers who are excited about GNU and +want to help. + + Many programmers are unhappy about the commercialization of system +software. It may enable them to make more money, but it requires them +to feel in conflict with other programmers in general rather than feel +as comrades. The fundamental act of friendship among programmers is the +sharing of programs; marketing arrangements now typically used +essentially forbid programmers to treat others as friends. The +purchaser of software must choose between friendship and obeying the +law. Naturally, many decide that friendship is more important. But +those who believe in law often do not feel at ease with either choice. +They become cynical and think that programming is just a way of making +money. + + By working on and using GNU rather than proprietary programs, we can +be hospitable to everyone and obey the law. In addition, GNU serves as +an example to inspire and a banner to rally others to join us in +sharing. This can give us a feeling of harmony which is impossible if +we use software that is not free. For about half the programmers I +talk to, this is an important happiness that money cannot replace. + +How You Can Contribute +====================== + + I am asking computer manufacturers for donations of machines and +money. I'm asking individuals for donations of programs and work. + + One consequence you can expect if you donate machines is that GNU +will run on them at an early date. The machines should be complete, +ready-to-use systems, approved for use in a residential area, and not +in need of sophisticated cooling or power. + + I have found very many programmers eager to contribute part-time +work for GNU. For most projects, such part-time distributed work would +be very hard to coordinate; the independently-written parts would not +work together. But for the particular task of replacing Unix, this +problem is absent. A complete Unix system contains hundreds of utility +programs, each of which is documented separately. Most interface +specifications are fixed by Unix compatibility. If each contributor +can write a compatible replacement for a single Unix utility, and make +it work properly in place of the original on a Unix system, then these +utilities will work right when put together. Even allowing for Murphy +to create a few unexpected problems, assembling these components will +be a feasible task. (The kernel will require closer communication and +will be worked on by a small, tight group.) + + If I get donations of money, I may be able to hire a few people full +or part time. The salary won't be high by programmers' standards, but +I'm looking for people for whom building community spirit is as +important as making money. I view this as a way of enabling dedicated +people to devote their full energies to working on GNU by sparing them +the need to make a living in another way. + +Why All Computer Users Will Benefit +=================================== + + Once GNU is written, everyone will be able to obtain good system +software free, just like air. + + This means much more than just saving everyone the price of a Unix +license. It means that much wasteful duplication of system programming +effort will be avoided. This effort can go instead into advancing the +state of the art. + + Complete system sources will be available to everyone. As a result, +a user who needs changes in the system will always be free to make them +himself, or hire any available programmer or company to make them for +him. Users will no longer be at the mercy of one programmer or company +which owns the sources and is in sole position to make changes. + + Schools will be able to provide a much more educational environment +by encouraging all students to study and improve the system code. +Harvard's computer lab used to have the policy that no program could be +installed on the system if its sources were not on public display, and +upheld it by actually refusing to install certain programs. I was very +much inspired by this. + + Finally, the overhead of considering who owns the system software +and what one is or is not entitled to do with it will be lifted. + + Arrangements to make people pay for using a program, including +licensing of copies, always incur a tremendous cost to society through +the cumbersome mechanisms necessary to figure out how much (that is, +which programs) a person must pay for. And only a police state can +force everyone to obey them. Consider a space station where air must +be manufactured at great cost: charging each breather per liter of air +may be fair, but wearing the metered gas mask all day and all night is +intolerable even if everyone can afford to pay the air bill. And the +TV cameras everywhere to see if you ever take the mask off are +outrageous. It's better to support the air plant with a head tax and +chuck the masks. + + Copying all or parts of a program is as natural to a programmer as +breathing, and as productive. It ought to be as free. + +Some Easily Rebutted Objections to GNU's Goals +============================================== + + "Nobody will use it if it is free, because that means they can't + rely on any support." + + "You have to charge for the program to pay for providing the + support." + + If people would rather pay for GNU plus service than get GNU free +without service, a company to provide just service to people who have +obtained GNU free ought to be profitable. + + We must distinguish between support in the form of real programming +work and mere handholding. The former is something one cannot rely on +from a software vendor. If your problem is not shared by enough +people, the vendor will tell you to get lost. + + If your business needs to be able to rely on support, the only way +is to have all the necessary sources and tools. Then you can hire any +available person to fix your problem; you are not at the mercy of any +individual. With Unix, the price of sources puts this out of +consideration for most businesses. With GNU this will be easy. It is +still possible for there to be no available competent person, but this +problem cannot be blamed on distibution arrangements. GNU does not +eliminate all the world's problems, only some of them. + + Meanwhile, the users who know nothing about computers need +handholding: doing things for them which they could easily do +themselves but don't know how. + + Such services could be provided by companies that sell just +hand-holding and repair service. If it is true that users would rather +spend money and get a product with service, they will also be willing +to buy the service having got the product free. The service companies +will compete in quality and price; users will not be tied to any +particular one. Meanwhile, those of us who don't need the service +should be able to use the program without paying for the service. + + "You cannot reach many people without advertising, and you must + charge for the program to support that." + + "It's no use advertising a program people can get free." + + There are various forms of free or very cheap publicity that can be +used to inform numbers of computer users about something like GNU. But +it may be true that one can reach more microcomputer users with +advertising. If this is really so, a business which advertises the +service of copying and mailing GNU for a fee ought to be successful +enough to pay for its advertising and more. This way, only the users +who benefit from the advertising pay for it. + + On the other hand, if many people get GNU from their friends, and +such companies don't succeed, this will show that advertising was not +really necessary to spread GNU. Why is it that free market advocates +don't want to let the free market decide this? + + "My company needs a proprietary operating system to get a + competitive edge." + + GNU will remove operating system software from the realm of +competition. You will not be able to get an edge in this area, but +neither will your competitors be able to get an edge over you. You and +they will compete in other areas, while benefitting mutually in this +one. If your business is selling an operating system, you will not +like GNU, but that's tough on you. If your business is something else, +GNU can save you from being pushed into the expensive business of +selling operating systems. + + I would like to see GNU development supported by gifts from many +manufacturers and users, reducing the cost to each. + + "Don't programmers deserve a reward for their creativity?" + + If anything deserves a reward, it is social contribution. +Creativity can be a social contribution, but only in so far as society +is free to use the results. If programmers deserve to be rewarded for +creating innovative programs, by the same token they deserve to be +punished if they restrict the use of these programs. + + "Shouldn't a programmer be able to ask for a reward for his + creativity?" + + There is nothing wrong with wanting pay for work, or seeking to +maximize one's income, as long as one does not use means that are +destructive. But the means customary in the field of software today +are based on destruction. + + Extracting money from users of a program by restricting their use of +it is destructive because the restrictions reduce the amount and the +ways that the program can be used. This reduces the amount of wealth +that humanity derives from the program. When there is a deliberate +choice to restrict, the harmful consequences are deliberate destruction. + + The reason a good citizen does not use such destructive means to +become wealthier is that, if everyone did so, we would all become +poorer from the mutual destructiveness. This is Kantian ethics; or, +the Golden Rule. Since I do not like the consequences that result if +everyone hoards information, I am required to consider it wrong for one +to do so. Specifically, the desire to be rewarded for one's creativity +does not justify depriving the world in general of all or part of that +creativity. + + "Won't programmers starve?" + + I could answer that nobody is forced to be a programmer. Most of us +cannot manage to get any money for standing on the street and making +faces. But we are not, as a result, condemned to spend our lives +standing on the street making faces, and starving. We do something +else. + + But that is the wrong answer because it accepts the questioner's +implicit assumption: that without ownership of software, programmers +cannot possibly be paid a cent. Supposedly it is all or nothing. + + The real reason programmers will not starve is that it will still be +possible for them to get paid for programming; just not paid as much as +now. + + Restricting copying is not the only basis for business in software. +It is the most common basis because it brings in the most money. If it +were prohibited, or rejected by the customer, software business would +move to other bases of organization which are now used less often. +There are always numerous ways to organize any kind of business. + + Probably programming will not be as lucrative on the new basis as it +is now. But that is not an argument against the change. It is not +considered an injustice that sales clerks make the salaries that they +now do. If programmers made the same, that would not be an injustice +either. (In practice they would still make considerably more than +that.) + + "Don't people have a right to control how their creativity is + used?" + + "Control over the use of one's ideas" really constitutes control over +other people's lives; and it is usually used to make their lives more +difficult. + + People who have studied the issue of intellectual property rights +carefully (such as lawyers) say that there is no intrinsic right to +intellectual property. The kinds of supposed intellectual property +rights that the government recognizes were created by specific acts of +legislation for specific purposes. + + For example, the patent system was established to encourage +inventors to disclose the details of their inventions. Its purpose was +to help society rather than to help inventors. At the time, the life +span of 17 years for a patent was short compared with the rate of +advance of the state of the art. Since patents are an issue only among +manufacturers, for whom the cost and effort of a license agreement are +small compared with setting up production, the patents often do not do +much harm. They do not obstruct most individuals who use patented +products. + + The idea of copyright did not exist in ancient times, when authors +frequently copied other authors at length in works of non-fiction. This +practice was useful, and is the only way many authors' works have +survived even in part. The copyright system was created expressly for +the purpose of encouraging authorship. In the domain for which it was +invented--books, which could be copied economically only on a printing +press--it did little harm, and did not obstruct most of the individuals +who read the books. + + All intellectual property rights are just licenses granted by society +because it was thought, rightly or wrongly, that society as a whole +would benefit by granting them. But in any particular situation, we +have to ask: are we really better off granting such license? What kind +of act are we licensing a person to do? + + The case of programs today is very different from that of books a +hundred years ago. The fact that the easiest way to copy a program is +from one neighbor to another, the fact that a program has both source +code and object code which are distinct, and the fact that a program is +used rather than read and enjoyed, combine to create a situation in +which a person who enforces a copyright is harming society as a whole +both materially and spiritually; in which a person should not do so +regardless of whether the law enables him to. + + "Competition makes things get done better." + + The paradigm of competition is a race: by rewarding the winner, we +encourage everyone to run faster. When capitalism really works this +way, it does a good job; but its defenders are wrong in assuming it +always works this way. If the runners forget why the reward is offered +and become intent on winning, no matter how, they may find other +strategies--such as, attacking other runners. If the runners get into +a fist fight, they will all finish late. + + Proprietary and secret software is the moral equivalent of runners +in a fist fight. Sad to say, the only referee we've got does not seem +to object to fights; he just regulates them ("For every ten yards you +run, you can fire one shot"). He really ought to break them up, and +penalize runners for even trying to fight. + + "Won't everyone stop programming without a monetary incentive?" + + Actually, many people will program with absolutely no monetary +incentive. Programming has an irresistible fascination for some +people, usually the people who are best at it. There is no shortage of +professional musicians who keep at it even though they have no hope of +making a living that way. + + But really this question, though commonly asked, is not appropriate +to the situation. Pay for programmers will not disappear, only become +less. So the right question is, will anyone program with a reduced +monetary incentive? My experience shows that they will. + + For more than ten years, many of the world's best programmers worked +at the Artificial Intelligence Lab for far less money than they could +have had anywhere else. They got many kinds of non-monetary rewards: +fame and appreciation, for example. And creativity is also fun, a +reward in itself. + + Then most of them left when offered a chance to do the same +interesting work for a lot of money. + + What the facts show is that people will program for reasons other +than riches; but if given a chance to make a lot of money as well, they +will come to expect and demand it. Low-paying organizations do poorly +in competition with high-paying ones, but they do not have to do badly +if the high-paying ones are banned. + + "We need the programmers desperately. If they demand that we stop + helping our neighbors, we have to obey." + + You're never so desperate that you have to obey this sort of demand. +Remember: millions for defense, but not a cent for tribute! + + "Programmers need to make a living somehow." + + In the short run, this is true. However, there are plenty of ways +that programmers could make a living without selling the right to use a +program. This way is customary now because it brings programmers and +businessmen the most money, not because it is the only way to make a +living. It is easy to find other ways if you want to find them. Here +are a number of examples. + + A manufacturer introducing a new computer will pay for the porting of +operating systems onto the new hardware. + + The sale of teaching, hand-holding, and maintenance services could +also employ programmers. + + People with new ideas could distribute programs as freeware and ask +for donations from satisfied users or sell hand-holding services. I +have met people who are already working this way successfully. + + Users with related needs can form users' groups and pay dues. A +group would contract with programming companies to write programs that +the group's members would like to use. + + All sorts of development can be funded with a Software Tax: + + Suppose everyone who buys a computer has to pay a certain percent + of the price as a software tax. The government gives this to an + agency like the NSF to spend on software development. + + But if the computer buyer makes a donation to software development + himself, he can take a credit against the tax. He can donate to + the project of his own choosing--often, chosen because he hopes to + use the results when + + it is done. He can take a credit for any amount of donation up to + the total tax he had to pay. + + The total tax rate could be decided by a vote of the payers of the + tax, weighted according to the amount they will be taxed on. + + The consequences: + + * The computer-using community supports software development. + + * This community decides what level of support is needed. + + * Users who care which projects their share is spent on can + choose this for themselves. + + In the long run, making programs free is a step toward the +post-scarcity world, where nobody will have to work very hard just to +make a living. People will be free to devote themselves to activities +that are fun, such as programming, after spending the necessary ten +hours a week on required tasks such as legislation, family counseling, +robot repair, and asteroid prospecting. There will be no need to be +able to make a living from programming. + + We have already greatly reduced the amount of work that the whole +society must do for its actual productivity, but only a little of this +has translated itself into leisure for workers because much +nonproductive activity is required to accompany productive activity. +The main causes of this are bureaucracy and isometric struggles against +competition. Free software will greatly reduce these drains in the +area of software production. We must do this, in order for technical +gains in productivity to translate into less work for us. + + +File: xemacs.info, Node: Key Index, Next: Command Index, Prev: Manifesto, Up: Top + +Key (Character) Index +********************* + +* Menu: + +* ! (query-replace): Query Replace. +* " (TeX mode): TeX Editing. +* , (query-replace): Query Replace. +* . (Calendar mode): Specified Dates. +* . (query-replace): Query Replace. +* ? (Calendar mode): General Calendar. +* ^ (query-replace): Query Replace. +* a (Calendar mode): Holidays. +* button1: Intro to Keystrokes. +* button1up: Intro to Keystrokes. +* button2: Intro to Keystrokes. +* button2up: Intro to Keystrokes. +* button3: Intro to Keystrokes. +* button3up: Intro to Keystrokes. +* C-<: Setting Mark. +* C->: Setting Mark. +* C-@ (Calendar mode): Mark and Region. +* C-\: Select Input Method. +* C-] <1>: Recursive Edit. +* C-]: Quitting. +* C-_: Undo. +* C-a: Basic. +* C-a (Calendar mode): Move to Beginning or End. +* C-b: Basic. +* C-b (Calendar mode): Calendar Unit Motion. +* C-c: Key Sequences. +* C-c ' (Picture mode): Insert in Picture. +* C-c . (Picture mode): Insert in Picture. +* C-c / (Picture mode): Insert in Picture. +* C-c ; (Fortran mode): Fortran Comments. +* C-c < (Picture mode): Insert in Picture. +* C-c > (Picture mode): Insert in Picture. +* C-c \ (Picture mode): Insert in Picture. +* C-c ^ (Picture mode): Insert in Picture. +* C-c ` (Picture mode): Insert in Picture. +* C-c C-\ (Shell mode): Shell Mode. +* C-c C-b (Outline mode): Outline Motion. +* C-c C-b (Picture mode): Insert in Picture. +* C-c C-b (TeX mode): TeX Print. +* C-c C-c (Edit Abbrevs): Editing Abbrevs. +* C-c C-c (Edit Tab Stops): Tab Stops. +* C-c C-c (Mail mode): Mail Mode. +* C-c C-c (Occur mode): Other Repeating Search. +* C-c C-c (Shell mode): Shell Mode. +* C-c C-d (Picture mode): Basic Picture. +* C-c C-d (Shell mode): Shell Mode. +* C-c C-f (LaTeX mode): TeX Editing. +* C-c C-f (Outline mode): Outline Motion. +* C-c C-f (Picture mode): Insert in Picture. +* C-c C-f C-c (Mail mode): Mail Mode. +* C-c C-f C-s (Mail mode): Mail Mode. +* C-c C-f C-t (Mail mode): Mail Mode. +* C-c C-h (Outline mode): Outline Visibility. +* C-c C-i (Outline mode): Outline Visibility. +* C-c C-j (Term mode): Term Mode. +* C-c C-k (Picture mode): Rectangles in Picture. +* C-c C-k (Term mode): Term Mode. +* C-c C-k (TeX mode): TeX Print. +* C-c C-l (Calendar mode): General Calendar. +* C-c C-l (TeX mode): TeX Print. +* C-c C-n (Fortran mode): Fortran Motion. +* C-c C-n (Outline mode): Outline Motion. +* C-c C-o (Shell mode): Shell Mode. +* C-c C-p (Fortran mode): Fortran Motion. +* C-c C-p (Outline mode): Outline Motion. +* C-c C-p (TeX mode): TeX Print. +* C-c C-q (Mail mode): Mail Mode. +* C-c C-q (Term mode): Paging in Term. +* C-c C-q (TeX mode): TeX Print. +* C-c C-r (Fortran mode): Fortran Columns. +* C-c C-r (Shell mode): Shell Mode. +* C-c C-r (TeX mode): TeX Print. +* C-c C-s (Mail mode): Mail Mode. +* C-c C-s (Outline mode): Outline Visibility. +* C-c C-u (Outline mode): Outline Motion. +* C-c C-u (Shell mode): Shell Mode. +* C-c C-w (Fortran mode): Fortran Columns. +* C-c C-w (Mail mode): Mail Mode. +* C-c C-w (Picture mode): Rectangles in Picture. +* C-c C-w (Shell mode): Shell Mode. +* C-c C-x (Picture mode): Rectangles in Picture. +* C-c C-y (Mail mode): Mail Mode. +* C-c C-y (Picture mode): Rectangles in Picture. +* C-c C-y (Shell mode): Shell Mode. +* C-c C-z (Shell mode): Shell Mode. +* C-c TAB (Picture mode): Tabs in Picture. +* C-c { (TeX mode): TeX Editing. +* C-c } (TeX mode): TeX Editing. +* C-d: Killing. +* C-d (Shell mode): Shell Mode. +* C-e: Basic. +* C-e (Calendar mode): Move to Beginning or End. +* C-END: Basic. +* C-f: Basic. +* C-f (Calendar mode): Calendar Unit Motion. +* C-g <1>: Quitting. +* C-g: Minibuffer. +* C-g (isearch-mode): Incremental Search. +* C-h: Key Sequences. +* C-h a: Help. +* C-h b: Help. +* C-h C: Coding Systems. +* C-h c: Help. +* C-h C-\: Select Input Method. +* C-h C-c: Help. +* C-h C-d: Help. +* C-h C-w: Help. +* C-h f <1>: Help. +* C-h f: Documentation. +* C-h h: Mule Intro. +* C-h I: Select Input Method. +* C-h i: Help. +* C-h k: Help. +* C-h L: Language Environments. +* C-h l: Help. +* C-h m: Help. +* C-h n: Help. +* C-h s: Syntax Change. +* C-h t <1>: Help. +* C-h t: Basic. +* C-h v <1>: Help. +* C-h v <2>: Examining. +* C-h v: Documentation. +* C-h w: Help. +* C-HOME: Basic. +* C-k: Killing. +* C-l <1>: Basic. +* C-l: Scrolling. +* C-l (query-replace): Query Replace. +* C-LEFT: Basic. +* C-M-@ <1>: Marking Objects. +* C-M-@: Lists. +* C-M-\ <1>: Indentation Commands. +* C-M-\: Multi-line Indent. +* C-M-a: Defuns. +* C-M-a (Fortran mode): Fortran Motion. +* C-M-b: Lists. +* C-M-c: Recursive Edit. +* C-M-d: Lists. +* C-M-e: Defuns. +* C-M-e (Fortran mode): Fortran Motion. +* C-M-f: Lists. +* C-M-h <1>: Marking Objects. +* C-M-h: Defuns. +* C-M-h (Fortran mode): Fortran Motion. +* C-M-k <1>: Killing. +* C-M-k: Lists. +* C-M-n: Lists. +* C-M-o: Indentation Commands. +* C-M-p: Lists. +* C-M-q: Multi-line Indent. +* C-M-q (Fortran mode): ForIndent Commands. +* C-M-t <1>: Transpose. +* C-M-t: Lists. +* C-M-u: Lists. +* C-M-v <1>: Other Window. +* C-M-v: Minibuffer Edit. +* C-M-w: Appending Kills. +* C-M-x <1>: External Lisp. +* C-M-x: Lisp Eval. +* C-n: Basic. +* C-n (Calendar mode): Calendar Unit Motion. +* C-o: Blank Lines. +* C-p: Basic. +* C-p (Calendar mode): Calendar Unit Motion. +* C-q: Basic. +* C-q (isearch-mode): Incremental Search. +* C-r: Incremental Search. +* C-r (isearch-mode): Incremental Search. +* C-r (query-replace): Query Replace. +* C-RIGHT: Basic. +* C-s: Incremental Search. +* C-s (isearch-mode): Incremental Search. +* C-SPC: Setting Mark. +* C-SPC (Calendar mode): Mark and Region. +* C-t <1>: Transpose. +* C-t: Basic. +* C-u: Arguments. +* C-u - C-x ;: Comments. +* C-u C-@: Mark Ring. +* C-u C-SPC: Mark Ring. +* C-u C-x v v: Editing with VC. +* C-u TAB: Multi-line Indent. +* C-v <1>: Scrolling. +* C-v: Basic. +* C-v (Calendar mode): Scroll Calendar. +* C-w: Killing. +* C-w (isearch-mode): Incremental Search. +* C-w (query-replace): Query Replace. +* C-x: Key Sequences. +* C-x $: Selective Display. +* C-x (: Basic Kbd Macro. +* C-x ): Basic Kbd Macro. +* C-x .: Fill Prefix. +* C-x 0: Change Window. +* C-x 1: Change Window. +* C-x 2: Split Window. +* C-x 3: Split Window. +* C-x 4: Pop Up Window. +* C-x 4 .: Find Tag. +* C-x 4 b: Select Buffer. +* C-x 4 d: Dired Enter. +* C-x 4 f: Visiting. +* C-x 4 m: Sending Mail. +* C-x 5 b: Select Buffer. +* C-x 5 C-f: Visiting. +* C-x ;: Comments. +* C-x <: Horizontal Scrolling. +* C-x < (Calendar mode): Scroll Calendar. +* C-x =: Position Info. +* C-x >: Horizontal Scrolling. +* C-x > (Calendar mode): Scroll Calendar. +* C-x [: Pages. +* C-x [ (Calendar mode): Calendar Unit Motion. +* C-x ]: Pages. +* C-x ] (Calendar mode): Calendar Unit Motion. +* C-x ^: Change Window. +* C-x `: Compilation. +* C-x a g: Defining Abbrevs. +* C-x a i g: Defining Abbrevs. +* C-x a i l: Defining Abbrevs. +* C-x a l: Defining Abbrevs. +* C-x b: Select Buffer. +* C-x C-b: List Buffers. +* C-x C-c: Exiting. +* C-x C-d: ListDir. +* C-x C-e: Lisp Eval. +* C-x C-l: Case. +* C-x C-o <1>: Killing. +* C-x C-o: Blank Lines. +* C-x C-p <1>: Marking Objects. +* C-x C-p: Pages. +* C-x C-q: Misc Buffer. +* C-x C-q (version control): Editing with VC. +* C-x C-s: Saving. +* C-x C-t: Transpose. +* C-x C-u: Case. +* C-x C-v: Visiting. +* C-x C-w: Saving. +* C-x C-x: Setting Mark. +* C-x C-x (Calendar mode): Mark and Region. +* C-x d: Dired Enter. +* C-x DEL <1>: Sentences. +* C-x DEL <2>: Kill Errors. +* C-x DEL: Killing. +* C-x e: Basic Kbd Macro. +* C-x ESC: Repetition. +* C-x f: Fill Commands. +* C-x h: Marking Objects. +* C-x k: Kill Buffer. +* C-x l: Pages. +* C-x m: Sending Mail. +* C-x n n: Narrowing. +* C-x n w: Narrowing. +* C-x o: Other Window. +* C-x q: Kbd Macro Query. +* C-x r g: RegText. +* C-x r j: RegPos. +* C-x r s: RegText. +* C-x r SPC: RegPos. +* C-x RET: Mule Intro. +* C-x RET c: Specify Coding. +* C-x RET C-\: Select Input Method. +* C-x RET f: Specify Coding. +* C-x RET k: Specify Coding. +* C-x RET p: Specify Coding. +* C-x RET t: Specify Coding. +* C-x s: Saving. +* C-x TAB: Indentation Commands. +* C-x u: Undo. +* C-x v =: Old Versions. +* C-x v a: Change Logs and VC. +* C-x v c: Editing with VC. +* C-x v d: VC Status. +* C-x v h: Version Headers. +* C-x v i: Editing with VC. +* C-x v l: VC Status. +* C-x v r: Making Snapshots. +* C-x v s: Making Snapshots. +* C-x v u: Editing with VC. +* C-x v ~: Old Versions. +* C-x }: Change Window. +* C-y: Kill Ring. +* C-y (isearch-mode): Incremental Search. +* C-z: Exiting. +* control key: Intro to Keystrokes. +* d (Calendar mode): Diary Commands. +* DEL <1>: Basic. +* DEL <2>: Killing. +* DEL <3>: Kill Errors. +* DEL <4>: Program Modes. +* DEL: Major Modes. +* DEL (isearch-mode): Incremental Search. +* DEL (query-replace): Query Replace. +* DOWN: Basic. +* END: Basic. +* ESC <1>: Key Sequences. +* ESC: Meta Key. +* ESC (query-replace): Query Replace. +* g CHAR (Calendar mode): From Other Calendar. +* g d (Calendar mode): Specified Dates. +* g m l (Calendar mode): Mayan Calendar. +* h (Calendar mode): Holidays. +* HOME: Basic. +* hyper key <1>: Intro to Keystrokes. +* hyper key <2>: Representing Keystrokes. +* hyper key: Super and Hyper Keys. +* i a (Calendar mode): Special Diary Entries. +* i b (Calendar mode): Special Diary Entries. +* i c (Calendar mode): Special Diary Entries. +* i d (Calendar mode): Adding to Diary. +* i m (Calendar mode): Adding to Diary. +* i w (Calendar mode): Adding to Diary. +* i y (Calendar mode): Adding to Diary. +* LEFT: Basic. +* LFD <1>: Basic Indent. +* LFD <2>: String Key Sequences. +* LFD: Major Modes. +* LFD (TeX mode): TeX Editing. +* M (Calendar mode): Lunar Phases. +* m (Calendar mode): Diary Commands. +* M-!: Single Shell. +* M-$: Spelling. +* M-%: Query Replace. +* M-': Expanding Abbrevs. +* M-(: Balanced Editing. +* M-): Balanced Editing. +* M-,: Tags Search. +* M--: Arguments. +* M-- M-c: Fixing Case. +* M-- M-l: Fixing Case. +* M-- M-u: Fixing Case. +* M-.: Find Tag. +* M-/: Dynamic Abbrevs. +* M-1: Arguments. +* M-;: Comments. +* M-<: Basic. +* M-< (Calendar mode): Move to Beginning or End. +* M-=: Position Info. +* M-= (Calendar mode): Mark and Region. +* M->: Basic. +* M-> (Calendar mode): Move to Beginning or End. +* M-?: Nroff Mode. +* M-@ <1>: Words. +* M-@: Marking Objects. +* M-[: Paragraphs. +* M-\ <1>: Indentation Commands. +* M-\: Killing. +* M-]: Paragraphs. +* M-^ <1>: Killing. +* M-^: Indentation Commands. +* M-a: Sentences. +* M-a (Calendar mode): Move to Beginning or End. +* M-b: Words. +* M-c: Case. +* M-C-s: Regexp Search. +* M-d <1>: Words. +* M-d: Killing. +* M-DEL <1>: Killing. +* M-DEL <2>: Kill Errors. +* M-DEL: Words. +* M-e: Sentences. +* M-e (Calendar mode): Move to Beginning or End. +* M-ESC: Lisp Eval. +* M-f: Words. +* M-g: Fill Commands. +* M-h <1>: Paragraphs. +* M-h: Marking Objects. +* M-i: Tab Stops. +* M-k <1>: Killing. +* M-k: Sentences. +* M-l: Case. +* M-LFD: Comments. +* M-LFD (Fortran mode): ForIndent Commands. +* M-m: Indentation Commands. +* M-n <1>: Nroff Mode. +* M-n: Repetition. +* M-n (isearch-mode): Incremental Search. +* M-n (Shell mode): Shell Mode. +* M-p <1>: Repetition. +* M-p: Nroff Mode. +* M-p (isearch-mode): Incremental Search. +* M-p (Shell mode): Shell Mode. +* M-q: Fill Commands. +* M-r: Basic. +* M-s: Fill Commands. +* M-SPC: Killing. +* M-t <1>: Transpose. +* M-t: Words. +* M-TAB <1>: Tabs in Picture. +* M-TAB: Lisp Completion. +* M-TAB (customization buffer): Changing an Option. +* M-TAB (isearch-mode): Incremental Search. +* M-u: Case. +* M-v <1>: Basic. +* M-v: Scrolling. +* M-v (Calendar mode): Scroll Calendar. +* M-w: Kill Ring. +* M-x: M-x. +* M-y: Earlier Kills. +* M-z: Killing. +* M-{ (Calendar mode): Calendar Unit Motion. +* M-|: Single Shell. +* M-} (Calendar mode): Calendar Unit Motion. +* M-~: Saving. +* META: Meta Key. +* meta key: Intro to Keystrokes. +* next: Scrolling. +* o (Calendar mode): Specified Dates. +* p (Calendar mode): To Other Calendar. +* p d (Calendar mode): General Calendar. +* PGDN: Basic. +* pgdn: Scrolling. +* PGUP: Basic. +* pgup: Scrolling. +* prior: Scrolling. +* q (Calendar mode): General Calendar. +* RET: Basic. +* RET (isearch-mode): Incremental Search. +* RET (Shell mode): Shell Mode. +* RIGHT: Basic. +* s (Calendar mode): Diary Commands. +* S (Calendar mode): Sunrise/Sunset. +* S-TAB (customization buffer): Changing an Option. +* shift key: Intro to Keystrokes. +* SPC: Completion. +* SPC (Calendar mode): General Calendar. +* SPC (query-replace): Query Replace. +* super key <1>: Intro to Keystrokes. +* super key <2>: Super and Hyper Keys. +* super key: Representing Keystrokes. +* t (Calendar mode): LaTeX Calendar. +* TAB <1>: String Key Sequences. +* TAB <2>: Major Modes. +* TAB <3>: Basic Indent. +* TAB <4>: Text Mode. +* TAB <5>: Completion. +* TAB: Indentation. +* TAB (customization buffer): Changing an Option. +* TAB (Shell mode): Shell Mode. +* u (Calendar mode) <1>: Diary Commands. +* u (Calendar mode): Holidays. +* UP: Basic. +* x (Calendar mode): Holidays. + diff --git a/info/xemacs.info-2 b/info/xemacs.info-2 index f2754c1..81da987 100644 --- a/info/xemacs.info-2 +++ b/info/xemacs.info-2 @@ -1,5 +1,5 @@ -This is ../info/xemacs.info, produced by makeinfo version 4.0 from -xemacs/xemacs.texi. +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -30,7 +30,7 @@ versions, except that the sections entitled "The GNU Manifesto", translation approved by the author instead of in the original English.  -File: xemacs.info, Node: Mode Line, Next: GUI Components, Prev: Echo Area, Up: Frame +File: xemacs.info, Node: Mode Line, Next: XEmacs under X, Prev: Echo Area, Up: Frame The Mode Line ============= @@ -122,219 +122,7 @@ terminal supports it); `nil' means no inverse video. The default is appropriately.  -File: xemacs.info, Node: GUI Components, Next: XEmacs under X, Prev: Mode Line, Up: Frame - -GUI Components -============== - - When executed in a graphical windowing environment such as the X -Window System or Microsoft Windows, XEmacs displays several graphical -user interface components such as scrollbars, menubars, toolbars, and -gutters. By default there is a vertical scrollbar at the right of each -frame, and at the top of the frame there is a menubar, a toolbar, and a -gutter, in that order. Gutters can contain any of several widgets, but -the default configuration puts a set of "notebook tabs" which you can -use as a shortcut for selecting any of several related buffers in a -given frame. Operating the GUI components is "obvious": click on the -menubar to pull down a menu, on a button in the toolbar to invoke a -function, and on a tab in the gutter to switch buffers. - -* Menu: - -* Menubar Basics:: How XEmacs uses the menubar. -* Scrollbar Basics:: How XEmacs uses scrollbars. -* Mode Line Basics:: How XEmacs uses modelines. -* Toolbar Basics:: How XEmacs uses toolbars. -* Gutter Basics:: How XEmacs uses gutters. -* Inhibiting:: What if you don't like GUI? -* Customizing:: Position, orientation, and appearance of GUI objects. - - -File: xemacs.info, Node: Menubar Basics, Next: Scrollbar Basics, Up: GUI Components - -The XEmacs Menubar -================== - - The XEmacs menubar is intended to be conformant to the usual -conventions for menubars, although conformance is not yet perfect. The -menu at the extreme right is the `Help' menu, which should always be -available. It provides access to all the XEmacs help facilities -available through `C-h', as well as samples of various configuration -files like `~/.Xdefaults' and `~/.emacs'. At the extreme left is the -`Files' menu, which provides the usual file reading, writing, and -printing operations, as well as operations like revert buffer from most -recent save. The next menu from the left is the `Edit' menu, which -provides the `Undo' operation as well as cutting and pasting, -searching, and keyboard macro definition and execution. - - XEmacs provides a very dynamic environment, and the Lisp language -makes for highly flexible applications. The menubar reflects this: -many menus (eg, the `Buffers' menu, *note Buffers Menu::) contain items -determined by the current state of XEmacs, and most major modes and many -minor modes add items to menus and even whole menus to the menubar. In -fact, some applications like w3.el and VM provide so many menus that -they define a whole new menubar and add a button that allows convenient -switching between the "XEmacs menubar" and the "application menubar". -Such applications normally bind themselves to a particular frame, and -this switching only takes place on frames where such an application is -active (ie, the current window of the frame is displaying a buffer in -the appropriate major mode). - - Other menus which are typically available are the `Options', -`Tools', `Buffers', `Apps', and `Mule' menus. For detailed -descriptions of these menus, *Note Pull-down Menus::. (In 21.2 -XEmacsen, the `Mule' menu will be moved under `Options'.) - - -File: xemacs.info, Node: Scrollbar Basics, Next: Mode Line Basics, Prev: Menubar Basics, Up: GUI Components - -XEmacs Scrollbars -================= - - XEmacs scrollbars provide the usual interface. Arrow buttons at -either end allow for line by line scrolling, including autorepeat. -Clicking in the scrollbar itself provides scrolling by windowsfull, -depending on which side of the slider is clicked. The slider itself -may be dragged for smooth scrolling. - - The position of the slider corresponds to the position of the window -in the buffer. In particular, the length of the slider is proportional -to the fraction of the buffer which appears in the window. - - The presence of the scrollbars is under control of the application or -may be customized by the user. By default a vertical scrollbar is -present in all windows (except the minibuffer), and there is no -horizontal scrollbar. - - -File: xemacs.info, Node: Mode Line Basics, Next: Toolbar Basics, Prev: Scrollbar Basics, Up: GUI Components - -XEmacs Mode Lines -================= - - When used in a windowing system, the XEmacs modelines can be dragged -vertically. The effect is to resize the windows above and below the -modeline (this includes the minibuffer window). - - Additionally, a modeline can be dragged horizontally, in which case -it scrolls its own text. This behavior is not enabled by default -because it could be considered as disturbing when dragging vertically. -When this behavior is enabled, the modeline's text can be dragged -either in the same direction as the mouse, or in the opposite sense, -making the modeline act as a scrollbar for its own text. - - You can select the behavior you want from the `Display' submenu of -the `Options' menu. - - -File: xemacs.info, Node: Toolbar Basics, Next: Gutter Basics, Prev: Mode Line Basics, Up: GUI Components - -XEmacs Toolbars -=============== - - XEmacs has a default toolbar which provides shortcuts for some of the -commonly used operations (such as opening files) and applications (such -as the Info manual reader). Operations which require arguments will pop -up dialogs to get them. - - The position of the default toolbar can be customized. Also, several -toolbars may be present simultaneously (in different positions). VM, -for example, provides an application toolbar which shortcuts for -mail-specific operations like sending, saving, and deleting messages. - - -File: xemacs.info, Node: Gutter Basics, Next: Inhibiting, Prev: Toolbar Basics, Up: GUI Components - -XEmacs Gutters -============== - - Gutters are the most flexible of the GUI components described in this -section. In theory, the other GUI components could be implemented by -customizing a gutter, but in practice the other components were -introduced earlier and have their own special implementations. Gutters -tend to be more transient than the other components. Buffer tabs, for -example, change every time the selected buffer in the frame changes. -And for progress gauges a gutter to contain the gauge is typically -created on the fly when needed, then destroyed when the operation whose -staus is being displayed is completed. - - Buffer tabs, having somewhat complex behavior, deserve a closer look. -By default, a row of buffer tabs is displayed at the top of every frame. -(The tabs could be placed in the bottom gutter, but would be oriented -the same way and look rather odd. The horizontal orientation makes -putting them in a side gutter utterly impractical.) The buffer -displayed in the current window of a frame can be changed to a specific -buffer by clicking [mouse-1] on the corresponding tab in the gutter. - - Each tab contains the name of its buffer. The tab for the current -buffer in each frame is displayed in raised relief. The list of buffers -chosen for display in the buffer tab row is derived by filtering the -buffer list (like the `Buffers' menu). The list starts out with all -existing buffers, with more recently selected buffers coming earlier in -the list. - - Then "uninteresting" buffers, like internal XEmacs buffers, the -`*Message Log*' buffer, and so on are deleted from the list. Next, the -frame's selected buffer is determined. Buffers with a different major -mode from the selected buffer are removed from the list. Finally, if -the list is too long, the least recently used buffers are deleted from -the list. By default up to 6 most recently used buffers with the same -mode are displayed on tabs in the gutter. - - -File: xemacs.info, Node: Inhibiting, Next: Customizing, Prev: Gutter Basics, Up: GUI Components - -Inhibiting Display of GUI Components -==================================== - - Use of GUI facilities is a personal thing. Almost everyone agrees -that drawing via keyboard-based "turtle graphics" is acceptable to -hardly anyone if a mouse is available, but conversely emulating a -keyboard with a screenful of buttons is a painful experience. But -between those extremes the complete novice will require a fair amount -of time before toolbars and menus become dispensable, but many an -"Ancien Haquer" sees them as a complete waste of precious frame space -that could be filled with text. - - Display of all of the GUI components created by XEmacs can be -inhibited through the use of Customize. Customize can be accessed -through `Options | Customize' in the menu bar, or via `M-x customize'. -Then navigate through the Customize tree to `Emacs | Environment'. -Scrollbar and toolbar visibility is controlled via the `Display' group, -options `Scrollbars visible' and `Toolbar visible' respectively. -Gutter visibility is controlled by group `Gutter', option `Visible'. - - Or they can be controlled directly by `M-x customize-variable', by -changing the values of the variables `menubar-visible-p', -`scrollbars-visible-p', `toolbar-visible-p', or -`gutter-buffers-tab-visible-p' respectively. (The strange form of the -last variable is due to the fact that gutters are often used to display -transient widgets like progress gauges, which you probably don't want -to inhibit. It is more likely that you want to inhibit the default -display of the buffers tab widget, which is what that variable controls. -This interface is subject to change depending on developer experience -and user feedback.) - - Control of frame configuration can controlled automatically -according to various parameters such as buffer or frame because these -are "specifiers" *Note Specifiers: (lispref)Specifiers. Using these -features requires programming in Lisp; Customize is not yet that -sophisticated. Also, components that appear in various positions and -orientations can have display suppressed according to position. `C-h a -visible-p' gives a list of variables which can be customized. E.g., to -control the visibility of specifically the left-side toolbar only, -customize `left-toolbar-visible-p'. - - -File: xemacs.info, Node: Customizing, Prev: Inhibiting, Up: GUI Components - -Changing the Position, Orientation, and Appearance of GUI Components -==================================================================== - - #### Not documented yet. - - -File: xemacs.info, Node: XEmacs under X, Next: XEmacs under MS Windows, Prev: GUI Components, Up: Frame +File: xemacs.info, Node: XEmacs under X, Prev: Mode Line, Up: Frame Using XEmacs Under the X Window System ====================================== @@ -347,7 +135,7 @@ manual for information on manipulating X windows. When you are working under X, each X window (that is, each XEmacs frame) has a menu bar for mouse-controlled operations (*note Pull-down -Menus::). +Menus::.). XEmacs under X is also a multi-frame XEmacs. You can use the New Frame menu item from the File menu to create a new XEmacs frame in a @@ -403,19 +191,6 @@ applies: things, and the title is simply what appears above the window.)  -File: xemacs.info, Node: XEmacs under MS Windows, Prev: XEmacs under X, Up: Frame - -Using XEmacs Under Microsoft Windows -==================================== - - Use of XEmacs under MS Windows is not separately documented here, but -most operations available under the X Window System are also available -with MS Windows. - - Where possible, native MS Windows GUI components and capabilities are -used in XEmacs. - - File: xemacs.info, Node: Keystrokes, Next: Pull-down Menus, Prev: Frame, Up: Top Keystrokes, Key Sequences, and Key Bindings @@ -548,7 +323,7 @@ sequence must make up a "prefix key sequence". Emacs represents a key sequence as a vector of keystrokes. Thus, the schematic representation of a complete key sequence is as follows: - [(modifier .. modifier keysym) ... (modifier .. modifier keysym)] + [(modifier .. modifer keysym) ... (modifier .. modifier keysym)] Here are some examples of complete key sequences: @@ -669,9 +444,9 @@ following: Create a file called `~/.xmodmap'. In this file, place the lines - 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 The first line says that the key that is currently called `Caps_Lock' should no longer behave as a "lock" key. The second line says that @@ -1051,7 +826,7 @@ Clear menu items. When you select a menu item, Emacs executes the equivalent command. Most commands on the Edit menu work on a block of text, the X selection. They appear faded until you select a block of text (activate a region) with the mouse. *Note Using X Selections::, -*note Killing::, and *note Yanking:: for more information. +*note Killing::., and *note Yanking::. for more information. Undo Undoes the previous command. Undo is equivalent to the Emacs @@ -1110,3 +885,264 @@ When you select a menu item, Emacs executes the equivalent command. For some of the menu items, there are sub-menus which you will need to select. + +File: xemacs.info, Node: Options Menu, Next: Buffers Menu, Prev: Apps Menu, Up: Pull-down Menus + +The Options Menu +---------------- + + The Options pull-down menu contains the Read Only, Case Sensitive +Search, Overstrike, Auto Delete Selection, Teach Extended Commands, +Syntax Highlighting, Paren Highlighting, Font, Size, Weight, Buffers +Menu Length..., Buffers Sub-Menus and Save Options menu items. When +you select a menu item, Emacs executes the equivalent command. For +some of the menu items, there are sub-menus which you will need to +select. + +Read Only + Selecting this item will cause the buffer to visit the file in a + read-only mode. Changes to the file will not be allowed. This is + equivalent to the Emacs command `toggle-read-only' (`C-x C-q'). + +Case Sensitive Search + Selecting this item will cause searches to be case-sensitive. If + its not selected then searches will ignore case. This option is + local to the buffer. + +Overstrike + After selecting this item, when you type letters they will replace + existing text on a one-to-one basis, rather than pushing it to the + right. At the end of a line, such characters extend the line. + Before a tab, such characters insert until the tab is filled in. + This is the same as Emacs command `quoted-insert' (`C-q'). + +Auto Delete Selection + Selecting this item will cause automatic deletion of the selected + region. The typed text will replace the selection if the selection + is active (i.e. if its highlighted). If the option is not selected + then the typed text is just inserted at the point. + +Teach Extended Commands + After you select this item, any time you execute a command with + `M-x'which has a shorter keybinding, you will be shown the + alternate binding before the command executes. + +Syntax Highlighting + You can customize your `.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 Fonts is selected, different parts of the program will + appear in different Fonts. When Colors is selected, then the + program will be displayed in different colors. Selecting None + causes the program to appear in just one Font and Color. Selecting + Less resets the Fonts and Colors to a fast, minimal set of + decorations. Selecting More resets the Fonts and Colors to a larger + set of decorations. For example, if Less is selected (which is the + default setting) then you might have all comments in green color. + Whereas, if More is selected then a function name in the comments + themselves might appear in a different Color or Font. + +Paren Highlighting + After selecting Blink from this item, if you place the cursor on a + parenthesis, the matching parenthesis will blink. If you select + Highlight and place the cursor on a parenthesis, the whole + expression of the parenthesis under the cursor will be highlighted. + Selecting None will turn off the options (regarding Paren + Highlighting) which you had selected earlier. + +Font + You can select any Font for your program by choosing from one of + the available Fonts. + +Size + You can select any size ranging from 2 to 24 by selecting the + appropriate option. + +Weight + You can choose either Bold or Medium for the weight. + +Buffers Menu Length... + Prompts you for the number of buffers to display. Then it will + display that number of most recently selected buffers. + +Buffers Sub-Menus + After selection of this item the Buffers menu will contain several + commands, as submenus of each buffer line. If this item is + unselected, then there are no submenus for each buffer line, the + only command available will be selecting that buffer. + +Save Options + Selecting this item will save the current settings of your Options + menu to your `.emacs' file. + + +File: xemacs.info, Node: Buffers Menu, Next: Tools Menu, Prev: Options Menu, Up: Pull-down Menus + +The Buffers Menu +---------------- + + The Buffers menu provides a selection of up to ten buffers and the +item List All Buffers, which provides a Buffer List. *Note List +Buffers::, for more information. + + +File: xemacs.info, Node: Tools Menu, Next: Help Menu, Prev: Buffers Menu, Up: Pull-down Menus + +The Tools Menu +-------------- + + The Tools pull-down menu contains the Grep..., Compile..., Shell +Command..., Shell Command on Region..., Debug(GDB)... and +Debug(DBX)... menu items, and the Compare, Merge, Apply Patch and Tags +sub-menus. When you select a menu item, Emacs executes the equivalent +command. For some of the menu items, there are sub-menus which you +will need to select. + + +File: xemacs.info, Node: Help Menu, Next: Menu Customization, Prev: Tools Menu, Up: Pull-down Menus + +The Help Menu +------------- + + The Help Menu gives you access to Emacs Info and provides a menu +equivalent for each of the choices you have when using `C-h'. *Note +Help::, for more information. + + The Help menu also gives access to UNIX online manual pages via the +UNIX Manual Page option. + + +File: xemacs.info, Node: Menu Customization, Prev: Help Menu, Up: Pull-down Menus + +Customizing XEmacs Menus +------------------------ + + You can customize any of the pull-down menus by adding or removing +menu items and disabling or enabling existing menu items. + + The following functions are available: +`add-menu: (MENU-PATH MENU-NAME MENU-ITEMS &OPTIONAL BEFORE)' + Add a menu to the menu bar or one of its submenus. + +`add-menu-item: (MENU-PATH ITEM-NAME FUNCTION ENABLED-P + &optional before)' Add a menu item to a menu, creating the menu + first if necessary. + +`delete-menu-item: (PATH)' + Remove the menu item defined by PATH from the menu hierarchy. + +`disable-menu-item: (PATH)' + Disable the specified menu item. + +`enable-menu-item: (PATH)' + Enable the specified previously disabled menu item. + +`relabel-menu-item: (PATH NEW-NAME)' + Change the string of the menu item specified by PATH to NEW-NAME. + + Use the function `add-menu' to add a new menu or submenu. If a menu +or submenu of the given name exists already, it is changed. + + MENU-PATH identifies the menu under which the new menu should be +inserted. It is a list of strings; for example, `("File")' names the +top-level File menu. `("File" "Foo")' names a hypothetical submenu of +File. If MENU-PATH is `nil', the menu is added to the menu bar itself. + + MENU-NAME is the string naming the menu to be added. + + MENU-ITEMS is a list of menu item descriptions. Each menu item +should be a vector of three elements: + + * A string, which is the name of the menu item + + * A symbol naming a command, or a form to evaluate + + * `t' or `nil' to indicate whether the item is selectable + + The optional argument BEFORE is the name of the menu before which +the new menu or submenu should be added. If the menu is already +present, it is not moved. + + The function `add-menu-item' adds a menu item to the specified menu, +creating the menu first if necessary. If the named item already +exists, the menu remains unchanged. + + MENU-PATH identifies the menu into which the new menu item should be +inserted. It is a list of strings; for example, `("File")' names the +top-level File menu. `("File" "Foo")' names a hypothetical submenu of +File. + + ITEM-NAME is the string naming the menu item to add. + + FUNCTION is the command to invoke when this menu item is selected. +If it is a symbol, it is invoked with `call-interactively', in the same +way that functions bound to keys are invoked. If it is a list, the +list is simply evaluated. + + ENABLED-P controls whether the item is selectable or not. It should +be `t', `nil', or a form to evaluate to decide. This form will be +evaluated just before the menu is displayed, and the menu item will be +selectable if that form returns non-`nil'. + + For example, to make the `rename-file' command available from the +File menu, use the following code: + + (add-menu-item '("File") "Rename File" 'rename-file t) + + To add a submenu of file management commands using a File Management +item, use the following code: + + (add-menu-item '("File" "File Management") "Copy File" 'copy-file t) + (add-menu-item '("File" "File Management") "Delete File" 'delete-file t) + (add-menu-item '("File" "File Management") "Rename File" 'rename-file t) + + The optional BEFORE argument is the name of a menu item before which +the new item should be added. If the item is already present, it is +not moved. + + To remove a specified menu item from the menu hierarchy, use +`delete-menu-item'. + + PATH is a list of strings that identify the position of the menu +item in the menu hierarchy. `("File" "Save")' means the menu item +called Save under the top level File menu. `("Menu" "Foo" "Item")' +means the menu item called Item under the Foo submenu of Menu. + + To disable a menu item, use `disable-menu-item'. The disabled menu +item is grayed and can no longer be selected. To make the item +selectable again, use `enable-menu-item'. `disable-menu-item' and +`enable-menu-item' both have the argument PATH. + + To change the string of the specified menu item, use +`relabel-menu-item'. This function also takes the argument PATH. + + NEW-NAME is the string to which the menu item will be changed. + + +File: xemacs.info, Node: Entering Emacs, Next: Exiting, Prev: Pull-down Menus, Up: Top + +Entering and Exiting Emacs +************************** + + The usual way to invoke Emacs is to type `emacs ' at the shell +(for XEmacs, type `xemacs '). Emacs clears the screen and then +displays an initial advisory message and copyright notice. You can +begin typing Emacs commands immediately afterward. + + Some operating systems insist on discarding all type-ahead when 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. + + 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 `*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 `initial-major-mode' +in your init file. *Note Init 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. + diff --git a/info/xemacs.info-20 b/info/xemacs.info-20 new file mode 100644 index 0000000..aaede94 --- /dev/null +++ b/info/xemacs.info-20 @@ -0,0 +1,765 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Command Index, Next: Variable Index, Prev: Key Index, Up: Top + +Command and Function Index +************************** + +* Menu: + +* abbrev-mode <1>: Abbrevs. +* abbrev-mode: Minor Modes. +* abbrev-prefix-mark: Expanding Abbrevs. +* abort-recursive-edit <1>: Recursive Edit. +* abort-recursive-edit: Quitting. +* add-change-log-entry: Change Log. +* add-global-abbrev: Defining Abbrevs. +* add-menu: Menu Customization. +* add-menu-item: Menu Customization. +* add-mode-abbrev: Defining Abbrevs. +* add-name-to-file: Misc File Ops. +* american-calendar: Date Formats. +* append-next-kill: Appending Kills. +* append-to-buffer: Accumulating Text. +* append-to-file <1>: Misc File Ops. +* append-to-file: Accumulating Text. +* apropos: Help. +* ask-user-about-lock: Interlocking. +* auto-fill-mode <1>: Minor Modes. +* auto-fill-mode: Auto Fill. +* auto-save-mode: Auto Save Control. +* back-to-indentation: Indentation Commands. +* backward-char: Basic. +* backward-delete-char-untabify: Program Modes. +* backward-kill-sentence <1>: Kill Errors. +* backward-kill-sentence <2>: Sentences. +* backward-kill-sentence: Killing. +* backward-kill-word <1>: Kill Errors. +* backward-kill-word <2>: Words. +* backward-kill-word: Killing. +* backward-list: Lists. +* backward-page: Pages. +* backward-paragraph: Paragraphs. +* backward-sentence: Sentences. +* backward-sexp: Lists. +* backward-text-line: Nroff Mode. +* backward-up-list: Lists. +* backward-word: Words. +* batch-byte-compile: Compiling Libraries. +* beginning-of-buffer: Basic. +* beginning-of-defun: Defuns. +* beginning-of-fortran-subprogram: Fortran Motion. +* beginning-of-line: Basic. +* buffer-menu: Several Buffers. +* byte-compile-and-load-file: Compiling Libraries. +* byte-compile-buffer: Compiling Libraries. +* byte-compile-file: Compiling Libraries. +* byte-recompile-directory: Compiling Libraries. +* c-indent-line: Basic Indent. +* calendar: Calendar/Diary. +* calendar-backward-day: Calendar Unit Motion. +* calendar-backward-month: Calendar Unit Motion. +* calendar-backward-week: Calendar Unit Motion. +* calendar-beginning-of-month: Move to Beginning or End. +* calendar-beginning-of-week: Move to Beginning or End. +* calendar-beginning-of-year: Move to Beginning or End. +* calendar-count-days-region: Mark and Region. +* calendar-cursor-holidays: Holidays. +* calendar-end-of-month: Move to Beginning or End. +* calendar-end-of-week: Move to Beginning or End. +* calendar-end-of-year: Move to Beginning or End. +* calendar-exchange-point-and-mark: Mark and Region. +* calendar-forward-day: Calendar Unit Motion. +* calendar-forward-month: Calendar Unit Motion. +* calendar-forward-week: Calendar Unit Motion. +* calendar-forward-year: Calendar Unit Motion. +* calendar-goto-astro-day-number: From Other Calendar. +* calendar-goto-chinese-date: From Other Calendar. +* calendar-goto-coptic-date: From Other Calendar. +* calendar-goto-date: Specified Dates. +* calendar-goto-ethiopic-date: From Other Calendar. +* calendar-goto-french-date: From Other Calendar. +* calendar-goto-hebrew-date: From Other Calendar. +* calendar-goto-islamic-date: From Other Calendar. +* calendar-goto-iso-date: From Other Calendar. +* calendar-goto-julian-date: From Other Calendar. +* calendar-goto-mayan-long-count-date: Mayan Calendar. +* calendar-goto-persian-date: From Other Calendar. +* calendar-goto-today: Specified Dates. +* calendar-mark-today: Calendar Customizing. +* calendar-next-calendar-round-date: Mayan Calendar. +* calendar-next-haab-date: Mayan Calendar. +* calendar-next-tzolkin-date: Mayan Calendar. +* calendar-other-month: Specified Dates. +* calendar-phases-of-moon: Lunar Phases. +* calendar-previous-haab-date: Mayan Calendar. +* calendar-previous-tzolkin-date: Mayan Calendar. +* calendar-print-astro-day-number: To Other Calendar. +* calendar-print-chinese-date: To Other Calendar. +* calendar-print-coptic-date: To Other Calendar. +* calendar-print-day-of-year: General Calendar. +* calendar-print-ethiopic-date: To Other Calendar. +* calendar-print-french-date: To Other Calendar. +* calendar-print-hebrew-date: To Other Calendar. +* calendar-print-islamic-date: To Other Calendar. +* calendar-print-iso-date: To Other Calendar. +* calendar-print-julian-date: To Other Calendar. +* calendar-print-mayan-date: To Other Calendar. +* calendar-print-persian-date: To Other Calendar. +* calendar-set-mark: Mark and Region. +* calendar-star-date: Calendar Customizing. +* calendar-sunrise-sunset: Sunrise/Sunset. +* calendar-unmark <1>: Diary Commands. +* calendar-unmark: Holidays. +* call-last-kbd-macro: Basic Kbd Macro. +* cancel-debug-on-entry: Lisp Debug. +* capitalize-word <1>: Fixing Case. +* capitalize-word: Case. +* center-line: Fill Commands. +* clear-rectangle: Rectangles. +* comint-delchar-or-maybe-eof: Shell Mode. +* comint-dynamic-complete: Shell Mode. +* comint-next-input: Shell Mode. +* comint-previous-input: Shell Mode. +* command-apropos: Help. +* compare-windows <1>: Other Window. +* compare-windows: Comparing Files. +* compile: Compilation. +* compile-defun: Defuns. +* convert-mocklisp-buffer: Mocklisp. +* conx: CONX. +* conx-buffer: CONX. +* conx-init: CONX. +* conx-load: CONX. +* conx-region: CONX. +* conx-save: CONX. +* copy-file: Misc File Ops. +* copy-last-shell-input: Shell Mode. +* copy-region-as-kill: Kill Ring. +* copy-region-to-rectangle: RegRect. +* copy-to-buffer: Accumulating Text. +* copy-to-register: RegText. +* count-lines-page: Pages. +* count-lines-region: Position Info. +* count-matches: Other Repeating Search. +* count-text-lines: Nroff Mode. +* customize: Easy Customization. +* customize-apropos: Specific Customization. +* customize-browse: Customization Groups. +* customize-customized: Specific Customization. +* customize-face: Specific Customization. +* customize-group: Specific Customization. +* customize-option: Specific Customization. +* customize-saved: Specific Customization. +* dabbrev-expand: Dynamic Abbrevs. +* debug: Lisp Debug. +* debug-on-entry: Lisp Debug. +* default-value: Locals. +* define-abbrevs: Saving Abbrevs. +* define-key <1>: Programmatic Rebinding. +* define-key: Interactive Rebinding. +* delete-backward-char <1>: Basic. +* delete-backward-char <2>: Killing. +* delete-backward-char: Kill Errors. +* delete-blank-lines <1>: Killing. +* delete-blank-lines: Blank Lines. +* delete-char <1>: Basic Picture. +* delete-char: Killing. +* delete-file: Misc File Ops. +* delete-horizontal-space <1>: Indentation Commands. +* delete-horizontal-space: Killing. +* delete-indentation <1>: Indentation Commands. +* delete-indentation: Killing. +* delete-matching-lines: Other Repeating Search. +* delete-menu-item: Menu Customization. +* delete-non-matching-lines: Other Repeating Search. +* delete-other-windows: Change Window. +* delete-rectangle: Rectangles. +* delete-window: Change Window. +* describe-bindings: Help. +* describe-calendar-mode: General Calendar. +* describe-coding-system: Coding Systems. +* describe-copying: Help. +* describe-distribution: Help. +* describe-function <1>: Help. +* describe-function: Documentation. +* describe-input-method: Select Input Method. +* describe-key: Help. +* describe-key-briefly: Help. +* describe-language-environment: Language Environments. +* describe-mode: Help. +* describe-no-warranty: Help. +* describe-syntax: Syntax Change. +* describe-variable <1>: Documentation. +* describe-variable <2>: Examining. +* describe-variable: Help. +* diary: Diary Commands. +* diary-anniversary <1>: Special Diary Entries. +* diary-anniversary: Sexp Diary Entries. +* diary-astro-day-number: Sexp Diary Entries. +* diary-block: Special Diary Entries. +* diary-cyclic <1>: Special Diary Entries. +* diary-cyclic: Sexp Diary Entries. +* diary-day-of-year: Sexp Diary Entries. +* diary-float: Special Diary Entries. +* diary-french-date: Sexp Diary Entries. +* diary-hebrew-date: Sexp Diary Entries. +* diary-islamic-date: Sexp Diary Entries. +* diary-iso-date: Sexp Diary Entries. +* diary-julian-date: Sexp Diary Entries. +* diary-mail-entries: Diary Commands. +* diary-mayan-date: Sexp Diary Entries. +* diary-omer: Sexp Diary Entries. +* diary-parasha: Sexp Diary Entries. +* diary-phases-of-moon: Sexp Diary Entries. +* diary-rosh-hodesh: Sexp Diary Entries. +* diary-sabbath-candles: Sexp Diary Entries. +* diary-sunrise-sunset: Sexp Diary Entries. +* diary-yahrzeit: Sexp Diary Entries. +* diff: Comparing Files. +* diff-backup: Comparing Files. +* digit-argument: Arguments. +* dired: Dired Enter. +* dired-other-window <1>: Pop Up Window. +* dired-other-window: Dired Enter. +* disable-command: Disabling. +* disable-menu-item: Menu Customization. +* disassemble: Compiling Libraries. +* display-time: Mode Line. +* dissociated-press: Dissociated Press. +* do-auto-save: Auto Save Control. +* doctor: Total Frustration. +* down-list: Lists. +* downcase-region: Case. +* downcase-word <1>: Case. +* downcase-word: Fixing Case. +* edit-abbrevs: Editing Abbrevs. +* edit-abbrevs-redefine: Editing Abbrevs. +* edit-options: Edit Options. +* edit-picture: Picture. +* edit-tab-stops <1>: Text Mode. +* edit-tab-stops: Tab Stops. +* edit-tab-stops-note-changes: Tab Stops. +* edt-emulation-off: Emulation. +* edt-emulation-on: Emulation. +* electric-nroff-mode: Nroff Mode. +* emacs-lisp-mode: Lisp Eval. +* emacs-version: Bugs. +* enable-command: Disabling. +* enable-menu-item: Menu Customization. +* end-kbd-macro: Basic Kbd Macro. +* end-of-buffer: Basic. +* end-of-defun: Defuns. +* end-of-fortran-subprogram: Fortran Motion. +* end-of-line: Basic. +* enlarge-window: Change Window. +* enlarge-window-horizontally: Change Window. +* european-calendar: Date Formats. +* eval-current-buffer: Lisp Eval. +* eval-defun: Lisp Eval. +* eval-expression: Lisp Eval. +* eval-last-sexp: Lisp Eval. +* eval-region: Lisp Eval. +* exchange-point-and-mark: Setting Mark. +* execute-extended-command: M-x. +* exit-calendar: General Calendar. +* exit-recursive-edit: Recursive Edit. +* expand-abbrev: Expanding Abbrevs. +* expand-region-abbrevs: Expanding Abbrevs. +* fancy-diary-display: Fancy Diary Display. +* fill-individual-paragraphs: Fill Prefix. +* fill-paragraph: Fill Commands. +* fill-region: Fill Commands. +* fill-region-as-paragraph: Fill Commands. +* find-alternate-file: Visiting. +* find-file: Visiting. +* find-file-other-frame <1>: XEmacs under X. +* find-file-other-frame: Visiting. +* find-file-other-window <1>: Pop Up Window. +* find-file-other-window: Visiting. +* find-tag: Find Tag. +* find-tag-other-window <1>: Find Tag. +* find-tag-other-window: Pop Up Window. +* find-this-file: Visiting. +* find-this-file-other-window: Visiting. +* fortran-column-ruler: Fortran Columns. +* fortran-comment-region: Fortran Comments. +* fortran-indent-line: ForIndent Commands. +* fortran-indent-subprogram: ForIndent Commands. +* fortran-mode: Fortran. +* fortran-next-statement: Fortran Motion. +* fortran-previous-statement: Fortran Motion. +* fortran-split-line: ForIndent Commands. +* fortran-window-create: Fortran Columns. +* forward-char: Basic. +* forward-list: Lists. +* forward-page: Pages. +* forward-paragraph: Paragraphs. +* forward-sentence: Sentences. +* forward-sexp: Lists. +* forward-text-line: Nroff Mode. +* forward-word: Words. +* global-set-key <1>: Interactive Rebinding. +* global-set-key: Programmatic Rebinding. +* goto-char: Basic. +* goto-line: Basic. +* hanoi: Amusements. +* help-with-tutorial <1>: Help. +* help-with-tutorial: Basic. +* hide-body: Outline Visibility. +* hide-entry: Outline Visibility. +* hide-leaves: Outline Visibility. +* hide-subtree: Outline Visibility. +* holidays: Holidays. +* include-other-diary-files: Included Diary Files. +* indent-c-exp: Multi-line Indent. +* indent-for-comment: Comments. +* indent-new-comment-line: Comments. +* indent-region <1>: Multi-line Indent. +* indent-region: Indentation Commands. +* indent-relative: Indentation Commands. +* indent-rigidly: Indentation Commands. +* indent-sexp: Multi-line Indent. +* indented-text-mode: Text Mode. +* info: Help. +* insert-abbrevs: Saving Abbrevs. +* insert-anniversary-diary-entry: Special Diary Entries. +* insert-block-diary-entry: Special Diary Entries. +* insert-cyclic-diary-entry: Special Diary Entries. +* insert-diary-entry: Adding to Diary. +* insert-file: Misc File Ops. +* insert-hebrew-diary-entry: Hebrew/Islamic Entries. +* insert-islamic-diary-entry: Hebrew/Islamic Entries. +* insert-kbd-macro: Save Kbd Macro. +* insert-monthly-diary-entry: Adding to Diary. +* insert-monthly-hebrew-diary-entry: Hebrew/Islamic Entries. +* insert-monthly-islamic-diary-entry: Hebrew/Islamic Entries. +* insert-parentheses: Balanced Editing. +* insert-register: RegText. +* insert-weekly-diary-entry: Adding to Diary. +* insert-yearly-diary-entry: Adding to Diary. +* insert-yearly-hebrew-diary-entry: Hebrew/Islamic Entries. +* insert-yearly-islamic-diary-entry: Hebrew/Islamic Entries. +* interactive: M-x. +* interrupt-shell-subjob: Shell Mode. +* inverse-add-global-abbrev: Defining Abbrevs. +* inverse-add-mode-abbrev: Defining Abbrevs. +* invert-face: Faces. +* isearch-abort: Incremental Search. +* isearch-backward: Incremental Search. +* isearch-backward-regexp: Regexp Search. +* isearch-complete: Incremental Search. +* isearch-delete-char: Incremental Search. +* isearch-exit: Incremental Search. +* isearch-forward: Incremental Search. +* isearch-forward-regexp: Regexp Search. +* isearch-quote-char: Incremental Search. +* isearch-repeat-backward: Incremental Search. +* isearch-repeat-forward: Incremental Search. +* isearch-ring-advance: Incremental Search. +* isearch-ring-retreat: Incremental Search. +* isearch-yank-line: Incremental Search. +* isearch-yank-word: Incremental Search. +* jump-to-register: Split Window. +* just-one-space: Killing. +* kbd-macro-query: Kbd Macro Query. +* kill-all-abbrevs: Defining Abbrevs. +* kill-buffer: Kill Buffer. +* kill-comment: Comments. +* kill-compilation: Compilation. +* kill-line: Killing. +* kill-local-variable: Locals. +* kill-output-from-shell: Shell Mode. +* kill-rectangle: Rectangles. +* kill-region: Killing. +* kill-sentence <1>: Killing. +* kill-sentence: Sentences. +* kill-sexp <1>: Lists. +* kill-sexp: Killing. +* kill-some-buffers: Kill Buffer. +* kill-word <1>: Words. +* kill-word: Killing. +* latex-mode: TeX Mode. +* LaTeX-mode: TeX Mode. +* lisp-complete-symbol: Lisp Completion. +* lisp-indent-line: Basic Indent. +* lisp-interaction-mode: Lisp Interaction. +* lisp-mode: External Lisp. +* lisp-send-defun: External Lisp. +* list-abbrevs: Editing Abbrevs. +* list-buffers: List Buffers. +* list-calendar-holidays: Holidays. +* list-coding-systems: Coding Systems. +* list-command-history: Repetition. +* list-directory: ListDir. +* list-hebrew-diary-entries: Hebrew/Islamic Entries. +* list-holidays: Holidays. +* list-input-methods: Select Input Method. +* list-islamic-diary-entries: Hebrew/Islamic Entries. +* list-matching-lines: Other Repeating Search. +* list-options: Edit Options. +* list-tags: List Tags. +* list-yahrzeit-dates: From Other Calendar. +* load: Loading. +* load-default-sounds: Audible Bell. +* load-file: Loading. +* load-library <1>: Startup Paths. +* load-library: Loading. +* load-sound-file: Audible Bell. +* local-set-key: Interactive Rebinding. +* local-unset-key: Interactive Rebinding. +* locate-library: Loading. +* lpr-buffer: Hardcopy. +* lpr-region: Hardcopy. +* mail: Sending Mail. +* mail-cc: Mail Mode. +* mail-fill-yanked-message: Mail Mode. +* mail-interactive-insert-alias: Mail Headers. +* mail-other-window <1>: Pop Up Window. +* mail-other-window: Sending Mail. +* mail-send: Mail Mode. +* mail-send-and-exit: Mail Mode. +* mail-signature: Mail Mode. +* mail-subject: Mail Mode. +* mail-to: Mail Mode. +* mail-yank-original: Mail Mode. +* make-directory: File Names. +* make-face-bold: Faces. +* make-face-bold-italic: Faces. +* make-face-italic: Faces. +* make-face-larger: Faces. +* make-face-smaller: Faces. +* make-face-unbold: Faces. +* make-face-unitalic: Faces. +* make-frame: XEmacs under X. +* make-local-variable: Locals. +* make-obsolete: Compiling Libraries. +* make-symbolic-link: Misc File Ops. +* make-variable-buffer-local: Locals. +* manual-entry: Documentation. +* mark-beginning-of-buffer: Setting Mark. +* mark-calendar-holidays: Holidays. +* mark-defun <1>: Defuns. +* mark-defun: Marking Objects. +* mark-diary-entries: Diary Commands. +* mark-end-of-buffer: Setting Mark. +* mark-fortran-subprogram: Fortran Motion. +* mark-hebrew-diary-entries: Hebrew/Islamic Entries. +* mark-included-diary-files: Included Diary Files. +* mark-islamic-diary-entries: Hebrew/Islamic Entries. +* mark-page <1>: Pages. +* mark-page: Marking Objects. +* mark-paragraph <1>: Paragraphs. +* mark-paragraph: Marking Objects. +* mark-sexp <1>: Marking Objects. +* mark-sexp: Lists. +* mark-whole-buffer: Marking Objects. +* mark-word <1>: Words. +* mark-word: Marking Objects. +* minibuffer-complete: Completion. +* minibuffer-complete-word: Completion. +* modify-syntax-entry: Syntax Change. +* mouse-del-char: Additional Mouse Operations. +* mouse-delete-window: Additional Mouse Operations. +* mouse-keep-one-window: Additional Mouse Operations. +* mouse-kill-line: Additional Mouse Operations. +* mouse-line-length: Additional Mouse Operations. +* mouse-scroll: Additional Mouse Operations. +* mouse-select: Additional Mouse Operations. +* mouse-select-and-split: Additional Mouse Operations. +* mouse-set-mark: Additional Mouse Operations. +* mouse-set-point: Additional Mouse Operations. +* mouse-track: Additional Mouse Operations. +* mouse-track-adjust: Additional Mouse Operations. +* mouse-track-and-copy-to-cutbuffer: Additional Mouse Operations. +* mouse-track-delete-and-insert: Additional Mouse Operations. +* move-over-close-and-reindent: Balanced Editing. +* move-to-window-line: Basic. +* name-last-kbd-macro: Save Kbd Macro. +* narrow-to-region: Narrowing. +* negative-argument: Arguments. +* newline: Basic. +* newline-and-indent: Basic Indent. +* next-complex-command: Repetition. +* next-error: Compilation. +* next-line: Basic. +* not-modified: Saving. +* nroff-mode: Nroff Mode. +* occur: Other Repeating Search. +* open-dribble-file: Bugs. +* open-line: Blank Lines. +* open-rectangle: Rectangles. +* open-termscript: Bugs. +* other-window: Other Window. +* other-window-any-frame: Other Window. +* outline-backward-same-level: Outline Motion. +* outline-forward-same-level: Outline Motion. +* outline-next-visible-heading: Outline Motion. +* outline-previous-visible-heading: Outline Motion. +* outline-up-heading: Outline Motion. +* overwrite-mode: Minor Modes. +* phases-of-moon: Lunar Phases. +* picture-backward-clear-column: Basic Picture. +* picture-backward-column: Basic Picture. +* picture-clear-column: Basic Picture. +* picture-clear-line: Basic Picture. +* picture-clear-rectangle: Rectangles in Picture. +* picture-clear-rectangle-to-register: Rectangles in Picture. +* picture-forward-column: Basic Picture. +* picture-motion: Insert in Picture. +* picture-motion-reverse: Insert in Picture. +* picture-move-down: Basic Picture. +* picture-move-up: Basic Picture. +* picture-movement-down: Insert in Picture. +* picture-movement-left: Insert in Picture. +* picture-movement-ne: Insert in Picture. +* picture-movement-nw: Insert in Picture. +* picture-movement-right: Insert in Picture. +* picture-movement-se: Insert in Picture. +* picture-movement-sw: Insert in Picture. +* picture-movement-up: Insert in Picture. +* picture-newline: Basic Picture. +* picture-open-line: Basic Picture. +* picture-set-tab-stops: Tabs in Picture. +* picture-tab: Tabs in Picture. +* picture-tab-search: Tabs in Picture. +* picture-yank-rectangle: Rectangles in Picture. +* picture-yank-rectangle-from-register: Rectangles in Picture. +* plain-tex-mode: TeX Mode. +* plain-TeX-mode: TeX Mode. +* play-sound: Audible Bell. +* point-to-register: RegPos. +* prefer-coding-system: Recognize Coding. +* prepend-to-buffer: Accumulating Text. +* previous-complex-command: Repetition. +* previous-line: Basic. +* print-buffer: Hardcopy. +* print-diary-entries <1>: Diary Customizing. +* print-diary-entries: Diary Commands. +* print-region: Hardcopy. +* quail-set-keyboard-layout: Select Input Method. +* query-replace: Query Replace. +* query-replace-regexp: Query Replace. +* quietly-read-abbrev-file: Saving Abbrevs. +* quit-shell-subjob: Shell Mode. +* quoted-insert: Basic. +* re-search-backward: Regexp Search. +* re-search-forward: Regexp Search. +* read-abbrev-file: Saving Abbrevs. +* read-key-sequence: Representing Keystrokes. +* recenter <1>: Scrolling. +* recenter: Basic. +* recover-file: Recover. +* redraw-calendar: General Calendar. +* register-to-point: RegPos. +* relabel-menu-item: Menu Customization. +* remove-directory: File Names. +* rename-buffer: Misc Buffer. +* rename-file: Misc File Ops. +* repeat-complex-command: Repetition. +* replace-regexp: Unconditional Replace. +* replace-string: Unconditional Replace. +* revert-buffer: Reverting. +* run-lisp: External Lisp. +* save-buffer: Saving. +* save-buffers-kill-emacs: Exiting. +* save-some-buffers: Saving. +* scroll-calendar-left: Scroll Calendar. +* scroll-calendar-left-three-months: Scroll Calendar. +* scroll-calendar-right: Scroll Calendar. +* scroll-calendar-right-three-months: Scroll Calendar. +* scroll-down: Scrolling. +* scroll-left: Horizontal Scrolling. +* scroll-other-window <1>: Other Window. +* scroll-other-window: General Calendar. +* scroll-right: Horizontal Scrolling. +* scroll-up: Scrolling. +* search-backward: Non-Incremental Search. +* search-forward: Non-Incremental Search. +* select-input-method: Select Input Method. +* self-insert: Basic. +* send-shell-input: Shell Mode. +* set-buffer-file-coding-system: Specify Coding. +* set-buffer-process-coding-system: Specify Coding. +* set-comment-column: Comments. +* set-default-file-modes: Interlocking. +* set-face-background: Faces. +* set-face-background-pixmap: Faces. +* set-face-font: Faces. +* set-face-foreground: Faces. +* set-face-underline-p: Faces. +* set-fill-column: Fill Commands. +* set-fill-prefix: Fill Prefix. +* set-gnu-bindings: Emulation. +* set-goal-column: Basic. +* set-gosmacs-bindings: Emulation. +* set-keyboard-coding-system: Specify Coding. +* set-language-environment: Language Environments. +* set-mark-command: Setting Mark. +* set-selective-display: Selective Display. +* set-terminal-coding-system: Specify Coding. +* set-variable: Examining. +* set-visited-file-name: Saving. +* setq-default: Locals. +* shell: Interactive Shell. +* shell-command: Single Shell. +* shell-command-on-region: Single Shell. +* shell-send-eof: Shell Mode. +* show-all: Outline Visibility. +* show-all-diary-entries: Diary Commands. +* show-branches: Outline Visibility. +* show-children: Outline Visibility. +* show-entry: Outline Visibility. +* show-output-from-shell: Shell Mode. +* show-subtree: Outline Visibility. +* simple-diary-display: Fancy Diary Display. +* sort-columns: Sorting. +* sort-diary-entries: Fancy Diary Display. +* sort-fields: Sorting. +* sort-lines: Sorting. +* sort-numeric-fields: Sorting. +* sort-pages: Sorting. +* sort-paragraphs: Sorting. +* spell-buffer: Spelling. +* spell-region: Spelling. +* spell-string: Spelling. +* spell-word: Spelling. +* split-line: Indentation Commands. +* split-window-horizontally: Split Window. +* split-window-vertically: Split Window. +* start-kbd-macro: Basic Kbd Macro. +* stop-shell-subjob: Shell Mode. +* substitute-key-definition: Interactive Rebinding. +* sunrise-sunset: Sunrise/Sunset. +* suspend-emacs: Exiting. +* switch-to-buffer: Select Buffer. +* switch-to-buffer-other-frame <1>: XEmacs under X. +* switch-to-buffer-other-frame: Select Buffer. +* switch-to-buffer-other-window <1>: Select Buffer. +* switch-to-buffer-other-window: Pop Up Window. +* switch-to-other-buffer: Select Buffer. +* tab-to-tab-stop <1>: Tab Stops. +* tab-to-tab-stop: Text Mode. +* tabify: Just Spaces. +* tags-apropos: List Tags. +* tags-loop-continue: Tags Search. +* tags-query-replace: Tags Search. +* tags-search: Tags Search. +* term: Terminal emulator. +* term-line-mode: Term Mode. +* term-pager-toggle: Paging in Term. +* tex-buffer: TeX Print. +* tex-close-latex-block: TeX Editing. +* tex-insert-braces: TeX Editing. +* tex-insert-quote: TeX Editing. +* tex-kill-job: TeX Print. +* TeX-mode: TeX Mode. +* tex-mode: TeX Mode. +* tex-print: TeX Print. +* tex-recenter-output-buffer: TeX Print. +* tex-region: TeX Print. +* tex-show-print-queue: TeX Print. +* tex-terminate-paragraph: TeX Editing. +* text-mode: Text Mode. +* toggle-input-method: Select Input Method. +* toggle-read-only: Misc Buffer. +* top-level <1>: Recursive Edit. +* top-level: Quitting. +* transpose-chars <1>: Basic. +* transpose-chars: Transpose. +* transpose-lines: Transpose. +* transpose-sexps <1>: Lists. +* transpose-sexps: Transpose. +* transpose-words <1>: Transpose. +* transpose-words: Words. +* undo: Undo. +* unexpand-abbrev: Expanding Abbrevs. +* universal-argument: Arguments. +* universal-coding-system-argument: Specify Coding. +* untabify: Just Spaces. +* up-list: TeX Editing. +* upcase-region: Case. +* upcase-word <1>: Fixing Case. +* upcase-word: Case. +* validate-tex-buffer: TeX Editing. +* vc-cancel-version: Editing with VC. +* vc-create-snapshot: Making Snapshots. +* vc-diff: Old Versions. +* vc-directory: VC Status. +* vc-insert-headers: Version Headers. +* vc-next-action: Editing with VC. +* vc-print-log: VC Status. +* vc-register: Editing with VC. +* vc-rename-file: Renaming and VC. +* vc-retrieve-snapshot: Making Snapshots. +* vc-revert-buffer: Editing with VC. +* vc-update-change-log: Change Logs and VC. +* vc-version-other-window: Old Versions. +* view-buffer: Misc Buffer. +* view-diary-entries: Diary Commands. +* view-emacs-news: Help. +* view-file: Misc File Ops. +* view-hello-file: Mule Intro. +* view-lossage: Help. +* view-register: Registers. +* visit-tags-table: Select Tags Table. +* what-cursor-position: Position Info. +* what-line: Position Info. +* what-page: Position Info. +* where-is: Help. +* widen: Narrowing. +* widget-backward: Changing an Option. +* widget-complete: Changing an Option. +* widget-forward: Changing an Option. +* window-configuration-to-register: Split Window. +* word-search-backward: Word Search. +* word-search-forward: Word Search. +* write-abbrev-file: Saving Abbrevs. +* write-file: Saving. +* x-copy-primary-selection: X Selection Commands. +* x-create-frame: X Resources. +* x-delete-primary-selection: X Selection Commands. +* x-insert-selection: X Selection Commands. +* x-kill-primary-selection: X Selection Commands. +* x-mouse-kill: X Selection Commands. +* x-own-secondary-selection: X Selection Commands. +* x-own-selection: X Selection Commands. +* x-set-point-and-insert-selection: X Selection Commands. +* Yank: Kill Ring. +* yank-pop: Earlier Kills. +* yank-rectangle: Rectangles. +* yow: Amusements. +* zap-to-char: Killing. +* zmacs-activate-region: Active Regions. +* zmacs-deactivate-region: Active Regions. + diff --git a/info/xemacs.info-21 b/info/xemacs.info-21 new file mode 100644 index 0000000..cc7f100 --- /dev/null +++ b/info/xemacs.info-21 @@ -0,0 +1,782 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Variable Index, Next: Concept Index, Prev: Command Index, Up: Top + +Variable Index +************** + +* Menu: + +* abbrev-all-caps: Expanding Abbrevs. +* abbrev-file-name: Saving Abbrevs. +* abbrev-mode: Abbrevs. +* after-load-alist: Loading. +* after-save-hook: Saving. +* all-christian-calendar-holidays: Holiday Customizing. +* all-hebrew-calendar-holidays: Holiday Customizing. +* all-islamic-calendar-holidays: Holiday Customizing. +* appt-audible: Appt Customizing. +* appt-display-duration: Appt Customizing. +* appt-display-mode-line: Appt Customizing. +* appt-message-warning-time: Appt Customizing. +* appt-msg-window: Appt Customizing. +* appt-visible: Appt Customizing. +* auto-fill-inhibit-regexp: Fill Commands. +* auto-lower-frame: XEmacs under X. +* auto-mode-alist: Choosing Modes. +* auto-raise-frame: XEmacs under X. +* auto-save-default: Auto Save Control. +* auto-save-interval: Auto Save Control. +* auto-save-timeout: Auto Save Control. +* auto-save-visited-file-name: Auto Save Files. +* backup-by-copying: Backup Copying. +* backup-by-copying-when-linked: Backup Copying. +* backup-by-copying-when-mismatch: Backup Copying. +* bell-volume: Audible Bell. +* blink-matching-paren: Matching. +* blink-matching-paren-distance: Matching. +* buffer-file-coding-system: Recognize Coding. +* buffer-file-name: Visiting. +* buffer-file-truename: Visiting. +* buffer-read-only: Misc Buffer. +* buffer-tag-table: Find Tag. +* c-argdecl-indent: C Indent. +* c-auto-newline: C Indent. +* c-brace-imaginary-offset: C Indent. +* c-brace-offset: C Indent. +* c-continued-statement-offset: C Indent. +* c-indent-level: C Indent. +* c-label-offset: C Indent. +* c-mode-hook: Program Modes. +* c-mode-map: Keymaps. +* c-tab-always-indent: C Indent. +* calendar-date-display-form: Date Display Format. +* calendar-daylight-savings-ends: Daylight Savings. +* calendar-daylight-savings-ends-time: Daylight Savings. +* calendar-daylight-savings-starts: Daylight Savings. +* calendar-daylight-time-offset: Daylight Savings. +* calendar-daylight-time-zone-name: Sunrise/Sunset. +* calendar-holiday-marker: Calendar Customizing. +* calendar-holidays: Holiday Customizing. +* calendar-latitude: Sunrise/Sunset. +* calendar-load-hook: Calendar Customizing. +* calendar-location-name: Sunrise/Sunset. +* calendar-longitude: Sunrise/Sunset. +* calendar-standard-time-zone-name: Sunrise/Sunset. +* calendar-time-display-form: Time Display Format. +* calendar-time-zone: Sunrise/Sunset. +* calendar-today-marker: Calendar Customizing. +* calendar-week-start-day: Move to Beginning or End. +* case-fold-search <1>: Search Case. +* case-fold-search: Replacement and Case. +* case-replace: Replacement and Case. +* christian-holidays: Holiday Customizing. +* coding: Recognize Coding. +* command-history: Repetition. +* command-line-args: Command Switches. +* comment-column: Comments. +* comment-end: Comments. +* comment-indent-hook: Comments. +* comment-line-start: Fortran Comments. +* comment-line-start-skip: Fortran Comments. +* comment-multi-line: Comments. +* comment-start: Comments. +* comment-start-skip: Comments. +* compare-ignore-case: Comparing Files. +* compile-command: Compilation. +* completion-auto-help: Completion. +* completion-ignored-extensions: Completion. +* create-frame-hook: XEmacs under X. +* ctl-arrow: Display Vars. +* ctl-x-map: Keymaps. +* current-input-method: Select Input Method. +* data-directory: Startup Paths. +* data-directory-list: Startup Paths. +* debug-on-error: Lisp Debug. +* debug-on-quit: Lisp Debug. +* default-buffer-file-coding-system: Specify Coding. +* default-directory: File Names. +* default-directory-alist: File Names. +* default-frame-alist: XEmacs under X. +* default-input-method: Select Input Method. +* default-major-mode: Choosing Modes. +* delete-auto-save-files: Auto Save Files. +* describe-function-show-arglist: Help. +* diary-date-forms: Diary Customizing. +* diary-display-hook: Fancy Diary Display. +* diary-entry-marker: Calendar Customizing. +* diary-file: Format of Diary File. +* diary-list-include-blanks: Fancy Diary Display. +* diary-mail-days: Diary Commands. +* diff-switches: Comparing Files. +* dired-kept-versions: Dired Deletion. +* dired-listing-switches: Dired Enter. +* display-buffer-function: Pop Up Window. +* doc-directory: Startup Paths. +* echo-keystrokes: Display Vars. +* emacs-lisp-mode-hook: Program Modes. +* emacs-roots: Startup Paths. +* EMACSDATA: Startup Paths. +* EMACSLOADPATH: Startup Paths. +* EMACSLOCKDIR: Startup Paths. +* EMACSPATH: Startup Paths. +* enable-local-variables: File Variables. +* enable-recursive-minibuffers: Minibuffer Edit. +* esc-map: Keymaps. +* european-calendar-style: Date Formats. +* exec-directory: Startup Paths. +* exec-path: Startup Paths. +* explicit-shell-file-name: Interactive Shell. +* file-coding-system-alist: Recognize Coding. +* file-name-coding-system: Specify Coding. +* fill-column: Fill Commands. +* fill-prefix: Fill Prefix. +* find-file-compare-truenames: Visiting. +* find-file-hooks: Visiting. +* find-file-not-found-hooks: Visiting. +* find-file-run-dired: Visiting. +* find-file-use-truenames: Visiting. +* fortran-check-all-num-for-matching-do: ForIndent Vars. +* fortran-comment-indent-char: Fortran Comments. +* fortran-comment-indent-style: Fortran Comments. +* fortran-comment-line-column: Fortran Comments. +* fortran-comment-region: Fortran Comments. +* fortran-continuation-char: ForIndent Conv. +* fortran-continuation-indent: ForIndent Vars. +* fortran-do-indent: ForIndent Vars. +* fortran-electric-line-number: ForIndent Num. +* fortran-if-indent: ForIndent Vars. +* fortran-line-number-indent: ForIndent Num. +* fortran-minimum-statement-indent: ForIndent Vars. +* frame-icon-title-format <1>: XEmacs under X. +* frame-icon-title-format: Command Switches. +* frame-title-format <1>: Command Switches. +* frame-title-format: XEmacs under X. +* general-holidays: Holiday Customizing. +* global-map: Keymaps. +* hebrew-holidays: Holiday Customizing. +* help-map: Keymaps. +* holidays-in-diary-buffer: Diary Customizing. +* indent-tabs-mode: Just Spaces. +* Info-directory-list: Startup Paths. +* INFOPATH: Startup Paths. +* initial-calendar-window-hook: Calendar Customizing. +* initial-major-mode: Entering Emacs. +* input-method-highlight-flag: Input Methods. +* input-method-verbose-flag: Input Methods. +* input-ring-size: Interactive Shell. +* insert-default-directory <1>: Minibuffer File. +* insert-default-directory: File Names. +* isearch-mode-map: Keymaps. +* islamic-holidays: Holiday Customizing. +* kept-new-versions: Backup Deletion. +* kept-old-versions: Backup Deletion. +* keyboard-translate-table: Intro to Keystrokes. +* kill-ring-max: Earlier Kills. +* LaTeX-mode-hook: TeX Print. +* lisp-body-indention: Lisp Indent. +* lisp-directory: Startup Paths. +* lisp-indent-offset: Lisp Indent. +* lisp-interaction-mode-hook: Program Modes. +* lisp-mode-hook: Program Modes. +* lisp-mode-map: Keymaps. +* list-diary-entries-hook: Included Diary Files. +* list-directory-brief-switches: ListDir. +* list-directory-verbose-switches: ListDir. +* load-path <1>: Loading. +* load-path: Startup Paths. +* local-holidays: Holiday Customizing. +* lock-directory: Startup Paths. +* lpr-switches: Hardcopy. +* mail-abbrev-mailrc-file: Mail Headers. +* mail-abbrev-mode-regexp: Mail Headers. +* mail-alias-seperator-string: Mail Headers. +* mail-archive-file-name: Mail Headers. +* mail-header-separator: Mail Format. +* mail-mode-hook: Mail Mode. +* make-backup-files: Backup. +* make-tags-files-invisible: Find Tag. +* mark-diary-entries-hook: Included Diary Files. +* mark-diary-entries-in-calendar: Calendar Customizing. +* mark-holidays-in-calendar: Calendar Customizing. +* mark-ring: Mark Ring. +* mark-ring-max: Mark Ring. +* meta-flag: Meta Key. +* minibuffer-confirm-incomplete: Completion. +* minibuffer-local-completion-map: Keymaps. +* minibuffer-local-map: Keymaps. +* minibuffer-local-must-match-map: Keymaps. +* minibuffer-local-ns-map: Keymaps. +* mode-line-inverse-video: Mode Line. +* modeline-pointer-glyph: Mouse Selection. +* muddle-mode-hook: Program Modes. +* next-screen-context-lines: Scrolling. +* no-redraw-on-reenter: Display Vars. +* nongregorian-diary-listing-hook: Hebrew/Islamic Entries. +* nongregorian-diary-marking-hook: Hebrew/Islamic Entries. +* nontext-pointer-glyph: Mouse Selection. +* nroff-mode-hook: Nroff Mode. +* number-of-diary-entries: Diary Customizing. +* other-holidays: Holiday Customizing. +* outline-mode-hook: Outline Mode. +* outline-regexp: Outline Format. +* page-delimiter: Pages. +* paragraph-separate: Paragraphs. +* paragraph-start: Paragraphs. +* parse-sexp-ignore-comments: Syntax Entry. +* PATH: Startup Paths. +* picture-mode-hook: Picture. +* picture-tab-chars: Tabs in Picture. +* plain-TeX-mode-hook: TeX Print. +* print-diary-entries-hook: Diary Customizing. +* repeat-complex-command-map: Keymaps. +* require-final-newline: Saving. +* save-abbrevs: Saving Abbrevs. +* scheme-mode-hook: Program Modes. +* scroll-conservatively: Scrolling. +* scroll-step: Scrolling. +* search-slow-speed: Incremental Search. +* search-slow-window-lines: Incremental Search. +* selective-display-ellipses <1>: Display Vars. +* selective-display-ellipses: Outline Visibility. +* sentence-end: Sentences. +* shell-cd-regexp: Interactive Shell. +* shell-file-name: Single Shell. +* shell-popd-regexp: Interactive Shell. +* shell-prompt-pattern: Shell Mode. +* shell-pushd-regexp: Interactive Shell. +* sound-alist: Audible Bell. +* superlock-file: Startup Paths. +* tab-stop-list: Tab Stops. +* tab-width: Display Vars. +* tag-mark-stack-max: Find Tag. +* tag-table-alist <1>: Find Tag. +* tag-table-alist: Select Tags Table. +* tags-always-build-completion-table: Select Tags Table. +* tags-build-completion-table: Find Tag. +* tags-file-name <1>: Find Tag. +* tags-file-name: Select Tags Table. +* term-file-prefix: Terminal Init. +* term-setup-hook: Terminal Init. +* TeX-mode-hook: TeX Print. +* text-mode-hook: Text Mode. +* text-pointer-glyph: Mouse Selection. +* today-invisible-calendar-hook: Calendar Customizing. +* today-visible-calendar-hook: Calendar Customizing. +* track-eol: Basic. +* trim-versions-without-asking: Backup Deletion. +* truncate-lines: Continuation Lines. +* truncate-partial-width-windows: Split Window. +* vc-command-messages: Variables for Check-in/out. +* vc-comment-alist: Version Headers. +* vc-default-back-end: Editing with VC. +* vc-header-alist: Version Headers. +* vc-initial-comment: Editing with VC. +* vc-keep-workfiles: Editing with VC. +* vc-log-mode-hook: Log Entries. +* vc-make-backup-files: Editing with VC. +* vc-mistrust-permissions: Variables for Check-in/out. +* vc-path: Variables for Check-in/out. +* vc-static-header-alist: Version Headers. +* vc-suppress-confirm: Variables for Check-in/out. +* version-control: Backup Names. +* view-calendar-holidays-initially: Calendar Customizing. +* view-diary-entries-initially: Calendar Customizing. +* window-min-height: Change Window. +* window-min-width: Change Window. +* write-file-hooks: Saving. +* x-frame-defaults: XEmacs under X. +* zmacs-region-stays: Active Regions. +* zmacs-regions: Active Regions. + + +File: xemacs.info, Node: Concept Index, Next: Frame, Prev: Variable Index, Up: Top + +Concept Index +************* + +* Menu: + +* .mailrc file: Mail Headers. +* Abbrev mode: Minor Modes. +* abbrevs: Abbrevs. +* aborting: Quitting. +* accumulating text: Accumulating Text. +* active fields (customization buffer): Customization Groups. +* active regions: Active Regions. +* adding menu items: Menu Customization. +* adding menus: Menu Customization. +* againformation: Dissociated Press. +* Apps menu <1>: Pull-down Menus. +* Apps menu: Apps Menu. +* apropos: Help. +* architecture-specific directories: Startup Paths. +* arguments (from shell): Command Switches. +* ASCII: Intro to Keystrokes. +* Asm mode: Asm Mode. +* astronomical day numbers: Calendar Systems. +* audible bell, changing: Audible Bell. +* Auto Delete Selection menu item: Options Menu. +* Auto Fill mode <1>: Comments. +* Auto Fill mode <2>: Auto Fill. +* Auto Fill mode: Minor Modes. +* Auto-Save mode: Auto Save. +* autoload: Loading. +* backup file: Backup. +* batch mode: Command Switches. +* bell, changing: Audible Bell. +* binary packages: Package Terminology. +* binding: Commands. +* blank lines <1>: Comments. +* blank lines: Blank Lines. +* body lines (Outline mode): Outline Format. +* bold font: Face Customization. +* boredom: Amusements. +* buffer: Frame. +* buffer menu: Several Buffers. +* buffers: Buffers. +* Buffers menu <1>: Buffers Menu. +* Buffers menu: Pull-down Menus. +* Buffers Menu Length... menu item: Options Menu. +* Buffers Sub-Menus menu item: Options Menu. +* buggestion: Dissociated Press. +* bugs: Bugs. +* byte code: Compiling Libraries. +* C: Programs. +* C mode: Program Modes. +* calendar: Calendar/Diary. +* calendar and LaTeX: LaTeX Calendar. +* calendar, first day of week: Move to Beginning or End. +* candle lighting times: Sexp Diary Entries. +* case conversion <1>: Fixing Case. +* case conversion: Case. +* Case Sensitive Search menu item: Options Menu. +* centering: Fill Commands. +* change log: Change Log. +* changing buffers: Select Buffer. +* changing menu items: Menu Customization. +* character set: Intro to Keystrokes. +* checking in files: Concepts of VC. +* checking out files: Concepts of VC. +* Chinese: Mule. +* Chinese calendar: Calendar Systems. +* Clear menu item: Edit Menu. +* clipboard selections: X Clipboard Selection. +* coding systems: Coding Systems. +* command <1>: Commands. +* command: Key Bindings. +* command history: Repetition. +* command line arguments: Command Switches. +* command name: Key Bindings. +* comments: Comments. +* comparing files: Comparing Files. +* compilation errors: Compilation. +* compiling files: Compilation. +* completion: Completion. +* completion (symbol names): Lisp Completion. +* continuation line: Continuation Lines. +* Control-Meta: Lists. +* Coptic calendar: Calendar Systems. +* Copy menu item: Edit Menu. +* copying files: Misc File Ops. +* copying text <1>: Yanking. +* copying text: Accumulating Text. +* core distribution: Using Packages. +* crashes: Auto Save. +* creating directories: File Names. +* creating files: Visiting. +* current buffer: Buffers. +* current stack frame: Lisp Debug. +* cursor <1>: Point. +* cursor: Basic. +* customization <1>: Customization. +* customization <2>: Commands. +* customization: Lisp Indent. +* customization buffer: Easy Customization. +* customization groups: Customization Groups. +* customizing faces: Face Customization. +* cut buffers: X Selection Commands. +* Cut menu item: Edit Menu. +* cutting: Killing. +* day of year: General Calendar. +* daylight savings time: Daylight Savings. +* debugger: Lisp Debug. +* default argument: Minibuffer. +* defuns: Defuns. +* Delete Frame menu item: File Menu. +* deleting menu items: Menu Customization. +* deletion <1>: Killing. +* deletion: Basic. +* deletion (of files) <1>: Misc File Ops. +* deletion (of files): Dired. +* diary: Diary. +* diary buffer: Fancy Diary Display. +* diary file: Format of Diary File. +* ding: Audible Bell. +* directories: Startup Paths. +* directory hierarchies: Startup Paths. +* directory listing: ListDir. +* Dired: Dired. +* disabled command: Disabling. +* disabling menu items: Menu Customization. +* Distribution: License. +* doctor: Total Frustration. +* drastic changes: Reverting. +* dribble file: Bugs. +* early package hierarchies: Startup Paths. +* echo area: Echo Area. +* Edit menu <1>: Pull-down Menus. +* Edit menu: Edit Menu. +* editable fields (customization buffer): Customization Groups. +* editing level, recursive <1>: Recursive Edit. +* editing level, recursive: Quitting. +* EDT: Emulation. +* Eliza: Total Frustration. +* Emacs initialization file: Init File. +* Emacs-Lisp mode: Lisp Eval. +* enabling menu items: Menu Customization. +* encoding of characters: Mule. +* End Macro Recording menu item: Edit Menu. +* entering Emacs: Entering Emacs. +* entering XEmacs: Entering Emacs. +* environment: Single Shell. +* error log: Compilation. +* etags program: Create Tags Table. +* Ethiopic calendar: Calendar Systems. +* Execute Last Macro menu item: Edit Menu. +* Exit Emacs menu item: File Menu. +* exiting <1>: Recursive Edit. +* exiting: Exiting. +* expansion (of abbrevs): Abbrevs. +* expression: Lists. +* file dates: Interlocking. +* file directory: ListDir. +* File menu <1>: Pull-down Menus. +* File menu: File Menu. +* file names: File Names. +* file protection: Interlocking. +* files <1>: Files. +* files <2>: Visiting. +* files: Basic. +* fill prefix: Fill Prefix. +* filling: Filling. +* Font menu item: Options Menu. +* fonts and faces: Face Customization. +* formfeed: Pages. +* Fortran mode: Fortran. +* frame: Frame. +* French Revolutionary calendar: Calendar Systems. +* function <1>: Key Bindings. +* function: Commands. +* General Public License: License. +* global keymap: Keymaps. +* global substitution: Replace. +* graphic characters: Basic. +* Greek: Mule. +* Gregorian calendar: Other Calendars. +* grinding: Grinding. +* hardcopy: Hardcopy. +* header (TeX mode): TeX Print. +* headers (of mail message): Mail Headers. +* heading lines (Outline mode): Outline Format. +* Hebrew calendar: Calendar Systems. +* help: Help. +* Help menu <1>: Help Menu. +* Help menu: Pull-down Menus. +* hierarchies: Startup Paths. +* history of commands: Repetition. +* holiday forms: Holiday Customizing. +* holidays: Holidays. +* horizontal scrolling: Horizontal Scrolling. +* ignoriginal: Dissociated Press. +* indentation <1>: Grinding. +* indentation <2>: Indentation. +* indentation: Comments. +* inferior process: Compilation. +* init file: Init File. +* input methods: Input Methods. +* Insert File... menu item: File Menu. +* insertion: Basic. +* international scripts: Mule. +* interval operator (in regexps): Create Tags Table. +* invisible lines: Outline Mode. +* IPA: Mule. +* Islamic calendar: Calendar Systems. +* ISO commercial calendar: Calendar Systems. +* italic font: Face Customization. +* Japanese: Mule. +* Julian calendar: Calendar Systems. +* Julian day numbers: Calendar Systems. +* justification: Fill Commands. +* key rebinding, permanent: Init File. +* key rebinding, this session: Rebinding. +* keyboard macros: Keyboard Macros. +* keycode: Super and Hyper Keys. +* keymap <1>: Commands. +* keymap: Keymaps. +* keystroke: Intro to Keystrokes. +* keysym: Intro to Keystrokes. +* keysyms: Super and Hyper Keys. +* Kill Buffer menu item: File Menu. +* kill ring: Yanking. +* killing: Killing. +* killing Emacs: Exiting. +* Korean: Mule. +* language environments: Language Environments. +* last package hierarchies: Startup Paths. +* late package hierarchies: Startup Paths. +* LaTeX: TeX Mode. +* libraries: Lisp Libraries. +* license to copy XEmacs: License. +* line number: Position Info. +* Lisp: Programs. +* Lisp mode: Program Modes. +* list: Lists. +* loading libraries: Loading. +* loading Lisp code: Lisp Libraries. +* local keymap: Keymaps. +* local variables: Locals. +* local variables in files: File Variables. +* locking and version control: Concepts of VC. +* log entry: Editing with VC. +* mail <1>: Reading Mail. +* mail: Sending Mail. +* major modes: Major Modes. +* make: Compilation. +* mark: Mark. +* mark ring <1>: Mark and Region. +* mark ring: Mark Ring. +* Markov chain: Dissociated Press. +* master file: Concepts of VC. +* matching parentheses: Matching. +* Mayan calendar: Calendar Systems. +* Mayan calendar round: Mayan Calendar. +* Mayan haab calendar: Mayan Calendar. +* Mayan long count: Mayan Calendar. +* Mayan tzolkin calendar: Mayan Calendar. +* menus <1>: Change Window. +* menus: Pull-down Menus. +* message <1>: Sending Mail. +* message: Reading Mail. +* Meta: Words. +* minibuffer <1>: M-x. +* minibuffer <2>: Keymaps. +* minibuffer: Minibuffer. +* minor modes: Minor Modes. +* mistakes, correcting <1>: Fixit. +* mistakes, correcting: Undo. +* mocklisp: Mocklisp. +* mode hook: Program Modes. +* mode line <1>: Mode Line. +* mode line: Minor Modes. +* mode, Term: Term Mode. +* modified (buffer): Visiting. +* modifier key: Intro to Keystrokes. +* modifier mapping: Super and Hyper Keys. +* moon, phases of: Lunar Phases. +* mouse operations: Additional Mouse Operations. +* mouse selection: Mouse Selection. +* moving inside the calendar: Calendar Motion. +* moving text: Yanking. +* MULE: Mule. +* multi-frame XEmacs: XEmacs under X. +* multibyte characters: Mule. +* named configurations (RCS): Snapshot Caveats. +* narrowing: Narrowing. +* New Frame menu item: File Menu. +* newline: Basic. +* non-incremental search: Non-Incremental Search. +* nroff: Nroff Mode. +* numeric arguments: Arguments. +* omer count: Sexp Diary Entries. +* Open File, New Frame... menu item: File Menu. +* Open File... menu item: File Menu. +* option <1>: Variables. +* option: Examining. +* Options menu <1>: Pull-down Menus. +* Options menu: Options Menu. +* other editors: Emulation. +* outlines: Outline Mode. +* outragedy: Dissociated Press. +* Overstrike menu item: Options Menu. +* Overwrite mode: Minor Modes. +* package hierarchies: Startup Paths. +* package path: Startup Paths. +* packages: Packages. +* page number: Position Info. +* pages: Pages. +* paragraphs: Paragraphs. +* parasha, weekly: Sexp Diary Entries. +* Paren Highlighting menu item: Options Menu. +* parentheses: Matching. +* Paste menu item: Edit Menu. +* pasting: Yanking. +* path: Startup Paths. +* paths: Startup Paths. +* per-buffer variables: Locals. +* Persian calendar: Calendar Systems. +* phases of the moon: Lunar Phases. +* pictures: Picture. +* point <1>: Basic. +* point: Point. +* pointer face: Mouse Selection. +* pointer shapes: Mouse Selection. +* prefix key sequence: Key Sequences. +* presidentagon: Dissociated Press. +* primary selections: X Selection Commands. +* Print Buffer menu item: File Menu. +* prompt: Minibuffer. +* properbose: Dissociated Press. +* Pull-down Menus <1>: Change Window. +* Pull-down Menus: Pull-down Menus. +* query replace: Query Replace. +* quitting: Quitting. +* quitting (in search): Incremental Search. +* quoting: Basic. +* random sentences: CONX. +* RCS: Concepts of VC. +* Read Only menu item: Options Menu. +* read-only buffer: Misc Buffer. +* rebinding keys, permanently: Init File. +* rebinding keys, this session: Rebinding. +* rectangle <1>: RegRect. +* rectangle: Rectangles in Picture. +* rectangles: Rectangles. +* recursive editing level <1>: Quitting. +* recursive editing level: Recursive Edit. +* redefining keys: Key Bindings Using Strings. +* regexp: Regexp Search. +* region <1>: Case. +* region: Mark. +* registered file: Concepts of VC. +* registers: Registers. +* regular expression: Regexp Search. +* regular packages: Package Terminology. +* removing directories: File Names. +* replacement: Replace. +* restriction: Narrowing. +* Revert Buffer menu item: File Menu. +* root of a hierarchy: Startup Paths. +* rosh hodesh: Sexp Diary Entries. +* Russian: Mule. +* Save Buffer As ... menu item: File Menu. +* Save Buffer menu item: File Menu. +* Save Options: Options Menu. +* saving: Visiting. +* saving option value: Changing an Option. +* SCCS: Concepts of VC. +* Scheme mode: Program Modes. +* scrolling: Scrolling. +* scrolling in the calendar: Scroll Calendar. +* searching: Search. +* selected buffer: Buffers. +* selected window: Basic Window. +* selective display: Outline Mode. +* self-documentation: Help. +* sentences: Sentences. +* setting option value: Changing an Option. +* setting variables: Examining. +* sexp: Lists. +* sexp diary entries: Sexp Diary Entries. +* shell commands: Shell. +* Shell mode: Shell Mode. +* shift modifer: Representing Keystrokes. +* shrinking XEmacs frame: Exiting. +* simultaneous editing: Interlocking. +* single-file packages: Package Terminology. +* site-specific directories: Startup Paths. +* Size menu item: Options Menu. +* snapshots and version control: Snapshots. +* sorting: Sorting. +* sorting diary entries: Fancy Diary Display. +* source packages: Package Terminology. +* spelling: Spelling. +* Split Frame: File Menu. +* Start Macro Recording menu item: Edit Menu. +* startup paths: Startup Paths. +* string substitution: Replace. +* subshell: Shell. +* subtree (Outline mode): Outline Visibility. +* sunrise and sunset: Sunrise/Sunset. +* suspending: Exiting. +* switching buffers: Select Buffer. +* Syntax Highlighting menu item: Options Menu. +* syntax table <1>: Syntax. +* syntax table: Words. +* tags table: Tags. +* Teach Extended Commands menu item: Options Menu. +* techniquitous: Dissociated Press. +* television: Appending Kills. +* Term mode: Term Mode. +* termscript file: Bugs. +* TeX: TeX Mode. +* text: Text. +* Text mode: Text Mode. +* Tools menu <1>: Pull-down Menus. +* Tools menu: Tools Menu. +* top level: Mode Line. +* transposition <1>: Words. +* transposition <2>: Lists. +* transposition: Transpose. +* truncation: Continuation Lines. +* typos: Fixit. +* Un-split (Keep Others): File Menu. +* Un-split (Keep This): File Menu. +* undo: Undo. +* Undo menu item: Edit Menu. +* variable: Variables. +* variables: Commands. +* version control: Version Control. +* version-specific directories: Startup Paths. +* vi: Emulation. +* viewing: Misc File Ops. +* Viper: Emulation. +* visiting: Visiting. +* visiting files: Visiting. +* weeks, which day they start on: Move to Beginning or End. +* Weight menu item: Options Menu. +* widening: Narrowing. +* window: Frame. +* windows: Windows. +* Windows menu: Change Window. +* word search: Word Search. +* words <1>: Case. +* words <2>: Fixing Case. +* words: Words. +* work file: Concepts of VC. +* X resources: X Resources. +* yahrzeits <1>: From Other Calendar. +* yahrzeits: Sexp Diary Entries. +* yanking: Yanking. + + diff --git a/info/xemacs.info-22 b/info/xemacs.info-22 new file mode 100644 index 0000000..912f44b --- /dev/null +++ b/info/xemacs.info-22 @@ -0,0 +1,795 @@ +This is ../info/xemacs.info, produced by makeinfo version 4.0 from +xemacs/xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Variable Index, Next: Concept Index, Prev: Command Index, Up: Top + +Variable Index +************** + +* Menu: + +* abbrev-all-caps: Expanding Abbrevs. +* abbrev-file-name: Saving Abbrevs. +* abbrev-mode: Abbrevs. +* after-load-alist: Loading. +* after-save-hook: Saving. +* all-christian-calendar-holidays: Holiday Customizing. +* all-hebrew-calendar-holidays: Holiday Customizing. +* all-islamic-calendar-holidays: Holiday Customizing. +* appt-audible: Appt Customizing. +* appt-display-duration: Appt Customizing. +* appt-display-mode-line: Appt Customizing. +* appt-message-warning-time: Appt Customizing. +* appt-msg-window: Appt Customizing. +* appt-visible: Appt Customizing. +* apropos-do-all: Apropos. +* auto-fill-inhibit-regexp: Fill Commands. +* auto-lower-frame: XEmacs under X. +* auto-mode-alist: Choosing Modes. +* auto-raise-frame: XEmacs under X. +* auto-save-default: Auto Save Control. +* auto-save-interval: Auto Save Control. +* auto-save-timeout: Auto Save Control. +* auto-save-visited-file-name: Auto Save Files. +* backup-by-copying: Backup Copying. +* backup-by-copying-when-linked: Backup Copying. +* backup-by-copying-when-mismatch: Backup Copying. +* bell-volume: Audible Bell. +* blink-matching-paren: Matching. +* blink-matching-paren-distance: Matching. +* bookmark-save-flag: Bookmarks. +* bookmark-search-size: Bookmarks. +* buffer-file-coding-system: Recognize Coding. +* buffer-file-name: Visiting. +* buffer-file-truename: Visiting. +* buffer-read-only: Misc Buffer. +* buffer-tag-table: Find Tag. +* c-argdecl-indent: C Indent. +* c-auto-newline: C Indent. +* c-brace-imaginary-offset: C Indent. +* c-brace-offset: C Indent. +* c-continued-statement-offset: C Indent. +* c-indent-level: C Indent. +* c-label-offset: C Indent. +* c-mode-hook: Program Modes. +* c-mode-map: Keymaps. +* c-tab-always-indent: C Indent. +* calendar-date-display-form: Date Display Format. +* calendar-daylight-savings-ends: Daylight Savings. +* calendar-daylight-savings-ends-time: Daylight Savings. +* calendar-daylight-savings-starts: Daylight Savings. +* calendar-daylight-time-offset: Daylight Savings. +* calendar-daylight-time-zone-name: Sunrise/Sunset. +* calendar-holiday-marker: Calendar Customizing. +* calendar-holidays: Holiday Customizing. +* calendar-latitude: Sunrise/Sunset. +* calendar-load-hook: Calendar Customizing. +* calendar-location-name: Sunrise/Sunset. +* calendar-longitude: Sunrise/Sunset. +* calendar-standard-time-zone-name: Sunrise/Sunset. +* calendar-time-display-form: Time Display Format. +* calendar-time-zone: Sunrise/Sunset. +* calendar-today-marker: Calendar Customizing. +* calendar-week-start-day: Move to Beginning or End. +* case-fold-search <1>: Replacement and Case. +* case-fold-search: Search Case. +* case-replace: Replacement and Case. +* christian-holidays: Holiday Customizing. +* coding: Recognize Coding. +* command-history: Repetition. +* command-line-args: Command Switches. +* comment-column: Comments. +* comment-end: Comments. +* comment-indent-hook: Comments. +* comment-line-start: Fortran Comments. +* comment-line-start-skip: Fortran Comments. +* comment-multi-line: Comments. +* comment-start: Comments. +* comment-start-skip: Comments. +* compare-ignore-case: Comparing Files. +* compile-command: Compilation. +* completion-auto-help: Completion Options. +* completion-ignored-extensions: Completion Options. +* create-frame-hook: XEmacs under X. +* ctl-arrow: Display Vars. +* ctl-x-map: Keymaps. +* current-input-method: Select Input Method. +* data-directory: Startup Paths. +* data-directory-list: Startup Paths. +* debug-on-error: Lisp Debug. +* debug-on-quit: Lisp Debug. +* default-buffer-file-coding-system: Specify Coding. +* default-directory: File Names. +* default-directory-alist: File Names. +* default-frame-alist: XEmacs under X. +* default-input-method: Select Input Method. +* default-major-mode: Choosing Modes. +* delete-auto-save-files: Auto Save Files. +* delete-old-versions: Backup Deletion. +* describe-function-show-arglist: Name Help. +* diary-date-forms: Diary Customizing. +* diary-display-hook: Fancy Diary Display. +* diary-entry-marker: Calendar Customizing. +* diary-file: Format of Diary File. +* diary-list-include-blanks: Fancy Diary Display. +* diary-mail-days: Diary Commands. +* diff-switches: Comparing Files. +* dired-kept-versions: Dired Deletion. +* dired-listing-switches: Dired Enter. +* display-buffer-function: Pop Up Window. +* doc-directory: Startup Paths. +* echo-keystrokes: Display Vars. +* emacs-lisp-mode-hook: Program Modes. +* emacs-roots: Startup Paths. +* EMACSDATA: Startup Paths. +* EMACSLOADPATH: Startup Paths. +* EMACSLOCKDIR: Startup Paths. +* EMACSPATH: Startup Paths. +* enable-local-variables: File Variables. +* enable-recursive-minibuffers: Minibuffer Edit. +* esc-map: Keymaps. +* european-calendar-style: Date Formats. +* exec-directory: Startup Paths. +* exec-path: Startup Paths. +* explicit-shell-file-name: Interactive Shell. +* file-coding-system-alist: Recognize Coding. +* file-name-coding-system: Specify Coding. +* fill-column: Fill Commands. +* fill-prefix: Fill Prefix. +* find-file-compare-truenames: Visiting. +* find-file-hooks: Visiting. +* find-file-not-found-hooks: Visiting. +* find-file-run-dired: Visiting. +* find-file-use-truenames: Visiting. +* fortran-check-all-num-for-matching-do: ForIndent Vars. +* fortran-comment-indent-char: Fortran Comments. +* fortran-comment-indent-style: Fortran Comments. +* fortran-comment-line-column: Fortran Comments. +* fortran-comment-region: Fortran Comments. +* fortran-continuation-char: ForIndent Conv. +* fortran-continuation-indent: ForIndent Vars. +* fortran-do-indent: ForIndent Vars. +* fortran-electric-line-number: ForIndent Num. +* fortran-if-indent: ForIndent Vars. +* fortran-line-number-indent: ForIndent Num. +* fortran-minimum-statement-indent: ForIndent Vars. +* frame-icon-title-format <1>: Command Switches. +* frame-icon-title-format: XEmacs under X. +* frame-title-format <1>: Command Switches. +* frame-title-format: XEmacs under X. +* general-holidays: Holiday Customizing. +* global-map: Keymaps. +* hebrew-holidays: Holiday Customizing. +* help-map: Keymaps. +* holidays-in-diary-buffer: Diary Customizing. +* indent-tabs-mode: Just Spaces. +* Info-directory-list: Startup Paths. +* INFOPATH: Startup Paths. +* initial-calendar-window-hook: Calendar Customizing. +* initial-major-mode: Entering Emacs. +* input-method-highlight-flag: Input Methods. +* input-method-verbose-flag: Input Methods. +* input-ring-size: Interactive Shell. +* insert-default-directory <1>: File Names. +* insert-default-directory: Minibuffer File. +* isearch-mode-map: Keymaps. +* islamic-holidays: Holiday Customizing. +* kept-new-versions: Backup Deletion. +* kept-old-versions: Backup Deletion. +* keyboard-translate-table: Intro to Keystrokes. +* kill-ring-max: Earlier Kills. +* LaTeX-mode-hook: TeX Print. +* lisp-body-indention: Lisp Indent. +* lisp-directory: Startup Paths. +* lisp-indent-offset: Lisp Indent. +* lisp-interaction-mode-hook: Program Modes. +* lisp-mode-hook: Program Modes. +* lisp-mode-map: Keymaps. +* list-diary-entries-hook: Included Diary Files. +* list-directory-brief-switches: ListDir. +* list-directory-verbose-switches: ListDir. +* load-path <1>: Loading. +* load-path: Startup Paths. +* local-holidays: Holiday Customizing. +* lock-directory: Startup Paths. +* lpr-switches: Hardcopy. +* mail-abbrev-mailrc-file: Mail Headers. +* mail-abbrev-mode-regexp: Mail Headers. +* mail-alias-seperator-string: Mail Headers. +* mail-archive-file-name: Mail Headers. +* mail-header-separator: Mail Format. +* mail-mode-hook: Mail Mode. +* make-backup-files: Backup. +* make-tags-files-invisible: Find Tag. +* mark-diary-entries-hook: Included Diary Files. +* mark-diary-entries-in-calendar: Calendar Customizing. +* mark-holidays-in-calendar: Calendar Customizing. +* mark-ring: Mark Ring. +* mark-ring-max: Mark Ring. +* meta-flag: Meta Key. +* minibuffer-confirm-incomplete <1>: Completion Options. +* minibuffer-confirm-incomplete: Minibuffer Edit. +* minibuffer-local-completion-map: Keymaps. +* minibuffer-local-map: Keymaps. +* minibuffer-local-must-match-map: Keymaps. +* minibuffer-local-ns-map: Keymaps. +* mode-line-inverse-video: Mode Line. +* modeline-pointer-glyph: Mouse Selection. +* muddle-mode-hook: Program Modes. +* next-screen-context-lines: Scrolling. +* no-redraw-on-reenter: Display Vars. +* nongregorian-diary-listing-hook: Hebrew/Islamic Entries. +* nongregorian-diary-marking-hook: Hebrew/Islamic Entries. +* nontext-pointer-glyph: Mouse Selection. +* nroff-mode-hook: Nroff Mode. +* number-of-diary-entries: Diary Customizing. +* other-holidays: Holiday Customizing. +* outline-mode-hook: Outline Mode. +* outline-regexp: Outline Format. +* page-delimiter: Pages. +* paragraph-separate: Paragraphs. +* paragraph-start: Paragraphs. +* parse-sexp-ignore-comments: Syntax Entry. +* PATH: Startup Paths. +* picture-mode-hook: Picture. +* picture-tab-chars: Tabs in Picture. +* plain-TeX-mode-hook: TeX Print. +* print-diary-entries-hook: Diary Customizing. +* repeat-complex-command-map: Keymaps. +* require-final-newline: Saving. +* save-abbrevs: Saving Abbrevs. +* scheme-mode-hook: Program Modes. +* scroll-conservatively: Scrolling. +* scroll-step: Scrolling. +* search-slow-speed: Incremental Search. +* search-slow-window-lines: Incremental Search. +* selective-display-ellipses <1>: Outline Visibility. +* selective-display-ellipses: Display Vars. +* sentence-end: Sentences. +* shell-cd-regexp: Interactive Shell. +* shell-file-name: Single Shell. +* shell-popd-regexp: Interactive Shell. +* shell-prompt-pattern: Shell Mode. +* shell-pushd-regexp: Interactive Shell. +* sound-alist: Audible Bell. +* superlock-file: Startup Paths. +* tab-stop-list: Tab Stops. +* tab-width: Display Vars. +* tag-mark-stack-max: Find Tag. +* tag-table-alist <1>: Find Tag. +* tag-table-alist: Select Tags Table. +* tags-always-build-completion-table: Select Tags Table. +* tags-build-completion-table: Find Tag. +* tags-file-name <1>: Find Tag. +* tags-file-name: Select Tags Table. +* term-file-prefix: Terminal Init. +* term-setup-hook: Terminal Init. +* TeX-mode-hook: TeX Print. +* text-mode-hook: Text Mode. +* text-pointer-glyph: Mouse Selection. +* today-invisible-calendar-hook: Calendar Customizing. +* today-visible-calendar-hook: Calendar Customizing. +* track-eol: Basic. +* truncate-lines: Continuation Lines. +* truncate-partial-width-windows: Split Window. +* vc-command-messages: Variables for Check-in/out. +* vc-comment-alist: Version Headers. +* vc-default-back-end: Editing with VC. +* vc-header-alist: Version Headers. +* vc-initial-comment: Editing with VC. +* vc-keep-workfiles: Editing with VC. +* vc-log-mode-hook: Log Entries. +* vc-make-backup-files: Editing with VC. +* vc-mistrust-permissions: Variables for Check-in/out. +* vc-path: Variables for Check-in/out. +* vc-static-header-alist: Version Headers. +* vc-suppress-confirm: Variables for Check-in/out. +* version-control: Backup Names. +* view-calendar-holidays-initially: Calendar Customizing. +* view-diary-entries-initially: Calendar Customizing. +* window-min-height: Change Window. +* window-min-width: Change Window. +* write-file-hooks: Saving. +* x-frame-defaults: XEmacs under X. +* zmacs-region-stays: Active Regions. +* zmacs-regions: Active Regions. + + +File: xemacs.info, Node: Concept Index, Next: Frame, Prev: Variable Index, Up: Top + +Concept Index +************* + +* Menu: + +* .mailrc file: Mail Headers. +* // in file name: Minibuffer File. +* Abbrev mode: Minor Modes. +* abbrevs: Abbrevs. +* aborting: Quitting. +* accumulating text: Accumulating Text. +* active fields (customization buffer): Customization Groups. +* active regions: Active Regions. +* adding menu items: Menu Customization. +* adding menus: Menu Customization. +* againformation: Dissociated Press. +* Apps menu <1>: Apps Menu. +* Apps menu: Pull-down Menus. +* apropos: Apropos. +* architecture-specific directories: Startup Paths. +* arguments (from shell): Command Switches. +* ASCII: Intro to Keystrokes. +* Asm mode: Asm Mode. +* astronomical day numbers: Calendar Systems. +* audible bell, changing: Audible Bell. +* Auto Delete Selection menu item: Options Menu. +* Auto Fill mode <1>: Minor Modes. +* Auto Fill mode <2>: Comments. +* Auto Fill mode: Auto Fill. +* Auto-Save mode: Auto Save. +* autoload: Loading. +* backup file: Backup. +* batch mode: Command Switches. +* bell, changing: Audible Bell. +* binary packages: Package Terminology. +* binding: Commands. +* blank lines <1>: Comments. +* blank lines: Blank Lines. +* body lines (Outline mode): Outline Format. +* bold font: Face Customization. +* bookmarks: Bookmarks. +* boredom: Amusements. +* buffer: Frame. +* buffer menu: Several Buffers. +* buffers: Buffers. +* Buffers menu <1>: Buffers Menu. +* Buffers menu: Pull-down Menus. +* Buffers Menu Length... menu item: Options Menu. +* Buffers Sub-Menus menu item: Options Menu. +* buggestion: Dissociated Press. +* bugs: Bugs. +* byte code: Compiling Libraries. +* C: Programs. +* C mode: Program Modes. +* calendar: Calendar/Diary. +* calendar and LaTeX: LaTeX Calendar. +* calendar, first day of week: Move to Beginning or End. +* candle lighting times: Sexp Diary Entries. +* case conversion <1>: Case. +* case conversion: Fixing Case. +* Case Sensitive Search menu item: Options Menu. +* centering: Fill Commands. +* change log: Change Log. +* changing buffers: Select Buffer. +* changing menu items: Menu Customization. +* character set: Intro to Keystrokes. +* checking in files: Concepts of VC. +* checking out files: Concepts of VC. +* Chinese: Mule. +* Chinese calendar: Calendar Systems. +* Clear menu item: Edit Menu. +* clipboard selections: X Clipboard Selection. +* coding systems: Coding Systems. +* command <1>: Key Bindings. +* command: Commands. +* command history: Repetition. +* command line arguments: Command Switches. +* command name: Key Bindings. +* comments: Comments. +* comparing files: Comparing Files. +* compilation errors: Compilation. +* compiling files: Compilation. +* completion: Completion. +* completion (symbol names): Lisp Completion. +* continuation line: Continuation Lines. +* Control-Meta: Lists. +* Coptic calendar: Calendar Systems. +* Copy menu item: Edit Menu. +* copying files: Misc File Ops. +* copying text <1>: Accumulating Text. +* copying text: Yanking. +* core distribution: Using Packages. +* crashes: Auto Save. +* creating directories: File Names. +* creating files: Visiting. +* current buffer: Buffers. +* current stack frame: Lisp Debug. +* cursor <1>: Basic. +* cursor: Point. +* customization <1>: Customization. +* customization <2>: Lisp Indent. +* customization: Commands. +* customization buffer: Easy Customization. +* customization groups: Customization Groups. +* customizing faces: Face Customization. +* cut buffers: X Selection Commands. +* Cut menu item: Edit Menu. +* cutting: Killing. +* day of year: General Calendar. +* daylight savings time: Daylight Savings. +* debugger: Lisp Debug. +* default argument: Minibuffer. +* defuns: Defuns. +* Delete Frame menu item: File Menu. +* deleting menu items: Menu Customization. +* deletion <1>: Killing. +* deletion: Basic. +* deletion (of files) <1>: Misc File Ops. +* deletion (of files): Dired. +* diary: Diary. +* diary buffer: Fancy Diary Display. +* diary file: Format of Diary File. +* ding: Audible Bell. +* directories: Startup Paths. +* directory hierarchies: Startup Paths. +* directory listing: ListDir. +* Dired: Dired. +* disabled command: Disabling. +* disabling menu items: Menu Customization. +* Distribution: License. +* doctor: Total Frustration. +* double slash in file name: Minibuffer File. +* drastic changes: Reverting. +* dribble file: Bugs. +* early package hierarchies: Startup Paths. +* echo area: Echo Area. +* Edit menu <1>: Edit Menu. +* Edit menu: Pull-down Menus. +* editable fields (customization buffer): Customization Groups. +* editing level, recursive <1>: Quitting. +* editing level, recursive: Recursive Edit. +* EDT: Emulation. +* Eliza: Total Frustration. +* Emacs initialization file: Init File. +* Emacs-Lisp mode: Lisp Eval. +* enabling menu items: Menu Customization. +* encoding of characters: Mule. +* End Macro Recording menu item: Edit Menu. +* entering Emacs: Entering Emacs. +* entering XEmacs: Entering Emacs. +* environment: Single Shell. +* error log: Compilation. +* etags program: Create Tags Table. +* Ethiopic calendar: Calendar Systems. +* Execute Last Macro menu item: Edit Menu. +* Exit Emacs menu item: File Menu. +* exiting <1>: Recursive Edit. +* exiting: Exiting. +* expansion (of abbrevs): Abbrevs. +* expression: Lists. +* file dates: Interlocking. +* file directory: ListDir. +* File menu <1>: File Menu. +* File menu: Pull-down Menus. +* file names: File Names. +* file protection: Interlocking. +* files <1>: Visiting. +* files <2>: Files. +* files: Basic. +* fill prefix: Fill Prefix. +* filling: Filling. +* Font menu item: Options Menu. +* fonts and faces: Face Customization. +* formfeed: Pages. +* Fortran mode: Fortran. +* frame: Frame. +* French Revolutionary calendar: Calendar Systems. +* function <1>: Key Bindings. +* function: Commands. +* General Public License: License. +* global keymap: Keymaps. +* global substitution: Replace. +* graphic characters: Basic. +* Greek: Mule. +* Gregorian calendar: Other Calendars. +* grinding: Grinding. +* hardcopy: Hardcopy. +* header (TeX mode): TeX Print. +* headers (of mail message): Mail Headers. +* heading lines (Outline mode): Outline Format. +* Hebrew calendar: Calendar Systems. +* help: Help. +* Help menu <1>: Help Menu. +* Help menu: Pull-down Menus. +* hierarchies: Startup Paths. +* history of commands: Repetition. +* history of minibuffer input: Minibuffer History. +* holiday forms: Holiday Customizing. +* holidays: Holidays. +* horizontal scrolling: Horizontal Scrolling. +* ignoriginal: Dissociated Press. +* indentation <1>: Comments. +* indentation <2>: Grinding. +* indentation: Indentation. +* inferior process: Compilation. +* Info: Misc Help. +* init file: Init File. +* input methods: Input Methods. +* Insert File... menu item: File Menu. +* insertion: Basic. +* international scripts: Mule. +* interval operator (in regexps): Etags Regexps. +* invisible lines: Outline Mode. +* IPA: Mule. +* Islamic calendar: Calendar Systems. +* ISO commercial calendar: Calendar Systems. +* italic font: Face Customization. +* Japanese: Mule. +* Julian calendar: Calendar Systems. +* Julian day numbers: Calendar Systems. +* justification: Fill Commands. +* key rebinding, permanent: Init File. +* key rebinding, this session: Rebinding. +* keyboard macros: Keyboard Macros. +* keycode: Super and Hyper Keys. +* keymap <1>: Keymaps. +* keymap: Commands. +* keystroke: Intro to Keystrokes. +* keysym: Intro to Keystrokes. +* keysyms: Super and Hyper Keys. +* Kill Buffer menu item: File Menu. +* kill ring: Yanking. +* killing: Killing. +* killing Emacs: Exiting. +* Korean: Mule. +* language environments: Language Environments. +* last package hierarchies: Startup Paths. +* late package hierarchies: Startup Paths. +* LaTeX: TeX Mode. +* libraries: Lisp Libraries. +* license to copy XEmacs: License. +* line number: Position Info. +* Lisp: Programs. +* Lisp mode: Program Modes. +* list: Lists. +* loading libraries: Loading. +* loading Lisp code: Lisp Libraries. +* local keymap: Keymaps. +* local variables: Locals. +* local variables in files: File Variables. +* locking and version control: Concepts of VC. +* log entry: Editing with VC. +* mail <1>: Reading Mail. +* mail: Sending Mail. +* major modes: Major Modes. +* make: Compilation. +* manuals, on-line: Misc Help. +* mark: Mark. +* mark ring <1>: Mark and Region. +* mark ring: Mark Ring. +* Markov chain: Dissociated Press. +* master file: Concepts of VC. +* matching parentheses: Matching. +* Mayan calendar: Calendar Systems. +* Mayan calendar round: Mayan Calendar. +* Mayan haab calendar: Mayan Calendar. +* Mayan long count: Mayan Calendar. +* Mayan tzolkin calendar: Mayan Calendar. +* menus <1>: Change Window. +* menus: Pull-down Menus. +* message <1>: Reading Mail. +* message: Sending Mail. +* Meta: Words. +* minibuffer <1>: Keymaps. +* minibuffer <2>: M-x. +* minibuffer: Minibuffer. +* minibuffer history: Minibuffer History. +* minor modes: Minor Modes. +* mistakes, correcting <1>: Fixit. +* mistakes, correcting: Undo. +* mocklisp: Mocklisp. +* mode hook: Program Modes. +* mode line <1>: Minor Modes. +* mode line: Mode Line. +* mode, Term: Term Mode. +* modified (buffer): Visiting. +* modifier key: Intro to Keystrokes. +* modifier mapping: Super and Hyper Keys. +* moon, phases of: Lunar Phases. +* mouse operations: Additional Mouse Operations. +* mouse selection: Mouse Selection. +* moving inside the calendar: Calendar Motion. +* moving text: Yanking. +* MULE: Mule. +* multi-frame XEmacs: XEmacs under X. +* multibyte characters: Mule. +* named configurations (RCS): Snapshot Caveats. +* narrowing: Narrowing. +* New Frame menu item: File Menu. +* newline: Basic. +* non-incremental search: Non-Incremental Search. +* nroff: Nroff Mode. +* numeric arguments: Arguments. +* omer count: Sexp Diary Entries. +* on-line manuals: Misc Help. +* Open File, New Frame... menu item: File Menu. +* Open File... menu item: File Menu. +* option <1>: Examining. +* option: Variables. +* Options menu <1>: Options Menu. +* Options menu: Pull-down Menus. +* other editors: Emulation. +* outlines: Outline Mode. +* outragedy: Dissociated Press. +* Overstrike menu item: Options Menu. +* Overwrite mode: Minor Modes. +* package hierarchies: Startup Paths. +* package path: Startup Paths. +* packages: Packages. +* page number: Position Info. +* pages: Pages. +* paragraphs: Paragraphs. +* parasha, weekly: Sexp Diary Entries. +* Paren Highlighting menu item: Options Menu. +* parentheses: Matching. +* Paste menu item: Edit Menu. +* pasting: Yanking. +* path: Startup Paths. +* paths: Startup Paths. +* per-buffer variables: Locals. +* Persian calendar: Calendar Systems. +* phases of the moon: Lunar Phases. +* pictures: Picture. +* point <1>: Basic. +* point: Point. +* pointer face: Mouse Selection. +* pointer shapes: Mouse Selection. +* prefix key sequence: Key Sequences. +* presidentagon: Dissociated Press. +* primary selections: X Selection Commands. +* Print Buffer menu item: File Menu. +* prompt: Minibuffer. +* properbose: Dissociated Press. +* Pull-down Menus <1>: Change Window. +* Pull-down Menus: Pull-down Menus. +* query replace: Query Replace. +* quitting: Quitting. +* quitting (in search): Incremental Search. +* quoting: Basic. +* random sentences: CONX. +* RCS: Concepts of VC. +* Read Only menu item: Options Menu. +* read-only buffer: Misc Buffer. +* rebinding keys, permanently: Init File. +* rebinding keys, this session: Rebinding. +* rectangle <1>: Rectangles in Picture. +* rectangle: RegRect. +* rectangles: Rectangles. +* recursive editing level <1>: Quitting. +* recursive editing level: Recursive Edit. +* redefining keys: Key Bindings Using Strings. +* regexp: Regexp Search. +* region <1>: Case. +* region: Mark. +* registered file: Concepts of VC. +* registers: Registers. +* regular expression: Regexp Search. +* regular packages: Package Terminology. +* removing directories: File Names. +* replacement: Replace. +* restriction: Narrowing. +* Revert Buffer menu item: File Menu. +* root of a hierarchy: Startup Paths. +* rosh hodesh: Sexp Diary Entries. +* Russian: Mule. +* Save Buffer As ... menu item: File Menu. +* Save Buffer menu item: File Menu. +* Save Options: Options Menu. +* saving: Visiting. +* saving option value: Changing an Option. +* SCCS: Concepts of VC. +* Scheme mode: Program Modes. +* scrolling: Scrolling. +* scrolling in the calendar: Scroll Calendar. +* searching: Search. +* selected buffer: Buffers. +* selected window: Basic Window. +* selective display: Outline Mode. +* self-documentation: Help. +* sentences: Sentences. +* setting option value: Changing an Option. +* setting variables: Examining. +* sexp: Lists. +* sexp diary entries: Sexp Diary Entries. +* shell commands: Shell. +* Shell mode: Shell Mode. +* shift modifer: Representing Keystrokes. +* shrinking XEmacs frame: Exiting. +* simultaneous editing: Interlocking. +* single-file packages: Package Terminology. +* site-specific directories: Startup Paths. +* Size menu item: Options Menu. +* slashes repeated in file name: Minibuffer File. +* snapshots and version control: Snapshots. +* sorting: Sorting. +* sorting diary entries: Fancy Diary Display. +* source packages: Package Terminology. +* spelling: Spelling. +* Split Frame: File Menu. +* Start Macro Recording menu item: Edit Menu. +* startup paths: Startup Paths. +* string substitution: Replace. +* subshell: Shell. +* subtree (Outline mode): Outline Visibility. +* sunrise and sunset: Sunrise/Sunset. +* suspending: Exiting. +* switching buffers: Select Buffer. +* Syntax Highlighting menu item: Options Menu. +* syntax table <1>: Syntax. +* syntax table: Words. +* tags table: Tags. +* Teach Extended Commands menu item: Options Menu. +* techniquitous: Dissociated Press. +* television: Appending Kills. +* Term mode: Term Mode. +* termscript file: Bugs. +* TeX: TeX Mode. +* text: Text. +* Text mode: Text Mode. +* Tools menu <1>: Tools Menu. +* Tools menu: Pull-down Menus. +* top level: Mode Line. +* transposition <1>: Lists. +* transposition <2>: Words. +* transposition: Transpose. +* truncation: Continuation Lines. +* typos: Fixit. +* Un-split (Keep Others): File Menu. +* Un-split (Keep This): File Menu. +* undo: Undo. +* Undo menu item: Edit Menu. +* variable: Variables. +* variables: Commands. +* version control: Version Control. +* version-specific directories: Startup Paths. +* vi: Emulation. +* viewing: Misc File Ops. +* Viper: Emulation. +* visiting: Visiting. +* visiting files: Visiting. +* weeks, which day they start on: Move to Beginning or End. +* Weight menu item: Options Menu. +* widening: Narrowing. +* window: Frame. +* windows: Windows. +* Windows menu: Change Window. +* word search: Word Search. +* words <1>: Case. +* words <2>: Words. +* words: Fixing Case. +* work file: Concepts of VC. +* X resources: X Resources. +* yahrzeits <1>: Sexp Diary Entries. +* yahrzeits: From Other Calendar. +* yanking: Yanking. + + diff --git a/info/xemacs.info-23 b/info/xemacs.info-23 new file mode 100644 index 0000000..cc4a455 --- /dev/null +++ b/info/xemacs.info-23 @@ -0,0 +1,863 @@ +This is ../info/xemacs.info, produced by makeinfo version 4.0 from +xemacs/xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Variable Index, Next: Concept Index, Prev: Command Index, Up: Top + +Variable Index +************** + +* Menu: + +* abbrev-all-caps: Expanding Abbrevs. +* abbrev-file-name: Saving Abbrevs. +* abbrev-mode: Abbrevs. +* after-load-alist: Loading. +* after-save-hook: Saving. +* all-christian-calendar-holidays: Holiday Customizing. +* all-hebrew-calendar-holidays: Holiday Customizing. +* all-islamic-calendar-holidays: Holiday Customizing. +* appt-audible: Appt Customizing. +* appt-display-duration: Appt Customizing. +* appt-display-mode-line: Appt Customizing. +* appt-message-warning-time: Appt Customizing. +* appt-msg-window: Appt Customizing. +* appt-visible: Appt Customizing. +* apropos-do-all: Apropos. +* auto-fill-inhibit-regexp: Fill Commands. +* auto-lower-frame: XEmacs under X. +* auto-mode-alist: Choosing Modes. +* auto-raise-frame: XEmacs under X. +* auto-save-default: Auto Save Control. +* auto-save-interval: Auto Save Control. +* auto-save-timeout: Auto Save Control. +* auto-save-visited-file-name: Auto Save Files. +* backup-by-copying: Backup Copying. +* backup-by-copying-when-linked: Backup Copying. +* backup-by-copying-when-mismatch: Backup Copying. +* bell-volume: Audible Bell. +* blink-matching-paren: Matching. +* blink-matching-paren-distance: Matching. +* bookmark-save-flag: Bookmarks. +* bookmark-search-size: Bookmarks. +* buffer-file-coding-system: Recognize Coding. +* buffer-file-name: Visiting. +* buffer-file-truename: Visiting. +* buffer-read-only: Misc Buffer. +* buffer-tag-table: Find Tag. +* c-argdecl-indent: C Indent. +* c-auto-newline: C Indent. +* c-brace-imaginary-offset: C Indent. +* c-brace-offset: C Indent. +* c-continued-statement-offset: C Indent. +* c-indent-level: C Indent. +* c-label-offset: C Indent. +* c-mode-hook: Program Modes. +* c-mode-map: Keymaps. +* c-tab-always-indent: C Indent. +* calendar-date-display-form: Date Display Format. +* calendar-daylight-savings-ends: Daylight Savings. +* calendar-daylight-savings-ends-time: Daylight Savings. +* calendar-daylight-savings-starts: Daylight Savings. +* calendar-daylight-time-offset: Daylight Savings. +* calendar-daylight-time-zone-name: Sunrise/Sunset. +* calendar-holiday-marker: Calendar Customizing. +* calendar-holidays: Holiday Customizing. +* calendar-latitude: Sunrise/Sunset. +* calendar-load-hook: Calendar Customizing. +* calendar-location-name: Sunrise/Sunset. +* calendar-longitude: Sunrise/Sunset. +* calendar-standard-time-zone-name: Sunrise/Sunset. +* calendar-time-display-form: Time Display Format. +* calendar-time-zone: Sunrise/Sunset. +* calendar-today-marker: Calendar Customizing. +* calendar-week-start-day: Move to Beginning or End. +* case-fold-search <1>: Replacement and Case. +* case-fold-search: Search Case. +* case-replace: Replacement and Case. +* christian-holidays: Holiday Customizing. +* coding: Recognize Coding. +* command-history: Repetition. +* command-line-args: Command Switches. +* comment-column: Comments. +* comment-end: Comments. +* comment-indent-hook: Comments. +* comment-line-start: Fortran Comments. +* comment-line-start-skip: Fortran Comments. +* comment-multi-line: Comments. +* comment-start: Comments. +* comment-start-skip: Comments. +* compare-ignore-case: Comparing Files. +* compile-command: Compilation. +* completion-auto-help: Completion Options. +* completion-ignored-extensions: Completion Options. +* create-frame-hook: XEmacs under X. +* ctl-arrow: Display Vars. +* ctl-x-map: Keymaps. +* current-input-method: Select Input Method. +* data-directory: Startup Paths. +* data-directory-list: Startup Paths. +* debug-on-error: Lisp Debug. +* debug-on-quit: Lisp Debug. +* default-buffer-file-coding-system: Specify Coding. +* default-directory: File Names. +* default-directory-alist: File Names. +* default-frame-alist: XEmacs under X. +* default-input-method: Select Input Method. +* default-major-mode: Choosing Modes. +* delete-auto-save-files: Auto Save Files. +* delete-old-versions: Backup Deletion. +* describe-function-show-arglist: Name Help. +* diary-date-forms: Diary Customizing. +* diary-display-hook: Fancy Diary Display. +* diary-entry-marker: Calendar Customizing. +* diary-file: Format of Diary File. +* diary-list-include-blanks: Fancy Diary Display. +* diary-mail-days: Diary Commands. +* diff-switches: Comparing Files. +* dired-kept-versions: Dired Deletion. +* dired-listing-switches: Dired Enter. +* display-buffer-function: Pop Up Window. +* doc-directory: Startup Paths. +* echo-keystrokes: Display Vars. +* emacs-lisp-mode-hook: Program Modes. +* emacs-roots: Startup Paths. +* EMACSDATA: Startup Paths. +* EMACSLOADPATH: Startup Paths. +* EMACSPATH: Startup Paths. +* enable-local-variables: File Variables. +* enable-recursive-minibuffers: Minibuffer Edit. +* esc-map: Keymaps. +* european-calendar-style: Date Formats. +* exec-directory: Startup Paths. +* exec-path: Startup Paths. +* explicit-shell-file-name: Interactive Shell. +* file-coding-system-alist: Recognize Coding. +* file-name-coding-system: Specify Coding. +* fill-column: Fill Commands. +* fill-prefix: Fill Prefix. +* find-file-compare-truenames: Visiting. +* find-file-hooks: Visiting. +* find-file-not-found-hooks: Visiting. +* find-file-run-dired: Visiting. +* find-file-use-truenames: Visiting. +* fortran-check-all-num-for-matching-do: ForIndent Vars. +* fortran-comment-indent-char: Fortran Comments. +* fortran-comment-indent-style: Fortran Comments. +* fortran-comment-line-column: Fortran Comments. +* fortran-comment-region: Fortran Comments. +* fortran-continuation-char: ForIndent Conv. +* fortran-continuation-indent: ForIndent Vars. +* fortran-do-indent: ForIndent Vars. +* fortran-electric-line-number: ForIndent Num. +* fortran-if-indent: ForIndent Vars. +* fortran-line-number-indent: ForIndent Num. +* fortran-minimum-statement-indent: ForIndent Vars. +* frame-icon-title-format <1>: Command Switches. +* frame-icon-title-format: XEmacs under X. +* frame-title-format <1>: Command Switches. +* frame-title-format: XEmacs under X. +* general-holidays: Holiday Customizing. +* global-map: Keymaps. +* hebrew-holidays: Holiday Customizing. +* help-map: Keymaps. +* holidays-in-diary-buffer: Diary Customizing. +* indent-tabs-mode: Just Spaces. +* Info-directory-list: Startup Paths. +* INFOPATH: Startup Paths. +* initial-calendar-window-hook: Calendar Customizing. +* initial-major-mode: Entering Emacs. +* input-method-highlight-flag: Input Methods. +* input-method-verbose-flag: Input Methods. +* input-ring-size: Interactive Shell. +* insert-default-directory <1>: File Names. +* insert-default-directory: Minibuffer File. +* isearch-mode-map: Keymaps. +* islamic-holidays: Holiday Customizing. +* kept-new-versions: Backup Deletion. +* kept-old-versions: Backup Deletion. +* keyboard-translate-table: Intro to Keystrokes. +* kill-ring-max: Earlier Kills. +* LaTeX-mode-hook: TeX Print. +* lisp-body-indention: Lisp Indent. +* lisp-directory: Startup Paths. +* lisp-indent-offset: Lisp Indent. +* lisp-interaction-mode-hook: Program Modes. +* lisp-mode-hook: Program Modes. +* lisp-mode-map: Keymaps. +* list-diary-entries-hook: Included Diary Files. +* list-directory-brief-switches: ListDir. +* list-directory-verbose-switches: ListDir. +* load-path <1>: Loading. +* load-path: Startup Paths. +* local-holidays: Holiday Customizing. +* lpr-switches: Hardcopy. +* mail-abbrev-mailrc-file: Mail Headers. +* mail-abbrev-mode-regexp: Mail Headers. +* mail-alias-separator-string: Mail Headers. +* mail-archive-file-name: Mail Headers. +* mail-header-separator: Mail Format. +* mail-mode-hook: Mail Mode. +* make-backup-files: Backup. +* make-tags-files-invisible: Find Tag. +* mark-diary-entries-hook: Included Diary Files. +* mark-diary-entries-in-calendar: Calendar Customizing. +* mark-holidays-in-calendar: Calendar Customizing. +* mark-ring: Mark Ring. +* mark-ring-max: Mark Ring. +* meta-flag: Meta Key. +* minibuffer-confirm-incomplete <1>: Completion Options. +* minibuffer-confirm-incomplete: Minibuffer Edit. +* minibuffer-local-completion-map: Keymaps. +* minibuffer-local-map: Keymaps. +* minibuffer-local-must-match-map: Keymaps. +* minibuffer-local-ns-map: Keymaps. +* mode-line-inverse-video: Mode Line. +* modeline-pointer-glyph: Mouse Selection. +* muddle-mode-hook: Program Modes. +* next-line-add-newlines: Moving Point. +* next-screen-context-lines: Scrolling. +* no-redraw-on-reenter: Display Vars. +* nongregorian-diary-listing-hook: Hebrew/Islamic Entries. +* nongregorian-diary-marking-hook: Hebrew/Islamic Entries. +* nontext-pointer-glyph: Mouse Selection. +* nroff-mode-hook: Nroff Mode. +* number-of-diary-entries: Diary Customizing. +* other-holidays: Holiday Customizing. +* outline-mode-hook: Outline Mode. +* outline-regexp: Outline Format. +* page-delimiter: Pages. +* paragraph-separate: Paragraphs. +* paragraph-start: Paragraphs. +* parse-sexp-ignore-comments: Syntax Entry. +* PATH: Startup Paths. +* picture-mode-hook: Picture. +* picture-tab-chars: Tabs in Picture. +* plain-TeX-mode-hook: TeX Print. +* print-diary-entries-hook: Diary Customizing. +* repeat-complex-command-map: Keymaps. +* require-final-newline: Saving. +* save-abbrevs: Saving Abbrevs. +* scheme-mode-hook: Program Modes. +* scroll-conservatively: Scrolling. +* scroll-step: Scrolling. +* search-slow-speed: Incremental Search. +* search-slow-window-lines: Incremental Search. +* selective-display-ellipses <1>: Outline Visibility. +* selective-display-ellipses: Display Vars. +* sentence-end: Sentences. +* shell-cd-regexp: Interactive Shell. +* shell-file-name: Single Shell. +* shell-popd-regexp: Interactive Shell. +* shell-prompt-pattern: Shell Mode. +* shell-pushd-regexp: Interactive Shell. +* sound-alist: Audible Bell. +* tab-stop-list: Tab Stops. +* tab-width: Display Vars. +* tag-mark-stack-max: Find Tag. +* tag-table-alist <1>: Find Tag. +* tag-table-alist: Select Tags Table. +* tags-always-build-completion-table: Select Tags Table. +* tags-build-completion-table: Find Tag. +* tags-file-name <1>: Find Tag. +* tags-file-name: Select Tags Table. +* term-file-prefix: Terminal Init. +* term-setup-hook: Terminal Init. +* TeX-mode-hook: TeX Print. +* text-mode-hook: Text Mode. +* text-pointer-glyph: Mouse Selection. +* today-invisible-calendar-hook: Calendar Customizing. +* today-visible-calendar-hook: Calendar Customizing. +* track-eol: Moving Point. +* truncate-lines: Continuation Lines. +* truncate-partial-width-windows: Split Window. +* vc-command-messages: Variables for Check-in/out. +* vc-comment-alist: Version Headers. +* vc-default-back-end: Editing with VC. +* vc-header-alist: Version Headers. +* vc-initial-comment: Editing with VC. +* vc-keep-workfiles: Editing with VC. +* vc-log-mode-hook: Log Entries. +* vc-make-backup-files: Editing with VC. +* vc-mistrust-permissions: Variables for Check-in/out. +* vc-path: Variables for Check-in/out. +* vc-static-header-alist: Version Headers. +* vc-suppress-confirm: Variables for Check-in/out. +* version-control: Backup Names. +* view-calendar-holidays-initially: Calendar Customizing. +* view-diary-entries-initially: Calendar Customizing. +* window-min-height: Change Window. +* window-min-width: Change Window. +* write-file-hooks: Saving. +* x-frame-defaults: XEmacs under X. +* zmacs-region-stays: Active Regions. +* zmacs-regions: Active Regions. + + +File: xemacs.info, Node: Concept Index, Next: Frame, Prev: Variable Index, Up: Top + +Concept Index +************* + +* Menu: + +* $ in regexp: Regexps. +* ( in regexp: Regexps. +* ) in regexp: Regexps. +* * in regexp: Regexps. +* *? in regexp: Regexps. +* + in regexp: Regexps. +* +? in regexp: Regexps. +* . in regexp: Regexps. +* .mailrc file: Mail Headers. +* // in file name: Minibuffer File. +* ? in regexp: Regexps. +* ?? in regexp: Regexps. +* [ in regexp: Regexps. +* \ in regexp: Regexps. +* \' in regexp: Regexps. +* \(?: in regexp: Regexps. +* \< in regexp: Regexps. +* \= in regexp: Regexps. +* \> in regexp: Regexps. +* \` in regexp: Regexps. +* \B in regexp: Regexps. +* \b in regexp: Regexps. +* \S in regexp: Regexps. +* \s in regexp: Regexps. +* \W in regexp: Regexps. +* \w in regexp: Regexps. +* \{n,m\} in regexp: Regexps. +* ] in regexp: Regexps. +* ^ in regexp: Regexps. +* Abbrev mode: Minor Modes. +* abbrevs: Abbrevs. +* aborting: Quitting. +* accumulating text: Accumulating Text. +* active fields (customization buffer): Customization Groups. +* active regions: Active Regions. +* adding menu items: Menu Customization. +* adding menus: Menu Customization. +* againformation: Dissociated Press. +* Apps menu <1>: Apps Menu. +* Apps menu: Pull-down Menus. +* apropos: Apropos. +* architecture-specific directories: Startup Paths. +* arguments (from shell): Command Switches. +* arrow keys: Moving Point. +* ASCII: Intro to Keystrokes. +* Asm mode: Asm Mode. +* astronomical day numbers: Calendar Systems. +* audible bell, changing: Audible Bell. +* Auto Delete Selection menu item: Options Menu. +* Auto Fill mode <1>: Minor Modes. +* Auto Fill mode <2>: Comments. +* Auto Fill mode: Auto Fill. +* Auto-Save mode: Auto Save. +* autoload: Loading. +* automatic package install: Automatically. +* available packages: Available Packages. +* backup file: Backup. +* batch mode: Command Switches. +* beginning of line in regexp: Regexps. +* bell, changing: Audible Bell. +* binary packages: Package Terminology. +* binding: Commands. +* blank lines <1>: Comments. +* blank lines: Blank Lines. +* body lines (Outline mode): Outline Format. +* bold font: Face Customization. +* bookmarks: Bookmarks. +* boredom: Amusements. +* buffer: Frame. +* buffer menu: Several Buffers. +* buffers: Buffers. +* Buffers menu <1>: Buffers Menu. +* Buffers menu: Pull-down Menus. +* Buffers Menu Length... menu item: Options Menu. +* Buffers Sub-Menus menu item: Options Menu. +* buggestion: Dissociated Press. +* bugs: Bugs. +* building packages: Building Packages. +* byte code: Compiling Libraries. +* C: Programs. +* C mode: Program Modes. +* C++ class browser, tags: Tags. +* calendar: Calendar/Diary. +* calendar and LaTeX: LaTeX Calendar. +* calendar, first day of week: Move to Beginning or End. +* candle lighting times: Sexp Diary Entries. +* case conversion <1>: Case. +* case conversion: Fixing Case. +* Case Sensitive Search menu item: Options Menu. +* centering: Fill Commands. +* change log: Change Log. +* changing buffers: Select Buffer. +* changing menu items: Menu Customization. +* character set: Intro to Keystrokes. +* character set (in regexp): Regexps. +* checking in files: Concepts of VC. +* checking out files: Concepts of VC. +* Chinese: Mule. +* Chinese calendar: Calendar Systems. +* choosing packages <1>: Which Packages. +* choosing packages: Installing Packages. +* class browser, C++: Tags. +* Clear menu item: Edit Menu. +* clipboard selections: X Clipboard Selection. +* coding systems: Coding Systems. +* command <1>: Key Bindings. +* command: Commands. +* command history: Repetition. +* command line arguments: Command Switches. +* command name: Key Bindings. +* comments: Comments. +* comparing files: Comparing Files. +* compilation errors: Compilation. +* compiling files: Compilation. +* completion: Completion. +* completion (symbol names): Lisp Completion. +* continuation line: Continuation Lines. +* Control-Meta: Lists. +* Coptic calendar: Calendar Systems. +* Copy menu item: Edit Menu. +* copying files: Misc File Ops. +* copying text <1>: Accumulating Text. +* copying text: Yanking. +* core distribution: Installing Packages. +* crashes: Auto Save. +* creating directories: File Names. +* creating files: Visiting. +* creating packages: Creating Packages. +* current buffer: Buffers. +* current stack frame: Lisp Debug. +* cursor <1>: Inserting Text. +* cursor: Point. +* cursor motion: Moving Point. +* customization <1>: Customization. +* customization <2>: Lisp Indent. +* customization: Commands. +* customization buffer: Easy Customization. +* customization groups: Customization Groups. +* customizing faces: Face Customization. +* cut buffers: X Selection Commands. +* Cut menu item: Edit Menu. +* cutting: Killing. +* day of year: General Calendar. +* daylight savings time: Daylight Savings. +* debugger: Lisp Debug. +* default argument: Minibuffer. +* defuns: Defuns. +* Delete Frame menu item: File Menu. +* deleting blank lines: Blank Lines. +* deleting characters and lines: Erasing. +* deleting menu items: Menu Customization. +* deleting packages: Removing Packages. +* deletion <1>: Killing. +* deletion: Inserting Text. +* deletion (of files) <1>: Misc File Ops. +* deletion (of files): Dired. +* diary: Diary. +* diary buffer: Fancy Diary Display. +* diary file: Format of Diary File. +* ding: Audible Bell. +* directories: Startup Paths. +* directory hierarchies: Startup Paths. +* directory listing: ListDir. +* Dired: Dired. +* disabled command: Disabling. +* disabling menu items: Menu Customization. +* Distribution: License. +* doctor: Total Frustration. +* double slash in file name: Minibuffer File. +* drastic changes: Reverting. +* dribble file: Bugs. +* early package hierarchies: Startup Paths. +* Ebrowse: Tags. +* echo area: Echo Area. +* Edit menu <1>: Edit Menu. +* Edit menu: Pull-down Menus. +* editable fields (customization buffer): Customization Groups. +* editing level, recursive <1>: Quitting. +* editing level, recursive: Recursive Edit. +* EDT: Emulation. +* Eliza: Total Frustration. +* Emacs initialization file: Init File. +* Emacs-Lisp mode: Lisp Eval. +* enabling menu items: Menu Customization. +* encoding of characters: Mule. +* End Macro Recording menu item: Edit Menu. +* entering XEmacs: Entering Emacs. +* environment: Single Shell. +* erasing characters and lines: Erasing. +* error log: Compilation. +* etags program: Create Tags Table. +* Ethiopic calendar: Calendar Systems. +* Execute Last Macro menu item: Edit Menu. +* Exit Emacs menu item: File Menu. +* exiting <1>: Recursive Edit. +* exiting: Exiting. +* expansion (of abbrevs): Abbrevs. +* expression: Lists. +* file dates: Interlocking. +* file directory: ListDir. +* File menu <1>: File Menu. +* File menu: Pull-down Menus. +* file names: File Names. +* file protection: Interlocking. +* files <1>: Visiting. +* files <2>: Files. +* files: Basic Files. +* fill prefix: Fill Prefix. +* filling: Filling. +* Font menu item: Options Menu. +* fonts and faces: Face Customization. +* formfeed: Pages. +* Fortran mode: Fortran. +* frame: Frame. +* French Revolutionary calendar: Calendar Systems. +* function <1>: Key Bindings. +* function: Commands. +* General Public License: License. +* getting help with keys: Basic Help. +* global keymap: Keymaps. +* global substitution: Replace. +* graphic characters: Inserting Text. +* Greek: Mule. +* Gregorian calendar: Other Calendars. +* grinding: Grinding. +* hardcopy: Hardcopy. +* header (TeX mode): TeX Print. +* headers (of mail message): Mail Headers. +* heading lines (Outline mode): Outline Format. +* Hebrew calendar: Calendar Systems. +* help: Help. +* Help menu <1>: Help Menu. +* Help menu: Pull-down Menus. +* hierarchies: Startup Paths. +* history of commands: Repetition. +* history of minibuffer input: Minibuffer History. +* holiday forms: Holiday Customizing. +* holidays: Holidays. +* horizontal scrolling: Horizontal Scrolling. +* Icomplete mode: Completion Options. +* ignoriginal: Dissociated Press. +* indentation <1>: Comments. +* indentation <2>: Grinding. +* indentation: Indentation. +* inferior process: Compilation. +* Info: Misc Help. +* init file: Init File. +* input methods: Input Methods. +* Insert File... menu item: File Menu. +* inserting blank lines: Blank Lines. +* insertion: Inserting Text. +* install: Installing Packages. +* installing packages: Installing Packages. +* international scripts: Mule. +* interval operator (in regexps): Etags Regexps. +* invisible lines: Outline Mode. +* IPA: Mule. +* Islamic calendar: Calendar Systems. +* ISO commercial calendar: Calendar Systems. +* italic font: Face Customization. +* Japanese: Mule. +* Julian calendar: Calendar Systems. +* Julian day numbers: Calendar Systems. +* justification: Fill Commands. +* key rebinding, permanent: Init File. +* key rebinding, this session: Rebinding. +* keyboard macros: Keyboard Macros. +* keycode: Super and Hyper Keys. +* keymap <1>: Keymaps. +* keymap: Commands. +* keystroke: Intro to Keystrokes. +* keysym: Intro to Keystrokes. +* keysyms: Super and Hyper Keys. +* Kill Buffer menu item: File Menu. +* kill ring: Yanking. +* killing: Killing. +* killing characters and lines: Erasing. +* killing Emacs: Exiting. +* Korean: Mule. +* language environments: Language Environments. +* last package hierarchies: Startup Paths. +* late package hierarchies: Startup Paths. +* LaTeX: TeX Mode. +* leaving Emacs: Exiting. +* libraries: Lisp Libraries. +* license to copy XEmacs: License. +* line number: Position Info. +* line wrapping: Continuation Lines. +* Lisp: Programs. +* Lisp mode: Program Modes. +* list: Lists. +* loading libraries: Loading. +* loading Lisp code: Lisp Libraries. +* local keymap: Keymaps. +* local variables: Locals. +* local variables in files: File Variables. +* local.rules: Local.rules File. +* locking and version control: Concepts of VC. +* log entry: Editing with VC. +* mail <1>: Reading Mail. +* mail: Sending Mail. +* major modes: Major Modes. +* make: Compilation. +* manual package install: Manually. +* manuals, on-line: Misc Help. +* mark: Mark. +* mark ring <1>: Mark and Region. +* mark ring: Mark Ring. +* Markov chain: Dissociated Press. +* master file: Concepts of VC. +* matching parentheses: Matching. +* Mayan calendar: Calendar Systems. +* Mayan calendar round: Mayan Calendar. +* Mayan haab calendar: Mayan Calendar. +* Mayan long count: Mayan Calendar. +* Mayan tzolkin calendar: Mayan Calendar. +* menus <1>: Change Window. +* menus: Pull-down Menus. +* message <1>: Reading Mail. +* message: Sending Mail. +* Meta: Words. +* minibuffer <1>: Keymaps. +* minibuffer <2>: M-x. +* minibuffer: Minibuffer. +* minibuffer history: Minibuffer History. +* minor modes: Minor Modes. +* mistakes, correcting <1>: Fixit. +* mistakes, correcting: Undo. +* mocklisp: Mocklisp. +* mode hook: Program Modes. +* mode line <1>: Minor Modes. +* mode line: Mode Line. +* mode, Term: Term Mode. +* modified (buffer): Visiting. +* modifier key: Intro to Keystrokes. +* modifier mapping: Super and Hyper Keys. +* moon, phases of: Lunar Phases. +* mouse operations: Additional Mouse Operations. +* mouse selection: Mouse Selection. +* movement: Moving Point. +* moving inside the calendar: Calendar Motion. +* moving point: Moving Point. +* moving text: Yanking. +* moving the cursor: Moving Point. +* MULE: Mule. +* multi-frame XEmacs: XEmacs under X. +* multibyte characters: Mule. +* named configurations (RCS): Snapshot Caveats. +* narrowing: Narrowing. +* New Frame menu item: File Menu. +* newline: Inserting Text. +* non-incremental search: Non-Incremental Search. +* nroff: Nroff Mode. +* numeric arguments: Arguments. +* omer count: Sexp Diary Entries. +* on-line manuals: Misc Help. +* Open File, New Frame... menu item: File Menu. +* Open File... menu item: File Menu. +* option <1>: Examining. +* option: Variables. +* Options menu <1>: Options Menu. +* Options menu: Pull-down Menus. +* other editors: Emulation. +* outlines: Outline Mode. +* outragedy: Dissociated Press. +* Overstrike menu item: Options Menu. +* Overwrite mode: Minor Modes. +* package building: Building Packages. +* package distributions: Package Terminology. +* package hierarchies: Startup Paths. +* package path: Startup Paths. +* package tools: Automatically. +* packages <1>: Available Packages. +* packages: Packages. +* page number: Position Info. +* pages: Pages. +* paragraphs: Paragraphs. +* parasha, weekly: Sexp Diary Entries. +* Paren Highlighting menu item: Options Menu. +* parentheses: Matching. +* Paste menu item: Edit Menu. +* pasting: Yanking. +* path: Startup Paths. +* paths: Startup Paths. +* per-buffer variables: Locals. +* Persian calendar: Calendar Systems. +* phases of the moon: Lunar Phases. +* pictures: Picture. +* point <1>: Inserting Text. +* point: Point. +* pointer face: Mouse Selection. +* pointer shapes: Mouse Selection. +* prefix key sequence: Key Sequences. +* presidentagon: Dissociated Press. +* primary selections: X Selection Commands. +* Print Buffer menu item: File Menu. +* prompt: Minibuffer. +* properbose: Dissociated Press. +* Pull-down Menus <1>: Change Window. +* Pull-down Menus: Pull-down Menus. +* query replace: Query Replace. +* quitting: Quitting. +* quitting (in search): Incremental Search. +* quitting Emacs: Exiting. +* quoting: Inserting Text. +* random sentences: CONX. +* RCS: Concepts of VC. +* Read Only menu item: Options Menu. +* read-only buffer: Misc Buffer. +* rebinding keys, permanently: Init File. +* rebinding keys, this session: Rebinding. +* rectangle <1>: Rectangles in Picture. +* rectangle: RegRect. +* rectangles: Rectangles. +* recursive editing level <1>: Quitting. +* recursive editing level: Recursive Edit. +* redefining keys: Key Bindings Using Strings. +* regexp: Regexp Search. +* regexp alternative: Regexps. +* regexp grouping: Regexps. +* region <1>: Case. +* region: Mark. +* registered file: Concepts of VC. +* registers: Registers. +* regular expression: Regexp Search. +* regular packages: Package Terminology. +* removing directories: File Names. +* removing packages: Removing Packages. +* replacement: Replace. +* restriction: Narrowing. +* Revert Buffer menu item: File Menu. +* root of a hierarchy: Startup Paths. +* rosh hodesh: Sexp Diary Entries. +* Russian: Mule. +* Save Buffer As ... menu item: File Menu. +* Save Buffer menu item: File Menu. +* Save Options: Options Menu. +* saving: Visiting. +* saving option value: Changing an Option. +* SCCS: Concepts of VC. +* Scheme mode: Program Modes. +* scrolling: Scrolling. +* scrolling in the calendar: Scroll Calendar. +* searching: Search. +* selected buffer: Buffers. +* selected window: Basic Window. +* selective display: Outline Mode. +* self-documentation: Help. +* sentences: Sentences. +* setting option value: Changing an Option. +* setting variables: Examining. +* sexp: Lists. +* sexp diary entries: Sexp Diary Entries. +* shell commands: Shell. +* Shell mode: Shell Mode. +* shift modifier: Representing Keystrokes. +* shrinking XEmacs frame: Exiting. +* simultaneous editing: Interlocking. +* single-file packages: Package Terminology. +* site-specific directories: Startup Paths. +* Size menu item: Options Menu. +* slashes repeated in file name: Minibuffer File. +* snapshots and version control: Snapshots. +* sorting: Sorting. +* sorting diary entries: Fancy Diary Display. +* source packages: Package Terminology. +* spelling: Spelling. +* Split Frame: File Menu. +* Start Macro Recording menu item: Edit Menu. +* starting XEmacs: Entering Emacs. +* startup paths: Startup Paths. +* string substitution: Replace. +* subshell: Shell. +* subtree (Outline mode): Outline Visibility. +* sumo package install: Sumo. +* sunrise and sunset: Sunrise/Sunset. +* suspending: Exiting. +* switching buffers: Select Buffer. +* Syntax Highlighting menu item: Options Menu. +* syntax table <1>: Syntax. +* syntax table: Words. +* tags table: Tags. +* tags, C++: Tags. +* Teach Extended Commands menu item: Options Menu. +* techniquitous: Dissociated Press. +* television: Appending Kills. +* Term mode: Term Mode. +* termscript file: Bugs. +* TeX: TeX Mode. +* text: Text. +* Text mode: Text Mode. +* Tools menu <1>: Tools Menu. +* Tools menu: Pull-down Menus. +* top level: Mode Line. +* transposition <1>: Lists. +* transposition <2>: Words. +* transposition: Transpose. +* truncation: Continuation Lines. +* typos: Fixit. +* Un-split (Keep Others): File Menu. +* Un-split (Keep This): File Menu. +* undo: Undo. +* Undo menu item: Edit Menu. +* variable: Variables. +* variables: Commands. +* version control: Version Control. +* version-specific directories: Startup Paths. +* vi: Emulation. +* viewing: Misc File Ops. +* Viper: Emulation. +* visiting: Visiting. +* visiting files: Visiting. +* weeks, which day they start on: Move to Beginning or End. +* Weight menu item: Options Menu. +* which packages: Which Packages. +* widening: Narrowing. +* window: Frame. +* windows: Windows. +* Windows menu: Change Window. +* word search: Word Search. +* words <1>: Case. +* words <2>: Words. +* words: Fixing Case. +* work file: Concepts of VC. +* wrapping: Continuation Lines. +* X resources: X Resources. +* yahrzeits <1>: Sexp Diary Entries. +* yahrzeits: From Other Calendar. +* yanking: Yanking. +* | in regexp: Regexps. + + diff --git a/info/xemacs.info-3 b/info/xemacs.info-3 index f3f6e3a..e663385 100644 --- a/info/xemacs.info-3 +++ b/info/xemacs.info-3 @@ -1,5 +1,5 @@ -This is ../info/xemacs.info, produced by makeinfo version 4.0 from -xemacs/xemacs.texi. +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -30,318 +30,23 @@ versions, except that the sections entitled "The GNU Manifesto", translation approved by the author instead of in the original English.  -File: xemacs.info, Node: Options Menu, Next: Buffers Menu, Prev: Apps Menu, Up: Pull-down Menus - -The Options Menu ----------------- - - The Options pull-down menu contains the Read Only, Case Sensitive -Search, Overstrike, Auto Delete Selection, Teach Extended Commands, -Syntax Highlighting, Paren Highlighting, Font, Size, Weight, Buffers -Menu Length..., Buffers Sub-Menus and Save Options menu items. When -you select a menu item, Emacs executes the equivalent command. For -some of the menu items, there are sub-menus which you will need to -select. - -Read Only - Selecting this item will cause the buffer to visit the file in a - read-only mode. Changes to the file will not be allowed. This is - equivalent to the Emacs command `toggle-read-only' (`C-x C-q'). - -Case Sensitive Search - Selecting this item will cause searches to be case-sensitive. If - its not selected then searches will ignore case. This option is - local to the buffer. - -Overstrike - After selecting this item, when you type letters they will replace - existing text on a one-to-one basis, rather than pushing it to the - right. At the end of a line, such characters extend the line. - Before a tab, such characters insert until the tab is filled in. - This is the same as Emacs command `quoted-insert' (`C-q'). - -Auto Delete Selection - Selecting this item will cause automatic deletion of the selected - region. The typed text will replace the selection if the selection - is active (i.e. if its highlighted). If the option is not selected - then the typed text is just inserted at the point. - -Teach Extended Commands - After you select this item, any time you execute a command with - `M-x'which has a shorter keybinding, you will be shown the - alternate binding before the command executes. - -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. *Note Init File::. When Fonts is selected, different parts of - the program will appear in different Fonts. When Colors is - selected, then the program will be displayed in different colors. - Selecting None causes the program to appear in just one Font and - Color. Selecting Less resets the Fonts and Colors to a fast, - minimal set of decorations. Selecting More resets the Fonts and - Colors to a larger set of decorations. For example, if Less is - selected (which is the default setting) then you might have all - comments in green color. Whereas, if More is selected then a - function name in the comments themselves might appear in a - different Color or Font. - -Paren Highlighting - After selecting Blink from this item, if you place the cursor on a - parenthesis, the matching parenthesis will blink. If you select - Highlight and place the cursor on a parenthesis, the whole - expression of the parenthesis under the cursor will be highlighted. - Selecting None will turn off the options (regarding Paren - Highlighting) which you had selected earlier. - -Font - You can select any Font for your program by choosing from one of - the available Fonts. - -Size - You can select any size ranging from 2 to 24 by selecting the - appropriate option. - -Weight - You can choose either Bold or Medium for the weight. - -Buffers Menu Length... - Prompts you for the number of buffers to display. Then it will - display that number of most recently selected buffers. - -Buffers Sub-Menus - After selection of this item the Buffers menu will contain several - commands, as submenus of each buffer line. If this item is - unselected, then there are no submenus for each buffer line, the - only command available will be selecting that buffer. - -Save Options - Selecting this item will save the current settings of your Options - menu to your init file. *Note Init File::. - - -File: xemacs.info, Node: Buffers Menu, Next: Tools Menu, Prev: Options Menu, Up: Pull-down Menus - -The Buffers Menu ----------------- - - The Buffers menu provides a selection of up to ten buffers and the -item List All Buffers, which provides a Buffer List. *Note List -Buffers::, for more information. - - -File: xemacs.info, Node: Tools Menu, Next: Help Menu, Prev: Buffers Menu, Up: Pull-down Menus - -The Tools Menu --------------- - - The Tools pull-down menu contains the Grep..., Compile..., Shell -Command..., Shell Command on Region..., Debug(GDB)... and -Debug(DBX)... menu items, and the Compare, Merge, Apply Patch and Tags -sub-menus. When you select a menu item, Emacs executes the equivalent -command. For some of the menu items, there are sub-menus which you -will need to select. - - -File: xemacs.info, Node: Help Menu, Next: Menu Customization, Prev: Tools Menu, Up: Pull-down Menus - -The Help Menu -------------- - - The Help Menu gives you access to Emacs Info and provides a menu -equivalent for each of the choices you have when using `C-h'. *Note -Help::, for more information. - - The Help menu also gives access to UNIX online manual pages via the -UNIX Manual Page option. - - -File: xemacs.info, Node: Menu Customization, Prev: Help Menu, Up: Pull-down Menus - -Customizing XEmacs Menus ------------------------- - - You can customize any of the pull-down menus by adding or removing -menu items and disabling or enabling existing menu items. - - The following functions are available: -`add-menu: (MENU-PATH MENU-NAME MENU-ITEMS &optional BEFORE)' - Add a menu to the menu bar or one of its submenus. - -`add-menu-item: (MENU-PATH ITEM-NAME FUNCTION' - ENABLED-P &optional BEFORE) Add a menu item to a menu, creating - the menu first if necessary. - -`delete-menu-item: (PATH)' - Remove the menu item defined by PATH from the menu hierarchy. - -`disable-menu-item: (PATH)' - Disable the specified menu item. - -`enable-menu-item: (PATH)' - Enable the specified previously disabled menu item. - -`relabel-menu-item: (PATH NEW-NAME)' - Change the string of the menu item specified by PATH to NEW-NAME. - - Use the function `add-menu' to add a new menu or submenu. If a menu -or submenu of the given name exists already, it is changed. - - MENU-PATH identifies the menu under which the new menu should be -inserted. It is a list of strings; for example, `("File")' names the -top-level File menu. `("File" "Foo")' names a hypothetical submenu of -File. If MENU-PATH is `nil', the menu is added to the menu bar itself. - - MENU-NAME is the string naming the menu to be added. - - MENU-ITEMS is a list of menu item descriptions. Each menu item -should be a vector of three elements: - - * A string, which is the name of the menu item - - * A symbol naming a command, or a form to evaluate - - * `t' or `nil' to indicate whether the item is selectable - - The optional argument BEFORE is the name of the menu before which -the new menu or submenu should be added. If the menu is already -present, it is not moved. - - The function `add-menu-item' adds a menu item to the specified menu, -creating the menu first if necessary. If the named item already -exists, the menu remains unchanged. - - MENU-PATH identifies the menu into which the new menu item should be -inserted. It is a list of strings; for example, `("File")' names the -top-level File menu. `("File" "Foo")' names a hypothetical submenu of -File. - - ITEM-NAME is the string naming the menu item to add. - - FUNCTION is the command to invoke when this menu item is selected. -If it is a symbol, it is invoked with `call-interactively', in the same -way that functions bound to keys are invoked. If it is a list, the -list is simply evaluated. - - ENABLED-P controls whether the item is selectable or not. It should -be `t', `nil', or a form to evaluate to decide. This form will be -evaluated just before the menu is displayed, and the menu item will be -selectable if that form returns non-`nil'. - - For example, to make the `rename-file' command available from the -File menu, use the following code: - - (add-menu-item '("File") "Rename File" 'rename-file t) - - To add a submenu of file management commands using a File Management -item, use the following code: - - (add-menu-item '("File" "File Management") "Copy File" 'copy-file t) - (add-menu-item '("File" "File Management") "Delete File" 'delete-file t) - (add-menu-item '("File" "File Management") "Rename File" 'rename-file t) - - The optional BEFORE argument is the name of a menu item before which -the new item should be added. If the item is already present, it is -not moved. - - To remove a specified menu item from the menu hierarchy, use -`delete-menu-item'. - - PATH is a list of strings that identify the position of the menu -item in the menu hierarchy. `("File" "Save")' means the menu item -called Save under the top level File menu. `("Menu" "Foo" "Item")' -means the menu item called Item under the Foo submenu of Menu. - - To disable a menu item, use `disable-menu-item'. The disabled menu -item is grayed and can no longer be selected. To make the item -selectable again, use `enable-menu-item'. `disable-menu-item' and -`enable-menu-item' both have the argument PATH. - - To change the string of the specified menu item, use -`relabel-menu-item'. This function also takes the argument PATH. - - NEW-NAME is the string to which the menu item will be changed. - - -File: xemacs.info, Node: Entering Emacs, Next: Exiting, Prev: Pull-down Menus, Up: Top - -Entering and Exiting Emacs -************************** - - The usual way to invoke XEmacs is to type `xemacs ' 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. - - If you run XEmacs from a shell window under the X Window System, run -it in the background with `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. - - 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 `*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 `initial-major-mode' in your -init file. *Note 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. *Note Command Switches::. But we don't recommend -doing this. The feature exists mainly for compatibility with other -editors. - - 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. *Note Files::, for more information on visiting more than one -file. - - File: xemacs.info, Node: Exiting, Next: Command Switches, Prev: Entering Emacs, Up: Top Exiting Emacs ============= There are two commands for exiting Emacs because there are two kinds -of exiting: "suspending" Emacs and "killing" Emacs. - - "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. - - "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. +of exiting: "suspending" Emacs and "killing" Emacs. "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. "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. `C-z' - Suspend Emacs or iconify a frame - (`suspend-emacs-or-iconify-frame'). If used under the X window + Suspend Emacs (`suspend-emacs'). If used under the X window system, shrink the X window containing the Emacs frame to an icon (see below). @@ -352,65 +57,41 @@ the same editing session after it has been killed. 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 `C-z' is iconified. +frame from which you used `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 `C-x C-c' or the Exit XEmacs item on the File menu. - - To suspend Emacs, type `C-z' (`suspend-emacs'). This takes you back -to the shell from which you invoked Emacs. You can resume Emacs with -the shell command `%xemacs' in most common shells. - - On systems that do not support suspending programs, `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 `C-d' or `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 `cannot-suspend' to a -non-`nil' value to force `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, `C-z' has a different meaning. Suspending an -applications that uses its own X windows is not meaningful or useful. -Instead, `C-z' runs the command `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. +process, use `C-x C-c' or the Exit Emacs item on the File menu. + + On systems that do not permit programs to be suspended, `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. `C-d' or `exit' are typical commands to +exit a subshell. To kill Emacs, type `C-x C-c' (`save-buffers-kill-emacs'). A -two-character key is used for this to make it harder to type. Selecting -the Exit XEmacs option of the 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 Exit Emacs option of the 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 `yes' before killing Emacs, since -any changes not saved will be lost forever. If any subprocesses are -still running, `C-x C-c' asks you to confirm killing them, since killing -Emacs will kill the subprocesses immediately. - - 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. - - The operating system usually listens for certain special characters -whose meaning is to kill or suspend the program you are running. This -operating system feature is turned off while you are in Emacs. The -meanings of `C-z' and `C-x C-c' as keys in Emacs were inspired by the -use of `C-z' and `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 (*note Keymaps::). +any modified buffers. If you do not save all buffers, you are asked for +reconfirmation with `yes' before killing Emacs, since any changes not +saved will be lost. If any subprocesses are still running, `C-x C-c' +asks you to confirm killing them, since killing Emacs kills the +subprocesses simultaneously. + + In most programs running on Unix, certain characters may instantly +suspend or kill the program. (In Berkeley Unix these characters are +normally `C-z' and `C-c'.) This Unix feature is turned off while you +are in Emacs. The meanings of `C-z' and `C-x C-c' as keys in Emacs were +inspired by the standard Berkeley Unix meanings of `C-z' and `C-c', but +that is their only relationship with Unix. You could customize these +keys to do anything (*note Keymaps::.).  File: xemacs.info, Node: Command Switches, Next: Startup Paths, Prev: Exiting, Up: Top @@ -442,14 +123,9 @@ command line arguments for specifying a file when Emacs is started are seldom needed. Emacs accepts command-line arguments that specify files to visit, -functions to call, and other activities and operating modes. If you -are running XEmacs under the X window system, a number of standard Xt -command line arguments are available, as well as a few X parameters -that are XEmacs-specific. - - Options with long names with a single initial hyphen are also -recognized with the GNU double initial hyphen syntax. (The reverse is -not true.) +functions to call, and other activities and operating modes. If you are +running XEmacs under the X window system, a number of standard Xt +command line arguments are available as well. The following subsections list: * Command line arguments that you can always use @@ -494,8 +170,7 @@ must be at the front of the list if they are used. what `M-x insert-buffer' does; *Note Misc File Ops::. `-kill' - Exit from Emacs without asking for confirmation. Always the last - argument processed, no matter where it appears in the command line. + Exit from Emacs without asking for confirmation. `-version' `-V' @@ -514,18 +189,6 @@ Command Line Arguments (Beginning of Line Only) command line. If more than one of them appears, they must appear in the order in which they appear in this table. -`--show-dump-id' -`-sd' - Print the ID for the new portable dumper's dump file on the - terminal and exit. (Prints an error message and exits if XEmacs - was not configured `--pdump'.) - -`--no-dump-file' -`-nd' - Don't load the dump file. Roughly equivalent to old temacs. - (Ignored if XEmacs was not configured `--pdump'.) - -`--terminal FILE' `-t FILE' Use FILE instead of the terminal for input and output. This implies the `-nw' option, documented below. @@ -547,7 +210,6 @@ order in which they appear in this table. processed. In addition, auto-saving is not done except in buffers for which it has been explicitly requested. -`--no-windows' `-nw' Start up XEmacs in TTY mode (using the TTY XEmacs was started from), rather than trying to connect to an X display. Note that @@ -559,7 +221,7 @@ order in which they appear in this table. `-debug-paths' Displays information on how XEmacs constructs the various paths - into its hierarchy on startup. (See also *note Startup Paths::.) + into its hierarchy on startup. (See also *note Startup Paths::..) `-unmapped' Do not map the initial frame. This is useful if you want to start @@ -568,7 +230,7 @@ order in which they appear in this table. `-no-init-file' `-q' - Do not load your Emacs init file. *Note Init File::. + Do not load your Emacs init file `~/.emacs'. `-no-site-file' Do not load the site-specific init file `lisp/site-start.el'. @@ -585,8 +247,7 @@ order in which they appear in this table. This is equivalent to `-q -no-site-file -no-early-packages'. `-user-init-file FILE' - Load FILE as your Emacs init file instead of - `~/.xemacs/init.el'/`~/.emacs'. + Load FILE as your Emacs init file instead of `~/.emacs'. `-user-init-directory DIRECTORY' Use DIRECTORY as the location of your early package hierarchies @@ -594,10 +255,8 @@ order in which they appear in this table. `-user USER' `-u USER' - Equivalent to `-user-init-file ~USER/.xemacs/init.el - -user-init-directory ~USER/.xemacs', or `-user-init-file - ~USER/.emacs -user-init-directory ~USER/.xemacs', whichever init - file comes first. *Note Init File::. + Equivalent to `-user-init-file ~USER/.emacs -user-init-directory + ~USER/.xemacs'. Note that the init file can get access to the command line argument values as the elements of a list in the variable `command-line-args'. @@ -610,7 +269,7 @@ normal processing of the other arguments by setting this variable. xemacs *.c passes each `.c' file as a separate argument to Emacs, so that Emacs -visits each file (*note Visiting::). +visits each file (*note Visiting::.). Here is an advanced example that assumes you have a Lisp program file called `hack-c-program.el' which, when loaded, performs some useful @@ -704,7 +363,7 @@ command line arguments. Emacs only.  -File: xemacs.info, Node: Startup Paths, Next: Packages, Prev: Command Switches, Up: Top +File: xemacs.info, Node: Startup Paths, Next: Basic, Prev: Command Switches, Up: Top How XEmacs finds Directories and Files ====================================== @@ -739,9 +398,9 @@ hierarchies: the hierarchy where XEmacs was or will be installed, and the one where it is being built.) Such a directory containing a hierarchy is called a "root". Whenever this section refers to a directory using the shorthand `', it means that XEmacs searches -for it under all hierarchies XEmacs was able to scrounge up. In a -running XEmacs, the hierarchy roots are stored in the variable -`emacs-roots'. +for it under all hierarchies under all hierarchies XEmacs was able to +scrounge up. In a running XEmacs, the hierarchy roots are stored in +the variable `emacs-roots'. Package Hierarchies ------------------- @@ -759,8 +418,8 @@ XEmacs paths. Early package hierarchies are at the 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 `.xemacs/xemacs-packages' of the user's home directory. + By default, XEmacs expects an early package hierarchy in the a +subdirectory `.xemacs' of the user's home directory. Moreover, XEmacs expects late hierarchies in the subdirectories `site-packages', `mule-packages', and `xemacs-packages' (in that order) @@ -773,18 +432,18 @@ prefer directories found there. 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 package hierarchies with the `--package-path' option to configure. The early, late, and last components of the package path -are separated by double instead of single colons. If all three -components are present, they locate the early, late, and last package +are separated by double instead of single colons. If three components +are present, they are locate the early, late, and last package hierarchies respectively. If two components are present, they locate the early and late hierarchies. If only one component is present, it locates the late hierarchy. At run time, the package path may also be -specified via the `EMACSPACKAGEPATH' environment variable. +specified via the `PACKAGEPATH' environment variable. An XEmacs package is laid out just like a normal installed XEmacs lisp directory. It may have `lisp', `etc', `info', and `lib-src' @@ -819,7 +478,7 @@ directly under `', because that is where they are in the XEmacs tarball. If XEmacs runs with the `-debug-paths' option (*note Command -Switches::), it will print the values of these variables, hopefully +Switches::.), it will print the values of these variables, hopefully aiding in debugging any problems which come up. `lisp-directory' @@ -841,6 +500,12 @@ aiding in debugging any problems which come up. `/usr/local/info' as well as the directories of the environment variable `INFOPATH' to `Info-directory-list'. +`lock-directory' +`superlock-file' + Are the site-specific locations of the lock directory and the + superlock file, respectively. The `lock-directory' variable may + also be initialized from the `EMACSLOCKDIR' environment variable. + `exec-directory' Is the directory of architecture-dependent files that come with XEmacs, especially executable programs intended for XEmacs to @@ -866,7 +531,7 @@ aiding in debugging any problems which come up. package data directories as well as `data-directory'.  -File: xemacs.info, Node: Basic, Next: Undo, Prev: Packages, Up: Top +File: xemacs.info, Node: Basic, Next: Undo, Prev: Startup Paths, Up: Top Basic Editing Commands ********************** @@ -874,102 +539,64 @@ Basic Editing Commands 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 `Control-h t' -(`help-with-tutorial'). You can also use Tutorials item from the 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 (*note Language Environments::). If you -want specific translation, give `C-h t' a prefix argument, like `C-u -C-h t'. - - To clear the screen and redisplay, type `C-l' (`recenter'). - -* Menu: - - -* Inserting Text:: Inserting text by simply typing it. -* Moving Point:: How to move the cursor to the place where you want to - change something. -* Erasing:: Deleting and killing text. -* Files: Basic Files. Visiting, creating, and saving files. -* Help: Basic Help. Asking what a character does. -* Blank Lines:: Commands to make or delete blank lines. -* Continuation Lines:: Lines too wide for the screen. -* Position Info:: What page, line, row, or column is point on? -* Arguments:: Numeric arguments for repeating a command. - - -File: xemacs.info, Node: Inserting Text, Next: Moving Point, Up: Basic +do this, type `Control-h t' (`help-with-tutorial'). Inserting Text ============== 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 "point"; *note Point::). The cursor moves forward, -and any text after the cursor moves forward too. If the text in the -buffer is `FOOBAR', with the cursor before the `B', then if you type -`XX', you get `FOOXXBAR', with the cursor still before the `B'. - - To "delete" text you have just inserted, use . deletes the -character _before_ the cursor (not the one that the cursor is on top of -or under; that is the character AFTER the cursor). The cursor and all -characters after it move backwards. Therefore, if you type a printing -character and then type , they cancel out. +type them. This inserts the characters into the buffer at the cursor +(that is, at "point"; *note Point::.). The cursor moves forward. Any +characters after the cursor move forward too. If the text in the buffer +is `FOOBAR', with the cursor before the `B', and you type `XX', the +result is `FOOXXBAR', with the cursor still before the `B'. + + To "delete" text you have just inserted, use . deletes +the character BEFORE the cursor (not the one that the cursor is on top +of or under; that is the character AFTER the cursor). The cursor and +all characters after it move backwards. Therefore, if you type a +printing character and then type , they cancel out. To end a line and start typing a new one, type . This inserts a newline character in the buffer. If point is in the middle of a line, splits the line. Typing when the cursor is at the -beginning of a line deletes the preceding newline, thus joining the -line with the preceding line. +beginning of a line rubs out the newline before the line, thus joining +the line with the preceding line. - Emacs can split lines automatically when they become too long, if you -turn on a special minor mode called "Auto Fill" mode. *Note Filling::, -for how to use Auto Fill mode. + Emacs automatically splits lines when they become too long, if you +turn on a special mode called "Auto Fill" mode. *Note Filling::, for +information on using 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. *Note Minor Modes::. + Customization information: , in most modes, runs the command +`delete-backward-char'; runs the command `newline', and +self-inserting printing characters run the command `self-insert', which +inserts whatever character was typed to invoke it. Some major modes +rebind to other commands. Direct insertion works for printing characters and , 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 "quote" it by typing the character `Control-q' -(`quoted-insert') first. (This character's name is normally written -`C-q' for short.) There are two ways to use `C-q': - - * `C-q' followed by any non-graphic character (even `C-g') inserts - that character. - - * `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 , 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.) +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 "quote" it by typing the character +`control-q' (`quoted-insert') first. There are two ways to use `C-q': -A numeric argument to `C-q' specifies how many copies of the quoted -character should be inserted (*note Arguments::). + * `Control-q' followed by any non-graphic character (even `C-g') + inserts that character. - Customization information: , in most modes, runs the command -`backward-or-forward-delete-char'; runs the command `newline', -and self-inserting printing characters run the command `self-insert', -which inserts whatever character was typed to invoke it. Some major -modes rebind to other commands. + * `Control-q' followed by three octal digits inserts the character + with the specified character code. - -File: xemacs.info, Node: Moving Point, Next: Erasing, Prev: Inserting Text, Up: Basic +A numeric argument to `C-q' specifies how many copies of the quoted +character should be inserted (*note Arguments::.). + + If you prefer to have text characters replace (overwrite) existing +text instead of moving it to the right, you can enable Overwrite mode, a +minor mode. *Note Minor Modes::. Changing the Location of Point ============================== To do more than insert characters, you have to know how to move point -(*note Point::). The simplest way to do this is with arrow keys, or by -clicking the left mouse button where you want to move to. +(*note 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. or ) and one that doesn't. The @@ -1025,13 +652,11 @@ TTY's), but the latter are available on all terminals. on the frame to bring point to the center of the window. `M-r' - Move point to left margin, vertically centered in the window - (`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 (-1 - for the bottom line). + Move point to left margin on the line halfway down the frame or + window (`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 (-1 for the bottom). `C-t' Transpose two characters, the ones before and after the cursor @@ -1048,46 +673,36 @@ TTY's), but the latter are available on all terminals. Move to the end of the buffer (`end-of-buffer'). `M-x goto-char' - Read a number N and move point to buffer position N. Position 1 - is the beginning of the buffer. + Read a number N and move the cursor to character number N. + Position 1 is the beginning of the buffer. `M-g' - Read a number N and move point to line number N (`goto-line'). + Read a number N and move cursor to line number N (`goto-line'). Line 1 is the beginning of the buffer. -`M-x set-goal-column' +`C-x C-n' Use the current column of point as the "semi-permanent goal column" for `C-n' and `C-p' (`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-u M-x set-goal-column' +`C-u C-x C-n' Cancel the goal column. Henceforth, `C-n' and `C-p' once again try to avoid changing the horizontal position, as usual. - If you set the variable `track-eol' to a non-`nil' value, then `C-n' -and `C-p' when at the end of the starting line move to the end of -another line. Normally, `track-eol' is `nil'. *Note Variables::, for -how to set variables such as `track-eol'. - - Normally, `C-n' on the last line of a buffer appends a newline to -it. If the variable `next-line-add-newlines' is `nil', then `C-n' gets -an error instead (like `C-p' on the first line). - - -File: xemacs.info, Node: Erasing, Next: Basic Files, Prev: Moving Point, Up: Basic + If you set the variable `track-eol' to a non-`nil' value, `C-n' and +`C-p' move to the end of the line when at the end of the starting line. +By default, `track-eol' is `nil'. Erasing Text ============ `' - Delete the character before or after point - (`backward-or-forward-delete-char'). You can customize this - behavior by setting the variable `delete-key-deletes-forward'. + Delete the character before the cursor (`delete-backward-char'). `C-d' - Delete the character after point (`delete-char'). + Delete the character after the cursor (`delete-char'). `C-k' Kill to the end of the line (`kill-line'). @@ -1099,87 +714,85 @@ Erasing Text Kill back to the beginning of the previous word (`backward-kill-word'). - You already know about the key which deletes the character -before point (that is, before the cursor). Another key, `Control-d' -(`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 `C-d' at the end of a line, it joins -together that line and the next line. + In contrast to the key, which deletes the character before the +cursor, `Control-d' deletes the character after the cursor, causing the +rest of the text on the line to shift left. If `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 `C-k' key, which kills a -line at a time. If you type `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 + To erase a larger amount of text, use `Control-k', which kills a +line at a time. If you use `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 `C-k' at the end of a line, it joins that line and the next line. *Note Killing::, for more flexible ways of killing text. - -File: xemacs.info, Node: Basic Files, Next: Basic Help, Prev: Erasing, Up: Basic - 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 -"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 "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 `/usr/rms/foo.c'. To begin editing this file from Emacs, type: C-x C-f /usr/rms/foo.c -Here the file name is given as an "argument" to the command `C-x C-f' -(`find-file'). That command uses the "minibuffer" to read the -argument, and you type to terminate the argument (*note -Minibuffer::). +The file name is given as an "argument" to the command `C-x C-f' +(`find-file'). The command uses the "minibuffer" to read the argument. +You have to type to terminate the argument (*note Minibuffer::.). You can also use the Open... menu item from the File menu, then type the name of the file to the prompt. - Emacs obeys the command by "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 "save" the -new text in the file by typing `C-x C-s' (`save-buffer') or choosing -Save Buffer from the File menu. This makes the changes permanent by -copying the altered buffer contents back into the file -`/usr/rms/foo.c'. Until you save, the changes exist only inside Emacs, -and the file `foo.c' is unaltered. + Emacs obeys the command by "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 +"save" the file by typing `C-x C-s' (`save-buffer') or choosing Save +Buffer from the File menu. This makes the changes permanent by copying +the altered contents of the buffer back into the file `/usr/rms/foo.c'. +Until then, the changes are only inside your Emacs buffer, and the +file `foo.c' is not changed. To create a file, visit the file with `C-x C-f' as if it already existed or choose Open... from the 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 `C-x C-s', or by choosing Save Buffer from the File menu, the file -is created. +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 `C-x C-s', or by choosing Save Buffer from the +File menu, the file is created. - To learn more about using files, *Note Files::. - - -File: xemacs.info, Node: Basic Help, Next: Blank Lines, Prev: Basic Files, Up: Basic + To learn more about using files, *note Files::.. Help ==== - If you forget what a key does, you can find out with the Help -character, which is `C-h' (or , which is an alias for `C-h'). Type -`C-h k' followed by the key you want to know about; for example, `C-h k -C-n' tells you all about what `C-n' does. `C-h' is a prefix key; `C-h -k' is just one of its subcommands (the command `describe-key'). The -other subcommands of `C-h' provide different kinds of help. Type `C-h' -twice to get a description of all the help facilities. *Note Help::. + If you forget what a key does, you can use the Help character +(`C-h') to find out: Type `C-h k' followed by the key you want to know +about. For example, `C-h k C-n' tells you what `C-n' does. `C-h' is a +prefix key; `C-h k' is just one of its subcommands (the command +`describe-key'). The other subcommands of `C-h' provide different +kinds of help. Type `C-h' three times to get a description of all the +help facilities. *Note Help::. + +* Menu: + +* Blank Lines:: Commands to make or delete blank lines. +* Continuation Lines:: Lines too wide for the frame. +* Position Info:: What page, line, row, or column is point on? +* Arguments:: Numeric arguments for repeating a command.  -File: xemacs.info, Node: Blank Lines, Next: Continuation Lines, Prev: Basic Help, Up: Basic +File: xemacs.info, Node: Blank Lines, Next: Continuation Lines, Prev: Basic, Up: Basic Blank Lines =========== - Here are special commands and techniques for putting in and taking -out blank lines. + Here are special commands and techniques for entering and removing +blank lines. `C-o' Insert one or more blank lines after the cursor (`open-line'). @@ -1189,25 +802,24 @@ out blank lines. (`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 . -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 `C-o' (`open-line'), which inserts a newline after point -but leaves point in front of the newline. After `C-o', type the text -for the new line. `C-o F O O' has the same effect as `F O O ', -except for the final location of point. - - You can make several blank lines by typing `C-o' several times, or -by giving it a numeric argument to tell it how many blank lines to make. -*Note Arguments::, for how. If you have a fill prefix, then `C-o' -command inserts the fill prefix on the new line, when you use it at the -beginning of a line. *Note Fill Prefix::. - - The easy way to get rid of extra blank lines is with the command -`C-x C-o' (`delete-blank-lines'). `C-x C-o' in a run of several blank -lines deletes all but one of them. `C-x C-o' on a solitary blank line -deletes that blank line. When point is on a nonblank line, `C-x C-o' -deletes any blank lines following that nonblank line. +you just type the new line of text, followed by . If you prefer +to create a blank line first and then insert the desired text, use the +key `C-o' (`open-line'), which inserts a newline after point but leaves +point in front of the newline. Then type the text into the new line. +`C-o F O O' has the same effect as `F O O ', except for the final +location of point. + + To create several blank lines, type `C-o' several times, or give +`C-o' an argument indicating how many blank lines to create. *Note +Arguments::, for more information. + + If you have many blank lines in a row and want to get rid of them, +use `C-x C-o' (`delete-blank-lines'). If point is on a blank line +which is adjacent to at least one other blank line, `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, `C-x C-o' deletes any blank lines following that +non-blank line.  File: xemacs.info, Node: Continuation Lines, Next: Position Info, Prev: Blank Lines, Up: Basic @@ -1215,32 +827,374 @@ File: xemacs.info, Node: Continuation Lines, Next: Position Info, Prev: Blank Continuation Lines ================== - If you add too many characters to one line without breaking it with -, 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 "continuation" of a -line too long to fit the screen. Continuation is also called "line -wrapping". - - Sometimes it is nice to have Emacs insert newlines automatically when -a line gets too long. Continuation on the screen does not do that. Use -Auto Fill mode (*note Filling::) if that's what you want. + If you add too many characters to one line without breaking with a +, 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 "continuation" of a line too +long to fit the frame. You can use Auto Fill mode (*note Filling::.) +to have Emacs insert newlines automatically when a line gets too long. Instead of continuation, long lines can be displayed by "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. - - Truncation instead of continuation happens whenever horizontal -scrolling is in use, and optionally in all side-by-side windows (*note -Windows::). You can enable truncation for a particular buffer by -setting the variable `truncate-lines' to non-`nil' in that buffer. -(*Note Variables::.) Altering the value of `truncate-lines' makes it -local to the current buffer; until that time, the default value is in -effect. The default is initially `nil'. *Note Locals::. - - *Note Display Vars::, for additional variables that affect how text -is displayed. +temporarily invisible. Three diagonal dots in the last column (instead +of the curved arrow inform you that truncation is in effect. + + To turn off continuation for a particular buffer, set the variable +`truncate-lines' to non-`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 (*note Windows::.). +Altering the value of `truncate-lines' makes it local to the current +buffer; until that time, the default value is in effect. The default +is initially `nil'. *Note Locals::. + + +File: xemacs.info, Node: Position Info, Next: Arguments, Prev: Continuation Lines, Up: Basic + +Cursor Position Information +=========================== + + If you are accustomed to other display editors, you may be surprised +that Emacs does not always display the page number or line number of +point in the mode line. In Emacs, this information is only rarely +needed, and a number of commands are available to compute and print it. +Since text is stored in a way that makes it difficult to compute the +information, it is not displayed all the time. + +`M-x what-page' + Print page number of point, and line number within page. + +`M-x what-line' + Print line number of point in the buffer. + +`M-=' + Print number of lines and characters in the current region + (`count-lines-region'). + +`C-x =' + Print character code of character after point, character position + of point, and column of point (`what-cursor-position'). + + There are several commands for printing line numbers: + * `M-x what-line' counts lines from the beginning of the file and + prints the line number point is on. The first line of the file is + line number 1. You can use these numbers as arguments to `M-x + goto-line'. + + * `M-x what-page' counts pages from the beginning of the file, and + counts lines within the page, printing both of them. *Note + Pages::, for the command `C-x l', which counts the lines in the + current page. + + * `M-=' (`count-lines-region') prints the number of lines in the + region (*note Mark::.). + + The command `C-x =' (`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: + + Char: x (0170) point=65986 of 563027(12%) column 44 + +(In fact, this is the output produced when point is before `column 44' +in the example.) + + The two values after `Char:' describe the character following point, +first by showing it and second by giving its octal character code. + + `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 as 2, and so on. The next, larger number is the total +number of characters in the buffer. Afterward in parentheses comes the +position expressed as a percentage of the total size. + + `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, `C-x =' prints additional +text describing the current visible range. For example, it might say: + + Char: x (0170) point=65986 of 563025(12%) <65102 - 68533> column 44 + +where the two extra numbers give the smallest and largest character +position that point is allowed to assume. The characters between those +two positions are the visible ones. *Note Narrowing::. + + If point is at the end of the buffer (or the end of the visible +part), `C-x =' omits any description of the character after point. The +output looks like + + point=563026 of 563025(100%) column 0 + + +File: xemacs.info, Node: Arguments, Prev: Position Info, Up: Basic + +Numeric Arguments +================= + + Any Emacs command can be given a "numeric argument". Some commands +interpret the argument as a repetition count. For example, giving an +argument of ten to the key `C-f' (the command `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. + + If your keyboard has a key (labelled with a diamond on +Sun-type keyboards and labelled `Alt' on some other keyboards), the +easiest way to specify a numeric argument is to type digits and/or a +minus sign while holding down the key. For example, + M-5 C-n + +moves down five lines. The characters `Meta-1', `Meta-2', and so on, +as well as `Meta--', do this because they are keys bound to commands +(`digit-argument' and `negative-argument') that are defined to +contribute to an argument for the next command. + + Another way of specifying an argument is to use the `C-u' +(`universal-argument') command followed by the digits of the argument. +With `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 -1. `C-u' works on all terminals. + + `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 +argument for the next command by four. `C-u' twice multiplies it by +sixteen. Thus, `C-u C-u C-f' moves forward sixteen characters. This +is a good way to move forward "fast", since it moves about 1/5 of a line +in the usual size frame. Other useful combinations are `C-u C-n', `C-u +C-u C-n' (move down a good fraction of a frame), `C-u C-u C-o' (make "a +lot" of blank lines), and `C-u C-k' (kill four lines). + + Some commands care only about whether there is an argument and not +about its value. For example, the command `M-q' (`fill-paragraph') with +no argument fills text; with an argument, it justifies the text as well. +(*Note Filling::, for more information on `M-q'.) Just `C-u' is a +handy way of providing an argument for such commands. + + Some commands use the value of the argument as a repeat count, but do +something peculiar when there is no argument. For example, the command +`C-k' (`kill-line') with argument N kills N lines, including their +terminating newlines. But `C-k' with no argument is special: it kills +the text up to the next newline, or, if point is right at the end of +the line, it kills the newline itself. Thus, two `C-k' commands with +no arguments can kill a non-blank line, just like `C-k' with an +argument of one. (*Note Killing::, for more information on `C-k'.) + + A few commands treat a plain `C-u' differently from an ordinary +argument. A few others may treat an argument of just a minus sign +differently from an argument of -1. These unusual cases will be +described when they come up; they are always to make the individual +command more convenient to use. + + +File: xemacs.info, Node: Undo, Next: Minibuffer, Prev: Basic, Up: Top + +Undoing Changes +*************** + + Emacs allows you to undo all changes you make to the text of a +buffer, up to a certain amount of change (8000 characters). Each +buffer records changes individually, and the undo command always +applies to the current buffer. Usually each editing command makes a +separate entry in the undo records, but some commands such as +`query-replace' make many entries, and very simple commands such as +self-inserting characters are often grouped to make undoing less +tedious. + +`C-x u' + Undo one batch of changes (usually, one command's worth) (`undo'). + +`C-_' + The same. + + The command `C-x u' or `C-_' allows you to undo changes. The first +time you give this command, it undoes the last change. Point moves to +the text affected by the undo, so you can see what was undone. + + Consecutive repetitions of the `C-_' or `C-x u' commands undo +earlier and earlier changes, back to the limit of what has been +recorded. If all recorded changes have already been undone, the undo +command prints an error message and does nothing. + + Any command other than an undo command breaks the sequence of undo +commands. Starting at this moment, the previous undo commands are +considered ordinary changes that can themselves be undone. Thus, you +can redo changes you have undone by typing `C-f' or any other command +that have no important effect, and then using more undo commands. + + If you notice that a buffer has been modified accidentally, the +easiest way to recover is to type `C-_' repeatedly until the stars +disappear from the front of the mode line. When that happens, all the +modifications you made have been canceled. If you do not remember +whether you changed the buffer deliberately, type `C-_' once. When you +see Emacs undo the last change you made, you probably remember why you +made it. If the change was an accident, leave it undone. If it was +deliberate, redo the change as described in the preceding paragraph. + + Whenever an undo command makes the stars disappear from the mode +line, the buffer contents is the same as it was when the file was last +read in or saved. + + Not all buffers record undo information. Buffers whose names start +with spaces don't; these buffers are used internally by Emacs and its +extensions to hold text that users don't normally look at or edit. +Minibuffers, help buffers, and documentation buffers also don't record +undo information. + + Emacs can remember at most 8000 or so characters of deleted or +modified text in any one buffer for reinsertion by the undo command. +There is also a limit on the number of individual insert, delete, or +change actions that Emacs can remember. + + There are two keys to run the `undo' command, `C-x u' and `C-_', +because on some keyboards, it is not obvious how to type `C-_'. `C-x u' +is an alternative you can type in the same fashion on any terminal. + + +File: xemacs.info, Node: Minibuffer, Next: M-x, Prev: Undo, Up: Top + +The Minibuffer +************** + + Emacs commands use the "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. + + 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 +"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. + + Sometimes a "default argument" appears in parentheses after the +colon; it, too, is part of the prompt. The default is used as the +argument value if you enter an empty argument (e.g., by just typing +). For example, commands that read buffer names always show a +default, which is the name of the buffer that will be used if you type +just . + + The simplest way to give a minibuffer argument is to type the text +you want, terminated by to exit the minibuffer. To get out of +the minibuffer and cancel the command that it was for, type `C-g'. + + Since the minibuffer uses the screen space of the echo area, it can +conflict with other ways Emacs customarily uses the echo area. Here is +how Emacs handles such conflicts: + + * If a command gets an error while you are in the minibuffer, this + does not cancel the minibuffer. However, the echo area is needed + for the error message and therefore the minibuffer itself is + hidden for a while. It comes back after a few seconds, or as soon + as you type anything. + + * If you use a command in the minibuffer whose purpose is to print a + message in the echo area (for example `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. + + * Echoing of keystrokes does not take place while the minibuffer is + in use. + +* Menu: + +* 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. +* Repetition:: Re-executing commands that used the minibuffer. + + +File: xemacs.info, Node: Minibuffer File, Next: Minibuffer Edit, Prev: Minibuffer, Up: Minibuffer + +Minibuffers for File Names +========================== + + 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 "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: + + Find File: /u2/emacs/src/ + +where `Find File: ' is the prompt. Typing `buffer.c' specifies the file +`/u2/emacs/src/buffer.c'. To find files in nearby directories, use +`..'; thus, if you type `../lisp/simple.el', the file that you visit +will be the one named +`/u2/emacs/lisp/simple.el'. Alternatively, you can use `M-' to +kill directory names you don't want (*note Words::.). + + 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 `/etc/termcap', just type the name, giving: + + Find File: /u2/emacs/src//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, `/u2/emacs/src/' is ignored, and you +get the file `/etc/termcap'. + + If you set `insert-default-directory' to `nil', the default +directory is not inserted in the minibuffer. This way, the minibuffer +starts out empty. But the name you type, if relative, is still +interpreted with respect to the same default directory. + + +File: xemacs.info, Node: Minibuffer Edit, Next: Completion, Prev: Minibuffer File, Up: Minibuffer + +Editing in the Minibuffer +========================= + + 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 in the minibuffer is defined to exit the minibuffer, you +must use `C-o' or `C-q ' to insert a newline into the minibuffer. +(Recall that a newline is really the 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. The minibuffer window is just like the others; you can switch to +another window with `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. *Note +Windows::. + + 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 `C-x ^'. + + 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 +`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. + + If the variable `minibuffer-confirm-incomplete' is `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: + Find File:chocolate_bar.c [no completions, confirm] + If you press `Return' again, that confirms the filename. Otherwise, +you can continue editing it. + + 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. + + If you set the variable `enable-recursive-minibuffers' to be +non-`nil', recursive use of the minibuffer is always allowed. diff --git a/info/xemacs.info-4 b/info/xemacs.info-4 index 53fc1cd..32d87d6 100644 --- a/info/xemacs.info-4 +++ b/info/xemacs.info-4 @@ -1,5 +1,5 @@ -This is ../info/xemacs.info, produced by makeinfo version 4.0 from -xemacs/xemacs.texi. +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. INFO-DIR-SECTION XEmacs Editor START-INFO-DIR-ENTRY @@ -30,420 +30,34 @@ versions, except that the sections entitled "The GNU Manifesto", translation approved by the author instead of in the original English.  -File: xemacs.info, Node: Position Info, Next: Arguments, Prev: Continuation Lines, Up: Basic - -Cursor Position Information -=========================== - - If you are accustomed to other display editors, you may be surprised -that Emacs does not always display the page number or line number of -point in the mode line. In Emacs, this information is only rarely -needed, and a number of commands are available to compute and print it. -Since text is stored in a way that makes it difficult to compute the -information, it is not displayed all the time. - -`M-x what-page' - Print page number of point, and line number within page. - -`M-x what-line' - Print line number of point in the buffer. - -`M-x line-number-mode' - Toggle automatic display of current line number. - -`M-=' - Print number of lines and characters in the current region - (`count-lines-region'). *Note Mark::, for information about the - region. - -`C-x =' - Print character code of character after point, character position - of point, and column of point (`what-cursor-position'). - - There are several commands for printing line numbers: - - * `M-x what-line' counts lines from the beginning of the file and - prints the line number point is on. The first line of the file is - line number 1. You can use these numbers as arguments to `M-x - goto-line'. - - * `M-x what-page' counts pages from the beginning of the file, and - counts lines within the page, printing both of them. *Note - Pages::, for the command `C-x l', which counts the lines in the - current page. - - * `M-=' (`count-lines-region') prints the number of lines in the - region (*note Mark::). *Note Pages::, for the command `C-x l' - which counts the lines in the - - The command `C-x =' (`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: - - Char: c (0143, 99, 0x63) point=18862 of 24800(76%) column 53 - -(In fact, this is the output produced when point is before `column 53' -in the example.) - - The four values after `Char:' describe the character that follows -point, first by showing it and then by giving its character code in -octal, decimal and hex. - - `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 as 2, and so on. The next, larger number is the total -number of characters in the buffer. Afterward in parentheses comes the -position expressed as a percentage of the total size. - - `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, `C-x =' prints additional -text describing the current visible range. For example, it might say: - - Char: c (0143, 99, 0x63) point=19674 of 24575(80%) <19591 - 19703> column 69 - -where the two extra numbers give the smallest and largest character -position that point is allowed to assume. The characters between those -two positions are the visible ones. *Note Narrowing::. - - If point is at the end of the buffer (or the end of the visible -part), `C-x =' omits any description of the character after point. The -output looks like - - point=563026 of 563025(100%) column 0 - - -File: xemacs.info, Node: Arguments, Prev: Position Info, Up: Basic - -Numeric Arguments -================= - - In mathematics and computer usage, the word "argument" means "data -provided to a function or operation." Any Emacs command can be given a -"numeric argument" (also called a "prefix argument"). Some commands -interpret the argument as a repetition count. For example, giving an -argument of ten to the key `C-f' (the command `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. - - If your keyboard has a key (labelled with a diamond on -Sun-type keyboards and labelled `Alt' on some other keyboards), the -easiest way to specify a numeric argument is to type digits and/or a -minus sign while holding down the key. For example, - M-5 C-n - -would move down five lines. The characters `Meta-1', `Meta-2', and so -on, as well as `Meta--', do this because they are keys bound to -commands (`digit-argument' and `negative-argument') that are defined to -contribute to an argument for the next command. Digits and `-' -modified with Control, or Control and Meta, also specify numeric -arguments. - - Another way of specifying an argument is to use the `C-u' -(`universal-argument') command followed by the digits of the argument. -With `C-u', you can type the argument digits without holding down -modifier keys; `C-u' works on all terminals. To type a negative -argument, type a minus sign after `C-u'. Just a minus sign without -digits normally means -1. - - `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 -argument for the next command by four. `C-u' twice multiplies it by -sixteen. Thus, `C-u C-u C-f' moves forward sixteen characters. This -is a good way to move forward "fast", since it moves about 1/5 of a line -in the usual size frame. Other useful combinations are `C-u C-n', `C-u -C-u C-n' (move down a good fraction of a frame), `C-u C-u C-o' (make "a -lot" of blank lines), and `C-u C-k' (kill four lines). - - Some commands care only about whether there is an argument and not -about its value. For example, the command `M-q' (`fill-paragraph') with -no argument fills text; with an argument, it justifies the text as well. -(*Note Filling::, for more information on `M-q'.) Just `C-u' is a -handy way of providing an argument for such commands. - - Some commands use the value of the argument as a repeat count, but do -something peculiar when there is no argument. For example, the command -`C-k' (`kill-line') with argument N kills N lines, including their -terminating newlines. But `C-k' with no argument is special: it kills -the text up to the next newline, or, if point is right at the end of -the line, it kills the newline itself. Thus, two `C-k' commands with -no arguments can kill a non-blank line, just like `C-k' with an -argument of one. (*Note Killing::, for more information on `C-k'.) - - A few commands treat a plain `C-u' differently from an ordinary -argument. A few others may treat an argument of just a minus sign -differently from an argument of -1. These unusual cases are described -when they come up; they are always for reasons of convenience of use of -the individual command. - - You can use a numeric argument to insert multiple copies of a -character. This is straightforward unless the character is a digit; for -example, `C-u 6 4 a' inserts 64 copies of the character `a'. But this -does not work for inserting digits; `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 `C-u'; for example, `C-u 6 4 C-u -1' does insert 64 copies of the character `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. - - -File: xemacs.info, Node: Undo, Next: Minibuffer, Prev: Basic, Up: Top - -Undoing Changes -*************** - - Emacs allows you to undo all changes you make to the text of a -buffer, up to a certain amount of change (8000 characters). Each -buffer records changes individually, and the undo command always -applies to the current buffer. Usually each editing command makes a -separate entry in the undo records, but some commands such as -`query-replace' make many entries, and very simple commands such as -self-inserting characters are often grouped to make undoing less -tedious. - -`C-x u' - Undo one batch of changes (usually, one command's worth) (`undo'). - -`C-_' - The same. - - The command `C-x u' or `C-_' allows you to undo changes. The first -time you give this command, it undoes the last change. Point moves to -the text affected by the undo, so you can see what was undone. - - Consecutive repetitions of the `C-_' or `C-x u' commands undo -earlier and earlier changes, back to the limit of what has been -recorded. If all recorded changes have already been undone, the undo -command prints an error message and does nothing. - - Any command other than an undo command breaks the sequence of undo -commands. Starting at this moment, the previous undo commands are -considered ordinary changes that can themselves be undone. Thus, you -can redo changes you have undone by typing `C-f' or any other command -that have no important effect, and then using more undo commands. - - If you notice that a buffer has been modified accidentally, the -easiest way to recover is to type `C-_' repeatedly until the stars -disappear from the front of the mode line. When that happens, all the -modifications you made have been canceled. If you do not remember -whether you changed the buffer deliberately, type `C-_' once. When you -see Emacs undo the last change you made, you probably remember why you -made it. If the change was an accident, leave it undone. If it was -deliberate, redo the change as described in the preceding paragraph. - - Whenever an undo command makes the stars disappear from the mode -line, the buffer contents is the same as it was when the file was last -read in or saved. - - Not all buffers record undo information. Buffers whose names start -with spaces don't; these buffers are used internally by Emacs and its -extensions to hold text that users don't normally look at or edit. -Minibuffers, help buffers, and documentation buffers also don't record -undo information. - - Emacs can remember at most 8000 or so characters of deleted or -modified text in any one buffer for reinsertion by the undo command. -There is also a limit on the number of individual insert, delete, or -change actions that Emacs can remember. - - There are two keys to run the `undo' command, `C-x u' and `C-_', -because on some keyboards, it is not obvious how to type `C-_'. `C-x u' -is an alternative you can type in the same fashion on any terminal. - - -File: xemacs.info, Node: Minibuffer, Next: M-x, Prev: Undo, Up: Top - -The Minibuffer -************** - - The "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. - - 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 -"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. - - Sometimes a "default argument" appears in parentheses after the -colon; it, too, is part of the prompt. The default is used as the -argument value if you enter an empty argument (e.g., by just typing -). For example, commands that read buffer names always show a -default, which is the name of the buffer that will be used if you type -just . - - The simplest way to enter a minibuffer argument is to type the text -you want, terminated by which exits the minibuffer. You can -cancel the command that wants the argument, and get out of the -minibuffer, by typing `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: - - * If a command gets an error while you are in the minibuffer, this - does not cancel the minibuffer. However, the echo area is needed - for the error message and therefore the minibuffer itself is - hidden for a while. It comes back after a few seconds, or as soon - as you type anything. - - * If in the minibuffer you use a command whose purpose is to print a - message in the echo area, such as `C-x =', the message is printed - normally, and the minibuffer is hidden for a while. It comes back - after a few seconds, or as soon as you type anything. - - * Echoing of keystrokes does not take place while the minibuffer is - in use. - -* Menu: - -* 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. - - -File: xemacs.info, Node: Minibuffer File, Next: Minibuffer Edit, Prev: Minibuffer, Up: Minibuffer - -Minibuffers for File Names -========================== - - 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 "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: - - Find File: /u2/emacs/src/ - -where `Find File: ' is the prompt. Typing `buffer.c' specifies the -file `/u2/emacs/src/buffer.c'. To find files in nearby directories, -use `..'; thus, if you type `../lisp/simple.el', you will get the file -named `/u2/emacs/lisp/simple.el'. Alternatively, you can kill with -`M-' the directory names you don't want (*note Words::). - - If you don't want any of the default, you can kill it with `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 -`/etc/termcap', just insert that name, giving these minibuffer contents: - - Find File: /u2/emacs/src//etc/termcap - -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, `/u2/emacs/src/' is ignored in the -example above, and you get the file `/etc/termcap'. - - If you set `insert-default-directory' to `nil', the default -directory is not inserted in the minibuffer. This way, the minibuffer -starts out empty. But the name you type, if relative, is still -interpreted with respect to the same default directory. - - -File: xemacs.info, Node: Minibuffer Edit, Next: Completion, Prev: Minibuffer File, Up: Minibuffer - -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. - - Since 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 -`C-o' or `C-q C-j'. (Recall that a newline is really the character -control-J.) - - 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 `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. *Note 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 -`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 `M-x resize-minibuffer-mode' to enable or disable -this minor mode (*note Minor Modes::). - - If while in the minibuffer you issue a command that displays help -text of any sort in another window, you can use the `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. *Note Other -Window::. - - If the variable `minibuffer-confirm-incomplete' is `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: - Find File: chocolate_bar.c [no completions, confirm] - If you press `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. - - If you set the variable `enable-recursive-minibuffers' to a -non-`nil', recursive use of the minibuffer is always allowed. - - -File: xemacs.info, Node: Completion, Next: Minibuffer History, Prev: Minibuffer Edit, Up: Minibuffer +File: xemacs.info, Node: Completion, Next: Repetition, Prev: Minibuffer Edit, Up: Minibuffer Completion ========== - For certain kinds of arguments, you can use "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 "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--, , and ---are rebound to complete the text present in the minibuffer into -a longer string that it stands for, by matching it against a set of -"completion alternatives" provided by the command reading the argument. -`?' is defined to display a list of possible completions of what you -have inserted. - - For example, when `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 `M-x inse b ' instead of `M-x insert-buffer ' -(for example). +--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 "completion alternatives" provided by the command +reading the argument. `?' is defined to display a list of possible +completions of what you have inserted. + + For example, when the minibuffer is being used by `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, `fo' does not complete to `Foo'. When you are -completing a name in which case does not matter, case may be ignored +in most of the names that you can complete (buffer names, file names, +and command names). Thus, `fo' will not complete to `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 @@ -451,53 +65,40 @@ 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 . -* Menu: +A Completion Example +-------------------- -* Example: Completion Example. -* Commands: Completion Commands. -* Strict Completion:: -* Options: Completion Options. - - -File: xemacs.info, Node: Completion Example, Next: Completion Commands, Prev: Completion, Up: Completion - -Completion Example ------------------- - - A concrete example may help here. If you type `M-x au ', the + Consider the following example. If you type `Meta-x au ', looks for alternatives (in this case, command names) that start -with `au'. There are several, including `auto-fill-mode' and -`auto-save-mode'--but they are all the same as far as `auto', so the -`au' in the minibuffer changes to `auto'. - - If you type again immediately, there are multiple -possibilities for the very next character--it could be any of `c-'--so -no more characters are added; instead, displays a list of all -possible completions in another window. - - If you go on to type `-f ', this sees `auto-f'. The only -command name starting this way is `auto-fill-mode', so completion fills -in the rest of that. You now have `auto-fill-mode' in the minibuffer -after typing just `au f '. Note that has this effect -because in the minibuffer it is bound to the command -`minibuffer-complete' when completion is available. - - -File: xemacs.info, Node: Completion Commands, Next: Strict Completion, Prev: Completion Example, Up: Completion +with `au'. There are only two commands: `auto-fill-mode' and +`auto-save-mode'. They are the same as far as `auto-', so the `au' in +the minibuffer changes to `auto-'. + + If you type again immediately, there are multiple possibilities +for the very next character--it could be `s' or `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 `f ', this sees `auto-f'. The only +command name starting this way is `auto-fill-mode', so completion +inserts the rest of that command. You now have `auto-fill-mode' in the +minibuffer after typing just `au f '. Note that has +this effect because in the minibuffer it is bound to the function +`minibuffer-complete' when completion is supposed to be done. Completion Commands ------------------- - Here is a list of the completion commands defined in the minibuffer -when completion is available. + Here is a list of all the completion commands defined in the +minibuffer when completion is available. `' Complete the text in the minibuffer as much as possible (`minibuffer-complete'). `' - Complete the minibuffer text, but don't go beyond one word - (`minibuffer-complete-word'). + Complete the text in the minibuffer but don't add or fill out more + than one word (`minibuffer-complete-word'). `' Submit the text in the minibuffer as the argument, possibly @@ -516,56 +117,13 @@ when completion is available. Clicking will select the highlighted completion and exit the minibuffer. (`minibuf-select-highlighted-completion'). - completes much like , but never goes beyond the next -hyphen or space. If you have `auto-f' in the minibuffer and type -, it finds that the completion is `auto-fill-mode', but it stops -completing after `fill-'. This gives `auto-fill-'. Another at -this point completes all the way to `auto-fill-mode'. in the -minibuffer when completion is available runs the command -`minibuffer-complete-word'. - - Here are some commands you can use to choose a completion from a -window that displays a list of completions: - -`button2up' - Clicking mouse button 2 on a completion in the list of possible - completions chooses that completion (`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. - -`' -`M-v' - Typing or `M-v', while in the minibuffer, selects the - window showing the completion list buffer - (`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.) - -`' - Typing _in the completion list buffer_ chooses the - completion that point is in or next to (`choose-completion'). To - use this command, you must first switch windows to the window that - shows the list of completions. - -`' -`' -`C-f' - Typing the right-arrow key , or `C-f' _in the - completion list buffer_ moves point to the following completion - (`next-list-mode-item'). - -`' -`C-b' - Typing the left-arrow key or `C-b' _in the completion list - buffer_ moves point toward the beginning of the buffer, to the - previous completion (`previous-list-mode-item'). - - -File: xemacs.info, Node: Strict Completion, Next: Completion Options, Prev: Completion Commands, Up: Completion - -Strict Completion ------------------ + completes in a way that is similar to , but it never goes +beyond the next hyphen or space. If you have `auto-f' in the +minibuffer and type , it finds that the completion is +`auto-fill-mode', but it stops completing after `fill-'. The result is +`auto-fill-'. Another at this point completes all the way to +`auto-fill-mode'. in the minibuffer runs the function +`minibuffer-complete-word' when completion is available. There are three different ways that can work in completing minibuffers, depending on how the argument will be used. @@ -586,35 +144,27 @@ minibuffers, depending on how the argument will be used. Cautious completion is used for reading file names for files that must already exist. - * "Permissive" completion is used when any string whatever is - meaningful, and the list of completion alternatives is just a - guide. For example, when `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 permissive completion, takes the text in the - minibuffer exactly as given, without completing it. + * "Permissive" completion is used when any string is meaningful, and + the list of completion alternatives is just a guide. For example, + when `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 permissive + completion, takes the text in the minibuffer exactly as + given, without completing it. - 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 `?' explicitly requests such a list. If the -list of completions is long, you can scroll it with `C-M-v' (*note -Other Window::). - - -File: xemacs.info, Node: Completion Options, Prev: Strict Completion, Up: Completion - -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 `?' explicitly requests such a list. The list +of completions counts as help text, so `C-M-v' typed in the minibuffer +scrolls the list. When completion is done on file names, certain file names are usually ignored. The variable `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 `".o"', `".elc"', `".dvi"' and `"~"'. The -effect is that, for example, `foo' can complete to `foo.c' even though -`foo.o' exists as well. However, if _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. +effect is that, for example, `foo' completes to `foo.c' even though +`foo.o' exists as well. If the only possible completions are files +that end in "ignored" strings, they are not ignored. If a completion command finds the next character is undetermined, it automatically displays a list of all possible completions. If the @@ -626,136 +176,62 @@ in contexts where `completing-read' allows answers that are not valid completions, an extra must be typed to confirm the response. This is helpful for catching typos. - 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 `M-x icomplete-mode'. - - -File: xemacs.info, Node: Minibuffer History, Next: Repetition, Prev: Completion, Up: Minibuffer - -Minibuffer History -================== - - Every argument that you enter with the minibuffer is saved on a -"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. - -`' -`M-p' - Move to the next earlier argument string saved in the minibuffer - history (`previous-history-element'). - -`' -`M-n' - Move to the next later argument string saved in the minibuffer - history (`next-history-element'). - -`M-r REGEXP ' - Move to an earlier saved argument in the minibuffer history that - has a match for REGEXP (`previous-matching-history-element'). - -`M-s REGEXP ' - Move to a later saved argument in the minibuffer history that has a - match for REGEXP (`next-matching-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 `M-p' or up-arrow (`previous-history-element') to "move -to" the next earlier minibuffer input, and use `M-n' or down-arrow -(`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 . 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 `M-n' -to move "into the future" in the 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. `M-r' -(`previous-matching-history-element') searches older elements in the -history, while `M-s' (`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 (*note 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 `M-x', one for buffer names, one for arguments -of commands like `query-replace', and one for compilation commands read -by `compile'. Finally, there is one "miscellaneous" history list that -most minibuffer arguments use. -  -File: xemacs.info, Node: Repetition, Prev: Minibuffer History, Up: Minibuffer +File: xemacs.info, Node: Repetition, Prev: Completion, Up: Minibuffer Repeating Minibuffer 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 `M-x' -is recorded there, since `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 `Meta-x' is recorded, since `M-x' uses the minibuffer to +read the command name. -`C-x ' - Re-execute a recent minibuffer command (`repeat-complex-command'). +`C-x ' + Re-execute a recent minibuffer command + (`repeat-complex-command'). `M-p' - Within `C-x ', move to previous recorded command + Within `C-x ', move to previous recorded command (`previous-history-element'). `M-n' - Within `C-x ', move to the next (more recent) recorded + Within `C-x ', move to the next (more recent) recorded command (`next-history-element'). `M-x list-command-history' Display the entire command history, showing all the commands `C-x - ' can repeat, most recent first. + ' can repeat, most recent first. - `C-x ' 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. + `C-x ' 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. - `C-x ' works by turning the previous command into a Lisp + `C-x ' 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 , 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. +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, you can be sure the command will repeat exactly as before. - If you are in the minibuffer for `C-x ' and the command -shown to you is not the one you want to repeat, you can move around the -list of previous commands using `M-n' and `M-p'. `M-p' replaces the + If you are in the minibuffer for `C-x ' and the command shown +to you is not the one you want to repeat, you can move around the list +of previous commands using `M-n' and `M-p'. `M-p' replaces the contents of the minibuffer with the next earlier recorded command, and `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 . Any editing you have done on the command to be repeated is lost if you use `M-n' or `M-p'. - `M-n' and `M-p' are specially defined within `C-x ' to -run the commands `previous-history-element' and `next-history-element'. + `M-n' and `M-p' are specially defined within `C-x ' to run the +commands `previous-history-element' and `next-history-element'. The list of previous commands using the minibuffer is stored as a Lisp list in the variable `command-history'. Each element of the list @@ -925,75 +401,49 @@ File: xemacs.info, Node: Help, Next: Mark, Prev: M-x, Up: Top Help **** - XEmacs provides extensive help features accessible through a single + Emacs provides extensive help features which revolve around a single character, `C-h'. `C-h' is a prefix key that is used only for -documentation-printing commands. The characters that you can type after -`C-h' are called "help options". One help option is `C-h'; that is how -you ask for help about using `C-h'. To cancel, type `C-g'. The -function key is equivalent to `C-h'. +documentation-printing commands. The characters you can type after +`C-h' are called "help options". One help option is `C-h'; you use it +to ask for help about using `C-h'. - `C-h C-h' (`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: + `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: - 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: You should type one of those characters. Typing a third `C-h' displays a description of what the options mean; Emacs still waits for you to type an option. To cancel, type `C-g'. - Most help buffers use a special major mode, Help mode, which lets you -scroll conveniently with and or . - -* 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. - - -File: xemacs.info, Node: Help Summary, Next: Key Help, Prev: Help, Up: Help - -Help Summary -============ - Here is a summary of the defined help commands. -`C-h a REGEXP ' - Display a list of functions and variables whose names match REGEXP - (`hyper-apropos'). - -`C-h A REGEXP' - Show all commands whose names contain matches for REGEXP - (`command-apropos'). +`C-h a STRING ' + Display a list of commands whose names contain STRING (`command- + apropos'). `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 (`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 (`describe-bindings'). `C-h c KEY' - Print the name of the command that KEY runs - (`describe-key-briefly'). Here `c' stands for `character'. For - more extensive information on KEY, use `C-h k'. + Print the name of the command that KEY runs (`describe-key- + briefly'). `c' is for `character'. For more extensive + information on KEY, use `C-h k'. -`C-h d FUNCTION ' `C-h f FUNCTION ' Display documentation on the Lisp function named FUNCTION - (`describe-function'). Since commands are Lisp functions, a - command name may be used. + (`describe-function'). Note that commands are Lisp functions, so + a command name may be used. `C-h i' Run Info, the program for browsing documentation files (`info'). - The complete XEmacs manual is available online in Info. + The complete Emacs manual is available online in Info. `C-h k KEY' - Display the name and documentation of the command that KEY runs + Display name and documentation of the command KEY runs (`describe-key'). `C-h l' @@ -1004,65 +454,41 @@ Help Summary Display documentation of the current major mode (`describe-mode'). `C-h n' -`C-h C-n' - Display documentation of XEmacs changes, most recent first + Display documentation of Emacs changes, most recent first (`view-emacs-news'). `C-h p' - Find packages by topic keyword (`finder-by-keyword'). - -`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 (`describe-pointer'). `C-h s' Display current contents of the syntax table, plus an explanation - of what they mean (`describe-syntax'). *Note Syntax::. + of what they mean (`describe-syntax'). `C-h t' - Enter the XEmacs interactive tutorial (`help-with-tutorial'). + Display the Emacs tutorial (`help-with-tutorial'). `C-h v VAR ' - Display the documentation of the Lisp variable VAR - (`describe-variable'). + Display the documentation of the Lisp variable VAR (`describe- + variable'). `C-h w COMMAND ' Print which keys run the command named COMMAND (`where-is'). -`C-h B ' - Display info on how to deal with Beta versions of XEmacs - (`describe-beta'). - -`C-h C GROUP ' - Select customization buffer for GROUP (`customize'). - -`C-h F ' - View the local copy of the XEmacs FAQ (`xemacs-local-faq'). - -`C-h C-i FILE ' - Read Info file FILE with Info browser (`Info-query'). - -`C-h C-c COMMAND ' - Look up an Emacs command COMMAND in the Emacs manual in the Info - system (`Info-goto-emacs-command-node'). - -`C-h C-f FUNCTION ' - Look up an Emacs Lisp function FUNCTION in the Elisp manual in the - Info system (`Info-elisp-ref'). - - -File: xemacs.info, Node: Key Help, Next: Name Help, Prev: Help Summary, Up: Help +`M-x apropos REGEXP' + Show all symbols whose names contain matches for REGEXP. Documentation for a Key ======================= The most basic `C-h' options are `C-h c' (`describe-key-briefly') -and `C-h k' (`describe-key'). `C-h c KEY' prints in the echo area the -name of the command that KEY is bound to. For example, `C-h c C-f' -prints `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 KEY does. +and `C-h k' +(`describe-key'). `C-h c KEY' prints the name of the command that KEY +is bound to in the echo area. For example, `C-h c C-f' prints +`forward-char'. Since command names are chosen to describe what the +command does, using this option is a good way to get a somewhat cryptic +description of what KEY does. `C-h k KEY' is similar to `C-h c' but gives more information. It displays the documentation string of the function KEY is bound to as @@ -1070,12 +496,6 @@ well as its name. KEY is a string or vector of events. When called interactively, KEY may also be a menu selection. This information does not usually fit into the echo area, so a window is used for the display. - `C-h c' and `C-h k' work for any sort of key sequences, including -function keys and mouse events. - - -File: xemacs.info, Node: Name Help, Next: Apropos, Prev: Key Help, Up: Help - Help by Command or Variable Name ================================ @@ -1093,31 +513,30 @@ key, that is, a command you would normally call using `M-x'. If the variable `describe-function-show-arglist' is `t', `describe-function' shows its arglist if the FUNCTION is not an autoload function. - `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 `(make-vector len)' and want to make sure you are using -`make-vector' properly, type `C-h f make-vector '. Because `C-h -f' allows all function names, not just command names, you may find that -some of your favorite abbreviations that work in `M-x' don't work in -`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 `C-h f' to describe has a default which is -used if you type leaving the minibuffer empty. The default is -the function called by the innermost Lisp expression in the buffer -around point, _provided_ that is a valid, defined Lisp function name. -For example, if point is located following the text `(make-vector (car -x)', the innermost list containing point is the one that starts with -`(make-vector', so the default is to describe the function -`make-vector'. + `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 +`(make-vector len)' and want to make sure you are using `make-vector' +properly, type `C-h f make-vector '. Because `C-h f' allows all +function names, not just command names, you may find that some of your +favorite abbreviations that work in `M-x' don't work in `C-h f'. An +abbreviation may be unique among command names, yet fail to be unique +when other function names are allowed. + + If you type , leaving the minibuffer empty, `C-h f' by default +describes the function called by the innermost Lisp expression in the +buffer around point, provided that that is a valid, defined Lisp +function name. For example, if point is located following the text +`(make-vector (car x)', the innermost list containing point is the one +starting with `(make-vector', so the default is to describe the +function `make-vector'. `C-h f' is often useful just to verify that you have the right -spelling for the function name. If `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 `C-g' to cancel the `C-h f' -command, then go on editing. +spelling for the function name. If `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 `C-g' to cancel the `C-h f' command +and continue editing. - `C-h w COMMAND ' (`where-is') tells you what keys are bound to + `C-h w COMMAND ' (`where-s') tells you what keys are bound to 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 `M-x' to call the command. @@ -1127,69 +546,675 @@ 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. *Note Variables::. - -File: xemacs.info, Node: Apropos, Next: Library Keywords, Prev: Name Help, Up: Help - Apropos ======= -`C-h A' +`C-h a' Show only symbols that are names of commands (`command-apropos'). `M-x apropos REGEXP' - Show all symbols whose names contain matches for REGEXP. - - A more sophisticated sort of question to ask is, "What are the -commands for working with files?" To ask this question, type `C-h a -file ', which displays a list of all command names that contain -`file', including `copy-file', `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 `find-file' by typing `C-x C-f'. The `A' in `C-h -A' stands for `Apropos'; `C-h A' runs the command `command-apropos'. -This command normally checks only commands (interactive functions); if -you specify a prefix argument, it checks noninteractive functions as -well. - - Because `C-h A' looks only for functions whose names contain the + Show all symbols whose names comtain matches for REGEXP. + + It is possible to ask a question like, "What are the commands for +working with files?" To do this, type `C-h a file ', which +displays a list of all command names that contain `file', such as +`copy-file', `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 `find-file' by typing `C-x C-f'. The `a' in `C-h a' stands +for `Apropos'; `C-h a' runs the Lisp function `command-apropos'. + + Because `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 `C-h a -kill-backwards ' doesn't reveal any, don't give up. Try just -`kill', or just `backwards', or just `back'. Be persistent. Pretend -you are playing Adventure. Also note that you can use a regular -expression as the argument, for more flexibility (*note Regexps::). +kill-backwards ' doesn't reveal any commands, don't give up. Try +just `kill', or just `backwards', or just `back'. Be persistent. +Pretend you are playing Adventure. Also note that you can use a +regular expression as the argument (*note Regexps::.). Here is a set of arguments to give to `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 `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 `apropos' strings. 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. + defun, buffer, frame, window, file, dir, register, mode, + beginning, end, forward, backward, next, previous, up, down, + search, goto, kill, delete, mark, insert, yank, fill, indent, case, + change, set, what, list, find, view, describe. To list all Lisp symbols that contain a match for a regexp, not just the ones that are defined as commands, use the command `M-x apropos' -instead of `C-h A'. This command does not check key bindings by -default; specify a numeric argument if you want it to check them. +instead of `C-h a'. + +Other Help Commands +=================== + + `C-h i' (`info') runs the Info program, which is used for 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 `h' after entering Info to run a +tutorial on using Info. + + If something surprising happens, and you are not sure what commands +you typed, use `C-h l' (`view-lossage'). `C-h l' prints the last 100 +command characters you typed. If you see commands you don't know, use +`C-h c' to find out what they do. + + Emacs has several major modes. Each mode redefines a few keys and +makes a few other changes in how editing works. `C-h m' +(`describe-mode') prints documentation on the current major mode, which +normally describes all the commands that are changed in this mode. + + `C-h b' (`describe-bindings') and `C-h s' (`describe-syntax') +present information about the current Emacs mode that is not covered by +`C-h m'. `C-h b' displays a list of all key bindings currently in +effect, with the local bindings of the current major mode first, +followed by the global bindings (*note Key Bindings::.). `C-h s' +displays the contents of the syntax table with explanations of each +character's syntax (*note Syntax::.). + + The other `C-h' options display various files of useful information. +`C-h C-w' (`describe-no-warranty') displays details on the complete +absence of warranty for XEmacs. `C-h n' (`view-emacs-news') displays +the file `emacs/etc/NEWS', which contains documentation on Emacs +changes arranged chronologically. `C-h t' (`help-with-tutorial') +displays the learn-by-doing Emacs tutorial. `C-h C-c' +(`describe-copying') displays the file `emacs/etc/COPYING', which tells +you the conditions you must obey in distributing copies of Emacs. `C-h +C-d' (`describe-distribution') displays another file named +`emacs/etc/DISTRIB', which tells you how you can order a copy of the +latest version of Emacs. + + +File: xemacs.info, Node: Mark, Next: Mouse Selection, Prev: Help, Up: Top + +Selecting Text +************** - The `apropos-documentation' command is like `apropos' except that it -searches documentation strings for matches for the specified regular -expression. + Many Emacs commands operate on an arbitrary contiguous part of the +current buffer. You can select text in two ways: - The `apropos-value' command is like `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. + * You use special keys to select text by defining a region between + point and the mark. - If the variable `apropos-do-all' is non-`nil', the commands above -all behave as if they had been given a prefix argument. + * If you are running XEmacs under X, you can also select text with + the mouse. - If you want more information about a function definition, variable or -symbol property listed in the Apropos buffer, you can click on it with -`Mouse-2' or move there and type . +The Mark and the Region +======================= + + To specify the text for a command to operate on, set "the mark" at +one end of it, and move point to the other end. The text between point +and the mark is called "the region". You can move point or the mark to +adjust the boundaries of the region. It doesn't matter which one is +set first chronologically, or which one comes earlier in the text. + + Once the mark has been set, it remains until it is set again at +another place. The mark remains fixed with respect to the preceding +character if text is inserted or deleted in a buffer. Each Emacs +buffer has its own mark; when you return to a buffer that had been +selected previously, it has the same mark it had before. + + Many commands that insert text, such as `C-y' (`yank') and `M-x +insert-buffer', position the mark at one end of the inserted text--the +opposite end from where point is positioned, so that the region +contains the text just inserted. + + Aside from delimiting the region, the mark is useful for marking a +spot that you may want to go back to. To make this feature more useful, +Emacs remembers 16 previous locations of the mark in the `mark ring'. + +* Menu: + +* Setting Mark:: Commands to set the mark. +* Using Region:: Summary of ways to operate on contents of the region. +* Marking Objects:: Commands to put region around textual units. +* Mark Ring:: Previous mark positions saved so you can go back there. + + +File: xemacs.info, Node: Setting Mark, Next: Using Region, Prev: Mark, Up: Mark + +Setting the Mark +---------------- + + Here are some commands for setting the mark: + +`C-' + Set the mark where point is (`set-mark-command'). + +`C-@' + The same. + +`C-x C-x' + Interchange mark and point (`exchange-point-and-mark'). + +`C-<' + Pushes a mark at the beginning of the buffer. + +`C->' + Pushes a mark at the end of the buffer. + + For example, to convert part of the buffer to all upper-case, you +can use the `C-x C-u' (`upcase-region') command, which operates on the +text in the region. First go to the beginning of the text you want to +capitalize and type `C-' to put the mark there, then move to the +end, and then type `C-x C-u' to capitalize the selected region. You +can also set the mark at the end of the text, move to the beginning, +and then type `C-x C-u'. Most commands that operate on the text in the +region have the word `region' in their names. + + The most common way to set the mark is with the `C-' command +(`set-mark-command'). This command sets the mark where point is. You +can then move point away, leaving the mark behind. It is actually +incorrect to speak of the character `C-'; there is no such +character. When you type while holding down , you get the +character `C-@' on most terminals. This character is actually bound to +`set-mark-command'. But unless you are unlucky enough to have a +terminal where typing `C-' does not produce `C-@', you should +think of this character as `C-'. + + Since terminals have only one cursor, Emacs cannot show you where the +mark is located. Most people use the mark soon after they set it, before +they forget where it is. But you can see where the mark is with the +command `C-x C-x' (`exchange-point-and-mark') which puts the mark where +point was and point where the mark was. The extent of the region is +unchanged, but the cursor and point are now at the previous location of +the mark. + + Another way to set the mark is to push the mark to the beginning of a +buffer while leaving point at its original location. If you supply an +argument to `C-<' (`mark-beginning-of-buffer'), the mark is pushed N/10 +of the way from the true beginning of the buffer. You can also set the +mark at the end of a buffer with `C->' (`mark-end-of-buffer'). It +pushes the mark to the end of the buffer, leaving point alone. +Supplying an argument to the command pushes the mark N/10 of the way +from the true end of the buffer. + + If you are using XEmacs under the X window system, you can set the +variable `zmacs-regions' to `t'. This makes the current region (defined +by point and mark) highlight and makes it available as the X clipboard +selection, which means you can use the menu bar items on it. *Note +Active Regions::, for more information. + + `C-x C-x' is also useful when you are satisfied with the location of +point but want to move the mark; do `C-x C-x' to put point there and +then you can move it. A second use of `C-x C-x', if necessary, puts +the mark at the new location with point back at its original location. + + +File: xemacs.info, Node: Using Region, Next: Marking Objects, Prev: Setting Mark, Up: Mark + +Operating on the Region +----------------------- + + Once you have created an active region, you can do many things to +the text in it: + * Kill it with `C-w' (*note Killing::.). + + * Save it in a register with `C-x r s' (*note Registers::.). + + * Save it in a buffer or a file (*note Accumulating Text::.). + + * Convert case with `C-x C-l' or `C-x C-u' + (*note Case::.). + + * Evaluate it as Lisp code with `M-x eval-region' (*note Lisp + Eval::.). + + * Fill it as text with `M-q' (*note Filling::.). + + * Print hardcopy with `M-x print-region' (*note Hardcopy::.). + + * Indent it with `C-x ' or `C-M-\' (*note Indentation::.). + + +File: xemacs.info, Node: Marking Objects, Next: Mark Ring, Prev: Using Region, Up: Mark + +Commands to Mark Textual Objects +-------------------------------- + + There are commands for placing point and the mark around a textual +object such as a word, list, paragraph or page. + +`M-@' + Set mark after end of next word (`mark-word'). This command and + the following one do not move point. + +`C-M-@' + Set mark after end of next Lisp expression (`mark-sexp'). + +`M-h' + Put region around current paragraph (`mark-paragraph'). + +`C-M-h' + Put region around current Lisp defun (`mark-defun'). + +`C-x h' + Put region around entire buffer (`mark-whole-buffer'). + +`C-x C-p' + Put region around current page (`mark-page'). + + `M-@' (`mark-word') puts the mark at the end of the next word, while +`C-M-@' (`mark-sexp') puts it at the end of the next Lisp expression. +These characters sometimes save you some typing. + + A number of commands are available that set both point and mark and +thus delimit an object in the buffer. `M-h' (`mark-paragraph') moves +point to the beginning of the paragraph that surrounds or follows +point, and puts the mark at the end of that paragraph (*note +Paragraphs::.). You can then indent, case-convert, or kill the whole +paragraph. In the same fashion, `C-M-h' (`mark-defun') puts point +before and the mark after the current or following defun (*note +Defuns::.). `C-x C-p' (`mark-page') puts point before the current page +(or the next or previous, depending on the argument), and mark at the +end (*note Pages::.). The mark goes after the terminating page +delimiter (to include it), while point goes after the preceding page +delimiter (to exclude it). Finally, `C-x h' (`mark-whole-buffer') sets +up the entire buffer as the region by putting point at the beginning +and the mark at the end. + + +File: xemacs.info, Node: Mark Ring, Prev: Marking Objects, Up: Mark + +The Mark Ring +------------- + + Aside from delimiting the region, the mark is also useful for marking +a spot that you may want to go back to. To make this feature more +useful, Emacs remembers 16 previous locations of the mark in the "mark +ring". Most commands that set the mark push the old mark onto this +ring. To return to a marked location, use `C-u C-' (or `C-u +C-@'); this is the command `set-mark-command' given a numeric argument. +The command moves point to where the mark was, and restores the mark +from the ring of former marks. Repeated use of this command moves point +to all the old marks on the ring, one by one. The marks you have seen +go to the end of the ring, so no marks are lost. + + Each buffer has its own mark ring. All editing commands use the +current buffer's mark ring. In particular, `C-u C-' always stays +in the same buffer. + + Many commands that can move long distances, such as `M-<' +(`beginning-of-buffer'), start by setting the mark and saving the old +mark on the mark ring. This makes it easier for you to move back +later. Searches set the mark, unless they do not actually move point. +When a command sets the mark, `Mark Set' is printed in the echo area. + + The variable `mark-ring-max' is the maximum number of entries to +keep in the mark ring. If that many entries exist and another entry is +added, the last entry in the list is discarded. Repeating `C-u +C-' circulates through the entries that are currently in the ring. + + The variable `mark-ring' holds the mark ring itself, as a list of +marker objects in the order most recent first. This variable is local +in every buffer. + + +File: xemacs.info, Node: Mouse Selection, Next: Additional Mouse Operations, Prev: Mark, Up: Top + +Selecting Text with the Mouse +============================= + + If you are using XEmacs under X, you can use the mouse pointer to +select text. (The normal mouse pointer is an I-beam, the same pointer +that `xterm' uses.) + + The glyph variable `text-pointer-glyph' controls the shape of the +mouse pointer when over text. You can also control the shape of the +mouse pointer when over nontext using `nontext-pointer-glyph', and the +shape of the mouse pointer when over the modeline using +`modeline-pointer-glyph'. (Remember, you should use `set-glyph-image', +not `setq', to set one of these variables.) + + If you want to get fancy, you can set the foreground and background +colors of the mouse pointer by setting the `pointer' face. + + There are two ways to select a region of text with the mouse: + + To select a word in text, double-click with the left mouse button +while the mouse cursor is over the word. The word is highlighted when +selected. On monochrome monitors, a stippled background indicates that a +region of text has been highlighted. On color monitors, a color +background indicates highlighted text. You can triple-click to select +whole lines. + + To select an arbitrary region of text: + + 1. Move the mouse cursor over the character at the beginning of the + region of text you want to select. + + 2. Press and hold the left mouse button. + + 3. While holding the left mouse button down, drag the cursor to the + character at the end of the region of text you want to select. + + 4. Release the left mouse button. + The selected region of text is highlighted. + + Once a region of text is selected, it becomes the primary X selection +(*note Using X Selections::.) as well as the Emacs selected region. You +can paste it into other X applications and use the options from the +Edit pull-down menu on it. Since it is also the Emacs region, you can +use Emacs region commands on it. + + +File: xemacs.info, Node: Additional Mouse Operations, Next: Killing, Prev: Mouse Selection, Up: Top + +Additional Mouse Operations +=========================== + + XEmacs also provides the following mouse functions. Most of these +are not bound to mouse gestures by default, but they are provided for +your customization pleasure. For example, if you wanted `shift-left' +(that is, holding down the key and clicking the left mouse +button) to delete the character at which you are pointing, then you +could do this: + + (global-set-key '(shift button1) 'mouse-del-char) + +`mouse-del-char' + Delete the character pointed to by the mouse. + +`mouse-delete-window' + Delete the Emacs window that the mouse is on. + +`mouse-keep-one-window' + Select the Emacs window that the mouse is on, then delete all other + windows on this frame. + +`mouse-kill-line' + Kill the line pointed to by the mouse. + +`mouse-line-length' + Print the length of the line indicated by the pointer. + +`mouse-scroll' + Scroll point to the mouse position. + +`mouse-select' + Select the Emacs window the mouse is on. + +`mouse-select-and-split' + Select the Emacs window mouse is on, then split it vertically in + half. + +`mouse-set-mark' + Select the Emacs window the mouse is on and set the mark at the + mouse position. Display the cursor at that position for a second. + +`mouse-set-point' + Select the Emacs window that the mouse is on and move point to the + mouse position. + +`mouse-track' + Make a selection with the mouse. This is the default binding of + the left mouse button (). + +`mouse-track-adjust' + Extend the existing selection. This is the default binding of + . + +`mouse-track-and-copy-to-cutbuffer' + Make a selection like `mouse-track', but also copy it to the cut + buffer. + +`mouse-track-delete-and-insert' + Make a selection with the mouse and insert it at point. This is + the default binding of . + +`mouse-track-insert' + Make a selection with the mouse and insert it at point. This is + the default binding of . + +`mouse-window-to-region' + Narrow a window to the region between the cursor and the mouse + pointer. + + The `M-x mouse-track' command should be bound to a mouse button. If +you click-and-drag, the selection is set to the region between the +point of the initial click and the point at which you release the +button. These positions do not need to be ordered. + + If you click-and-release without moving the mouse, the point is +moved, and the selection is disowned (there will be no selection +owner.) The mark will be set to the previous position of point. + + If you double-click, the selection will extend by symbols instead of +by characters. If you triple-click, the selection will extend by lines. + + If you drag the mouse off the top or bottom of the window, you can +select pieces of text that are larger than the visible part of the +buffer; the buffer will scroll as necessary. + + The selected text becomes the current X selection, and is also +copied to the top of the kill ring. Point will be left at the position +at which you released the button and the mark will be left at the +initial click position. Bind a mouse click to +`mouse-track-and-copy-to-cutbuffer' to copy selections to the cut +buffer. (See also the `mouse-track-adjust' command, on +`Shift-button1'.) + + The `M-x mouse-track-adjust' command should be bound to a mouse +button. The selection will be enlarged or shrunk so that the point of +the mouse click is one of its endpoints. This is only meaningful after +the `mouse-track' command () has been executed. + + The `M-x mouse-track-delete-and-insert' command is exactly the same +as the `mouse-track' command on , except that point is not +moved; the selected text is immediately inserted after being selected; +and the text of the selection is deleted. + + The `M-x mouse-track-insert' command is exactly the same as the +`mouse-track' command on , except that point is not moved; the +selected text is immediately inserted after being selected; and the +selection is immediately disowned afterwards. + + +File: xemacs.info, Node: Killing, Next: Yanking, Prev: Additional Mouse Operations, Up: Top + +Deletion and Killing +==================== + + Most commands that erase text from the buffer save it. You can get +the text back if you change your mind, or you can move or copy it to +other parts of the buffer. Commands which erase text and save it in the +kill ring are known as "kill" commands. Some other commands erase text +but do not save it; they are known as "delete" commands. (This +distinction is made only for erasing text in the buffer.) + + The commands' names and individual descriptions use the words `kill' +and `delete' to indicate what they do. If you perform a kill or delete +command by mistake, use the `C-x u' (`undo') command to undo it (*note +Undo::.). The delete commands include `C-d' (`delete-char') and +(`delete-backward-char'), which delete only one character at a time, +and those commands that delete only spaces or newlines. Commands that +can destroy significant amounts of nontrivial data usually kill. + +Deletion +-------- + +`C-d' + Delete next character (`delete-char'). + +`' + Delete previous character (`delete-backward-char'). + +`M-\' + Delete spaces and tabs around point (`delete-horizontal-space'). + +`M-' + Delete spaces and tabs around point, leaving one space + (`just-one-space'). + +`C-x C-o' + Delete blank lines around the current line (`delete-blank-lines'). + +`M-^' + Join two lines by deleting the intervening newline, and any + indentation following it (`delete-indentation'). + + The most basic delete commands are `C-d' (`delete-char') and +(`delete-backward-char'). `C-d' deletes the character after point, the +one the cursor is "on top of". Point doesn't move. deletes the +character before the cursor, and moves point back. You can delete +newlines like any other characters in the buffer; deleting a newline +joins two lines. Actually, `C-d' and aren't always delete +commands; if you give them an argument, they kill instead, since they +can erase more than one character this way. + + The other delete commands delete only formatting characters: spaces, +tabs and newlines. `M-\' (`delete-horizontal-space') deletes all +spaces and tab characters before and after point. `M-' +(`just-one-space') does the same but leaves a single space after point, +regardless of the number of spaces that existed previously (even zero). + + `C-x C-o' (`delete-blank-lines') deletes all blank lines after the +current line. If the current line is blank, it deletes all blank lines +preceding the current line as well as leaving one blank line, the +current line. `M-^' (`delete-indentation') joins the current line and +the previous line, or, if given an argument, joins the current line and +the next line by deleting a newline and all surrounding spaces, possibly +leaving a single space. *Note M-^: Indentation. + +Killing by Lines +---------------- + +`C-k' + Kill rest of line or one or more lines (`kill-line'). + + The simplest kill command is `C-k'. If given at the beginning of a +line, it kills all the text on the line, leaving the line blank. If +given on a blank line, the blank line disappears. As a consequence, a +line disappears completely if you go to the front of a non-blank line +and type `C-k' twice. + + More generally, `C-k' kills from point up to the end of the line, +unless it is at the end of a line. In that case, it kills the newline +following the line, thus merging the next line into the current one. +Emacs ignores invisible spaces and tabs at the end of the line when +deciding which case applies: if point appears to be at the end of the +line, you can be sure the newline will be killed. + + If you give `C-k' a positive argument, it kills that many lines and +the newlines that follow them (however, text on the current line before +point is not killed). With a negative argument, `C-k' kills back to a +number of line beginnings. An argument of -2 means kill back to the +second line beginning. If point is at the beginning of a line, that +line beginning doesn't count, so `C-u - 2 C-k' with point at the front +of a line kills the two previous lines. + + `C-k' with an argument of zero kills all the text before point on the +current line. + +Other Kill Commands +------------------- + +`C-w' + Kill region (from point to the mark) (`kill-region'). *Note + Words::. + +`M-d' + Kill word (`kill-word'). + +`M-' + Kill word backwards (`backward-kill-word'). + +`C-x ' + Kill back to beginning of sentence (`backward-kill-sentence'). + *Note Sentences::. + +`M-k' + Kill to end of sentence (`kill-sentence'). + +`C-M-k' + Kill sexp (`kill-sexp'). *Note Lists::. + +`M-z CHAR' + Kill up to next occurrence of CHAR (`zap-to-char'). + + `C-w' (`kill-region') is a very general kill command; it kills +everything between point and the mark. You can use this command to kill +any contiguous sequence of characters by first setting the mark at one +end of a sequence of characters, then going to the other end and typing +`C-w'. + + A convenient way of killing is combined with searching: `M-z' +(`zap-to-char') reads a character and kills from point up to (but not +including) the next occurrence of that character in the buffer. If +there is no next occurrence, killing goes to the end of the buffer. A +numeric argument acts as a repeat count. A negative argument means to +search backward and kill text before point. + + Other syntactic units can be killed: words, with `M-' and `M-d' +(*note Words::.); sexps, with `C-M-k' (*note Lists::.); and sentences, +with `C-x ' and `M-k' (*note Sentences::.). + + +File: xemacs.info, Node: Yanking, Next: Using X Selections, Prev: Killing, Up: Top + +Yanking +======= + + "Yanking" means getting back text which was killed. Some systems +call this "pasting". The usual way to move or copy text is to kill it +and then yank it one or more times. + +`C-y' + Yank last killed text (`yank'). + +`M-y' + Replace re-inserted killed text with the previously killed text + (`yank-pop'). + +`M-w' + Save region as last killed text without actually killing it + (`copy-region-as-kill'). + +`C-M-w' + Append next kill to last batch of killed text (`append-next-kill'). + +* Menu: + +* Kill Ring:: Where killed text is stored. Basic yanking. +* Appending Kills:: Several kills in a row all yank together. +* Earlier Kills:: Yanking something killed some time ago. + + +File: xemacs.info, Node: Kill Ring, Next: Appending Kills, Prev: Yanking, Up: Yanking + +The Kill Ring +------------- + + All killed text is recorded in the "kill ring", a list of blocks of +text that have been killed. There is only one kill ring, used in all +buffers, so you can kill text in one buffer and yank it in another +buffer. This is the usual way to move text from one file to another. +(*Note Accumulating Text::, for some other ways.) + + If you have two separate Emacs processes, you cannot use the kill +ring to move text. If you are using XEmacs under X, however, you can +use the X selection mechanism to move text from one to another. + + If you are using XEmacs under X and have one Emacs process with +multiple frames, they do share the same kill ring. You can kill or +copy text in one Emacs frame, then yank it in the other frame belonging +to the same process. + + The command `C-y' (`yank') reinserts the text of the most recent +kill. It leaves the cursor at the end of the text and sets the mark at +the beginning of the text. *Note Mark::. + + `C-u C-y' yanks the text, leaves the cursor in front of the text, +and sets the mark after it, if the argument is with just a `C-u'. Any +other argument, including `C-u' and digits, has different results, +described below, under "Yanking Earlier Kills". + + To copy a block of text, you can also use `M-w' +(`copy-region-as-kill'), which copies the region into the kill ring +without removing it from the buffer. `M-w' is similar to `C-w' followed +by `C-y' but does not mark the buffer as "modified" and does not +actually cut anything. diff --git a/info/xemacs.info-5 b/info/xemacs.info-5 new file mode 100644 index 0000000..a1374e0 --- /dev/null +++ b/info/xemacs.info-5 @@ -0,0 +1,1172 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Appending Kills, Next: Earlier Kills, Prev: Kill Ring, Up: Yanking + +Appending Kills +--------------- + + Normally, each kill command pushes a new block onto the kill ring. +However, two or more kill commands in a row combine their text into a +single entry, so that a single `C-y' yanks it all back. This means you +don't have to kill all the text you want to yank in one command; you +can kill line after line, or word after word, until you have killed what +you want, then get it all back at once using `C-y'. (Thus we join +television in leading people to kill thoughtlessly.) + + Commands that kill forward from point add onto the end of the +previous killed text. Commands that kill backward from point add onto +the beginning. This way, any sequence of mixed forward and backward +kill commands puts all the killed text into one entry without +rearrangement. Numeric arguments do not break the sequence of +appending kills. For example, suppose the buffer contains: + + This is the first + line of sample text + and here is the third. + +with point at the beginning of the second line. If you type `C-k C-u 2 +M- C-k', the first `C-k' kills the text `line of sample text', +`C-u 2 M-' kills `the first' with the newline that followed it, +and the second `C-k' kills the newline after the second line. The +result is that the buffer contains `This is and here is the third.' and +a single kill entry contains `the firstline of sample +text'--all the killed text, in its original order. + + If a kill command is separated from the last kill command by other +commands (not just numeric arguments), it starts a new entry on the kill +ring. To force a kill command to append, first type the command `C-M-w' +(`append-next-kill'). `C-M-w' tells the following command, if it is a +kill command, to append the text it kills to the last killed text, +instead of starting a new entry. With `C-M-w', you can kill several +separated pieces of text and accumulate them to be yanked back in one +place. + + +File: xemacs.info, Node: Earlier Kills, Prev: Appending Kills, Up: Yanking + +Yanking Earlier Kills +--------------------- + + To recover killed text that is no longer the most recent kill, you +need the `Meta-y' (`yank-pop') command. You can use `M-y' only after a +`C-y' or another `M-y'. It takes the text previously yanked and +replaces it with the text from an earlier kill. To recover the text of +the next-to-the-last kill, first use `C-y' to recover the last kill, +then `M-y' to replace it with the previous kill. + + You can think in terms of a "last yank" pointer which points at an +item in the kill ring. Each time you kill, the "last yank" pointer +moves to the new item at the front of the ring. `C-y' yanks the item +which the "last yank" pointer points to. `M-y' moves the "last yank" +pointer to a different item, and the text in the buffer changes to +match. Enough `M-y' commands can move the pointer to any item in the +ring, so you can get any item into the buffer. Eventually the pointer +reaches the end of the ring; the next `M-y' moves it to the first item +again. + + Yanking moves the "last yank" pointer around the ring, but does not +change the order of the entries in the ring, which always runs from the +most recent kill at the front to the oldest one still remembered. + + Use `M-y' with a numeric argument to advance the "last yank" pointer +by the specified number of items. A negative argument moves the +pointer toward the front of the ring; from the front of the ring, it +moves to the last entry and starts moving forward from there. + + Once the text you are looking for is brought into the buffer, you can +stop doing `M-y' commands and the text will stay there. Since the text +is just a copy of the kill ring item, editing it in the buffer does not +change what's in the ring. As long you don't kill additional text, the +"last yank" pointer remains at the same place in the kill ring: +repeating `C-y' will yank another copy of the same old kill. + + If you know how many `M-y' commands it would take to find the text +you want, you can yank that text in one step using `C-y' with a numeric +argument. `C-y' with an argument greater than one restores the text +the specified number of entries back in the kill ring. Thus, `C-u 2 +C-y' gets the next to the last block of killed text. It is equivalent +to `C-y M-y'. `C-y' with a numeric argument starts counting from the +"last yank" pointer, and sets the "last yank" pointer to the entry that +it yanks. + + The variable `kill-ring-max' controls the length of the kill ring; +no more than that many blocks of killed text are saved. + + +File: xemacs.info, Node: Using X Selections, Next: Accumulating Text, Prev: Yanking, Up: Top + +Using X Selections +================== + + In the X window system, mouse selections provide a simple mechanism +for text transfer between different applications. In a typical X +application, you can select text by pressing the left mouse button and +dragging the cursor over the text you want to copy. The text becomes +the primary X selection and is highlighted. The highlighted region is +also the Emacs selected region. + + * Since the region is the primary X selection, you can go to a + different X application and click the middle mouse button: the + text that you selected in the previous application is pasted into + the current application. + + * Since the region is the Emacs selected region, you can use all + region commands (`C-w, M-w' etc.) as well as the options of the + Edit menu to manipulate the selected text. + +* Menu: + +* X Clipboard Selection:: Pasting to the X clipboard. +* X Selection Commands:: Other operations on the selection. +* X Cut Buffers:: X cut buffers are available for compatibility. +* Active Regions:: Using zmacs-style highlighting of the + selected region. + + +File: xemacs.info, Node: X Clipboard Selection, Next: X Selection Commands, Prev: Using X Selections, Up: Using X Selections + +The Clipboard Selection +----------------------- + + There are other kinds of X selections besides the Primary selection; +one common one is the Clipboard selection. Some applications prefer to +transfer data using this selection in preference to the Primary. One +can transfer text from the Primary selection to the Clipboard +selection with the Copy command under the Edit menu in the menubar. + + Usually, the clipboard selection is not visible. However, if you +run the `xclipboard' application, the text most recently copied to the +clipboard (with the Copy command) is displayed in a window. Any time +new text is thus copied, the `xclipboard' application makes a copy of +it and displays it in its window. The value of the clipboard can +survive the lifetime of the running Emacs process. The `xclipboard' +man page provides more details. + + Warning: If you use the `xclipboard' application, remember that it +maintains a list of all things that have been pasted to the clipboard +(that is, copied with the Copy command). If you don't manually delete +elements from this list by clicking on the Delete button in the +`xclipboard' window, the clipboard will eventually consume a lot of +memory. + + In summary, some X applications (such as `xterm') allow one to paste +text in them from XEmacs in the following way: + + * Drag out a region of text in Emacs with the left mouse button, + making that text be the Primary selection. + + * Click the middle button in the other application, pasting the + Primary selection. + + With some other applications (notably, the OpenWindows and Motif +tools) you must use this method instead: + + * Drag out a region of text in Emacs with the left mouse button, + making that text be the Primary selection. + + * Copy the selected text to the Clipboard selection by selecting the + Copy menu item from the Edit menu, or by hitting the Copy key on + your keyboard. + + * Paste the text in the other application by selecting Paste from its + menu, or by hitting the Paste key on your keyboard. + + +File: xemacs.info, Node: X Selection Commands, Next: X Cut Buffers, Prev: X Clipboard Selection, Up: Using X Selections + +Miscellaneous X Selection Commands +---------------------------------- + +`M-x x-copy-primary-selection' + Copy the primary selection to both the kill ring and the Clipboard. + +`M-x x-insert-selection' + Insert the current selection into the buffer at point. + +`M-x x-delete-primary-selection' + Deletes the text in the primary selection without copying it to + the kill ring or the Clipboard. + +`M-x x-kill-primary-selection' + Deletes the text in the primary selection and copies it to both + the kill ring and the Clipboard. + +`M-x x-mouse-kill' + Kill the text between point and the mouse and copy it to the + clipboard and to the cut buffer. + +`M-x x-own-secondary-selection' + Make a secondary X selection of the given argument. + +`M-x x-own-selection' + Make a primary X selection of the given argument. + +`M-x x-set-point-and-insert-selection' + Set point where clicked and insert the primary selection or the + cut buffer. + + +File: xemacs.info, Node: X Cut Buffers, Next: Active Regions, Prev: X Selection Commands, Up: Using X Selections + +X Cut Buffers +------------- + + X cut buffers are a different, older way of transferring text between +applications. XEmacs supports cut buffers for compatibility with older +programs, even though selections are now the preferred way of +transferring text. + + X has a concept of applications "owning" selections. When you select +text by clicking and dragging inside an application, the application +tells the X server that it owns the selection. When another +application asks the X server for the value of the selection, the X +server requests the information from the owner. When you use +selections, the selection data is not actually transferred unless +someone wants it; the act of making a selection doesn't transfer data. +Cut buffers are different: when you "own" a cut buffer, the data is +actually transferred to the X server immediately, and survives the +lifetime of the application. + + Any time a region of text becomes the primary selection in Emacs, +Emacs also copies that text to the cut buffer. This makes it possible +to copy text from an XEmacs buffer and paste it into an older, +non-selection-based application (such as Emacs 18). + + Note: Older versions of Emacs could not access the X selections, only +the X cut buffers. + + +File: xemacs.info, Node: Active Regions, Prev: X Cut Buffers, Up: Using X Selections + +Active Regions +-------------- + + By default, both the text you select in an Emacs buffer using the +click-and-drag mechanism and text you select by setting point and the +mark is highlighted. You can use Emacs region commands as well as the +Cut and Copy commands on the highlighted region you selected with the +mouse. + + If you prefer, you can make a distinction between text selected with +the mouse and text selected with point and the mark by setting the +variable `zmacs-regions' to `nil'. In that case: + + * The text selected with the mouse becomes both the X selection and + the Emacs selected region. You can use menu-bar commands as well + as Emacs region commands on it. + + * The text selected with point and the mark is not highlighted. You + can only use Emacs region commands on it, not the menu-bar items. + + Active regions originally come from Zmacs, the Lisp Machine editor. +The idea behind them is that commands can only operate on a region when +the region is in an "active" state. Put simply, you can only operate on +a region that is highlighted. + + The variable `zmacs-regions' checks whether LISPM-style active +regions should be used. This means that commands that operate on the +region (the area between point and the mark) only work while the region +is in the active state, which is indicated by highlighting. Most +commands causes the region to not be in the active state; for example, +`C-w' only works immediately after activating the region. + + More specifically: + * Commands that operate on the region only work if the region is + active. + + * Only a very small set of commands causes the region to become + active-- those commands whose semantics are to mark an area, such + as `mark-defun'. + + * The region is deactivated after each command that is executed, + except that motion commands do not change whether the region is + active or not. + + `set-mark-command' (`C-SPC') pushes a mark and activates the region. +Moving the cursor with normal motion commands (`C-n', `C-p', etc.) +will cause the region between point and the recently-pushed mark to be +highlighted. It will remain highlighted until some non-motion command +is executed. + + `exchange-point-and-mark' (`C-x C-x') activates the region. So if +you mark a region and execute a command that operates on it, you can +reactivate the same region with `C-x C-x' (or perhaps `C-x C-x C-x +C-x') to operate on it again. + + Generally, commands that push marks as a means of navigation, such as +`beginning-of-buffer' (`M-<') and `end-of-buffer' (`M->'), do not +activate the region. However, commands that push marks as a means of +marking an area of text, such as `mark-defun' (`M-C-h'), `mark-word' +(`M-@'), and `mark-whole-buffer' (`C-x h'), do activate the region. + + When `zmacs-regions' is `t', there is no distinction between the +primary X selection and the active region selected by point and the +mark. To see this, set the mark () and move the cursor with any +cursor-motion command: the region between point and mark is +highlighted, and you can watch it grow and shrink as you move the +cursor. + + Any other commands besides cursor-motion commands (such as inserting +or deleting text) will cause the region to no longer be active; it will +no longer be highlighted, and will no longer be the primary selection. +Region can be explicitly deactivated with `C-g'. + + Commands that require a region (such as `C-w') signal an error if +the region is not active. Certain commands cause the region to be in +its active state. The most common ones are `push-mark' () and +`exchange-point-and-mark' (`C-x C-x'). + + When `zmacs-regions' is `t', programs can be non-intrusive on the +state of the region by setting the variable `zmacs-region-stays' to a +non-`nil' value. If you are writing a new Emacs command that is +conceptually a "motion" command and should not interfere with the +current highlightedness of the region, then you may set this variable. +It is reset to `nil' after each user command is executed. + + When `zmacs-regions' is `t', programs can make the region between +point and mark go into the active (highlighted) state by using the +function `zmacs-activate-region'. Only a small number of commands +should ever do this. + + When `zmacs-regions' is `t', programs can deactivate the region +between point and the mark by using `zmacs-deactivate-region'. Note: +you should not have to call this function; the command loop calls it +when appropriate. + + +File: xemacs.info, Node: Accumulating Text, Next: Rectangles, Prev: Using X Selections, Up: Top + +Accumulating Text +================= + + Usually you copy or move text by killing it and yanking it, but +there are other ways that are useful for copying one block of text in +many places, or for copying many scattered blocks of text into one +place. + + If you like, you can accumulate blocks of text from scattered +locations either into a buffer or into a file. The relevant commands +are described here. You can also use Emacs registers for storing and +accumulating text. *Note Registers::. + +`M-x append-to-buffer' + Append region to contents of specified buffer (`append-to-buffer'). + +`M-x prepend-to-buffer' + Prepend region to contents of specified buffer. + +`M-x copy-to-buffer' + Copy region into specified buffer, deleting that buffer's old + contents. + +`M-x insert-buffer' + Insert contents of specified buffer into current buffer at point. + +`M-x append-to-file' + Append region to the end of the contents of specified file. + + To accumulate text into a buffer, use the command `M-x +append-to-buffer', which inserts a copy of the region into the buffer +BUFFERNAME, at the location of point in that buffer. If there is no +buffer with the given name, one is created. + + If you append text to a buffer that has been used for editing, the +copied text goes to the place where point is. Point in that buffer is +left at the end of the copied text, so successive uses of +`append-to-buffer' accumulate the text in the specified buffer in the +same order as they were copied. Strictly speaking, this command does +not always append to the text already in the buffer; but if this command +is the only command used to alter a buffer, it does always append to the +existing text because point is always at the end. + + `M-x prepend-to-buffer' is similar to `append-to-buffer', but point +in the other buffer is left before the copied text, so successive +prependings add text in reverse order. `M-x copy-to-buffer' is +similar, except that any existing text in the other buffer is deleted, +so the buffer is left containing just the text newly copied into it. + + You can retrieve the accumulated text from that buffer with `M-x +insert-buffer', which takes BUFFERNAME as an argument. It inserts a +copy of the text in buffer BUFFERNAME into the selected buffer. You +could alternatively select the other buffer for editing, perhaps moving +text from it by killing or with `append-to-buffer'. *Note Buffers::, +for background information on buffers. + + Instead of accumulating text within Emacs in a buffer, you can append +text directly into a file with `M-x append-to-file', which takes +FILE-NAME as an argument. It adds the text of the region to the end of +the specified file. The file is changed immediately on disk. This +command is normally used with files that are not being visited in +Emacs. Using it on a file that Emacs is visiting can produce confusing +results, because the file's text inside Emacs does not change while the +file itself changes. + + +File: xemacs.info, Node: Rectangles, Next: Registers, Prev: Accumulating Text, Up: Top + +Rectangles +========== + + The rectangle commands affect rectangular areas of text: all +characters between a certain pair of columns, in a certain range of +lines. Commands are provided to kill rectangles, yank killed +rectangles, clear them out, or delete them. Rectangle commands are +useful with text in multicolumnar formats, like code with comments at +the right, or for changing text into or out of such formats. + + To specify the rectangle a command should work on, put the mark at +one corner and point at the opposite corner. The specified rectangle is +called the "region-rectangle" because it is controlled about the same +way the region is controlled. Remember that a given combination of +point and mark values can be interpreted either as specifying a region +or as specifying a rectangle; it is up to the command that uses them to +choose the interpretation. + +`M-x delete-rectangle' + Delete the text of the region-rectangle, moving any following text + on each line leftward to the left edge of the region-rectangle. + +`M-x kill-rectangle' + Similar, but also save the contents of the region-rectangle as the + "last killed rectangle". + +`M-x yank-rectangle' + Yank the last killed rectangle with its upper left corner at point. + +`M-x open-rectangle' + Insert blank space to fill the space of the region-rectangle. The + previous contents of the region-rectangle are pushed rightward. + +`M-x clear-rectangle' + Clear the region-rectangle by replacing its contents with spaces. + + The rectangle operations fall into two classes: commands deleting and +moving rectangles, and commands for blank rectangles. + + There are two ways to get rid of the text in a rectangle: you can +discard the text (delete it) or save it as the "last killed" rectangle. +The commands for these two ways are `M-x delete-rectangle' and `M-x +kill-rectangle'. In either case, the portion of each line that falls +inside the rectangle's boundaries is deleted, causing following text +(if any) on the line to move left. + + Note that "killing" a rectangle is not killing in the usual sense; +the rectangle is not stored in the kill ring, but in a special place +that only records the most recently killed rectangle (that is, does not +append to a killed rectangle). Different yank commands have to be used +and only one rectangle is stored, because yanking a rectangle is quite +different from yanking linear text and yank-popping commands are +difficult to make sense of. + + Inserting a rectangle is the opposite of deleting one. You specify +where to put the upper left corner by putting point there. The +rectangle's first line is inserted at point, the rectangle's second line +is inserted at a point one line vertically down, and so on. The number +of lines affected is determined by the height of the saved rectangle. + + To insert the last killed rectangle, type `M-x yank-rectangle'. +This can be used to convert single-column lists into double-column +lists; kill the second half of the list as a rectangle and then yank it +beside the first line of the list. + + There are two commands for working with blank rectangles: `M-x +clear-rectangle' erases existing text, and `M-x open-rectangle' inserts +a blank rectangle. Clearing a rectangle is equivalent to deleting it +and then inserting a blank rectangle of the same size. + + Rectangles can also be copied into and out of registers. *Note +Rectangle Registers: RegRect. + + +File: xemacs.info, Node: Registers, Next: Display, Prev: Rectangles, Up: Top + +Registers +********* + + Emacs "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 (*note Rectangles::.). + + 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. + +`M-x view-register R' + Display a description of what register R contains. + + `M-x view-register' reads a register name as an argument and then +displays the contents of the specified register. + + +File: xemacs.info, Node: RegPos, Next: RegText, Prev: Registers, Up: Registers + +Saving Positions in Registers +============================= + + 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. + +`C-x r SPC R' + Save the location of point in register R (`point-to-register'). + +`C-x r j R' + Jump to the location saved in register R (`register-to-point'). + + To save the current location of point in a register, choose a name R +and type `C-x r SPC R'. The register R retains the location thus saved +until you store something else in that register. + + The command `C-x r j R' moves point to the location recorded in +register 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. + + +File: xemacs.info, Node: RegText, Next: RegRect, Prev: RegPos, Up: Registers + +Saving Text in Registers +======================== + + When you want to insert a copy of the same piece of text many times, +it can be impractical to use the kill ring, since each subsequent kill +moves 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 `C-y'. +An alternative is to store the text in a register with `C-x r s' +(`copy-to-register') and then retrieve it with `C-x r g' +(`insert-register'). + +`C-x r s R' + Copy region into register R (`copy-to-register'). + +`C-x r g R' + Insert text contents of register R (`insert-register'). + + `C-x r s R' stores a copy of the text of the region into the +register named R. Given a numeric argument, `C-x r s' deletes the text +from the buffer as well. + + `C-x r g R' inserts the text from register 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. + + +File: xemacs.info, Node: RegRect, Prev: RegText, Up: Registers + +Saving Rectangles in Registers +============================== + + A register can contain a rectangle instead of lines of text. The +rectangle is represented as a list of strings. *Note Rectangles::, for +basic information on rectangles and how to specify rectangles in a +buffer. + +`C-x r r R' + Copy the region-rectangle into register + R(`copy-rectangle-to-register'). With a numeric argument, delete + it as well. + +`C-x r g R' + Insert the rectangle stored in register R (if it contains a + rectangle) (`insert-register'). + + The `C-x r g' command inserts linear text if the register contains +that, or inserts a rectangle if the register contains one. + + +File: xemacs.info, Node: Display, Next: Search, Prev: Registers, Up: Top + +Controlling the Display +*********************** + + Since only part of a large buffer fits in the window, XEmacs tries +to show the part that is likely to be interesting. The display control +commands allow you to specify which part of the text you want to see. + +`C-l' + Clear frame and redisplay, scrolling the selected window to center + point vertically within it (`recenter'). + +`C-v' +`pgdn' +`next' + Scroll forward (a windowful or a specified number of lines) + (`scroll-up'). On most X keyboards, you can get this + functionality using the key labelled `Page Down', which generates + either `next' or `pgdn'. + +`M-v' +`pgup' +`prior' + Scroll backward (`scroll-down'). On most X keyboards, you can get + this functionality using the key labelled `Page Up', which + generates either `prior' or `pgup'. + +`ARG C-l' + Scroll so point is on line ARG (`recenter'). + +`C-x <' +`C-pgdn' +`C-next' + Scroll text in current window to the left (`scroll-left'). + +`C-x >' +`C-pgup' +`C-prior' + Scroll to the right (`scroll-right'). + +`C-x $' + Make deeply indented lines invisible (`set-selective-display'). + +* Menu: + +* Scrolling:: Moving text up and down in a window. +* Horizontal Scrolling:: Moving text left and right in a window. +* Selective Display:: Hiding lines with lots of indentation. +* Display Vars:: Information on variables for customizing display. + + +File: xemacs.info, Node: Scrolling, Next: Horizontal Scrolling, Prev: Display, Up: Display + +Scrolling +========= + + If a buffer contains text that is too large to fit entirely within +the window that is displaying the buffer, XEmacs shows a contiguous +section of the text. The section shown always contains point. + + "Scrolling" means moving text up or down in the window so that +different parts of the text are visible. Scrolling forward means that +text moves up, and new text appears at the bottom. Scrolling backward +moves text down and new text appears at the top. + + Scrolling happens automatically if you move point past the bottom or +top of the window. You can also explicitly request scrolling with the +commands in this section. + +`C-l' + Clear frame and redisplay, scrolling the selected window to center + point vertically within it (`recenter'). + +`C-v' +`pgdn' +`next' + Scroll forward (a windowful or a specified number of lines) + (`scroll-up'). + +`M-v' +`pgup' +`prior' + Scroll backward (`scroll-down'). + +`ARG C-l' + Scroll so point is on line ARG (`recenter'). + + The most basic scrolling command is `C-l' (`recenter') with no +argument. It clears the entire frame and redisplays all windows. In +addition, it scrolls the selected window so that point is halfway down +from the top of the window. + + The scrolling commands `C-v' and `M-v' let you move all the text in +the window up or down a few lines. `C-v' (`scroll-up') with an +argument shows you that many more lines at the bottom of the window, +moving the text and point up together as `C-l' might. `C-v' with a +negative argument shows you more lines at the top of the window. +`Meta-v' (`scroll-down') is like `C-v', but moves in the opposite +direction. + + To read the buffer a windowful at a time, use `C-v' with no +argument. `C-v' takes the last two lines at the bottom of the window +and puts them at the top, followed by nearly a whole windowful of lines +not previously visible. Point moves to the new top of the window if it +was in the text scrolled off the top. `M-v' with no argument moves +backward with similar overlap. The number of lines of overlap across a +`C-v' or `M-v' is controlled by the variable +`next-screen-context-lines'; by default, it is two. + + Another way to scroll is using `C-l' with a numeric argument. `C-l' +does not clear the frame when given an argument; it only scrolls the +selected window. With a positive argument N, `C-l' repositions text to +put point N lines down from the top. An argument of zero puts point on +the very top line. Point does not move with respect to the text; +rather, the text and point move rigidly on the frame. `C-l' with a +negative argument puts point that many lines from the bottom of the +window. For example, `C-u - 1 C-l' puts point on the bottom line, and +`C-u - 5 C-l' puts it five lines from the bottom. Just `C-u' as +argument, as in `C-u C-l', scrolls point to the center of the frame. + + Scrolling happens automatically if point has moved out of the visible +portion of the text when it is time to display. Usually scrolling is +done to put point vertically centered within the window. However, if +the variable `scroll-step' has a non-zero value, an attempt is made to +scroll the buffer by that many lines; if that is enough to bring point +back into visibility, that is what happens. + + Scrolling happens automatically if point has moved out of the visible +portion of the text when it is time to display. Usually scrolling is +done to put point vertically centered within the window. However, if +the variable `scroll-step' has a non-zero value, an attempt is made to +scroll the buffer by that many lines; if that is enough to bring point +back into visibility, that is what happens. + + If you set `scroll-step' to a small value because you want to use +arrow keys to scroll the screen without recentering, the redisplay +preemption will likely make XEmacs keep recentering the screen when +scrolling fast, regardless of `scroll-step'. To prevent this, set +`scroll-conservatively' to a small value, which will have the result of +overriding the redisplay preemption. + + +File: xemacs.info, Node: Horizontal Scrolling, Prev: Scrolling, Up: Display + +Horizontal Scrolling +==================== + +`C-x <' + Scroll text in current window to the left (`scroll-left'). + +`C-x >' + Scroll to the right (`scroll-right'). + + The text in a window can also be scrolled horizontally. This means +that each line of text is shifted sideways in the window, and one or +more characters at the beginning of each line are not displayed at all. +When a window has been scrolled horizontally in this way, text lines +are truncated rather than continued (*note Continuation Lines::.), with +a `$' appearing in the first column when there is text truncated to the +left, and in the last column when there is text truncated to the right. + + The command `C-x <' (`scroll-left') scrolls the selected window to +the left by N columns with argument N. With no argument, it scrolls by +almost the full width of the window (two columns less, to be precise). +`C-x >' (`scroll-right') scrolls similarly to the right. The window +cannot be scrolled any farther to the right once it is displaying +normally (with each line starting at the window's left margin); +attempting to do so has no effect. + + +File: xemacs.info, Node: Selective Display, Next: Display Vars, Prev: Display, Up: Display + +Selective Display +================= + + XEmacs can hide lines indented more than a certain number of columns +(you specify how many columns). This allows you to get an overview of +a part of a program. + + To hide lines, type `C-x $' (`set-selective-display') with a numeric +argument N. (*Note Arguments::, for information on giving the +argument.) Lines with at least N columns of indentation disappear from +the screen. The only indication of their presence are three dots +(`...'), which appear at the end of each visible line that is followed +by one or more invisible ones. + + The invisible lines are still present in the buffer, and most editing +commands see them as usual, so it is very easy to put point in the +middle of invisible text. When this happens, the cursor appears at the +end of the previous line, after the three dots. If point is at the end +of the visible line, before the newline that ends it, the cursor +appears before the three dots. + + The commands `C-n' and `C-p' move across the invisible lines as if +they were not there. + + To make everything visible again, type `C-x $' with no argument. + + +File: xemacs.info, Node: Display Vars, Prev: Selective Display, Up: Display + +Variables Controlling Display +============================= + + This section contains information for customization only. Beginning +users should skip it. + + When you reenter XEmacs after suspending, XEmacs normally clears the +screen and redraws the entire display. On some terminals with more than +one page of memory, it is possible to arrange the termcap entry so that +the `ti' and `te' strings (output to the terminal when XEmacs is +entered and exited, respectively) switch between pages of memory so as +to use one page for XEmacs and another page for other output. In that +case, you might want to set the variable `no-redraw-on-reenter' to +non-`nil' so that XEmacs will assume, when resumed, that the screen +page it is using still contains what XEmacs last wrote there. + + The variable `echo-keystrokes' controls the echoing of +multi-character keys; its value is the number of seconds of pause +required to cause echoing to start, or zero, meaning don't echo at all. +*Note Echo Area::. + + If the variable `ctl-arrow' is `nil', control characters in the +buffer are displayed with octal escape sequences, all except newline and +tab. If its value is `t', then control characters will be printed with +an up-arrow, for example `^A'. + + If its value is not `t' and not `nil', then characters whose code is +greater than 160 (that is, the space character (32) with its high bit +set) will be assumed to be printable, and will be displayed without +alteration. This is the default when running under X Windows, since +XEmacs assumes an ISO/8859-1 character set (also known as "Latin1"). +The `ctl-arrow' variable may also be set to an integer, in which case +all characters whose codes are greater than or equal to that value will +be assumed to be printable. + + Altering the value of `ctl-arrow' makes it local to the current +buffer; until that time, the default value is in effect. *Note +Locals::. + + Normally, a tab character in the buffer is displayed as whitespace +which extends to the next display tab stop position, and display tab +stops come at intervals equal to eight spaces. The number of spaces +per tab is controlled by the variable `tab-width', which is made local +by changing it, just like `ctl-arrow'. Note that how the tab character +in the buffer is displayed has nothing to do with the definition of + as a command. + + If you set the variable `selective-display-ellipses' to `nil', the +three dots at the end of a line that precedes invisible lines do not +appear. There is no visible indication of the invisible lines. This +variable becomes local automatically when set. + + +File: xemacs.info, Node: Search, Next: Fixit, Prev: Display, Up: Top + +Searching and Replacement +************************* + + Like other editors, Emacs has commands for searching for occurrences +of a string. The principal search command is unusual in that it is +"incremental": it begins to search before you have finished typing the +search string. There are also non-incremental search commands more like +those of other editors. + + Besides the usual `replace-string' command that finds all +occurrences of one string and replaces them with another, Emacs has a +fancy replacement command called `query-replace' which asks +interactively which occurrences to replace. + +* Menu: + +* Incremental Search:: Search happens as you type the string. +* Non-Incremental Search:: Specify entire string and then search. +* Word Search:: Search for sequence of words. +* Regexp Search:: Search for match for a regexp. +* Regexps:: Syntax of regular expressions. +* Search Case:: To ignore case while searching, or not. +* Replace:: Search, and replace some or all matches. +* Other Repeating Search:: Operating on all matches for some regexp. + + +File: xemacs.info, Node: Incremental Search, Next: Non-Incremental Search, Prev: Search, Up: Search + +Incremental Search +================== + + An incremental search begins searching as soon as you type the first +character of the search string. As you type in the search string, Emacs +shows you where the string (as you have typed it so far) is found. +When you have typed enough characters to identify the place you want, +you can stop. Depending on what you do next, you may or may not need to +terminate the search explicitly with a . + +`C-s' + Incremental search forward (`isearch-forward'). + +`C-r' + Incremental search backward (`isearch-backward'). + + `C-s' starts an incremental search. `C-s' reads characters from the +keyboard and positions the cursor at the first occurrence of the +characters that you have typed. If you type `C-s' and then `F', the +cursor moves right after the first `F'. Type an `O', and see the +cursor move to after the first `FO'. After another `O', the cursor is +after the first `FOO' after the place where you started the search. +Meanwhile, the search string `FOO' has been echoed in the echo area. + + The echo area display ends with three dots when actual searching is +going on. When search is waiting for more input, the three dots are +removed. (On slow terminals, the three dots are not displayed.) + + If you make a mistake in typing the search string, you can erase +characters with . Each cancels the last character of the +search string. This does not happen until Emacs is ready to read +another input character; first it must either find, or fail to find, +the character you want to erase. If you do not want to wait for this +to happen, use `C-g' as described below. + + When you are satisfied with the place you have reached, you can type + (or ), which stops searching, leaving the cursor where the +search brought it. Any command not specially meaningful in searches +also stops the search and is then executed. Thus, typing `C-a' exits +the search and then moves to the beginning of the line. is +necessary only if the next command you want to type is a printing +character, , , or another control character that is special +within searches (`C-q', `C-w', `C-r', `C-s', or `C-y'). + + Sometimes you search for `FOO' and find it, but were actually +looking for a different occurance of it. To move to the next occurrence +of the search string, type another `C-s'. Do this as often as +necessary. If you overshoot, you can cancel some `C-s' characters with +. + + After you exit a search, you can search for the same string again by +typing just `C-s C-s': the first `C-s' is the key that invokes +incremental search, and the second `C-s' means "search again". + + If the specified string is not found at all, the echo area displays +the text `Failing I-Search'. The cursor is after the place where Emacs +found as much of your string as it could. Thus, if you search for +`FOOT', and there is no `FOOT', the cursor may be after the `FOO' in +`FOOL'. At this point there are several things you can do. If you +mistyped the search string, correct it. If you like the place you have +found, you can type or some other Emacs command to "accept what +the search offered". Or you can type `C-g', which removes from the +search string the characters that could not be found (the `T' in +`FOOT'), leaving those that were found (the `FOO' in `FOOT'). A second +`C-g' at that point cancels the search entirely, returning point to +where it was when the search started. + + If a search is failing and you ask to repeat it by typing another +`C-s', it starts again from the beginning of the buffer. Repeating a +failing backward search with `C-r' starts again from the end. This is +called "wrapping around". `Wrapped' appears in the search prompt once +this has happened. + + The `C-g' "quit" character does special things during searches; just +what it does depends on the status of the search. If the search has +found what you specified and is waiting for input, `C-g' cancels the +entire search. The cursor moves back to where you started the search. +If `C-g' is typed when there are characters in the search string that +have not been found--because Emacs is still searching for them, or +because it has failed to find them--then the search string characters +which have not been found are discarded from the search string. The +search is now successful and waiting for more input, so a second `C-g' +cancels the entire search. + + To search for a control character such as `C-s' or or , +you must quote it by typing `C-q' first. This function of `C-q' is +analogous to its meaning as an Emacs command: it causes the following +character to be treated the way a graphic character would normally be +treated in the same context. + + To search backwards, you can use `C-r' instead of `C-s' to start the +search; `C-r' is the key that runs the command (`isearch-backward') to +search backward. You can also use `C-r' to change from searching +forward to searching backwards. Do this if a search fails because the +place you started was too far down in the file. Repeated `C-r' keeps +looking for more occurrences backwards. `C-s' starts going forward +again. You can cancel `C-r' in a search with . + + The characters `C-y' and `C-w' can be used in incremental search to +grab text from the buffer into the search string. This makes it +convenient to search for another occurrence of text at point. `C-w' +copies the word after point as part of the search string, advancing +point over that word. Another `C-s' to repeat the search will then +search for a string including that word. `C-y' is similar to `C-w' but +copies the rest of the current line into the search string. + + The characters `M-p' and `M-n' can be used in an incremental search +to recall things which you have searched for in the past. A list of +the last 16 things you have searched for is retained, and `M-p' and +`M-n' let you cycle through that ring. + + The character `M-' does completion on the elements in the +search history ring. For example, if you know that you have recently +searched for the string `POTATOE', you could type `C-s P O M-'. +If you had searched for other strings beginning with `PO' then you +would be shown a list of them, and would need to type more to select +one. + + You can change any of the special characters in incremental search +via the normal keybinding mechanism: simply add a binding to the +`isearch-mode-map'. For example, to make the character `C-b' mean +"search backwards" while in isearch-mode, do this: + + (define-key isearch-mode-map "\C-b" 'isearch-repeat-backward) + + These are the default bindings of isearch-mode: + +`DEL' + Delete a character from the incremental search string + (`isearch-delete-char'). + +`RET' + Exit incremental search (`isearch-exit'). + +`C-q' + Quote special characters for incremental search + (`isearch-quote-char'). + +`C-s' + Repeat incremental search forward (`isearch-repeat-forward'). + +`C-r' + Repeat incremental search backward (`isearch-repeat-backward'). + +`C-y' + Pull rest of line from buffer into search string + (`isearch-yank-line'). + +`C-w' + Pull next word from buffer into search string + (`isearch-yank-word'). + +`C-g' + Cancels input back to what has been found successfully, or aborts + the isearch (`isearch-abort'). + +`M-p' + Recall the previous element in the isearch history ring + (`isearch-ring-retreat'). + +`M-n' + Recall the next element in the isearch history ring + (`isearch-ring-advance'). + +`M-' + Do completion on the elements in the isearch history ring + (`isearch-complete'). + + Any other character which is normally inserted into a buffer when +typed is automatically added to the search string in isearch-mode. + +Slow Terminal Incremental Search +-------------------------------- + + Incremental search on a slow terminal uses a modified style of +display that is designed to take less time. Instead of redisplaying +the buffer at each place the search gets to, it creates a new +single-line window and uses that to display the line the search has +found. The single-line window appears as soon as point gets outside of +the text that is already on the screen. + + When the search is terminated, the single-line window is removed. +Only at this time the window in which the search was done is +redisplayed to show its new value of point. + + The three dots at the end of the search string, normally used to +indicate that searching is going on, are not displayed in slow style +display. + + The slow terminal style of display is used when the terminal baud +rate is less than or equal to the value of the variable +`search-slow-speed', initially 1200. + + The number of lines to use in slow terminal search display is +controlled by the variable `search-slow-window-lines'. Its normal +value is 1. + + +File: xemacs.info, Node: Non-Incremental Search, Next: Word Search, Prev: Incremental Search, Up: Search + +Non-Incremental Search +====================== + + Emacs also has conventional non-incremental search commands, which +require you type the entire search string before searching begins. + +`C-s STRING ' + Search for STRING. + +`C-r STRING ' + Search backward for STRING. + + To do a non-incremental search, first type `C-s ' (or `C-s +C-m'). This enters the minibuffer to read the search string. +Terminate the string with to start the search. If the string is +not found, the search command gets an error. + + By default, `C-s' invokes incremental search, but if you give it an +empty argument, which would otherwise be useless, it invokes +non-incremental search. Therefore, `C-s ' invokes non-incremental +search. `C-r ' also works this way. + + Forward and backward non-incremental searches are implemented by the +commands `search-forward' and `search-backward'. You can bind these +commands to keys. The reason that incremental search is programmed to +invoke them as well is that `C-s ' is the traditional sequence of +characters used in Emacs to invoke non-incremental search. + + Non-incremental searches performed using `C-s ' do not call +`search-forward' right away. They first check if the next character is +`C-w', which requests a word search. *Note Word Search::. + + +File: xemacs.info, Node: Word Search, Next: Regexp Search, Prev: Non-Incremental Search, Up: Search + +Word Search +=========== + + Word search looks for a sequence of words without regard to how the +words are separated. More precisely, you type a string of many words, +using single spaces to separate them, and the string is found even if +there are multiple spaces, newlines or other punctuation between the +words. + + Word search is useful in editing documents formatted by text +formatters. If you edit while looking at the printed, formatted +version, you can't tell where the line breaks are in the source file. +Word search, allows you to search without having to know the line +breaks. + +`C-s C-w WORDS ' + Search for WORDS, ignoring differences in punctuation. + +`C-r C-w WORDS ' + Search backward for WORDS, ignoring differences in punctuation. + + Word search is a special case of non-incremental search. It is +invoked with `C-s C-w' followed by the search string, which must +always be terminated with another . Being non-incremental, this +search does not start until the argument is terminated. It works by +constructing a regular expression and searching for that. *Note Regexp +Search::. + + You can do a backward word search with `C-r C-w'. + + Forward and backward word searches are implemented by the commands +`word-search-forward' and `word-search-backward'. You can bind these +commands to keys. The reason that incremental search is programmed to +invoke them as well is that `C-s C-w' is the traditional Emacs +sequence of keys for word search. + diff --git a/info/xemacs.info-6 b/info/xemacs.info-6 new file mode 100644 index 0000000..b86f3d6 --- /dev/null +++ b/info/xemacs.info-6 @@ -0,0 +1,1158 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Regexp Search, Next: Regexps, Prev: Word Search, Up: Search + +Regular Expression Search +========================= + + A "regular expression" ("regexp", for short) is a pattern that +denotes a set of strings, possibly an infinite set. Searching for +matches for a regexp is a powerful operation that editors on Unix +systems have traditionally offered. In XEmacs, you can search for the +next match for a regexp either incrementally or not. + + Incremental search for a regexp is done by typing `M-C-s' +(`isearch-forward-regexp'). This command reads a search string +incrementally just like `C-s', but it treats the search string as a +regexp rather than looking for an exact match against the text in the +buffer. Each time you add text to the search string, you make the +regexp longer, and the new regexp is searched for. A reverse regexp +search command `isearch-backward-regexp' also exists, but no key runs +it. + + All of the control characters that do special things within an +ordinary incremental search have the same functionality in incremental +regexp search. Typing `C-s' or `C-r' immediately after starting a +search retrieves the last incremental search regexp used: incremental +regexp and non-regexp searches have independent defaults. + + Non-incremental search for a regexp is done by the functions +`re-search-forward' and `re-search-backward'. You can invoke them with +`M-x' or bind them to keys. You can also call `re-search-forward' by +way of incremental regexp search with `M-C-s '. + + +File: xemacs.info, Node: Regexps, Next: Search Case, Prev: Regexp Search, Up: Search + +Syntax of Regular Expressions +============================= + + Regular expressions have a syntax in which a few characters are +special constructs and the rest are "ordinary". An ordinary character +is a simple regular expression which matches that character and nothing +else. The special characters are `$', `^', `.', `*', `+', `?', `[', +`]' and `\'; no new special characters will be defined. Any other +character appearing in a regular expression is ordinary, unless a `\' +precedes it. + + For example, `f' is not a special character, so it is ordinary, and +therefore `f' is a regular expression that matches the string `f' and +no other string. (It does not match the string `ff'.) Likewise, `o' +is a regular expression that matches only `o'. + + Any two regular expressions A and B can be concatenated. The result +is a regular expression which matches a string if A matches some amount +of the beginning of that string and B matches the rest of the string. + + As a simple example, you can concatenate the regular expressions `f' +and `o' to get the regular expression `fo', which matches only the +string `fo'. To do something nontrivial, you need to use one of the +following special characters: + +`. (Period)' + is a special character that matches any single character except a + newline. Using concatenation, you can make regular expressions + like `a.b', which matches any three-character string which begins + with `a' and ends with `b'. + +`*' + is not a construct by itself; it is a suffix, which means the + preceding regular expression is to be repeated as many times as + possible. In `fo*', the `*' applies to the `o', so `fo*' matches + one `f' followed by any number of `o's. The case of zero `o's is + allowed: `fo*' does match `f'. + + `*' always applies to the smallest possible preceding expression. + Thus, `fo*' has a repeating `o', not a repeating `fo'. + + The matcher processes a `*' construct by immediately matching as + many repetitions as it can find. Then it continues with the rest + of the pattern. If that fails, backtracking occurs, discarding + some of the matches of the `*'-modified construct in case that + makes it possible to match the rest of the pattern. For example, + matching `ca*ar' against the string `caaar', the `a*' first tries + to match all three `a's; but the rest of the pattern is `ar' and + there is only `r' left to match, so this try fails. The next + alternative is for `a*' to match only two `a's. With this choice, + the rest of the regexp matches successfully. + +`+' + is a suffix character similar to `*' except that it requires that + the preceding expression be matched at least once. For example, + `ca+r' will match the strings `car' and `caaaar' but not the + string `cr', whereas `ca*r' would match all three strings. + +`?' + is a suffix character similar to `*' except that it can match the + preceding expression either once or not at all. For example, + `ca?r' will match `car' or `cr'; nothing else. + +`[ ... ]' + `[' begins a "character set", which is terminated by a `]'. In + the simplest case, the characters between the two form the set. + Thus, `[ad]' matches either one `a' or one `d', and `[ad]*' + matches any string composed of just `a's and `d's (including the + empty string), from which it follows that `c[ad]*r' matches `cr', + `car', `cdr', `caddaar', etc. + + You can include character ranges in a character set by writing two + characters with a `-' between them. Thus, `[a-z]' matches any + lower-case letter. Ranges may be intermixed freely with individual + characters, as in `[a-z$%.]', which matches any lower-case letter + or `$', `%', or period. + + Note that inside a character set the usual special characters are + not special any more. A completely different set of special + characters exists inside character sets: `]', `-', and `^'. + + To include a `]' in a character set, you must make it the first + character. For example, `[]a]' matches `]' or `a'. To include a + `-', write `---', which is a range containing only `-'. To + include `^', make it other than the first character in the set. + +`[^ ... ]' + `[^' begins a "complement character set", which matches any + character except the ones specified. Thus, `[^a-z0-9A-Z]' matches + all characters except letters and digits. + + `^' is not special in a character set unless it is the first + character. The character following the `^' is treated as if it + were first (`-' and `]' are not special there). + + Note that a complement character set can match a newline, unless + newline is mentioned as one of the characters not to match. + +`^' + is a special character that matches the empty string, but only if + at the beginning of a line in the text being matched. Otherwise, + it fails to match anything. Thus, `^foo' matches a `foo' that + occurs at the beginning of a line. + +`$' + is similar to `^' but matches only at the end of a line. Thus, + `xx*$' matches a string of one `x' or more at the end of a line. + +`\' + does two things: it quotes the special characters (including `\'), + and it introduces additional special constructs. + + Because `\' quotes special characters, `\$' is a regular + expression that matches only `$', and `\[' is a regular expression + that matches only `[', and so on. + + Note: for historical compatibility, special characters are treated as +ordinary ones if they are in contexts where their special meanings make +no sense. For example, `*foo' treats `*' as ordinary since there is no +preceding expression on which the `*' can act. It is poor practice to +depend on this behavior; better to quote the special character anyway, +regardless of where is appears. + + Usually, `\' followed by any character matches only that character. +However, there are several exceptions: characters which, when preceded +by `\', are special constructs. Such characters are always ordinary +when encountered on their own. Here is a table of `\' constructs. + +`\|' + specifies an alternative. Two regular expressions A and B with + `\|' in between form an expression that matches anything A or B + matches. + + Thus, `foo\|bar' matches either `foo' or `bar' but no other string. + + `\|' applies to the largest possible surrounding expressions. + Only a surrounding `\( ... \)' grouping can limit the grouping + power of `\|'. + + Full backtracking capability exists to handle multiple uses of + `\|'. + +`\( ... \)' + is a grouping construct that serves three purposes: + + 1. To enclose a set of `\|' alternatives for other operations. + Thus, `\(foo\|bar\)x' matches either `foox' or `barx'. + + 2. To enclose a complicated expression for the postfix `*' to + operate on. Thus, `ba\(na\)*' matches `bananana', etc., with + any (zero or more) number of `na' strings. + + 3. To mark a matched substring for future reference. + + + This last application is not a consequence of the idea of a + parenthetical grouping; it is a separate feature which happens to + be assigned as a second meaning to the same `\( ... \)' construct + because in practice there is no conflict between the two meanings. + Here is an explanation: + +`\DIGIT' + after the end of a `\( ... \)' construct, the matcher remembers the + beginning and end of the text matched by that construct. Then, + later on in the regular expression, you can use `\' followed by + DIGIT to mean "match the same text matched the DIGIT'th time by the + `\( ... \)' construct." + + The strings matching the first nine `\( ... \)' constructs + appearing in a regular expression are assigned numbers 1 through 9 + in order that the open-parentheses appear in the regular + expression. `\1' through `\9' may be used to refer to the text + matched by the corresponding `\( ... \)' construct. + + For example, `\(.*\)\1' matches any newline-free string that is + composed of two identical halves. The `\(.*\)' matches the first + half, which may be anything, but the `\1' that follows must match + the same exact text. + +`\`' + matches the empty string, provided it is at the beginning of the + buffer. + +`\'' + matches the empty string, provided it is at the end of the buffer. + +`\b' + matches the empty string, provided it is at the beginning or end + of a word. Thus, `\bfoo\b' matches any occurrence of `foo' as a + separate word. `\bballs?\b' matches `ball' or `balls' as a + separate word. + +`\B' + matches the empty string, provided it is not at the beginning or + end of a word. + +`\<' + matches the empty string, provided it is at the beginning of a + word. + +`\>' + matches the empty string, provided it is at the end of a word. + +`\w' + matches any word-constituent character. The editor syntax table + determines which characters these are. + +`\W' + matches any character that is not a word-constituent. + +`\sCODE' + matches any character whose syntax is CODE. CODE is a character + which represents a syntax code: thus, `w' for word constituent, + `-' for whitespace, `(' for open-parenthesis, etc. *Note Syntax::. + +`\SCODE' + matches any character whose syntax is not CODE. + + Here is a complicated regexp used by Emacs to recognize the end of a +sentence together with any whitespace that follows. It is given in Lisp +syntax to enable you to distinguish the spaces from the tab characters. +In Lisp syntax, the string constant begins and ends with a +double-quote. `\"' stands for a double-quote as part of the regexp, +`\\' for a backslash as part of the regexp, `\t' for a tab and `\n' for +a newline. + + "[.?!][]\"')]*\\($\\|\t\\| \\)[ \t\n]*" + +This regexp contains four parts: a character set matching period, `?' +or `!'; a character set matching close-brackets, quotes or parentheses, +repeated any number of times; an alternative in backslash-parentheses +that matches end-of-line, a tab or two spaces; and a character set +matching whitespace characters, repeated any number of times. + + +File: xemacs.info, Node: Search Case, Next: Replace, Prev: Regexps, Up: Search + +Searching and Case +================== + + All searches in Emacs normally ignore the case of the text they are +searching through; if you specify searching for `FOO', `Foo' and `foo' +are also considered a match. Regexps, and in particular character +sets, are included: `[aB]' matches `a' or `A' or `b' or `B'. + + If you want a case-sensitive search, set the variable +`case-fold-search' to `nil'. Then all letters must match exactly, +including case. `case-fold-search' is a per-buffer variable; altering +it affects only the current buffer, but there is a default value which +you can change as well. *Note Locals::. You can also use Case +Sensitive Search from the Options menu on your screen. + + +File: xemacs.info, Node: Replace, Next: Other Repeating Search, Prev: Search Case, Up: Search + +Replacement Commands +==================== + + Global search-and-replace operations are not needed as often in +Emacs as they are in other editors, but they are available. In +addition to the simple `replace-string' command which is like that +found in most editors, there is a `query-replace' command which asks +you, for each occurrence of a pattern, whether to replace it. + + The replace commands all replace one string (or regexp) with one +replacement string. It is possible to perform several replacements in +parallel using the command `expand-region-abbrevs'. *Note Expanding +Abbrevs::. + +* Menu: + +* Unconditional Replace:: Replacing all matches for a string. +* Regexp Replace:: Replacing all matches for a regexp. +* Replacement and Case:: How replacements preserve case of letters. +* Query Replace:: How to use querying. + + +File: xemacs.info, Node: Unconditional Replace, Next: Regexp Replace, Prev: Replace, Up: Replace + +Unconditional Replacement +------------------------- + +`M-x replace-string STRING NEWSTRING ' + Replace every occurrence of STRING with NEWSTRING. + +`M-x replace-regexp REGEXP NEWSTRING ' + Replace every match for REGEXP with NEWSTRING. + + To replace every instance of `foo' after point with `bar', use the +command `M-x replace-string' with the two arguments `foo' and `bar'. +Replacement occurs only after point: if you want to cover the whole +buffer you must go to the beginning first. By default, all occurrences +up to the end of the buffer are replaced. To limit replacement to part +of the buffer, narrow to that part of the buffer before doing the +replacement (*note Narrowing::.). + + When `replace-string' exits, point is left at the last occurrence +replaced. The value of point when the `replace-string' command was +issued is remembered on the mark ring; `C-u C-' moves back there. + + A numeric argument restricts replacement to matches that are +surrounded by word boundaries. + + +File: xemacs.info, Node: Regexp Replace, Next: Replacement and Case, Prev: Unconditional Replace, Up: Replace + +Regexp Replacement +------------------ + + `replace-string' replaces exact matches for a single string. The +similar command `replace-regexp' replaces any match for a specified +pattern. + + In `replace-regexp', the NEWSTRING need not be constant. It can +refer to all or part of what is matched by the REGEXP. `\&' in +NEWSTRING stands for the entire text being replaced. `\D' in +NEWSTRING, where D is a digit, stands for whatever matched the D'th +parenthesized grouping in REGEXP. For example, + + M-x replace-regexp c[ad]+r \&-safe + +would replace (for example) `cadr' with `cadr-safe' and `cddr' with +`cddr-safe'. + + M-x replace-regexp \(c[ad]+r\)-safe \1 + +would perform exactly the opposite replacements. To include a `\' in +the text to replace with, you must give `\\'. + + +File: xemacs.info, Node: Replacement and Case, Next: Query Replace, Prev: Regexp Replace, Up: Replace + +Replace Commands and Case +------------------------- + + If the arguments to a replace command are in lower case, the command +preserves case when it makes a replacement. Thus, the following +command: + + M-x replace-string foo bar + +replaces a lower-case `foo' with a lower case `bar', `FOO' with `BAR', +and `Foo' with `Bar'. If upper-case letters are used in the second +argument, they remain upper-case every time that argument is inserted. +If upper-case letters are used in the first argument, the second +argument is always substituted exactly as given, with no case +conversion. Likewise, if the variable `case-replace' is set to `nil', +replacement is done without case conversion. If `case-fold-search' is +set to `nil', case is significant in matching occurrences of `foo' to +replace; also, case conversion of the replacement string is not done. + + +File: xemacs.info, Node: Query Replace, Prev: Replacement and Case, Up: Replace + +Query Replace +------------- + +`M-% STRING NEWSTRING ' +`M-x query-replace STRING NEWSTRING ' + Replace some occurrences of STRING with NEWSTRING. + +`M-x query-replace-regexp REGEXP NEWSTRING ' + Replace some matches for REGEXP with NEWSTRING. + + If you want to change only some of the occurrences of `foo' to +`bar', not all of them, you can use `query-replace' instead of `M-%'. +This command finds occurrences of `foo' one by one, displays each +occurrence, and asks you whether to replace it. A numeric argument to +`query-replace' tells it to consider only occurrences that are bounded +by word-delimiter characters. + + Aside from querying, `query-replace' works just like +`replace-string', and `query-replace-regexp' works just like +`replace-regexp'. + + The things you can type when you are shown an occurrence of STRING +or a match for REGEXP are: + +`' + to replace the occurrence with NEWSTRING. This preserves case, + just like `replace-string', provided `case-replace' is non-`nil', + as it normally is. + +`' + to skip to the next occurrence without replacing this one. + +`, (Comma)' + to replace this occurrence and display the result. You are then + prompted for another input character. However, since the + replacement has already been made, and are equivalent. + At this point, you can type `C-r' (see below) to alter the + replaced text. To undo the replacement, you can type `C-x u'. + This exits the `query-replace'. If you want to do further + replacement you must use `C-x ESC' to restart (*note + Repetition::.). + +`' + to exit without doing any more replacements. + +`. (Period)' + to replace this occurrence and then exit. + +`!' + to replace all remaining occurrences without asking again. + +`^' + to go back to the location of the previous occurrence (or what + used to be an occurrence), in case you changed it by mistake. + This works by popping the mark ring. Only one `^' in a row is + allowed, because only one previous replacement location is kept + during `query-replace'. + +`C-r' + to enter a recursive editing level, in case the occurrence needs + to be edited rather than just replaced with NEWSTRING. When you + are done, exit the recursive editing level with `C-M-c' and the + next occurrence will be displayed. *Note Recursive Edit::. + +`C-w' + to delete the occurrence, and then enter a recursive editing level + as in `C-r'. Use the recursive edit to insert text to replace the + deleted occurrence of STRING. When done, exit the recursive + editing level with `C-M-c' and the next occurrence will be + displayed. + +`C-l' + to redisplay the screen and then give another answer. + +`C-h' + to display a message summarizing these options, then give another + answer. + + If you type any other character, Emacs exits the `query-replace', and +executes the character as a command. To restart the `query-replace', +use `C-x ', which repeats the `query-replace' because it used the +minibuffer to read its arguments. *Note C-x ESC: Repetition. + + +File: xemacs.info, Node: Other Repeating Search, Prev: Replace, Up: Search + +Other Search-and-Loop Commands +============================== + + Here are some other commands that find matches for a regular +expression. They all operate from point to the end of the buffer. + +`M-x occur' + Print each line that follows point and contains a match for the + specified regexp. A numeric argument specifies the number of + context lines to print before and after each matching line; the + default is none. + + The buffer `*Occur*' containing the output serves as a menu for + finding occurrences in their original context. Find an occurrence + as listed in `*Occur*', position point there, and type `C-c C-c'; + this switches to the buffer that was searched and moves point to + the original of the same occurrence. + +`M-x list-matching-lines' + Synonym for `M-x occur'. + +`M-x count-matches' + Print the number of matches following point for the specified + regexp. + +`M-x delete-non-matching-lines' + Delete each line that follows point and does not contain a match + for the specified regexp. + +`M-x delete-matching-lines' + Delete each line that follows point and contains a match for the + specified regexp. + + +File: xemacs.info, Node: Fixit, Next: Files, Prev: Search, Up: Top + +Commands for Fixing Typos +************************* + + This chapter describes commands that are especially useful when you +catch a mistake in your text just after you have made it, or when you +change your mind while composing text on line. + +* Menu: + +* Kill Errors:: Commands to kill a batch of recently entered text. +* Transpose:: Exchanging two characters, words, lines, lists... +* Fixing Case:: Correcting case of last word entered. +* Spelling:: Apply spelling checker to a word, or a whole file. + + +File: xemacs.info, Node: Kill Errors, Next: Transpose, Prev: Fixit, Up: Fixit + +Killing Your Mistakes +===================== + +`' + Delete last character (`delete-backward-char'). + +`M-' + Kill last word (`backward-kill-word'). + +`C-x ' + Kill to beginning of sentence (`backward-kill-sentence'). + + The character (`delete-backward-char') is the most important +correction command. When used among graphic (self-inserting) +characters, it can be thought of as canceling the last character typed. + + When your mistake is longer than a couple of characters, it might be +more convenient to use `M-' or `C-x '. `M-' kills back +to the start of the last word, and `C-x ' kills back to the start +of the last sentence. `C-x ' is particularly useful when you are +thinking of what to write as you type it, in case you change your mind +about phrasing. `M-' and `C-x ' save the killed text for +`C-y' and `M-y' to retrieve. *Note Yanking::. + + `M-' is often useful even when you have typed only a few +characters wrong, if you know you are confused in your typing and aren't +sure exactly what you typed. At such a time, you cannot correct with + except by looking at the screen to see what you did. It requires +less thought to kill the whole word and start over. + + +File: xemacs.info, Node: Transpose, Next: Fixing Case, Prev: Kill Errors, Up: Fixit + +Transposing Text +================ + +`C-t' + Transpose two characters (`transpose-chars'). + +`M-t' + Transpose two words (`transpose-words'). + +`C-M-t' + Transpose two balanced expressions (`transpose-sexps'). + +`C-x C-t' + Transpose two lines (`transpose-lines'). + + The common error of transposing two adjacent characters can be fixed +with the `C-t' command (`transpose-chars'). Normally, `C-t' transposes +the two characters on either side of point. When given at the end of a +line, `C-t' transposes the last two characters on the line, rather than +transposing the last character of the line with the newline, which +would be useless. If you catch a transposition error right away, you +can fix it with just `C-t'. If you catch the error later, move the +cursor back to between the two transposed characters. If you +transposed a space with the last character of the word before it, the +word motion commands are a good way of getting there. Otherwise, a +reverse search (`C-r') is often the best way. *Note Search::. + + `Meta-t' (`transpose-words') transposes the word before point with +the word after point. It moves point forward over a word, dragging the +word preceding or containing point forward as well. The punctuation +characters between the words do not move. For example, `FOO, BAR' +transposes into `BAR, FOO' rather than `BAR FOO,'. + + `C-M-t' (`transpose-sexps') is a similar command for transposing two +expressions (*note Lists::.), and `C-x C-t' (`transpose-lines') +exchanges lines. It works like `M-t' but in determines the division of +the text into syntactic units differently. + + A numeric argument to a transpose command serves as a repeat count: +it tells the transpose command to move the character (word, sexp, line) +before or containing point across several other characters (words, +sexps, lines). For example, `C-u 3 C-t' moves the character before +point forward across three other characters. This is equivalent to +repeating `C-t' three times. `C-u - 4 M-t' moves the word before point +backward across four words. `C-u - C-M-t' would cancel the effect of +plain `C-M-t'. + + A numeric argument of zero transposes the character (word, sexp, +line) ending after point with the one ending after the mark (otherwise a +command with a repeat count of zero would do nothing). + + +File: xemacs.info, Node: Fixing Case, Next: Spelling, Prev: Transpose, Up: Fixit + +Case Conversion +=============== + +`M-- M-l' + Convert last word to lower case. Note that `Meta--' is + "Meta-minus." + +`M-- M-u' + Convert last word to all upper case. + +`M-- M-c' + Convert last word to lower case with capital initial. + + A common error is to type words in the wrong case. Because of this, +the word case-conversion commands `M-l', `M-u', and `M-c' do not move +the cursor when used with a negative argument. As soon as you see you +have mistyped the last word, you can simply case-convert it and +continue typing. *Note Case::. + + +File: xemacs.info, Node: Spelling, Prev: Fixing Case, Up: Fixit + +Checking and Correcting Spelling +================================ + +`M-$' + Check and correct spelling of word (`spell-word'). + +`M-x spell-buffer' + Check and correct spelling of each word in the buffer. + +`M-x spell-region' + Check and correct spelling of each word in the region. + +`M-x spell-string' + Check spelling of specified word. + + To check the spelling of the word before point, and optionally +correct it, use the command `M-$' (`spell-word'). This command runs an +inferior process containing the `spell' program to see whether the word +is correct English. If it is not, it asks you to edit the word (in the +minibuffer) into a corrected spelling, and then performs a +`query-replace' to substitute the corrected spelling for the old one +throughout the buffer. + + If you exit the minibuffer without altering the original spelling, it +means you do not want to do anything to that word. In that case, the +`query-replace' is not done. + + `M-x spell-buffer' checks each word in the buffer the same way that +`spell-word' does, doing a `query-replace' for every incorrect word if +appropriate. + + `M-x spell-region' is similar to `spell-buffer' but operates only on +the region, not the entire buffer. + + `M-x spell-string' reads a string as an argument and checks whether +that is a correctly spelled English word. It prints a message giving +the answer in the echo area. + + +File: xemacs.info, Node: Files, Next: Buffers, Prev: Fixit, Up: Top + +File Handling +************* + + The basic unit of stored data in Unix is the "file". To edit a file, +you must tell Emacs to examine the file and prepare a buffer containing +a copy of the file's text. This is called "visiting" the file. Editing +commands apply directly to text in the buffer; that is, to the copy +inside Emacs. Your changes appear in the file itself only when you +"save" the buffer back into the file. + + In addition to visiting and saving files, Emacs can delete, copy, +rename, and append to files, and operate on file directories. + +* Menu: + +* File Names:: How to type and edit file name arguments. +* Visiting:: Visiting a file prepares Emacs to edit the file. +* Saving:: Saving makes your changes permanent. +* Reverting:: Reverting cancels all the changes not saved. +* Auto Save:: Auto Save periodically protects against loss of data. +* Version Control:: Version control systems (RCS and SCCS). +* ListDir:: Listing the contents of a file directory. +* Comparing Files:: Finding where two files differ. +* Dired:: "Editing" a directory to delete, rename, etc. + the files in it. +* Misc File Ops:: Other things you can do on files. + + +File: xemacs.info, Node: File Names, Next: Visiting, Prev: Files, Up: Files + +File Names +========== + + Most Emacs commands that operate on a file require you to specify the +file name. (Saving and reverting are exceptions; the buffer knows which +file name to use for them.) File names are specified in the minibuffer +(*note Minibuffer::.). "Completion" is available, to make it easier to +specify long file names. *Note Completion::. + + There is always a "default file name" which is used if you enter an +empty argument by typing just . Normally the default file name is +the name of the file visited in the current buffer; this makes it easy +to operate on that file with any of the Emacs file commands. + + Each buffer has a default directory, normally the same as the +directory of the file visited in that buffer. When Emacs reads a file +name, the default directory is used if you do not specify a directory. +If you specify a directory in a relative fashion, with a name that does +not start with a slash, it is interpreted with respect to the default +directory. The default directory of the current buffer is kept in the +variable `default-directory', which has a separate value in every +buffer. The value of the variable should end with a slash. + + For example, if the default file name is `/u/rms/gnu/gnu.tasks' then +the default directory is `/u/rms/gnu/'. If you type just `foo', which +does not specify a directory, it is short for `/u/rms/gnu/foo'. +`../.login' would stand for `/u/rms/.login'. `new/foo' would stand for +the filename `/u/rms/gnu/new/foo'. + + The variable `default-directory-alist' takes an alist of major modes +and their opinions on `default-directory' as a Lisp expression to +evaluate. A resulting value of `nil' is ignored in favor of +`default-directory'. + + You can create a new directory with the function `make-directory', +which takes as an argument a file name string. The current directory is +displayed in the minibuffer when the function is called; you can delete +the old directory name and supply a new directory name. For example, if +the current directory is `/u/rms/gnu', you can delete `gnu' and type +`oryx' and to create `/u/rms/oryx'. Removing a directory is +similar to creating one. To remove a directory, use +`remove-directory'; it takes one argument, a file name string. + + The command `M-x pwd' prints the current buffer's default directory, +and the command `M-x cd' sets it (to a value read using the +minibuffer). A buffer's default directory changes only when the `cd' +command is used. A file-visiting buffer's default directory is +initialized to the directory of the file that is visited there. If a +buffer is created with `C-x b', its default directory is copied from +that of the buffer that was current at the time. + + The default directory name actually appears in the minibuffer when +the minibuffer becomes active to read a file name. This serves two +purposes: it shows you what the default is, so that you can type a +relative file name and know with certainty what it will mean, and it +allows you to edit the default to specify a different directory. To +inhibit the insertion of the default directory, set the variable +`insert-default-directory' to `nil'. + + Note that it is legitimate to type an absolute file name after you +enter the minibuffer, ignoring the presence of the default directory +name. The final minibuffer contents may look invalid, but that is not +so. *Note Minibuffer File::. + + `$' in a file name is used to substitute environment variables. For +example, if you have used the shell command `setenv FOO rms/hacks' to +set up an environment variable named `FOO', then you can use +`/u/$FOO/test.c' or `/u/${FOO}/test.c' as an abbreviation for +`/u/rms/hacks/test.c'. The environment variable name consists of all +the alphanumeric characters after the `$'; alternatively, it may be +enclosed in braces after the `$'. Note that the `setenv' command +affects Emacs only if done before Emacs is started. + + To access a file with `$' in its name, type `$$'. This pair is +converted to a single `$' at the same time variable substitution is +performed for single `$'. The Lisp function that performs the +substitution is called `substitute-in-file-name'. The substitution is +performed only on filenames read as such using the minibuffer. + + +File: xemacs.info, Node: Visiting, Next: Saving, Prev: File Names, Up: Files + +Visiting Files +============== + +`C-x C-f' + Visit a file (`find-file'). + +`C-x C-v' + Visit a different file instead of the one visited last + (`find-alternate-file'). + +`C-x 4 C-f' + Visit a file, in another window (`find-file-other-window'). Don't + change this window. + +`C-x 5 C-f' + Visit a file, in another frame (`find-file-other-frame'). Don't + change this window or frame. + + "Visiting" a file means copying its contents into an Emacs buffer so +you can edit it. Emacs creates a new buffer for each file you visit. +We say that the buffer is visiting the file that it was created to +hold. Emacs constructs the buffer name from the file name by throwing +away the directory and keeping just the file name. For example, a file +named `/usr/rms/emacs.tex' is displayed in a buffer named `emacs.tex'. +If a buffer with that name exists, a unique name is constructed by +appending `<2>', `<3>',and so on, using the lowest number that makes a +name that is not already in use. + + Each window's mode line shows the name of the buffer that is being +displayed in that window, so you can always tell what buffer you are +editing. + + The changes you make with Emacs are made in the Emacs buffer. They +do not take effect in the file that you visit, or any other permanent +place, until you "save" the buffer. Saving the buffer means that Emacs +writes the current contents of the buffer into its visited file. *Note +Saving::. + + If a buffer contains changes that have not been saved, the buffer is +said to be "modified". This is important because it implies that some +changes will be lost if the buffer is not saved. The mode line displays +two stars near the left margin if the buffer is modified. + + To visit a file, use the command `C-x C-f' (`find-file'). Follow +the command with the name of the file you wish to visit, terminated by a +. If you are using XEmacs under X, you can also use the Open... +command from the File menu bar item. + + The file name is read using the minibuffer (*note Minibuffer::.), +with defaulting and completion in the standard manner (*note File +Names::.). While in the minibuffer, you can abort `C-x C-f' by typing +`C-g'. + + `C-x C-f' has completed successfully when text appears on the screen +and a new buffer name appears in the mode line. If the specified file +does not exist and could not be created or cannot be read, an error +results. The error message is printed in the echo area, and includes +the name of the file that Emacs was trying to visit. + + If you visit a file that is already in Emacs, `C-x C-f' does not make +another copy. It selects the existing buffer containing that file. +However, before doing so, it checks that the file itself has not changed +since you visited or saved it last. If the file has changed, Emacs +prints a warning message. *Note Simultaneous Editing: Interlocking. + + You can switch to a specific file called out in the current buffer by +calling the function `find-this-file'. By providing a prefix argument, +this function calls `filename-at-point' and switches to a buffer +visiting the file FILENAME. It creates one if none already exists. You +can use this function to edit the file mentioned in the buffer you are +working in or to test if the file exists. You can do that by using the +minibuffer completion after snatching the all or part of the filename. + + If the variable `find-file-use-truenames''s value is non-`nil', a +buffer's visited filename will always be traced back to the real file. +The filename will never be a symbolic link, and there will never be a +symbolic link anywhere in its directory path. In other words, the +`buffer-file-name' and `buffer-file-truename' will be equal. + + If the variable `find-file-compare-truenames' value is non-`nil', +the `find-file' command will check the `buffer-file-truename' of all +visited files when deciding whether a given file is already in a +buffer, instead of just `buffer-file-name'. If you attempt to visit +another file which is a hard-link or symbolic-link to a file that is +already in a buffer, the existing buffer will be found instead of a +newly created one. + + If you want to create a file, just visit it. Emacs prints `(New +File)' in the echo area, but in other respects behaves as if you had +visited an existing empty file. If you make any changes and save them, +the file is created. + + If you visit a nonexistent file unintentionally (because you typed +the wrong file name), use the `C-x C-v' (`find-alternate-file') command +to visit the file you wanted. `C-x C-v' is similar to `C-x C-f', but +it kills the current buffer (after first offering to save it if it is +modified). `C-x C-v' is allowed even if the current buffer is not +visiting a file. + + If the file you specify is actually a directory, Dired is called on +that directory (*note Dired::.). To inhibit this, set the variable +`find-file-run-dired' to `nil'; then it is an error to try to visit a +directory. + + `C-x 4 f' (`find-file-other-window') is like `C-x C-f' except that +the buffer containing the specified file is selected in another window. +The window that was selected before `C-x 4 f' continues to show the +same buffer it was already showing. If you use this command when only +one window is being displayed, that window is split in two, with one +window showing the same buffer as before, and the other one showing the +newly requested file. *Note Windows::. + + `C-x 5 C-f' (`find-file-other-frame') is like `C-x C-f' except that +it creates a new frame in which the file is displayed. + + Use the function `find-this-file-other-window' to edit a file +mentioned in the buffer you are editing or to test if that file exists. +To do this, use the minibuffer completion after snatching the part or +all of the filename. By providing a prefix argument, the function calls +`filename-at-point' and switches you to a buffer visiting the file +FILENAME in another window. The function creates a buffer if none +already exists. This function is similar to `find-file-other-window'. + + There are two hook variables that allow extensions to modify the +operation of visiting files. Visiting a file that does not exist runs +the functions in the list `find-file-not-found-hooks'; the value of this +variable is expected to be a list of functions which are called one by +one until one of them returns non-`nil'. Any visiting of a file, +whether extant or not, expects `find-file-hooks' to contain list of +functions and calls them all, one by one. In both cases the functions +receive no arguments. Visiting a nonexistent file runs the +`find-file-not-found-hooks' first. + + +File: xemacs.info, Node: Saving, Next: Reverting, Prev: Visiting, Up: Files + +Saving Files +============ + + "Saving" a buffer in Emacs means writing its contents back into the +file that was visited in the buffer. + +`C-x C-s' + Save the current buffer in its visited file (`save-buffer'). + +`C-x s' + Save any or all buffers in their visited files + (`save-some-buffers'). + +`M-~' + Forget that the current buffer has been changed (`not-modified'). + +`C-x C-w' + Save the current buffer in a specified file, and record that file + as the one visited in the buffer (`write-file'). + +`M-x set-visited-file-name' + Change file the name under which the current buffer will be saved. + + To save a file and make your changes permanent, type `C-x C-s' +(`save-buffer'). After saving is finished, `C-x C-s' prints a message +such as: + + Wrote /u/rms/gnu/gnu.tasks + +If the selected buffer is not modified (no changes have been made in it +since the buffer was created or last saved), Emacs does not save it +because it would have no effect. Instead, `C-x C-s' prints a message +in the echo area saying: + + (No changes need to be saved) + + The command `C-x s' (`save-some-buffers') can save any or all +modified buffers. First it asks, for each modified buffer, whether to +save it. The questions should be answered with `y' or `n'. `C-x C-c', +the key that kills Emacs, invokes `save-some-buffers' and therefore +asks the same questions. + + If you have changed a buffer and do not want the changes to be saved, +you should take some action to prevent it. Otherwise, you are liable to +save it by mistake each time you use `save-some-buffers' or a related +command. One thing you can do is type `M-~' (`not-modified'), which +removes the indication that the buffer is modified. If you do this, +none of the save commands will believe that the buffer needs to be +saved. (`~' is often used as a mathematical symbol for `not'; thus +`Meta-~' is `not', metafied.) You could also use +`set-visited-file-name' (see below) to mark the buffer as visiting a +different file name, not in use for anything important. + + You can also undo all the changes made since the file was visited or +saved, by reading the text from the file again. This is called +"reverting". *Note Reverting::. Alternatively, you can undo all the +changes by repeating the undo command `C-x u'; but this only works if +you have not made more changes than the undo mechanism can remember. + + `M-x set-visited-file-name' alters the name of the file that the +current buffer is visiting. It prompts you for the new file name in the +minibuffer. You can also use `set-visited-file-name' on a buffer that +is not visiting a file. The buffer's name is changed to correspond to +the file it is now visiting unless the new name is already used by a +different buffer; in that case, the buffer name is not changed. +`set-visited-file-name' does not save the buffer in the newly visited +file; it just alters the records inside Emacs so that it will save the +buffer in that file. It also marks the buffer as "modified" so that +`C-x C-s' will save. + + If you wish to mark a buffer as visiting a different file and save it +right away, use `C-x C-w' (`write-file'). It is precisely equivalent +to `set-visited-file-name' followed by `C-x C-s'. `C-x C-s' used on a +buffer that is not visiting a file has the same effect as `C-x C-w'; +that is, it reads a file name, marks the buffer as visiting that file, +and saves it there. The default file name in a buffer that is not +visiting a file is made by combining the buffer name with the buffer's +default directory. + + If Emacs is about to save a file and sees that the date of the latest +version on disk does not match what Emacs last read or wrote, Emacs +notifies you of this fact, because it probably indicates a problem +caused by simultaneous editing and requires your immediate attention. +*Note Simultaneous Editing: Interlocking. + + If the variable `require-final-newline' is non-`nil', Emacs puts a +newline at the end of any file that doesn't already end in one, every +time a file is saved or written. + + Use the hook variable `write-file-hooks' to implement other ways to +write files, and specify things to be done before files are written. +The value of this variable should be a list of Lisp functions. When a +file is to be written, the functions in the list are called, one by +one, with no arguments. If one of them returns a non-`nil' value, Emacs +takes this to mean that the file has been written in some suitable +fashion; the rest of the functions are not called, and normal writing is +not done. Use the hook variable `after-save-hook' to list all the +functions to be called after writing out a buffer to a file. + +* Menu: + +* Backup:: How Emacs saves the old version of your file. +* Interlocking:: How Emacs protects against simultaneous editing + of one file by two users. + + +File: xemacs.info, Node: Backup, Next: Interlocking, Prev: Saving, Up: Saving + +Backup Files +------------ + + Because Unix does not provide version numbers in file names, +rewriting a file in Unix automatically destroys all record of what the +file used to contain. Thus, saving a file from Emacs throws away the +old contents of the file--or it would, except that Emacs carefully +copies the old contents to another file, called the "backup" file, +before actually saving. (Make sure that the variable +`make-backup-files' is non-`nil'. Backup files are not written if this +variable is `nil'). + + At your option, Emacs can keep either a single backup file or a +series of numbered backup files for each file you edit. + + Emacs makes a backup for a file only the first time a file is saved +from one buffer. No matter how many times you save a file, its backup +file continues to contain the contents from before the file was visited. +Normally this means that the backup file contains the contents from +before the current editing session; however, if you kill the buffer and +then visit the file again, a new backup file is made by the next save. + +* Menu: + +* Names: Backup Names. How backup files are named; + Choosing single or numbered backup files. +* Deletion: Backup Deletion. Emacs deletes excess numbered backups. +* Copying: Backup Copying. Backups can be made by copying or renaming. + + +File: xemacs.info, Node: Backup Names, Next: Backup Deletion, Prev: Backup, Up: Backup + +Single or Numbered Backups +.......................... + + If you choose to have a single backup file (the default), the backup +file's name is constructed by appending `~' to the file name being +edited; thus, the backup file for `eval.c' is `eval.c~'. + + If you choose to have a series of numbered backup files, backup file +names are made by appending `.~', the number, and another `~' to the +original file name. Thus, the backup files of `eval.c' would be called +`eval.c.~1~', `eval.c.~2~', and so on, through names like +`eval.c.~259~' and beyond. + + If protection stops you from writing backup files under the usual +names, the backup file is written as `%backup%~' in your home directory. +Only one such file can exist, so only the most recently made backup is +available. + + The choice of single backup or numbered backups is controlled by the +variable `version-control'. Its possible values are: + +`t' + Make numbered backups. + +`nil' + Make numbered backups for files that have numbered backups already. + Otherwise, make single backups. + +`never' + Never make numbered backups; always make single backups. + +`version-control' may be set locally in an individual buffer to control +the making of backups for that buffer's file. For example, Rmail mode +locally sets `version-control' to `never' to make sure that there is +only one backup for an Rmail file. *Note Locals::. + + +File: xemacs.info, Node: Backup Deletion, Next: Backup Copying, Prev: Backup Names, Up: Backup + +Automatic Deletion of Backups +............................. + + To prevent unlimited consumption of disk space, Emacs can delete +numbered backup versions automatically. Generally Emacs keeps the +first few backups and the latest few backups, deleting any in between. +This happens every time a new backup is made. The two variables that +control the deletion are `kept-old-versions' and `kept-new-versions'. +Their values are, respectively the number of oldest (lowest-numbered) +backups to keep and the number of newest (highest-numbered) ones to +keep, each time a new backup is made. The values are used just after a +new backup version is made; that newly made backup is included in the +count in `kept-new-versions'. By default, both variables are 2. + + If `trim-versions-without-asking' is non-`nil', excess middle +versions are deleted without notification. If it is `nil', the +default, you are asked whether the excess middle versions should really +be deleted. + + You can also use Dired's `.' (Period) command to delete old versions. +*Note Dired::. + diff --git a/info/xemacs.info-7 b/info/xemacs.info-7 new file mode 100644 index 0000000..b085ba1 --- /dev/null +++ b/info/xemacs.info-7 @@ -0,0 +1,1138 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Backup Copying, Prev: Backup Deletion, Up: Backup + +Copying vs. Renaming +.................... + + You can make backup files by copying the old file or by renaming it. +This makes a difference when the old file has multiple names. If you +rename the old file into the backup file, the alternate names become +names for the backup file. If you copy the old file instead, the +alternate names remain names for the file that you are editing, and the +contents accessed by those names will be the new contents. + + How you make a backup file may also affect the file's owner and +group. If you use copying, they do not change. If renaming is used, +you become the file's owner, and the file's group becomes the default +(different operating systems have different defaults for the group). + + Having the owner change is usually a good idea, because then the +owner is always the person who last edited the file. Occasionally +there is a file whose owner should not change. Since most files should +change owners, it is a good idea to use local variable lists to set +`backup-by-copying-when-mismatch' for the special cases where the owner +should not change (*note File Variables::.). + + Three variables control the choice of renaming or copying. +Normally, renaming is done. If the variable `backup-by-copying' is +non-`nil', copying is used. Otherwise, if the variable +`backup-by-copying-when-linked' is non-`nil', copying is done for files +that have multiple names, but renaming may still be done when the file +being edited has only one name. If the variable +`backup-by-copying-when-mismatch' is non-`nil', copying is done if +renaming would cause the file's owner or group to change. + + +File: xemacs.info, Node: Interlocking, Prev: Backup, Up: Saving + +Protection Against Simultaneous Editing +--------------------------------------- + + Simultaneous editing occurs when two users visit the same file, both +make changes, and both save their changes. If no one was informed that +this was happening, and you saved first, you would later find that your +changes were lost. On some systems, Emacs notices immediately when the +second user starts to change a file already being edited, and issues a +warning. When this is not possible, or if the second user has started +to change the file despite the warning, Emacs checks when the file is +saved, and issues a second warning when a user is about to overwrite a +file containing another user's changes. If you are the user editing the +file, you can take corrective action at this point and prevent actual +loss of work. + + When you make the first modification in an Emacs buffer that is +visiting a file, Emacs records that you have locked the file. (It does +this by writing another file in a directory reserved for this purpose.) +The lock is removed when you save the changes. The idea is that the +file is locked whenever the buffer is modified. If you begin to modify +the buffer while the visited file is locked by someone else, this +constitutes a collision, and Emacs asks you what to do. It does this +by calling the Lisp function `ask-user-about-lock', which you can +redefine to customize what it does. The standard definition of this +function asks you a question and accepts three possible answers: + +`s' + Steal the lock. Whoever was already changing the file loses the + lock, and you get the lock. + +`p' + Proceed. Go ahead and edit the file despite its being locked by + someone else. + +`q' + Quit. This causes an error (`file-locked') and the modification + you were trying to make in the buffer does not actually take place. + + Note that locking works on the basis of a file name; if a file has +multiple names, Emacs does not realize that the two names are the same +file and cannot prevent two users from editing it simultaneously under +different names. However, basing locking on names means that Emacs can +interlock the editing of new files that do not really exist until they +are saved. + + Some systems are not configured to allow Emacs to make locks. On +these systems, Emacs cannot detect trouble in advance, but it can still +detect it in time to prevent you from overwriting someone else's +changes. + + Every time Emacs saves a buffer, it first checks the +last-modification date of the existing file on disk to see that it has +not changed since the file was last visited or saved. If the date does +not match, it implies that changes were made in the file in some other +way, and these changes are about to be lost if Emacs actually does +save. To prevent this, Emacs prints a warning message and asks for +confirmation before saving. Occasionally you will know why the file +was changed and know that it does not matter; then you can answer `yes' +and proceed. Otherwise, you should cancel the save with `C-g' and +investigate the situation. + + The first thing you should do when notified that simultaneous editing +has already taken place is to list the directory with `C-u C-x C-d' +(*note Directory Listing: ListDir.). This will show the file's current +author. You should attempt to contact that person and ask him not to +continue editing. Often the next step is to save the contents of your +Emacs buffer under a different name, and use `diff' to compare the two +files. + + Simultaneous editing checks are also made when you visit a file that +is already visited with `C-x C-f' and when you start to modify a file. +This is not strictly necessary, but it is useful to find out about such +a problem as early as possible, when corrective action takes less work. + + Another way to protect your file is to set the read, write, and +executable permissions for the file. Use the function +`set-default-file-modes' to set the UNIX `umask' value to the NMASK +argument. The `umask' value is the default protection mode for new +files. + + +File: xemacs.info, Node: Reverting, Next: Auto Save, Prev: Saving, Up: Files + +Reverting a Buffer +================== + + If you have made extensive changes to a file and then change your +mind about them, you can get rid of all changes by reading in the +previous version of the file. To do this, use `M-x revert-buffer', +which operates on the current buffer. Since reverting a buffer can +result in very extensive changes, you must confirm it with `yes'. + + If the current buffer has been auto-saved more recently than it has +been saved explicitly, `revert-buffer' offers to read the auto save file +instead of the visited file (*note Auto Save::.). Emacs asks you about +the auto-save file before the request for confirmation of the +`revert-buffer' operation, and demands `y' or `n' as an answer. If you +have started to type `yes' for confirmation without realizing that the +auto-save question was going to be asked, the `y' will answer that +question, but the `es' will not be valid confirmation. This gives you +a chance to cancel the operation with `C-g' and try again with the +answers you really intend. + + `revert-buffer' keeps point at the same distance (measured in +characters) from the beginning of the file. If the file was edited only +slightly, you will be at approximately the same piece of text after +reverting as before. If you have made more extensive changes, the +value of point in the old file may bring you to a totally different +piece of text than your last editing point. + + A buffer reverted from its visited file is marked "not modified" +until you make a change. + + Some kinds of buffers whose contents reflect data bases other than +files, such as Dired buffers, can also be reverted. For them, +reverting means recalculating their contents from the appropriate data. +Buffers created randomly with `C-x b' cannot be reverted; +`revert-buffer' reports an error when asked to do so. + + +File: xemacs.info, Node: Auto Save, Next: Version Control, Prev: Reverting, Up: Files + +Auto-Saving: Protection Against Disasters +========================================= + + Emacs saves all the visited files from time to time (based on +counting your keystrokes) without being asked. This is called +"auto-saving". It prevents you from losing more than a limited amount +of work if the system crashes. + + When Emacs determines it is time for auto-saving, each buffer is +considered and is auto-saved if auto-saving is turned on for it and it +has changed since the last time it was auto-saved. If any auto-saving +is done, the message `Auto-saving...' is displayed in the echo area +until auto-saving is finished. Errors occurring during auto-saving are +caught so that they do not interfere with the execution of commands you +have been typing. + +* Menu: + +* Files: Auto Save Files. +* Control: Auto Save Control. +* Recover:: Recovering text from auto-save files. + + +File: xemacs.info, Node: Auto Save Files, Next: Auto Save Control, Prev: Auto Save, Up: Auto Save + +Auto-Save Files +--------------- + + Auto-saving does not normally write to the files you visited, because +it can be undesirable to save a program that is in an inconsistent +state when you have made only half of a planned change. Instead, +auto-saving is done in a different file called the "auto-save file", +and the visited file is changed only when you save explicitly, for +example, with `C-x C-s'. + + Normally, the name of the auto-save file is generated by appending +`#' to the front and back of the visited file name. Thus, a buffer +visiting file `foo.c' would be auto-saved in a file `#foo.c#'. Most +buffers that are not visiting files are auto-saved only if you request +it explicitly; when they are auto-saved, the auto-save file name is +generated by appending `#%' to the front and `#' to the back of buffer +name. For example, the `*mail*' buffer in which you compose messages +to be sent is auto-saved in a file named `#%*mail*#'. Names of +auto-save files are generated this way unless you customize the +functions `make-auto-save-file-name' and `auto-save-file-name-p' to do +something different. The file name to be used for auto-saving a buffer +is calculated at the time auto-saving is turned on in that buffer. + + If you want auto-saving to be done in the visited file, set the +variable `auto-save-visited-file-name' to be non-`nil'. In this mode, +there is really no difference between auto-saving and explicit saving. + + Emacs deletes a buffer's auto-save file when you explicitly save the +buffer. To inhibit the deletion, set the variable +`delete-auto-save-files' to `nil'. Changing the visited file name with +`C-x C-w' or `set-visited-file-name' renames any auto-save file to +correspond to the new visited name. + + +File: xemacs.info, Node: Auto Save Control, Next: Recover, Prev: Auto Save Files, Up: Auto Save + +Controlling Auto-Saving +----------------------- + + Each time you visit a file, auto-saving is turned on for that file's +buffer if the variable `auto-save-default' is non-`nil' (but not in +batch mode; *note Entering Emacs::.). The default for this variable is +`t', so Emacs auto-saves buffers that visit files by default. You can +use the command `M-x auto-save-mode' to turn auto-saving for a buffer +on or off. Like other minor mode commands, `M-x auto-save-mode' turns +auto-saving on with a positive argument, off with a zero or negative +argument; with no argument, it toggles. + + Emacs performs auto-saving periodically based on counting how many +characters you have typed since the last time auto-saving happened. The +variable `auto-save-interval' specifies the number of characters +between auto-saves. By default, it is 300. Emacs also auto-saves +whenever you call the function `do-auto-save'. + + Emacs also does auto-saving whenever it gets a fatal error. This +includes killing the Emacs job with a shell command such as `kill +-emacs', or disconnecting a phone line or network connection. + + You can set the number of seconds of idle time before an auto-save is +done. Setting the value of the variable `auto-save-timeout' to zero or +`nil' will disable auto-saving due to idleness. + + The actual amount of idle time between auto-saves is logarithmically +related to the size of the current buffer. This variable is the number +of seconds after which an auto-save will happen when the current buffer +is 50k or less; the timeout will be 2 1/4 times this in a 200k buffer, 3 +3/4 times this in a 1000k buffer, and 4 1/2 times this in a 2000k +buffer. + + For this variable to have any effect, you must do `(require 'timer)'. + + +File: xemacs.info, Node: Recover, Prev: Auto Save Control, Up: Auto Save + +Recovering Data from Auto-Saves +------------------------------- + + If you want to use the contents of an auto-save file to recover from +a loss of data, use the command `M-x recover-file FILE '. +Emacs visits FILE and then (after your confirmation) restores the +contents from the auto-save file `#FILE#'. You can then save the file +with `C-x C-s' to put the recovered text into FILE itself. For +example, to recover file `foo.c' from its auto-save file `#foo.c#', do: + + M-x recover-file foo.c + C-x C-s + + Before asking for confirmation, `M-x recover-file' displays a +directory listing describing the specified file and the auto-save file, +so you can compare their sizes and dates. If the auto-save file is +older, `M-x recover-file' does not offer to read it. + + Auto-saving is disabled by `M-x recover-file' because using this +command implies that the auto-save file contains valuable data from a +past session. If you save the data in the visited file and then go on +to make new changes, turn auto-saving back on with `M-x auto-save-mode'. + + +File: xemacs.info, Node: Version Control, Next: ListDir, Prev: Auto Save, Up: Files + +Version Control +=============== + + "Version control systems" are packages that can record multiple +versions of a source file, usually storing the unchanged parts of the +file just once. Version control systems also record history information +such as the creation time of each version, who created it, and a +description of what was changed in that version. + + The GNU project recommends the version control system known as RCS, +which is free software and available from the Free Software Foundation. +Emacs supports use of either RCS or SCCS (a proprietary, but widely +used, version control system that is not quite as powerful as RCS) +through a facility called VC. The same Emacs commands work with either +RCS or SCCS, so you hardly have to know which one of them you are using. + +* Menu: + +* Concepts of VC:: Basic version control information; + checking files in and out. +* Editing with VC:: Commands for editing a file maintained + with version control. +* Variables for Check-in/out:: Variables that affect the commands used + to check files in or out. +* Log Entries:: Logging your changes. +* Change Logs and VC:: Generating a change log file from log + entries. +* Old Versions:: Examining and comparing old versions. +* VC Status:: Commands to view the VC status of files and + look at log entries. +* Renaming and VC:: A command to rename both the source and + master file correctly. +* Snapshots:: How to make and use snapshots, a set of + file versions that can be treated as a unit. +* Version Headers:: Inserting version control headers into + working files. + + +File: xemacs.info, Node: Concepts of VC, Next: Editing with VC, Prev: Version Control, Up: Version Control + +Concepts of Version Control +--------------------------- + + When a file is under version control, we also say that it is +"registered" in the version control system. Each registered file has a +corresponding "master file" which represents the file's present state +plus its change history, so that you can reconstruct from it either the +current version or any specified earlier version. Usually the master +file also records a "log entry" for each version describing what was +changed in that version. + + The file that is maintained under version control is sometimes called +the "work file" corresponding to its master file. + + To examine a file, you "check it out". This extracts a version of +the source file (typically, the most recent) from the master file. If +you want to edit the file, you must check it out "locked". Only one +user can do this at a time for any given source file. (This kind of +locking is completely unrelated to the locking that Emacs uses to +detect simultaneous editing of a file.) + + When you are done with your editing, you must "check in" the new +version. This records the new version in the master file, and unlocks +the source file so that other people can lock it and thus modify it. + + Checkin and checkout are the basic operations of version control. +You can do both of them with a single Emacs command: `C-x C-q' +(`vc-toggle-read-only'). + + A "snapshot" is a coherent collection of versions of the various +files that make up a program. *Note Snapshots::. + + +File: xemacs.info, Node: Editing with VC, Next: Variables for Check-in/out, Prev: Concepts of VC, Up: Version Control + +Editing with Version Control +---------------------------- + + When you visit a file that is maintained using version control, the +mode line displays `RCS' or `SCCS' to inform you that version control +is in use, and also (in case you care) which low-level system the file +is actually stored in. Normally, such a source file is read-only, and +the mode line indicates this with `%%'. With RCS, the mode line also +indicates the number of the head version, which is normally also the +version you are looking at. + + These are the commands for editing a file maintained with version +control: + +`C-x C-q' + Check the visited file in or out. + +`C-x v u' + Revert the buffer and the file to the last checked in version. + +`C-x v c' + Remove the last-entered change from the master for the visited + file. This undoes your last check-in. + +`C-x v i' + Register the visited file in version control. + +(`C-x v' is the prefix key for version control commands; all of these +commands except for `C-x C-q' start with `C-x v'.) + + When you want to modify a file maintained with version control, type +`C-x C-q' (`vc-toggle-read-only'). This "checks out" the file, and +tells RCS or SCCS to lock the file. This means making the file +writable for you (but not for anyone else). + + When you are finished editing the file, type `C-x C-q' again. When +used on a file that is checked out, this command checks the file in. +But check-in does not start immediately; first, you must enter the "log +entry"--a description of the changes in the new version. `C-x C-q' +pops up a buffer for you to enter this in. When you are finished +typing in the log entry, type `C-c C-c' to terminate it; this is when +actual check-in takes place. + + Once you have checked in your changes, the file is unlocked, so that +other users can lock it and modify it. + + Emacs does not save backup files for source files that are maintained +with version control. If you want to make backup files despite version +control, set the variable `vc-make-backup-files' to a non-`nil' value. + + Normally the work file exists all the time, whether it is locked or +not. If you set `vc-keep-workfiles' to `nil', then checking in a new +version with `C-x C-q' deletes the work file; but any attempt to visit +the file with Emacs creates it again. + + It is not impossible to lock a file that someone else has locked. If +you try to check out a file that is locked, `C-x C-q' asks you whether +you want to "steal the lock." If you say yes, the file becomes locked +by you, but a message is sent to the person who had formerly locked the +file, to inform him of what has happened. The mode line indicates that +a file is locked by someone else by displaying the login name of that +person, before the version number. + + If you want to discard your current set of changes and revert to the +last version checked in, use `C-x v u' (`vc-revert-buffer'). This +cancels your last check-out, leaving the file unlocked. If you want to +make a different set of changes, you must first check the file out +again. `C-x v u' requires confirmation, unless it sees that you +haven't made any changes since the last checked-in version. + + `C-x v u' is also the command to use if you lock a file and then +don't actually change it. + + You can cancel a change after checking it in, with `C-x v c' +(`vc-cancel-version'). This command discards all record of the most +recent checked in version, so be careful about using it. It requires +confirmation with `yes'. By default, `C-x v c' reverts your workfile +and buffer to the previous version (the one that precedes the version +that is deleted), but you can prevent the reversion by giving the +command a prefix argument. Then the buffer does not change. + + This command with a prefix argument is useful when you have checked +in a change and then discover a trivial error in it; you can cancel the +erroneous check-in, fix the error, and repeat the check-in. + + Be careful when invoking `C-x v c', as it is easy to throw away a +lot of work with it. To help you be careful, this command always +requires confirmation with `yes'. + + You can register the visited file for version control using +`C-x v i' (`vc-register'). If the variable `vc-default-back-end' is +non-`nil', it specifies which version control system to use; otherwise, +this uses RCS if it is installed on your system and SCCS if not. After +`C-x v i', the file is unlocked and read-only. Type `C-x C-q' if you +wish to edit it. + + By default, the initial version number is 1.1. If you want to use a +different number, give `C-x v i' a prefix argument; then it reads the +initial version number using the minibuffer. + + If `vc-initial-comment' is non-`nil', `C-x v i' reads an initial +comment (much like a log entry) to describe the purpose of this source +file. + + To specify the version number for a subsequent checkin, use the +command `C-u C-x v v'. `C-x v v' (`vc-next-action') is the command +that `C-x C-q' uses to do the "real work" when the visited file uses +version control. When used for checkin, and given a prefix argument, +it reads the version number with the minibuffer. + + +File: xemacs.info, Node: Variables for Check-in/out, Next: Log Entries, Prev: Editing with VC, Up: Version Control + +Variables Affecting Check-in and Check-out +------------------------------------------ + + If `vc-suppress-confirm' is non-`nil', then `C-x C-q' and `C-x v i' +can save the current buffer without asking, and `C-x v u' also operates +without asking for confirmation. (This variable does not affect `C-x v +c'; that is so drastic that it should always ask for confirmation.) + + VC mode does much of its work by running the shell commands for RCS +and SCCS. If `vc-command-messages' is non-`nil', VC displays messages +to indicate which shell commands it runs, and additional messages when +the commands finish. + + Normally, VC assumes that it can deduce the locked/unlocked state of +files by looking at the file permissions of the work file; this is +fast. However, if the `RCS' or `SCCS' subdirectory is actually a +symbolic link, then VC does not trust the file permissions to reflect +this status. + + You can specify the criterion for whether to trust the file +permissions by setting the variable `vc-mistrust-permissions'. Its +value may be `t' (always mistrust the file permissions and check the +master file), `nil' (always trust the file permissions), or a function +of one argument which makes the decision. The argument is the directory +name of the `RCS' or `SCCS' subdirectory. A non-`nil' value from the +function says to mistrust the file permissions. + + If you find that the file permissions of work files are changed +erroneously, set `vc-mistrust-permissions' to `t'. Then VC always +checks the master file to determine the file's status. + + You can specify additional directories to search for version control +programs by setting the variable `vc-path'. These directories are +searched before the usual search path. The proper result usually +happens automatically. + + +File: xemacs.info, Node: Log Entries, Next: Change Logs and VC, Prev: Variables for Check-in/out, Up: Version Control + +Log Entries +----------- + + When you're editing an initial comment or log entry for inclusion in +a master file, finish your entry by typing `C-c C-c'. + +`C-c C-c' + Finish the comment edit normally (`vc-finish-logentry'). This + finishes check-in. + + To abort check-in, just don't type `C-c C-c' in that buffer. You +can switch buffers and do other editing. As long as you don't try to +check in another file, the entry you were editing remains in its +buffer, and you can go back to that buffer at any time to complete the +check-in. + + If you change several source files for the same reason, it is often +convenient to specify the same log entry for many of the files. To do +this, use the history of previous log entries. The commands `M-n', +`M-p', `M-s' and `M-r' for doing this work just like the minibuffer +history commands (except that these versions are used outside the +minibuffer). + + Each time you check in a file, the log entry buffer is put into VC +Log mode, which involves running two hooks: `text-mode-hook' and +`vc-log-mode-hook'. + + +File: xemacs.info, Node: Change Logs and VC, Next: Old Versions, Prev: Log Entries, Up: Version Control + +Change Logs and VC +------------------ + + If you use RCS for a program and also maintain a change log file for +it (*note Change Log::.), you can generate change log entries +automatically from the version control log entries: + +`C-x v a' + Visit the current directory's change log file and create new + entries for versions checked in since the most recent entry in the + change log file (`vc-update-change-log'). + + This command works with RCS only; it does not work with SCCS. + + For example, suppose the first line of `ChangeLog' is dated 10 April +1992, and that the only check-in since then was by Nathaniel Bowditch +to `rcs2log' on 8 May 1992 with log text `Ignore log messages that +start with `#'.'. Then `C-x v a' visits `ChangeLog' and inserts text +like this: + + Fri May 8 21:45:00 1992 Nathaniel Bowditch (nat@apn.org) + + * rcs2log: Ignore log messages that start with `#'. + +You can then edit the new change log entry further as you wish. + + Normally, the log entry for file `foo' is displayed as `* foo: TEXT +OF LOG ENTRY'. The `:' after `foo' is omitted if the text of the log +entry starts with `(FUNCTIONNAME): '. For example, if the log entry +for `vc.el' is `(vc-do-command): Check call-process status.', then the +text in `ChangeLog' looks like this: + + Wed May 6 10:53:00 1992 Nathaniel Bowditch (nat@apn.org) + + * vc.el (vc-do-command): Check call-process status. + + When `C-x v a' adds several change log entries at once, it groups +related log entries together if they all are checked in by the same +author at nearly the same time. If the log entries for several such +files all have the same text, it coalesces them into a single entry. +For example, suppose the most recent checkins have the following log +entries: + +For `vc.texinfo': + Fix expansion typos. +For `vc.el': + Don't call expand-file-name. +For `vc-hooks.el': + Don't call expand-file-name. + + They appear like this in `ChangeLog': + + Wed Apr 1 08:57:59 1992 Nathaniel Bowditch (nat@apn.org) + + * vc.texinfo: Fix expansion typos. + + * vc.el, vc-hooks.el: Don't call expand-file-name. + + Normally, `C-x v a' separates log entries by a blank line, but you +can mark several related log entries to be clumped together (without an +intervening blank line) by starting the text of each related log entry +with a label of the form `{CLUMPNAME} '. The label itself is not +copied to `ChangeLog'. For example, suppose the log entries are: + +For `vc.texinfo': + {expand} Fix expansion typos. +For `vc.el': + {expand} Don't call expand-file-name. +For `vc-hooks.el': + {expand} Don't call expand-file-name. + +Then the text in `ChangeLog' looks like this: + + Wed Apr 1 08:57:59 1992 Nathaniel Bowditch (nat@apn.org) + + * vc.texinfo: Fix expansion typos. + * vc.el, vc-hooks.el: Don't call expand-file-name. + + A log entry whose text begins with `#' is not copied to `ChangeLog'. +For example, if you merely fix some misspellings in comments, you can +log the change with an entry beginning with `#' to avoid putting such +trivia into `ChangeLog'. + + +File: xemacs.info, Node: Old Versions, Next: VC Status, Prev: Change Logs and VC, Up: Version Control + +Examining And Comparing Old Versions +------------------------------------ + +`C-x v ~ VERSION ' + Examine version VERSION of the visited file, in a buffer of its + own (`vc-version-other-window'). + +`C-x v =' + Compare the current buffer contents with the latest checked-in + version of the file. + +`C-u C-x v = FILE OLDVERS NEWVERS ' + Compare the specified two versions of FILE. + + You can examine any version of a file by first visiting it, and then +using `C-x v ~ VERSION ' (`vc-version-other-window'). This puts +the text of version VERSION in a file named `FILENAME.~VERSION~', then +visits it in a separate window. + + To compare two versions of a file, use the command `C-x v =' +(`vc-diff'). + + Plain `C-x v =' compares the current buffer contents (saving them in +the file if necessary) with the last checked-in version of the file. +With a prefix argument, `C-x v =' reads a file name and two version +numbers, then compares those versions of the specified file. + + If you supply a directory name instead of the name of a work file, +this command compares the two specified versions of all registered files +in that directory and its subdirectories. You can also specify a +snapshot name (*note Snapshots::.) instead of one or both version +numbers. + + You can specify a checked-in version by its number; you can specify +the most recent checked-in version with an empty version number. + + This command works by running the `vcdiff' utility, getting the +options from the variable `diff-switches'. It displays the output in a +special buffer in another window. Unlike the `M-x diff' command, `C-x +v =' does not try to find the changes in the old and new versions. +This is because one or both versions normally do not exist as files. +They exist only in the records of the master file. *Note Comparing +Files::, for more information about `M-x diff'. + + +File: xemacs.info, Node: VC Status, Next: Renaming and VC, Prev: Old Versions, Up: Version Control + +VC Status Commands +------------------ + + To view the detailed version control status and history of a file, +type `C-x v l' (`vc-print-log'). It displays the history of changes to +the current file, including the text of the log entries. The output +appears in a separate window. + + When you are working on a large program, it's often useful to find +all the files that are currently locked, or all the files maintained in +version control at all. You can use `C-x v d' (`vc-directory') to show +all the locked files in or beneath the current directory. This +includes all files that are locked by any user. `C-u C-x v d' lists +all files in or beneath the current directory that are maintained with +version control. + + The list of files is displayed as a buffer that uses an augmented +Dired mode. The names of the users locking various files are shown (in +parentheses) in place of the owner and group. All the normal Dired +commands work in this buffer. Most interactive VC commands work also, +and apply to the file name on the current line. + + The `C-x v v' command (`vc-next-action'), when used in the augmented +Dired buffer, operates on all the marked files (or the file on the +current line). If it operates on more than one file, it handles each +file according to its current state; thus, it may check out one file +and check in another (because it is already checked out). If it has to +check in any files, it reads a single log entry, then uses that text +for all the files being checked in. This can be convenient for +registering or checking in several files at once, as part of the same +change. + + +File: xemacs.info, Node: Renaming and VC, Next: Snapshots, Prev: VC Status, Up: Version Control + +Renaming VC Work Files and Master Files +--------------------------------------- + + When you rename a registered file, you must also rename its master +file correspondingly to get proper results. Use `vc-rename-file' to +rename the source file as you specify, and rename its master file +accordingly. It also updates any snapshots (*note Snapshots::.) that +mention the file, so that they use the new name; despite this, the +snapshot thus modified may not completely work (*note Snapshot +Caveats::.). + + You cannot use `vc-rename-file' on a file that is locked by someone +else. + + +File: xemacs.info, Node: Snapshots, Next: Version Headers, Prev: Renaming and VC, Up: Version Control + +Snapshots +--------- + + A "snapshot" is a named set of file versions (one for each +registered file) that you can treat as a unit. One important kind of +snapshot is a "release", a (theoretically) stable version of the system +that is ready for distribution to users. + +* Menu: + +* Making Snapshots:: The snapshot facilities. +* Snapshot Caveats:: Things to be careful of when using snapshots. + + +File: xemacs.info, Node: Making Snapshots, Next: Snapshot Caveats, Prev: Snapshots, Up: Snapshots + +Making and Using Snapshots +.......................... + + There are two basic commands for snapshots; one makes a snapshot +with a given name, the other retrieves a named snapshot. + +`C-x v s NAME ' + Define the last saved versions of every registered file in or + under the current directory as a snapshot named NAME + (`vc-create-snapshot'). + +`C-x v r NAME ' + Check out all registered files at or below the current directory + level using whatever versions correspond to the snapshot NAME + (`vc-retrieve-snapshot'). + + This command reports an error if any files are locked at or below + the current directory, without changing anything; this is to avoid + overwriting work in progress. + + A snapshot uses a very small amount of resources--just enough to +record the list of file names and which version belongs to the +snapshot. Thus, you need not hesitate to create snapshots whenever +they are useful. + + You can give a snapshot name as an argument to `C-x v =' or `C-x v +~' (*note Old Versions::.). Thus, you can use it to compare a snapshot +against the current files, or two snapshots against each other, or a +snapshot against a named version. + + +File: xemacs.info, Node: Snapshot Caveats, Prev: Making Snapshots, Up: Snapshots + +Snapshot Caveats +................ + + VC's snapshot facilities are modeled on RCS's named-configuration +support. They use RCS's native facilities for this, so under VC +snapshots made using RCS are visible even when you bypass VC. + + For SCCS, VC implements snapshots itself. The files it uses contain +name/file/version-number triples. These snapshots are visible only +through VC. + + A snapshot is a set of checked-in versions. So make sure that all +the files are checked in and not locked when you make a snapshot. + + File renaming and deletion can create some difficulties with +snapshots. This is not a VC-specific problem, but a general design +issue in version control systems that no one has solved very well yet. + + If you rename a registered file, you need to rename its master along +with it (the command `vc-rename-file' does this automatically). If you +are using SCCS, you must also update the records of the snapshot, to +mention the file by its new name (`vc-rename-file' does this, too). An +old snapshot that refers to a master file that no longer exists under +the recorded name is invalid; VC can no longer retrieve it. It would +be beyond the scope of this manual to explain enough about RCS and SCCS +to explain how to update the snapshots by hand. + + Using `vc-rename-file' makes the snapshot remain valid for +retrieval, but it does not solve all problems. For example, some of the +files in the program probably refer to others by name. At the very +least, the makefile probably mentions the file that you renamed. If you +retrieve an old snapshot, the renamed file is retrieved under its new +name, which is not the name that the makefile expects. So the program +won't really work as retrieved. + + +File: xemacs.info, Node: Version Headers, Prev: Snapshots, Up: Version Control + +Inserting Version Control Headers +--------------------------------- + + Sometimes it is convenient to put version identification strings +directly into working files. Certain special strings called "version +headers" are replaced in each successive version by the number of that +version. + + You can use the `C-x v h' command (`vc-insert-headers') to insert a +suitable header string. + +`C-x v h' + Insert headers in a file for use with your version-control system. + + The default header string is `\$Id\$' for RCS and `\%W\%' for SCCS. +(The actual strings inserted do not have the backslashes in them. They +were placed in the Info source file so that the strings don't get +interpreted as version-control headers when the Info source files are +maintained under version control.) You can specify other headers to +insert by setting the variable `vc-header-alist'. Its value is a list +of elements of the form `(PROGRAM . STRING)' where PROGRAM is `RCS' or +`SCCS' and STRING is the string to use. + + Instead of a single string, you can specify a list of strings; then +each string in the list is inserted as a separate header on a line of +its own. + + It is often necessary to use "superfluous" backslashes when writing +the strings that you put in this variable. This is to prevent the +string in the constant from being interpreted as a header itself if the +Emacs Lisp file containing it is maintained with version control. + + Each header is inserted surrounded by tabs, inside comment +delimiters, on a new line at the start of the buffer. Normally the +ordinary comment start and comment end strings of the current mode are +used, but for certain modes, there are special comment delimiters for +this purpose; the variable `vc-comment-alist' specifies them. Each +element of this list has the form `(MODE STARTER ENDER)'. + + The variable `vc-static-header-alist' specifies further strings to +add based on the name of the buffer. Its value should be a list of +elements of the form `(REGEXP . FORMAT)'. Whenever REGEXP matches the +buffer name, FORMAT is inserted as part of the header. A header line +is inserted for each element that matches the buffer name, and for each +string specified by `vc-header-alist'. The header line is made by +processing the string from `vc-header-alist' with the format taken from +the element. The default value for `vc-static-header-alist' is: + + (("\\.c$" . + "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\ + #endif /* lint */\n")) + +which specifies insertion of a string of this form: + + + #ifndef lint + static char vcid[] = "STRING"; + #endif /* lint */ + + +File: xemacs.info, Node: ListDir, Next: Comparing Files, Prev: Version Control, Up: Files + +Listing a File Directory +======================== + + Files are organized by Unix into "directories". A "directory +listing" is a list of all the files in a directory. Emacs provides +directory listings in brief format (file names only) and verbose format +(sizes, dates, and authors included). + +`C-x C-d DIR-OR-PATTERN' + Print a brief directory listing (`list-directory'). + +`C-u C-x C-d DIR-OR-PATTERN' + Print a verbose directory listing. + + To print a directory listing, use `C-x C-d' (`list-directory'). +This command prompts in the minibuffer for a file name which is either +a directory to be listed or pattern containing wildcards for the files +to be listed. For example, + + C-x C-d /u2/emacs/etc + +lists all the files in directory `/u2/emacs/etc'. An example of +specifying a file name pattern is: + + C-x C-d /u2/emacs/src/*.c + + Normally, `C-x C-d' prints a brief directory listing containing just +file names. A numeric argument (regardless of value) tells it to print +a verbose listing (like `ls -l'). + + Emacs obtains the text of a directory listing by running `ls' in an +inferior process. Two Emacs variables control the switches passed to +`ls': `list-directory-brief-switches' is a string giving the switches +to use in brief listings (`"-CF"' by default). +`list-directory-verbose-switches' is a string giving the switches to +use in a verbose listing (`"-l"' by default). + + The variable `directory-abbrev-alist' is an alist of abbreviations +for file directories. The list consists of elements of the form `(FROM +. TO)', each meaning to replace `FROM' with `TO' when it appears in a +directory name. This replacement is done when setting up the default +directory of a newly visited file. Every `FROM' string should start +with ``^''. + + Use this feature when you have directories which you normally refer +to via absolute symbolic links. Make `TO' the name of the link, and +`FROM' the name it is linked to. + + +File: xemacs.info, Node: Comparing Files, Next: Dired, Prev: ListDir, Up: Files + +Comparing Files +=============== + + The command `M-x diff' compares two files, displaying the +differences in an Emacs buffer named `*Diff*'. It works by running the +`diff' program, using options taken from the variable `diff-switches', +whose value should be a string. + + The buffer `*Diff*' has Compilation mode as its major mode, so you +can use `C-x `' to visit successive changed locations in the two source +files. You can also move to a particular hunk of changes and type `C-c +C-c' to find the corresponding source location. You can also use the +other special commands of Compilation mode: and for +scrolling, and `M-p' and `M-n' for cursor motion. *Note Compilation::. + + The command `M-x diff-backup' compares a specified file with its most +recent backup. If you specify the name of a backup file, `diff-backup' +compares it with the source file that it is a backup of. + + The command `M-x compare-windows' compares the text in the current +window with that in the next window. Comparison starts at point in each +window. Point moves forward in each window, a character at a time in +each window, until the next characters in the two windows are +different. Then the command is finished. For more information about +windows in Emacs, *Note Windows::. + + With a numeric argument, `compare-windows' ignores changes in +whitespace. If the variable `compare-ignore-case' is non-`nil', it +ignores differences in case as well. + + +File: xemacs.info, Node: Dired, Next: Misc File Ops, Prev: Comparing Files, Up: Files + +Dired, the Directory Editor +=========================== + + Dired makes it easy to delete or visit many of the files in a single +directory at once. It creates an Emacs buffer containing a listing of +the directory. You can use the normal Emacs commands to move around in +this buffer and special Dired commands to operate on the files. + +* Menu: + +* Enter: Dired Enter. How to invoke Dired. +* Edit: Dired Edit. Editing the Dired buffer. +* Deletion: Dired Deletion. Deleting files with Dired. +* Immed: Dired Immed. Other file operations through Dired. + + +File: xemacs.info, Node: Dired Enter, Next: Dired Edit, Prev: Dired, Up: Dired + +Entering Dired +-------------- + + To invoke dired, type `C-x d' or `M-x dired'. The command reads a +directory name or wildcard file name pattern as a minibuffer argument +just like the `list-directory' command, `C-x C-d'. Where `dired' +differs from `list-directory' is in naming the buffer after the +directory name or the wildcard pattern used for the listing, and putting +the buffer into Dired mode so that the special commands of Dired are +available in it. The variable `dired-listing-switches' is a string +used as an argument to `ls' in making the directory; this string must +contain `-l'. + + To display the Dired buffer in another window rather than in the +selected window, use `C-x 4 d' (`dired-other-window)' instead of `C-x +d'. + + +File: xemacs.info, Node: Dired Edit, Next: Dired Deletion, Prev: Dired Enter, Up: Dired + +Editing in Dired +---------------- + + Once the Dired buffer exists, you can switch freely between it and +other Emacs buffers. Whenever the Dired buffer is selected, certain +special commands are provided that operate on files that are listed. +The Dired buffer is "read-only", and inserting text in it is not +useful, so ordinary printing characters such as `d' and `x' are used +for Dired commands. Most Dired commands operate on the file described +by the line that point is on. Some commands perform operations +immediately; others "flag" a file to be operated on later. + + Most Dired commands that operate on the current line's file also +treat a numeric argument as a repeat count, meaning to act on the files +of the next few lines. A negative argument means to operate on the +files of the preceding lines, and leave point on the first of those +lines. + + All the usual Emacs cursor motion commands are available in Dired +buffers. Some special purpose commands are also provided. The keys +`C-n' and `C-p' are redefined so that they try to position the cursor +at the beginning of the filename on the line, rather than at the +beginning of the line. + + For extra convenience, and `n' in Dired are equivalent to +`C-n'. `p' is equivalent to `C-p'. Moving by lines is done so often +in Dired that it deserves to be easy to type. (move up and +unflag) is often useful simply for moving up. + + The `g' command in Dired runs `revert-buffer' to reinitialize the +buffer from the actual disk directory and show any changes made in the +directory by programs other than Dired. All deletion flags in the Dired +buffer are lost when this is done. + + +File: xemacs.info, Node: Dired Deletion, Next: Dired Immed, Prev: Dired Edit, Up: Dired + +Deleting Files With Dired +------------------------- + + The primary use of Dired is to flag files for deletion and then +delete them. + +`d' + Flag this file for deletion. + +`u' + Remove deletion-flag on this line. + +`' + Remove deletion-flag on previous line, moving point to that line. + +`x' + Delete the files that are flagged for deletion. + +`#' + Flag all auto-save files (files whose names start and end with `#') + for deletion (*note Auto Save::.). + +`~' + Flag all backup files (files whose names end with `~') for deletion + (*note Backup::.). + +`. (Period)' + Flag excess numeric backup files for deletion. The oldest and + newest few backup files of any one file are exempt; the middle + ones are flagged. + + You can flag a file for deletion by moving to the line describing the +file and typing `d' or `C-d'. The deletion flag is visible as a `D' at +the beginning of the line. Point is moved to the beginning of the next +line, so that repeated `d' commands flag successive files. + + The files are flagged for deletion rather than deleted immediately to +avoid the danger of deleting a file accidentally. Until you direct +Dired to delete the flagged files, you can remove deletion flags using +the commands `u' and . `u' works just like `d', but removes flags +rather than making flags. moves upward, removing flags; it is +like `u' with numeric argument automatically negated. + + To delete the flagged files, type `x'. This command first displays a +list of all the file names flagged for deletion, and requests +confirmation with `yes'. Once you confirm, all the flagged files are +deleted, and their lines are deleted from the text of the Dired buffer. +The shortened Dired buffer remains selected. If you answer `no' or +quit with `C-g', you return immediately to Dired, with the deletion +flags still present and no files actually deleted. + + The `#', `~', and `.' commands flag many files for deletion, based +on their names. These commands are useful precisely because they do +not actually delete any files; you can remove the deletion flags from +any flagged files that you really wish to keep. + + `#' flags for deletion all files that appear to have been made by +auto-saving (that is, files whose names begin and end with `#'). `~' +flags for deletion all files that appear to have been made as backups +for files that were edited (that is, files whose names end with `~'). + + `.' (Period) flags just some of the backup files for deletion: only +numeric backups that are not among the oldest few nor the newest few +backups of any one file. Normally `dired-kept-versions' (not +`kept-new-versions'; that applies only when saving) specifies the +number of newest versions of each file to keep, and `kept-old-versions' +specifies the number of oldest versions to keep. Period with a +positive numeric argument, as in `C-u 3 .', specifies the number of +newest versions to keep, overriding `dired-kept-versions'. A negative +numeric argument overrides `kept-old-versions', using minus the value +of the argument to specify the number of oldest versions of each file +to keep. + diff --git a/info/xemacs.info-8 b/info/xemacs.info-8 new file mode 100644 index 0000000..5b6078b --- /dev/null +++ b/info/xemacs.info-8 @@ -0,0 +1,1068 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Dired Immed, Prev: Dired Deletion, Up: Dired + +Immediate File Operations in Dired +---------------------------------- + + Some file operations in Dired take place immediately when they are +requested. + +`C' + Copies the file described on the current line. You must supply a + file name to copy to, using the minibuffer. + +`f' + Visits the file described on the current line. It is just like + typing `C-x C-f' and supplying that file name. If the file on + this line is a subdirectory, `f' actually causes Dired to be + invoked on that subdirectory. *Note Visiting::. + +`o' + Like `f', but uses another window to display the file's buffer. + The Dired buffer remains visible in the first window. This is + like using `C-x 4 C-f' to visit the file. *Note Windows::. + +`R' + Renames the file described on the current line. You must supply a + file name to rename to, using the minibuffer. + +`v' + Views the file described on this line using `M-x view-file'. + Viewing a file is like visiting it, but is slanted toward moving + around in the file conveniently and does not allow changing the + file. *Note View File: Misc File Ops. Viewing a file that is a + directory runs Dired on that directory. + + +File: xemacs.info, Node: Misc File Ops, Prev: Dired, Up: Files + +Miscellaneous File Operations +============================= + + Emacs has commands for performing many other operations on files. +All operate on one file; they do not accept wildcard file names. + + You can use the command `M-x add-name-to-file' to add a name to an +existing file without removing the old name. The new name must belong +on the file system that the file is on. + + `M-x append-to-file' adds the text of the region to the end of the +specified file. + + `M-x copy-file' reads the file OLD and writes a new file named NEW +with the same contents. Confirmation is required if a file named NEW +already exists, because copying overwrites the old contents of the file +NEW. + + `M-x delete-file' deletes a specified file, like the `rm' command in +the shell. If you are deleting many files in one directory, it may be +more convenient to use Dired (*note Dired::.). + + `M-x insert-file' inserts a copy of the contents of a specified file +into the current buffer at point, leaving point unchanged before the +contents and the mark after them. *Note Mark::. + + `M-x make-symbolic-link' reads two file names OLD and LINKNAME, and +then creates a symbolic link named LINKNAME and pointing at OLD. +Future attempts to open file LINKNAME will then refer to the file named +OLD at the time the opening is done, or will result in an error if the +name OLD is not in use at that time. Confirmation is required if you +create the link while LINKNAME is in use. Note that not all systems +support symbolic links. + + `M-x rename-file' reads two file names OLD and NEW using the +minibuffer, then renames file OLD as NEW. If a file named NEW already +exists, you must confirm with `yes' or renaming is not done; this is +because renaming causes the previous meaning of the name NEW to be +lost. If OLD and NEW are on different file systems, the file OLD is +copied and deleted. + + `M-x view-file' allows you to scan or read a file by sequential +screenfuls. It reads a file name argument using the minibuffer. After +reading the file into an Emacs buffer, `view-file' reads and displays +one windowful. You can then type to scroll forward one window, +or to scroll backward. Various other commands are provided for +moving around in the file, but none for changing it; type `C-h' while +viewing a file for a list of them. Most commands are the default Emacs +cursor motion commands. To exit from viewing, type `C-c'. + + +File: xemacs.info, Node: Buffers, Next: Windows, Prev: Files, Up: Top + +Using Multiple Buffers +********************** + + Text you are editing in Emacs resides in an object called a +"buffer". Each time you visit a file, Emacs creates a buffer to hold +the file's text. Each time you invoke Dired, Emacs creates a buffer to +hold the directory listing. If you send a message with `C-x m', a +buffer named `*mail*' is used to hold the text of the message. When +you ask for a command's documentation, it appears in a buffer called +`*Help*'. + + At any time, one and only one buffer is "selected". It is also +called the "current buffer". Saying a command operates on "the buffer" +really means that the command operates on the selected buffer, as most +commands do. + + When Emacs creates multiple windows, each window has a chosen buffer +which is displayed there, but at any time only one of the windows is +selected and its chosen buffer is the selected buffer. Each window's +mode line displays the name of the buffer the window is displaying +(*note Windows::.). + + Each buffer has a name which can be of any length but is +case-sensitive. You can select a buffer using its name. Most buffers +are created when you visit files; their names are derived from the +files' names. You can also create an empty buffer with any name you +want. A newly started Emacs has a buffer named `*scratch*' which you +can use for evaluating Lisp expressions in Emacs. + + Each buffer records what file it is visiting, whether it is +modified, and what major mode and minor modes are in effect in it +(*note Major Modes::.). Any Emacs variable can be made "local to" a +particular buffer, meaning its value in that buffer can be different +from the value in other buffers. *Note Locals::. + +* Menu: + +* Select Buffer:: Creating a new buffer or reselecting an old one. +* List Buffers:: Getting a list of buffers that exist. +* Misc Buffer:: Renaming; changing read-onliness; copying text. +* Kill Buffer:: Killing buffers you no longer need. +* Several Buffers:: How to go through the list of all buffers + and operate variously on several of them. + + +File: xemacs.info, Node: Select Buffer, Next: List Buffers, Prev: Buffers, Up: Buffers + +Creating and Selecting Buffers +============================== + +`C-x b BUFFER ' + Select or create a buffer named BUFFER (`switch-to-buffer'). + +`C-x 4 b BUFFER ' + Similar, but select a buffer named BUFFER in another window + (`switch-to-buffer-other-window'). + +`M-x switch-to-other-buffer N' + Switch to the previous buffer. + + To select a buffer named BUFNAME, type `C-x b BUFNAME '. This +is the command `switch-to-buffer' with argument BUFNAME. You can use +completion on an abbreviation for the buffer name you want (*note +Completion::.). An empty argument to `C-x b' specifies the most +recently selected buffer that is not displayed in any window. + + Most buffers are created when you visit files, or use Emacs commands +that display text. You can also create a buffer explicitly by typing +`C-x b BUFNAME ', which creates a new, empty buffer that is not +visiting any file, and selects it for editing. The new buffer's major +mode is determined by the value of `default-major-mode' (*note Major +Modes::.). Buffers not visiting files are usually used for making +notes to yourself. If you try to save one, you are asked for the file +name to use. + + The function `switch-to-buffer-other-frame' is similar to +`switch-to-buffer' except that it creates a new frame in which to +display the selected buffer. + + Use `M-x switch-to-other-buffer' to visit the previous buffer. If +you supply a positive integer N, the Nth most recent buffer is +displayed. If you supply an argument of 0, the current buffer is moved +to the bottom of the buffer stack. + + Note that you can also use `C-x C-f' and any other command for +visiting a file to switch buffers. *Note Visiting::. + + +File: xemacs.info, Node: List Buffers, Next: Misc Buffer, Prev: Select Buffer, Up: Buffers + +Listing Existing Buffers +======================== + +`C-x C-b' + List the existing buffers (`list-buffers'). + + To print a list of all existing buffers, type `C-x C-b'. Each line +in the list shows one buffer's name, major mode, and visited file. A +`*' at the beginning of a line indicates the buffer has been +"modified". If several buffers are modified, it may be time to save +some with `C-x s' (*note Saving::.). A `%' indicates a read-only +buffer. A `.' marks the selected buffer. Here is an example of a +buffer list: + + MR Buffer Size Mode File + -- ------ ---- ---- ---- + .* emacs.tex 383402 Texinfo /u2/emacs/man/emacs.tex + *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/ + 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 + +Note that the buffer `*Help*' was made by a help request; it is not +visiting any file. The buffer `man' was made by Dired on the directory +`/u2/emacs/man/'. + + As you move the mouse over the `*Buffer List*' buffer, the lines are +highlighted. This visual cue indicates that clicking the right mouse +button (`button3') will pop up a menu of commands on the buffer +represented by this line. This menu duplicates most of those commands +which are bound to keys in the `*Buffer List*' buffer. + + +File: xemacs.info, Node: Misc Buffer, Next: Kill Buffer, Prev: List Buffers, Up: Buffers + +Miscellaneous Buffer Operations +=============================== + +`C-x C-q' + Toggle read-only status of buffer (`toggle-read-only'). + +`M-x rename-buffer' + Change the name of the current buffer. + +`M-x view-buffer' + Scroll through a buffer. + + A buffer can be "read-only", which means that commands to change its +text are not allowed. Normally, read-only buffers are created by +subsystems such as Dired and Rmail that have special commands to operate +on the text. Emacs also creates a read-only buffer if you visit a file +that is protected. To make changes in a read-only buffer, use the +command `C-x C-q' (`toggle-read-only'). It makes a read-only buffer +writable, and makes a writable buffer read-only. This works by setting +the variable `buffer-read-only', which has a local value in each buffer +and makes a buffer read-only if its value is non-`nil'. + + `M-x rename-buffer' changes the name of the current buffer, +prompting for the new name in the minibuffer. There is no default. If +you specify a name that is used by a different buffer, an error is +signalled and renaming is not done. + + `M-x view-buffer' is similar to `M-x view-file' (*note Misc File +Ops::.), but it examines an already existing Emacs buffer. View mode +provides convenient commands for scrolling through the buffer but not +for changing it. When you exit View mode, the resulting value of point +remains in effect. + + To copy text from one buffer to another, use the commands `M-x +append-to-buffer' and `M-x insert-buffer'. *Note Accumulating Text::. + + +File: xemacs.info, Node: Kill Buffer, Next: Several Buffers, Prev: Misc Buffer, Up: Buffers + +Killing Buffers +=============== + + After using Emacs for a while, you may accumulate a large number of +buffers and may want to eliminate the ones you no longer need. There +are several commands for doing this. + +`C-x k' + Kill a buffer, specified by name (`kill-buffer'). + +`M-x kill-some-buffers' + Offer to kill each buffer, one by one. + + `C-x k' (`kill-buffer') kills one buffer, whose name you specify in +the minibuffer. If you type just in the minibuffer, the default, +killing the current buffer, is used. If the current buffer is killed, +the buffer that has been selected recently but does not appear in any +window now is selected. If the buffer being killed contains unsaved +changes, you are asked to confirm with `yes' before the buffer is +killed. + + The command `M-x kill-some-buffers' asks about each buffer, one by +one. An answer of `y' means to kill the buffer. Killing the current +buffer or a buffer containing unsaved changes selects a new buffer or +asks for confirmation just like `kill-buffer'. + + +File: xemacs.info, Node: Several Buffers, Prev: Kill Buffer, Up: Buffers + +Operating on Several Buffers +============================ + + The "buffer-menu" facility is like a "Dired for buffers"; it allows +you to request operations on various Emacs buffers by editing a buffer +containing a list of them. You can save buffers, kill them (here +called "deleting" them, for consistency with Dired), or display them. + +`M-x buffer-menu' + Begin editing a buffer listing all Emacs buffers. + + The command `buffer-menu' writes a list of all Emacs buffers into +the buffer `*Buffer List*', and selects that buffer in Buffer Menu +mode. The buffer is read-only. You can only change it using the +special commands described in this section. Most of the commands are +graphic characters. You can use Emacs cursor motion commands in the +`*Buffer List*' buffer. If the cursor is on a line describing a +buffer, the following special commands apply to that buffer: + +`d' + Request to delete (kill) the buffer, then move down. A `D' before + the buffer name on a line indicates a deletion request. Requested + deletions actually take place when you use the `x' command. + +`k' + Synonym for `d'. + +`C-d' + Like `d' but move up afterwards instead of down. + +`s' + Request to save the buffer. An `S' befor the buffer name on a line + indicates the request. Requested saves actually take place when + you use the `x' command. You can request both saving and deletion + for the same buffer. + +`~' + Mark buffer "unmodified". The command `~' does this immediately + when typed. + +`x' + Perform previously requested deletions and saves. + +`u' + Remove any request made for the current line, and move down. + +`' + Move to previous line and remove any request made for that line. + + All commands that add or remove flags to request later operations +also move down a line. They accept a numeric argument as a repeat +count, unless otherwise specified. + + There are also special commands to use the buffer list to select +another buffer, and to specify one or more other buffers for display in +additional windows. + +`1' + Select the buffer in a full-frame window. This command takes + effect immediately. + +`2' + Immediately set up two windows, with this buffer in one and the + buffer selected before `*Buffer List*' in the other. + +`f' + Immediately select the buffer in place of the `*Buffer List*' + buffer. + +`o' + Immediately select the buffer in another window as if by `C-x 4 b', + leaving `*Buffer List*' visible. + +`q' + Immediately select this buffer, and display any buffers previously + flagged with the `m' command in other windows. If there are no + buffers flagged with `m', this command is equivalent to `1'. + +`m' + Flag this buffer to be displayed in another window if the `q' + command is used. The request shows as a `>' at the beginning of + the line. The same buffer may not have both a delete request and a + display request. + + Going back between a `buffer-menu' buffer and other Emacs buffers is +easy. You can, for example, switch from the `*Buffer List*' buffer to +another Emacs buffer, and edit there. You can then reselect the +`buffer-menu' buffer and perform operations already requested, or you +can kill that buffer or pay no further attention to it. All that +`buffer-menu' does directly is create and select a suitable buffer, and +turn on Buffer Menu mode. All the other capabilities of the buffer +menu are implemented by special commands provided in Buffer Menu mode. + + The only difference between `buffer-menu' and `list-buffers' is that +`buffer-menu' selects the `*Buffer List*' buffer and `list-buffers' +does not. If you run `list-buffers' (that is, type `C-x C-b') and +select the buffer list manually, you can use all the commands described +here. + + +File: xemacs.info, Node: Windows, Next: Mule, Prev: Buffers, Up: Top + +Multiple Windows +**************** + + Emacs can split the frame into two or many windows, which can display +parts of different buffers or different parts of one buffer. If you are +running XEmacs under X, that means you can have the X window that +contains the Emacs frame have multiple subwindows. + +* Menu: + +* Basic Window:: Introduction to Emacs windows. +* Split Window:: New windows are made by splitting existing windows. +* Other Window:: Moving to another window or doing something to it. +* Pop Up Window:: Finding a file or buffer in another window. +* Change Window:: Deleting windows and changing their sizes. + + +File: xemacs.info, Node: Basic Window, Next: Split Window, Prev: Windows, Up: Windows + +Concepts of Emacs Windows +========================= + + When Emacs displays multiple windows, each window has one Emacs +buffer designated for display. The same buffer may appear in more than +one window; if it does, any changes in its text are displayed in all +the windows that display it. Windows showing the same buffer can show +different parts of it, because each window has its own value of point. + + At any time, one window is the "selected window"; the buffer +displayed by that window is the current buffer. The cursor shows the +location of point in that window. Each other window has a location of +point as well, but since the terminal has only one cursor, it cannot +show the location of point in the other windows. + + Commands to move point affect the value of point for the selected +Emacs window only. They do not change the value of point in any other +Emacs window, including those showing the same buffer. The same is +true for commands such as `C-x b' to change the selected buffer in the +selected window; they do not affect other windows at all. However, +there are other commands such as `C-x 4 b' that select a different +window and switch buffers in it. Also, all commands that display +information in a window, including (for example) `C-h f' +(`describe-function') and `C-x C-b' (`list-buffers'), work by switching +buffers in a non-selected window without affecting the selected window. + + Each window has its own mode line, which displays the buffer name, +modification status, and major and minor modes of the buffer that is +displayed in the window. *Note Mode Line::, for details on the mode +line. + + +File: xemacs.info, Node: Split Window, Next: Other Window, Prev: Basic Window, Up: Windows + +Splitting Windows +================= + +`C-x 2' + Split the selected window into two windows, one above the other + (`split-window-vertically'). + +`C-x 3' + Split the selected window into two windows positioned side by side + (`split-window-horizontally'). + +`C-x 6' + Save the current window configuration in register REG (a letter). + +`C-x 7' + Restore (make current) the window configuration in register REG (a + letter). Use with a register previously set with `C-x 6'. + + The command `C-x 2' (`split-window-vertically') breaks the selected +window into two windows, one above the other. Both windows start out +displaying the same buffer, with the same value of point. By default +each of the two windows gets half the height of the window that was +split. A numeric argument specifies how many lines to give to the top +window. + + `C-x 3' (`split-window-horizontally') breaks the selected window +into two side-by-side windows. A numeric argument specifies how many +columns to give the one on the left. A line of vertical bars separates +the two windows. Windows that are not the full width of the frame have +truncated mode lines which do not always appear in inverse video, +because Emacs display routines cannot display a region of inverse video +that is only part of a line on the screen. + + When a window is less than the full width, many text lines are too +long to fit. Continuing all those lines might be confusing. Set the +variable `truncate-partial-width-windows' to non-`nil' to force +truncation in all windows less than the full width of the frame, +independent of the buffer and its value for `truncate-lines'. *Note +Continuation Lines::. + + Horizontal scrolling is often used in side-by-side windows. *Note +Display::. + + You can resize a window and store that configuration in a register by +supplying a REGISTER argument to `window-configuration-to-register' +(`C-x 6'). To return to the window configuration established with +`window-configuration-to-register', use `jump-to-register' (`C-x j'). + + +File: xemacs.info, Node: Other Window, Next: Pop Up Window, Prev: Split Window, Up: Windows + +Using Other Windows +=================== + +`C-x o' + Select another window (`other-window'). That is the letter `o', + not zero. + +`M-C-v' + Scroll the next window (`scroll-other-window'). + +`M-x compare-windows' + Find the next place where the text in the selected window does not + match the text in the next window. + +`M-x other-window-any-frame N' + Select the Nth different window on any frame. + + To select a different window, use `C-x o' (`other-window'). That is +an `o', for `other', not a zero. When there are more than two windows, +the command moves through all the windows in a cyclic order, generally +top to bottom and left to right. From the rightmost and bottommost +window, it goes back to the one at the upper left corner. A numeric +argument, N, moves several steps in the cyclic order of windows. A +negative numeric argument moves around the cycle in the opposite order. +If the optional second argument ALL-FRAMES is non-`nil', the function +cycles through all frames. When the minibuffer is active, the +minibuffer is the last window in the cycle; you can switch from the +minibuffer window to one of the other windows, and later switch back +and finish supplying the minibuffer argument that is requested. *Note +Minibuffer Edit::. + + The command `M-x other-window-any-frame' also selects the window N +steps away in the cyclic order. However, unlike `other-window', this +command selects a window on the next or previous frame instead of +wrapping around to the top or bottom of the current frame, when there +are no more windows. + + The usual scrolling commands (*note Display::.) apply to the selected +window only. `M-C-v' (`scroll-other-window') scrolls the window that +`C-x o' would select. Like `C-v', it takes positive and negative +arguments. + + The command `M-x compare-windows' compares the text in the current +window with the text in the next window. Comparison starts at point in +each window. Point moves forward in each window, a character at a time, +until the next set of characters in the two windows are different. +Then the command is finished. + + A prefix argument IGNORE-WHITESPACE means ignore changes in +whitespace. The variable `compare-windows-whitespace' controls how +whitespace is skipped. + + If `compare-ignore-case' is non-`nil', changes in case are also +ignored. + + +File: xemacs.info, Node: Pop Up Window, Next: Change Window, Prev: Other Window, Up: Windows + +Displaying in Another Window +============================ + + `C-x 4' is a prefix key for commands that select another window +(splitting the window if there is only one) and select a buffer in that +window. Different `C-x 4' commands have different ways of finding the +buffer to select. + +`C-x 4 b BUFNAME ' + Select buffer BUFNAME in another window. This runs + `switch-to-buffer-other-window'. + +`C-x 4 f FILENAME ' + Visit file FILENAME and select its buffer in another window. This + runs `find-file-other-window'. *Note Visiting::. + +`C-x 4 d DIRECTORY ' + Select a Dired buffer for directory DIRECTORY in another window. + This runs `dired-other-window'. *Note Dired::. + +`C-x 4 m' + Start composing a mail message in another window. This runs + `mail-other-window', and its same-window version is `C-x m' (*note + Sending Mail::.). + +`C-x 4 .' + Find a tag in the current tag table in another window. This runs + `find-tag-other-window', the multiple-window variant of `M-.' + (*note Tags::.). + + If the variable `display-buffer-function' is non-`nil', its value is +the function to call to handle `display-buffer'. It receives two +arguments, the buffer and a flag that if non-`nil' means that the +currently selected window is not acceptable. Commands such as +`switch-to-buffer-other-window' and `find-file-other-window' work using +this function. + + +File: xemacs.info, Node: Change Window, Prev: Pop Up Window, Up: Windows + +Deleting and Rearranging Windows +================================ + +`C-x 0' + Get rid of the selected window (`delete-window'). That is a zero. + If there is more than one Emacs frame, deleting the sole remaining + window on that frame deletes the frame as well. If the current + frame is the only frame, it is not deleted. + +`C-x 1' + Get rid of all windows except the selected one + (`delete-other-windows'). + +`C-x ^' + Make the selected window taller, at the expense of the other(s) + (`enlarge-window'). + +`C-x }' + Make the selected window wider (`enlarge-window-horizontally'). + + To delete a window, type `C-x 0' (`delete-window'). (That is a +zero.) The space occupied by the deleted window is distributed among +the other active windows (but not the minibuffer window, even if that +is active at the time). Once a window is deleted, its attributes are +forgotten; there is no automatic way to make another window of the same +shape or showing the same buffer. The buffer continues to exist, and +you can select it in any window with `C-x b'. + + `C-x 1' (`delete-other-windows') is more powerful than `C-x 0'; it +deletes all the windows except the selected one (and the minibuffer). +The selected window expands to use the whole frame except for the echo +area. + + To readjust the division of space among existing windows, use `C-x +^' (`enlarge-window'). It makes the currently selected window longer +by one line or as many lines as a numeric argument specifies. With a +negative argument, it makes the selected window smaller. `C-x }' +(`enlarge-window-horizontally') makes the selected window wider by the +specified number of columns. The extra screen space given to a window +comes from one of its neighbors, if that is possible; otherwise, all +the competing windows are shrunk in the same proportion. If this makes +some windows too small, those windows are deleted and their space is +divided up. Minimum window size is specified by the variables +`window-min-height' and `window-min-width'. + + You can also resize windows within a frame by clicking the left mouse +button on a modeline, and dragging. + + Clicking the right button on a mode line pops up a menu of common +window manager operations. This menu contains the following options: + +Delete Window + Remove the window above this modeline from the frame. + +Delete Other Windows + Delete all windows on the frame except for the one above this + modeline. + +Split Window + Split the window above the mode line in half, creating another + window. + +Split Window Horizontally + Split the window above the mode line in half horizontally, so that + there will be two windows side-by-side. + +Balance Windows + Readjust the sizes of all windows on the frame until all windows + have roughly the same number of lines. + + +File: xemacs.info, Node: Mule, Next: Major Modes, Prev: Windows, Up: Top + +World Scripts Support +********************* + + If you compile XEmacs with mule option, it supports a wide variety of +world scripts, including Latin script, as well as Arabic script, +Simplified Chinese script (for mainland of China), Traditional Chinese +script (for Taiwan and Hong-Kong), Greek script, Hebrew script, IPA +symbols, Japanese scripts (Hiragana, Katakana and Kanji), Korean scripts +(Hangul and Hanja) and Cyrillic script (for Beylorussian, Bulgarian, +Russian, Serbian and Ukrainian). These features have been merged from +the modified version of Emacs known as MULE (for "MULti-lingual +Enhancement to GNU Emacs"). + +* Menu: + +* Mule Intro:: Basic concepts of Mule. +* Language Environments:: Setting things up for the language you use. +* Input Methods:: Entering text characters not on your keyboard. +* Select Input Method:: Specifying your choice of input methods. +* Coding Systems:: Character set conversion when you read and + write files, and so on. +* Recognize Coding:: How XEmacs figures out which conversion to use. +* Specify Coding:: Various ways to choose which conversion to use. + + +File: xemacs.info, Node: Mule Intro, Next: Language Environments, Prev: Mule, Up: Mule + +Introduction to world scripts +============================= + + The users of these scripts have established many more-or-less +standard coding systems for storing files. XEmacs translates between +the internal character encoding and various other coding systems when +reading and writing files, when exchanging data with subprocesses, and +(in some cases) in the `C-q' command (see below). + + The command `C-h h' (`view-hello-file') displays the file +`etc/HELLO', which shows how to say "hello" in many languages. This +illustrates various scripts. + + Keyboards, even in the countries where these character sets are used, +generally don't have keys for all the characters in them. So XEmacs +supports various "input methods", typically one for each script or +language, to make it convenient to type them. + + The prefix key `C-x ' is used for commands that pertain to +world scripts, coding systems, and input methods. + + +File: xemacs.info, Node: Language Environments, Next: Input Methods, Prev: Mule Intro, Up: Mule + +Language Environments +===================== + + All supported character sets are supported in XEmacs buffers if it is +compile with mule; there is no need to select a particular language in +order to display its characters in an XEmacs buffer. However, it is +important to select a "language environment" in order to set various +defaults. The language environment really represents a choice of +preferred script (more or less) rather that a choice of language. + + The language environment controls which coding systems to recognize +when reading text (*note Recognize Coding::.). This applies to files, +incoming mail, netnews, and any other text you read into XEmacs. It may +also specify the default coding system to use when you create a file. +Each language environment also specifies a default input method. + + The command to select a language environment is `M-x +set-language-environment'. It makes no difference which buffer is +current when you use this command, because the effects apply globally to +the XEmacs session. The supported language environments include: + + Chinese-BIG5, Chinese-CNS, Chinese-GB, Cyrillic-ISO, English, + Ethiopic, Greek, Japanese, Korean, Latin-1, Latin-2, Latin-3, + Latin-4, Latin-5. + + Some operating systems let you specify the language you are using by +setting locale environment variables. XEmacs handles one common special +case of this: if your locale name for character types contains the +string `8859-N', XEmacs automatically selects the corresponding +language environment. + + To display information about the effects of a certain language +environment LANG-ENV, use the command `C-h L LANG-ENV ' +(`describe-language-environment'). This tells you which languages this +language environment is useful for, and lists the character sets, +coding systems, and input methods that go with it. It also shows some +sample text to illustrate scripts used in this language environment. +By default, this command describes the chosen language environment. + + +File: xemacs.info, Node: Input Methods, Next: Select Input Method, Prev: Language Environments, Up: Mule + +Input Methods +============= + + An "input method" is a kind of character conversion designed +specifically for interactive input. In XEmacs, typically each language +has its own input method; sometimes several languages which use the same +characters can share one input method. A few languages support several +input methods. + + The simplest kind of input method works by mapping ASCII letters into +another alphabet. This is how the Greek and Russian input methods work. + + A more powerful technique is composition: converting sequences of +characters into one letter. Many European input methods use composition +to produce a single non-ASCII letter from a sequence that consists of a +letter followed by accent characters. For example, some methods convert +the sequence `'a' into a single accented letter. + + The input methods for syllabic scripts typically use mapping followed +by composition. The input methods for Thai and Korean work this way. +First, letters are mapped into symbols for particular sounds or tone +marks; then, sequences of these which make up a whole syllable are +mapped into one syllable sign. + + Chinese and Japanese require more complex methods. In Chinese input +methods, first you enter the phonetic spelling of a Chinese word (in +input method `chinese-py', among others), or a sequence of portions of +the character (input methods `chinese-4corner' and `chinese-sw', and +others). Since one phonetic spelling typically corresponds to many +different Chinese characters, you must select one of the alternatives +using special XEmacs commands. Keys such as `C-f', `C-b', `C-n', +`C-p', and digits have special definitions in this situation, used for +selecting among the alternatives. displays a buffer showing all +the possibilities. + + In Japanese input methods, first you input a whole word using +phonetic spelling; then, after the word is in the buffer, XEmacs +converts it into one or more characters using a large dictionary. One +phonetic spelling corresponds to many differently written Japanese +words, so you must select one of them; use `C-n' and `C-p' to cycle +through the alternatives. + + Sometimes it is useful to cut off input method processing so that the +characters you have just entered will not combine with subsequent +characters. For example, in input method `latin-1-postfix', the +sequence `e '' combines to form an `e' with an accent. What if you +want to enter them as separate characters? + + One way is to type the accent twice; that is a special feature for +entering the separate letter and accent. For example, `e ' '' gives +you the two characters `e''. Another way is to type another letter +after the `e'--something that won't combine with that--and immediately +delete it. For example, you could type `e e '' to get separate +`e' and `''. + + Another method, more general but not quite as easy to type, is to use +`C-\ C-\' between two characters to stop them from combining. This is +the command `C-\' (`toggle-input-method') used twice. *Note Select +Input Method::. + + `C-\ C-\' is especially useful inside an incremental search, because +stops waiting for more characters to combine, and starts searching for +what you have already entered. + + The variables `input-method-highlight-flag' and +`input-method-verbose-flag' control how input methods explain what is +happening. If `input-method-highlight-flag' is non-`nil', the partial +sequence is highlighted in the buffer. If `input-method-verbose-flag' +is non-`nil', the list of possible characters to type next is displayed +in the echo area (but not when you are in the minibuffer). + + +File: xemacs.info, Node: Select Input Method, Next: Coding Systems, Prev: Input Methods, Up: Mule + +Selecting an Input Method +========================= + +`C-\' + Enable or disable use of the selected input method. + +`C-x C-\ METHOD ' + Select a new input method for the current buffer. + +`C-h I METHOD ' +`C-h C-\ METHOD ' + Describe the input method METHOD (`describe-input-method'). By + default, it describes the current input method (if any). + +`M-x list-input-methods' + Display a list of all the supported input methods. + + To choose an input method for the current buffer, use `C-x +C-\' (`select-input-method'). This command reads the input method name +with the minibuffer; the name normally starts with the language +environment that it is meant to be used with. The variable +`current-input-method' records which input method is selected. + + Input methods use various sequences of ASCII characters to stand for +non-ASCII characters. Sometimes it is useful to turn off the input +method temporarily. To do this, type `C-\' (`toggle-input-method'). +To reenable the input method, type `C-\' again. + + If you type `C-\' and you have not yet selected an input method, it +prompts for you to specify one. This has the same effect as using `C-x + C-\' to specify an input method. + + Selecting a language environment specifies a default input method for +use in various buffers. When you have a default input method, you can +select it in the current buffer by typing `C-\'. The variable +`default-input-method' specifies the default input method (`nil' means +there is none). + + Some input methods for alphabetic scripts work by (in effect) +remapping the keyboard to emulate various keyboard layouts commonly used +for those scripts. How to do this remapping properly depends on your +actual keyboard layout. To specify which layout your keyboard has, use +the command `M-x quail-set-keyboard-layout'. + + To display a list of all the supported input methods, type `M-x +list-input-methods'. The list gives information about each input +method, including the string that stands for it in the mode line. + + +File: xemacs.info, Node: Coding Systems, Next: Recognize Coding, Prev: Select Input Method, Up: Mule + +Coding Systems +============== + + Users of various languages have established many more-or-less +standard coding systems for representing them. XEmacs does not use +these coding systems internally; instead, it converts from various +coding systems to its own system when reading data, and converts the +internal coding system to other coding systems when writing data. +Conversion is possible in reading or writing files, in sending or +receiving from the terminal, and in exchanging data with subprocesses. + + XEmacs assigns a name to each coding system. Most coding systems are +used for one language, and the name of the coding system starts with the +language name. Some coding systems are used for several languages; +their names usually start with `iso'. There are also special coding +systems `binary' and `no-conversion' which do not convert printing +characters at all. + + In addition to converting various representations of non-ASCII +characters, a coding system can perform end-of-line conversion. XEmacs +handles three different conventions for how to separate lines in a file: +newline, carriage-return linefeed, and just carriage-return. + +`C-h C CODING ' + Describe coding system CODING. + +`C-h C ' + Describe the coding systems currently in use. + +`M-x list-coding-systems' + Display a list of all the supported coding systems. + + The command `C-h C' (`describe-coding-system') displays information +about particular coding systems. You can specify a coding system name +as argument; alternatively, with an empty argument, it describes the +coding systems currently selected for various purposes, both in the +current buffer and as the defaults, and the priority list for +recognizing coding systems (*note Recognize Coding::.). + + To display a list of all the supported coding systems, type `M-x +list-coding-systems'. The list gives information about each coding +system, including the letter that stands for it in the mode line (*note +Mode Line::.). + + Each of the coding systems that appear in this list--except for +`binary', which means no conversion of any kind--specifies how and +whether to convert printing characters, but leaves the choice of +end-of-line conversion to be decided based on the contents of each file. +For example, if the file appears to use carriage-return linefeed between +lines, that end-of-line conversion will be used. + + Each of the listed coding systems has three variants which specify +exactly what to do for end-of-line conversion: + +`...-unix' + Don't do any end-of-line conversion; assume the file uses newline + to separate lines. (This is the convention normally used on Unix + and GNU systems.) + +`...-dos' + Assume the file uses carriage-return linefeed to separate lines, + and do the appropriate conversion. (This is the convention + normally used on Microsoft systems.) + +`...-mac' + Assume the file uses carriage-return to separate lines, and do the + appropriate conversion. (This is the convention normally used on + the Macintosh system.) + + These variant coding systems are omitted from the +`list-coding-systems' display for brevity, since they are entirely +predictable. For example, the coding system `iso-8859-1' has variants +`iso-8859-1-unix', `iso-8859-1-dos' and `iso-8859-1-mac'. + + In contrast, the coding system `binary' specifies no character code +conversion at all--none for non-Latin-1 byte values and none for end of +line. This is useful for reading or writing binary files, tar files, +and other files that must be examined verbatim. + + The easiest way to edit a file with no conversion of any kind is with +the `M-x find-file-literally' command. This uses `binary', and also +suppresses other XEmacs features that might convert the file contents +before you see them. *Note Visiting::. + + The coding system `no-conversion' means that the file contains +non-Latin-1 characters stored with the internal XEmacs encoding. It +handles end-of-line conversion based on the data encountered, and has +the usual three variants to specify the kind of end-of-line conversion. + + +File: xemacs.info, Node: Recognize Coding, Next: Specify Coding, Prev: Coding Systems, Up: Mule + +Recognizing Coding Systems +========================== + + Most of the time, XEmacs can recognize which coding system to use for +any given file-once you have specified your preferences. + + Some coding systems can be recognized or distinguished by which byte +sequences appear in the data. However, there are coding systems that +cannot be distinguished, not even potentially. For example, there is no +way to distinguish between Latin-1 and Latin-2; they use the same byte +values with different meanings. + + XEmacs handles this situation by means of a priority list of coding +systems. Whenever XEmacs reads a file, if you do not specify the coding +system to use, XEmacs checks the data against each coding system, +starting with the first in priority and working down the list, until it +finds a coding system that fits the data. Then it converts the file +contents assuming that they are represented in this coding system. + + The priority list of coding systems depends on the selected language +environment (*note Language Environments::.). For example, if you use +French, you probably want XEmacs to prefer Latin-1 to Latin-2; if you +use Czech, you probably want Latin-2 to be preferred. This is one of +the reasons to specify a language environment. + + However, you can alter the priority list in detail with the command +`M-x prefer-coding-system'. This command reads the name of a coding +system from the minibuffer, and adds it to the front of the priority +list, so that it is preferred to all others. If you use this command +several times, each use adds one element to the front of the priority +list. + + Sometimes a file name indicates which coding system to use for the +file. The variable `file-coding-system-alist' specifies this +correspondence. There is a special function +`modify-coding-system-alist' for adding elements to this list. For +example, to read and write all `.txt' using the coding system +`china-iso-8bit', you can execute this Lisp expression: + + (modify-coding-system-alist 'file "\\.txt\\'" 'china-iso-8bit) + +The first argument should be `file', the second argument should be a +regular expression that determines which files this applies to, and the +third argument says which coding system to use for these files. + + You can specify the coding system for a particular file using the +`-*-...-*-' construct at the beginning of a file, or a local variables +list at the end (*note File Variables::.). You do this by defining a +value for the "variable" named `coding'. XEmacs does not really have a +variable `coding'; instead of setting a variable, it uses the specified +coding system for the file. For example, `-*-mode: C; coding: +iso-8859-1;-*-' specifies use of the iso-8859-1 coding system, as well +as C mode. + + Once XEmacs has chosen a coding system for a buffer, it stores that +coding system in `buffer-file-coding-system' and uses that coding +system, by default, for operations that write from this buffer into a +file. This includes the commands `save-buffer' and `write-region'. If +you want to write files from this buffer using a different coding +system, you can specify a different coding system for the buffer using +`set-buffer-file-coding-system' (*note Specify Coding::.). + diff --git a/info/xemacs.info-9 b/info/xemacs.info-9 new file mode 100644 index 0000000..c7381d1 --- /dev/null +++ b/info/xemacs.info-9 @@ -0,0 +1,1159 @@ +This is Info file ../../info/xemacs.info, produced by Makeinfo version +1.68 from the input file xemacs.texi. + +INFO-DIR-SECTION XEmacs Editor +START-INFO-DIR-ENTRY +* XEmacs: (xemacs). XEmacs Editor. +END-INFO-DIR-ENTRY + + This file documents the XEmacs editor. + + Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C) +1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun +Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation. + + 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 "The GNU Manifesto", "Distribution" 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 the sections entitled "The GNU Manifesto", +"Distribution" and "GNU General Public License" may be included in a +translation approved by the author instead of in the original English. + + +File: xemacs.info, Node: Specify Coding, Prev: Recognize Coding, Up: Mule + +Specifying a Coding System +========================== + + In cases where XEmacs does not automatically choose the right coding +system, you can use these commands to specify one: + +`C-x f CODING ' + Use coding system CODING for the visited file in the current + buffer. + +`C-x c CODING ' + Specify coding system CODING for the immediately following command. + +`C-x k CODING ' + Use coding system CODING for keyboard input. + +`C-x t CODING ' + Use coding system CODING for terminal output. + +`C-x p CODING ' + Use coding system CODING for subprocess input and output in the + current buffer. + + The command `C-x RET f' (`set-buffer-file-coding-system') specifies +the file coding system for the current buffer--in other words, which +coding system to use when saving or rereading the visited file. You +specify which coding system using the minibuffer. Since this command +applies to a file you have already visited, it affects only the way the +file is saved. + + Another way to specify the coding system for a file is when you visit +the file. First use the command `C-x c' +(`universal-coding-system-argument'); this command uses the minibuffer +to read a coding system name. After you exit the minibuffer, the +specified coding system is used for *the immediately following command*. + + So if the immediately following command is `C-x C-f', for example, +it reads the file using that coding system (and records the coding +system for when the file is saved). Or if the immediately following +command is `C-x C-w', it writes the file using that coding system. +Other file commands affected by a specified coding system include `C-x +C-i' and `C-x C-v', as well as the other-window variants of `C-x C-f'. + + In addition, if you run some file input commands with the precedent +`C-u', you can specify coding system to read from minibuffer. So if +the immediately following command is `C-x C-f', for example, it reads +the file using that coding system (and records the coding system for +when the file is saved). Other file commands affected by a specified +coding system include `C-x C-i' and `C-x C-v', as well as the +other-window variants of `C-x C-f'. + + The variable `default-buffer-file-coding-system' specifies the +choice of coding system to use when you create a new file. It applies +when you find a new file, and when you create a buffer and then save it +in a file. Selecting a language environment typically sets this +variable to a good choice of default coding system for that language +environment. + + The command `C-x t' (`set-terminal-coding-system') specifies +the coding system for terminal output. If you specify a character code +for terminal output, all characters output to the terminal are +translated into that coding system. + + This feature is useful for certain character-only terminals built to +support specific languages or character sets--for example, European +terminals that support one of the ISO Latin character sets. + + By default, output to the terminal is not translated at all. + + The command `C-x k' (`set-keyboard-coding-system') specifies +the coding system for keyboard input. Character-code translation of +keyboard input is useful for terminals with keys that send non-ASCII +graphic characters--for example, some terminals designed for ISO +Latin-1 or subsets of it. + + By default, keyboard input is not translated at all. + + There is a similarity between using a coding system translation for +keyboard input, and using an input method: both define sequences of +keyboard input that translate into single characters. However, input +methods are designed to be convenient for interactive use by humans, and +the sequences that are translated are typically sequences of ASCII +printing characters. Coding systems typically translate sequences of +non-graphic characters. + + The command `C-x p' (`set-buffer-process-coding-system') +specifies the coding system for input and output to a subprocess. This +command applies to the current buffer; normally, each subprocess has its +own buffer, and thus you can use this command to specify translation to +and from a particular subprocess by giving the command in the +corresponding buffer. + + By default, process input and output are not translated at all. + + The variable `file-name-coding-system' specifies a coding system to +use for encoding file names. If you set the variable to a coding +system name (as a Lisp symbol or a string), XEmacs encodes file names +using that coding system for all file operations. This makes it +possible to use non-Latin-1 characters in file names--or, at least, +those non-Latin-1 characters which the specified coding system can +encode. By default, this variable is `nil', which implies that you +cannot use non-Latin-1 characters in file names. + + +File: xemacs.info, Node: Major Modes, Next: Indentation, Prev: Mule, Up: Top + +Major Modes +*********** + + Emacs has many different "major modes", each of which customizes +Emacs for editing text of a particular sort. The major modes are +mutually exclusive; at any time, each buffer has one major mode. The +mode line normally contains the name of the current major mode in +parentheses. *Note Mode Line::. + + The least specialized major mode is called "Fundamental mode". This +mode has no mode-specific redefinitions or variable settings. Each +Emacs command behaves in its most general manner, and each option is in +its default state. For editing any specific type of text, such as Lisp +code or English text, you should switch to the appropriate major mode, +such as Lisp mode or Text mode. + + Selecting a major mode changes the meanings of a few keys to become +more specifically adapted to the language being edited. , , +and are changed frequently. In addition, commands which handle +comments use the mode to determine how to delimit comments. Many major +modes redefine the syntactical properties of characters appearing in +the buffer. *Note Syntax::. + + The major modes fall into three major groups. Lisp mode (which has +several variants), C mode, and Muddle mode are for specific programming +languages. Text mode, Nroff mode, TeX mode, and Outline mode are for +editing English text. The remaining major modes are not intended for +use on users' files; they are used in buffers created by Emacs for +specific purposes and include Dired mode for buffers made by Dired +(*note Dired::.), Mail mode for buffers made by `C-x m' (*note Sending +Mail::.), and Shell mode for buffers used for communicating with an +inferior shell process (*note Interactive Shell::.). + + Most programming language major modes specify that only blank lines +separate paragraphs. This is so that the paragraph commands remain +useful. *Note Paragraphs::. They also cause Auto Fill mode to use the +definition of to indent the new lines it creates. This is +because most lines in a program are usually indented. *Note +Indentation::. + +* Menu: + +* Choosing Modes:: How major modes are specified or chosen. + + +File: xemacs.info, Node: Choosing Modes, Prev: Major Modes, Up: Major Modes + +Choosing Major Modes +==================== + + You can select a major mode explicitly for the current buffer, but +most of the time Emacs determines which mode to use based on the file +name or some text in the file. + + Use a `M-x' command to explicitly select a new major mode. Add +`-mode' to the name of a major mode to get the name of a command to +select that mode. For example, to enter Lisp mode, execute `M-x +lisp-mode'. + + When you visit a file, Emacs usually chooses the right major mode +based on the file's name. For example, files whose names end in `.c' +are edited in C mode. The variable `auto-mode-alist' controls the +correspondence between file names and major mode. Its value is a list +in which each element has the form: + + (REGEXP . MODE-FUNCTION) + +For example, one element normally found in the list has the form +`("\\.c$" . c-mode)'. It is responsible for selecting C mode for files +whose names end in `.c'. (Note that `\\' is needed in Lisp syntax to +include a `\' in the string, which is needed to suppress the special +meaning of `.' in regexps.) The only practical way to change this +variable is with Lisp code. + + You can specify which major mode should be used for editing a certain +file by a special sort of text in the first non-blank line of the file. +The mode name should appear in this line both preceded and followed by +`-*-'. Other text may appear on the line as well. For example, + + ;-*-Lisp-*- + +tells Emacs to use Lisp mode. Note how the semicolon is used to make +Lisp treat this line as a comment. Such an explicit specification +overrides any default mode based on the file name. + + Another format of mode specification is: + + -*-Mode: MODENAME;-*- + +which allows other things besides the major mode name to be specified. +However, Emacs does not look for anything except the mode name. + + The major mode can also be specified in a local variables list. +*Note File Variables::. + + When you visit a file that does not specify a major mode to use, or +when you create a new buffer with `C-x b', Emacs uses the major mode +specified by the variable `default-major-mode'. Normally this value is +the symbol `fundamental-mode', which specifies Fundamental mode. If +`default-major-mode' is `nil', the major mode is taken from the +previously selected buffer. + + +File: xemacs.info, Node: Indentation, Next: Text, Prev: Major Modes, Up: Top + +Indentation +*********** + +`' + Indent current line "appropriately" in a mode-dependent fashion. + +`' + Perform followed by (`newline-and-indent'). + +`M-^' + Merge two lines (`delete-indentation'). This would cancel out the + effect of . + +`C-M-o' + Split line at point; text on the line after point becomes a new + line indented to the same column that it now starts in + (`split-line'). + +`M-m' + Move (forward or back) to the first non-blank character on the + current line (`back-to-indentation'). + +`C-M-\' + Indent several lines to same column (`indent-region'). + +`C-x ' + Shift block of lines rigidly right or left (`indent-rigidly'). + +`M-i' + Indent from point to the next prespecified tab stop column + (`tab-to-tab-stop'). + +`M-x indent-relative' + Indent from point to under an indentation point in the previous + line. + + Most programming languages have some indentation convention. For +Lisp code, lines are indented according to their nesting in +parentheses. The same general idea is used for C code, though details +differ. + + Use the command to indent a line whatever the language. Each +major mode defines this command to perform indentation appropriate for +the particular language. In Lisp mode, aligns a line according +to its depth in parentheses. No matter where in the line you are when +you type , it aligns the line as a whole. In C mode, +implements a subtle and sophisticated indentation style that knows +about many aspects of C syntax. + + In Text mode, runs the command `tab-to-tab-stop', which +indents to the next tab stop column. You can set the tab stops with +`M-x edit-tab-stops'. + +* Menu: + +* Indentation Commands:: Various commands and techniques for indentation. +* Tab Stops:: You can set arbitrary "tab stops" and then + indent to the next tab stop when you want to. +* Just Spaces:: You can request indentation using just spaces. + + +File: xemacs.info, Node: Indentation Commands, Next: Tab Stops, Prev: Indentation, Up: Indentation + +Indentation Commands and Techniques +=================================== + + If you just want to insert a tab character in the buffer, you can +type `C-q '. + + To move over the indentation on a line, type `Meta-m' +(`back-to-indentation'). This command, given anywhere on a line, +positions point at the first non-blank character on the line. + + To insert an indented line before the current line, type `C-a C-o +'. To make an indented line after the current line, use `C-e +'. + + `C-M-o' (`split-line') moves the text from point to the end of the +line vertically down, so that the current line becomes two lines. +`C-M-o' first moves point forward over any spaces and tabs. Then it +inserts after point a newline and enough indentation to reach the same +column point is on. Point remains before the inserted newline; in this +regard, `C-M-o' resembles `C-o'. + + To join two lines cleanly, use the `Meta-^' (`delete-indentation') +command to delete the indentation at the front of the current line, and +the line boundary as well. Empty spaces are replaced by a single +space, or by no space if at the beginning of a line, before a close +parenthesis, or after an open parenthesis. To delete just the +indentation of a line, go to the beginning of the line and use `Meta-\' +(`delete-horizontal-space'), which deletes all spaces and tabs around +the cursor. + + There are also commands for changing the indentation of several +lines at once. `Control-Meta-\' (`indent-region') gives each line which +begins in the region the "usual" indentation by invoking at the +beginning of the line. A numeric argument specifies the column to +indent to. Each line is shifted left or right so that its first +non-blank character appears in that column. `C-x ' +(`indent-rigidly') moves all the lines in the region right by its +argument (left, for negative arguments). The whole group of lines moves +rigidly sideways, which is how the command gets its name. + + `M-x indent-relative' indents at point based on the previous line +(actually, the last non-empty line.) It inserts whitespace at point, +moving point, until it is underneath an indentation point in the +previous line. An indentation point is the end of a sequence of +whitespace or the end of the line. If point is farther right than any +indentation point in the previous line, the whitespace before point is +deleted and the first indentation point then applicable is used. If no +indentation point is applicable even then, `tab-to-tab-stop' is run +(see next section). + + `indent-relative' is the definition of in Indented Text mode. +*Note Text::. + + +File: xemacs.info, Node: Tab Stops, Next: Just Spaces, Prev: Indentation Commands, Up: Indentation + +Tab Stops +========= + + For typing in tables, you can use Text mode's definition of , +`tab-to-tab-stop'. This command inserts indentation before point, +enough to reach the next tab stop column. Even if you are not in Text +mode, this function is associated with `M-i' anyway. + + You can arbitrarily set the tab stops used by `M-i'. They are +stored as a list of column-numbers in increasing order in the variable +`tab-stop-list'. + + The convenient way to set the tab stops is using `M-x +edit-tab-stops', which creates and selects a buffer containing a +description of the tab stop settings. You can edit this buffer to +specify different tab stops, and then type `C-c C-c' to make those new +tab stops take effect. In the tab stop buffer, `C-c C-c' runs the +function `edit-tab-stops-note-changes' rather than the default +`save-buffer'. `edit-tab-stops' records which buffer was current when +you invoked it, and stores the tab stops in that buffer. Normally all +buffers share the same tab stops and changing them in one buffer +affects all. If you make `tab-stop-list' local in one buffer +`edit-tab-stops' in that buffer edits only the local settings. + + Below is the text representing ordinary tab stops every eight +columns: + + : : : : : : + 0 1 2 3 4 + 0123456789012345678901234567890123456789012345678 + To install changes, type C-c C-c + + The first line contains a colon at each tab stop. The remaining +lines help you see where the colons are and tell you what to do. + + Note that the tab stops that control `tab-to-tab-stop' have nothing +to do with displaying tab characters in the buffer. *Note Display +Vars::, for more information on that. + + +File: xemacs.info, Node: Just Spaces, Prev: Tab Stops, Up: Indentation + +Tabs vs. Spaces +=============== + + Emacs normally uses both tabs and spaces to indent lines. If you +prefer, all indentation can be made from spaces only. To request this, +set `indent-tabs-mode' to `nil'. This is a per-buffer variable; +altering the variable affects only the current buffer, but there is a +default value which you can change as well. *Note Locals::. + + There are also commands to convert tabs to spaces or vice versa, +always preserving the columns of all non-blank text. `M-x tabify' +scans the region for sequences of spaces, and converts sequences of at +least three spaces to tabs if that is possible without changing +indentation. `M-x untabify' changes all tabs in the region to +corresponding numbers of spaces. + + +File: xemacs.info, Node: Text, Next: Programs, Prev: Indentation, Up: Top + +Commands for Human Languages +**************************** + + The term "text" has two widespread meanings in our area of the +computer field. One is data that is a sequence of characters. In this +sense of the word any file that you edit with Emacs is text. The other +meaning is more restrictive: a sequence of characters in a human +language for humans to read (possibly after processing by a text +formatter), as opposed to a program or commands for a program. + + Human languages have syntactic and stylistic conventions that editor +commands should support or use to advantage: conventions involving +words, sentences, paragraphs, and capital letters. This chapter +describes Emacs commands for all these things. There are also commands +for "filling", or rearranging paragraphs into lines of approximately +equal length. The commands for moving over and killing words, +sentences, and paragraphs, while intended primarily for editing text, +are also often useful for editing programs. + + Emacs has several major modes for editing human language text. If a +file contains plain text, use Text mode, which customizes Emacs in +small ways for the syntactic conventions of text. For text which +contains embedded commands for text formatters, Emacs has other major +modes, each for a particular text formatter. Thus, for input to TeX, +you can use TeX mode; for input to nroff, Nroff mode. + +* Menu: + +* Text Mode:: The major modes for editing text files. +* Nroff Mode:: The major mode for editing input to the formatter nroff. +* TeX Mode:: The major modes for editing input to the formatter TeX. +* Outline Mode:: The major mode for editing outlines. +* Words:: Moving over and killing words. +* Sentences:: Moving over and killing sentences. +* Paragraphs:: Moving over paragraphs. +* Pages:: Moving over pages. +* Filling:: Filling or justifying text +* Case:: Changing the case of text + + +File: xemacs.info, Node: Text Mode, Next: Words, Prev: Text, Up: Text + +Text Mode +========= + + You should use Text mode--rather than Fundamental or Lisp mode--to +edit files of text in a human language. Invoke `M-x text-mode' to +enter Text mode. In Text mode, runs the function +`tab-to-tab-stop', which allows you to use arbitrary tab stops set with +`M-x edit-tab-stops' (*note Tab Stops::.). Features concerned with +comments in programs are turned off unless they are explicitly invoked. +The syntax table is changed so that periods are not considered part of a +word, while apostrophes, backspaces and underlines are. + + A similar variant mode is Indented Text mode, intended for editing +text in which most lines are indented. This mode defines to run +`indent-relative' (*note Indentation::.), and makes Auto Fill indent +the lines it creates. As a result, a line made by Auto Filling, or by +, is normally indented just like the previous line. Use `M-x +indented-text-mode' to select this mode. + + Entering Text mode or Indented Text mode calls the value of the +variable `text-mode-hook' with no arguments, if that value exists and +is not `nil'. This value is also called when modes related to Text +mode are entered; this includes Nroff mode, TeX mode, Outline mode, and +Mail mode. Your hook can look at the value of `major-mode' to see +which of these modes is actually being entered. + + Two modes similar to Text mode are of use for editing text that is to +be passed through a text formatter before achieving its final readable +form. + +* Menu: + +* Nroff Mode:: The major mode for editing input to the formatter nroff. +* TeX Mode:: The major modes for editing input to the formatter TeX. + + + Another similar mode is used for editing outlines. It allows you +to view the text at various levels of detail. You can view either +the outline headings alone or both headings and text; you can also +hide some of the headings at lower levels from view to make the high +level structure more visible. + + +* Outline Mode:: The major mode for editing outlines. + + +File: xemacs.info, Node: Nroff Mode, Next: TeX Mode, Prev: Text Mode, Up: Text Mode + +Nroff Mode +---------- + + Nroff mode is a mode like Text mode but modified to handle nroff +commands present in the text. Invoke `M-x nroff-mode' to enter this +mode. Nroff mode differs from Text mode in only a few ways. All nroff +command lines are considered paragraph separators, so that filling never +garbles the nroff commands. Pages are separated by `.bp' commands. +Comments start with backslash-doublequote. There are also three special +commands that are not available in Text mode: + +`M-n' + Move to the beginning of the next line that isn't an nroff command + (`forward-text-line'). An argument is a repeat count. + +`M-p' + Like `M-n' but move up (`backward-text-line'). + +`M-?' + Prints in the echo area the number of text lines (lines that are + not nroff commands) in the region (`count-text-lines'). + + The other feature of Nroff mode is Electric Nroff newline mode. +This is a minor mode that you can turn on or off with `M-x +electric-nroff-mode' (*note Minor Modes::.). When the mode is on and +you use to end a line containing an nroff command that opens a +kind of grouping, Emacs automatically inserts the matching nroff +command to close that grouping on the following line. For example, if +you are at the beginning of a line and type `.(b ', the matching +command `.)b' will be inserted on a new line following point. + + Entering Nroff mode calls the value of the variable `text-mode-hook' +with no arguments, if that value exists and is not `nil'; then it does +the same with the variable `nroff-mode-hook'. + + +File: xemacs.info, Node: TeX Mode, Next: Outline Mode, Prev: Nroff Mode, Up: Text Mode + +TeX Mode +-------- + + TeX is a powerful text formatter written by Donald Knuth; like GNU +Emacs, it is free. LaTeX is a simplified input format for TeX, +implemented by TeX macros. It is part of TeX. + + Emacs has a special TeX mode for editing TeX input files. It +provides facilities for checking the balance of delimiters and for +invoking TeX on all or part of the file. + + TeX mode has two variants, Plain TeX mode and LaTeX mode, which are +two distinct major modes that differ only slightly. These modes are +designed for editing the two different input formats. The command `M-x +tex-mode' looks at the contents of a buffer to determine whether it +appears to be LaTeX input or not; it then selects the appropriate mode. +If it can't tell which is right (e.g., the buffer is empty), the +variable `tex-default-mode' controls which mode is used. + + The commands `M-x plain-tex-mode' and `M-x latex-mode' explicitly +select one of the variants of TeX mode. Use these commands when `M-x +tex-mode' does not guess right. + +* Menu: + +* Editing: TeX Editing. Special commands for editing in TeX mode. +* Printing: TeX Print. Commands for printing part of a file with TeX. + + TeX for Unix systems can be obtained from the University of +Washington for a distribution fee. + + To order a full distribution, send $140.00 for a 1/2 inch 9-track +tape, $165.00 for two 4-track 1/4 inch cartridge tapes (foreign sites +$150.00, for 1/2 inch, $175.00 for 1/4 inch, to cover the extra +postage) payable to the University of Washington to: + + The Director + Northwest Computer Support Group, DW-10 + University of Washington + Seattle, Washington 98195 + +Purchase orders are acceptable, but there is an extra charge of $10.00 +to pay for processing charges. (The total cost comes to $150 for +domestic sites, $175 for foreign sites). + + The normal distribution is a tar tape, blocked 20, 1600 bpi, on an +industry standard 2400 foot half-inch reel. The physical format for +the 1/4 inch streamer cartridges uses QIC-11, 8000 bpi, 4-track +serpentine recording for the SUN. Also, SystemV tapes can be written +in cpio format, blocked 5120 bytes, ASCII headers. + + +File: xemacs.info, Node: TeX Editing, Next: TeX Print, Prev: TeX Mode, Up: TeX Mode + +TeX Editing Commands +.................... + + Here are the special commands provided in TeX mode for editing the +text of the file. + +`"' + Insert, according to context, either ```' or `"' or `''' + (`TeX-insert-quote'). + +`' + Insert a paragraph break (two newlines) and check the previous + paragraph for unbalanced braces or dollar signs (`tex-terminate- + paragraph'). + +`M-x validate-tex-buffer' + Check each paragraph in the buffer for unbalanced braces or dollar + signs. + +`C-c {' + Insert `{}' and position point between them (`tex-insert-braces'). + +`C-c }' + Move forward past the next unmatched close brace (`up-list'). + +`C-c C-e' + Close a block for LaTeX (`tex-close-latex-block'). + + In TeX, the character `"' is not normally used; you use ```' to +start a quotation and `''' to end one. TeX mode defines the key `"' to +insert ```' after whitespace or an open brace, `"' after a backslash, +or `''' otherwise. This is done by the command `tex-insert-quote'. If +you need the character `"' itself in unusual contexts, use `C-q' to +insert it. Also, `"' with a numeric argument always inserts that +number of `"' characters. + + In TeX mode, `$' has a special syntax code which attempts to +understand the way TeX math mode delimiters match. When you insert a +`$' that is meant to exit math mode, the position of the matching `$' +that entered math mode is displayed for a second. This is the same +feature that displays the open brace that matches a close brace that is +inserted. However, there is no way to tell whether a `$' enters math +mode or leaves it; so when you insert a `$' that enters math mode, the +previous `$' position is shown as if it were a match, even though they +are actually unrelated. + + If you prefer to keep braces balanced at all times, you can use `C-c +{' (`tex-insert-braces') to insert a pair of braces. It leaves point +between the two braces so you can insert the text that belongs inside. +Afterward, use the command `C-c }' (`up-list') to move forward past the +close brace. + + There are two commands for checking the matching of braces. +(`tex-terminate-paragraph') checks the paragraph before point, and +inserts two newlines to start a new paragraph. It prints a message in +the echo area if any mismatch is found. `M-x validate-tex-buffer' +checks the entire buffer, paragraph by paragraph. When it finds a +paragraph that contains a mismatch, it displays point at the beginning +of the paragraph for a few seconds and pushes a mark at that spot. +Scanning continues until the whole buffer has been checked or until you +type another key. The positions of the last several paragraphs with +mismatches can be found in the mark ring (*note Mark Ring::.). + + Note that square brackets and parentheses, not just braces, are +matched in TeX mode. This is wrong if you want to check TeX syntax. +However, parentheses and square brackets are likely to be used in text +as matching delimiters and it is useful for the various motion commands +and automatic match display to work with them. + + In LaTeX input, `\begin' and `\end' commands must balance. After +you insert a `\begin', use `C-c C-f' (`tex-close-latex-block') to +insert automatically a matching `\end' (on a new line following the +`\begin'). A blank line is inserted between the two, and point is left +there. + + +File: xemacs.info, Node: TeX Print, Prev: TeX Editing, Up: TeX Mode + +TeX Printing Commands +..................... + + You can invoke TeX as an inferior of Emacs on either the entire +contents of the buffer or just a region at a time. Running TeX in this +way on just one chapter is a good way to see what your changes look +like without taking the time to format the entire file. + +`C-c C-r' + Invoke TeX on the current region, plus the buffer's header + (`tex-region'). + +`C-c C-b' + Invoke TeX on the entire current buffer (`tex-buffer'). + +`C-c C-l' + Recenter the window showing output from the inferior TeX so that + the last line can be seen (`tex-recenter-output-buffer'). + +`C-c C-k' + Kill the inferior TeX (`tex-kill-job'). + +`C-c C-p' + Print the output from the last `C-c C-r' or `C-c C-b' command + (`tex-print'). + +`C-c C-q' + Show the printer queue (`tex-show-print-queue'). + + You can pass the current buffer through an inferior TeX using `C-c +C-b' (`tex-buffer'). The formatted output appears in a file in `/tmp'; +to print it, type `C-c C-p' (`tex-print'). Afterward use `C-c C-q' +(`tex-show-print-queue') to view the progress of your output towards +being printed. + + The console output from TeX, including any error messages, appears +in a buffer called `*TeX-shell*'. If TeX gets an error, you can switch +to this buffer and feed it input (this works as in Shell mode; *note +Interactive Shell::.). Without switching to this buffer, you can scroll +it so that its last line is visible by typing `C-c C-l'. + + Type `C-c C-k' (`tex-kill-job') to kill the TeX process if you see +that its output is no longer useful. Using `C-c C-b' or `C-c C-r' also +kills any TeX process still running. + + You can pass an arbitrary region through an inferior TeX by typing +`C-c C-r' (`tex-region'). This is tricky, however, because most files +of TeX input contain commands at the beginning to set parameters and +define macros. Without them, no later part of the file will format +correctly. To solve this problem, `C-c C-r' allows you to designate a +part of the file as containing essential commands; it is included +before the specified region as part of the input to TeX. The +designated part of the file is called the "header". + + To indicate the bounds of the header in Plain TeX mode, insert two +special strings in the file: `%**start of header' before the header, +and `%**end of header' after it. Each string must appear entirely on +one line, but there may be other text on the line before or after. The +lines containing the two strings are included in the header. If +`%**start of header' does not appear within the first 100 lines of the +buffer, `C-c C-r' assumes there is no header. + + In LaTeX mode, the header begins with `\documentstyle' and ends with +`\begin{document}'. These are commands that LaTeX requires you to use, +so you don't need to do anything special to identify the header. + + When you enter either kind of TeX mode, Emacs calls with no +arguments the value of the variable `text-mode-hook', if that value +exists and is not `nil'. Emacs then calls the variable `TeX-mode-hook' +and either `plain-TeX-mode-hook' or `LaTeX-mode-hook' under the same +conditions. + + +File: xemacs.info, Node: Outline Mode, Prev: TeX Mode, Up: Text Mode + +Outline Mode +------------ + + Outline mode is a major mode similar to Text mode but intended for +editing outlines. It allows you to make parts of the text temporarily +invisible so that you can see just the overall structure of the +outline. Type `M-x outline-mode' to turn on Outline mode in the +current buffer. + + When you enter Outline mode, Emacs calls with no arguments the value +of the variable `text-mode-hook', if that value exists and is not +`nil'; then it does the same with the variable `outline-mode-hook'. + + When a line is invisible in outline mode, it does not appear on the +screen. The screen appears exactly as if the invisible line were +deleted, except that an ellipsis (three periods in a row) appears at +the end of the previous visible line (only one ellipsis no matter how +many invisible lines follow). + + All editing commands treat the text of the invisible line as part of +the previous visible line. For example, `C-n' moves onto the next +visible line. Killing an entire visible line, including its +terminating newline, really kills all the following invisible lines as +well; yanking everything back yanks the invisible lines and they remain +invisible. + +* Menu: + +* Format: Outline Format. What the text of an outline looks like. +* Motion: Outline Motion. Special commands for moving through outlines. +* Visibility: Outline Visibility. Commands to control what is visible. + + +File: xemacs.info, Node: Outline Format, Next: Outline Motion, Prev: Outline Mode, Up: Outline Mode + +Format of Outlines +.................. + + Outline mode assumes that the lines in the buffer are of two types: +"heading lines" and "body lines". A heading line represents a topic in +the outline. Heading lines start with one or more stars; the number of +stars determines the depth of the heading in the outline structure. +Thus, a heading line with one star is a major topic; all the heading +lines with two stars between it and the next one-star heading are its +subtopics; and so on. Any line that is not a heading line is a body +line. Body lines belong to the preceding heading line. Here is an +example: + + * Food + + This is the body, + which says something about the topic of food. + + ** Delicious Food + + This is the body of the second-level header. + + ** Distasteful Food + + This could have + a body too, with + several lines. + + *** Dormitory Food + + * Shelter + + A second first-level topic with its header line. + + A heading line together with all following body lines is called +collectively an "entry". A heading line together with all following +deeper heading lines and their body lines is called a "subtree". + + You can customize the criterion for distinguishing heading lines by +setting the variable `outline-regexp'. Any line whose beginning has a +match for this regexp is considered a heading line. Matches that start +within a line (not at the beginning) do not count. The length of the +matching text determines the level of the heading; longer matches make +a more deeply nested level. Thus, for example, if a text formatter has +commands `@chapter', `@section' and `@subsection' to divide the +document into chapters and sections, you can make those lines count as +heading lines by setting `outline-regexp' to +`"@chap\\|@\\(sub\\)*section"'. Note the trick: the two words +`chapter' and `section' are the same length, but by defining the regexp +to match only `chap' we ensure that the length of the text matched on a +chapter heading is shorter, so that Outline mode will know that +sections are contained in chapters. This works as long as no other +command starts with `@chap'. + + Outline mode makes a line invisible by changing the newline before it +into an ASCII Control-M (code 015). Most editing commands that work on +lines treat an invisible line as part of the previous line because, +strictly speaking, it is part of that line, since there is no longer a +newline in between. When you save the file in Outline mode, Control-M +characters are saved as newlines, so the invisible lines become ordinary +lines in the file. Saving does not change the visibility status of a +line inside Emacs. + + +File: xemacs.info, Node: Outline Motion, Next: Outline Visibility, Prev: Outline Format, Up: Outline Mode + +Outline Motion Commands +....................... + + Some special commands in Outline mode move backward and forward to +heading lines. + +`C-c C-n' + Move point to the next visible heading line + (`outline-next-visible-heading'). + +`C-c C-p' + Move point to the previous visible heading line + (`outline-previous-visible-heading'). + +`C-c C-f' + Move point to the next visible heading line at the same level as + the one point is on (`outline-forward-same-level'). + +`C-c C-b' + Move point to the previous visible heading line at the same level + (`outline-backward-same-level'). + +`C-c C-u' + Move point up to a lower-level (more inclusive) visible heading + line (`outline-up-heading'). + + `C-c C-n' (`next-visible-heading') moves down to the next heading +line. `C-c C-p' (`previous-visible-heading') moves similarly backward. +Both accept numeric arguments as repeat counts. The names emphasize +that invisible headings are skipped, but this is not really a special +feature. All editing commands that look for lines ignore the invisible +lines automatically. + + More advanced motion commands understand the levels of headings. +The commands `C-c C-f' (`outline-forward-same-level') and `C-c C-b' +(`outline-backward-same-level') move from one heading line to another +visible heading at the same depth in the outline. `C-c C-u' +(`outline-up-heading') moves backward to another heading that is less +deeply nested. + + +File: xemacs.info, Node: Outline Visibility, Prev: Outline Motion, Up: Outline Mode + +Outline Visibility Commands +........................... + + The other special commands of outline mode are used to make lines +visible or invisible. Their names all start with `hide' or `show'. +Most of them exist as pairs of opposites. They are not undoable; +instead, you can undo right past them. Making lines visible or +invisible is simply not recorded by the undo mechanism. + +`M-x hide-body' + Make all body lines in the buffer invisible. + +`M-x show-all' + Make all lines in the buffer visible. + +`C-c C-d' + Make everything under this heading invisible, not including this + heading itself (`hide-subtree'). + +`C-c C-s' + Make everything under this heading visible, including body, + subheadings, and their bodies (`show-subtree'). + +`M-x hide-leaves' + Make the body of this heading line, and of all its subheadings, + invisible. + +`M-x show-branches' + Make all subheadings of this heading line, at all levels, visible. + +`C-c C-i' + Make immediate subheadings (one level down) of this heading line + visible (`show-children'). + +`M-x hide-entry' + Make this heading line's body invisible. + +`M-x show-entry' + Make this heading line's body visible. + + Two commands that are exact opposites are `M-x hide-entry' and `M-x +show-entry'. They are used with point on a heading line, and apply +only to the body lines of that heading. The subtopics and their bodies +are not affected. + + Two more powerful opposites are `C-c C-h' (`hide-subtree') and `C-c +C-s' (`show-subtree'). Both should be used when point is on a heading +line, and both apply to all the lines of that heading's "subtree": its +body, all its subheadings, both direct and indirect, and all of their +bodies. In other words, the subtree contains everything following this +heading line, up to and not including the next heading of the same or +higher rank. + + Intermediate between a visible subtree and an invisible one is having +all the subheadings visible but none of the body. There are two +commands for doing this, one that hides the bodies and one that makes +the subheadings visible. They are `M-x hide-leaves' and `M-x +show-branches'. + + A little weaker than `show-branches' is `C-c C-i' (`show-children'). +It makes just the direct subheadings visible--those one level down. +Deeper subheadings remain invisible. + + Two commands have a blanket effect on the whole file. `M-x +hide-body' makes all body lines invisible, so that you see just the +outline structure. `M-x show-all' makes all lines visible. You can +think of these commands as a pair of opposites even though `M-x +show-all' applies to more than just body lines. + + You can turn off the use of ellipses at the ends of visible lines by +setting `selective-display-ellipses' to `nil'. The result is no +visible indication of the presence of invisible lines. + + +File: xemacs.info, Node: Words, Next: Sentences, Prev: Text Mode, Up: Text + +Words +===== + + Emacs has commands for moving over or operating on words. By +convention, the keys for them are all `Meta-' characters. + +`M-f' + Move forward over a word (`forward-word'). + +`M-b' + Move backward over a word (`backward-word'). + +`M-d' + Kill up to the end of a word (`kill-word'). + +`M-' + Kill back to the beginning of a word (`backward-kill-word'). + +`M-@' + Mark the end of the next word (`mark-word'). + +`M-t' + Transpose two words; drag a word forward or backward across other + words (`transpose-words'). + + Notice how these keys form a series that parallels the +character-based `C-f', `C-b', `C-d', `C-t' and . `M-@' is related +to `C-@', which is an alias for `C-'. + + The commands `Meta-f' (`forward-word') and `Meta-b' +(`backward-word') move forward and backward over words. They are +analogous to `Control-f' and `Control-b', which move over single +characters. Like their `Control-' analogues, `Meta-f' and `Meta-b' +move several words if given an argument. `Meta-f' with a negative +argument moves backward, and `Meta-b' with a negative argument moves +forward. Forward motion stops after the last letter of the word, while +backward motion stops before the first letter. + + `Meta-d' (`kill-word') kills the word after point. To be precise, +it kills everything from point to the place `Meta-f' would move to. +Thus, if point is in the middle of a word, `Meta-d' kills just the part +after point. If some punctuation comes between point and the next +word, it is killed along with the word. (To kill only the next word +but not the punctuation before it, simply type `Meta-f' to get to the +end and kill the word backwards with `Meta-'.) `Meta-d' takes +arguments just like `Meta-f'. + + `Meta-' (`backward-kill-word') kills the word before point. It +kills everything from point back to where `Meta-b' would move to. If +point is after the space in `FOO, BAR', then `FOO, ' is killed. To +kill just `FOO', type `Meta-b Meta-d' instead of `Meta-'. + + `Meta-t' (`transpose-words') exchanges the word before or containing +point with the following word. The delimiter characters between the +words do not move. For example, transposing `FOO, BAR' results in +`BAR, FOO' rather than `BAR FOO,'. *Note Transpose::, for more on +transposition and on arguments to transposition commands. + + To operate on the next N words with an operation which applies +between point and mark, you can either set the mark at point and then +move over the words, or you can use the command `Meta-@' (`mark-word') +which does not move point but sets the mark where `Meta-f' would move +to. It can be given arguments just like `Meta-f'. + + The word commands' understanding of syntax is completely controlled +by the syntax table. For example, any character can be declared to be +a word delimiter. *Note Syntax::. + + +File: xemacs.info, Node: Sentences, Next: Paragraphs, Prev: Words, Up: Text + +Sentences +========= + + The Emacs commands for manipulating sentences and paragraphs are +mostly on `Meta-' keys, and therefore are like the word-handling +commands. + +`M-a' + Move back to the beginning of the sentence (`backward-sentence'). + +`M-e' + Move forward to the end of the sentence (`forward-sentence'). + +`M-k' + Kill forward to the end of the sentence (`kill-sentence'). + +`C-x ' + Kill back to the beginning of the sentence + (`backward-kill-sentence'). + + The commands `Meta-a' and `Meta-e' (`backward-sentence' and +`forward-sentence') move to the beginning and end of the current +sentence, respectively. They resemble `Control-a' and `Control-e', +which move to the beginning and end of a line. Unlike their +counterparts, `Meta-a' and `Meta-e' move over successive sentences if +repeated or given numeric arguments. Emacs assumes the typist's +convention is followed, and thus considers a sentence to end wherever +there is a `.', `?', or `!' followed by the end of a line or two +spaces, with any number of `)', `]', `'', or `"' characters allowed in +between. A sentence also begins or ends wherever a paragraph begins or +ends. + + Neither `M-a' nor `M-e' moves past the newline or spaces beyond the +sentence edge at which it is stopping. + + `M-a' and `M-e' have a corresponding kill command, just like `C-a' +and `C-e' have `C-k'. The command is `M-k' (`kill-sentence') which +kills from point to the end of the sentence. With minus one as an +argument it kills back to the beginning of the sentence. Larger +arguments serve as repeat counts. + + There is a special command, `C-x ' (`backward-kill-sentence'), +for killing back to the beginning of a sentence, which is useful when +you change your mind in the middle of composing text. + + The variable `sentence-end' controls recognition of the end of a +sentence. It is a regexp that matches the last few characters of a +sentence, together with the whitespace following the sentence. Its +normal value is: + + "[.?!][]\"')]*\\($\\|\t\\| \\)[ \t\n]*" + +This example is explained in the section on regexps. *Note Regexps::. + + +File: xemacs.info, Node: Paragraphs, Next: Pages, Prev: Sentences, Up: Text + +Paragraphs +========== + + The Emacs commands for manipulating paragraphs are also `Meta-' keys. + +`M-[' + Move back to previous paragraph beginning + (`backward-paragraph'). + +`M-]' + Move forward to next paragraph end (`forward-paragraph'). + +`M-h' + Put point and mark around this or next paragraph + (`mark-paragraph'). + + `Meta-[' moves to the beginning of the current or previous paragraph, +while `Meta-]' moves to the end of the current or next paragraph. +Blank lines and text formatter command lines separate paragraphs and are +not part of any paragraph. An indented line starts a new paragraph. + + In major modes for programs (as opposed to Text mode), paragraphs +begin and end only at blank lines. As a result, the paragraph commands +continue to be useful even though there are no paragraphs per se. + + When there is a fill prefix, paragraphs are delimited by all lines +which don't start with the fill prefix. *Note Filling::. + + To operate on a paragraph, you can use the command `Meta-h' +(`mark-paragraph') to set the region around it. This command puts +point at the beginning and mark at the end of the paragraph point was +in. If point is between paragraphs (in a run of blank lines or at a +boundary), the paragraph following point is surrounded by point and +mark. If there are blank lines preceding the first line of the +paragraph, one of the blank lines is included in the region. Thus, for +example, `M-h C-w' kills the paragraph around or after point. + + The precise definition of a paragraph boundary is controlled by the +variables `paragraph-separate' and `paragraph-start'. The value of +`paragraph-start' is a regexp that matches any line that either starts +or separates paragraphs. The value of `paragraph-separate' is another +regexp that matches only lines that separate paragraphs without being +part of any paragraph. Lines that start a new paragraph and are +contained in it must match both regexps. For example, normally +`paragraph-start' is `"^[ \t\n\f]"' and `paragraph-separate' is `"^[ +\t\f]*$"'. + + Normally it is desirable for page boundaries to separate paragraphs. +The default values of these variables recognize the usual separator for +pages. + diff --git a/lib-src/.cvsignore b/lib-src/.cvsignore index d18aa8b..8be3c26 100644 --- a/lib-src/.cvsignore +++ b/lib-src/.cvsignore @@ -23,4 +23,3 @@ gnuclient ootags ellcc DOC -*.pdb diff --git a/lib-src/aixcc.lex b/lib-src/aixcc.lex new file mode 100644 index 0000000..b7b4470 --- /dev/null +++ b/lib-src/aixcc.lex @@ -0,0 +1,301 @@ +%Start ErrorText ErrorMessage OtherText + +EC [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9] +D [0-9] +D3 [0-9 ][0-9 ][0-9] +D4 [0-9 ][0-9 ][0-9 ][0-9] +D5 [0-9 ][0-9 ][0-9 ][0-9 ][0-9] +DS [0-9 ] + +%{ +/* moore@wilma.cs.utk.edu + + * Hack to work around the AIX C compiler's brain-damaged error messages + * so that emacs can parse them. It runs /bin/cc as a subprocess, and + * tries to rearrange the error messages so that (a) each message contains + * both the filename and line number where the error occurred, and (b) + * the error message(s) for a particular line get displayed *before* the + * line itself. + * + * to compile: + * lex aixcc.lex + * cc -o aixcc lex.yy.c + * + * + * Copyright December 1991 by Keith Moore + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * + * TODO: figure out how the compiler counts file numbers for included + * files, keep track of which file corresponds to which number, and + * always output the right file name. + */ + +#include +#include + +char *current_file; +int line; +int debug = 0; +char bigbuf[10240]; +char *bufptr = bigbuf; +int last_line_was_error = 0; + +spaces (s) +char *s; +{ + while (*s++) + *bufptr++ = ' '; +} + +char * +strsave (s) +char *s; +{ + char *ptr = malloc (strlen (s) + 1); + strcpy (ptr, s); + return ptr; +} + +yywrap () +{ + *bufptr = '\0'; + bufptr = bigbuf; + while (*bufptr) + putc (*bufptr++, yyout); + return 1; +} + +%} +%% +^File\ Line\ Column\ Message\ text[^\n]* { + /* + * ignore this. don't treat it as error text + */ +} + +^{DS}{DS}{DS}\ {D5}\ \| { + /* + * (optional) nesting level, followed by line number, followed + * by the source code fragment that caused the error + */ + + /* + * save the line number for later + */ + line = atoi (yytext+4); + + if (debug) { + fprintf (yyout, "line <= %d\n", line); + fprintf (yyout, "%s\n", yytext); + } + + /* + * if the last line was an error message, to flush out all of + * the old source text before starting to save the new source text. + */ + if (last_line_was_error) { + *bufptr = '\0'; + bufptr = bigbuf; + while (*bufptr) + putc (*bufptr++, yyout); + bufptr = bigbuf; + last_line_was_error = 0; + } + /* + * stuff enough spaces in the text buffer so that the + * saved text will line up properly when displayed. + */ + spaces (yytext); + + BEGIN ErrorText; /* continue below */ +} + +[^\n]*$ { + char *ptr; + + /* + * Save the text until we see the error message(s), then print it. + * This because emacs puts the error message at the top of the + * window, and it's nice to be able to see the text below it. + */ + + ptr = yytext; + while (*ptr) + *bufptr++ = *ptr++; + *bufptr++ = '\n'; + + BEGIN 0; +} + +^Processing\ include\ file\ .*$ { + /* + * name of a new include file being processed. Increment file number + * and remember the file name corresponding to this file number. + */ + + current_file = strsave (yytext+24); + + if (debug) { + fprintf (yyout, "current_file <= %s\n", current_file); + fprintf (yyout, "%s\n", yytext); + } +} + +^([a-z]\ -)?\ *{EC}: { + /* + * error message (which we print immediately) preceded by an + * error code (which we ignore) + */ + + fprintf (yyout, "\"%s\", line %d: %c -", current_file, line, *yytext); + last_line_was_error = 1; + BEGIN ErrorMessage; +} + +^{D3}\ {D5}\ {D4}\ {EC}: { + /* + * (optional) nesting level, followed by line number, followed + * by column number, followed by error message text. + */ + + /* + * save the line number for later + */ + line = atoi (yytext+4); + + if (debug) { + fprintf (yyout, "line <= %d\n", line); + fprintf (yyout, "%s\n", yytext); + } + + /* + * if the last line was an error message, flush out all of + * the old source text before printing this error message. + */ + if (last_line_was_error) { + *bufptr = '\0'; + bufptr = bigbuf; + while (*bufptr) + putc (*bufptr++, yyout); + bufptr = bigbuf; + last_line_was_error = 0; + } + fprintf (yyout, "\"%s\", line %d:", current_file, line); + last_line_was_error = 1; + BEGIN ErrorMessage; +} + +[^\n]*$ { + fprintf (yyout, "%s\n", yytext); + BEGIN 0; +} + + +^[^ :]+".c:"\ *$ { + /* name of new source file being processed */ + + char *ptr; + + if (current_file) + free (current_file); + ptr = strchr (yytext, ':'); + *ptr = '\0'; + current_file = strsave (yytext); +} + +^[^\n] { + /* + * other text starting with a newline. We have to break it up this + * way to keep this rule from matching any of the above patterns + */ + + if (last_line_was_error) { + *bufptr = '\0'; + bufptr = bigbuf; + while (*bufptr) + putc (*bufptr++, yyout); + bufptr = bigbuf; + last_line_was_error = 0; + } + + *bufptr++ = *yytext; + BEGIN OtherText; +} + +[^\n]*$ { + char *ptr; + + ptr = yytext; + while (*ptr) + *bufptr++ = *ptr++; + *bufptr++ = '\n'; + + BEGIN 0; +} + +\n ; + +%% + +main (argc, argv) +char **argv; +{ + int pfd[2]; + int child_pid; + int i; + + current_file = strsave ("/dev/null"); + + line = 0; + + for (i = 1; i < argc; ++i) { + char *ptr = strrchr (argv[i], '.'); + if (ptr && ptr[1] == 'c' && ptr[2] == '\0') { + current_file = strsave (argv[i]); + break; + } + } + + if (pipe (pfd) < 0) { + perror ("pipe"); + exit (1); + } + if ((child_pid = fork()) > 0) { + int status; + + close (pfd[1]); + yyin = fdopen (pfd[0], "r"); + yyout = stderr; + yylex(); + + wait (&status); + exit ((status >> 8) & 0xff); + } + else if (child_pid == 0) { + dup2 (pfd[1], 2); + close (pfd[0]); + close (pfd[1]); + argv[0] = "cc"; + execv ("/bin/cc", argv); + perror ("/bin/cc"); + exit (1); + } + else { + perror ("fork"); + exit (1); + } +} diff --git a/lib-src/i.c b/lib-src/i.c index 097b311..1bec21f 100644 --- a/lib-src/i.c +++ b/lib-src/i.c @@ -90,7 +90,7 @@ start_pump (I_connector* pi) static LPTSTR get_command (void) { - LPTSTR cl = GetCommandLine (); + LPTSTR q, ws, cl = GetCommandLine (); int ix; while (1) diff --git a/lib-src/install-sid b/lib-src/install-sid new file mode 100755 index 0000000..60083f5 --- /dev/null +++ b/lib-src/install-sid @@ -0,0 +1,88 @@ +#!/bin/sh +# Drop in the SUBMITTER id into a site's installed send-pr script. +# Copyright (C) 1993 Free Software Foundation, Inc. +# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a +# version written by Heinz G. Seidl (hgs@ide.com). +# +# This file is part of GNU GNATS. +# +# GNU GNATS 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 GNATS 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 GNATS; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +COMMAND=`echo $0 | sed -e 's,.*/,,g'` +USAGE="Usage: $COMMAND [--install-dir=prefix] [--help] [--version] submitter-id" + +VERSION=3.101 + +BINDIR=/usr/bin + +SUBMITTER= +TEMP=/tmp/sp$$ + +if [ $# -eq 0 ]; then + echo "$USAGE" + exit 1 +fi + +while [ $# -gt 0 ]; do + case "$1" in + -install-dir=*|--install-dir=*|--install-di=*|--install-d=*|--install-=*|--install=*|--instal=*|--insta=*|--inst=*|--ins=*|--in=*|--i=*) + I=`echo "$1" | sed 's/-*i[a-z\-]*=//'` + BINDIR=$I/bin ;; + --version) echo $COMMAND version $VERSION ; exit 1 ;; + -*) echo "$USAGE" ; exit 1 ;; + *) SUBMITTER=$1 ;; + esac + shift +done + +path=`echo $0 | sed -e "s;${COMMAND};;"` + +[ -z "$path" ] && path=. + +examinebindir=yes + +if [ "$examinebindir" = yes ] && [ -f $BINDIR/send-pr ]; then + SPPATHLIST=$BINDIR/send-pr +else + if [ -f $path/send-pr ]; then + SPPATHLIST=$path/send-pr + else + echo "$COMMAND: cannot find \`$BINDIR/send-pr' or \`$path/send-pr'" >&2 + exit 1 + fi +fi + +trap 'rm -f $TEMP ; exit 0' 0 +trap 'echo "$COM: Aborting ..."; rm -f $TEMP ; exit 1' 1 2 3 13 15 + +for SPPATH in $SPPATHLIST; do + sed -e "s/^SUBMITTER=.*/SUBMITTER=${SUBMITTER}/" $SPPATH > $TEMP + + if grep $SUBMITTER $TEMP > /dev/null; then + cp $SPPATH $SPPATH.orig && + rm -f $SPPATH && + cp $TEMP $SPPATH && + chmod a+rx $SPPATH && + rm -f $TEMP $SPPATH.orig || + { echo "$COMMAND: unable to replace send-pr" >&2 ; exit 1; } + else + echo "$COMMAND: something went wrong when sed-ing the submitter into send-pr" >&2 + exit 1 + fi +done + +echo "$COMMAND: \`$SUBMITTER' is now the default submitter ID for send-pr" + +exit 0 diff --git a/lib-src/make-dump-id.c b/lib-src/make-dump-id.c index bfa2f7d..dba2a9c 100644 --- a/lib-src/make-dump-id.c +++ b/lib-src/make-dump-id.c @@ -23,26 +23,6 @@ Boston, MA 02111-1307, USA. */ #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) @@ -64,7 +44,10 @@ main (int argc, char *argv[]) return EXIT_FAILURE; } - fprintf (f, "unsigned int dump_id = %uU;\n", generate_dump_id ()); + fprintf (f, + "#include \n" + "unsigned int dump_id = %uU;\n", + generate_dump_id ()); if ((fclose (f)) != 0) { diff --git a/lib-src/process-depends.sh b/lib-src/process-depends.sh new file mode 100644 index 0000000..258d606 --- /dev/null +++ b/lib-src/process-depends.sh @@ -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 --git a/lib-src/process-gnu-depends.sh b/lib-src/process-gnu-depends.sh new file mode 100755 index 0000000..b08a916 --- /dev/null +++ b/lib-src/process-gnu-depends.sh @@ -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 --git a/lib-src/pstogif b/lib-src/pstogif new file mode 100755 index 0000000..7ddbcd3 --- /dev/null +++ b/lib-src/pstogif @@ -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 --git a/lib-src/run.c b/lib-src/run.c new file mode 100644 index 0000000..86830ba --- /dev/null +++ b/lib-src/run.c @@ -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 --git a/lib-src/run.h b/lib-src/run.h new file mode 100644 index 0000000..896dc5c --- /dev/null +++ b/lib-src/run.h @@ -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 --git a/lib-src/run.rc b/lib-src/run.rc new file mode 100644 index 0000000..35ec240 --- /dev/null +++ b/lib-src/run.rc @@ -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 --git a/lib-src/send-pr b/lib-src/send-pr new file mode 100755 index 0000000..3c97e40 --- /dev/null +++ b/lib-src/send-pr @@ -0,0 +1,530 @@ +#!/bin/sh +# Submit a problem report to a GNATS site. +# Copyright (C) 1993 Free Software Foundation, Inc. +# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a +# version written by Heinz G. Seidl (hgs@cygnus.com). +# +# This file is part of GNU GNATS. +# +# GNU GNATS 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 GNATS 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 GNATS; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +# The version of this send-pr. +VERSION=3.101 + +# The submitter-id for your site. +SUBMITTER=net + +# Where the GNATS directory lives, if at all. +[ -z "$GNATS_ROOT" ] && +GNATS_ROOT=/usr/lib/gnats/gnats-db + +# The default mail address for PR submissions. +GNATS_ADDR=bugs@xemacs.org + +# Where the gnats category tree lives. +[ -z "$DATADIR" ] && +DATADIR=/usr/share + +# If we've been moved around, try using GCC_EXEC_PREFIX. +[ ! -d $DATADIR/gnats -a -d "$GCC_EXEC_PREFIX" ] && + DATADIR=${GCC_EXEC_PREFIX}../../../lib + + +# The default release for this host. +DEFAULT_RELEASE="gnats-3.101" + +# The default organization. +DEFAULT_ORGANIZATION="XEmacs Users" + +# The default site to look for. +GNATS_SITE=xemacs.org + +# Newer config information? +[ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config + +# What mailer to use. This must come after the config file, since it is +# host-dependent. +MAIL_AGENT="/usr/lib/sendmail -oi -t" + +# How to read the passwd database. +PASSWD="cat /etc/passwd" + +ECHON=bsd + +if [ $ECHON = bsd ] ; then + ECHON1="echo -n" + ECHON2= +elif [ $ECHON = sysv ] ; then + ECHON1=echo + ECHON2='\c' +else + ECHON1=echo + ECHON2= +fi + +# + +if [ -z "$TMPDIR" ]; then + TMPDIR=/tmp +else + if [ "`echo $TMPDIR | grep '/$'`" != "" ]; then + TMPDIR="`echo $TMPDIR | sed -e 's,/$,,'`" + fi +fi + +TEMP=$TMPDIR/p$$ +BAD=$TMPDIR/pbad$$ +REF=$TMPDIR/pf$$ + +# find a user name +if [ "$LOGNAME" = "" ]; then + if [ "$USER" != "" ]; then + LOGNAME="$USER" + else + LOGNAME="UNKNOWN" + fi +fi + +FROM="$LOGNAME" +if [ -z "$REPLYTO" ]; then + REPLYTO="$LOGNAME" +fi + +# Find out the name of the originator of this PR. +if [ -n "$NAME" ]; then + ORIGINATOR="$NAME" +elif [ -f $HOME/.fullname ]; then + ORIGINATOR="`sed -e '1q' $HOME/.fullname`" +else + # Must use temp file due to incompatibilities in quoting behavior + # and to protect shell metacharacters in the expansion of $LOGNAME + $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP + ORIGINATOR="`cat $TEMP`" + rm -f $TEMP +fi + +if [ -n "$ORGANIZATION" ]; then + if [ -f "$ORGANIZATION" ]; then + ORGANIZATION="`cat $ORGANIZATION`" + fi +else + if [ -n "$DEFAULT_ORGANIZATION" ]; then + ORGANIZATION="$DEFAULT_ORGANIZATION" + elif [ -f $HOME/.organization ]; then + ORGANIZATION="`cat $HOME/.organization`" + elif [ -f $HOME/.signature ]; then + ORGANIZATION="`cat $HOME/.signature`" + fi +fi + +# If they don't have a preferred editor set, then use +if [ -z "$VISUAL" ]; then + if [ -z "$EDITOR" ]; then + EDIT=vi + else + EDIT="$EDITOR" + fi +else + EDIT="$VISUAL" +fi + +# Find out some information. +SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \ + ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""` +ARCH=`[ -f /bin/arch ] && /bin/arch` +MACHINE=`[ -f /bin/machine ] && /bin/machine` + +COMMAND=`echo $0 | sed -e 's,.*/,,'` +USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-s severity] + [-c address] [--request-id] [--version]" +REMOVE= +BATCH= +CC= +SEVERITY_C= + +while [ $# -gt 0 ]; do + case "$1" in + -r) ;; # Ignore for backward compat. + -t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi + shift ; GNATS_ADDR="$1" + EXPLICIT_GNATS_ADDR=true + ;; + -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi + shift ; IN_FILE="$1" + if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then + echo "$COMMAND: cannot read $IN_FILE" + exit 1 + fi + ;; + -b | --batch) BATCH=true ;; + -c | --cc) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi + shift ; CC="$1" + ;; + -s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi + shift ; SEVERITY_C="$1" + ;; + -p | -P | --print) PRINT=true ;; + -L | --list) FORMAT=norm ;; + -l | -CL | --lisp) FORMAT=lisp ;; + --request-id) REQUEST_ID=true ;; + -h | --help) echo "$USAGE"; exit 0 ;; + -V | --version) echo "$VERSION"; exit 0 ;; + -*) echo "$USAGE" ; exit 1 ;; + *) if [ -z "$USER_GNATS_SITE" ]; then + if [ ! -r "$DATADIR/gnats/$1" ]; then + echo "$COMMAND: the GNATS site $1 does not have a categories list." + exit 1 + else + # The site name is the alias they'll have to have created. + USER_GNATS_SITE=$1 + fi + else + echo "$USAGE" ; exit 1 + fi + ;; + esac + shift +done + +if [ -n "$USER_GNATS_SITE" ] && [ "$USER_GNATS_SITE" != "$GNATS_SITE" ]; then + GNATS_SITE=$USER_GNATS_SITE + GNATS_ADDR=$USER_GNATS_SITE-gnats +fi + +if [ "$SUBMITTER" = "unknown" -a -z "$REQUEST_ID" -a -z "$IN_FILE" ]; then + cat << '__EOF__' +It seems that send-pr is not installed with your unique submitter-id. +You need to run + + install-sid YOUR-SID + +where YOUR-SID is the identification code you received with `send-pr'. +`send-pr' will automatically insert this value into the template field +`>Submitter-Id'. If you've downloaded `send-pr' from the Net, use `net' +for this value. If you do not know your id, run `send-pr --request-id' to +get one from your support site. +__EOF__ + exit 1 +fi + +if [ -r "$DATADIR/gnats/$GNATS_SITE" ]; then + CATEGORIES=`grep -v '^#' $DATADIR/gnats/$GNATS_SITE | sort` +else + echo "$COMMAND: could not read $DATADIR/gnats/$GNATS_SITE for categories list." + exit 1 +fi + +if [ -z "$CATEGORIES" ]; then + echo "$COMMAND: the categories list for $GNATS_SITE was empty!" + exit 1 +fi + +case "$FORMAT" in + lisp) echo "$CATEGORIES" | \ + awk 'BEGIN {printf "( "} {printf "(\"%s\") ",$0} END {printf ")\n"}' + exit 0 + ;; + norm) l=`echo "$CATEGORIES" | \ + awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } } + END {print max + 1;}'` + c=`expr 70 / $l` + if [ $c -eq 0 ]; then c=1; fi + echo "$CATEGORIES" | \ + awk 'BEGIN {print "Known categories:"; i = 0 } + { printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } } + END { print ""; }' + exit 0 + ;; +esac + +ORIGINATOR_C='' +ORGANIZATION_C='' +CONFIDENTIAL_C='<[ yes | no ] (one line)>' +SYNOPSIS_C='' +if [ -z "$SEVERITY_C" ]; then + SEVERITY_C='<[ non-critical | serious | critical ] (one line)>' +fi +PRIORITY_C='<[ low | medium | high ] (one line)>' +CATEGORY_C='' +CLASS_C='<[ sw-bug | doc-bug | change-request | support ] (one line)>' +RELEASE_C='' +ENVIRONMENT_C='' +DESCRIPTION_C='' +HOW_TO_REPEAT_C='' +FIX_C='' + +# Catch some signals. ($xs kludge needed by Sun /bin/sh) +xs=0 +trap 'rm -f $REF $TEMP; exit $xs' 0 +trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit' 1 2 3 13 15 + +# If they told us to use a specific file, then do so. +if [ -n "$IN_FILE" ]; then + if [ "$IN_FILE" = "-" ]; then + # The PR is coming from the standard input. + if [ -n "$EXPLICIT_GNATS_ADDR" ]; then + sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP + else + cat > $TEMP + fi + else + # Use the file they named. + if [ -n "$EXPLICIT_GNATS_ADDR" ]; then + sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP + else + cat $IN_FILE > $TEMP + fi + fi +else + + if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then + # If their PR_FORM points to a bogus entry, then bail. + if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then + echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM" + sleep 1 + PRINT_INTERN=bad_prform + fi + fi + + if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then + cp $PR_FORM $TEMP || + ( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit ) + else + for file in $TEMP $REF ; do + cat > $file << '__EOF__' +SEND-PR: -*- send-pr -*- +SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as +SEND-PR: will all comments (text enclosed in `<' and `>'). +SEND-PR: +SEND-PR: Please consult the send-pr man page `send-pr(1)' or the Texinfo +SEND-PR: manual if you are not sure how to fill out a problem report. +SEND-PR: +SEND-PR: Choose from the following categories: +SEND-PR: +__EOF__ + + # Format the categories so they fit onto lines. + l=`echo "$CATEGORIES" | \ + awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } } + END {print max + 1;}'` + c=`expr 61 / $l` + if [ $c -eq 0 ]; then c=1; fi + echo "$CATEGORIES" | \ + awk 'BEGIN {printf "SEND-PR: "; i = 0 } + { printf ("%-'$l'.'$l's", $0); + if ((++i % '$c') == 0) { printf "\nSEND-PR: " } } + END { printf "\nSEND-PR:\n"; }' >> $file + + cat >> $file << __EOF__ +To: $GNATS_ADDR +Subject: +From: $FROM +Reply-To: $REPLYTO +Cc: $CC +X-send-pr-version: $VERSION + + +>Submitter-Id: $SUBMITTER +>Originator: $ORIGINATOR +>Organization: +${ORGANIZATION- $ORGANIZATION_C} +>Confidential: $CONFIDENTIAL_C +>Synopsis: $SYNOPSIS_C +>Severity: $SEVERITY_C +>Priority: $PRIORITY_C +>Category: $CATEGORY_C +>Class: $CLASS_C +>Release: ${DEFAULT_RELEASE-$RELEASE_C} +>Environment: + $ENVIRONMENT_C +`[ -n "$SYSTEM" ] && echo System: $SYSTEM` +`[ -n "$ARCH" ] && echo Architecture: $ARCH` +`[ -n "$MACHINE" ] && echo Machine: $MACHINE` +>Description: + $DESCRIPTION_C +>How-To-Repeat: + $HOW_TO_REPEAT_C +>Fix: + $FIX_C +__EOF__ + done + fi + + if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then + cat $TEMP + xs=0; exit + fi + + chmod u+w $TEMP + if [ -z "$REQUEST_ID" ]; then + eval $EDIT $TEMP + else + ed -s $TEMP << '__EOF__' +/^Subject/s/^Subject:.*/Subject: request for a customer id/ +/^>Category/s/^>Category:.*/>Category: send-pr/ +w +q +__EOF__ + fi + + if cmp -s $REF $TEMP ; then + echo "$COMMAND: problem report not filled out, therefore not sent" + xs=1; exit + fi +fi + +# +# Check the enumeration fields + +# This is a "sed-subroutine" with one keyword parameter +# (with workaround for Sun sed bug) +# +SED_CMD=' +/$PATTERN/{ +s||| +s|<.*>|| +s|^[ ]*|| +s|[ ]*$|| +p +q +}' + + +while [ -z "$REQUEST_ID" ]; do + CNT=0 + + # 1) Confidential + # + PATTERN=">Confidential:" + CONFIDENTIAL=`eval sed -n -e "\"$SED_CMD\"" $TEMP` + case "$CONFIDENTIAL" in + ""|yes|no) CNT=`expr $CNT + 1` ;; + *) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;; + esac + # + # 2) Severity + # + PATTERN=">Severity:" + SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP` + case "$SEVERITY" in + ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;; + *) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'." + esac + # + # 3) Priority + # + PATTERN=">Priority:" + PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP` + case "$PRIORITY" in + ""|low|medium|high) CNT=`expr $CNT + 1` ;; + *) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'." + esac + # + # 4) Category + # + PATTERN=">Category:" + CATEGORY=`eval sed -n -e "\"$SED_CMD\"" $TEMP` + FOUND= + for C in $CATEGORIES + do + if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi + done + if [ -n "$FOUND" ]; then + CNT=`expr $CNT + 1` + else + if [ -z "$CATEGORY" ]; then + echo "$COMMAND: you must include a Category: field in your report." + else + echo "$COMMAND: \`$CATEGORY' is not a known category." + fi + fi + # + # 5) Class + # + PATTERN=">Class:" + CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP` + case "$CLASS" in + ""|sw-bug|doc-bug|change-request|support) CNT=`expr $CNT + 1` ;; + *) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'." + esac + + [ $CNT -lt 5 -a -z "$BATCH" ] && + echo "Errors were found with the problem report." + + while true; do + if [ -z "$BATCH" ]; then + $ECHON1 "a)bort, e)dit or s)end? $ECHON2" + read input + else + if [ $CNT -eq 5 ]; then + input=s + else + input=a + fi + fi + case "$input" in + a*) + if [ -z "$BATCH" ]; then + echo "$COMMAND: the problem report remains in $BAD and is not sent." + mv $TEMP $BAD + else + echo "$COMMAND: the problem report is not sent." + fi + xs=1; exit + ;; + e*) + eval $EDIT $TEMP + continue 2 + ;; + s*) + break 2 + ;; + esac + done +done +# +# Remove comments and send the problem report +# (we have to use patterns, where the comment contains regex chars) +# +# /^>Originator:/s;$ORIGINATOR;; +sed -e " +/^SEND-PR:/d +/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;; +/^>Confidential:/s;<.*>;; +/^>Synopsis:/s;$SYNOPSIS_C;; +/^>Severity:/s;<.*>;; +/^>Priority:/s;<.*>;; +/^>Category:/s;$CATEGORY_C;; +/^>Class:/s;<.*>;; +/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;; +/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;; +/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;; +/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;; +/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;; +" $TEMP > $REF + +if $MAIL_AGENT < $REF; then + echo "$COMMAND: problem report sent" + xs=0; exit +else + echo "$COMMAND: mysterious mail failure." + if [ -z "$BATCH" ]; then + echo "$COMMAND: the problem report remains in $BAD and is not sent." + mv $REF $BAD + else + echo "$COMMAND: the problem report is not sent." + fi + xs=1; exit +fi diff --git a/lib-src/tm-au b/lib-src/tm-au new file mode 100755 index 0000000..4309ebe --- /dev/null +++ b/lib-src/tm-au @@ -0,0 +1,57 @@ +#!/bin/sh - +# +# $Id: tm-au,v 1.6 1997/02/15 22:20:26 steve Exp $ +# +# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, 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 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. + +PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH + +if [ "$TM_TMP_DIR" = "" ]; then + TM_TMP_DIR=/tmp + export TM_TMP_DIR +fi + +if [ "$5" = "" ]; then + filename="$TM_TMP_DIR/mime$$.au" +else + filename="$TM_TMP_DIR/$5" +fi + + +case "$4" in +"play") + echo "$2; $3 ->" + tmdecode $3 $1 $filename + if [ "$AUDIOSERVER" = "" ]; then + case "`uname`" in + IRIX ) sfplay $filename ;; + OSF1 ) decsound -play $filename ;; + * ) cat $filename > /dev/audio ;; + esac + else + autool -v 40 $filename + fi + + trap 'rm -f $filename' 0 1 2 3 13 15 + ;; +"extract") + echo "$2; $3 -> $filename" + echo "extract to $filename" + tmdecode $3 $1 $filename + ;; +esac diff --git a/lib-src/tm-file b/lib-src/tm-file new file mode 100755 index 0000000..359b357 --- /dev/null +++ b/lib-src/tm-file @@ -0,0 +1,38 @@ +#!/bin/sh - +# +# $Id: tm-file,v 1.4 1997/01/30 02:22:30 steve Exp $ +# +# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, 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 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. + +PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH + +if [ "$TM_TMP_DIR" = "" ]; then + TM_TMP_DIR=/tmp + export TM_TMP_DIR +fi + +if [ "$5" = "" ]; then + filename="$TM_TMP_DIR/mime$$" +else + filename="$TM_TMP_DIR/$5" +fi + + +echo "$2; $3 -> $filename" + +tmdecode $3 $1 $filename diff --git a/lib-src/tm-html b/lib-src/tm-html new file mode 100755 index 0000000..aa4d27d --- /dev/null +++ b/lib-src/tm-html @@ -0,0 +1,62 @@ +#!/bin/sh +# +# $Id: tm-html,v 1.4 1997/01/30 02:22:30 steve Exp $ +# +# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, 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 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. + +PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH + +if [ "$TM_TMP_DIR" = "" ]; then + TM_TMP_DIR=/tmp + export TM_TMP_DIR +fi + +if [ "$TM_WWW_BROWSER" = "" ]; then + TM_WWW_BROWSER=netscape + export TM_WWW_BROWSER +fi + +if [ "$5" = "" ]; then + filename="$TM_TMP_DIR/mime$$.html" +else + filename="$TM_TMP_DIR/$5" +fi + +echo "$2; $3 -> $filename" + +tmdecode "$3" $1 $filename + +case "$4" in +"play") + if [ `echo $TM_WWW_BROWSER | grep netscape` ]; then + echo netscape + if [ -h $HOME/.netscape/lock ]; then + netscape -remote "openURL(file:$filename,new-window)" + else + netscape $filename + fi + else + echo not netscape + $TM_WWW_BROWSER $filename + fi + trap 'rm -f $filename' 0 1 2 3 13 15 + ;; +"extract") + echo "extract to $filename" + ;; +esac diff --git a/lib-src/tm-image b/lib-src/tm-image new file mode 100755 index 0000000..78646e1 --- /dev/null +++ b/lib-src/tm-image @@ -0,0 +1,71 @@ +#!/bin/sh - +# +# $Id: tm-image,v 1.4 1997/01/30 02:22:30 steve Exp $ +# +# Copyright 1994, 1995, 1996 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, 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 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. + +PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH + +if [ "$TM_TMP_DIR" = "" ]; then + TM_TMP_DIR=/tmp + export TM_TMP_DIR +fi +if [ "$5" = "" ]; then + case "$2" in + "image/gif") + filename="$TM_TMP_DIR/mime$$.gif" + ;; + "image/jpeg") + filename="$TM_TMP_DIR/mime$$.jpg" + ;; + "image/tiff"|"image/x-tiff") + filename="$TM_TMP_DIR/mime$$.tif" + ;; + "image/x-xwd") + filename="$TM_TMP_DIR/mime$$.xwd" + ;; + "image/x-xbm") + filename="$TM_TMP_DIR/mime$$.xbm" + ;; + "image/x-pic") + filename="$TM_TMP_DIR/mime$$.pic" + ;; + "image/x-mag") + filename="$TM_TMP_DIR/mime$$.mag" + ;; + *) + filename="$TM_TMP_DIR/mime$$.img" + ;; + esac +else + filename="$TM_TMP_DIR/$5" +fi + +echo "$2; $3 -> $filename" + +tmdecode $3 $1 $filename + +case "$4" in +"play") + xv -geometry +1+1 $filename + trap 'rm -f $filename' 0 1 2 3 13 15 + ;; +"extract") + echo "extract to $filename" + ;; +esac diff --git a/lib-src/tm-mpeg b/lib-src/tm-mpeg new file mode 100755 index 0000000..88c5c1c --- /dev/null +++ b/lib-src/tm-mpeg @@ -0,0 +1,50 @@ +#!/bin/sh - +# +# $Id: tm-mpeg,v 1.4 1997/01/30 02:22:30 steve Exp $ +# +# Copyright 1994, 1995, 1996 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, 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 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. + +PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH + +if [ "$TM_TMP_DIR" = "" ]; then + TM_TMP_DIR=/tmp + export TM_TMP_DIR +fi +if [ "$5" = "" ]; then + filename="$TM_TMP_DIR/mime$$.mpg" +else + filename="$TM_TMP_DIR/$5" +fi + +echo "$2; $3 -> $filename" + +tmdecode $3 $1 $filename + +case "$4" in +"play") + if [ "$VIDEO_DITHER" = "" ]; then + VIDEO_DITHER=gray + export VIDEO_DITHER + fi + mpeg_play -dither $VIDEO_DITHER $filename + trap 'rm -f $filename' 0 1 2 3 13 15 + ;; +"extract") + echo "extract to $filename" + ;; +esac diff --git a/lib-src/tm-plain b/lib-src/tm-plain new file mode 100755 index 0000000..7035779 --- /dev/null +++ b/lib-src/tm-plain @@ -0,0 +1,48 @@ +#!/bin/sh - +# +# $Id: tm-plain,v 1.4 1997/01/30 02:22:30 steve Exp $ +# +# Copyright 1994,1995,1996,1997 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, 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 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. + +PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH + +if [ "$TM_TMP_DIR" = "" ]; then + TM_TMP_DIR=/tmp + export TM_TMP_DIR +fi +if [ "$5" = "" ]; then + filename="$TM_TMP_DIR/mime$$.pln" +else + filename="$TM_TMP_DIR/$5" +fi + +case "$4" in +"play") + echo "$2; $3 ->" + tmdecode "$3" "$1" /dev/stdout + ;; +"extract") + echo "$2; $3 -> $filename" + echo "extract to $filename" + tmdecode "$3" "$1" $filename + ;; +"print") + echo "$2; $3 ->" + tmdecode "$3" "$1" /dev/stdout | lpr + ;; +esac diff --git a/lib-src/tm-ps b/lib-src/tm-ps new file mode 100755 index 0000000..d816945 --- /dev/null +++ b/lib-src/tm-ps @@ -0,0 +1,50 @@ +#!/bin/sh - +# +# $Id: tm-ps,v 1.4 1997/01/30 02:22:30 steve Exp $ +# +# Copyright 1994, 1995, 1996 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, 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 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. + +PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH + +if [ "$TM_TMP_DIR" = "" ]; then + TM_TMP_DIR=/tmp + export TM_TMP_DIR +fi +if [ "$5" = "" ]; then + filename="$TM_TMP_DIR/mime$$.pln" +else + filename="$TM_TMP_DIR/$5" +fi + +case "$4" in +"play") + echo "$2; $3 -> $filename" + tmdecode $3 $1 $filename + ghostview $filename + trap 'rm -f $filename' 0 1 2 3 13 15 + ;; +"extract") + echo "$2; $3 -> $filename" + echo "extract to $filename" + tmdecode "$3" "$1" $filename + ;; +"print") + echo "$2; $3 ->" + tmdecode "$3" "$1" /dev/stdout | lpr + ;; +esac diff --git a/lib-src/tmdecode b/lib-src/tmdecode new file mode 100755 index 0000000..ebb02fc --- /dev/null +++ b/lib-src/tmdecode @@ -0,0 +1,59 @@ +#!/bin/sh - +# +# $Id: tmdecode,v 1.4 1997/01/30 02:22:30 steve Exp $ +# +# Copyright 1994, 1995, 1996 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, 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 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. + +PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH + +trap 'rm -f $2' 0 1 2 3 13 15 + +case "$3" in +/dev/stdout) + OUTPUT= + ;; +*) + OUTPUT='> $3' + ;; +esac + +case "$1" in +""|"7bit"|"8bit"|"binary") + eval "cat $2 $OUTPUT" + ;; +"base64") + #eval "decode-b < $2 $OUTPUT" + eval "mmencode -u $2 $OUTPUT" + ;; +"quoted-printable") + eval "mmencode -q -u $2 $OUTPUT" + ;; +"x-uue"|"x-uuencode") + (cd $TM_TMP_DIR ; uudecode $2) + ;; +"x-gzip64") + #eval "decode-b < $2 | gzip -cd $OUTPUT" + eval "mmencode -u $2 | gzip -cd $OUTPUT" + ;; +*) + echo "unknown encoding" + exit -1 + ;; +esac + +# echo "$2 was removed." diff --git a/lib-src/update-elc.sh b/lib-src/update-elc.sh new file mode 100644 index 0000000..5d3f461 --- /dev/null +++ b/lib-src/update-elc.sh @@ -0,0 +1,190 @@ +#!/bin/sh +# update-elc.sh --- recompile all missing or out-of-date .elc files + +# Author: Jamie Zawinski, Ben Wing, Martin Buchholz +# Maintainer: Martin Buchholz +# Keywords: recompile byte-compile .el .elc + +# This file is part of XEmacs. + +# XEmacs is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# XEmacs is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with XEmacs; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +### Commentary: +## Recompile all .elc files that need recompilation. Requires a +## working version of "xemacs". Correctly handles the case where the +## .elc files are missing; thus you can execute "rm lisp/*/*.elc" +## before running this script. Run this from the parent of the +## "lisp" directory, or another nearby directory. + +set -e + +# Try to find the lisp directory in several places. +# (Sun workspaces have an "editor" directory) +for dir in . .. ../.. editor ../editor ; do + if test -d $dir/lisp/. ; then cd $dir ; break ; fi +done + +if test ! -d lisp/. ; then + echo "$0: Cannot find the \"lisp\" directory." + exit 1 +fi + +if test -z "$EMACS"; then EMACS="./src/xemacs"; fi +export EMACS + +echo " (using $EMACS)" + +# fuckin' sysv, man... +if [ "`uname -r | sed 's/[^0-9]*\([0-9]*\).*/\1/'`" -gt 4 ]; then + echon() + { + /bin/echo $* '\c' + } +else + echon() + { + echo -n $* + } +fi + +EMACS_DIR=`cd \`dirname $EMACS\` && pwd`; +CANON_PWD=`pwd` +# Account for various system automounter configurations +if test -d "/net"; then + if test -d "/tmp_mnt/net"; then tdir="/tmp_mnt/net"; else tdir="/tmp_mnt"; fi + EMACS_DIR=`echo "$EMACS_DIR" | \ + sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"` + CANON_PWD=`echo "$CANON_PWD" | \ + sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"` +fi +REAL="$EMACS_DIR/`basename $EMACS`" + +echo "Recompiling in $CANON_PWD" +echo " with $REAL..." + +BYTECOMP="$REAL -batch -vanilla " + +$EMACS -batch -vanilla -l $CANON_PWD/lisp/cleantree -f batch-remove-old-elc lisp + +prune_vc="( -name '.*' -o -name SCCS -o -name RCS -o -name CVS ) -prune -o" + +# $els is a list of all .el files +# $elcs is a list of all .elc files +els=/tmp/update-elc-1.$$ elcs=/tmp/update-elc-2.$$ +rm -f $els $elcs +trap "rm -f $els $elcs" 0 1 2 3 15 +find lisp/. $prune_vc -name '*.el' -print | sort > $els +find lisp/. $prune_vc -name '*.elc' -print | sed 's/elc$/el/' | sort > $elcs + + +echon "Deleting .elc files without .el files..." +comm -13 $els $elcs | sed -e '\!/vm.el!d' -e 's/el$/elc/' | \ + while read file ; do echo rm "$file" ; rm "$file" ; done +echo done. + + +# Compute patterns to ignore when searching for files +ignore_dirs="" +ignore_pattern='' + +# Only use Mule XEmacs to compile Mule-specific elisp dirs +echon "Checking for Mule support..." +lisp_prog='(princ (featurep (quote mule)))' +mule_p="`$EMACS -batch -vanilla -eval \"$lisp_prog\"`" +if test "$mule_p" = nil ; then + echo No + ignore_dirs="$ignore_dirs mule" +else + echo Yes +fi + +# first recompile the byte-compiler, so that the other compiles take place +# with the latest version (assuming we're compiling the lisp dir of the emacs +# we're running, which might not be the case, but often is.) +#echo "Checking the byte compiler..." +#$BYTECOMP -f batch-byte-recompile-directory lisp/bytecomp + +# Prepare for byte-compiling directories with directory-specific instructions +# Not necessary any more, but I want to keep the text current to cut & paste +# into the package lisp maintenance tree. +#make_special_commands='' +#make_special () { +# dir="$1"; shift; +# ignore_dirs="$ignore_dirs $dir" +# make_special_commands="$make_special_commands \ +#echo \"Compiling in lisp/$dir\"; \ +#(cd \"lisp/$dir\" && ${MAKE:-make} EMACS=$REAL ${1+$*}); \ +#echo \"lisp/$dir done.\";" +#} + +#if test "$mule_p" != nil; then +# make_special skk all +#fi + +## AUCTeX is a package now +# if test "$mule_p" = nil ; then +# make_special auctex some +# else +# make_special auctex some MULE_ELC=tex-jp.elc +# fi +#make_special cc-mode all +# EFS is now packaged +# make_special efs x20 +#make_special eos -k # not strictly necessary... +## make_special gnus some # Now this is a package. +# hyperbole is now packaged +# make_special hyperbole elc +# We're not ready for the following, yet. +#make_special ilisp XEmacsELC=custom-load.elc elc +# ilisp is now packaged +# make_special ilisp elc +# oobr is now packaged +# make_special oobr HYPB_ELC='' elc +## W3 is a package now. +#make_special w3 xemacs-w3 + +for dir in $ignore_dirs ; do + ignore_pattern="${ignore_pattern}/\\/$dir\\//d +/\\/$dir\$/d +" +done + +# Other special-case filenames that don't get byte-compiled +ignore_pattern="$ignore_pattern"' +\!/,!d +\!/paths.el$!d +\!/loadup.el$!d +\!/loadup-el.el$!d +\!/update-elc.el$!d +\!/dumped-lisp.el$!d +\!/make-docfile.el$!d +\!/site-start.el$!d +\!/site-load.el$!d +\!/site-init.el$!d +\!/version.el$!d +\!/very-early-lisp.el$!d +' + +echo "Compiling files without .elc..." +NUMTOCOMPILE=20 # compile this many files with each invocation +comm -23 $els $elcs | \ + sed "$ignore_pattern" | \ + xargs -t -n$NUMTOCOMPILE $BYTECOMP -f batch-byte-compile +echo "Compiling files without .elc... Done" + +#if test "$mule_p" != nil; then +# eval "$make_special_commands" +#fi diff --git a/lib-src/winclient.c b/lib-src/winclient.c new file mode 100644 index 0000000..0399d99 --- /dev/null +++ b/lib-src/winclient.c @@ -0,0 +1,490 @@ +/* DDE client for XEmacs. + Copyright (C) 2002 Alastair J. Houghton + + 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. */ + +/* -- Pre-Include Defines --------------------------------------------------- */ + +#define STRICT + +/* -- Includes -------------------------------------------------------------- */ + +#include +#ifdef HAVE_CONFIG_H +# include +#endif +#include +#include +#include +#include + +static void error (const char* s1, const char* s2); +static void fatal (const char *s1, const char *s2); +static void * xmalloc (size_t size); +static char * getNextArg (const char **ptr, unsigned *len); + +/* -- Post-Include Defines -------------------------------------------------- */ + +/* Timeouts & delays */ +#define CONNECT_DELAY 500 /* ms */ +#define TRANSACTION_TIMEOUT 5000 /* ms */ +#define MAX_INPUT_IDLE_WAIT INFINITE /* ms */ + +/* DDE Strings */ +#define SERVICE_NAME "XEmacs" +#define TOPIC_NAME "System" +#define COMMAND_FORMAT "[open(\"%s%s\")]" + +/* XEmacs program name */ +#define PROGRAM_TO_RUN "xemacs.exe" + +/* -- Constants ------------------------------------------------------------- */ + +/* -- Global Variables ------------------------------------------------------ */ + +HINSTANCE hInstance; +DWORD idInst = 0; + +/* -- Function Declarations ------------------------------------------------- */ + +HDDEDATA CALLBACK ddeCallback (UINT uType, UINT uFmt, HCONV hconv, + HSZ hsz1, HSZ hsz2, HDDEDATA hdata, + DWORD dwData1, DWORD dwData2); + +int WINAPI WinMain (HINSTANCE hInst, + HINSTANCE hPrev, + LPSTR lpCmdLine, + int nCmdShow); + +static HCONV openConversation (void); +static void closeConversation (HCONV hConv); +static int doFile (HCONV hConv, LPSTR lpszFileName1, LPSTR lpszFileName2); +static int parseCommandLine (HCONV hConv, LPSTR lpszCommandLine); + +/* -- Function Definitions -------------------------------------------------- */ + +/* + * Name : ddeCallback + * Function: Gets called by DDEML. + * + */ + +HDDEDATA CALLBACK +ddeCallback (UINT uType, UINT uFmt, HCONV hconv, + HSZ hsz1, HSZ hsz2, HDDEDATA hdata, + DWORD dwData1, DWORD dwData2) +{ + return (HDDEDATA) NULL; +} + +/* + * Name : WinMain + * Function: The program's entry point function. + * + */ + +int WINAPI +WinMain (HINSTANCE hInst, + HINSTANCE hPrev, + LPSTR lpCmdLine, + int nCmdShow) +{ + HCONV hConv; + int ret = 0; + UINT uiRet; + + /* Initialise the DDEML library */ + uiRet = DdeInitialize (&idInst, + (PFNCALLBACK) ddeCallback, + APPCMD_CLIENTONLY + |CBF_FAIL_ALLSVRXACTIONS, + 0); + + if (uiRet != DMLERR_NO_ERROR) + { + MessageBox (NULL, "Could not initialise DDE management library.", + "winclient", MB_ICONEXCLAMATION | MB_OK); + + return 1; + } + + /* Open a conversation */ + hConv = openConversation (); + + if (hConv) + { + /* OK. Next, we need to parse the command line. */ + ret = parseCommandLine (hConv, lpCmdLine); + + /* Close the conversation */ + closeConversation (hConv); + } + + DdeUninitialize (idInst); + + return ret; +} + +/* + * Name : openConversation + * Function: Start a conversation. + * + */ + +static HCONV +openConversation (void) +{ + HSZ hszService = NULL, hszTopic = NULL; + HCONV hConv = NULL; + + /* Get the application (service) name */ + hszService = DdeCreateStringHandle (idInst, + SERVICE_NAME, + CP_WINANSI); + + if (!hszService) + { + MessageBox (NULL, "Could not create string handle for service.", + "winclient", MB_ICONEXCLAMATION | MB_OK); + + goto error; + } + + /* Get the topic name */ + hszTopic = DdeCreateStringHandle (idInst, + TOPIC_NAME, + CP_WINANSI); + + if (!hszTopic) + { + MessageBox (NULL, "Could not create string handle for topic.", + "winclient", MB_ICONEXCLAMATION | MB_OK); + + goto error; + } + + /* Try to connect */ + hConv = DdeConnect (idInst, hszService, hszTopic, NULL); + + if (!hConv) + { + STARTUPINFO sti; + PROCESS_INFORMATION pi; + int n; + + /* Try to start the program */ + ZeroMemory (&sti, sizeof (sti)); + sti.cb = sizeof (sti); + if (!CreateProcess (NULL, PROGRAM_TO_RUN, NULL, NULL, FALSE, 0, + NULL, NULL, &sti, &pi)) + { + MessageBox (NULL, "Could not start process.", + "winclient", MB_ICONEXCLAMATION | MB_OK); + + goto error; + } + + /* Wait for the process to enter an idle state */ + WaitForInputIdle (pi.hProcess, MAX_INPUT_IDLE_WAIT); + + /* Close the handles */ + CloseHandle (pi.hThread); + CloseHandle (pi.hProcess); + + /* Try to connect */ + for (n = 0; n < 5; n++) + { + Sleep (CONNECT_DELAY); + + hConv = DdeConnect (idInst, hszService, hszTopic, NULL); + + if (hConv) + break; + } + + if (!hConv) + { + /* Still couldn't connect. */ + MessageBox (NULL, "Could not connect to DDE server.", + "winclient", MB_ICONEXCLAMATION | MB_OK); + + goto error; + } + } + + /* Release the string handles */ + DdeFreeStringHandle (idInst, hszService); + DdeFreeStringHandle (idInst, hszTopic); + + return hConv; + + error: + if (hConv) + DdeDisconnect (hConv); + if (hszService) + DdeFreeStringHandle (idInst, hszService); + if (hszTopic) + DdeFreeStringHandle (idInst, hszTopic); + + return NULL; +} + +/* + * Name : closeConversation + * Function: Close a conversation. + * + */ + +static void +closeConversation (HCONV hConv) +{ + /* Shut down */ + DdeDisconnect (hConv); +} + +/* + * Name : doFile + * Function: Process a file. + * + */ + +int +doFile (HCONV hConv, LPSTR lpszFileName1, LPSTR lpszFileName2) +{ + char *buf = NULL; + unsigned len; + + /* Calculate the buffer length */ + len = strlen (lpszFileName1) + strlen (lpszFileName2) + + strlen (COMMAND_FORMAT); + + /* Allocate a buffer */ + buf = (char *) xmalloc (len); + + if (!buf) + { + MessageBox (NULL, "Not enough memory.", + "winclient", MB_ICONEXCLAMATION | MB_OK); + + return 1; + } + + /* Build the command */ + len = wsprintf (buf, COMMAND_FORMAT, lpszFileName1, lpszFileName2); + + len++; + + /* OK. We're connected. Send the message. */ + DdeClientTransaction (buf, len, hConv, NULL, + 0, XTYP_EXECUTE, TRANSACTION_TIMEOUT, NULL); + + free (buf); + + return 0; +} + +/* + * Name : getNextArg + * Function: Retrieve the next command line argument. + * + */ + +static char * +getNextArg (const char **ptr, unsigned *len) +{ + int in_quotes = 0, quit = 0, all_in_quotes = 0; + const char *p = *ptr, *start; + char *buf = NULL; + unsigned length = 0; + + /* Skip whitespace */ + while (*p && isspace (*p)) + p++; + + /* If this is the end, return NULL */ + if (!*p) + return NULL; + + /* Remember where we are */ + start = p; + + /* Find the next whitespace character outside quotes */ + if (*p == '"') + all_in_quotes = 1; + + while (*p && !quit) + { + switch (*p) + { + case '"': + in_quotes = 1 - in_quotes; + p++; + break; + + case '\\': + if (!in_quotes) + all_in_quotes = 0; + + p++; + + if (!*p) + break; + + p++; + break; + + default: + if (isspace (*p) && !in_quotes) + quit = 1; + else if (!in_quotes) + all_in_quotes = 0; + + if (!quit) + p++; + } + } + + /* Work out the length */ + length = p - start; + + /* Strip quotes if the argument is completely quoted */ + if (all_in_quotes) + { + start++; + length -= 2; + } + + /* Copy */ + buf = (char *) xmalloc (length + 1); + + if (!buf) + return NULL; + + strncpy (buf, start, length); + buf[length] = '\0'; + + /* Return the pointer and length */ + *ptr = p; + *len = length; + + return buf; +} + +/* + * Name : parseCommandLine + * Function: Process the command line. This program accepts a list of strings + * : (which may contain wildcards) representing filenames. + * + */ + +int +parseCommandLine (HCONV hConv, LPSTR lpszCommandLine) +{ + char *fullpath, *filepart; + char *arg; + unsigned len, pathlen; + int ret = 0; + HANDLE hFindFile = NULL; + WIN32_FIND_DATA wfd; + + /* Retrieve arguments */ + while ((arg = getNextArg ((const char**)&lpszCommandLine, &len)) != NULL) + { + /* First find the canonical path name */ + fullpath = filepart = NULL; + pathlen = GetFullPathName (arg, 0, fullpath, &filepart); + + fullpath = (char *) xmalloc (pathlen); + + if (!fullpath) + { + MessageBox (NULL, "Not enough memory.", "winclient", + MB_ICONEXCLAMATION | MB_OK); + + ret = 1; + free (arg); + + break; + } + + GetFullPathName (arg, pathlen, fullpath, &filepart); + + /* Find the first matching file */ + hFindFile = FindFirstFile (arg, &wfd); + + if (hFindFile == INVALID_HANDLE_VALUE) + ret = doFile (hConv, fullpath, ""); + else + { + /* Chop off the file part from the full path name */ + if (filepart) + *filepart = '\0'; + + /* For each matching file */ + do + { + /* Process it */ + ret = doFile (hConv, fullpath, wfd.cFileName); + + if (ret) + break; + } + while (FindNextFile (hFindFile, &wfd)); + + FindClose (hFindFile); + } + + /* Release the path name buffers */ + free (fullpath); + free (arg); + + if (ret) + break; + } + + return ret; +} + +static void +fatal (const char *s1, const char *s2) +{ + error (s1, s2); + exit (1); +} + +/* Print error message. `s1' is printf control string, `s2' is arg for it. */ +static void +error (const char* s1, const char* s2) +{ + fprintf (stderr, "winclient: "); + fprintf (stderr, s1, s2); + fprintf (stderr, "\n"); +} + +/* Like malloc but get fatal error if memory is exhausted. */ + +static void * +xmalloc (size_t size) +{ + void *result = malloc (size); + if (result == NULL) + fatal ("virtual memory exhausted", (char *) 0); + return result; +} diff --git a/lisp/.cvsignore b/lisp/.cvsignore index 41f4d7b..a7ad904 100644 --- a/lisp/.cvsignore +++ b/lisp/.cvsignore @@ -1,6 +1 @@ -ChangeLog.font-menu finder-inf.el -auto-autoloads.el -custom-load.el -auto-autoloads.el -custom-load.el diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 93e89a6..a8c5f60 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6329 +1,3 @@ -2002-11-02 Stephen J. Turnbull - - * XEmacs 21.4.10 "Military Intelligence" is released. - -2002-10-07 Katsumi Yamaoka - - * font-lock.el (font-lock-fontify-keywords-region): Fix typo. - -2002-10-07 Katsumi Yamaoka - - * keydefs.el (global-map): Bind C-xrd to delete-rectangle per GNU. - -2001-05-10 Daiki Ueno - - * font-lock.el (font-lock-compile-keywords): Rewrite as a side - effect free function. - (font-lock-fontify-keywords-region): Supply the argument to - font-lock-compile-keywords. - -2002-09-22 Ville Skyttä - - * package-get.el (package-get-download-sites): Bring sites list - up to date, prefer xx.xemacs.org addresses. - -2002-09-27 Andy Piper - - * dialog.el (make-dialog-box): for general dialogs only - delete-frame-hook will be run. - -2002-09-28 Stephen J. Turnbull - - * font-lock.el (font-lock-fontify-syntactically-region): Add - comment about lookup-syntax-properties, document LOUDLY as unused. - -2002-08-26 Andy Piper - - * gutter-items.el (set-progress-feedback-instantiator): Fix bad - merge. - -2002-09-02 Ville Skyttä - - * bytecomp-runtime.el (make-obsolete): Docstring argument nit. - (make-obsolete-variable): Ditto. - (make-compatible): Ditto. - (make-compatible-variable): Ditto. - -2002-09-16 Stephen J. Turnbull - - * obsolete.el (parse-sexp-lookup-properties): new compatible alias - for `lookup-syntax-properties'. RFE from Alan Mackenzie. - -2002-08-28 Andy Piper - - * files.el (revert-buffer): propagate revert-without-query-status. - -2002-06-03 Andy Piper - - * dialog-items.el (make-search-dialog): align various subcontrols - in visually pleasing ways, allow frame to autosize to the dialog - size. - * dialog.el (make-dialog-box): add a border inside the frame. Add - :autosize property, if t then reset the frame size appropriately - before the frame is mapped. - * gutter-items.el (set-progress-feedback-instantiator): align - various subcontrols. - * gutter-items.el (set-progress-abort-instantiator): ditto. - -2002-08-23 Stephen J. Turnbull - - * XEmacs 21.4.9 "Informed Management" is released. - -2002-06-22 Ville Skyttä - - * subr.el (add-to-list): Sync with GNU Emacs 21.2, adding the - "&optional append" argument. - -2002-07-16 Didier Verna - - * subr.el (replace-in-string): fix case fold bug introduced by - "2000-07-30 Ben Wing ": honor the value of - case-fold-search in temporary buffers. - -2002-08-03 Steve Youngs - - * lib-complete.el (find-library): Remove check for mule because - decompression DOES work on Mule. - -2002-08-11 John Paul Wallington - - * simple.el (join-line): New alias for `delete-indentation'. - -2002-08-02 Ville Skyttä - - * font-lock.el: Some faces and doc typo fixes from GNU Emacs. - (font-lock-doc-face): New alias to font-lock-doc-string-face. - (font-lock-builtin-face): New. - (font-lock-constant-face): New. - (font-lock-face-list): Add builtin and constant faces. - -2002-08-16 Stephen J. Turnbull - - * autoload.el (make-autoload): Support define-derived-mode. - Collected puts of doc-string-elt property. Based on a patch by - Didier Verna . - -2002-08-15 Stephen J. Turnbull - - * wid-edit.el (widget-field-activate): Fix docstring typo. - -2002-07-23 Andy Piper - - * about.el (about-personal-info): update me. - -2002-07-12 Andy Piper - - * custom.el (custom-theme-set-variables): remove bogus - arguments. Use custom-set-default to set defaults. - (custom-set-variables): update doc. - (custom-local-buffer): new, synced from FSF. - (custom-set-default): ditto. - (defcustom): update doc. - -2002-06-16 Andy Piper - - * menubar-items.el (default-menubar): enable windows printing on - cygwin as well as native. - -2002-06-12 Andy Piper - - * printer.el (generic-print-buffer): catch all errors so that the - print device can be cleared in all scenarios. - (Printer-clear-device): make sure clearing the printer allows it - to be used again immediately. - (generic-print-region): make sure the default printer face is - black-on-white. - -2002-04-23 Jerry James - - * window-xemacs.el (display-buffer-function): Change doc to - reflect new arg. - * window-xemacs.el (pre-display-buffer-function): Ditto. - * window-xemacs.el (display-buffer): New arg, shrink-to-fit. If - non-nil, make the new window just big enough for its contents. - * frame.el (get-frame-for-buffer): Accept new arg, due to above. - * frame.el (show-temp-buffer-in-current-frame): Remove broken - temp-buffer-shrink-to-fit code. Tell display-buffer instead. - -2002-06-06 Andy Piper - - * custom.el (custom-theme-set-variables): sync :set-after from FSF. - (defcustom): ditto. - (custom-handle-keyword): ditto. - -2002-07-12 Stephen J. Turnbull - - * gutter-items.el (buffers-tab-selection-function): Improve doc. - Make obsolete. Default to nil. - (buffers-tab-filter-functions): Improve doc. Use literal default. - Inspired by a patch by John Palmieri. - -2002-07-01 Mike Alexander - - * process.el (shell-command-on-region): Don't delete the region - before giving it to call-process-region - -2002-06-04 Jerry James - - * find-paths.el (paths-find-architecture-directory): Search in - `system-configuration'/`base', not `base'`system-configuration'. - -2002-06-23 Ville Skyttä - - * info.el (Info-index): Add missing \ in [ t]. - -2002-06-11 Stephen J. Turnbull - - * gutter-items.el (gutter-buffers-tab-visible-p, - buffers-tab-omit-function, buffers-tab-selection-function, - buffers-tab-filter-functions): - Doc improvements. - -2002-06-09 Stephen J. Turnbull - - * toolbar.el (toolbar-icon-directory): Document trailing separator. - - * toolbar-items.el (toolbar-news): Fix typo in message string. - -2002-06-08 Stephen J. Turnbull - - * dialog.el (yes-or-no-p-dialog-box): - * cmdloop.el (y-or-n-p-minibuf): - (yes-or-no-p-minibuf): - (yes-or-no-p): - (y-or-n-p): - Specify negative answers in docstrings. - -2002-05-25 Steve Youngs - - * package-ui.el (pui-help-echo): Display both installed and author - version. Use a balloon-help window to display extra info like - package requires. - -2002-05-30 Andy Piper - - * files.el (revert-buffer-internal): don't visit - revert-buffer. Kill buffer when not used. Suggested by Mike - Alexander - -2002-05-20 Stephen J. Turnbull - - * files.el (revert-buffer): More docstring fiddling. - -2002-05-19 Stephen J. Turnbull - - * files.el (revert-buffer): - (revert-buffer-internal): - (revert-buffer-insert-file-contents-function): - Improve docstrings and comments. - -2002-05-08 Andy Piper - - * files.el (revert-buffer): observe noconfirm behavior. - -2002-04-09 Andy Piper - - * files.el (revert-buffer): use revert-buffer-internal if it looks - like doing so will not result in any user-visible changes. - (revert-buffer-internal): new function. Do the actual process of - reversion and then see whether the result is any different to what - we have already. If it is not then do nothing. - -2001-12-11 Andy Piper - - * menubar.el (get-popup-menu-response): re-order so that it works - on more sane/facist window systems. - -2001-12-03 Andy Piper - - * faces.el (frob-face-property): don't infloop in face frobbing - from Jan Vroonhof . - -2001-11-30 Jan Vroonhof - - * faces.el (frob-face-property): Follow face fall-back hierarchy - properly for face properties without an instance. Only do manual - copy form 'default in last resort. This handles in particular - the case where 'default itself has only a fall-back (which is - the case by default on windows). - -2001-11-24 Andy Piper - - * printer.el (generic-print-region): set default-frame-plist to - nil while creating the printer frame so that sizes reflect the - printed page. - - * faces.el (face-complain-about-font): Don't complain on printers. - -2002-05-10 Stephen J. Turnbull - - * package-net.el: Andy synch. - -2001-12-16 Andy Piper - - * package-get.el (package-get-update-all): Make sure installed.db - gets updated after updating packages. - -2002-03-28 Ben Wing - - * msw-glyphs.el: Set glyph-contrib-p to nil on hscroll, - continuation, truncation so that we don't get line jumpiness from - them being larger than the line height. - - * msw-font-menu.el (mswindows-font-menu-font-data): Fix bug. - -2001-11-30 Jan Vroonhof - - * font.el (font-window-system-mappings): Add mapping for Gtk - (assume identical to X) - -2002-02-04 Andy Piper - - * files.el (convert-standard-filename): Fix for short filename - Peter Arius - -2001-12-10 Christoph Wedler - - * list-mode.el (default-choose-completion): completion-base-size - should refer to local value in the completion list buffer. - -2001-12-03 Didier Verna - - * rect.el: autoload `replace-rectangle'. - * keydefs.el (global-map): bind it to `C-x r p'. - -2002-05-09 Stephen J. Turnbull - - * XEmacs 21.4.8 "Honest Recruiter" is released. - -2002-05-09 Stephen J. Turnbull - - This patch is based on Jerry James's patch and analysis. - - * select.el (get-clipboard): - (get-selection): - Update docstrings. - (get-clipboard-foreign): - (get-selection-foreign): - New function for use as `interprogram-paste-function's. - - * simple.el (interprogram-paste-function): Change default to - `get-clipboard-foreign'; improve docstring. - (interprogram-cut-function): Improve dosctring. - -2002-05-04 Stephen J. Turnbull - - * XEmacs 21.4.7 "Economic Science" is released. - -2002-03-18 Adrian Aichner - - * cus-edit.el (customize-save-variable): Fix typo in prompt. - -2002-03-26 John Paul Wallington - - * obsolete.el (assq-delete-all): New compatibility alias for - remassq. - -2002-01-09 Simon Josefsson - - * files.el (auto-mode-alist): Support Sieve (*.siv, *.sieve). - -2002-01-04 Adrian Aichner - - * info.el (Info-auto-generate-directory): Default - Info-auto-generate-directory to 'if-outdated. - -2002-03-28 Stephen J. Turnbull - - * startup.el (normal-top-level): Prevent migration code from - trashing .emacs on an error in loading the init files. - -2002-03-14 Ville Skyttä - - * files.el (auto-mode-alist): GNUmakefile is a Makefile, - "system default" Xdefaults and friends get xrdb-mode. - -2002-03-05 Mats Lidell - - * help-nomule.el (tutorial-supported-languages): Added Swedish - tutorial. Sorted languages. - -2002-02-11 Mike Sperber - - * info.el (Info-maybe-update-dir): Regenerate dir if we're - regenerating outdated dir files and dir is non-existent. - -2002-01-27 Stephen J. Turnbull - - * code-files.el (convert-mbox-coding-system): Improve comment. - (write-region): Improve docstring. Reformat to 80 columns. Add - coding-system argument to `write-region-pre-hook' call. - (write-region-pre-hook): Fix docstring to mention lockname argument. - -2002-01-18 Stephen J. Turnbull - - * minibuf.el (completing-read): Remove redundant wrong arg list. - - * help.el (with-displaying-help-buffer): Put usage advice in docstring. - -2001-12-27 John Paul Wallington - - * obsolete.el (interactive-form): new compatibility alias for - function-interactive. - -2001-11-29 Adrian Aichner - - * menubar-items.el (Menubar-items-truncate-list): Removed. - * menubar-items.el (Menubar-items-truncate-history): New. - * menubar-items.el (default-menubar): Use - Menubar-items-truncate-history. - -2002-02-03 Adrian Aichner - - * printer.el (generic-print-region): Pass correct arguments to - lpr-region. Thanks to Nevin Kapur and Björn - Torkelsson . - -2002-01-09 John Paul Wallington - - * help.el (describe-mode): synched with FSF 19.34; handle nil - minor mode indicators. - -2001-12-03 Christoph Wedler - - * minibuf.el (completing-read): Update docstring. - -2001-12-17 Stephen J. Turnbull - - * XEmacs 21.4.6 "Common Lisp" is released. - -2001-11-21 Stephen J. Turnbull - - * package-net.el: Inadvertant synch with Windows branch. From - Andy's log: - (package-net-kit-version): new variable. - (package-net-generate-bin-ini): use it. Remove unwanted functions. - -2001-11-28 Steve Youngs - - * package-get.el (package-get-locate-index-file): Also search the - core etc/ directory for the package index file if it can't be - found in ~/.xemacs/. - -2001-12-13 William Perry - - * dialog-gtk.el (popup-builtin-question-dialog): - Conform to API in gui.c. - -2001-11-12 Andy Piper - - * cus-edit.el (custom-save-face-internal): make sure we save - non-themed faces. - (custom-save-variables): ditto variables. - -2001-11-20 Stephen J. Turnbull - - * faces.el (make-face-family): - (make-face-size): - New face-modifying functions per Jan Vroonhof. - - cus-face.el (custom-set-face-font-family): - (custom-set-face-font-size): - Use them. - - * font.el (font-window-system-mappings): More precise docstring. - - (font-create-name): - (font-create-object): - (tty-font-create-object): - (tty-font-create-plist): - (x-font-create-object): - (x-font-create-name): - (ns-font-create-name): - (mswindows-font-create-object): - (mswindows-font-create-name): - Add doctrings. - -2001-11-14 John Paul Wallington - - * gtk-faces.el (gtk-init-device-faces): removed spurious - quote before let* expression. - -2001-10-29 Andy Piper - - * code-files.el (toggle-buffer-file-coding-system): mark buffer as - modified when changing coding system. - - * toolbar-items.el (toolbar-dired): Use interactive "D" spec so - that we invoke the GUI directory selector. - -2001-10-25 Andy Piper - - * dialog.el (make-dialog-box): use new directory dialog support. - * minibuf.el (read-file-name-1): ditto. - (read-file-name): ditto. - (read-directory-name): ditto. - -2001-10-23 Stephen J. Turnbull - - * XEmacs 21.4.5 "Civil Service" is released. - -2001-04-23 Didier Verna - - * cus-edit.el (custom-variable-pre-save): New. - * cus-edit.el (custom-variable-post-save): New. - * cus-edit.el (custom-variable-save): use them. - * cus-edit.el (custom-face-pre-save): New. - * cus-edit.el (custom-face-post-save): New. - * cus-edit.el (custom-face-save): use them. - * cus-edit.el (custom-group-pre-save): New. - * cus-edit.el (custom-group-post-save): New. - * cus-edit.el (custom-group-save): use them. - * cus-edit.el (Custom-save): use the pre/post functions above, - call `custom-save-all' only once. - * cus-edit.el (custom-variable-pre-reset-standard): New. - * cus-edit.el (custom-variable-post-reset-standard): New. - * cus-edit.el (custom-variable-reset-standard): use them. - * cus-edit.el (custom-face-pre-reset-standard): New. - * cus-edit.el (custom-face-post-reset-standard): New. - * cus-edit.el (custom-face-reset-standard): use them. - * cus-edit.el (custom-group-pre-reset-standard): New. - * cus-edit.el (custom-group-post-reset-standard): New. - * cus-edit.el (Custom-reset-standard): use them. - * cus-edit.el (custom-face-reset-saved): use the pre/post - functions above, call `custom-save-all' only once. - -2001-04-08 Danny Colascione - - * gutter-items.el (buffers-tab face): Derive from the modeline - face by default. Many people use white-on-black for the default - font, and the tabs look hideous with that color combination. The - modeline usually has the correct colors. - -2001-09-28 Robert Pluim - - * etags.el (find-tag): Doc fix, point users at pop-tag-mark. - (tag-mark-stack-max): Typo fix. - -2001-09-28 Ben Wing - - * font-lock.el: - * font-lock.el (font-lock-after-change-function): - fix problem with last patch, reported by Katsumi Yamaoka. - -2001-09-17 Ben Wing - - * font-lock.el (font-lock-after-change-function): - fix problem when you insert a comment on the line before a line of - code: if we use the following char, then when you hit backspace, - the following line of code turns the comment color. - -2001-06-08 Ben Wing - - * process.el: comment about shell-command-switch. - * process.el (shell-quote-argument): Need to quote a null - argument, too. From Dan Holmsand. - - * startup.el (normal-top-level): Delete some unused FSF junk. - * startup.el (command-line-early): - - * startup.el (command-line): Call MS Windows init function. - - * win32-native.el: - * win32-native.el (mswindows-system-shells): New. - * win32-native.el (mswindows-system-shell-p): New. - * win32-native.el (init-mswindows-at-startup): New. - * win32-native.el (mswindows-quote-one-vc-runtime-arg): - * win32-native.el (mswindows-quote-one-simple-arg): - * win32-native.el (mswindows-quote-one-command-arg): - * win32-native.el (mswindows-construct-process-command-line-alist): - Correct comments at top. Correctly handle passing arguments - to Cygwin programs and to bash. Fix quoting of zero-length - arguments (from Dan Holmsand). Set shell-command-switch based - on shell-file-name, which in turn comes from env var SHELL. - -2001-07-18 Alexey Mahotkin - - * toolbar.el (toolbar-visible-p, toolbar-captioned-p, - default-toolbar-position): Fill docstrings for balloon-help. - -2001-03-15 Stephen J. Turnbull - - * faces.el: Reenable specifications over 'gtk domain. - -2001-08-08 Didier Verna - - * autoload.el (update-autoload-files): make defdir a file name, - not directory name. - -2001-08-06 Steve Youngs - - * menubar-items.el (default-menubar): Use 'report-xemacs-bug'. - - * lisp-mnt.el (lm-report-bug): Use 'report-xemacs-bug-beta-address'. - -2001-08-01 Edward M. Lee - - * font-menu.el (font-menu-set-font): Default to current font-family. - (font-menu-preferred-resolution): - (font-menu-size-scaling): - Provide gtk defaults, too. - -2001-07-29 Mike Alexander - - * cus-face.el (custom-set-face-font-size): Last arg to apply is a - list - (custom-set-face-font-family): ditto - -2001-07-26 Mike Sperber - - * files.el (auto-mode-alist): .9 files are man pages, too. - -2001-07-23 Edwin Steiner - - * process.el (call-process-internal): bind - coding-system-for-write to 'binary when calling - start-process-internal, so the process receives - the literal contents of INFILE. - -2001-09-15 Edward M. Lee - - * files.el (auto-mode-alist): Add configure.ac support. - -2001-07-19 Adrian Aichner - - * buff-menu.el: - mouse.el: - Adrian's mouse-track patch. See . - -2001-07-28 Stephen J. Turnbull - - * XEmacs 21.4.4 "Artificial Intelligence" is released. - -2001-07-10 Katsumi Yamaoka - - * mule/kinsoku.el (kinsoku-bol-p): Work with ascii and non-ascii - mixed text. - (kinsoku-eol-p): Ditto. - -2001-07-09 Katsumi Yamaoka - - * mule/kinsoku.el (kinsoku-ascii-eol, kinsoku-gb-bol, - kinsoku-gb-eol, kinsoku-big5-bol, kinsoku-big5-eol): Assign - characters as the category `s' or `e' correctly. - -2001-06-06 Alexey Mahotkin - - * mule/cyrillic.el: Uncomment definition of ccl-encode-koi8-r-font. - -2001-06-14 Alexey Mahotkin - - * mule/cyrillic.el: Set up case table. - -2001-06-08 Mike Sperber - - * files.el (save-some-buffers-1): Don't zap the help window right - after `map-y-or-n-p' has popped it up. - -2001-06-15 Nick Pakoulin - - * help.el (frob-help-extents): Require 'hyper-apropos for faces. - -2001-07-18 Stephen J. Turnbull - - * specifier.el: define-specifier-tag 'gtk. - -2001-05-12 Ben Wing - - * find-paths.el (paths-find-recursive-path): - fix error with null EXCLUDE-REGEXP. - - * font-lock.el (font-lock-mode): - fix problem reported by hrvoje with buffers starting with a space. - -2001-05-06 Ben Wing - - * dialog.el (make-dialog-box): - * menubar-items.el (default-menubar): - * printer.el (generic-print-buffer): - * printer.el (generic-print-region): - implement printing the selection when it's selected. - -2001-04-18 Didier Verna - - * cus-edit.el (Custom-reset-standard): reset to standard settings - not only when the buffer's :custom-state is 'modified, but also - when it is 'set or 'saved. - -2001-04-17 Didier Verna - - * startup.el (load-user-init-file): define `custom-file' before - loading the user's init file. - -2001-04-09 Danny Colascione - - * menubar.el (popup-mode-menu): Make it work with - popup-menu-titles turned off. - -2001-04-24 Hrvoje Niksic - - * about.el (about-mailto-link): Use compose-mail for sending mail. - -2001-07-14 Sean MacLennan - - * package-admin.el (package-install-hook): New. - (package-delete-hook): New. - (package-admin-add-single-file-package): Use package-delete-hook. - - * package-get.el (package-get): Use package-install-hook. - -2001-06-26 Robert Pluim - - * package-ui.el (pui-install-selected-packages): reverse the lists - of packages so that they get handled in the same order as they - were selected. - -2001-06-26 Robert Pluim - - * packages.el (locate-library): Use read-library-name for completion. - -2001-05-21 Martin Buchholz - - * byte-optimize.el (=): `=' is not a binary predicate! - Fix incorrect optimization: (= 0 0 (random 2)) ==> 0 or 1. - Use byte-optimize-predicate, not byte-optimize-binary-predicate, - -2001-05-20 Martin Buchholz - - * bytecomp.el (byte-compile-arithcompare): - Only optimize (= x) ==> t if byte-compile-delete-errors is not nil. - -2001-06-03 William M. Perry - - * dialog-gtk.el (popup-builtin-open-dialog): Don't forget to - return the filename selected by the user! - -2001-05-31 William M. Perry - - * font-menu.el: Avoid arithmetic with 'nil' when using the font menu - in XEmacs/GTK. - -2001-05-29 Alexey Mahotkin - - * coding.el: Tiny typo fixed. - -2001-05-17 Stephen J. Turnbull - - * XEmacs 21.4.3 "Academic Rigor" is released. - -2001-05-17 Stephen J. Turnbull - - * config.values.sh: lisp/utils?/config.el -> lisp/config.el. - -2001-05-10 Stephen J. Turnbull - - * XEmacs 21.4.2 "Developer-Friendly Unix APIs" is released. - -2001-05-04 Ben Wing - - * printer.el (generic-print-buffer): - * printer.el (generic-print-region): - Enable dialog boxes. Apply workaround recommended by Kirill. - fix (fboundp 'lpr-buffer) -> (fboundp 'lpr-region). - - * simple.el (kill-whole-line): - * simple.el (kill-line-1): - * simple.el (kill-entire-line): - * simple.el (kill-line): - * simple.el (backward-kill-line): - Take out interactive dependence of kill-whole-line. - -2001-04-22 Ben Wing - - * dialog.el (make-dialog-box): - Put dialog titles back in -- this time correctly. Fix various - other problems with leaks and such. - - * simple.el (region-exists-p): - * simple.el (region-active-p): - Add comment about which one is correct to use in menu specs. - -2001-05-05 Ben Wing - - * dialog.el (make-dialog-box): fix doc string. - * menubar-items.el (default-menubar): Add Page Setup for Windows, - take out Pretty Print. - * printer.el: - * printer.el (printer-current-device): New. - * printer.el (Printer-get-device): New. - * printer.el (Printer-clear-device): New. - * printer.el (generic-page-setup): New. - * printer.el (generic-print-buffer): - * printer.el (generic-print-region): - Implement Page Setup. Handle errors properly. - -2001-05-05 Ben Wing - - * subr.el (error): Complete list of errors in doc string. - -2001-04-22 Ben Wing - - * bytecomp-runtime.el (byte-compiler-options): Correct doc string. - -2001-05-03 Adrian Aichner - - * build-report.el: Remove CVS keywords since this file has been in - core lisp for a while now. - * build-report.el (build-report-make-output-files): Fix typo. - -2001-04-24 Hrvoje Niksic - - * about.el (about-finish-buffer): Make sure the last change works - even if EVENT is nil. - -2001-04-24 Hrvoje Niksic - - * about.el (about-finish-buffer): Kill/bury the buffer where the user - clicked, not the one that happens to be the current buffer at the - time. - -2001-03-19 Karl M. Hegbloom - - * cus-edit.el (custom-display): Support the GTK Window System also. - -2001-04-30 Ben Wing - - * printer.el: - * printer.el (printer-page-header): - * printer.el (Print-context): New. - * printer.el (printer-page-footer): - * printer.el (generate-header-element): New. - * printer.el (generate-header-line): New. - * printer.el (print-context-property): - * printer.el (generic-print-buffer): - * printer.el (generic-print-region): - Implement headers and footers. Implement calling Print dialog box - (#### but it doesn't quite work yet). - -2001-04-25 Ben Wing - - * about.el (xemacs-hackers): - * about.el (about-url-alist): - * about.el (about-personal-info): - * about.el (about-hacker-contribution): - More contributions. - - * simple.el (handle-post-motion-command): - Fix spurious setting of zmacs-region-stays to t after a non-shift - motion command. - -2001-04-24 Hrvoje Niksic - - * about.el (about-personal-info): Update my bio. - (about-hacker-contribution): Ditto. - -2001-04-23 Stephen J. Turnbull - - * startup.el (splash-frame-body): Update copyright notices: Ben, FSF. - -2001-04-19 Andy Piper - - * package-net.el (package-net-cygwin32-binary-size): new size. - (package-net-win32-binary-size): new size. - (package-net-convert-index-to-ini): Use new arch. - (package-net-batch-convert-index-to-ini): Removed. - (package-net-generate-bin-ini): New. - (package-net-batch-generate-bin-ini): New. - -2001-04-19 Stephen J. Turnbull - - * XEmacs 21.4.1 "Copyleft" is released. - -2001-04-19 Stephen J. Turnbull - - * x-compose.el (xlib-input-method-bug-workaround): - (alias-colon-to-double-quote): - Force sort in map-keymap to work around rehash bug. - -2001-04-17 Ben Wing - - * about.el: Finish overhaul, add a few new hackers, update a - couple old ones. - -2001-04-16 Stephen J. Turnbull - - * XEmacs 21.4.0 "Solid Vapor" is released. - -2001-04-15 Ben Wing - - * about.el: - * about.el (about-headline-face): New. - * about.el (about-link-face): New. - * about.el (about-current-release-maintainers): New. - * about.el (about-other-current-hackers): New. - * about.el (about-url-alist): - * about.el (about-once-and-future-hackers): New. - * about.el (about-mailto-link): New. - * about.el (about-get-buffer): - * about.el (about-finish-buffer): - * about.el (about-xemacs): - * about.el (about-features): Removed. - * about.el (about-advantages): New. - * about.el (about-maintainer-info): Removed. - * about.el (about-personal-info): New. - * about.el (about-hacker-contribution): New. - * about.el (about-maintainer): - * about.el (about-show-linked-info): - * about.el (about-hackers): - Major revamping. Rewriting of most of the text, improve the - link handling, separate info on contributors into personal - and contribution info, add new contributors, update personal - info, etc. etc. - - * menubar-items.el (default-menubar): - Help menubar entry for News now says more accurately - "What's New in XEmacs". - - * mouse.el: - * mouse.el (mouse-track-cleanup-hook): - * mouse.el (mouse-track): - Don't set-buffer to a dead buffer when calling mouse-track - cleanup hooks. - -2001-04-14 Stephen J. Turnbull - - * XEmacs 21.2.47 "Zephir" is released. - -2001-04-02 Jan Vroonhof - - * dialog.el (make-dialog-box): Disable dialog box titles until - we get them working. - -2001-03-30 Ben Wing - - * help.el: - * help.el (Help-princ-face): - * help.el (Help-prin1-face): - * help.el (frob-help-extents): - * help.el (describe-function-1): - * help.el (describe-variable): - Avoid using font-lock faces, which may not be defined. - Instead, use hyper-apropos faces, and make sure they're - defined as necessary by using `require'. (It's not so safe - to do this for font-lock.) In any case, we will eventually - be merging this functionality into hyper-apropos. - - * loaddefs.el (completion-ignored-extensions): - Fix documentation. - - * menubar-items.el (menu-truncate-list): Removed. - * menubar-items.el (Menubar-items-truncate-list): New. - * menubar-items.el (default-menubar): - Fix errors if grep or compile command is too long. Rename helper - function to be less visible. - -2001-03-23 Martin Buchholz - - * byte-optimize.el (byte-optimize-minus): - Fix mis-byte-compilation of (- 0 x) --> (- (- x)) - -2001-03-26 Hrvoje Niksic - - * dumped-lisp.el (preloaded-file-list): Load mule/latin.el when - Mule is available. - - * mule/latin.el: New file. - -2001-03-11 Ben Wing - - * auto-save.el: - * auto-save.el (auto-save-directory): - * auto-save.el (make-auto-save-file-name): - * auto-save.el (auto-save-file-name-p): New. - - Merge in improvements from other definition of - make-auto-save-file-name in files.el. - - * auto-save.el (auto-save-original-name): - * auto-save.el (auto-save-name-in-fixed-directory): - * auto-save.el (auto-save-unslashify-name): Removed. - * auto-save.el (auto-save-slashify-name): Removed. - * auto-save.el (auto-save-reserved-chars): New. - * auto-save.el (auto-save-escape-name): New. - * auto-save.el (auto-save-unhex): New. - * auto-save.el (auto-save-unescape-name): New. - - Change algorithm for encoding filenames in auto-save names to be - entirely safe with all filesystems and all possible characters in - a filename, and 100% reversible. (Essentially, uses - quoted-printable as the encoding.) - - * auto-save.el (recover-all-files): - - Use insert-directory rather than calling ls directly -- fixes - things under Windows. - - * files.el: - * files.el (convert-standard-filename): Substitute FSF's - definition for this (we had nothing here before). - - * files.el (backup-buffer): Warning fix. - - * files.el (make-backup-file-name): - * files.el (find-backup-file-name): - Fix error in calling sequence to auto-save-file-name-p. - - * files.el (recover-file): - Use insert-directory rather than calling ls directly -- fixes - things under Windows. - - * files.el (make-auto-save-file-name): Removed. - * files.el (auto-save-file-name-p): Removed. - auto-save is always dumped so no sense in having a definition - that will always be overwritten with another. - - * files.el (insert-directory): - * win32-native.el: - * win32-native.el (debug-mswindows-process-command-lines): - * win32-native.el (original-make-auto-save-file-name): Removed. - * win32-native.el (make-auto-save-file-name): Removed. - - -2001-03-21 Martin Buchholz - - * XEmacs 21.2.46 "Urania" is released. - -2001-03-16 Stephen J. Turnbull - - * menubar-items.el (default-menubar): Update sample.emacs to - sample.init.el and adjust accelerators. - -2001-02-02 Stephen J. Turnbull - - * build-report.el (build-report): Improve docstring. - -2001-03-15 Stephen J. Turnbull - - * ChangeLog: Log GTK merge. - - * gutter-items.el: - * mwheel.el: - * sound.el: - * startup.el: - Revert gratuitous whitespace changes. - -2001-03-07 Ben Wing - - * help.el: - * help.el (key-or-menu-binding): - * help.el (Help-find-file): New. - * help.el (describe-beta): - * help.el (describe-copying): - * help.el (describe-project): - * help.el (view-emacs-news): - * help.el (view-sample-init-el): New. - * help.el (Help-princ-face): New. - * help.el (Help-prin1-face): New. - * help.el (help-symbol-function-context-menu): - * help.el (help-symbol-variable-context-menu): - * help.el (help-symbol-function-and-variable-context-menu): - * help.el (frob-help-extents): - * help.el (describe-function-1): - * help.el (describe-variable): - - Add coloring in Help buffers, correspondent with hyperlinks. - View files in view-mode rather than Fundamental. - Remove separators from context menus -- now handled in generic code. - Add `Find Tag' to context menu. - - * menubar.el (popup-mode-menu): - - Rewrite code that outputs the popup menu to (a) put more specific - entries first, (b) be more robust, (c) output the proper context - menu separators automatically (the context menu functionality is - new and currently used only by Help). - -2001-03-10 William M. Perry - - * dialog-gtk.el (gtk-make-dialog-box-internal): Forgot to rewrite - this function when converting from the 21.1 GTK branch. Now - supports file, password, question, and color built-in dialogs. - -2001-03-06 Ben Wing - - * keydefs.el: - * keydefs.el (global-map): - Add commented-out change of M-k (for 21.5). - - * menubar-items.el (default-menubar): - Fix items to control kill-line behavior; add items for - shifted motion. - - * simple.el: - * simple.el (kill-whole-line): - * simple.el (historical-kill-line): Removed. - * simple.el (kill-line): Removed. - * simple.el (kill-entire-line): New. - * simple.el (kill-line-1): New. - * simple.el (backward-kill-line): - Undo kill-whole-line == always changes. Add new function - kill-entire-line to unconditionally delete the current line. - Add comments describing the lamentable state of affairs of - the kill-line functions and variables. - -2001-03-02 Ben Wing - - * simple.el: - * simple.el (beginning-of-buffer): - * simple.el (end-of-buffer): - * simple.el (mark-ring-unrecorded-commands): - * simple.el (signal-error-on-buffer-boundary): - * simple.el (shifted-motion-keys-select-region): - * simple.el (unshifted-motion-keys-deselect-region): - * simple.el (motion-keys-for-shifted-motion): New. - * simple.el (handle-pre-motion-command): - * simple.el (handle-post-motion-command): - * simple.el (forward-char-command): - * simple.el (backward-char-command): - * simple.el (scroll-up-command): - * simple.el (scroll-down-command): - * simple.el (next-line): - * simple.el (previous-line): - * simple.el (backward-block-of-lines): - * simple.el (forward-block-of-lines): - * simple.el (backward-word): - * simple.el (mark-word): - - Augment documentation of the most common motion commands to make - note of the shifted-motion support. Improve the support to (a) - properly document how it works and why it's done in the fashion it - is, and (b) allow the keystrokes that trigger it to be customized. - - Correct error in the customize specification of - mark-ring-unrecorded-commands. - -2001-03-02 Ben Wing - - * font-lock.el: - * font-lock.el (font-lock-pending-extent-table): Removed. - * font-lock.el (font-lock-pending-buffer-table): New. - * font-lock.el (font-lock-pre-idle-hook): - * font-lock.el (font-lock-after-change-function): - * font-lock.el (font-lock-fontify-pending-extents): - * font-lock.el (font-lock-lisp-like): - - Fix handling of pending extents to avoid excessive slowness (N^2 - behavior) when making lots of buffer changes between redisplays, - such as when saving the Options. - -2001-03-09 William M. Perry - - * device.el: - * dragdrop.el: - * dumped-lisp.el: - * faces.el: - * frame.el: - * gnuserv.el: - * loadup.el: - * menubar-items.el: - * minibuf.el: - The Great GTK Merge. - - * ChangeLog.GTK: - * dialog-gtk.el: - * gdk.el: - * generic-widgets.el: - * glade.el: - * gnome-widgets.el: - * gnome.el: - * gtk-compose.el: - * gtk-extra.el: - * gtk-faces.el: - * gtk-ffi.el: - * gtk-file-dialog.el: - * gtk-font-menu.el: - * gtk-glyphs.el: - * gtk-init.el: - * gtk-iso8859-1.el: - * gtk-marshal.el: - * gtk-mouse.el: - * gtk-package.el: - * gtk-password-dialog.el: - * gtk-select.el: - * gtk-widget-accessors.el: - * gtk-widgets.el: - * gtk.el: - widgets-gtk.el: - The Great GTK Merge: new files. - -2001-03-05 Stephen J. Turnbull - - * generic-widgets.el: Don't require gtk (a built-in feature) at - top level. Don't execute the last sexp unless (featurep 'gtk). - -2001-02-28 Stephen J. Turnbull - - * mule/mule-init.el (auto-language-alist): Split zh into GB and BIG5. - -2001-02-23 Martin Buchholz - - * XEmacs 21.2.45 "Thelxepeia" is released. - -2001-01-25 Jason R. Mastaler - - * about.el (xemacs-hackers): update my entry. - * about.el (about-maintainer-info): ditto. - * about.el (about-hackers): ditto. - -2001-02-20 Jan Vroonhof - - * about.el (about-maintainer-info): More vanity info about - yours truly. - -2001-02-20 Adrian Aichner - - * build-report.el (build-report-destination): xemacs-build-reports - has moved to SourceForge, where mailing list name length is - restricted, hence the name change to - xemacs-buildreports@xemacs.org. - * build-report.el (build-report-keep-regexp): Update default. - * build-report.el (build-report-delete-regexp): Ditto. - * build-report.el (build-report-make-output-files): Ditto. - -2001-02-19 Craig Lanning - - * lisp-mode.el: Add indentation specifications for following - Common Lisp forms: handler-case, handler-bind, with-slots, - with-open-file, with-open-stream, print-unreadable-object. - -2001-02-18 Matt Tucker - - * font-lock.el (font-lock-set-defaults-1): - Move initialization of `font-lock-cache-position' so that it's set - even if font-lock-keywords is already defined. - -2001-02-17 Matt Tucker - - * autoload.el (generate-file-autoloads-1): - Use `emacs-lisp-mode-syntax-table' instead of - `lisp-mode-syntax-table'. - * lisp-mode.el (lisp-mode-syntax-table): - Get rid of old checks for `parse-partial-sexp' version. - Make `|' (pipe) string delimiter instead of punctuation. - -2001-02-16 Martin Buchholz - - * window.el (save-selected-window): - Use gensym for better macro hygiene. - -2001-02-06 Mike Sperber - - * dump-paths.el: - * startup.el (startup-setup-paths): Set and use - `mule-lisp-directory'. - (startup-setup-paths-warning): Ditto. - - * setup-paths.el (paths-find-mule-lisp-directory): Added. - (paths-construct-load-path): Consider `mule-lisp-directory'. - -2001-02-07 Matt Tucker - - * font-lock.el: Syntax table improvements used. A few random - changes are not specified below. - (font-lock-fontify-string-delimiters): - (font-lock-syntactic-keywords): - (font-lock-cache-state nil): - (font-lock-cache-position): - New variables. - (font-lock-set-syntax): - (font-lock-apply-syntactic-highlight): - (font-lock-fontify-syntactic-anchored-keywords): - (font-lock-fontify-syntactic-keywords-region): - (font-lock-eval-keywords): - New functions. - (font-lock-remove-face): - (font-lock-fontify-syntactically-region): - Use syntax properties. - -2001-02-08 Martin Buchholz - - * XEmacs 21.2.44 "Thalia" is released. - -2001-01-16 Mike Sperber - - * startup.el (normal-top-level): Work even if no installation root - is found. - -2001-01-30 Andy Piper - - * gutter-items.el (progress-abort-glyph): remove instantiator. - (set-progress-abort-instantiator): new function. - (abort-progress-feedback): use it. - - * gutter.el (set-gutter-dirty-p): new function. - -2001-01-30 Didier Verna - - * mwheel.el (mwheel-scroll): unwind-protect the selected window. - -2001-01-24 Didier Verna - - * sound.el (sound-extension-list): give a better default value. - * sound.el (load-sound-file): improve the doc string, also find - files given by absolute names, pass a real extension list to - `locate-file'. - -2001-01-26 Martin Buchholz - - * XEmacs 21.2.43 "Terspichore" is released. - -2001-01-20 Klaus Frank - - * gnuserv.el (gnuserv-process-filter): Robuster handling of error - messages from gnuserv. - -2001-01-20 Martin Buchholz - - * XEmacs 21.2.42 "Poseidon" is released. - -2001-01-12 Nick V. Pakoulin - - * cl-macs.el (cl-upcase-arg): New function. - (cl-function-arglist): New function. - (cl-transform-lambda): Automatically add CL-style lambda list to - documentation string using functions above. - -2001-01-12 Andy Piper - - * package-get.el (package-get-custom): call - package-net-update-installed-db. - - * package-ui.el (pui-install-selected-packages): call - package-net-update-installed-db. - - * package-net.el (package-net-update-installed-db): use - packages-package-list so that we reflect reality. - - * packages.el (packages-package-list): Make docstring reflect - reality. - - * package-net.el (package-net-convert-index-to-ini): exclude mule entries. - - * postinstall.cc (do_postinstall): don't pick up shells if cygwin - isn't installed. - -2001-01-17 Andy Piper - - * wid-edit.el (widget-activation-glyph-mapper): activate or - deactivate native widgets. - (widget-glyph-insert-glyph): record instantiator. - (widget-push-button-value-create): use it. - - * gui.el (gui-button-action): new function. Make button's domain - buffer current when calling. - (make-gui-button): update to use gui-button-action. - -2001-01-16 Didier Verna - - * menubar-items.el (default-menubar): add an entry for modeline - horizontal scrolling in Options -> Display. - -2001-01-17 Steve Youngs - - * package-get.el (package-get-require-signed-base): Set to nil - by default. - -2001-01-17 Martin Buchholz - - * XEmacs 21.2.41 "Polyhymnia" is released. - -2001-01-16 Mike Sperber - - * setup-paths.el (paths-core-load-path-depth): Stopgap bump to - catch lisp/mule/. - -2001-01-14 Mike Sperber - - * startup.el (maybe-create-compatibility-dot-emacs): - (maybe-unmigrate-user-init-file): - (unmigrate-user-init-file): Created. - (maybe-migrate-user-init-file): Offer creation of compatibility - .emacs. - Some doc fixes wrt init file location. - -2001-01-15 Golubev I. N. - - * faces.el (face-frob-from-locale-first): new variable. - (frob-face-font-2): Honor tags arg while trying to use - standard-face-mapping. When face-frob-from-locale-first is set, - first try to set face inheriting from frobbed-face. - -2001-01-15 Didier Verna - - * about.el (xemacs-hackers): update my entry. - * about.el (about-url-alist): ditto. - * about.el (about-maintainer-info): ditto. - * about.el (about-hackers): ditto. - -2001-01-15 Martin Buchholz - - The byte compiler has been badly broken for a year, - by the patch of 1999-12-06. - * byte-optimize.el (byte-optimize-form-code-walker): - Bug was: the byte compiler was making this erroneous optimization: - (progn (or (foo)) (bar)) ==> (bar) - -2000-11-20 Mike Sperber - - * setup-paths.el (paths-core-load-path-depth): Split - `paths-load-path-depth' in two for site and core lisp. Don't - recurse into core. - * setup-paths.el (paths-construct-load-path): Use. - -2001-01-10 Andy Piper - - * package-net.el (package-net-cygwin32-binary-size): new variable - (package-net-win32-binary-size): ditto. add much needed - commentary. - - * gutter-items.el (buffers-tab-items): correct off-by-one error - for buffers-tab-max-size. - -2001-01-08 Martin Buchholz - - * XEmacs 21.2.40 is released. - -2001-01-06 Stephen J. Turnbull - - * mule/hebrew.el: Fix comments and typos. - mule/japanese.el: Fix comments, typos, and 8-bit character encoding. - -2001-01-06 Stephen J. Turnbull - - * ChangeLog.1: move ancient log from fill.el. - - * dump-paths.el: - paragraphs.el: - mule/mule-category.el: - Miscellaneous typo fixes and slight doc clarifications. - - * mule/mule-ccl.el: Correct file name in header. - -2000-12-31 Martin Buchholz - - * XEmacs 21.2.39 is released. - -2000-12-27 Martin Buchholz - - * byte-optimize.el (byte-optimize-cond): - (byte-optimize-cond-1): New. - Rewrite `cond' in terms of `if' and `or', which are easier to optimize. - Optimizes (cond (x nil)) ==> nil. - Provide better diagnostic on malformed expr like (cond foo). - -2000-12-20 Stephen J. Turnbull - - * mule/mule-coding.el: - mule/mule-cmds.el (reset-language-environment, - set-language-environment-coding-systems): - Safer default coding-priority-list, corresponding to src/file-coding.h. - -2000-12-03 Jorma Laaksonen - - * package-admin.el: Allow package removal from - early-package-load-path. - -2000-12-15 Andreas Jaeger - - * about.el (about-maintainer-info): Update my entry. - -2000-12-11 Matt Tucker - - * packages.el (locate-library): Add support for bzip2 - compressed .el files. - -2000-12-12 Andy Piper - - * package-net.el: new file. - -2000-12-01 Enrico Scholz - - * font-lock.el: Add missing C++ keywords. - -2000-12-08 Adrian Aichner - - * simple.el (indent-for-comment): Preserve indentation of comments - starting in column 0, as documented in (Info-goto-node - "(xemacs)Comments"). Update docstring accordingly. - -2000-12-05 Martin Buchholz - - * XEmacs 21.2.38 is released. - -2000-12-04 Didier Verna - - * mouse.el (default-mouse-track-set-point-in-window): remove - spurious '+' operation detected by Martin. - - -2000-12-01 Martin Buchholz - - * cl-extra.el (coerce): - Implement char to integer coercion. - Remove extraneous (numberp) test. - - * byte-optimize.el (byte-compile-splice-in-already-compiled-code): - Perform lapcode inlining if the value of `byte-optimize' is 'byte. - (byte-optimize-predicate): - Warn if evaluating constant expression signals an error. - (byte-optimize-form): Small simplification. - - * cl-macs.el (cl-do-proclaim): small efficiency improvement. - -2000-11-30 Martin Buchholz - - * byte-optimize.el: - (byte-optimize-minus): - (byte-optimize-plus): - (byte-optimize-mult): - (byte-optimize-quo): - Use (car (last x)) instead of (last x) to get last elt! - Use `byte-optimize-predicate' to optimize `%'. - Move optimizations for special numeric args to bytecomp.el. - * bytecomp.el (byte-compile-associative): Remove. - (byte-compile-max): New. - (byte-compile-min): New. - Properly handle erroneous calls: (max) (min). - (byte-compile-plus): New. - (byte-compile-minus): - It's easiest to handle 0, +1 and -1 args here. - (byte-compile-mult): New. - It's easiest to handle 1, -1 and 2 args here. - (byte-compile-quo): - It's easiest to handle 0, +1 and -1 args here. - Issue byte-compiler warning when dividing by zero. - - Byte-compiler arithmetic improvements. - Better optimize these expressions in the obvious way: - (+ x y 1) --> varref x varref y add add1 - (+ x y -1) --> varref x varref y add sub1 - (- x y 0) --> (- x y) - (- 0 x y) --> (- (- x) y) - (% 42 19) --> compile-time constant - (/ 42 19) --> compile-time constant - (* (foo) 2) --> foo call dup plus - - Optimize away arithmetic operations (+ x) (* x) (/ x 1) - unless (declaim (optimize (safety 3))) - or (setq byte-compile-delete-errors nil). - -2000-11-28 Stephen J. Turnbull - - * paragraphs.el (paragraph-separate, forward-sentence): Clarify - docstrings. - -2000-11-08 Stephen J. Turnbull - - * startup.el (command-line-do-help): Add documentation of - portable dumper switches. - -2000-11-22 Andy Piper - - * x-mouse.el (x-init-pointer-shape): use cursor-font explicitly. - - * glyphs.el (init-glyphs): don't use autodetect for strings. - -2000-11-28 Martin Buchholz - - * byte-optimize.el (byte-optimize-char-before): - (byte-optimize-backward-char): - (byte-optimize-backward-word): - Fix incorrect optimizations for these sorts of expressions: - (let ((x nil)) (backward-char x)) - -2000-11-21 Martin Buchholz - - * byte-optimize.el: - * byte-optimize.el (byte-optimize-backward-char): New. - * byte-optimize.el (byte-optimize-backward-word): New. - Make backward-word and backward-char as efficient as forward versions. - - * bytecomp.el (byte-compile-no-args-with-one-extra): - * bytecomp.el (byte-compile-one-arg-with-one-extra): - * bytecomp.el (byte-compile-two-args-with-one-extra): - * bytecomp.el (byte-compile-zero-or-one-arg-with-one-extra): - * bytecomp.el (byte-compile-one-or-two-args-with-one-extra): - * bytecomp.el (byte-compile-two-or-three-args-with-one-extra): - Check if extra arg is constant nil, and if so, use byte-coded call. - - * simple.el (backward-word): - * simple.el (mark-word): - * simple.el (kill-word): - * simple.el (backward-kill-word): - Make COUNT argument optional, for consistency with forward-char et al. - - * abbrev.el (abbrev-string-to-be-defined): - * abbrev.el (inverse-abbrev-string-to-be-defined): - * abbrev.el (inverse-add-abbrev): - * abbrev.el (expand-region-abbrevs): - * buff-menu.el (Buffer-menu-execute): - * indent.el (move-to-left-margin): - * indent.el (indent-relative): - * indent.el (move-to-tab-stop): - * info.el (Info-reannotate-node): - * lisp-mode.el (lisp-indent-line): - * lisp.el (end-of-defun): - * lisp.el (move-past-close-and-reindent): - * misc.el (copy-from-above-command): - * mouse.el (default-mouse-track-scroll-and-set-point): - * page.el (forward-page): - * paragraphs.el (forward-paragraph): - * paragraphs.el (end-of-paragraph-text): - * picture.el (picture-forward-column): - * picture.el (picture-self-insert): - * rect.el (extract-rectangle-line): - * simple.el (newline): - * simple.el (fixup-whitespace): - * simple.el (backward-delete-char-untabify): - * simple.el (transpose-chars): - * simple.el (transpose-preceding-chars): - * simple.el (do-auto-fill): - * simple.el (indent-new-comment-line): - * simple.el (blink-matching-open): - * view-less.el (cleanup-backspaces): - * wid-edit.el (widget-transpose-chars): - * term/bg-mouse.el (bg-insert-moused-sexp): - Use more readable (backward-FOO n) instead of (forward-FOO -n). - - * info.el (Info-fontify-node): - * simple.el (backward-delete-function): - Use canonical delete-backward-char instead of backward-delete-char. - -2000-11-20 Andy Piper - - * gutter-items.el (update-tab-in-gutter): don't barf if there are - no buffers. - -2000-11-20 Andy Piper - - * gutter-items.el (update-tab-in-gutter): don't give popup frames - buffer tabs. - -2000-11-18 Martin Buchholz - - * cl-macs.el: Correctly optimize plusp minusp oddp evenp. - (proclaim inline...) was shadowing compiler-macros. - -2000-11-17 Martin Buchholz - - * bytecomp.el (byte-compile-eval): New. - (byte-compile-initial-macro-environment): Use byte-compile-eval. - Keeps this promise made in Lispref: - "If a file being compiled contains a `defmacro' form, the macro is - defined temporarily for the rest of the compilation of that file." - -2000-11-09 Martin Buchholz - - * cl.el (floatp-safe): - (plusp): - (minusp): - (oddp): - (evenp): - (cl-abs): - Use a better parameter name than `x'. - - * cl-macs.el (check-type): Make continuable. Change documentation - to require PLACE, but accept any form for compatibility. - - * abbrev.el (define-abbrev): Use check-type. - * font-menu.el (font-menu-change-face): Use check-type. - * menubar.el (relabel-menu-item): Use check-type. - * itimer.el: Fix typo. - -2000-11-10 Yoshiki Hayashi - - * info.el (Info-extract-menu-node-name): Comma is a delimiter. - -2000-11-14 Martin Buchholz - - * XEmacs 21.2.37 is released. - -2000-11-13 Katsumi Yamaoka - - * code-cmds.el: Provide the feature. - -2000-07-21 Jan Vroonhof - - * dumped-lisp.el (preloaded-file-list): Load code-cmds.el - - * code-cmds.el: New file - * mule/mule-cmds.el: - * mule/mule-misc.el - (coding-keymap): New keymap. Define coding system keyboard - commands on file-coding builds too. - (coding-system-change-eol-conversion): - (universal-coding-system-argument): - (set-default-coding-systems): - (prefer-coding-system): Moved from mule-cmds.el - (set-buffer-process-coding-system): Moved from mule-misc.el - -2000-09-15 Stephen Carney - - * etags.el (buffer-tag-table-files): Use append instead of nconc. - -2000-11-09 Steve Youngs - - * package-get.el (package-get-download-sites): Add a pre-release - site for experimental packages. - - * auto-autoloads.el: Regenerated. - -2000-08-01 Andy Piper - - * gutter-items.el (buffers-tab-omit-function): reference - buffers-tab-select-visible-buffers. - (buffers-tab-filter-functions): new variable, by default uses - buffers-tab-selection-function and buffers-tab-omit-function. - (select-buffers-tab-buffers-by-mode): invert arguments. - (buffers-tab-select-visible-buffers): new function. Invert calling - of buffers-menu-omit-invisible-buffers. - (buffers-tab-items): rewrite to use - buffers-tab-filter-functions. Rewrite docstring. - (gutter-buffers-tab-extent): delete. - (add-tab-to-gutter): always build a new extent when adding the - tabs. - (update-tab-in-gutter): make gutter dirty when orientation - changes. - -2000-11-07 Martin Buchholz - - * bytecomp.el (byte-compile-defvar-or-defconst): - Only do loadhist recording if defvar form includes a value. - -2000-11-02 Martin Buchholz - - * bytecomp.el (byte-compile-initial-macro-environment): - `eval-when-compile' should not compile its body. - -2000-11-02 Stephen J. Turnbull - - * mule/cyrillic.el: Add Windows 1251 code page encoding (by - Sergey Groznyh in <863diqaygu.fsf@fct.ru>). Fix - some Japanese English. Remove some ancient FSF comments, and - improve docstrings. Use symbols not vectors for tables. - -2000-11-03 Martin Buchholz - - * keymap.el: - (local-key-binding): - (global-key-binding): - Add an optional `accept-defaults' parameter, just like `lookup-key'. - - * lisp.el: - (backward-sexp): Slightly simpler code. - (mark-sexp): Make arg optional, like FSF Emacs. - (forward-list): Slightly simpler code. - (backward-list): Slightly simpler code. - (down-list): Make arg optional, like FSF Emacs. - (up-list): Make arg optional, like FSF Emacs. - (backward-up-list): Make arg optional, like FSF Emacs. - (kill-sexp): Make arg optional, like FSF Emacs. - (backward-kill-sexp): Make arg optional, like FSF Emacs. - - * font-menu.el (font-menu-change-face): - Take continuable errors into account. - - * abbrev.el: - * abbrev.el (clear-abbrev-table): - * abbrev.el (define-abbrev-table): - * abbrev.el (define-abbrev): - * abbrev.el (insert-abbrev-table-description): - * apropos.el (apropos-documentation-check-doc-file): - * apropos.el (apropos-documentation-check-elc-file): - * buff-menu.el (list-buffers): - * buff-menu.el (list-buffers-noselect): - * bytecomp.el (byte-recompile-directory): - * bytecomp.el (batch-byte-compile): - * cl-macs.el (typep): - * code-files.el (find-coding-system-magic-cookie): - * code-files.el (insert-file-contents): - * cus-edit.el (customize-set-variable): - * cus-edit.el (customize-save-variable): - * cus-face.el (custom-set-face-font-size): - * cus-face.el (custom-set-face-update-spec): - * cus-face.el (custom-reset-faces): - * custom.el (custom-check-theme): - * custom.el (copy-upto-last): - * fill.el (canonically-space-region): - * fill.el (fill-paragraph): - * fill.el (fill-region): - * fill.el (find-space-insertable-point): - * fill.el (justify-current-line): - * faces.el (face-spec-update-all-matching): - * faces.el (set-face-stipple): - * files-nomule.el (insert-file-contents): - * files.el (insert-file-contents-literally): - * files.el (hack-local-variables-last-page): - * files.el (basic-save-buffer): - * files.el (insert-directory): - * font-menu.el (font-menu-change-face): - * font.el (font-spatial-to-canonical): - * format.el (format-encode-region): - * format.el (format-insert-file): - * format.el (format-replace-strings): - * gutter.el (set-gutter-element): - * help.el (key-or-menu-binding): - * help.el (describe-bindings): - * help.el (with-syntax-table): - * indent.el (indent-rigidly): - * indent.el (delete-to-left-margin): - * info.el: - * info.el (Info-extract-dir-entry-from): - * info.el (Info-build-dir-anew): - * info.el (Info-rebuild-dir): - * info.el (Info-batch-rebuild-dir): - * info.el (Info-read-subfile): - * info.el (Info-build-node-completions): - * info.el (Info-extract-menu-node-name): - * isearch-mode.el (isearch-range-invisible): - * isearch-mode.el (isearch-restore-invisible-extents): - * itimer.el (itimerp): - * itimer.el (itimer-live-p): - * keymap.el: - * keymap.el (substitute-key-definition): - * keymap.el (read-command-or-command-sexp): - * keymap.el (local-key-binding): - * keymap.el (global-key-binding): - * keymap.el (global-set-key): - * keymap.el (local-set-key): - * ldap.el: - * ldap.el (ldap-add-entries): - * ldap.el (ldap-delete-entries): - * lisp.el (backward-sexp): - * lisp.el (mark-sexp): - * lisp.el (forward-list): - * lisp.el (backward-list): - * lisp.el (down-list): - * lisp.el (backward-up-list): - * lisp.el (up-list): - * lisp.el (kill-sexp): - * lisp.el (backward-kill-sexp): - * menubar.el (add-menu-button): - * menubar.el (add-submenu): - * menubar.el (delete-menu-item): - * menubar.el (relabel-menu-item): - * mouse.el (narrow-window-to-region): - * obsolete.el (define-obsolete-variable-alias): - * obsolete.el (store-substring): - * package-admin.el: - * package-admin.el (package-admin-install-function): - * package-admin.el (package-admin-install-function-mswindows): - * package-admin.el (package-admin-default-install-function): - * package-get.el (package-get-update-base-entries): - * packages.el (packages-load-package-dumped-lisps): - * packages.el (packages-collect-package-dumped-lisps): - * printer.el (generic-print-buffer): - * printer.el (generic-print-region): - * replace.el (occur-mode-mouse-goto): - * replace.el (perform-replace): - * select.el (get-selection-no-error): - * simple.el: - * simple.el (newline): - * simple.el (open-line): - * simple.el (edit-and-eval-command): - * simple.el (goto-line): - * simple.el (undo): - * simple.el (kill-region): - * simple.el (copy-region-as-kill): - * simple.el (kill-ring-save): - * simple.el (set-mark): - * simple.el (next-line): - * simple.el (previous-line): - * simple.el (line-move): - * simple.el (set-goal-column): - * simple.el (comment-region): - * subr.el: - * subr.el (putf): - * syntax.el (modify-syntax-entry): - * syntax.el (map-syntax-table): - * view-less.el (view-file): - * view-less.el (view-buffer): - * view-less.el (view-file-other-window): - * window-xemacs.el (backward-other-window): - * window.el: - * window.el (one-window-p): - * window.el (walk-windows): - * window.el (window-list): - * x-mouse.el (x-mouse-kill): - * x-select.el (x-get-cutbuffer): - * x-select.el (x-store-cutbuffer): - * term/bg-mouse.el (bg-mouse-line-to-center): - * term/sun-mouse.el (window-line-end): - * term/sun-mouse.el (sun-select-region): - * term/sun.el (kill-region-and-unmark): - * mule/mule-category.el: - * mule/mule-category.el (modify-category-entry): - * mule/mule-category.el (char-category-list): - * mule/mule-coding.el (coding-system-force-on-output): - * mule/mule-misc.el (coding-system-put): - Docstring arglist/Texinfo fixes. See man/ChangeLog for details. - -2000-11-02 Stephen J. Turnbull - - * cus-face.el: Typo fixes and tiny clarifications. - * custom.el: ditto - -2000-10-27 Yoshiki Hayashi - - * startup.el (auto-save-list-file-prefix): Moved to fileio.c. - * startup.el (normal-top-level): Setup auto-save-list-file-name - if auto-save-list-file-prefix is non-nil. - -2000-10-25 Yoshiki Hayashi - - * files.el (auto-mode-alist): Allow mixed case suffix for idlwave-mode. - -2000-01-05 Yoshiki Hayashi - - * hyper-apropos.el (hyper-apropos-this-symbol): Don't always - get symbol at point-min. - -2000-10-24 Didier Verna - - * info.el (Info-emacs-info-file-name): defconst it. - * info.el (Info-footnote-tag): defcustom it. - * info.el (Info-no-description-string): ditto. - * info.el (Info-find-node): adapt to new semantics of - 'Info-suffixed-file (don't do the case variants stuff). - * info.el (Info-insert-dir): rewrite the dir file variants code. - * info.el (Info-directory-files): New. Return the list of info - files in a directory. - * info.el (Info-dir-outdated-p): use it. - * info.el (Info-parse-dir-entries): ditto. - * info.el (Info-build-dir-anew): don't restrict to files ending - with a ".info.*" extension. - * info.el (Info-set-mode-line): ditto. - * info.el (Info-read-subfile): adapt to new semantics of - 'Info-suffixed-file (append 'exact argument). - * info.el (Info-all-case-regexp): New. Return a regexp matching a - string independently of the case. - * info.el (Info-suffixed-file): use it (match all possible case - for the file name). - * info.el (Info-insert-file-contents): code cleanup. - * info.el (Info-rebuild-dir): cosmetics only. Fit code in 80 - columns. - * info.el (Info-batch-rebuild-dir): ditto. - * info.el (Info-read-node-name-1): ditto. - * info.el (Info-search): ditto. - * info.el (Info-fontify-node): ditto. - - -2000-10-24 Didier Verna - - * process.el (shell-command): when called from a program, avoid - 'push-mark's "mark-set" message. - -2000-10-15 MIYASHITA Hisashi - - * mule/thai-xtis.el (tis-620): Specify coding-system's ccl-program - by a symbol, not by a vector. - * mule/vietnamese.el (vscii): Likewise. - (viscii): Likewise. - * mule/cyrillic.el (koi8-r): Likewise. - - * mule/chinese.el (chinese-big5-1): Specify charset's ccl-program - by a symbol, not by a vector. - (chinese-big5-2): Likewise. - * mule/ethiopic.el (ethiopic): Likewise. - * mule/vietnamese.el (vietnamese-viscii-lower): Likewise. - (vietnamese-viscii-upper): Likewise. - -2000-10-12 Yoshiki Hayashi - - * files.el (auto-mode-alist): Remove obsolete entry for html3-mode. - -2000-10-13 Yoshiki Hayashi - - * byte-optimize.el (byte-optimize-car): New function. - (byte-optimize-cdr): Ditto. - -2000-10-12 Yoshiki Hayashi - - * byte-optimize.el: Partial synch with FSF 20.7. - Optimize constant concatenation. - Add keymapp as a side effect free function. It is a built-in. - (byte-after-unbind-pos): Remove byte-equal. - -2000-10-13 Gunnar Evermann - - * update-elc-2.el: Quote regexps correctly. - -2000-10-05 MIYASHITA Hisashi - - * mule/mule-ccl.el: Sync up with Emacs 21.0.90. - (ccl-compile): Apply integerp, not integer-or-char-p to - check the type of the buffer magnification - (ccl-compile-write-string): Encode a string with binary - coding system. - (ccl-compile-write-repeat): Likewise. - -2000-09-25 Robert Pluim - - * buff-menu.el: - * bytecomp.el: - * coding.el: - * faces.el: - * files.el: - * fill.el: - * float-sup.el: - * font-lock.el: - * help.el: - * iso8859-1.el: - * loaddefs.el: - * menubar-items.el: - * menubar.el: - * modeline.el: - * msw-font-menu.el: - * paragraphs.el: - * paths.el: - * replace.el: - * simple.el: - * sound.el: - * startup.el: - * version.el: - * x-faces.el: - * x-font-menu.el: - Remove purecopy. - -2000-10-03 Daniel Pittman - - * simple.el (do-auto-fill): Use the function pointer to by - `comment-line-break-function', not `indent-new-comment-line'. This - fixes an issue with cc-mode comment continuation. - -2000-10-11 Martin Buchholz - - * simple.el (turn-on-auto-fill): Add (interactive). - * mwheel.el (mwheel-install): Add (interactive). - * font-lock.el (turn-on-font-lock): Add (interactive). - (turn-off-font-lock): Add (interactive). - -2000-10-03 Karl M. Hegbloom - - * packages.el (packages-special-base-regexp): Add `man'. - -2000-10-08 Adrian Aichner - - * wid-edit.el (widget-specify-active): map over extents in current - buffer like `widget-specify-inactive' does. Mapping over the - inactive extent object does not work since the current extent is - ignored by `map-extents'. - -2000-10-04 Martin Buchholz - - * XEmacs 21.2.36 is released. - -2000-09-22 Martin Buchholz - - * byte-optimize.el (byte-optimize-lapcode): Add an optimizer pass. - Optimize the compiled-function-constants vector by byte-code - reference counts. - -2000-09-25 Robert Pluim - - * build-report.el (build-report-delete-regexp): quote value in - defcustom - -2000-09-24 Adrian Aichner - - * build-report.el (build-report): Don't bind srcdir which we don't - use in `multiple-value-bind' to avoid the only byte-compiler - warning. - -2000-09-23 Adrian Aichner - - * build-report.el: Requires cl and custom now. - build-report-version is determined by XEmacs version -- remove - build-report-version*. - * build-report.el (build-report-version): Removed. - * build-report.el (build-report-installation-version-regexp): New. - * build-report.el (build-report-version-file-regexp): New. - * build-report.el (build-report-installation-srcdir-regexp): New. - * build-report.el (build-report-destination): Offer - xemacs-build-reports and xemacs-beta. - * build-report.el (build-report-keep-regexp): Adjusted. - * build-report.el (build-report-delete-regexp): Adjusted. - * build-report.el (build-report-make-output-dir): New. - * build-report.el (build-report-installation-file): Replace use of - `concat' with `expand-file-name'. - * build-report.el (build-report-make-output-file): Removed. - * build-report.el (build-report-make-output-files): New. - * build-report.el (build-report-subject): Identify as - user-variable with "*...". - * build-report.el (build-report-prompts): Ditto. - * build-report.el (build-report-version-file): New. - * build-report.el (build-report-file-encoding): Identify as - user-variable with "*...". - * build-report.el (build-report-make-output-get): New. - * build-report.el (build-report-insert-header): Report - emacs-version and system-configuration instead of - build-report-version. - * build-report.el (build-report-insert-make-output): Add file - argument. - * build-report.el (build-report-insert-installation-file): - Re-indent. - * build-report.el (build-report-keep): Change docstring, - re-indent. - * build-report.el (build-report-delete): Ditto. - * build-report.el (build-report-installation-data): New. - * build-report.el (build-report-version-file-data): New. - -2000-09-20 Martin Buchholz - - * byte-optimize.el (byte-optimize-lapcode): - Fix the optimization of using the first 5 elements of the - constants vector for variables. - (byte-optimize-lapcode): Fix another ancient broken optimization. - -2000-09-19 Martin Buchholz - - * *: Spelling mega-patch - -2000-09-19 Martin Buchholz - - * easymenu.el: doc fixes. - (easy-menu-do-define): Use backquote. - (easy-menu-change): - (easy-menu-add): - `when' seems much clearer than `if' here. - (easy-menu-remove): - (easy-menu-add-item): - (easy-menu-item-present-p): - (easy-menu-remove-item): - Wrap using (when (featurep 'menubar) ...) - -2000-09-16 Martin Buchholz - - * bytecomp.el (displaying-byte-compile-warnings): - Revert Ben's change to this function below so that the compile log - is displayed properly for users of the "popper" package. - -2000-09-12 Martin Buchholz - - * window.el (save-selected-window): Use backquote. - - * bytecomp.el (byte-compile-file-form-defvar-or-defconst): - Renamed from `byte-compile-file-form-defvar'. - * bytecomp.el (byte-compile-defvar-or-defconst): - Only cons onto current-load-list in top-level forms. - Else this leaks a cons cell every time a defun is called. - Renamed from `byte-compile-defvar', for clarity. - Warn when docstring of defvar is not a string. - Use consistent error messages. - Better comments. - -2000-09-11 Martin Buchholz - - * simple.el (set-variable): - Remove unneeded defvar by rearranging order of let* forms. - - * mule/mule-ccl.el (ccl-get-next-code): - * menubar-items.el (bookmark-menu-filter): - (language-environment-menu-filter): - (tutorials-menu-filter): - * toolbar-items.el (toolbar-compile): - * byte-optimize.el (disassemble-offset): - Use (declare (special ...)) instead of `defvar'. - - * cl-macs.el (cl-do-proclaim): - Fix (declare (special ...)) warning suppression syntax. - -2000-07-22 Golubev I. N. - - * info.el (Info-tag-table-marker): - (Info-tag-table-buffer): - (Info-find-file-node): - (Info-read-subfile): - (Info-build-node-completions): - (Info-search): - (Info-mode): - Multiple info buffer support. - -2000-08-28 Oscar Figueiredo - - * ldap.el (ldap-decode-entry): New defun - (ldap-search-entries): Use it in order to decode DN-prefixed - entries properly - -2000-08-23 Daniel Pittman - - * mule/mule-cmds.el (coding-system-change-eol-conversion): - Use `eq', not `=', to compare symbols. - -2000-07-30 Ben Wing - - * bytecomp.el (byte-compile-report-error): - * bytecomp.el (displaying-byte-compile-warnings): - if stack-trace-on-error is set, send out a backtrace when - an error is encountered that stops byte compilation. this - should make it much much easier to track down those curious - problems. also undo the kludge of using a separate "*Show*" - buffer for display when there's a temp-buffer-show-function; - we can avoid this by just being a little smarter. - - * dialog-items.el: - * dialog-items.el (search-dialog-regexp): New. - * dialog-items.el (search-dialog-callback): - * dialog-items.el (make-search-dialog): - add a regexp option to the dialog and clean up a bit. - - * dialog.el: - * dialog.el (yes-or-no-p-dialog-box): - * dialog.el (get-dialog-box-response): - * dialog.el (make-dialog-box): - * dialog.el (dialog-box-finish): New. - * dialog.el (dialog-box-cancel): New. - * dialog.el (internal-make-dialog-box-exit): New. - implement [properly!] the :modal property of the new dialog box - interface. this is the first time xemacs has ever had *proper* - modal dialog boxes, giving the standard window-system feedback. - (e.g. under windows, clicking on a disabled frame causes a beep - and makes the dialog box flash three times.) - - * dragdrop.el: header keyword frobbing. - - * dumped-lisp.el (preloaded-file-list): - renamed winnt.el to win32-native.el. - - * faces.el (face-property): - * faces.el (set-face-property): - * faces.el (frob-face-property): - * faces.el (frob-face-font-2): - * faces.el (make-face-bold): - * faces.el (make-face-italic): - * faces.el (make-face-bold-italic): - * faces.el (make-face-unbold): - * faces.el (make-face-unitalic): - * faces.el (make-face-smaller): - * faces.el (make-face-larger): - clean up the implementation of these so that window-system-specific - methods are called only on objects belonging to that window system. - previously, you could have [e.g.] mswindows-make-face-bold called - on font object of device type `stream', which is not good and - explains the subtle errors Adrian was getting when byte-compiling - something that required 'term. (Adrian, now you can use stack-trace- - on-error to find the exact place where things are going wrong instead - of having to laboriously binary-search your way through.) - - * finder.el (finder-known-keywords): - cleaned up -- properly sorted, clarified the meanings of many of - the keywords, and added a few -- mswin, gui, content, build, www, - user, services. the last two try to distinguish between a package - that's used directly by the user, and a package that provides - support services to other packages. - - * font-lock.el (lisp-font-lock-keywords-2): - update list of lisp control structures to include everything, - including new ones i introduced. - - * gutter.el: header keyword frobbing. - - * isearch-mode.el (isearch-ring-adjust1): M-p to recall the most - recent isearch element was not doing so! you got the second-most- - recent instead. - - * lisp-mode.el (construct-lisp-mode-menu): - more menubar cleanups. - * lisp-mode.el (with-selected-window): - make it indent properly. - - * menubar-items.el (default-menubar): lots of menubar cleanups. - rearranged the options menu the most, e.g. splitting up the - Keyboard/Mouse menu into a new Editing menu and combining the - separate Scrollbar/Gutter/Toolbar submenus into Display. - Got rid of General, moved items to Editing or new Troubleshooting. - Moved Packages to Tools; doesn't seem to belong under Options. - Added stuff to the Cmds menu, e.g. Change Case. - - NB please don't complain about these periodic menubar changes. - Anything like this is necessarily incremental in its construction - -- By constant use you gradually become more and more aware of - better and better ways to group menu items. When we eventually - move the options menu to a property sheet, the existing structure - will probably be preserved fairly well. - - * minibuf.el (next-history-element): fix problems with pressing - down arrow in repeat-complex-command. - - * modeline.el: - * modeline.el (modeline-3d-p): New. - added custom variable for controlling the 3d modeline. the - corresponding Options item has been present for a long time, - but commented out with "fix me!" comments. it's fixed now. - - * obsolete.el (add-menu): - remove bogus gettexts. - - * process.el (shell-quote-argument): - handle this correctly under Windows native with COMMAND.COM/CMD.EXE. - For bash under Windows native, see below. - - * simple.el: - * simple.el (display-warning-buffer): - Fixed the handling of warning display to eliminate the annoying - *Show* buffer, like was done for byte-compiler output above. - - * simple.el (debug-print): New. - Simple function for sending debug messages to the console and/or - other debug places. - - * subr.el (replace-in-string): - Rewrite this function to avoid N^2 behavior with large strings -- - catastrophic with the new Windows selection code! (Apparently the - author of this function didn't realize there was a fun - replace-match that could make his life much easier, because we - duplicated the entire logic. The new version is smaller, easier - to understand, much more robust, and has extended features -- - those of replace-match.) - - * window.el: - * window.el (with-selected-window): New. - An obvious complement to the existing `with-selected-frame' and - `with-current-buffer'. - - * win32-native.el: Renamed from winnt.el. - Added a great deal of stuff for properly handling process quoting, - somewhat modeled on Kirill's original model (which i later threw - away). We should now finally have correctly working process arg - quoting/dequoting so that the final app gets exactly what we - intended. Because the mechanism is in Lisp, it's easily - extendible. (For those running bash and running the native - version, I tried hard to do what I thought was correct. But more - thought is needed, and ideally the volunteer work of people with - these configurations that they generally run on.) - - * x-font-menu.el (x-font-menu-font-data): - Put in defvar's to fix byte-compiler warnings. - -2000-08-01 Alastair J. Houghton - - * select.el (selection-coercion-alist): Initialise. - * select.el (select-coerce-to-text): New. - * select.el (select-coerce): New. - New functions to perform type and value coercion. - - * select.el (select-buffer-killed-default): Keep data if it was - on the clipboard. - -2000-08-02 Martin Buchholz - - * menubar-items.el (default-menubar): Fix typo. - (default-menubar): `lambda' was mispelled as `lamda'. - -2000-07-31 Yoshiki Hayashi - - * window.el (shrink-window-if-larger-than-buffer): Remove - edge checking code. - -2000-07-31 Yoshiki Hayashi - - * paths.el (gnus-local-domain): Removed. - (gnus-local-organization): Ditto. - (gnus-startup-file): Ditto. - -2000-07-13 Yoshiki Hayashi - - * files.el (auto-mode-alist): Add .spec for RPM. - -2000-07-31 Andy Piper - - * gutter-items.el (update-tab-in-gutter): deprecate :properties. - -2000-07-31 Yoshiki Hayashi - - * dragdrop.el (experimental-dragdrop-drop-url-default): Use function - browse-url. - * help.el (xemacs-www-page): Ditto. - (xemacs-www-faq): Ditto. - * menubar-items.el (default-menubar): Ditto. - - * wid-edit.el (widget-url-link-action): Ditto. - From: Kenichi OKADA . - -2000-07-31 Martin Buchholz - - * finder.el (finder-commentary): Add autoload cookie. - -2000-07-28 Adrian Aichner - - * files.el (insert-file-contents-literally): Fix second let - binding for `coding-system-for-read' to `coding-system-for-write' - as suggested by Dan Holmsand . - -1999-06-15 Jan Vroonhof - - * files.el (insert-file-contents-literally): Use binary coding - system (from Morioka san). - (insert-file-contents-literally): Make file-name-handler method. - -2000-07-26 Martin Buchholz - - * cl-macs.el (get-selection): Add defsetf. - -2000-07-25 Steve Youngs - - * x-init.el (x-activate-region-as-selection): replace obsolete - function x-own-selection with own-selection. - (ow-find): replace obsolete functions x-get-selection and - x-get-clipboard with get-selection and get-clipboard. - (init-post-x-win): replace obsolete function x-disown-selection - with disown-selection. - -2000-07-20 Mike Sperber - - * startup.el (load-user-init-file): Only try to load init file if - it exists. - -2000-07-10 Andy Piper - - * dialog-items.el: sync with Ben's patch. - - * gutter-items.el (buffers-tab-switch-to-buffer): remove now-bogus - comment. - (progress-text-glyph): deleted. - (progress-layout-glyph): make completely minimal. - (progress-gauge-glyph): ditto. - (progress-display-style): fix to handle dynamic instantiator - changes. - (progress-text-instantiator): new. - (progress-layout-instantiator): new. - (progress-gauge-instantiator): new. - (set-progress-display-instantiator): renamed and changed from - set-progress-display-style. - (progress-abort-glyph): use instantiator not glyph. - (append-progress-display): use set-progress-display-instantiator - and set-glyph-image. - (abort-progress-display): ditto. - (raw-append-progress-display): ditto. - -2000-07-20 Ben Wing - - * code-files.el: Move Mule-specific code to mule-coding.el. - -2000-07-15 Ben Wing - - * autoload.el: - Fixed comments. - - * cmdloop.el: - * cmdloop.el (yes-or-no-p): - * cmdloop.el (y-or-n-p): - Make these functions use should-use-dialog-box-p and not be - overridden in dialog.el. - - * cus-dep.el: - * cus-dep.el (Custom-make-dependencies): Removed. - * cus-dep.el (Custom-make-dependencies-1): New. - * cus-dep.el (Custom-make-one-dependency): New. - New entry point for use in Makefiles, to avoid excessive - invocations. - - * cus-edit.el (custom-variable-reset-saved): - * cus-edit.el (custom-variable-reset-standard): - * cus-edit.el (custom-save-resets): - Fix bytecompiler warnings. - - * dialog.el: - * dialog.el (yes-or-no-p-dialog-box): - * dialog.el (yes-or-no-p-maybe-dialog-box): Removed. - * dialog.el (y-or-n-p-maybe-dialog-box): Removed. - * dialog.el (get-dialog-box-response): - * dialog.el (message-or-box): - * dialog.el (make-dialog-box): - * dialog.el (popup-dialog-box): New. - Avoid yes-or-no-p bogosities. - Create a general function `make-dialog-box' to encapsulate all - dialog box methods; easily extendible. popup-dialog-box now obsolete. - - * dumped-lisp.el (preloaded-file-list): - Add dialog-items. Clean up. Group files by types. - - * easymenu.el (easy-menu-add): - * easymenu.el (easy-menu-remove): - Account for accelerators. - - * extents.el: - * extents.el (extent-list): New args, like in map-extents. - * extents.el (extent-at-event): New. - * extents.el (extents-at-event): New. - - * font-lock.el: - * font-lock.el (font-lock-mode): - * font-lock.el (font-lock-default-fontify-buffer): - * font-lock.el (font-lock-default-unfontify-region): - * font-lock.el (font-lock-fontify-syntactically-region): - * font-lock.el (font-lock-fontify-keywords-region): - Use new progress-feedback names. - - * font-lock.el (java-font-lock-identifier-regexp): - * font-lock.el (java-font-lock-class-name-regexp): - Fix bytecompiler warnings. - - * gutter-items.el: - * gutter-items.el (progress-display-use-echo-area): Removed. - * gutter-items.el (progress-feedback-use-echo-area): New. - * gutter-items.el (progress-display-popup-period): Removed. - * gutter-items.el (progress-feedback-popup-period): New. - * gutter-items.el (set-progress-display-style): Removed. - * gutter-items.el (set-progress-feedback-style): New. - * gutter-items.el (progress-display-style): Removed. - * gutter-items.el (progress-feedback-style): New. - * gutter-items.el (progress-stack): - * gutter-items.el (progress-displayed-p): Removed. - * gutter-items.el (progress-feedbacked-p): New. - * gutter-items.el (clear-progress-display): Removed. - * gutter-items.el (clear-progress-feedback): New. - * gutter-items.el (progress-display-clear-when-idle): Removed. - * gutter-items.el (progress-feedback-clear-when-idle): New. - * gutter-items.el (remove-progress-display): Removed. - * gutter-items.el (remove-progress-feedback): New. - * gutter-items.el (progress-display-dispatch-non-command-events): Removed. - * gutter-items.el (progress-feedback-dispatch-non-command-events): New. - * gutter-items.el (append-progress-display): Removed. - * gutter-items.el (append-progress-feedback): New. - * gutter-items.el (abort-progress-display): Removed. - * gutter-items.el (abort-progress-feedback): New. - * gutter-items.el (raw-append-progress-display): Removed. - * gutter-items.el (raw-append-progress-feedback): New. - * gutter-items.el (display-progress-display): Removed. - * gutter-items.el (display-progress-feedback): New. - * gutter-items.el (current-progress-display): Removed. - * gutter-items.el (current-progress-feedback): New. - * gutter-items.el (current-progress-display-label): Removed. - * gutter-items.el (current-progress-feedback-label): New. - * gutter-items.el (progress-display): Removed. - * gutter-items.el (progress-feedback): New. - Replace "progress-display" with "progress-feedback" globally. - - * gutter-items.el (lprogress-display): Removed. - * gutter-items.el (progress-feedback-with-label): New. - Rename lprogress-display ==> progress-feedback-with-label. - - * gutter-items.el (search-dialog-direction): Removed. - * gutter-items.el (search-dialog-text): Removed. - * gutter-items.el (search-dialog-callback): Removed. - * gutter-items.el (make-search-dialog): Removed. - Move to dialog-items.el. - - * help.el: - * help.el (help-mode-quit): - * help.el (mode-for-help): New. - * help.el (help-sticky-window): New. - * help.el (help-window-config): New. - * help.el (with-displaying-help-buffer): - * help.el (function-at-event): New. - * help.el (help-symbol-regexp): New. - * help.el (help-symbol-run-function-1): New. - * help.el (help-symbol-run-function): New. - * help.el (help-symbol-function-context-menu): New. - * help.el (help-symbol-variable-context-menu): New. - * help.el (help-symbol-function-and-variable-context-menu): New. - * help.el (frob-help-extents): New. - * help.el (describe-function-1): - * help.el (variable-at-point): - * help.el (variable-at-event): New. - * help.el (describe-variable): - Major overhaul. - - Make functions and variables be mousable. - - Middle button hyperlinks. - - New context-menu entries. - - * keydefs.el: - * keydefs.el (global-map): - New key bindings to move lines up and down. - - * lisp-mode.el: - * lisp-mode.el (construct-lisp-mode-menu): New. - * lisp-mode.el (emacs-lisp-mode-popup-menu): - * lisp-mode.el (lisp-interaction-mode-menubar-menu): - * lisp-mode.el (emacs-lisp-mode-menubar-menu): - * lisp-mode.el (lisp-indent-function): Indent "flet" entries better. - Make popup and menubar menus be different. Popup menu uses - clicked location and automatically assumes symbol under the mouse - for various commands. - - * menubar-items.el: - * menubar-items.el (bookmark-menu-filter): Add accelerators. - * menubar-items.el (buffers-menu-omit-chars-list): Include 'd'. - - * menubar-items.el (global-popup-menu): Removed. - * menubar-items.el (mode-popup-menu): Removed. - * menubar-items.el (activate-popup-menu-hook): Removed. - * menubar-items.el (popup-mode-menu): Removed. - * menubar-items.el (popup-buffer-menu): Removed. - * menubar-items.el (popup-menubar-menu): Removed. - Move to menubar.el. - - * menubar.el: - * menubar.el (global-popup-menu): New. - * menubar.el (mode-popup-menu): New. - * menubar.el (activate-popup-menu-hook): New. - * menubar.el (last-popup-menu-event): New. - * menubar.el (popup-mode-menu): New. - * menubar.el (popup-buffer-menu): New. - * menubar.el (popup-menubar-menu): New. - * menubar.el (menu-call-at-event): New. - Move non-content functions here. Add support for context menu - items on extents. - - * minibuf.el (minibuffer-history-uniquify): - Typo fix. - - * minibuf.el (read-file-name-1): - Call new file dialog box if it exists. - - * minibuf.el (mouse-rfn-setup-vars): - Clean up "chop" action. - - * mouse.el: - * mouse.el (button2): Now bound to mouse-track. - * mouse.el (click-inside-extent-p): - * mouse.el (point-inside-extent-p): - * mouse.el (point-inside-selection-p): - * mouse.el (mouse-drag-or-yank): Removed. - * mouse.el (mouse-begin-drag-n-drop): New. - * mouse.el (mouse-eval-sexp): - * mouse.el (mouse-track-activate-strokes): New. - * mouse.el (mouse-track-do-activate): New. - * mouse.el (mouse-track): - * mouse.el (default-mouse-track-event-is-with-button): New. - * mouse.el (default-mouse-track-cleanup-hook): - * mouse.el (default-mouse-track-drag-hook): - * mouse.el (default-mouse-track-drag-up-hook): - * mouse.el (default-mouse-track-click-hook): - Merge drag-n-drop into mouse-track. - Add general "activate" support to replace specific button2 kludges. - Use "button modifier" support in mouse-track. - - * package-get.el (package-get-dependencies): Fix bytecompiler warnings. - - * package-ui.el: - * package-ui.el (pui-menu): - * package-ui.el (pui-popup-context-sensitive): Removed. - Fix bytecompiler warnings. - Clean up popup code a bit. - - * select.el (get-selection-no-error): Fix bytecompiler warnings. - - * simple.el: - * simple.el (transpose-lines): - * simple.el (transpose-line-up): New. - * simple.el (transpose-line-down): New. - * simple.el (transpose-subr): - * simple.el (transpose-subr-1): Removed. - Clean up, add functions to move lines up and down. - - * startup.el (mail-host-address): - * startup.el (user-mail-address): - Customize. - - * subr.el: - * subr.el (set-symbol-value-in-buffer): New. - * subr.el (error): - * subr.el (check-argument-type): - * subr.el (defined-error-p): New. - Add structured error support. - - * toolbar-items.el (toolbar-compile): - Use new make-dialog-box. - - * update-elc.el: - - * userlock.el (ask-user-about-lock-dbox): - * userlock.el (ask-user-about-supersession-threat-dbox): - * userlock.el (ask-user-about-lock): - * userlock.el (ask-user-about-supersession-threat): - Use new make-dialog-box. - Add safety checks; use should use-dialog-box-p. - - * window-xemacs.el: - * window-xemacs.el (__buffer-dedicated-frame): - * window-xemacs.el (buffer-dedicated-frame): New. - * window-xemacs.el (set-buffer-dedicated-frame): New. - Move dedicated-frame stuff into lisp. - -2000-07-18 Kirill 'Big K' Katsnelson - - * printer.el (generic-print-region): Do not require that - `printer-name' be set. - (printer-name): Commentary clarification. - -2000-07-19 Martin Buchholz - - * XEmacs 21.2.35 is released. - -2000-07-18 Alastair J. Houghton - - * select.el (selection-coercible-types): Initialise. - -2000-07-18 Alastair J. Houghton - - * select.el (own-clipboard): Bug fix. - -2000-07-17 Mike Sperber - - * cus-edit.el (custom-migrate-custom-file): Save init file before - continuing. - -2000-07-16 Mike Sperber - - * startup.el (load-init-file): Remove silly call to - `load-user-custom-file`. - (maybe-migrate-user-init-file): Minor fixes. - -2000-07-16 Martin Buchholz - - * apropos.el (apropos-documentation-check-doc-file): - `doc' variable should be let-bound, as was presumably intended. - - * cus-edit.el (custom-variable-reset-saved): - (custom-variable-reset-standard): - Remove unused variable comment-widget. Twice. - - * toolbar.el (toolbar-blank-press-function): - Add a real defvar with initial value nil and proper docstring. - (press-toolbar-button): No need to check for boundp-ness anymore. - - * rect.el (open-rectangle-line): Remove useless (let) form. - Add defvar for pending-delete-mode. - - * info.el (Info-find-node): This function needs an autoload cookie. - - * mule/mule-x-init.el (x-use-halfwidth-roman-font): - Use let* since the second form referred to the first. - -2000-07-16 Adrian Aichner - - * msw-select.el (mswindows-paste-clipboard): Use `get-clipboard' - instead of removed `mswindows-get-clipboard'. - - -2000-07-15 Alastair J. Houghton - - * select.el (select-convert-from-text): New. - * select.el (select-convert-from-length): New. - * select.el (select-convert-from-integer): New. - * select.el (select-convert-from-identity): New. - * select.el (select-convert-from-filename): New. - * select.el (selection-converter-in-alist): Use them. - New converter functions for X. - - * select.el (get-selection): Removed comment. - - * select.el (own-selection): Removed append code - I thought - I'd already done this, but apparently not... - - * select.el: Changed comment about TIMESTAMP. - - * select.el (select-convert-in): New. - * select.el (select-convert-out): New. - New functions that get used by select.c. - - * select.el (select-buffer-killed-default): New. - * select.el (select-buffer-killed-text): New. - * select.el (selection-buffer-killed-alist): New. - New list and functions that get called if a relevant selection - exists and a buffer gets killed. - - * select.el (select-convert-to-targets): - * select.el (select-convert-to-identity): Removed. - * select.el (select-convert-from-identity): Removed. - * select.el (select-converter-out-alist): - Removed _EMACS_INTERNAL selection type. - - * x-select.el (xselect-kill-buffer-hook): Removed. - * x-select.el (xselect-kill-buffer-hook-1): Removed. - Removed this X-specific nonesense. Use the generic support - in select.el instead. - -2000-07-15 Martin Buchholz - - * mule/mule-category.el (defined-category-hashtable): - Use make-hash-table instead of make-hashtable - - * buff-menu.el: Byte-compiler warning fix. - - * isearch-mode.el (isearch-highlight-all-cleanup): - Remove unused variable `isearch-highlight-all-start'. - - * etags.el (add-to-tag-completion-table): Byte-compiler warning fix. - - * itimer.el (itimer-edit-mode): Byte-compiler warning fixes. - - * cus-dep.el (Custom-make-dependencies): - Add autoload cookie for custom-add-loads to generated custom-load.el. - - * autoload.el (autoload-package-name): Warning suppression. - Move defvar prior to first use. - - * custom.el: Add autoload for custom-declare-face. - Allow `xemacs -no-autoloads -l bytecomp -f batch-byte-compile ...' - * cl.el (cl-hack-byte-compiler): - Allow `xemacs -no-autoloads -l bytecomp -f batch-byte-compile ...' - to work properly. - -2000-07-08 Mike Sperber - - * startup.el (load-home-init-file): Added variable. - (maybe-migrate-user-init-file): Added. - (load-user-init-file): Load custom file if different from init - file. - - * dumped-lisp.el (preloaded-file-list): Added "cus-file" before - "startup." - - * cus-edit.el (custom-migrate-custom-file): Added for migration. - Moved `custom-file'-related code to cus-file.el. - - * cus-file.el: New file. - -2000-04-01 Mike Sperber - - * packages.el (packages-find-package-directories): Added support - for external package hierarchies with in-place installations. - - * find-paths.el (paths-root-in-place-p): Added. - (paths-find-emacs-directory): Added support for external - directories with in-place installations. - (paths-find-site-directory): Ditto. - - * startup.el (find-user-init-file): Also look for - ~/.xemacs/init.elc? in preference to ~/.emacs. - -2000-07-12 Alastair J. Houghton - - * select.el (own-selection): - * select.el (own-clipboard): Changed `append' parameter to - `how-to-use' parameter. - * select.el (own-selection): Removed icky append code. - * select.el (own-selection, get-selection): Removed extra type - checking. - * select.el (selection-appender-alist): - * select.el (selection-converter-{in|out}-alist): Initialise. - * select.el (select-append-to-*): New. - * select.el (select-convert-from-*): New. New functions to append - data and convert data from external type. - -2000-07-12 Stef Epardaud - - * font-lock.el: Javadoc enhancements. - -2000-07-06 Kirill 'Big K' Katsnelson - - * printer.el (generic-print-region): Compose job name from buffer - name. - -2000-07-06 Yoshiki Hayashi - - * font-lock.el (font-lock-fontify-pending-extents): Call - font-lock-fontify-region instead of font-lock-fontify-buffer - to avoid unnecessary progress gauges. - -2000-07-06 Craig Lanning - - * custom-load.el (faces): - - * finder.el (finder-compile-keywords): from Dan Holmsand, make sure - dir is a regex. - - * process.el (call-process-internal): from Dan Holmsand, use binary - coding systems so that jka-compr works. - -2000-07-07 Ben Wing - - * font-lock.el: Undo previous change. Unfortunately, some - files actually use the variables directly in their init code - without quoting them. - -2000-07-07 Ben Wing - - * font-lock.el (defvar font-lock-*-face): Removed. - - * font-lock.el (font-lock-apply-highlight): Bind these face vars - only when necessary. - -2000-06-30 Charles G Waldman - - * cl-macs.el: fix cl-transform-function-property kludge - so that it does not require a random feature. - -2000-06-09 Karl M. Hegbloom - - * files.el (auto-mode-alist): allow .make extension for Makefiles, - as in Linux kernel "Rules.make". - -2000-06-29 Gunnar Evermann - - * build-report.el (build-report): Add autoload cookie. - -2000-06-21 Charles G Waldman - - * package-ui.el (defgroup pui): Correct a misspelling - (pui-toggle-package-delete): Change `seleted' to `selected' - -2000-06-12 Jan Vroonhof - - * package-get.el (package-get-update-base): - (package-get): Use insert-file-contents-literally always. - (package-get-maybe-save-index): - Force coding system for writing to binary. - -2000-06-08 Mike Alexander - - * code-process.el (call-process-region): If there is no coding - system for the process on process-coding-system-alist use the - coding system of the buffer containing the region. - -2000-06-10 Ben Wing - - * cmdloop.el (command-error): - If debug-on-error and noninteractive, output backtrace. - - * files.el (file-relative-name): - Remove MSDOS references. - - * simple.el (line-number): New function, due to non-obvious - behavior/usage of count-lines. - - * simple.el (count-lines): document non-obvious usage to get - line number. - -2000-06-11 Ben Wing - - * faces.el ((featurep 'xpm)): - * x-faces.el (x-init-face-from-resources): - * x-faces.el (x-init-frame-faces): - * x-misc.el (x-init-specifier-from-resources): - * x-misc.el (x-get-resource-and-bogosity-check): - * x-misc.el (x-get-resource-and-maybe-bogosity-check): - * x-mouse.el (x-init-pointer-shape): - * x-scrollbar.el (x-init-scrollbar-from-resources): - Add sixth argument to x-get-resource calls so as to issue warnings - rather than errors on bogus arguments. - -2000-06-05 Ben Wing - - * compat.el: new file. provides a clean, non-intrusive way to - define compatibility functions. - - * process.el (shell-quote-argument): temporary fix for lack - of nt-quote-process-args. #### I need to put back the overall - structure of that mechanism but redo the guts of it using the - extra intelligence in the C code. - -2000-05-28 Adrian Aichner - - * package-info.el (pi-md5sum): Calculate MD5 sum just like - `package-get' does in package-get.el, instead of using external - "md5sum" program. - - * package-get.el (package-get): Insert package file literally to - make checksum calculation work. - -2000-04-18 Hrvoje Niksic - - * code-files.el (convert-mbox-coding-system): Deleted. - (file-coding-system-alist): Removed reference to - convert-mbox-coding-system. - -2000-05-28 Martin Buchholz - - * XEmacs 21.2.34 is released. - -2000-05-20 Karl M. Hegbloom - - * font-lock.el (font-lock-keywords): Rewrote docstring - -2000-05-22 Karl M. Hegbloom - - * loadhist.el (unload-feature): handle case where x is both boundp - and fboundp - -2000-05-22 Karl M. Hegbloom - - * packages.el: It's ok to use built-in macros, but not lisp - defined ones. - -2000-05-20 Ben Wing - - * font-lock.el: - * font-lock.el (font-lock-message-threshold): - * font-lock.el (font-lock-mode): - * font-lock.el (font-lock-default-fontify-buffer): - * font-lock.el (font-lock-always-fontify-immediately): - * font-lock.el (font-lock-old-extent): Removed. - * font-lock.el (font-lock-old-len): Removed. - * font-lock.el (font-lock-fontify-glumped-region): Removed. - * font-lock.el (font-lock-pending-extent-table): New. - * font-lock.el (font-lock-range-table): New. - * font-lock.el (font-lock-after-change-function): - * font-lock.el (font-lock-after-change-function-1): Removed. - * font-lock.el (font-lock-fontify-pending-extents): New. - * font-lock.el ('font-lock-revert-cleanup): Removed. - * font-lock.el ('font-lock-revert-setup): Removed. - Rewrite deferral code to handle any number of changes, merging - them properly. Remove hacked-up code for revert-buffer, now - unnecessary. - - * menubar-items.el (default-menubar): - In Options->Edit Init File, don't switch to emacs-lisp-mode - unless necessary; doing this turns off font-lock. - -2000-05-15 Yoshiki Hayashi - - * keydefs.el: Define C-x BS to backward-kill-sentence. - -2000-05-15 Yoshiki Hayashi - - * files.el (hack-local-variables-prop-line): Use non-greedy - matching to process -*-texinfo-*- -*-. - -2000-05-11 Jonathan Marten - - * minibuf.el (minibuf-directory-files): new function. - (read-file-name-activate-callback): use minibuf-directory-files. - (read-directory-name-internal): ditto. - (mouse-file-display-completion-list): ditto. - (mouse-directory-display-completion-list): ditto. - (read-file-name-internal): remove "./" from completion list unless - explicitly matched, for consistency. - -2000-05-11 Ben Wing - - * gutter-items.el (gutter-buffers-tab): - * gutter-items.el (add-tab-to-gutter): - * gutter-items.el (update-tab-in-gutter): - * gutter-items.el (remove-buffer-from-gutter-tab): Removed. - * gutter-items.el (append-progress-display): - * gutter-items.el (abort-progress-display): - * gutter-items.el (raw-append-progress-display): - Further fixes. Use set-glyph-image not set-image-instance-property, - to fix problems with multiple windows in a frame. - - * menubar-items.el (tutorials-menu-filter): - Fix typo. - - * startup.el (early-error-handler): - Display message box under windows; otherwise, message will disappear - before it can be viewed. - - * update-elc.el: - Fix bug in NEEDTODUMP processing. - -2000-05-08 Yoshiki Hayashi - - * startup.el (lock-directory): Removed. - (superlock-file): Ditto. - (startup-set-paths): Remove lockdir. - (startup-setup-paths-warning): Remove lock-directory. - - * setup-paths.el (paths-find-lock-directory): Removed. - (paths-find-superlock-file): Ditto. - -2000-05-09 Ben Wing - - * faces.el (set-face-property): - * faces.el (set-face-font): - * faces.el (set-face-foreground): - * faces.el (set-face-background): - * faces.el (set-face-background-pixmap): - * faces.el (set-face-underline-p): - * faces.el (set-face-strikethru-p): - * faces.el (set-face-highlight-p): - * faces.el (set-face-dim-p): - * faces.el (set-face-blinking-p): - * faces.el (set-face-reverse-p): - doc string changes. - - * glyphs.el: - * glyphs.el (make-image-specifier): - * glyphs.el (glyph-property): - * glyphs.el (set-glyph-image): - * glyphs.el (make-glyph): - * glyphs.el (make-pointer-glyph): - * glyphs.el (make-icon-glyph): - * glyphs.el (widget-image-instance-p): New. - authorship info, lots of doc changes. New predicate, inadvertently - omitted. the general principle with specifier docs is now that - the description of instantiators should go with the make-foo-specifier - fun's doc string, rather than in foo-specifier-p. this follows - conventions elsewhere in XEmacs and in general is a lot more obvious - of a place to look. sometimes the make-foo-specifier function needs - to be created in the process. - - * gutter.el: - * gutter.el (make-gutter-specifier): New. - * gutter.el (make-gutter-size-specifier): New. - * gutter.el (make-gutter-visible-specifier): New. - specifier doc updates according to the conventions specified before. - - * objects.el: - * objects.el (make-font-specifier): - * objects.el (make-color-specifier): - * objects.el (make-face-boolean-specifier): New. - specifier doc updates according to the conventions specified before. - - * specifier.el: - * specifier.el (set-specifier): - * specifier.el (make-integer-specifier): New. - * specifier.el (make-boolean-specifier): New. - * specifier.el (make-natnum-specifier): New. - * specifier.el (make-generic-specifier): New. - * specifier.el (make-display-table-specifier): New. - specifier doc updates according to the conventions specified before. - - * toolbar.el: - * toolbar.el (make-toolbar-specifier): New. - specifier doc updates according to the conventions specified before. - -2000-05-09 Ben Wing - - * process.el (call-process-internal): Revert to previous version - because Mike's change clashed with a change I did not long before. - Changed progn to prog1 to fix the bug pointed out by Mike Alexander. - Thanks very much Mike for pointing out the bug and submitting a - patch! - -2000-04-13 Mike Alexander - - * process.el (call-process-internal): Send the correct input buffer - (call-process-internal): Return the exit status of the process - -2000-05-07 Ben Wing - - * winnt.el: - * winnt.el (nt-quote-args-verbatim): Removed. - * winnt.el (nt-quote-args-prefix-quote): Removed. - * winnt.el (nt-quote-args-backslash-quote): Removed. - * winnt.el (nt-quote-args-double-quote): Removed. - * winnt.el (nt-quote-args-functions-alist): Removed. - * winnt.el (nt-quote-process-args): Removed. - Remove all stuff for argument quoting. We borrow the code instead - from Emacs 20.6, which is much more careful in its quoting - (e.g. in handling runs of the escape character) and avoids most of - the need for this Lisp mechanism by checking to see whether we're - running a Cygwin or normal program and doing the appropriate - quoting. If we end up needing such a mechanism, we should add - it by extending the variable `mswindows-quote-process-args' so it - can take an alist of regexps. - -2000-05-07 Ben Wing - - * keydefs.el: - Restore M-up, M-down to 21.1 state. Put *ward-sentence on - C-M-left, C-M-right instead. Define C-M-up, C-M-down to scroll - the window without moving point. - - * simple.el: - * simple.el (scroll-up-one): New. - * simple.el (scroll-down-one): New. - Functions for use with C-M-up/down. - -2000-05-01 Martin Buchholz - - * XEmacs 21.2.33 is released. - -2000-04-29 Martin Buchholz - - * dialog.el (yes-or-no-p-dialog-box): - Fix docstring. - Fix following horrible bug in X11 mode with focus-follows-mouse: - 1. Visit two files in two different frames. - 2. do File->Revert Buffer in one of those frames. - 3. Dialog box appears. - 4. Arrange things so that the mouse passes over the *other* - frame, then to the dialog box, and click on "Yes". - 5. The file contents end up in the *wrong* buffer! - Add TODO comment. - -2000-04-28 Ben Wing - - * help.el (describe-installation): correct typo introduced - in last patch: boundp -> fboundp. - - * etags.el (buffer-tag-table-list): - canonicalize filenames to Unix format so that tag-table-alist - searching works under Windows. - - * autoload.el: - Bowdlerize the supposedly objectionable words - "who couldn't quite manage to cleanly modify batch-update-autoloads". - - * gutter-items.el (set-progress-display-style): - * gutter-items.el (search-dialog-callback): - * gutter-items.el (make-search-dialog): - Change to new callback-ex api. - -2000-04-26 Bjrn Torkelsson - - * help.el: (describe-installation): decode-coding-string is not - defined in a non MULE environment. - -2000-04-28 Ben Wing - - * gutter-items.el (buffer-list-changed-hook): - use it, not record-buffer-hook. - - * subr.el (record-buffer-hook): Removed. - -2000-04-27 Ben Wing - - * gutter-items.el (buffers-tab-switch-to-buffer): do not - use NORECORD option. Andy will not like this, but the existing - gutter behavior is just wrong, as per this comment: - - ;; this used to add the norecord flag to both calls below. - ;; this is bogus because it is a pervasive assumption in XEmacs - ;; that the current buffer is at the front of the buffers list. - ;; for example, select an item and then do M-C-l - ;; (switch-to-other-buffer). Things get way confused. - ;; - ;; Andy, if you want to maintain the current look, you must - ;; *uncouple* the gutter order and buffers order. - - * loaddefs.el (completion-ignored-extensions): unfuckify. - - * bytecomp.el (batch-byte-compile-one-file): new function, used in - xemacs.mak. - - * autoload.el (batch-update-one-directory): new function, used in - xemacs.mak. - - * loadup.el: set gc-cons-threshold very high unless dumping -- - loadup during update-elc is much much much faster. also do this - when quick-building. - - add commented-out code for profiling loadup. - - - * update-elc.el (preloaded-file-list): add bytecomp.el, since it - is required in order to build xemacs. - -2000-04-26 Ben Wing - - * loadup.el: don't garbage collect during loadup if quick-build - compile-time option is set. - -2000-04-23 Ben Wing - - * update-elc.el: compute whether any dumped .el or .elc files - are newer than the dumped exe, and touch the file ../src/NEEDTODUMP - if so. - - * update-elc.el (update-elc-files-to-compile): always change - NOBYTECOMPILE in the src directory rather than current dir, - so it will work under NT. - - * autoload.el (autoload-trim-file-name): canonicalize to slashes so - the form of this file is identical between Unix and Windows. - (autoload-target-directory): Fixed to be lisp/ not lisp/prim/. - Added comment. - (update-autoloads-from-directory): updated doc string. - updated doc strings in a few other places. - -2000-04-18 Yoshiki Hayashi - - * bytecomp.el (byte-force-recompile): Fix argument to - byte-recompile-directory. - -2000-04-17 Yoshiki Hayashi - - * gutter-items.el (progress-display-clear-when-idle): Use - add-one-shot-hook. - * gutter-items.el (clear-progress-display): Adjust number of - arguments. - -2000-04-13 Yoshiki Hayashi - - * dumped-lisp.el (preloaded-file-list): Always dump select.el. - -2000-04-16 Ben Wing - - * printer.el: New file. - - * dumped-lisp.el (preloaded-file-list): Declare printer.el. - - * help.el (describe-installation): Fix decoding for Windows. - - * menubar-items.el: - * menubar-items.el (default-menubar): - * menubar-items.el (tutorials-menu-filter): New. - * menubar-items.el (popup-menubar-menu): - Add authorship. Redo Help menu and Tutorials filter. - - * menubar.el: Correct comment. - - * modeline.el (modeline-buffer-identification): Correct doc string. - - * simple.el: - * simple.el (printing): Removed. - * simple.el (printer-name): Removed. - * simple.el (generic-print-buffer): Removed. - * simple.el (generic-print-region): Removed. - Move generic print code to printer.el. - -2000-04-15 Ben Wing - - * simple.el (generic-print-region): New. - make this function actually work. - (generic-print-buffer): call generic-print-region. - -2000-04-14 Andy Piper - - * gutter-items.el (make-search-dialog): avoid unnecessary futzing - by using the new widget-callback-current-channel. - (search-dialog-callback): ditto. - -2000-04-12 Andy Piper - - * gutter.el (default-gutter-position): moved from gutter-items.el. - (default-gutter-position-changed-hook): ditto. - (gutter-element-visibility-changed-hook): ditto. - (set-gutter-element): ditto. - (remove-gutter-element): ditto. - (set-gutter-element-visible-p): ditto. - (gutter-element-visible-p): ditto. - (init-gutter): ditto. - - * dialog.el (make-dialog-box): renamed and moved from - gutter-items.el - - * gutter-items.el: move various functions elsewhere. - -2000-04-13 Katsumi Yamaoka - - * menubar-items.el: Fixed place of parenthesis. - -2000-04-12 Ben Wing - - * etags.el (find-tag-at-point): New. Lets you do find-tag - without constantly being prompted for the tag. - * simple.el: Added a number of section headings, to clarify the - organization of this file. - * simple.el (activate-region): - * simple.el (region-exists-p): - * simple.el (region-active-p): - Moved these three function down to the other side of - the case-changing functions, so they join the rest of - the region code. - * simple.el (printing): New. - * simple.el (printer-name): New. - * simple.el (generic-print-buffer): New. - New functions, a very simple prototype for a unified - printing interface. - - * process.el (call-process-internal): Real fix for null BUFFER, - other problems with BUFFER specs. - - * menubar-items.el: - Fixed up File->Print to use new printing functions. - Various corrections and expansions to Grep/Compile menus. - New options for Printing. - New options for SMTP Mail, the way to send mail under - MS Windows. (There's also a package patch to make SMTP - Mail be the default under MSWin.) - -2000-04-09 Jeff Miller - - * menubar-items.el: Selecting Rectangle Mousing from menubar - did not work. Needed to quote mouse-track-rectangle-p. - -2000-04-06 Yoshiki Hayashi - - * cl-compat.el (keywordp): Removed. - -2000-04-05 Andy Piper - - * gutter-items.el (progress-layout-glyph): don't initialize here. - (progress-gauge-glyph): use dynamic sizing. - (set-progress-display-style): new function. Set progress glyphs - appropriately depending on the style. - (progress-display-style): new variable. Custom version of - set-progress-display-style. - (progress-abort-glyph): switch to dynamic sizes. - (search-dialog-text): make the edit field active. - -2000-04-04 Andy Piper - - * gutter-items.el (make-search-dialog): need to make the search - dialog visible after creation. - - * menubar-items.el (default-menubar): use the search dialog for - searching. Remove some extraneous search menu items. - - * gutter-items.el (set-gutter-element): allow glyphs to be used as - well as strings. - (make-gutter-only-dialog-frame): allow the user to create the - frame unmapped. Allow the gutter spec to be given as a glyph. - (search-dialog-direction): new variable. - (search-dialog-text): new variable. - (search-dialog-callback): new function. Callback for the search - dialog action. - (make-search-dialog): new function. Create a user-friendly search - dialog. - -2000-04-04 Hrvoje Niksic - - * faces.el (set-face-stipple): Use mswindows-bitmap-file-path - under Windows. - -2000-04-01 Andy Piper - - * font-lock.el (font-lock-fontify-keywords-region): Calculate - progress more accurately. - -2000-02-02 Hirokazu FUKUI - - * finder.el (finder-compile-keywords): Process readable files only. - Because error in process of .#finder-inf.el when compile xemacs - with --with-clash-detection option. - -2000-03-31 Andy Piper - - * gutter-items.el (append-progress-display): don't delay after a - successful font-lock. - (make-gutter-only-dialog-frame): new function. Allow users to - create gutter-only dialogs. - -2000-03-27 Mike Alexander - - * process.el (call-process-internal): Handle a null BUFFER - parameter correctly. - -2000-03-28 Andy Piper - - * gutter-items.el (abort-progress-display): put strings in the - gutter not extents. - (progress-layout-glyph): signal special 'quit callback. - (progress-display-quit-function): deleted. - (progress-display-stop-callback): deleted. - (progress-display-dispatch-command-events): deleted. - (append-progress-display): remove calls to - progress-display-dispatch-command-events. - (raw-append-progress-display): ditto. - -2000-03-23 Hrvoje Niksic - - * faces.el (set-face-stipple): Rewrite to correctly handle PIXMAP - being a list. Actually define `stipple-pixmap-p' which is used as - an error predicate. Correctly handle PIXMAP being either relative - or absolute file name. - -2000-03-24 Andy Piper - - * gutter-items.el (add-tab-to-gutter): use copy-sequence. - (abort-progress-display): ditto. Don't delete the created extent. - (raw-append-progress-display): ditto. - (progress-display-dispatch-non-command-events): new - function. Encapsulates what we want to do when no command input is - required. - (progress-display-dispatch-command-events): likewise, but disable - for now since it causes too many problems. - (append-progress-display): use them. - (raw-append-progress-display): ditto. - (default-gutter-position-changed-hook): set this rather than - default-gutter-position-changed. - (default-gutter-position-changed-hook): lambda with zero arguments - rather than one. - (raw-append-progress-display): trap errors in pending input since - allowing them to signal will hose the gauge well and - truly. Ideally we would like to delay these until we are more able - to cope. - (append-progress-display): ditto. - -2000-03-20 Jeff Miller - - * lisp/make-docfile.el: call-process-internal is now implemented - in process.el. - -2000-03-21 Ben Wing - - * mule\mule-cmds.el (set-language-info-alist): - Fix to correspond to new menu arrangement. - -2000-03-21 Ben Wing - - * process.el: - * process.el (call-process-internal): New. - New implementation of call-process. Only enabled under NT, so far. - stderr handling not implemented yet in CVS'd C code. - -2000-03-20 Ben Wing - - * lisp-mode.el: - * lisp-mode.el (lisp-interaction-mode-menubar-menu): New. - * lisp-mode.el (lisp-interaction-mode): - Put back Lisp Interaction menubar for Jan V's sake. - - * simple.el: - * simple.el (mark-ring): - * simple.el (dont-record-current-mark): New. - * simple.el (in-shifted-motion-command): New. - * simple.el (mark-ring-unrecorded-commands): New. - * simple.el (mark-ring-max): - * simple.el (set-mark-command): - * simple.el (push-mark): - * simple.el (handle-pre-motion-command): - Implement scheme for not recording unimportant marks. - - * subr.el: - * subr.el (function-allows-args): New. - New function function-allows-args. - -2000-03-20 Martin Buchholz - - * XEmacs 21.2.32 is released. - -2000-03-20 Andy Piper - - * gutter-items.el (update-tab-in-gutter): force selection of the - selected-window if required to do so. - (buffers-tab-items): ditto. - (add-tab-to-gutter): ditto. - (create-frame-hook): use force-selection. - (default-gutter-position-changed): lambdify. - (update-tab-hook): deleted since it was only used in one place. - -2000-03-18 Andy Piper - - * files.el (find-file-noselect): undo change that shouldn't have - gone in. - -2000-03-17 Andy Piper - - * buffer.el (switch-to-buffer): use last-nonminibuf-window instead - of selected-window trickery. - - * gutter-items.el (update-tab-in-gutter): don't give dedicated - frames tabs. - (progress-display-stop-callback): progress -> progress-display - (progress-display-quit-function): ditto. - (clear-progress-display): ditto. - (remove-progress-display): ditto. - (append-progress-display): ditto. - (abort-progress-display): ditto. - (raw-append-progress-display): ditto. - (display-progress-display): ditto. - (current-progress-display-label): ditto. - (current-progress-display): ditto. - (lprogress-display): ditto and save the buffer - (progress-display): ditto. Otherwise the buffer sometimes gets - changed which confuses font-lock. - - * font-lock.el (font-lock-default-fontify-buffer): catch all - errors, not just quit. - (font-lock-mode): progress -> display-progress - (font-lock-default-fontify-buffer): ditto. - (font-lock-fontify-syntactically-region): ditto. - (font-lock-fontify-keywords-region): ditto. - -2000-03-14 Hrvoje Niksic - - * cl.el (gensym): Move to here from cl-macs.el. - (gentemp): Ditto. - -2000-03-16 Andy Piper - - * font-lock.el (font-lock-mode): use lprogress and friends for - progress management. - (font-lock-default-fontify-buffer): ditto. - (font-lock-fontify-syntactically-region): ditto. - (font-lock-fontify-keywords-region): ditto. - (font-lock-revert-cleanup): fix reverting. - (font-lock-revert-setup): ditto. - - * gutter-items.el (progress-use-echo-area): new variable. Use the - echo area for progress gauges if non-nil. - (clear-progress): remove echo area stuff and defer to - clear-message. - (append-progress): dispatch non-command events after each progress - increment. Remove echo area stuff. - (abort-progress): remove echo area stuff and defer to - display-message. - (raw-append-progress): ditto. Dispatch non-command events after - gutter redisplay. - (display-progress): defer echo area stuff to display-message. - - * gutter-items.el (clear-progress): - (abort-progress): indentation changes. - (display-progress): don't clear progress. - (append-progress): compare messages with equal. - (raw-append-progress): use dispatch-non-command-events to flush - widget creation events. - -2000-03-13 Ben Wing - - * abbrev.el: - * abbrev.el (abbrev-string-to-be-defined): New. - * abbrev.el (inverse-abbrev-string-to-be-defined): New. - Changes for use with the menubar. - -2000-03-12 Ben Wing - - * alist.el (vassoc): moved here from font-menu.el. - - * custom.el (defface): typo fix. - - * dialog.el (yes-or-no-p-dialog-box): - * dialog.el (message-box): - * files.el (save-some-buffers-1): - Put accelerators in the button names. - - * font-lock.el (font-lock-comment-face): - * font-lock.el (font-lock-keyword-face): - * font-lock.el (font-lock-function-name-face): - Fixed some of the colors under MS Windows because the existing - default colors were hardly different from black and needed to be - made lighter. - - * font-menu.el: - * font-menu.el (font-menu-split-long-menu): - * font-menu.el (font-menu-family-constructor): - * font-menu.el (font-menu-size-constructor): - * font-menu.el (font-menu-weight-constructor): - * font-menu.el (font-menu-set-font): - vassoc moved to alist.el. - Accelerators added to all menus. - Unused bound var new-props removed. - - * keydefs.el: I did a whole lot of rearranging to put things in a - more consistent order and fixed a number of cases where key - combinations involving up, down, left, right and so on were - defined but the corresponding keypad combinations were not - defined. - - * lisp-mode.el: - * lisp-mode.el (lisp-interaction-mode-popup-menu): - * lisp-mode.el (emacs-lisp-mode): - * lisp-mode.el (lisp-interaction-mode): - * lisp-mode.el (flet): - Added accelerators onto the menus. - Made all the different versions of the let function be indented - the same way. - Undid Steve's easy-menu-ification, because it makes it impossible - to have the menubar and popup menus different. - Cleaned up the menu; added items for find-function &c and some - indenting, and removed debug-on-*. - - * list-mode.el (list-mode-hook): - * list-mode.el (list-mode): - * list-mode.el (completion-setup-hook): - * list-mode.el (display-completion-list): - Added support for the :window-height keyword, which is required - because of other changes that I made for the file dialog box. I - also made the hook variables list-mode-hook and - completion-setup-hook and also minibuffer-setup-hook in - minibuf.el be permanent-local; see comment in list-mode.el. - - * map-ynp.el (map-y-or-n-p): - Added accelerators to the dialog buttons. - - * menubar-items.el (menu-truncate-list): - New internal function. - * menubar-items.el (submenu-generate-accelerator-spec): - * menubar-items.el (menu-item-strip-accelerator-spec): - * menubar-items.el (menu-item-generate-accelerator-spec): - New exported functions, for use in auto-generating accelerator specs. - - * menubar-items.el: - * menubar-items.el (default-menubar): - * menubar-items.el (maybe-add-init-button): - * menubar-items.el (bookmark-menu-filter): - * menubar-items.el (slow-format-buffers-menu-line): - * menubar-items.el (build-buffers-menu-internal): - * menubar-items.el (language-environment-menu-filter): - * menubar-items.el (default-popup-menu): - * menubar-items.el (popup-buffer-menu): - * menubar-items.el (popup-menubar-menu): - Did a major overhaul on this file, and in fact I'm nowhere near - done working on the menubar, and there will be more patches to - come. A basic summary of what I've done: - - a) I added accelerators to all of the menu items. For menus that - are auto-generated, such as the buffers menu, the accelerators are - automatically added to the beginning of each line using the - numbers 1 through 9, then zero, and then letters starting with A, - but omitting the letters that are already in use for the fixed - menu items at the top of the buffers menu. To facilitate adding - accelerators of this kind, I created some new functions - (*-accelerator-spec), which are also being used by other filters - that auto generate lists of things such as ftp sites to download - packages. If people really don't like these accelerators - appearing at the beginning of the menu items, a variable can be - added to optionally turn them off, but I think this is rather - pointless because other menu items have accelerators and many or - most of the menu users will use the accelerators if the support is - there. - - b) I combined the top level Tools and Apps menus into a single - Tools menu, because the distinction between the two is not - obvious, and the items on the menus are not used often enough that - putting some of them onto submenus is a problem. - - c) I created two new top level menus called View and Cmds because - there were too many items on the File and Edit menus, and I'm going - to be adding more items to these menus. In contrast to the Tools - menu, the items on these menus may be used quite often during an - editing session, and so should be available with fewer - keystrokes. - - d) I added a number of options to the options menu, including one - for controlling whether the alt key can be used to traverse to - menu items using the accelerators, one for controlling behavior of - control-k, one for controlling how the kill and yank functions - interact with the clipboard, a few additional buffers-menu - options, and various other things. I also did a bit of - rearranging, for example, combining the keyboard and mouse options - into a single keyboard and mouse submenu to facilitate the - accelerators on that level. - - e) I changed the variable buffers-menu-format-buffer-line-function - to take two arguments instead of one, the second argument being - the line number for use in creating an accelerator. I added a - hack to support existing functions with one argument (although I - doubt that very many of these exist), for backward compatibility. - - f) I moved the top level mule menu to be a submenu of the edit - menu. I think that most of the items on this menu are fairly - useless and there are certainly not enough frequently used items - to justify this being its own top level menu. - - g) I combined most of the items in big-menubar.el into the main menu. - If people think the main menu is too big, it would be possible to - create different configurations, some smaller. - - * menubar.el (check-menu-syntax): - Deleted some syntax checks that were no longer valid, partly - because of changes that were already made a long time ago, and - partly because of a change I made where I allow the name of the - menu item to be an evaluated expression rather than just a string, - similar to all of the other parameters of a menu item. - - * minibuf.el: - * minibuf.el (read-file-name-1): - * minibuf.el (mouse-read-file-name-1): - I made a number of changes to improve the appearance - and functioning of the file dialog box. They include: - - a) Fixing the problem where closing the dialog box by clicking on - the close button of the window didn't properly exit the - minibuffer. - - b) Fixing the problem that if you typed part of a file name, and - then clicked on a completion with the mouse, the file was not - correctly selected. - - c) Changing the title of the dialog box to reflect the operation - being done in accordance with user interface conventions, rather - than the name of the dialog box buffer, which is rather useless. - - d) Remove the words "possible completions are" which didn't - belong. - - e) Fix things so that the completions scroll off the end of the - completions windows only to the right, rather than both to the - right and down, which is in accordance with Windows user interface - conventions. - - * msw-init.el (init-post-mswindows-win): - Added a binding for meta-F4, which is the standard windows binding - for exiting a program. - - * select.el (get-selection-no-error): - * select.el (own-selection): - * select.el (own-clipboard): - Added an optional argument called append to the functions - own-selection and own-clipboard. This adds support for appending - text to the existing selection and allows the function - own-clipboard to be used as the value of the variable - interprogram- cut-function. - - Fixed a bug in own-selection in handling zmacs-region-stays. - - * simple.el (historical-kill-line): New. - - * simple.el (kill-line): - * simple.el (interprogram-cut-function): - * simple.el (interprogram-paste-function): - * simple.el (handle-pre-motion-command): - * simple.el (next-line): - * simple.el (previous-line): - a) Expanded the variable kill-whole-line, so that function - kill-line can be set to delete the entire line always, not just - when cursor is at the beginning of the line. This is controlled - by setting the variable kill-whole-line to the symbol 'always. - This behavior, as well as the existing kill-whole-line behavior, - now only take effect when kill-line is called interactively, - although this is a departure from a previous behavior in the case - of setting this variable kill-whole-line to t. It is almost - certainly what has always been intended, and most likely the old - way of doing things introduced bugs. I also created a function - called historical-kill-line, which ignores the kill-whole-line - setting and always gives the historical behavior of only killing - to the end of the line. I bound this function to shift- control-k - so that the kill to end of line behavior is available, even when - kill-whole-line has been set to change control-k into the simple - delete-whole-line behavior. (This can be set using the options - menu.) - - b) I changed things so that kill and yank now interact with the - clipboard by default under windows. This was done by changing the - default value of interprogram-cut- function and - interprogram-paste-function. You can get the old behavior by - setting these to nil, and there is an option on the options menu - to do this. - - c) I added support for selecting text using shifted motion keys. - This support is on by default and can be controlled by the - variable shifted-motion-keys-select-region. There is also a - variable called unshifted-motion-keys-deselect-region that - controls more specifically how the shifted motion key behavior - works. I did not put an option on the options menu to turn this - off, because I can't imagine why this would be useful. - - * simple.el (forward-block-of-lines): - * simple.el (backward-block-of-lines): - * simple.el (block-movement-size): - New. - - * simple.el (uncapitalized-title-words): - * simple.el (uncapitalized-title-word-regexp): - * simple.el (capitalize-string-as-title): - * simple.el (capitalize-region-as-title): - New. - - - * subr.el (add-hook): - * subr.el (make-local-hook): New. - * subr.el (remove-local-hook): New. - * subr.el (add-one-shot-hook): New. - * subr.el (add-local-one-shot-hook): New. - Added some functions to make using hooks easier. - These include: - - a) Functions add-local-hook and remove-local-hook to make it easy - to use local hooks. - - b) Functions add-one-shot-hook and add-local-one-shot-hook, which - make it possible to add a "one-shot" hook, which is to say a hook - that runs only once, and automatically removes itself after the - first time it has run. - -2000-03-09 Andy Piper - - * files.el (auto-mode-alist): pick up jsp, jhtml and xml files. - -2000-03-09 Yoshiki Hayashi - - * buff-menu.el (buffers-menu-omit-invisible-buffers): - Moved from menubar-items.el. - * dumped-lisp.el: Dump gutter-items regardless of menubar. - -2000-03-08 Andy Piper - - * gutter-items.el (build-buffers-tab-internal): add selected field - to buffers tab spec. - -2000-03-07 Yoshiki Hayashi - - * minibuf.el (last-exact-completion): Initialize to nil. - -2000-03-07 Didier Verna - - * startup.el (command-line-1): remove unused variable - `first-file-buffer'. - -2000-02-29 Hrvoje Niksic - - * loaddefs.el (completion-ignored-extensions): Removed ".log", - which is also used for Web server log files. - -2000-02-03 IKEYAMA Tomonori - - * mule/mule-charset.el: Setup auto-fill-chars. - -2000-03-02 SL Baur - - * subr.el (with-string-as-buffer-contents): Reimplement using - `with-temp-buffer'. Fixes non-unique buffer name problem, fixes - non-deletion of buffer after execution problem. - (with-output-to-string): Use unique buffer name. - -2000-02-29 Stephen J. Turnbull - - * gutter-items.el (buffers-tab-sort-function): New variable. - (buffers-tab-items): Funcall it to sort the buffer tab list. - -2000-02-29 Stephen J. Turnbull - - * startup.el (load-user-init-file): Merge two `if's to one `or'. - -2000-02-28 Martin Buchholz - - * menubar-items.el (maybe-add-init-button): Remove the "Load - .emacs" button from all menubars. - -2000-03-01 Didier Verna - - * rect.el (string-rectangle): depend on `pending-delete-mode' for - region rectangle replacement (from Jan Vroonhof). - (replace-rectangle): new function. - -2000-01-05 Yoshiki Hayashi - - * mule/mule-cmds.el (set-default-coding-systems): Use - set-terminal-coding-system and set-keyboard-coding-system. - * coding.el (set-terminal-coding-system): Use - set-console-tty-output-coding-system. - (set-keyboard-coding-system): Use - set-console-tty-input-coding-system. - -2000-02-21 Yoshiki Hayashi - - * minibuf.el (read-variable): Allow symbol to default argument. - -2000-02-27 Andy Piper - - * gutter-items.el (update-tab-hook): new function to be used for - hooks. - (create-frame-hook): add update-tab-hook. - (record-buffer-hook): ditto. - (default-gutter-position-changed): ditto. - (default-gutter-position): updating the buffers tab is now handled - by a hook. - (default-gutter-position-changed-hook): new variable. - (gutter-element-visibility-changed-hook): ditto. - (set-gutter-element-visible-p): call it. - (set-gutter-element): use modify-specifier-instances. Set extents - as duplicable before using. - (remove-gutter-element): ditto. - (set-gutter-element-visible-p): ditto. - (init-gutter): new function. - (add-tab-to-gutter): use new gutter-element functions rather than - setting specifiers directly. - (clear-progress): ditto. - (abort-progress): ditto. - (gutter-buffers-tab-visible-p): renamed from - default-gutter-visible-p - - * specifier.el (modify-specifier-instances): new function from Jan - Vroonhof. - - * x-init.el (init-post-x-win): call init-gutter. - - * msw-init.el (init-post-mswindows-win): call init-gutter. - - * menubar-items.el (default-menubar): Update to reflect new gutter - variables. - -2000-02-26 Andy Piper - - * gutter-items.el (set-gutter-element): new function. Add gutter - elements to the specified gutter. - (remove-gutter-element): new function. Remove gutter elements from - the specified gutter. - (set-gutter-element-visible-p): new function. Set gutter element - visibility for the provided gutter-visible specifier. - -2000-02-23 Andy Piper - - * gutter-items.el (add-tab-to-gutter): specify dimensions - dynamically. - -2000-02-24 Martin Buchholz - - * gutter-items.el (add-tab-to-gutter): - * package-get.el (package-get-interactive-package-query): - * package-ui.el (pui-directory-exists): - (pui-install-selected-packages): - (pui-list-packages): - Use #'(lambda ...) instead of '(lambda ...). - -2000-02-21 Gregory Neil Shapiro - - * startup.el (load-user-init-file): Check to make sure user - has an init-file before calling load(). - -2000-02-20 Kirill 'Big K' Katsnelson - - * msw-glyphs.el (msgdi-device-p): Added this and 'msgdi specifier tag. - -2000-02-23 Martin Buchholz - - * XEmacs 21.2.31 is released. - -2000-02-21 Mike Sperber - - * loadup.el (really-early-error-handler): - * update-elc.el: - * make-docfile.el: - Remove dependency on EMACSBOOTSTRAP... environment variables. - -2000-02-21 Martin Buchholz - - * XEmacs 21.2.30 is released. - -2000-02-19 Martin Buchholz - - * byte-optimize.el (byte-optimize-plus): - (byte-optimize-minus): - (byte-optimize-multiply): - Optimize (- 0) to 0, not (-) - Optimize (+ 5 3.0) to 8.0 - Optimize (* 5 3.0) to 15.0 - Improve readability. - -2000-02-21 Jonathan Harris - - * modeline.el: (modeline-scrolling-method): change modeline - mswindows cursor appearance according to the value. - - * msw-faces.el: (mswindows-init-device-faces): Initialise 'default - and 'gui-element face colors and 'gui-element face font to Windows - defaults. - -2000-02-09 Stef Epardaud - - * font-lock.el: Javadoc enhancements - -1999-11-27 Oscar Figueiredo - - * ldap.el (toplevel): Test if LDAP support has been compiled in - (ldap-verbose): New option - (ldap-search-entries): Renamed from the previous ldap-search - Conditionalize message display on ldap-verbose - (ldap-add-entries, ldap-modify-entries, ldap-delete-entries): New - defuns - (ldap-search): Is now defined as an obsolete wrapper calling - ldap-search-basic or ldap-search-entries - - -1999-12-06 Hirokazu FUKUI - Shuhei KOBAYASHI - Jan Vroonhof - - * byte-optimize.el (byte-optimize-form-code-walker): Fixed. - When for-effect is true, didn't call `byte-optimize-form' - in and/or subforms without last. - -1999-12-07 Jan Vroonhof - - * package-get.el (package-get-download-sites): Use correct custom - type. - -2000-02-15 Kirill 'Big K' Katsnelson - - * files.el (write-file): Ask for coding system when compiled with - file-coding. - -2000-02-16 Andy Piper - - * buffer.el (switch-to-buffer): give norecord argument to - set-window-buffer instead of explicitly recording. - - * gutter-items.el (buffers-tab-switch-to-buffer): don't record if - we have to pick a window. - -1999-12-24 Yoshiki Hayashi - - * mule/mule-cmds.el (describe-language-support): Don't add - unexist function to help-map. - (describe-coding-system): Don't use already assigend `C'. - -2000-01-23 Bjrn Torkelsson - - * info.el (Info-save-auto-generated-dir): nil -> 'never to make it - work in custom. - -2000-02-04 Kazuyuki IENAGA - - * about.el: Ienaga's e-mail address change. - -2000-02-16 Samuel Mikes - - * etags.el (find-tag): force new window -- even if buf already - visible -- when other-window is t - -2000-02-16 Martin Buchholz - - * XEmacs 21.2.29 is released. - -2000-02-09 Martin Buchholz - - * cl-extra.el (getf): This is now identical to `plist-get', so - just defalias it. - * cl-macs.el: Make getf an alias to plist-get, at the - byte-compiler level, using define-compiler-macro. - -2000-02-08 Martin Buchholz - - * cl-extra.el (cl-remprop): Remove. remprop is now in C. - -2000-02-07 Kyle Jones - - * lisp/etags.el (find-tag-internal): set exact-tagname to - a regular expression that matches against the tagname - part of the tag entry first instead of only looking in - the context area. - -2000-01-23 Bjrn Torkelsson - - * gutter-items.el: fixed typo(s) in customizing default-gutter-position - * toobar.el: fixed typo(s) in customizing default-toolbar-position - -2000-02-07 Martin Buchholz - - * XEmacs 21.2.28 is released. - -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 appropriate 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 @@ -6409,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 @@ -6537,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. @@ -6561,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 @@ -6575,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). @@ -6597,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. @@ -6607,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 @@ -6617,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 @@ -6682,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). @@ -6699,7 +373,7 @@ 1999-02-15 Martin Buchholz - * paths.el: + * paths.el: - improved automounter tmp directory support. - support 4 (!) empirically discovered automounter conventions @@ -6720,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. @@ -6728,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. @@ -6738,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 @@ -6786,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. @@ -6799,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 @@ -6827,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. @@ -6855,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 @@ -6904,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: @@ -7115,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 @@ -7127,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. @@ -7149,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. @@ -7177,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. @@ -7215,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 @@ -7236,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 @@ -7275,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. @@ -7310,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. @@ -7371,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 @@ -7407,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 @@ -7419,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. @@ -7440,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. @@ -7497,7 +1171,7 @@ Added interactive function `package-get-delete-package', for use by users for deleting a package. - Also modified to not require the presence of efs. + Also modified to not require the prescence of efs. 1998-09-22 Hrvoje Niksic @@ -7518,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 @@ -7526,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 @@ -7546,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 @@ -7592,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. @@ -7608,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' @@ -7656,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 @@ -7710,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 @@ -7791,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. @@ -7925,7 +1599,7 @@ * find-paths.el (paths-emacs-root-p): Relaxed emacs-root checking of an in-place installation to - also accommodate the flat layout used on MS Windows. + also accomodate the flat layout used on MS Windows. 1998-06-29 John Jones @@ -7936,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. @@ -7950,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 @@ -7967,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 @@ -7975,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 @@ -8045,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 @@ -8054,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 @@ -8101,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 @@ -8206,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 @@ -8308,7 +1982,7 @@ Wed May 27, 1998 Darryl Okahata * faces.el: move definition of xpm-color-symbols from x-faces.el to faces. Predicate x-get-resource on the presence of x. - * msw-faces.el: set 3d-object face rather than modeline. Specify + * msw-faces.el: set 3d-object face rather than modeline. Specifiy faces as specfier defaults. * package-get.el: don't use package-admin-add-single-file-package. @@ -8358,7 +2032,7 @@ Wed May 27, 1998 Darryl Okahata * 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 @@ -8466,7 +2140,7 @@ Wed May 27, 1998 Darryl Okahata 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'. @@ -8480,7 +2154,7 @@ Wed May 27, 1998 Darryl Okahata 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 @@ -8489,7 +2163,7 @@ Wed May 27, 1998 Darryl Okahata * 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'. @@ -8560,11 +2234,11 @@ Wed May 27, 1998 Darryl Okahata 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. @@ -8589,7 +2263,7 @@ Wed May 27, 1998 Darryl Okahata * 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. @@ -8775,8 +2449,8 @@ Wed May 27, 1998 Darryl Okahata 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. @@ -8848,11 +2522,11 @@ Wed May 27, 1998 Darryl Okahata 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. @@ -8861,7 +2535,7 @@ Wed May 27, 1998 Darryl Okahata * 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 @@ -8907,12 +2581,12 @@ Wed May 27, 1998 Darryl Okahata 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. @@ -9035,7 +2709,7 @@ Wed May 27, 1998 Darryl Okahata 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. @@ -9043,7 +2717,7 @@ Wed May 27, 1998 Darryl Okahata 1998-04-29 Andy Piper * code-process.el (call-process): dynamically decide process - coding type. + coding type. 1998-04-29 Jim Radford @@ -9089,7 +2763,7 @@ Wed May 27, 1998 Darryl Okahata * 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. @@ -9141,7 +2815,7 @@ Wed May 27, 1998 Darryl Okahata 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 @@ -9163,7 +2837,7 @@ Sat Apr 24 1998 Andy Piper * 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. @@ -9207,7 +2881,7 @@ Sat Apr 24 1998 Andy Piper * 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. @@ -9224,7 +2898,7 @@ Sat Apr 24 1998 Andy Piper * 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 @@ -9255,11 +2929,11 @@ Wed Apr 22 12:59:35 1998 Andy Piper 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 @@ -9273,7 +2947,7 @@ Wed Apr 22 12:59:35 1998 Andy Piper 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 @@ -9302,7 +2976,7 @@ Wed Apr 22 12:59:35 1998 Andy Piper * 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. @@ -9312,12 +2986,12 @@ Wed Apr 22 12:59:35 1998 Andy Piper 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] @@ -9329,7 +3003,7 @@ Wed Apr 22 12:59:35 1998 Andy Piper * 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 @@ -9346,7 +3020,7 @@ Thu Apr 16 12:59:35 1998 Andy Piper 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] @@ -9445,7 +3119,7 @@ Thu Apr 16 12:59:35 1998 Andy Piper * 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. @@ -9463,7 +3137,7 @@ Thu Apr 16 12:59:35 1998 Andy Piper * 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 @@ -9477,11 +3151,11 @@ Thu Apr 16 12:59:35 1998 Andy Piper (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. @@ -9501,7 +3175,7 @@ Thu Apr 16 12:59:35 1998 Andy Piper * 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. @@ -9538,7 +3212,7 @@ Sun Mar 29 1998 Andy Piper 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 @@ -9548,7 +3222,7 @@ Sun Mar 29 1998 Andy Piper 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] @@ -9607,7 +3281,7 @@ Sun Mar 29 1998 Andy Piper 1998-03-27 Kyle Jones - * faces.el: Separated face initializations based on + * faces.el: Separated face intializations based on device classes into device type specific (tag set, instantiator) pairs. @@ -9743,7 +3417,7 @@ Sun Mar 29 1998 Andy Piper 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 @@ -9783,11 +3457,11 @@ Sun Mar 29 1998 Andy Piper 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 @@ -9797,7 +3471,7 @@ Sun Mar 29 1998 Andy Piper 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. @@ -9818,7 +3492,7 @@ Sun Mar 29 1998 Andy Piper 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 @@ -9989,14 +3663,14 @@ Tue Feb 17 12:50:37 1998 Andy Piper 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 @@ -10044,23 +3718,23 @@ Tue Feb 17 12:50:37 1998 Andy Piper 1998-02-21 Greg Klanderman * (with-displaying-help-buffer): there is no need to kill the buffer - if it exists, because with-output-to-temp-buffer will clear it. + 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 +1998-02-23 Didier Verna - * modeline.el (mouse-drag-modeline): + * 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. + another window. -1998-02-23 Didier Verna +1998-02-23 Didier Verna * x-mouse.el (x-init-pointer-shape): use a crossed-arrows cursor glyph on the modeline to indicate that dragging the mouse has an @@ -10087,10 +3761,10 @@ Tue Feb 17 12:50:37 1998 Andy Piper 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 @@ -10109,20 +3783,20 @@ Tue Feb 17 12:50:37 1998 Andy Piper * 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. @@ -10221,7 +3895,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper 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): @@ -10234,7 +3908,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper * 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" @@ -10314,7 +3988,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper * 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 @@ -10331,7 +4005,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper (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 @@ -10350,9 +4024,9 @@ Tue Feb 17 12:50:37 1998 Andy Piper 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 @@ -10417,7 +4091,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper * (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. @@ -10441,7 +4115,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper (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' @@ -10508,7 +4182,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper * 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). @@ -10535,10 +4209,10 @@ Tue Feb 17 12:50:37 1998 Andy Piper * 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. @@ -10594,7 +4268,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper 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 @@ -10735,10 +4409,10 @@ Tue Feb 17 12:50:37 1998 Andy Piper 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 @@ -10758,7 +4432,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper * 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. @@ -10833,11 +4507,11 @@ Tue Feb 17 12:50:37 1998 Andy Piper * 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). @@ -10877,7 +4551,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper 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 @@ -10893,7 +4567,7 @@ Tue Feb 17 12:50:37 1998 Andy Piper 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 --git a/lisp/auto-autoloads.el b/lisp/auto-autoloads.el index 35096b5..b485276 100644 --- a/lisp/auto-autoloads.el +++ b/lisp/auto-autoloads.el @@ -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 @@ Describe the True Editor and its minions." t nil) ;;;*** -;;;### (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 @@ Returns list of symbols and documentation found." t nil) ;;;*** -;;;### (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 @@ are used." t nil) (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 @@ Update sections of the current buffer generated by `update-file-autoloads'." t n (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 @@ The directory to which the auto-autoloads.el file must be the first parameter 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,29 +117,7 @@ be used only with -batch." nil nil) ;;;*** -;;;### (autoloads (build-report) "build-report" "lisp/build-report.el") - -(autoload 'build-report "build-report" "\ -Report build information including Installation and make output. - -Prompts for status (usually \"Success\" or \"Failure\"). Then uses -`compose-mail' to create a mail message. The Subject header contains -status and version information. Point is left at the beginning of the -mail text. Add some notes if you like, and send the report. - -Looks for Installation and the make output file (`beta.err' by -default, customizable via `build-report-make-output-files') in the -build directory of the running XEmacs by default (customizable via -`build-report-make-output-dir'). The output from make is filtered -through `build-report-keep-regexp' and `build-report-delete-regexp' -before including in the message. - -See also `mail-user-agent', `build-report-destination', 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. @@ -159,8 +126,8 @@ Files in subdirectories of DIRECTORY are processed also." t nil) (autoload 'byte-recompile-directory "bytecomp" "\ Recompile every `.el' file in DIRECTORY that needs recompilation. This is if a `.elc' file exists but is older than the `.el' file. -Files in subdirectories of DIRECTORY are also processed unless -optional argument NORECURSION is non-nil. +Files in subdirectories of DIRECTORY are processed also unless argument +NORECURSION is non-nil. If the `.elc' file does not exist, normally the `.el' file is *not* compiled. But a prefix argument (optional second arg) means ask user, @@ -169,7 +136,7 @@ don't ask and compile the file anyway. A nonzero prefix argument also means ask about each subdirectory. -If the fourth optional argument FORCE is non-nil, +If the fourth argument FORCE is non-nil, recompile every `.el' file that already has a `.elc' file." t nil) (autoload 'byte-recompile-file "bytecomp" "\ @@ -225,12 +192,7 @@ Run `byte-compile-file' on the files remaining on the command line. Use this from the command line, with `-batch'; it won't work in an interactive Emacs. 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) +For example, invoke \"xemacs -batch -f batch-byte-compile $emacs/ ~/*.el\"" nil nil) (autoload 'batch-byte-recompile-directory-norecurse "bytecomp" "\ Same as `batch-byte-recompile-directory' but without recursion." nil nil) @@ -242,10 +204,18 @@ For example, invoke `xemacs -batch -f batch-byte-recompile-directory .'." nil ni ;;;*** -;;;### (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, @@ -531,7 +501,7 @@ Check that OBJECT is of type TYPE. TYPE is a Common Lisp-style type specifier." nil nil) (autoload 'check-type "cl-macs" "\ -Verify that PLACE is of type TYPE; signal a continuable error if not. +Verify that FORM is of type TYPE; signal an error if not. STRING is an optional description of the desired type." nil 'macro) (autoload 'assert "cl-macs" "\ @@ -565,6 +535,12 @@ and then returning foo." nil 'macro) ;;;*** +;;;### (autoloads (batch-remove-old-elc) "cleantree" "lisp/cleantree.el") + +(autoload 'batch-remove-old-elc "cleantree" nil nil nil) + +;;;*** + ;;;### (autoloads (config-value config-value-hash-table) "config" "lisp/config.el") (autoload 'config-value-hash-table "config" "\ @@ -587,7 +563,7 @@ Batch usage: xemacs -batch -l cus-dep.el -f Custom-make-dependencies DIRS" t nil ;;;*** -;;;### (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,12 +572,10 @@ 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." 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 any Lisp object. +Set the default for VARIABLE to VALUE. VALUE is a Lisp object. If VARIABLE has a `custom-set' property, that is used for setting VARIABLE, otherwise `set-default' is used. @@ -613,9 +587,7 @@ 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." 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 @@ 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." 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 @@ that option." nil nil) (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,67 +696,28 @@ If optional NAME is given, use that as the name of the menu. 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) (autoload 'custom-set-face-update-spec "cus-face" "\ Customize the FACE for display types matching DISPLAY, merging - in the new items from PLIST." nil nil) + in the new items from PLIST" nil nil) (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. -Associate this setting with the 'user' theme. - -ARGS is defined as for `custom-theme-reset-faces'." nil nil) - -;;;*** - -;;;### (autoloads (make-custom-file-name) "cus-file" "lisp/cus-file.el") - -(defconst custom-file-base "custom.el" "\ -Base of file name for storing customization information.") - -(defvar custom-file nil "\ -File used for storing customization information. -If you change this from the default you need to -explicitly load that file for the settings to take effect.") - -(autoload 'make-custom-file-name "cus-file" "\ -Construct the default custom file name from the init file name. -If FORCE-NEW is non-nil, force post-migration location." nil nil) - ;;;*** ;;;### (autoloads (disassemble) "disass" "lisp/disass.el") @@ -840,18 +773,13 @@ With prefix argument, enable European character display iff arg is positive." t ;;;*** -;;;### (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 @@ -864,8 +792,7 @@ in the tag table that matches the tagname used in the previous find-tag. the tag. This version of this function supports multiple active tags tables, -and completion. See also the commands `\\[push-tag-mark]' and -`\\[pop-tag-mark]'. +and completion. Variables of note: @@ -877,7 +804,7 @@ Variables of note: 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 @@ -953,11 +880,7 @@ This function pops (and moves to) the tag at the top of this stack." t nil) ;;;*** -;;;### (autoloads (finder-by-keyword finder-commentary) "finder" "lisp/finder.el") - -(autoload 'finder-commentary "finder" "\ -Display FILE's commentary section. -FILE should be in a form suitable for passing to `locate-library'." t nil) +;;;### (autoloads (finder-by-keyword) "finder" "lisp/finder.el") (autoload 'finder-by-keyword "finder" "\ Find packages matching a given keyword." t nil) @@ -982,165 +905,98 @@ Find packages matching a given keyword." t nil) (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) -(defcustom font-lock-fontify-string-delimiters nil "*If non-nil, apply font-lock-string-face to string delimiters as well as\nstring text when fontifying." :type 'boolean :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 ...) - - 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'. - - (\"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. - - (fubar-match 1 fubar-face) The first subexpression within all - occurrences of whatever the function - `fubar-match' finds and matches in the value - of `fubar-face'. - - (\"\\\\\\=\" (0 anchor-face) (\"\\\\\\=\" nil nil (0 item-face))) - -------------- --------------- ------------ --- --- ------------- - | | | | | | - MATCHER | ANCHOR-MATCHER | +------+ MATCH-HIGHLIGHT - MATCH-HIGHLIGHT PRE-MATCH-FORM | - POST-MATCH-FORM - - Discrete occurrences of \"anchor\" in the value of `anchor-face', and - subsequent discrete occurrences of \"item\" (on the same line) in the value - of `item-face'. (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil. - Therefore \"item\" is initially searched for starting from the end of the - match of \"anchor\", and searching for subsequent instance of \"anchor\" - resumes from where searching for \"item\" concluded.) - -For highlighting single items, typically only MATCH-HIGHLIGHT is required. -However, if an item or (typically) several items are to be highlighted -following the instance of another item (the anchor) then MATCH-ANCHORED may be -required. - -These regular expressions should not match text which spans lines. While -\\[font-lock-fontify-buffer] handles multi-line patterns correctly, updating when you -edit the buffer does not, since it considers text one line at a time. - -Be very careful composing regexps for this list; the wrong pattern can -dramatically slow things down! -") +A list of the keywords to highlight. +Each element should be of the form: -(make-variable-buffer-local 'font-lock-keywords) - -(defvar font-lock-syntactic-keywords nil "\ -A list of the syntactic keywords to highlight. -Can be the list or the name of a function or variable whose value is the list. -See `font-lock-keywords' for a description of the form of this list; -the differences are listed below. MATCH-HIGHLIGHT should be of the form: - - (MATCH SYNTAX OVERRIDE LAXMATCH) - -where SYNTAX can be of the form (SYNTAX-CODE . MATCHING-CHAR), the name of a -syntax table, or an expression whose value is such a form or a syntax table. -OVERRIDE cannot be `prepend' or `append'. + MATCHER + (MATCHER . MATCH) + (MATCHER . FACENAME) + (MATCHER . HIGHLIGHT) + (MATCHER HIGHLIGHT ...) + (eval . FORM) -For example, an element of the form highlights syntactically: +where HIGHLIGHT should be either MATCH-HIGHLIGHT or MATCH-ANCHORED. - (\"\\\\$\\\\(#\\\\)\" 1 (1 . nil)) +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. - a hash character when following a dollar character, with a SYNTAX-CODE of - 1 (meaning punctuation syntax). Assuming that the buffer syntax table does - specify hash characters to have comment start syntax, the element will only - highlight hash characters that do not follow dollar characters as comments - syntactically. - - (\"\\\\('\\\\).\\\\('\\\\)\" - (1 (7 . ?')) - (2 (7 . ?'))) +For highlighting single items, typically only MATCH-HIGHLIGHT is required. +However, if an item or (typically) items is to be highlighted following the +instance of another item (the anchor) then MATCH-ANCHORED may be required. + +MATCH-HIGHLIGHT should be of the form: + + (MATCH FACENAME OVERRIDE LAXMATCH) + +Where MATCHER can be either the regexp to search for, a variable +containing the regexp to search for, or the function to call to make +the search (called with one argument, the limit of the search). MATCH +is the subexpression of MATCHER to be highlighted. FACENAME is either +a symbol naming a face, or an expression whose value is the face name +to use. If you want FACENAME to be a symbol that evaluates to a face, +use a form like \"(progn sym)\". + +OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification may +be overwritten. If `keep', only parts not already fontified are highlighted. +If `prepend' or `append', existing fontification is merged with the new, in +which the new or existing fontification, respectively, takes precedence. +If LAXMATCH is non-nil, no error is signalled if there is no MATCH in MATCHER. + +For example, an element of the form highlights (if not already highlighted): + + \"\\\\\\=\" Discrete occurrences of \"foo\" in the value of the + variable `font-lock-keyword-face'. + (\"fu\\\\(bar\\\\)\" . 1) Substring \"bar\" within all occurrences of \"fubar\" in + the value of `font-lock-keyword-face'. + (\"fubar\" . fubar-face) Occurrences of \"fubar\" in the value of `fubar-face'. + (\"foo\\\\|bar\" 0 foo-bar-face t) + Occurrences of either \"foo\" or \"bar\" in the value + of `foo-bar-face', even if already highlighted. + +MATCH-ANCHORED should be of the form: + + (MATCHER PRE-MATCH-FORM POST-MATCH-FORM MATCH-HIGHLIGHT ...) + +Where MATCHER is as for MATCH-HIGHLIGHT with one exception; see below. +PRE-MATCH-FORM and POST-MATCH-FORM are evaluated before the first, and after +the last, instance MATCH-ANCHORED's MATCHER is used. Therefore they can be +used to initialize before, and cleanup after, MATCHER is used. Typically, +PRE-MATCH-FORM is used to move to some position relative to the original +MATCHER, before starting with MATCH-ANCHORED's MATCHER. POST-MATCH-FORM might +be used to move, before resuming with MATCH-ANCHORED's parent's MATCHER. + +For example, an element of the form highlights (if not already highlighted): + + (\"\\\\\\=\" (0 anchor-face) (\"\\\\\\=\" nil nil (0 item-face))) + + Discrete occurrences of \"anchor\" in the value of `anchor-face', and subsequent + discrete occurrences of \"item\" (on the same line) in the value of `item-face'. + (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil. Therefore \"item\" is + initially searched for starting from the end of the match of \"anchor\", and + searching for subsequent instance of \"anchor\" resumes from where searching + for \"item\" concluded.) + +The above-mentioned exception is as follows. The limit of the MATCHER search +defaults to the end of the line after PRE-MATCH-FORM is evaluated. +However, if PRE-MATCH-FORM returns a position greater than the position after +PRE-MATCH-FORM is evaluated, that position is used as the limit of the search. +It is generally a bad idea to return a position greater than the end of the +line, i.e., cause the MATCHER search to span lines. + +Note that the MATCH-ANCHORED feature is experimental; in the future, we may +replace it with other ways of providing this functionality. - both single quotes which surround a single character, with a SYNTAX-CODE of - 7 (meaning string quote syntax) and a MATCHING-CHAR of a single quote (meaning - a single quote matches a single quote). Assuming that the buffer syntax table - does not specify single quotes to have quote syntax, the element will only - highlight single quotes of the form 'c' as strings syntactically. - Other forms, such as foo'bar or 'fubar', will not be highlighted as strings. +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. -This is normally set via `font-lock-defaults'.") +Be very careful composing regexps for this list; +the wrong pattern can dramatically slow things down!") -(make-variable-buffer-local 'font-lock-syntactic-keywords) +(make-variable-buffer-local 'font-lock-keywords) (defcustom font-lock-mode nil "Non nil means `font-lock-mode' is on" :group 'font-lock :type 'boolean :initialize 'custom-initialize-default :require 'font-lock :set (function (lambda (var val) (font-lock-mode (or val 0))))) @@ -1184,10 +1040,10 @@ size, you can use \\[font-lock-fontify-buffer]. See the variable `font-lock-keywords' for customization." t nil) (autoload 'turn-on-font-lock "font-lock" "\ -Unconditionally turn on Font Lock mode." t nil) +Unconditionally turn on Font Lock mode." nil nil) (autoload 'turn-off-font-lock "font-lock" "\ -Unconditionally turn off Font Lock mode." t nil) +Unconditionally turn off Font Lock mode." nil nil) (autoload 'font-lock-fontify-buffer "font-lock" "\ Fontify the current buffer the way `font-lock-mode' would. @@ -1201,34 +1057,9 @@ This can take a while for large buffers." t nil) ;;;*** -;;;### (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" "\ -Return a font descriptor object for FONTNAME, appropriate for DEVICE." nil nil) +(autoload 'font-create-object "font" nil nil nil) (autoload 'font-default-font-for-device "font" nil nil nil) @@ -1263,20 +1094,6 @@ Prefix arg means just kill any existing server communications subprocess." t nil ;;;*** -;;;### (autoloads (gtk-reset-device-font-menus) "gtk-font-menu" "lisp/gtk-font-menu.el") - -(autoload 'gtk-reset-device-font-menus "gtk-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* gtk-font-menu-font-data (face dcache) (defvar gtk-font-regexp) (defvar gtk-font-regexp-foundry-and-family) (let* ((case-fold-search t) (domain (if font-menu-this-frame-only-p (selected-frame) (selected-device))) (name (font-instance-name (face-font-instance face domain))) (truename (font-instance-truename (face-font-instance face domain (if (featurep 'mule) 'ascii)))) family size weight entry slant) (when (string-match gtk-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 gtk-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 gtk-font-menu-font-data (make-vector 5 nil))) (when (string-match gtk-font-regexp name) (setq weight (capitalize (match-string 1 name))) (setq size (string-to-int (match-string 6 name)))) (when (string-match gtk-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))) - -;;;*** - ;;;### (autoloads nil "help-macro" "lisp/help-macro.el") (defcustom three-step-help t "*Non-nil means give more info about Help command in three steps.\nThe three steps are simple prompt, prompt with all options,\nand window listing and describing the options.\nA value of nil means skip the middle step, so that\n\\[help-command] \\[help-command] gives the window that lists the options." :type 'boolean :group 'help-appearance) @@ -1332,21 +1149,15 @@ Interactively set the variable on the current line." t nil) ;;;*** -;;;### (autoloads (Info-elisp-ref Info-emacs-key Info-goto-emacs-key-command-node Info-goto-emacs-command-node Info-emacs-command Info-search Info-visit-file Info-goto-node Info-batch-rebuild-dir Info-find-node Info-query info) "info" "lisp/info.el") +;;;### (autoloads (Info-elisp-ref Info-emacs-key Info-goto-emacs-key-command-node Info-goto-emacs-command-node Info-emacs-command Info-search Info-visit-file Info-goto-node Info-batch-rebuild-dir Info-query info) "info" "lisp/info.el") (defvar Info-directory-list nil "\ List of directories to search for Info documentation files. The first directory in this list, the \"dir\" file there will become -the (dir)Top node of the Info documentation tree. - -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. @@ -1359,20 +1170,12 @@ to read a file name from the minibuffer." t nil) (autoload 'Info-query "info" "\ Enter Info, the documentation browser. Prompt for name of Info file." t nil) -(autoload 'Info-find-node "info" "\ -Go to an info node specified as separate FILENAME and NODENAME. -Look for a plausible filename, or if not found then look for URL's and -dispatch to the appropriate fn. NO-GOING-BACK is non-nil if -recovering from an error in this function; it says do not attempt -further (recursive) error recovery. TRYFILE is ??" nil nil) - (autoload 'Info-batch-rebuild-dir "info" "\ -(Re)build `dir' files in the directories remaining on the command line. -Use this from the command line, with `-batch', it won't work in an -interactive XEmacs. - -Each file is processed even if an error occurred previously. For example, -invoke \"xemacs -batch -f Info-batch-rebuild-dir /usr/local/info\"." nil nil) +(Re)build info `dir' files in the directories remaining on the command line. +Use this from the command line, with `-batch'; +it won't work in an interactive Emacs. +Each file is processed even if an error occurred previously. +For example, invoke \"xemacs -batch -f Info-batch-rebuild-dir /usr/local/info\"" nil nil) (autoload 'Info-goto-node "info" "\ Go to info node named NAME. Give just NODENAME or (FILENAME)NODENAME. @@ -1425,24 +1228,10 @@ This command is designed to be used whether you are already in Info or not." t n ;;;*** -;;;### (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 (or (match-string 4 name) "0")))) (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 (or (match-string 4 truename) "0")))) (setq slant (match-string 5 truename))) (vector entry family size weight slant))) - -;;;*** - ;;;### (autoloads (mwheel-install) "mwheel" "lisp/mwheel.el") (autoload 'mwheel-install "mwheel" "\ -Enable mouse wheel support." t nil) +Enable mouse wheel support." nil nil) ;;;*** @@ -1508,8 +1297,6 @@ recent to least recent -- in other words, the version names don't have to 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 '(("Pre-Releases" "ftp.xemacs.org" "pub/xemacs/beta/experimental/packages") ("xemacs.org" "ftp.xemacs.org" "pub/xemacs/packages") ("ca.xemacs.org (Canada)" "ftp.ca.xemacs.org" "pub/Mirror/xemacs/packages") ("crc.ca (Canada)" "ftp.crc.ca" "pub/packages/editors/xemacs/packages") ("us.xemacs.org (United States)" "ftp.us.xemacs.org" "pub/xemacs/packages") ("ibiblio.org (United States)" "ibiblio.org" "pub/packages/editors/xemacs/packages") ("stealth.net (United States)" "ftp.stealth.net" "pub/mirrors/ftp.xemacs.org/pub/xemacs/packages") ("br.xemacs.org (Brazil)" "ftp.br.xemacs.org" "pub/xemacs/packages") ("at.xemacs.org (Austria)" "ftp.at.xemacs.org" "editors/xemacs/packages") ("be.xemacs.org (Belgium)" "ftp.be.xemacs.org" "xemacs/packages") ("cz.xemacs.org (Czech Republic)" "ftp.cz.xemacs.org" "MIRRORS/ftp.xemacs.org/pub/xemacs/packages") ("dk.xemacs.org (Denmark)" "ftp.dk.xemacs.org" "pub/emacs/xemacs/packages") ("fi.xemacs.org (Finland)" "ftp.fi.xemacs.org" "pub/mirrors/ftp.xemacs.org/pub/tux/xemacs/packages") ("fr.xemacs.org (France)" "ftp.fr.xemacs.org" "pub/xemacs/packages") ("pasteur.fr (France)" "ftp.pasteur.fr" "pub/computing/xemacs/packages") ("de.xemacs.org (Germany)" "ftp.de.xemacs.org" "pub/ftp.xemacs.org/tux/xemacs/packages") ("tu-darmstadt.de (Germany)" "ftp.tu-darmstadt.de" "pub/editors/xemacs/packages") ("ie.xemacs.org (Ireland)" "ftp.ie.xemacs.org" "mirrors/ftp.xemacs.org/pub/xemacs/packages") ("it.xemacs.org (Italy)" "ftp.it.xemacs.org" "unix/packages/XEMACS/packages") ("no.xemacs.org (Norway)" "ftp.no.xemacs.org" "pub/xemacs/packages") ("pl.xemacs.org (Poland)" "ftp.pl.xemacs.org" "pub/unix/editors/xemacs/packages") ("ru.xemacs.org (Russia)" "ftp.ru.xemacs.org" "pub/xemacs/packages") ("sk.xemacs.org (Slovakia)" "ftp.sk.xemacs.org" "pub/mirrors/xemacs/packages") ("se.xemacs.org (Sweden)" "ftp.se.xemacs.org" "pub/gnu/xemacs/packages") ("ch.xemacs.org (Switzerland)" "ftp.ch.xemacs.org" "mirror/xemacs/packages") ("uk.xemacs.org (United Kingdom)" "ftp.uk.xemacs.org" "sites/ftp.xemacs.org/pub/xemacs/packages") ("jp.xemacs.org (Japan)" "ftp.jp.xemacs.org" "pub/GNU/xemacs/packages") ("aist.go.jp (Japan)" "ring.aist.go.jp" "pub/text/xemacs/packages") ("asahi-net.or.jp (Japan)" "ring.asahi-net.or.jp" "pub/text/xemacs/packages") ("dti.ad.jp (Japan)" "ftp.dti.ad.jp" "pub/unix/editor/xemacs/packages") ("jaist.ac.jp (Japan)" "ftp.jaist.ac.jp" "pub/GNU/xemacs/packages") ("nucba.ac.jp (Japan)" "mirror.nucba.ac.jp" "mirror/xemacs/packages") ("sut.ac.jp (Japan)" "sunsite.sut.ac.jp" "pub/archives/packages/xemacs/packages") ("kr.xemacs.org (Korea)" "ftp.kr.xemacs.org" "pub/tools/emacs/xemacs/packages") ("za.xemacs.org (South Africa)" "ftp.za.xemacs.org" "mirrorsites/ftp.xemacs.org/packages") ("sa.xemacs.org (Saudi Arabia)" "ftp.sa.xemacs.org" "pub/mirrors/ftp.xemacs.org/xemacs/packages") ("au.xemacs.org (Australia)" "ftp.au.xemacs.org" "pub/xemacs/packages") ("aarnet.edu.au (Australia)" "mirror.aarnet.edu.au" "pub/xemacs/packages") ("nz.xemacs.org (New Zealand)" "ftp.nz.xemacs.org" "mirror/ftp.xemacs.org/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) @@ -1575,7 +1362,7 @@ package is already installed. Valid values for CONFLICT are: 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. @@ -1591,7 +1378,7 @@ successfully installed but errors occurred during initialization, or (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 @@ -1602,17 +1389,6 @@ Fetch and install the latest versions of all customized packages." t nil) ;;;*** -;;;### (autoloads (package-net-update-installed-db package-net-setup-directory) "package-net" "lisp/package-net.el") - -(autoload 'package-net-setup-directory "package-net" nil nil nil) - -(autoload 'package-net-update-installed-db "package-net" "\ -Write out the installed package index in a net install suitable format. -If DESTDIR is non-nil then use that as the destination directory. -DESTDIR defaults to the value of `package-net-setup-directory'." nil nil) - -;;;*** - ;;;### (autoloads (pui-list-packages pui-add-install-directory package-ui-add-site) "package-ui" "lisp/package-ui.el") (autoload 'package-ui-add-site "package-ui" "\ @@ -1698,38 +1474,29 @@ they are not defaultly assigned to keys." t nil) ;;;*** -;;;### (autoloads (clear-rectangle replace-rectangle string-rectangle open-rectangle insert-rectangle yank-rectangle kill-rectangle extract-rectangle delete-extract-rectangle delete-rectangle) "rect" "lisp/rect.el") +;;;### (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) @@ -1743,32 +1510,21 @@ After this command, the mark is at the upper left corner 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) - -(autoload 'replace-rectangle "rect" "\ -Like `string-rectangle', but unconditionally replace the original region, -as if `pending-delete-mode' were active." 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) ;;;*** @@ -1822,11 +1578,6 @@ buffer called `*Shadows*'. Shadowings are located by calling the (autoload 'load-sound-file "sound" "\ Read in an audio-file and add it to the sound-alist. -FILENAME can either be absolute or relative, in which case the file will -be searched in the directories given by `default-sound-directory-list'. -When looking for the file, the extensions given by `sound-extension-list' are -also tried in the given order. - You can only play sound files if you are running on display 0 of the console of a machine with native sound support or running a NetAudio server and XEmacs has the necessary sound support compiled in. @@ -1845,21 +1596,21 @@ server and XEmacs has the necessary sound support compiled in." t nil) ;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock) "userlock" "lisp/userlock.el") (autoload 'ask-user-about-lock "userlock" "\ -Ask user wanting to edit FILENAME, locked by OTHER-USER, what to do. +Ask user what to do when he wants to edit FILE but it is locked by USER. This function has a choice of three things to do: - do (signal 'file-locked (list FILENAME OTHER-USER)) + do (signal 'file-locked (list FILE USER)) to refrain from editing the file return t (grab the lock on the file) return nil (edit the file even though it is locked). -You can rewrite it to use any criteria you like to choose which one to do." nil nil) +You can rewrite it to use any criterion you like to choose which one to do." nil nil) (autoload 'ask-user-about-supersession-threat "userlock" "\ -Ask user who is about to modify an obsolete buffer what to do. +Ask a user who is about to modify an obsolete buffer what to do. This function has two choices: it can return, in which case the modification -of the buffer will proceed, or it can (signal 'file-supersession (FILENAME)), +of the buffer will proceed, or it can (signal 'file-supersession (file)), in which case the proposed buffer modification will not be made. -You can rewrite this to use any criteria you like to choose which one to do. +You can rewrite this to use any criterion you like to choose which one to do. The buffer in question is current when this function is called." nil nil) ;;;*** @@ -1871,13 +1622,13 @@ The buffer in question is current when this function is called." nil nil) (defvar view-mode-map (let ((map (copy-keymap view-minor-mode-map))) (set-keymap-name map 'view-mode-map) map)) (autoload 'view-file "view-less" "\ -Find FILENAME, enter view mode. With prefix arg OTHER-WINDOW-P, use other window." t nil) +Find FILE, enter view mode. With prefix arg OTHER-P, use other window." t nil) (autoload 'view-buffer "view-less" "\ -Switch to BUFFER, enter view mode. With prefix arg use other window." t nil) +Switch to BUF, enter view mode. With prefix arg use other window." t nil) (autoload 'view-file-other-window "view-less" "\ -Find FILENAME in other window, and enter view mode." t nil) +Find FILE in other window, and enter view mode." t nil) (autoload 'view-buffer-other-window "view-less" "\ Switch to BUFFER in another window, and enter view mode." t nil) @@ -1968,9 +1719,15 @@ Delete WIDGET." nil nil) ;;;*** -;;;### (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") -(autoload 'x-reset-device-font-menus "x-font-menu" "\ +(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) + +(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 @@ -1978,7 +1735,11 @@ If you don't like the lazy invocation of this function, you can add it to 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) (defvar x-font-regexp) (defvar x-font-regexp-foundry-and-family) (let* ((case-fold-search t) (domain (if font-menu-this-frame-only-p (selected-frame) (selected-device))) (name (font-instance-name (face-font-instance face domain))) (truename (font-instance-truename (face-font-instance face domain (if (featurep 'mule) 'ascii)))) family size weight entry slant) (when (string-match x-font-regexp-foundry-and-family name) (setq family (capitalize (match-string 1 name))) (setq entry (vassoc family (aref dcache 0)))) (when (and (null entry) (string-match x-font-regexp-foundry-and-family truename)) (setq family (capitalize (match-string 1 truename))) (setq entry (vassoc family (aref dcache 0)))) (when (null entry) (return-from x-font-menu-font-data (make-vector 5 nil))) (when (string-match x-font-regexp name) (setq weight (capitalize (match-string 1 name))) (setq size (string-to-int (match-string 6 name)))) (when (string-match x-font-regexp truename) (when (not (member weight (aref entry 1))) (setq weight (capitalize (match-string 1 truename)))) (when (not (member size (aref entry 2))) (setq size (string-to-int (match-string 6 truename)))) (setq slant (capitalize (match-string 2 truename)))) (vector entry family size weight slant))) +(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) ;;;*** @@ -1994,4 +1755,4 @@ or if you change your font path, you can call this to re-initialize the menus." ;;;*** -(provide 'lisp-autoloads) +(provide 'Standard-autoloads) diff --git a/lisp/bytecomp.el b/lisp/bytecomp.el index f468eeb..d8ab789 100644 --- a/lisp/bytecomp.el +++ b/lisp/bytecomp.el @@ -3,14 +3,13 @@ ;;; Copyright (C) 1985-1987, 1991-1994 Free Software Foundation, Inc. ;;; Copyright (C) 1996 Ben Wing. -;; Authors: Jamie Zawinski +;; Author: Jamie Zawinski ;; Hallvard Furuseth -;; Ben Wing -;; Martin Buchholz -;; Richard Stallman -;; Keywords: internal lisp +;; Keywords: internal -(defconst byte-compile-version "2.27 XEmacs; 2000-09-12.") +;; Subsequently modified by RMS and others. + +(defconst byte-compile-version (purecopy "2.26 XEmacs; 1998-10-07.")) ;; This file is part of XEmacs. @@ -34,15 +33,8 @@ ;;; Commentary: ;; The Emacs Lisp byte compiler. This crunches lisp source into a -;; sort of p-code (`bytecode') which takes up less space and can be -;; interpreted faster. First, the source code forms are converted to -;; an intermediate form, `lapcode' [`LAP' == `Lisp Assembly Program'] -;; which is much easier to manipulate than bytecode. Then the lapcode -;; is converted to bytecode, which can be considered to be actual -;; machine language. Optimizations can occur at either the source -;; level or the lapcode level. - -;; The user entry points are byte-compile-file, +;; sort of p-code which takes up less space and can be interpreted +;; faster. The user entry points are byte-compile-file, ;; byte-recompile-directory and byte-compile-buffer. ;;; Code: @@ -121,7 +113,7 @@ ;;; generate .elc files which can be loaded into ;;; generic emacs 19. ;;; emacs-lisp-file-regexp Regexp for the extension of source-files; -;;; see also the function `byte-compile-dest-file'. +;;; see also the function byte-compile-dest-file. ;;; byte-compile-overwrite-file If nil, delete old .elc files before saving. ;;; ;;; Most of the above parameters can also be set on a file-by-file basis; see @@ -145,7 +137,7 @@ ;;; This is, in fact, exactly what `defsubst' does. To make a function no ;;; longer be inline, you must use `proclaim-notinline'. Beware that if ;;; you define a function with `defsubst' and later redefine it with -;;; `defun', it will still be open-coded until you use `proclaim-notinline'. +;;; `defun', it will still be open-coded until you use proclaim-notinline. ;;; ;;; o You can also open-code one particular call to a function without ;;; open-coding all calls. Use the 'inline' form to do this, like so: @@ -164,20 +156,20 @@ ;;; ;;; o Forms like ((lambda ...) ...) are open-coded. ;;; -;;; o The form `eval-when-compile' is like `progn', except that the body +;;; o The form `eval-when-compile' is like progn, except that the body ;;; is evaluated at compile-time. When it appears at top-level, this ;;; is analogous to the Common Lisp idiom (eval-when (compile) ...). ;;; When it does not appear at top-level, it is similar to the ;;; Common Lisp #. reader macro (but not in interpreted code). ;;; -;;; o The form `eval-and-compile' is similar to `eval-when-compile', -;;; but the whole form is evalled both at compile-time and at run-time. +;;; o The form `eval-and-compile' is similar to eval-when-compile, but +;;; the whole form is evalled both at compile-time and at run-time. ;;; ;;; o The command M-x byte-compile-and-load-file does what you'd think. ;;; -;;; o The command `compile-defun' is analogous to `eval-defun'. +;;; o The command compile-defun is analogous to eval-defun. ;;; -;;; o If you run `byte-compile-file' on a filename which is visited in a +;;; o If you run byte-compile-file on a filename which is visited in a ;;; buffer, and that buffer is modified, you are asked whether you want ;;; to save the buffer before compiling. ;;; @@ -229,7 +221,7 @@ is compiled with optimization, this causes a speedup.") (defmacro byte-compile-version-cond (cond) cond))) ) -(defvar emacs-lisp-file-regexp "\\.el$" +(defvar emacs-lisp-file-regexp (purecopy "\\.el$") "*Regexp which matches Emacs Lisp source files. You may want to redefine `byte-compile-dest-file' if you change this.") @@ -443,33 +435,16 @@ on the specbind stack. The cdr of each cell is an integer bitmask.") (defvar byte-compiler-error-flag) -;;; A form of eval that includes the currently defined macro definitions. -;;; This helps implement the promise made in the Lispref: -;;; -;;; "If a file being compiled contains a `defmacro' form, the macro is -;;; defined temporarily for the rest of the compilation of that file." -(defun byte-compile-eval (form) - (let ((save-macro-environment nil)) - (unwind-protect - (loop for (sym . def) in byte-compile-macro-environment do - (push - (if (fboundp sym) (cons sym (symbol-function sym)) sym) - save-macro-environment) - (fset sym (cons 'macro def)) - finally return (eval form)) - (dolist (elt save-macro-environment) - (if (symbolp elt) - (fmakunbound elt) - (fset (car elt) (cdr elt))))))) - (defconst byte-compile-initial-macro-environment - '((byte-compiler-options . (lambda (&rest forms) - (apply 'byte-compiler-options-handler forms))) - (eval-when-compile . (lambda (&rest body) - (list 'quote (byte-compile-eval (cons 'progn body))))) - (eval-and-compile . (lambda (&rest body) - (byte-compile-eval (cons 'progn body)) - (cons 'progn body)))) + (purecopy + '((byte-compiler-options . (lambda (&rest forms) + (apply 'byte-compiler-options-handler forms))) + (eval-when-compile . (lambda (&rest body) + (list 'quote (eval (byte-compile-top-level + (cons 'progn body)))))) + (eval-and-compile . (lambda (&rest body) + (eval (cons 'progn body)) + (cons 'progn body))))) "The default macro-environment passed to macroexpand by the compiler. Placing a macro here will cause a macro to have different semantics when expanded by the compiler as when expanded by the interpreter.") @@ -733,18 +708,18 @@ otherwise pop it") (defconst byte-constant-limit 64 "Exclusive maximum index usable in the `byte-constant' opcode.") -(defconst byte-goto-ops - '(byte-goto byte-goto-if-nil byte-goto-if-not-nil - byte-goto-if-nil-else-pop - byte-goto-if-not-nil-else-pop) +(defconst byte-goto-ops (purecopy + '(byte-goto byte-goto-if-nil byte-goto-if-not-nil + byte-goto-if-nil-else-pop + byte-goto-if-not-nil-else-pop)) "List of byte-codes whose offset is a pc.") (defconst byte-goto-always-pop-ops - '(byte-goto-if-nil byte-goto-if-not-nil)) + (purecopy '(byte-goto-if-nil byte-goto-if-not-nil))) (defconst byte-rel-goto-ops - '(byte-rel-goto byte-rel-goto-if-nil byte-rel-goto-if-not-nil - byte-rel-goto-if-nil-else-pop byte-rel-goto-if-not-nil-else-pop) + (purecopy '(byte-rel-goto byte-rel-goto-if-nil byte-rel-goto-if-not-nil + byte-rel-goto-if-nil-else-pop byte-rel-goto-if-not-nil-else-pop)) "byte-codes for relative jumps.") (byte-extrude-byte-code-vectors) @@ -963,9 +938,7 @@ otherwise pop it") (concat "!! " (format (if (cdr error-info) "%s (%s)" "%s") (get (car error-info) 'error-message) - (prin1-to-string (cdr error-info))))) - (if stack-trace-on-error - (backtrace nil t))) + (prin1-to-string (cdr error-info)))))) ;;; Used by make-obsolete. (defun byte-compile-obsolete (form) @@ -1014,7 +987,7 @@ otherwise pop it") '(emacs19) '(emacs20))))) ;; now we can copy it. -(setq byte-compiler-legal-options byte-compiler-legal-options) +(setq byte-compiler-legal-options (purecopy byte-compiler-legal-options)) (defun byte-compiler-options-handler (&rest args) (let (key val desc choices) @@ -1246,10 +1219,7 @@ otherwise pop it") (setq var nil)) (setq rest (cdr rest))) ;; if var is nil at this point, it's a defvar in this file. - (not var)) - ;; Perhaps (eval-when-compile (defvar foo)) - (and (boundp 'current-load-list) - (memq var current-load-list)))) + (not var)))) ;;; If we have compiled bindings of variables which have no referents, warn. @@ -1350,11 +1320,11 @@ otherwise pop it") (point-max byte-compile-log-buffer)))) (unwind-protect - (call-with-condition-handler - #'(lambda (error-info) - (byte-compile-report-error error-info)) - #'(lambda () - (progn ,@body))) + (condition-case error-info + (progn ,@body) + (error + (byte-compile-report-error error-info))) + ;; Always set point in log to start of interesting output. (with-current-buffer byte-compile-log-buffer (let ((show-begin @@ -1385,14 +1355,14 @@ otherwise pop it") "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) "Recompile every `.el' file in DIRECTORY that needs recompilation. This is if a `.elc' file exists but is older than the `.el' file. -Files in subdirectories of DIRECTORY are also processed unless -optional argument NORECURSION is non-nil. +Files in subdirectories of DIRECTORY are processed also unless argument +NORECURSION is non-nil. If the `.elc' file does not exist, normally the `.el' file is *not* compiled. But a prefix argument (optional second arg) means ask user, @@ -1401,7 +1371,7 @@ don't ask and compile the file anyway. A nonzero prefix argument also means ask about each subdirectory. -If the fourth optional argument FORCE is non-nil, +If the fourth argument FORCE is non-nil, recompile every `.el' file that already has a `.elc' file." (interactive "DByte recompile directory: \nP") (if arg @@ -1552,7 +1522,11 @@ With prefix arg (noninteractively: 2nd arg), load the file after compiling." (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" @@ -1773,19 +1747,18 @@ With argument, insert value in current buffer after the form." ;; 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 @@ -1994,7 +1967,7 @@ list that represents a doc string reference. (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 @@ -2016,14 +1989,12 @@ list that represents a doc string reference. ;; No doc string, so we can compile this as a normal form. (byte-compile-keep-pending form 'byte-compile-normal-call))) -(put 'defvar 'byte-hunk-handler 'byte-compile-file-form-defvar-or-defconst) -(put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar-or-defconst) -(defun byte-compile-file-form-defvar-or-defconst (form) - ;; (defvar|defconst VAR [VALUE [DOCSTRING]]) +(put 'defvar 'byte-hunk-handler 'byte-compile-file-form-defvar) +(put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar) +(defun byte-compile-file-form-defvar (form) (if (> (length form) 4) - (byte-compile-warn - "%s %s called with %d arguments, but accepts only %s" - (car form) (nth 1 form) (length (cdr form)) 3)) + (byte-compile-warn "%s used with too many args (%s)" + (car form) (nth 1 form))) (if (and (> (length form) 3) (not (stringp (nth 3 form)))) (byte-compile-warn "Third arg to %s %s is not a string: %s" (car form) (nth 1 form) (nth 3 form))) @@ -2699,8 +2670,6 @@ If FORM is a lambda or a macro, byte-compile it as a function." (if (eq base-op 'byte-varset) byte-compile-assigned-bit byte-compile-referenced-bit))))) - (and (boundp 'current-load-list) - (memq var current-load-list)) (if (eq base-op 'byte-varset) (or (memq var byte-compile-free-assignments) (progn @@ -2744,8 +2713,8 @@ If FORM is a lambda or a macro, byte-compile it as a function." (defmacro byte-defop-compiler (function &optional compile-handler) ;; add a compiler-form for FUNCTION. - ;; If FUNCTION is a symbol, then the variable "byte-SYMBOL" must name - ;; the opcode to be used. If is a list, the first element + ;; If function is a symbol, then the variable "byte-SYMBOL" must name + ;; the opcode to be used. If function is a list, the first element ;; is the function and the second element is the bytecode-symbol. ;; COMPILE-HANDLER is the function to use to compile this byte-op, or ;; may be the abbreviations 0, 1, 2, 3, 0-1, 1-2, 2-3, 0+1, 1+1, 2+1, @@ -2935,6 +2904,11 @@ If FORM is a lambda or a macro, byte-compile it as a function." (byte-defop-compiler-rmsfun member 2) (byte-defop-compiler-rmsfun assq 2) +(byte-defop-compiler max byte-compile-associative) +(byte-defop-compiler min byte-compile-associative) +(byte-defop-compiler (+ byte-plus) byte-compile-associative) +(byte-defop-compiler (* byte-mult) byte-compile-associative) + ;;####(byte-defop-compiler move-to-column 1) (byte-defop-compiler-1 interactive byte-compile-noop) (byte-defop-compiler-1 domain byte-compile-domain) @@ -3013,52 +2987,40 @@ If FORM is a lambda or a macro, byte-compile it as a function." (defun byte-compile-no-args-with-one-extra (form) (case (length (cdr form)) (0 (byte-compile-no-args form)) - (1 (if (eq nil (nth 1 form)) - (byte-compile-no-args (butlast form)) - (byte-compile-normal-call form))) + (1 (byte-compile-normal-call form)) (t (byte-compile-subr-wrong-args form "0-1")))) (defun byte-compile-one-arg-with-one-extra (form) (case (length (cdr form)) (1 (byte-compile-one-arg form)) - (2 (if (eq nil (nth 2 form)) - (byte-compile-one-arg (butlast form)) - (byte-compile-normal-call form))) + (2 (byte-compile-normal-call form)) (t (byte-compile-subr-wrong-args form "1-2")))) (defun byte-compile-two-args-with-one-extra (form) (case (length (cdr form)) (2 (byte-compile-two-args form)) - (3 (if (eq nil (nth 3 form)) - (byte-compile-two-args (butlast form)) - (byte-compile-normal-call form))) + (3 (byte-compile-normal-call form)) (t (byte-compile-subr-wrong-args form "2-3")))) (defun byte-compile-zero-or-one-arg-with-one-extra (form) (case (length (cdr form)) (0 (byte-compile-one-arg (append form '(nil)))) (1 (byte-compile-one-arg form)) - (2 (if (eq nil (nth 2 form)) - (byte-compile-one-arg (butlast form)) - (byte-compile-normal-call form))) + (2 (byte-compile-normal-call form)) (t (byte-compile-subr-wrong-args form "0-2")))) (defun byte-compile-one-or-two-args-with-one-extra (form) (case (length (cdr form)) (1 (byte-compile-two-args (append form '(nil)))) (2 (byte-compile-two-args form)) - (3 (if (eq nil (nth 3 form)) - (byte-compile-two-args (butlast form)) - (byte-compile-normal-call form))) + (3 (byte-compile-normal-call form)) (t (byte-compile-subr-wrong-args form "1-3")))) (defun byte-compile-two-or-three-args-with-one-extra (form) (case (length (cdr form)) (2 (byte-compile-three-args (append form '(nil)))) (3 (byte-compile-three-args form)) - (4 (if (eq nil (nth 4 form)) - (byte-compile-three-args (butlast form)) - (byte-compile-normal-call form))) + (4 (byte-compile-normal-call form)) (t (byte-compile-subr-wrong-args form "2-4")))) (defun byte-compile-no-args-with-two-extra (form) @@ -3090,31 +3052,33 @@ If FORM is a lambda or a macro, byte-compile it as a function." (defun byte-compile-discard () (byte-compile-out 'byte-discard 0)) -(defun byte-compile-max (form) - (let ((args (cdr form))) +;; Compile a function that accepts one or more args and is right-associative. +;; We do it by left-associativity so that the operations +;; are done in the same order as in interpreted code. +;(defun byte-compile-associative (form) +; (if (cdr form) +; (let ((opcode (get (car form) 'byte-opcode)) +; (args (copy-sequence (cdr form)))) +; (byte-compile-form (car args)) +; (setq args (cdr args)) +; (while args +; (byte-compile-form (car args)) +; (byte-compile-out opcode 0) +; (setq args (cdr args)))) +; (byte-compile-constant (eval form)))) + +;; Compile a function that accepts one or more args and is right-associative. +;; We do it by left-associativity so that the operations +;; are done in the same order as in interpreted code. +(defun byte-compile-associative (form) + (let ((args (cdr form)) + (opcode (get (car form) 'byte-opcode))) (case (length args) - (0 (byte-compile-subr-wrong-args form "1 or more")) - (1 (byte-compile-form (car args)) - (when (not byte-compile-delete-errors) - (byte-compile-out 'byte-dup 0) - (byte-compile-out 'byte-max 0))) + (0 (byte-compile-constant (eval form))) (t (byte-compile-form (car args)) - (dolist (elt (cdr args)) - (byte-compile-form elt) - (byte-compile-out 'byte-max 0)))))) - -(defun byte-compile-min (form) - (let ((args (cdr form))) - (case (length args) - (0 (byte-compile-subr-wrong-args form "1 or more")) - (1 (byte-compile-form (car args)) - (when (not byte-compile-delete-errors) - (byte-compile-out 'byte-dup 0) - (byte-compile-out 'byte-min 0))) - (t (byte-compile-form (car args)) - (dolist (elt (cdr args)) - (byte-compile-form elt) - (byte-compile-out 'byte-min 0)))))) + (dolist (arg (cdr args)) + (byte-compile-form arg) + (byte-compile-out opcode 0)))))) ;; more complicated compiler macros @@ -3124,12 +3088,8 @@ If FORM is a lambda or a macro, byte-compile it as a function." (byte-defop-compiler fset) (byte-defop-compiler insert) (byte-defop-compiler-1 function byte-compile-function-form) -(byte-defop-compiler max) -(byte-defop-compiler min) -(byte-defop-compiler (+ byte-plus) byte-compile-plus) -(byte-defop-compiler-1 - byte-compile-minus) -(byte-defop-compiler (* byte-mult) byte-compile-mult) -(byte-defop-compiler (/ byte-quo) byte-compile-quo) +(byte-defop-compiler-1 - byte-compile-minus) +(byte-defop-compiler (/ byte-quo) byte-compile-quo) (byte-defop-compiler nconc) (byte-defop-compiler-1 beginning-of-line) @@ -3142,9 +3102,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." (defun byte-compile-arithcompare (form) (case (length (cdr form)) (0 (byte-compile-subr-wrong-args form "1 or more")) - (1 (if byte-compile-delete-errors - (byte-compile-constant t) - (byte-compile-normal-call form))) + (1 (byte-compile-constant t)) (2 (byte-compile-two-args form)) (t (byte-compile-normal-call form)))) @@ -3206,23 +3164,6 @@ If FORM is a lambda or a macro, byte-compile it as a function." (byte-compile-out 'byte-concatN nargs)) ((byte-compile-normal-call form))))) -(defun byte-compile-plus (form) - (let ((args (cdr form))) - (case (length args) - (0 (byte-compile-constant 0)) - (1 (byte-compile-plus (append form '(0)))) - (t (byte-compile-form (car args)) - (dolist (elt (cdr args)) - (case elt - (0 (when (not byte-compile-delete-errors) - (byte-compile-constant 0) - (byte-compile-out 'byte-plus 0))) - (+1 (byte-compile-out 'byte-add1 0)) - (-1 (byte-compile-out 'byte-sub1 0)) - (t - (byte-compile-form elt) - (byte-compile-out 'byte-plus 0)))))))) - (defun byte-compile-minus (form) (let ((args (cdr form))) (case (length args) @@ -3231,33 +3172,8 @@ If FORM is a lambda or a macro, byte-compile it as a function." (byte-compile-out 'byte-negate 0)) (t (byte-compile-form (car args)) (dolist (elt (cdr args)) - (case elt - (0 (when (not byte-compile-delete-errors) - (byte-compile-constant 0) - (byte-compile-out 'byte-diff 0))) - (+1 (byte-compile-out 'byte-sub1 0)) - (-1 (byte-compile-out 'byte-add1 0)) - (t - (byte-compile-form elt) - (byte-compile-out 'byte-diff 0)))))))) - -(defun byte-compile-mult (form) - (let ((args (cdr form))) - (case (length args) - (0 (byte-compile-constant 1)) - (1 (byte-compile-mult (append form '(1)))) - (t (byte-compile-form (car args)) - (dolist (elt (cdr args)) - (case elt - (1 (when (not byte-compile-delete-errors) - (byte-compile-constant 1) - (byte-compile-out 'byte-mult 0))) - (-1 (byte-compile-out 'byte-negate 0)) - (2 (byte-compile-out 'byte-dup 0) - (byte-compile-out 'byte-plus 0)) - (t - (byte-compile-form elt) - (byte-compile-out 'byte-mult 0)))))))) + (byte-compile-form elt) + (byte-compile-out 'byte-diff 0)))))) (defun byte-compile-quo (form) (let ((args (cdr form))) @@ -3268,16 +3184,8 @@ If FORM is a lambda or a macro, byte-compile it as a function." (byte-compile-out 'byte-quo 0)) (t (byte-compile-form (car args)) (dolist (elt (cdr args)) - (case elt - (+1 (when (not byte-compile-delete-errors) - (byte-compile-constant 1) - (byte-compile-out 'byte-quo 0))) - (-1 (byte-compile-out 'byte-negate 0)) - (t - (when (and (numberp elt) (= elt 0)) - (byte-compile-warn "Attempt to divide by zero: %s" form)) - (byte-compile-form elt) - (byte-compile-out 'byte-quo 0)))))))) + (byte-compile-form elt) + (byte-compile-out 'byte-quo 0)))))) (defun byte-compile-nconc (form) (let ((args (cdr form))) @@ -3806,8 +3714,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." (byte-defop-compiler-1 defun) (byte-defop-compiler-1 defmacro) (byte-defop-compiler-1 defvar) -(byte-defop-compiler-1 defvar byte-compile-defvar-or-defconst) -(byte-defop-compiler-1 defconst byte-compile-defvar-or-defconst) +(byte-defop-compiler-1 defconst byte-compile-defvar) (byte-defop-compiler-1 autoload) ;; According to Mly this can go now that lambda is a macro ;(byte-defop-compiler-1 lambda byte-compile-lambda-form) @@ -3835,39 +3742,32 @@ If FORM is a lambda or a macro, byte-compile it as a function." (list 'quote (cons 'macro (eval code)))))) (list 'quote (nth 1 form))))) -(defun byte-compile-defvar-or-defconst (form) - ;; This is not used for file-level defvar/defconsts with doc strings: - ;; byte-compile-file-form-defvar-or-defconst will be used in that case. - ;; (defvar|defconst VAR [VALUE [DOCSTRING]]) - (let ((fun (nth 0 form)) - (var (nth 1 form)) +(defun byte-compile-defvar (form) + ;; This is not used for file-level defvar/consts with doc strings: + ;; byte-compile-file-form-defvar will be used in that case. + (let ((var (nth 1 form)) (value (nth 2 form)) (string (nth 3 form))) - (when (> (length form) 4) - (byte-compile-warn - "%s %s called with %d arguments, but accepts only %s" - fun var (length (cdr form)) 3)) - (when (memq 'free-vars byte-compile-warnings) - (push (cons var byte-compile-global-bit) byte-compile-bound-variables)) + (if (> (length form) 4) + (byte-compile-warn "%s used with too many args" (car form))) + (if (memq 'free-vars byte-compile-warnings) + (setq byte-compile-bound-variables + (cons (cons var byte-compile-global-bit) + byte-compile-bound-variables))) (byte-compile-body-do-effect - (list - ;; Put the defined variable in this library's load-history entry - ;; just as a real defvar would, but only in top-level forms with values. - (when (and (> (length form) 2) - (null byte-compile-current-form)) - `(push ',var current-load-list)) - (when (> (length form) 3) - (when (and string (not (stringp string))) - (byte-compile-warn "Third arg to %s %s is not a string: %s" - fun var string)) - `(put ',var 'variable-documentation ,string)) - (if (cdr (cdr form)) ; `value' provided - (if (eq fun 'defconst) - ;; `defconst' sets `var' unconditionally. - `(setq ,var ,value) - ;; `defvar' sets `var' only when unbound. - `(if (not (boundp ',var)) (setq ,var ,value)))) - `',var)))) + (list (if (cdr (cdr form)) + (if (eq (car form) 'defconst) + (list 'setq var value) + (list 'or (list 'boundp (list 'quote var)) + (list 'setq var value)))) + ;; Put the defined variable in this library's load-history entry + ;; just as a real defvar would. + (list 'setq 'current-load-list + (list 'cons (list 'quote var) + 'current-load-list)) + (if string + (list 'put (list 'quote var) ''variable-documentation string)) + (list 'quote var))))) (defun byte-compile-autoload (form) (and (byte-compile-constp (nth 1 form)) @@ -4132,7 +4032,7 @@ invoked interactively." Use this from the command line, with `-batch'; it won't work in an interactive Emacs. Each file is processed even if an error occurred previously. -For example, invoke \"xemacs -batch -f batch-byte-compile $emacs/ ~/*.el\"." +For example, invoke \"xemacs -batch -f batch-byte-compile $emacs/ ~/*.el\"" ;; command-line-args-left is what is left of the command line (from ;; startup.el) (defvar command-line-args-left) ;Avoid 'free variable' warning @@ -4140,42 +4040,27 @@ For example, invoke \"xemacs -batch -f batch-byte-compile $emacs/ ~/*.el\"." (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 --git a/lisp/cleantree.el b/lisp/cleantree.el new file mode 100644 index 0000000..17f4680 --- /dev/null +++ b/lisp/cleantree.el @@ -0,0 +1,68 @@ +;;; cleantree.el --- Remove out of date .elcs in lisp directories + +;; Copyright (C) 1997 by Free Software Foundation, Inc. + +;; Author: Steven L Baur +;; Keywords: internal + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. + +;;; Synched up with: Not in FSF + +;;; Commentary: + +;; This code is derived from Gnus based on a suggestion by +;; David Moore + +;;; Code: + +(defun remove-old-elc-1 (dir &optional seen) + (setq dir (file-name-as-directory dir)) + ;; Only scan this sub-tree if we haven't been here yet. + (unless (member (file-truename dir) seen) + (push (file-truename dir) seen) + ;; We descend recursively + (let ((dirs (directory-files dir t nil t)) + dir) + (while (setq dir (pop dirs)) + (when (and (not (member (file-name-nondirectory dir) '("." ".."))) + (file-directory-p dir)) + (remove-old-elc-1 dir seen)))) + ;; Do this directory. + (let ((files (directory-files dir t ".el$")) + file file-c) + (while (setq file (car files)) + (setq files (cdr files)) + (setq file-c (concat file "c")) + (when (and (file-exists-p file-c) + (file-newer-than-file-p file file-c)) + (message file-c) + (delete-file file-c)))))) + +;;;###autoload +(defun batch-remove-old-elc () + (defvar command-line-args-left) + (unless noninteractive + (error "`batch-remove-old-elc' is to be used only with -batch")) + (let ((dir (car command-line-args-left))) + (message "Cleaning out of date .elcs in directory `%s'..." dir) + (remove-old-elc-1 dir) + (message "Cleaning out of date .elcs in directory `%s'...done" dir)) + (setq command-line-args-left nil)) + +;;; cleantree.el ends here diff --git a/lisp/cus-file.el b/lisp/cus-file.el index dcd1165..c01635e 100644 --- a/lisp/cus-file.el +++ b/lisp/cus-file.el @@ -47,10 +47,10 @@ explicitly load that file for the settings to take effect.") (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))) + (let* ((init-file (or init-file user-init-file)) + (init-file-directory (file-name-directory init-file))) (if (or force-new - (not init-file) - (string= (file-name-directory init-file) + (string= init-file-directory (expand-file-name (file-name-as-directory user-init-directory)))) (expand-file-name custom-file-base user-init-directory) diff --git a/lisp/custom-load.el b/lisp/custom-load.el index 90a3c79..54b38b3 100644 --- a/lisp/custom-load.el +++ b/lisp/custom-load.el @@ -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,13 +15,12 @@ (custom-add-loads 'menu '("menubar-items")) (custom-add-loads 'minibuffer '("simple" "minibuf")) (custom-add-loads 'log-message '("simple")) -(custom-add-loads 'environment '("frame" "keydefs" "minibuf" "modeline" "window-xemacs" "menubar" "gutter" "toolbar-items" "x-init" "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")) (custom-add-loads 'auto-save '("files" "auto-save")) -(custom-add-loads 'mail '("simple" "startup")) -(custom-add-loads 'lpr '("printer")) +(custom-add-loads 'mail '("simple")) (custom-add-loads 'custom-menu '("cus-edit")) (custom-add-loads 'docs '("hyper-apropos" "info")) (custom-add-loads 'tools '("etags" "hyper-apropos")) @@ -46,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")) @@ -59,35 +55,33 @@ (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")) (custom-add-loads 'languages '("lisp-mode" "cus-edit" "font-lock")) (custom-add-loads 'fill '("simple" "fill")) (custom-add-loads 'custom-magic-faces '("cus-edit")) -(custom-add-loads 'display '("modeline" "toolbar" "scrollbar" "auto-show")) +(custom-add-loads 'display '("toolbar" "scrollbar" "auto-show")) (custom-add-loads 'faces '("faces" "cus-edit" "font-lock" "font" "hyper-apropos" "info" "wid-edit")) (custom-add-loads 'emacs '("faces" "help" "files" "cus-edit" "package-get")) (custom-add-loads 'processes '("process" "gnuserv")) (custom-add-loads 'hyper-apropos '("hyper-apropos")) -(custom-add-loads 'wp '("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" "gtk-faces")) -(custom-add-loads 'buffers-tab '("gutter-items")) +(custom-add-loads 'x '("x-faces" "x-font-menu")) ;;; custom-load.el ends here diff --git a/lisp/dialog-gtk.el b/lisp/dialog-gtk.el index cb69ba7..5cf81c1 100644 --- a/lisp/dialog-gtk.el +++ b/lisp/dialog-gtk.el @@ -69,8 +69,7 @@ (gtk-widget-show-all widget) (gtk-main) (if (not clicked-ok) - (signal 'quit nil) - filename))) + (signal 'quit nil)))) (defalias 'popup-builtin-save-as-dialog 'popup-builtin-open-dialog) @@ -180,9 +179,7 @@ (dialog nil) ; GtkDialog (buttons nil) ; List of GtkButton objects (activep t) - (callback nil) (flushrightp nil) - (length nil) (errp t)) (if (not buttons-descr) (error 'syntax-error @@ -208,29 +205,28 @@ (if (not (vectorp button)) (error "Button descriptor is not a vector: %S" button)) - (setq length (length button)) - - (cond - ((= length 1) ; [ "name" ] - (setq callback nil - activep nil)) - ((= length 2) ; [ "name" callback ] - (setq callback (aref button 1) - activep t)) - ((and (or (= length 3) (= length 4)) - (not (keywordp (aref button 2)))) - ;; [ "name" callback active-p ] or - ;; [ "name" callback active-p suffix ] - ;; We ignore the 'suffix' entry, because that is - ;; what the X code does. - (setq callback (aref button 1) - activep (aref button 2))) - (t ; 100% keyword specification - (let ((plist (cdr (mapcar 'identity button)))) - (setq activep (plist-get plist :active) - callback (plist-get plist :callback))))) + (if (< (length button) 3) + (error "Button descriptor is too small: %S" button)) (push (gtk-button-new-with-label (aref button 0)) buttons) + + ;; Need to detect what flavor of descriptor it is. + (if (not (keywordp (aref button 2))) + ;; Simple style... just [ name callback activep ] + ;; We ignore the 'suffix' entry, because that is what + ;; the X code does. + (setq activep (aref button 2)) + (let ((ctr 2) + (len (length button))) + (if (logand len 1) + (error + "Button descriptor has an odd number of keywords and values: %S" + button)) + (while (< ctr len) + (if (eq (aref button ctr) :active) + (setq activep (aref button (1+ ctr)) + ctr len)) + (setq ctr (+ ctr 2))))) (gtk-widget-set-sensitive (car buttons) (eval activep)) ;; Apply the callback @@ -246,7 +242,7 @@ unread-command-events) (gtk-main-quit) t) - (cons callback dialog)) + (cons (aref button 1) dialog)) (gtk-widget-show (car buttons)) (funcall (if flushrightp 'gtk-box-pack-end 'gtk-box-pack-start) diff --git a/lisp/dialog-items.el b/lisp/dialog-items.el index 9b12179..5d26ac1 100644 --- a/lisp/dialog-items.el +++ b/lisp/dialog-items.el @@ -60,18 +60,17 @@ 'general :parent parent :title "Search" - :autosize t :spec (setq search-dialog (make-glyph `[layout - :orientation horizontal - :vertically-justify top - :horizontally-justify center + :orientation horizontal :justify left + ;; neither the following height/width nor the identical one + ;; below should be necessary! (see below) + :height 11 :width 40 :border [string :data "Search"] :items - ([layout :orientation vertical - :justify top ; implies left also + ([layout :orientation vertical :justify left :items ([string :data "Search for:"] [button :descriptor "Match Case" @@ -93,12 +92,10 @@ :selected (not search-dialog-direction) :callback (setq search-dialog-direction nil)] )] - [layout :orientation vertical - :vertically-justify top - :horizontally-justify right - :items + [layout :orientation vertical :justify left + :items ([edit-field :width 15 :descriptor "" :active t - :initial-focus t] + :face default :initial-focus t] [button :width 10 :descriptor "Find Next" :callback-ex (lambda (image-instance event) @@ -111,9 +108,8 @@ (isearch-dehighlight) (delete-frame (event-channel event)))])])])) - ;; These are no longer strictly necessary, but not setting a size - ;; at all yields a much more noticeable resize since the initial - ;; frame is so big. - :properties `(height ,(widget-logical-to-character-height 6) - width ,(widget-logical-to-character-width 39)) - ))) + ;; neither this height/width nor the identical one above should + ;; be necessary! (in fact, if you omit the one above, the layout + ;; sizes itself correctly; but the frame as a whole doesn't use + ;; the layout's size, as it should.) + :properties '(height 11 width 40)))) diff --git a/lisp/dump-paths.el b/lisp/dump-paths.el index ed3d568..10117d5 100644 --- a/lisp/dump-paths.el +++ b/lisp/dump-paths.el @@ -28,7 +28,6 @@ ;; This sets up the various paths for continuing loading files for ;; dumping. -;; #### This code is duplicated in startup.el (startup-setup-paths). (let ((debug-paths (or debug-paths (and (getenv "EMACSDEBUGPATHS") @@ -40,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)) @@ -62,16 +56,6 @@ (if debug-paths (princ (format "lisp-directory:\n%S\n" lisp-directory) 'external-debugging-output)) - (if (featurep 'mule) - (progn - (setq mule-lisp-directory - (paths-find-mule-lisp-directory roots - lisp-directory)) - (if debug-paths - (princ (format "mule-lisp-directory:\n%S\n" - mule-lisp-directory) - 'external-debugging-output))) - (setq mule-lisp-directory '())) (setq site-directory (and (null inhibit-site-lisp) (paths-find-site-lisp-directory roots))) (if (and debug-paths (null inhibit-site-lisp)) @@ -83,8 +67,7 @@ late-package-load-path '() lisp-directory - site-directory - mule-lisp-directory)) + site-directory)) (setq module-directory (paths-find-module-directory roots)) (if debug-paths diff --git a/lisp/dumped-lisp.el b/lisp/dumped-lisp.el index 731eef2..07c67ce 100644 --- a/lisp/dumped-lisp.el +++ b/lisp/dumped-lisp.el @@ -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,50 +79,26 @@ "text-mode" "fill" "auto-save" ; Added for 20.4 - "movemail" ; Added for 21.2 - (when-feature windows-nt "win32-native") + + (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" - - ;;;;;;;;;;;;;;;;;; GUI support - (when-feature window-system "gui") - (when-feature window-system "mouse") - (when-feature window-system "mode-motion") (when-feature toolbar "toolbar") (when-feature scrollbar "scrollbar") (when-feature menubar "menubar") (when-feature dialog "dialog") - (when-feature gutter "gutter") - (when-feature dragdrop-api "dragdrop") - "select" - - ;;;;;;;;;;;;;;;;;; Content for GUI's - ;; There used to be window-system inserted in the when-feature, - ;; but IMHO your configure script should turn off the menubar, - ;; toolbar, etc. features when there is no window system. We - ;; should just be able to assume that, if (featurep 'menubar), - ;; the menubar should work and if items are added, they can be - ;; seen clearly and usefully. - (when-feature (and (not infodock) menubar) "menubar-items") - (when-feature (and gutter) "gutter-items") - (when-feature (and (not infodock) toolbar) "toolbar-items") - (when-feature (and (not infodock) dialog) "dialog-items") - - ;;;;;;;;;;;;;;;;;; Coding-system support + (when-feature mule "mule-charset") (when-feature file-coding "coding") + (when-feature mule "mule-coding") +;; Handle I/O of files with extended characters. (when-feature file-coding "code-files") - ;; Handle process with encoding/decoding coding-system. + (when-feature mule "mule-files") +;; Handle process with encoding/decoding non-ascii coding-system. (when-feature file-coding "code-process") - ;; Provide basic commands to set coding systems to user - (when-feature file-coding "code-cmds") - ;;;;;;;;;;;;;;;;;; MULE support - (when-feature mule "mule-charset") - (when-feature mule "mule-coding") - ;; All files after this can have extended characters in them. (when-feature mule "mule-help") +;; Load the remaining basic files. (when-feature mule "mule-category") (when-feature mule "mule-ccl") (when-feature mule "mule-misc") @@ -158,10 +133,8 @@ (when-feature mule "hebrew") (when-feature mule "japanese") (when-feature mule "korean") - (when-feature mule "latin") (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") @@ -183,13 +156,15 @@ ;; Moved to sunpro-load.el - the default only for Sun. ;;(pureload "mime-setup") ;;; mule-load.el ends here - -;; preload InfoDock stuff. should almost certainly not be here if -;; id-menus is not here. infodock needs to figure out a clever way to -;; advise this stuff or we need to export a clean way for infodock or -;; others to control this programmatically. - (when-feature (and infodock (or x mswindows gtk) menubar) "id-menus") -;; preload the X code. + (when-feature window-system "gui") + (when-feature window-system "mode-motion") + (when-feature window-system "mouse") + (when-feature window-system "select") + (when-feature dragdrop-api "dragdrop") +;; preload the X code, for faster startup. + (when-feature (and (not infodock) + (or x mswindows) menubar) "menubar-items") + (when-feature (and infodock (or x mswindows) menubar) "id-menus") (when-feature x "x-faces") (when-feature x "x-iso8859-1") (when-feature x "x-mouse") @@ -197,22 +172,10 @@ (when-feature (and x scrollbar) "x-scrollbar") (when-feature x "x-misc") (when-feature x "x-init") + (when-feature (and (not infodock) + window-system toolbar) "toolbar-items") (when-feature x "x-win-xfree86") (when-feature x "x-win-sun") -;; preload the GTK code - (when-feature gtk "gtk-ffi") - (when-feature gtk "gtk-widgets") - (when-feature gtk "gdk") - (when-feature gtk "gtk-init") - (when-feature gtk "gtk-faces") - (when-feature gtk "gtk-iso8859-1") - (when-feature (and gtk dialog) "dialog-gtk") - (when-feature gtk "gtk-select") - (when-feature gtk "gtk-mouse") - (when-feature gtk "gtk-glyphs") - (when-feature glade "glade") - (when-feature gtk "widgets-gtk") - ;; preload the mswindows code. (when-feature mswindows "msw-glyphs") (when-feature mswindows "msw-faces") diff --git a/lisp/files.el b/lisp/files.el index 05d5011..186043f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -291,11 +291,11 @@ changing the major mode does not clear it. However, calling (defvar after-set-visited-file-name-hooks nil "List of functions to be called after \\[set-visited-file-name] or during \\[write-file]. -You can use this hook to restore local values of `write-file-hooks', -`after-save-hook', and `revert-buffer-function', which pertain +You can use this hook to restore local values of write-file-hooks, +after-save-hook, and revert-buffer-function, which pertain to a specific file and therefore are normally killed by a rename. -Put hooks pertaining to the buffer contents on `write-contents-hooks' -and `revert-buffer-insert-file-contents-function'.") +Put hooks pertaining to the buffer contents on write-contents-hooks +and revert-buffer-insert-file-contents-function.") (defvar write-contents-hooks nil "List of functions to be called before writing out a buffer to a file. @@ -371,23 +371,11 @@ and ignores this variable." ; (apply op args)) (defun convert-standard-filename (filename) - "Convert a standard file's name to something suitable for the current OS." - (if (eq system-type 'windows-nt) - (let ((name (copy-sequence filename)) - (start 0)) - ;; leave ':' if part of drive specifier - (if (and (> (length name) 1) - (eq (aref name 1) ?:)) - (setq start 2)) - ;; destructively replace invalid filename characters with ! - (while (string-match "[?*:<>|\"\000-\037]" name start) - (aset name (match-beginning 0) ?!) - (setq start (match-end 0))) - ;; FSF: [convert directory separators to Windows format ...] - ;; unneeded in XEmacs. - name) - filename)) - + "Convert a standard file's name to something suitable for the current OS. +This function's standard definition is trivial; it just returns the argument. +However, on some systems, the function is redefined +with a definition that really does change some file names." + filename) (defun pwd () "Show the current default directory." @@ -806,36 +794,29 @@ If optional argument HACK-HOMEDIR is non-nil, then this also substitutes (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))) @@ -882,34 +863,26 @@ If there is no such live buffer, return nil." (setq list (cdr list)))) found)))) -(defun insert-file-contents-literally (filename &optional visit start end replace) +(defun insert-file-contents-literally (filename &optional visit beg end replace) "Like `insert-file-contents', q.v., but only reads in the file. A buffer may be modified in several ways after reading into the buffer due -to advanced Emacs features, such as format decoding, character code -conversion, find-file-hooks, automatic uncompression, etc. - +to advanced Emacs features, such as file-name-handlers, format decoding, +find-file-hooks, etc. This function ensures that none of these modifications will take place." - (let ((wrap-func (find-file-name-handler filename - 'insert-file-contents-literally))) - (if wrap-func - (funcall wrap-func 'insert-file-contents-literally filename - visit start end replace) - (let ((file-name-handler-alist nil) - (format-alist nil) - (after-insert-file-functions nil) - (coding-system-for-read 'binary) - (coding-system-for-write 'binary) - (find-buffer-file-type-function - (if (fboundp 'find-buffer-file-type) - (symbol-function 'find-buffer-file-type) - nil))) - (unwind-protect - (progn - (fset 'find-buffer-file-type (lambda (filename) t)) - (insert-file-contents filename visit start end replace)) - (if find-buffer-file-type-function - (fset 'find-buffer-file-type find-buffer-file-type-function) - (fmakunbound 'find-buffer-file-type))))))) + (let ((file-name-handler-alist nil) + (format-alist nil) + (after-insert-file-functions nil) + (find-buffer-file-type-function + (if (fboundp 'find-buffer-file-type) + (symbol-function 'find-buffer-file-type) + nil))) + (unwind-protect + (progn + (fset 'find-buffer-file-type (lambda (filename) t)) + (insert-file-contents filename visit beg end replace)) + (if find-buffer-file-type-function + (fset 'find-buffer-file-type find-buffer-file-type-function) + (fmakunbound 'find-buffer-file-type))))) (defun find-file-noselect (filename &optional nowarn rawfile) "Read file FILENAME into a buffer and return the buffer. @@ -1048,8 +1021,7 @@ If RAWFILE is non-nil, the file is read literally." (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. @@ -1185,16 +1157,13 @@ run `normal-mode' explicitly." ("\\.m\\(?:[mes]\\|an\\)\\'" . nroff-mode) ("\\.icn\\'" . icon-mode) ("\\.\\(?:[ckz]?sh\\|shar\\)\\'" . sh-mode) - ("\\.[Pp][Rr][Oo]\\'" . idlwave-mode) - ("\\.si\\(v\\|eve\\)\\'" . sieve-mode) ;; #### Unix-specific! ("/\\.\\(?:bash_\\|z\\)?\\(profile\\|login\\|logout\\)\\'" . sh-mode) ("/\\.\\(?:[ckz]sh\\|bash\\|tcsh\\|es\\|xinit\\|startx\\)rc\\'" . sh-mode) ("/\\.\\(?:[kz]shenv\\|xsession\\)\\'" . sh-mode) - ("\\.m?spec$" .sh-mode) ;; The following come after the ChangeLog pattern for the sake of ;; ChangeLog.1, etc. and after the .scm.[0-9] pattern too. - ("\\.[123456789]\\'" . nroff-mode) + ("\\.[12345678]\\'" . nroff-mode) ("\\.[tT]e[xX]\\'" . tex-mode) ("\\.\\(?:sty\\|cls\\|bbl\\)\\'" . latex-mode) ("\\.bib\\'" . bibtex-mode) @@ -1216,20 +1185,19 @@ run `normal-mode' explicitly." ("\\.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) ;; .emacs following a directory delimiter in either Unix or ;; Windows syntax. ("[/\\][._].*emacs\\'" . emacs-lisp-mode) ("\\.m4\\'" . autoconf-mode) - ("configure\\(\\.in\\|\\.ac\\)\\'" . autoconf-mode) + ("configure\\.in\\'" . autoconf-mode) ("\\.ml\\'" . lisp-mode) - ("\\.ma?ke?\\'" . makefile-mode) - ("\\(GNU\\)?[Mm]akefile\\(\\.\\|\\'\\)" . makefile-mode) - ("[./\\]X\\(defaults\\|environment\\|resources\\|modmap\\)\\'" . xrdb-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?) ("/app-defaults/" . xrdb-mode) ("\\.[^/]*wm2?\\(?:rc\\)?\\'" . winmgr-mode) @@ -1253,9 +1221,7 @@ REGEXP and search the list again for another match.") ("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 @@ -1272,7 +1238,8 @@ with the name of the interpreter specified in the first line. If it matches, mode MODE is selected.") (defvar binary-file-regexps - '("\\.\\(?:bz2\\|elc\\|g\\(if\\|z\\)\\|jp\\(eg\\|g\\)\\|png\\|t\\(ar\\|gz\\|iff\\)\\|[Zo]\\)\\'") + (purecopy + '("\\.\\(?:bz2\\|elc\\|g\\(if\\|z\\)\\|jp\\(eg\\|g\\)\\|png\\|t\\(ar\\|gz\\|iff\\)\\|[Zo]\\)\\'")) "List of regexps of filenames containing binary (non-text) data.") ; (eval-when-compile @@ -1292,9 +1259,9 @@ If it matches, mode MODE is selected.") ; "tiff" ; "jpg" ; "jpeg")))))) - + (defvar inhibit-first-line-modes-regexps - binary-file-regexps + (purecopy binary-file-regexps) "List of regexps; if one matches a file name, don't look for `-*-'.") (defvar inhibit-first-line-modes-suffixes nil @@ -1303,7 +1270,7 @@ When checking `inhibit-first-line-modes-regexps', we first discard 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) @@ -1342,15 +1309,9 @@ and we don't even do that unless it would come from the file name." (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))) @@ -1492,7 +1453,7 @@ for current buffer." (or force (hack-local-variables-p nil)))) (let ((continue t) - prefix prefixlen suffix start + prefix prefixlen suffix beg (enable-local-eval enable-local-eval)) ;; The prefix is what comes before "local variables:" in its line. ;; The suffix is what comes after "local variables:" in its line. @@ -1519,11 +1480,11 @@ for current buffer." (error "Local variables entry is missing the prefix"))) ;; Find the variable name; strip whitespace. (skip-chars-forward " \t") - (setq start (point)) + (setq beg (point)) (skip-chars-forward "^:\n") (if (eolp) (error "Missing colon in local variables entry")) (skip-chars-backward " \t") - (let* ((str (buffer-substring start (point))) + (let* ((str (buffer-substring beg (point))) (var (read str)) val) ;; Setting variable named "end" means end of list. @@ -1562,7 +1523,7 @@ for current buffer." (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 @@ -1854,7 +1815,7 @@ with a prefix argument, you will be prompted for the coding system." (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")) @@ -1908,7 +1869,7 @@ of the new file to agree with the old modes." (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)) @@ -1940,9 +1901,7 @@ of the new file to agree with the old modes." (setq setmodes (file-modes backupname))) (file-error ;; If trouble writing the backup, write it in ~. - (setq backupname - (expand-file-name - (convert-standard-filename "~/%backup%~"))) + (setq backupname (expand-file-name "~/%backup%~")) (message "Cannot write backup file; backing up in ~/%%backup%%~") (sleep-for 1) (condition-case () @@ -2028,14 +1987,21 @@ the value is \"\"." (defun make-backup-file-name (file) "Create the non-numeric backup file name for FILE. This is a separate function so you can redefine it for customization." - ;; FSF has code here for MS-DOS short filenames, not supported in XEmacs. - (concat file "~")) + (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, @@ -2056,7 +2022,6 @@ the index in the name where the version number begins." Value is a list whose car is the name for the backup file and whose cdr is a list of old versions to consider deleting now. If the value is nil, don't make a backup." - (declare (special bv-length)) (let ((handler (find-file-name-handler fn 'find-backup-file-name))) ;; Run a handler for this function so that ange-ftp can refuse to do it. (if handler @@ -2107,15 +2072,16 @@ If the value is nil, don't make a backup." "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 @@ -2245,22 +2211,20 @@ After saving the buffer, run `after-save-hook'." (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))) - - ;; Run the write-file-hooks until one returns non-nil. + (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 ;; recursively (from inside a write-file-hook) the @@ -2376,9 +2340,9 @@ After saving the buffer, run `after-save-hook'." "Provide a clean way for a write-file-hook to wrap AROUND the execution of the remaining hooks and writing to disk. Do not call this function except from a functions -on the `write-file-hooks' or `write-contents-hooks' list. +on the write-file-hooks or write-contents-hooks list. A hook that calls this function must return non-nil, -to signal completion to its caller. `continue-save-buffer' +to signal completion to its caller. continue-save-buffer always returns non-nil." (let ((hooks (cdr (or continue-save-buffer-hooks-tail (error @@ -2426,43 +2390,38 @@ Optional second argument EXITING means ask about certain non-file buffers ;; XEmacs - do not use queried flag (defun save-some-buffers-1 (arg exiting switch-buffer) (let* ((switched nil) - (last-buffer nil) (files-done (map-y-or-n-p (lambda (buffer) - (prog1 - (and (buffer-modified-p buffer) - (not (buffer-base-buffer buffer)) - ;; XEmacs addition: - (not (symbol-value-in-buffer 'save-buffers-skip buffer)) - (or - (buffer-file-name buffer) - (and exiting - (progn - (set-buffer buffer) - (and buffer-offer-save (> (buffer-size) 0))))) - (if arg - t - ;; #### We should provide a per-buffer means to - ;; disable the switching. For instance, you might - ;; want to turn it off for buffers the contents of - ;; which is meaningless to humans, such as - ;; `.newsrc.eld'. - (when (and switch-buffer - ;; map-y-or-n-p is displaying help - (not (eq last-buffer buffer))) - (unless (one-window-p) - (delete-other-windows)) - (setq switched t) - ;; #### Consider using `display-buffer' here for 21.1! - ;;(display-buffer buffer nil (selected-frame))) - (switch-to-buffer buffer t)) - (if (buffer-file-name buffer) - (format "Save file %s? " - (buffer-file-name buffer)) - (format "Save buffer %s? " - (buffer-name buffer))))) - (setq last-buffer buffer))) + (and (buffer-modified-p buffer) + (not (buffer-base-buffer buffer)) + ;; XEmacs addition: + (not (symbol-value-in-buffer 'save-buffers-skip buffer)) + (or + (buffer-file-name buffer) + (and exiting + (progn + (set-buffer buffer) + (and buffer-offer-save (> (buffer-size) 0))))) + (if arg + t + ;; #### We should provide a per-buffer means to + ;; disable the switching. For instance, you might + ;; want to turn it off for buffers the contents of + ;; which is meaningless to humans, such as + ;; `.newsrc.eld'. + (when switch-buffer + (unless (one-window-p) + (delete-other-windows)) + (setq switched t) + ;; #### Consider using `display-buffer' here for 21.1! + ;;(display-buffer buffer nil (selected-frame))) + (switch-to-buffer buffer t)) + (if (buffer-file-name buffer) + (format "Save file %s? " + (buffer-file-name buffer)) + (format "Save buffer %s? " + (buffer-name buffer)))))) (lambda (buffer) (set-buffer buffer) (condition-case () @@ -2490,7 +2449,7 @@ Optional second argument EXITING means ask about certain non-file buffers (recursive-edit) ;; Return nil to ask about BUF again. nil) - "%_Display Buffer")))) + "display the current buffer")))) (abbrevs-done (and save-abbrevs abbrevs-changed (progn @@ -2642,9 +2601,7 @@ which are the arguments that `revert-buffer' received.") (defvar revert-buffer-insert-file-contents-function nil "Function to use to insert contents when reverting this buffer. Gets two args, first the nominal file name to use, -and second, t if reading the auto-save file. -If the current buffer contents are to be discarded, the function must do -so itself.") +and second, t if reading the auto-save file.") (defvar before-revert-hook nil "Normal hook for `revert-buffer' to run before reverting. @@ -2669,10 +2626,10 @@ This undoes all changes since the file was visited or saved. With a prefix argument, offer to revert from latest auto-save file, if that is more recent than the visited file. -This command also refreshes certain special buffers that contain text -which doesn't come from a file, but reflects some other data base -instead: for example, Dired buffers and buffer-list buffers. This is -implemented by having the modes set `revert-buffer-function'. +This command also works for special buffers that contain text which +doesn't come from a file, but reflects some other data base instead: +for example, Dired buffers and buffer-list buffers. In these cases, +it reconstructs the buffer contents from the appropriate data base. When called from Lisp, the first argument is IGNORE-AUTO; only offer to revert from the auto-save file when this is nil. Note that the @@ -2684,17 +2641,13 @@ Optional second argument NOCONFIRM means don't ask for confirmation at all. Optional third argument PRESERVE-MODES non-nil means don't alter -the buffer's modes. Otherwise, reinitialize them using `normal-mode'. +the files modes. Normally we reinitialize them using `normal-mode'. If the value of `revert-buffer-function' is non-nil, it is called to do all the work for this command. Otherwise, the hooks `before-revert-hook' and `after-revert-hook' are run at the beginning and the end, and if `revert-buffer-insert-file-contents-function' is -non-nil, it is called instead of rereading visited file contents. - -If the buffer-modified flag is nil, and we are not reverting from an -auto-save file, then compare the contents of the buffer and the file. -Revert only if they differ." +non-nil, it is called instead of rereading visited file contents." ;; I admit it's odd to reverse the sense of the prefix argument, but ;; there is a lot of code out there which assumes that the first @@ -2706,9 +2659,6 @@ Revert only if they differ." (if revert-buffer-function (funcall revert-buffer-function ignore-auto noconfirm) (let* ((opoint (point)) - (newbuf nil) - (found nil) - (delay-prompt nil) (auto-save-p (and (not ignore-auto) (recent-auto-save-p) buffer-auto-save-file-name @@ -2722,114 +2672,62 @@ Revert only if they differ." (error "Buffer does not seem to be associated with any file")) ((or noconfirm (and (not (buffer-modified-p)) - (dolist (rx revert-without-query found) - (when (string-match rx file-name) - (setq found t)))) - ;; If we will call revert-buffer-internal, delay prompting - (and (not auto-save-p) - (not (buffer-modified-p)) - (setq delay-prompt t)) + (let (found) + (dolist (rx revert-without-query found) + (when (string-match rx file-name) + (setq found t))))) (yes-or-no-p (format "Revert buffer from file %s? " file-name))) (run-hooks 'before-revert-hook) - (cond ((or auto-save-p - (buffer-modified-p) - ;; Do we need to do expensive reversion? Compare ... - (and (setq newbuf (revert-buffer-internal - file-name)) - ;; ... and if different, prompt - (or noconfirm found - (and delay-prompt - (yes-or-no-p - (format "Revert buffer from file %s? " - file-name)))))) - ;; If file was backed up but has changed since, - ;; we should make another backup. - (and (not auto-save-p) - (not (verify-visited-file-modtime (current-buffer))) - (setq buffer-backed-up nil)) - ;; Get rid of all undo records for this buffer. - (or (eq buffer-undo-list t) - (setq buffer-undo-list nil)) - ;; Effectively copy the after-revert-hook status, - ;; since after-find-file will clobber it. - (let ((global-hook (default-value 'after-revert-hook)) - (local-hook-p (local-variable-p 'after-revert-hook - (current-buffer))) - (local-hook (and (local-variable-p 'after-revert-hook - (current-buffer)) - after-revert-hook))) - (let (buffer-read-only - ;; Don't make undo records for the reversion. - (buffer-undo-list t)) - (if revert-buffer-insert-file-contents-function - (funcall revert-buffer-insert-file-contents-function - file-name auto-save-p) - (if (not (file-exists-p file-name)) - (error "File %s no longer exists!" file-name)) - ;; Bind buffer-file-name to nil - ;; so that we don't try to lock the file. - (let ((buffer-file-name nil)) - (or auto-save-p - (unlock-buffer))) - (widen) - (insert-file-contents file-name (not auto-save-p) - nil nil t))) - (goto-char (min opoint (point-max))) - ;; Recompute the truename in case changes in symlinks - ;; have changed the truename. - ;;XEmacs: already done by insert-file-contents - ;;(setq buffer-file-truename - ;;(abbreviate-file-name (file-truename buffer-file-name))) - (after-find-file nil nil t t preserve-modes) - ;; Run after-revert-hook as it was before we reverted. - (setq-default revert-buffer-internal-hook global-hook) - (if local-hook-p - (progn - (make-local-variable 'revert-buffer-internal-hook) - (setq revert-buffer-internal-hook local-hook)) - (kill-local-variable 'revert-buffer-internal-hook)) - (run-hooks 'revert-buffer-internal-hook))) - ((null newbuf) - ;; The resultant buffer is identical, alter - ;; modtime, update mods and exit - (set-visited-file-modtime) - (after-find-file nil nil t t t)) - (t t)) + ;; If file was backed up but has changed since, + ;; we shd make another backup. + (and (not auto-save-p) + (not (verify-visited-file-modtime (current-buffer))) + (setq buffer-backed-up nil)) + ;; Get rid of all undo records for this buffer. + (or (eq buffer-undo-list t) + (setq buffer-undo-list nil)) + ;; Effectively copy the after-revert-hook status, + ;; since after-find-file will clobber it. + (let ((global-hook (default-value 'after-revert-hook)) + (local-hook-p (local-variable-p 'after-revert-hook + (current-buffer))) + (local-hook (and (local-variable-p 'after-revert-hook + (current-buffer)) + after-revert-hook))) + (let (buffer-read-only + ;; Don't make undo records for the reversion. + (buffer-undo-list t)) + (if revert-buffer-insert-file-contents-function + (funcall revert-buffer-insert-file-contents-function + file-name auto-save-p) + (if (not (file-exists-p file-name)) + (error "File %s no longer exists!" file-name)) + ;; Bind buffer-file-name to nil + ;; so that we don't try to lock the file. + (let ((buffer-file-name nil)) + (or auto-save-p + (unlock-buffer))) + (widen) + (insert-file-contents file-name (not auto-save-p) + nil nil t))) + (goto-char (min opoint (point-max))) + ;; Recompute the truename in case changes in symlinks + ;; have changed the truename. + ;XEmacs: already done by insert-file-contents + ;;(setq buffer-file-truename + ;;(abbreviate-file-name (file-truename buffer-file-name))) + (after-find-file nil nil t t preserve-modes) + ;; Run after-revert-hook as it was before we reverted. + (setq-default revert-buffer-internal-hook global-hook) + (if local-hook-p + (progn + (make-local-variable 'revert-buffer-internal-hook) + (setq revert-buffer-internal-hook local-hook)) + (kill-local-variable 'revert-buffer-internal-hook)) + (run-hooks 'revert-buffer-internal-hook)) t))))) -;; #### something like `revert-buffer-compare-with-file' is a better name -;; #### why is the argument optional? -(defun revert-buffer-internal (&optional file-name) - "Read contents of FILE-NAME into a buffer, and compare to current buffer. -Return nil if identical, and the new buffer if different." - - (let* ((newbuf (get-buffer-create " *revert*")) - bmin bmax) - (save-excursion - (set-buffer newbuf) - (let (buffer-read-only - (buffer-undo-list t) - after-change-function - after-change-functions - before-change-function - before-change-functions) - (if revert-buffer-insert-file-contents-function - (funcall revert-buffer-insert-file-contents-function - file-name nil) - (if (not (file-exists-p file-name)) - (error "File %s no longer exists!" file-name)) - (widen) - (insert-file-contents file-name nil nil nil t) - (setq bmin (point-min) - bmax (point-max))))) - (if (not (and (eq bmin (point-min)) - (eq bmax (point-max)) - (eq (compare-buffer-substrings - newbuf bmin bmax (current-buffer) bmin bmax) 0))) - newbuf - (and (kill-buffer newbuf) nil)))) - (defun recover-file (file) "Visit file FILE, but get contents from its last auto-save file." ;; Actually putting the file name in the minibuffer should be used @@ -2844,7 +2742,7 @@ Return nil if identical, and the new buffer if different." 'recover-file)))) (if handler (funcall handler 'recover-file file) - (if (auto-save-file-name-p (file-name-nondirectory file)) + (if (auto-save-file-name-p file) (error "%s is an auto-save file" file)) (let ((file-name (let ((buffer-file-name file)) (make-auto-save-file-name)))) @@ -2853,17 +2751,11 @@ Return nil if identical, and the new buffer if different." (not (file-exists-p file-name))) (error "Auto-save file %s not current" file-name)) ((save-window-excursion - ;; XEmacs change: use insert-directory instead of - ;; calling ls directly. (with-output-to-temp-buffer "*Directory*" (buffer-disable-undo standard-output) - (save-excursion - (set-buffer "*Directory*") - (setq default-directory (file-name-directory file)) - (insert-directory file - (if (file-symlink-p file) "-lL" "-l")) - (setq default-directory (file-name-directory file-name)) - (insert-directory file-name "-l"))) + (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)) @@ -3029,9 +2921,72 @@ Also rename any existing auto save file, if it was made in this session." (recent-auto-save-p)) (rename-file osave buffer-auto-save-file-name t)))) -;; make-auto-save-file-name and auto-save-file-name-p are now only in -;; auto-save.el. - +;; see also ../packages/auto-save.el +(defun make-auto-save-file-name (&optional filename) + "Return file name to use for auto-saves of current buffer. +Does not consider `auto-save-visited-file-name' as that variable is checked +before calling this function. You can redefine this for customization. +See also `auto-save-file-name-p'." + (let ((fname (or filename buffer-file-name)) + name) + (setq name + (if fname + (concat (file-name-directory fname) + "#" + (file-name-nondirectory fname) + "#") + + ;; Deal with buffers that don't have any associated files. (Mail + ;; mode tends to create a good number of these.) + + (let ((buffer-name (buffer-name)) + (limit 0)) + ;; Use technique from Sebastian Kremer's auto-save + ;; package to turn slashes into \\!. This ensures that + ;; the auto-save buffer name is unique. + + ;; #### - yuck! yuck! yuck! move this functionality + ;; somewhere else and make the name translation customizable. + ;; Using "\!" as part of a filename on a UNIX filesystem is nearly + ;; IMPOSSIBLE to get past a shell parser. -stig + + (while (string-match "[/\\]" buffer-name limit) + (setq buffer-name + (concat (substring buffer-name 0 (match-beginning 0)) + (if (string= (substring buffer-name + (match-beginning 0) + (match-end 0)) + "/") + "\\!" + "\\\\") + (substring buffer-name (match-end 0)))) + (setq limit (1+ (match-end 0)))) + + ;; (expand-file-name (format "#%s#%s#" (buffer-name) (make-temp-name ""))) + + ;; jwz: putting the emacs PID in the auto-save file name + ;; is bad news, because that defeats auto-save-recovery of + ;; *mail* buffers -- the (sensible) code in sendmail.el + ;; calls (make-auto-save-file-name) to determine whether + ;; there is unsent, auto-saved mail to recover. If that + ;; mail came from a previous emacs process (far and away + ;; the most likely case) then this can never succeed as + ;; the pid differs. + + (expand-file-name (format "#%s#" buffer-name))) + )) + ;; don't try to write auto-save files in unwritable places. Unless + ;; there's already an autosave file here, put ours somewhere safe. --Stig + (if (or (file-writable-p name) + (file-exists-p name)) + name + (expand-file-name (concat "~/" (file-name-nondirectory name)))))) + +(defun auto-save-file-name-p (filename) + "Return non-nil if FILENAME can be yielded by `make-auto-save-file-name'. +FILENAME should lack slashes. +You can redefine this for customization." + (string-match "\\`#.*#\\'" filename)) (defun wildcard-to-regexp (wildcard) "Given a shell file name pattern WILDCARD, return an equivalent regexp. @@ -3175,9 +3130,6 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." (funcall handler 'insert-directory file switches wildcard full-directory-p) (cond - ;; [mswindows-insert-directory should be called - ;; nt-insert-directory - kkm]. not true any more according to - ;; my new naming scheme. --ben ((and (fboundp 'mswindows-insert-directory) (eq system-type 'windows-nt)) (mswindows-insert-directory file switches wildcard full-directory-p)) @@ -3189,19 +3141,19 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." (file-name-directory file) (file-name-directory (expand-file-name file)))) (pattern (file-name-nondirectory file)) - (start 0)) + (beg 0)) ;; Quote some characters that have special meanings in shells; ;; but don't quote the wildcards--we want them to be special. ;; We also currently don't quote the quoting characters ;; in case people want to use them explicitly to quote ;; wildcard characters. ;;#### Unix-specific - (while (string-match "[ \t\n;<>&|()#$]" pattern start) + (while (string-match "[ \t\n;<>&|()#$]" pattern beg) (setq pattern (concat (substring pattern 0 (match-beginning 0)) "\\" (substring pattern (match-beginning 0))) - start (1+ (match-end 0)))) + beg (1+ (match-end 0)))) (call-process shell-file-name nil t nil "-c" (concat "\\" ;; Disregard shell aliases! insert-directory-program diff --git a/lisp/finder-inf.el b/lisp/finder-inf.el new file mode 100644 index 0000000..6c5365a --- /dev/null +++ b/lisp/finder-inf.el @@ -0,0 +1,3677 @@ +;;; finder-inf.el --- keyword-to-package mapping +;; Keywords: help +;;; Commentary: +;; Don't edit this file. It's generated by finder.el + +;;; Code: + +(defconst finder-package-info '( + ("eos.el" + "Intereactively loads the XEmacs/SPARCworks interface" + (sparcworks eos era on sparcworks load) + "/home/martin/x/packages/lisp/Sun/") + ("sccs.el" + "easy-to-use SCCS control from within Emacs" + nil + "/home/martin/x/packages/lisp/Sun/") + ("sun-eos-browser.el" + "Implements the XEmacs/SPARCworks SourceBrowser interface" + (sparcworks eos era on sparcworks sbrowser source browser) + "/home/martin/x/packages/lisp/Sun/") + ("sun-eos-debugger-extra.el" + "Implements the XEmacs/SPARCworks Debugger interface" + (sparcworks eos era on sparcworks debugger dbx) + "/home/martin/x/packages/lisp/Sun/") + ("sun-eos-debugger.el" + "Implements the XEmacs/SPARCworks interface" + (sparcworks eos era on sparcworks debugger dbx) + "/home/martin/x/packages/lisp/Sun/") + ("sun-eos-editor.el" + "Implements the XEmacs/SPARCworks editor protocol" + (sparcworks eos era on sparcworks editor) + "/home/martin/x/packages/lisp/Sun/") + ("sun-eos-init.el" + "Initializes the XEmacs/SPARCworks interface" + (sparcworks eos era on sparcworks initialize) + "/home/martin/x/packages/lisp/Sun/") + ("sun-eos-load.el" + "Loads the XEmacs/SPARCworks interface code" + (sparcworks eos era on sparcworks debugger dbx) + "/home/martin/x/packages/lisp/Sun/") + ("sun-eos-menubar.el" + "Implements the XEmacs/SPARCworks menubar" + (sparcworks eos era on sparcworks menubar) + "/home/martin/x/packages/lisp/Sun/") + ("sun-eos-toolbar.el" + "Implements the EOS toolbar interface" + (sparcworks eos era on sparcworks toolbar) + "/home/martin/x/packages/lisp/Sun/") + ("sun-eos.el" + "Intereactively loads the XEmacs/SPARCworks interface" + (sparcworks eos era on sparcworks load) + "/home/martin/x/packages/lisp/Sun/") + ("sunpro-keys.el" + "SunPro-specific key bindings" + nil + "/home/martin/x/packages/lisp/Sun/") + ("sunpro-menubar.el" + "Initialize the SunPro menubar" + (sunpro menubar initialization) + "/home/martin/x/packages/lisp/Sun/") + ("sunpro-sparcworks.el" + "support SPARCworks manager ToolTalk messages" + (sparcworks tooltalk messages) + "/home/martin/x/packages/lisp/Sun/") + ("ada-mode.el" + "An Emacs major-mode for editing Ada source." + (languages oop ada) + "/home/martin/x/packages/lisp/ada/") + ("custom-load.el" + "automatically extracted custom dependencies" + nil + "/home/martin/x/packages/lisp/ada/") + ("atype.el" + "atype functions" + (atype) + "/home/martin/x/packages/lisp/apel/") + ("emu-20.el" + "emu API implementation for Emacs 20 and XEmacs/mule" + (emulation compatibility mule) + "/home/martin/x/packages/lisp/apel/") + ("emu-e19.el" + "emu module for Emacs 19 and XEmacs 19" + (emulation compatibility mule latin-1) + "/home/martin/x/packages/lisp/apel/") + ("emu-x20.el" + "emu API implementation for XEmacs with mule" + (emulation compatibility mule xemacs) + "/home/martin/x/packages/lisp/apel/") + ("emu-xemacs.el" + "emu API implementation for XEmacs" + (emulation compatibility xemacs) + "/home/martin/x/packages/lisp/apel/") + ("emu.el" + "Emulation module for each Emacs variants" + (emulation compatibility nemacs mule emacs/mule xemacs) + "/home/martin/x/packages/lisp/apel/") + ("file-detect.el" + "Path management or file detection utility" + (file detection install module) + "/home/martin/x/packages/lisp/apel/") + ("filename.el" + "file name filter" + (file name string) + "/home/martin/x/packages/lisp/apel/") + ("install.el" + "Emacs Lisp package install utility" + (install byte-compile directory detection) + "/home/martin/x/packages/lisp/apel/") + ("mule-caesar.el" + "ROT 13-47 Caesar rotation utility" + (rot 13-47 caesar mail news text/x-rot13-47) + "/home/martin/x/packages/lisp/apel/") + ("path-util.el" + "Emacs Lisp file detection utility" + (file detection install module) + "/home/martin/x/packages/lisp/apel/") + ("richtext.el" + "read and save files in text/richtext format" + (wp faces mime multimedia) + "/home/martin/x/packages/lisp/apel/") + ("std11-parse.el" + "STD 11 parser for GNU Emacs" + (mail news rfc 822 std 11) + "/home/martin/x/packages/lisp/apel/") + ("std11.el" + "STD 11 functions for GNU Emacs" + (mail news rfc 822 std 11) + "/home/martin/x/packages/lisp/apel/") + ("font-latex.el" + "LaTeX fontification for Font Lock mode." + (latex faces) + "/home/martin/x/packages/lisp/auctex/") + ("latex.el" + "Support for LaTeX documents." + (wp) + "/home/martin/x/packages/lisp/auctex/") + ("multi-prompt.el" + "completing read of multiple strings." + (extensions) + "/home/martin/x/packages/lisp/auctex/") + ("tex.el" + "Support for TeX documents." + (wp) + "/home/martin/x/packages/lisp/auctex/") + ("bbdb-print.el" + "for printing BBDB databases using TeX." + nil + "/home/martin/x/packages/lisp/bbdb/") + ("bbdb-reportmail.el" + "Hooks the Insidious Big Brother Database" + nil + "/home/martin/x/packages/lisp/bbdb/") + ("bbdb-snarf.el" + "convert free-form text to BBDB records" + nil + "/home/martin/x/packages/lisp/bbdb/") + ("bbdb-whois.el" + "Big Brother gets a little help from Big Brother" + nil + "/home/martin/x/packages/lisp/bbdb/") + ("c-comment-edit.el" + "edit C comments" + (languages) + "/home/martin/x/packages/lisp/c-support/") + ("c-comment.el" + "edit C comments" + (languages) + "/home/martin/x/packages/lisp/c-support/") + ("c-style.el" + "sets c-style control variables." + nil + "/home/martin/x/packages/lisp/c-support/") + ("cmacexp.el" + "expand C macros in a region" + (c) + "/home/martin/x/packages/lisp/c-support/") + ("ctypes.el" + "Enhanced Font lock support for custom defined types." + nil + "/home/martin/x/packages/lisp/c-support/") + ("hideif.el" + "hides selected code within ifdef." + (c outlines) + "/home/martin/x/packages/lisp/c-support/") + ("hideshow.el" + "minor mode cmds to selectively display blocks of code" + (c c++ lisp tools editing) + "/home/martin/x/packages/lisp/c-support/") + ("appt.el" + "appointment notification functions." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-china.el" + "calendar functions for the Chinese calendar." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-coptic.el" + "calendar functions for the Coptic/Ethiopic calendars." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-dst.el" + "calendar functions for daylight savings rules." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-french.el" + "calendar functions for the French Revolutionary calendar." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-hebrew.el" + "calendar functions for the Hebrew calendar." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-islam.el" + "calendar functions for the Islamic calendar." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-iso.el" + "calendar functions for the ISO calendar." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-julian.el" + "calendar functions for the Julian calendar." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-mayan.el" + "calendar functions for the Mayan calendars." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-move.el" + "calendar functions for movement in the calendar" + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-persia.el" + "calendar functions for the Persian calendar." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-tex.el" + "calendar functions for printing calendars with LaTeX." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-x.el" + "calendar windows in dedicated frames in x-windows" + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cal-xemacs.el" + "calendar functions for menu bar and popup menu support" + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("calendar.el" + "Calendar functions. -*-byte-compile-dynamic: t;-*-" + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("diary-lib.el" + "diary functions." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("holidays.el" + "holiday functions for the calendar package" + (holidays calendar) + "/home/martin/x/packages/lisp/calendar/") + ("lunar.el" + "calendar functions for phases of the moon." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("solar.el" + "calendar functions for solar events." + (calendar) + "/home/martin/x/packages/lisp/calendar/") + ("cc-align.el" + "custom indentation functions for CC Mode" + (c languages oop) + "/home/martin/x/packages/lisp/cc-mode/") + ("cc-cmds.el" + "user level commands for CC Mode " + (c languages oop) + "/home/martin/x/packages/lisp/cc-mode/") + ("cc-compat.el" + "cc-mode compatibility with c-mode.el confusion" + (c languages oop) + "/home/martin/x/packages/lisp/cc-mode/") + ("cc-defs.el" + "compile time definitions for CC Mode" + (c languages oop) + "/home/martin/x/packages/lisp/cc-mode/") + ("cc-engine.el" + "core syntax guessing engine for CC mode" + (c languages oop) + "/home/martin/x/packages/lisp/cc-mode/") + ("cc-langs.el" + "specific language support for CC Mode" + (c languages oop) + "/home/martin/x/packages/lisp/cc-mode/") + ("cc-menus.el" + "imenu support for CC Mode" + (c languages oop) + "/home/martin/x/packages/lisp/cc-mode/") + ("cc-mode.el" + "major mode for editing C, C++, Objective-C, and Java code" + (c languages oop) + "/home/martin/x/packages/lisp/cc-mode/") + ("cc-styles.el" + "support for styles in CC Mode" + (c languages oop) + "/home/martin/x/packages/lisp/cc-mode/") + ("cc-vars.el" + "user customization variables for CC Mode" + (c languages oop) + "/home/martin/x/packages/lisp/cc-mode/") + ("cookie1.el" + "retrieve random phrases from fortune cookie files" + (games) + "/home/martin/x/packages/lisp/cookie/") + ("spook.el" + "spook phrase utility for overloading the NSA line eater" + (games) + "/home/martin/x/packages/lisp/cookie/") + ("yow.el" + "quote random zippyisms" + (games) + "/home/martin/x/packages/lisp/cookie/") + ("crisp.el" + "CRiSP/Brief Emacs emulator" + (emulations brief crisp) + "/home/martin/x/packages/lisp/crisp/") + ("scroll-lock.el" + "scroll-locking minor mode" + (scroll crisp brief lock) + "/home/martin/x/packages/lisp/crisp/") + ("dbx.el" + "run dbx under Emacs" + (c unix tools debugging) + "/home/martin/x/packages/lisp/debug/") + ("gdb-highlight.el" + "make gdb buffers be mouse-sensitive." + (extensions c unix tools debugging) + "/home/martin/x/packages/lisp/debug/") + ("gdb.el" + "run gdb under Emacs" + (c unix tools debugging) + "/home/martin/x/packages/lisp/debug/") + ("gdbsrc.el" + "Source-based (as opposed to comint-based) debugger" + (c unix tools debugging) + "/home/martin/x/packages/lisp/debug/") + ("gud.el" + "Grand Unified Debugger mode for gdb, sdb, dbx, or xdb" + (c unix tools debugging) + "/home/martin/x/packages/lisp/debug/") + ("history.el" + "Generic history stuff" + nil + "/home/martin/x/packages/lisp/debug/") + ("advise-eval-region.el" + "Wrap advice around eval-region" + (extensions lisp) + "/home/martin/x/packages/lisp/edebug/") + ("cust-print.el" + "handles print-level and print-circle." + (extensions) + "/home/martin/x/packages/lisp/edebug/") + ("edebug-cl-read.el" + "Edebug reader macros for use with cl-read." + (lisp tools maint) + "/home/martin/x/packages/lisp/edebug/") + ("edebug.el" + "a source-level debugger for Emacs Lisp" + (lisp tools maint) + "/home/martin/x/packages/lisp/edebug/") + ("eval-reg.el" + "Redefine eval-region, and subrs that use it, in Lisp" + (lisp) + "/home/martin/x/packages/lisp/edebug/") + ("ediff-diff.el" + "diff-related utilities" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff-help.el" + "Code related to the contents of Ediff help buffers" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff-hook.el" + "setup for Ediff's menus and autoloads" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff-init.el" + "Macros, variables, and defsubsts used by Ediff" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff-merg.el" + "merging utilities" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff-mult.el" + "support for multi-file/multi-buffer processing in Ediff" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff-ptch.el" + "Ediff's patch support" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff-tbar.el" + "A toolbar for Ediff control buffer" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff-util.el" + "the core commands and utilities of ediff" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff-vers.el" + "version control interface to Ediff" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff-wind.el" + "window manipulation utilities" + nil + "/home/martin/x/packages/lisp/ediff/") + ("ediff.el" + "a comprehensive visual interface to diff & patch" + (comparing merging patching version control.) + "/home/martin/x/packages/lisp/ediff/") + ("abbrevlist.el" + "list one abbrev table alphabetically ordered." + (abbrev) + "/home/martin/x/packages/lisp/edit-utils/") + ("after-save-commands.el" + "Run a shell command after saving a file" + (processes unix) + "/home/martin/x/packages/lisp/edit-utils/") + ("array.el" + "array editing commands for XEmacs" + (extensions) + "/home/martin/x/packages/lisp/edit-utils/") + ("atomic-extents.el" + "treat regions of text as a single object" + (extensions) + "/home/martin/x/packages/lisp/edit-utils/") + ("avoid.el" + "make mouse pointer stay out of the way of editing" + (mouse) + "/home/martin/x/packages/lisp/edit-utils/") + ("backup-dir.el" + "allow backup files to live in some other directory(s)." + (backup file) + "/home/martin/x/packages/lisp/edit-utils/") + ("big-menubar.el" + "an alternate menubar" + (mouse menubar) + "/home/martin/x/packages/lisp/edit-utils/") + ("blink-cursor.el" + "Blink the cursor on or off" + (display) + "/home/martin/x/packages/lisp/edit-utils/") + ("blink-paren.el" + "blink the matching paren, just like Zmacs" + (faces) + "/home/martin/x/packages/lisp/edit-utils/") + ("bookmark.el" + "set bookmarks, maybe annotate them, jump to them later." + (bookmarks placeholders annotations) + "/home/martin/x/packages/lisp/edit-utils/") + ("compare-w.el" + "compare text between windows for Emacs." + nil + "/home/martin/x/packages/lisp/edit-utils/") + ("completion.el" + "dynamic word-completion code" + (abbrev) + "/home/martin/x/packages/lisp/edit-utils/") + ("dabbrev.el" + "dynamic abbreviation package" + (abbrev expand completion) + "/home/martin/x/packages/lisp/edit-utils/") + ("desktop.el" + "save partial status of Emacs when killed" + (customization) + "/home/martin/x/packages/lisp/edit-utils/") + ("detached-minibuf.el" + "Support a detached minibuffer for XEmacs." + (extensions) + "/home/martin/x/packages/lisp/edit-utils/") + ("edit-faces.el" + "interactive face editing mode" + (faces) + "/home/martin/x/packages/lisp/edit-utils/") + ("edit-toolbar.el" + "Interactive toolbar editing mode for XEmacs" + (tools) + "/home/martin/x/packages/lisp/edit-utils/") + ("fast-lock.el" + "Automagic text properties caching for fast Font Lock mode." + (faces files) + "/home/martin/x/packages/lisp/edit-utils/") + ("file-part.el" + "treat a section of a buffer as a separate file" + (extensions tools) + "/home/martin/x/packages/lisp/edit-utils/") + ("floating-toolbar.el" + "popup toolbar support for XEmacs." + (lisp) + "/home/martin/x/packages/lisp/edit-utils/") + ("flow-ctrl.el" + "help for lusers on cu(1) or ttys with wired-in ^S/^Q flow control" + (hardware) + "/home/martin/x/packages/lisp/edit-utils/") + ("foldout.el" + "Folding extensions for outline-mode and outline-minor-mode." + (folding outline) + "/home/martin/x/packages/lisp/edit-utils/") + ("func-menu.el" + "Jump to a function within a buffer." + (tools c lisp) + "/home/martin/x/packages/lisp/edit-utils/") + ("hippie-exp.el" + "expand text trying various ways to find its expansion." + (abbrev) + "/home/martin/x/packages/lisp/edit-utils/") + ("id-select.el" + "Select larger and larger syntax-driven regions in a buffer" + (matching mouse) + "/home/martin/x/packages/lisp/edit-utils/") + ("info-look.el" + "major-mode-sensitive Info index lookup facility." + (help languages) + "/home/martin/x/packages/lisp/edit-utils/") + ("iswitchb.el" + "switch between buffers using substrings" + (extensions) + "/home/martin/x/packages/lisp/edit-utils/") + ("lazy-lock.el" + "Lazy demand-driven fontification for fast Font Lock mode." + (faces files) + "/home/martin/x/packages/lisp/edit-utils/") + ("lazy-shot.el" + "Lazy font locking for XEmacs" + (languages faces) + "/home/martin/x/packages/lisp/edit-utils/") + ("lispm-fonts.el" + "quick hack to parse LISPM-style font-shift codes" + (faces) + "/home/martin/x/packages/lisp/edit-utils/") + ("live-icon.el" + "make frame icons represent the current frame contents" + nil + "/home/martin/x/packages/lisp/edit-utils/") + ("makesum.el" + "generate key binding summary for Emacs" + (help) + "/home/martin/x/packages/lisp/edit-utils/") + ("man.el" + "browse UNIX manual pages" + (help) + "/home/martin/x/packages/lisp/edit-utils/") + ("mic-paren.el" + "highlight matching parenthesises." + (languages faces) + "/home/martin/x/packages/lisp/edit-utils/") + ("outl-mouse.el" + "outline mode mouse commands for Emacs" + (outlines mouse) + "/home/martin/x/packages/lisp/edit-utils/") + ("page-ext.el" + "extended page handling commands" + nil + "/home/martin/x/packages/lisp/edit-utils/") + ("paren.el" + "highlight (un)matching parens and whole expressions" + (languages faces) + "/home/martin/x/packages/lisp/edit-utils/") + ("permanent-buffers.el" + "Permanent buffers management package." + (extensions) + "/home/martin/x/packages/lisp/edit-utils/") + ("popper.el" + "shrink-wrapped temporary windows for Emacs" + (temporary window popup window) + "/home/martin/x/packages/lisp/edit-utils/") + ("recent-files.el" + "Maintain menu of recently opened files." + (menu file) + "/home/martin/x/packages/lisp/edit-utils/") + ("redo.el" + "Redo/undo system for XEmacs" + (lisp extensions) + "/home/martin/x/packages/lisp/edit-utils/") + ("resume.el" + "process command line args from within a suspended Emacs job" + (processes) + "/home/martin/x/packages/lisp/edit-utils/") + ("rsz-minibuf.el" + "dynamically resize minibuffer to display entire contents" + (minibuffer window frames display) + "/home/martin/x/packages/lisp/edit-utils/") + ("savehist.el" + "Save minibuffer history" + (minibuffer) + "/home/martin/x/packages/lisp/edit-utils/") + ("saveplace.el" + "automatically save place in files." + (bookmarks placeholders) + "/home/martin/x/packages/lisp/edit-utils/") + ("tempo.el" + "Flexible template insertion" + (extensions languages tools) + "/home/martin/x/packages/lisp/edit-utils/") + ("toolbar-utils.el" + "Toolbar utility functions for XEmacs" + (extensions) + "/home/martin/x/packages/lisp/edit-utils/") + ("uniquify.el" + "unique buffer names dependent on file name" + nil + "/home/martin/x/packages/lisp/edit-utils/") + ("where-was-i-db.el" + "Keep persistent state in visited files." + (tools data wp) + "/home/martin/x/packages/lisp/edit-utils/") + ("edt-lk201.el" + "Enhanced EDT Keypad Mode Emulation for LK-201 Keyboards" + (emulations) + "/home/martin/x/packages/lisp/edt/") + ("edt-mapper.el" + "Create an EDT LK-201 Map File for X-Windows Emacs" + (emulations) + "/home/martin/x/packages/lisp/edt/") + ("edt-pc.el" + "Enhanced EDT Keypad Mode Emulation for PC 101 Keyboards" + (emulations) + "/home/martin/x/packages/lisp/edt/") + ("edt-vt100.el" + "Enhanced EDT Keypad Mode Emulation for VT Series Terminals" + (emulations) + "/home/martin/x/packages/lisp/edt/") + ("edt.el" + "Enhanced EDT Keypad Mode Emulation for GNU Emacs 19" + (emulations) + "/home/martin/x/packages/lisp/edt/") + ("dll-debug.el" + "A slow implementation of dll for debugging." + (extensions lisp) + "/home/martin/x/packages/lisp/elib/") + ("emerge.el" + "merge diffs under Emacs control" + (unix tools) + "/home/martin/x/packages/lisp/emerge/") + ("term.el" + "general command interpreter in a window stuff" + nil + "/home/martin/x/packages/lisp/eterm/") + ("tshell.el" + "specialized term.el for running the shell." + (processes) + "/home/martin/x/packages/lisp/eterm/") + ("eudc-bbdb.el" + "Emacs Unified Directory Client - BBDB Backend" + (help) + "/home/martin/x/packages/lisp/eudc/") + ("eudc-custom-vars.el" + "Emacs Unified Directory Client" + (help) + "/home/martin/x/packages/lisp/eudc/") + ("eudc-ldap.el" + "Emacs Unified Directory Client - LDAP Backend" + (help) + "/home/martin/x/packages/lisp/eudc/") + ("eudc-ph.el" + "Emacs Unified Directory Client - CCSO PH/QI Backend" + (help) + "/home/martin/x/packages/lisp/eudc/") + ("eudc.el" + "Emacs Unified Directory Client" + (help) + "/home/martin/x/packages/lisp/eudc/") + ("footnote-cyrillic.el" + "Cyrillic lettering for footnote mode" + (mule news mail) + "/home/martin/x/packages/lisp/footnote/") + ("footnote-greek.el" + "Greek lettering for footnote mode" + (mule news mail) + "/home/martin/x/packages/lisp/footnote/") + ("footnote-han.el" + "Han Japanese footnote support" + (mail news mule) + "/home/martin/x/packages/lisp/footnote/") + ("footnote-hebrew.el" + "Hebrew lettering for footnote mode" + (mule news mail) + "/home/martin/x/packages/lisp/footnote/") + ("footnote-kana.el" + "more Japanese footnote support" + (mail news mule) + "/home/martin/x/packages/lisp/footnote/") + ("footnote.el" + "Footnote support for message mode" + (mail news) + "/home/martin/x/packages/lisp/footnote/") + ("forms-d2.el" + "demo forms-mode" + nil + "/home/martin/x/packages/lisp/forms/") + ("forms-pass.el" + "passwd file demo for forms-mode" + nil + "/home/martin/x/packages/lisp/forms/") + ("forms.el" + "Forms mode: edit a file as a form to fill in" + (extensions) + "/home/martin/x/packages/lisp/forms/") + ("frame-icon.el" + "set up mode-specific icons for each frame under XEmacs" + (frames lisp extensions) + "/home/martin/x/packages/lisp/frame-icon/") + ("overlay.el" + "overlay support." + (internal) + "/home/martin/x/packages/lisp/fsf-compat/") + ("thingatpt.el" + "Get the `thing' at point" + (extensions matching mouse) + "/home/martin/x/packages/lisp/fsf-compat/") + ("timer.el" + "run a function with args at some time in future." + nil + "/home/martin/x/packages/lisp/fsf-compat/") + ("x-popup-menu.el" + "Mimic x-popup-menu in FSF Emacs" + (frames) + "/home/martin/x/packages/lisp/fsf-compat/") + ("gamegrid.el" + "Library for implementing grid-based games on Emacs." + (games) + "/home/martin/x/packages/lisp/games/") + ("snake.el" + "Implementation of Snake for Emacs." + (games) + "/home/martin/x/packages/lisp/games/") + ("sokoban.el" + "Implementation of Sokoban for Emacs." + (games) + "/home/martin/x/packages/lisp/games/") + ("tetris.el" + "Implementation of Tetris for Emacs." + (games) + "/home/martin/x/packages/lisp/games/") + ("dgnushack.el" + "a hack to set the load path for byte-compiling" + (news path) + "/home/martin/x/packages/lisp/gnus/") + ("earcon.el" + "Sound effects for messages" + nil + "/home/martin/x/packages/lisp/gnus/") + ("gnus-agent.el" + "unplugged support for Gnus" + nil + "/home/martin/x/packages/lisp/gnus/") + ("gnus-art.el" + "article mode commands for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-async.el" + "asynchronous support for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-audio.el" + "Sound effects for Gnus" + nil + "/home/martin/x/packages/lisp/gnus/") + ("gnus-bcklg.el" + "backlog functions for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-cache.el" + "cache interface for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-cite.el" + "parse citations in articles for Gnus" + nil + "/home/martin/x/packages/lisp/gnus/") + ("gnus-cus.el" + "customization commands for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-demon.el" + "daemonic Gnus behaviour" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-draft.el" + "draft message support for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-dup.el" + "suppression of duplicate articles in Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-eform.el" + "a mode for editing forms for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-ems.el" + "functions for making Gnus work under different Emacsen" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-gl.el" + "an interface to GroupLens for Gnus" + (news score) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-group.el" + "group mode commands for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-int.el" + "backend interface functions for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-kill.el" + "kill commands for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-load.el" + "automatically extracted custom dependencies" + nil + "/home/martin/x/packages/lisp/gnus/") + ("gnus-logic.el" + "advanced scoring code for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-mh.el" + "mh-e interface for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-move.el" + "commands for moving Gnus from one server to another" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-msg.el" + "mail and post interface for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-nocem.el" + "NoCeM pseudo-cancellation treatment" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-picon.el" + "displaying pretty icons in Gnus" + (news xpm annotation glyph faces) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-range.el" + "range and sequence functions for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-salt.el" + "alternate summary mode interfaces for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-score.el" + "scoring code for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-setup.el" + "Initialization & Setup for Gnus 5" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-soup.el" + "SOUP packet writing support for Gnus" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-spec.el" + "format spec functions for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-srvr.el" + "virtual server support for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-start.el" + "startup functions for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-sum.el" + "summary mode commands for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-topic.el" + "a folding minor mode for Gnus group buffers" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-undo.el" + "minor mode for undoing in Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-util.el" + "utility functions for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-uu.el" + "extract (uu)encoded files in Gnus" + nil + "/home/martin/x/packages/lisp/gnus/") + ("gnus-vm.el" + "vm interface for Gnus" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-win.el" + "window configuration functions for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus-xmas.el" + "Gnus functions for XEmacs" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("gnus.el" + "a newsreader for GNU Emacs" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("mailheader.el" + "Mail header parsing, merging, formatting" + (tools mail news) + "/home/martin/x/packages/lisp/gnus/") + ("md5.el" + "MD5 Message Digest Algorithm" + nil + "/home/martin/x/packages/lisp/gnus/") + ("message.el" + "composing mail and news messages" + (mail news) + "/home/martin/x/packages/lisp/gnus/") + ("messagexmas.el" + "XEmacs extensions to message" + (mail news) + "/home/martin/x/packages/lisp/gnus/") + ("messcompat.el" + "making message mode compatible with mail mode" + (mail news) + "/home/martin/x/packages/lisp/gnus/") + ("nnagent.el" + "offline backend for Gnus" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("nnbabyl.el" + "rmail mbox access for Gnus" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("nndb.el" + "nndb access for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nndir.el" + "single directory newsgroup access for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nndoc.el" + "single file access for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nndraft.el" + "draft article access for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nneething.el" + "arbitrary file access for Gnus" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("nnfolder.el" + "mail folder access for Gnus" + (mail) + "/home/martin/x/packages/lisp/gnus/") + ("nngateway.el" + "posting news via mail gateways" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("nnheader.el" + "header access macros for Gnus and its backends" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nnheaderxm.el" + "making Gnus backends work under XEmacs" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nnkiboze.el" + "select virtual news access for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nnlistserv.el" + "retrieving articles via web mailing list archives" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("nnmail.el" + "mail support functions for the Gnus mail backends" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("nnmbox.el" + "mail mbox access for Gnus" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("nnmh.el" + "mhspool access for Gnus" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("nnml.el" + "mail spool access for Gnus" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("nnoo.el" + "OO Gnus Backends" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nnsoup.el" + "SOUP access for Gnus" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("nnspool.el" + "spool access for GNU Emacs" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nntp.el" + "nntp access for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nnvirtual.el" + "virtual newsgroups access for Gnus" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("nnweb.el" + "retrieving articles via web search engines" + (news) + "/home/martin/x/packages/lisp/gnus/") + ("parse-time.el" + "Parsing time strings" + (util) + "/home/martin/x/packages/lisp/gnus/") + ("pop3.el" + "Post Office Protocol (RFC 1460) interface" + (mail pop3) + "/home/martin/x/packages/lisp/gnus/") + ("score-mode.el" + "mode for editing Gnus score files" + (news mail) + "/home/martin/x/packages/lisp/gnus/") + ("smiley.el" + "displaying smiley faces" + (fun) + "/home/martin/x/packages/lisp/gnus/") + ("hm--html-menu.el" + "A menu for the hm--html-mode." + nil + "/home/martin/x/packages/lisp/hm--html-menus/") + ("hm--html-mode.el" + "Major mode for editing HTML documents for the WWW" + (hypermedia languages help docs wp) + "/home/martin/x/packages/lisp/hm--html-menus/") + ("html-view.el" + "routines for communicating with a NCSA Mosaic process" + (comm unix wp help) + "/home/martin/x/packages/lisp/hm--html-menus/") + ("internal-drag-and-drop.el" + "Internal drag and drop interface" + (mouse) + "/home/martin/x/packages/lisp/hm--html-menus/") + ("tmpl-minor-mode.el" + "Template Minor Mode" + (data tools) + "/home/martin/x/packages/lisp/hm--html-menus/") + ("igrep.el" + "An improved interface to `grep` and `find`." + nil + "/home/martin/x/packages/lisp/igrep/") + ("jde-db.el" + "Debugger mode for jdb." + (java tools) + "/home/martin/x/packages/lisp/jde/") + ("jde-gen.el" + "Integrated Development Environment for Java." + (java tools) + "/home/martin/x/packages/lisp/jde/") + ("jde-make.el" + "Integrated Development Environment for Java." + (java tools) + "/home/martin/x/packages/lisp/jde/") + ("jde-run.el" + "runs the Java app in the current buffer." + (tools processes) + "/home/martin/x/packages/lisp/jde/") + ("jde.el" + "Integrated Development Environment for Java." + (java tools) + "/home/martin/x/packages/lisp/jde/") + ("browse-url.el" + "ask a WWW browser to load a URL" + (hypertext) + "/home/martin/x/packages/lisp/mail-lib/") + ("highlight-headers.el" + "highlighting message headers." + (mail news) + "/home/martin/x/packages/lisp/mail-lib/") + ("mail-abbrevs.el" + "Abbrev-expansion of mail aliases." + nil + "/home/martin/x/packages/lisp/mail-lib/") + ("mail-extr.el" + "extract full name and address from RFC 822 mail header." + (mail) + "/home/martin/x/packages/lisp/mail-lib/") + ("mail-utils.el" + "utility functions used both by rmail and rnews" + (mail news) + "/home/martin/x/packages/lisp/mail-lib/") + ("reporter.el" + "customizable bug reporting of lisp programs" + (maint mail tools) + "/home/martin/x/packages/lisp/mail-lib/") + ("rfc822.el" + "hairy rfc822 parser for mail and news and suchlike" + (mail) + "/home/martin/x/packages/lisp/mail-lib/") + ("rmail-mini.el" + "minimal core of \"RMAIL\" mail reader for Emacs." + (mail) + "/home/martin/x/packages/lisp/mail-lib/") + ("rmailout.el" + "\"RMAIL\" mail reader for Emacs: output message to a file." + (mail) + "/home/martin/x/packages/lisp/mail-lib/") + ("sendmail.el" + "mail sending commands for Emacs." + (mail) + "/home/martin/x/packages/lisp/mail-lib/") + ("mc-remail.el" + "Remailer support for Mailcrypt" + nil + "/home/martin/x/packages/lisp/mailcrypt/") + ("mew-attach.el" + "attachments for Mew Draft mode" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-bq.el" + "Base64 and Quoted-Printable encoding for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-cache.el" + "Cache management for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-complete.el" + "Completion magic for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-decode.el" + "MIME syntax decoder for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-demo.el" + "Startup demo for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-draft.el" + "Draft mode for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-encode.el" + "MIME syntax encoder for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-env.el" + "Environment setup for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-ext.el" + "Message/External-Body support for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-fib.el" + "Filling blanks for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-func.el" + "Basic functions for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-header.el" + "Mail header stuff for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-highlight.el" + "Highlight for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-lang-jp.el" + "Japanese specific stuff for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-mark.el" + "Marking for Mew Summary and Virtual mode" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-message.el" + "Message mode for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-mime.el" + "MIME launcher for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-minibuf.el" + "Minibuffer input methods for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-mule0.el" + "Environment of non-Mule for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-mule2.el" + "Environment of Mule version 2 for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-mule3.el" + "Environment of Mule version 3 for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-pgp.el" + "PGP/MIME for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-pick.el" + "Picking up messages for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-refile.el" + "Refile for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-scan.el" + "Scanning messages for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-sort.el" + "Sorting messages for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-summary.el" + "Summary mode for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-syntax.el" + "Internal syntax for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-temacs.el" + "Environment of Text Emacs for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-unix.el" + "MIME content type for UNIX" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-vars.el" + "Variables and Constants for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-virtual.el" + "Virtual mode for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-win32.el" + "Settings for Mew on Win32" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew-xemacs.el" + "Environment of XEmacs for Mew" + nil + "/home/martin/x/packages/lisp/mew/") + ("mew.el" + "Messaging in the Emacs World" + nil + "/home/martin/x/packages/lisp/mew/") + ("mh-comp.el" + "mh-e functions for composing messages" + nil + "/home/martin/x/packages/lisp/mh-e/") + ("mh-e.el" + "GNU Emacs interface to the MH mail system" + (mail) + "/home/martin/x/packages/lisp/mh-e/") + ("mh-funcs.el" + "mh-e functions not everyone will use right away" + nil + "/home/martin/x/packages/lisp/mh-e/") + ("mh-mime.el" + "mh-e support for composing MIME messages" + nil + "/home/martin/x/packages/lisp/mh-e/") + ("mh-pick.el" + "make a search pattern and search for a message in mh-e" + nil + "/home/martin/x/packages/lisp/mh-e/") + ("mh-seq.el" + "mh-e sequences support" + nil + "/home/martin/x/packages/lisp/mh-e/") + ("mh-utils.el" + "mh-e code needed for both sending and reading" + nil + "/home/martin/x/packages/lisp/mh-e/") + ("xmine.el" + "Mine game for XEmacs" + (games) + "/home/martin/x/packages/lisp/mine/") + ("NeXTify.el" + "Character insertion variation" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("advocacy.el" + "blatant XEmacs self promotion" + nil + "/home/martin/x/packages/lisp/misc-games/") + ("blackbox.el" + "blackbox game in Emacs Lisp" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("conx.el" + "Yet another dissociater" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("decipher.el" + "Cryptanalyze monoalphabetic substitution ciphers" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("dissociate.el" + "scramble text amusingly for Emacs." + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("doctor.el" + "psychological help for frustrated users." + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("dunnet.el" + "Text adventure for Emacs" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("flame.el" + "Automated insults" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("gomoku.el" + "Gomoku game between you and Emacs" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("hanoi.el" + "towers of hanoi in GNUmacs" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("life.el" + "John Horton Conway's `Life' game for GNU Emacs" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("morse.el" + "Convert text to morse code and back." + nil + "/home/martin/x/packages/lisp/misc-games/") + ("mpuz.el" + "multiplication puzzle for XEmacs" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("rot13.el" + "display a buffer in rot13." + nil + "/home/martin/x/packages/lisp/misc-games/") + ("studly.el" + "StudlyCaps (tm)(r)(c)(xxx)" + (games) + "/home/martin/x/packages/lisp/misc-games/") + ("emacsbug.el" + "command to report Emacs bugs to appropriate mailing list." + (maint mail) + "/home/martin/x/packages/lisp/net-utils/") + ("feedmail.el" + "assist other email packages to massage outgoing messages " + (email queue mail sendmail message spray smtp draft) + "/home/martin/x/packages/lisp/net-utils/") + ("metamail.el" + "Metamail interface for GNU Emacs" + (mail news mime multimedia) + "/home/martin/x/packages/lisp/net-utils/") + ("net-utils.el" + "Network functions" + nil + "/home/martin/x/packages/lisp/net-utils/") + ("rcompile.el" + "run a compilation on a remote machine" + (tools processes) + "/home/martin/x/packages/lisp/net-utils/") + ("shadowfile.el" + "automatic file copying for Emacs 19" + (comm) + "/home/martin/x/packages/lisp/net-utils/") + ("webjump.el" + "programmable Web hotlist" + (comm www) + "/home/martin/x/packages/lisp/net-utils/") + ("webster-www.el" + "Look up a word in WWW Merriam-Webster dictionaries" + (comm hypermedia) + "/home/martin/x/packages/lisp/net-utils/") + ("arc-mode.el" + "simple editing of archives" + (data unix) + "/home/martin/x/packages/lisp/os-utils/") + ("background.el" + "fun with background jobs" + (processes) + "/home/martin/x/packages/lisp/os-utils/") + ("crypt.el" + "code for handling all sorts of compressed and encrypted files" + (extensions) + "/home/martin/x/packages/lisp/os-utils/") + ("ftelnet.el" + "remote login interface" + (unix comm) + "/home/martin/x/packages/lisp/os-utils/") + ("inf-lisp.el" + "an inferior-lisp mode" + (processes lisp) + "/home/martin/x/packages/lisp/os-utils/") + ("jka-compr.el" + "reading/writing/loading compressed files" + (data) + "/home/martin/x/packages/lisp/os-utils/") + ("kermit.el" + "additions to shell mode for use with kermit, etc." + (comm) + "/home/martin/x/packages/lisp/os-utils/") + ("ledit.el" + "Emacs side of ledit interface" + nil + "/home/martin/x/packages/lisp/os-utils/") + ("lpr.el" + "print Emacs buffer on line printer." + (unix) + "/home/martin/x/packages/lisp/os-utils/") + ("mchat.el" + "Multicast Chatting package for XEmacs." + (comm processes) + "/home/martin/x/packages/lisp/os-utils/") + ("ps-print.el" + "Jim's Pretty-Good PostScript Generator for Emacs 19." + (print postscript) + "/home/martin/x/packages/lisp/os-utils/") + ("rlogin.el" + "remote login interface" + (unix comm) + "/home/martin/x/packages/lisp/os-utils/") + ("spell.el" + "spelling correction interface for Emacs." + (wp unix) + "/home/martin/x/packages/lisp/os-utils/") + ("ssh.el" + "remote login interface" + (unix comm) + "/home/martin/x/packages/lisp/os-utils/") + ("tar-mode.el" + "simple editing of tar files from GNU emacs" + (unix) + "/home/martin/x/packages/lisp/os-utils/") + ("telnet.el" + "run a telnet session from within an Emacs buffer" + (comm unix) + "/home/martin/x/packages/lisp/os-utils/") + ("terminal.el" + "terminal emulator for GNU Emacs." + (comm terminals) + "/home/martin/x/packages/lisp/os-utils/") + ("uncompress.el" + "auto-decompression hook for visiting .Z files" + (unix extensions) + "/home/martin/x/packages/lisp/os-utils/") + ("delbs.el" + "a small lisp package to allow you to swap around DEL/BS keys" + (lisp terminals) + "/home/martin/x/packages/lisp/pc/") + ("fusion.el" + "CodeWright Fusion-style motion and text selection" + (keyboard selection region) + "/home/martin/x/packages/lisp/pc/") + ("pc-select.el" + "PC shift selection minor mode for XEmacs" + (hardware mouse) + "/home/martin/x/packages/lisp/pc/") + ("pending-del.el" + "Making insertions replace any selected text." + nil + "/home/martin/x/packages/lisp/pc/") + ("s-region.el" + "set region using shift key." + (terminals) + "/home/martin/x/packages/lisp/pc/") + ("dired-cvs.el" + "Extensions to dired." + nil + "/home/martin/x/packages/lisp/pcl-cvs/") + ("generic-sc.el" + "generic interface to source control systems" + (tools unix) + "/home/martin/x/packages/lisp/pcl-cvs/") + ("pcl-cvs.el" + "A Front-end to CVS. Release R-2_0-Beta_2." + (cvs version control release management) + "/home/martin/x/packages/lisp/pcl-cvs/") + ("ph.el" + "Client for the CCSO directory system (aka PH/QI)" + (help) + "/home/martin/x/packages/lisp/ph/") + ("asm-mode.el" + "mode for editing assembler code" + (tools languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("autoconf-mode.el" + "autoconf code editing commands for Emacs" + (languages faces m4 configure) + "/home/martin/x/packages/lisp/prog-modes/") + ("awk-mode.el" + "AWK code editing commands for Emacs" + (unix languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("cl-indent.el" + "enhanced lisp-indent mode" + (lisp tools) + "/home/martin/x/packages/lisp/prog-modes/") + ("cperl-mode.el" + "Perl code editing commands for XEmacs" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("cvs.el" + "Light cvs support for emacs (ediff + msb + dired + mode line)" + (cvs ediff mode-line) + "/home/martin/x/packages/lisp/prog-modes/") + ("f90.el" + "Fortran-90 mode (free format)" + (fortran f90 languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("fortran-misc.el" + "Routines than can be used with fortran mode." + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("fortran.el" + "Fortran mode for GNU Emacs" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("icon.el" + "mode for editing Icon code" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("ksh-mode.el" + "sh (ksh, bash) script editing mode for GNU Emacs." + (shell korn bourne sh ksh bash) + "/home/martin/x/packages/lisp/prog-modes/") + ("m4-mode.el" + "m4 code editing commands for Emacs" + (languages faces) + "/home/martin/x/packages/lisp/prog-modes/") + ("make-mode.el" + "makefile editing commands for Emacs" + (unix tools) + "/home/martin/x/packages/lisp/prog-modes/") + ("modula2.el" + "Modula-2 editing support package" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("pascal.el" + "major mode for editing pascal source in Emacs" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("perl-mode.el" + "Perl code editing commands for GNU Emacs" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("postscript.el" + "major mode for editing PostScript programs" + (langauges) + "/home/martin/x/packages/lisp/prog-modes/") + ("prolog.el" + "major mode for editing and running Prolog under Emacs" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("python-mode.el" + "Major mode for editing Python programs" + (python languages oop) + "/home/martin/x/packages/lisp/prog-modes/") + ("rexx-mode.el" + "major mode for editing REXX program files" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("simula.el" + "SIMULA 87 code editing commands for Emacs" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("sql.el" + "specialized comint.el for SQL interpreters" + (processes sql) + "/home/martin/x/packages/lisp/prog-modes/") + ("tcl.el" + "Tcl code editing commands for Emacs" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("teco.el" + "Teco interpreter for Gnu Emacs, version 1." + (emulators) + "/home/martin/x/packages/lisp/prog-modes/") + ("verilog-mode.el" + "major mode for editing verilog source in Emacs" + (languages) + "/home/martin/x/packages/lisp/prog-modes/") + ("vrml-mode.el" + "major mode for editing VRML (.wrl) files" + (languages vrml modes) + "/home/martin/x/packages/lisp/prog-modes/") + ("iso-sgml.el" + "display SGML entity references as ISO 8859-1 characters" + (sgml html iso latin i18n) + "/home/martin/x/packages/lisp/psgml/") + ("psgml-api.el" + "Extra API functions for PSGML" + nil + "/home/martin/x/packages/lisp/psgml/") + ("psgml-dtd.el" + "DTD parser for SGML-editing mode with parsing support" + nil + "/home/martin/x/packages/lisp/psgml/") + ("psgml-edit.el" + "Editing commands for SGML-mode with parsing support" + nil + "/home/martin/x/packages/lisp/psgml/") + ("psgml-fs.el" + "Format a SGML-file according to a style file" + nil + "/home/martin/x/packages/lisp/psgml/") + ("psgml-html.el" + "HTML mode in conjunction with PSGML" + nil + "/home/martin/x/packages/lisp/psgml/") + ("psgml-other.el" + "Part of SGML-editing mode with parsing support" + nil + "/home/martin/x/packages/lisp/psgml/") + ("psgml-parse.el" + "Parser for SGML-editing mode with parsing support" + nil + "/home/martin/x/packages/lisp/psgml/") + ("psgml-xemacs.el" + "Part of SGML-editing mode with parsing support" + nil + "/home/martin/x/packages/lisp/psgml/") + ("psgml.el" + "SGML-editing mode with parsing support" + (languages) + "/home/martin/x/packages/lisp/psgml/") + ("reftex.el" + "Minor mode for doing \\label, \\ref and \\cite in LaTeX" + (tex) + "/home/martin/x/packages/lisp/reftex/") + ("rmail-kill.el" + "Mail filtering for rmail" + (mail) + "/home/martin/x/packages/lisp/rmail/") + ("rmail-xemacs.el" + "Mouse and font support for RMAIL running on XEmacs" + (mail) + "/home/martin/x/packages/lisp/rmail/") + ("rmail.el" + "main code of \"RMAIL\" mail reader for Emacs." + (mail) + "/home/martin/x/packages/lisp/rmail/") + ("rmailedit.el" + "\"RMAIL edit mode\" Edit the current message." + (mail) + "/home/martin/x/packages/lisp/rmail/") + ("rmailkwd.el" + "part of the \"RMAIL\" mail reader for Emacs." + (mail) + "/home/martin/x/packages/lisp/rmail/") + ("rmailmsc.el" + "miscellaneous support functions for the RMAIL mail reader" + (mail) + "/home/martin/x/packages/lisp/rmail/") + ("rmailsort.el" + "Rmail: sort messages." + (mail) + "/home/martin/x/packages/lisp/rmail/") + ("rmailsum.el" + "make summary buffers for the mail reader" + (mail) + "/home/martin/x/packages/lisp/rmail/") + ("undigest.el" + "digest-cracking support for the RMAIL mail reader" + (mail) + "/home/martin/x/packages/lisp/rmail/") + ("unrmail.el" + "convert Rmail files to mailbox files." + (mail) + "/home/martin/x/packages/lisp/rmail/") + ("cmuscheme.el" + "Scheme process in a buffer. Adapted from tea.el." + (processes lisp) + "/home/martin/x/packages/lisp/scheme/") + ("cmuscheme48.el" + "Scheme process in a buffer. Adapted from cmuscheme.el." + nil + "/home/martin/x/packages/lisp/scheme/") + ("scheme.el" + "Scheme (and DSSSL) editing mode." + (languages lisp) + "/home/martin/x/packages/lisp/scheme/") + ("xscheme.el" + "Run MIT-Scheme under XEmacs" + (languages lisp) + "/home/martin/x/packages/lisp/scheme/") + ("linuxdoc-sgml.el" + "sgml-mode enhancements for linuxdoc" + (docs languages) + "/home/martin/x/packages/lisp/sgml/") + ("sgml-mode.el" + "SGML- and HTML-editing modes" + (wp hypermedia comm languages) + "/home/martin/x/packages/lisp/sgml/") + ("executable.el" + "base functionality for executable interpreter scripts" + (languages unix) + "/home/martin/x/packages/lisp/sh-script/") + ("sh-script.el" + "shell-script editing commands for Emacs" + (languages unix) + "/home/martin/x/packages/lisp/sh-script/") + ("color-selector.el" + "a graphical widget of three sliders to change faces. " + (extensions faces) + "/home/martin/x/packages/lisp/slider/") + ("slider.el" + "graphical sliders for XEmacs. (c) 1997" + (utilities) + "/home/martin/x/packages/lisp/slider/") + ("sb-gud.el" + "Speedbar support for the Grand Unified Debugger" + (tools gud) + "/home/martin/x/packages/lisp/speedbar/") + ("sb-info.el" + "Speedbar support for Info" + (file tags tools) + "/home/martin/x/packages/lisp/speedbar/") + ("sb-rmail.el" + "Speedbar support for rmail" + (file tags tools) + "/home/martin/x/packages/lisp/speedbar/") + ("sb-w3.el" + "Speedbar support for w3." + (file tags tools) + "/home/martin/x/packages/lisp/speedbar/") + ("speedbar.el" + "quick access to files and tags" + (file tags tools) + "/home/martin/x/packages/lisp/speedbar/") + ("speedbspec.el" + "Buffer specialized configurations for speedbar" + (file tags tools) + "/home/martin/x/packages/lisp/speedbar/") + ("strokes.el" + "Control XEmacs through mouse strokes --" + (lisp mouse extensions) + "/home/martin/x/packages/lisp/strokes/") + ("supercite.el" + "minor mode for citing mail and news replies" + (citation attribution mail news article reply followup) + "/home/martin/x/packages/lisp/supercite/") + ("detexinfo.el" + "remove Texinfo commands from a Texinfo source file" + (tex docs) + "/home/martin/x/packages/lisp/texinfo/") + ("informat.el" + "info support functions package for Emacs" + (help) + "/home/martin/x/packages/lisp/texinfo/") + ("makeinfo.el" + "run makeinfo conveniently" + nil + "/home/martin/x/packages/lisp/texinfo/") + ("tex-mode.el" + "TeX, LaTeX, and SliTeX mode commands." + nil + "/home/martin/x/packages/lisp/texinfo/") + ("texinfmt.el" + "format Texinfo files into Info files." + nil + "/home/martin/x/packages/lisp/texinfo/") + ("texinfo.el" + "major mode for editing Texinfo files" + (maint tex docs) + "/home/martin/x/packages/lisp/texinfo/") + ("texnfo-upd.el" + "utilities for updating nodes and menus in Texinfo files" + (maint tex docs) + "/home/martin/x/packages/lisp/texinfo/") + ("autoinsert.el" + "automatic mode-dependent insertion of text into new files" + nil + "/home/martin/x/packages/lisp/text-modes/") + ("flyspell.el" + "On-the-fly spell checker" + (convenience) + "/home/martin/x/packages/lisp/text-modes/") + ("folding.el" + "A folding-editor-like minor mode." + (tools) + "/home/martin/x/packages/lisp/text-modes/") + ("hexl.el" + "edit a file in a hex dump format using the hexl filter." + (data) + "/home/martin/x/packages/lisp/text-modes/") + ("image-mode.el" + "Major mode for navigate images" + (image graphics) + "/home/martin/x/packages/lisp/text-modes/") + ("iso-acc.el" + "minor mode providing electric accent keys" + (i18n) + "/home/martin/x/packages/lisp/text-modes/") + ("iso-ascii.el" + "set up char tables for ISO 8859/1 on ASCII terminals." + (i18n) + "/home/martin/x/packages/lisp/text-modes/") + ("iso-cvt.el" + "translate to ISO 8859-1 from/to net/TeX conventions" + (tex iso latin i18n) + "/home/martin/x/packages/lisp/text-modes/") + ("iso-insert.el" + "insert functions for ISO 8859/1." + (i18n) + "/home/martin/x/packages/lisp/text-modes/") + ("iso-swed.el" + "set up char tables for ISO 8859/1 for Swedish/Finnish ttys" + (i18n) + "/home/martin/x/packages/lisp/text-modes/") + ("nroff-mode.el" + "GNU Emacs major mode for editing nroff source" + (wp) + "/home/martin/x/packages/lisp/text-modes/") + ("scribe.el" + "scribe mode, and its idiosyncratic commands." + (wp) + "/home/martin/x/packages/lisp/text-modes/") + ("swedish.el" + "miscellaneous functions for dealing with Swedish." + (i18n) + "/home/martin/x/packages/lisp/text-modes/") + ("tabify.el" + "tab conversion commands for XEmacs" + nil + "/home/martin/x/packages/lisp/text-modes/") + ("underline.el" + "insert/remove underlining (done by overstriking) in Emacs." + (wp) + "/home/martin/x/packages/lisp/text-modes/") + ("whitespace-mode.el" + "minor mode for making whitespace visible" + (modes extensions) + "/home/martin/x/packages/lisp/text-modes/") + ("winmgr-mode.el" + "generic window manager mode" + (languages) + "/home/martin/x/packages/lisp/text-modes/") + ("ws-mode.el" + "WordStar emulation mode for GNU Emacs" + (emulations) + "/home/martin/x/packages/lisp/text-modes/") + ("xpm-mode.el" + "minor mode for editing XPM files" + (data tools) + "/home/martin/x/packages/lisp/text-modes/") + ("xrdb-mode.el" + "mode for editing X resource database files" + (data languages) + "/home/martin/x/packages/lisp/text-modes/") + ("bib-mode.el" + "bib-mode, major mode for editing bib files." + (bib) + "/home/martin/x/packages/lisp/textools/") + ("bibtex.el" + "BibTeX mode for GNU Emacs" + (bibtex latex tex) + "/home/martin/x/packages/lisp/textools/") + ("doctex.el" + "grind GNU Emacs DOC file into LaTeX input" + (tex docs) + "/home/martin/x/packages/lisp/textools/") + ("refbib.el" + "convert refer-style references to ones usable by Latex bib" + (bib tex) + "/home/martin/x/packages/lisp/textools/") + ("time.el" + "display time and load in mode line of Emacs." + nil + "/home/martin/x/packages/lisp/time/") + ("char-util.el" + "character utility" + (character emacs/mule) + "/home/martin/x/packages/lisp/tm/") + ("cless.el" + "Common lisp and Emacs Lisp source sharing" + (common lisp) + "/home/martin/x/packages/lisp/tm/") + ("gnus-art-mime.el" + "MIME extension for article mode of Gnus" + (news mime multimedia multilingual encoded-word) + "/home/martin/x/packages/lisp/tm/") + ("gnus-charset.el" + "MIME charset extension for Gnus" + (news mime multimedia multilingual encoded-word) + "/home/martin/x/packages/lisp/tm/") + ("gnus-mime.el" + "MIME extensions for Gnus" + (news mime multimedia multilingual encoded-word) + "/home/martin/x/packages/lisp/tm/") + ("gnus-sum-mime.el" + "MIME extension for summary mode of Gnus" + (news mime multimedia multilingual encoded-word) + "/home/martin/x/packages/lisp/tm/") + ("latex-math-symbol.el" + "LaTeX math symbol decoder" + (latex math mule) + "/home/martin/x/packages/lisp/tm/") + ("message-mime.el" + "MIME extensions for message.el" + (news mime multimedia multilingual encoded-word) + "/home/martin/x/packages/lisp/tm/") + ("mime-setup.el" + "setup file for tm viewer and composer." + (mail news mime multimedia multilingual encoded-word) + "/home/martin/x/packages/lisp/tm/") + ("mu-bbdb.el" + "`attribution' function for mu-cite with BBDB." + nil + "/home/martin/x/packages/lisp/tm/") + ("mu-cite.el" + "yet another citation tool for GNU Emacs" + (mail news citation) + "/home/martin/x/packages/lisp/tm/") + ("range.el" + "range functions" + (range) + "/home/martin/x/packages/lisp/tm/") + ("signature.el" + "a signature utility for GNU Emacs" + (mail news signature) + "/home/martin/x/packages/lisp/tm/") + ("texi-util.el" + "Texinfo utility" + (texinfo) + "/home/martin/x/packages/lisp/tm/") + ("tl-atype.el" + "atype functions" + (atype) + "/home/martin/x/packages/lisp/tm/") + ("tl-list.el" + "utility functions about list" + (list) + "/home/martin/x/packages/lisp/tm/") + ("tl-misc.el" + "miscellaneous utility of tl." + (load-path module structure) + "/home/martin/x/packages/lisp/tm/") + ("tl-seq.el" + "sequence functions" + (sequence) + "/home/martin/x/packages/lisp/tm/") + ("tl-str.el" + "Emacs Lisp Library module about string" + (string) + "/home/martin/x/packages/lisp/tm/") + ("tm-bbdb.el" + "tm shared module for BBDB" + (mail news mime multimedia multilingual bbdb) + "/home/martin/x/packages/lisp/tm/") + ("tm-def.el" + "definition module for tm" + (mail news mime multimedia definition) + "/home/martin/x/packages/lisp/tm/") + ("tm-edit-mc.el" + "Mailcrypt interface for tm-edit" + (mail news mime multimedia multilingual security pgp) + "/home/martin/x/packages/lisp/tm/") + ("tm-edit.el" + "Simple MIME Composer for GNU Emacs" + (mail news mime multimedia multilingual) + "/home/martin/x/packages/lisp/tm/") + ("tm-ew-d.el" + "RFC 2047 based encoded-word decoder for GNU Emacs" + (encoded-word mime multilingual header mail news) + "/home/martin/x/packages/lisp/tm/") + ("tm-ew-e.el" + "RFC 2047 based encoded-word encoder for GNU Emacs" + (encoded-word mime multilingual header mail news) + "/home/martin/x/packages/lisp/tm/") + ("tm-file.el" + "tm-view internal method for file extraction" + (mail news mime multimedia file extract) + "/home/martin/x/packages/lisp/tm/") + ("tm-ftp.el" + "tm-view internal method for anonymous ftp" + (anonymous ftp mime multimedia mail news) + "/home/martin/x/packages/lisp/tm/") + ("tm-image.el" + "tm-view filter to display images in XEmacs or MULE buffers" + (image picture x-face mime multimedia mail news) + "/home/martin/x/packages/lisp/tm/") + ("tm-mail.el" + "mail-mode extension." + (mail mime multimedia) + "/home/martin/x/packages/lisp/tm/") + ("tm-mh-e.el" + "MIME extension for mh-e" + (mail mh mime multimedia encoded-word multilingual) + "/home/martin/x/packages/lisp/tm/") + ("tm-parse.el" + "MIME message parser" + (mail news mime multimedia) + "/home/martin/x/packages/lisp/tm/") + ("tm-partial.el" + "Grabbing all MIME \"message/partial\"s." + (mail news mime multimedia message/partial) + "/home/martin/x/packages/lisp/tm/") + ("tm-pgp.el" + "tm-view internal methods for PGP." + (mail news mime multimedia pgp security) + "/home/martin/x/packages/lisp/tm/") + ("tm-play.el" + "decoder for tm-view.el" + (mail news mime multimedia) + "/home/martin/x/packages/lisp/tm/") + ("tm-rmail.el" + "MIME extension for RMAIL" + (mail mime multimedia multilingual encoded-word) + "/home/martin/x/packages/lisp/tm/") + ("tm-setup.el" + "setup file for tm viewer." + (mail news mime multimedia multilingual encoded-word) + "/home/martin/x/packages/lisp/tm/") + ("tm-view.el" + "interactive MIME viewer for GNU Emacs" + (mail news mime multimedia) + "/home/martin/x/packages/lisp/tm/") + ("tm-vm.el" + "tm-MUA (MIME Extension module) for VM" + (mail mime multimedia multilingual encoded-word) + "/home/martin/x/packages/lisp/tm/") + ("tmh-comp.el" + "tm-mh-e functions for composing messages" + (mail mh mime multimedia encoded-word multilingual) + "/home/martin/x/packages/lisp/tm/") + ("tu-comment.el" + "a comment out utility for Lisp programs." + (comment lisp) + "/home/martin/x/packages/lisp/tm/") + ("tu-replace.el" + "a replacing utility for GNU Emacs" + (replace) + "/home/martin/x/packages/lisp/tm/") + ("tpu-doc.el" + "Documentation for TPU-edt" + (emulations) + "/home/martin/x/packages/lisp/tpu/") + ("tpu-edt.el" + "Emacs emulating TPU emulating EDT" + (emulations) + "/home/martin/x/packages/lisp/tpu/") + ("tpu-extras.el" + "Scroll margins and free cursor mode for TPU-edt" + (emulations) + "/home/martin/x/packages/lisp/tpu/") + ("tpu-mapper.el" + "Create a TPU-edt X-windows keymap file" + (emulations) + "/home/martin/x/packages/lisp/tpu/") + ("vc-hooks.el" + "resident support for version-control" + nil + "/home/martin/x/packages/lisp/vc/") + ("vc.el" + "drive a version-control system from within Emacs" + nil + "/home/martin/x/packages/lisp/vc/") + ("vhdl-mode.el" + "major mode for editing VHDL code" + (languages vhdl) + "/home/martin/x/packages/lisp/vhdl/") + ("view-process-mode.el" + "Display current running processes" + (processes) + "/home/martin/x/packages/lisp/view-process/") + ("view-process-system-specific.el" + "System specific stuff for view-process" + (processes) + "/home/martin/x/packages/lisp/view-process/") + ("view-process-xemacs.el" + "XEmacs specific code for view-process" + (processes) + "/home/martin/x/packages/lisp/view-process/") + ("viper-cmd.el" + "Vi command support for Viper" + nil + "/home/martin/x/packages/lisp/viper/") + ("viper-ex.el" + "functions implementing the Ex commands for Viper" + nil + "/home/martin/x/packages/lisp/viper/") + ("viper-init.el" + "some common definitions for Viper" + nil + "/home/martin/x/packages/lisp/viper/") + ("viper-keym.el" + "Viper keymaps" + nil + "/home/martin/x/packages/lisp/viper/") + ("viper-macs.el" + "functions implementing keyboard macros for Viper" + nil + "/home/martin/x/packages/lisp/viper/") + ("viper-mous.el" + "mouse support for Viper" + nil + "/home/martin/x/packages/lisp/viper/") + ("viper-util.el" + "Utilities used by viper.el" + nil + "/home/martin/x/packages/lisp/viper/") + ("viper.el" + "A full-featured Vi emulator for GNU Emacs and XEmacs," + (emulations) + "/home/martin/x/packages/lisp/viper/") + ("vm-easymenu.el" + "support the easymenu interface for defining a menu." + (emulations) + "/home/martin/x/packages/lisp/vm/") + ("vm-loaddefs.el" + "autoloads for VM formerly in loaddefs.el" + (mail dumped) + "/home/martin/x/packages/lisp/vm/") + ("base64.el" + "Base64 encoding functions" + (extensions) + "/home/martin/x/packages/lisp/w3/") + ("css.el" + "Cascading Style Sheet parser" + nil + "/home/martin/x/packages/lisp/w3/") + ("dsssl-flow.el" + "DSSSL flow objects" + nil + "/home/martin/x/packages/lisp/w3/") + ("dsssl.el" + "DSSSL parser" + nil + "/home/martin/x/packages/lisp/w3/") + ("images.el" + "Automatic image converters" + (images) + "/home/martin/x/packages/lisp/w3/") + ("mm.el" + "Mailcap parsing routines, and MIME handling" + (mail news hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("mule-sysdp.el" + "consolidate MULE-version dependencies in one file." + (lisp tools) + "/home/martin/x/packages/lisp/w3/") + ("socks.el" + "A Socks v5 Client for Emacs" + (comm firewalls) + "/home/martin/x/packages/lisp/w3/") + ("ssl.el" + "ssl functions for emacsen without them builtin" + (comm) + "/home/martin/x/packages/lisp/w3/") + ("url-auth.el" + "Uniform Resource Locator authorization modules" + (comm data processes hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("url-cache.el" + "Uniform Resource Locator retrieval tool" + (comm data processes hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("url-cookie.el" + "Netscape Cookie support" + (comm data processes hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("url-file.el" + "File retrieval code" + (comm data processes) + "/home/martin/x/packages/lisp/w3/") + ("url-gopher.el" + "Gopher Uniform Resource Locator retrieval code" + (comm data processes) + "/home/martin/x/packages/lisp/w3/") + ("url-gw.el" + "Gateway munging for URL loading" + (comm data processes) + "/home/martin/x/packages/lisp/w3/") + ("url-http.el" + "HTTP Uniform Resource Locator retrieval code" + (comm data processes) + "/home/martin/x/packages/lisp/w3/") + ("url-irc.el" + "IRC URL interface" + (comm data processes) + "/home/martin/x/packages/lisp/w3/") + ("url-mail.el" + "Mail Uniform Resource Locator retrieval code" + (comm data processes) + "/home/martin/x/packages/lisp/w3/") + ("url-misc.el" + "Misc Uniform Resource Locator retrieval code" + (comm data processes) + "/home/martin/x/packages/lisp/w3/") + ("url-news.el" + "News Uniform Resource Locator retrieval code" + (comm data processes) + "/home/martin/x/packages/lisp/w3/") + ("url-nfs.el" + "NFS URL interface" + (comm data processes) + "/home/martin/x/packages/lisp/w3/") + ("url-ns.el" + "Various netscape-ish functions for proxy definitions" + (comm data processes hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("url-parse.el" + "Uniform Resource Locator parser" + (comm data processes) + "/home/martin/x/packages/lisp/w3/") + ("url-vars.el" + "Variables for Uniform Resource Locator tool" + (comm data processes hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("url.el" + "Uniform Resource Locator retrieval tool" + (comm data processes hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-about.el" + "About pages for emacs-w3" + (hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-cfg.el" + "Configuration info from Emacs/W3" + (hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-cus.el" + "Customization support for Emacs-W3" + (comm help hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-display.el" + "display engine" + (faces help hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-e19.el" + "Emacs 19.xx specific functions for emacs-w3" + (faces help mouse hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-e20.el" + "Emacs 20.xx specific functions for emacs-w3" + (faces help mouse hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-elisp.el" + "Scripting support for emacs-lisp" + (hypermedia scripting) + "/home/martin/x/packages/lisp/w3/") + ("w3-emulate.el" + "All variable definitions for emacs-w3" + (comm help hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-forms.el" + "Emacs-w3 forms parsing code for new display engine" + (faces help comm data languages) + "/home/martin/x/packages/lisp/w3/") + ("w3-hot.el" + "Main functions for emacs-w3 on all platforms/versions" + (faces help comm news mail processes mouse hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-imap.el" + "Imagemap functions" + (hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-jscript.el" + "Scripting support for javascript" + (hypermedia scripting) + "/home/martin/x/packages/lisp/w3/") + ("w3-keyword.el" + "Emacs-W3 binding style sheet mechanism" + (hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-latex.el" + "Emacs-W3 printing via LaTeX" + (hypermedia printing typesetting) + "/home/martin/x/packages/lisp/w3/") + ("w3-menu.el" + "Menu functions for emacs-w3" + (menu hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-mouse.el" + "Mouse specific functions for emacs-w3" + (mouse hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-prefs.el" + "Preferences panels for Emacs-W3" + (hypermedia preferences) + "/home/martin/x/packages/lisp/w3/") + ("w3-print.el" + "Printing support for emacs-w3" + (faces help printing hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-props.el" + "Additional text property stuff" + (faces) + "/home/martin/x/packages/lisp/w3/") + ("w3-script.el" + "Scripting support" + (hypermedia scripting) + "/home/martin/x/packages/lisp/w3/") + ("w3-speak.el" + "Emacs-W3 speech interface" + (hypermedia speech) + "/home/martin/x/packages/lisp/w3/") + ("w3-style.el" + "Emacs/W3 binding style sheet mechanism" + (faces hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-sysdp.el" + "consolidate Emacs-version dependencies in one file." + (lisp tools) + "/home/martin/x/packages/lisp/w3/") + ("w3-toolbar.el" + "Toolbar functions for emacs-w3" + (mouse toolbar) + "/home/martin/x/packages/lisp/w3/") + ("w3-vars.el" + "All variable definitions for emacs-w3" + (comm help hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3-widget.el" + "An image widget" + (faces images) + "/home/martin/x/packages/lisp/w3/") + ("w3-xemac.el" + "XEmacs specific functions for emacs-w3" + (faces help mouse hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("w3.el" + "Main functions for emacs-w3 on all platforms/versions" + (faces help comm news mail processes mouse hypermedia) + "/home/martin/x/packages/lisp/w3/") + ("add-log.el" + "change log maintenance commands for Emacs" + (maint) + "/home/martin/x/packages/lisp/xemacs-base/") + ("advice.el" + "an overloading mechanism for Emacs Lisp functions" + (extensions lisp tools) + "/home/martin/x/packages/lisp/xemacs-base/") + ("annotations.el" + "interface to marginal annotations" + (extensions hypermedia outlines) + "/home/martin/x/packages/lisp/xemacs-base/") + ("assoc.el" + "insert/delete/sort functions on association lists" + (extensions) + "/home/martin/x/packages/lisp/xemacs-base/") + ("case-table.el" + "code to extend the character set and support case tables." + (i18n) + "/home/martin/x/packages/lisp/xemacs-base/") + ("chistory.el" + "list command history" + nil + "/home/martin/x/packages/lisp/xemacs-base/") + ("comint-xemacs.el" + "Face customizations for comint" + (help faces) + "/home/martin/x/packages/lisp/xemacs-base/") + ("comint.el" + "general command interpreter in a window stuff" + (processes) + "/home/martin/x/packages/lisp/xemacs-base/") + ("compile.el" + "run compiler as inferior of Emacs, parse error messages." + (tools processes) + "/home/martin/x/packages/lisp/xemacs-base/") + ("debug.el" + "debuggers and related commands for XEmacs" + nil + "/home/martin/x/packages/lisp/xemacs-base/") + ("ebuff-menu.el" + "electric-buffer-list mode" + (frames) + "/home/martin/x/packages/lisp/xemacs-base/") + ("echistory.el" + "Electric Command History Mode" + (extensions) + "/home/martin/x/packages/lisp/xemacs-base/") + ("edmacro.el" + "keyboard macro editor" + (abbrev internal) + "/home/martin/x/packages/lisp/xemacs-base/") + ("ehelp.el" + "bindings for electric-help mode" + (help extensions) + "/home/martin/x/packages/lisp/xemacs-base/") + ("electric.el" + "window maker and Command loop for `electric' modes." + (extensions) + "/home/martin/x/packages/lisp/xemacs-base/") + ("enriched.el" + "read and save files in text/enriched format" + (wp faces) + "/home/martin/x/packages/lisp/xemacs-base/") + ("env.el" + "functions to manipulate environment variables." + (processes unix) + "/home/martin/x/packages/lisp/xemacs-base/") + ("facemenu.el" + "create a face menu for interactively adding fonts to text" + (faces) + "/home/martin/x/packages/lisp/xemacs-base/") + ("ffap.el" + "find file (or url) at point" + (files hypermedia matching mouse) + "/home/martin/x/packages/lisp/xemacs-base/") + ("helper.el" + "utility help package supporting help in electric modes" + (help) + "/home/martin/x/packages/lisp/xemacs-base/") + ("imenu.el" + "Framework for mode-specific buffer indexes." + (tools) + "/home/martin/x/packages/lisp/xemacs-base/") + ("iso-syntax.el" + "set up case-conversion and syntax tables for ISO 8859/1" + (i18n) + "/home/martin/x/packages/lisp/xemacs-base/") + ("macros.el" + "non-primitive commands for keyboard macros." + (abbrev) + "/home/martin/x/packages/lisp/xemacs-base/") + ("novice.el" + "handling of disabled commands (\"novice mode\") for XEmacs." + (internal help) + "/home/martin/x/packages/lisp/xemacs-base/") + ("outline.el" + "outline mode commands for Emacs" + (outlines) + "/home/martin/x/packages/lisp/xemacs-base/") + ("passwd.el" + "Prompting for passwords semi-securely" + (comm extensions) + "/home/martin/x/packages/lisp/xemacs-base/") + ("pp.el" + "pretty printer for Emacs Lisp" + (lisp tools language extensions) + "/home/martin/x/packages/lisp/xemacs-base/") + ("regi.el" + "REGular expression Interpreting engine" + (extensions matching) + "/home/martin/x/packages/lisp/xemacs-base/") + ("ring.el" + "handle rings of items" + (extensions) + "/home/martin/x/packages/lisp/xemacs-base/") + ("shell.el" + "specialized comint.el for running the shell." + (processes shell terminal csh tcsh bash sh) + "/home/martin/x/packages/lisp/xemacs-base/") + ("skeleton.el" + "Lisp language extension for writing statement skeletons" + (extensions abbrev languages tools) + "/home/martin/x/packages/lisp/xemacs-base/") + ("sort.el" + "commands to sort text in an XEmacs buffer." + (unix) + "/home/martin/x/packages/lisp/xemacs-base/") + ("thing.el" + "find language-specific contiguous pieces of text" + (extensions languages) + "/home/martin/x/packages/lisp/xemacs-base/") + ("time-stamp.el" + "Maintain last change time stamps in files edited by Emacs" + (tools) + "/home/martin/x/packages/lisp/xemacs-base/") + ("timezone.el" + "time zone package for XEmacs" + (news) + "/home/martin/x/packages/lisp/xemacs-base/") + ("xbm-button.el" + "Create XBM text buttons under XEmacs" + (frames internal) + "/home/martin/x/packages/lisp/xemacs-base/") + ("xpm-button.el" + "create XPM buttons" + (frames internal) + "/home/martin/x/packages/lisp/xemacs-base/") + ("bench.el" + "benchmarking utility for emacsen" + (internal maint) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("docref.el" + "Simple cross references for Elisp documentation strings" + (docs help lisp) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("eldoc.el" + "show function arglist or variable docstring in echo area" + (extensions) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("elp.el" + "Emacs Lisp Profiler" + (debugging lisp tools) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("eval-expr.el" + "enhanced eval-expression command" + (extensions) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("find-func.el" + "find the definition of the Emacs Lisp function near point" + (emacs-lisp functions variables) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("find-gc.el" + "detect functions that call the garbage collector" + (maint) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("hide-copyleft.el" + "hide obnoxious copyright prologs" + nil + "/home/martin/x/packages/lisp/xemacs-devel/") + ("ielm.el" + "interaction mode for Emacs Lisp" + (lisp) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("pretty-print.el" + "Emacs Lisp pretty printer and macro expander" + (lisp internal) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("profile.el" + "basic profiling commands for XEmacs" + (internal) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("regexp-opt.el" + "generate efficient regexps to match strings." + (strings regexps) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("reposition.el" + "center a Lisp function or comment on the screen" + nil + "/home/martin/x/packages/lisp/xemacs-devel/") + ("trace.el" + "tracing facility for Emacs Lisp functions" + (tools lisp) + "/home/martin/x/packages/lisp/xemacs-devel/") + ("zenirc-18.el" + "compatibility functions for Emacs 18" + (extensions zenirc) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-8ball.el" + "magic 8 ball for ZenIRC" + (zenirc extensions magic 8ball) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-away.el" + "fancy away processing for ZenIRC" + (zenirc extensions oink) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-bork.el" + "Swedish Chef message catalog for ZenIRC" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-color.el" + "color messages in zenirc" + (zenirc extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-complete.el" + "complete commands, nicknames, etc. in ZenIRC" + (zenirc completion extensions oink) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-dcc.el" + "CTCP DCC module for ZenIRC" + (zenirc extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-doto.el" + "do things to who, list, links replies" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-eval.el" + "join the \"mi emacs es tu emacs\" club" + (zenirc extensions eval oink) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-fill.el" + "fill messages in zenirc" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-finnish.el" + "Finnish message catalog for ZenIRC" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-format.el" + "format nick!user@host for zenirc" + (zenirc extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-fortran.el" + "emulate F-BOT FORTRAN bot program with ZenIRC" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-french.el" + "French message catalog for ZenIRC" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-history.el" + "keep a history of commands in ZenIRC" + (zenirc history) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-ignore.el" + "ignore module for zenirc." + (zenirc ignorance) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-iwantop.el" + "IWANTOP ctcp for granting channel operator bits" + (zenirc extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-latin.el" + "Latin message catalog for ZenIRC" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-make.el" + "a hack to set the load path for byte-compiling" + (zenirc make) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-meditate.el" + "admonish others for disturbing your meditation" + (zenirc extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-netsplit.el" + "hide excessive spew from netsplits" + (zenirc extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-notify.el" + "Notifies you when people signon/off" + (zenirc notify extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-oink.el" + "auto-oink" + (zenirc extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-ojnk.el" + "Send ojnks - example of adding commands to zenirc" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-popup.el" + "pop up zenirc buffer window on signal" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-prime-p.el" + "flag prime numbers" + (zenirc extensions oink "mmmm primes") + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-signal.el" + "Fancy signal formatting for ZenIRC" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-stamp.el" + "timestamping for ZenIRC" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-swedish.el" + "Swedish message catalog for ZenIRC" + (extensions) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-yow-filter.el" + "neutralize yowage" + (zenirc extensions oink yow) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc-yow.el" + "important pinheadery for ZenIRC" + (zenirc extensions oink yow) + "/home/martin/x/packages/lisp/zenirc/") + ("zenirc.el" + "Waste time on Internet Relay Chat (ZenIRC client)" + (extensions zenirc) + "/home/martin/x/packages/lisp/zenirc/") + ("dui-registry.el" + "Registry of dui dictionary methods" + (mule dictionary) + "/home/martin/x/mule-packages/lisp/edict/") + ("dui.el" + "Dictionary user interface" + (mule dictionary) + "/home/martin/x/mule-packages/lisp/edict/") + ("edict-edit.el" + "Edit an EDICT dictionary." + (mule edict dictionary) + "/home/martin/x/mule-packages/lisp/edict/") + ("edict-english.el" + "English morphology rules for edict.el" + (mule edict dictionary) + "/home/martin/x/mule-packages/lisp/edict/") + ("edict-japanese.el" + "Japanese morphology rules for edict.el" + (mule edict dictionary) + "/home/martin/x/mule-packages/lisp/edict/") + ("edict-morphology.el" + "morphology rewrite engine for edict.el" + (mule edict dictionary) + "/home/martin/x/mule-packages/lisp/edict/") + ("edict.el" + "Word lookup (with deinflection) in EDICT" + (mule edict dictionary) + "/home/martin/x/mule-packages/lisp/edict/") + ("ts-mode.el" + "Insert time-stamps in buffers" + (minor mode) + "/home/martin/x/mule-packages/lisp/edict/") + ("egg-cwnn-leim.el" + "Egg/CWnn-related code for LEIM" + (japanese input method leim) + "/home/martin/x/mule-packages/lisp/egg-its/") + ("egg-kwnn-leim.el" + "Egg/CWnn-related code for LEIM" + (japanese input method leim) + "/home/martin/x/mule-packages/lisp/egg-its/") + ("egg-leim.el" + "Egg/Wnn-related code for LEIM" + (japanese input method leim) + "/home/martin/x/mule-packages/lisp/egg-its/") + ("egg-sj3-leim.el" + "Egg/SJ3-related code for LEIM" + (japanese input method leim) + "/home/martin/x/mule-packages/lisp/egg-its/") + ("egg-wnn.el" + "a inputting method communicating with [jck]server" + (inputting method) + "/home/martin/x/mule-packages/lisp/egg-its/") + ("cyril-jis.el" + "Quail package for inputting JISX0208 Cyrillic letters" + (multilingual input method cyrillic) + "/home/martin/x/mule-packages/lisp/leim/") + ("cyrillic.el" + "Quail package for inputting Cyrillic characters" + (multilingual input method cyrillic) + "/home/martin/x/mule-packages/lisp/leim/") + ("greek.el" + "Quail package for inputting Greek" + (multilingual input method greek) + "/home/martin/x/mule-packages/lisp/leim/") + ("hangul.el" + "Quail package for inputting Korean Hangul characters" + (multilingual input method korean hangul) + "/home/martin/x/mule-packages/lisp/leim/") + ("hangul3.el" + "Quail package for inputting Korean Hangul characters" + (multilingual input method korean hangul) + "/home/martin/x/mule-packages/lisp/leim/") + ("hanja-jis.el" + "Quail package for inputting Korean Hanja (JISX0208)" + (multilingual input method korean hangul) + "/home/martin/x/mule-packages/lisp/leim/") + ("hanja.el" + "Quail-package for Korean Hanja (KSC5601)" + (multilingual input method korean hanja) + "/home/martin/x/mule-packages/lisp/leim/") + ("ipa.el" + "Quail package for inputting IPA characters" + (multilingual input method ipa) + "/home/martin/x/mule-packages/lisp/leim/") + ("latin-pre.el" + "Quail packages for inputting various European characters." + (mule multilingual latin input method) + "/home/martin/x/mule-packages/lisp/leim/") + ("leim-list.el" + "list of LEIM (Library of Emacs Input Method)" + nil + "/home/martin/x/mule-packages/lisp/leim/") + ("py-punct.el" + "Quail packages for Chinese (pinyin + extra symbols)" + (multilingual input method chienese) + "/home/martin/x/mule-packages/lisp/leim/") + ("pypunct-b5.el" + "Quail packages for Chinese (pinyin + extra symbols)" + (multilingual input method chienese) + "/home/martin/x/mule-packages/lisp/leim/") + ("quail.el" + "Provides simple input method for multilingual text" + (mule multilingual input method) + "/home/martin/x/mule-packages/lisp/leim/") + ("symbol-ksc.el" + "Quail-package for Korean Symbol (KSC5601)" + (multilingual input method korean hangul) + "/home/martin/x/mule-packages/lisp/leim/") + ("arabic.el" + "pre-loaded support for Arabic." + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("canna-leim.el" + "Canna-related code for LEIM" + (japanese input method leim) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("canna.el" + "Interface to the Canna input method." + (canna japanese input method mule multilingual) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("char-table.el" + "display table of charset" + (character mule) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("chartblxmas.el" + "display table of charset by pop-up menu" + (character xemacs/mule) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("china-util.el" + "utilities for Chinese" + (mule multilingual chinese) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("chinese.el" + "Support for Chinese" + (multilingual chinese) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("cyril-util.el" + "utilities for Cyrillic scripts" + (mule multilingual cyrillic) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("english.el" + "English support" + (multibyte character character set syntax category) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("european.el" + "Support for European languages" + (multilingual european) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("hebrew.el" + "Support for Hebrew" + (multilingual hebrew) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("isearch-mule.el" + "incremental search with front-end inputting method" + (search) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("japan-util.el" + "utilities for Japanese" + (mule multilingual japanese) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("japanese.el" + "Japanese support" + (multilingual japanese) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("kinsoku.el" + "Kinsoku (line wrap) processing for XEmacs/Mule" + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("korean.el" + "Support for Korean" + (multilingual korean) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("misc-lang.el" + "support for miscellaneous languages (characters)" + (multilingual character set coding system) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-category.el" + "category functions for XEmacs/Mule." + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-ccl.el" + "CCL (Code Conversion Language) compiler" + (ccl mule multilingual character set coding-system) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-charset.el" + "Charset functions for Mule." + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-cmds.el" + "Commands for multilingual environment" + (mule multilingual) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-cne.el" + "interface between input methods Canna and EGG." + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-coding.el" + "Coding-system functions for Mule." + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-debug.el" + "debugging functions for Mule." + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-diag.el" + "Show diagnosis of multilingual environment (MULE)" + (multilingual charset coding system fontset diagnosis) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-files.el" + "File I/O functions for XEmacs/Mule." + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-help.el" + "Mule-ized Help functions " + (help internal) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-keyboard.el" + "Direct input of multilingual chars from keyboard." + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-misc.el" + "Miscellaneous Mule functions." + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-tty-init.el" + "Initialization code for console tty under MULE" + (mule tty console dumped) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-util.el" + "Utility functions for multilingual environment (mule)" + (mule multilingual) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("mule-x-init.el" + "initialization code for X Windows under MULE" + (mule x11) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("thai-util.el" + "utilities for Thai" + (mule multilingual thai) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("thai.el" + "Support for Thai" + (multilingual thai) + "/home/martin/x/mule-packages/lisp/mule-base/") + ("viet-chars.el" + "pre-loaded support for Vietnamese, part 1." + nil + "/home/martin/x/mule-packages/lisp/mule-base/") + ("skk-auto.el" + "$BAw$j2>L>$N<+F0=hM}$N$?$a$N%W%m%0%i%`(B" + (japanese) + "/home/martin/x/mule-packages/lisp/skk/") + ("skk-comp.el" + "$BJd40$N$?$a$N%W%m%0%i%`(B" + (japanese) + "/home/martin/x/mule-packages/lisp/skk/") + ("skk-foreword.el" + "$BA0=q$-(B" + (japanese) + "/home/martin/x/mule-packages/lisp/skk/") + ("skk-gadget.el" + "$B (length (windows-of-buffer buffer)) 0) - (select-window (car (windows-of-buffer buffer))) - (switch-to-buffer buffer)))) - -(defun select-buffers-tab-buffers-by-mode (buffer-to-select buf1) - "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 - buffer-to-select))) - (modenm1 (symbol-value-in-buffer 'mode-name buf1)) - (modenm2 (symbol-value-in-buffer 'mode-name buffer-to-select))) - (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)))) + (switch-to-buffer buffer t)) (defsubst build-buffers-tab-internal (buffers) - (let ((selected t)) + (let (line) (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)))) + (setq line (funcall buffers-tab-format-buffer-line-function + buffer)) + (vector line (list buffers-tab-switch-to-buffer-function + (buffer-name buffer)))) buffers))) -;;; #### SJT would like this function to have a sort function list. I -;;; don't see how this could work given that sorting is not -;;; cumulative --andyp. -(defun buffers-tab-items (&optional in-deletion frame force-selection) - "Return a list of tab instantiators based on the current buffers list. -This function is used as the tab filter for the top-level buffers -\"Buffers\" tab. It dynamically creates a list of tab instantiators -to use as the contents of the tab. The contents and order of the list -is controlled by `buffers-tab-filter-functions' which by default -groups buffers according to major mode and removes invisible buffers. -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 - ;; NB it is too late if we run the omit function as part of the - ;; filter functions because we need to know which buffer is the - ;; context buffer before they get run. - (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))) - ;; filter buffers - (when buffers-tab-filter-functions - (setq buffers - (delete-if - #'null - (mapcar #'(lambda (buf) - (let ((tmp-buf buf)) - (mapc #'(lambda (fun) - (unless (funcall fun buf first-buf) - (setq tmp-buf nil))) - buffers-tab-filter-functions) - tmp-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 (1- 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 buffers-tab-items () + "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'." + (let ((buffers (delete-if buffers-tab-omit-function (buffer-list)))) + (and (integerp buffers-tab-max-size) + (> buffers-tab-max-size 1) + (> (length buffers) buffers-tab-max-size) + ;; shorten list of buffers + (setcdr (nthcdr buffers-tab-max-size buffers) nil)) + (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")) - (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)) - ((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)) - ))) - (console-type-list)))) - -(defun update-tab-in-gutter (frame &optional force-selection) + (let ((gutter-string "")) + (set-extent-begin-glyph + (make-extent 0 0 gutter-string) + (setq gutter-buffers-tab + (make-glyph + (vector 'tab-control :descriptor "Buffers" + :properties (list :items (buffers-tab-items)))))) + ;; This looks better than a 3d border + (set-specifier default-gutter-border-width 0 'global 'mswindows) + (set-specifier default-gutter gutter-string 'global 'mswindows))) + +(defun update-tab-in-gutter (&optional notused) "Update the tab control in the gutter area." - ;; dedicated frames don't get tabs - (unless (or (window-dedicated-p (frame-selected-window frame)) - (frame-property frame 'popup)) - (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) - (let ((items (buffers-tab-items nil frame force-selection))) - (when items - (set-glyph-image - gutter-buffers-tab - (vector 'tab-control :descriptor "Buffers" :face buffers-tab-face - :orientation gutter-buffers-tab-orientation - (if (or (eq gutter-buffers-tab-orientation 'top) - (eq gutter-buffers-tab-orientation 'bottom)) - :pixel-width :pixel-height) - (if (or (eq gutter-buffers-tab-orientation 'top) - (eq gutter-buffers-tab-orientation 'bottom)) - '(gutter-pixel-width) '(gutter-pixel-height)) - :items items) - frame) - ;; set-glyph-image will not make the gutter dirty - (set-gutter-dirty-p gutter-buffers-tab-orientation))))))) - -;; A myriad of different update hooks all doing slightly different things -(add-one-shot-hook - 'after-init-hook - #'(lambda () - ;; don't add the hooks if the user really doesn't want them - (when gutter-buffers-tab-enabled - (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))))) - (update-tab-in-gutter (selected-frame) t)))) - -;; -;; progress display -;; ripped off from message display -;; -(defcustom progress-feedback-use-echo-area nil - "*Whether progress gauge display should display in the echo area. -If NIL then progress gauges will be displayed with whatever native widgets -are available on the current console. If non-NIL then progress display will be -textual and displayed in the echo area." - :type 'boolean - :group 'gutter) - -(defvar progress-glyph-height 24 - "Height of the progress gauge glyph.") - -(defvar progress-feedback-popup-period 0.5 - "The time that the progress gauge should remain up after completion") - -(defcustom progress-feedback-style 'large - "*Control the appearance of the progress gauge. -If 'large, the default, then the progress-feedback text is displayed -above the gauge itself. If 'small then the gauge and text are arranged -side-by-side." - :group 'gutter - :type '(choice (const :tag "large" large) - (const :tag "small" small))) - -;; private variables -(defvar progress-text-instantiator [string :data ""]) -(defvar progress-layout-glyph (make-glyph)) -(defvar progress-layout-instantiator nil) - -(defvar progress-gauge-instantiator - [progress-gauge - :value 0 - :pixel-height (eval progress-glyph-height) - :pixel-width 250 - :descriptor "Progress"]) - -(defun set-progress-feedback-instantiator (&optional locale) - (cond - ((eq progress-feedback-style 'small) - (setq progress-glyph-height 16) - (setq progress-layout-instantiator - `[layout - :orientation vertical :margin-width 4 - :horizontally-justify left :vertically-justify center - :items (,progress-gauge-instantiator - [button - :pixel-height (eval progress-glyph-height) - ;; 'quit is special and acts "asynchronously". - :descriptor "Stop" :callback 'quit] - ,progress-text-instantiator)]) - (set-glyph-image progress-layout-glyph progress-layout-instantiator - locale)) - (t - (setq progress-glyph-height 24) - (setq progress-layout-instantiator - `[layout - :orientation vertical :margin-width 4 - :horizontally-justify left :vertically-justify center - :items (,progress-text-instantiator - [layout - :orientation horizontal - :items (,progress-gauge-instantiator - [button - :pixel-height (eval progress-glyph-height) - :descriptor " Stop " - ;; 'quit is special and acts "asynchronously". - :callback 'quit])])]) - (set-glyph-image progress-layout-glyph progress-layout-instantiator - locale)))) - -(defvar progress-abort-glyph (make-glyph)) - -(defun set-progress-abort-instantiator (&optional locale) - (set-glyph-image progress-abort-glyph - `[layout :orientation vertical - :horizontally-justify left :vertically-justify center - :items (,progress-text-instantiator - [layout - :margin-width 4 - :pixel-height progress-glyph-height - :orientation horizontal])] - locale)) - -(defvar progress-stack nil - "An alist of label/string pairs representing active progress gauges. -The first element in the list is currently displayed in the gutter area. -Do not modify this directly--use the `progress-feedback' or -`display-progress-feedback'/`clear-progress-feedback' functions.") - -(defun progress-feedback-displayed-p (&optional return-string frame) - "Return a non-nil value if a progress gauge is presently displayed in the -gutter area. If optional argument RETURN-STRING is non-nil, -return a string containing the message, otherwise just return t." - (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-feedback (&optional label frame no-restore) - "Remove any progress gauge with LABEL from the progress gauge-stack, -erasing it from the gutter area if it's currently displayed there. -If a message remains at the head of the progress-stack and NO-RESTORE -is nil, it will be displayed. The string which remains in the gutter -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-feedback-use-echo-area) - (clear-message label frame nil no-restore) - (or frame (setq frame (selected-frame))) - (remove-progress-feedback label frame) - (let ((inhibit-read-only t) - (zmacs-region-stays zmacs-region-stays)) ; preserve from change - (erase-buffer (get-buffer-create " *Gutter Area*"))) - (if no-restore - nil ; just preparing to put another msg up - (if progress-stack - (let ((oldmsg (cdr (car progress-stack)))) - (raw-append-progress-feedback oldmsg nil frame) - oldmsg) - ;; nothing to display so get rid of the gauge - (set-specifier bottom-gutter-border-width 0 frame) - (set-gutter-element-visible-p bottom-gutter-visible-p - 'progress nil frame))))) - -(defun progress-feedback-clear-when-idle (&optional label) - (add-one-shot-hook 'pre-idle-hook - `(lambda () - (clear-progress-feedback ',label)))) - -(defun remove-progress-feedback (&optional label frame) - ;; If label is nil, we want to remove all matching progress gauges. - (while (and progress-stack - (or (null label) ; null label means clear whole stack - (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-feedback-dispatch-non-command-events () - ;; don't allow errors to hose things - (condition-case t - ;; (sit-for 0) is too agressive and cause more display than we - ;; want. - (dispatch-non-command-events) - nil)) - -(defun append-progress-feedback (label message &optional value frame) - (or frame (setq frame (selected-frame))) - ;; Add a new entry to the message-stack, or modify an existing one - (let* ((top (car progress-stack)) - (tmsg (cdr top))) - (if (eq label (car top)) - (progn - (setcdr top message) - (if (equal tmsg message) - (progn - (set-instantiator-property progress-gauge-instantiator :value value) - (set-progress-feedback-instantiator (frame-selected-window frame))) - (raw-append-progress-feedback message value frame)) - (redisplay-gutter-area)) - (push (cons label message) progress-stack) - (raw-append-progress-feedback message value frame)) - (progress-feedback-dispatch-non-command-events) - ;; either get command events or sit waiting for them - (when (eq value 100) -; (sit-for progress-feedback-popup-period nil) - (clear-progress-feedback label)))) - -(defun abort-progress-feedback (label message &optional frame) - (if (or (not (valid-image-instantiator-format-p 'progress-gauge frame)) - progress-feedback-use-echo-area) - (display-message label (concat message "aborted.") frame) - (or frame (setq frame (selected-frame))) - ;; Add a new entry to the message-stack, or modify an existing one - (let* ((top (car progress-stack)) - (inhibit-read-only t) - (zmacs-region-stays zmacs-region-stays)) - (if (eq label (car top)) - (setcdr top message) - (push (cons label message) progress-stack)) - (unless (equal message "") - (insert-string message (get-buffer-create " *Gutter Area*")) - (let* ((gutter-string (copy-sequence "\n")) - (ext (make-extent 0 1 gutter-string))) - ;; do some funky display here. - (set-extent-begin-glyph ext progress-abort-glyph) - ;; fixup the gutter specifiers - (set-gutter-element bottom-gutter 'progress gutter-string frame) - (set-specifier bottom-gutter-border-width 2 frame) - (set-instantiator-property progress-text-instantiator :data message) - (set-progress-abort-instantiator (frame-selected-window 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. - (redisplay-gutter-area) - (sit-for progress-feedback-popup-period nil) - (clear-progress-feedback label frame) - (set-extent-begin-glyph ext progress-layout-glyph) - (set-gutter-element bottom-gutter 'progress gutter-string frame) - ))))) - -(defun raw-append-progress-feedback (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) - (set-instantiator-property progress-gauge-instantiator :value val) - (set-progress-feedback-instantiator (frame-selected-window frame)) - - (set-instantiator-property progress-text-instantiator :data message) - (set-progress-feedback-instantiator (frame-selected-window frame)) - (if (and (eq (specifier-instance bottom-gutter-height frame) - 'autodetect) - (gutter-element-visible-p bottom-gutter-visible-p - 'progress frame)) - ;; if the gauge is already visible then just draw the gutter - ;; checking for user events - (progn - (redisplay-gutter-area) - (progress-feedback-dispatch-non-command-events)) - ;; otherwise make the gutter visible and redraw the frame - (set-specifier bottom-gutter-height 'autodetect frame) - (set-gutter-element-visible-p bottom-gutter-visible-p - 'progress t frame) - ;; we have to do this so redisplay is up-to-date and so - ;; redisplay-gutter-area performs optimally. This may also - ;; make sure the frame geometry looks ok. - (progress-feedback-dispatch-non-command-events) - (redisplay-frame frame) - )))) - -(defun display-progress-feedback (label message &optional value frame) - "Display a progress gauge and message in the bottom gutter area. - First argument LABEL is an identifier for this message. MESSAGE is -the string to display. Use `clear-progress-feedback' to remove a labelled -message." - (cond ((eq value 'abort) - (abort-progress-feedback label message frame)) - ((or (not (valid-image-instantiator-format-p 'progress-gauge frame)) - progress-feedback-use-echo-area) - (display-message label - (concat message (if (eq value 100) "done." - (make-string (/ value 5) ?.))) - frame)) - (t - (append-progress-feedback label message value frame)))) - -(defun current-progress-feedback (&optional frame) - "Return the current progress gauge in the gutter area, or nil. -The FRAME argument is currently unused." - (cdr (car progress-stack))) - -;;; may eventually be frame-dependent -(defun current-progress-feedback-label (&optional frame) - (car (car progress-stack))) - -(defun progress-feedback (fmt &optional value &rest args) - "Print a progress gauge and message in the bottom gutter area of the frame. -The arguments are the same as to `format'. - -If the only argument is nil, clear any existing progress gauge." - (save-excursion - (if (and (null fmt) (null args)) - (prog1 nil - (clear-progress-feedback nil)) - (let ((str (apply 'format fmt args))) - (display-progress-feedback 'progress str value) - str)))) - -(defun progress-feedback-with-label (label fmt &optional value &rest args) - "Print a progress gauge and message in the bottom gutter area of the frame. -First argument LABEL is an identifier for this progress gauge. The rest of the -arguments are the same as to `format'." - ;; #### sometimes the buffer gets changed temporarily. I don't know - ;; why this is, so protect against it. - (save-excursion - (if (and (null fmt) (null args)) - (prog1 nil - (clear-progress-feedback label nil)) - (let ((str (apply 'format fmt args))) - (display-progress-feedback label str value) - str)))) + (when (valid-image-instantiator-format-p 'tab-control) + (set-image-instance-property (glyph-image-instance gutter-buffers-tab) + :items + (buffers-tab-items)) + (resize-subwindow (glyph-image-instance gutter-buffers-tab) + (gutter-pixel-width) nil))) + +(add-tab-to-gutter) +(add-hook 'switch-to-buffer-hooks 'update-tab-in-gutter) +(add-hook 'create-frame-hook 'update-tab-in-gutter) (provide 'gutter-items) ;;; gutter-items.el ends here. diff --git a/lisp/gutter.el b/lisp/gutter.el index a6dad1e..f4565a6 100644 --- a/lisp/gutter.el +++ b/lisp/gutter.el @@ -4,7 +4,7 @@ ;; Copyright (C) 1999, 2000 Andy Piper. ;; Maintainer: XEmacs Development Team -;; Keywords: frames, gui, internal, dumped +;; Keywords: frames, extensions, internal, dumped ;; This file is part of XEmacs. @@ -30,7 +30,7 @@ "Input from the gutters." :group 'environment) -;; Although these customizations appear bogus, they are necessary in +;; 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) @@ -60,16 +60,16 @@ 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 value &optional locale tag-set) - "Set GUTTER-SPECIFIER gutter element PROP to VALUE in optional LOCALE. +(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. -VALUE in general must be a string. If VALUE is a glyph then a string -will be created to put the glyph into." - (let ((spec value)) - (when (glyphp value) +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) value)) - (map-extents #'(lambda (extent arg) + (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))) @@ -85,13 +85,13 @@ This is a convenience function for removing gutter elements." 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. +GUTTER-SPECIFIER-VISIBLE-P in optional LOCALE. This is a convenience function for hiding and showing gutter elements." - (modify-specifier-instances + (modify-specifier-instances gutter-visible-specifier-p #'(lambda (spec prop visible-p) (if (consp spec) - (if visible-p - (if (memq prop spec) spec + (if visible-p + (if (memq prop spec) spec (cons prop spec)) (delq prop spec)) (if visible-p (list prop)))) @@ -108,76 +108,6 @@ non-nil if it is visible in optional DOMAIN." (or (and (listp spec) (memq 'buffers-tab spec)) spec))) -(defun set-gutter-dirty-p (gutter-or-location) - "Make GUTTER-OR-LOCATION dirty to force redisplay updates." - ;; set-glyph-image will not make the gutter dirty - (when (or (gutter-specifier-p gutter-or-location) - (eq gutter-or-location 'top) - (eq gutter-or-location 'bottom) - (eq gutter-or-location 'left) - (eq gutter-or-location 'right)) - (or (gutter-specifier-p gutter-or-location) - (setq gutter-or-location - (eval (intern (concat - (symbol-name gutter-or-location) - "-gutter"))))) - (set-specifier-dirty-flag gutter-or-location))) - -(defun make-gutter-specifier (spec-list) - "Return a new `gutter' specifier object with the given specification list. -SPEC-LIST can be a list of specifications (each of which is a cons of a -locale and a list of instantiators), a single instantiator, or a list -of instantiators. See `make-specifier' for more information about -specifiers. - -Gutter specifiers are used to specify the format of a gutter. -The values of the variables `default-gutter', `top-gutter', -`left-gutter', `right-gutter', and `bottom-gutter' are always -gutter specifiers. - -Valid gutter instantiators are called \"gutter descriptors\" and are -either strings or property-lists of strings. See `default-gutter' for -a description of the exact format." - (make-specifier-and-init 'gutter spec-list)) - -(defun make-gutter-size-specifier (spec-list) - "Return a new `gutter-size' specifier object with the given spec list. -SPEC-LIST can be a list of specifications (each of which is a cons of a -locale and a list of instantiators), a single instantiator, or a list -of instantiators. See `make-specifier' for more information about -specifiers. - -Gutter-size specifiers are used to specify the size of a gutter. The -values of the variables `default-gutter-size', `top-gutter-size', -`left-gutter-size', `right-gutter-size', and `bottom-gutter-size' are -always gutter-size specifiers. - -Valid gutter-size instantiators are either integers or the special -symbol 'autodetect. If a gutter-size is set to 'autodetect them the -size of the gutter will be adjusted to just accommodate the gutters -contents. 'autodetect only works for top and bottom gutters." - (make-specifier-and-init 'gutter-size spec-list)) - -(defun make-gutter-visible-specifier (spec-list) - "Return a new `gutter-visible' specifier object with the given spec list. -SPEC-LIST can be a list of specifications (each of which is a cons of a -locale and a list of instantiators), a single instantiator, or a list -of instantiators. See `make-specifier' for more information about -specifiers. - -Gutter-visible specifiers are used to specify the visibility of a -gutter. The values of the variables `default-gutter-visible-p', -`top-gutter-visible-p', `left-gutter-visible-p', -`right-gutter-visible-p', and `bottom-gutter-visible-p' are always -gutter-visible specifiers. - -Valid gutter-visible instantiators are t, nil or a list of symbols. -If a gutter-visible instantiator is set to a list of symbols, and the -corresponding gutter specification is a property-list strings, then -elements of the gutter specification will only be visible if the -corresponding symbol occurs in the gutter-visible instantiator." - (make-specifier-and-init 'gutter-visible spec-list)) - (defun init-gutter () "Initialize the gutter." ;; do nothing as yet. diff --git a/lisp/iso8859-1.el b/lisp/iso8859-1.el index 01a15eb..50bd40a 100644 --- a/lisp/iso8859-1.el +++ b/lisp/iso8859-1.el @@ -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 @@ -161,9 +161,9 @@ (setq pairs (cdr pairs))) (cons 'setq (cons 'iso8859/1-case-table - (list - (list 'quote - (list downcase nil nil nil)))))))) + (list (list 'purecopy + (list 'quote + (list downcase nil nil nil))))))))) (?\300 ?\340) ; Agrave (?\301 ?\341) ; Aacute diff --git a/lisp/movemail.el b/lisp/movemail.el index 1b183b8..5d4c18e 100644 --- a/lisp/movemail.el +++ b/lisp/movemail.el @@ -41,7 +41,7 @@ (if stuff (intern stuff) configure-mail-lock-method)) - "mail spool locking method used by this instance of XEmacs. + "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) diff --git a/lisp/msw-font-menu.el b/lisp/msw-font-menu.el index 194e6cd..23a2b6d 100644 --- a/lisp/msw-font-menu.el +++ b/lisp/msw-font-menu.el @@ -43,11 +43,12 @@ "Registry and encoding to use with font menu fonts.") (defvar mswindows-font-menu-junk-families - (mapconcat - #'identity - '("Symbol" - ) - "\\|") + (purecopy + (mapconcat + #'identity + '("Symbol" + ) + "\\|")) "A regexp matching font families which are uninteresting (e.g. cursor fonts).") (defvar mswindows-font-regexp-ascii nil @@ -176,13 +177,13 @@ or if you change your font path, you can call this to re-initialize the menus." (when (string-match mswindows-font-regexp name) (setq weight (match-string 2 name)) - (setq size (string-to-int (or (match-string 4 name) "0")))) + (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 (or (match-string 4 truename) "0")))) + (setq size (string-to-int (match-string 4 truename)))) (setq slant (match-string 5 truename))) (vector entry family size weight slant))) diff --git a/lisp/mule/auto-autoloads.el b/lisp/mule/auto-autoloads.el index 78c9da6..eaed7c8 100644 --- a/lisp/mule/auto-autoloads.el +++ b/lisp/mule/auto-autoloads.el @@ -1,7 +1,10 @@ ;;; 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) "mule-ccl" "mule/mule-ccl.el") +;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program declare-ccl-program ccl-dump ccl-compile ccl-program-p) "mule-ccl" "mule/mule-ccl.el") + +(autoload 'ccl-program-p "mule-ccl" "\ +T if OBJECT is a valid CCL compiled code." nil nil) (autoload 'ccl-compile "mule-ccl" "\ Return a compiled code of CCL-PROGRAM as a vector of integer." nil nil) @@ -12,233 +15,25 @@ Disassemble compiled CCL-CODE." nil nil) (autoload 'declare-ccl-program "mule-ccl" "\ Declare NAME as a name of CCL program. -This macro exists for backward compatibility. In the old version of -Emacs, to compile a CCL program which calls another CCL program not -yet defined, it must be declared as a CCL program in advance. But, -now CCL program names are resolved not at compile time but before -execution. - +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 has this form: - (BUFFER_MAGNIFICATION - CCL_MAIN_CODE - [ CCL_EOF_CODE ]) - -BUFFER_MAGNIFICATION is an integer value specifying the approximate -output buffer magnification size compared with the bytes of input data -text. If the value is zero, the CCL program can't execute `read' and -`write' commands. - -CCL_MAIN_CODE and CCL_EOF_CODE are CCL program codes. CCL_MAIN_CODE -executed at first. If there's no more input data when `read' command -is executed in CCL_MAIN_CODE, CCL_EOF_CODE is executed. If -CCL_MAIN_CODE is terminated, CCL_EOF_CODE is not executed. - -Here's the syntax of CCL program code in BNF notation. The lines -starting by two semicolons (and optional leading spaces) describe the -semantics. - -CCL_MAIN_CODE := CCL_BLOCK - -CCL_EOF_CODE := CCL_BLOCK - -CCL_BLOCK := STATEMENT | (STATEMENT [STATEMENT ...]) - -STATEMENT := - SET | IF | BRANCH | LOOP | REPEAT | BREAK | READ | WRITE | CALL - | TRANSLATE | END - -SET := (REG = EXPRESSION) - | (REG ASSIGNMENT_OPERATOR EXPRESSION) - ;; The following form is the same as (r0 = integer). - | integer - -EXPRESSION := ARG | (EXPRESSION OPERATOR ARG) - -;; Evaluate EXPRESSION. If the result is nonzeor, execute -;; CCL_BLOCK_0. Otherwise, execute CCL_BLOCK_1. -IF := (if EXPRESSION CCL_BLOCK_0 CCL_BLOCK_1) - -;; Evaluate EXPRESSION. Provided that the result is N, execute -;; CCL_BLOCK_N. -BRANCH := (branch EXPRESSION CCL_BLOCK_0 [CCL_BLOCK_1 ...]) - -;; Execute STATEMENTs until (break) or (end) is executed. -LOOP := (loop STATEMENT [STATEMENT ...]) - -;; Terminate the most inner loop. -BREAK := (break) - -REPEAT := - ;; Jump to the head of the most inner loop. - (repeat) - ;; Same as: ((write [REG | integer | string]) - ;; (repeat)) - | (write-repeat [REG | integer | string]) - ;; Same as: ((write REG [ARRAY]) - ;; (read REG) - ;; (repeat)) - | (write-read-repeat REG [ARRAY]) - ;; Same as: ((write integer) - ;; (read REG) - ;; (repeat)) - | (write-read-repeat REG integer) - -READ := ;; Set REG_0 to a byte read from the input text, set REG_1 - ;; to the next byte read, and so on. - (read REG_0 [REG_1 ...]) - ;; Same as: ((read REG) - ;; (if (REG OPERATOR ARG) CCL_BLOCK_0 CCL_BLOCK_1)) - | (read-if (REG OPERATOR ARG) CCL_BLOCK_0 CCL_BLOCK_1) - ;; Same as: ((read REG) - ;; (branch REG CCL_BLOCK_0 [CCL_BLOCK_1 ...])) - | (read-branch REG CCL_BLOCK_0 [CCL_BLOCK_1 ...]) - ;; Read a character from the input text while parsing - ;; multibyte representation, set REG_0 to the charset ID of - ;; the character, set REG_1 to the code point of the - ;; character. If the dimension of charset is two, set REG_1 - ;; to ((CODE0 << 8) | CODE1), where CODE0 is the first code - ;; point and CODE1 is the second code point. - | (read-multibyte-character REG_0 REG_1) - -WRITE := - ;; Write REG_0, REG_1, ... to the output buffer. If REG_N is - ;; a multibyte character, write the corresponding multibyte - ;; representation. - (write REG_0 [REG_1 ...]) - ;; Same as: ((r7 = EXPRESSION) - ;; (write r7)) - | (write EXPRESSION) - ;; Write the value of `integer' to the output buffer. If it - ;; is a multibyte character, write the corresponding multibyte - ;; representation. - | (write integer) - ;; Write the byte sequence of `string' as is to the output - ;; buffer. It is encoded by binary coding system, thus, - ;; by this operation, you cannot write multibyte string - ;; as it is. - | (write string) - ;; Same as: (write string) - | string - ;; Provided that the value of REG is N, write Nth element of - ;; ARRAY to the output buffer. If it is a multibyte - ;; character, write the corresponding multibyte - ;; representation. - | (write REG ARRAY) - ;; Write a multibyte representation of a character whose - ;; charset ID is REG_0 and code point is REG_1. If the - ;; dimension of the charset is two, REG_1 should be ((CODE0 << - ;; 8) | CODE1), where CODE0 is the first code point and CODE1 - ;; is the second code point of the character. - | (write-multibyte-character REG_0 REG_1) - -;; Call CCL program whose name is ccl-program-name. -CALL := (call ccl-program-name) - -;; Terminate the CCL program. -END := (end) - -;; CCL registers that can contain any integer value. As r7 is also -;; used by CCL interpreter, its value is changed unexpectedly. -REG := r0 | r1 | r2 | r3 | r4 | r5 | r6 | r7 - -ARG := REG | integer - -OPERATOR := - ;; Normal arithmethic operators (same meaning as C code). - + | - | * | / | % - - ;; Bitwize operators (same meaning as C code) - | & | `|' | ^ - - ;; Shifting operators (same meaning as C code) - | << | >> - - ;; (REG = ARG_0 <8 ARG_1) means: - ;; (REG = ((ARG_0 << 8) | ARG_1)) - | <8 - - ;; (REG = ARG_0 >8 ARG_1) means: - ;; ((REG = (ARG_0 >> 8)) - ;; (r7 = (ARG_0 & 255))) - | >8 - - ;; (REG = ARG_0 // ARG_1) means: - ;; ((REG = (ARG_0 / ARG_1)) - ;; (r7 = (ARG_0 % ARG_1))) - | // - - ;; Normal comparing operators (same meaning as C code) - | < | > | == | <= | >= | != - - ;; If ARG_0 and ARG_1 are higher and lower byte of Shift-JIS - ;; code, and CHAR is the corresponding JISX0208 character, - ;; (REG = ARG_0 de-sjis ARG_1) means: - ;; ((REG = CODE0) - ;; (r7 = CODE1)) - ;; where CODE0 is the first code point of CHAR, CODE1 is the - ;; second code point of CHAR. - | de-sjis - - ;; If ARG_0 and ARG_1 are the first and second code point of - ;; JISX0208 character CHAR, and SJIS is the correponding - ;; Shift-JIS code, - ;; (REG = ARG_0 en-sjis ARG_1) means: - ;; ((REG = HIGH) - ;; (r7 = LOW)) - ;; where HIGH is the higher byte of SJIS, LOW is the lower - ;; byte of SJIS. - | en-sjis - -ASSIGNMENT_OPERATOR := - ;; Same meaning as C code - += | -= | *= | /= | %= | &= | `|=' | ^= | <<= | >>= - - ;; (REG <8= ARG) is the same as: - ;; ((REG <<= 8) - ;; (REG |= ARG)) - | <8= - - ;; (REG >8= ARG) is the same as: - ;; ((r7 = (REG & 255)) - ;; (REG >>= 8)) - - ;; (REG //= ARG) is the same as: - ;; ((r7 = (REG % ARG)) - ;; (REG /= ARG)) - | //= - -ARRAY := `[' integer ... `]' - - -TRANSLATE := - (translate-character REG(table) REG(charset) REG(codepoint)) - | (translate-character SYMBOL REG(charset) REG(codepoint)) -MAP := - (iterate-multiple-map REG REG MAP-IDs) - | (map-multiple REG REG (MAP-SET)) - | (map-single REG REG MAP-ID) -MAP-IDs := MAP-ID ... -MAP-SET := MAP-IDs | (MAP-IDs) MAP-SET -MAP-ID := integer -" nil 'macro) +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 CCL program, return +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. - -See the documentation of `define-ccl-program' for the detail of CCL program." nil nil) +The return value is a vector of resulting CCL registers." nil nil) ;;;*** diff --git a/lisp/mule/chinese.el b/lisp/mule/chinese.el index 7ab691e..a4fd892 100644 --- a/lisp/mule/chinese.el +++ b/lisp/mule/chinese.el @@ -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 @@ -255,33 +236,33 @@ ;; (setq font-ccl-encoder-alist ;; (cons (cons "big5" ccl-encode-big5-font) font-ccl-encoder-alist)) -(set-charset-ccl-program 'chinese-big5-1 'ccl-encode-big5-font) -(set-charset-ccl-program 'chinese-big5-2 'ccl-encode-big5-font) +(set-charset-ccl-program 'chinese-big5-1 ccl-encode-big5-font) +(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 --git a/lisp/mule/ethiopic.el b/lisp/mule/ethiopic.el deleted file mode 100644 index 66e08ed..0000000 --- a/lisp/mule/ethiopic.el +++ /dev/null @@ -1,81 +0,0 @@ -;;; ethiopic.el --- Support for Ethiopic -*- coding: iso-2022-7bit; -*- - -;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN. -;; Licensed to the Free Software Foundation. -;; Copyright (C) 1997 MORIOKA Tomohiko - -;; Keywords: multilingual, Ethiopic - -;; 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: TAKAHASHI Naoto -;; modified by MORIOKA Tomohiko for XEmacs. - -;;; Code: - -;; Ethiopic -(make-charset 'ethiopic "Ethiopic" - '(registry "Ethio" - dimension 2 - chars 94 - final ?3 - graphic 0 - )) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; ETHIOPIC -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(define-category ?E "Ethiopic (Ge'ez) character.") -(modify-category-entry 'ethiopic ?E) - -(define-ccl-program ccl-encode-ethio-font - '(0 - ;; In: R0:ethiopic (not checked) - ;; R1:position code 1 - ;; R2:position code 2 - ;; Out: R1:font code point 1 - ;; R2:font code point 2 - ((r1 -= 33) - (r2 -= 33) - (r1 *= 94) - (r2 += r1) - (if (r2 < 256) - (r1 = ?\x12) - (if (r2 < 448) - ((r1 = ?\x13) (r2 -= 256)) - ((r1 = ?\xfd) (r2 -= 208)) - )))) - "CCL program to encode an Ethiopic code to code point of Ethiopic font.") - -;; (setq font-ccl-encoder-alist -;; (cons (cons "ethiopic" ccl-encode-ethio-font) font-ccl-encoder-alist)) -(set-charset-ccl-program 'ethiopic 'ccl-encode-ethio-font) - -(set-language-info-alist - "Ethiopic" '((setup-function . setup-ethiopic-environment-internal) - (exit-function . exit-ethiopic-environment) - (charset ethiopic) - (coding-system iso-2022-7bit) - (coding-priority iso-2022-7bit) - (input-method . "ethiopic") - (features ethio-util) - (sample-text . "$(3$Q#U!.(B") - (documentation . t))) - -;;; ethiopic.el ends here diff --git a/lisp/mule/japanese.el b/lisp/mule/japanese.el index 42b2207..fbc7328 100644 --- a/lisp/mule/japanese.el +++ b/lisp/mule/japanese.el @@ -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. @@ -125,11 +125,8 @@ ;; (setq egg-default-startup-file "eggrc-wnn") (setq-default its:*current-map* (its:get-mode-map "roma-kana")))) -;; stuff for providing grammatic processing of Japanese text +;; stuff for providing gramatic processing of Japanese text ;; something like this should probably be created for all environments... -;; #### Arrgh. This stuff should defvar'd in either fill.el or kinsoku.el. -;; Then the language environment should set these things, probably buffer- -;; locally. (defvar aletter (concat "\\(" ascii-char "\\|" kanji-char "\\)")) (defvar kanji-space-insertable (concat @@ -140,7 +137,6 @@ ascii-alphanumeric kanji-kanji-char "\\|" kanji-kanji-char ascii-alphanumeric )) -;; #### will be moved to fill.el (defvar space-insertable (concat " " aletter "\\|" kanji-space-insertable) "Regexp for finding points that can have spaces inserted into them for justification") @@ -148,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 @@ -165,47 +160,26 @@ mnemonic "MULE/7bit" )) -(define-coding-system-alias 'junet 'iso-2022-jp) - -;; (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))) +(copy-coding-system 'iso-2022-jp 'junet) ;; (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 @@ -218,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 @@ -243,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:]FAJ(B") + (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 --git a/lisp/mule/misc-lang.el b/lisp/mule/misc-lang.el index b0f9ff3..236f9b0 100644 --- a/lisp/mule/misc-lang.el +++ b/lisp/mule/misc-lang.el @@ -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 --git a/lisp/mule/mule-category.el b/lisp/mule/mule-category.el index 3757302..bcc1e03 100644 --- a/lisp/mule/mule-category.el +++ b/lisp/mule/mule-category.el @@ -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. @@ -19,7 +17,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. @@ -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 @@ Categories are given by their designators." "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)) @@ -79,21 +77,21 @@ Categories are given by their designators." (check-argument-type 'defined-category-p designator) (gethash designator defined-category-hashtable)) -(defun modify-category-entry (char-range designator &optional category-table reset) +(defun modify-category-entry (char-range designator &optional table reset) "Add a category to the categories associated with CHAR-RANGE. CHAR-RANGE is a single character or a range of characters, as per `put-char-table'. The category is given by a designator character. -The changes are made in CATEGORY-TABLE, which defaults to the current - buffer's category table. +The changes are made in TABLE, which defaults to the current buffer's + category table. If optional fourth argument RESET is non-nil, previous categories associated with CHAR-RANGE are removed before adding the specified category." - (or category-table (setq category-table (category-table))) - (check-argument-type 'category-table-p category-table) + (or table (setq table (category-table))) + (check-argument-type 'category-table-p table) (check-argument-type 'defined-category-p designator) (if reset ;; clear all existing stuff. - (put-char-table char-range nil category-table)) + (put-char-table char-range nil table)) (map-char-table #'(lambda (key value) ;; make sure that this range has a bit-vector assigned to it @@ -103,25 +101,25 @@ If optional fourth argument RESET is non-nil, previous categories associated ;; set the appropriate bit in that vector. (aset value (- designator 32) 1) ;; put the vector back, thus assuring we have a unique setting for this range - (put-char-table key value category-table)) - category-table char-range)) + (put-char-table key value table)) + table char-range)) -(defun char-category-list (character &optional category-table) - "Return a list of the categories that CHARACTER is in. -CATEGORY-TABLE defaults to the current buffer's category table. +(defun char-category-list (char &optional table) + "Return a list of the categories that CHAR is in. +TABLE defaults to the current buffer's category table. The categories are given by their designators." - (or category-table (setq category-table (category-table))) - (check-argument-type 'category-table-p category-table) - (let ((vec (get-char-table character category-table))) + (or table (setq table (category-table))) + (check-argument-type 'category-table-p table) + (let ((vec (get-char-table char table))) (if (null vec) nil (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 @@ The categories are given by their designators." "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 @@ Each element is a list of a charset, a designator, and maybe a doc string.") (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,30 +255,8 @@ Each element is a list of a charset, a designator, and maybe a doc string.") (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'. -;;; #### SJT this needs to be set by language environments and probably should -;;; be buffer-local---strategy for dealing with this: check all $language.el -;;; files and also mule-base/$language-utils.el files for variables set; -;;; these should be made buffer local and some kind of a- or p-list of vars -;;; to be set for a language environment created. (defvar word-across-newline "\\(\\cj\\|\\cc\\|\\ct\\)" "Regular expression of such characters which can be a word across newline.") diff --git a/lisp/mule/mule-charset.el b/lisp/mule/mule-charset.el index 9dd8fef..6e3c366 100644 --- a/lisp/mule/mule-charset.el +++ b/lisp/mule/mule-charset.el @@ -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. - -;;; Commentary: + +;;;; Composite character support -;; These functions are not compatible at the bytecode level with Emacs/Mule, -;; and they never will be. -sb [1999-05-26] +(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))) + +(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 @@ -75,12 +97,12 @@ BUFFER defaults to the current buffer if omitted." ;;;; Charset accessors -(defun charset-iso-graphic-plane (charset) +(defun charset-graphic (charset) "Return the `graphic' property of CHARSET. See `make-charset'." (charset-property charset 'graphic)) -(defun charset-iso-final-char (charset) +(defun charset-final (charset) "Return the final byte of the ISO 2022 escape sequence designating CHARSET." (charset-property charset 'final)) @@ -88,21 +110,16 @@ See `make-charset'." "Return the number of characters per dimension of CHARSET." (charset-property charset 'chars)) -(defun charset-width (charset) +(defun charset-columns (charset) "Return the number of display columns per character of CHARSET. This only applies to TTY mode (under X, the actual display width can 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 @@ -114,148 +131,12 @@ that can display the characters in CHARSET." See `make-charset'." (charset-property charset 'ccl-program)) -(defun charset-bytes (charset) - "Useless in XEmacs, returns 1." - 1) - -(define-obsolete-function-alias 'charset-columns 'charset-width) ;; 19990409 -(define-obsolete-function-alias 'charset-final 'charset-iso-final-char) ;; 19990409 -(define-obsolete-function-alias 'charset-graphic 'charset-iso-graphic-plane) ;; 19990409 -(define-obsolete-function-alias 'charset-doc-string 'charset-description) ;; 19990409 +(defun charset-leading-byte (charset) + "Return the leading byte of CHARSET. +See `make-charset'." + (charset-property charset 'leading-byte)) ;;;; Define setf methods for all settable Charset properties (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 --git a/lisp/mule/mule-cmds.el b/lisp/mule/mule-cmds.el index c63bc97..832bf97 100644 --- a/lisp/mule/mule-cmds.el +++ b/lisp/mule/mule-cmds.el @@ -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 @@ -23,28 +23,33 @@ ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. -;; Note: Some of the code here is now in code-cmds.el - ;;; Code: ;;; MULE related key bindings and menus. -(require 'code-cmds) +(defvar mule-keymap (make-sparse-keymap "MULE") + "Keymap for MULE (Multilingual environment) specific commands.") -;; Preserve the old name -(defvaralias 'mule-keymap 'coding-keymap) +;; Keep "C-x C-m ..." for mule specific commands. +(define-key ctl-x-map "\C-m" mule-keymap) -(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 "f" 'set-buffer-file-coding-system) +(define-key mule-keymap "F" 'set-default-buffer-file-coding-system) ; XEmacs +(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 "\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. @@ -58,218 +63,205 @@ ;; 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 (eq eol-type orig-eol-type) - coding-system - (setq orig-eol-type (coding-system-eol-type base)) - (if (null orig-eol-type) - (coding-system-property base eol-type)))))))) - -;; (defun coding-system-change-text-conversion (coding-system coding) -;; "Return a coding system which differs from CODING-SYSTEM in text conversion. -;; 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* ((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))) + (let ((coding-system-for-read coding-system) + (coding-system-for-write coding-system)) + (message "") + (call-interactively cmd)))) + +(defun set-default-coding-systems (coding-system) + "Set default value of various coding systems to CODING-SYSTEM. +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" + (check-coding-system coding-system) + ;;(setq-default buffer-file-coding-system coding-system) + (set-default-buffer-file-coding-system coding-system) + ;;(setq default-terminal-coding-system coding-system) + (setq terminal-coding-system coding-system) + ;;(setq default-keyboard-coding-system coding-system) + (setq keyboard-coding-system coding-system) + ;;(setq default-process-coding-system (cons coding-system coding-system)) + (add-hook 'comint-exec-hook + `(lambda () + (let ((proc (get-buffer-process (current-buffer)))) + (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 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 subprocess I/O" + (interactive "zPrefer 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)) + (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 (or parent coding-system)) + (if (not (eq coding-category (car coding-category-list))) + ;; We must change the order. + (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)))) + -;;; 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 - - 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))) +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.") + +(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'. + +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. -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))) +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))) - -(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 -`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 + ;; 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 - '("%_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))))) + `(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)))) + )) + + (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 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. @@ -284,7 +276,7 @@ Emacs loads this file at startup time.") ";;; %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: @@ -329,13 +321,10 @@ If nil, that means no input method is activated now.") (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.") @@ -359,40 +348,26 @@ This function is called with no argument.") (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.") - -(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. + (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 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) @@ -412,41 +387,30 @@ The return value is a string." ;; 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." @@ -462,12 +426,12 @@ If INPUT-METHOD is nil, deactivate any current input method." (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 @@ -479,35 +443,28 @@ This also sets the default input method to the one you specify." (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): "))) @@ -527,11 +484,12 @@ The default is to use the most recent input method specified (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 @@ -541,51 +499,37 @@ to be activated instead of the one selected last time. It is a symbol 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. - -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. +area. -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) @@ -599,53 +543,22 @@ just activated.") "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 behavior of an input method on invalid key input. + "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) @@ -655,272 +568,30 @@ This hook is mainly used for canceling the effect of (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-7 iso-2022-7bit - no-conversion raw-text - utf-8 utf-8 - iso-8-1 iso-8859-1 - iso-8-2 ctext (iso-8859-1 alias) - iso-8-designate ctext (iso-8859-1 alias) - iso-lock-shift iso-2022-lock - shift-jis shift_jis - big5 big5 - ucs-4 iso-10646-ucs-4 -" -;; The old table (from FSF synch?) was not what we use (cf mule-coding.el), -;; and as documented iso-8-designate is inconsistent with iso-2022-8bit-ss2. -;; 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) - - (set-coding-category-system 'iso-7 'iso-2022-7) - (set-coding-category-system 'iso-8-1 'iso-8859-1) - (set-coding-category-system 'iso-8-2 'ctext) - (set-coding-category-system 'iso-lock-shift 'iso-2022-lock) - (set-coding-category-system 'iso-8-designate 'ctext) - (set-coding-category-system 'no-conversion 'raw-text) - (set-coding-category-system 'shift-jis 'shift_jis) - (set-coding-category-system 'big5 'big5) - ;; #### Can we now assume the existence of the 10646 coding systems? - ;; #### These lists need to be synched with the ones in mule-coding.el. - (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-7 - no-conversion - utf-8 - iso-8-1 - iso-8-2 - iso-8-designate - iso-lock-shift - shift-jis - big5 - ucs-4)) - ) - (t - (set-coding-priority-list - '(iso-7 - no-conversion - iso-8-1 - iso-8-2 - iso-8-designate - iso-lock-shift - 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. - -Note that `coding-priority-list' is not reset first; thus changing language -environment allows recognition of coding systems from previously set language -environments. (This will not work if the desired coding systems are from the -same category. E.g., starting with a Hebrew language environment, ISO 8859-8 -will be recognized. If you shift to Russian, ISO 8859-8 will be shadowed by -ISO 8859-5, and cannot be automatically recognized without resetting the -language environment to Hebrew. However, if you shift from Japanese to -Russian, ISO-2022-JP will continue to be automatically recognized, since -ISO-8859-5 and ISO-2022-JP are different coding categories.)" - (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: @@ -940,7 +611,7 @@ ISO-8859-5 and ISO-2022-JP are different coding categories.)" (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) @@ -950,9 +621,8 @@ ISO-8859-5 and ISO-2022-JP are different coding categories.)" (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))) @@ -961,15 +631,9 @@ ISO-8859-5 and ISO-2022-JP are different coding categories.)" (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))))) @@ -992,14 +656,9 @@ ISO-8859-5 and ISO-2022-JP are different coding categories.)" (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 @@ -1019,7 +678,7 @@ ISO-8859-5 and ISO-2022-JP are different coding categories.)" (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))) @@ -1040,70 +699,8 @@ It can be retrieved with `(get-char-code-property CHAR PROPNAME)'." (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 --git a/lisp/mule/mule-coding.el b/lisp/mule/mule-coding.el index 0608850..3880c18 100644 --- a/lisp/mule/mule-coding.el +++ b/lisp/mule/mule-coding.el @@ -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. @@ -31,7 +31,8 @@ (defun coding-system-force-on-output (coding-system register) "Return the 'force-on-output property of CODING-SYSTEM for the specified REGISTER." - (check-type register integer) + (unless (integerp register) + (signal 'wrong-type-argument (list 'integerp register))) (coding-system-property coding-system (case register @@ -174,19 +175,9 @@ ;; initialize the coding categories to something semi-reasonable ;; so that the remaining Lisp files can contain extended characters. ;; (They will be in ISO-7 format) -;; #### This list needs to be synched with the ones in mule-cmds.el. - -(set-coding-priority-list '(iso-7 - no-conversion - ;; utf-8 - iso-8-1 - iso-8-2 - iso-8-designate - iso-lock-shift - shift-jis - big5 - ;; ucs-4 - )) + +(set-coding-priority-list '(iso-8-2 iso-8-designate iso-8-1 + iso-7 iso-lock-shift no-conversion)) (set-coding-category-system 'iso-7 'iso-2022-7) (set-coding-category-system 'iso-8-designate 'ctext) @@ -194,6 +185,4 @@ (set-coding-category-system 'iso-lock-shift 'iso-2022-lock) (set-coding-category-system 'no-conversion 'no-conversion) -(setq-default buffer-file-coding-system 'iso-2022-8) - ;;; mule-coding.el ends here diff --git a/lisp/mule/mule-files.el b/lisp/mule/mule-files.el new file mode 100644 index 0000000..e228426 --- /dev/null +++ b/lisp/mule/mule-files.el @@ -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 --git a/lisp/mule/thai-xtis-chars.el b/lisp/mule/thai-xtis-chars.el deleted file mode 100644 index 27226b1..0000000 --- a/lisp/mule/thai-xtis-chars.el +++ /dev/null @@ -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 --git a/lisp/mule/thai-xtis.el b/lisp/mule/thai-xtis.el deleted file mode 100644 index 1036597..0000000 --- a/lisp/mule/thai-xtis.el +++ /dev/null @@ -1,365 +0,0 @@ -;;; thai-xtis.el --- Support for Thai (XTIS) -*- coding: iso-2022-7bit; -*- - -;; Copyright (C) 1999 Electrotechnical Laboratory, JAPAN. -;; Licensed to the Free Software Foundation. - -;; Author: TAKAHASHI Naoto -;; MORIOKA Tomohiko -;; Created: 1998-03-27 for Emacs-20.3 by TAKAHASHI Naoto -;; 1999-03-29 imported and modified for XEmacs by 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: - -(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)))) - - (put-charset-property 'thai-xtis 'preferred-coding-system 'tis-620) - ) - -;; 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 | - - -(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)))) - -(define-ccl-program ccl-thai-xtis-consonant - '(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)))))) - -(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)))))))) - -(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)))))))) - -(define-ccl-program ccl-thai-xtis-tone - '(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) - (r1 = 0)) - ((r5 = r1) (r6 = ((r0 - #xE6) | r2)) (call ccl-thai-xtis-write) - (r1 = 0) - (r2 = 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 - (if (r1 == 0) - (write r0) - (if (r2 == 0) - ((r5 = r1) (r6 = r3) (call ccl-thai-xtis-write) - (write r0) - (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)))))) - -(define-ccl-program ccl-decode-thai-xtis - `(4 - ((read r0) - (r1 = 0) - (r2 = 0) - (r3 = #x30) - (r4 = ,(charset-id 'thai-xtis)) - (loop - (if (r0 < 161) - (call ccl-thai-xtis-ascii) - (branch (r0 - 161) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-consonant) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-vowel-d1) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-vowel) - (call ccl-thai-xtis-vowel) - (call ccl-thai-xtis-vowel) - (call ccl-thai-xtis-vowel) - (call ccl-thai-xtis-vowel) - (call ccl-thai-xtis-vowel) - (call ccl-thai-xtis-vowel) - nil - nil - nil - nil - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-tone) - (call ccl-thai-xtis-tone) - (call ccl-thai-xtis-tone) - (call ccl-thai-xtis-tone) - (call ccl-thai-xtis-tone) - (call ccl-thai-xtis-tone) - (call ccl-thai-xtis-tone) - (call ccl-thai-xtis-vowel-ee) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - (call ccl-thai-xtis-symbol) - nil - nil - nil)) - (read r0) - (repeat))) - - (call ccl-thai-xtis-eof))) - -) - -(defconst leading-code-private-21 #x9F) - -(define-ccl-program ccl-encode-thai-xtis - `(1 - ((read r0) - (loop - (if (r0 == ,leading-code-private-21) - ((read r1) - (if (r1 == ,(charset-id 'thai-xtis)) - ((read r0) - (write r0) - (read r0) - (r1 = (r0 & 7)) - (r0 = ((r0 - #xB0) >> 3)) - (if (r0 != 0) - (write r0 [0 209 212 213 214 215 216 217 218 238])) - (if (r1 != 0) - (write r1 [0 231 232 233 234 235 236 237])) - (read r0) - (repeat)) - ((write r0 r1) - (read r0) - (repeat)))) - (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 4 ?T "external=tis620, internal=thai-xtis" - '(ccl-decode-thai-xtis . ccl-encode-thai-xtis) - '((safe-charsets . t))) - ) - - -(set-language-info-alist - "Thai-XTIS" - '((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))) - -;; thai-xtis.el ends here. diff --git a/lisp/mule/vietnamese.el b/lisp/mule/vietnamese.el deleted file mode 100644 index a3f6540..0000000 --- a/lisp/mule/vietnamese.el +++ /dev/null @@ -1,298 +0,0 @@ -;;; vietnamese.el --- Support for Vietnamese -*- coding: iso-2022-7bit; -*- - -;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. -;; Licensed to the Free Software Foundation. -;; Copyright (C) 1997 MORIOKA Tomohiko - -;; Keywords: multilingual, Vietnamese - -;; 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 Vietnames, the character sets VISCII and VSCII are supported. - -;;; Code: - -(eval-and-compile - -(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 - 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 ] - "Vietnamese VISCII decoding table.") - -(defvar viet-viscii-encode-table - (let ((table-lower (make-vector 128 0)) - (table-upper (make-vector 128 0)) - (i 0) - char-component) - (while (< i 256) - (setq char-component - (split-char (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) - (aset table-upper (nth 1 char-component) i))) - (setq i (1+ i))) - (cons table-lower table-upper)) - "Vietnamese VISCII encoding table. -Cons of tables for encoding lower-case chars and upper-case characters. -Both tables are indexed by the position code of Vietnamese characters.") - -(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 - 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] - "Vietnamese VSCII decoding table.") - -(defvar viet-vscii-encode-table - (let ((table-lower (make-vector 128 0)) - (table-upper (make-vector 128 0)) - (i 0) - char-component) - (while (< i 256) - (setq char-component - (split-char (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) - (aset table-upper (nth 1 char-component) i))) - (setq i (1+ i))) - (cons table-lower table-upper)) - "Vietnamese VSCII encoding table. -Cons of tables for encoding lower-case chars and upper-case characters. -Both tables are indexed by the position code of Vietnamese characters.") - -) - -(define-ccl-program ccl-decode-viscii - `(3 - ((read r0) - (loop - (write-read-repeat r0 ,viet-viscii-decode-table)) - )) - "CCL program to decode VISCII 1.1") - -;; Multibyte form of a Vietnamese character is as follows (3-byte): -;; LEADING-CODE-PRIVATE-11 LEADING-CODE-EXTENDED-11 POSITION-CODE -;; where LEADING-CODE-EXTENDED-11 for Vietnamese is -;; `vietnamese-viscii-lower' or `vietnamese-viscii-upper'. - -(defvar leading-code-private-11 #x9E) - -(define-ccl-program ccl-encode-viscii - `(1 - ((read r0) - (loop - (if (r0 < 128) - ;; ASCII - (write-read-repeat r0) - ;; not ASCII - (if (r0 != ,leading-code-private-11) - ;; not Vietnamese - (write-read-repeat r0) - ((read-if (r0 == ,(charset-id 'vietnamese-viscii-lower)) - (;; Vietnamese lower - (read r0) - (r0 -= 128) - (write-read-repeat r0 ,(car viet-viscii-encode-table))) - (if (r0 == ,(charset-id 'vietnamese-viscii-upper)) - (;; Vietnamese upper - (read r0) - (r0 -= 128) - (write-read-repeat r0 ,(cdr viet-viscii-encode-table))) - ;; not Vietnamese - (write-read-repeat r0))))))))) - "CCL program to encode VISCII 1.1") - -(define-ccl-program ccl-encode-viscii-font - `(0 - ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper - ;; R1:position code - ;; Out: R1:font code point - (if (r0 == ,(charset-id 'vietnamese-viscii-lower)) - (r1 = r1 ,(car viet-viscii-encode-table)) - (r1 = r1 ,(cdr viet-viscii-encode-table))) - ) - "CCL program to encode Vietnamese chars to VISCII 1.1 font") - -(define-ccl-program ccl-decode-vscii - `(3 - ((read r0) - (loop - (write-read-repeat r0 ,viet-vscii-decode-table)) - )) - "CCL program to decode VSCII-1.") - -(define-ccl-program ccl-encode-vscii - `(1 - ((read r0) - (loop - (if (r0 < 128) - ;; ASCII - (write-read-repeat r0) - ;; not ASCII - (if (r0 != ,leading-code-private-11) - ;; not Vietnamese - (write-read-repeat r0) - (read-if (r0 == ,(charset-id 'vietnamese-viscii-lower)) - (;; Vietnamese lower - (read r0) - (r0 -= 128) - (write-read-repeat r0 ,(car viet-vscii-encode-table))) - (if (r0 == ,(charset-id 'vietnamese-viscii-upper)) - (;; Vietnamese upper - (read r0) - (r0 -= 128) - (write-read-repeat r0 ,(cdr viet-vscii-encode-table))) - ;; not Vietnamese - (write-read-repeat r0)))))))) - "CCL program to encode VSCII-1.") - -(define-ccl-program ccl-encode-vscii-font - `(0 - ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper - ;; R1:position code - ;; Out: R1:font code point - (if (r0 == ,(charset-id 'vietnamese-viscii-lower)) - (r1 = r1 ,(car viet-vscii-encode-table)) - (r1 = r1 ,(cdr viet-vscii-encode-table))) - ) - "CCL program to encode Vietnamese chars to VSCII-1 font.") - - -(make-coding-system - 'viscii 'ccl - "Coding-system used for VISCII 1.1." - `(mnemonic "VISCII" - 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)))) - -;; (define-coding-system-alias 'viscii 'vietnamese-viscii) - -(make-coding-system - 'vscii 'ccl - "Coding-system used for VSCII 1.1." - `(mnemonic "VSCII" - decode ccl-decode-vscii - encode ccl-encode-vscii)) - -;; (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)))) - -;; (define-coding-system-alias 'vscii 'vietnamese-vscii) - -(make-coding-system - 'viqr 'no-conversion - "Coding-system used for VIQR." - '(mnemonic "VIQR" - eol-type lf - post-read-conversion viqr-post-read-conversion - pre-write-conversion viqr-pre-write-conversion)) - -;; (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)))) - -;; (define-coding-system-alias 'viqr 'vietnamese-viqr) - -;; For VISCII users -(set-charset-ccl-program 'vietnamese-viscii-lower - 'ccl-encode-viscii-font) -(set-charset-ccl-program 'vietnamese-viscii-upper - 'ccl-encode-viscii-font) -;; For VSCII users -(set-charset-ccl-program 'vietnamese-viscii-lower 'ccl-encode-vscii-font) -(set-charset-ccl-program 'vietnamese-viscii-upper 'ccl-encode-vscii-font) - -;; (setq font-ccl-encoder-alist -;; (cons (cons "viscii" ccl-encode-viscii-font) font-ccl-encoder-alist)) - -;; (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") - (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)") - )) - -;;; vietnamese.el ends here diff --git a/lisp/obsolete.el b/lisp/obsolete.el index 4970f11..a205c6b 100644 --- a/lisp/obsolete.el +++ b/lisp/obsolete.el @@ -57,7 +57,7 @@ This makes referencing or setting OLDVAR equivalent to referencing or setting NEWVAR and marks OLDVAR as obsolete. If OLDVAR was bound and NEWVAR was not, Set NEWVAR to OLDVAR. -Note: Use this before any other references (defvar/defcustom) to NEWVAR." +Note: Use this before any other references (defvar/defcustom) to NEWVAR" (let ((needs-setting (and (boundp oldvar) (not (boundp newvar)))) (value (and (boundp oldvar) (symbol-value oldvar)))) (defvaralias oldvar newvar) @@ -106,8 +106,6 @@ setting NEWVAR and marks OLDVAR as provided for compatibility only." (make-obsolete 'set-window-dot 'set-window-point) (define-obsolete-function-alias 'extent-buffer 'extent-object) -(define-compatible-variable-alias 'parse-sexp-lookup-properties - 'lookup-syntax-properties) ;;;;;;;;;;;;;;;;;;;;;;;;;;;; frames (defun frame-first-window (frame) @@ -173,10 +171,6 @@ If you want to change the locations where XEmacs looks for info files, 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) @@ -221,8 +215,8 @@ set Info-directory-list.") (defun add-menu (menu-path menu-name menu-items &optional before) "See the function `add-submenu'." - (or menu-name (error "must specify a menu name")) - (or menu-items (error "must specify some menu items")) + (or menu-name (error (gettext "must specify a menu name"))) + (or menu-items (error (gettext "must specify some menu items"))) (add-submenu menu-path (cons menu-name menu-items) before)) ;; Can't make this obsolete. easymenu depends on it. (make-compatible 'add-menu 'add-submenu) @@ -248,22 +242,12 @@ set Info-directory-list.") (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... (make-obsolete-variable 'executing-macro 'executing-kbd-macro) -(define-compatible-function-alias 'interactive-form - 'function-interactive) ;GNU 21.1 -(define-compatible-function-alias 'assq-delete-all - 'remassq) ;GNU 21.1 - ;;;;;;;;;;;;;;;;;;;;;;;;;;;; modeline (define-compatible-function-alias 'redraw-mode-line 'redraw-modeline) @@ -345,13 +329,13 @@ Multibyte characters are concerned." "Return a vector of characters in STRING." (mapvector #'identity string)) -(defun store-substring (string idx object) - "Embed OBJECT (string or character) at index IDX of STRING." - (let* ((str (cond ((stringp object) object) - ((characterp object) (char-to-string object)) +(defun store-substring (string idx obj) + "Embed OBJ (string or character) at index IDX of STRING." + (let* ((str (cond ((stringp obj) obj) + ((characterp obj) (char-to-string obj)) (t (error "Invalid argument (should be string or character): %s" - object)))) + obj)))) (string-len (length string)) (len (length str)) (i 0)) @@ -360,9 +344,9 @@ Multibyte characters are concerned." (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 +;; In case we need the exact behaviour, we can always copy the FSF ;; version, which is very long and does lots of unnecessary stuff. (defun truncate-string-to-width (str end-column &optional start-column padding) "Truncate string STR to end at column END-COLUMN. @@ -393,5 +377,4 @@ the resulting string may be narrower than END-COLUMN." (make-obsolete 'function-called-at-point 'function-at-point) -(provide 'obsolete) ;;; obsolete.el ends here diff --git a/lisp/package-get-base.el b/lisp/package-get-base.el new file mode 100644 index 0000000..7eeebbd --- /dev/null +++ b/lisp/package-get-base.el @@ -0,0 +1,1466 @@ +(setq package-get-base +'((eudc + (standards-version 1.0 + version "1.09" + author-version "1.09" + date "1998-06-30" + build-date "1998-06-30" + maintainer "Oscar Figueiredo " + distribution stable + priority low + category "comm" + dump nil + description "Emacs Unified Directory Client (LDAP, PH)." + filename "eudc-1.09-pkg.tar.gz" + md5sum "517bfd3112700fd3dcfc59e02bbb0b12" + size 40867 + provides (eudc eudc-ldap eudc-ph) + requires (fsf-compat xemacs-base) + type regular +)) +(footnote + (standards-version 1.0 + version "1.03" + author-version "0.18x" + date "1998-06-01" + build-date "1998-06-01" + maintainer "SL Baur " + distribution stable + priority low + category "comm" + dump nil + description "Footnoting in mail message editing modes." + filename "footnote-1.03-pkg.tar.gz" + md5sum "bea3aa23b37988f690fa56ba8cc11e92" + size 18199 + provides (footnote) + requires (mail-lib xemacs-base) + type regular +)) +(gnats + (standards-version 1.0 + version "1.03" + author-version "3.101" + date "1998-04-06" + build-date "1998-04-17" + maintainer "XEmacs Development Team " + distribution stable + priority high + category "comm" + dump nil + description "XEmacs bug reports." + filename "gnats-1.03-pkg.tar.gz" + md5sum "2b8f3a25baa78ffd23927ac5bb5777b5" + size 126412 + provides (gnats gnats-admin send-pr) + requires (mail-lib xemacs-base) + type regular +)) +(gnus + (standards-version 1.0 + version "1.21" + author-version "5.6.23" + date "1998-07-06" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "comm" + dump nil + description "The Gnus Newsreader and Mailreader." + filename "gnus-1.21-pkg.tar.gz" + md5sum "6d58f34293ec00bbd297a6abb98fe2e9" + size 1693384 + provides (gnus message) + requires (gnus w3 mh-e mailcrypt rmail mail-lib xemacs-base) + type regular +)) +(mailcrypt + (standards-version 1.0 + version "1.04" + author-version "3.4" + date "1998-01-24" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "comm" + dump nil + description "Support for messaging encryption with PGP." + filename "mailcrypt-1.04-pkg.tar.gz" + md5sum "66601a110f1499d3c6f815f806e43a71" + size 66937 + provides (mailcrypt) + requires (gnus vm mail-lib xemacs-base) + type regular +)) +(mew + (standards-version 1.0 + version "1.0" + author-version "1.93b38" + date "1998-06-21" + build-date "1998-06-21" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "comm" + dump nil + description "Messaging in an Emacs World." + filename "mew-1.0-pkg.tar.gz" + md5sum "be366b8dd9495ecb7b3b6a7a46563faa" + size 441775 + provides (mew) + requires (mew) + type regular +)) +(mh-e + (standards-version 1.0 + version "1.05" + author-version "21.0" + date "1998-01-24" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "comm" + dump nil + description "Front end support for MH." + filename "mh-e-1.05-pkg.tar.gz" + md5sum "62b8598c55698c74ddfe71e874f0fe5e" + size 129257 + provides (mh-e) + requires (mail-lib xemacs-base) + type regular +)) +(net-utils + (standards-version 1.0 + version "1.08" + author-version "21.0" + date "1998-07-01" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "comm" + dump nil + description "Miscellaneous Networking Utilities." + filename "net-utils-1.08-pkg.tar.gz" + md5sum "2591eca88f5ea04272012e479ea8665c" + size 107983 + provides (ilisp-browse-cltl2 emacsbug feedmail metamail net-utils rcompile shadowfile webjump webster-www) + requires (w3 efs mail-lib xemacs-base) + type single +)) +(rmail + (standards-version 1.0 + version "1.04" + author-version "21.0" + date "1998-06-28" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "comm" + dump nil + description "An obsolete Emacs mailer." + filename "rmail-1.04-pkg.tar.gz" + md5sum "5a4fc73565cb0e9ea62d6b0665ccb013" + size 85711 + provides (rmail rmailsum) + requires (tm apel mail-lib xemacs-base) + type regular +)) +(supercite + (standards-version 1.0 + version "1.07" + author-version "3.55x" + date "1998-05-07" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "comm" + dump nil + description "An Emacs citation tool for News & Mail messages." + filename "supercite-1.07-pkg.tar.gz" + md5sum "c1ef998b1819e6b19efd10bf0e48534c" + size 71084 + provides (supercite) + requires (mail-lib xemacs-base) + type regular +)) +(tm + (standards-version 1.0 + version "1.09" + author-version "21.0" + date "1998-06-09" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "comm" + dump nil + description "Emacs MIME support." + filename "tm-1.09-pkg.tar.gz" + md5sum "a5697117fc719a9c5a74a62f6b812101" + size 253269 + provides (tm tm-edit tm-view mime-setup) + requires (gnus mh-e rmail vm mailcrypt mail-lib apel xemacs-base) + type regular +)) +(vm + (standards-version 1.0 + version "1.09" + author-version "6.53" + date "1998-06-26" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "comm" + dump t + description "An Emacs mailer." + filename "vm-1.09-pkg.tar.gz" + md5sum "a3dd4a14155abf835275120c62ca82fd" + size 514307 + provides (vm) + requires (mail-lib xemacs-base) + type regular +)) +(w3 + (standards-version 1.0 + version "1.06" + author-version "4.0pre18" + date "1998-05-01" + build-date "1998-05-02" + maintainer "XEmacs Development Team " + distribution experimental + priority high + category "comm" + dump nil + description "A Web browser." + filename "w3-1.06-pkg.tar.gz" + md5sum "fea5098f9e8dd5b3b82e3ebe7d447b9c" + size 581731 + provides (w3 url) + requires (w3 mail-lib xemacs-base) + type regular +)) +(cookie + (standards-version 1.0 + version "1.07" + author-version "21.0b36" + date "1998-04-07" + build-date "1998-04-17" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "games" + dump nil + description "Spook and Yow (Zippy quotes)." + filename "cookie-1.07-pkg.tar.gz" + md5sum "df97f80082395667a0e23eda8f68b8dd" + size 34184 + provides (cookie1 yow) + requires (xemacs-base) + type regular +)) +(games + (standards-version 1.0 + version "1.05" + author-version "1.04" + date "1998-06-04" + build-date "1998-07-09" + maintainer "Glynn Clements " + distribution stable + priority low + category "games" + dump nil + description "Tetris, Sokoban, and Snake." + filename "games-1.05-pkg.tar.gz" + md5sum "2b856bc25a05ad32400bdd947fec6231" + size 32000 + provides (gamegrid snake tetris sokoban) + requires (xemacs-base) + type regular +)) +(mine + (standards-version 1.0 + version "1.05" + author-version "1.8x1" + date "1998-03-31" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "games" + dump nil + description "Minehunt Game." + filename "mine-1.05-pkg.tar.gz" + md5sum "330cd395304f600487b748d466993e06" + size 67568 + provides (xmine) + requires (xemacs-base) + type regular +)) +(misc-games + (standards-version 1.0 + version "1.06" + author-version "21.0b35" + date "1998-03-22" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "games" + dump nil + description "Other amusements and diversions." + filename "misc-games-1.06-pkg.tar.gz" + md5sum "48d883e7e6092c227b476386ece41672" + size 165586 + provides (decipher gomoku hanoi life morse rot13) + requires (xemacs-base) + type single +)) +(Sun + (standards-version 1.0 + version "1.05" + author-version "21.0b35" + date "1998-03-06" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution sun + priority low + category "libs" + dump t + description "Support for Sparcworks." + filename "Sun-1.05-pkg.tar.gz" + md5sum "70a776046ea5b12d08ca7276484f6139" + size 63826 + 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 +)) +(apel + (standards-version 1.0 + version "1.04" + author-version "3.3" + date "1998-01-24" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution mule + priority high + category "libs" + dump nil + description "A Portable Emacs Library. Used by XEmacs MIME support." + filename "apel-1.04-pkg.tar.gz" + md5sum "7082f6eaa80bfef9e655e1c603ff68d3" + size 34597 + 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 +)) +(dired + (standards-version 1.0 + version "1.01" + author-version "7.9" + date "1998-05-05" + build-date "1998-05-05" + maintainer "Mike Sperber " + distribution stable + priority medium + category "libs" + dump nil + description "Manage file systems." + filename "dired-1.01-pkg.tar.gz" + md5sum "d9748d8e8af8a63095aaaab9924987ef" + size 187526 + provides (diff dired) + requires (xemacs-base) + type regular +)) +(edebug + (standards-version 1.0 + version "1.04" + author-version "21.0b35" + date "1998-03-12" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "libs" + dump nil + description "An Emacs Lisp debugger." + filename "edebug-1.04-pkg.tar.gz" + md5sum "d4a46e9bee361d60cb079731e5b152e9" + size 118141 + provides (edebug cl-read cust-print eval-reg cl-specs) + requires (xemacs-base) + type regular +)) +(efs + (standards-version 1.0 + version "1.08" + author-version "1.16x1" + date "1998-03-21" + build-date "1998-04-04" + maintainer "Mike Sperber " + distribution stable + priority medium + category "libs" + dump nil + description "Treat files on remote systems the same as local files." + filename "efs-1.08-pkg.tar.gz" + md5sum "1ec45851fe72d06d32a6f941877ae544" + size 347544 + provides (efs) + requires (xemacs-base vm dired) + type regular +)) +(fsf-compat + (standards-version 1.0 + version "1.0" + author-version "21.0b39" + date "1998-03-25" + build-date "1998-05-06" + maintainer "XEmacs Development Team " + distribution mule + priority high + category "libs" + dump nil + description "FSF Emacs compatibility files." + filename "fsf-compat-1.0-pkg.tar.gz" + md5sum "71351ff26a69b341015612d9b88dfc55" + size 16083 + provides (overlay thingatpt timer) + requires () + type single +)) +(mail-lib + (standards-version 1.0 + version "1.16" + author-version "21.0" + date "1998-06-08" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "libs" + dump nil + description "Fundamental lisp files for providing email support." + filename "mail-lib-1.16-pkg.tar.gz" + md5sum "8466339df937c3e7dc4176df85987cf3" + size 120230 + provides (browse-url highlight-headers mail-abbrevs mail-extr mail-utils reporter rfc822 rmail-mini rmailout sendmail smtpmail) + requires (xemacs-base) + type regular +)) +(sounds-au + (standards-version 1.0 + version "1.02" + author-version "21.0" + date "1998-06-30" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority high + category "libs" + dump nil + description "XEmacs Sun sound files." + filename "sounds-au-1.02-pkg.tar.gz" + md5sum "061ab67267c7cdfe37472141130d19ff" + size 125736 + provides () + requires () + type regular +)) +(sounds-wav + (standards-version 1.0 + version "1.02" + author-version "21.0" + date "1998-06-30" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority high + category "libs" + dump nil + description "XEmacs Microsoft sound files." + filename "sounds-wav-1.02-pkg.tar.gz" + md5sum "c970808088c408bfd780dc8466a848b3" + size 148621 + provides () + requires () + type regular +)) +(tooltalk + (standards-version 1.0 + version "1.04" + author-version "21.0b35" + date "1998-01-24" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "libs" + dump t + description "Support for building with Tooltalk." + filename "tooltalk-1.04-pkg.tar.gz" + md5sum "60ea390c4aa203ea26d66ddb2f3ad99f" + size 9245 + provides () + requires () + type regular +)) +(xemacs-base + (standards-version 1.0 + version "1.21" + author-version "21.0" + date "1998-07-02" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution mule + priority high + category "libs" + dump nil + description "Fundamental XEmacs support, you almost certainly need this." + filename "xemacs-base-1.21-pkg.tar.gz" + md5sum "1807f3591bc644c52d41bf472cd30bfc" + size 458268 + 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 +)) +(xemacs-devel + (standards-version 1.0 + version "1.13" + author-version "21.0" + date "1998-06-15" + build-date "1998-06-19" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "libs" + dump nil + description "Emacs Lisp developer support." + filename "xemacs-devel-1.13-pkg.tar.gz" + md5sum "3bec2cd2b955fa86617335ad14480e1a" + size 78840 + provides (docref eldoc elp find-func hide-copyleft ielm regexp-opt trace) + requires (xemacs-base) + type single +)) +(edict + (standards-version 1.0 + version "1.03" + author-version "0.9.8" + date "1998-06-29" + build-date "1998-07-09" + maintainer "Stephen J. Turnbull " + distribution mule + priority high + category "mule" + dump nil + description "Lisp Interface to EDICT, Kanji Dictionary" + filename "edict-1.03-pkg.tar.gz" + md5sum "0f317174ab3e163780f26c6fcfe0eccb" + size 94823 + provides (dui-registry dui edict-edit edict-english edict-japanese edict-morphology edict-test edict ts-mode) + requires (mule-base xemacs-base) + type regular +)) +(egg-its + (standards-version 1.0 + version "1.05" + author-version "21.0" + date "1998-06-20" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution mule + priority high + category "mule" + dump t + description "Wnn (4.2 and 6) support. SJ3 support." + filename "egg-its-1.05-pkg.tar.gz" + md5sum "ef131233410ea57fad940b40cb3c786c" + size 259670 + 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 xemacs-base) + type regular +)) +(leim + (standards-version 1.0 + version "1.07" + author-version "21.0b36" + date "1998-04-09" + build-date "1998-04-17" + 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.07-pkg.tar.gz" + md5sum "91ef40389a36d7236ce3e9536c5097e1" + size 1744016 + provides () + requires (mule-base fsf-compat xemacs-base) + type regular +)) +(locale + (standards-version 1.0 + version "1.04" + author-version "21.0b35" + date "1998-03-01" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution mule + priority high + category "mule" + dump nil + description "Localized menubars and localized splash screens." + filename "locale-1.04-pkg.tar.gz" + md5sum "5d6dd1391ac017f4f210a810db2541cb" + size 34651 + provides () + requires (mule-base) + type regular +)) +(mule-base + (standards-version 1.0 + version "1.19" + author-version "21.0" + date "1998-07-09" + build-date "1998-07-09" + maintainer "SL Baur " + distribution mule + priority high + category "mule" + dump t + description "Basic Mule support, required for building with Mule." + filename "mule-base-1.19-pkg.tar.gz" + md5sum "ac5ed26ee38de23d3591c37a283bc7b5" + size 488988 + 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) + type regular +)) +(skk + (standards-version 1.0 + version "1.06" + author-version "10.38" + date "1998-04-28" + build-date "1998-05-01" + maintainer "SL Baur " + distribution mule + priority medium + category "mule" + dump t + description "Japanese Language Input Method." + filename "skk-1.06-pkg.tar.gz" + md5sum "ccc92c60519be92efef3c40696897ef7" + size 1467006 + provides (skk skk-tut) + requires (viper mule-base xemacs-base) + type regular +)) +(calc + (standards-version 1.0 + version "1.05" + author-version "2.02fX1" + date "1998-02-27" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "oa" + dump nil + description "Emacs calculator" + filename "calc-1.05-pkg.tar.gz" + md5sum "cc170d1a19718a152144dfd0a66f6865" + size 1165091 + provides (calc) + requires () + type regular +)) +(calendar + (standards-version 1.0 + version "1.04" + author-version "21.0" + date "1998-06-19" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "oa" + dump nil + description "Calendar and diary support." + filename "calendar-1.04-pkg.tar.gz" + md5sum "c0955508d51af1524ca8ef6687b362f1" + size 239851 + 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 +)) +(edit-utils + (standards-version 1.0 + version "1.24" + author-version "21.0" + date "1998-06-13" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution stable + priority high + category "oa" + dump nil + description "Miscellaneous editor extensions, you probably need this." + filename "edit-utils-1.24-pkg.tar.gz" + md5sum "0b7136586f8b47e9b000bcf08f9b75a0" + size 584396 + 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 +)) +(forms + (standards-version 1.0 + version "1.06" + author-version "2.10" + date "1998-01-25" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "oa" + dump nil + description "Forms editing support (obsolete, use Widget instead)." + filename "forms-1.06-pkg.tar.gz" + md5sum "ebee64ebf564f934e15fed3503e3b15e" + size 39948 + provides (forms forms-mode) + requires () + type regular +)) +(frame-icon + (standards-version 1.0 + version "1.02" + author-version "21.0b35" + date "1998-02-26" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "oa" + dump nil + description "Set up mode-specific icons for each frame under XEmacs" + filename "frame-icon-1.02-pkg.tar.gz" + md5sum "82d098425df2fd7e3a7e7d16c9a9e12b" + size 33568 + provides (forms forms-mode) + requires () + type regular +)) +(hm--html-menus + (standards-version 1.0 + version "1.06" + author-version "5.9" + date "1998-01-25" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "oa" + dump nil + description "HTML editing." + filename "hm--html-menus-1.06-pkg.tar.gz" + md5sum "2570d8211b63c2edcc114ec3560a075f" + size 147168 + provides (adapt hm--date hm--html-configuration hm--html-drag-and-drop hm--html-indentation hm--html-keys hm--html-menu hm--html-mode hm--html-not-standard hm--html html-view tmpl-minor-mode) + requires (xemacs-base) + type regular +)) +(ispell + (standards-version 1.0 + version "1.08" + author-version "3.0x1" + date "1998-04-01" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "oa" + dump nil + description "Spell-checking with GNU ispell." + filename "ispell-1.08-pkg.tar.gz" + md5sum "54cd76987a472eca72c24592a10756d6" + size 64990 + provides (ispell) + requires () + type regular +)) +(pc + (standards-version 1.0 + version "1.10" + author-version "21.0b38" + date "1998-04-22" + build-date "1998-04-26" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "oa" + dump nil + description "PC style interface emulation." + filename "pc-1.10-pkg.tar.gz" + md5sum "e750bebcb0d2b7632796b1c6c4fc4c16" + size 16004 + provides (delbs fusion pc-select pending-del s-region) + requires (xemacs-base) + type regular +)) +(psgml + (standards-version 1.0 + version "1.08" + author-version "1.01" + date "1998-07-06" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "oa" + dump nil + description "Validated HTML/SGML editing." + filename "psgml-1.08-pkg.tar.gz" + md5sum "757842225e4d3e9841bf6de1d3fdbbc4" + size 419252 + provides (psgml sgml) + requires (edit-utils) + type regular +)) +(sgml + (standards-version 1.0 + version "1.01" + author-version "21.0b35" + date "1998-01-25" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "oa" + dump nil + description "SGML/Linuxdoc-SGML editing." + filename "sgml-1.01-pkg.tar.gz" + md5sum "4e7039730eb4399c09b1a85d1758381c" + size 26874 + provides (sgml linuxdoc-sgml) + requires (xemacs-base) + type regular +)) +(slider + (standards-version 1.0 + version "1.05" + author-version "0.3" + date "1998-01-25" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution experimental + priority low + category "oa" + dump nil + description "User interface tool." + filename "slider-1.05-pkg.tar.gz" + md5sum "67b376e5b886a78f5094eb13c61ff8ec" + size 12116 + provides (slider color-selector) + requires () + type regular +)) +(speedbar + (standards-version 1.0 + version "1.05" + author-version "0.6.2" + date "1998-02-07" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "oa" + dump nil + description "??? Document me." + filename "speedbar-1.05-pkg.tar.gz" + md5sum "8a988bada9d09dac0e934f0859f88613" + size 95018 + provides (speedbar) + requires (xemacs-base) + type regular +)) +(strokes + (standards-version 1.0 + version "1.01" + author-version "21.0b35" + date "1998-01-25" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "oa" + dump nil + description "Mouse enhancement utility." + filename "strokes-1.01-pkg.tar.gz" + md5sum "a160a62e0570fc69f3c03b6ee1693fcd" + size 43743 + provides (strokes) + requires (text-modes edit-utils mail-lib xemacs-base) + type regular +)) +(text-modes + (standards-version 1.0 + version "1.08" + author-version "21.0" + date "1998-07-03" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority high + category "oa" + dump nil + description "Miscellaneous support for editing text files." + filename "text-modes-1.08-pkg.tar.gz" + md5sum "7334a90ddbcedec459caecf8e0314bad" + size 171811 + 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 (fsf-compat xemacs-base) + type regular +)) +(time + (standards-version 1.0 + version "1.04" + author-version "1.17" + date "1998-04-24" + build-date "1998-04-26" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "oa" + dump nil + description "Display time & date on the modeline." + filename "time-1.04-pkg.tar.gz" + md5sum "e25caf29cf9684887460d9cd124639d4" + size 19905 + provides (time) + requires (xemacs-base) + type regular +)) +(eterm + (standards-version 1.0 + version "1.05" + author-version "21.0" + date "1998-06-28" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "os" + dump nil + description "Terminal emulation." + filename "eterm-1.05-pkg.tar.gz" + md5sum "0c1660a9a8426077534caf84762e7ec1" + size 144233 + provides (eterm) + requires (xemacs-base) + type regular +)) +(igrep + (standards-version 1.0 + version "1.01" + author-version "21.0b35" + date "1998-01-24" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "os" + dump nil + description "Enhanced front-end for Grep." + filename "igrep-1.01-pkg.tar.gz" + md5sum "e50e3a5ac2d6ca5eea67d7f664dee406" + size 13971 + provides (igrep) + requires (dired xemacs-base) + type regular +)) +(ilisp + (standards-version 1.0 + version "1.04" + author-version "5.8" + date "1998-01-24" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "os" + dump nil + description "Front-end for Inferior Lisp." + filename "ilisp-1.04-pkg.tar.gz" + md5sum "1fa1b08bd6b7cc3c71f512ad412e1b24" + size 223559 + provides (ilisp completer) + requires (xemacs-base) + type regular +)) +(os-utils + (standards-version 1.0 + version "1.08" + author-version "21.0" + date "1998-06-07" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "os" + dump nil + description "Miscellaneous O/S utilities." + filename "os-utils-1.08-pkg.tar.gz" + md5sum "9fdcc24ee2d83c6d214f4afa1f41c617" + size 229921 + provides (archive-mode background crypt crypt++ inf-lisp jka-compr lpr mchat ps-print tar-mode telnet terminal uncompress) + requires (xemacs-base) + type single +)) +(view-process + (standards-version 1.0 + version "1.03" + author-version "2.4" + date "1998-01-24" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "os" + dump nil + description "A Unix process browsing tool." + filename "view-process-1.03-pkg.tar.gz" + md5sum "96bcf35e325034ee3c37563fecfe623d" + size 59886 + provides (view-process-mode) + requires (xemacs-base) + type regular +)) +(ada + (standards-version 1.0 + version "1.03" + author-version "2.27" + date "1998-01-24" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "prog" + dump nil + description "Ada language support." + filename "ada-1.03-pkg.tar.gz" + md5sum "661f8c0ac17fe447f8cc0e54f753704d" + size 54323 + provides (ada-mode ada-stmt) + requires () + type regular +)) +(c-support + (standards-version 1.0 + version "1.07" + author-version "21.0b35" + date "1998-03-25" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "prog" + dump nil + description "Basic single-file add-ons for editing C code." + filename "c-support-1.07-pkg.tar.gz" + md5sum "771e606d76e18922efb6559e101c7ecf" + size 68651 + provides (c-comment-edit cmacexp ctypes hideif hideshow) + requires (cc-mode xemacs-base) + type regular +)) +(cc-mode + (standards-version 1.0 + version "1.11" + author-version "5.22" + date "1998-03-05" + build-date "1998-06-14" + maintainer "Barry Warsaw " + distribution stable + priority medium + category "prog" + dump nil + description "C, C++ and Java language support." + filename "cc-mode-1.11-pkg.tar.gz" + md5sum "dadf89d5a4dfbee90d0168831a33150f" + size 151138 + provides (cc-mode) + requires (xemacs-base) + type regular +)) +(debug + (standards-version 1.0 + version "1.04" + author-version "21.0" + date "1998-07-09" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "prog" + dump nil + description "GUD, gdb, dbx debugging support." + filename "debug-1.04-pkg.tar.gz" + md5sum "f881ca1a0593d218ca6a0e19dd10d8a0" + size 90350 + provides (dbx gdb-highlight gdb gdbsrc gud history) + requires (xemacs-base) + type regular +)) +(ediff + (standards-version 1.0 + version "1.08" + author-version "2.70.1" + date "1998-04-27" + build-date "1998-05-15" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "prog" + dump nil + description "Interface over GNU patch." + filename "ediff-1.08-pkg.tar.gz" + md5sum "d73e47087119a6cb7d5b4f71fdba8b72" + size 243042 + provides (ediff) + requires (pcl-cvs dired xemacs-base) + type regular +)) +(emerge + (standards-version 1.0 + version "1.02" + author-version "21.0b36" + date "1998-04-07" + build-date "1998-04-17" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "prog" + dump nil + description "Another interface over GNU patch." + filename "emerge-1.02-pkg.tar.gz" + md5sum "6f7687196172109d6014346d5ead6d3a" + size 60940 + provides (emerge) + requires () + type regular +)) +(jde + (standards-version 1.0 + version "1.04" + author-version "2.05" + date "1998-07-09" + build-date "1998-07-09" + maintainer "Andy Piper " + distribution stable + priority medium + category "prog" + dump nil + description "Java language and development support." + filename "jde-1.04-pkg.tar.gz" + md5sum "97b90e88928033f405005a9441b7e141" + size 126784 + provides (jde) + requires (cc-mode debug speedbar edit-utils mail-lib xemacs-base) + type regular +)) +(pcl-cvs + (standards-version 1.0 + version "1.11" + author-version "21.0" + date "1998-06-18" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "prog" + dump nil + description "CVS frontend." + filename "pcl-cvs-1.11-pkg.tar.gz" + md5sum "7592786d2734d87778915e50561c472d" + size 141698 + provides (pcl-cvs dll elib-node generic-sc) + requires (xemacs-base) + type regular +)) +(prog-modes + (standards-version 1.0 + version "1.06" + author-version "21.0" + date "1998-05-04" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "prog" + dump nil + description "Support for various programming languages." + filename "prog-modes-1.06-pkg.tar.gz" + md5sum "38d494e334b846fe735f45d573759ed9" + size 539915 + 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-base) + type regular +)) +(scheme + (standards-version 1.0 + version "1.03" + author-version "21.0b36" + date "1998-04-11" + build-date "1998-04-17" + maintainer "Karl M. Hegbloom " + distribution contrib + priority low + category "prog" + dump nil + description "Front-end support for Inferior Scheme." + filename "scheme-1.03-pkg.tar.gz" + md5sum "f22026713da1be70eba93f8d59700499" + size 36833 + provides (scheme xscheme cmuscheme cmuscheme48) + requires (xemacs-base) + type regular +)) +(sh-script + (standards-version 1.0 + version "1.05" + author-version "2.0e" + date "1998-05-12" + build-date "1998-05-15" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "prog" + dump nil + description "Support for editing shell scripts." + filename "sh-script-1.05-pkg.tar.gz" + md5sum "8462bd33b9edc71da72ebd134b8a77c6" + size 33785 + provides (sh-script executable) + requires (xemacs-base) + type regular +)) +(vc-cc + (standards-version 1.0 + version "1.04" + author-version "21.0" + date "1998-06-30" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "prog" + dump t + description "Version Control for ClearCase (UnFree) systems." + filename "vc-cc-1.04-pkg.tar.gz" + md5sum "07557cc75c0b2aafc5966cca1c0a22e2" + size 96262 + provides (vc) + requires (dired xemacs-base) + type regular +)) +(vc + (standards-version 1.0 + version "1.09" + author-version "21.0b42" + date "1998-05-30" + build-date "1998-06-01" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "prog" + dump t + description "Version Control for Free systems." + filename "vc-1.09-pkg.tar.gz" + md5sum "233d46c01ab9e5052395cf730420f41d" + size 83688 + provides (vc) + requires (dired xemacs-base) + type regular +)) +(vhdl + (standards-version 1.0 + version "1.04" + author-version "2.74" + date "1998-01-24" + build-date "1998-06-14" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "prog" + dump nil + description "Support for VHDL." + filename "vhdl-1.04-pkg.tar.gz" + md5sum "8de144972dd6f33bcdd43314e6e6564d" + size 54169 + provides (vhdl-mode) + requires () + type regular +)) +(auctex + (standards-version 1.0 + version "1.08" + author-version "9.7p" + date "1998-04-10" + build-date "1998-04-17" + maintainer "XEmacs Development Team " + distribution stable + priority medium + category "wp" + dump nil + description "Basic TeX/LaTeX support." + filename "auctex-1.08-pkg.tar.gz" + md5sum "e79c956bd2a7cfc086d91c399667c2ef" + size 305607 + provides (auc-old bib-cite font-latex latex multi-prompt tex-buf tex-info tex-jp tex-site tex) + requires (xemacs-base) + type regular +)) +(crisp + (standards-version 1.0 + version "1.04" + author-version "1.33" + date "1998-01-24" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "wp" + dump nil + description "Crisp/Brief emulation." + filename "crisp-1.04-pkg.tar.gz" + md5sum "2a51917984d7556019b1b20ff85a9feb" + size 10189 + provides (crisp scroll-lock) + requires () + type regular +)) +(edt + (standards-version 1.0 + version "1.04" + author-version "21.0b36" + date "1998-04-07" + build-date "1998-04-17" + maintainer "XEmacs Development Team " + distribution contrib + priority low + category "wp" + dump nil + description "DEC EDIT/EDT emulation." + filename "edt-1.04-pkg.tar.gz" + md5sum "fabfedc63988de7296eae068d8b78ae0" + size 46095 + provides (edt) + requires (xemacs-base) + type regular +)) +(reftex + (standards-version 1.0 + version "1.04" + author-version "3.22" + date "1998-03-21" + build-date "1998-04-04" + maintainer "Carsten Dominik " + distribution stable + priority medium + category "wp" + dump nil + description "Emacs support for LaTeX cross-references, citations.." + filename "reftex-1.04-pkg.tar.gz" + md5sum "817a50763a3e909449a93780f662723c" + size 141810 + provides (reftex) + requires (fsf-compat xemacs-base) + type regular +)) +(texinfo + (standards-version 1.0 + version "1.09" + author-version "21.0" + date "1998-07-01" + build-date "1998-07-09" + maintainer "XEmacs Development Team " + distribution stable + priority high + category "wp" + dump nil + description "XEmacs TeXinfo support." + filename "texinfo-1.09-pkg.tar.gz" + md5sum "7ab1fa9774456869027cfc0846d8f3fc" + size 127683 + provides (makeinfo tex-mode texinfmt texinfo texnfo-tex texnfo-upd) + requires (xemacs-base) + type regular +)) +(textools + (standards-version 1.0 + version "1.05" + author-version "21.0b38" + date "1998-04-29" + build-date "1998-05-01" + maintainer "XEmacs Development Team " + distribution stabl + priority medium + category "wp" + dump nil + description "Miscellaneous TeX support." + filename "textools-1.05-pkg.tar.gz" + md5sum "4b0a417849ca270ed498c1e9c9aaa07b" + size 79125 + provides (bib-mode bibtex refer-to-bibtex) + requires (xemacs-base) + type single +)) +(tpu + (standards-version 1.0 + version "1.04" + author-version "21.0b35" + date "1998-01-24" + build-date "1998-04-04" + maintainer "XEmacs Development Team " + distribution mule + priority high + category "wp" + dump nil + description "DEC EDIT/TPU support." + filename "tpu-1.04-pkg.tar.gz" + md5sum "f45c9f761d6a88b2d3bdb4a4af2abf25" + size 57425 + provides (tpu) + requires () + type regular +)) +(viper + (standards-version 1.0 + version "1.08" + author-version "3.03" + date "1998-02-25" + build-date "1998-06-01" + maintainer "XEmacs Development Team " + distribution stable + priority low + category "wp" + dump nil + description "VI emulation support." + filename "viper-1.08-pkg.tar.gz" + md5sum "f36b7e49bda79a19d7beeeeb6092bedd" + size 261090 + provides (viper) + requires (xemacs-base) + type regular +)) +)) +(provide 'package-get-base) diff --git a/lisp/package-net.el b/lisp/package-net.el index 1fadce1..fbc36ff 100644 --- a/lisp/package-net.el +++ b/lisp/package-net.el @@ -27,38 +27,6 @@ ;; Manipulate packages for the netinstall setup utility -;; The process should be so: - -;; 1. The package maintainer or release manager makes a release -;; announcement. -;; -;; 2. For a new package releases the netinstall maintainer simply -;; needs to update `ftp://ftp.xemacs.org/pub/xemacs/setup.ini'. This is -;; harder than it sounds because the file also includes information -;; about the binary releases. At the moment going to the netinstall -;; directory and typing: -;; -;; `make XEMACS= setup.ini' -;; -;; will do the right thing provided that: -;; -;; (a) `package-net-cygwin32-binary-size' and -;; `package-net-win32-binary-size' are set correctly. -;; -;; (b) The binary pointed to by `XEMACS' has a current -;; `package-index.LATEST.pgp' file. If you don't specify the XEMACS= -;; part then you will get whatever is current for your build tree - -;; which is probably not what you want. -;; -;; You can run `package-net-convert-index-to-ini' manually and specify -;; REMOTE but I generally found that to be inconvenient and error-prone. -;; -;; 3. For package releases that's all you need to do. For binary -;; releases you need to build both cygwin and win32 binaries and put -;; them in appropriate tarballs: This can be achieved by running -;; build-msw-release.sh -;; - (require 'package-admin) (require 'package-get) @@ -67,108 +35,94 @@ ;; bootstrap the process. This will be: ;; /setup/ for native windows ;; /lib/xemacs/setup for cygwin. -;; -;;; To Do: -;; -;; 1. Package update functions should also update the installed -;; database so that running setup.exe again does not reinstall -;; packages. -;; -;; 2. Generating setup.ini should be more automatic. - -(defvar package-net-cygwin32-binary-size 0 - "The size in bytes of the cygwin32 binary distribution.") - -(defvar package-net-win32-binary-size 0 - "The size in bytes of the win32 binary distribution.") - -(defvar package-net-kit-version "" - "XEmacs kitting revision, usually empty.") - -(defvar package-net-setup-version "1.0" - "The version string of setup.") - -;;;###autoload (defun package-net-setup-directory () (file-truename (concat data-directory "../../" (if (eq system-type 'cygwin32) "xemacs/setup/" "setup/")))) -(defun package-net-generate-bin-ini (&optional version) - "Convert the package index to ini file format in the current directory." - (let ((buf (get-buffer-create "*setup-bin.ini*"))) +(defun package-net-convert-index-to-ini (&optional destdir remote version) + "Convert the package index to ini file format in DESTDIR. +DESTDIR defaults to the value of `data-directory'." + (package-get-require-base remote) + + (setq destdir (file-name-as-directory (or destdir data-directory))) + (let ((buf (get-buffer-create "*setup.ini*"))) (unwind-protect (save-excursion (set-buffer buf) (erase-buffer buf) (goto-char (point-min)) - (insert "# This file is automatically generated. If you edit it, your\n") - (insert "# edits will be discarded next time the file is generated.\n") - (insert "#\n\n") - (insert (format "setup-timestamp: %d\n" - (+ (* (car (current-time)) 65536) (car (cdr (current-time)))))) - (insert (format "setup-version: %s\n\n" (or version "1.0"))) - ;; Native version - (insert (format "@ %s\n" "xemacs-i586-pc-win32")) - (insert (format "version: %s%s\n" emacs-program-version - package-net-kit-version)) - (insert "type: native\n") - (insert (format "install: win32/%s %d\n\n" - (concat emacs-program-name - "-i586-pc-win32-" - emacs-program-version package-net-kit-version - ".tar.gz") - package-net-win32-binary-size)) - ;; Cygwin version - (insert (format "@ %s\n" "xemacs-i686-pc-cygwin")) - (insert (format "version: %s%s\n" emacs-program-version - package-net-kit-version)) - (insert "type: cygwin\n") - (insert (format "install: cygwin32/%s %d\n\n" - (concat emacs-program-name - "-i686-pc-cygwin-" - emacs-program-version package-net-kit-version - ".tar.gz") - package-net-cygwin32-binary-size)) + (let ((entries package-get-base) entry plist) + (insert "# This file is automatically generated. If you edit it, your\n") + (insert "# edits will be discarded next time the file is generated.\n") + (insert "#\n\n") + (insert (format "setup-timestamp: %d\n" + (+ (* (car (current-time)) 65536) (car (cdr (current-time)))))) + (insert (format "setup-version: %s\n\n" (or version "1.0"))) + ;; Native version + ;; We give the package a capitalised name so that it appears at the top + (insert (format "@ %s\n" "xemacs-i586-pc-win32")) + (insert (format "version: %s\n" emacs-program-version)) + (insert "type: native\n") + (insert (format "install: binaries/win32/%s %d\n\n" + (concat emacs-program-name + "-i586-pc-win32-" + emacs-program-version ".tar.gz") 0)) + ;; Cygwin version + ;; We give the package a capitalised name so that it appears at the top + (insert (format "@ %s\n" "xemacs-i686-pc-cygwin32")) + (insert (format "version: %s\n" emacs-program-version)) + (insert "type: cygwin\n") + (insert (format "install: binaries/cygwin32/%s %d\n\n" + (concat emacs-program-name + "-i686-pc-cygwin32-" + emacs-program-version ".tar.gz") 6779200)) + ;; Standard packages + (while entries + (setq entry (car entries)) + (setq plist (car (cdr entry))) + (insert (format "@ %s\n" (symbol-name (car entry)))) + (insert (format "version: %s\n" (plist-get plist 'version))) + (insert (format "install: packages/%s %s\n" (plist-get plist 'filename) + (plist-get plist 'size))) + ;; These are not supported as yet + ;; + ;; (insert (format "source: %s\n" (plist-get plist 'source))) + ;; (insert "[prev]\n") + ;; (insert (format "version: %s\n" (plist-get plist 'version))) + ;; (insert (format "install: %s\n" (plist-get plist 'filename))) + ;; (insert (format "source: %s\n" (plist-get plist 'source))) + (insert "\n") + (setq entries (cdr entries)))) (insert "# setup.ini file ends here\n") - (write-region (point-min) (point-max) "setup-bin.ini"))) - (kill-buffer buf))) - -(defun package-net-batch-generate-bin-ini () - "Convert the package index to ini file format." - (unless noninteractive - (error "`package-net-batch-generate-bin-ini' is to be used only with -batch")) - (package-net-generate-bin-ini package-net-setup-version)) + (write-region (point-min) (point-max) (concat destdir "setup.ini"))) + (kill-buffer buf)))) -;;;###autoload (defun package-net-update-installed-db (&optional destdir) "Write out the installed package index in a net install suitable format. If DESTDIR is non-nil then use that as the destination directory. DESTDIR defaults to the value of `package-net-setup-directory'." + ;; Need the local version + (package-get-require-base) - (when (or (eq system-type 'cygwin32) - (eq system-type 'window-nt)) - (setq destdir (file-name-as-directory - (or destdir (package-net-setup-directory)))) - (let ((buf (get-buffer-create "*installed.db*"))) - (unwind-protect - (save-excursion - (set-buffer buf) - (erase-buffer buf) - (goto-char (point-min)) - ;; we use packages-package-list here as we actually want to - ;; update relative to the installed reality - (let ((entries packages-package-list) entry version) - (while entries - (setq entry (car entries)) - (setq version (plist-get (cdr entry) :version)) - ;; Unfortunately we can't read the size from this - (insert (format "%s %s-%3.2f-pkg.tar.gz 0\n" (symbol-name (car entry)) - (symbol-name (car entry)) - version)) - (setq entries (cdr entries)))) - (make-directory-path destdir) - (write-region (point-min) (point-max) (concat destdir "installed.db"))) - (kill-buffer buf))))) + (setq destdir (file-name-as-directory + (or destdir (package-net-setup-directory)))) + (let ((buf (get-buffer-create "*installed.db*"))) + (unwind-protect + (save-excursion + (set-buffer buf) + (erase-buffer buf) + (goto-char (point-min)) + (let ((entries package-get-base) entry plist) + (while entries + (setq entry (car entries)) + (setq plist (car (cdr entry))) + (insert (format "%s %s %s\n" (symbol-name (car entry)) + (plist-get plist 'filename) + (plist-get plist 'size))) + (setq entries (cdr entries)))) + (make-directory-path destdir) + (write-region (point-min) (point-max) (concat destdir "installed.db"))) + (kill-buffer buf)))) (defun package-net-convert-download-sites-to-mirrors (&optional destdir) "Write out the download site list in a net install suitable format. diff --git a/lisp/printer.el b/lisp/printer.el index 9f0b6d7..ed1ce4d 100644 --- a/lisp/printer.el +++ b/lisp/printer.el @@ -53,50 +53,37 @@ ;; 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 currently only really supports Windows. +;; 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 +(defcustom printer-name nil ; "Okidata OL610e/PS PostScript" "*Name of printer to print to. If nil, use default. -Under Windows, use `mswindows-printer-list' to get names of installed -printers." +Under MS Windows, this can have the form `\\\\STOLI\\HP-345-PS'." :type 'string :group 'printing) -(defstruct Print-context pageno window start-time printer-name) - -(defvar printer-current-device nil) - -(defun Printer-get-device () - (or printer-current-device (setq printer-current-device - (make-device 'msprinter printer-name)))) - -(defun Printer-clear-device () - ;; relying on GC to delete the device is too error-prone since there - ;; only can be one anyway. - (and printer-current-device (delete-device printer-current-device)) - (setq printer-current-device nil)) - -(defcustom printer-page-header '((face bold date) nil (face bold buffer-name)) +(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. + 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: - 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 @@ -105,8 +92,6 @@ This can be: page Current printout page number, 1-based user-id User logon id user-name User full name - - A list of three elements: (face FACE-NAME EXPR). EXPR is any of the - items given here. The item will be displayed in the given face. - 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. @@ -119,338 +104,107 @@ This can be: :type 'sexp :group 'printing) -(defcustom printer-page-footer '(nil (face bold ("Page " page))) +(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 generate-header-element (element context) - (cond ((null element) nil) - ((stringp element) (insert element)) - ((memq element '(printer-name - short-file-name long-file-name buffer-name - date time page user-id user-name)) - (insert (print-context-property context element))) - ((and (consp element) (eq 'face (car element))) - (let ((p (point))) - (generate-header-element (third element) context) - (let ((x (make-extent p (point)))) - (set-extent-face x (second element))))) - ((and (consp element) (extentp (car element))) - (let ((p (point))) - (generate-header-element (cdr element) context) - (let ((x (make-extent p (point)))) - (set-extent-face x (extent-face (car element))) - (set-extent-begin-glyph x (extent-begin-glyph (car element))) - (set-extent-end-glyph x (extent-end-glyph (car element)))))) - ((listp element) - (mapcar #'(lambda (el) (generate-header-element el context)) - element)) - ((functionp element) - (generate-header-element (funcall element context) context)) - (t (error 'invalid-argument "Unknown header element" element)))) - -(defun generate-header-line (spec context) - (let* ((left (first spec)) - (middle (second spec)) - (right (third spec)) - (left-start (point)) - (middle-start (progn (generate-header-element left context) - (point))) - (right-start (progn (generate-header-element middle context) - (point))) - (right-end (progn (generate-header-element right context) - (point))) - (left-width (- middle-start left-start)) - (middle-width (- right-start middle-start)) - (right-width (- right-end right-start)) - (winwidth (- (window-width (Print-context-window context)) 1)) - (spaces1 (max (- (/ (- winwidth middle-width) 2) left-width) 0)) - (spaces2 (max (- (- winwidth right-width) - (+ left-width spaces1 middle-width)) - 0))) - (goto-char right-start) - (insert-char ?\ spaces2) - (goto-char middle-start) - (insert-char ?\ spaces1))) - (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 -print-start-time Time current when printing started (`current-time' format) -print-page Current printout page number, 1-based -printer-name Name of printer being printed to +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 (as a string) -time Time current when printing started (as a string) -page Current printout page number, 1-based (as a string) -user-id User logon id (as a string) +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" - (let* ((window (Print-context-window print-context)) - (pageno (Print-context-pageno print-context)) - (start-time (Print-context-start-time print-context)) - (printer-name (Print-context-printer-name print-context)) - (buffer (window-buffer window))) - (case prop - (print-buffer buffer) - (print-window window) - (print-frame (window-frame window)) - (print-device (frame-device (window-frame window))) - (print-start-time start-time) - (print-page pageno) - (printer-name printer-name) - (short-file-name (let ((name (buffer-file-name buffer))) - (if name (file-name-nondirectory name) ""))) - (long-file-name (let ((name (buffer-file-name buffer))) - (or name ""))) - (buffer-name (buffer-name buffer)) - (date (format-time-string "%x" start-time)) - (time (format-time-string "%X" start-time)) - (page (format "%d" pageno)) - (user-id (format "%d" (user-uid))) - (user-name (format "%d" (user-login-name))) - (t (error 'invalid-argument "Unrecognized print-context property" - prop))))) - -(defun generic-page-setup () - "Display the Page Setup dialog box. -Changes made are recorded internally." - (interactive) - (let* ((d (Printer-get-device)) - (props - (condition-case err - (make-dialog-box 'page-setup :device d - :properties default-msprinter-frame-plist) - (error - (Printer-clear-device) - (signal (car err) (cdr err)))))) - (while props - (setq default-msprinter-frame-plist - (plist-put default-msprinter-frame-plist (car props) (cadr props))) - (setq props (cddr props))))) + (error "not yet implemented")) -(defun generic-print-buffer (&optional buffer display-print-dialog) - "Print buffer BUFFER using a printing method appropriate to the O.S. being run. +(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 DISPLAY-PRINT-DIALOG is t, the print dialog will first be -displayed, allowing the user to select various printing settings -\(e.g. which printer to print to, the range of pages, number of copies, -modes such landscape/portrait/2-up/4-up [2 or 4 (small!) logical pages -per physical page], etc.). At this point the user can cancel the printing -operation using the dialog box, and `generic-print-buffer' will not print -anything. When called interactively, use a prefix arg to suppress the -display of the print dialog box. - -If BUFFER is nil or omitted, the current buffer is used." - (interactive (list nil (not current-prefix-arg))) - (condition-case err - (let* ((print-region (and (interactive-p) (region-active-p))) - (start (if print-region (region-beginning) (point-min buffer))) - (end (if print-region (region-end) (point-max buffer)))) - (if (or (not (valid-specifier-tag-p 'msprinter)) - (not display-print-dialog)) - (generic-print-region start end buffer) - (let* ((d (Printer-get-device)) - (props (make-dialog-box 'print :device d - :allow-selection print-region - :selected-page-button - (if print-region 'selection 'all)))) - (and props - (let ((really-print-region - (eq (plist-get props 'selected-page-button) 'selection))) - (generic-print-region (if really-print-region start - (point-min buffer)) - (if really-print-region end - (point-max buffer)) - buffer d props)))))) - (error - ;; Make sure we catch all errors thrown from the native code. - (Printer-clear-device) - (signal (car err) (cdr err))))) +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 (start end &optional buffer print-device props) +(defun generic-print-region (b e &optional buf) "Print region using a printing method appropriate to the O.S. being run. -The region between START and END of BUFFER (defaults to the current -buffer) is printed. +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. - -Optional PRINT-DEVICE is a device, already created, to use to do the -printing. This is typically used when this function was invoked from -`generic-print-buffer' and it displayed a dialog box. That function created -the device, and then the dialog box stuffed it with the user's selections -of how the buffer should be printed. - -PROPS, if given, is typically the plist returned from the call to -`make-dialog-box' that displayed the Print box. It contains properties -relevant to us when we print. - -Recognized properties are the same as those in `make-dialog-box': - - name Printer device name. If omitted, the current system-selected - printer will be used. - from-page First page to print, 1-based. If omitted, printing starts from - the beginning. - to-page Last page to print, inclusive, If omitted, printing ends at - the end. - copies Number of copies to print. If omitted, one copy is printed." +PostScript printer. Under MS Windows, the built-in printing support is used." (cond ((valid-specifier-tag-p 'msprinter) - ;; loop, printing one copy of document per loop. kill and - ;; re-create the frame each time so that we eject the piece - ;; of paper at the end even if we're printing more than one - ;; page per sheet of paper. - (let ((copies (plist-get props 'copies 1)) - ;; This is not relevant to printing and can mess up - ;; msprinter frame sizing - default-frame-plist) - (while (> copies 0) - (let (d f header-buffer footer-buffer) - (setq buffer (decode-buffer buffer)) - (unwind-protect - (with-current-buffer buffer - (save-restriction - (narrow-to-region start end) - (setq d (or print-device (Printer-get-device))) - (setq f (make-frame - (list* 'name - (concat - (substitute ?_ ?. (buffer-name buffer)) - " - 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 - [default foreground] "black" - [default background] "white")) - d)) - (let* ((w (frame-root-window f)) - (vertdpi - (cdr (device-system-metric d 'device-dpi))) - (pixel-vertical-clip-threshold (/ vertdpi 2)) - (from-page (plist-get props 'from-page 1)) - (to-page (plist-get props 'to-page)) - (context (make-Print-context - :start-time (current-time) - ;; #### bogus! we need accessors for - ;; print-settings objects. - :printer-name - (or (plist-get props 'name) - printer-name - (mswindows-get-default-printer)))) - header-window - footer-window) - - (when printer-page-header - (let ((window-min-height 2)) - (setq header-window w) - (setq w (split-window w 2))) - (setq header-buffer - (generate-new-buffer " *header*")) - (set-window-buffer header-window header-buffer)) - - (when printer-page-footer - (let ((window-min-height 2)) - (setq footer-window - (split-window w (- (window-height w) 2)))) - (setq footer-buffer - (generate-new-buffer " *footer*")) - (set-window-buffer footer-window footer-buffer)) - - (setf (Print-context-window context) w) - - (let ((last-end 0) ; bufpos at end of previous page - reached-end ; t if we've reached the end of the - ; text we're printing - (pageno 1)) - (set-window-buffer w buffer) - (set-window-start w start) - - ;; loop, printing one page per loop - (while (and (not reached-end) - ;; stop at end of region of text or - ;; outside of ranges of pages given - (or (not to-page) (<= pageno to-page))) - - (setf (Print-context-pageno context) pageno) - - ;; only actually print the page if it's in the - ;; range. - (when (>= pageno from-page) - (when printer-page-header - (with-current-buffer header-buffer - (erase-buffer) - (generate-header-line printer-page-header - context) - (goto-char (point-min)) - (set-window-start header-window - (point-min)))) - - (when printer-page-footer - (with-current-buffer footer-buffer - (erase-buffer) - (insert "\n") - (generate-header-line printer-page-footer - context) - (goto-char (point-min)) - (set-window-start footer-window - (point-min)))) - - (redisplay-frame f t) - (print-job-eject-page f) - ) - ;; but use the GUARANTEE argument to `window-end' - ;; so that we get the right value even if we - ;; didn't do a redisplay. - (let ((this-end (window-end w t)) - (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 (= this-end last-end) - ;; #### fuckme! window-end returns a - ;; value outside of the valid range of - ;; buffer positions!!! - (>= this-end end)) - (setq reached-end t) - (setq last-end this-end) - (set-window-start w this-end) - (if pixvis - (with-selected-window w - ;; #### scroll-down should take a - ;; window arg. - (let ((window-pixel-scroll-increment - pixvis)) - (scroll-down 1)))))) - (setq pageno (1+ pageno)))))) - (and f (delete-frame f)) - (and header-buffer (kill-buffer header-buffer)) - (and footer-buffer (kill-buffer footer-buffer))))) - (setq copies (1- copies))))) + (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 + '(name "Test!" + 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-region)) - (lpr-region start end)) + (fboundp 'lpr-buffer)) + (lpr-region buf)) (t (error "No print support available")))) diff --git a/lisp/setup-paths.el b/lisp/setup-paths.el index c7a3bf1..3d07560 100644 --- a/lisp/setup-paths.el +++ b/lisp/setup-paths.el @@ -38,24 +38,14 @@ ;;; Code: -(defvar paths-core-load-path-depth 0 +(defvar paths-load-path-depth 1 "Depth of load-path searches in core Lisp paths.") -(defvar paths-site-load-path-depth 1 - "Depth of load-path searches in site Lisp paths.") - -(defvar paths-mule-load-path-depth 0 - "Depth of load-path searches in Mule 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) @@ -64,40 +54,16 @@ nil configure-site-directory)) -(defun paths-find-site-module-directory (roots) - "Find the site modules directory of the XEmacs hierarchy." - (paths-find-site-directory roots "site-modules" - nil - configure-site-module-directory)) - (defun paths-find-lisp-directory (roots) "Find the main Lisp directory of the XEmacs hierarchy." (paths-find-version-directory roots "lisp" nil configure-lisp-directory)) -(defun paths-find-mule-lisp-directory (roots &optional lisp-directory) - "Find the Mule Lisp directory of the XEmacs hierarchy." - ;; #### kludge - (if lisp-directory - (let ((guess - (file-name-as-directory - (paths-construct-path (list lisp-directory "mule"))))) - (if (paths-file-readable-directory-p guess) - guess - (paths-find-version-directory roots "mule-lisp" - nil - configure-mule-lisp-directory))))) - -(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)) - (defun paths-construct-load-path (roots early-package-load-path late-package-load-path last-package-load-path lisp-directory - &optional site-lisp-directory mule-lisp-directory) + &optional site-lisp-directory) "Construct the load path." (let* ((envvar-value (getenv "EMACSLOADPATH")) (env-load-path @@ -106,42 +72,18 @@ (site-lisp-load-path (and site-lisp-directory (paths-find-recursive-load-path (list site-lisp-directory) - paths-site-load-path-depth))) - (mule-lisp-load-path - (and mule-lisp-directory - (paths-find-recursive-load-path (list mule-lisp-directory) - paths-mule-load-path-depth))) + paths-load-path-depth))) (lisp-load-path (and lisp-directory (paths-find-recursive-load-path (list lisp-directory) - paths-core-load-path-depth)))) + paths-load-path-depth)))) (append env-load-path early-package-load-path site-lisp-load-path late-package-load-path - mule-lisp-load-path lisp-load-path last-package-load-path))) -(defun paths-construct-module-load-path - (root module-directory &optional site-module-directory) - "Construct the modules load path." - (let* ((envvar-value (getenv "EMACSMODULEPATH")) - (env-module-path - (and envvar-value - (paths-decode-directory-path envvar-value 'drop-empties))) - (site-module-load-path - (and site-module-directory - (paths-find-recursive-load-path (list site-module-directory) - paths-site-load-path-depth))) - (module-load-path - (and module-directory - (paths-find-recursive-load-path (list module-directory) - paths-core-load-path-depth)))) - (append env-module-path - site-module-load-path - module-load-path))) - (defun paths-construct-info-path (roots early-packages late-packages last-packages) "Construct the info path." (let ((info-path-envval (getenv "INFOPATH"))) @@ -165,12 +107,26 @@ (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." + (paths-find-site-directory roots "lock" "EMACSLOCKDIR" configure-lock-directory)) + +(defun paths-find-superlock-file (lock-directory) + "Find the 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) @@ -181,12 +137,12 @@ (paths-decode-directory-path path-envval 'drop-empties))) (packages-find-package-exec-path early-packages) (packages-find-package-exec-path late-packages) + (packages-find-package-exec-path last-packages) (let ((emacspath-envval (getenv "EMACSPATH"))) (and emacspath-envval (split-path emacspath-envval))) (and exec-directory - (list exec-directory)) - (packages-find-package-exec-path last-packages))) + (list exec-directory)))) (defun paths-find-data-directory (roots) "Find the data directory." @@ -198,7 +154,7 @@ (append (packages-find-package-data-path early-packages) (packages-find-package-data-path late-packages) - (list data-directory) - (packages-find-package-data-path last-packages))) + (packages-find-package-data-path last-packages) + (list data-directory))) ;;; setup-paths.el ends here diff --git a/lisp/startup.el b/lisp/startup.el index 5751967..19cbcc3 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -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, @@ -43,7 +43,6 @@ (defvar command-line-processed nil "t once command line has been processed") (defconst startup-message-timeout 12000) ; More or less disable the timeout -(defconst splash-frame-timeout 7) ; interval between splash frame elements (defconst inhibit-startup-message nil "*Non-nil inhibits the initial startup message. @@ -77,9 +76,9 @@ The frame system uses this to open frames to display messages while XEmacs loads the user's initialization file.") (defvar after-init-hook nil - "*Functions to call after loading the init file. + "*Functions to call after loading the init file (`.emacs'). The call is not protected by a condition-case, so you can set `debug-on-error' -in the init file, and put all the actual code on `after-init-hook'.") +in `.emacs', and put all the actual code on `after-init-hook'.") (defvar term-setup-hook nil "*Functions to be called after loading terminal-specific Lisp code. @@ -104,39 +103,22 @@ the user's init file.") (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 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-directory - (file-name-as-directory - (paths-construct-path (list "~" user-init-directory-base))) - "Directory where user-installed init files may go.") +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-init-file-base "init.el" - "Default name of the user init file if uncompiled. -This should be used for migration purposes only.") - -(defvar user-init-file-base-list '("init.elc" "init.el") - "List of allowed init files in the user's init directory. -The first one found takes precedence.") - -(defvar user-home-init-file-base-list - (append '(".emacs.elc" ".emacs.el" ".emacs") - (and (eq system-type 'windows-nt) - '("_emacs.elc" "_emacs.el" "_emacs"))) - "List of allowed init files in the user's home directory. -The first one found takes precedence.") - -(defvar load-home-init-file nil - "Non-nil if XEmacs should load the init file from the home directory. -Otherwise, XEmacs will offer migration to the init directory.") - -(defvar load-user-init-file-p t - "Non-nil if XEmacs should load the user's init file.") +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 -(defvar site-start-file "site-start" +(defvar site-start-file (purecopy "site-start") "File containing site-wide run-time initializations. This file is loaded at run-time before `.emacs'. It contains inits that need to be in place for the entire site, but @@ -159,17 +141,18 @@ is less convenient.") ;;We do that if this regexp matches the locale name ;;specified by the LC_ALL, LC_CTYPE and LANG environment variables.") -(defcustom mail-host-address nil - "*Name of this machine, for purposes of naming users." - :type 'string - :group 'mail) +(defvar mail-host-address nil + "*Name of this machine, for purposes of naming users.") -(defcustom user-mail-address nil +(defvar user-mail-address nil "*Full mailing address of this user. This is initialized based on `mail-host-address', -after your init file is read, in case it sets `mail-host-address'." - :type 'string - :group 'mail) +after your init file is read, in case it sets `mail-host-address'.") + +(defvar auto-save-list-file-prefix "~/.saves-" + "Prefix for generating auto-save-list-file-name. +Emacs's pid and the system name will be appended to +this prefix to create a unique file name.") (defvar init-file-debug nil) @@ -185,22 +168,23 @@ after, and will not be true at any time before.") (defvar command-switch-alist - '(("-help" . command-line-do-help) - ("-version". command-line-do-version) - ("-V" . command-line-do-version) - ("-funcall". command-line-do-funcall) - ("-f" . command-line-do-funcall) - ("-e" . command-line-do-funcall-1) - ("-eval" . command-line-do-eval) - ("-load" . command-line-do-load) - ("-l" . command-line-do-load) - ("-insert" . command-line-do-insert) - ("-i" . command-line-do-insert) - ("-kill" . command-line-do-kill) - ;; Options like +35 are handled specially. - ;; Window-system, site, or package-specific code might add to this. - ;; X11 handles its options by letting Xt remove args from this list. - ) + (purecopy + '(("-help" . command-line-do-help) + ("-version". command-line-do-version) + ("-V" . command-line-do-version) + ("-funcall". command-line-do-funcall) + ("-f" . command-line-do-funcall) + ("-e" . command-line-do-funcall-1) + ("-eval" . command-line-do-eval) + ("-load" . command-line-do-load) + ("-l" . command-line-do-load) + ("-insert" . command-line-do-insert) + ("-i" . command-line-do-insert) + ("-kill" . command-line-do-kill) + ;; Options like +35 are handled specially. + ;; Window-system, site, or package-specific code might add to this. + ;; X11 handles its options by letting Xt remove args from this list. + )) "Alist of command-line switches. Elements look like (SWITCH-STRING . HANDLER-FUNCTION). HANDLER-FUNCTION receives switch name as sole arg; @@ -215,21 +199,12 @@ remaining command-line args are in the variable `command-line-args-left'.") (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: - -sd Show dump ID. Ignored when configured without --pdump. - -nd Don't load the dump file. Roughly like old temacs. - Ignored when configured without --pdump. + -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 @@ -238,14 +213,12 @@ In addition, the") -debug-init Enter the debugger if an error in the init file occurs. -unmapped Do not map the initial frame. -no-site-file Do not load the site-specific init file (site-start.el). - -no-init-file Do not load the user-specific init file. + -no-init-file Do not load the user-specific init file (~/.emacs). -no-early-packages Do not process early packages. -no-autoloads Do not load global symbol files (auto-autoloads) at 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. -u <user> Same as -user.\n") (let ((l command-switch-alist) @@ -381,21 +354,23 @@ Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n") (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.") (setq command-line-processed t) ;; Canonicalize HOME (PWD is canonicalized by init_buffer in buffer.c) - (let ((value (user-home-directory))) - (if (and value - (< (length value) (length default-directory)) - (equal (file-attributes default-directory) - (file-attributes value))) - (setq default-directory (file-name-as-directory value)))) + (unless (eq system-type 'vax-vms) + (let ((value (user-home-directory))) + (if (and value + (< (length value) (length default-directory)) + (equal (file-attributes default-directory) + (file-attributes value))) + (setq default-directory (file-name-as-directory value))))) (setq default-directory (abbreviate-file-name default-directory)) (initialize-xemacs-paths) @@ -407,53 +382,48 @@ Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n") (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) + (startup-find-roots-warning) + (startup-setup-paths emacs-roots + inhibit-early-packages + inhibit-site-lisp + debug-paths)) (startup-setup-paths-warning)) (if (and (not inhibit-autoloads) 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) - (packages-load-package-auto-autoloads early-package-load-path)) + (packages-load-package-auto-autoloads last-package-load-path) (packages-load-package-auto-autoloads late-package-load-path) - (packages-load-package-auto-autoloads last-package-load-path))) - - (let (error-data) - (condition-case data - (command-line) - ;; catch non-error signals, especially quit - (t (setq error-data data))) - ;; Do this again, in case the init file defined more abbreviations. + (if (not inhibit-early-packages) + (packages-load-package-auto-autoloads early-package-load-path)))) + + (unwind-protect + (command-line) + ;; Do this again, in case .emacs defined more abbreviations. (setq default-directory (abbreviate-file-name default-directory)) ;; Specify the file for recording all the auto save files of ;; this session. This is used by recover-session. - (if auto-save-list-file-prefix - (setq auto-save-list-file-name - (expand-file-name - (format "%s%d-%s" - auto-save-list-file-prefix - (emacs-pid) - (system-name))))) + (setq auto-save-list-file-name + (expand-file-name + (format "%s%d-%s" + auto-save-list-file-prefix + (emacs-pid) + (system-name)))) (run-hooks 'emacs-startup-hook) (and term-setup-hook (run-hooks 'term-setup-hook)) (setq term-setup-hook nil) - ;; ;; Modify the initial frame based on what the init file puts into + ;; ;; Modify the initial frame based on what .emacs puts into ;; ;; ...-frame-alist. (frame-notice-user-settings) ;; ;;####FSFmacs junk @@ -462,18 +432,25 @@ Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n") ;; (font-menu-add-default)) (when window-setup-hook (run-hooks 'window-setup-hook)) - (setq window-setup-hook nil) - (if error-data - ;; re-signal, and don't allow continuation as that will probably - ;; wipe out the user's .emacs if she hasn't migrated yet! - (signal-error (car error-data) (cdr error-data)))) - - (if load-user-init-file-p - (maybe-migrate-user-init-file)) - ;; FSF calls precompute-menubar-bindings. We don't mix menubars - ;; and keymaps. + (setq window-setup-hook nil)) + ;;####FSFmacs junk + ;; (or menubar-bindings-done + ;; (precompute-menubar-bindings)) )) +;;####FSFmacs junk +;;; Precompute the keyboard equivalents in the menu bar items. +;;(defun precompute-menubar-bindings () +;; (if (eq window-system 'x) +;; (let ((submap (lookup-key global-map [menu-bar]))) +;; (while submap +;; (and (consp (car submap)) +;; (symbolp (car (car submap))) +;; (stringp (car-safe (cdr (car submap)))) +;; (keymapp (cdr (cdr (car submap)))) +;; (x-popup-menu nil (cdr (cdr (car submap))))) +;; (setq submap (cdr submap)))))) + (defun command-line-early (args) ;; This processes those switches which need to be processed before ;; starting up the window system. @@ -504,11 +481,16 @@ Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n") ;; (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) @@ -518,7 +500,7 @@ Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n") (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") @@ -529,23 +511,11 @@ Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n") ;; 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") @@ -557,10 +527,7 @@ Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n") (while args (push (pop args) new-args))) (t (push arg new-args)))) - - ;; obsolete, initialize for backward compatibility - (setq init-file-user (and load-user-init-file-p "")) - + (nreverse new-args))) (defconst initial-scratch-message "\ @@ -585,9 +552,6 @@ If this is nil, no message will be displayed.") ;; handled here instead of down in C. (setq command-line-args-left (command-line-early command-line-args-left)) - (when (eq system-type 'windows-nt) - (init-mswindows-at-startup)) - ;; Setup the toolbar icon directory (when (featurep 'toolbar) (init-toolbar-location)) @@ -604,11 +568,6 @@ If this is nil, no message will be displayed.") ;; 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 @@ -617,7 +576,7 @@ If this is nil, no message will be displayed.") ;;; Load init files. (load-init-file) - + (with-current-buffer (get-buffer "*scratch*") (erase-buffer) ;; (insert initial-scratch-message) @@ -642,7 +601,7 @@ If this is nil, no message will be displayed.") ;; 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) @@ -653,162 +612,43 @@ If this is nil, no message will be displayed.") (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-readable-p expanded) - (throw 'found expanded))))))) - -(defun find-user-home-directory-init-file (&optional home-directory) - "Determine the user's init file if in the home directory." - (let ((home-directory (or home-directory "~"))) - (catch 'found - (dolist (file user-home-init-file-base-list) - (let ((expanded (expand-file-name file home-directory))) - (when (file-readable-p expanded) - (throw 'found expanded)))) - nil))) - -(defun find-user-init-file (&optional init-directory home-directory) - "Determine the user's init file." - (if load-home-init-file - (find-user-home-directory-init-file home-directory) - (or (find-user-init-directory-init-file init-directory) - (find-user-home-directory-init-file home-directory)))) - -(defun maybe-migrate-user-init-file () - "Ask user if she wants to migrate the init file(s) to new location." - (if (and (not load-home-init-file) - (not (find-user-init-directory-init-file user-init-directory)) - (stringp user-init-file) - (file-readable-p user-init-file)) - (if (with-output-to-temp-buffer (help-buffer-name nil) - (progn - (princ "XEmacs recommends that the initialization code in -") - (princ user-init-file) - (princ " -be migrated to the ") - (princ user-init-directory) - (princ " directory. XEmacs can -perform the migration automatically. - -After the migration, init.el/init.elc holds user-written -initialization code. Moreover the customize settings will be in -custom.el. - -You can undo the migration at any time with -M-x maybe-unmigrate-user-init-file. - -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 - "? ")))) - (progn - (migrate-user-init-file) - (maybe-create-compatibility-dot-emacs)) - (customize-save-variable 'load-home-init-file t)))) - -(defun maybe-create-compatibility-dot-emacs () - "Ask user if she wants to create a .emacs compatibility file." - (if (with-output-to-temp-buffer (help-buffer-name nil) - (progn - (princ "The initialization code has now been migrated to the ") - (princ user-init-directory) - (princ "directory. - -For backwards compatibility with, for example, older versions of XEmacs, -XEmacs can create a special old-style .emacs file in your home -directory which will load the relocated initialization code.") - (show-temp-buffer-in-current-frame standard-output) - (yes-or-no-p-minibuf "Create compatibility .emacs? "))) - (create-compatibility-dot-emacs))) - -(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...") - (customize-set-value 'load-home-init-file nil) - (custom-migrate-custom-file (make-custom-file-name user-init-file - 'force-new)) - (message "Moving init file...") - (let ((new-user-init-file (expand-file-name user-init-file-base - user-init-directory))) - (rename-file user-init-file new-user-init-file) - (setq user-init-file new-user-init-file)) - (message "Migration done.")) - -(defun create-compatibility-dot-emacs () - "Create .emacs compatibility file for migrated setup." - (message "Creating .emacs compatibility file.") - (with-temp-file (expand-file-name ".emacs" "~") - (insert ";;; XEmacs backwards compatibility file\n") - (insert "(setq user-init-file\n") - (insert " (expand-file-name \"init.el\"\n") - (insert " (expand-file-name \".xemacs\" \"~\")))\n") - (insert "(setq custom-file\n") - (insert " (expand-file-name \"custom.el\"\n") - (insert " (expand-file-name \".xemacs\" \"~\")))\n") - (insert "\n") - (insert "(load-file user-init-file)\n") - (insert "(load-file custom-file)")) - (message "Created .emacs compatibility file.")) - -(defun maybe-unmigrate-user-init-file () - "Possibly unmigrate the user's init and custom files." - (interactive) - (let ((dot-emacs-file-name (expand-file-name ".emacs" "~"))) - (if (and (not load-home-init-file) - (or (not (file-exists-p dot-emacs-file-name)) - (yes-or-no-p-minibuf (concat "Overwrite " dot-emacs-file-name - "? ")))) - (unmigrate-user-init-file dot-emacs-file-name)))) - -(defun unmigrate-user-init-file (&optional target-file-name) - "Unmigrate the user's init and custom files." - (interactive) - (let ((target-file-name - (or target-file-name (expand-file-name ".emacs" "~")))) - (rename-file user-init-file target-file-name 'ok-if-already-exists) - (setq user-init-file target-file-name) - (let ((old-custom-file custom-file)) - (custom-migrate-custom-file target-file-name) - (customize-save-variable 'load-home-init-file t) - (delete-file old-custom-file)))) - -(defun load-user-init-file () - "This function actually reads the init file." - (if (not user-init-file) - (setq user-init-file - (find-user-init-file user-init-directory))) - (if (not custom-file) - (setq custom-file (make-custom-file-name user-init-file))) - ;; #### should test load-user-init-file-p here, not in load-init-file - ;; see comment there - (if (and user-init-file - (file-readable-p user-init-file)) - (load user-init-file t t t)) - (if (and custom-file - (or (not user-init-file) - (not (string= custom-file user-init-file))) - (file-readable-p custom-file)) - (load custom-file t t t)) - (unless inhibit-default-init - (let ((inhibit-startup-message nil)) - ;; Users are supposed to be told their rights. - ;; (Plus how to get help and how to undo.) - ;; Don't you dare turn this off for anyone except yourself. - (load "default" t t)))) +(defconst user-init-directory "/.xemacs/" + "Directory where user-installed packages may go.") +(define-obsolete-variable-alias + 'emacs-user-extension-dir + 'user-init-directory) + +(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 () @@ -829,23 +669,18 @@ directory which will load the relocated initialization code.") (debug-on-error-initial (if (eq init-file-debug t) 'startup init-file-debug))) (let ((debug-on-error debug-on-error-initial)) - ;; #### I believe this test is incorrect, it leads to custom-file - ;; (at least) being undefined - (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 - ;; #### probably incorrect, see comment above - (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)) (display-warning 'initialization (format "\ -An error has occurred while loading %s: +An error has occured while loading %s: %s @@ -901,23 +736,22 @@ a new format, when variables have changed, etc." (when (string= (buffer-name) "*scratch*") (unless (or inhibit-startup-message (input-pending-p)) - (let (tmout circ-tmout) + (let ((timeout nil)) (unwind-protect ;; Guts of with-timeout - (catch 'tmout - (setq tmout (add-timeout startup-message-timeout - (lambda (ignore) - (condition-case nil - (throw 'tmout t) - (error nil))) - nil)) - (setq circ-tmout (display-splash-frame)) + (catch 'timeout + (setq timeout (add-timeout startup-message-timeout + (lambda (ignore) + (condition-case nil + (throw 'timeout t) + (error nil))) + nil)) + (startup-splash-frame) (or nil;; (pos-visible-in-window-p (point-min)) (goto-char (point-min))) (sit-for 0) (setq unread-command-event (next-command-event))) - (when tmout (disable-timeout tmout)) - (when circ-tmout (disable-timeout circ-tmout))))) + (when timeout (disable-timeout timeout))))) (with-current-buffer (get-buffer "*scratch*") ;; In case the XEmacs server has already selected ;; another buffer, erase the one our message is in. @@ -932,7 +766,7 @@ a new format, when variables have changed, etc." (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 @@ -953,14 +787,14 @@ a new format, when variables have changed, etc." (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 @@ -991,7 +825,7 @@ a new format, when variables have changed, etc." (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) @@ -1010,12 +844,12 @@ a new format, when variables have changed, etc." (symbol-name e))) (defun splash-frame-present-hack (e v) - ;; (set-extent-property e 'mouse-face 'highlight) - ;; (set-extent-property e 'keymap - ;; startup-presentation-hack-keymap) - ;; (set-extent-property e 'startup-presentation-hack v) - ;; (set-extent-property e 'help-echo - ;; 'startup-presentation-hack-help) + ;; (set-extent-property e 'mouse-face 'highlight) + ;; (set-extent-property e 'keymap + ;; startup-presentation-hack-keymap) + ;; (set-extent-property e 'startup-presentation-hack v) + ;; (set-extent-property e 'help-echo + ;; 'startup-presentation-hack-help)) ) (defun splash-hack-version-string () @@ -1070,7 +904,7 @@ a new format, when variables have changed, etc." (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 @@ -1081,7 +915,7 @@ a new format, when variables have changed, etc." ;; 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) @@ -1093,125 +927,81 @@ a new format, when variables have changed, etc." (+ left-margin (round (/ (/ (- fill-area-width glyph-pixwidth) 2) avg-pixwidth))))) -(defun splash-frame-body () - `[((face (blue bold underline) - "\nDistribution, copying license, warranty:\n\n") - "Please visit the XEmacs website at http://www.xemacs.org !\n\n" - ,@(if (featurep 'sparcworks) - `( "\ +(defun startup-splash-frame-body () + `("\n" ,(emacs-version) "\n" + ,@(if (string-match "beta" emacs-version) + `( (face (bold blue) ( "This is an Experimental version of XEmacs. " + " Type " (key describe-beta) + " to see what this means.\n"))) + `( "\n")) + (face bold-italic "\ +Copyright (C) 1985-1997 Free Software Foundation, Inc. +Copyright (C) 1990-1994 Lucid, Inc. +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\n") + + ,@(if (featurep 'sparcworks) + `( "\ 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") - (getenv "LANG")))) - (if (and - (not (featurep 'mule)) ;; Already got mule? - ;; No Mule support on tty's yet - (not (eq 'tty (console-type))) - lang ;; Non-English locale? - (not (string= lang "C")) - (not (string-match "^en" lang)) - ;; Comes with Sun WorkShop - (locate-file "xemacs-mule" exec-path)) - '( "\ +All other XEmacs packages are provided to you \"AS IS\". +For full details, type " (key describe-no-warranty) +" to refer to the GPL Version 2, dated June 1991.\n\n" +,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") (getenv "LANG")))) + (if (and + (not (featurep 'mule)) ; Already got mule? + (not (eq 'tty (console-type))) ; No Mule support on tty's yet + lang ; Non-English locale? + (not (string= lang "C")) + (not (string-match "^en" lang)) + (locate-file "xemacs-mule" exec-path)) ; Comes with Sun WorkShop + '( "\ This version of XEmacs has been built with support for Latin-1 languages only. To handle other languages you need to run a Multi-lingual (`Mule') version of 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) - ": "(face (red bold) "XEmacs comes with ABSOLUTELY NO WARRANTY\n")) - ((key describe-copying) - ": conditions to give out copies of XEmacs\n") - ((key describe-distribution) - ": how to get the latest version\n") - "\n--\n" - (face italic "\ -Copyright (C) 1985-2001 Free Software Foundation, Inc. -Copyright (C) 1990-1994 Lucid, Inc. -Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved. -Copyright (C) 1994-1996 Board of Trustees, University of Illinois -Copyright (C) 1995-2001 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) - ": " (face (red bold) - "This is an Experimental version of XEmacs.\n")) - `( "\n")) - ((key xemacs-local-faq) - ": read the XEmacs FAQ (a " (face underline "capital") " F!)\n") - ((key help-with-tutorial) - ": read the XEmacs tutorial (also available through the " - (face bold "Help") " menu)\n") - ((key help-command) - ": get help on using XEmacs (also available through the " - (face bold "Help") " menu)\n") - ((key info) ": read the on-line documentation\n\n") - ((key describe-project) ": read about the GNU project\n") - ((key about-xemacs) ": see who's developing XEmacs\n")) - - ((face (blue bold underline) "\nUseful stuff:\n\n") - "Things that you should know rather quickly...\n\n" - ((key find-file) ": visit a file\n") - ((key save-buffer) ": save changes\n") - ((key advertised-undo) ": undo changes\n") - ((key save-buffers-kill-emacs) ": exit XEmacs\n")) - ]) +`ESERVE*defaultXEmacsPath: xemacs-mule' when starting XEmacs from Sun WorkShop.\n\n")))) + + '("XEmacs comes with ABSOLUTELY NO WARRANTY; type " + (key describe-no-warranty) " for full details.\n")) + + "You may give out copies of XEmacs; type " + (key describe-copying) " to see the conditions.\n" + "Type " (key describe-distribution) + " for information on getting the latest version.\n\n" + + "Type " (key help-command) " or use the " (face bold "Help") " menu to get help.\n" + "Type " (key advertised-undo) " to undo changes (`C-' means use the Control key).\n" + "To get out of XEmacs, type " (key save-buffers-kill-emacs) ".\n" + "Type " (key help-with-tutorial) " for a tutorial on using XEmacs.\n" + "Type " (key info) " to enter Info, " + "which you can use to read online documentation.\n" + (face (bold red) ( "\ +For tips and answers to frequently asked questions, see the XEmacs FAQ. +\(It's on the Help menu, or type " (key xemacs-local-faq) " [a capital F!].\)")))) ;; I really hate global variables, oh well. ;(defvar xemacs-startup-logo-function nil ; "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. -(defconst splash-frame-static-body - `(,(emacs-version) "\n\n" - (face italic "`C-' means the control key,`M-' means the meta key\n\n"))) - - -(defun circulate-splash-frame-elements (client-data) - (with-current-buffer (aref client-data 2) - (let ((buffer-read-only nil) - (elements (aref client-data 3)) - (indice (aref client-data 0))) - (goto-char (aref client-data 1)) - (delete-region (point) (point-max)) - (splash-frame-present (aref elements indice)) - (set-buffer-modified-p nil) - (aset client-data 0 - (if (= indice (- (length elements) 1)) - 0 - (1+ indice ))) - ))) - -;; #### This function now returns the (possibly nil) timeout circulating the -;; splash-frame elements -(defun display-splash-frame () - (let ((logo xemacs-logo) - (buffer-read-only nil) +(defun startup-splash-frame () + (let ((p (point)) +; (logo (cond (xemacs-startup-logo-function +; (funcall xemacs-startup-logo-function)) +; (t xemacs-logo))) + (logo xemacs-logo) (cramped-p (eq 'tty (console-type)))) (unless cramped-p (insert "\n")) (indent-to (startup-center-spaces logo)) (set-extent-begin-glyph (make-extent (point) (point)) logo) - ;;(splash-frame-present-hack (make-extent p (point)) 'about-xemacs)) - (insert "\n\n") - (splash-frame-present splash-frame-static-body) - (splash-hack-version-string) - (goto-char (point-max)) - (let* ((after-change-functions nil) ; no font-lock, thank you - (elements (splash-frame-body)) - (client-data `[ 1 ,(point) ,(current-buffer) ,elements ]) - tmout) - (if (listp elements) ;; A single element to display - (splash-frame-present (splash-frame-body)) - ;; several elements to rotate - (splash-frame-present (aref elements 0)) - (setq tmout (add-timeout splash-frame-timeout - 'circulate-splash-frame-elements - client-data splash-frame-timeout))) - (set-buffer-modified-p nil) - tmout))) + (insert (if cramped-p "\n" "\n\n")) + (splash-frame-present-hack (make-extent p (point)) 'about-xemacs)) + + (let ((after-change-functions nil)) ; no font-lock, thank you + (dolist (l (startup-splash-frame-body)) + (splash-frame-present l))) + (splash-hack-version-string) + (set-buffer-modified-p nil)) ;; (let ((present-file ;; #'(lambda (f) @@ -1234,8 +1024,7 @@ Copyright (C) 1995-2001 Ben Wing\n")) ;; 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. @@ -1250,9 +1039,7 @@ It's idempotent, so call this as often as you like!" 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)) @@ -1278,17 +1065,6 @@ It's idempotent, so call this as often as you like!" (princ (format "lisp-directory:\n%S\n" lisp-directory) 'external-debugging-output)) - (if (featurep 'mule) - (progn - (setq mule-lisp-directory - (paths-find-mule-lisp-directory roots - lisp-directory)) - (if debug-paths - (princ (format "mule-lisp-directory:\n%S\n" - mule-lisp-directory) - 'external-debugging-output))) - (setq mule-lisp-directory '())) - (setq site-directory (and (null inhibit-site-lisp) (paths-find-site-lisp-directory roots))) @@ -1301,18 +1077,29 @@ It's idempotent, so call this as often as you like!" late-package-load-path last-package-load-path lisp-directory - site-directory - mule-lisp-directory)) + site-directory)) (setq Info-directory-list (paths-construct-info-path roots early-packages late-packages last-packages)) - + (if debug-paths (princ (format "Info-directory-list:\n%S\n" Info-directory-list) 'external-debugging-output)) + (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 @@ -1326,7 +1113,7 @@ It's idempotent, so call this as often as you like!" (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 @@ -1360,18 +1147,20 @@ It's idempotent, so call this as often as you like!" (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 (and (featurep 'mule) - (null mule-lisp-directory)) - (push "mule-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 --git a/lisp/update-elc-2.el b/lisp/update-elc-2.el index eb2bd21..aa46fcf 100644 --- a/lisp/update-elc-2.el +++ b/lisp/update-elc-2.el @@ -52,18 +52,18 @@ (defvar update-elc-ignored-files ;; note: entries here are regexps '("^," ;; #### huh? - "^paths\\.el$" - "^loadup\\.el$" - "^loadup-el\\.el$" - "^update-elc\\.el$" - "^update-elc-2\\.el$" - "^dumped-lisp\\.el$" - "^make-docfile\\.el$" - "^site-start\\.el$" - "^site-load\\.el$" - "^site-init\\.el$" - "^version\\.el$" - "^very-early-lisp\\.el$")) + "^paths.el$" + "^loadup.el$" + "^loadup-el.el$" + "^update-elc.el$" + "^update-elc-2.el$" + "^dumped-lisp.el$" + "^make-docfile.el$" + "^site-start.el$" + "^site-load.el$" + "^site-init.el$" + "^version.el$" + "^very-early-lisp.el$")) ;; SEEN accumulates the list of already-handled dirs. (defun do-update-elc-2 (dir compile-stage-p seen) @@ -75,7 +75,7 @@ ;; Do this directory. (if compile-stage-p ;; Stage 2: Recompile necessary .els - (let ((files (directory-files dir t "\\.el$")) + (let ((files (directory-files dir t ".el$")) file file-c) (while (setq file (car files)) (setq files (cdr files)) @@ -95,7 +95,7 @@ ;; Stage 1. ;; Remove out-of-date elcs - (let ((files (directory-files dir t "\\.el$")) + (let ((files (directory-files dir t ".el$")) file file-c) (while (setq file (car files)) (setq files (cdr files)) @@ -105,7 +105,7 @@ (message "Removing out-of-date %s" file-c) (delete-file file-c)))) ;; Remove elcs without corresponding el - (let ((files (directory-files dir t "\\.elc$")) + (let ((files (directory-files dir t ".elc$")) file file-c) (while (setq file-c (car files)) (setq files (cdr files)) @@ -145,4 +145,4 @@ (message "Recompiling updated .els in directory tree `%s'...done" dir)) (setq command-line-args-left nil)) -;;; update-elc-2.el ends here +;;; cleantree.el ends here diff --git a/lisp/update-elc.el b/lisp/update-elc.el index 1fda28d..45b5e1d 100644 --- a/lisp/update-elc.el +++ b/lisp/update-elc.el @@ -1,9 +1,8 @@ ;;; update-elc.el --- Bytecompile out-of-date dumped files ;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Copyright (C) 1996 Sun Microsystems, Inc. +;; Copyright (C) 1996 Unknown -;; Author: Ben Wing <ben@xemacs.org>, Steven L Baur <steve@xemacs.org> ;; Maintainer: XEmacs Development Team ;; Keywords: internal @@ -40,7 +39,8 @@ ;; (the idea here is that you can bootstrap if your .ELC files ;; are missing or badly out-of-date) -;; See also update-elc-2.el +;; Currently this code gets the list of files to check passed to it from +;; src/Makefile. This must be fixed. -slb ;;; Code: @@ -62,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) @@ -72,7 +71,7 @@ (load "setup-paths.el") (load "dump-paths.el") -(let ((autol (packages-list-autoloads (concat default-directory "../lisp")))) +(let ((autol (packages-list-autoloads))) ;; (print (prin1-to-string autol)) (while autol (let ((src (car autol))) @@ -84,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 @@ -99,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) @@ -111,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 @@ -150,17 +123,10 @@ (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 - (nreverse processed))) + processed)) ;; (print (prin1-to-string update-elc-files-to-compile)) @@ -173,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 --git a/lisp/version.el b/lisp/version.el index d2bc894..87c1d79 100644 --- a/lisp/version.el +++ b/lisp/version.el @@ -36,19 +36,17 @@ Warning, this variable did not exist in XEmacs versions prior to 20.3") (defconst emacs-version - (format "%d.%d %s%s%s%s" - emacs-major-version - emacs-minor-version - (if emacs-patch-level - (format "(patch %d)" emacs-patch-level) - "") - (if xemacs-betaname - (concat " " xemacs-betaname) - "") - (if xemacs-codename - (concat " \"" xemacs-codename "\"") - "") - " XEmacs Lucid") + (purecopy + (format "%d.%d %s%s%s" + emacs-major-version + emacs-minor-version + (if xemacs-codename + (concat "\"" xemacs-codename "\"") + "") + " XEmacs Lucid" + (if xemacs-betaname + (concat " " xemacs-betaname) + ""))) "Version numbers of this version of XEmacs.") (if (featurep 'infodock) @@ -109,19 +107,16 @@ to the system configuration; look at `system-configuration' instead." (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) @@ -130,9 +125,10 @@ argument are optional. Only the Non-nil arguments are used in the test." ;; `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. -(concat "\n@" "(#)" (emacs-version) - "\n@" "(#)" "Configuration: " - system-configuration "\n") +(or (memq system-type '(vax-vms windows-nt ms-dos)) + (purecopy (concat "\n@" "(#)" (emacs-version) + "\n@" "(#)" "Configuration: " + system-configuration "\n"))) ;;Local variables: ;;version-control: never diff --git a/lisp/win32-native.el b/lisp/win32-native.el index a7187e2..8f9d8ac 100644 --- a/lisp/win32-native.el +++ b/lisp/win32-native.el @@ -1,4 +1,4 @@ -;;; win32-native.el --- Lisp routines when running on native MS Windows. +;;; win32-native.el --- Lisp routines for MS Windows. ;; Copyright (C) 1994 Free Software Foundation, Inc. ;; Copyright (C) 2000 Ben Wing. @@ -23,26 +23,24 @@ ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. -;;; Synched up with: Not in FSF. +;;; Synched up with: Not synched with FSF. Almost completely divergent. ;;; (FSF has stuff in w32-fns.el and term/w32-win.el.) ;;; Commentary: ;; This file is dumped with XEmacs for MS Windows (without cygwin). -;; It is for stuff that is used specifically when `system-type' eq -;; `windows-nt' (i.e. also applies to MinGW), and has nothing to do -;; with the `mswindows' device type. Thus, it probably applies in -;; non-interactive mode as well, and it DOES NOT APPLY to Cygwin. -;; Based (originally) on NT Emacs version by Geoff Voelker -;; (voelker@cs.washington.edu) +;; Based on NT Emacs version by Geoff Voelker (voelker@cs.washington.edu) ;; Ported to XEmacs by Marc Paquette <marcpa@cam.org> ;; Largely modified by Kirill M. Katsnelson <kkm@kis.ru> -;; Rewritten from scratch by Ben Wing <ben@xemacs.org>. No code in common -;; with FSF. ;;; Code: +;; The cmd.exe shell uses the "/c" switch instead of the "-c" switch +;; for executing its command line argument (from simple.el). +;; #### Oh if we had an alist of shells and their command switches. +(setq shell-command-switch "/c") + ;; For appending suffixes to directories and files in shell ;; completions. This screws up cygwin users so we leave it out for ;; now. Uncomment this if you only ever want to use cmd. @@ -63,26 +61,31 @@ (setq grep-regexp-alist '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3))) -(defvar mswindows-system-shells '("cmd" "cmd.exe" "command" "command.com" - "4nt" "4nt.exe" "4dos" "4dos.exe" - "ndos" "ndos.exe") - "List of strings recognized as Windows NT/9X system shells. -These are shells with native semantics, e.g. they use `/c', not '-c', -to pass a command in.") - -(defun mswindows-system-shell-p (shell-name) - (member (downcase (file-name-nondirectory shell-name)) - mswindows-system-shells)) - -(defun init-mswindows-at-startup () - ;; shell-file-name is initialized in the C code (callproc.c) from - ;; SHELL or COMSPEC. - ;; #### If only shell-command-switch could be a function. But there - ;; is code littered around that uses it. - ;; #### Maybe we should set a symbol-value handler on `shell-file-name' - ;; that automatically sets shell-command-switch? - (if (mswindows-system-shell-p shell-file-name) - (setq shell-command-switch "/c"))) +;;---------------------------------------------------------------------- +;; Autosave hack +;;-------------------- + +;; Avoid creating auto-save file names containing invalid characters +;; (primarily "*", eg. for the *mail* buffer). +;; Avoid "doc lost for function" warning +(defun original-make-auto-save-file-name (&optional junk) + "You do not want to call this." + ) +(fset 'original-make-auto-save-file-name + (symbol-function 'make-auto-save-file-name)) + +(defun make-auto-save-file-name () + "Return file name to use for auto-saves of current buffer. +Does not consider `auto-save-visited-file-name' as that variable is checked +before calling this function. You can redefine this for customization. +See also `auto-save-file-name-p'." + (let ((name (original-make-auto-save-file-name)) + (start 0)) + ;; destructively replace occurrences of * or ? with $ + (while (string-match "[?*]" name start) + (aset name (match-beginning 0) ?$) + (setq start (1+ (match-end 0)))) + name)) ;;---------------------------------------------------------------------- ;; Quoting process args @@ -99,32 +102,28 @@ to the process appear to be getting passed incorrectly.") ;; we also include shell metachars if asked. ;; note that \ is NOT included! it's perfectly OK to include an ;; arg like c:\ or c:\foo. - (cond ((equal arg "") "\"\"") - ((string-match - (if quote-shell "[ \t\n\r\f*?\"<>|&^%]" "[ \t\n\r\f*?\"]") - arg) - ;; handle nested quotes, possibly preceded by backslashes - (setq arg (replace-in-string arg "\\([\\]*\\)\"" "\\1\\1\\\\\"")) - ;; handle trailing backslashes - (setq arg (replace-in-string arg "\\([\\]+\\)$" "\\1\\1")) - (concat "\"" arg "\"")) - (t arg))) + (if (string-match (if quote-shell "[ \t\n\r\f*?\"<>|&^%]" "[ \t\n\r\f*?\"]") + arg) + (progn + ;; handle nested quotes, possibly preceded by backslashes + (setq arg (replace-in-string arg "\\([\\]*\\)\"" "\\1\\1\\\\\"")) + ;; handle trailing backslashes + (setq arg (replace-in-string arg "\\([\\]+\\)$" "\\1\\1")) + (concat "\"" arg "\"")) + arg)) (defun mswindows-quote-one-simple-arg (arg &optional quote-shell) ;; just put double quotes around args with spaces (and maybe shell ;; metachars). - (cond ((equal arg "") "\"\"") - ((string-match - (if quote-shell "[ \t\n\r\f*?\"<>|&^%]" "[ \t\n\r\f*?]") - arg) - (concat "\"" arg "\"")) - (t arg))) + (if (string-match (if quote-shell "[ \t\n\r\f*?\"<>|&^%]" "[ \t\n\r\f*?]") + arg) + (concat "\"" arg "\"") + arg)) (defun mswindows-quote-one-command-arg (arg) ;; quote an arg to get it past COMMAND.COM/CMD.EXE: need to quote shell ;; metachars with ^. - (cond ((equal arg "") "\"\"") - (t (replace-in-string "[<>|&^%]" "^\\1" arg)))) + (replace-in-string "[<>|&^%]" "^\\1" arg)) (defun mswindows-construct-verbatim-command-line (program args) (mapconcat #'identity args " ")) @@ -225,11 +224,7 @@ to the process appear to be getting passed incorrectly.") args " ")) (defvar mswindows-construct-process-command-line-alist - '( - ;; at one point (pre-1.0), this was required for Cygwin bash. - ;; evidently, Cygwin changed its arg handling to work just like - ;; any standard VC program, so we no longer need it. - ;;("[\\/].?.?sh\\." . mswindows-construct-verbatim-command-line) + '(("[\\/].?.?sh\\." . mswindows-construct-verbatim-command-line) ("[\\/]command\\.com$" . mswindows-construct-command-command-line) ("[\\/]cmd\\.exe$" . mswindows-construct-command-command-line) ("" . mswindows-construct-vc-runtime-command-line)) diff --git a/lisp/winnt.el b/lisp/winnt.el new file mode 100644 index 0000000..b0898a9 --- /dev/null +++ b/lisp/winnt.el @@ -0,0 +1,137 @@ +;;; winnt.el --- Lisp routines for Windows NT. + +;; Copyright (C) 1994 Free Software Foundation, Inc. + +;; Maintainer: XEmacs Development Team +;; Keywords: mouse, dumped + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs; see the file COPYING. If not, write to the +;; Free Software Foundation, 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Synched up with: Not synched with FSF. Almost completely divergent. + +;;; Commentary: + +;; This file is dumped with XEmacs for MS Windows (without cygwin). + +;; Based on NT Emacs version by Geoff Voelker (voelker@cs.washington.edu) +;; Ported to XEmacs by Marc Paquette <marcpa@cam.org> +;; Largely modified by Kirill M. Katsnelson <kkm@kis.ru> + +;;; Code: + +;; The cmd.exe shell uses the "/c" switch instead of the "-c" switch +;; for executing its command line argument (from simple.el). +;; #### Oh if we had an alist of shells and their command switches. +(setq shell-command-switch "/c") + +;; For appending suffixes to directories and files in shell completions. +(defun nt-shell-mode-hook () + (setq comint-completion-addsuffix '("\\" . " ") + comint-process-echoes t)) +(add-hook 'shell-mode-hook 'nt-shell-mode-hook) + +;; Use ";" instead of ":" as a path separator (from files.el). +(setq path-separator ";") + +;; Set the null device (for compile.el). +;; #### There should be such a global thingy as null-device - kkm +(setq grep-null-device "NUL") + +;; Set the grep regexp to match entries with drive letters. +(setq grep-regexp-alist + '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3))) + +;;---------------------------------------------------------------------- +;; Autosave hack +;;-------------------- + +;; Avoid creating auto-save file names containing invalid characters +;; (primarily "*", eg. for the *mail* buffer). +;; Avoid "doc lost for function" warning +(defun original-make-auto-save-file-name (&optional junk) + "You do not want to call this." + ) +(fset 'original-make-auto-save-file-name + (symbol-function 'make-auto-save-file-name)) + +(defun make-auto-save-file-name () + "Return file name to use for auto-saves of current buffer. +Does not consider `auto-save-visited-file-name' as that variable is checked +before calling this function. You can redefine this for customization. +See also `auto-save-file-name-p'." + (let ((name (original-make-auto-save-file-name)) + (start 0)) + ;; destructively replace occurences of * or ? with $ + (while (string-match "[?*]" name start) + (aset name (match-beginning 0) ?$) + (setq start (1+ (match-end 0)))) + name)) + +;;---------------------------------------------------------------------- +;; Quoting process args +;;-------------------- + +(defun nt-quote-args-verbatim (args) + "Copy ARG list verbatim, separating each arg with space." + (mapconcat 'identity args " ")) + +(defun nt-quote-args-prefix-quote (prefix args) + (mapconcat (lambda (str) + (concat "\"" + (mapconcat (lambda (ch) + (concat (if (eq ch ?\") prefix) + (char-to-string ch))) + str nil) + "\"")) + args " ")) + +(defun nt-quote-args-backslash-quote (args) + "Place ARG list in quotes, prefixing quotes in args with backslashes." + (nt-quote-args-prefix-quote "\\" args)) + +(defun nt-quote-args-double-quote (args) + "Place ARG list in quotes, doubling quotes in args." + (nt-quote-args-prefix-quote "\"" args)) + +(defvar nt-quote-args-functions-alist + '(("^.?.?sh\\." . nt-quote-args-double-quote)) + "An alist for determining proper argument quoting given executable file name. +Car of each cons must be a string, a regexp against which a file name sans +directory is matched. Cdr is a function symbol. The list is mathced in +forward order, and mathcing entry cdr's funcrion is called with a list of +strings, process arguments. It must return a string which is passed to +the newly created process. + +If not found, then `nt-quote-args-verbatim' is called on the argument list.") + +(defun nt-quote-process-args (args) + ;;Properly quote process ARGS for executing (car ARGS). + (let ((fname (file-name-nondirectory (car args))) + (alist nt-quote-args-functions-alist) + (case-fold-search nil) + (return-me nil) + (assoc nil)) + (while (and alist + (null return-me)) + (setq assoc (pop alist)) + (if (string-match (car assoc) fname) + (setq return-me (funcall (cdr assoc) (cdr args))))) + (or return-me + (nt-quote-args-verbatim (cdr args))))) + +;;; winnt.el ends here diff --git a/lock/.precious b/lock/.precious new file mode 100644 index 0000000..1650a2e --- /dev/null +++ b/lock/.precious @@ -0,0 +1 @@ +Dummy file to keep CVS happy. diff --git a/lwlib/config.h b/lwlib/config.h new file mode 100644 index 0000000..34aab2c --- /dev/null +++ b/lwlib/config.h @@ -0,0 +1,33 @@ +/* lwlib/config.h. Generated automatically by configure. */ +/* Lwlib site configuration template file. -*- C -*- + Copyright (C) 1997 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. */ + +/* Not in FSF. */ + +#ifndef _LWLIB_CONFIG_H_ +#define _LWLIB_CONFIG_H_ + +#include <../src/config.h> + +/* #undef NEED_MOTIF */ +/* #undef NEED_ATHENA */ +/* #undef NEED_LUCID */ + +#endif /* _LWLIB_CONFIG_H_ */ diff --git a/lwlib/xlwcheckbox.c b/lwlib/xlwcheckbox.c index 9c685bc..16ab1fd 100644 --- a/lwlib/xlwcheckbox.c +++ b/lwlib/xlwcheckbox.c @@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: June 30, 1997 * * Overview: This widget is identical to the Radio widget in behavior, @@ -38,7 +38,7 @@ Boston, MA 02111-1307, USA. */ #include <X11/IntrinsicP.h> #include <X11/StringDefs.h> -#include ATHENA_XawInit_h_ +#include <X11/Xaw/XawInit.h> #include "../src/xmu.h" #include "xlwcheckboxP.h" @@ -65,7 +65,7 @@ Boston, MA 02111-1307, USA. */ #if DRAW_CHECK #define check_width 14 #define check_height 14 -static unsigned char check_bits[] = { +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}; @@ -126,7 +126,7 @@ static XtActionsRec actionsList[] = CheckboxClassRec checkboxClassRec = { { - (WidgetClass) SuperClass, /* superclass */ + (WidgetClass) SuperClass, /* superclass */ "Checkbox", /* class_name */ sizeof(CheckboxRec), /* size */ CheckboxClassInit, /* class_initialize */ @@ -170,7 +170,7 @@ CheckboxClassRec checkboxClassRec = { NULL /* extension */ }, /* CoreClass fields initialization */ { - XtInheritChangeSensitive /* change_sensitive */ + XtInheritChangeSensitive /* change_sensitive */ }, /* SimpleClass fields initialization */ #ifdef _ThreeDP_h { @@ -271,7 +271,7 @@ CheckboxRealize(Widget w, /* Function Name: CheckboxDestroy * Description: Destroy Callback for checkbox widget. * Arguments: w - the checkbox widget that is being destroyed. - * junk, garbage - not used. + * junk, grabage - not used. * Returns: none. */ diff --git a/lwlib/xlwgauge.c b/lwlib/xlwgauge.c index 074a6c7..a6c223b 100644 --- a/lwlib/xlwgauge.c +++ b/lwlib/xlwgauge.c @@ -1,4 +1,4 @@ -/* Gauge Widget for XEmacs. +/* Gauge Widget for XEmacs. Copyright (C) 1999 Edward A. Falk This file is part of XEmacs. @@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: July 9, 1997 * * Note: for fun and demonstration purposes, I have added selection @@ -52,7 +52,7 @@ Boston, MA 02111-1307, USA. */ #include <X11/IntrinsicP.h> #include <X11/Xatom.h> #include <X11/StringDefs.h> -#include ATHENA_XawInit_h_ +#include <X11/Xaw/XawInit.h> #include "xlwgaugeP.h" #include "../src/xmu.h" #ifdef HAVE_XMU @@ -135,11 +135,11 @@ static void GaugeGetValue (XtPointer, XtIntervalId *); static void GaugeMercury (Display *, Window, GC, GaugeWidget, Cardinal, Cardinal); static Boolean GaugeConvert (Widget, Atom *, Atom *, Atom *, - XtPointer *, unsigned long *, int *); + XtPointer *, u_long *, int *); static void GaugeLoseSel (Widget, Atom *); static void GaugeDoneSel (Widget, Atom *, Atom *); static void GaugeGetSelCB (Widget, XtPointer, Atom *, Atom *, - XtPointer, unsigned long *, int *); + XtPointer, u_long *, int *); static GC Get_GC (GaugeWidget, Pixel); @@ -160,7 +160,7 @@ static XtActionsRec actionsList[] = GaugeClassRec gaugeClassRec = { { -/* core_class fields */ +/* core_class fields */ /* superclass */ (WidgetClass) &labelClassRec, /* class_name */ "Gauge", /* widget_size */ sizeof(GaugeRec), @@ -334,7 +334,7 @@ GaugeResize (Widget w) } else { - gw->gauge.margin0 = + gw->gauge.margin0 = gw->gauge.margin1 = lh / 2 ; size += lwm + vmargin ; } @@ -404,7 +404,7 @@ register Window win = XtWindow(w) ; } /* if the gauge is selected, signify by drawing the background - * in a contrasting color. + * in a constrasting color. */ if( gw->gauge.selected ) @@ -466,7 +466,7 @@ register Window win = XtWindow(w) ; if( gw->gauge.nlabels > 1 ) { char label[20], *s = label ; - int xlen, wd,h =0 ; + int len, w,h =0 ; if( gw->gauge.orientation == XtorientHorizontal ) y = gw->gauge.lmargin + gw->label.font->max_bounds.ascent - 1 ; @@ -483,13 +483,13 @@ register Window win = XtWindow(w) ; s = gw->gauge.labels[i] ; if( s != NULL ) { x = e0 + i*(e1-e0-1)/(gw->gauge.nlabels-1) ; - xlen = strlen(s) ; + len = strlen(s) ; if( gw->gauge.orientation == XtorientHorizontal ) { - wd = XTextWidth(gw->label.font, s, xlen) ; - XDrawString(dpy,win,gc, x-wd/2,y, s,xlen) ; + w = XTextWidth(gw->label.font, s, len) ; + XDrawString(dpy,win,gc, x-w/2,y, s,len) ; } else { - XDrawString(dpy,win,gc, y,x+h, s,xlen) ; + XDrawString(dpy,win,gc, y,x+h, s,len) ; } } } @@ -540,7 +540,7 @@ GaugeSetValues (Widget old, else GaugeResize(new) ; } - + if( gw->gauge.update != oldgw->gauge.update ) { if( gw->gauge.update > 0 ) @@ -636,7 +636,7 @@ GaugeConvert (Widget w, Atom *target, /* requested target */ Atom *type, /* returned type */ XtPointer *value, /* returned value */ - unsigned long *length, /* returned length */ + u_long *length, /* returned length */ int *format) /* returned format */ { GaugeWidget gw = (GaugeWidget)w ; @@ -650,7 +650,7 @@ GaugeConvert (Widget w, if( *target == XA_TARGETS(XtDisplay(w)) ) { Atom *rval, *stdTargets ; - unsigned long stdLength ; + u_long stdLength ; /* XmuConvertStandardSelection can handle this. This function * will return a list of standard targets. We prepend TEXT, @@ -668,13 +668,13 @@ GaugeConvert (Widget w, *rval++ = XA_INTEGER ; *rval++ = XA_STRING ; *rval++ = XA_TEXT(XtDisplay(w)) ; - memcpy((char *)rval, (char *)stdTargets, stdLength*sizeof(Atom)) ; + bcopy((char *)stdTargets, (char *)rval, stdLength*sizeof(Atom)) ; XtFree((char*) stdTargets) ; *format = 8*sizeof(Atom) ; /* TODO: needed? */ return True ; } - else + else #endif if( *target == XA_INTEGER ) { @@ -685,10 +685,10 @@ GaugeConvert (Widget w, return True ; } - else if( *target == XA_STRING + else if( *target == XA_STRING #ifdef HAVE_XMU - || - *target == XA_TEXT(XtDisplay(w)) + || + *target == XA_TEXT(XtDisplay(w)) #endif ) { @@ -707,7 +707,7 @@ GaugeConvert (Widget w, if( XmuConvertStandardSelection(w, req->time, selection, target, type, (XPointer *) value, length, format) ) return True ; - else + else #endif { printf( @@ -774,7 +774,7 @@ GaugeGetSelCB (Widget w, Atom *selection, Atom *type, XtPointer value, - unsigned long *length, + u_long *length, int *format) { Display *dpy = XtDisplay(w) ; @@ -787,12 +787,12 @@ GaugeGetSelCB (Widget w, XawGaugeSetValue(w, *iptr) ; } - else if( *type == XA_STRING + else if( *type == XA_STRING #ifdef HAVE_XMU || - *type == XA_TEXT(dpy) + *type == XA_TEXT(dpy) #endif - ) + ) { cptr = (char *)value ; XawGaugeSetValue(w, atoi(cptr)) ; diff --git a/lwlib/xlwgauge.h b/lwlib/xlwgauge.h index ceb21ef..fb4875d 100644 --- a/lwlib/xlwgauge.h +++ b/lwlib/xlwgauge.h @@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: July 8, 1997 */ @@ -42,7 +42,7 @@ Boston, MA 02111-1307, USA. */ * ***********************************************************************/ -#include ATHENA_Label_h_ +#include <X11/Xaw/Label.h> /* Resources: @@ -89,7 +89,7 @@ Boston, MA 02111-1307, USA. */ +++ 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 application. + 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. @@ -102,7 +102,7 @@ Boston, MA 02111-1307, USA. */ { *(Cardinal *)rval = value ; } - + */ /* diff --git a/lwlib/xlwgaugeP.h b/lwlib/xlwgaugeP.h index bc6b19c..3a14e41 100644 --- a/lwlib/xlwgaugeP.h +++ b/lwlib/xlwgaugeP.h @@ -40,7 +40,7 @@ Boston, MA 02111-1307, USA. */ ***********************************************************************/ #include "xlwgauge.h" -#include ATHENA_LabelP_h_ +#include <X11/Xaw/LabelP.h> /* New fields for the Gauge widget class record */ diff --git a/lwlib/xlwgcs.c b/lwlib/xlwgcs.c index 94a273b..f720522 100644 --- a/lwlib/xlwgcs.c +++ b/lwlib/xlwgcs.c @@ -1,25 +1,25 @@ /* Tabs Widget for XEmacs. Copyright (C) 1999 Edward A. Falk - + This file is part of XEmacs. - + XEmacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + XEmacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with XEmacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + /* Synched up with: Gcs.c 1.7 */ - + /* #### This code is duplicated many times within lwlib and XEmacs. It should be modularised. */ @@ -162,15 +162,14 @@ * * If the widget's background is solid white or solid black, * this code just picks some numbers. (The choice is designed - * to be compatible with ThreeD interface.) + * to be compatibile with ThreeD interface.) */ #if XtSpecificationRelease < 5 -static GC XtAllocateGC(Widget, int, unsigned long, XGCValues *, - unsigned long, unsigned long) ; +static GC XtAllocateGC(Widget, int, u_long, XGCValues *, u_long, u_long) ; #endif @@ -187,7 +186,7 @@ GC AllocFgGC(Widget w, Pixel fg, Font font) { XGCValues values ; - unsigned long vmask, dcmask ; + u_long vmask, dcmask ; values.foreground = fg ; values.font = font ; @@ -234,7 +233,7 @@ AllocShadeGC(Widget w, Pixel fg, Pixel bg, Font font, int contrast, Bool be_nice_to_cmap) { XGCValues values ; - unsigned long vmask, dcmask ; + u_long vmask, dcmask ; values.foreground = fg ; values.background = bg ; @@ -343,7 +342,7 @@ AllocArmGC(Widget w, int contrast, Bool be_nice_to_cmap) GCFont|GCSubwindowMode|GCGraphicsExposures| GCDashOffset|GCDashList|GCArcMode) ; } - else + else #endif { values.foreground = AllocShadowPixel(w, 100-contrast) ; @@ -514,20 +513,18 @@ Draw3dBox(Widget w, int x, int y, int wid, int hgt, int s, GC topgc, GC botgc) #if XtSpecificationRelease < 5 static GC -XtAllocateGC(Widget w, int depth, unsigned long mask, XGCValues *values, - unsigned long dynamic, unsigned long dontcare) +XtAllocateGC(Widget w, int depth, u_long mask, XGCValues *values, + u_long dynamic, du_long ontcare) { return XtGetGC(w, mask, values) ; } #endif -#ifdef HAVE_XMU - -static unsigned char screen0[2] = {0,0} ; -static unsigned char screen25[2] = {0,0xaa} ; -static unsigned char screen75[2] = {0xaa,0xff} ; -static unsigned char screen100[2] = {0xff,0xff} ; +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) @@ -546,5 +543,3 @@ getDitherPixmap(Widget w, int contrast) else return XCreateBitmapFromData(dpy,win, (char *)screen100, 2,2) ; } - -#endif /* HAVE_XMU */ diff --git a/lwlib/xlwgcs.h b/lwlib/xlwgcs.h index 30b9b86..6ecedac 100644 --- a/lwlib/xlwgcs.h +++ b/lwlib/xlwgcs.h @@ -1,25 +1,25 @@ /* Tabs Widget for XEmacs. Copyright (C) 1999 Edward A. Falk - + This file is part of XEmacs. - + XEmacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + XEmacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with XEmacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + /* Synched up with: Gcs 1.7 */ - + #ifndef GCS_H #define GCS_H @@ -35,7 +35,7 @@ * AllocShadeGC() * Given foreground, background, a contrast value & be_nice_to_colormap * flag, return a GC suitable for rendering in an intermediate color, - * as determined by contrast. May return a dither pattern or a + * 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 @@ -117,9 +117,8 @@ 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, unsigned long mask, - XGCValues *, - unsigned long dynamic, unsigned long dontcare) ; +extern GC XtAllocateGC(Widget, int depth, u_long mask, + XGCValues *, u_long dynamic, u_long dontcare) ; #endif #else diff --git a/lwlib/xlwradio.c b/lwlib/xlwradio.c index 207a1ff..18f9cdd 100644 --- a/lwlib/xlwradio.c +++ b/lwlib/xlwradio.c @@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: June 30, 1997 * * @@ -53,7 +53,7 @@ Boston, MA 02111-1307, USA. */ #include <X11/IntrinsicP.h> #include <X11/StringDefs.h> -#include ATHENA_XawInit_h_ +#include <X11/Xaw/XawInit.h> #include "../src/xmu.h" #include "xlwradioP.h" @@ -120,7 +120,7 @@ static XtActionsRec actionsList[] = RadioClassRec radioClassRec = { { - (WidgetClass) SuperClass, /* superclass */ + (WidgetClass) SuperClass, /* superclass */ "Radio", /* class_name */ sizeof(RadioRec), /* size */ RadioClassInit, /* class_initialize */ @@ -154,7 +154,7 @@ RadioClassRec radioClassRec = { NULL /* extension */ }, /* CoreClass fields initialization */ { - XtInheritChangeSensitive /* change_sensitive */ + XtInheritChangeSensitive /* change_sensitive */ }, /* SimpleClass fields initialization */ #ifdef _ThreeDP_h { @@ -241,7 +241,7 @@ RadioInit (Widget request, /* Function Name: RadioDestroy * Description: Destroy Callback for radio widget. * Arguments: w - the radio widget that is being destroyed. - * junk, garbage - not used. + * junk, grabage - not used. * Returns: none. */ @@ -272,13 +272,13 @@ RadioResize (Widget w) switch( rw->label.justify ) { case XtJustifyLeft: - rw->label.label_x += (bs(rw) + rw->label.internal_width) ; + rw->label.label_x += bs(rw) + rw->label.internal_width ; break ; case XtJustifyRight: break ; case XtJustifyCenter: default: - rw->label.label_x += (bs(rw) + rw->label.internal_width)/2; + rw->label.label_x += (bs(rw) + rw->label.internal_width)/2 ; break ; } } @@ -328,10 +328,10 @@ RadioExpose (Widget w, { /* 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, - 1UL) ; + 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 */ @@ -375,13 +375,6 @@ RadioSetValues (Widget current, 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 ; } @@ -423,7 +416,7 @@ RadioQueryGeometry (Widget w, * border. */ -static void +static void DrawHighlight (Widget w, GC gc) { @@ -473,7 +466,7 @@ RadioUnhighlight (Widget w, /* ARGSUSED */ -void +void RadioSet (Widget w, XEvent *event, String *params, /* unused */ @@ -492,7 +485,7 @@ RadioSet (Widget w, /* ARGSUSED */ -void +void RadioUnset (Widget w, XEvent *event, String *params, /* unused */ diff --git a/lwlib/xlwradio.h b/lwlib/xlwradio.h index 0cffdad..c23a714 100644 --- a/lwlib/xlwradio.h +++ b/lwlib/xlwradio.h @@ -42,7 +42,7 @@ Boston, MA 02111-1307, USA. */ * ***********************************************************************/ -#include ATHENA_Toggle_h_ +#include <X11/Xaw/Toggle.h> /* Resources: diff --git a/lwlib/xlwradioP.h b/lwlib/xlwradioP.h index d45fecc..9983c8e 100644 --- a/lwlib/xlwradioP.h +++ b/lwlib/xlwradioP.h @@ -32,7 +32,7 @@ Boston, MA 02111-1307, USA. */ #define _XawRadioP_h #include "xlwradio.h" -#include ATHENA_ToggleP_h_ +#include <X11/Xaw/ToggleP.h> /*********************************************************************** * @@ -40,9 +40,7 @@ Boston, MA 02111-1307, USA. */ * ***********************************************************************/ -/* Already in Xaw/ToggleP.h, and not used by us. - #define streq(a, b) ( strcmp((a), (b)) == 0 ) -*/ +#define streq(a, b) ( strcmp((a), (b)) == 0 ) typedef void (*XawDiamondProc) (Widget); diff --git a/lwlib/xlwtabs.c b/lwlib/xlwtabs.c index ec1502a..e58d6fa 100644 --- a/lwlib/xlwtabs.c +++ b/lwlib/xlwtabs.c @@ -1,30 +1,25 @@ /* Tabs Widget for XEmacs. Copyright (C) 1999 Edward A. Falk - + This file is part of XEmacs. - + XEmacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + XEmacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with XEmacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - /* Synched up with: Tabs.c 1.27. - - #### This file contains essential XEmacs related fixes to the original - verison of the Tabs widget. Be VERY careful about syncing if you ever - update to a more recent version. In general this is probably now a - bad idea. */ - + + /* Synched up with: Tabs.c 1.23 */ + /* * Tabs.c - Index Tabs composite widget * @@ -56,8 +51,8 @@ * the frame. */ -/* - * TODO: min child height = tab height +/* TODO: min child height = tab height + * */ #include <config.h> @@ -66,8 +61,6 @@ #include <X11/Xlib.h> #include <X11/IntrinsicP.h> #include <X11/StringDefs.h> - -#include "lwlib-internal.h" #include "../src/xmu.h" #include "xlwtabsP.h" #include "xlwgcs.h" @@ -129,7 +122,7 @@ static char accelTable[] = " #augment\n\ <Key>KP_Down: highlight(down) \n\ <Key> : page(select) \n\ " ; -static XtAccelerators defaultAccelerators ; /* #### Never used */ +static XtAccelerators defaultAccelerators ; #define offset(field) XtOffsetOf(TabsRec, tabs.field) static XtResource resources[] = { @@ -146,8 +139,6 @@ static XtResource resources[] = { XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, (XtPointer)0}, {XtNtopWidget, XtCTopWidget, XtRWidget, sizeof(Widget), offset(topWidget), XtRImmediate, NULL}, - {XtNhighlightWidget, XtCHighlightWidget, XtRWidget, sizeof(Widget), - offset(hilight), XtRImmediate, NULL}, {XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer), offset(callbacks), XtRCallback, NULL}, {XtNpopdownCallback, XtCCallback, XtRCallback, sizeof(XtPointer), @@ -198,7 +189,6 @@ static void TabsExpose(); static void TabsDestroy(); static void TabsRealize(); static Boolean TabsSetValues(); -static Boolean TabsAcceptFocus(); static XtGeometryResult TabsQueryGeometry(); static XtGeometryResult TabsGeometryManager(); static void TabsChangeManaged(); @@ -247,7 +237,6 @@ 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, @@ -271,17 +260,17 @@ 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, Dimension wid, Dimension hgt, Dimension *r_hgt, +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 MaxChild(TabsWidget) ; 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, Dimension cw, Dimension ch, +static int PreferredSize2( TabsWidget, int cw, int ch, Dimension *rw, Dimension *rh) ; -static int PreferredSize3( TabsWidget, Dimension wid, Dimension hgt, +static int PreferredSize3( TabsWidget, int wid, int hgt, Dimension *rw, Dimension *rh) ; static void MakeSizeRequest(TabsWidget) ; @@ -336,13 +325,9 @@ TabsClassRec tabsClassRec = { /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, -#if XtSpecificationRelease < 6 - /* compress_exposure */ XtExposeCompressMaximal, -#else - /* compress_exposure */ XtExposeCompressMaximal|XtExposeNoRegion, -#endif + /* compress_exposure */ TRUE, /* compress_enterleave*/ TRUE, - /* visible_interest */ TRUE, + /* visible_interest */ FALSE, /* destroy */ TabsDestroy, /* resize */ TabsResize, /* expose */ TabsExpose, @@ -350,7 +335,7 @@ TabsClassRec tabsClassRec = { /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, - /* accept_focus */ TabsAcceptFocus, + /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defaultTranslations, @@ -396,10 +381,21 @@ TabsClassRec tabsClassRec = { WidgetClass tabsWidgetClass = (WidgetClass)&tabsClassRec; -#define TabsNumChildren(tw) (((TabsWidget)tw)->composite.num_children) -#define TabVisible(tab) \ - (XtIsManaged(tab) && \ - ((TabsConstraints)((tab)->core.constraints))->tabs.visible) + + +#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 + + /**************************************************************** @@ -428,7 +424,7 @@ TabsInit(Widget request, Widget new, ArgList args, Cardinal *num_args) TabsWidget newTw = (TabsWidget)new; newTw->tabs.numRows = 0 ; - newTw->tabs.realRows = 0; + newTw->tabs.displayChildren = 0; GetPreferredSizes(newTw) ; @@ -464,7 +460,7 @@ TabsInit(Widget request, Widget new, ArgList args, Cardinal *num_args) newTw->tabs.grey50 = None ; newTw->tabs.needs_layout = False ; - + newTw->tabs.hilight = NULL ; #ifdef NEED_MOTIF @@ -484,7 +480,7 @@ TabsConstraintInitialize(Widget request, Widget new, { TabsConstraints tab = (TabsConstraints) new->core.constraints ; tab->tabs.greyAlloc = False ; /* defer allocation of pixel */ - tab->tabs.visible = False ; + tab->tabs.queried = False ; /* defer size query */ getBitmapInfo((TabsWidget)XtParent(new), tab) ; TabWidth(new) ; @@ -529,7 +525,7 @@ TabsResize(Widget w) int i ; int num_children = tw->composite.num_children ; Widget *childP ; - TabsConstraints tab ; /* #### unused */ + TabsConstraints tab ; Dimension cw,ch,bw ; /* Our size has now been dictated by the parent. Lay out the @@ -543,13 +539,11 @@ TabsResize(Widget w) * 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 = TabsNumChildren (tw); + num_children = tw->tabs.displayChildren; /* assign a top widget, bring it to bottom row. */ TabsShuffleRows(tw) ; @@ -560,29 +554,24 @@ TabsResize(Widget w) tw->tabs.child_width = cw = tw->core.width - 2 * SHADWID ; tw->tabs.child_height = ch = - tw->core.height < (tw->tabs.tab_total + 2 * SHADWID) ? 0 : - tw->core.height - tw->tabs.tab_total - 2 * SHADWID ; + tw->core.height - tw->tabs.tab_total - 2 * SHADWID ; + for(i=0, childP=tw->composite.children; - i < num_children; + i < num_children; ++i, ++childP) if( XtIsManaged(*childP) ) { tab = (TabsConstraints) (*childP)->core.constraints ; - bw = (*childP)->core.border_width ; - /* Don't do anything if we can't see any of the child. */ - if (ch >= bw*2 && ch > 0 && cw >= bw*2 && cw > 0) - XtConfigureWidget(*childP, SHADWID,tw->tabs.tab_total+SHADWID, - cw-bw*2,ch-bw*2, bw) ; + bw = tab->tabs.bwid ; + XtConfigureWidget(*childP, SHADWID,tw->tabs.tab_total+SHADWID, + cw-bw*2,ch-bw*2, bw) ; } - if( XtIsRealized(w) ) { + 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) ; - } } + + tw->tabs.needs_layout = False ; } /* Resize */ @@ -640,8 +629,7 @@ TabsSetValues(Widget current, Widget request, Widget new, /* 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 ) + tw->core.background_pixmap != curtw->core.background_pixmap ) if( XtIsRealized(new) ) { TabsFreeGCs(tw) ; @@ -652,18 +640,11 @@ TabsSetValues(Widget current, Widget request, Widget new, if( tw->core.sensitive != curtw->core.sensitive ) needRedraw = True ; - /* Highlit widget changed */ - if ( tw->tabs.hilight != curtw->tabs.hilight ) - { - 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 ; @@ -678,12 +659,10 @@ TabsSetValues(Widget current, Widget request, Widget new, if( tab->tabs.row != tw->tabs.numRows-1 ) TabsShuffleRows(tw) ; - needRedraw = True ; } else tw->tabs.needs_layout = True ; - } return needRedraw ; } @@ -745,27 +724,11 @@ TabsConstraintSetValues(Widget current, Widget request, Widget new, } -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 offered more than we need?) + * if offerred more than we need?) */ static XtGeometryResult @@ -782,9 +745,11 @@ TabsQueryGeometry(Widget w, (!(mode & CWHeight) || intended->height == w->core.height) ) return XtGeometryNo ; +#ifdef COMMENT if( (!(mode & CWWidth) || intended->width >= preferred->width) && (!(mode & CWHeight) || intended->height >= preferred->height) ) return XtGeometryYes; +#endif /* COMMENT */ return XtGeometryAlmost; } @@ -802,7 +767,6 @@ TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) Dimension s = SHADWID ; TabsConstraints tab = (TabsConstraints)w->core.constraints; XtGeometryResult result ; - Dimension rw, rh ; /* Position request always denied */ @@ -824,11 +788,11 @@ TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) 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) ; + /* updated cached preferred size of the child */ + tab->tabs.bwid = req->border_width ; + tab->tabs.wid = req->width + req->border_width * 2 ; + tab->tabs.hgt = req->height + req->border_width * 2 ; + MaxChild(tw) ; /* Size changes must see if the new size can be accommodated. @@ -836,9 +800,7 @@ TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) * 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. - * + * returns an "almost" response with the new proposed size. * A request to grow will be accepted only if the Tabs parent can * grow to accommodate. * @@ -850,19 +812,23 @@ TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) if (req->request_mode & (CWWidth | CWHeight | CWBorderWidth)) { + Dimension rw,rh ; /* child's requested width, height */ 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 ; + rw = tab->tabs.wid ; + rh = tab->tabs.hgt ; - /* find out what *my* resulting preferred size would be */ + /* find out what the resulting preferred size would be */ - PreferredSize2(tw, cw, ch, &wid, &hgt) ; +#ifdef COMMENT + MaxChild(tw, &cw, &ch) ; +#endif /* COMMENT */ + PreferredSize2(tw, tw->tabs.max_cw,tw->tabs.max_ch, &wid, &hgt) ; - /* Would my size change? If so, ask to be resized. */ + /* Ask to be resized to accommodate. */ if( wid != tw->core.width || hgt != tw->core.height ) { @@ -872,8 +838,7 @@ TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) myrequest.width = wid ; myrequest.height = hgt ; myrequest.request_mode = CWWidth | CWHeight ; - - assert (wid > 0 && hgt > 0); + /* If child is only querying, or if we're going to have to * offer the child a compromise, then make this a query only. */ @@ -883,7 +848,7 @@ TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) result = XtMakeGeometryRequest((Widget)tw, &myrequest, &myreply) ; - /* !$@# Athena Box widget changes the core size even if QueryOnly + /* !$@# 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, @@ -901,7 +866,6 @@ TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) switch( result ) { case XtGeometryYes: case XtGeometryDone: - tw->tabs.needs_layout = True ; break ; case XtGeometryNo: @@ -912,8 +876,6 @@ TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) case XtGeometryAlmost: wid = myreply.width ; hgt = myreply.height ; - tw->tabs.needs_layout = True ; - break ; } } @@ -941,8 +903,8 @@ TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) Widget *childP = tw->composite.children ; int i,bw ; w->core.border_width = req->border_width ; - for(i=TabsNumChildren (tw); --i >= 0; ++childP) - if( TabVisible(*childP) ) + for(i=tw->tabs.displayChildren; --i >= 0; ++childP) + if( XtIsManaged(*childP) ) { bw = (*childP)->core.border_width ; XtConfigureWidget(*childP, s,tw->tabs.tab_total+s, @@ -989,12 +951,6 @@ TabsChangeManaged(Widget w) 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) ; @@ -1010,7 +966,7 @@ TabsChangeManaged(Widget w) */ if( tw->tabs.topWidget != NULL && XtIsRealized(tw->tabs.topWidget) ) { - for(i=TabsNumChildren (tw); --i >= 0; ++childP) + for(i=tw->tabs.displayChildren; --i >= 0; ++childP) if( !XtIsRealized(*childP) ) XtRealizeWidget(*childP) ; @@ -1031,6 +987,9 @@ TabsChangeManaged(Widget w) if( tw->tabs.topWidget != NULL ) XtVaSetValues(tw->tabs.topWidget, XmNtraversalOn, True, 0) ; #endif + + + } @@ -1075,9 +1034,9 @@ TabsSelect(Widget w, XEvent *event, String *params, Cardinal *num_params) * widget to be top of stacking order with XawTabsSetTop(). */ for(i=0, childP=tw->composite.children; - i < TabsNumChildren (tw); + i < tw->tabs.displayChildren; ++i, ++childP) - if( TabVisible(*childP) ) + if( XtIsManaged(*childP) ) { TabsConstraints tab = (TabsConstraints)(*childP)->core.constraints; if( x > tab->tabs.x && x < tab->tabs.x + tab->tabs.width && @@ -1098,10 +1057,11 @@ static void TabsPage(Widget w, XEvent *event, String *params, Cardinal *num_params) { TabsWidget tw = (TabsWidget) w ; - Widget newtop = NULL; + Widget newtop ; Widget *childP ; int idx ; - int nc = TabsNumChildren (tw) ; + int i ; + int nc = tw->composite.num_children ; if( nc <= 0 ) return ; @@ -1122,9 +1082,9 @@ TabsPage(Widget w, XEvent *event, String *params, Cardinal *num_params) switch( params[0][0] ) { case 'u': /* up */ case 'U': - if( --idx < 0 ) - idx = nc-1 ; - newtop = tw->composite.children[idx] ; + if( idx == 0 ) + idx = nc ; + newtop = tw->composite.children[idx-1] ; break ; case 'd': /* down */ @@ -1136,7 +1096,6 @@ TabsPage(Widget w, XEvent *event, String *params, Cardinal *num_params) case 'h': case 'H': - default: newtop = tw->composite.children[0] ; break ; @@ -1162,10 +1121,11 @@ static void TabsHighlight(Widget w, XEvent *event, String *params, Cardinal *num_params) { TabsWidget tw = (TabsWidget) w ; - Widget newhl = NULL; + Widget newhl ; Widget *childP ; int idx ; - int nc = TabsNumChildren (tw) ; + int i ; + int nc = tw->composite.num_children ; if( nc <= 0 ) return ; @@ -1182,7 +1142,6 @@ TabsHighlight(Widget w, XEvent *event, String *params, Cardinal *num_params) else { - /* find index of currently highlit child */ for(idx=0, childP=tw->composite.children; idx < nc; ++idx, ++childP ) if( tw->tabs.hilight == *childP ) break ; @@ -1190,9 +1149,9 @@ TabsHighlight(Widget w, XEvent *event, String *params, Cardinal *num_params) switch( params[0][0] ) { case 'u': /* up */ case 'U': - if( --idx < 0 ) - idx = nc-1 ; - newhl = tw->composite.children[idx] ; + if( idx == 0 ) + idx = nc ; + newhl = tw->composite.children[idx-1] ; break ; case 'd': /* down */ @@ -1211,10 +1170,6 @@ TabsHighlight(Widget w, XEvent *event, String *params, Cardinal *num_params) case 'E': newhl = tw->composite.children[nc-1] ; break ; - - default: - newhl = tw->tabs.hilight ; - break ; } } @@ -1257,20 +1212,19 @@ XawTabsSetTop(Widget w, Bool callCallbacks) if( !XtIsSubclass(w->core.parent, tabsWidgetClass) ) { - char line[256] ; - sprintf(line, "XawTabsSetTop: widget \"%.64s\" is not the child of a tabs widget.", XtName(w)) ; + char line[1024] ; + sprintf(line, "XawTabsSetTop: widget \"%s\" 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) ; + (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 ; } @@ -1281,14 +1235,6 @@ XawTabsSetTop(Widget w, Bool callCallbacks) #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 @@ -1325,12 +1271,16 @@ void XawTabsSetHighlight(Widget t, Widget w) { TabsWidget tw = (TabsWidget)t ; + TabsConstraints tab ; + Widget oldtop = tw->tabs.topWidget ; if( !XtIsSubclass(t, tabsWidgetClass) ) return ; if( XtIsRealized(t) && w != tw->tabs.hilight ) { + if( tw->tabs.hilight != NULL ) + DrawHighlight(tw, tw->tabs.hilight, True) ; if( w != NULL ) DrawHighlight(tw, w, False) ; } @@ -1394,7 +1344,7 @@ DrawTabs(TabsWidget tw, Bool labels) 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.) @@ -1403,9 +1353,9 @@ DrawTabs(TabsWidget tw, Bool labels) y = tw->tabs.numRows == 1 ? TABDELTA : 0 ; for(i=0; i<tw->tabs.numRows; ++i, y += th) { - for( j=TabsNumChildren (tw), childP=tw->composite.children; + for( j=tw->tabs.displayChildren, childP=tw->composite.children; --j >= 0; ++childP ) - if( TabVisible(*childP) ) + if( XtIsManaged(*childP) ) { tab = (TabsConstraints)(*childP)->core.constraints; if( tab->tabs.row == i && *childP != tw->tabs.topWidget ) @@ -1477,11 +1427,11 @@ DrawTab(TabsWidget tw, Widget child, Bool labels) { if( tab->tabs.lbm_depth == 1 ) XCopyPlane(dpy, tab->tabs.left_bitmap, win,gc, - 0,0, tab->tabs.lbm_width, tab->tabs.lbm_height, + 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, + 0,0, tab->tabs.lbm_width, tab->tabs.lbm_height, x+tab->tabs.lbm_x, y+tab->tabs.lbm_y) ; } @@ -1505,26 +1455,8 @@ DrawFrame(TabsWidget tw) GC botgc = tw->tabs.botGC ; Dimension s = SHADWID ; Dimension ch = tw->tabs.child_height ; - if (ch > 0) - Draw3dBox((Widget)tw, 0,tw->tabs.tab_total, - tw->core.width, ch+2*s, s, topgc, botgc) ; - else - { - Widget w = tw->tabs.topWidget ; - if (w != NULL) - { - TabsConstraints tab = (TabsConstraints) w->core.constraints ; - Draw3dBox((Widget)tw, 0,tw->core.height - 2*s, - tab->tabs.x, 2*s, s, topgc, botgc); - Draw3dBox((Widget)tw, tab->tabs.x + tab->tabs.width, - tw->core.height - 2*s, - tw->core.width - tab->tabs.x - tab->tabs.width, 2*s, s, - topgc, botgc); - } - else - Draw3dBox((Widget)tw, 0,tw->core.height - 2*s, - tw->core.width, 2*s, s, topgc, botgc) ; - } + Draw3dBox((Widget)tw, 0,tw->tabs.tab_total, + tw->core.width, ch+2*s, s, topgc, botgc) ; } @@ -1658,27 +1590,8 @@ UndrawTab(TabsWidget tw, Widget child) /* 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 + /* Compute the size of one child's tab. Positions will be computed * elsewhere. * * height: font height + vertical_space*2 + shadowWid*2 @@ -1711,7 +1624,7 @@ TabWidth(Widget w) { 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.ascent - tw->tabs.font->max_bounds.descent)/2 ; } } @@ -1730,18 +1643,18 @@ TabWidth(Widget w) */ static int -TabLayout(TabsWidget tw, - Dimension wid, - Dimension hgt, - Dimension *reply_height, Bool query_only) +TabLayout(TabsWidget tw, int wid, int hgt, Dimension *reply_height, Bool query_only) { - int i, row, done = 0, display_rows = 0 ; + 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. @@ -1760,14 +1673,10 @@ TabLayout(TabsWidget tw, { tab = (TabsConstraints) (*childP)->core.constraints ; w = tab->tabs.width ; - if( x + w > wid ) { /* new row */ - if (y + tw->tabs.tab_height > hgt && !done) - { - display_rows = row; - done = 1; - } - ++row; + if (y + tw->tabs.tab_height > hgt) + break; + ++row ; x = INDENT ; y += tw->tabs.tab_height ; } @@ -1777,14 +1686,12 @@ TabLayout(TabsWidget tw, tab->tabs.row = row ; } x += w + SPACING ; - if (!query_only && !done) - tab->tabs.visible = 1; - + if (!query_only) + tw->tabs.displayChildren++; } - /* If there was only one row, increase the height by TABDELTA */ - if( ++display_rows == 1 ) + /* If there was only one row, increse the height by TABDELTA */ + if( ++row == 1 ) { - row++; y = TABDELTA ; if( !query_only ) for(i=num_children, childP=tw->composite.children; @@ -1798,51 +1705,75 @@ TabLayout(TabsWidget tw, y += tw->tabs.tab_height ; } else - display_rows = row = y = 0 ; + row = y = 0 ; if( !query_only ) { tw->tabs.tab_total = y ; - tw->tabs.numRows = display_rows ; - tw->tabs.realRows = row; + tw->tabs.numRows = row ; } if( reply_height != NULL ) *reply_height = y ; - return display_rows ; + return row ; } /* Find max preferred child size. Returned sizes include child - * border widths. + * border widths. We only ever ask a child its preferred + * size once. After that, the preferred size is updated only + * if the child makes a geometry request. */ static void GetPreferredSizes(TabsWidget tw) { - MaxChild(tw, NULL, 0,0) ; + int i ; + Widget *childP = tw->composite.children ; + XtWidgetGeometry preferred ; + TabsConstraints tab ; + Dimension cw = 0, ch = 0 ; + + for(i=tw->tabs.displayChildren; --i >= 0; ++childP) + if( XtIsManaged(*childP) ) + { + tab = (TabsConstraints) (*childP)->core.constraints ; + if( !tab->tabs.queried ) { + (void) XtQueryGeometry(*childP, NULL, &preferred) ; + tab->tabs.bwid = preferred.border_width ; + tab->tabs.wid = preferred.width + preferred.border_width * 2 ; + tab->tabs.hgt = preferred.height + preferred.border_width * 2 ; + tab->tabs.queried = True ; + } + cw = Max(cw, tab->tabs.wid ) ; + ch = Max(ch, tab->tabs.hgt ) ; + } + tw->tabs.max_cw = cw ; + tw->tabs.max_ch = ch ; } /* Find max preferred child size. Returned sizes include child - * border widths. If except is non-null, don't ask that one. - */ + * border widths. */ static void -MaxChild(TabsWidget tw, Widget except, Dimension cw, Dimension ch) +MaxChild(TabsWidget tw) { - int i ; - Widget *childP = tw->composite.children ; - XtWidgetGeometry preferred ; + Dimension cw,ch ; /* child width, height */ + int i ; + Widget *childP = tw->composite.children ; + TabsConstraints tab ; + + cw = ch = 0 ; for(i=tw->composite.num_children; --i >=0; ++childP) - if( TabVisible (*childP) /*XtIsManaged(*childP)*/ && *childP != except ) + if( XtIsManaged(*childP) ) { - (void) XtQueryGeometry(*childP, NULL, &preferred) ; - cw = Max(cw, preferred.width + preferred.border_width * 2 ) ; - ch = Max(ch, preferred.height + preferred.border_width * 2 ) ; + tab = (TabsConstraints) (*childP)->core.constraints ; + cw = Max(cw, tab->tabs.wid ) ; + ch = Max(ch, tab->tabs.hgt ) ; } tw->tabs.max_cw = cw ; @@ -1860,7 +1791,7 @@ TabsShuffleRows(TabsWidget tw) { TabsConstraints tab ; int move ; - int real_rows, display_rows ; + int nrows ; Widget *childP ; Dimension th = tw->tabs.tab_height ; Position bottom ; @@ -1868,7 +1799,7 @@ TabsShuffleRows(TabsWidget tw) /* There must be a top widget. If not, assign one. */ if( tw->tabs.topWidget == NULL && tw->composite.children != NULL ) - for(i=TabsNumChildren (tw), childP=tw->composite.children; + for(i=tw->composite.num_children, childP=tw->composite.children; --i >= 0; ++childP) if( XtIsManaged(*childP) ) { @@ -1878,44 +1809,38 @@ TabsShuffleRows(TabsWidget tw) if( tw->tabs.topWidget != NULL ) { - display_rows = tw->tabs.numRows ; - real_rows = tw->tabs.realRows ; - assert( display_rows <= real_rows ) ; + nrows = tw->tabs.numRows ; + assert( nrows > 0 ) ; - if( real_rows > 1 ) + if( nrows > 1 ) { tab = (TabsConstraints) tw->tabs.topWidget->core.constraints ; assert( tab != NULL ) ; - /* How far to move top row. The selected tab must be on - the bottom row of the *visible* rows. */ - move = (real_rows + 1 - display_rows) - tab->tabs.row ; - if (move < 0) - move = real_rows - move; + /* how far to move top row */ + move = nrows - tab->tabs.row ; bottom = tw->tabs.tab_total - th ; - for(i=tw->composite.num_children, childP=tw->composite.children; + 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) % real_rows ; + tab->tabs.row = (tab->tabs.row + move) % nrows ; tab->tabs.y = bottom - tab->tabs.row * th ; - tab->tabs.visible = (tab->tabs.row < display_rows); } } } } - /* Find preferred size. Ask children, find size of largest, + /* 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, @@ -1929,6 +1854,12 @@ PreferredSize( Dimension rwid,rhgt ; int nrow ; + + /* find max desired child height */ +#ifdef COMMENT + MaxChild(tw, &cw, &ch) ; +#endif /* COMMENT */ + wid = cw = tw->tabs.max_cw ; hgt = ch = tw->tabs.max_ch ; @@ -1942,7 +1873,6 @@ PreferredSize( if( nrow > 2 && rhgt > rwid ) { Dimension w0, w1 ; - int maxloop = 20 ; /* step 1: start doubling size until it's too big */ do { @@ -1955,7 +1885,7 @@ PreferredSize( /* step 2: use Newton's method to find ideal size. Stop within * 8 pixels. */ - while( --maxloop > 0 && w1 > w0 + 8 ) + while( w1 > w0 + 8 ) { wid = (w0+w1)/2 ; nrow = PreferredSize2(tw, wid,hgt, &rwid,&rhgt) ; @@ -1980,22 +1910,18 @@ PreferredSize( static int PreferredSize2( TabsWidget tw, - Dimension cw, /* child width, height */ - Dimension ch, + int cw, /* child width, height */ + int ch, Dimension *reply_width, /* total widget size */ Dimension *reply_height) { Dimension s = SHADWID ; - int ret; /* make room for shadow frame */ cw += s*2 ; ch += s*2 ; - ret = PreferredSize3(tw, cw, ch, reply_width, reply_height) ; - - assert (*reply_width > 0 && *reply_height > 0); - return ret; + return PreferredSize3(tw, cw, ch, reply_width, reply_height) ; } @@ -2004,8 +1930,8 @@ PreferredSize2( static int PreferredSize3( TabsWidget tw, - Dimension wid, /* child width, height */ - Dimension hgt, + int wid, /* child width, height */ + int hgt, Dimension *reply_width, /* total widget size */ Dimension *reply_height) { @@ -2077,7 +2003,7 @@ getBitmapInfo(TabsWidget tw, TabsConstraints tab) if( tab->tabs.left_bitmap == None || !XGetGeometry(XtDisplay(tw), tab->tabs.left_bitmap, &root, &x, &y, - &tab->tabs.lbm_width, &tab->tabs.lbm_height, + &tab->tabs.lbm_width, &tab->tabs.lbm_height, &bw, &tab->tabs.lbm_depth) ) tab->tabs.lbm_width = tab->tabs.lbm_height = 0 ; } diff --git a/lwlib/xlwtabs.h b/lwlib/xlwtabs.h index 467d287..6f5d410 100644 --- a/lwlib/xlwtabs.h +++ b/lwlib/xlwtabs.h @@ -47,7 +47,6 @@ internalWidth Width Dimension 4 *1 internalHeight Height Dimension 2 *1 topWidget TopWidget Widget *2 - highlightWidget HighlightWidget Widget 4 callback Callback XtCallbackList NULL *3 popdownCallback Callback XtCallbackList NULL *4 selectInsensitive SelectInsensitive Boolean True *5 @@ -133,11 +132,6 @@ #define XtCTopWidget "TopWidget" #endif -#ifndef XtNhighlightWidget -#define XtNhighlightWidget "highlightWidget" -#define XtCHighlightWidget "HighlightWidget" -#endif - #ifndef XtNhSpace #define XtNhSpace "hSpace" #define XtCHSpace "HSpace" diff --git a/lwlib/xlwtabsP.h b/lwlib/xlwtabsP.h index d28fd53..48b0c0e 100644 --- a/lwlib/xlwtabsP.h +++ b/lwlib/xlwtabsP.h @@ -18,7 +18,7 @@ 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 */ +/* Synched up with: TabsP.h 1.7 */ /* * TabsP.h - Private definitions for Index Tabs widget @@ -93,7 +93,7 @@ typedef struct { Dimension child_width, child_height; /* child size, including borders */ Dimension max_cw, max_ch ; /* max child preferred size */ Cardinal numRows ; - Cardinal realRows; /* XEmacs addition */ + Cardinal displayChildren ; XtGeometryMask last_query_mode; Boolean needs_layout ; Pixmap grey50 ; /* TODO: cache this elsewhere */ @@ -129,10 +129,12 @@ typedef struct _TabsConstraintsPart { /* private state */ Pixel grey ; Boolean greyAlloc ; - Boolean visible; /* XEmacs change */ Dimension width ; /* tab width */ Position x,y ; /* tab base position */ short row ; /* tab row */ + Dimension wid,hgt ; /* desired size */ + Dimension bwid ; /* desired border width */ + Boolean queried ; /* we've asked child it's pref. size */ Position l_x, l_y ; /* label position */ Position lbm_x, lbm_y ; /* bitmap position */ unsigned int lbm_width, lbm_height, lbm_depth ; diff --git a/man/info-stnd.texi b/man/info-stnd.texi new file mode 100644 index 0000000..abb7ff8 --- /dev/null +++ b/man/info-stnd.texi @@ -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 --git a/man/internals/Makefile b/man/internals/Makefile new file mode 100644 index 0000000..9229d29 --- /dev/null +++ b/man/internals/Makefile @@ -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 --git a/man/internals/index.perm b/man/internals/index.perm new file mode 100644 index 0000000..0624e15 --- /dev/null +++ b/man/internals/index.perm @@ -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 --git a/man/internals/index.texi b/man/internals/index.texi index 6423f10..4a27571 100644 --- a/man/internals/index.texi +++ b/man/internals/index.texi @@ -19,7 +19,7 @@ @c pindex is used for .el files and Unix programs -@node Index, , Interface to the X Window System, Top +@node Index, , Interface to X Windows, Top @unnumbered Index @ignore diff --git a/man/internals/index.unperm b/man/internals/index.unperm new file mode 100644 index 0000000..4a27571 --- /dev/null +++ b/man/internals/index.unperm @@ -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 --git a/man/lispref/Makefile b/man/lispref/Makefile new file mode 100644 index 0000000..5ab9c87 --- /dev/null +++ b/man/lispref/Makefile @@ -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 --git a/man/lispref/gutter.texi b/man/lispref/gutter.texi index f3f9b9c..4da9fa2 100644 --- a/man/lispref/gutter.texi +++ b/man/lispref/gutter.texi @@ -14,15 +14,13 @@ 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. +* Gutter Descriptor Format:: How to create a gutter. * 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 +@node Gutter Intro, Gutter Descriptor Format, , Gutter @section Gutter Intro A @dfn{gutter} is a rectangle displayed along one edge of a frame. It @@ -59,70 +57,7 @@ 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 @code{t}, @code{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 +@node Gutter Descriptor Format, Specifying a Gutter, Gutter Intro, Gutter @section Gutter Descriptor Format The contents of a gutter are specified using a @dfn{gutter descriptor}. @@ -252,7 +187,7 @@ 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 +@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} @@ -312,7 +247,7 @@ Specifier for the gutter at the right edge of the frame. @end defvr @defun gutter-specifier-p object -This function returns non-@code{nil} if @var{object} is a gutter specifier. +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}). @@ -408,7 +343,7 @@ visibility that is used in frame geometry calculations. 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 @code{nil} value specified for +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 @@ -448,13 +383,13 @@ time-consuming operations like downloading. * Progress Bars:: Visual indication of operation progress. @end menu -@node Buffer Tabs, Progress Bars, ,Common Gutter Widgets -@subsection Buffer Tabs +@node Buffer Tabs, Progress Bars, , Common Gutter Widgets +@section Buffer Tabs Not documented yet. -@node Progress Bars, , Buffer Tabs, Common Gutter Widgets -@subsection Progress Bars +@node Progress Bars, , Buffer Tabs, Common Gutter Widgets +@section Progress Bars Not documented yet. diff --git a/man/lispref/index.perm b/man/lispref/index.perm new file mode 100644 index 0000000..163d218 --- /dev/null +++ b/man/lispref/index.perm @@ -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 --git a/man/lispref/index.texi b/man/lispref/index.texi index 937b347..31ed313 100644 --- a/man/lispref/index.texi +++ b/man/lispref/index.texi @@ -24,7 +24,7 @@ @ignore All variables, functions, keys, programs, files, and concepts are -in this one index. +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, diff --git a/man/lispref/index.unperm b/man/lispref/index.unperm new file mode 100644 index 0000000..31ed313 --- /dev/null +++ b/man/lispref/index.unperm @@ -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 --git a/man/lispref/packaging.texi b/man/lispref/packaging.texi new file mode 100644 index 0000000..827420c --- /dev/null +++ b/man/lispref/packaging.texi @@ -0,0 +1,1245 @@ +@c -*-texinfo-*- +@c This is part of the XEmacs Lisp Reference Manual. +@c Copyright (C) 2001 Free Software Foundation, Inc. +@c See the file lispref.texi for copying conditions. + +@setfilename ../../info/packaging.info + +@c Macro to make formatting of the XEmacs pms name consistent. +@c Maybe @sc looks OK in HTML? If so, condition on Info. +@iftex +@macro xpms +XE@sc{macs} Packaging System +@end macro +@end iftex +@ifnottex +@macro xpms +XEmacs Packaging System +@end macro +@end ifnottex + +@node Packaging, Lisp Data Types, Introduction, Top +@chapter The @xpms{} +@cindex package +@cindex packaging + +The XEmacs distribution, starting with version 21, comes only with a +very basic set of built-in modes and libraries. Most of the libraries +that were part of the distribution of earlier versions of XEmacs are now +available separately. The user as well as the system administrator 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. + +This chapter describes how to package Lisp libraries for use with the +@xpms{}. + +@emph{Please note carefully} that the term @dfn{package} as used in +XEmacs refers to an aggregation of Lisp code and/or data distributed as +a unit. It does not, as it does in many Lisps, refer to a way of +creating separate name spaces. XEmacs has no facility for providing +separate name spaces. (If we ever do get separate name spaces, we'll +probably regret overloading the nomenclature in this way, but it's +become established.) + +@menu +Introduction: +* Package Overview:: Lisp Libraries and Packages. + +Packaging Lisp Libraries: +* Package Terminology:: Basic stuff. +* Building Packages:: Turn packaged source into a tarball. +* Local.rules File:: Tell the @xpms{} about your host. +* Creating Packages:: Tell the @xpms{} about your package. +@c * History:: History of the @xpms{} +@c * Installation:: Installing the @xpms{} with your (X)Emacs. +@c * Configuration:: Configuring the @xpms{} for use. +@c * Usage:: An overview of the operation of the @xpms{}. +@c * Bug Reports:: Reporting Bugs and Problems +@c * Frequently Asked Questions:: Questions and answers from the mailing list. + +Internals and Package Release Engineering: +* Issues:: +@end menu + +@node Package Overview, Package Terminology, , Packaging +@chapter An overview of the @xpms{} + +The @xpms{} is a system for administering the installation, upgrade, and +removal of Lisp libraries. For the end user, it provides facilities for +determining availability of packages and which versions at remote +sites. It will download and automatically install a package, ensuring +that any old files from previous versions of the package are removed +first. By providing a standard set of hierarchies for installation, it +makes configuration of XEmacs simpler. Furthermore, packages normally +provide ancillary auto-autoloads and custom-loads libraries, which are +automatically detected and loaded by XEmacs upon startup. This means +that once installed, all facilities of package, including autoloading +the library upon invocation of a command provided by the library and +convenient configuration and customization, are automatically available +to the user. There is no need to add autoloads or keybindings to in the +init file, and structured configuration of the package is available +through the Customize system even before the libraries are loaded. + +All of this convenience comes at a cost. The cost of administration at +the package level is negligible compared to the benefits, of course. +However, the requirement that XEmacs find and load auto-autoloads and +custom-loads libraries comes at a fairly large cost in startup time. In +order to reduce this cost, XEmacs imposes fairly strict conditions on +the structure of an installed package. + +Meeting these requirements, as well as simply providing the +auto-autoloads and the information about availability and so on does +impose some costs on the library maintainer. The @xpms{} also provides +structure and utilities to the library maintainer to make these tasks +easier. This manual documents the requirements and the tools that the +@xpms{} provides to ensure that a package satisfies them. + +@menu +* The User's View:: +* The Library Maintainer's View:: +* The Package Release Engineer's View:: +@end menu + + +@node The User's View, The Library Maintainer's View, , Package Overview +@section The User's View + +@strong{N.B.} Much of the discussion in this section undoubtedly +belongs elsewhere, @ref{Packages,,,xemacs}. + +From the user's point of view, an XEmacs binary package is simply a +standard tarball (usually gzipped) containing Lisp sources, compiled +Lisp, documentation, and possibly data files or supporting executables. +The tarball is unpacked using standard tools such as GNU tar and gzip. +The package system does impose certain requirements for automatic +configuration to work. + +Here the main consideration is that the tarball ``expects'' to be +unpacked from the top of a package hierarchy. A @dfn{package hierarchy} +is basically an image of a classic Emacs ``run-in-place'' tree, with +@file{lisp}, @file{etc}, @file{info}, @file{man}, @file{lib-src}, and +@file{pkginfo} subdirectories of the top. The @file{pkginfo} +subdirectory is for use by the @xpms{} administration tools, and +currently contains a @file{MANIFEST.@var{package-name}} file for each +package to ensure that no cruft remains when a package is removed or +updated. The @file{lisp}, @file{etc}, and @file{lib-src} subdirectories +are further subdivided, with a subdirectory for each package. The +@file{info} directory obeys the usual conventions. +@emph{I.e.}, the @file{info} directory is flat +with a(n) (optional) @file{dir} file and one (set of) info file(s) per +package. The @file{man} subdirectory typically contains documentation +sources, separated by package. (It does not contain @file{man(1)} +pages, as Emacs provides very few of them.) + +There are several standard package hierarchies, and administrators can +configure others at build time, while users can configure others at run +time. The standard system hierarchies are all subdirectories of an +@c #### This is possibly incorrect usage of "installation root." +XEmacs installation root, typically @file{/usr/local/lib/xemacs/}. +These are the @file{xemacs-packages}, @file{mule-packages}, +@file{infodock-packages}, and @file{site-packages} hierarchies. Each +has the structure described above, but the purposes differ. The +@file{xemacs-packages} is the normal place for installing ``official'' +packages and many third-party libraries. Unfortunately, it is not yet +quite possible to read libraries containing international characters +with a non-Mule XEmacs, so such libraries are sequestered in the +@file{mule-packages} hierarchy. Some packages are compatible only with +the Infodock development environment, and they will be installed in the +@file{infodock-packages} hierarchy. The @file{site-packages} hierarchy +is for packages not distributed by XEmacs.org, typically locally +developed. + +Packages are in principle supposed to be XEmacs version-independent, but +if such dependencies are unavoidable, additional standard package +hierarchies may be installed under version directories, @emph{e.g.} +@file{/usr/local/lib/xemacs-21.4.6/}. + +Users who do not have sufficient privilege to install packages in the +system hierarchies may install package hierarchies under +@file{~/.xemacs}. At present only the @file{xemacs-packages} and +@file{mule-packages} hierarchies are supported, but it might make sense +to extend this to support @file{infodock-packages} and +@file{site-packages} hierarchies in the future. + +The package hierarchies are not searched directly for libraries to be +loaded; this would be very costly. Instead, the hierarchies are ordered +according to certain rules, and searched for package lisp directories at +invocation. These directories are added to the general +@code{load-path}. As usual, it is @code{load-path} that is searched at +run-time. This approach is somewhat costly at initialization, but +results in a very ``clean'' @code{load-path}. + +The order of search can be changed at build time by specifying the +@samp{--package-path} option to @file{configure}, or at run-time by +specifying the @code{EMACSPACKAGEPATH} environment variable. +@xref{Packages,,,xemacs}. + +@c #### The following description is quite possibly inaccurate. +@c Please, Michael, write some specs up! +The default order of search is hierarchically determined. First, the +roots are ordered. The @dfn{early} roots are the user-specific roots, +typically @file{~/.xemacs}. The @dfn{late} roots are the system roots, +typically @file{/usr/local/lib/xemacs-21.4.6} and +@file{/usr/local/lib/xemacs}, in that order. All hierarchies for a +given root are searched for package Lisp directories, which are appended +to @code{load-path} in the order found. Then the search proceeds to the +next root, whose results will be appended to the @code{load-path} +generated by previous roots. + +Second, the hierarchies below each root are searched in the order +@file{site-packages}, @file{infodock-packages}, @file{mule-packages}, +then @file{xemacs-packages}. + +In each hierarchy there should be a @file{lisp} subdirectory, containing +directories named for the packages. Each package's Lisp libraries thus +are contained in a directory of the form +@var{root}/@var{hierarchy}/lisp/@var{package}/. + +With such a complex search algorithm, the possibility of libraries being +shadowed by another library with the same name is quite real. There are +two considerations here. First, every XEmacs package contains certain +libraries with constant names. These are + +@table @file +@item _pkg.el +Lisp code to inform the package administration system about the package + +@item auto-autoloads.el +Lisp code to set up autoloaded functions and variables that may be +needed at load time + +@item custom-load.el +definitions of configuration variables for use with the Customize +system. +@end table + +They are special-cased, because the way they are used prevents shadowing +from being an issue. + +Second, it is possible that multiple copies of some library, or +different libraries with the same name, are installed in various places +in the hierarchies. To detect such shadows, use +@code{list-load-path-shadows}. + +Finally, note that most basic Emacs functionality, including most of the +Lisp API, is implemented in Lisp libraries. Because they use internal +reserved APIs that are subject to change according the needs of the +developers, these libraries are distributed with the XEmacs binary, and +are called @dfn{core Lisp libraries}. Most core Lisp libraries are +``preloaded'' into the Emacs binary and in normal usage are never +explicitly loaded. However, they can be explicitly loaded, and if so +they are searched on @code{load-path}. +@c #### Is this correct? It is not for C-h f, for example. +Furthermore, functions such as @code{locate-library} will also search on +the @code{load-path}. The searching takes place under somewhat +different rules from those used for packaged Lisp. It is probably +easiest to think of the package hierarchy searching algorithm as +receiving a @code{load-path} initialized to the core Lisp directories. + + +@node The Library Maintainer's View, The Package Release Engineer's View, The User's View, Package Overview +@section The Library Maintainer's View + +From the library maintainer's viewpoint, the advantages to the @xpms{} +stem from the convenience to the user of installation and upgrade. +Since an installed package automatically registers its entry points via +autoload and its configuration variables with the Customize system, +configuration FAQs are reduced. When it's easy to upgrade, users learn +to try @samp{Tools | Packages | Update Installed Packages} before +posting a FAQ whose answer is ``long since fixed, please upgrade.'' + +This comes at some cost, as the library maintainer needs to arrange that +the package be installed in a directory structure that satisfies the +requirements of the @xpms{}. Autoload cookies and defcustoms must also +be added to existing libraries. The @xpms{} provides infrastructure to +assure that all of these annoyances need only be dealt with once. The +autoload cookies and defcustoms are beyond the scope of this chapter, but +most maintainers of modern packages are already familiar with these +mechanisms. + +The @xpms{} may be divided into the @dfn{infrastructure} common to all +packages, and the package-specific @dfn{control files}. The +infrastructure supports global builds, installation, and generation of +the ``sumo'' bundles of packages, as well as generation of individual +packages. The package control files describe the structure of the +package's source tree and provide administrative information. + +@menu +* Infrastructure:: Global Makefiles and common rules. +* Control Files:: Package-specific Makefiles and administrative files. +* Obtaining:: Obtaining the @xpms{} and required utilities. +@end menu + +@node Infrastructure, Control Files, , The Library Maintainer's View +@subsection Infrastructure + +In order to get the greatest benefit from the @xpms{}, a library +maintainer should place the package sources in an appropriate place in +the XEmacs source package hierarchy, and arrange to have the source +package imported into the XEmacs CVS repository. +@c #### the parenthetical remark should go to "issues." +(We realize that the +latter requirement can be quite burdensome. We are working on ways to +remove this requirement, but for the present it remains necessary.) The +library maintainer must also keep sources for any packages his/her +package requires. This requirement is somewhat burdensome, but unlikely +to be relaxed because of the implementation of compilation of macros in +Emacs Lisp. Macros cannot be called by compiled Lisp (the macro +expansion, which is always known at compile time, is inlined), so the +source of the macro must be loaded before compiling the called function. + +The source package hierarchy may be rooted anywhere. The CVS module is +called ``packages,'' so we will refer to the top directory of the source +package hierarchy as ``the @file{packages} directory.'' The +@file{packages} directory contains two source subdirectories, +@file{xemacs-packages} and @file{mule-packages} (for convenience in +segregating the packages which depend on Mule, as they will cause +load-time errors in a non-Mule XEmacs). Each subdirectory contains many +package source directories, whose internal structure is not specified. +That structure is left up to the convenience of the library maintainers. +The requirements on the top directory of an individual package source +tree are given below, @ref{Control Files}. + +The @file{packages} directory contains some auxiliary Lisp libraries +used in the compilation and packaging process. The content of these +libraries is of interest primarily to the packaging engineers, @ref{The +Package Release Engineer's View}. + +Finally, the @file{packages}, @file{packages/xemacs-packages}, and +@file{packages/mule-packages} directories contain @file{Makefile}s and +include files to control the package creation process. The +@file{Makefile}s in @file{packages/xemacs-packages} and +@file{packages/mule-packages} simply define the default sets of known +packages and include @file{../iterate.rules}, which implements recursive +building of all target packages. + +The @samp{make} infrastructure in @file{packages} includes + +@table @file +@item Makefile +controls building of individual packages, local installation, and +bundling of ``sumo'' tarballs + +@item iterate.rules +controls recursive builds of multiple packages + +@item XEmacs.rules +provides the rules for building and packaging. Included by all package +@file{Makefile}s. + +@item Local.rules +provides local configuration, such as installation targets and staging +directories, as well as a number of kludges (many now obsolete) required +for building packages on the Windows platform. + +@item Local.rules.template +a template for Local.rules, liberally commented + +@item Local.rules.mk +consistency checking for @file{Local.rules}, included by both the +top-level @file{Makefile} and by @file{XEmacs.rules}. + +@c #### Add to "issues" +@item package-compile.el +compile environment (@emph{e.g.}, load-path) setup. It is very bogus +that this is here, an alternative mechanism is likely to be provided. +@end table + +Of these, only @file{Local.rules} and @file{package-compile.el} need to +be modified by the library maintainer. The changes to Local.rules +affect only your environment. This should need to be done only once +when first preparing the source environment. The necessary +modifications to @file{package-compile.el} need to be done for each +package and are discussed in the next section, @ref{Control Files}. + + +@node Control Files, Obtaining, Infrastructure, The Library Maintainer's View +@subsection Control Files + +Each package source must contain a number of control files in the +top-level directory. These files in general can be created and then +ignored, except for a few variables that need to be updated when new +versions are released. In most cases even adding, renaming, and +removing library source files can be handled by generic rules. + +The package control files include + +@table @file +@item Makefile +Must set a few @file{make} variables used by the administrative +utilities, and defines a couple of package-building targets to depend on +appropriate targets defined generically in @file{XEmacs.rules}. It may +also provide various variables and rules to transform the source tree +structure into that expected by the run-time system. + +@item package-info.in +Provides a template for package information to be provided to the +administrative utilities. Static variables that are rarely changed +(such as the package's name) are entered as literals. Some variables +are generated by the build process (build dates and MD5 checksums) and +are automatically filled in. Finally, some variables that change +irregularly (dependences and even version numbers) are set as +@file{make} variables in the @file{Makefile}. + +@item ChangeLog +Not strictly required, but normally a ChangeLog will be added by the +XEmacs package maintainer if different from the upstream maintainer. + +@item package-compile.el +compile environment (@emph{e.g.}, load-path) setup. It is very bogus +that this is here, an alternative mechanism is likely to be provided. + +@item _pkg.el +Generated. Simply does a @code{package-provide} for the package. + +@item _auto-autoloads.el +Generated. Read when XEmacs is initialized, and provides autoloads for +all defuns and other specially-marked forms in the sources. + +@item custom-loads.el +Generated. Read when XEmacs is initialized, and informs the Customize +subsystem how to find the defcustom forms needed to create Customization +forms for the usre configuration variables of the package. +@end table + + +@node Obtaining, , Control Files, The Library Maintainer's View +@subsection Obtaining the @xpms{} and Required Utilities + +Currently both the infrastructure for creating XEmacs packages and the +package sources themselves are available only by CVS. See +@uref{http://www.xemacs.org/Develop/cvsaccess.html} for more +intformation. + +The @xpms{} currently requires GNU @file{make}, and probably XEmacs, to +build packages. + + +@node The Package Release Engineer's View, , The Library Maintainer's View, Package Overview +@subsection The Package Release Engineer's View + +The XEmacs Package Release Engineer is responsible for keeping the +system coherent. The changes to @file{packages/package-compile.el} and +@file{packages/xemacs-packages/Makefile} required to make the package +available to others, and for building SUMO tarballs, @emph{etc}, are +done by the Package Release Engineer, not individual library +maintainers. + +The Package Release Engineer also maintains assorted infrastructure for +actually making releases. These are generally available for inspection +in the @code{xemacs-builds} module in the CVS repository. + +@c #### To be completed. + + +@c #### The following section is lifted verbatim from the XEmacs User's +@c Manual, file packages.texi. +@node Package Terminology, Building Packages, Package Overview, Packaging +@comment node-name, next, previous, up +@heading Package Terminology: + +@subsection Libraries and Packages +@cindex library +@cindex package + +A Lisp @dfn{library} is a single loadable file containing Lisp code. It +may be in source or byte-compiled form. A Lisp @dfn{package} is a set +of one or more libraries, usually related to each other in some way, +bundled with administrative information for convenient distribution. + +@subsection Package Flavors + +There are two main flavors of packages. + +@table @strong +@item Regular Packages +@cindex regular package +A regular package is a set of Lisp libraries design to cooperate with +one another. A very complex example is Gnus. One may not in general +safely remove any of the component libraries. + +@item Single-File Packages +@cindex single-file package +A single-file package is an collection of thematically related but +otherwise independent Lisp libraries. These libraries are bundled +together for convenience of the maintainers. Usually individual +libraries may be deleted at will without any loss of functionality of +other libraries in the package. However, we would recommend that you +follow this rule of thumb: "When in doubt, don't delete". If it's +really that big a deal, request that the maintainers split the package +into smaller aggregations. +@end table + +@subsection Package Distributions +@cindex package distributions +@cindex binary packages +@cindex source packages +XEmacs Lisp packages are distributed in two ways. @dfn{Binary packages} +are used by system administrators and end users. They are packaged in a +form convenient for direct installation into an XEmacs package +hierarchy. @dfn{Source packages} are for developers and include all +files necessary for rebuilding byte-compiled lisp and creating tarballs +for distribution or installation. This is all of the package author's +source code plus all of the files necessary to build distribution +tarballs (Unix Tar format files, gzipped for space savings). +@c #### This next is an Evile Practice and should be discontinued. +(Occasionally sources that are not relevant to XEmacs are removed.) + +Currently, source packages are only available via CVS. See +@url{http://www.xemacs.org/Develop/cvsaccess.html} for details. + +The package distributions are also split according to major features +required in XEmacs to support them. At present there are @dfn{generic} +packages, which can be loaded by @emph{any} XEmacs, and @dfn{Mule} +packages, which @emph{require} Mule support or they will cause errors +when loaded. Note that there is no guarantee that a generic package +will have any useful functionality in a minimally configured XEmacs. As +long as any XEmacs can successfully load the package's libraries +(perhaps given other required Lisp libraries), it will be classified as +generic. At the present time only Mule packages need be treated +specially, and even those only if they contain multibyte characters. + + +@c #### The following section is lifted verbatim from the XEmacs User's +@c Manual, file packages.texi. +@node Building Packages, Local.rules File, Package Terminology, Packaging +@comment node-name, next, previous, up +@cindex building packages +@cindex package building +@heading Building Packages: +Currently, source packages are only available via anonymous CVS. See +@url{http://www.xemacs.org/Develop/cvsaccess.html} for details of +checking out the @file{packages} module. + +@subsection Prerequisites for Building Source Packages + +@table @code +@item GNU cp +@item GNU install +(or a BSD compatible install program). +@item GNU make +(3.75 or later preferred). +@item makeinfo +(1.68 from texinfo-3.11 or later required, 1.69 from Texinfo 4 preferred). +@item GNU tar +(or equivalent). +@item GNU gzip +(or equivalent). +@item A properly configured @file{Local.rules} file. +@ref{Local.rules File}. +@end table + +And of course, XEmacs, 21.0 or higher. + +@subsection What You Can Do With Source Packages + +The packages CVS sources are most useful for creating XEmacs package +tarballs for installation into your own XEmacs installations or for +distributing to others. + +The supported @file{make} targets are: + +@table @code +@item all +Bytecompile all files, build and bytecompile byproduct files like +@file{auto-autoloads.el} and @file{custom-load.el}. Create info version +of TeXinfo documentation if present. + +@c #### Why do we need this _and_ the binkit target? +@item bindist +Does a @code{make all} as well as create a binary package tarball in the +staging directory. + +@item install +Bytecompile all files, build and bytecompile byproduct files like +@file{auto-autoloads.el} and @file{custom-load.el}. Create info version +of TeXinfo documentation if present. And install everything into the +staging directory. + +@item srckit +Usually simply depends on @code{srckit-std}, with no actions. This does +a @code{make distclean} and creates a package source tarball in the +staging directory. This is generally only of use for package +maintainers. + +@item binkit +May depend on @code{binkit-sourceonly}, @code{binkit-sourceinfo}, +@code{binkit-sourcedata}, or @code{binkit-sourcedatainfo}, with no +actions. @code{sourceonly} indicates there is nothing to install in a +data directory or info directory. @code{sourceinfo} indicates that +source and info files are to be installed. @code{sourcedata} indicates +that source and etc (data) files are to be installed. +@code{sourcedatainfo} indicates source, etc (data), and info files are +to be installed. A few packages have needs beyond the basic templates +so this is not yet complete. + +@item dist +Runs the rules @code{srckit} followed by @code{binkit}. This is +primarily of use by XEmacs maintainers producing files for distribution. + +@item clean +Remove all built files except @file{auto-autoloads.el} and +@file{custom-load.el}. + +@item distclean +Remove all created files. +@end table + +@c #### The following section is lifted verbatim from the XEmacs User's +@c Manual, file packages.texi. +@node Local.rules File, Creating Packages, Building Packages, Packaging +@comment node-name, next, previous, up +@cindex local.rules +@heading The Local.rules File: +This file in @file{packages} provides the @xpms{} with information about +the local configuration and environment. To create @file{Local.rules}, +simply copy @file{Local.rules.template} from that directory to +@file{Local.rules} and edit it to suit your needs. + +These are the variables in @file{Local.rules} that you will need to +provide values for. The following variables control which packages will +be built: + +@table @var +@item XEMACS_PACKAGES +The default is @samp{xemacs-packages}, which results in the set in +the @file{xemacs-packages/Makefile} @code{PACKAGES} variable. + +Otherwise, it should be a list of package source directories prefixed by +@samp{xemacs-packages}: + +@example +XEMACS_PACKAGES = xemacs-packages/xemacs-base xemacs-packages/bbdb +@end example + +@item BUILD_WITHOUT_MULE +The default is the empty value. + +Building from CVS defaults to building the Mule +packages. Set this to 't' if you don't want/have Mule. + +@item MULE_PACKAGES +The default is @samp{mule-packages}, which results in the set in +the @file{mule-packages/Makefile} @code{PACKAGES} variable. + +Otherwise, it should be a list of package source directories prefixed by +@samp{mule-packages}: + +@example +MULE_PACKAGES = mule-packages/mule-base mule-packages/skk +@end example + +@item PACKAGE_INDEX +The default is @file{package-index}. + +If you want the package index file to have a different name, change +this. This is probably a bad idea unless you are a packages release +engineer, as it will confuse the package administration tools. +@end table + +The following variables determine where files are installed and how they +are installed. Several of the defaults use the variable +@var{XEMACS_PACKAGES_BASE}. Never set this variable in +@file{Local.rules}; it is automatically set in @file{XEmacs.rules}. + +@table @asis +@item @var{XEMACS_STAGING} +The default is @file{$@{XEMACS_PACKAGES_BASE@}/../xemacs-packages}. + +Generic packages will be installed here. This can be the final +destination for files or symlinks (if the packages are being installed +locally), or a clean staging area for building tarballs. + +@strong{N.B.} @samp{make bindist} ignores this variable. It should be +handled by the administration utilities, but currently isn't. + +@item @var{MULE_STAGING} + +The default is @file{$@{XEMACS_PACKAGES_BASE@}/../mule-packages}. + +Packages requiring Mule to load correctly will be installed here. This +can be the final destination for files or symlinks (if the packages are +being installed locally), or a clean staging area for building tarballs. + +@strong{N.B.} @samp{make bindist} ignores this variable. It should be +handled by the administration utilities, but currently isn't. + +@item symlink +The default is the empty value. + +Set this to 't' if you want to simulate ``running in place.'' It is +currently not possible to ask XEmacs to use any package source tree as +an automatically configured member of @code{load-path}, and it is +unlikely that complex trees such as that of the Gnus package will ever +be able to ``run in place.'' This variable, when set to `t', causes the +build process to create a symlink farm otherwise identical to an +installed tree of binary packages. Thus it is purely a space +optimization. + +Setting this is incompatible with @samp{make bindist}. +@end table + +The following variables determine how packages are made. + +@table @var +@item XEMACS +The default is @samp{xemacs}. + +The path to the XEmacs executable you wish to use to compile the +packages and execute Lisp build scripts. + +@item XEMACS_NATIVE_NT +The default is the empty value. + +Set this to 't' if you are building on WinNT. It controls hairy shell +quoting in the @file{Makefile}s. + +@item INSTALL +The default is @samp{install -c}. + +The path to your BSD compatible install program. + +@item TAR +The default is @samp{tar}. + +The path to your tar program. + +@item BZIP2 +The default is the empty value. + +If unset, bzipped tarballs will not be built. If this is set to +something that resolves to a @samp{bzip2} executable, bzip2 tarballs +will be built @emph{in addition to} @samp{gzip} tarballs. + +@item MAKEINFO +The default is @samp{makeinfo}. + +The path to your @file{makeinfo} program +@end table + + +@c #### The following section is lifted verbatim from the XEmacs User's +@c Manual, file packages.texi. +@node Creating Packages, Issues, Local.rules File, Packaging +@comment node-name, next, previous, up +@cindex creating packages +@heading Creating Packages: +Creating a package from an existing Lisp library is not very difficult. + +In addition to the Lisp libraries themselves, you need a +@file{package-info.in} file and a simple @file{Makefile}. The rest is +done by @file{XEmacs.rules}, part of the packaging system +infrastructure. + +@file{package-info.in} contains a single Lisp form like this: + +@example +(NAME ; your package's name + (standards-version 1.1 + version VERSION ; Makefile + author-version AUTHOR_VERSION ; Makefile + date DATE ; Makefile + build-date BUILD_DATE ; generated + maintainer MAINTAINER ; Makefile + distribution DISTRIBUTION ; "mule" if MULE is needed, + ; else "xemacs" + priority high + category CATEGORY ; Makefile + dump nil + description "description" ; a one-line description string + filename FILENAME ; obsolete + md5sum MD5SUM ; generated + size SIZE ; generated + provides (FEATURE ...) ; one for every `provides' form + requires (REQUIRES) ; Makefile + ; NOT run-time dependencies! These + ; are files that provide macros or + ; defsubsts that must be inlined. + type regular +)) +@end example + +You should replace NAME, DISTRIBUTION, DESCRIPTION, and FEATURE ... with +appropriate values, according to the comments. Fields marked as +@samp{obsolete} can be ignored. Fields marked as @samp{generated} are +generated by the package construction process, and will be filled in +automatically. Fields marked as @samp{Makefile} should be set as +variables in the @file{Makefile}. + +The @samp{provides} can be done automatically, but currently aren't. It +would probably be a good idea to set them in the @file{Makefile} (they +do change, fairly often, but at present they aren't. + +The @file{Makefile} is quite stylized. The idea is similar to an +@file{Imakefile} or an @code{automake} file: the complexity is hidden in +generic rules files, in this case the @file{XEmacs.rules} include file +in the top directory of the packages hierarchy. + +An @xpms{} @file{Makefile} has three components. First, there is a +variable definition section. The standard @xpms{} @file{make} variables +must be defined here for use by the @file{XEmacs.rules} include file. +Second, the file @file{../../XEmacs.rules} is included. Finally, the +@file{make} rules are defined, possibly including additional variable +definitions for use by the @file{Makefile}. These always include rules +for the targets @samp{all}, @samp{binkit}, and @file{srckit}. + +Although a number of facilities are available for complex libraries, +most simple packages' @file{Makefile}s contain a copyright notice, the +variable definitions mentioned above, and some boilerplate. + +@example +# Makefile for apackage's lisp code + +# 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 = 0.00 +AUTHOR_VERSION = 0.00 +MAINTAINER = A. M. Aintainer <ama@@not.a.doc> +PACKAGE = apackage +PKG_TYPE = regular +REQUIRES = xemacs-base +CATEGORY = standard + +# All .els should be compiled and packaged. +ELS = $(wildcard *.el) +ELCS = $(ELS:.el=.elc) + +include ../../XEmacs.rules + +all:: $(ELCS) auto-autoloads.elc custom-load.elc + +srckit: srckit-std + +binkit: binkit-common +@end example + +@menu +* package-compile.el:: +* package-info.in Fields:: +* Makefile Variables:: +* Makefile Targets:: +@end menu + + +@node package-compile.el, package-info.in Fields, , Creating Packages + +The @xpms{} does not automatically become aware of your package simply +because there is a new subtree. If any package, including your own, +requires any of your files, it must be explicitly added to the compile +environment or loads/requires that search load-path will fail. The +changes that need to be made are + +@table @strong +@item an entry in @code{package-directory-map} +This tells the @xpms{} which distribution (currently +@samp{xemacs-packages} or @samp{mule-packages}) your package is found +in. It then looks in the distribution subdirectory whose name is the +same as the package's. + +@item an entry in the @code{cond} in @code{package-name-to-directory} +This is optional; it is necessary only if you keep your Lisp code +somewhere other than the top-level directory of the package's source +tree, eg, in @file{packages/xemacs-packages/@var{PACKAGE}/lisp}. +@end table + +This only needs to be done once, when the package is first added to the +@xpms{}. (Well, when you randomly change the subdirectory layout, too.) +Your changes to @file{package-compile.el} must be cleared and checked in +by the XEmacs Package Release Engineer before your package will build +correctly from a fresh checkout. + +This is unfortunate; it works pretty well once set up, but can cause +confusion when first building a package in the @xpms{} context. In +particular, if the @code{package-directory-map} entry for a required +package +@c #### including the package itself? +is not found, the necessary requires will not be executed by +@file{package-compile.el}. If required functions are executed (under +@code{eval-when-compile}), they won't be found and the compile will +fail. If required function is actually a macro, the byte compiler will +not recognize that, compile a function call to the macro. This will +cause a run-time error because the byte-code interpreter does not know +how to execute macros. (Macros can always be expanded at compile-time, +and this is more efficient.) + +If your package keeps some or all Lisp code somewhere other than the top +directory, then an entry in @code{package-name-to-directory} is also +necessary, or requires will fail, leading to the problems just described. + + +@node package-info.in Fields, Makefile Variables, package-compile.el, Creating Packages + +The @file{package-info.in} structure is simply Lisp data, to be read by +a Lisp script, have values substituted for variables, and then written +out (appropriately quoted) into a loadable Lisp file, to be consed into +the @file{package-index.el} list at the FTP archives. That list is +structured as an alist with package names as keys. The package data is +a plist. Do not rely on this, as it may change. If you have a good +reason for relying on it, let the maintainers know and we may +incorporate it in a future revision of the @xpms{} standard. + +There are several kinds of fields, distinguished by how they get their +values. There are literals written into @file{package-info.in} by the +package maintainer. There are variables substituted in by the build +process, some computed, and others written as values of @file{make} +variables in the @file{Makefile} by the package maintainer. There are a +few implementation constants, some of which are simply the default value +for obsolete fields. + +The @file{package-info.in} literals provided by the maintainer generally +should not change over the life of the package. (The exception is the +@samp{provides} field, which should be generated, but isn't yet.) +Values described as ``literal'' below are unquoted literal test. These +are normally interpreted as symbols by the package build process. The +maintainer literals are + +@table @asis +@item @var{package_name} +A literal. The only unnamed ``field,'' the name of the package. + +@item distribution +A literal, either @samp{xemacs} (for generic packages) or @samp{mule} +(for packages requiring Mule). @xref{Package Terminology}. + +@item description +A Lisp string containing a one-line text description for use in package +listings. + +@item provides +A (Lisp) list of features provided by the libraries in the package. All +of the features provided by libraries in your package should be elements +of this list. + +@item type +A literal, either @samp{regular} or @samp{single-file}. For practical +purposes, @samp{regular} should be considered an implementation constant. +@end table + +@c #### The following should be rewritten to @xref the make variables +@c node, and simply associate the field names to the make variables with +@c one line of description. +Values which are expected to change regularly as the package is enhanced +are implemented as @file{make} variables. You should not change them in +the @file{package-info.in} file; they are automatically filled in by the +build process. + +The corresponding field name is given in parentheses. These include + +@table @code +@item VERSION +(version) +The version of the XEmacs package, a numeric literal (a decimal +fixed-point number with two-places of precision). + +@item AUTHOR_VERSION +(author-version) +The upstream author's version, an unintepreted literal. + +@item DATE +(date) +Date of release of the upstream version. + +@item MAINTAINER +(maintainer) +A literal containing the XEmacs package's maintainer and his/her email +address. + +@item CATEGORY +(category) +A literal, either @samp{standard} or @samp{mule}. Probably redundant. + +@item REQUIRES +(requires) +A list of packages required to correctly build this package. + +Note that the usual form in @file{package-info.in} already has the +parentheses, so the @file{make} variable should be set to a +space-separated list of package names @emph{not} enclosed in +parentheses. + +The list is of @emph{packages}, not @emph{libraries}, as would +ordinarily be provided to the Lisp @code{require} function. + +@samp{REQUIRES} cannot be correctly computed from the calls to +@code{require} in the package's library sources. @samp{REQUIRES} is +used to ensure that all macro and defstruct definitions used by the +package are available at build time. This is not merely a matter of +efficiency, to get the expansions inlined. In fact, it is +@emph{impossible} to call a macro by name in byte-compiled Emacs Lisp +code. Thus, if the macro expansion is not inlined, the call will result +in an error at run-time! Thus, packages providing libraries that would +be loaded because of autoload definitions must also be included. + +On the other hand, if a package provides no macros to this package, it +is preferable @emph{not} to include it in @samp{REQUIRES}, because it is +not uncommon that if the developer doesn't normally use the required +package, he will never use the functionality in the package being built, +either. In that case it would be preferable to not require the +developer to have source for the dependencies. That said, of course it +is safe to put too many packages in @samp{REQUIRES}. +@end table + +Values for the following fields are automatically generated by the build +process. + +@table @asis +@item build-date +The date the package tarball was generated. + +@item md5sum +An MD5 checksum for the package tarball, as gzipped. + +@item size +The size of the package tarball, as gzipped. +@end table + +It is not clear that either md5sum or size works correctly if the +@samp{BZIP2} variable in @file{Local.rules} is set. + +The implementation constants are + +@table @asis +@item standards-version +Currently 1.1. Defines the format of the @file{package-info.in} file +and the @file{Makefile}. A true implementation constant. + +@item priority +An unimplemented and underspecified feature. Suggestions for +specification and implementation welcome. + +@item dump +An obsolete feature, superseded by the @file{site-load.el} mechanism. +The value should always be nil. + +@item filename +An obsolete feature, completely ignored. Don't even think about doing +anything useful with it. +@end table + + +@node Makefile Variables, Makefile Targets, package-info.in Fields, Creating Packages + +A number of @file{make} variables are defined by the @xpms{}. Some are +required, others are optional. Of course your @file{Makefile} may +define other variables for private use, but you should be careful not to +choose names that conflict with variables defined and used by the +@xpms{}. + +The required variables are described in the table below. +The corresponding field names for @file{package-info.in}, where +relevant, are given in parentheses. + +@c #### This is the canonical place for this information. If there is +@c unnecessary duplication with package-info.in documentation, shorten +@c that and leave this full-length. +@table @code +@item VERSION +(version) +The version of the XEmacs package, a numeric literal (a decimal +fixed-point number with two-places of precision). + +@item AUTHOR_VERSION +(author-version) +The upstream author's version, an unintepreted literal. + +@item DATE +(date) +Date of release of the upstream version. + +@item MAINTAINER +(maintainer) +A literal containing the XEmacs package's maintainer and his/her email +address. + +@item CATEGORY +(category) +A literal, either @samp{standard} or @samp{mule}. Probably redundant. + +@item REQUIRES +(requires) +A list of packages required to correctly build this package. + +Note that the usual form in @file{package-info.in} already has the +parentheses, so the @file{make} variable should be set to a +space-separated list of package names @emph{not} enclosed in +parentheses. + +The list is of @emph{packages}, not @emph{libraries}, as would +ordinarily be provided to the Lisp @code{require} function. + +@samp{REQUIRES} cannot be correctly computed from the calls to +@code{require} in the package's library sources. @samp{REQUIRES} is +used to ensure that all macro and defstruct definitions used by the +package are available at build time. This is not merely a matter of +efficiency, to get the expansions inlined. In fact, it is +@emph{impossible} to call a macro by name in byte-compiled Emacs Lisp +code. Thus, if the macro expansion is not inlined, the call will result +in an error at run-time! Thus, packages providing libraries that would +be loaded because of autoload definitions must also be included. + +On the other hand, if a package provides no macros to this package, it +is preferable @emph{not} to include it in @samp{REQUIRES}, because it is +not uncommon that if the developer doesn't normally use the required +package, he will never use the functionality in the package being built, +either. In that case it would be preferable to not require the +developer to have source for the dependencies. That said, of course it +is safe to put too many packages in @samp{REQUIRES}. + +@item ELCS +The list of the byte-compiled Lisp files used by the package. These +files and their @file{.el} versions will be included in the binary +package. This variable determines which libraries will be +byte-compiled. These libraries are also deleted by @samp{make clean}. + +Note there is no sanity-checking done on this variable. If you put +@samp{.el} files in here, they will not be compiled and they @emph{will} +be deleted by @samp{make clean}. You would surely be very distressed if +that happened, so be very careful. If this variable is left empty, none +of your Lisp code will be compiled or packaged. This would be a less +than amusing surprise, too. + +We don't consider this a feature, of course. Please do submit code to +do sanity checking to @email{xemacs-patches@@xemacs.org}. +@end table + +Optional, but very commonly used variables include: + +@table @code +item EXTRA_SOURCES +Other files (such as extra Lisp sources or an upstream @file{Makefile}) +that are normally placed in the installed Lisp directory, but not +byte-compiled. These files are @emph{preserved} by the @samp{clean} +targets. + +@item EXTRA_OBJS +Other files (such as compiled autoload or concatenated @file{.elc} +libraries) which are normally placed in the installed Lisp directory, +but do @emph{not} have corresponding source files and @emph{should} be +deleted by the @samp{clean} targets. Some of these (such as +package-specific autoload setups) can and probably should be replaced by +@xpms{} solutions such as @file{auto-autoloads.el}, but many cannot. + +@item PRELOADS +A specification for loading libraries containing macros before compiling +the Lisp in the package. This is spliced directly into the invocation +of XEmacs for byte-compilation, so it must contain the @samp{-l} flag +for XEmacs: + +@example +PRELOADS=-l ./apackage-macros.el -l ../bpackage/lisp/bpackage-macros.el +@end example + +@item INFO_FILES +Any Info file(s) generated by the package. These must be paths relative +to the root of the package's source tree. + +@item TEXI_FILES +The Texinfo source file(s). These must be paths relative +to the root of the package's source tree. + +@item MANUAL +The name to be used for Info files and man pages. + +@item DATA_FILES +Any data files, such as pixmaps, READMEs, and ChangeLogs. These must be +paths relative to the root of the package's source tree. + +@item DATA_DEST +The installation location for data files, relative to the @file{etc/} +directory of the package hierarchy. The normal value is simply +$(PACKAGE). Leaving it empty (@emph{i.e.}, put it directly under +@file{etc/}) will probably work, but is subject to name conflicts with +other packages. +@end table + +Rarely used variables. + +@c @table @code +@c @item +@c @end table + +@node Makefile Targets, , Makefile Variables, Creating Packages + +The standard targets that need to be defined in your @file{Makefile} +follow. These normally should @emph{not} have an action. All of the +work should be done by dependent targets, usually having standard +definitions in the @xpms{}. + +@table @samp +@item all +A list of generated files, usually byte-compiled Lisp libraries, to be +bundled in the package. The typical dependencies are + +@example +$(ELCS) auto-autoloads.elc custom-load.elc +@end example + +Other targets (such as Info files) may need to be added as dependencies +for the @code{all} target. + +@item srckit +The target for generating a source package. Not implemented. If it +were, the normal dependency would be @samp{srckit-std}. + +@item binkit +The target for creating a ``master'' installation. Binary packages are +actually generated by the @samp{bindist} target. @xref{Building Packages}. +@end table + +Standard dependencies for @code{srckit} and @code{binkit} are defined in +@file{XEmacs.rules}. The most useful of these values are given in the +following table. + +@table @samp +@item srckit-std +Build a standard source kit. Not fully implemented. + +@item binkit-sourceonly +The @samp{binkit} target need only install source and compiled Lisp in +the staging area. There is nothing to install in a data directory or +info directory. + +@item binkit-sourceinfo +Both source and info files are to be installed in the staging area. + +@item binkit-sourcedata +Both source and etc (data) files are to be installed in the staging +area. + +@item binkit-sourcedatainfo +Source, etc (data), and info files all are present and need to be +installed in the staging area. + +@item binkit-common +A dependency for all the above. (In fact in the current implementation +@samp{binkit-common} does all the work for all of the @samp{binkit} +targets.) +@end table + +Data files include things like pixmaps for a package-specific toolbar, +and are normally installed in @file{etc/@var{PACKAGE_NAME}}. A few +packages have needs beyond the basic templates. See @file{XEmacs.rules} +or a future revision of this manual for details. + + +@node Issues, , Creating Packages, Packaging +@section Issues + +To be completed. + diff --git a/man/lispref/permute-index b/man/lispref/permute-index new file mode 100755 index 0000000..600b066 --- /dev/null +++ b/man/lispref/permute-index @@ -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 --git a/man/lispref/postgresql.texi b/man/lispref/postgresql.texi index 3a6dbc4..982cc95 100644 --- a/man/lispref/postgresql.texi +++ b/man/lispref/postgresql.texi @@ -23,22 +23,19 @@ relational database access from Emacs Lisp code. @comment node-name, next, previous, up @section Building XEmacs with PostgreSQL support -XEmacs PostgreSQL support requires linking to the PostgreSQL libpq +XEmacs PostgreSQL support requires linking to the PostgreSQL libpq.so library. Describing how to build and install PostgreSQL is beyond the -scope of this document. See the PostgreSQL manual for details. +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 +ROM, you should have XEmacs PostgreSQL support by default. If you are +building XEmacs from source on a Linux system with PostgreSQL installed +into the default location, it should be autodetected when you run +configure. If you have installed PostgreSQL into its non-Linux 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 +you installed PostgreSQL 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. @@ -49,9 +46,9 @@ V6.5. In particular, asynchronous queries are supported. @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. +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. @@ -521,8 +518,8 @@ 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. -(setq R (pq-exec P "INSERT INTO xemacs_test - VALUES (6, 'Wakanohana', 'Yokozuna');")) +(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" @@ -781,7 +778,7 @@ Returns: t if successfully submitted Retrieve an asynchronous result from a query. @var{conn} A database connection object. -@code{nil} is returned when no more query work remains. +NIL is returned when no more query work remains. @end defun @defun pq-set-nonblocking conn arg @@ -809,7 +806,7 @@ Compatibility note: this function is only available with libpq-7.0. @end defun @defun PQsetenvPoll conn -Check an asynchronous environment variables transfer for completion. +Check an asynchronous enviroment variables transfer for completion. @var{conn} A database connection object. Compatibility note: this function is only available with libpq-7.0. diff --git a/man/new-users-guide/Makefile b/man/new-users-guide/Makefile new file mode 100644 index 0000000..3e24296 --- /dev/null +++ b/man/new-users-guide/Makefile @@ -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 --git a/man/xemacs/Makefile b/man/xemacs/Makefile new file mode 100644 index 0000000..24e9bd2 --- /dev/null +++ b/man/xemacs/Makefile @@ -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 --git a/modules/Makefile.in b/modules/Makefile.in new file mode 100644 index 0000000..07405d2 --- /dev/null +++ b/modules/Makefile.in @@ -0,0 +1,19 @@ +@SET_MAKE@ +SUBDIR=ldap base64 zlib example +RECURSIVE_MAKE=@RECURSIVE_MAKE@ +SHELL = /bin/sh +RM = rm -f + +all: + -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done + +install clean mostlyclean: + -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done + +distclean: + $(RM) Makefile config.* + -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done + +realclean extraclean: + $(RM) *~ \#* + -for d in $(SUBDIR) ; do (cd ./$${d} && $(RECURSIVE_MAKE) $@) ; done diff --git a/modules/aclocal.m4 b/modules/aclocal.m4 new file mode 100644 index 0000000..1b1808d --- /dev/null +++ b/modules/aclocal.m4 @@ -0,0 +1,36 @@ +AC_DEFUN(XE_EMACS, [ + dnl + dnl Apparently, if you run a shell window in Emacs, it sets the EMACS + dnl environment variable to 't'. Lets undo the damage. + dnl + if test "${EMACS}" = "t"; then + EMACS="" + fi + + AC_ARG_WITH(xemacs, --with-xemacs Use XEmacs to build, [ if test "${withval}" = "yes"; then EMACS=xemacs; else EMACS=${withval}; fi ]) + AC_ARG_WITH(emacs, --with-emacs Use Emacs to build, [ if test "${withval}" = "yes"; then EMACS=emacs; else EMACS=${withval}; fi ]) + AC_CHECK_PROG(EMACS, xemacs, xemacs, emacs) + AC_SUBST(EMACS) +]) + +AC_DEFUN(XE_CONFIG_VALUE, [ + OUTPUT=./conftest-$$ + rm -f ${OUTPUT} + ${EMACS} -batch -eval " +(let ((hash (config-value-hash-table)) + (desired (split-string \"$1\"))) + (mapcar + (lambda (key) + (message \"Checking for %S\" (intern key)) + (if (config-value (intern key)) + (progn + (write-region (format \"%s=\\\"%s\\\"\n\" key (config-value (intern key))) + nil \"${OUTPUT}\" t)))) + desired)) +" 2> /dev/null > /dev/null + test -f ${OUTPUT} && . ${OUTPUT} + rm -f ${OUTPUT} + for ac_func in $1; do + : + done +]) diff --git a/modules/base64/Makefile.in b/modules/base64/Makefile.in new file mode 100644 index 0000000..4170df4 --- /dev/null +++ b/modules/base64/Makefile.in @@ -0,0 +1,37 @@ +# NOTE!! +# The use of BLDDIR here is _BOGUS_. +# What really needs to happen is that we should install config.h into +# the architecture dependent directory when we really hash all this +# out. + +blddir=@blddir@ +dll_cflags=@dll_cflags@ +dll_oflags=@dll_oflags@ +dll_lflags=@dll_lflags@ +dll_ld=@dll_ld@ + +INCLUDES=-I$(blddir)/src +CFLAGS=@CFLAGS@ $(INCLUDES) +CC=@CC@ +RM=@RM@ + +TARGET=base64 + +.PHONY: clean mostlyclean distclean realclean install + +all: $(TARGET).ell + +$(TARGET).ell: $(TARGET).o + $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^ + +install: + echo "Don't know how to install yet" + +clean mostlyclean: + $(RM) *.o $(TARGET).ell + +distclean: clean + $(RM) Makefile + +realclean extraclean: distclean + $(RM) *~ \#* diff --git a/modules/configure.in b/modules/configure.in new file mode 100644 index 0000000..123fb37 --- /dev/null +++ b/modules/configure.in @@ -0,0 +1,23 @@ +AC_PREREQ(2.12) +AC_INIT(configure.in) + +XE_EMACS +XE_CONFIG_VALUE(dll_cflags dll_ld dll_lflags dll_oflags CFLAGS CC DEFS INSTALL top_srcdir blddir) + +RM='rm -f' + +AC_SUBST(INSTALL) +AC_SUBST(RM) +AC_SUBST(CC) +AC_SUBST(dll_cflags) +AC_SUBST(dll_oflags) +AC_SUBST(dll_lflags) +AC_SUBST(dll_ld) +AC_SUBST(top_srcdir) +AC_SUBST(blddir) + +AC_OUTPUT(Makefile + ldap/Makefile + base64/Makefile + example/Makefile + zlib/Makefile) diff --git a/modules/example/Makefile.in b/modules/example/Makefile.in new file mode 100644 index 0000000..4cb432f --- /dev/null +++ b/modules/example/Makefile.in @@ -0,0 +1,35 @@ +# NOTE!! +# The use of BLDDIR here is _BOGUS_. +# What really needs to happen is that we should install config.h into +# the architecture dependent directory when we really hash all this +# out. + +blddir=@blddir@ +dll_cflags=@dll_cflags@ +dll_oflags=@dll_oflags@ +dll_lflags=@dll_lflags@ +dll_ld=@dll_ld@ +INCLUDES=-I$(blddir)/src +CFLAGS=@CFLAGS@ $(INCLUDES) +CC=@CC@ +RM=@RM@ + +TARGET=purified +all: $(TARGET).ell + +.PHONY: clean mostlyclean distclean realclean install + +$(TARGET).ell: $(TARGET).o + $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^ + +install: + echo "Don't know how to install yet" + +clean mostlyclean: + $(RM) *.o $(TARGET).ell + +distclean: clean + $(RM) Makefile + +realclean extraclean: distclean + $(RM) *~ \#* diff --git a/modules/example/purified.c b/modules/example/purified.c new file mode 100644 index 0000000..d66ad6c --- /dev/null +++ b/modules/example/purified.c @@ -0,0 +1,16 @@ +#include <config.h> +#include "lisp.h" +#include "emacsfns.h" + +DEFUN ("purifiedp", Fpurifiedp, 1, 1, 0, /* +*/ + (obj)) +{ + return purified(obj) ? Qt : Qnil; +} + +void +syms_of() +{ + DEFSUBR(Fpurifiedp); +} diff --git a/modules/ldap/Makefile.in b/modules/ldap/Makefile.in new file mode 100644 index 0000000..c35f80b --- /dev/null +++ b/modules/ldap/Makefile.in @@ -0,0 +1,37 @@ +# NOTE!! +# The use of BLDDIR here is _BOGUS_. +# What really needs to happen is that we should install config.h into +# the architecture dependent directory when we really hash all this +# out. + +blddir=@blddir@ +dll_cflags=@dll_cflags@ +dll_oflags=@dll_oflags@ +dll_lflags=@dll_lflags@ +dll_ld=@dll_ld@ + +INCLUDES=-I$(blddir)/src +CFLAGS=@CFLAGS@ $(INCLUDES) +CC=@CC@ +RM=@RM@ + +TARGET=eldap + +.PHONY: clean mostlyclean distclean realclean install + +all: $(TARGET).ell + +$(TARGET).ell: $(TARGET).o + $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^ + +install: + echo "Don't know how to install yet" + +clean mostlyclean: + $(RM) *.o $(TARGET).ell + +distclean: clean + $(RM) Makefile + +realclean extraclean: distclean + $(RM) *~ \#* diff --git a/modules/ldap/configure.in b/modules/ldap/configure.in new file mode 100644 index 0000000..123fb37 --- /dev/null +++ b/modules/ldap/configure.in @@ -0,0 +1,23 @@ +AC_PREREQ(2.12) +AC_INIT(configure.in) + +XE_EMACS +XE_CONFIG_VALUE(dll_cflags dll_ld dll_lflags dll_oflags CFLAGS CC DEFS INSTALL top_srcdir blddir) + +RM='rm -f' + +AC_SUBST(INSTALL) +AC_SUBST(RM) +AC_SUBST(CC) +AC_SUBST(dll_cflags) +AC_SUBST(dll_oflags) +AC_SUBST(dll_lflags) +AC_SUBST(dll_ld) +AC_SUBST(top_srcdir) +AC_SUBST(blddir) + +AC_OUTPUT(Makefile + ldap/Makefile + base64/Makefile + example/Makefile + zlib/Makefile) diff --git a/modules/zlib/Makefile.in b/modules/zlib/Makefile.in new file mode 100644 index 0000000..5b86a45 --- /dev/null +++ b/modules/zlib/Makefile.in @@ -0,0 +1,37 @@ +# NOTE!! +# The use of BLDDIR here is _BOGUS_. +# What really needs to happen is that we should install config.h into +# the architecture dependent directory when we really hash all this +# out. + +blddir=@blddir@ +dll_cflags=@dll_cflags@ +dll_oflags=@dll_oflags@ +dll_lflags=@dll_lflags@ +dll_ld=@dll_ld@ + +INCLUDES=-I$(blddir)/src +CFLAGS=@CFLAGS@ $(INCLUDES) +CC=@CC@ +RM=@RM@ + +TARGET=zlib + +.PHONY: clean mostlyclean distclean realclean install + +all: $(TARGET).ell + +$(TARGET).ell: $(TARGET).o + $(dll_ld) $(dll_oflags) $@ $(dll_lflags) $^ + +install: + echo "Don't know how to install yet" + +clean mostlyclean: + $(RM) *.o $(TARGET).ell + +distclean: clean + $(RM) Makefile + +realclean extraclean: distclean + $(RM) *~ \#* diff --git a/netinstall/ChangeLog b/netinstall/ChangeLog index b6f3c50..8e2dad2 100644 --- a/netinstall/ChangeLog +++ b/netinstall/ChangeLog @@ -1,229 +1,3 @@ -2002-11-02 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.10 "Military Intelligence" is released. - -2002-08-23 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.9 "Informed Management" is released. - -2002-05-09 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.8 "Honest Recruiter" is released. - -2002-02-04 Andy Piper <andy@xemacs.org> - - * install.cc (install_one): Munge installed filename to fit inside - dialog. - -2002-05-04 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.7 "Economic Science" is released. - -2001-12-17 Andy Piper <andy@xemacs.org> - - * desktop.cc (do_desktop_setup): register the whole gamut of C++ - file types. - -2001-12-12 Andy Piper <andy@xemacs.org> - - * win32.h (CDECL): reorder to remove warnings. - - * Makefile.in.in: add new dependencies. - - * desktop.h: new file. - - * uninstall.cc: use it. - - * install.cc (uninstall_one): when uninstalling xemacs remove - shortcuts also. - - * desktop.cc (remove_xemacs_setup): split out from - remove_desktop_setup. - (remove_desktop_setup): call it. - -2001-12-05 Andy Piper <andy@xemacs.org> - - * win32.h: re-order declarations for native windows from Fabrice - Popineau. - -2001-11-22 Andy Piper <andy@xemacs.org> - - * Makefile.in.in (setup-bin.ini): cope with kit revisions. - - * source.cc (save_dialog): warning removal. - (load_dialog): ditto. - - * msg.cc: remove cvs id. - - * desktop.cc (find_xemacs_version): new function. Cope with kit - revisions. - (find_xemacs_exe_path): use it. - (find_xemacs_exe_name): ditto. - -2001-12-17 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.6 "Common Lisp" is released. - -2001-10-27 Andy Piper <andy@xemacs.org> - - * localdir.cc (dialog_cmd): allow download directory to be - created. - * log.cc (exit_setup): cygwin -> XEmacs - * net.cc (dialog_cmd): - (dialog_proc): - (do_net): sync with cygwin installer. - * res.rc: - * resource.h (IDS_CREATE_DIR): new. - * source.cc (load_dialog): - (save_dialog): - (dialog_cmd): - (dialog_proc): - (do_source): sync with cygwin installer. - * uninstall.cc (progress): remove log message. - * Makefile.in.in: generated setup-bin.ini correctly. - -2001-10-25 Andy Piper <andy@xemacs.org> - - * Merge 21.5 codeline. - -2001-10-25 Andy Piper <andy@xemacs.org> - - * setup.mak (OBJS): minor build fixes. - (distclean): - -2001-10-23 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.5 "Civil Service" is released. - -2001-07-28 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.4 "Artificial Intelligence" is released. - -2001-05-17 Andy Piper <andy@xemacs.org> - - * win32.h: - * win32.h (NOCOMATTRIBUTE): sync with latest cygwin version. - -2001-05-17 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.3 "Academic Rigor" is released. - -2001-05-10 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.2 "Developer-Friendly Unix APIs" is released. - -2001-04-19 Andy Piper <andy@xemacs.org> - - * Makefile.in.in (setup-bin.ini): new. Just calculate ini for the - binaries - (desktop.o): add correct dependency - - * reginfo.h: Update arch to i586 and 21.4 - * reginfo.h (XEMACS_NATIVE_ARCH_NAME): ditto - -2001-04-19 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.1 "Copyleft" is released. - -2001-04-17 Stephen J. Turnbull <stephen@xemacs.org> - - * reginfo.h: Fixup 21.2 -> 21.4. - -2001-04-16 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.0 "Solid Vapor" is released. - -2001-04-14 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.2.47 "Zephir" is released. - -2001-03-21 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.46 "Urania" is released. - -2001-03-01 Andy Piper <andy@xemacs.org> - - * desktop.cc (find_xemacs_exe_name): support 21.1 and 21.2 series. - - * iniparse.c: remove. - - * inilex.c: remove - -2001-02-23 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.45 "Thelxepeia" is released. - -2001-02-08 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.44 "Thalia" is released. - -2001-02-02 Andy Piper <andy@xemacs.org> - - * res.rc: update mirrors.lst location. - -2001-01-26 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.43 "Terspichore" is released. - -2001-01-21 Andy Piper <andy@xemacs.org> - - * Makefile.in.in (%.o): use CXX to compile - - * res.rc: beautify download status and install status. - - * nio-ftp.cc: use xemacs-setup user for identity. - -2001-01-20 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.42 "Poseidon" is released. - -2001-01-17 Andy Piper <andy@xemacs.org> - - * ini.h: move extern "C" to aid win32 compilation. From Fabrice - Popineau. - -2001-01-17 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.41 "Polyhymnia" is released. - -2001-01-12 Andy Piper <andy@xemacs.org> - - * postinstall.cc (do_postinstall): don't pick up shells if cygwin - isn't installed. - -2001-01-10 Andy Piper <andy@xemacs.org> - - * README.xemacs: deleted. - - * README: updated. - - * tar.cc (tar_gzctell): new function picked up from some internal - cygnus version of zlib. - - * Makefile.in.in (LOCALCFLAGS): use -O2 - (OBJS): reinstate autoload. - -2001-01-09 Andy Piper <andy@xemacs.org> - - * root.cc (dialog_cmd): backslash root dir. - - * desktop.cc (do_desktop): runemacs.exe is the exe to run. - - * package-net.el (package-net-batch-convert-index-to-ini): new - batch command. - - * Makefile.in.in (setup.ini): new target. Automatically create. - (LOCALCFLAGS): use extra_includes. - (setup.ini): new target. - - * regedit.cc (create_xemacs_root): write out the package path. - - * reginfo.h (XEMACS_NATIVE_ARCH_NAME): arch dir is i386 not i586 - -2001-01-08 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.40 is released. - 2000-12-31 Martin Buchholz <martin@xemacs.org> * XEmacs 21.2.39 is released. @@ -350,6 +124,5 @@ * all: port from cygwin setup. -%%% $Id: ChangeLog,v 1.2.2.17 2002/08/23 16:44:34 stephent Exp $ -$Revision: 1.2.2.17 $ - +%%% $Id: ChangeLog,v 1.1.2.4 2000/12/30 10:01:41 andyp Exp $ +$Revision: 1.1.2.4 $ diff --git a/netinstall/Makefile.in.in b/netinstall/Makefile.in.in index 694e145..59dfb83 100644 --- a/netinstall/Makefile.in.in +++ b/netinstall/Makefile.in.in @@ -13,6 +13,8 @@ ## ## Makefile for Cygwin installer +## FIXME: integrate autoload.c so that wininet doesn't have to be linked. + ## For performance and consistency, no built-in rules .SUFFIXES: .SUFFIXES: .c .cc .h .o @@ -40,9 +42,6 @@ INSTALLABLES=setup vpath %.c @srcdir@ vpath %.cc @srcdir@ vpath %.h @srcdir@ -vpath %.l @srcdir@ -vpath %.y @srcdir@ -vpath %.rc @srcdir@ #else VPATH=@srcdir@ #endif @@ -61,8 +60,6 @@ archlibdir=@archlibdir@ configuration=@configuration@ moduledir=@moduledir@ sitemoduledir=@sitemoduledir@ -extra_includes=@extra_includes@ -blddir=@blddir@ ## ==================== Utility Programs for the Build ================= @@ -81,8 +78,7 @@ program_transform_name = @program_transform_name@ CC = @CC@ CC_FOR_TARGET = $(CC) -## -O3 has problems so fix this locally -LOCALCFLAGS = $(CFLAGS) -O2 -DMINGW $(extra_includes) +LOCALCFLAGS = $(CFLAGS) -DMINGW CXXFLAGS = $(LOCALCFLAGS) -fno-exceptions -nostdinc++ -fno-rtti WINDRES = windres @@ -92,16 +88,10 @@ MINGW_CFLAGS = $(LOCALCFLAGS) -mno-cygwin $(MINGW_INCLUDES) -mwindows MINGW_ZLIB_DIR = /usr/local/lib PROGS = setup.exe -XEMACS=${blddir}/src/${PROGNAME} - -CYGWIN_SIZE=0 -WIN32_SIZE=0 -KIT_VERSION="" CONFIG_H = ../src/config.h OBJS = \ - autoload.o \ choose.o \ concat.o \ desktop.o \ @@ -115,7 +105,6 @@ OBJS = \ ini.o \ inilex.o \ iniparse.o \ - init.o \ install.o \ localdir.o \ log.o \ @@ -140,7 +129,6 @@ OBJS = \ splash.o \ state.o \ tar.o \ - uninstall.o \ version.o .SUFFIXES: @@ -153,21 +141,10 @@ all: Makefile $(PROGS) setup.exe: $(OBJS) $(CXX) $(MINGW_CXXFLAGS) -o $@ $(OBJS) \ -lole32 -lwsock32 -lnetapi32 -ladvapi32 \ - -luuid -lkernel32 -luser32 \ + -luuid -lkernel32 -luser32 -lwininet \ -L$(MINGW_ZLIB_DIR) -lz -lmingw32 @chmod a-x $@ -setup-bin.ini: - V=`grep '^\$$Revision.*' $(srcdir)/ChangeLog \ - | sed -e 's/\$$Revision:* *//' -e 's/ *$$.*//'` ;\ - $(XEMACS) -batch -vanilla \ - -eval '(setq package-net-cygwin32-binary-size $(CYGWIN_SIZE) \ - package-net-win32-binary-size $(WIN32_SIZE) \ - package-net-kit-version "$(KIT_VERSION)" \ - package-net-setup-version "'$$V'")' \ - -l ${srcdir}/../lisp/package-net.el \ - -f package-net-batch-generate-bin-ini - install: @echo; echo "Installing net setup." for file in ${INSTALLABLES} ; do \ @@ -186,10 +163,10 @@ version.c : $(srcdir)/ChangeLog Makefile $(WINDRES) --include-dir $(srcdir) -o $@ $< %.o: %.c - $(CC) $(MINGW_CFLAGS) -c -o $@ $< + $(CC) $(MINGW_CFLAGS) -c -o $@ ${srcdir}/$< %.o: %.cc - $(CC) $(MINGW_CXXFLAGS) -c -o $@ $< + $(CC) $(MINGW_CXXFLAGS) -c -o $@ ${srcdir}/$< iniparse.c iniparse.h : iniparse.y bison -d -o iniparse.c $(srcdir)/iniparse.y @@ -201,7 +178,7 @@ inilex.c : inilex.l iniparse.h .PHONY: mostlyclean clean distclean realclean extraclean mostlyclean: - $(RM) *.o *.i *.ini core $(PROGS) + $(RM) *.o *.i core $(PROGS) clean: mostlyclean @@ -217,7 +194,7 @@ choose.o: choose.cc win32.h dialog.h resource.h state.h ini.h concat.h \ msg.h log.h find.h reginfo.h concat.o: concat.cc desktop.o: desktop.cc win32.h resource.h ini.h msg.h state.h concat.h \ - mkdir.h dialog.h version.h port.h reginfo.h desktop.h + mkdir.h dialog.h version.h port.h dialog.o: dialog.cc win32.h dialog.h msg.h log.h diskfull.o: diskfull.cc win32.h diskfull.h download.o: download.cc win32.h resource.h msg.h ini.h dialog.h \ @@ -238,11 +215,7 @@ iniparse.o: iniparse.c ini.h \ port.h install.o: install.cc win32.h \ resource.h ini.h dialog.h concat.h geturl.h mkdir.h state.h tar.h \ - diskfull.h msg.h regedit.h reginfo.h log.h hash.h port.h desktop.h -init.o: init.cc win32.h resource.h dialog.h state.h msg.h log.h -uninstall.o: uninstall.cc win32.h \ - resource.h ini.h dialog.h concat.h geturl.h mkdir.h state.h tar.h \ - diskfull.h msg.h regedit.h reginfo.h log.h hash.h port.h desktop.h + diskfull.h msg.h regedit.h reginfo.h log.h hash.h port.h localdir.o: localdir.cc win32.h dialog.h resource.h state.h msg.h \ concat.h log.h log.o: log.cc win32.h resource.h msg.h log.h dialog.h state.h concat.h \ diff --git a/netinstall/README b/netinstall/README index 8548349..21d1877 100644 --- a/netinstall/README +++ b/netinstall/README @@ -1,16 +1,25 @@ -This directory contains the source for the setup program for the XEmacs +This directory contains the source for the setup program for the cygwin net releases. -For commentary on how to do a release please see `package-net.el' -This code has been adapted from the cygwin net release installer. In -particular note that the cygwin net release installer is actively -maintained and therefore we will want to incorporate improvements from -that. I have therefore tried to use the cygwin way wherever -possible. I have however cleaned up the code somewhat so that there -are not billions of warnings. -This program should get built as part of the standard XEmacs -make. Note however that if you use trhe cygwin build you will need a -NON CYGWIN VERSION OF ZLIB. - +To-Do list: + +ini.cc: add field in setup.ini to specify whether package is installed +by default, or not. + +install.cc: scan newly installed files for README files, show list to +user, let them read them if they want. + +download.cc: add a "total progress" indicator, like the install one. + +add a "category" field to setup.ini, let user choose which categories +of packages to install, perhaps with a "custom..." button to lead to +the current chooser. + +remember which packages were selected to be skipped, and which prev/curr/exp +option was last selected, and recall them each time the chooser runs. + +Add friendly error reporting to simpsock.cc + +Add option to download sources also. diff --git a/netinstall/README.xemacs b/netinstall/README.xemacs index e69de29..f962e65 100644 --- a/netinstall/README.xemacs +++ b/netinstall/README.xemacs @@ -0,0 +1,23 @@ +This directory contains the source for the setup program for the +XEmacs net releases. + +This code has been adapted from the cygwin net release installer. In +particular note that the cygwin net release installer is actively +maintained and therefore we will want to incorporate improvements from +that. I have therefore tried to use the cygwin way wherever +possible. I have however cleaned up the code somewhat so that there +are not billions of warnings. + +This program should get built as part of the standard XEmacs +make. Note however that if you use trhe cygwin build you will need a +NON CYGWIN VERSION OF ZLIB. + +New files: + regedit.cc: + regedit.h + reginfo.h + Makefile.in.in: + +Deleted files: + mount.cc: moved to regedit.cc + mount.h: moved to regedit.h diff --git a/netinstall/choose.cc b/netinstall/choose.cc index d86346e..40d4bc8 100644 --- a/netinstall/choose.cc +++ b/netinstall/choose.cc @@ -623,7 +623,7 @@ dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) return FALSE; } -char * +static char * base (char *s) { if (!s) diff --git a/netinstall/desktop.cc b/netinstall/desktop.cc index e7e53ec..0a7c993 100644 --- a/netinstall/desktop.cc +++ b/netinstall/desktop.cc @@ -40,8 +40,6 @@ #include "reginfo.h" #include "regedit.h" #include "port.h" -#include "log.h" -#include "desktop.h" extern "C" { void make_link_2 (char *exepath, char *args, char *icon, char *lname); @@ -62,31 +60,27 @@ static OSVERSIONINFO verinfo; static char *iconname; static char *batname; -static char *uninstname; static void -make_link (char *linkpath, char *title, char *target, char* args) +make_link (char *linkpath, char *title, char *target) { -#if 0 char argbuf[_MAX_PATH]; -#endif char *fname = concat (linkpath, "/", title, ".lnk", 0); if (_access (fname, 0) == 0) return; /* already exists */ - msg ("make_link %s, %s, %s, %s\n", fname, title, target, args); + msg ("make_link %s, %s, %s\n", fname, title, target); mkdir_p (0, fname); - char *exepath; -#if 0 + char *exepath, *args; + /* If we are running Win9x, build a command line. */ if (verinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) { -#endif exepath = target; -#if 0 + args = ""; } else { @@ -97,19 +91,9 @@ make_link (char *linkpath, char *title, char *target, char* args) sprintf (argbuf, "%s %s", COMMAND9XARGS, target); args = argbuf; } -#endif - msg ("make_link_2 (%s, %s, %s, %s)", exepath, args, iconname, fname); - make_link_2 (backslash (exepath), args, iconname, fname); -} -static char* -find_xemacs_version () -{ - char* v = strdup (xemacs_package->info[xemacs_package->trust].version); - char* dash = strrchr (v, '-'); - if (dash) - *dash = 0; - return v; + msg ("make_link_2 (%s, %s, %s, %s)", exepath, args, iconname, fname); + make_link_2 (exepath, args, iconname, fname); } static char* @@ -119,47 +103,23 @@ find_xemacs_exe_path () return backslash (concat (root_dir, "/bin/", XEMACS_CYGWIN_ARCH_NAME, 0)); else return backslash (concat (root_dir, "\\XEmacs-", - find_xemacs_version (), + xemacs_package->info[xemacs_package->trust].version, "\\", XEMACS_NATIVE_ARCH_NAME, 0)); } -char* +static char* find_xemacs_exe_name () { - /* Hack to support older versions. */ - if (strncmp (xemacs_package->info[xemacs_package->trust].version, - "21.1", 4) == 0) - return strdup ("runemacs.exe"); - else if (xemacs_package->type == TY_CYGWIN) + if (xemacs_package->type == TY_CYGWIN) return backslash (concat ("xemacs-", - find_xemacs_version (), + xemacs_package->info[xemacs_package->trust].version, ".exe", 0)); else return strdup ("xemacs.exe"); } static void -remove_link (char *linkpath, char* title) -{ - if (title) - { - char *fname = backslash (concat (linkpath, "/", title, ".lnk", 0)); - msg ("remove_link %s, %s\n", fname, title); - if (_access (fname, 0) != 0) - return; /* doesn't exist */ - _unlink (fname); - } - else - { - msg ("remove_link %s\n", linkpath); - if (_access (linkpath, 0) != 0) - return; /* doesn't exist */ - _rmdir (linkpath); - } -} - -static void -start_menu (char *title, char *target, int rem, char* args) +start_menu (char *title, char *target) { char path[_MAX_PATH]; LPITEMIDLIST id; @@ -175,16 +135,13 @@ start_menu (char *title, char *target, int rem, char* args) msg("Program directory for program link changed to: %s",path); } // end of Win95 addition - strcat (path, "\\"); + strcat (path, "/"); strcat (path, XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME); - if (rem == 0) - make_link (path, title, target, args); - else - remove_link (path, title); + make_link (path, title, target); } static void -desktop_icon (char *title, char *target, int rem) +desktop_icon (char *title, char *target) { char path[_MAX_PATH]; LPITEMIDLIST id; @@ -201,10 +158,59 @@ desktop_icon (char *title, char *target, int rem) msg("Desktop directory for deskop link changed to: %s",path); } // end of Win95 addition - if (rem == 0) - make_link (path, title, target, ""); - else - remove_link (path, title); + make_link (path, title, target); +} + +static int +uexists (char *path) +{ + char *f = concat (root_dir, path, 0); + int a = _access (f, 0); + free (f); + if (a == 0) + return 1; + return 0; +} + +static void +make_passwd_group () +{ + if (verinfo.dwPlatformId != VER_PLATFORM_WIN32_NT) + { + int i; + + LOOP_PACKAGES + { + if (!strcmp (package[i].name, "cygwin")) + { + /* mkpasswd and mkgroup are not working on 9x/ME up to 1.1.5-4 */ + char *border_version = canonicalize_version ("1.1.5-4"); + char *inst_version = canonicalize_version (pi.version); + + if (strcmp (inst_version, border_version) <= 0) + return; + + break; + } + } + } + + if (uexists ("/etc/passwd") && uexists ("/etc/group")) + return; + + char *fname = concat (root_dir, "/etc/postinstall/passwd-grp.bat", 0); + mkdir_p (0, fname); + + FILE *p = fopen (fname, "wb"); + if (!p) + return; + + if (!uexists ("/etc/passwd")) + fprintf (p, "bin\\mkpasswd -l > etc\\passwd\n"); + if (!uexists ("/etc/group")) + fprintf (p, "bin\\mkgroup -l > etc\\group\n"); + + fclose (p); } static void @@ -230,117 +236,46 @@ save_icon () } } -void -remove_xemacs_setup() -{ - if (xemacs_package == 0) - return; - - start_menu ("XEmacs", 0, 1, 0); - desktop_icon ("XEmacs", 0, 1); - -#define FROB(exe) remove_app_path (exe) - FROB (find_xemacs_exe_name ()); - FROB ("runemacs.exe"); - FROB ("xemacs.exe"); -#undef FROB -} - -void -remove_desktop_setup() -{ - remove_xemacs_setup(); - start_menu ("Uninstall XEmacs", 0, 1, 0); - start_menu (0, 0, 1, 0); -} - static void do_desktop_setup() { save_icon (); if (root_menu && batname) { - start_menu ("XEmacs", batname, 0, ""); - start_menu ("Uninstall XEmacs", uninstname, 0, "-u"); + start_menu ("XEmacs", batname); } if (root_desktop && batname) { - desktop_icon ("XEmacs", batname, 0); + desktop_icon ("XEmacs", batname); } // set regkeys for the application if (xemacs_package != 0) { int issystem = (root_scope == IDC_ROOT_SYSTEM ? 1 : 0); - if (xemacs_package->type == TY_NATIVE - || xemacs_package->type == TY_CYGWIN) + if (xemacs_package->type == TY_NATIVE) { - if (xemacs_package->type == TY_NATIVE) - { #define FROB(exe) set_app_path ((exe), \ find_xemacs_exe_path (), \ issystem) - FROB (find_xemacs_exe_name ()); - FROB ("runemacs.exe"); - FROB ("xemacs.exe"); + FROB (find_xemacs_exe_name ()); + FROB ("runemacs.exe"); + FROB ("xemacs.exe"); #undef FROB - } - else if (xemacs_package->type == TY_CYGWIN) - { - int junk; - char* root = find_cygwin_root (&junk); + } + else if (xemacs_package->type == TY_CYGWIN) + { + int junk; + char* root = find_cygwin_root (&junk); #define FROB(exe) set_app_path ((exe), \ concat (find_xemacs_exe_path (), ";", \ root, "\\bin;", \ root, "\\usr\\bin", 0), \ issystem) - FROB (find_xemacs_exe_name ()); - FROB ("runemacs.exe"); - FROB ("xemacs.exe"); + FROB (find_xemacs_exe_name ()); + FROB ("runemacs.exe"); + FROB ("xemacs.exe"); #undef FROB - } - set_install_path (find_xemacs_exe_path(), issystem); - } - // Register file types - if (batname) - { - if (reg_java) - { - log (0, "Registering .java files"); - setup_explorer ("java", "Java Source file", batname); - setup_explorer ("jav", "Java Source file", batname); - } - if (reg_cpp) - { - log (0, "Registering .cpp files"); - setup_explorer ("cpp", "C++ Source file", batname); - setup_explorer ("cc", "C++ Source file", batname); - setup_explorer ("cxx", "C++ Source file", batname); - setup_explorer ("hh", "C++ Header file", batname); - setup_explorer ("hpp", "C++ Header file", batname); - setup_explorer ("hxx", "C++ Header file", batname); - } - if (reg_c) - { - log (0, "Registering .c files"); - setup_explorer ("c", "C Source file", batname); - setup_explorer ("h", "C Header file", batname); - } - if (reg_elisp) - { - log (0, "Registering .el files"); - setup_explorer ("el", "E-Lisp Source file", batname); - } - if (reg_txt) - { - log (0, "Registering .txt files"); - setup_explorer ("txt", "Text file", batname); - } - if (reg_idl) - { - log (0, "Registering .idl files"); - setup_explorer ("idl", "OMG IDL file", batname); - } } } } @@ -348,13 +283,6 @@ do_desktop_setup() static int da[] = { IDC_ROOT_DESKTOP, 0 }; static int ma[] = { IDC_ROOT_MENU, 0 }; -static int ct[] = { IDC_C_TYPE, 0 }; -static int javat[] = { IDC_JAVA_TYPE, 0 }; -static int cppt[] = { IDC_CPP_TYPE, 0 }; -static int elispt[] = { IDC_ELISP_TYPE, 0 }; -static int txtt[] = { IDC_TXT_TYPE, 0 }; -static int idlt[] = { IDC_IDL_TYPE, 0 }; - static void check_if_enable_next (HWND h) { @@ -366,12 +294,6 @@ load_dialog (HWND h) { rbset (h, da, root_desktop); rbset (h, ma, root_menu); - rbset (h, ct, reg_c); - rbset (h, javat, reg_java); - rbset (h, cppt, reg_cpp); - rbset (h, elispt, reg_elisp); - rbset (h, txtt, reg_txt); - rbset (h, idlt, reg_idl); check_if_enable_next (h); } @@ -420,14 +342,14 @@ static int check_startmenu (char *title, char *target) msg ("Program directory for program link changed to: %s",path); } // end of Win95 addition - strcat (path, "\\"); + strcat (path, "/"); strcat (path, XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME); - char *fname = concat (path, "\\", title, ".lnk", 0); + char *fname = concat (path, "/", title, ".lnk", 0); if (_access (fname, 0) == 0) return 0; /* already exists */ - fname = concat (path, "\\", title, ".pif", 0); /* check for a pif as well */ + fname = concat (path, "/", title, ".pif", 0); /* check for a pif as well */ if (_access (fname, 0) == 0) return 0; /* already exists */ @@ -440,12 +362,6 @@ save_dialog (HWND h) { root_desktop= rbget (h, da); root_menu = rbget (h, ma); - reg_c = rbget (h, ct); - reg_java = rbget (h, javat); - reg_cpp = rbget (h, cppt); - reg_elisp = rbget (h, elispt); - reg_txt = rbget (h, txtt); - reg_idl = rbget (h, idlt); } static BOOL @@ -500,33 +416,18 @@ do_desktop (HINSTANCE h) verinfo.dwOSVersionInfoSize = sizeof (verinfo); GetVersionEx (&verinfo); batname = 0; - uninstname = 0; if (xemacs_package != 0 && xemacs_package->type != TY_GENERIC) { batname = concat (find_xemacs_exe_path (), "\\", - find_xemacs_exe_name (), - 0); - uninstname = concat (find_xemacs_exe_path (), "\\", "setup.exe", 0); + find_xemacs_exe_name (), 0); root_desktop = check_desktop ("XEmacs", batname); root_menu = check_startmenu ("XEmacs", batname); - reg_c = IDC_C_TYPE; - reg_cpp = IDC_CPP_TYPE; - reg_java = IDC_JAVA_TYPE; - reg_elisp = IDC_ELISP_TYPE; - reg_txt = IDC_TXT_TYPE; - reg_idl = IDC_IDL_TYPE; } else { root_desktop = 0; root_menu = 0; - reg_c = 0; - reg_cpp = 0; - reg_java = 0; - reg_elisp = 0; - reg_txt = 0; - reg_idl = 0; } int rv = 0; diff --git a/netinstall/desktop.h b/netinstall/desktop.h new file mode 100644 index 0000000..e37c4e8 --- /dev/null +++ b/netinstall/desktop.h @@ -0,0 +1,23 @@ +/* + Copyright (C) 2001 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. */ + +extern void remove_desktop_setup (); +extern void remove_xemacs_setup (); +extern char* find_xemacs_exe_name(); diff --git a/netinstall/dialog.h b/netinstall/dialog.h index e12a421..44c6f9c 100644 --- a/netinstall/dialog.h +++ b/netinstall/dialog.h @@ -31,13 +31,11 @@ D(do_desktop); D(do_download); D(do_fromcwd); D(do_ini); -D(do_init); D(do_install); D(do_local_dir); D(do_net); D(do_other); D(do_postinstall); -D(do_uninstall); D(do_root); D(do_site); D(do_source); diff --git a/netinstall/download.cc b/netinstall/download.cc index 8de578d..3b6ad95 100644 --- a/netinstall/download.cc +++ b/netinstall/download.cc @@ -32,6 +32,8 @@ #include "mkdir.h" #include "log.h" +#define pi (package[i].info[package[i].trust]) + static int download_one (char *name, int expected_size) { diff --git a/netinstall/geturl.cc b/netinstall/geturl.cc index f199c7e..864319f 100644 --- a/netinstall/geturl.cc +++ b/netinstall/geturl.cc @@ -72,10 +72,10 @@ static DWORD WINAPI dialog (void *) { MSG m; - HWND lgw_dialog = CreateDialog (hinstance, MAKEINTRESOURCE (IDD_DLSTATUS), + HWND gw_dialog = CreateDialog (hinstance, MAKEINTRESOURCE (IDD_DLSTATUS), 0, dialog_proc); - ShowWindow (lgw_dialog, SW_SHOWNORMAL); - UpdateWindow (lgw_dialog); + ShowWindow (gw_dialog, SW_SHOWNORMAL); + UpdateWindow (gw_dialog); while (GetMessage (&m, 0, 0, 0) > 0) { TranslateMessage (&m); DispatchMessage (&m); @@ -197,10 +197,6 @@ get_url_to_string (char *_url) bufs = tmp; } *rvp = 0; - - if (n) - delete n; - return rv; } @@ -248,9 +244,6 @@ get_url_to_file (char *_url, char *_filename, int expected_length) fclose (f); - if (n) - delete n; - return 0; } diff --git a/netinstall/ini.h b/netinstall/ini.h index 00ab152..6e5eab2 100644 --- a/netinstall/ini.h +++ b/netinstall/ini.h @@ -61,20 +61,19 @@ typedef struct { } info[NTRUST+1]; /* +1 for TRUST_UNKNOWN */ } Package; -#ifdef __cplusplus -extern "C" { -#endif - extern Package *package; extern Package *xemacs_package; extern int npackages; +#ifdef __cplusplus +extern "C" { +#endif + Package *new_package (char *name); void ini_init (char *string); -#define pinfo(p) ((p).info[(p).trust]) -#define pi pinfo(package[i]) +#define pi (package[i].info[package[i].trust]) #define LOOP_PACKAGES \ for (i=0; i<npackages; i++) \ diff --git a/netinstall/inilex.c b/netinstall/inilex.c new file mode 100644 index 0000000..9562b21 --- /dev/null +++ b/netinstall/inilex.c @@ -0,0 +1,1802 @@ +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /usr/CVSroot/XEmacs/xemacs/netinstall/Attic/inilex.c,v 1.1.2.3 2000/12/27 09:35:04 andyp Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include <stdio.h> + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include <stdlib.h> +#include <unistd.h> + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include <io.h> +#include <stdlib.h> +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT + +#define yywrap() 1 +#define YY_SKIP_YYWRAP +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern int yylineno; +int yylineno = 1; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 21 +#define YY_END_OF_BUFFER 22 +static yyconst short int yy_acclist[188] = + { 0, + 22, 20, 21, 17, 20, 21, 19, 21, 20, 21, + 20, 21, 16, 20, 21, 20, 21, 16, 20, 21, + 16, 20, 21, 16, 20, 21, 16, 20, 21, 16, + 20, 21, 16, 20, 21, 16, 20, 21, 16, 20, + 21, 16, 20, 21, 16, 20, 21, 16, 20, 21, + 17, 1, 18, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 10, 16, 16, 16, 16, 16, 16, 16, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, + + 15, 16, 16, 16, 16, 16, 6, 16, 16, 16, + 16, 16, 16, 6, 10, 16, 11, 15, 14, 15, + 12, 15, 16, 9, 8, 16, 16, 16, 16, 9, + 10, 8, 10, 16, 16, 16, 16, 16, 16, 7, + 16, 16, 16, 16, 7, 10, 16, 5, 16, 16, + 4, 5, 10, 16, 16, 4, 10, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 3, 16, + 3, 10, 16, 16, 2, 2, 10 + } ; + +static yyconst short int yy_accept[167] = + { 0, + 1, 1, 1, 2, 4, 7, 9, 11, 13, 16, + 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, + 48, 51, 52, 52, 53, 53, 54, 55, 55, 55, + 55, 55, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 72, 72, 72, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 86, 86, + 86, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 100, 102, 102, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + + 113, 114, 116, 117, 119, 121, 123, 124, 125, 126, + 127, 128, 129, 130, 132, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 147, 148, 149, + 150, 151, 152, 154, 155, 156, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 183, 184, 185, 186, 188, 188 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 6, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 8, 1, 1, + 1, 1, 1, 1, 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, + 9, 1, 10, 1, 7, 1, 11, 7, 12, 13, + + 14, 7, 7, 7, 15, 7, 7, 16, 17, 18, + 19, 20, 7, 21, 22, 23, 24, 25, 7, 26, + 27, 7, 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, 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, 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, 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, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[28] = + { 0, + 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2 + } ; + +static yyconst short int yy_base[171] = + { 0, + 0, 27, 264, 265, 261, 265, 258, 258, 0, 43, + 242, 246, 45, 231, 243, 248, 52, 48, 54, 57, + 61, 253, 250, 265, 250, 265, 0, 242, 61, 62, + 66, 64, 229, 236, 235, 225, 223, 226, 224, 236, + 265, 69, 72, 75, 71, 73, 82, 74, 265, 82, + 86, 90, 83, 220, 220, 219, 216, 218, 224, 215, + 90, 93, 99, 100, 91, 102, 101, 101, 226, 104, + 107, 224, 222, 221, 212, 219, 222, 214, 117, 119, + 124, 118, 125, 220, 126, 217, 265, 216, 215, 208, + 215, 214, 215, 206, 265, 200, 127, 210, 209, 112, + + 131, 265, 132, 265, 265, 265, 200, 265, 265, 119, + 207, 196, 138, 265, 265, 139, 205, 140, 204, 196, + 196, 265, 201, 200, 141, 145, 265, 199, 265, 189, + 184, 265, 265, 144, 142, 265, 190, 181, 152, 147, + 180, 186, 149, 157, 177, 180, 159, 160, 187, 179, + 162, 166, 179, 178, 168, 175, 161, 265, 167, 265, + 172, 170, 265, 265, 265, 187, 190, 175, 117, 192 + } ; + +static yyconst short int yy_def[171] = + { 0, + 165, 165, 165, 165, 165, 165, 166, 167, 168, 169, + 168, 168, 168, 168, 168, 170, 170, 170, 170, 170, + 170, 165, 166, 165, 167, 165, 168, 169, 169, 169, + 169, 169, 168, 168, 168, 168, 168, 168, 168, 170, + 165, 170, 170, 170, 170, 170, 170, 170, 165, 169, + 169, 169, 169, 168, 168, 168, 168, 168, 168, 168, + 170, 170, 170, 170, 170, 170, 170, 169, 169, 169, + 169, 168, 168, 168, 168, 168, 168, 168, 170, 170, + 170, 170, 170, 170, 170, 169, 165, 169, 169, 168, + 168, 168, 168, 168, 165, 168, 170, 170, 170, 170, + + 170, 165, 170, 165, 165, 165, 168, 165, 165, 168, + 168, 168, 170, 165, 165, 170, 170, 170, 168, 168, + 168, 165, 168, 170, 170, 170, 165, 170, 165, 168, + 168, 165, 165, 170, 170, 165, 168, 168, 170, 170, + 168, 168, 170, 170, 168, 168, 170, 170, 168, 168, + 170, 170, 168, 168, 170, 170, 168, 165, 170, 165, + 168, 170, 165, 165, 0, 165, 165, 165, 165, 165 + } ; + +static yyconst short int yy_nxt[293] = + { 0, + 4, 5, 6, 7, 8, 9, 9, 4, 10, 4, + 9, 9, 9, 9, 11, 12, 9, 9, 9, 9, + 9, 13, 14, 9, 15, 9, 9, 4, 5, 6, + 7, 8, 16, 16, 4, 10, 4, 16, 16, 16, + 16, 17, 18, 16, 16, 16, 16, 16, 19, 20, + 16, 21, 16, 16, 29, 41, 30, 35, 36, 41, + 43, 41, 31, 37, 41, 32, 44, 45, 41, 42, + 49, 49, 46, 49, 48, 49, 41, 53, 41, 41, + 41, 41, 41, 47, 50, 62, 52, 51, 63, 41, + 61, 49, 49, 64, 67, 49, 65, 41, 41, 49, + + 41, 66, 68, 70, 71, 69, 41, 41, 41, 41, + 49, 83, 79, 49, 80, 84, 49, 116, 28, 41, + 81, 86, 85, 82, 41, 41, 41, 97, 88, 89, + 98, 41, 41, 41, 41, 99, 101, 100, 41, 41, + 103, 120, 113, 121, 117, 41, 41, 41, 41, 41, + 118, 41, 41, 124, 41, 134, 41, 128, 135, 41, + 139, 125, 140, 126, 41, 143, 41, 41, 144, 41, + 147, 148, 155, 41, 41, 41, 27, 164, 152, 163, + 161, 151, 160, 156, 159, 158, 162, 23, 23, 23, + 25, 25, 25, 40, 40, 157, 154, 153, 150, 149, + + 146, 145, 142, 141, 138, 137, 136, 133, 132, 131, + 130, 129, 127, 123, 122, 119, 115, 114, 112, 111, + 110, 109, 108, 107, 106, 105, 104, 102, 96, 95, + 94, 93, 92, 91, 90, 87, 78, 77, 76, 75, + 74, 73, 72, 41, 60, 59, 58, 57, 56, 55, + 54, 49, 26, 24, 22, 41, 39, 38, 34, 33, + 26, 24, 22, 165, 3, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165 + + } ; + +static yyconst short int yy_chk[293] = + { 0, + 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, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 10, 18, 10, 13, 13, 17, + 18, 19, 10, 13, 20, 10, 19, 19, 21, 17, + 29, 30, 19, 32, 21, 31, 42, 32, 45, 43, + 46, 48, 44, 20, 29, 43, 31, 30, 44, 47, + 42, 50, 53, 45, 48, 51, 46, 61, 65, 52, + + 62, 47, 50, 52, 53, 51, 63, 64, 67, 66, + 68, 65, 61, 70, 62, 66, 71, 100, 169, 100, + 63, 68, 67, 64, 79, 82, 80, 79, 70, 71, + 80, 81, 83, 85, 97, 81, 83, 82, 101, 103, + 85, 110, 97, 110, 101, 113, 116, 118, 125, 135, + 103, 134, 126, 113, 140, 125, 143, 118, 126, 139, + 134, 116, 135, 116, 144, 139, 147, 148, 140, 151, + 143, 144, 151, 152, 159, 155, 168, 162, 148, 161, + 157, 147, 156, 152, 155, 154, 159, 166, 166, 166, + 167, 167, 167, 170, 170, 153, 150, 149, 146, 145, + + 142, 141, 138, 137, 131, 130, 128, 124, 123, 121, + 120, 119, 117, 112, 111, 107, 99, 98, 96, 94, + 93, 92, 91, 90, 89, 88, 86, 84, 78, 77, + 76, 75, 74, 73, 72, 69, 60, 59, 58, 57, + 56, 55, 54, 40, 39, 38, 37, 36, 35, 34, + 33, 28, 25, 23, 22, 16, 15, 14, 12, 11, + 8, 7, 5, 3, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165 + + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +++yy_lp; \ +goto find_rule; \ +} +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +char *yytext; +#line 1 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +#define INITIAL 0 +#line 2 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie <dj@cygnus.com> + * + */ + +/* tokenize the setup.ini files. We parse a string which we've + previously downloaded. The program must call ini_init() to specify + that string. */ + +#include "win32.h" +#include <string.h> +#include <stdlib.h> + +#include "ini.h" +#include "iniparse.h" + +#define YY_INPUT(buf,result,max_size) { result = ini_getchar(buf, max_size); } + +static int ini_getchar(char *buf, int max_size); +static void ignore_line (); + +/*%option debug */ +#define YY_NEVER_INTERACTIVE 1 +#line 546 "lex.yy.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include <stdlib.h> +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + yy_current_buffer->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 42 "/windows/build/xemacs/xemacs/netinstall/inilex.l" + + +#line 699 "lex.yy.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 166 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 265 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + { + yy_full_match = yy_cp; + break; + } + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER ) + { + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + ++yylineno; + } + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 44 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +{ yylval = strdup (yytext+1); + yylval[strlen (yylval)-1] = 0; + return STRING; } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 48 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return SETUP_TIMESTAMP; + YY_BREAK +case 3: +YY_RULE_SETUP +#line 49 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return SETUP_VERSION; + YY_BREAK +case 4: +YY_RULE_SETUP +#line 50 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return VERSION; + YY_BREAK +case 5: +YY_RULE_SETUP +#line 51 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return INSTALL; + YY_BREAK +case 6: +YY_RULE_SETUP +#line 52 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return TYPE; + YY_BREAK +case 7: +YY_RULE_SETUP +#line 53 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return SOURCE; + YY_BREAK +case 8: +YY_RULE_SETUP +#line 54 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return SDESC; + YY_BREAK +case 9: +YY_RULE_SETUP +#line 55 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return LDESC; + YY_BREAK +case 10: +YY_RULE_SETUP +#line 57 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +ignore_line (); + YY_BREAK +case 11: +YY_RULE_SETUP +#line 59 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return T_CURR; + YY_BREAK +case 12: +YY_RULE_SETUP +#line 60 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return T_TEST; + YY_BREAK +case 13: +YY_RULE_SETUP +#line 61 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return T_TEST; + YY_BREAK +case 14: +YY_RULE_SETUP +#line 62 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return T_PREV; + YY_BREAK +case 15: +YY_RULE_SETUP +#line 63 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return T_UNKNOWN; + YY_BREAK +case 16: +YY_RULE_SETUP +#line 65 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +{ yylval = strdup (yytext); + return STRING; } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 68 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +/* do nothing */ + YY_BREAK +case 18: +YY_RULE_SETUP +#line 70 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +/* ignore comments */ + YY_BREAK +case 19: +YY_RULE_SETUP +#line 72 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +{ return yytext[0]; } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 73 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +{ return yytext[0]; } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 75 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +ECHO; + YY_BREAK +#line 899 "lex.yy.c" + case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a singled characater, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 166 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 166 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + yy_is_jam = (yy_current_state == 165); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + if ( c == '\n' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + yytext_ptr = yy_c_buf_p; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + { + yy_c_buf_p = + yytext_ptr + YY_MORE_ADJ; + return EOF; + } + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + break; + + case EOB_ACT_LAST_MATCH: +#ifdef __cplusplus + YY_FATAL_ERROR( + "unexpected last match in yyinput()" ); +#else + YY_FATAL_ERROR( + "unexpected last match in input()" ); +#endif + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + yy_current_buffer->yy_at_bol = (c == '\n'); + if ( yy_current_buffer->yy_at_bol ) + ++yylineno; + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *str ) +#else +YY_BUFFER_STATE yy_scan_string( str ) +yyconst char *str; +#endif + { + int len; + for ( len = 0; str[len]; ++len ) + ; + + return yy_scan_bytes( str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 75 "/windows/build/xemacs/xemacs/netinstall/inilex.l" + + +static char *input_string = 0; +static char *end_input_string; + +void +ini_init(char *string) +{ + input_string = string; + end_input_string = input_string + strlen(input_string); +} + +static int +ini_getchar(char *buf, int max_size) +{ + if (input_string) + { + int avail = end_input_string - input_string; + if (avail == 0) + { + input_string = end_input_string = 0; + return 0; + } + if (avail > max_size) + avail = max_size; + memcpy(buf, input_string, avail); + input_string += avail; + return avail; + } + else + return 0; +} + +static void +ignore_line () +{ + char c; + while (c = input ()) + { + if (c == EOF) + return; + if (c == '\n') + return; + } +} diff --git a/netinstall/iniparse.c b/netinstall/iniparse.c new file mode 100644 index 0000000..7c30c67 --- /dev/null +++ b/netinstall/iniparse.c @@ -0,0 +1,1068 @@ + +/* A Bison parser, made from /windows/build/xemacs/xemacs/netinstall/iniparse.y + by GNU Bison version 1.28 */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define STRING 257 +#define SETUP_TIMESTAMP 258 +#define SETUP_VERSION 259 +#define VERSION 260 +#define INSTALL 261 +#define SOURCE 262 +#define SDESC 263 +#define LDESC 264 +#define TYPE 265 +#define T_PREV 266 +#define T_CURR 267 +#define T_TEST 268 +#define T_UNKNOWN 269 + +#line 1 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" + +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie <dj@cygnus.com> + * + */ + +/* Parse the setup.ini files. inilex.l provides the tokens for this. */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "win32.h" + +#include "ini.h" +#include "iniparse.h" + +#include "port.h" + +#define YYERROR_VERBOSE 1 +/*#define YYDEBUG 1*/ + +static Package *cp; +static int trust; +extern unsigned int setup_timestamp; +extern char *setup_version; +extern int yylineno; +extern int CDECL yyerror (char *s, ...); + +#define cpt (cp->info+trust) + +#ifndef YYSTYPE +#define YYSTYPE int +#endif +#include <stdio.h> + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 47 +#define YYFLAG -32768 +#define YYNTBASE 18 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 269 ? yytranslate[x] : 27) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 17, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 3, 6, 7, 11, 15, 17, 18, 22, 25, + 26, 27, 33, 37, 39, 42, 45, 48, 52, 56, + 59, 61, 63, 65, 67, 68 +}; + +static const short yyrhs[] = { 19, + 22, 0, 20, 19, 0, 0, 4, 3, 16, 0, + 5, 3, 16, 0, 16, 0, 0, 1, 21, 16, + 0, 23, 22, 0, 0, 0, 17, 3, 16, 24, + 25, 0, 26, 16, 25, 0, 26, 0, 6, 3, + 0, 9, 3, 0, 10, 3, 0, 7, 3, 3, + 0, 8, 3, 3, 0, 11, 3, 0, 12, 0, + 13, 0, 14, 0, 15, 0, 0, 1, 16, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 50, 54, 55, 59, 60, 61, 62, 63, 66, 67, + 71, 73, 76, 77, 81, 82, 83, 84, 86, 88, + 94, 95, 96, 97, 98, 99 +}; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) + +static const char * const yytname[] = { "$","error","$undefined.","STRING", +"SETUP_TIMESTAMP","SETUP_VERSION","VERSION","INSTALL","SOURCE","SDESC","LDESC", +"TYPE","T_PREV","T_CURR","T_TEST","T_UNKNOWN","'\\n'","'@'","whole_file","setup_headers", +"setup_header","@1","packages","package","@2","lines","simple_line", NULL +}; +#endif + +static const short yyr1[] = { 0, + 18, 19, 19, 20, 20, 20, 21, 20, 22, 22, + 24, 23, 25, 25, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26 +}; + +static const short yyr2[] = { 0, + 2, 2, 0, 3, 3, 1, 0, 3, 2, 0, + 0, 5, 3, 1, 2, 2, 2, 3, 3, 2, + 1, 1, 1, 1, 0, 2 +}; + +static const short yydefact[] = { 0, + 7, 0, 0, 6, 10, 0, 0, 0, 0, 0, + 1, 10, 2, 8, 4, 5, 0, 9, 11, 0, + 0, 0, 0, 0, 0, 0, 0, 21, 22, 23, + 24, 12, 14, 26, 15, 0, 0, 16, 17, 20, + 0, 18, 19, 13, 0, 0, 0 +}; + +static const short yydefgoto[] = { 45, + 5, 6, 7, 11, 12, 20, 32, 33 +}; + +static const short yypact[] = { 18, +-32768, -1, 1,-32768, -14, 18, -11, 4, 5, 21, +-32768, -14,-32768,-32768,-32768,-32768, 9,-32768,-32768, 0, + 10, 24, 25, 26, 27, 28, 29,-32768,-32768,-32768, +-32768,-32768, 17,-32768,-32768, 33, 34,-32768,-32768,-32768, + 0,-32768,-32768,-32768, 38, 39,-32768 +}; + +static const short yypgoto[] = {-32768, + 35,-32768,-32768, 30,-32768,-32768, 2,-32768 +}; + + +#define YYLAST 43 + + +static const short yytable[] = { -25, + 21, 8, 10, 9, 14, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, -25, -25, -3, 1, 15, + 16, 2, 3, 17, 19, 34, 35, 36, 37, 38, + 39, 40, 41, 4, -3, 42, 43, 46, 47, 0, + 13, 18, 44 +}; + +static const short yycheck[] = { 0, + 1, 3, 17, 3, 16, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 0, 1, 16, + 16, 4, 5, 3, 16, 16, 3, 3, 3, 3, + 3, 3, 16, 16, 17, 3, 3, 0, 0, -1, + 6, 12, 41 +}; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, 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. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include <alloca.h> +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include <malloc.h> +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include <malloc.h> */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) +{ + register char *t = to; + register char *f = from; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +#line 217 "/usr/share/bison.simple" + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); +#else +int yyparse (void); +#endif +#endif + +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + int size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 4: +#line 59 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ setup_timestamp = strtoul (yyvsp[-1], 0, 0); ; + break;} +case 5: +#line 60 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ setup_version = strdup (yyvsp[-1]); ; + break;} +case 7: +#line 62 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ yyerror ("unrecognized line in setup.ini headers (do you have the latest setup?)"); ; + break;} +case 11: +#line 71 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ new_package(yyvsp[-1]); ; + break;} +case 15: +#line 81 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ cpt->version = yyvsp[0]; ; + break;} +case 16: +#line 82 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ cp->sdesc = yyvsp[0]; ; + break;} +case 17: +#line 83 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ cp->ldesc = yyvsp[0]; ; + break;} +case 18: +#line 84 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ cpt->install = yyvsp[-1]; + cpt->install_size = atoi(yyvsp[0]); ; + break;} +case 19: +#line 86 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ cpt->source = yyvsp[-1]; + cpt->source_size = atoi(yyvsp[0]); ; + break;} +case 20: +#line 88 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ if (!strcmp (yyvsp[0], "cygwin")) + cp->type = TY_CYGWIN; + else if (!strcmp (yyvsp[0], "native")) + cp->type = TY_NATIVE; + else + cp->type = TY_GENERIC; ; + break;} +case 21: +#line 94 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ trust = TRUST_PREV; ; + break;} +case 22: +#line 95 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ trust = TRUST_CURR; ; + break;} +case 23: +#line 96 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ trust = TRUST_TEST; ; + break;} +case 24: +#line 97 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ trust = TRUST_UNKNOWN; ; + break;} +case 26: +#line 99 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ yylineno --; + yyerror ("unrecognized line in package %s (do you have the latest setup?)", cp->name); + yylineno ++; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; + + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; + + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 1; +} +#line 105 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" + + +Package *package = 0; +Package *xemacs_package = 0; +int npackages = 0; +static int maxpackages = 0; + +Package * +new_package (char *name) +{ + if (package == 0) + maxpackages = npackages = 0; + if (npackages >= maxpackages) + { + maxpackages += 10; + if (package) + package = (Package *) realloc (package, maxpackages * sizeof (Package)); + else + package = (Package *) malloc (maxpackages * sizeof (Package)); + } + cp = package + npackages; + npackages ++; + + memset (cp, 0, sizeof (Package)); + cp->name = name; + + trust = TRUST_CURR; + + return cp; +} diff --git a/netinstall/init.cc b/netinstall/init.cc new file mode 100644 index 0000000..d18c5d0 --- /dev/null +++ b/netinstall/init.cc @@ -0,0 +1,65 @@ +/* Initialisation for netinstall. + Copyright (C) 2001 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. */ + +#include "win32.h" +#include <stdio.h> +#include <stdlib.h> +#include "dialog.h" +#include "log.h" +#include "resource.h" +#include "state.h" +#include "msg.h" +#include "regedit.h" +#include "reginfo.h" +#include "version.h" + +static void +init_root () +{ + int isnative, issystem; + root_dir = find_root_location (&issystem, &isnative); + if (root_dir) + { + if (isnative) + install_type = IDC_INSTALL_NATIVE; + else + install_type = IDC_INSTALL_CYGWIN; + + if (issystem) + root_scope = IDC_ROOT_SYSTEM; + else + root_scope = IDC_ROOT_USER; + root_dir_default = 0; + } +} + +void +do_init (HINSTANCE h) +{ + char cwd[_MAX_PATH]; + GetCurrentDirectory (sizeof (cwd), cwd); + local_dir = strdup (cwd); + log (0, "Current Directory: %s", cwd); + + HANDLE gnu = LoadImage (h, MAKEINTRESOURCE (IDB_GNU), + IMAGE_BITMAP, 0, 0, 0); + init_root(); +} + diff --git a/netinstall/install.cc b/netinstall/install.cc index c9bd2d6..5d64055 100644 --- a/netinstall/install.cc +++ b/netinstall/install.cc @@ -47,7 +47,7 @@ #include "reginfo.h" #include "log.h" #include "hash.h" -#include "desktop.h" + #include "port.h" static HWND ins_dialog = 0; @@ -231,10 +231,6 @@ uninstall_one (char *name, int action, int type) { SetWindowText (ins_pkgname, name); SetWindowText (ins_action, "Uninstalling..."); - // remove shortcuts and registry entries - if (type != TY_GENERIC) - remove_xemacs_setup(); - if (action == ACTION_UPGRADE) log (0, "Uninstalling old %s", name); else @@ -282,7 +278,6 @@ install_one (char *name, char *file, int file_size, int action, int type) for (cp=local; *cp; cp++) if (*cp == '/' || *cp == '\\' || *cp == ':') base = cp+1; - SetWindowText (ins_pkgname, base); if (!exists (local) && exists (base)) @@ -316,27 +311,14 @@ install_one (char *name, char *file, int file_size, int action, int type) tar_open (local); while ((fn = tar_next_file ())) { - char *dest_file, *disp_file; - int len; + char *dest_file; if (lst) fprintf (lst, "%s\n", fn); dest_file = map_filename (fn, type); - - // The installer uses a variable width font. Assume roughly 32 chars - // will fit and munge the file accordingly. -#define MAX_DISP_SIZE 50 - disp_file = strdup(dest_file); - if ((len = strlen(dest_file)) > MAX_DISP_SIZE) { - disp_file += (len - MAX_DISP_SIZE); - disp_file[0] = '.'; - disp_file[1] = '.'; - disp_file[2] = '.'; - } -#undef MAX_DISP_SIZE - SetWindowText (ins_filename, disp_file); + SetWindowText (ins_filename, dest_file); log (LOG_BABBLE, "Installing file %s", dest_file); if (tar_read_file (dest_file) != 0) { diff --git a/netinstall/localdir.cc b/netinstall/localdir.cc index efe8a27..89f8e34 100644 --- a/netinstall/localdir.cc +++ b/netinstall/localdir.cc @@ -12,7 +12,6 @@ * Written by Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru> * based on work and suggestions of DJ Delorie * - * Sync'ed with cinstall 2001-10-16 */ /* The purpose of this file is to ask the user where they want the @@ -24,9 +23,7 @@ #include <stdio.h> #include <stdlib.h> #include <ctype.h> -#include <io.h> -#include "mkdir.h" #include "dialog.h" #include "resource.h" #include "state.h" @@ -105,11 +102,6 @@ dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) case IDOK: save_dialog (h); - if (_access (local_dir, 0) != 0 && yesno (IDS_CREATE_DIR, local_dir) == IDYES) - { - log (0, "Created install directory %s\n", local_dir); - mkdir_p (1, local_dir); - } if (SetCurrentDirectoryA (local_dir)) { switch (source) @@ -140,6 +132,7 @@ dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) NEXT (0); break; } + return FALSE; } static BOOL CALLBACK diff --git a/netinstall/log.cc b/netinstall/log.cc index 53efce3..0ffc8e5 100644 --- a/netinstall/log.cc +++ b/netinstall/log.cc @@ -110,7 +110,7 @@ exit_setup (int exit_code) if (exit_msg) note (exit_msg); - log (LOG_TIMESTAMP, "Ending XEmacs install"); + log (LOG_TIMESTAMP, "Ending cygwin install"); if (source == IDC_SOURCE_DOWNLOAD || !root_dir) { diff --git a/netinstall/main.cc b/netinstall/main.cc index df8a543..4a93fb2 100644 --- a/netinstall/main.cc +++ b/netinstall/main.cc @@ -51,29 +51,21 @@ WinMain (HINSTANCE h, int cmd_show) { hinstance = h; - int pos = -1; - if ((pos = strcspn(command_line, "-")) >= 0 - && - command_line[pos+1] == 'u') - { - next_dialog = IDD_UNINSTALL; - log (LOG_TIMESTAMP, "Starting XEmacs uninstall"); - uninstall = 1; - } - else - { - next_dialog = IDD_SPLASH; - log (LOG_TIMESTAMP, "Starting XEmacs install"); - } - do_init(h); + next_dialog = IDD_SPLASH; + + log (LOG_TIMESTAMP, "Starting XEmacs install"); + + char cwd[_MAX_PATH]; + GetCurrentDirectory (sizeof (cwd), cwd); + local_dir = strdup (cwd); + log (0, "Current Directory: %s", cwd); while (next_dialog) { switch (next_dialog) { case IDD_SPLASH: do_splash (h); break; - case IDD_UNINSTALL: do_uninstall (h); break; case IDD_SOURCE: do_source (h); break; case IDD_LOCAL_DIR: do_local_dir (h); break; case IDD_ROOT: do_root (h); break; diff --git a/netinstall/msg.cc b/netinstall/msg.cc index 2cee192..5a9ed24 100644 --- a/netinstall/msg.cc +++ b/netinstall/msg.cc @@ -16,6 +16,8 @@ /* The purpose of this file is to centralize all the message functions. */ +static char *cvsid = "\n%%% $Id: msg.cc,v 1.1.2.1 2000/12/11 22:01:36 andyp Exp $\n"; + #include "win32.h" #include <stdio.h> #include <stdarg.h> diff --git a/netinstall/net.cc b/netinstall/net.cc index eb01ca4..3891d3f 100644 --- a/netinstall/net.cc +++ b/netinstall/net.cc @@ -11,7 +11,6 @@ * * Written by DJ Delorie <dj@cygnus.com> * - * Sync'ed with cinstall 2001-10-16 */ /* The purpose of this file is to get the network configuration @@ -116,6 +115,7 @@ dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) NEXT (0); break; } + return FALSE; } static BOOL CALLBACK @@ -125,13 +125,6 @@ dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) { case WM_INITDIALOG: load_dialog (h); - - // Check to see if any radio buttons are selected. If not, select a default. - if ((!SendMessage(GetDlgItem (h, IDC_NET_IE5), BM_GETCHECK, 0, 0) == BST_CHECKED) - && (!SendMessage(GetDlgItem (h, IDC_NET_PROXY), BM_GETCHECK, 0, 0) == BST_CHECKED)) - { - SendMessage(GetDlgItem (h, IDC_NET_DIRECT), BM_CLICK, 0, 0); - } return FALSE; case WM_COMMAND: return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); @@ -144,7 +137,6 @@ do_net (HINSTANCE h) { int rv = 0; - net_method = IDC_NET_DIRECT; rv = DialogBox (h, MAKEINTRESOURCE (IDD_NET), 0, dialog_proc); if (rv == -1) fatal (IDS_DIALOG_FAILED); diff --git a/netinstall/nio-ftp.cc b/netinstall/nio-ftp.cc index 9aa41de..f30beb6 100644 --- a/netinstall/nio-ftp.cc +++ b/netinstall/nio-ftp.cc @@ -43,7 +43,7 @@ ftp_line (SimpleSocket *s) last_line = s->gets (); log (LOG_BABBLE, "ftp > %s", last_line); } while (last_line && (!isdigit (last_line[0]) || last_line[3] != ' ')); - return atoi (last_line ?: "0"); + return atoi (last_line ? last_line : "0"); } NetIO_FTP::NetIO_FTP (char *Purl) @@ -73,7 +73,7 @@ NetIO_FTP::NetIO_FTP (char *Purl) code = ftp_line (c); if (code == 331) { - c->printf ("PASS xemacs-setup@\r\n"); + c->printf ("PASS cygwin-setup@\r\n"); code = ftp_line (c); } diff --git a/netinstall/nio-ie5.cc b/netinstall/nio-ie5.cc index 29584f3..9f2cae0 100644 --- a/netinstall/nio-ie5.cc +++ b/netinstall/nio-ie5.cc @@ -18,6 +18,8 @@ must already have installed and configured IE5. This module is called from netio.cc, which is called from geturl.cc */ +static char *cvsid = "\n%%% $Id: nio-ie5.cc,v 1.1.2.1 2000/12/11 22:01:41 andyp Exp $\n"; + #include "win32.h" #include "resource.h" diff --git a/netinstall/postinstall.cc b/netinstall/postinstall.cc index 23f656e1..bf26f66 100644 --- a/netinstall/postinstall.cc +++ b/netinstall/postinstall.cc @@ -102,19 +102,13 @@ do_postinstall (HINSTANCE h) next_dialog = 0; char* cygroot = find_cygwin_root (&issystem); int i; - - sh = 0; - - if (cygroot) + for (i=0; shells[i]; i++) { - for (i=0; shells[i]; i++) - { - sh = backslash (concat (cygroot, shells[i], 0)); - if (_access (sh, 0) == 0) - break; - free (sh); - sh = 0; - } + sh = backslash (concat (cygroot, shells[i], 0)); + if (_access (sh, 0) == 0) + break; + free (sh); + sh = 0; } char old_path[_MAX_PATH]; diff --git a/netinstall/regedit.cc b/netinstall/regedit.cc index fb4be82..0c69495 100644 --- a/netinstall/regedit.cc +++ b/netinstall/regedit.cc @@ -175,12 +175,6 @@ create_xemacs_root (char *path, int issystem, int isnative) 0, REG_SZ, (BYTE *)path, strlen (path)+1); RegSetValueEx (key, XEMACS_INFO_XEMACS_ROOT_TYPE, 0, REG_DWORD, (BYTE *)&itype, sizeof (itype)); - // write out the package path - sprintf (buf, "~\\.xemacs;%s\\site-packages;%s\\xemacs-packages", - path, path); - RegSetValueEx (key, XEMACS_INFO_XEMACS_PACKAGE_KEY, - 0, REG_SZ, (BYTE *)buf, strlen (buf)+1); - RegCloseKey (key); } void @@ -202,117 +196,6 @@ set_app_path (char *exe, char* path, int issystem) RegSetValueEx (key, "Path", 0, REG_SZ, (BYTE *)path, strlen (path)+1); - RegCloseKey (key); -} - -void -set_install_path (char* path, int issystem) -{ - char buf[1000]; - HKEY key; - DWORD disposition; - - sprintf (buf, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\XEmacs"); - - HKEY kr = issystem ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; - RegDeleteKey (kr, buf); - - if (RegCreateKeyEx (kr, buf, 0, "XEmacs", 0, KEY_ALL_ACCESS, - 0, &key, &disposition) != ERROR_SUCCESS) - fatal ("set_install_path"); - - RegSetValueEx (key, "DisplayName", - 0, REG_SZ, (BYTE *)"XEmacs", strlen ("XEmacs")+1); - - sprintf (buf, "%s\\setup.exe -u", path); - RegSetValueEx (key, "UninstallString", - 0, REG_SZ, (BYTE *)buf, strlen (buf)+1); - RegCloseKey (key); -} - -void -setup_explorer (char* file_type, char* name, char *exe) -{ - char buf[1000]; - char ftype[32]; - HKEY key; - DWORD disposition; - - sprintf (buf, ".%s", file_type); - RegDeleteKey (HKEY_CLASSES_ROOT, buf); - - if (RegCreateKeyEx (HKEY_CLASSES_ROOT, buf, 0, "XEmacs", 0, KEY_ALL_ACCESS, - 0, &key, &disposition) != ERROR_SUCCESS) - fatal ("setup_explorer"); - - // set default key - sprintf (ftype, "%sfile", file_type); - RegSetValueEx (key, NULL, - 0, REG_SZ, (BYTE *)ftype, strlen (ftype)+1); - RegCloseKey (key); - - // create file type entry - RegDeleteKey (HKEY_CLASSES_ROOT, ftype); - if (RegCreateKeyEx (HKEY_CLASSES_ROOT, ftype, 0, "XEmacs", - 0, KEY_ALL_ACCESS, - 0, &key, &disposition) != ERROR_SUCCESS) - fatal ("setup_explorer"); - RegSetValueEx (key, NULL, - 0, REG_SZ, (BYTE *)name, strlen (name)+1); - RegSetValueEx (key, "AlwaysShowExt", - 0, REG_SZ, (BYTE *)"", strlen ("")+1); - RegCloseKey (key); - - // make xemacs file the default icon - sprintf(buf, "%s\\DefaultIcon", ftype); - if (RegCreateKeyEx (HKEY_CLASSES_ROOT, buf, 0, "XEmacs", 0, KEY_ALL_ACCESS, - 0, &key, &disposition) != ERROR_SUCCESS) - fatal ("setup_explorer"); - - sprintf(buf, "%s,1", exe); - RegSetValueEx (key, NULL, - 0, REG_SZ, (BYTE *)buf, strlen (buf)+1); - RegCloseKey (key); - - // command default key (exe) - sprintf(buf, "%s\\shell\\Open\\command", ftype); - if (RegCreateKeyEx (HKEY_CLASSES_ROOT, buf, 0, "XEmacs", 0, KEY_ALL_ACCESS, - 0, &key, &disposition) != ERROR_SUCCESS) - fatal ("setup_explorer"); - - sprintf(buf, "\"%s\"", exe); // Don't need %1 because dde will open the file - RegSetValueEx (key, NULL, - 0, REG_SZ, (BYTE *)buf, strlen (buf)+1); - RegCloseKey (key); - - // ddeexec - sprintf(buf, "%s\\shell\\Open\\ddeexec", ftype); - if (RegCreateKeyEx (HKEY_CLASSES_ROOT, buf, 0, "XEmacs", 0, KEY_ALL_ACCESS, - 0, &key, &disposition) != ERROR_SUCCESS) - fatal ("setup_explorer"); - -#define DDE_OPEN "Open(\"%1\")" - RegSetValueEx (key, NULL, - 0, REG_SZ, (BYTE *)DDE_OPEN, strlen (DDE_OPEN)+1); - RegCloseKey (key); - - // ddeexec application - sprintf(buf, "%s\\shell\\Open\\ddeexec\\application", ftype); - if (RegCreateKeyEx (HKEY_CLASSES_ROOT, buf, 0, "XEmacs", 0, KEY_ALL_ACCESS, - 0, &key, &disposition) != ERROR_SUCCESS) - fatal ("setup_explorer"); - RegSetValueEx (key, NULL, - 0, REG_SZ, (BYTE *)"XEmacs", strlen ("XEmacs")+1); - RegCloseKey (key); - - // ddeexec topic - sprintf(buf, "%s\\shell\\Open\\ddeexec\\topic", ftype); - if (RegCreateKeyEx (HKEY_CLASSES_ROOT, buf, 0, "XEmacs", 0, KEY_ALL_ACCESS, - 0, &key, &disposition) != ERROR_SUCCESS) - fatal ("setup_explorer"); - RegSetValueEx (key, NULL, - 0, REG_SZ, (BYTE *)"system", strlen ("system")+1); - RegCloseKey (key); } static void @@ -323,10 +206,7 @@ remove1 (HKEY rkey) sprintf (buf, "Software\\%s\\%s", XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME, XEMACS_INFO_XEMACS_REGISTRY_NAME); - RegDeleteKey (rkey, buf); - sprintf (buf, "Software\\%s", - XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME); RegDeleteKey (rkey, buf); } @@ -337,23 +217,3 @@ remove_xemacs_root () remove1 (HKEY_CURRENT_USER); } -void -remove_app_path (char *exe) -{ - char buf[1000]; - sprintf (buf, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\%s", - exe); - - RegDeleteKey (HKEY_LOCAL_MACHINE, buf); - RegDeleteKey (HKEY_CURRENT_USER, buf); -} - -void -remove_uninstall_path () -{ - char buf[1000]; - sprintf (buf, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\XEmacs"); - - RegDeleteKey (HKEY_LOCAL_MACHINE, buf); - RegDeleteKey (HKEY_CURRENT_USER, buf); -} diff --git a/netinstall/regedit.h b/netinstall/regedit.h index 6ef4540..4944c9e 100644 --- a/netinstall/regedit.h +++ b/netinstall/regedit.h @@ -23,8 +23,4 @@ char * find_cygwin_root (int *issystem); void create_xemacs_root (char *posix, int issystem, int isnative); void remove_xemacs_root (); void set_app_path (char *exe, char* path, int issystem); -void set_install_path (char* path, int issystem); -void setup_explorer (char* file_type, char* name, char *exe); -void remove_app_path (char *exe); -void remove_uninstall_path (); diff --git a/netinstall/reginfo.h b/netinstall/reginfo.h index fda0ada..36c0cd2 100644 --- a/netinstall/reginfo.h +++ b/netinstall/reginfo.h @@ -2,7 +2,7 @@ Copyright (C) 2000 Andy Piper. */ -#define XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME "XEmacs" +#define XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME "GNU" #define XEMACS_INFO_XEMACS_REGISTRY_NAME "XEmacs" /* Keys */ #define XEMACS_INFO_XEMACS_ROOT_KEY "emacs_dir" @@ -21,7 +21,7 @@ Copyright (C) 2000 Andy Piper. */ ((char*)(install_type == IDC_INSTALL_NATIVE ? "\\xemacs-packages\\" \ : "/lib/xemacs/xemacs-packages/")) #define XEMACS_NATIVE_ARCH_NAME "i586-pc-win32" -#define XEMACS_CYGWIN_ARCH_NAME "i686-pc-cygwin" +#define XEMACS_CYGWIN_ARCH_NAME "i686-pc-cygwin32" /* * Installation hierarchy is: @@ -35,7 +35,7 @@ Copyright (C) 2000 Andy Piper. */ * \pkginfo * \site-packages * \mule-packages - * \XEmacs-21.4 + * \XEmacs-21.2 * \i586-pc-win32 * \etc * \info @@ -45,12 +45,12 @@ Copyright (C) 2000 Andy Piper. */ * /xemacs/xemacs-packages * /xemacs/site-packages * /xemacs/mule-packages - * /xemacs-21.4 - * /i686-pc-cygwin + * /xemacs-21.2 + * /i686-pc-cygwin32 * /etc * /info * /lisp - * /usr/local/bin/i686-pc-cygwin + * /usr/local/bin/i686-pc-cygwin32 */ diff --git a/netinstall/res.rc b/netinstall/res.rc index 349b6c2..2d59534 100644 --- a/netinstall/res.rc +++ b/netinstall/res.rc @@ -33,20 +33,20 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "XEmacs Setup" FONT 8, "MS Sans Serif" BEGIN - PUSHBUTTON "Next >",IDOK,199,176,45,15,WS_GROUP + DEFPUSHBUTTON "Next >",IDOK,199,176,45,15,WS_DISABLED PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 - CONTROL "Download from the Internet",IDC_SOURCE_DOWNLOAD,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,127,102,152,10 - CONTROL "Install from the Internet",IDC_SOURCE_NETINST,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,127,121,87,10 - CONTROL "Install from Local Directory",IDC_SOURCE_CWD,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,127,140,104,10 LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP LTEXT "Setup will use the following installation method.", IDC_STATIC,112,11,170,17 LTEXT "To exit setup click Cancel at any time.",IDC_STATIC,112, 32,166,17 + CONTROL "Download from the Internet",IDC_SOURCE_DOWNLOAD,"Button", + BS_AUTORADIOBUTTON,127,102,152,10 + CONTROL "Install from the Internet",IDC_SOURCE_NETINST,"Button", + BS_AUTORADIOBUTTON,127,121,87,10 + CONTROL "Install from Local Directory",IDC_SOURCE_CWD,"Button", + BS_AUTORADIOBUTTON,127,140,104,10 GROUPBOX "Installation method",IDC_STATIC,113,84,188,77 CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 END @@ -142,26 +142,26 @@ BEGIN CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 END -IDD_NET DIALOG DISCARDABLE 0, 0, 311, 201 +IDD_NET DIALOGEX 0, 0, 311, 201 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "XEmacs Setup" FONT 8, "MS Sans Serif" BEGIN - PUSHBUTTON "Next >",IDOK,199,176,45,15,WS_GROUP + DEFPUSHBUTTON "Next >",IDOK,199,176,45,15 PUSHBUTTON "< Back",IDC_BACK,154,176,45,15 PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP LTEXT "Setup will use the following connection method.", - IDC_STATIC,112,11,170,17,NOT WS_GROUP + IDC_STATIC,112,11,170,17 LTEXT "To exit setup click Cancel at any time.",IDC_STATIC,112, - 32,166,17,NOT WS_GROUP + 32,166,17 CONTROL "Use IE5 Settings",IDC_NET_IE5,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,128,93,69,10 + BS_AUTORADIOBUTTON,128,93,69,10 CONTROL "Direct Connection",IDC_NET_DIRECT,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,128,109,73,10 + BS_AUTORADIOBUTTON,128,109,73,10 CONTROL "Use HTTP/FTP Proxy:",IDC_NET_PROXY,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,128,124,88,10 + BS_AUTORADIOBUTTON,128,124,88,10 EDITTEXT IDC_PROXY_HOST,128,141,80,12,ES_AUTOHSCROLL | WS_DISABLED LTEXT "Proxy",IDC_STATIC,10,55,50,15,SS_CENTERIMAGE, @@ -174,70 +174,41 @@ BEGIN CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 END -IDD_DLSTATUS DIALOG DISCARDABLE 0, 0, 311, 201 +IDD_DLSTATUS DIALOG DISCARDABLE 0, 0, 215, 95 STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "XEmacs Setup" FONT 8, "MS Sans Serif" BEGIN - PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 - LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP - LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP - LTEXT "Downloading Packages",IDC_STATIC,112,10,170,17 - LTEXT "(URL)",IDC_DLS_URL,112,26,170,11 - LTEXT "(RATE)",IDC_DLS_RATE,112,41,166,11 + PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15 + LTEXT "Downloading...",IDC_STATIC,55,15,135,8 + LTEXT "(URL)",IDC_DLS_URL,55,30,150,8 + LTEXT "(RATE)",IDC_DLS_RATE,55,45,155,8 CONTROL "Progress1",IDC_DLS_PROGRESS,"msctls_progress32", - WS_BORDER,123,143,165,10 - GROUPBOX "Progress",IDC_STATIC,112,130,186,31 - CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 + PBS_SMOOTH | WS_BORDER,55,60,155,10 + ICON IDI_XEMACS,IDC_STATIC,5,5,20,20 END -IDD_INSTATUS DIALOG DISCARDABLE 0, 0, 311, 201 +IDD_INSTATUS DIALOG DISCARDABLE 0, 0, 215, 95 STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "XEmacs Setup" FONT 8, "MS Sans Serif" BEGIN - PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 - LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP - LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP - LTEXT "Installing Packages",IDC_STATIC,112,10,170,17 - LTEXT "(PKG)",IDC_INS_PKG,112,26,170,11 - LTEXT "(FILE)",IDC_INS_FILE,112,41,183,11 + PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15 + LTEXT "Installing...",IDC_INS_ACTION,55,5,135,8 + LTEXT "(PKG)",IDC_INS_PKG,55,15,150,8 + LTEXT "(FILE)",IDC_INS_FILE,55,25,155,8 CONTROL "Progress1",IDC_INS_DISKFULL,"msctls_progress32", - WS_BORDER,123,143,165,10 + PBS_SMOOTH | WS_BORDER,55,60,155,10 + ICON IDI_XEMACS,IDC_STATIC,5,5,20,20 CONTROL "Progress1",IDC_INS_IPROGRESS,"msctls_progress32", - WS_BORDER,125,106,163,10 + PBS_SMOOTH | WS_BORDER,55,50,155,10 CONTROL "Progress1",IDC_INS_PPROGRESS,"msctls_progress32", - WS_BORDER,125,67,163,10 - GROUPBOX "Disk",IDC_STATIC,112,130,186,31 - GROUPBOX "Package",IDC_STATIC,112,54,186,31 - GROUPBOX "Total",IDC_STATIC,112,93,186,31 - CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 -END - -IDD_UNINSTALL DIALOG DISCARDABLE 0, 0, 311, 201 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Uninstall XEmacs" -FONT 8, "MS Sans Serif" -BEGIN - PUSHBUTTON "Cancel",IDCANCEL,199,176,45,15 - DEFPUSHBUTTON "Uninstall",IDOK,256,176,45,15 - LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP - LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP - LTEXT "Uninstalling Packages",IDC_STATIC,112,10,170,17 - LTEXT "(PKG)",IDC_UNINS_PKG,112,26,170,11 - LTEXT "(FILE)",IDC_UNINS_FILE,112,41,166,11 - CONTROL "Progress1",IDC_UNINS_DISKFULL,"msctls_progress32", - WS_BORDER,123,143,165,10 - CONTROL "Progress1",IDC_UNINS_IPROGRESS,"msctls_progress32", - WS_BORDER,125,106,163,10 - CONTROL "Progress1",IDC_UNINS_PPROGRESS,"msctls_progress32", - WS_BORDER,125,67,163,10 - GROUPBOX "Disk",IDC_STATIC,112,130,186,31 - GROUPBOX "Package",IDC_STATIC,112,54,186,31 - GROUPBOX "Total",IDC_STATIC,112,93,186,31 - CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 + PBS_SMOOTH | WS_BORDER,55,40,155,10 + RTEXT "Package",IDC_STATIC,5,40,45,8 + RTEXT "Total",IDC_STATIC,10,50,40,8 + RTEXT "Disk",IDC_STATIC,5,60,45,8 END IDD_PROXY_AUTH DIALOG DISCARDABLE 0, 0, 215, 95 @@ -274,7 +245,7 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15 END -IDD_SPLASH DIALOG DISCARDABLE 0, 0, 311, 201 +IDD_SPLASH DIALOGEX 0, 0, 311, 201 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "XEmacs Setup" FONT 8, "MS Sans Serif" @@ -325,29 +296,17 @@ BEGIN DEFPUSHBUTTON "Finish",IDOK,199,176,45,15 PUSHBUTTON "< Back",IDC_BACK,154,176,45,15 PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 + LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP + LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP LTEXT "Setup has now finished. To create desktop shortcuts, please select from the following options.", IDC_STATIC,112,11,170,17 LTEXT "To complete setup click Finish.",IDC_STATIC,112,32,166, 17 CONTROL "Create Desktop Icon",IDC_ROOT_DESKTOP,"Button", - BS_AUTOCHECKBOX,113,50,100,8 + BS_AUTOCHECKBOX,113,76,100,8 CONTROL "Add to Start Menu",IDC_ROOT_MENU,"Button", - BS_AUTOCHECKBOX,113,66,100,8 - CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 - CONTROL "Text",IDC_TXT_TYPE,"Button",BS_AUTOCHECKBOX,209,101,38, - 8 - CONTROL "Java",IDC_JAVA_TYPE,"Button",BS_AUTOCHECKBOX,113,100,50, - 8 - CONTROL "C",IDC_C_TYPE,"Button",BS_AUTOCHECKBOX,113,116,41,8 - CONTROL "C++",IDC_CPP_TYPE,"Button",BS_AUTOCHECKBOX,113,133,38,8 - CONTROL "E-Lisp",IDC_ELISP_TYPE,"Button",BS_AUTOCHECKBOX,113,148, - 38,8 - LTEXT "Register XEmacs for these file types:",IDC_STATIC,113, - 84,166,13 - LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP - LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP + BS_AUTOCHECKBOX,113,97,100,8 CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 - CONTROL "IDL",IDC_IDL_TYPE,"Button",BS_AUTOCHECKBOX,209,116,38,8 END @@ -435,13 +394,6 @@ BEGIN HORZGUIDE, 153 END - IDD_INSTATUS, DIALOG - BEGIN - VERTGUIDE, 112 - VERTGUIDE, 125 - VERTGUIDE, 288 - END - IDD_PROXY_AUTH, DIALOG BEGIN BOTTOMMARGIN, 49 @@ -469,8 +421,6 @@ BEGIN IDD_DESKTOP, DIALOG BEGIN VERTGUIDE, 113 - VERTGUIDE, 209 - HORZGUIDE, 124 END END #endif // APSTUDIO_INVOKED @@ -487,7 +437,7 @@ IDB_RTARROW BITMAP DISCARDABLE "choose-rtarrow.bmp" IDB_CHECK_YES BITMAP DISCARDABLE "check-yes.bmp" IDB_CHECK_NO BITMAP DISCARDABLE "check-no.bmp" IDB_CHECK_NA BITMAP DISCARDABLE "check-na.bmp" -GNU BITMAP DISCARDABLE "gnu.bmp" +GNU BITMAP DISCARDABLE "gnu.bmp" IDB_GNU BITMAP DISCARDABLE "gnu.bmp" ///////////////////////////////////////////////////////////////////////////// @@ -499,7 +449,7 @@ STRINGTABLE DISCARDABLE BEGIN IDS_ROOT_SLASH "Warning: we recommend you do NOT use the root of your hard drive as the XEmacs root. Proceed anyway?" IDS_ROOT_SPACE "You should not choose a root path that include spaces in directory names. Proceed anyway?" - IDS_MIRROR_LST "http://www.xemacs.org/Download/mirrors.lst" + IDS_MIRROR_LST "http://ftp.xemacs.org/pub/xemacs/mirrors.lst" IDS_DIALOG_FAILED "Unable to create Dialog Box" IDS_CYGWIN_FUNC_MISSING "Error: unable to find function `%s' in %s" IDS_DOWNLOAD_SHORT "Download error: %s too short (%d, wanted %d)" @@ -516,7 +466,7 @@ BEGIN IDS_ERR_OPEN_READ "Can't open %s for reading: %s" IDS_ROOT_ABSOLUTE "The install directory must be absolute, with both a drive letter and leading slash, like C:\\Cygwin" IDS_DOWNLOAD_COMPLETE "Download Complete" - IDS_CVSID "\n%%% $Id: res.rc,v 1.2.2.2 2002/08/20 11:36:07 stephent Exp $\n" + IDS_CVSID "\n%%% $Id: res.rc,v 1.1.2.3 2000/12/27 09:35:11 andyp Exp $\n" IDS_NOLOGFILE "Cannot open log file %s for writing" IDS_UNINSTALL_COMPLETE "Uninstalls complete." IDS_WININET "Unable to find or load the Internet Explorer 5 DLLs" @@ -526,13 +476,30 @@ BEGIN IDS_DOWNLOAD_INCOMPLETE "Download Incomplete. Try again?" IDS_INSTALL_INCOMPLETE "Installation incomplete. Check /setup.log.full for details" IDS_ROOT_NOCYGWIN "You should not install the Cygwin version without Cygwin installed. Proceed anyway?" - IDS_CREATE_DIR "The directory %s does not exist, create it?" END #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// diff --git a/netinstall/resource.h b/netinstall/resource.h index ac46438..20cf78b 100644 --- a/netinstall/resource.h +++ b/netinstall/resource.h @@ -28,7 +28,6 @@ #define IDS_DOWNLOAD_INCOMPLETE 26 #define IDS_INSTALL_INCOMPLETE 27 #define IDS_ROOT_NOCYGWIN 28 -#define IDS_CREATE_DIR 29 #define IDD_ROOT 101 #define IDD_SOURCE 102 #define IDD_OTHER_URL 103 @@ -55,7 +54,6 @@ #define IDB_CHECK_NO 124 #define IDB_CHECK_NA 125 #define IDB_GNU 126 -#define IDD_UNINSTALL 127 #define IDC_SOURCE_DOWNLOAD 1000 #define IDC_SOURCE_NETINST 1001 #define IDC_SOURCE_CWD 1002 @@ -96,21 +94,9 @@ #define IDC_ROOT_DESKTOP 1041 #define IDC_ROOT_MENU 1042 #define IDC_LOCAL_DIR_BROWSE 1043 -#define IDC_TXT_TYPE 1043 #define IDC_LOCAL_DIR 1044 -#define IDC_JAVA_TYPE 1044 #define IDC_INSTALL_NATIVE 1045 -#define IDC_C_TYPE 1045 #define IDC_INSTALL_CYGWIN 1046 -#define IDC_CPP_TYPE 1046 -#define IDC_UNINS_PKG 1047 -#define IDC_ELISP_TYPE 1047 -#define IDC_UNINS_FILE 1048 -#define IDC_IDL_TYPE 1048 -#define IDC_UNINS_DISKFULL 1049 -#define IDC_UNINS_IPROGRESS 1050 -#define IDC_UNINS_PPROGRESS 1051 -#define IDC_UNINS_ACTION 1052 #define IDC_STATIC -1 // Next default values for new objects diff --git a/netinstall/root.cc b/netinstall/root.cc index 8c37175..2378151 100644 --- a/netinstall/root.cc +++ b/netinstall/root.cc @@ -137,6 +137,32 @@ change_default_root (int id) } } +static void +read_mount_table () +{ + int isnative, issystem; + root_dir = find_root_location (&issystem, &isnative); + if (root_dir) + { + if (isnative) + install_type = IDC_INSTALL_NATIVE; + else + install_type = IDC_INSTALL_CYGWIN; + + if (issystem) + root_scope = IDC_ROOT_SYSTEM; + else + root_scope = IDC_ROOT_USER; + root_dir_default = 0; + } + else + { + change_default_root (IDC_INSTALL_NATIVE); + root_scope = (is_admin()) ? IDC_ROOT_SYSTEM : IDC_ROOT_USER; + root_dir_default = 1; + } +} + static int CALLBACK browse_cb (HWND h, UINT m, LPARAM lp, LPARAM data) { @@ -247,7 +273,7 @@ dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) if (IDNO == yesno (IDS_ROOT_NOCYGWIN)) break; - create_xemacs_root (backslash (root_dir), + create_xemacs_root (root_dir, root_scope == IDC_ROOT_SYSTEM ? 1 : 0, install_type == IDC_INSTALL_NATIVE ? 1 : 0); @@ -291,21 +317,11 @@ dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) return FALSE; } -static void -set_default_root () -{ - change_default_root (IDC_INSTALL_NATIVE); - root_scope = (is_admin()) ? IDC_ROOT_SYSTEM : IDC_ROOT_USER; - root_dir_default = 1; -} - void do_root (HINSTANCE h) { int rv = 0; - // init will have read a previous root - if (!root_dir) - set_default_root (); + read_mount_table (); rv = DialogBox (h, MAKEINTRESOURCE (IDD_ROOT), 0, dialog_proc); if (rv == -1) diff --git a/netinstall/setup.mak b/netinstall/setup.mak index eb0318a..333e00a 100644 --- a/netinstall/setup.mak +++ b/netinstall/setup.mak @@ -26,6 +26,7 @@ TARGETOS=BOTH APPVER=4.0 +!include "c:\Program Files\Microsoft Platform SDK\Include\win32.mak" default: all @@ -54,9 +55,9 @@ OUTDIR = obj VERBOSECC=0 !endif !if $(VERBOSECC) -CCV=$(CC) +cc=$(cc) !else -CCV=@$(CC) +cc=@$(cc) !endif !if $(DEBUG_XEMACS) @@ -82,7 +83,6 @@ OBJS = \ $(OUTDIR)\geturl.obj \ $(OUTDIR)\hash.obj \ $(OUTDIR)\ini.obj \ - $(OUTDIR)\init.obj \ $(OUTDIR)\inilex.obj \ $(OUTDIR)\iniparse.obj \ $(OUTDIR)\install.obj \ @@ -101,6 +101,7 @@ OBJS = \ $(OUTDIR)\nio-http.obj \ $(OUTDIR)\other.obj \ $(OUTDIR)\postinstall.obj \ +# $(OUTDIR)\res.obj \ $(OUTDIR)\root.obj \ $(OUTDIR)\simpsock.obj \ $(OUTDIR)\site.obj \ @@ -108,7 +109,6 @@ OBJS = \ $(OUTDIR)\splash.obj \ $(OUTDIR)\state.obj \ $(OUTDIR)\tar.obj \ - $(OUTDIR)\uninstall.obj \ $(OUTDIR)\version.obj # @@ -126,9 +126,9 @@ LIBS = libcmt.lib $(olelibsmt) \ # nmake rule .cc{$(OUTDIR)}.obj: - $(CC) /TP $(cflags) $(cdebug) $(cvarsmt) $(defines) -Fo$@ $< + $(cc) /TP $(cflags) $(cdebug) $(cvarsmt) $(defines) -Fo$@ $< .c{$(OUTDIR)}.obj: - $(CC) $(cflags) $(cdebug) $(cvarsmt) $(defines) -Fo$@ $< + $(cc) $(cflags) $(cdebug) $(cvarsmt) $(defines) -Fo$@ $< # # Main target @@ -169,9 +169,8 @@ distclean:: clean # DO NOT DELETE $(OUTDIR)/autoload.obj: autoload.c win32.h -$(OUTDIR)/inilex.obj: inilex.c win32.h ini.h iniparse.h -$(OUTDIR)/init.obj: win32.h dialog.h resource.h \ - state.h ini.h concat.h msg.h log.h find.h reginfo.h +$(OUTDIR)/inilex.obj: inilex.c win32.h ini.h iniparse.h \ + $(OUTDIR)/iniparse.obj: iniparse.c ini.h iniparse.h port.h $(OUTDIR)/inilex.obj: inilex.c win32.h ini.h iniparse.h $(OUTDIR)/mklink2.obj: mklink2.c win32.h @@ -238,10 +237,6 @@ $(OUTDIR)/source.obj: source.cc win32.h dialog.h resource.h \ $(OUTDIR)/splash.obj: splash.cc win32.h dialog.h resource.h msg.h \ version.h $(OUTDIR)/state.obj: state.cc state.h -$(OUTDIR)/uninstall.obj: install.cc win32.h \ - $(ZLIBDIR)/zlib.h $(ZLIBDIR)/zconf.h \ - resource.h ini.h dialog.h concat.h geturl.h mkdir.h state.h tar.h \ - diskfull.h msg.h regedit.h reginfo.h log.h hash.h port.h $(OUTDIR)/tar.obj: tar.cc win32.h \ $(ZLIBDIR)/zlib.h $(ZLIBDIR)/zconf.h \ tar.h mkdir.h log.h port.h diff --git a/netinstall/source.cc b/netinstall/source.cc index 7e0aaf1..a1aa889 100644 --- a/netinstall/source.cc +++ b/netinstall/source.cc @@ -11,7 +11,6 @@ * * Written by DJ Delorie <dj@cygnus.com> * - * Sync'ed with cinstall 2001-10-16 */ /* The purpose of this file is to manage the dialog box that lets the @@ -26,12 +25,19 @@ #include "msg.h" #include "log.h" -static int rb[] = { IDC_SOURCE_NETINST, IDC_SOURCE_DOWNLOAD, IDC_SOURCE_CWD, 0 }; +static int rb[] = { IDC_SOURCE_DOWNLOAD, IDC_SOURCE_NETINST, IDC_SOURCE_CWD, 0 }; + +static void +check_if_enable_next (HWND h) +{ + EnableWindow (GetDlgItem (h, IDOK), source ? 1 : 0); +} static void load_dialog (HWND h) { rbset (h, rb, source); + check_if_enable_next (h); } static void @@ -50,6 +56,7 @@ dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) case IDC_SOURCE_NETINST: case IDC_SOURCE_CWD: save_dialog (h); + check_if_enable_next (h); break; case IDOK: @@ -65,10 +72,8 @@ dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) case IDCANCEL: NEXT (0); break; - - default: - break; } + return FALSE; } static BOOL CALLBACK @@ -78,12 +83,6 @@ dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) { case WM_INITDIALOG: load_dialog (h); - // Check to see if any radio buttons are selected. If not, select a default. - if ((!SendMessage(GetDlgItem (h, IDC_SOURCE_DOWNLOAD), BM_GETCHECK, 0, 0) == BST_CHECKED) - && (!SendMessage(GetDlgItem (h, IDC_SOURCE_CWD), BM_GETCHECK, 0, 0) == BST_CHECKED)) - { - SendMessage(GetDlgItem (h, IDC_SOURCE_NETINST), BM_SETCHECK, BST_CHECKED, 0); - } return FALSE; case WM_COMMAND: return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); @@ -95,8 +94,6 @@ void do_source (HINSTANCE h) { int rv = 0; - /* source = IDC_SOURCE_CWD;*/ - source = IDC_SOURCE_NETINST; rv = DialogBox (h, MAKEINTRESOURCE (IDD_SOURCE), 0, dialog_proc); if (rv == -1) fatal (IDS_DIALOG_FAILED); diff --git a/netinstall/splash.cc b/netinstall/splash.cc index 92ed2dc..9c866c7 100644 --- a/netinstall/splash.cc +++ b/netinstall/splash.cc @@ -68,6 +68,7 @@ void do_splash (HINSTANCE h) { int rv = 0; + HANDLE gnu = LoadImage (h, MAKEINTRESOURCE (IDB_GNU), IMAGE_BITMAP, 0, 0, 0); rv = DialogBox (h, MAKEINTRESOURCE (IDD_SPLASH), 0, dialog_proc); if (rv == -1) fatal (IDS_DIALOG_FAILED); diff --git a/netinstall/state.h b/netinstall/state.h index f891a7b..6f11d78 100644 --- a/netinstall/state.h +++ b/netinstall/state.h @@ -29,13 +29,6 @@ extern int root_scope; extern int root_menu; extern int root_desktop; -extern int reg_c; -extern int reg_cpp; -extern int reg_java; -extern int reg_elisp; -extern int reg_txt; -extern int reg_idl; - extern int net_method; extern char * net_proxy_host; extern int net_proxy_port; @@ -49,6 +42,5 @@ extern char * mirror_site; extern char * other_url; extern int trust_level; -extern int uninstall; #define MIRROR_SITE (mirror_site ? mirror_site : other_url) diff --git a/netinstall/tar.cc b/netinstall/tar.cc index 6149dd4..8be129e 100644 --- a/netinstall/tar.cc +++ b/netinstall/tar.cc @@ -116,37 +116,10 @@ tar_open (char *pathname) return g ? 0 : 1; } -/* For some reason the cygwin version uses a function that is not in - the original source. We duplicate it here - although this does mean - revealing some internals. */ -extern "C" { - z_off_t ZEXPORT tar_gzctell (gzFile file); - typedef struct gz_stream { - z_stream stream; - int z_err; /* error code for last stream operation */ - int z_eof; /* set if end of input file */ - FILE *file; /* .gz file */ - Byte *inbuf; /* input buffer */ - Byte *outbuf; /* output buffer */ - uLong crc; /* crc32 of uncompressed data */ - char *msg; /* error message */ - char *path; /* path name for debugging only */ - int transparent; /* 1 if input file is not a .gz file */ - char mode; /* 'w' or 'r' */ - long startpos; /* start of compressed data in file (header skipped) */ - } gz_stream; -}; - -z_off_t ZEXPORT tar_gzctell (gzFile file) -{ - gz_stream *s = (gz_stream *)file; - return ftell(s->file); -} - int tar_ftell () { - return tar_gzctell (g); + return gztell (g); } static void @@ -509,7 +482,7 @@ tar_auto (char *pathname, char **maplist) if ((tar_open (pathname))) return 1; - while ((c = tar_next_file ())) + while (c = tar_next_file ()) { int l = strlen (c); for (i=0; i<nmaps; i++) diff --git a/netinstall/uninstall.cc b/netinstall/uninstall.cc new file mode 100644 index 0000000..6117b3e --- /dev/null +++ b/netinstall/uninstall.cc @@ -0,0 +1,326 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie <dj@cygnus.com> + * + */ + +/* The purpose of this file is to intall all the packages selected in + the install list (in ini.h). Note that we use a separate thread to + maintain the progress dialog, so we avoid the complexity of + handling two tasks in one thread. We also create or update all the + files in /etc/setup and create the mount points. */ + +#include <io.h> +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> +#ifndef WIN32_NATIVE +#include <unistd.h> +#endif +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> +#include <zlib.h> + +#include "win32.h" +#include "commctrl.h" + +#include "resource.h" +#include "ini.h" +#include "dialog.h" +#include "concat.h" +#include "geturl.h" +#include "mkdir.h" +#include "state.h" +#include "tar.h" +#include "diskfull.h" +#include "msg.h" +#include "regedit.h" +#include "reginfo.h" +#include "log.h" +#include "hash.h" + +#include "port.h" + +#define XM_DONE (WM_USER + 101) + +static HWND unins_dialog = 0; +static HWND unins_action = 0; +static HWND unins_pkgname = 0; +static HWND unins_filename = 0; +static HWND unins_pprogress = 0; +static HWND unins_iprogress = 0; +static HWND unins_diskfull = 0; +static HANDLE init_event; + +static int package_bytes = 0; +static int uninstall_started = 0; + +extern char * map_filename (char *fn, int type); +void remove_desktop_setup (); +static void start_uninstall (); +extern char* find_xemacs_exe_name(); + +char * +base (char *s); + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + case IDCANCEL: + exit_setup (1); + case IDOK: + if (uninstall_started == 0) { + uninstall_started = 1; + start_uninstall(); + } + else + exit_setup(0); + break; + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + unins_dialog = h; + unins_action = GetDlgItem (h, IDC_UNINS_ACTION); + unins_pkgname = GetDlgItem (h, IDC_UNINS_PKG); + unins_filename = GetDlgItem (h, IDC_UNINS_FILE); + unins_pprogress = GetDlgItem (h, IDC_UNINS_PPROGRESS); + unins_iprogress = GetDlgItem (h, IDC_UNINS_IPROGRESS); + unins_diskfull = GetDlgItem (h, IDC_UNINS_DISKFULL); + SendMessage (unins_pprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100)); + SendMessage (unins_iprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100)); + SendMessage (unins_diskfull, PBM_SETRANGE, 0, MAKELPARAM (0, 100)); + SetWindowText (unins_pkgname, ""); + SetWindowText (unins_filename, ""); + SendMessage (unins_pprogress, PBM_SETPOS, (WPARAM) 0, 0); + SendMessage (unins_iprogress, PBM_SETPOS, (WPARAM) 0, 0); + SendMessage (unins_diskfull, PBM_SETPOS, (WPARAM) 0, 0); + return FALSE; + + case XM_DONE: + { + SetWindowText (GetDlgItem (h, IDOK), "Ok"); + LONG style = GetWindowLong (GetDlgItem (h, IDCANCEL), + GWL_STYLE); + SetWindowLong (GetDlgItem (h, IDCANCEL), + GWL_STYLE, style & WS_DISABLED); + } + return FALSE; + + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return DefWindowProc (h, message, wParam, lParam); +} + +static DWORD WINAPI uninstall_all (void *); + +static void +start_uninstall () +{ + DWORD tid; + HANDLE thread; + init_event = CreateEvent (0, 0, 0, 0); + thread = CreateThread (0, 0, uninstall_all, 0, 0, &tid); + WaitForSingleObject (init_event, 10000); + CloseHandle (init_event); +} + +static void +progress (int bytes, int num) +{ + int perc; + if (package_bytes > 100) + { + perc = (bytes * 100) / package_bytes; + SendMessage (unins_pprogress, PBM_SETPOS, (WPARAM) perc, 0); + } + + if (npackages > 0) + { + perc = (num * 100) / npackages; + SendMessage (unins_iprogress, PBM_SETPOS, (WPARAM) perc, 0); + } +} + +static int num_installs, num_uninstalls; + +static void +uninstall_one (char *name, int type, int num) +{ + hash dirs; + char line[_MAX_PATH]; + char* fname = (type == TY_GENERIC ? + concat (root_dir, XEMACS_PACKAGE_DIR, "pkginfo/MANIFEST.", + name, 0) : + concat (root_dir, XEMACS_SETUP_DIR, "MANIFEST.", name, 0)); + + FILE* lst = fopen (fname, "rb"); + int pos = 0; + + if (lst) + { + fseek (lst, 0, SEEK_END); + package_bytes = ftell (lst); + fseek (lst, 0, SEEK_SET); + + SetWindowText (unins_pkgname, name); + SetWindowText (unins_action, "Uninstalling..."); + log (0, "uninstalling %s", name); + + while (fgets (line, sizeof (line), lst)) + { + progress (pos, num); + pos += strlen(line); + if (line[strlen(line)-1] == '\n') + line[strlen(line)-1] = 0; + + dirs.add_subdirs (line); + + char *d = map_filename (line, type); + DWORD dw = GetFileAttributes (d); + if (dw != 0xffffffff && !(dw & FILE_ATTRIBUTE_DIRECTORY)) + { + log (LOG_BABBLE, "unlink %s", d); + DeleteFile (d); + } + } + fclose (lst); + remove (fname); + + dirs.reverse_sort (); + char *subdir = 0; + while ((subdir = dirs.enumerate (subdir)) != 0) + { + char *d = map_filename (subdir, type); + if (RemoveDirectory (d)) + log (LOG_BABBLE, "rmdir %s", d); + } + num_uninstalls ++; + } +} + +void +do_uninstall (HINSTANCE h) +{ + num_installs = 0, num_uninstalls = 0; + + next_dialog = 0; // we're done after this + + if (!root_dir) + fatal ("no installation found"); + + int rv = DialogBox (h, MAKEINTRESOURCE (IDD_UNINSTALL), 0, dialog_proc); + if (rv == -1) + fatal (IDS_DIALOG_FAILED); +} + +static void +read_installed_db () +{ + if (!root_dir) + return; + + char line[1000], pkg[1000], inst[1000], src[1000]; + int instsz, srcsz; + + FILE *db = fopen (concat (root_dir, XEMACS_SETUP_DIR, "installed.db", 0), "rt"); + if (!db) + return; + + while (fgets (line, 1000, db)) + { + src[0] = 0; + srcsz = 0; + sscanf (line, "%s %s %d %s %d", pkg, inst, &instsz, src, &srcsz); + + log (0, "read %s", pkg); + Package* np = new_package(strdup(pkg)); + pinfo(*np).install = inst; + pinfo(*np).install_size = instsz; + // pick up versoin + char *v, *d; + for (v=base (inst); *v; v++) + if (*v == '-' && isdigit(v[1])) + { + v++; + break; + } + if (!v) + v = inst; + for (d=v; *d; d++) + if (strncmp (d, ".tar", 4) == 0 + || strncmp (d, "-pkg", 4) == 0) + { + *d = 0; + break; + } + if (v[0]) + pinfo(*np).version = strdup (v); + else + pinfo(*np).version = "0"; + // Crude but effective + if (pkg != 0) + if (strncmp ("xemacs-i686", pkg, 11) == 0 + || (strncmp ("xemacs-i586", pkg, 11) == 0)) + { + np->type = install_type; + xemacs_package = np; + } + } + fclose (db); +} + +static DWORD WINAPI +uninstall_all (void *) +{ + int i; + SetEvent (init_event); + + int df = diskfull (root_dir); + SendMessage (unins_diskfull, PBM_SETPOS, (WPARAM) df, 0); + + read_installed_db(); + + log (0, "There are %d packages\n", npackages); + for (i=0; i<npackages; i++) + { + log (0, "uninstalling %s\n", package[i].name); + uninstall_one (package[i].name, package[i].type, i); + } + + PostMessage (unins_dialog, XM_DONE, 0, 0); + + remove (concat (root_dir, XEMACS_SETUP_DIR, "installed.db.old", 0)); + remove (concat (root_dir, XEMACS_SETUP_DIR, "installed.db", 0)); + + remove_desktop_setup(); + remove_xemacs_root(); + remove_uninstall_path(); + + if (num_installs == 0) + { + // exit_msg = IDS_UNINSTALL_COMPLETE; + return FALSE; + } + + return FALSE; +} diff --git a/netinstall/win32.h b/netinstall/win32.h index 7e1c4d1..d1ee070 100644 --- a/netinstall/win32.h +++ b/netinstall/win32.h @@ -21,8 +21,26 @@ #ifndef _MINI_WIN32_ #define _MINI_WIN32_ +#define _UNION_NAME(x) +#define _STRUCT_NAME(x) #define NOCOMATTRIBUTE +#include <stdarg.h> +#ifdef WIN32_NATIVE +/* MSVC is barking with the list above, something else is missing, so + I'm using <windows.h> and lean-n-mean. FP, 2000-23-12 */ +#include <windows.h> +#endif +#include <windef.h> +#include <basetyps.h> +#include <winbase.h> +#include <wingdi.h> +#include <winuser.h> +#include <wininet.h> +#include <winreg.h> + +#include <windowsx.h> + /* Cope with native win32 & mingw differences. Written by F. Popineau <Fabrice.Popineau@supelec.fr> */ #ifdef WIN32_NATIVE @@ -32,14 +50,6 @@ # define strnicmp _strnicmp #endif -#include <stdarg.h> - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -#include <wininet.h> -#include <windowsx.h> - #ifndef CDECL #define CDECL __cdecl #endif diff --git a/nt/.cvsignore b/nt/.cvsignore index 0f2069a..8bd15e7 100644 --- a/nt/.cvsignore +++ b/nt/.cvsignore @@ -2,4 +2,3 @@ config.inc xemacs.ncb xemacs.opt xemacs.plg -obj diff --git a/nt/Makefile.cygwin b/nt/Makefile.cygwin new file mode 100644 index 0000000..fdbd61e --- /dev/null +++ b/nt/Makefile.cygwin @@ -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 --git a/nt/Todo b/nt/Todo new file mode 100644 index 0000000..ac91718 --- /dev/null +++ b/nt/Todo @@ -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 --git a/nt/config.inc.samp b/nt/config.inc.samp index 0e2752c..c49da6b 100644 --- a/nt/config.inc.samp +++ b/nt/config.inc.samp @@ -12,25 +12,18 @@ PACKAGE_PREFIX=c:\Program Files\XEmacs HAVE_MULE=0 # Native MS Windows support. -HAVE_MS_WINDOWS=1 +HAVE_MSW=1 # X Windows support. -HAVE_X_WINDOWS=0 +HAVE_X=0 X11_DIR= -# GTK support. Do NOT set this to 1; as of xemacs-21.2-b44 -# gtk-xemacs is not supported on MSWindows (mingw or msvc). -# Yes, we know that gtk has been ported to native MSWindows -# but XEmacs is not yet ready to use that port. -HAVE_GTK=0 -GTK_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 +XPM_DIR=f:\src\xpm-3.4k # Set this to enable GIF support. HAVE_GIF=1 @@ -38,16 +31,16 @@ 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.9 -ZLIB_DIR=c:\src\zlib +PNG_DIR=f:\src\libpng-1.0.3 +ZLIB_DIR=f:\src\zlib # 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 +HAVE_JPEG=0 +JPEG_DIR= # Set this to enable XFace support, and specify the directory containing # compface. @@ -58,24 +51,22 @@ 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=c:\src\texinfo-4.0\makeinfo\makeinfo.exe +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 +############################################################################ -# Set this to use the portable dumper for dumping the preloaded Lisp -# routines, instead of the older "unexec" routines in unexnt.c. -USE_PORTABLE_DUMPER=1 +# Some technical options. +USE_MINIMAL_TAGBITS=0 +USE_INDEXED_LRECORD_IMPLEMENTATION=0 +USE_PORTABLE_DUMPER=0 +GUNG_HO=0 diff --git a/nt/inc/arpa/inet.h b/nt/inc/arpa/inet.h new file mode 100644 index 0000000..f5d197c --- /dev/null +++ b/nt/inc/arpa/inet.h @@ -0,0 +1 @@ +/* null version of <arpa/inet.h> - <sys/socket.h> has everything */ diff --git a/nt/inc/netdb.h b/nt/inc/netdb.h new file mode 100644 index 0000000..5bf232e --- /dev/null +++ b/nt/inc/netdb.h @@ -0,0 +1 @@ +/* null version of <netdb.h> - <sys/socket.h> has everything */ diff --git a/nt/inc/netinet/in.h b/nt/inc/netinet/in.h new file mode 100644 index 0000000..46fb0fa --- /dev/null +++ b/nt/inc/netinet/in.h @@ -0,0 +1 @@ +/* null version of <netinet/in.h> - <sys/socket.h> has everything */ diff --git a/nt/inc/pwd.h b/nt/inc/pwd.h new file mode 100644 index 0000000..6202ccd --- /dev/null +++ b/nt/inc/pwd.h @@ -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 --git a/nt/inc/sys/dir.h b/nt/inc/sys/dir.h new file mode 100644 index 0000000..df729d2 --- /dev/null +++ b/nt/inc/sys/dir.h @@ -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 --git a/nt/inc/sys/file.h b/nt/inc/sys/file.h new file mode 100644 index 0000000..8536d03 --- /dev/null +++ b/nt/inc/sys/file.h @@ -0,0 +1,8 @@ +/* + * sys\file.h doesn't exist on NT - only needed for these constants + */ + +#define F_OK 0 +#define X_OK 1 +#define W_OK 2 +#define R_OK 4 diff --git a/nt/inc/sys/ioctl.h b/nt/inc/sys/ioctl.h new file mode 100644 index 0000000..dc09578 --- /dev/null +++ b/nt/inc/sys/ioctl.h @@ -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 --git a/nt/inc/sys/param.h b/nt/inc/sys/param.h new file mode 100644 index 0000000..397c5ff --- /dev/null +++ b/nt/inc/sys/param.h @@ -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 --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h new file mode 100644 index 0000000..03c6077 --- /dev/null +++ b/nt/inc/sys/socket.h @@ -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 --git a/nt/inc/sys/time.h b/nt/inc/sys/time.h new file mode 100644 index 0000000..3bbdbe7 --- /dev/null +++ b/nt/inc/sys/time.h @@ -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 --git a/nt/inc/unistd.h b/nt/inc/unistd.h new file mode 100644 index 0000000..c1caa77 --- /dev/null +++ b/nt/inc/unistd.h @@ -0,0 +1 @@ +/* Fake unistd.h: config.h already provides most of the relevant things. */ diff --git a/nt/minitar.mak b/nt/minitar.mak index 50e5c0d..6218f56 100644 --- a/nt/minitar.mak +++ b/nt/minitar.mak @@ -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 --git a/nt/puresize-adjust.h b/nt/puresize-adjust.h new file mode 100644 index 0000000..b10cdc8 --- /dev/null +++ b/nt/puresize-adjust.h @@ -0,0 +1,3 @@ +/* Do not edit this file! + Automatically generated by XEmacs */ +# define PURESIZE_ADJUSTMENT (0) diff --git a/nt/runemacs.c b/nt/runemacs.c new file mode 100644 index 0000000..a516eec --- /dev/null +++ b/nt/runemacs.c @@ -0,0 +1,171 @@ +/* + 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 *p; + char modname[MAX_PATH]; + + if (!GetModuleFileName (NULL, modname, MAX_PATH)) + goto error; + if ((p = strrchr (modname, '\\')) == NULL) + goto error; + *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); + 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 + 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.", "Error", MB_ICONSTOP); + return 1; +} diff --git a/nt/xemacs.dsp b/nt/xemacs.dsp index 3438f45..f317c9c 100644 --- a/nt/xemacs.dsp +++ b/nt/xemacs.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="xemacs" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) External Target" 0x0106 @@ -22,7 +22,6 @@ CFG=xemacs - Win32 Debug !MESSAGE # Begin Project -# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" @@ -37,8 +36,8 @@ CFG=xemacs - Win32 Debug # PROP BASE Bsc_Name "xemacs.bsc" # PROP BASE Target_Dir "" # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\src" -# PROP Intermediate_Dir "obj" +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" # PROP Cmd_Line "NMAKE /f xemacs.mak" # PROP Rebuild_Opt "/a" # PROP Target_File "xemacs.exe" @@ -56,8 +55,8 @@ CFG=xemacs - Win32 Debug # PROP BASE Bsc_Name "xemacs.bsc" # PROP BASE Target_Dir "" # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\src" -# PROP Intermediate_Dir "obj" +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" # PROP Cmd_Line "NMAKE /f xemacs.mak" # PROP Rebuild_Opt "/a" # PROP Target_File "..\src\xemacs.exe" diff --git a/nt/xemacs.dsw b/nt/xemacs.dsw index 4b158e1..e9a8ca9 100644 --- a/nt/xemacs.dsw +++ b/nt/xemacs.dsw @@ -1,9 +1,9 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 +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> +Project: "xemacs"=".\xemacs.dsp" - Package Owner=<4> Package=<5> {{{ diff --git a/src/.cvsignore b/src/.cvsignore index cbba8e9..941595c 100644 --- a/src/.cvsignore +++ b/src/.cvsignore @@ -7,15 +7,5 @@ GNUmakefile puresize-adjust.h sheap-adjust.h temacs -xemacs -xemacs.dmp SATISFIED update-elc.stamp -*.so.* -gmon.out -NEEDTODUMP -Xpm.dll -temacs.bsc -temacs.pdb -temacs.map -xemacs.opt diff --git a/src/.dbxrc b/src/.dbxrc index 4e749e2..4653a31 100644 --- a/src/.dbxrc +++ b/src/.dbxrc @@ -39,8 +39,6 @@ # 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 @@ -64,17 +62,20 @@ 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]"; } + 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=\$[(\`alloc.c\`unsigned long) \`alloc.c\`$1]"; } + function ToLong { eval "$1=\$[(unsigned long) $1]"; } ToLong dbg_valmask ToLong dbg_typemask xemacs_initted=yes @@ -97,11 +98,11 @@ function decode_object { # 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)]";; + *Lisp_Object*) obj="$[(unsigned long)(($1).i)]";; + *) obj="$[(unsigned long)($1)]";; esac else - obj="$[(`alloc.c`unsigned long)($1)]"; + obj="$[(unsigned long)($1)]"; fi if test $[(int)($obj & 1)] = 1; then # It's an int @@ -119,12 +120,9 @@ function decode_object { 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])] + typeset lheader="((struct lrecord_header *) $val)" + imp=$[(void*)(lrecord_implementations_table[$lheader->type])] else - lheader="((struct lrecord_header *) -1)" - lrecord_type=-1 imp="0xdeadbeef" fi # printvar obj val type imp @@ -144,6 +142,10 @@ 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]" @@ -169,7 +171,7 @@ end function run-temacs { environment-to-run-temacs - run -nd -batch -l ../lisp/loadup.el run-temacs -q ${1+"$@"} + run -batch -l ../lisp/loadup.el run-temacs -q ${1+"$@"} } document check-xemacs << 'end' @@ -201,26 +203,29 @@ end function update-elc { environment-to-run-temacs - run -nd -batch -l ../lisp/update-elc.el + run -batch -l ../lisp/update-elc.el } -document dmp << 'end' -Usage: dmp +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 dmp { +function dump-temacs { environment-to-run-temacs - run -nd -batch -l ../lisp/loadup.el dump + run -batch -l ../lisp/loadup.el dump +} + +function pstruct { + xstruct="((struct $1 *) $val)" + print $xstruct + print *$xstruct } -function pstruct { # pstruct foo.c struct-name - module "$1" > /dev/null - type_ptr="((struct $2 *) $val)" - print $type_ptr - print *$type_ptr +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' @@ -238,110 +243,104 @@ function pobj { 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 = $Lisp_Type_String || lrecord_type_p string; then + pstruct Lisp_String + elif test $type = $Lisp_Type_Cons || lrecord_type_p cons; then + pstruct Lisp_Cons + elif test $type = $Lisp_Type_Symbol || lrecord_type_p symbol; then + pstruct Lisp_Symbol + echo "Symbol name: $[(char *)($xstruct->name->data)]" + elif test $type = $Lisp_Type_Vector || lrecord_type_p vector; then + pstruct Lisp_Vector + echo "Vector of length $[$xstruct->size]" + elif lrecord_type_p bit_vector; then + pstruct Lisp_Bit_Vector + elif lrecord_type_p buffer; then + pstruct buffer + elif lrecord_type_p char_table; then + pstruct Lisp_Char_Table + elif lrecord_type_p char_table_entry; then + pstruct Lisp_Char_Table_Entry + elif lrecord_type_p charset; then + pstruct Lisp_Charset + elif lrecord_type_p coding_system; then + pstruct Lisp_Coding_System + elif lrecord_type_p color_instance; then + pstruct Lisp_Color_Instance + elif lrecord_type_p command_builder; then + pstruct command_builder + elif lrecord_type_p compiled_function; then + pstruct Lisp_Compiled_Function + elif lrecord_type_p console; then + pstruct console + elif lrecord_type_p database; then + pstruct Lisp_Database + elif lrecord_type_p device; then + pstruct device + elif lrecord_type_p event; then + pstruct Lisp_Event + elif lrecord_type_p extent; then + pstruct extent + elif lrecord_type_p extent_auxiliary; then + pstruct extent_auxiliary + elif lrecord_type_p extent_info; then + pstruct extent_info + elif lrecord_type_p face; then + pstruct Lisp_Face + elif lrecord_type_p float; then + pstruct Lisp_Float + elif lrecord_type_p font_instance; then + pstruct Lisp_Font_Instance + elif lrecord_type_p frame; then + pstruct frame + elif lrecord_type_p glyph; then + pstruct Lisp_Glyph + elif lrecord_type_p hash_table; then + pstruct Lisp_Hash_Table + elif lrecord_type_p image_instance; then + pstruct Lisp_Image_Instance + elif lrecord_type_p keymap; then + pstruct Lisp_Keymap + elif lrecord_type_p lcrecord_list; then + pstruct lcrecord_list + elif lrecord_type_p lstream; then + pstruct lstream + elif lrecord_type_p marker; then + pstruct Lisp_Marker + elif lrecord_type_p opaque; then + pstruct Lisp_Opaque + elif lrecord_type_p opaque_ptr; then + pstruct Lisp_Opaque_Ptr + elif lrecord_type_p popup_data; then + pstruct popup_data + elif lrecord_type_p process; then + pstruct Lisp_Process + elif lrecord_type_p range_table; then + pstruct Lisp_Range_Table + elif lrecord_type_p specifier; then + pstruct Lisp_Specifier + elif lrecord_type_p subr; then + pstruct Lisp_Subr + elif lrecord_type_p symbol_value_buffer_local; then + pstruct symbol_value_buffer_local + elif lrecord_type_p symbol_value_forward; then + pstruct symbol_value_forward + elif lrecord_type_p symbol_value_lisp_magic; then + pstruct symbol_value_lisp_magic + elif lrecord_type_p symbol_value_varalias; then + pstruct symbol_value_varalias + elif lrecord_type_p toolbar_button; then + pstruct toolbar_button + elif lrecord_type_p tooltalk_message; then + pstruct Lisp_Tooltalk_Message + elif lrecord_type_p tooltalk_pattern; then + pstruct Lisp_Tooltalk_Pattern + elif lrecord_type_p weak_list; then + pstruct weak_list + elif lrecord_type_p window; then + pstruct window + elif lrecord_type_p window_configuration; then + pstruct window_config elif test "$type" = "null_pointer"; then echo "Lisp Object is a null pointer!!" else @@ -350,8 +349,14 @@ function pobj { fi } +function pproc { + print *(`process.c`struct Lisp_Process*)$1 ; + ldp "(`process.c`struct Lisp_Process*)$1->name" ; + ldp "(`process.c`struct Lisp_Process*)$1->command" ; +} + dbxenv suppress_startup_message 4.0 -# dbxenv mt_watchpoints on +dbxenv mt_watchpoints on function dp_core { print ((struct x_frame *)(((struct frame*)(Fselected_frame(Qnil)&0x00FFFFFF))->frame_data))->widget->core diff --git a/src/.gdbinit b/src/.gdbinit index 03720ca..b08c0a0 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -48,14 +48,12 @@ set print union off set print pretty off -set $Lisp_Type_Int = -2 - define decode_object set $obj = (unsigned long) $arg0 if $obj & 1 # It's an int set $val = $obj >> 1 - set $type = $Lisp_Type_Int + set $type = Lisp_Type_Int else set $type = $obj & dbg_typemask if $type == Lisp_Type_Char @@ -67,12 +65,9 @@ define decode_object end if $type == Lisp_Type_Record - set $lheader = ((struct lrecord_header *) $val) - set $lrecord_type = ($lheader->type) - set $imp = ((struct lrecord_implementation *) lrecord_implementations_table[(int) $lrecord_type]) + set $lheader = (struct lrecord_header *) $val + set $imp = lrecord_implementations_table[$lheader->type] else - set $lrecord_type = -1 - set $lheader = -1 set $imp = -1 end end @@ -90,13 +85,30 @@ end define xtype decode_object $arg0 - if $type == $Lisp_Type_Int + if $type == Lisp_Type_Int echo int\n else if $type == Lisp_Type_Char echo char\n else + if $type == Lisp_Type_Symbol + echo symbol\n + else + if $type == Lisp_Type_String + echo string\n + else + if $type == Lisp_Type_Vector + echo vector\n + else + if $type == Lisp_Type_Cons + echo cons\n + else printf "record type: %s\n", $imp->name + # barf + end + end + end + end end end end @@ -123,7 +135,7 @@ end define run-temacs environment-to-run-temacs - run -nd -batch -l ../lisp/loadup.el run-temacs -q + run -batch -l ../lisp/loadup.el run-temacs -q end document run-temacs @@ -144,7 +156,7 @@ end define check-temacs environment-to-run-temacs - run -nd -batch -l ../lisp/loadup.el run-temacs -q -batch -l ../tests/automated/test-harness.el -f batch-test-emacs ../tests/automated + 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 @@ -156,7 +168,7 @@ end define update-elc environment-to-run-temacs - run -nd -batch -l ../lisp/update-elc.el + run -batch -l ../lisp/update-elc.el end document update-elc @@ -166,18 +178,21 @@ Use when debugging temacs, not xemacs! Use this when temacs builds successfully, but xemacs does not. end -define dmp +define dump-temacs environment-to-run-temacs - run -nd -batch -l ../lisp/loadup.el dump + run -batch -l ../lisp/loadup.el dump end -document dmp -Usage: dmp +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) @@ -225,21 +240,15 @@ 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 +define pstruct + set $xstruct = (struct $arg0 *) $val + print $xstruct + print *$xstruct end define pobj decode_object $arg0 - if $type == $Lisp_Type_Int + if $type == Lisp_Type_Int printf "Integer: %d\n", $val else if $type == Lisp_Type_Char @@ -249,161 +258,152 @@ define pobj 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 + if $type == Lisp_Type_String || $imp == &lrecord_string + pstruct Lisp_String 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 + if $type == Lisp_Type_Cons || $imp == &lrecord_cons + pstruct Lisp_Cons else - if $lrecord_type == lrecord_type_bit_vector - ptype Lisp_Bit_Vector + if $type == Lisp_Type_Symbol || $imp == &lrecord_symbol + pstruct Lisp_Symbol + printf "Symbol name: %s\n", $xstruct->name->data else - if $lrecord_type == lrecord_type_buffer - pstructtype buffer + 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 $lrecord_type == lrecord_type_char_table - ptype Lisp_Char_Table + if $imp == &lrecord_bit_vector + pstruct Lisp_Bit_Vector else - if $lrecord_type == lrecord_type_char_table_entry - ptype Lisp_Char_Table_Entry + if $imp == &lrecord_buffer + pstruct buffer else - if $lrecord_type == lrecord_type_charset - ptype Lisp_Charset + if $imp == &lrecord_char_table + pstruct Lisp_Char_Table else - if $lrecord_type == lrecord_type_coding_system - ptype Lisp_Coding_System + if $imp == &lrecord_char_table_entry + pstruct Lisp_Char_Table_Entry else - if $lrecord_type == lrecord_type_color_instance - ptype Lisp_Color_Instance + if $imp == &lrecord_charset + pstruct Lisp_Charset else - if $lrecord_type == lrecord_type_command_builder - ptype command_builder + if $imp == &lrecord_coding_system + pstruct Lisp_Coding_System else - if $lrecord_type == lrecord_type_compiled_function - ptype Lisp_Compiled_Function + if $imp == &lrecord_color_instance + pstruct Lisp_Color_Instance else - if $lrecord_type == lrecord_type_console - pstructtype console + if $imp == &lrecord_command_builder + pstruct command_builder else - if $lrecord_type == lrecord_type_database - ptype Lisp_Database + if $imp == &lrecord_compiled_function + pstruct Lisp_Compiled_Function else - if $lrecord_type == lrecord_type_device - pstructtype device + if $imp == &lrecord_console + pstruct console else - if $lrecord_type == lrecord_type_event - ptype Lisp_Event + if $imp == &lrecord_database + pstruct Lisp_Database else - if $lrecord_type == lrecord_type_extent - pstructtype extent + if $imp == &lrecord_device + pstruct device else - if $lrecord_type == lrecord_type_extent_auxiliary - pstructtype extent_auxiliary + if $imp == &lrecord_event + pstruct Lisp_Event else - if $lrecord_type == lrecord_type_extent_info - pstructtype extent_info + if $imp == &lrecord_extent + pstruct extent else - if $lrecord_type == lrecord_type_face - ptype Lisp_Face + if $imp == &lrecord_extent_auxiliary + pstruct extent_auxiliary else - if $lrecord_type == lrecord_type_float - ptype Lisp_Float + if $imp == &lrecord_extent_info + pstruct extent_info else - if $lrecord_type == lrecord_type_font_instance - ptype Lisp_Font_Instance + if $imp == &lrecord_face + pstruct Lisp_Face else - if $lrecord_type == lrecord_type_frame - pstructtype frame + if $imp == &lrecord_float + pstruct Lisp_Float else - if $lrecord_type == lrecord_type_glyph - ptype Lisp_Glyph + if $imp == &lrecord_font_instance + pstruct Lisp_Font_Instance else - if $lrecord_type == lrecord_type_gui_item - ptype Lisp_Gui_Item + if $imp == &lrecord_frame + pstruct frame else - if $lrecord_type == lrecord_type_hash_table - ptype Lisp_Hash_Table + if $imp == &lrecord_glyph + pstruct Lisp_Glyph else - if $lrecord_type == lrecord_type_image_instance - ptype Lisp_Image_Instance + if $imp == &lrecord_hash_table + pstruct Lisp_Hash_Table else - if $lrecord_type == lrecord_type_keymap - ptype Lisp_Keymap + if $imp == &lrecord_image_instance + pstruct Lisp_Image_Instance else - if $lrecord_type == lrecord_type_lcrecord_list - pstructtype lcrecord_list + if $imp == &lrecord_keymap + pstruct Lisp_Keymap else - if $lrecord_type == lrecord_type_ldap - ptype Lisp_LDAP + if $imp == &lrecord_lcrecord_list + pstruct lcrecord_list else - if $lrecord_type == lrecord_type_lstream - pstructtype lstream + if $imp == &lrecord_lstream + pstruct lstream else - if $lrecord_type == lrecord_type_marker - ptype Lisp_Marker + if $imp == &lrecord_marker + pstruct Lisp_Marker else - if $lrecord_type == lrecord_type_opaque - ptype Lisp_Opaque + if $imp == &lrecord_opaque + pstruct Lisp_Opaque else - if $lrecord_type == lrecord_type_opaque_ptr - ptype Lisp_Opaque_Ptr + if $imp == &lrecord_opaque_ptr + pstruct Lisp_Opaque_Ptr else - if $lrecord_type == lrecord_type_popup_data - ptype popup_data + if $imp == &lrecord_popup_data + pstruct popup_data else - if $lrecord_type == lrecord_type_process - ptype Lisp_Process + if $imp == &lrecord_process + pstruct Lisp_Process else - if $lrecord_type == lrecord_type_range_table - ptype Lisp_Range_Table + if $imp == &lrecord_range_table + pstruct Lisp_Range_Table else - if $lrecord_type == lrecord_type_specifier - ptype Lisp_Specifier + if $imp == &lrecord_specifier + pstruct Lisp_Specifier else - if $lrecord_type == lrecord_type_subr - ptype Lisp_Subr + if $imp == &lrecord_subr + pstruct Lisp_Subr else - if $lrecord_type == lrecord_type_symbol_value_buffer_local - pstructtype symbol_value_buffer_local + if $imp == &lrecord_symbol_value_buffer_local + pstruct symbol_value_buffer_local else - if $lrecord_type == lrecord_type_symbol_value_forward - pstructtype symbol_value_forward + if $imp == &lrecord_symbol_value_forward + pstruct symbol_value_forward else - if $lrecord_type == lrecord_type_symbol_value_lisp_magic - pstructtype symbol_value_lisp_magic + if $imp == &lrecord_symbol_value_lisp_magic + pstruct symbol_value_lisp_magic else - if $lrecord_type == lrecord_type_symbol_value_varalias - pstructtype symbol_value_varalias + if $imp == &lrecord_symbol_value_varalias + pstruct symbol_value_varalias else - if $lrecord_type == lrecord_type_timeout - ptype Lisp_Timeout + if $imp == &lrecord_toolbar_button + pstruct toolbar_button else - if $lrecord_type == lrecord_type_toolbar_button - pstructtype toolbar_button + if $imp == &lrecord_tooltalk_message + pstruct Lisp_Tooltalk_Message else - if $lrecord_type == lrecord_type_tooltalk_message - ptype Lisp_Tooltalk_Message + if $imp == &lrecord_tooltalk_pattern + pstruct Lisp_Tooltalk_Pattern else - if $lrecord_type == lrecord_type_tooltalk_pattern - ptype Lisp_Tooltalk_Pattern + if $imp == &lrecord_weak_list + pstruct weak_list else - if $lrecord_type == lrecord_type_weak_list - pstructtype weak_list + if $imp == &lrecord_window + pstruct window else - if $lrecord_type == lrecord_type_window - pstructtype window - else - if $lrecord_type == lrecord_type_window_configuration - pstructtype window_config + if $imp == &lrecord_window_configuration + pstruct window_config else echo Unknown Lisp Object type\n print $arg0 @@ -423,8 +423,6 @@ define pobj end end end - end - end # Repeat after me... gdb sux, gdb sux, gdb sux... end end @@ -462,7 +460,6 @@ define pobj end end end - end end document pobj diff --git a/src/ChangeLog b/src/ChangeLog index f53dd09..72e9ef4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,10794 +1,1675 @@ -2002-11-02 Stephen J. Turnbull <stephen@xemacs.org> +1998-07-19 SL Baur <steve@altair.xemacs.org> - * XEmacs 21.4.10 "Military Intelligence" is released. + * XEmacs 21.2-beta1 is released. -2002-10-17 Raymond Toy <toy@rtp.ericsson.se> +1998-07-12 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> - * nas.c: Update for NAS 1.6 and later, from Jon Trulson. Was - using the NAS private array SoundFileInfo that no longer exists in - NAS 1.6 and later. Preserve backward compatibility with NAS 1.5a - and earlier. This is broken for some versions between 1.5a and - 1.5f. + * 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 -2002-10-10 Stephen J. Turnbull <stephen@xemacs.org> +1998-07-13 Jonathan Harris <jhar@tardis.ed.ac.uk> - * realpath.c (win32_readlink): Try to fix truename of wildcard bug. + * nt.c: Remove Vstdio_str; already defined in console-stream.c. - * emacs.c (shut_down_emacs): Improve crash message. + * unexnt.c: Unconditionally define bss_start and bss_size, and + ensure that they don't go in the .bss section. -2002-10-09 Stephen J. Turnbull <stephen@xemacs.org> +1998-07-17 Olivier Galibert <galibert@pobox.com> - * file-coding.c (determine_real_coding_system): Check for coding - cookie in first LINES_TO_CHECK lines (currently 2). Cater to - shebangs and Python PEP 263. + * 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> -2002-10-08 Andy Piper <andy@xemacs.org> +1998-07-18 SL Baur <steve@altair.xemacs.org> - * glyphs-widget.c (layout_query_geometry): only resize dynamically - if static sizes haven't been set. + * glyphs-msw.c (mswindows_resource_normalize): Qresource -> + Qmswindows_resource. + From Jonathan Harris <jhar@tardis.ed.ac.uk> -2002-08-30 Mike Alexander <mta@arbortext.com> +1998-07-12 SL Baur <steve@altair.xemacs.org> - * event-msw.c (winsock_closer): Use closesocket, not CloseHandle - to close a socket. + * general.c (syms_of_general): Add defsymbol for Qresource. -2002-10-03 Stephen J. Turnbull <stephen@xemacs.org> + * 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'. - * callproc.c (child_setup): 21.4 doesn't have retry_close. + * XEmacs 21.0-pre5 is released. -2002-09-20 Mike Sperber <mike@xemacs.org> +1998-07-10 SL Baur <steve@altair.xemacs.org> - (This partially gets back my patch from 2002-07-20 without the - bug.) - * callproc.c (child_setup): Remove Ben's comment noting confusion - over the file descriptors >= 3: close_process_descs() doesn't - close those. Fix fd range to go up to MAXDESC-1 instead of 64. - * process-unix.c (unix_create_process): Call - begin_dont_check_for_quit to inhibit unwanted interaction (and - thus breaking of X event synchronicity) in the child. + * mule-wnnfns.c (Fwnn_open): Correctly trap on misdefined Wnn + server type in environment. + Use alloca-ed strings instead of tiny fixed size ones. -2002-09-26 Golubev I. N. <gin@mo.msk.ru> +1998-07-09 SL Baur <steve@altair.xemacs.org> - * frame-x.c (x_delete_frame): do not call XtDisplay on a destroyed - widget. + * XEmacs 21.0-pre4 is released. -2002-08-20 Ben Sigelman <bhsigelm@cs.brown.edu> +1998-07-01 James N. Potts <jnpotts@plutonium.net> - * event-Xt.c (drain_X_queue): loop over while(XEventsQueued()) - instead of while(XtAppPending()&XtIMXEvent). Upon a gdm logout, - the xemacs process did not exit, but looped infinitely here. This - fixes that problem. + * 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. -2002-09-28 Stephen J. Turnbull <stephen@xemacs.org> +1998-07-09 Jonathan Harris <jhar@tardis.ed.ac.uk> - * font-lock.c (SYNTAX_START_STYLE, SYNTAX_END_STYLE): Quiet GCC. - (find_context): Improve comments. + * 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. - * regex.c (re_compile_fastmap): Gratuitous #ifdef comment fixes. - (re_match_2): An XCHAR_TABLE operation was missing. - - Many of the following changes were inspired by Andy Piper's (now - obsolete) patch to make syntax-table text property lookup optional. - - [Documentation] - - * syntax.h (top level): Document semantics of syntax flags. - * syntax.c (comstr_start, Fforward_comment): Improve comments. - * syntax.c, syntax.h (top level): Document syntax cache better in - comments. - - [Instrument syntax caching (temporary change)] - - * syntax.h (enum syntax_cache_statistics_functions, struct - syntax_cache_statistics, SCS_STATISTICS_SET_FUNCTION, - SYNTAX_CACHE_STATISTICS_COUNT_INIT): New types and macros. - * syntax.c (scan_words, Fforward_comment, scan_lists, - Fbackward_prefix_characters): - * font-lock.c (find_context): - Use them to instrument syntax caching. - * syntax.c (struct syntax_cache_statistics, scs_statistics, - syntax_cache_statistics_function_names): New type and variables. - * syntax.c (update_syntax_cache): Update and report statistics. - - [Major syntax cache optimizations] - - syntax.c (lookup_syntax_properties): Default off. - - * syntax.h (UPDATE_SYNTAX_INTERNAL): New, implements UPDATE_SYNTAX*. - * syntax.c (update_syntax_cache): - Move init test from update_syntax_cache to UPDATE_SYNTAX_INTERNAL. - - [Minor syntax cache optimizations and code clarifications] - - * syntax.h (SYNTAX_COMMENT_BITS, SYNTAX_START_P, SYNTAX_END_P, - SYNTAX_STYLES_MATCH_START_P, SYNTAX_STYLES_MATCH_1CHAR_P, - SYNTAX_STYLES_MATCH_END_P, STYLE_FOUND_1CHAR_P, STYLE_FOUND_P, - SYNTAX_COMMENT_MASK_END, SYNTAX_COMMENT_MASK_START, - SYNTAX_COMMENT_1CHAR_MASK): Remove redundant argument `table'. - (Code clarification.) - - * syntax.c (scan_words, find_end_of_comment, scan_sexps_forward, - scan_lists): Compute code from syncode, use Boolean macros instead - of redundant masking operations. (Code clarification; any decent - compiler can do this optimization.) - - * syntax.c (scan_lists): Rearrange switches (case Sstring_fence) - for clarity. - - * syntax.h, syntax.c (NEXT_SINGLE_PROPERTY_CHANGE, - PREVIOUS_SINGLE_PROPERTY_CHANGE, update_syntax_cache): Conditionally - use F*_single_property_change instead of F*_extent_change. - Currently F*_single_property_change is _much_ less efficient. - - * dired.c (Fdirectory_files): Qt not valid in syntax_cache.object. - * syntax.h (SETUP_SYNTAX_CACHE_FOR_OBJECT): Initialize - syntax_cache.object properly, don't leave Qt or Qnil. - (SYNTAX_CACHE_BYTE_TO_CHAR): Use SETUP_SYNTAX_CACHE_FOR_OBJECT. - * syntax.c (update_syntax_cache): Use BUFFERP and STRINGP, not - tests for Qt or Qnil. - -2002-09-21 Stephen J. Turnbull <stephen@xemacs.org> - - * redisplay.c (point_in_line_start_cache): - * extents.c (print_extent_1): - Fix warnings. - - * extents.c (Fset_extent_property): Document `syntax-table' property. - - * extents.h (Fnext_single_property_change): EXFUN it. - -2002-09-09 Stephen J. Turnbull <stephen@xemacs.org> - - * search.c (clear_unused_search_regs): New static function. - (search_buffer): - (simple_search): - (boyer_moore): - Use it. Fixes "stale match data" bug reported by Martin Stjernholm. - Minor clarifications in comments. - - * regex.c (re_match_2_internal): Ensure no stale submatches. - -2002-09-09 Stephen J. Turnbull <stephen@xemacs.org> - - * event-Xt.c (enqueue_focus_event): Add missing prototype. - -2002-08-29 Jerry James <james@xemacs.org> - - * lisp.h: structrures -> structures. - -2002-06-03 Andy Piper <andy@xemacs.org> - - * frame.c (frame_conversion_internal): add conversion appropriate - for setting frame dimensions in pixels. - - * console.h (struct console_methods): add device-specific widget - layout functions. - - * emacs.c (main_1): initialize glyph vars. - - * event-Xt.c (handle_focus_event_1): call handle_focus_event_2 - (handle_focus_event_2): new function. Allow focus to - be set to a particular window and widget. - (enqueue_focus_event): new function. Create a - synthetic focus event. - (emacs_Xt_handle_magic_event): call - handle_focus_event_2. - - * frame.c (Fset_frame_pixel_height): new function. Allow - pixel-based sizing. Does the right thing on character-oriented - displays. - (Fset_frame_pixel_width): ditto. - (Fset_frame_pixel_size): ditto. - (syms_of_frame): declare. - - * general-slots.h: add :vertically-justify and - :horizontally-justify. - - * glyphs-msw.c (xbm_create_bitmap_from_data): warning fix. - (mswindows_widget_border_width): new function. - (mswindows_combo_box_instantiate): set border widths. - (console_type_create_glyphs_mswindows): declare. - - * glyphs-widget.c: - (check_valid_justification): allow vertical and horizontal - justification. - (widget_border_width): new function. Call device methods. - (widget_instance_border_width): ditto. - (logical_unit_height): new function. Determine the height of a - logical-unit. Logical units are intended to provide grid-like - layout for subcontrols in a layout. If the layout is - :vertically-justify top then subcontrols will be positioned on - logical-unit boundaries, thus allowing adjacent subcontrols to - line up. - (widget_logical_unit_height): ditto for widgets. - (redisplay_widget): misc cleanup. - (widget_spacing): new function. Call device specific - methods. Intended to be the default gap between adjacent widgets. - (widget_query_geometry): use new spacing functions to determine - appropriate geometry. - (initialize_widget_image_instance): initialize horizontal and - vertical justification. - (widget_instantiate): use logica-units where appropriate for - sizing large widgets. - (button_query_geometry): use widget_instance_border_width. - (tree_view_query_geometry): ditto. - (tab_control_query_geometry): ditto. - (edit_field_query_geometry): new function. - (layout_update): pick up :justify, :horizontally-justify and - :vertically-justify none of which worked previously. :justify is - used as a fallback for both horizontal and vertical justification. - (layout_query_geometry): use logical units to size appropriately. - (layout_layout): ditto. - (Fwidget_logical_to_character_width): new function. Allow users to - convert from logical units to characters so that frame sizes can - be set appropriately. - (Fwidget_logical_to_character_height): ditto. - (syms_of_glyphs_widget): declare. - (image_instantiator_edit_fields): add edit_field_query_geometry. - (VALID_LAYOUT_KEYWORDS): declare :vertically-justify and - :horizontally-justify. - (specifier_vars_of_glyphs_widget): new function. Declare - Vwidget_border_width which is not yet used. - - * glyphs-x.c (x_map_subwindow): enqueue appropriate focus events. - (x_widget_border_width): new function. - (x_widget_instantiate): create a sensible name for widgets. - (console_type_create_glyphs_x): declare x_widget_border_width. - - * glyphs.h (DEFAULT_WIDGET_BORDER_WIDTH): new macro. - (struct Lisp_Image_Instance): add :vertically-justify and - :horizontally-justify. - (LAYOUT_JUSTIFY_TOP): new. - (IMAGE_INSTANCE_SUBWINDOW_H_JUSTIFY): new. - (ROUND_UP): new macro. Round argument up to next integral - interval. - - * redisplay-output.c (redisplay_output_layout): misc formatting. - - * symsinit.h: declare specifier_vars_of_glyphs_widget. - -2002-08-23 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.9 "Informed Management" is released. - -2002-08-19 Andy Piper <andy@xemacs.org> - - * fileio.c (Ffile_truename): on cygwin using win32 normalize to - win32 format. - - * realpath.c (xrealpath): normalize drive spec also so that dir - sep chars are not mixed on cygwin. - -2002-08-06 Jerry James <james@xemacs.org> - - * window.c (Fsplit_window): Count only half of the divider width - against the left window when splitting horizontally. - -2002-06-24 Andy Piper <andy@xemacs.org> - - * toolbar-gtk.c (GTK_OUTPUT_BUTTONS_LOOP): output button if whole - toolbar was cleared. - - * toolbar-msw.c (mswindows_clear_frame_toolbars): new - function. Split out from mswindows_output_frame_toolbars. - (mswindows_output_frame_toolbars): move clear pieces to - mswindows_output_frame_toolbars. - - * toolbar-gtk.c (gtk_clear_frame_toolbars): new function. Split - out from gtk_output_frame_toolbars. - (gtk_output_frame_toolbars): move clear pieces to - gtk_clear_frame_toolbars. - - * toolbar-x.c (X_OUTPUT_BUTTONS_LOOP): always output buttons when - the frame is cleared. How this ever worked before is a mystery. - (x_output_frame_toolbars): Only output toolbars. - (x_clear_frame_toolbars): new. Clear previous toolbar locations. - - * gutter.c (update_gutter_geometry): - Mark frame layout changed. - (update_frame_gutter_geometry, update_frame_gutters): - Respect frame_layout_changed. - - * console.h (struct console_methods): add - clear_frame_toolbars_method. - - * redisplay.c (redisplay_frame): call - update_frame_toolbars_geometry and re-order update_frame_toolbars. - - * toolbar.h: declare update_frame_toolbars_geometry. - - * toolbar.c (update_frame_toolbars_geometry): new function. Split - out from update_frame_toolbars. Call clear_frame_toolbars. - (update_frame_toolbars): only output, do not change geometry. - - * redisplay.c: add frame_layout_changed. - - * redisplay.h: add frame_layout_changed. - (CLASS_RESET_CHANGED_FLAGS): set it. - (GLOBAL_RESET_CHANGED_FLAGS): ditto. - (CLASS_REDISPLAY_FLAGS_CHANGEDP): test it. - (GLOBAL_REDISPLAY_FLAGS_CHANGEDP): ditto. - - * device.h (struct device): add frame_layout_changed. - (MARK_DEVICE_FRAME_LAYOUT_CHANGED): new. - - * frame.h (struct frame): add frame_layout_changed. - (MARK_FRAME_LAYOUT_CHANGED): new. - -2002-06-30 Mike Alexander <mta@arbortext.com> - - * event-msw.c (mswindows_need_event): Don't wait for a new message - if the queue is not empty. Suggested by Paul Moore. - -2002-06-12 Andy Piper <andy@xemacs.org> - - * frame-msw.c (msprinter_init_frame_3): calculate the frame size - for printing on accurately. - -2002-06-09 Rick Rankin <rick_rankin@yahoo.com> - - * event-msw.c (mswindows_wnd_proc): Add a handler for the - WM_ACTIVATE message. Make sure that the frame is visible if the - window is visible. This seemss to fix the problem where XEmacs - appears to freeze after switching desktops with certain virtual - window managers. - (debug_output_mswin_message): Added code to output message - parameters for WM_WINDOWPOSCHANGED, - WM_WINDOWPOSCHANGING, WM_MOVE, and WM_SIZE messages. - -2002-05-25 Andy Piper <andy@xemacs.org> - - * select-x.c (vars_of_select_x): Fix docstring of - x-selection-strict-motif-ownership - -2002-08-14 Stephen J. Turnbull <stephen@xemacs.org> - - * keymap.c (get_keymap): - Add comment about do_autoload GCPROs own args. - -2002-08-14 Stephen J. Turnbull <stephen@xemacs.org> - - * bytecode.c (execute_optimized_program): check_opcode ifdef - ERROR_CHECK_BYTE_CODE. - -2002-08-14 Stephen J. Turnbull <stephen@xemacs.org> - - Thanks to Ben Wing and Michael Sperber. - - * eval.c (Fcommand_execute): - (Feval): - (Ffuncall): - (Fmacroexpand_internal): - (function_argcount): - callint.c (Fcall_interactively): - Add comment about do_autoload GCPROs own args. - - * (do_autoload): GCPRO both args as well as local Lisp_Object. - - * eval.c (Ffuncall): Extra braces to placate GCC. - -2002-08-10 Stephen J. Turnbull <stephen@xemacs.org> - - * backtrace.h (grow_specpdl): - (SPECPDL_RESERVE): - * EmacsFrame.c (EmacsFrameSetValues): - * eval.c (grow_specpdl): - * ExternalShell.c (hack_event_masks_1): - * glyphs-x.c (convert_EImage_to_XImage): - (x_finalize_image_instance): - * ralloc.c (page_size): - (r_alloc_sbrk): - * xgccache.c (gc_cache_hash): - Fix unsigned comparison warnings. - -2002-07-29 Jerry James <james@xemacs.org> - - * lread.c (locate_file): Any nonnegative return value indicates - success if MODE is nonnegative. - -2002-08-03 Brian A Palmer <bpalmer@rescomp.Stanford.EDU> - - * emacs.c (Fsplit_string_by_char): Make 2nd arg SEPCHAR a required - argument. - -2002-07-17 Stephen J. Turnbull <stephen@xemacs.org> - - * process-unix.c (unix_send_process): #ifdef the coding_stream member. - - * dumper.c (pdump_get_indirect_count): - (pdump_scan_by_alignment): - (pdump_dump_root_struct_ptrs): - (pdump_dump_rtables): - (pdump_dump_root_objects): - (pdump): - * nas.c (WaveOpenDataForReading): - * fns.c (print_bit_vector): - * font-lock.c (SINGLE_SYNTAX_STYLE): - * glyphs.c (check_for_ignored_expose): - (find_matching_subwindow): - * glyphs-eimage.c: - * imgproc.c (get_histogram): - * redisplay.c (point_in_line_start_cache): - * redisplay-output.c (redisplay_unmap_subwindows): - * symbols.c (defsymbol_massage_name_1): - (defkeyword_massage_name): - (deferror_massage_name_and_message): - * redisplay-x.c (x_output_string): - * emacs.c (run_temacs_argv_size, run_temacs_args_size): - * frame.h (struct frame): - * filelock.c (current_lock_owner): - * doprnt.c (emacs_doprnt_1): - * lisp.h (struct Lisp_Bit_Vector): - (DO_REALLOC): - Fix warnings. - -2002-02-13 Ben Wing <ben@xemacs.org> - - * event-stream.c (reset_key_echo): - * event-stream.c (reset_this_command_keys): - * event-stream.c (execute_command_event): - If console is dead as a result of C-x 5 0, then post-command stuff - needs to be careful and do only non-console-specific stuff. - -2002-07-01 Mike Sperber <mike@xemacs.org> - - * process-unix.c (unix_send_process): Mark coding_outstream as - non-open upon SIGPIPE. - - * event-stream.c (Fnext_event): Reorder switch cases to something - that makes sense. - -2001-08-13 Dmitry Astapov <adept@umc.com.ua> - - * event-Xt.c (maybe_define_x_key_as_self_inserting_character): - Don't bogusly reinitialize ascii_character property. - -2002-07-08 Mike Sperber <mike@xemacs.org> - - * process.c (Fstart_process_internal): Do error checking before we - fork off the child, so the child can't muck with the state of the - parent. - -2002-07-08 Mike Sperber <mike@xemacs.org> - - * ralloc.c (init_ralloc): Allocate properly for pdump. - -2002-06-12 Andy Piper <andy@xemacs.org> - - * glyphs.c (query_string_geometry): check the string. - - * glyphs-widget.c (widget_logical_unit_height): cope with nil - widget names. - -2002-06-17 Jerry James <james@xemacs.org> - - * sysdll.c: Remove RTLD_GLOBAL initialization. - * sysdll.c (dll_open): Do not use RTLD_GLOBAL. - -2002-06-25 Stephen J. Turnbull <stephen@xemacs.org> - - * search.c (skip_chars): Port Ben's crash fix and efficiency patch. - -2002-05-16 Mathias Grimmberger <mgri@zaphod.sax.de> - - * sysdep.c (sys_rename): Make sys_rename work for the case where - Windows rename sets errno to EACCES if target file exists. - -2002-05-21 Jonathan Harris <jonathan@xemacs.org> - - * device-msw.c (mswindows_handle_page_setup_dialog_box): - Fix detection of metric units to work on Win95 - -2002-05-21 Stephen J. Turnbull <stephen@xemacs.org> - - * syswindows.h: #define LOCALE_RETURN_NUMBER. Why, I don't know. - -2002-04-25 Andy Piper <andy@xemacs.org> - - * redisplay.c (create_text_block): Remove extra comment trailer. - -2002-04-24 Andy Piper <andy@xemacs.org> - - * redisplay.c (create_text_block): Don't actually add propagation - data if the line ends after we have added a glyph. - -2002-04-22 Andy Piper <andy@xemacs.org> - - * extents.c (extent_fragment_update): check for glyphs we have - previously displayed. - * extents.c (print_extent_1): warning removal. - * extents.h: change prototype. - * redisplay-output.c (redisplay_normalize_glyph_area): calculate - widths correctly for wide glyphs. - * redisplay.c (position_redisplay_data_type): add end_glyph_width. - * redisplay.c (prop_type): add PROP_GLYPH. - * redisplay.c (struct prop_block): add glyph type - * redisplay.c (add_glyph_rune): when adding part of a glyph add it - to the propagation data. - * redisplay.c (create_text_block): if there is a glyph in the - propagation data use it to salt extent_fragment_update. - * redisplay.c (create_string_text_block): ditto. - -2002-04-13 Nix <nix@esperi.demon.co.uk> - - * redisplay.h (struct rune): Add ascent, descent, and yoffset fields. - * redisplay-output.c (compare_runes): Compare them. - * redisplay.c: Update copyright date. - * redisplay.c (pos_data): Add need_baseline_computation field. - * redisplay.c (add_glyph_rune): Update ascent, descent, and - need_baseline_computation; zero yoffset. Set max_pixmap_height - for all pixmaps, not just automatically positioned ones. - * redisplay.c (calculate_yoffset): New, compute yoffset values. - * redisplay.c (calculate_baseline): New, compute textual baseline. - * redisplay.c (add_glyph_rune): Call them. - * redisplay.c (create_text_block): Likewise. - * redisplay.c (create_overlay_glyph_block): Likewise. - * redisplay.c (add_margin_runes): Likewise. - * redisplay.c (create_string_text_block): Likewise. Fix tabdamage. - - * redisplay.h: (redisplay_calculate_display_boxes): Change prototype. - * redisplay-output.c (redisplay_calculate_display_boxes): Use yoffset. - * redisplay-msw.c (mswindows_output_blank): Pass 0 as yoffset. - * redisplay-msw.c (mswindows_output_string): Likewise. - * redisplay-msw.c (mswindows_output_display_block): Pass yoffset. - * redisplay-gtk.c (gtk_output_display_block): Likewise. - * redisplay-x.c (x_output_display_block): Likewise. - -2002-03-28 Ben Wing <ben@xemacs.org> - - * redisplay.c: Fixed bug in redisplay - w.r.t. hscroll/truncation/continuation glyphs causing jumping up - and down of the lines, since they're bigger than the line - size. (It was seen most obviously when there's a horizontal scroll - bar, e.g. do C-h a glyph or something like that.) The problem was - that the glyph-contrib-p setting on glyphs was ignored even if it - was set properly, which it wasn't until now. - -2002-04-24 Andy Piper <andy@xemacs.org> - - * lisp.h (Dynarr_end): Fix definition. - -2002-02-06 Adrian Aichner <adrian@xemacs.org> - - * redisplay.c (mark_redisplay): Remove call to - update_frame_window_mirror. - -2001-11-15 Andy Piper <andy@xemacs.org> - - * win32.c (Fmswindows_shell_execute): fix handling of URL's under - cygwin (again). - -2002-02-13 Andy Piper <andy@xemacs.org> - - * event-msw.c (mswindows_wnd_proc): only mark the frame visible if - we did in fact enqueue the XM_MAPFRAME event. - -2002-01-15 Adrian Aichner <adrian@xemacs.org> - - * event-msw.c (mswindows_wnd_proc): Add handling of WM_SHOWWINDOW - to fix problem switching between virtual desktops under virtuawin - virtual window manager. - -2001-07-30 Adrian Aichner <adrian@xemacs.org> - - * event-msw.c: Typo fix. - * event-msw.c (mswindows_wnd_proc): Set FRAME_VISIBLE_P after - magic XM_MAPFRAME event has been sent. - -2001-11-23 Andy Piper <andy@xemacs.org> - - * event-msw.c (mswindows_wnd_proc): Don't pump mousewheel events. - -2001-11-21 Andy Piper <andy@xemacs.org> - - * scrollbar-msw.c (mswindows_handle_mousewheel_event): cope with - mouse events outside the frame. - -2002-03-20 Andy Piper <andy@xemacs.org> - - * menubar-msw.c (mswindows_popup_menu): warning removal. - * dialog-msw.c (dialog_popped_down): ditto. - -2001-12-11 Andy Piper <andy@xemacs.org> - - * dialog-msw.c (dialog_popped_down): new function. unset popup_up_p. - * dialog-msw.c (mswindows_make_dialog_box_internal): set - popup_up_p. - * menubar-msw.c (unsafe_handle_wm_initmenupopup_1): ditto. - * menubar-msw.c (mswindows_handle_wm_command): ditto. - * menubar-msw.c (mswindows_popup_menu): ditto. - -2001-10-29 Andy Piper <andy@xemacs.org> - - * dialog-msw.c (handle_directory_dialog_box): quit if the user - cancels. - -2002-01-03 Andy Piper <andy@xemacs.org> - - * realpath.c (ABS_LENGTH): dtrt for cygwin systems using drive - letters. - (xrealpath): ditto. - -2002-03-29 Jonathan Harris <jonathan@xemacs.org> - - * device-msw.c (plist_get_margin): Add arg specifying mm or inches - * device-msw.c (plist_set_margin): Fix multiplicand used for mm - * device-msw.c (mswindows_handle_page_setup_dialog_box): - Detect and handle case where machine is set up for metric units - -2002-04-02 Andy Piper <andy@xemacs.org> - - * dired-msw.c (mswindows_get_files): - * nt.c (mswindows_stat): SetErrorMode() so that file errors are - completely handled by XEmacs. Suggested by Thomas Vogler - <mail@thomas-vogler.de>. - -2001-11-14 Andy Piper <andy@xemacs.org> - - * nt.c (REG_ROOT): change registry key to XEmacs. - -2002-04-27 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c (mswindows_widget_instantiate): remove dead-code. - -2002-04-26 Andy Piper <andy@xemacs.org> - - * glyphs-msw.c (mswindows_map_subwindow): observe :initial-focus - behavior. - -2002-03-14 Mike Alexander <mta@arbortext.com> - - * event-msw.c (mswindows_unwait_process): New, remove process from - wait list - * process-nt.c (nt_finalize_process_data): Call - mswindows_unwait_process - * console-msw.h: Declare mswindows_unwait_process - -2002-05-14 Stephen J. Turnbull <stephen@xemacs.org> - - * editfns.c (Fdecode_time): - (Fformat_time_string): - Check for invalid time. Thanks to Nick Pakoulin <npak@ispras.ru>. - (make_time): Warning elimination (change arg name). - -2001-11-24 Andy Piper <andy@xemacs.org> - - * window.c (Fsplit_window): Doc return type. - -2002-04-01 Andy Piper <andy@xemacs.org> - - * emacs.c (Fkill_emacs): Only output message box in interactive - mode. - -2002-04-26 Andy Piper <andy@xemacs.org> - - * config.h.in: pull in 21.5.x change to stop alloca warnings under - cygwin. - -2002-03-18 Gregory Steuck <greg-xemacs-patch@nest.cx> - - * unexelf.c: Use ELFSIZE or define from _LP64 to indicate a 64 - bit platform. - -2002-05-09 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.8 "Honest Recruiter" is released. - -2002-05-07 Nix <nix@esperi.demon.co.uk> - - Supersedes 2002-04-17 patch. - - * process.h (PROCESS_LIVE_P): Use the process status as - evidence of health, not the state of the input stream. - (PROCESS_READABLE_P): Say if the process is readable - from. (It may be dead nonetheless.) - (CHECK_READABLE_PROCESS): Test for that condition. - - * process.c (create_process): Use PROCESS_READABLE_P. - (read_process_output, set_process_filter): Likewise. - - * process.c (Fprocess_input_coding_system): Use CHECK_READABLE_PROCESS. - (Fset_process_input_coding_system, Fprocess_coding_system): Likewise. - - This code is #if 0'd, this is not the time to add new functions: - - * process.c (Fprocess_readable_p): Report readability status. - * process.c (Qprocess_readable_p): New, associated symbol... - * process.c (syms_of_process): ... initialize it. - -2002-05-04 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.7 "Economic Science" is released. - -2002-04-17 Nix <nix@esperi.demon.co.uk> - - * process.h (PROCESS_LIVE_P): Use the process status as - evidence of health, not the state of the input stream. - -2002-04-30 Charles G. Waldman <cgw@xemacs.org> - - * sysdep.c (sys_siglist): change "signum" to "signal" - -2001-04-21 Martin Buchholz <martin@xemacs.org> - - * s/darwin.h: New file. - Thanks to Greg Parker <gparker@cs.stanford.edu>. - -2002-04-23 Andreas Jaeger <aj@suse.de> - - * s/linux.h (LIB_STANDARD): Define correctly for x86-64 and s390x - which use lib64 for 64-bit libs. - (START_FILES): Likewise. - -2002-02-11 Mike Sperber <mike@xemacs.org> - - * device-x.c: - (x_IO_error_handler): - (x_init_device): Temporarily keep device in static variable - `device_being_initialized' so we can recover gracefully from - internal XOpenDevice failure. (XOpenDevice is documented to - return NULL on failure, but sometimes calls the IO error handler - instead.) - -2002-01-31 John H. Palmieri <palmieri@math.washington.edu> - - * dired.c (Ffile_name_all_completions): Change documentation -- - remove reference to completion-ignored-extensions. - * dired.c (vars_of_dired): Change documentation for - completion-ignored-extensions -- remove reference to - file-name-all-completions. - -2002-03-06 Jerry James <james@xemacs.org> - - * emodules.c (emodules_load): Fix multiple loading of same module. - -2002-01-25 Andrew Begel <abegel@cs.berkeley.edu> - * sysdll.c (dll_open): Changed to use RTLD_NOW instead of - RTLD_LAZY to avoid incorrect symbol binding when using nested - shared libraries on Solaris. - -2002-02-12 Stephen J. Turnbull <stephen@xemacs.org> - - * fileio.c (Ffind_file_name_handler): Improve docstring. - -2002-01-20 Stephen J. Turnbull <stephen@xemacs.org> - - * fns.c (Fmapconcat): Improve docstring. - -2002-01-03 Eric Gillespie, Jr. <epg@pretzelnet.org> - - * device-gtk.c: Add prototype for - emacs_gtk_selection_clear_event_handle. - (gtk_init_device): Call gtk_selection_add_target for CLIPBOARD - selection. Setup signal handler for "selection_clear_event" - (emacs_gtk_selection_clear_event_handle). - - * select-gtk.c (emacs_gtk_selection_clear_event_handle): Handle - other applications owning the clipboard (based on - x_handle_selection_clear). - -2001-12-23 William M. Perry <wmperry@gnu.org> - - * menubar-gtk.c (gtk_popup_menu) Add sanity checks, fix crash. - -2002-01-04 Martin Buchholz <martin@xemacs.org> - - * keymap.c (define_key_alternate_name): Parenthesize EQ. - -2001-12-17 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.6 "Common Lisp" is released. - -2001-12-16 Torsten Duwe <duwe@caldera.de> - - * search.c (Freplace_match): Add missing sub-expression functionality. - - * buffer.c (decode_buffer): Add a check for pointer type to - decode_buffer, before gcc's CSE optimization reorders a - dereference in front of the allow_string test. - -2001-11-16 Darryl Okahata <darrylo@xemacs.org> - - * window.c (window_loop): Fix bug that sometimes prevented - window_loop() from iterating across multiple devices. Also, at - Ben's request, changed infloop-detecting code to abort() instead - of silently terminating window_loop(). - -2001-11-21 Stephen J. Turnbull <stephen@xemacs.org> - - Based on analysis and patch by Simon Josefson <jas@extundo.com>. - * editfns.c (make_time): New function. - (Fencode_time): Use it instead of wasteful_word_to_lisp. - * lisp.h (make_time): Prototype and comment it. - * dired.c (wasteful_word_to_lisp): Deprecate. - (Ffile_attributes): Use make_time() instead of wasteful_word_to_lisp(). - -2001-10-31 Kyle Jones <kyle_jones@wonderworks.com> - - * fileio.c (auto_save_1): Use current coding system, not - escape-quoted. - -2001-11-13 Ben Wing <ben@xemacs.org> - - * window.c: - * window.c (window_truncation_on): - * window.c (syms_of_window): - truncate-partial-width-windows should respect the buffer being - displayed, like other redisplay vars. - -2001-11-13 Hirokazu FUKUI <hfukui@sannet.ne.jp> - - * event-stream.c (Fread_key_sequence): save current buffer. - -2001-10-29 Andrew Begel <abegel@eecs.berkeley.edu> - - * ntheap.c (_heap_init): Don't redefine in VS.NET (MSC >= 1300). - -2001-10-29 Andrew Begel <abegel@eecs.berkeley.edu> - - * alloc.c (lcrecord_stats): Add space for types defined in modules. - -2001-10-26 Mike Alexander <mta@arbortext.com> - - * event-msw.c (slurper_free_shared_data_maybe): Free the pipe handle. - -2001-10-25 Andy Piper <andy@xemacs.org> - - * ChangeLog: - * dialog-msw.c (handle_directory_proc): new function. - (handle_directory_dialog_box): new fucntion. - (handle_file_dialog_box): use new directory dialog support. - (mswindows_make_dialog_box_internal): ditto. - * event-msw.c (mswindows_wnd_proc): minor fix to scrollbar event - handling. - (mswindows_find_frame): make global. - * fileio.c (Fexpand_file_name): build fix. - * general-slots.h: add Qdirectory. - * scrollbar-msw.c (mswindows_handle_scrollbar_event): fix focus - handling. - * syswindows.h (LOCAL_TO_WIN32_FILE_FORMAT): fix problem with - cygwin not leaving win32 paths unchanged. - * win32.c (Fmswindows_cygwin_to_win32_path): new function. Use the - cygwin runtime to do path conversion. - (Fmswindows_shell_execute): fix cygwin handling of URLs. - (syms_of_win32): add new function. - * window.c (window_loop): build fix. - -2001-10-15 Andy Piper <andy@xemacs.org> - - (Fmswindows_shell_execute): fix handling of URL's under cygwin. - -2001-10-23 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.5 "Civil Service" is released. - -2001-04-08 Danny Colascione <qtmstr@optonline.net> - - * glyphs-x.c: Force buffer-tab highlight update when moving the - buffer, avoiding an ugly black border, used for keyboard focus - indication, on a widget that can never have keyboard focus, the - buffer tab. - -2001-08-30 Daiki Ueno <ueno@unixuser.org> - - * process-unix.c (unix_open_multicast_group): Remove too much - conversion between host and network byte order. - -2001-09-10 Nix <nix@esperi.demon.co.uk> - - * src/buffer.c (kill_buffer): Undedicate windows showing BUF - before replacing them. - - * src/window.c (window_loop): Implement new UNDEDICATE_BUFFER - operation. - - * src/window.c (undedicate_windows): Use it. - * src/window.h: Add prototype. - -2001-09-17 Ben Wing <ben@xemacs.org> - - * fileio.c (normalize_filename): - * fileio.c (Fexpand_file_name): - Fix various C++ compile errors in Andy's recent code. - - * callint.c (Fcall_interactively): - * editfns.c (Ftemp_directory): - * editfns.c (Fuser_full_name): - * emacs.c (argmatch): - * lread.c (locate_file_map_suffixes): - * redisplay-x.c (x_ring_bell): - Fix sign-compare warnings. - -2001-09-08 Andy Piper <andy@xemacs.org> - - * fileio.c (normalize_filename): copied from nt.c - * (Ffile_name_directory): enable win32 paths under cygwin. - * (Ffile_name_nondirectory): ditto. - * (directory_file_name): ditto. - * (Fexpand_file_name): ditto. - * (Ffile_truename): ditto. - * (Fsubstitute_in_file_name): ditto. - * (Ffile_name_absolute_p): ditto. - * (Ffile_readable_p): ditto. - -2001-09-08 Andy Piper <andy@xemacs.org> - - * device-msw.c (mswindows_finish_init_device): remove dde - initialization. - * device-msw.c (mswindows_init_dde): factor out from - mswindows_finish_init_device() - * device-msw.c (init_mswindows_very_early): new function - initialize but don't enable dde. - * emacs.c (main_1): call init_mswindows_very_early. - * event-msw.c: - * event-msw.c (mswindows_dde_callback): only execute when we are - ready. - * symsinit.h: declare init_mswindows_very_early. - -2001-05-02 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - [sjt: This has been in 21.5 for months with no complaints.] - - * console.h (struct console_methods): Added flags member. - (CONSOLE_IMPLEMENTATION_FLAGS): Defined. - (CONMETH_IMPL_FLAG): - (CONSOLE_IMPL_FLAG): Macro to check implememntation flags. - Defined XDEVIMPF_DONT_PREEMPT_REDISPLAY. - - * device.c (window_system_pixelated_geometry): Use the above macros. - - * device.h (DEVICE_IMPL_FLAG): Macro to check a device - implememntation flag. - * device.h (DEVICE_DISPLAY_P): Use it. - - * frame.c (delete_frame_internal): Use the above macro. - - * redisplay.c (redisplay_device): Use it. - (redisplay_device): Obey XDEVIMPF_DONT_PREEMPT_REDISPLAY. - (redisplay_frame): Ditto. - - * device-msw.c (mswindows_device_implementation_flags): Removed. - (msprinter_device_implementation_flags): Removed. - (console_type_create_device_mswindows): Removed references to - implementation_flags methods, set implementation flags here. - (console_type_create_device_mswindows): Added XDEVIMPF_DONT_PREEMPT. - - * device-gtk.c (gtk_device_implementation_flags): Removed method. - (console_type_create_device_gtk): Removed method declaration. - Added commented out statement which semantically matches the - commented out statement in the above removed method. - -2001-04-14 Gordon Sadler <gbsadler1@lcisp.com> - - The attached patch fixes a few warnings. - - * src/emacs.c: prototype console_type_create_select_gtk for GTK only - * src/frame-gtk.c: guard against GNOME calls in GTK only - * src/redisplay-gtk.c: include <sys/poll.h> #ifdef HAVE_POLL - * src/select-gtk.c: prototype lisp_to_time - -2001-06-08 Ben Wing <ben@xemacs.org> - - ------ gc-in-window-procedure fixes ------ - - * alloc.c: - * alloc.c (struct post_gc_action): - * alloc.c (register_post_gc_action): - * alloc.c (run_post_gc_actions): - * alloc.c (garbage_collect_1): - Create "post-gc actions", to avoid those dreaded "GC during window - procedure" problems. - - * event-msw.c: - Abort, clean and simple, when GC in window procedure. We want - to flush these puppies out. - - * glyphs-msw.c: - * glyphs-msw.c (finalize_destroy_window): - * glyphs-msw.c (mswindows_finalize_image_instance): - Use a post-gc action when destroying subwindows. - - * lisp.h: - Declare register_post_gc_action(). - - * scrollbar-msw.c: - * scrollbar-msw.c (unshow_that_mofo): - Use a post-gc action when unshowing scrollbar windows, if in gc. - - * redisplay.c (mark_redisplay): - Add comment about the utter evilness of what's going down here. - - ------ cygwin setitimer fixes ------ - - * Makefile.in.in (sheap_objs): - * Makefile.in.in (profile_objs): - * Makefile.in.in (objs): - Compile profile.c only when HAVE_SETITIMER. - - * nt.c (mswindows_sigset): - * nt.c (mswindows_sighold): - * nt.c (mswindows_sigrelse): - * nt.c (mswindows_sigpause): - * nt.c (mswindows_raise): - * nt.c (close_file_data): - Style fixes. - - * nt.c: - Move setitimer() emulation to win32.c, because Cygwin needs it too. - - * profile.c: - * profile.c (Fstart_profiling): - * profile.c (Fstop_profiling): - Make sure we don't compile if no setitimer(). Use qxe_setitimer() - instead of just plain setitimer(). - - * signal.c: - * signal.c (set_one_shot_timer): - * signal.c (alarm): - Define qxe_setitimer() as an encapsulation around setitimer() -- - call setitimer() directly unless Cygwin or MS Win, in which case - we use our simulated version in win32.c. - - * systime.h: - * systime.h (struct itimerval): - * systime.h (ITIMER_REAL): - Prototype mswindows_setitimer() and qxe_setitimer(). Long - comment about "qxe" and the policy regarding encapsulation. - - * win32.c: - * win32.c (setitimer_helper_proc): - * win32.c (setitimer_helper_period): - * win32.c (setitimer_helper): - * win32.c (mswindows_setitimer): - Move setitimer() emulation here, so Cygwin can use it. - Rename a couple of functions and variables to be longer and more - descriptive. In setitimer_helper_proc(), send the signal - using either mswindows_raise() or (on Cygwin) kill(). If for - some reason we are still getting lockups, we'll change the kill() - to directly invoke the signal handlers. - - ------ windows shell fixes ------ - - * callproc.c: - * ntproc.c: - Comments about how these two files must die. - - * callproc.c (init_callproc): - On MS Windows, init shell-file-name from SHELL, then COMSPEC, - not just COMSPEC. (more correct and closer to FSF.) Don't - force a value for SHELL into the environment. (Comments added - to explain why not.) - - * nt.c (init_user_info): - Don't shove a fabricated SHELL into the environment. See above. - -2001-06-01 Ben Wing <ben@xemacs.org> - - * Makefile.in.in (ldflags): - eliminate that pesky "defaulting to 00401000" warning. - * nt.h: - eliminate warnings. - -2001-06-15 Golubev I. N. <gin@mo.msk.ru> - - * s/sco5.h (FORCE_ALLOCATE_PTY_THE_OLD_FASHIONED_WAY): #define. - * process-unix.c (allocate_pty): #ifndef "modern" pty allocation. - -2001-04-24 Jerry James <james@xemacs.org> - - * faces.h: pass parameters to Fadd_spec_to_specifier in the - correct order. - -2001-06-01 Ben Wing <ben@xemacs.org> - - * event-msw.c (debug_mswin_messages): - conditionalize the messages that were causing compile errors. - (if only macros could generate #ifdef statements ...) - -2001-07-28 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.4 "Artificial Intelligence" is released. - -2001-07-22 Stephen J. Turnbull <stephen@xemacs.org> - - * event-msw.c (mswindows_wnd_proc): Add GC debugging assert. - -2001-07-22 Stephen J. Turnbull <stephen@xemacs.org> - - * config.h.in (IPV6_CANONICALIZE): New #define for --with-ipv6-lookup. - * process-unix.c (unix_canonicalize_host_name): - sysdep.c (init_system_name): - Use it to conditionally support IPv6 canonicalization. - -2001-05-31 Paul Stodghill <stodghil@cs.cornell.edu> - - * event-msw.c: - Cygwin does not define WM_IME_xxx. Modify the #if's accordingly. - -2001-05-19 Paul Krause <paulkrause1@mediaone.net> - - * scrollbar-msw.c: Fixes a crash that occurs on Windows when an - attempt is made to scroll when no scroll bar is available. - -2001-04-19 Glynn Clements <glynn.clements@virgin.net> - - * input-method-motif.c (XIM_delete_frame): New callback. - (XIM_init_frame): Register it. (Reapplied by SJT, it somehow - got deleted from 21.4.3.) - -2001-06-01 Ben Wing <ben@xemacs.org> - - * nt.c (mswindows_utime): - * nt.c (close_file_data): - fix off-by-one-indirection error. - -2001-05-29 Adrian Aichner <adrian@xemacs.org> - - * fileio.c: Include nt.h. Remove lisp_string_set_file_times() - because set_file_times() now takes Lisp_Object path, instead of - char*. - * nt.c: Include buffer.h. - * nt.c (convert_from_time_t): New. - * nt.c (mswindows_utime): New. Use utime, since SetFileTime does - not set mtime correctly. - * nt.h: Declare mswindows_utime(). - * sysdep.c (set_file_times): set_file_times() now takes Lisp_Object - path, instead of char*. - * systime.h: Include <sys/utime.h> on WIN32_NATIVE. - -2001-05-30 Ben Wing <ben@xemacs.org> - - For 21.4: - - (Stephen, just take all event-msw.c patches. This includes - the "iconify" fix below.) - - * event-msw.c: - * event-msw.c (mswindows_dequeue_dispatch_event): - * event-msw.c (assert): - * event-msw.c (emacs_mswindows_quit_p): - * event-msw.c (debug_mswin_messages): - * event-msw.c (debug_output_mswin_message): - * event-msw.c (vars_of_event_mswindows): - Fix yet more problems with C-g handling. - Implement debug-mswindows-events. - -2001-05-24 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * event-msw.c (WM_DROPFILES): Use correct type for OLE characters. - -2001-05-23 Ben Wing <ben@xemacs.org> - - * event-msw.c (winsock_writer): - * event-msw.c (winsock_closer): - prior kludgy code was clobbering the buffer, thinking it was - "unused" space to store an unneeded return value; instead, use - the variable we've already got staring us in the face. - -2001-05-17 Andy Piper <andy@xemacs.org> - - * sysfile.h: don't assume that file attributes are boolean - -2001-05-23 Ben Wing <ben@xemacs.org> - - * device-msw.c (msprinter_init_device): - signal an error rather than crash with an unavailable network - printer (from Mike Alexander). - - * event-msw.c: - * event-msw.c (struct winsock_stream): - * event-msw.c (winsock_writer): - * event-msw.c (winsock_closer): - * event-msw.c (make_winsock_stream_1): - cleanup headers. fix (hopefully) an error with data corruption - when sending to a network connection. - - * fileio.c (Fexpand_file_name): Fix evil code that attempts - to handle the ~user prefix by (a) always assuming we're referencing - ourselves and not even verifying the user -- hence any file with - a tilde as its first char is invalid! (b) if there wasn't a slash - following the filename, the pointer was set *past* the end of - file and we started reading from uninitialized memory. Now we - simply treat these as files, always. - - * buffer.c (common_init_complex_vars_of_buffer): comment change. - -2001-05-19 Ben Wing <ben@xemacs.org> - - * eval.c: doc comment about gcpro'ing in record_unwind_protect. - - * process-nt.c: - * process-nt.c (vars_of_process_nt): - remove unused mswindows-quote-process-args. rec for 21.4. - -2001-05-12 Ben Wing <ben@xemacs.org> - - * event-msw.c (mswindows_dde_callback): - * event-msw.c (mswindows_wnd_proc): - eliminate cygwin warnings. - -2001-05-06 Ben Wing <ben@xemacs.org> - - * console-msw.h: - * device-msw.c: - * device-msw.c (print_dialog_worker): - * device-msw.c (mswindows_handle_print_dialog_box): - * device-msw.c (syms_of_device_mswindows): - * dialog-msw.c (mswindows_make_dialog_box_internal): - * general-slots.h: - implement printing the selection when it's selected. - -2001-05-20 Drazen Kacar <dave@arsdigita.com> - - * glyphs-gtk.c (gtk_resource_instantiate): C++ comment -> #if 0 - -2001-05-11 Yoshiki Hayashi <yoshiki@xemacs.org> - - * lisp.h (EMACS_INT_MAX): This should be one bit less since - EMACS_INT is signed. - -2001-04-15 Michael Lausch <mla@1012surf.net> - - * scrollbar-gtk.c (gtk_create_scrollbar_instance): Call - gtk_widget_request_size() to give scrollbar >0 width for - GTK >1.2.8. - -2001-05-30 William M. Perry <wmperry@gnu.org> - - * event-gtk.c: Check for buttons as modifier keys. - -2001-05-25 Craig Lanning <CraigL@Knology.net> - - * s\mingw32.h: - Properly find MinGW's <process.h> inside Cygwin's restructured - include directories. Don't try to include <cygwin/version.h> - since we are dropping support for MinGW in versions of Cygwin - earlier than b21. - * nt.c: - Drop support for MinGW in versions of Cygwin before b21. - * sysdep.c: - Properly find MinGW's <process.h> inside Cygwin's restructured - include directories. - * syswindows.h: - Drop support for MinGW in versions of Cygwin before b21. - * unexcw.c: - Even though a.out.h is no longer detected by configure, allow - MinGW to use it until we figure out how to do the job with Win32. - -2001-07-11 Matt Tucker <tuck@whistlingfish.net> - - * syntax.c (find_start_of_comment): - Fix `unbalanced parentheses' bug when dealing with mixed comment - styles in c++/java/etc. mode - -2001-05-29 Mike Alexander <mta@arbortext.com> - - * console-msw.h (FRAME_MSPRINTER_CHARHEIGHT): Unswap - FRAME_MSPRINTER_CHARWIDTH and FRAME_MSPRINTER_CHARHEIGHT - -2001-05-17 Andrew Begel <abegel@eecs.berkeley.edu> - - * lrecord.h (INIT_EXTERNAL_LRECORD_IMPLEMENTATION): Add needed cast. - -2001-03-31 Mike Sperber <mike@xemacs.org> - - * search.c (Freplace_match): Support FSF-style specification of - match subexpression when applied to a buffer. - -2001-05-27 Karl M. Hegbloom <karlheg@hegbloom.net> - - * event-stream.c (is_scrollbar_event): add missing semicolon - -2001-05-22 Isaac Hollander <ysh@mindspring.com> - - * Makefile.in.in: Use TAR macro instead of hardcoding - tar. Allows use of GNU tar instead of system tar - -2001-05-27 Karl M. Hegbloom <karlheg@hegbloom.net> - - * event-stream.c (is_scrollbar_event): add missing semicolon - -2001-05-17 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.3 "Academic Rigor" is released. - -2001-05-17 Stephen J. Turnbull <stephen@xemacs.org> - - * regex.c: Define DECLARE_NOTHING when "lisp.h" is not included. - -2001-05-08 Yoshiki Hayashi <yoshiki@xemacs.org> - - * buffer.c (Vcase_fold_search): Remove obsolete - comment about non ASCII case-fold-search. This - bug has been fixed by case-table changes. - -2001-05-11 Stephen J. Turnbull <stephen@xemacs.org> - - * event-msw.c: Restore include of events-mod.h. - -2001-04-22 zhaoway <zw@debian.org> - - * event-stream.c (is_scrollbar_event): Noop returning 0 if - !HAVE_SCROLLBARS. - -2001-05-10 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.2 "Developer-Friendly Unix APIs" is released. - -2001-05-08 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> - - * mule-charset.c (Fmake_charset): Add missing else. - -2001-04-23 Ben Wing <ben@xemacs.org> - - * event-msw.c (FAKE_MOD_QUIT): - * event-msw.c (mswindows_dequeue_dispatch_event): - * event-msw.c (mswindows_wnd_proc): - * event-msw.c (emacs_mswindows_quit_p): - Get critical quit working. - -2001-05-05 Ben Wing <ben@xemacs.org> - - * console-msw.h: - * device-msw.c: - * device-msw.c (mswindows_get_default_margin): - * frame-msw.c (mswindows_size_frame_internal): - * frame-msw.c (msprinter_init_frame_1): - * frame-msw.c (vars_of_frame_mswindows): - Change top/bottom margin defaults to 0.5 inches. - -2001-05-01 Martin Buchholz <martin@xemacs.org> - - Fix link error with gcc 3.0 on Linux. - * terminfo.c (UP): Remove. - * terminfo.c (BC): Remove. - * terminfo.c (PC): Remove. - They weren't used, and in any case, these symbols should be - defined in the *library*. - -2001-05-03 Martin Buchholz <martin@xemacs.org> - - * s/aix4.h: Fix crash with xlc -O3. - Improve comment explaining how -O3 works. - -2001-04-15 Ben Wing <ben@xemacs.org> - - * event-stream.c: - * event-stream.c (Fnext_event): - * event-stream.c (is_scrollbar_event): - * event-stream.c (execute_command_event): - Better fix for Yoshiki's `C-x @ h <scrollbar-drag> x causes a - crash' problem. His fix introduces other problems. We filter - out scrollbar events specifically, making them somewhat invisible - to command-building, and not appearing in `this-command-keys'. - More work is still needed (see comments in event-stream.c), but - this fixes all the major problems. - -2001-04-20 Ben Wing <ben@xemacs.org> - - * .cvsignore: Added stuff for Windows. - -2001-04-28 Ben Wing <ben@xemacs.org> - - * buffer.c (Ferase_buffer): - * editfns.c (buffer_insert1): - * editfns.c (Finsert_before_markers): - * editfns.c (Finsert_string): - * editfns.c (Finsert_char): - * editfns.c (Fdelete_region): - * editfns.c (Fwiden): - * editfns.c (Fnarrow_to_region): - remove bogus lines setting zmacs_region_stays to 0. - -2001-04-15 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * process-unix.c (unix_open_network_stream): If connect() fails - invalidate file descriptor after closing it. - -2001-03-08 Mike Alexander <mta@arbortext.com> - - * event-msw.c (mswindows_need_event_in_modal_loop): - Don't dispatch a message if we didn't get one. - (mswindows_need_event): - Terminate the correct process when one exits instead of the first - one on Vprocess_list and look for process termination when in - mswindows_protect_modal_loop. - -2001-04-19 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.1 "Copyleft" is released. - -2001-04-19 Glynn Clements <glynn.clements@virgin.net> - - * input-method-motif.c (XIM_delete_frame): New callback. - (XIM_init_frame): Register it. - -2001-04-16 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.4.0 "Solid Vapor" is released. - -2001-04-15 Ben Wing <ben@xemacs.org> - - * cmdloop.c (call_command_loop): - Fix braino in bit-rotting code. - -2001-04-07 Hrvoje Niksic <hniksic@arsdigita.com> - - * extents.c (Fset_extent_endpoints): Force creation of extent info - in buffer_or_string. - - * extents.c (process_extents_for_insertion_mapper): Correctly - check for open-open zero-length extents. - -2001-04-16 Stephen J. Turnbull <stephen@xemacs.org> - - * lisp.h: New typedefs Memory_count, Element_count. - * regex.c: - * regex.h: - Sign-compare warning elimination: several unsigned -> signed. - Based on work by Ben Wing <ben@xemacs.org>. - -2001-04-14 Stephen J. Turnbull <stephen@xemacs.org> - - * XEmacs 21.2.47 "Zephir" is released. - -2001-04-02 Jan Vroonhof <jan@xemacs.org> - - * redisplay.c (add_bufbyte_string_runes): Update data->bytepos - -2001-04-03 Mike Sperber <mike@xemacs.org> - - * search.c: Revert previous patch due because of release. - -2001-03-30 Ben Wing <ben@xemacs.org> - - * s\cygwin32.h: - Add missing killpg prototype. - - * elhash.c: - Add a comment about fixing problems when a new entry is added - while mapping. - - * frame-msw.c (mswindows_init_frame_1): - Fix compile warnings. - - * menubar.c (vars_of_menubar): - Provide `menu-accelerator-support' to indicate that we properly - support %_ in menu specifications, so that package code can - conditionalize on this (and remove %_ from menu specifications - on older versions). - - * event-msw.c: - * scrollbar-msw.c: - * scrollbar-msw.c (can_scroll): - * scrollbar-msw.h: - Fix handling of mouse wheel under Windows to follow standards -- - now scrolls window under pointer, not selected window. - -2001-03-31 Mike Sperber <mike@xemacs.org> - - * search.c (Freplace_match): Support FSF-style specification of - match subexpression when applied to a buffer. - -2001-03-15 Martin Buchholz <martin@xemacs.org> - - * keymap.c (Fmap_keymap): map-keymap explicitly allows a mapping - function to modify KEYMAP, so map over a copy of the hash table. - -2001-03-21 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.46 "Urania" is released. - -2001-03-20 Dan Holmsand <dan@eyebee.com> - - * realpath.c (xrealpath): Make file-truename work with symlinks to - /cygdrive paths on cygwin. Always lowercase drive-letters on - native windows. - (cygwin_readlink): Don't try to find canonical filename unless - file exists. - -2001-03-15 Stephen J. Turnbull <stephen@xemacs.org> - - * ChangeLog: Log GTK merge. - - * dumper.c: - * select-x.c: - * specifier.c: - * symeval.h: - Revert gratuitous whitespace changes from GTK merge. - - * emacs.c: Document end of complex #ifdef @ l. 1495. - - -2001-03-12 Andy Piper <andy@xemacs.org> - - * mingw32.h: unfortunately cygnus changed mingw32 -> mingw so we - have to do likewise. - -2001-03-12 Andy Piper <andy@xemacs.org> - - * sysdep.c: we only support mingw now. - -2001-03-09 Andy Piper <andy@xemacs.org> - - * unexcw.c (copy_executable_and_dump_data_section): making approx - overrun a warning only. - -2001-03-10 William M. Perry <wmperry@aventail.com> - - * faces.c (complex_vars_of_faces): Rewrote the font mucking to - satisfy Stephen's identical-after-cpp plea. - -2001-03-02 Ben Wing <ben@xemacs.org> - - * cmds.c: - * cmds.c (Fforward_char): - * syntax.c: - * window.c: - - Augment documentation of the most common motion commands to make - note of the shifted-motion support. - -2001-03-02 Ben Wing <ben@xemacs.org> - - * nt.c (mswindows_fstat): - * nt.c (mswindows_stat): - * search.c (boyer_moore): - Fix compile warnings under Windows. - - * sysdep.c (sys_readdir): - Fix buggy filename-conversion code under Mule. - -2001-03-09 William M. Perry <wmperry@aventail.com> - - * Makefile.in.in: - * config.h.in: - * console.c: - * console.h: - * device.c: - * device.h: - * dragdrop.c: - * emacs.c: - * event-stream.c: - * events.c: - * events.h: - * faces.c: - * frame.h: - * general-slots.h: - * glyphs.c: - * gutter.c: - * inline.c: - * lisp.h: - * lrecord.h: - * make-src-depend: - * redisplay-output.c: - * redisplay.c: - * symsinit.h: - * sysfile.h: - * toolbar.c: - * window.c: - The Great GTK Merge. - - * ChangeLog.GTK: - * console-gtk.c: - * console-gtk.h: - * device-gtk.c: - * emacs-marshals.c: - * emacs-widget-accessors.c: - * event-gtk.c: - * frame-gtk.c: - * gccache-gtk.c: - * gccache-gtk.h: - * glade.c: - * glyphs-gtk.c: - * glyphs-gtk.h: - * gtk-glue.c: - * gtk-xemacs.c: - * gtk-xemacs.h: - * gui-gtk.c: - * gui-gtk.h: - * menubar-gtk.c: - * native-gtk-toolbar.c: - * objects-gtk.c: - * objects-gtk.h: - * redisplay-gtk.c: - * scrollbar-gtk.c: - * scrollbar-gtk.h: - * select-gtk.c: - * toolbar-gtk.c: - * ui-byhand.c: - * ui-gtk.c: - * ui-gtk.h: - The Great GTK Merge: new files. - -2001-02-26 Ben Wing <ben@xemacs.org> - - Reapplied Lstream change. - -2001-02-26 Ben Wing <ben@xemacs.org> - - Undid the last change, since it is more controversial than I - thought. It should be back in at some point soon. - -2001-02-25 Ben Wing <ben@xemacs.org> - - * buffer.c: - * callproc.c (Fold_call_process_internal): - * event-msw.c (ntpipe_slurp_reader): - * event-msw.c (ntpipe_shove_writer): - * event-msw.c (winsock_reader): - * event-msw.c (winsock_writer): - * file-coding.c: - * file-coding.c (detect_eol_type): - * file-coding.c (detect_coding_type): - * file-coding.c (determine_real_coding_system): - * file-coding.c (Fdetect_coding_region): - * file-coding.c (decoding_reader): - * file-coding.c (decoding_writer): - * file-coding.c (mule_decode): - * file-coding.c (Fdecode_coding_region): - * file-coding.c (encoding_reader): - * file-coding.c (encoding_writer): - * file-coding.c (mule_encode): - * file-coding.c (Fencode_coding_region): - * file-coding.c (detect_coding_sjis): - * file-coding.c (decode_coding_sjis): - * file-coding.c (encode_coding_sjis): - * file-coding.c (detect_coding_big5): - * file-coding.c (decode_coding_big5): - * file-coding.c (encode_coding_big5): - * file-coding.c (detect_coding_ucs4): - * file-coding.c (decode_coding_ucs4): - * file-coding.c (encode_coding_ucs4): - * file-coding.c (detect_coding_utf8): - * file-coding.c (decode_coding_utf8): - * file-coding.c (encode_coding_utf8): - * file-coding.c (detect_coding_iso2022): - * file-coding.c (decode_coding_iso2022): - * file-coding.c (encode_coding_iso2022): - * file-coding.c (decode_coding_no_conversion): - * file-coding.c (encode_coding_no_conversion): - * glyphs-x.c (write_lisp_string_to_temp_file): - * gpmevent.c (tty_get_foreign_selection): - * lisp.h: - * lstream.c: - * lstream.c (Lstream_flush_out): - * lstream.c (Lstream_adding): - * lstream.c (Lstream_write_1): - * lstream.c (Lstream_write): - * lstream.c (Lstream_raw_read): - * lstream.c (Lstream_read_more): - * lstream.c (Lstream_read): - * lstream.c (Lstream_unread): - * lstream.c (Lstream_fputc): - * lstream.c (stdio_reader): - * lstream.c (stdio_writer): - * lstream.c (filedesc_reader): - * lstream.c (filedesc_writer): - * lstream.c (lisp_string_reader): - * lstream.c (struct fixed_buffer_stream): - * lstream.c (make_fixed_buffer_input_stream): - * lstream.c (make_fixed_buffer_output_stream): - * lstream.c (fixed_buffer_reader): - * lstream.c (fixed_buffer_writer): - * lstream.c (struct resizing_buffer_stream): - * lstream.c (resizing_buffer_writer): - * lstream.c (dynarr_writer): - * lstream.c (lisp_buffer_reader): - * lstream.c (lisp_buffer_writer): - * lstream.h: - * lstream.h (lstream_implementation): - * lstream.h (struct lstream): - * md5.c (Fmd5): - * process-nt.c (nt_send_process): - * process-unix.c (unix_send_process): - - Correct Lstream lossage due to mixing of signed and unsigned - quantities. All Lstream uses of size_t and ssize_t are now a - single signed data type Lstream_data_count. This fixes problems - under Windows with sending large quantities of data to a process, - and may well fix other subtle bugs. - -2001-02-23 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.45 "Thelxepeia" is released. - -2001-02-21 Martin Buchholz <martin@xemacs.org> - - * lisp-union.h (XSETINT): - (XSETCHAR): - (XSETOBJ): - Reverse previous change of 2001-02-06. - -2001-02-20 Matt Tucker <tuck@whistlingfish.net> - - Fix `VALID_BYTIND_P' crashes in regex.c when using narrowed - buffers. - * syntax.h (SYNTAX_CACHE_BYTE_TO_CHAR): - * syntax.h (SYNTAX_CACHE_OBJECT_BYTE_TO_CHAR): - Add `BI_BUF_BEGV' to bytepos before calculating bufpos. - * regex.c (POS_AS_IN_BUFFER): removed - * regex.c (re_search_2): - * regex.c (re_match_2): - Don't use an offset of 1 when calculating buffer positions, since - `BI_BUF_BEGV' does it already. - -2001-02-18 Wim Dumon <wim@easics.be> - - * insdel.c (prepare_to_modify_buffer): Also check for - supersession when clash-detection is enabled. - -2001-02-17 Matt Tucker <tuck@whistlingfish.net> - - * regex.c (re_match_2_internal): - Convert temp characters from 'const unsigned char' to 're_char'. - Fix crashing bug with extended characters under mule. - * syntax.c (Qsyntax_table): Moved from vars_of_syntax to - syms_of_syntax. Use defsymbol to define. Fixes hanging bug with - font-lock, pdump, and new syntax-table code. - * syntax.c (find_start_of_comment): - (find_end_of_comment): - (forward-comment): - Fix crashing bugs involving moving beyond end of buffer. - * syntax.c (find_start_of_comment): - Fixed logic to allow proper detection of cases where the same - character is used to end both a two-char comment start and a - two-char comment end sequence. Fixes `(forward-comment -1)'. - * syntax.c (find_start_of_comment): - Return position just past last comment-end character for all cases - (previously was only done for two-char comment-end sequences). - * syntax.c (forward-comment): - Take value returned from `find_end_of_comment', rather than - incrementing it. - * syntax.h (SYNTAX_CACHE_BYTE_TO_CHAR): - Properly deal with BUFFERP (syntax_cache.object) - -2001-02-17 Martin Buchholz <martin@xemacs.org> - - * alloc.c (Fgarbage_collect): - * alloc.c (make_bit_vector_from_byte_vector): - -Wsign-compare-correctness. - -2001-02-16 Martin Buchholz <martin@xemacs.org> - - * lisp-union.h (XSETINT): Eliminate unnecessary temp var. - (XSETCHAR): Likewise. - (XSETOBJ): Likewise. - -2001-02-15 Martin Buchholz <martin@xemacs.org> - - * mule-canna.c (canna-func-delete_previous): - Rename to canna-func-delete-previous. - -2001-02-14 Martin Buchholz <martin@xemacs.org> - - * mule-ccl.c (ccl_driver): Warning suppression. Use countof. - -2001-02-13 Matt Tucker <tuck@whistlingfish.net> - - * font-lock.c (find_context): Fix C++ compile errors introduced by - recent patch - -2001-02-13 Martin Buchholz <martin@xemacs.org> - - * s/aix4.h: Later versions of IBM C compiler need a bug workaround - pragma, but earlier ones barf on the same pragma. - -2001-02-06 Mike Sperber <mike@xemacs.org> - - * emacs.c (complex_vars_of_emacs): Add `mule-lisp-directory' and - `configure-mule-lisp-directory'. - -2001-02-12 Martin Buchholz <martin@xemacs.org> - - Make sure dump-id.c is compiled in the same way as other .c's. - Fixes pdump compilation failure with HP's cc, which defaults to K&R. - * dump-id.h: Remove. - * emacs.c: Move dump-id.h into dumper.h. - * dumper.h: Move dump-id.h into dumper.h. - * Makefile.in.in: - Use standard .c.o rule for building dump-id.o. - Remove preprocessor flags from link command. - Add dump-id.o to ${otherobjs} if PDUMP. - -2001-02-07 Matt Tucker <tuck@whistlingfish.net> - - Port FSF 20.7 syntax table improvements. - * syntax.c. - * syntax.h. - - Fixups for new syntax table stuff. - * dired.c: Include syntax.c. - (Fdirectory_files): Initialize regex_match_object and - regex_emacs_buffer. - * extents.h: EXFUN Fnext_extent_change, Fprevious_extent_change, - and Fget_char_property. - - Use ported FSF 20.7 syntax table improvements. - * font-lock.c. - * regex.c. - * search.c. - -2001-02-09 Martin Buchholz <martin@xemacs.org> - - * regex.c (Boolean): Renamed to `re_bool', to avoid conflict with - Unixware's enum boolean from sys/types.h. - -2001-02-10 Martin Buchholz <martin@xemacs.org> - - Fix support for building with latest Purify. - * Makefile.in.in (PURIFY_LIBS): Remove thread flags. - (PURIFY_FLAGS): Likewise. - -2001-02-09 Martin Buchholz <martin@xemacs.org> - - * fileio.c (lisp_string_set_file_times): New. - * fileio.c (Fcopy_file): Use it. - Fixes bug: - (copy-file filename non-ascii-filename t t) - ==> No such file or directory, non-ascii-filename - -2001-02-10 Martin Buchholz <martin@xemacs.org> - - * glyphs-x.c (generate_cursor_fg_bg): Avoid a warning. - USHRT_MAX seems clearer than ~0 anyways. - -2001-02-09 Martin Buchholz <martin@xemacs.org> - - dumper improvements. Inspired by Olivier. - * dumper.c (pdump_max_align): New. - * dumper.c (pdump_add_entry): Use pdump_max_align. - * dumper.c (pdump_get_entry_list): Likewise. - * dumper.c (pdump_scan_by_alignment): Likewise. - Don't iterate through unnecessary alignments. - * dumper.c (pdump_file_get): No need to align result of malloc(). - * dumper.c (pdump_mallocadr): Remove. - The result of malloc() is guaranteed to be maximally aligned. - * dumper.c: s/elmt/elt/g; - * dumper.c (pdump_object_table): Allocate dynamically, not statically. - * dumper.c (pdump_alert_undump_object): Likewise. - * dumper.c (pdump_align_table): - Don't support alignments > 64. - Store ALIGNOF's, not shift counts, in table. - -2001-02-09 Martin Buchholz <martin@xemacs.org> - - * s/mingw32.h (HAVE_STRUCT_UTIMBUF): Remove. - * s/windowsnt.h (HAVE_STRUCT_UTIMBUF): Remove. - * systime.h: Use HAVE_UTIME. - * sysdep.c (struct utimbuf): Remove. - * sysdep.c (set_file_times): Prefer utime() to utimes(). - * config.h.in (HAVE_UTIME): New. - * config.h.in (HAVE_UTIME_H): Remove. - * config.h.in (HAVE_STRUCT_UTIMBUF): Remove. - -2001-02-09 Martin Buchholz <martin@xemacs.org> - - * s/aix4.h: Hide #pragmas inside #ifndef NOT_C_CODE. - -2001-02-08 Martin Buchholz <martin@xemacs.org> - - * s/irix6-0.h: Use the standard system memmove, not bcopy. - -2001-02-08 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.44 "Thalia" is released. - -2001-02-06 Martin Buchholz <martin@xemacs.org> - - Fixes crashes in kill-emacs on some systems. - * process-unix.c (unix_kill_child_process): - It's OK for kill() to fail with ESRCH. - -2001-02-07 Martin Buchholz <martin@xemacs.org> - - Contortions to make .gdbinit tricks work on most systems. - * alloc.c (dbg_inhibit_dbg_symbol_deletion): Keep debugger info. - * alloc.c (dbg_valmask): Make non-const. - * alloc.c (dbg_typemask): Make non-const. - * alloc.c (dbg_USE_UNION_TYPE): Make non-const. - * alloc.c (dbg_valbits): Make non-const. - * alloc.c (dbg_gctypebits): Make non-const. - * .gdbinit (decode_object): Make it work with AIX cc. - -2001-02-06 Martin Buchholz <martin@xemacs.org> - - * elhash.c (make_general_lisp_hash_table): - Use simpler and more efficient calloc to clear entries. - -2001-02-07 Martin Buchholz <martin@xemacs.org> - - * window.c (window_scroll): Work around an AIX C compiler bug. - Fixes 'scroll-up' does nothing problem with xlC. - -2001-02-05 Martin Buchholz <martin@xemacs.org> - - * .gdbinit: Remove obsolete comment. - -2001-01-31 Mike Alexander <mta@arbortext.com> - - * select.c (Fown_selection_internal): Set owned_p for device - method correctly. - -2001-02-01 Martin Buchholz <martin@xemacs.org> - - Port to g++ 2.97. - "not" cannot be used as a macro name as it is an operator in C++ - * config.h.in: Stop #defining `not'. - * chartab.c (check_category_char): not ==> not_p - * chartab.h: Likewise. - * regex.c (re_match_2_internal): Likewise. - -2001-02-02 Martin Buchholz <martin@xemacs.org> - - * lisp-disunion.h: Fix up comments. - -2001-01-31 Martin Buchholz <martin@xemacs.org> - - * keymap.c (define_key_check_and_coerce_keysym): - (syms_of_keymap): - Support mouse-6 and mouse-7 bindings in the obvious way. - -2001-02-01 Martin Buchholz <martin@xemacs.org> - - * m/hp9000s300.h (UNEXEC): Check for HPUX, not !BSD. - -2001-01-30 Martin Buchholz <martin@xemacs.org> - - Previous patch changing DEFVAR_INT to use EMACS_INT was incomplete. - Previous patch missed DEFVAR_INT_MAGIC. - Make sure future DEFVAR_foo use correct types. - * symeval.h (DEFVAR_SYMVAL_FWD_FIXNUM): New. - * (DEFVAR_SYMVAL_FWD_INT): Add type checking. - * (DEFVAR_SYMVAL_FWD_OBJECT): Add type checking. - * (DEFVAR_INT_MAGIC): Use DEFVAR_SYMVAL_FWD_FIXNUM. - * (DEFVAR_INT): Likewise. - * redisplay.c (vertical_clip): Should be of type Fixnum. - * redisplay.c (horizontal_clip): Likewise. - * lisp.h (dump_add_opaque_int): New. - (dump_add_opaque_fixnum): New. - -2001-01-29 Andy Piper <andy@xemacs.org> - - * glyphs-widget.c (check_valid_int_or_function): allow symbols - since they can be eval'ed - -2001-01-29 Martin Buchholz <martin@xemacs.org> - - * lisp.h (ALIGNOF): Make it work on non-gcc C++ compilers. - Oops, XEmacs redefines `class'. Use `typename' instead. - -2001-01-28 Martin Buchholz <martin@xemacs.org> - - * dumper.c: Fix C++ compile errors. - -2001-01-29 Martin Buchholz <martin@xemacs.org> - - * tparam.c: Use correct prototypes. - -2001-01-28 Martin Buchholz <martin@xemacs.org> - - * sysproc.h: #include util.h for NetBSD's openpty. - -2001-01-27 Martin Buchholz <martin@xemacs.org> - - More 64-bit correctness. - The C value of a DEFVAR_INT should be of type EMACS_INT, not int. - Use a typedef `fixnum' for the type used for DEFVAR_INT. - Fix up comments. - This finally finishes the 64-bit SGI port. - Fixes things like (let ((gc-cons-threshold most-positive-fixnum)) ...). - * symbols.c: Fix up comments and type casts. - * symbols.c (do_symval_forwarding): s/int/Fixnum/g - * symbols.c (store_symval_forwarding): s/int/Fixnum/g - * symeval.h (Fixnum): New type. - * symeval.h (symbol_value_type): Fix up comment. - - * commands.h: - * nt.c: - * emacs.c: - * data.c: - * redisplay.c: - * abbrev.c: - * dired-msw.c: - * event-Xt.c: - * eldap.c: - * window.c: - * sound.c: - * event-stream.c: - * eval.c: - * buffer.c: - * mule-canna.c: A million DEFVAR_INTs here... - * mule-canna.c (count_char): s/int */Fixnum */g in arglist. - * extents.c: - * cmdloop.c: - * lisp.h: - * select-x.c: - * console-x.h: - * event-msw.c: - * mule-wnnfns.c: - * hpplay.c: - * ralloc.c: - * alloc.c: - * keymap.c: - * profile.c: - s/int/Fixnum/g in DEFVAR_INT declarations. - -2001-01-26 Martin Buchholz <martin@xemacs.org> - - Port pdump to SGI alignment-sensitive environment. - Lisp Object sizeof methods now return aligned sizes. Rely on that. - Eliminate is_lrecord since Lisp_Objects sizeof methods are now all - properly aligned. - Define and use aligned reading and writing macros. - Use buffered stdio instead of posix i/o for faster dumping. - Eliminate kludgy 256 byte space for header. - Read and write from dump file using structs for alignment safety. - * dumper.c (pdump_align_stream): New. - * dumper.c (PDUMP_ALIGN_OUTPUT): New. - * dumper.c (PDUMP_READ_ALIGNED): New. - * dumper.c (PDUMP_WRITE_ALIGNED): New. - * dumper.c (pdump_static_Lisp_Object): New struct. - * dumper.c (pdump_static_pointer): New struct. - * dumper.c (pdump_entry_list_element): Remove is_lrecord member. - * dumper.c (pdump_add_entry): Remove is_lrecord parameter. - * dumper.c (pdump_dump_data): Rely on sizeof method alignment. - * dumper.c (pdump_allocate_offset): Rely on sizeof method alignment. - - * dumper.c (pdump_backtrace): - * dumper.c (pdump_get_indirect_count): - * dumper.c (pdump_register_object): - * dumper.c (pdump_register_struct): - * dumper.c (pdump_reloc_one): - * dumper.c (pdump_scan_by_alignment): - * dumper.c (pdump_dump_from_root_struct_ptrs): - * dumper.c (pdump_dump_opaques): - * dumper.c (pdump_dump_rtables): - * dumper.c (pdump_dump_from_root_objects): - * dumper.c (pdump): - * dumper.c (pdump_load_finish): - Use aligned reading and writing. - - * dumper.c (pdump_free): Make static. - * dumper.c (pdump_hFile): Likewise. - * dumper.c (pdump_hMap): Likewise. - -2001-01-26 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.43 "Terspichore" is released. - -2001-01-25 Martin Buchholz <martin@xemacs.org> - - Type fiddling for window_config.saved_windows_count - * window.c (struct window_config): - Make saved_windows_count member unsigned. - * window.c (sizeof_window_config_for_n_windows): - Make parameter unsigned. - * window.c (mark_window_config): - * window.c (window_config_equal): - * window.c (free_window_configuration): - * window.c (Fset_window_configuration): - * window.c (count_windows): - * window.c (Fcurrent_window_configuration): - * window.c (reinit_vars_of_window): - Update all callers and users. - -2001-01-25 Martin Buchholz <martin@xemacs.org> - - Alignment correctness for flexible arrays. - * lisp.h (FLEXIBLE_ARRAY_STRUCT_SIZEOF): - Make alignment-correct. Add interesting comments. - * alloc.c (size_vector): - * alloc.c (make_vector_internal): - * alloc.c (make_bit_vector_internal): - * alloc.c (sweep_bit_vectors_1): - * fns.c (size_bit_vector): - Update all callers of FLEXIBLE_ARRAY_STRUCT_SIZEOF to add new arg. - * window.c (sizeof_window_config_for_n_windows): - Use FLEXIBLE_ARRAY_STRUCT_SIZEOF. - -2001-01-24 Martin Buchholz <martin@xemacs.org> - - * lread.c (read1): Rename `fexp', which is #defined in SGI's math.h - -2001-01-23 Andy Piper <andy@xemacs.org> - - * select.c (Fown_selection_internal): pass owned_p - - * select-msw.c (mswindows_own_selection): New Signature. - - * console.h (struct console_methods): add owned_p to - _own_selection. - - * select-x.c (x_own_selection): pass owned_p - (hack_motif_clipboard_selection): use owned_p - (vars_of_select_x): new variable - - x_selection_strict_motif_ownership. - -2001-01-23 Martin Buchholz <martin@xemacs.org> - - * specifier.h (specifier_data_offset): Remove pointless parens. - * glyphs.h (IMAGE_SPECIFIER_DATA): Likewise. - -2001-01-24 Martin Buchholz <martin@xemacs.org> - - Make Lisp_Object sizeof methods be alignment-correct. - pdump must restore objects to the same alignment as the C compiler - assumes. It really matters on SGIs. - * lstream.c (aligned_sizeof_lstream): New. - (sizeof_lstream): Use aligned_sizeof_lstream. - (Lstream_new): Likewise. - * opaque.c (aligned_sizeof_opaque): New. - (sizeof_opaque): Use aligned_sizeof_opaque. - (make_opaque): Likewise. - * specifier.c (aligned_sizeof_specifier): New. - (sizeof_specifier): Use aligned_sizeof_specifier. - (make_specifier_internal): Likewise. - -2001-01-23 Martin Buchholz <martin@xemacs.org> - - * lstream.h (struct lstream): Use max_align_t for trailing data. - * specifier.h (struct Lisp_Specifier): Likewise. - -2001-01-22 Martin Buchholz <martin@xemacs.org> - - * mule-ccl.c (CCL_Extension): Renamed from CCL_Extention. - (CCL_SUCCESS): Kludge to prevent Sun cc compiler warnings. - (CCL_SUSPEND): Likewise. - (CCL_INVALID_CMD): Likewise. - (CCL_CALL_FOR_MAP_INSTRUCTION): Likewise. - (ccl_driver): Likewise. - (CCL_WRITE_CHAR): Macro hygiene. - (CCL_WRITE_STRING): Macro hygiene. - -2001-01-22 Martin Buchholz <martin@xemacs.org> - - Port "portable" dumper to SunOS 4 and HP-UX. - * s/aix4.h (AIX4): Move MAP_FAILED definition elsewhere. - * emacs.c (main): PDUMP implies no RUN_TIME_REMAP. - * dumper.c (pdump_file_get): Define MAP_FAILED if not already defined. - -2001-01-22 Martin Buchholz <martin@xemacs.org> - - * lisp.h (ALIGNOF): A better definition for C++. - -2001-01-20 Martin Buchholz <martin@xemacs.org> - - Macro hygiene. - Fix printf warnings: int format, long int arg. - * regex.c (DECLARE_DESTINATION): Use DECLARE_NOTHING. - (PUSH_FAILURE_POINT): Use correct printf formats. - (POP_FAILURE_POINT): Use correct printf formats. - Use do {...} while (0) - -2001-01-20 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.42 "Poseidon" is released. - -2001-01-20 Martin Buchholz <martin@xemacs.org> - - * console-x.h: typo fix du jour. Remove #if 0'ed code. - -2001-01-19 Martin Buchholz <martin@xemacs.org> - - De-kludgify FIXED_TYPE free list frobbing. - Fix crashes on 64-bit platforms introduced by my patch of 2001-01-13. - * alloc.c (DECLARE_FIXED_TYPE_ALLOC): Use Lisp_Free. - * alloc.c (ALLOCATE_FIXED_TYPE_1): Use new definitions. - * alloc.c (Lisp_Free): New pseudo lisp object definition. - * alloc.c (LRECORD_FREE_P): New. - * alloc.c (MARK_LRECORD_AS_FREE): New. - * alloc.c (MARK_LRECORD_AS_NOT_FREE): New. - * alloc.c (STRUCT_FREE_P): Deleted. - * alloc.c (MARK_STRUCT_AS_FREE): Deleted. - * alloc.c (MARK_STRUCT_AS_NOT_FREE): Deleted. - * alloc.c (STRING_CHARS_FREE_P): New. - * alloc.c (MARK_STRING_CHARS_AS_FREE): New. - * alloc.c (PUT_FIXED_TYPE_ON_FREE_LIST): Use new definitions. - * alloc.c (FREE_FIXED_TYPE): Use new definitions. - * alloc.c (STRING_CHARS_FREE_P): Use new definitions. - * alloc.c (resize_string): Use new definitions. - * alloc.c (SWEEP_FIXED_TYPE_BLOCK): Use new definitions. - * alloc.c (verify_string_chars_integrity): Use new definitions. - * alloc.c (compact_string_chars): Use new definitions. - * alloc.c: Update monster comments. - * lrecord.h (lrecord_type): Add some new lrecord types for - alloc.c's use. - -2001-01-18 Martin Buchholz <martin@xemacs.org> - - Improve alignment hackery. - * lisp.h (ALIGNOF): Better definition for the non-gcc case. - (max_align_t): Moved from opaque.h - general purpose. - (ALIGN_PTR): Use size_t, not long. - * opaque.h (max_align_t): Move to lisp.h. - -2001-01-18 Norbert Koch <nk@LF.net> - - * gui.h: Fix and add prototypes to fix build problems. - -2001-01-18 Martin Buchholz <martin@xemacs.org> - - temacs is going away, so `dump-temacs' is now a bad name. - * .dbxrc (dump-temacs): Rename to `dmp'. - * .gdbinit (dump-temacs): Rename to `dmp'. - -2001-01-17 Andy Piper <andy@xemacs.org> - - * glyphs.c (print_image_instance): comment to make martin happy. - - * glyphs-x.c (x_redisplay_widget): update faces after a frame - change. - - * glyphs-msw.c (mswindows_redisplay_widget): add code to cope with - activation. - (mswindows_tab_control_redisplay): warning suppression. - - * glyphs-widget.c (widget_update): re-write to cope with updated - items. - (widget_instantiate): use new gui_item functions. - (tab_control_update): deleted. - (progress_gauge_update): deleted. - (image_instantiator_progress_guage): take out update reference. - (image_instantiator_tree_view): ditto. - (image_instantiator_tab_control): ditto. - - * gui.c (widget_gui_parse_item_keywords): new function. Do things - Right the new way. - (gui_item_add_keyval_pair): re-write to cope with descriptors and - return whether anything was changed. - (update_gui_item_keywords): as it sounds. - - * gui.h: declare widget_gui_parse_item_keywords. - - * fns.c (safe_copy_tree): new function taken from Fcopy_tree. - (Fcopy_tree): use it. Stops infloop death in bogus instantiators. - -2001-01-17 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.41 "Polyhymnia" is released. - -2001-01-16 Didier Verna <didier@xemacs.org> - - * glyphs.c (image_instantiate): don't use fallbacks when - instantiating a face's background pixmap by inheritance. - -2001-01-14 Mike Sperber <mike@xemacs.org> - - * sysdep.c (start_of_data): PDUMP implies ORDINARY_LINK. - Conditionalize accordingly. - -2001-01-16 Martin Buchholz <martin@xemacs.org> - - * dumper.c (pdump_file_get): Fix a compiler warning. - -2001-01-15 Martin Buchholz <martin@xemacs.org> - - Make Purify happy when pdumping. - * symbols.c (Fmake_variable_buffer_local): Make Purify happy, by - iniitalizing all bits of new lisp object memory. - * symbols.c (Fmake_local_variable): Likewise. - * symbols.c (Fdontusethis_set_symbol_value_handler): Likewise. - * symbols.c (Fdefvaralias): Likewise. - * mule-charset.c (vars_of_mule_charset): Likewise. - -2001-01-15 Martin Buchholz <martin@xemacs.org> - Add the `-nd' flag when running pre-dump operations under the debugger. - * .dbxrc (run-temacs): Add `-nd'. - * .dbxrc (update-elc): Likewise. - * .dbxrc (dump-temacs): Likewise. - * .gdbinit (run-temacs): Likewise. - * .gdbinit (check-temacs): Likewise. - * .gdbinit (update-elc): Likewise. - * .gdbinit (dump-temacs): Likewise. - -2001-01-14 Martin Buchholz <martin@xemacs.org> - - Allow building 64-bit executables on AIX with GNU malloc, e.g. - export OBJECT_MODE=64 - configure --pdump --use-union-type=no - * m/ibmrs6000.h (DATA_START): Define for 64-bit world. - * gmalloc.c (__default_morecore): Remove pre-ANSI cruft. - - * miscplay.c (sndcnv8U_2mono): - Avoid two uses of `++' in the same expression. - Suppresses a GCC warning. - -2001-01-13 Martin Buchholz <martin@xemacs.org> - - Make sure future compilers don't miscompile alloc.c. - * alloc.c: - (MARK_STRUCT_AS_FREE): Make aliasing-optimization-resistant. - (MARK_STRUCT_AS_NOT_FREE): Make aliasing-optimization-resistant. - -2001-01-12 Martin Buchholz <martin@xemacs.org> - - * dumper.c: A little post-pdump-rename comment fixup. - -2001-01-09 Jerry James <james@eecs.ku.edu> - - * lisp-disunion.h: Change LISP_TO_CVOID arg to match its use. - -2001-01-13 Martin Buchholz <martin@xemacs.org> - - * *.[ch]: Globally rename symbols using the following `pdump-rename' - script: - #!/bin/sh - replace_symbol () { - (findn texi$; findn [ch]$) | xargs g -lw "$1" | xargs global-replace 's/(?<!_)\b'$1'\b(?!_)/'$2'/g' - } - - replace_symbol pdump_wire_lists pdump_weak_object_chains - replace_symbol pdump_wire_list dump_add_weak_object_chain - - replace_symbol pdump_wires pdump_root_objects - replace_symbol pdump_wire dump_add_root_object - - replace_symbol pdump_dump_wired pdump_dump_from_root_objects - replace_symbol pdump_dump_structs pdump_dump_from_root_struct_ptrs - - replace_symbol dumpstructinfos pdump_root_struct_ptrs - replace_symbol dumpstructinfo_dynarr pdump_root_struct_ptr_dynarr - replace_symbol dumpstructinfo pdump_root_struct_ptr - replace_symbol dumpstruct dump_add_root_struct_ptr - - replace_symbol dumpopaque dump_add_opaque - replace_symbol dumpopaqueinfo_dynarr pdump_opaque_dynarr - replace_symbol dumpopaqueinfos pdump_opaques - replace_symbol dumpopaqueinfo pdump_opaque - - replace_symbol nb_structdump nb_root_struct_ptrs - replace_symbol nb_opaquedump nb_opaques - - replace_symbol align_table pdump_align_table - replace_symbol dump_header pdump_header - - replace_symbol DUMP_SIGNATURE_LEN PDUMP_SIGNATURE_LEN - replace_symbol DUMP_SIGNATURE PDUMP_SIGNATURE - - -2001-01-12 Martin Buchholz <martin@xemacs.org> - - * s/aix4.h: Keep the C for AIX compiler from overaggressively - optimizing bytecount_to_charcount(). - -2001-01-06 Golubev I. N. <gin@mo.msk.ru> - - * config.h.in: - (HAVE_DLFCN_H): Removed. - * sysdll.c: Remove HAVE__DLOPEN, HAVE_DLFCN_H. - -2001-01-06 Martin Buchholz <martin@xemacs.org> - - Portable dumper maintainability improvements. - * alloc.c (staticpro): - * alloc.c (staticpro_nodump): - * alloc.c (garbage_collect_1): - * alloc.c (reinit_alloc_once_early): - * alloc.c (init_alloc_once_early): - * alloc.c: Move dumper functions to alloc.c. - * dumper.c (pdump_backtrace): - * dumper.c (pdump_dump_structs): - * dumper.c (pdump_dump_opaques): - * dumper.c (pdump_dump_rtables): - * dumper.c (pdump_dump_wired): - * dumper.c (pdump): - * dumper.c (pdump_load_check): - * dumper.c (pdump_load_finish): - * dumper.c (pdump_file_unmap): - * dumper.c (pdump_file_get): - * dumper.c (pdump_resource_free): - * dumper.c (pdump_resource_get): - * dumper.c (pdump_file_free): - * dumper.c (pdump_file_try): - * dumper.c (pdump_load): - Remove fixed size limits on staticpro(), staticpro_nodump(), - dumpopaque(), dumpstruct() by using Dynarrs instead of static C arrays. - Remove custom code for dumping lrecord_implementations_table - use - dumpopaque instead. - Remove (most of the) custom code for dumping staticpros - dump it - like any other dynarr. - - * alloc.h: Removed. No longer useful, since dumper now more self-contained. - * dumper.c: Moved functions from alloc.c. - * alloc.c (dumpstruct): Moved to dumper.c. - * alloc.c (dumpopaque): Likewise. - * alloc.c (pdump_wire): Likewise. - * alloc.c (pdump_wire_list): Likewise. - - * lisp.h (Dynarr_sizeof): New. - * lisp.h (Dynarr_begin): New. Very slightly C++oid. - * lisp.h (Dynarr_end): New. Very slightly C++oid. - * lisp.h (Lisp_Object_ptr_dynarr): New. For staticpros. - - * lisp.h (dumpstruct): Define to nothing if not PDUMPing. - * lisp.h (dumpopaque): ditto. - * lisp.h (pdump_wire): ditto. - * lisp.h (pdump_wire_list): ditto. - -2001-01-09 Martin Buchholz <martin@xemacs.org> - - * make-src-depend (PrintPatternDeps): - Use `sort' to make output independent of perl version. - -2001-01-08 Martin Buchholz <martin@xemacs.org> - - Port to Netbsd 1.5. - * unexelf.c: Remove (never used) bogus Netbsd-specific cruft. - * s/netbsd.c: Use unexelf.o if __ELF__ is defined. - -2001-01-03 Didier Verna <didier@xemacs.org> - - * event-stream.c (emacs_handle_focus_change_preliminary): ensure - that `focus_frame' is alive before thinking of calling - `redisplay_redraw_cursor' on it. - -2001-01-08 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.40 is released. - -2001-01-06 Golubev I. N. <gin@mo.msk.ru> - - * regex.c: Replace PREFETCH with REGEX_PREFETCH. - -2001-01-06 Martin Buchholz <martin@xemacs.org> - - * alloc.c (dbg_valmask): Make const. - * alloc.c (dbg_typemask): Make const. - * alloc.c (dbg_USE_UNION_TYPE): Make const. - * alloc.c (dbg_valbits): Make const. - * alloc.c (dbg_gctypebits): Make const. - -2001-01-06 Stephen J. Turnbull <stephen@xemacs.org> - - * redisplay-x.c (x_bevel_area): - redisplay.h (struct rune): - Typo fixes in comments. - -2001-01-05 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_redisplay_widget): use size changed for offset - adjustment. - - * menubar.c (menubar_visible_p_changed): don't mark frame changed. - -2001-01-05 Martin Buchholz <martin@xemacs.org> - - * alloc.c (pure-bytes-used): Remove unused mendacious variable. - - * mule-ccl.c (stack_idx_of_map_multiple): - Non const global data must not be initialized! - Found by MIYASHITA Hisashi. - -2001-01-02 Andy Piper <andy@xemacs.org> - - * frame.c (change_frame_size): make sure frame size is always - marked as changed. - - * glyphs.c (image_instance_layout): minor code reuse. - - * window.c (Fcurrent_window_configuration): revert previous - change. - -2001-01-02 Martin Buchholz <martin@xemacs.org> - - * glyphs.h: - * glyphs.c (make_image_instance_cache_hash_table): Use ANSI prototypes. - -2000-12-31 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_unmap_subwindow): return focus to enclosing frame - when widget gets unmapped. - - * event-Xt.c (emacs_Xt_handle_widget_losing_focus): new - function. Make sure widgets losing focus don't just drop it. - (handle_focus_event_1): record the widget with focus. - -2000-12-31 Andy Piper <andy@xemacs.org> - - * window.c (allocate_window): use - make_image_instance_cache_hash_table. - (make_dummy_parent): ditto. - (Fset_window_configuration): ditto. - - * glyphs.h (INSTANTIATOR_TYPE): new macro. declare new functions. - - * glyphs.c (process_image_string_instantiator): use - INSTANTIATOR_TYPE. - (get_image_instantiator_governing_domain): ditto. - (normalize_image_instantiator): ditto. - (instantiate_image_instantiator): ditto. - (make_image_instance_1): ditto. - (image_instantiate): ditto. Key on glyph *and* instantiator type. - (instantiator_eq_equal): new function for use with instance hash - tables. - (instantiator_eq_hash): ditto. - (make_image_instance_cache_hash_table): create a suitable hash - table for storing image instances. - - * elhash.h (hash_table_weakness): new internal weakness type - HASH_TABLE_KEY_CAR_VALUE_WEAK. - declare new functions. - - * elhash.c (finish_marking_weak_hash_tables): introduce yet - another weakness type for glyphs. - (make_standard_lisp_hash_table): new function split out from - make_general_lisp_hash_table. - (make_lisp_hash_table): call make_standard_lisp_hash_table. - (hash_table_instantiate): ditto. - (Fmake_hash_table): ditto. - -2000-12-31 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.39 is released. - -2000-12-29 Andy Piper <andy@xemacs.org> - - * menubar.c (menubar_visible_p_changed): signal the frame changed. - - * glyphs-x.c (x_redisplay_widget): Re-calculate widget offsets if - the frame has changed so that we pick up geometry changes such as - menubar visibility. - -2000-12-28 Andy Piper <andy@xemacs.org> - - * lastfile.c (my_ebss): make a char array so we can pad the - bss. Fixes cygwin unexec. - - * unexcw.c: invert BROKEN_GDB to NO_DEBUG. - -2000-12-26 Andy Piper <andy@xemacs.org> - - * event-Xt.c (emacs_Xt_force_event_pending): add some verbose - comments and try and be more precise about a non-/SIGIO world. - (emacs_Xt_event_pending_p): use XtAppPending under cygwin and non - SIGIO. - - * redisplay-output.c (redisplay_normalize_glyph_area): make sure - we don't normalize to zero width or height. - -2000-12-24 Andy Piper <andy@xemacs.org> - - * Makefile.in.in (ldflags): add -mwindows when appropriate. - -2000-08-18 Golubev I. N. <gin@mo.msk.ru> - - * s/sco5.h: SCO 5 has pty support. - -2000-07-20 Kazuyuki IENAGA <ienaga@xemacs.org> - - * input-method-xlib.c: supports both XIM_XLIB and USE_XFONTSET. - input-method-xlib.c contains whole contents of input-method-xfs.c, - so we can use input-method-xlib.c's code for USE_XFONTSET - using #ifdefs. - * input-method-xfs.c: removed. - -2000-12-20 Stephen Turnbull <stephen@xemacs.org> - - * file-coding.h (enum coding_category_type): reorder enumerators to - make autodetection safer. Make CODING_CATEGORY_LAST an enumerator - (now one greater than largest real coding_category_type enumerator). - * file-coding.c (coding_category_symbol, coding_category_by_priority, - coding_category_system, fcd_descriptihon_1, decode_coding_category, - Fcoding_category_list, Fset_coding_priority_list, - Fcoding_priority_list, coding_system_from_mask, Fdetect_coding_region, - vars_of_file_coding): adjust for change in CODING_CATEGORY_LAST. - -2000-12-18 Yoshiki Hayashi <yoshiki@xemacs.org> - - * redisplay-output.c (redisplay_clear_top_of_window): Remove static. - * redisplay-output.c (redisplay_output_window): Clear top of window - when face is changed. - * redisplay-x.c (x_redraw_exposed_window): Call - redisplay_clear_top_of_window. - * redisplay.h: Publish redisplay_clear_top_of_window. - -2000-12-18 Yoshiki Hayashi <yoshiki@xemacs.org> - - * buffer.c (Fkill_buffer): Map over all devices. - * window.c (window_loop): Remove UNSHOW_BUFFER code. - (list_windows): New function. - (list_all_windows): Ditto. - (Freplace_buffer_in_windows): Use them. - -2000-02-02 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> - - * database.c (berkdb_subtype): Recognize new subtype `queue'. - (Fopen_database): Use `db_create' instead of `db_open'. - (syms_of_database): Initialize Qqueue. - -2000-12-13 Yoshiki Hayashi <yoshiki@xemacs.org> - - * buffer.c (common_init_complex_vars_of_buffer): Initialize - buffer_local_face_property. - * buffer.h (struct buffer): New member buffer_local_face_property. - * window.c (Fset_window_buffer): Mark window's face as changed - when buffer has buffer local face. - * window.h (MARK_WINDOW_FACES_CHANGED): New macro. - * objects.c (color_after_change): Set buffer_local_face_property - when locale of face specifier is buffer. - * objects.c (font_after_change): Ditto. - * objects.c (face_boolean_after_change): Ditto. - * glyphs.c (image_after_change): Ditto. - -2000-12-09 Dan Holmsand <dan@eyebee.com> - - * nt.c (mswindows_fstat): Report file permissions, volume serial - number, etc. Code adapted from FSF Emacs 20.7. - -2000-12-09 Dan Holmsand <dan@eyebee.com> - - * sysfile.h (lstat): Make lstat an alias for xemacs_stat instead - of stat when we don't have symbolic links, to make sure - mswindows_stat is called on mswindows. - -2000-12-12 Yoshiki Hayashi <yoshiki@xemacs.org> - - * alloca.c: Define malloc to xmalloc only when built with XEmacs. - -2000-12-12 Martin Buchholz <martin@xemacs.org> - - * doprnt.c (emacs_doprnt_1): More printing fixes. - Make printing of numbers compatible with libc and FSF Emacs. - BUG was: (format "%6.3f" 1.2) ==>"1.200000" - Use the system printf to do most of the hard work of formatting, - instead of doprnt_1(). - Calculate memory to allocate for format string. - Remove arbitrary limit on precision, e.g. (format "%.1000f" 3.14) - (doprnt_1): Cleaner code and documentation. - -2000-12-01 Jerry James <james@eecs.ukans.edu> - - * Makefile.in.in: Use the loop variable to install headers. - -2000-12-04 Yoshiki Hayashi <yoshiki@xemacs.org> - - * window.c (Fsplit_window): Don't invalidate face cache. - -2000-12-04 Yoshiki Hayashi <yoshiki@xemacs.org> - - * minibuf.c (Fall_completions): Undo the previous change - which removed checking elements start with space. - -2000-12-06 Stephen Turnbull <stephen@xemacs.org> - - * mule-canna.c: Didier suppression. - -2000-12-06 Stephen Turnbull <stephen@xemacs.org> - - * mule-canna.c: rename static unsigned char buf[] to key_buffer - (warning suppression). Add English comment translations. - -2000-12-05 Martin Buchholz <martin@xemacs.org> - - * unexelfsgi.c (unexec): Better test for mmap failure. - -2000-12-05 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.38 is released. - -2000-12-05 Martin Buchholz <martin@xemacs.org> - - * redisplay.c (bar-cursor): Make a user variable. - - * symsinit.h: Add init_postgresql_from_environment. - -2000-12-04 Yoshiki Hayashi <yoshiki@xemacs.org> - - * regex.c: Convert to clean C. - -2000-12-05 Dan Holmsand <dan@eyebee.com> - - * realpath.c: - Don't #include sysfile.h. Revert to duplicating PATH_MAX - initialization. - (sys_readlink): renamed to system_readlink to avoid conflict with - the other sys_readlink. - -2000-12-04 Hiroaki Abe <h-abe@pc.highway.ne.jp> - - * dumper.c (pdump_file_get): Correct uses of pdump_fd. - -2000-12-04 Stephen J. Turnbull <stephen@xemacs.org> - - * postgresql.c (init_postgresql_from_environment): new function. - (vars_of_postgresql): Move code initializing Lisp variables out and - into init_postgresql_from_environment. - emacs.c (main_1): Call init_postgresql_from_environment if and only - if running a dumped XEmacs. - -2000-08-31 Dan Holmsand <dan@eyebee.com> - - * buffer.c: Make find-file-compare-truenames default to true on - windows. - - * realpath.c (win32_abs_start): - (cygwin_readlink): - (win32_readlink): New functions. - (xrealpath): Return really real filenames on windows. - - * fileio.c (Ffile_truename): Make file-truename work on windows. - -2000-11-29 Didier Verna <didier@xemacs.org> - - * faces.c (MAYBE_UNFROB_BACKGROUND_PIXMAP): new macro. - * faces.c (update_face_cachel_data): use it. - * faces.c (add_face_cachel): use it. Complete background pixmap - frobbing in face cache if `update_face_cachel_data' has not done so. - -2000-11-29 Yoshiki Hayashi <yoshiki@xemacs.org> - - * search.c (string_match_1): Don't set last_thing_searched - when search failed. - -2000-11-27 Yoshiki Hayashi <yoshiki@xemacs.org> - - * buffer.c: Include casetab.h - (common_init_complex_vars_of_buffer): Use new case-table object. - * buffer.h: Include casetab.h - * buffer.h (MAKE_TRT_TABLE): Use generic char-table. - (DOWNCASE_TABLE_OF): Ditto. - * bufslots.h: Remove char-tables and add case-table. - * casetab.c: Include casetab.h - (CASE_TABLE_P): Removed. - (mark_case_table): New function. - (allocate_case_table): New function. - (Fcase_table_p): Use new case-table. - (case_table_char): New function. - (Fget_case_table): Ditto. - (Fput_case_table): Ditto. - (Fput_case_table_pair): Ditto. - (Fcopy_case_table): Ditto. - (Fcurrent_case_table): Return case-table. - (Fstandard_case_table): Return case-table. - (Fset_case_table): Fix doc-string. - (set_case_table): Use case-table - (syms_of_casetab): DEFSUBR new functions. - (complex_vars_of_casetab): Set up standard case-table. - * casetab.h: New file. - * editfns.c: Include casetab.h - (Fcompare_buffer_substrings): Use case-table. - * inline.c: Include casetab.h - * lisp.h: Remove bogus extern. - * lrecord.h (lrecord_type): Add lrecord_type_case_table. - * search.c: Include casetab.h - (TRANSLATE_ASCII): Removed. - (TRANSLATE): Unconditionally translate character. - (looking_at_1): Use case-table. - (string_match_1): Ditto. - (fast_string_match): Ditto. - (search_command): Ditto. - (search_buffer): Separate boyer_moore. Check whether - boyer_moore is possible. - (simple_search): New function. - (boyer_moore): Separated from search_buffer. Translate char. - -2000-11-24 Yoshiki Hayashi <yoshiki@xemacs.org> - - * regex.c (RE_TR_ASCII): Removed. - (RE_TRANSLATE): Unconditionally use TRT_TABLE. - (PATFETCH): Call PATFETCH_RAW. - (PATFETCH_RAW): Fetch Emchar. - (PATUNFETCH): Decrement charptr. - (GET_BUFFER_SPACE): Rename b to buf_end. - (BUF_PUSH): Ditto. - (BUF_PUSH_2): Ditto. - (BUF_PUSH_3): Ditto. - (EXTEND_BUFFER): Ditto. - (SET_LIST_BIT): Ditto. - (regex_compile): Ditto. Translate non ASCII char. - (compile_range): Ditto. - (re_search_2): Ditto. - (re_match_2_internal): Compare Emchar. - (bcmp_translate): Ditto. - -2000-11-29 Stephen J. Turnbull <turnbull@xemacs.org> - - * lisp.h (basic char/int typedefs): comment improvement. - -2000-11-24 Stephen J. Turnbull <turnbull@xemacs.org> - - * emacs.c (main_1): unconditional pdump unstomping; don't save and - unstomp inhibit_site_lisp. Improve comments. - -2000-11-22 Stephen J. Turnbull <turnbull@xemacs.org> - - * mule-charset.c (Fcharset_property): improve type checking, comments. - -2000-11-28 Andy Piper <andy@xemacs.org> - - * redisplay-output.c (redisplay_output_subwindow): make sure we do - clipped display for windows in the gutter also. - (redisplay_display_boxes_in_window_p): change semantics of return - codes to be more intuitive. - - * gutter.h: declare display_boxes_in_gutter_p. - - * gutter.c (display_boxes_in_gutter_p): new function for - redisplay. - -2000-11-22 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (image_instantiator_format_create_glyphs_x): change - autodetect domain. - -2000-11-21 Yoshiki Hayashi <yoshiki@xemacs.org> - - * callproc.c (Fold_call_process_internal): - * gpm.c (Freceive_gpm_event): - (tty_get_foreign_selection): Might be just warning supression. - * fileio.c (Fwrite_region_internal): - (Fset_visited_file_modtime): - * keymap.c (event_matches_key_specifier_p): - Initialize GCPROed variable. - - * menubar-x.c (command_builder_find_menu_accelerator): - Initialize before use. - -2000-11-23 Andy Piper <andy@xemacs.org> - - * unexcw.c (unexec): make the resulting executable executable. - -2000-11-21 Martin Buchholz <martin@xemacs.org> - - * doc.c (get_doc_string): - Use size_t, not int, for result of XSTRING_LENGTH. - - * cmds.c (Fdelete_char): - * cmds.c (Fpoint_at_eol): - * cmds.c (Fself_insert_command): - Use EMACS_INT, not int, for result of XINT. - Someday, someone will want to insert more than 2**31 identical characters. - - * cmds.c (Fdelete_char): - * cmds.c (Fdelete_backward_char): - * syntax.c (Fforward_word): - * syntax.c (Fforward_comment): - Make COUNT argument optional, for consistency with forward-char et al. - -2000-11-22 Martin Buchholz <martin@xemacs.org> - - * lisp.h: - * print.c (long_to_string): - Return a useful value: the pointer at end of data written. - - * doprnt.c: - Use `static const char * const' for constant strings. - (union printf_arg): Delete `i', `ui' members. - (get_doprnt_args): - (emacs_doprnt_1): - Fix LP64 platform bug: (format "%d" most-positive-fixnum) ==> "-1" - Do all printf-ing via the `l' specifier. - Use EMACS_INT instead of int. - Optimize. - -2000-11-20 Didier Verna <didier@xemacs.org> - - * faces.c (update_face_cachel_data): don't frob the background - pixmap when the window is being created. The face is needed but - does not exist yet. - -2000-11-20 Andy Piper <andy@xemacs.org> - - * unexcw.c (copy_executable_and_dump_data_section): Only do bss - messing with a debug environment. - -2000-11-20 Martin Buchholz <martin@xemacs.org> - - * emacs.c (__sti__iflPNGFile_c___): Pedantically correct prototype. - -2000-11-20 Martin Buchholz <martin@xemacs.org> - - * casetab.c (Fcase_table_p): Fix compile error and crash. - -2000-11-18 Philip Aston <philipa@mail.com> - - * s/cygwin32.h: Cygwin has SVR4-like pty support. - -2000-11-18 Martin Buchholz <martin@xemacs.org> - - * fileio.c (Fexpand_file_name): GCPRO bug! Protect `handler'. - * filelock.c (lock_file): GCPRO bug! Initialize all GCPROed vars! - -2000-11-17 Martin Buchholz <martin@xemacs.org> - - * config.h.in: Define HAVE_ELF_H if elf.h exists. - * unexelf.c: Use HAVE_ELF_H. - * unexelfsgi.c: Fix bug with dumped xemacs stdout/stderr not working. - I copied FSF Emacs 20.7 unexelf.c to unexelfsgi.c and ANSIfied it. - Max Matveev <makc@sgi.com> removed non-SGI-relevant parts and tested. - Greg Harrington <greg_harrington@hotmail.com> provided a machine - for testing. - So this is an unexelfsgi.c from a different line of development. - -2000-11-16 Yoshiki Hayashi <yoshiki@xemacs.org> - - * regex.c (RE_TR_ASCII): New function. - (RE_TRANSLATE): Call it. - -2000-11-16 Yoshiki Hayashi <yoshiki@xemacs.org> - - * buffer.h (TRT_TABLE_OF): Remove assert. - (IN_TRT_TABLE_DOMAIN): Removed. - -2000-11-16 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * free-hook.c (log_gcpro): - (show_gcprohist): Add support for GCPRO5. - -2000-11-08 Stephen J. Turnbull <stephen@xemacs.org> - - * emacs.c (main_1): Improve -sd error message when --pdump=no. - -2000-11-16 Olivier Galibert <galibert@xemacs.org> - - * symeval.h: Declare flush_all_buffer_local_cache. - - * symbols.c: Change XD_LO_RESET_NIL into XD_LISP_OBJECTs. - (flush_buffer_local_cache): Added. - (flush_all_buffer_local_cache): Added. - - * lrecord.h: Remove unused XD_LO_RESET_NIL. - - * dumper.c (pdump_register_sub): Remove unused XD_LO_RESET_NIL. - (pdump_dump_data): Ditto. - (pdump_reloc_one): Ditto. - (pdump): Remove unused pdump_qnil. Flush buffer local caches - before dumping. - - -2000-11-14 Yoshiki Hayashi <yoshiki@xemacs.org> - - * buffer.c: Remove if 0'ed entry. - * buffer.h: Rewrite TRT to use char-table. - * bufslots.h: Remove mirror tables. - * casetab.c: Remove mirror tables. - (CASE_TABLE_P): New macro. - (Fcase_table_p): Element of a case table is string or char-table. - (make_mirror_trt_table): Removed. - (set_case_table): Setup char-table from strings for backward - compatibility. - * dired.c (Fdirectory_files): - * dired-msw.c: (mswindows_get_files): - * lisp.h: Change prototype of re_pattern_buffer. - * regex.c: (RE_TRANSLATE): New macro. - (TRANSLATE_P): Ditto. - Change translate to type RE_TRANSLATE_TYPE. - * regex.h: Define RE_TRANSLATE_TYPE - * search.c (TRANSLATE): New macro. - (TRANSLATE_ASCII): New macro. - Translate table is changed to Lisp_Object. - (signal_failure): Inhibit return. - -2000-11-14 Yoshiki Hayashi <yoshiki@xemacs.org> - - * device-msw.c: - * eldap.c: - * event-Xt.c: - * event-stream.c: - * print.c: - Do UNGCPRO before return. - -2000-11-14 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.37 is released. - -2000-11-13 Yoshiki Hayashi <yoshiki@xemacs.org> - - * fileio.c (Finsert_file_contents_internal): UNGCPRO before return. - Add comments about discarded return value. - -2000-11-09 Yoshiki Hayashi <yoshiki@xemacs.org> - - * callint.c: - * event-stream.c: Fix comments. Remove some #if 0'ed part. - -2000-10-27 Andy Piper <andy@xemacs.org> - - * gutter.c (Fset_default_gutter_position): default left and right - gutters to visible. - (calculate_gutter_size): calculate resonable heuristic for left - and right gutter sizes. - (specifier_vars_of_gutter): change left and right gutter sizes to - autodetect. - (calculate_gutter_size_from_display_lines): new function. - (output_gutter): check for resizing on left and right gutters. - (clear_gutter): don't special case top and left gutters. - (specifier_vars_of_gutter): use new signature for - set_specifier_caching. - - * glyphs-x.c (x_redisplay_widget): spelling fix. - * glyphs.c (specifier_vars_of_glyphs): - * menubar.c (specifier_vars_of_menubar): - * redisplay.c (specifier_vars_of_redisplay): - * toolbar.c (specifier_vars_of_toolbar): - * window.c (specifier_vars_of_window): - * scrollbar.c (specifier_vars_of_scrollbar): - (complex_vars_of_scrollbar): use new signature for - set_specifier_caching. - - * specifier.c (set_specifier_caching): include recompute flag. - (recompute_one_cached_specifier_in_window): always recompute if - flag set. - (recompute_one_cached_specifier_in_frame): ditto. - - * specifier.h (struct specifier_caching): add recompute flag. - -2000-10-24 Andy Piper <andy@xemacs.org> - - * unexcw.c (copy_executable_and_dump_data_section): add new - BSS_PAD_SIZE so that we can re-instate a mini-bss. This keeps gdb - 5.0 happy. - -2000-11-06 Yoshiki Hayashi <yoshiki@xemacs.org> - - * console-x.h (x_device): New member modifier_release_time. - * event-Xt.c (x_handle_sticky_modifiers): - Bound interval modifier keys are sticky. - * event-stream.c (Vmodifier_keys_sticky_time): New variable. - * events.h: extern it. - -2000-11-06 Yoshiki Hayashi <yoshiki@xemacs.org> - - * cmdloop.c (Fcommand_loop_1): Just add C-g to event queue. - -2000-11-06 Yoshiki Hayashi <yoshiki@xemacs.org> - - * event-stream.c (execute_command_event): Preserve current_events - and the like when event is misc-user-event. - Inhibit quit during the call to maybe_echo_keys. - -2000-10-31 Yoshiki Hayashi <yoshiki@xemacs.org> - - * filelock.c (lock_buffer): Cope with kill-buffer. Don't create a - symlink when buffer is killed. - (inhibit_clash_detection): New variable. - -2000-10-30 Yoshiki Hayashi <yoshiki@xemacs.org> - - * console.c (Fset_input_method): Trigger redisplay on tty. - -2000-11-07 Martin Buchholz <martin@xemacs.org> - - * process.c (Fprocess_status): Revert to previous behavior: - (process-status "nosuchprocess") ==> nil - -2000-11-06 Martin Buchholz <martin@xemacs.org> - - * mule-charset.h (CHARSET_BY_LEADING_BYTE): - Work around another GCC 2.95.2 optimizer bug. - -2000-11-02 Martin Buchholz <martin@xemacs.org> - - * process.c (Fget_process): Use LIST_LOOP_2. - (kill_buffer_processes): Use LIST_LOOP_2. - - * minibuf.c (Fall_completions): - Delete old non-functional code for FSF fourth argument. - - * frame.c (frame_matches_frame_spec): - Renamed from `frame_matches_frametype'. Update all callers. - (device_matches_device_spec): - Renamed from 'device_matches_console_spec'. Update all callers. - - * doc.c (Fsubstitute_command_keys): - Remove buffer overflow crash. Small code cleanups. - - * casetab.c (check_case_table): Simpler code. - - * window.c (Freplace_buffer_in_windows): - Give this the same WHICH-FRAMES and WHICH-DEVICES parameters - (and similar implementation) as Fdelete_windows_on. - Update all callers. - - * alloc.c (Fmake_list): - * alloc.c (make_vector): - * alloc.c (Fmake_vector): - * alloc.c (make_bit_vector): - * alloc.c (Fmake_bit_vector): - * alloc.c (Fbit_vector): - * alloc.c (Fmake_string): - * alloc.c (Fpurecopy): - * alloc.c (Fmemory_limit): - * buffer.c: - * buffer.c (Fget_buffer): - * buffer.c (Fkill_buffer): - * buffer.c (complex_vars_of_buffer): - * bytecode.c (Fcompiled_function_stack_depth): - * callint.c (Fprefix_numeric_value): - * event-stream.c: - * event-stream.c (Fread_key_sequence): - * casetab.c: - * casetab.c (Fcase_table_p): - * casetab.c (check_case_table): - * casetab.c (Fset_case_table): - * casetab.c (Fset_standard_case_table): - * chartab.c: - * chartab.c (Fchar_table_type): - * chartab.c (Freset_char_table): - * chartab.c (Fget_char_table): - * chartab.c (Fget_range_char_table): - * chartab.c (Fput_char_table): - * chartab.c (Fmap_char_table): - * chartab.c (Fcategory_table_p): - * chartab.c (Fcheck_category_at): - * chartab.c (Fchar_in_category_p): - * chartab.c (Fcategory_table): - * chartab.c (Fcopy_category_table): - * chartab.c (Fset_category_table): - * chartab.c (Fcategory_designator_p): - * chartab.c (Fcategory_table_value_p): - * cmds.c (Fdelete_char): - * cmds.c (Fdelete_backward_char): - * cmds.c (Fself_insert_command): - * cmds.c (Fself_insert_internal): - * console.c (Fvalid_console_type_p): - * console.c (Fcdfw_console): - * console.c (Fconsole_type): - * console.c (Fconsole_name): - * console.c (Fconsole_device_list): - * console.c (Fconsole_on_window_system_p): - * data.c: - * data.c (Feq): - * data.c (Fold_eq): - * data.c (Fsubr_interactive): - * data.c (Fchar_to_int): - * data.c (Fint_to_char): - * data.c (Fsetcar): - * data.c (Fsetcdr): - * data.c (Fnumber_to_string): - * data.c (Fstring_to_number): - * data.c (Frem): - * database.c (mark_database): - * database.c (finalize_database): - * database.c (Fdatabase_live_p): - * database.c (Fdatabasep): - * device-x.c (Fx_get_resource): - * device.c (Fdfw_device): - * dired.c: - * dired.c (Ffile_name_completion): - * dired.c (Ffile_name_all_completions): - * dired.c (Fuser_name_completion): - * dired.c (Fuser_name_completion_1): - * dired.c (Fuser_name_all_completions): - * doc.c (Fdocumentation): - * doc.c (Fdocumentation_property): - * doc.c (Fsubstitute_command_keys): - * editfns.c: - * editfns.c (Fchar_to_string): - * editfns.c (Fstring_to_char): - * editfns.c (Ftemp_directory): - * editfns.c (Finsert_char): - * editfns.c (Fbuffer_substring_no_properties): - * editfns.c (Fnarrow_to_region): - * editfns.c (Fchar_equal): - * editfns.c (Fchar_Equal): - * editfns.c (Ftranspose_regions): - * emacs.c (Fdump_emacs): - * eval.c (Fthrow): - * eval.c (Fcommand_execute): - * eval.c (Fautoload): - * eval.c (Fbacktrace): - * eval.c (Fbacktrace_frame): - * events.c: - * events.c (Fcopy_event): - * events.c (Fcharacter_to_event): - * events.c (Fevent_button): - * events.c (Fevent_process): - * extents.c: - * extents.c (Fnext_extent_change): - * extents.c (Fextent_property): - * faces.c (Ffacep): - * faces.c (Fmake_face): - * file-coding.c: - * file-coding.c (Fencode_shift_jis_char): - * file-coding.c (Fencode_big5_char): - * fileio.c (Ffile_name_directory): - * fileio.c (Ffile_name_nondirectory): - * fileio.c (Ffile_name_as_directory): - * fileio.c (Fdirectory_file_name): - * fileio.c (Ffile_truename): - * fileio.c (Fsubstitute_in_file_name): - * fileio.c (Ffile_modes): - * fileio.c (Fset_file_modes): - * fileio.c (Fset_default_file_modes): - * fileio.c (Fverify_visited_file_modtime): - * floatfns.c (Facos): - * floatfns.c (Fasin): - * floatfns.c (Fatan): - * floatfns.c (Fcos): - * floatfns.c (Fsin): - * floatfns.c (Ftan): - * floatfns.c (Fbessel_j0): - * floatfns.c (Fbessel_j1): - * floatfns.c (Fbessel_jn): - * floatfns.c (Fbessel_y0): - * floatfns.c (Fbessel_y1): - * floatfns.c (Fbessel_yn): - * floatfns.c (Ferf): - * floatfns.c (Ferfc): - * floatfns.c (Flog_gamma): - * floatfns.c (Fexp): - * floatfns.c (Fexpt): - * floatfns.c (Flog): - * floatfns.c (Flog10): - * floatfns.c (Fsqrt): - * floatfns.c (Fcube_root): - * floatfns.c (Facosh): - * floatfns.c (Fasinh): - * floatfns.c (Fatanh): - * floatfns.c (Fcosh): - * floatfns.c (Fsinh): - * floatfns.c (Ftanh): - * floatfns.c (Fabs): - * floatfns.c (Ffloat): - * floatfns.c (Flogb): - * floatfns.c (Fceiling): - * floatfns.c (Ffloor): - * floatfns.c (Fround): - * floatfns.c (Ftruncate): - * floatfns.c (Ffceiling): - * floatfns.c (Fffloor): - * floatfns.c (Ffround): - * floatfns.c (Fftruncate): - * fns.c (Fstring_equal): - * fns.c (Fstring_lessp): - * fns.c (concat2): - * fns.c (concat3): - * fns.c (vconcat2): - * fns.c (vconcat3): - * fns.c (Fsubstring): - * fns.c (Fassoc): - * fns.c (Fold_assoc): - * fns.c (assoc_no_quit): - * fns.c (Fassq): - * fns.c (Fold_assq): - * fns.c (assq_no_quit): - * fns.c (Frassoc): - * fns.c (Fold_rassoc): - * fns.c (Frassq): - * fns.c (Fold_rassq): - * fns.c (rassq_no_quit): - * fns.c (Fremassoc): - * fns.c (remassoc_no_quit): - * fns.c (Fremassq): - * fns.c (remassq_no_quit): - * fns.c (Fremrassoc): - * fns.c (Fremrassq): - * fns.c (remrassq_no_quit): - * fns.c (Fsort): - * fns.c (Fplist_get): - * fns.c (Fplist_put): - * fns.c (Fplist_remprop): - * fns.c (Fplist_member): - * fns.c (Flax_plist_get): - * fns.c (Flax_plist_put): - * fns.c (Flax_plist_remprop): - * fns.c (Flax_plist_member): - * fns.c (Fequal): - * fns.c (Fold_equal): - * fns.c (Frequire): - * fns.c (Fbase64_encode_region): - * fns.c (Fbase64_encode_string): - * fns.c (Fbase64_decode_region): - * frame.c: - * frame.c (frame_matches_frame_spec): - * frame.c (device_matches_device_spec): - * frame.c (next_frame): - * frame.c (previous_frame): - * frame.c (Fnext_frame): - * frame.c (Fprevious_frame): - * frame.c (Fframe_property): - * frame.c (Fset_frame_height): - * frame.c (Fset_frame_size): - * frame.h: - * glyphs.c: - * glyphs.c (if): - * glyphs.c (decode_error_behavior_flag): - * glyphs.c (Fmake_image_instance): - * indent.c (Findent_to): - * intl.c (Fignore_defer_gettext): - * keymap.c (Fkeymapp): - * keymap.c (Flookup_key): - * lread.c: - * lread.c (Fload_internal): - * lread.c (Feval_buffer): - * lread.c (Feval_region): - * macros.c (Fexecute_kbd_macro): - * marker.c (set_marker_internal): - * marker.c (Fset_marker): - * marker.c (set_marker_restricted): - * marker.c (Fcopy_marker): - * marker.c (noseeum_copy_marker): - * menubar.c: - * menubar.c (Fpopup_menu): - * minibuf.c: - * mule-charset.c (Fcharset_name): - * mule-charset.c (Fchar_charset): - * mule-charset.c (Fchar_octet): - * mule-charset.c (Fsplit_char): - * mule-wnnfns.c (Fwnn_open): - * mule-wnnfns.c (Fwnn_dict_comment): - * mule-wnnfns.c (Fwnn_quit_henkan): - * mule-wnnfns.c (Fwnn_word_toroku): - * mule-wnnfns.c (Fwnn_word_sakujo): - * mule-wnnfns.c (Fwnn_word_use): - * mule-wnnfns.c (Fwnn_hindo_set): - * objects.c: - * objects.c (Fmake_color_instance): - * objects.c (Fmake_font_instance): - * print.c (Fwrite_char): - * process.c: - * process.c (mark_process): - * process.c (print_process): - * process.c (get_process_from_usid): - * process.c (Fprocessp): - * process.c (Fprocess_live_p): - * process.c (Fget_process): - * process.c (Fget_buffer_process): - * process.c (get_process): - * process.c (Fprocess_id): - * process.c (Fprocess_name): - * process.c (Fprocess_command): - * process.c (init_process_io_handles): - * process.c (start_process_unwind): - * process.c (Fstart_process_internal): - * process.c (Fopen_multicast_group_internal): - * process.c (Fset_process_window_size): - * process.c (read_process_output): - * process.c (send_process): - * process.c (Fprocess_tty_name): - * process.c (Fset_process_buffer): - * process.c (Fprocess_buffer): - * process.c (Fprocess_mark): - * process.c (set_process_filter): - * process.c (Fset_process_filter): - * process.c (Fprocess_filter): - * process.c (Fprocess_send_region): - * process.c (Fprocess_send_string): - * process.c (exec_sentinel): - * process.c (Fset_process_sentinel): - * process.c (Fprocess_sentinel): - * process.c (status_notify): - * process.c (Fprocess_status): - * process.c (Fprocess_exit_status): - * process.c (process_send_signal): - * process.c (Fprocess_send_eof): - * process.c (deactivate_process): - * process.c (remove_process): - * process.c (Fdelete_process): - * process.c (kill_buffer_processes): - * process.c (Fprocess_kill_without_query): - * process.c (Fprocess_kill_without_query_p): - * rangetab.c: - * rangetab.c (Fget_range_table): - * rangetab.c (Fput_range_table): - * rangetab.c (Fremove_range_table): - * rangetab.c (Fclear_range_table): - * search.c: - * search.c (Fskip_chars_forward): - * search.c (Fskip_chars_backward): - * search.c (Fskip_syntax_forward): - * search.c (Fskip_syntax_backward): - * search.c (search_command): - * search.c (Freplace_match): - * search.c (Fregexp_quote): - * select.c (Fown_selection_internal): - * select.c (Fselection_owner_p): - * select.c (Fselection_exists_p): - * select.c (Fget_selection_internal): - * specifier.c: - * symbols.c: - * symbols.c (Fintern): - * symbols.c (Fintern_soft): - * symbols.c (Funintern): - * symbols.c (Fapropos_internal): - * symbols.c (Fset_default): - * syntax.c: - * syntax.c (Fsyntax_table_p): - * syntax.c (Fcopy_syntax_table): - * syntax.c (Fset_syntax_table): - * syntax.c (Fchar_syntax): - * syntax.c (syntax_match): - * syntax.c (Fmatching_paren): - * syntax.c (Fforward_word): - * syntax.c (scan_lists): - * syntax.c (Fscan_lists): - * syntax.c (Fscan_sexps): - * syntax.c (Fparse_partial_sexp): - * toolbar.c (Fcheck_toolbar_button_syntax): - * tooltalk.doc: - * window.c: - * window.c (Fwindowp): - * window.c (Fwindow_live_p): - * window.c (Fwindow_point): - * window.c (Fdelete_window): - * window.c (Fnext_window): - * window.c (Fprevious_window): - * window.c (Fother_window): - * window.c (window_loop): - * window.c (Fget_lru_window): - * window.c (Fsplit_window): - * window.c (Fenlarge_window): - * window.c (Fenlarge_window_pixels): - * window.c (Fshrink_window): - * window.c (Fshrink_window_pixels): - * window.c (change_window_height): - * window.c (Fwindow_configuration_p): - * window.c (Fcurrent_window_configuration): - * window.h: - * casefiddle.c (casify_object): - * casefiddle.c (Fupcase): - * casefiddle.c (Fdowncase): - * casefiddle.c (Fcapitalize): - * casefiddle.c (Fupcase_initials): - * casefiddle.c (casify_region_internal): - * casefiddle.c (casify_region): - * casefiddle.c (Fupcase_region): - * casefiddle.c (Fdowncase_region): - * casefiddle.c (Fcapitalize_region): - * casefiddle.c (Fupcase_initials_region): - * casefiddle.c (Fupcase_word): - * casefiddle.c (Fdowncase_word): - * casefiddle.c (Fcapitalize_word): - Docstring arglist/Texinfo fixes. See man/ChangeLog for details. - Replace 0 with '\0' when working with bytes. - Replace initial "(" with "\(" in docstrings. - -2000-11-01 Martin Buchholz <martin@xemacs.org> - - * config.h.in: Handle alloca with Compaq C on Alpha Linux. - - * m/alpha.h: Let configure handle SYSTEM_MALLOC on Linux. - -2000-10-31 Martin Buchholz <martin@xemacs.org> - - * eldap.c (print_ldap): 64-bit cleaner. Fixes warning. - -2000-10-30 Yoshiki Hayashi <yoshiki@xemacs.org> - - * doprnt.c (emacs_do_prnt_1): Format (format "%01.2d" 10) - correctly. - -2000-10-30 Yoshiki Hayashi <yoshiki@xemacs.org> - - * fileio.c (Vauto_save_list_file_prefix): Moved from startup.el. - (inhibit_auto_save_session): New variable. - (vars_of_fileio): Declare and initialize them. - * fileio.c (Fdo_auto_save): Don't create session file if - Vinhibit_auto_save_session or Vauto_save_list_file_prefix is non-nil. - -2000-10-31 Martin Buchholz <martin@xemacs.org> - - * sgiplay.c (play_internal): C++ compilability. - * alloc.c (SWEEP_FIXED_TYPE_BLOCK): Remove unused var `SFTB_prev'. - * callproc.c (Fold_call_process_internal): - Remove unused vars `env', `first'. - * scrollbar.c (update_scrollbar_instance): - #### unused var `current_window'. - * redisplay-tty.c: Put currently unused vars insert_mode_on, - etc. within #ifdef NOT_YET. - * emacs.c: #### unused vars `initial_argc', `initial_argv'. - * dialog-x.c (dbox_descriptor_to_widget_value): ### unused var `title'. - * specifier.c (specifier_instance): - #### unused var `tag'. - Use WINDOW_BUFFER, FRAME_DEVICE instead of their expansion. - -2000-10-27 Martin Buchholz <martin@xemacs.org> - - * fns.c (Fbutlast): - * fns.c (list_sort): - * fns.c (Ffillarray): - * fns.c (bytecode_nconc2): - * fns.c (Fnconc): - * fns.c (mapcar1): - * fns.c (Fmapconcat): - Be pedantically 64-bit correct. For the time when someone will - want to have a list with length > 2**32. - - * lisp.h (PRIVATE_EXTERNAL_LIST_LOOP_6): - Work around MIPSpro compiler bug. - - * process-unix.c (unix_kill_child_process): Add snarky comment. - * process-unix.c (try_to_initialize_subtty): Oops, `=' ==> `==' - - * config.h.in: Oops, _getpt ==> _getpty - -2000-10-26 Martin Buchholz <martin@xemacs.org> - - * config.h.in: - * regex.c: - Use void*, not char*, as return type of alloca(). - - * alloc.c (free_marker): Side effect inside assert expression! - -2000-10-16 MIYASHITA Hisashi <himi@m17n.org> - - * mule-charset.c (Fset_charset_ccl_program): To check - if the given ccl program is valid, use setup_ccl_program() - instead of CHECK_VECTOR(). - (Fmake_charset): Likewise. - -2000-10-20 Golubev I. N. <gin@mo.msk.ru> - - * faces.c (get_extent_fragment_face_cache_index): - Fix cachel.merged_faces memory leak. - -2000-10-14 MIYASHITA Hisashi <himi@m17n.org> - - * mule-ccl.c (ccl_driver)<CCL_DECODE_SJIS>: - Reset MSB of octets obtained by DECODE_SJIS - because of the incompatibility with Emacs. - (ccl_driver)<CCL_ENCODE_SJIS>: - Set MSB of octets before passing them to - ENCODE_SJIS because of the incompatibility - with Emacs. - -2000-10-18 Daiki Ueno <ueno@unixuser.org> - - * lrecord.h (DECLARE_TYPECHECK_LRECORD): Abolish. - (DECLARE_LRECORD): Undo the last change. - (DECLARE_EXTERNAL_LRECORD): Expand typechecking stuff. - -2000-10-17 Daiki Ueno <ueno@unixuser.org> - - * lrecord.h (INIT_EXTERNAL_LRECORD_IMPLEMENTATION): Connect - the implementation to lrecord_implementations_table. - -2000-10-14 Daiki Ueno <ueno@unixuser.org> - - * lrecord.h (MAKE_EXTERNAL_LRECORD_IMPLEMENTATION): Don't set the - initial value of `lrecord_type_##c_name' and - `lrecord_##c_name.lrecord_type_index'; discard "const" qualifier. - (INIT_EXTERNAL_LRECORD_IMPLEMENTATION): New macro. - [ERROR_CHECK_TYPECHECK] (DECLARE_TYPECHECK_LRECORD): New macro. - [ERROR_CHECK_TYPECHECK] (DECLARE_LRECORD): Use it. - [ERROR_CHECK_TYPECHECK] (DECLARE_EXTERNAL_LRECORD): Use it. - -2000-10-17 Martin Buchholz <martin@xemacs.org> - - * miscplay.c (sndcnv8S_2mono): - (sndcnv2monounsigned): - (sndcnvULaw_2linear): - (sndcnv16swap): - Remove implementation-defined behavior. - -2000-10-12 Martin Buchholz <martin@xemacs.org> - - * input-method-xlib.c: Warning suppression. - -2000-10-05 MIYASHITA Hisashi <himi@m17n.org> - - * mule-ccl.c: Sync up with Emacs 21.0.90. - (ccl_driver)<CCL_TranslateCharacter>: Disabled. - Do nothing. - (ccl_driver)<CCL_TranslateCharacterConstTbl>: - Likewise. - (ccl_driver[WriteMultibyteChar2]): Bug fix. - Use MAX_LEADING_BYTE_OFFICIAL_2 instead of - MIN_LEADING_BYTE_OFFICIAL_2 to check whether the - leading char belongs to official 2-dimensional charset. - (CCL_WRITE_CHAR): When CCL_MODE_ENCODING, - write the given character as is. Otherwise, - if it is a multibyte char, convert it by - non_ascii_set_charptr_emchar, then write it. - (CCL_WRITE_STRING): Likewise. - (ccl_get_compiled_code): New function. - (setup_ccl_program): When ccl_prog is invalid, - return -1. - (Fregister_code_conversion_map): New function. - (syms_of_mule_ccl): defsubr Fregister_code_conversion_map. - - * mule-ccl.h: Sync up with Emacs 21.0.90. - (Fregister_ccl_program): export it. - - * redisplay-msw.c (separate_textual_runs): - If ccl program is not valid, don't do ccl conversion. - - * redisplay-x.c (separate_textual_runs): Ditto. - - * file-coding.c (Fmake_coding_system): - When type is ccl and value is vector, register it - with a proper symbol. And checks whether the - given ccl program is valid. - (mule_decode): When calling ccl_driver, if src indicates - NULL pointer, set an empty string instead. - (mule_encode): Likewise. - -2000-10-11 Martin Buchholz <martin@xemacs.org> - - The following large batch of changes gets us back to a state of - C++ compilability. Extbyte is now a char, which means that - Extbyte * and Bufbyte * cannot be freely interchanged - a win! - - * tooltalk.c (Fset_tooltalk_message_attribute): Type correctness. - - * sound.c (Fplay_sound): Type correctness. - - * select-x.c (hack_motif_clipboard_selection): Type correctness. - (x_get_window_property): Type correctness. - (receive_incremental_selection): unsigned char ==> Extbyte - (selection_data_to_lisp_data): unsigned char ==> Extbyte - (Fx_get_cutbuffer_internal): unsigned char ==> Extbyte - (Fx_store_cutbuffer_internal): Type correctness. - - * process-unix.c (try_to_initialize_subtty): Type correctness. - - * objects-x.c (x_print_color_instance): Type correctness. - (x_print_font_instance): Type correctness. - (x_list_fonts): SExtbyte ==> Extbyte. - (valid_x_font_name_p): SExtbyte ==> Extbyte. - (x_find_charset_font): SExtbyte ==> Extbyte. - Use TO_INTERNAL_FORMAT. build_string ==> make_string. - (truename_via_XListFonts): SExtbyte ==> Extbyte. - (x_font_instance_properties): Use TO_INTERNAL_FORMAT. - Use bufbyte_strcmp. - - * mule-charset.h (LEADING_BYTE_PREFIX_P): unsigned char ==> Bufbyte - (PRIVATE_LEADING_BYTE_PREFIX): Add paranoia cast. - (BYTE_ASCII_P): Use bit ops for char-signedness safety. - (BYTE_C0_P): Use bit ops for char-signedness safety. - (BYTE_C1_P): Use bit ops for char-signedness safety. - (CHARSET_BY_LEADING_BYTE): - (CHARSET_BY_ATTRIBUTES): - Always use inline function. - Use type_checking_assert. - Hide chlook. - - * mule-charset.c (non_ascii_charptr_copy_char): - Modify to work with both ASCII and non-ASCII characters. - Improve docs and variable names. - Replace over-clever fall-through switch with a simple loop. - (Lstream_get_emchar_1): - Replace over-clever fall-through switch with a simple loop. - - * menubar-x.c (menu_item_descriptor_to_widget_value_1): - Warning suppression. - - * lstream.h (Lstream_get_emchar): BYTE_ASCII_P cannot be used on - the return value of Lstream_getc, which could be EOF as well. - - * lstream.c (Lstream_raw_read): Now returns ssize_t, not int. - - * lisp.h: Make Extbyte a char, not unsigned char, so that external - APIs can be used on Extbytes without casts. Risky! - (SExtbyte): Remove. - (UExtbyte): Remove. - - * input-method-xlib.c (XIM_init_device): - Use Xlib.h instead of IntrinsicP.h. - Use HAVE_XREGISTERIMINSTANTIATECALLBACK instead of THIS_IS_X11R6, - which will break in X11R7. - Use XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE, - to call XRegisterIMInstantiateCallback with correct types. - - * gui-x.c (button_item_to_widget_value): Type correctness. - - * glyphs.c (bitmap_to_lisp_data): Type correctness. - - * glyphs-x.c (pixmap_from_xbm_inline): Type correctness. - (xbm_instantiate_1): Type correctness. - (BUILD_GLYPH_INST): Type correctness. - - * fileio.c (Fsubstitute_in_file_name): Type correctness. - - * file-coding.c: - (decode_coding_sjis): - (decode_coding_big5): - (decode_coding_ucs4): - (decode_coding_utf8): - (decode_coding_iso2022): - (decode_coding_no_conversion): - Make all decoding functions take an Extbyte * arg. - (encode_coding_sjis): - (encode_coding_big5): - (encode_coding_ucs4): - (encode_coding_utf8): - (encode_coding_iso2022): - (encode_coding_no_conversion): - Make all encoding functions take a Bufbyte * arg. - Use size_t instead of unsigned int for memory sizes. - Only cast to unsigned char whenever dereferencing Extbyte *. - - * doc.c (unparesseuxify_doc_string): Type correctness. - - * console-x.c (split_up_display_spec): - Rewrite without using details of internal string representation. - (x_semi_canonicalize_device_connection): Type correctness. - - * config.h.in: - (HAVE_XREGISTERIMINSTANTIATECALLBACK): New. - (XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE): New. - (HAVE_XFREE386): Removed. - - * buffer.h (DEC_CHARPTR): `const' correctness. - (bufbyte_strcmp): New. - (bufbyte_memcmp): New. - - * buffer.c (dfc_convert_to_internal_format): Extbyte ==> Bufbyte - - * buffer.h (XCHAR_OR_CHAR_INT): - Always use inline function. - Remove redundant type checking assert() - XINT will abort quite nicely. - -2000-10-03 Yoshiki Hayashi <yoshiki@xemacs.org> - - * search.c (Freplace_match): Set newtext to an empty string. - -2000-10-10 Martin Buchholz <martin@xemacs.org> - - * s/decosf1-3.h: Remove #include of stropts.h - * s/ptx.h: Remove #include of stropts.h - * s/usg5-4.h: Remove #include of stropts.h - * sysproc.h: - * config.h.in: - Use stropts.h, not sys/stropts.h. - Use strtio.h, not sys/strtio.h. - -2000-10-04 Martin Buchholz <martin@xemacs.org> - - * XEmacs 21.2.36 is released. - -2000-09-21 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_redisplay_widget): make sure non-structural - changes still involve copying the widget tree. - (update_widget_face): make sure a change is register in the widget - tree. Call update_tab_widget_face appropriately. - (update_tab_widget_face): ditto. - (x_tab_control_redisplay): make sure non-structural changes still - involve copying the widget tree. - -2000-08-31 Daiki Ueno <ueno@unixuser.org> - - * lread.c (locate_file): Check the path element is non-nil. - -2000-10-02 Martin Buchholz <martin@xemacs.org> - - * lisp.h: Warning suppression for SCO compilers. - - * redisplay-tty.c (reset_tty_modes): Fix crash. - E.g. from xemacs running on X: (delete-device (make-device 'tty nil)) - -2000-09-27 Martin Buchholz <martin@xemacs.org> - - Big signal/process handling overhaul. Bugs fixed: - M-x shell, type `sleep 10000', M-x comint-interrupt-subjob and - M-x comint-kill-subjob should work for both values nil and t of - process-connection-type. It was broken on most platforms. - Testing on Irix and Cygwin still needed. Other plaforms tested. - * sysdep.c: Move #include of stropts.h into sysproc.h. Use pid_t. - * process-unix.c: Signal/Process handling overhaul. - (pty_name): make 64 bytes, as `expect' does, for paranoia. - (allocate_pty): Use all available modern methods of allocating - ptys, falling back to old style BSD allocation as a last resort. - Use allegedly more secure Unix98 pty allocation by default. - (allocate_pty_the_old_fashioned_way): New. the last resort. - (unix_create_process): Push ptem, ldterm, ttcompat where - available. Autoconfiscate. - (try_to_initialize_subtty): New. - (unix_kill_child_process): Proper signal handling for ptys on most - platforms, using special knowledge of AIX, BSD, etc... - (unix_create_process): Always disconnect_controlling_terminal() for - subprocesses, whether using ptys or not. - * process.h: Remove old getpt-dependent PTY code. - * process.c (Fprocess_send_signal): New, obvious generic function. - (decode_signal): New. - (Finterrupt_process): - (Fkill_process): - (Fquit_process): - (Fstop_process): - (Fcontinue_process): - (Fsignal_process): Use decode_signal. - (process_send_signal): - Many docstring corrections. - Allow any signal to be sent to a process object. - * config.h.in: Add symbols for big signal/process overhaul. - * syssignal.h (EMACS_KILLPG): Use HAVE_KILLPG. Use `pid', not `gid'. - * sysproc.h: Include process-related headers, where available: - sys/stropts.h sys/strtio.h pty.h libutil.h - * s/irix4-0.h: - * s/irix5-0.h: - * s/cygwin32.h: - * s/gnu.h: - * s/linux.h: - * s/hpux.h: - * s/aix3-1.h: - Remove old S&M pty stuff. - * console-tty.c (tty_init_console): Use pid_t, not int, for pids. - * systty.h: Simplify cpp hackery, improve comments. - Favor BSD ioctl(TIOCGPGRP) over Posix tcgetpgrp(). - - * editfns.c (Fformat_time_string): - Be a little more paranoid with the return value of ctime. - - * fileio.c (check_executable): - (check_writable): - Use symbolic constants X_OK, W_OK. - - * console-x.c (split_up_display_spec): Fix a warning. - -2000-10-02 Martin Buchholz <martin@xemacs.org> - - * gui-x.c (add_accel_and_to_external): strlen ==> XSTRING_LENGTH - * ntproc.c (sys_spawnve): make_string ==> build_string - Small clarity improvements. - -2000-09-30 Martin Buchholz <martin@xemacs.org> - - * events.c (WRONG_EVENT_TYPE_FOR_PROPERTY): Warning removal. - - * s/windowsnt.h (HAVE_STRCASECMP): Remove. - - * config.h.in (HAVE_STRCASECMP): Remove. - -2000-09-29 Martin Buchholz <martin@xemacs.org> - - * redisplay-output.c (redisplay_output_pixmap): - Cleaner and possibly more 64-bit correct code. - -2000-09-28 Stephen J. Turnbull <stephen@xemacs.org> - - * dumper.c (pdump_load_finish): move restoration of - `noninteractive1' to emacs.c (main_1). - * emacs.c (main_1): protect LISP-visible command-line flags - from pdump_load(). - -2000-09-26 Stephen J. Turnbull <stephen@xemacs.org> - - * Makefile.in.in (versionclean): Use EXE_TARGET and - DUMP_TARGET instead of literal program names. - -2000-09-20 Martin Buchholz <martin@xemacs.org> - - * Makefile.in.in: Recent purify's require absolute paths for cache-dir. - -2000-09-19 Martin Buchholz <martin@xemacs.org> - - * *: Spelling mega-patch - -2000-09-19 Martin Buchholz <martin@xemacs.org> - - * fns.c (bad_bad_turtle): - Delete "Eek!" comment, since we fixed the bug to which it refers. - -2000-09-16 Martin Buchholz <martin@xemacs.org> - - * alloca.c: Replace REGISTER with register. - -2000-09-16 Daiki Ueno <ueno@unixuser.org> - - * file-coding.c (ucs_to_char): Use countof. - -2000-09-16 Martin Buchholz <martin@xemacs.org> - - * file-coding.c: (ucs_to_char): - (complex_vars_of_file_coding): - Use countof instead of sizeof. - Use CHECK_NATNUM instead of CHECK_INT. - - * sysdep.c (strcasecmp): Remove. - * device-x.c (ascii_strcasecmp): New. - * device-x.c (Fx_get_resource): Use ascii_strcasecmp. - Avoid using non-standard non-portable strcasecmp. - -2000-09-16 Martin Buchholz <martin@xemacs.org> - - * Makefile.in.in (mostlyclean): remove reference to prefix-args. - * font-lock.c: remove reference to emacsfns.h. - * search.c: small doc improvement. - * event-Xt.c: correct file names in comments. - * console-x.h Correct file names in comments. - * frame.c: Correct file names in comments. - * event-stream.c: remove Energize from comments. - -2000-09-15 Martin Buchholz <martin@xemacs.org> - - * symeval.h (DEFERROR_STANDARD): - (DEFERROR): - (DEFSYMBOL): - (DEFSYMBOL_NO_DUMP): - (DEFSYMBOL_MULTIWORD_PREDICATE): - (DEFSYMBOL_MULTIWORD_PREDICATE_NO_DUMP): - (DEFKEYWORD): - The construct &##name is not sensible C. - Fixes compilation errors with Unixware native compiler. - -2000-09-14 Martin Buchholz <martin@xemacs.org> - - * frame.c (device_matches_console_spec): no longer takes a `frame' arg - (next_frame_internal): Removed. We now just have next_frame. - (next_frame): - Write a simpler and cleaner one-pass algorithm. - Remove called_from_delete_device arg and #ifdefed-out code. - (previous_frame): - Renamed from prev_frame. Update callers. - Cleaned up to have an analogous implementation to next_frame. - (other_visible_frames_internal): Remove the - called_from_delete_device bogus arg, and hence, remove this - function. Just use other_visible_frames(). - - * window.c (Fnext_window): - Prettify docstring. - Since next_frame() is guaranteed to return a frame, remove check - for nil inserted in previous patch. - (Fprevious_window): - Prettify docstring. - Make code look more like Fnext_window. - (window_loop): - Respect the `console' arg when iterating through windows. - Fixes bug: (get-buffer-window buffer t device) not respecting - the `device' arg. - This function needs more work, as others have pointed out. - - * frame.h: Rename prev_frame to previous_frame. - device_matches_console_spec no longer takes a `frame' arg. - - * s/gnu.h: - * s/linux.h: - * s/hpux.h: - Use EMACS_BLOCK_SIGNAL instead of sigblock. - From "Golubev I. N." <gin@mo.msk.ru>. - - * make-src-depend: Fix typo. - -2000-09-13 Martin Buchholz <martin@xemacs.org> - - * window.c (Fnext_window): - next_frame() might return nil, not a frame. - Fixes this crash: - (gdb) run -eval '(progn (make-device (quote x) "polgar:0") (next-window (minibuffer-window) t (quote visible) (second (device-list))))' - - * frame.c (next_frame_internal): - We've passed a frame if we've passed its device. - Fixes this crash: - (gdb) run -eval '(progn (make-frame nil (make-device (quote x) "polgar:0")) (next-window (minibuffer-window) t (quote visible) (second (device-list))))' -Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245, RECORD_TYPEP (obj, lrecord_type_frame) - -2000-09-11 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * menubar-msw.c (mswindows_translate_menu_or_dialog_item): - Allow option to suppress accelerators in menu/dialog items. - (populate_or_checksum_helper): Pass dialog title through above. - -2000-09-10 Jonathan Harris <jhar@tardis.ed.ac.uk> - - * event-msw.c (mswindows_key_to_emacs_keysym): - Add "pause" key, fix "menu" key. - -2000-09-09 Martin Buchholz <martin@xemacs.org> - - * eval.c (reinit_vars_of_eval): - Increase max_lisp_eval_depth to 1000, - required for thai-xtis.el to byte-compile under some circumstances. - -2000-09-04 Martin Buchholz <martin@xemacs.org> - - * event-Xt.c (x_to_emacs_keysym): Increase size of `buffer' to 513. - From Kenichi Handa. - -2000-09-01 Martin Buchholz <martin@xemacs.org> - - * make-src-depend: Make the generated Makefiles smaller. - - * s/hpux.h (SETUP_SLAVE_PTY): - Provide a %d in the format string for the errno argument. - - * editfns.c (Ftemp_directory): - Warning fix. - Avoid buffer overrun on very long file name. - - * input-method-xlib.c (XIM_init_device): - 6th parameter of XRegisterIMInstantiateCallback has different - pointer types on different OSes, so simply cast to (void *). - - * unexhp9k800.c: Warning fixes. Fiddly changes. - - * sysdll.c (dll_open): - shl_load will hang hard if passed a NULL filename. - Simply return NULL for compatibility with dlopen. - * sysdll.c: Conform to XEmacs coding standards. - - * sysdep.c (get_pty_max_bytes): - Support pty input lines longer than 512 bytes on HP-UX 10.20. - -2000-08-31 Martin Buchholz <martin@xemacs.org> - - * tooltalk.c: Add #include <syssignal.h> - -2000-08-12 Alexandre Oliva <aoliva@redhat.com> - - * s/hpux.h: Don't use undefined function sigunblock(). - -2000-08-31 Martin Buchholz <martin@xemacs.org> - - * config.h.in: Add HAVE_BALLOON_HELP. - * emacs.c: Use HAVE_BALLOON_HELP. - * Makefile.in.in (x_objs): - Make Balloon Help conditional on finding shape.h. - -2000-08-23 Yoshiki Hayashi <yoshiki@xemacs.org> - - * syntax.c (regex_emacs_buffer_p): New variable. - * syntax.h (regex_emacs_buffer_p): extern. - * search.c (looking_at_1): - (string_match_1): - (fast_string_match): - (search_buffer): Set regex_emacs_buffer_p. - * regex.c (re_match_2_internal): Reference regex_emacs_buffer_p - when before_dot, at_dot, after_dot. - -2000-08-23 Andy Piper <andy@xemacs.org> - - * gui-x.c (popup_selection_callback): Only set action_occurred - when we really have an image instance. - * gui-msw.c (mswindows_handle_gui_wm_command): ditto. - -2000-08-23 Andy Piper <andy@xemacs.org> - - * gui-msw.c (mswindows_handle_gui_wm_command): set - action_occurred. - * gui-x.c (popup_selection_callback): ditto. - - * glyphs.h (IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED): new accessor. - (XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED): ditto. - (struct Lisp_Image_Instance): add action_occurred flag. - - * glyphs.c (redisplay_subwindow): use action_occurred flag. - (image_instance_changed): ditto. - (reset_frame_subwindow_instance_cache): only unmap windows - do - not remove them from the cache also. - - * glyphs-widget.c (tab_control_update): better debug. - (progress_gauge_update): ditto. - (layout_update): ditto. - (layout_instantiate): ditto. - (tab_control_order_only_changed): cope with null pending items. - - * glyphs-msw.c (mswindows_tab_control_redisplay): add better - debug. Force selection of an item when an action occurred. Cope - with null pending_items. - (mswindows_progress_gauge_redisplay): better debug. - * glyphs-x.c (x_tab_control_redisplay): ditto. - - * redisplay.c (redisplay_frame): reset the frame cache if the - frame is garbaged. - - * window.c (Fset_window_configuration): potentially re-enable - frame cache reset. - (window_unmap_subwindows): need to finalize instances here since - it is only used in mark_window_as_deleted. - -2000-08-22 Stephen J. Turnbull <stephen@xemacs.org> - - * nas.c (SndOpenDataForReading): - nas.c (WaveOpenDataForReading): - nas.c (readChunk): {BIG,LITTLE}_ENDIAN -> NAS_{BIG,LITTLE}_ENDIAN. - Somehow escaped from the 2000-08-14 patch. - -2000-08-14 Stephen J. Turnbull <stephen@xemacs.org> - - * nas.c: Preprocessor trickery to use NAS_LITTLE_ENDIAN instead - of LITTLE_ENDIAN (conflicts with glibc, at least) in NAS <= 1.2p5. - -2000-08-21 Andy Piper <andy@xemacs.org> - - * glyphs-x.c (x_map_subwindow): Minor optimization - only map the - window if it is not already displayed. - - * glyphs-msw.c (mswindows_map_subwindow): only map the window if - it is not already displayed. - - * window.c (Fset_window_configuration): don't reset the frame - cache. - - * glyphs.c (unmap_subwindow_instance_cache_mapper): only remove - instances from the frame cache if we are actually finalizing them. - (reset_frame_subwindow_instance_cache): reset frame cache only - after unmapping everything. - (map_subwindow): set displayed flag after mapping. - -2000-08-21 Martin Buchholz <martin@xemacs.org> - - * data.c (indirect_function): - Rename ERRORP to non-misleading VOID_FUNCTION_ERRORP. - - * eval.c (function_argcount): - Use original function when signaling errors. - -2000-08-18 Andy Piper <andy@xemacs.org> - - * frame.c (delete_frame_internal): use new - free_frame_subwindow_instances name. - - * glyphs-msw.c (mswindows_tab_control_instantiate): verify index. - (add_tab_item): make return type correct. - (mswindows_tab_control_instantiate): assert index of tab. - (mswindows_tab_control_redisplay): Re-code to use - gui_item_equal_sans_selected and gui_item_list_find_selected. - - * glyphs-widget.c (tab_control_update): Correct comment. - - * window.c (window_unmap_subwindows): use new - unmap_subwindow_instance_cache_mapper. - (window_unmap_subwindows_cache_mapper): deleted. - (Fset_window_configuration): comparisons should now be with - EQ. Preserve the subwindow instance cache across configuration - changes. - (allocate_window): ditto. - (make_dummy_parent): ditto. - - * glyphs.c (free_frame_subwindow_instances): rename from - free_frame_subwindow_instance_cache. finalize all instances rather - than just those in the display cache. - (finalize_all_subwindow_instances): walk windows unmapping and - finalizing subwindows. - (unmap_subwindow_instance_cache_mapper): moved from - window.c. Allow finalization as well as unmapping. - - * gui.c (gui_item_list_find_selected): new function. - - * gui.h (gui_item_list_find_selected): declare. - - * glyphs-x.c (x_tab_control_redisplay): pick tab - explicitly. Re-code to use gui_item_equal_sans_selected and - gui_item_list_find_selected. - - * glyphs-x.h: add lwlib-utils.h - - * buffer.c (Frecord_buffer): undo previous change. - -2000-08-09 Vin Shelton <acs@xemacs.org> - - * config.h.in, s/gnu.h, s/hpux.h, s/linux.h: Use UNIX98 PTYs if - possible. Create temporary files more securely. The patch was - generated by Torsten Duwe <duwe@caldera.de>, Florian Weimer - <Florian.Weimer@RUS.Uni-Stuttgart.DE> and Olaf Kirch. See - http://www.xemacs.org/list-archives/xemacs-patches/200007/msg00123.html - for details. - -2000-08-07 Ben Wing <ben@xemacs.org> - - * getloadavg.c: remove duplicate (and windows-breaking) - includes of fcntl.h and sys/file.h. - - * nt.c: remove duplicate getloadavg() definition. - - * sysdll.h (Qdll_filename_encoding): add missing stand-in - encodings. - -2000-08-07 Gunnar Evermann <ge204@eng.cam.ac.uk> - - * eval.c (function_argcount): If function needs to be autoloaded - actually use the loaded definition. - GCPRO function. - -2000-08-05 Ben Wing <ben@xemacs.org> - - * getloadavg.c: add prototype for getloadavg(). remove - duplicate WIN32_NATIVE/CYGWIN code (already in the middle - of the code). remove duplicate header includes. - - * s\cygwin32.h, s\mingw32.h: remove stray NO_ARG_ARRAY. - - * s\cygwin32.h, s\mingw32.h, m\windowsnt.h: - don't define LOAD_AVE_TYPE/LOAD_AVE_CVT because we have no - useful load average. - - * alloc.c (reinit_alloc_once_early): removed references to - VIRT_ADDR_VARIES, malloc_sbrk_used/free, and data-bytes-used/free. - the lisp vars are the only things referencing the malloc_sbrk_* - vars, and they were already if 0'd out. these vars only exist - in the older malloc.c, which is basically unused, and they're - only for informational purposes. - - * m\*.h: removed useless VIRT_ADDR_VARIES. - - * m\powerpc.h: removed stray NO_ARG_ARRAY. - -2000-04-26 IKEYAMA Tomonori <tomonori@suiyokai.org> - - * redisplay-msw.c (mswindows_output_dibitmap): Set foreground - color if the image is a mono pixmap. - -2000-07-30 Ben Wing <ben@xemacs.org> - - * Makefile.in.in (release): - Remove stray @. - - * buffer.c (directory_is_current_directory): - * dired-msw.c (mswindows_get_files): - * dired.c: - * dired.c (Fdirectory_files): - * dired.c (file_name_completion_stat): - * dired.c (Ffile_attributes): - [[[[1]]]]: Rename stat() -> xemacs_stat() and eliminate nasty - preprocessor tricks, to avoid problems on some machines - (e.g. SCO). - - * callproc.c (egetenv): GC docs. - - * console-msw.h: - * console-msw.h (struct mswindows_dialog_id): - * lrecord.h (lrecord_type): - New object for use with MSW dialogs. - - * console.h (struct console_methods): - New enable/disable frame methods, for proper modal dialogs. - - * device-msw.c (msprinter_default_printer): Fix to follow - proper Mule conventions. - - * device-msw.c: - * device-msw.c (signal_open_printer_error): - * device-msw.c (msprinter_init_device): - * device-msw.c (ensure_not_printing): - * device-msw.c (plist_get_margin): - * device-msw.c (Fmsprinter_select_settings): - * device-msw.c (finalize_devmode): - * device-msw.c (Fmsprinter_settings_despecialize): - * device-msw.c (signal_enum_priner_error): - * extents.c (decode_extent): - * extents.c (decode_map_extents_flags): - * extents.c (decode_extent_at_flag): - * extents.c (Fextent_at): - * extents.c (Fextents_at): - * extents.c (symbol_to_glyph_layout): - [[[[2]]]] Use structured errors. - - * dialog-msw.c: - * dialog-msw.c (mswindows_is_dialog_msg): - * dialog-msw.c (mark_mswindows_dialog_id): - * dialog-msw.c (dialog_proc): - * dialog-msw.c (handle_question_dialog_box): - * dialog-msw.c (syms_of_dialog_mswindows): - Define new object to clean up marking; use it as a dialog identifier. - Call new delete-dialog-box-hook. - - * dialog-x.c (dbox_selection_callback): - * dialog-x.c (dbox_descriptor_to_widget_value): - * dialog-x.c (x_make_dialog_box_internal): - Call new delete-dialog-box-hook. - Return an id. - - * dialog.c: - * dialog.c (syms_of_dialog): - * dialog.c (vars_of_dialog): - Define new delete-dialog-box-hook, for use w/modal dialog boxes. - - * eval.c: - * eval.c (signal_call_debugger): - when noninteractive, output stack traces on the console instead - of in a (never-seen) buffer. - - * eval.c (signal_type_error): - * eval.c (invalid_argument_2): - * lisp.h: - new funs for use w/structured errors. - - * event-Xt.c: - * event-Xt.c (x_to_emacs_keysym): - * event-Xt.c (describe_event): - * event-Xt.c (emacs_Xt_event_handler): - * event-Xt.c (vars_of_event_Xt): - * event-msw.c: - * event-msw.c (mswindows_wnd_proc): - * event-msw.c (vars_of_event_mswindows): - rename {x,mswindows}-debug-events to debug-{}-events for - consistency with other debug-foo variables. - - * event-stream.c: - document next-event more clearly. - - * fileio.c (Ffile_name_directory): - * fileio.c (Ffile_name_nondirectory): - * fileio.c (Funhandled_file_name_directory): - * fileio.c (file_name_as_directory): - * fileio.c (Ffile_name_as_directory): - * fileio.c (directory_file_name): - * fileio.c (Fdirectory_file_name): - * fileio.c (Fmake_temp_name): - * fileio.c (Ffile_truename): - * fileio.c (Fsubstitute_in_file_name): - * fileio.c (expand_and_dir_to_file): - * fileio.c (barf_or_query_if_file_exists): - * fileio.c (check_executable): - * fileio.c (Ffile_exists_p): - * fileio.c (Ffile_writable_p): - * fileio.c (Ffile_directory_p): - * fileio.c (Ffile_regular_p): - * fileio.c (Ffile_modes): - * fileio.c (Ffile_newer_than_file_p): - * fileio.c (Fverify_visited_file_modtime): - * fileio.c (Fset_visited_file_modtime): - * fileio.c (auto_save_1): - (1). (2). - fix up gcpro's. - - * frame-msw.c: - * frame-msw.c (mswindows_init_frame_1): - * frame-msw.c (mswindows_enable_frame): - * frame-msw.c (error_frame_unsizable): - * frame-msw.c (msprinter_init_frame_1): - * frame-msw.c (msprinter_init_frame_3): - * frame-msw.c (console_type_create_frame_mswindows): - (2). - implement new enable/disable frame methods. - - * frame-x.c: - * frame-x.c (x_enable_frame): - * frame-x.c (console_type_create_frame_x): - implement new enable/disable frame methods. - - * frame.c: - * frame.c (Fdisable_frame): - * frame.c (syms_of_frame): - * frame.h (struct frame): - implement new enable/disable frame methods/functions. - - * general-slots.h: - add initial-focus. - - * glyphs-msw.c (mswindows_widget_instantiate): - comment that initial-focus should be implemented. - - * glyphs-widget.c: - * glyphs-widget.c (check_valid_instantiator): - * glyphs-widget.c (check_valid_orientation): - * glyphs-widget.c (check_valid_tab_orientation): - * glyphs-widget.c (check_valid_justification): - * glyphs-widget.c (check_valid_border): - * glyphs-widget.c (check_valid_callback): - * glyphs-widget.c (check_valid_int_or_function): - * glyphs-widget.c (check_valid_string_or_vector): - * glyphs-widget.c (check_valid_item_list_1): - * glyphs-widget.c (widget_validate): - * glyphs-widget.c (combo_box_validate): - * glyphs-widget.c (widget_instantiate): - * glyphs-widget.c (syms_of_glyphs_widget): - * glyphs-widget.c (VALID_WIDGET_KEYWORDS): - * glyphs-widget.c (image_instantiator_combo_box): - * glyphs-widget.c (image_instantiator_scrollbar): - * glyphs-widget.c (image_instantiator_tab_control): - * glyphs-widget.c (VALID_LAYOUT_KEYWORDS): - (2). - support (unimplemented) keyword initial-focus. - reindent long macros. - - * glyphs-x.c (x_redisplay_widget): - * glyphs-x.c (x_button_instantiate): - * glyphs-x.c (x_button_redisplay): - * glyphs-x.c (x_progress_gauge_instantiate): - * glyphs-x.c (x_edit_field_instantiate): - * glyphs-x.c (x_combo_box_instantiate): - * glyphs-x.c (x_tab_control_instantiate): - * glyphs-x.c (x_label_instantiate): - * gui-x.c: - * gui-x.c (button_item_to_widget_value): - * gui-x.c (gui_items_to_widget_values_1): - * gui-x.c (gui_item_children_to_widget_values): - * gui-x.c (gui_items_to_widget_values): - * gui-x.h: - * menubar-x.c (menu_item_descriptor_to_widget_value_1): - add new flag to gui-parsing routines to indicate whether - accelerator specs should be supported. - - * glyphs.c (syms_of_glyphs): use DEFSYMBOL. - - * glyphs.h (struct Lisp_Image_Instance): - * glyphs.h (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS): - add initial-focus flag. - - * gui.c: - * gui.c (syms_of_gui): - * gui.c (vars_of_gui): - clean up menu-no-selection-hook. - - * gui.h: - support delete-dialog-box-hook. - - * lread.c (Fload_internal): - * lread.c (locate_file_in_directory_mapper): - (1). - - * lrecord.h: - * lrecord.h (struct toolbar_button): - * lrecord.h (syms_of_toolbar): - document how to create a new object. - - * menubar-msw.c (mswindows_char_is_accelerator): - may be called on frames w/o menus. - - * menubar.c (vars_of_menubar): - clean up :filter docs. - - * nt.c (readdir): - * ntproc.c: - (1). - - * process-nt.c: - * process-nt.c (validate_signal_number): - * process-nt.c (signal_cannot_launch): - * process-nt.c (nt_create_process): - * process-nt.c (nt_send_process): - * process-nt.c (nt_kill_child_process): - * process-nt.c (nt_open_network_stream): - * process-nt.c (syms_of_process_nt): - (2). - delete quote-handling. call new lisp code that does it better. - - * process-unix.c (connect_to_file_descriptor): - * process-unix.c (allocate_pty): - * process-unix.c (unix_send_process): - * process-unix.c (unix_kill_child_process): - * process-unix.c (unix_open_network_stream): - * process-unix.c (unix_open_multicast_group): - (1). (2). - - * process.c: - * process.c (Fstart_process_internal): - (2). need to canonicalize process path even if absolute. - - * select-msw.c (symbol_to_ms_cf): - * select-msw.c (ms_cf_to_symbol): - * select-msw.c (cf_is_autofreed): - * select-msw.c (mswindows_destroy_selection): - * select.c: - * select.c (syms_of_select): - * select.h: - support dibv5, fix bugs. (from Mike Alexander) - - * select.c (Fget_selection_internal): - * select.c (select_convert_out): - - * sysdep.c: - * sysdep.c (xemacs_stat): - renamed. - - * sysdep.c (mkdir): - * sysdep.c (rmdir): - but keep original stat() here because we provide encapsulation - around these funs. - - * sysfile.h: - * sysfile.h (fstat): - remove stat garbage. - - * syswindows.h: - fix X/MSW conflict. - don't include tchar.h. it's inappropriate because it makes - compile-time distinctions when we want runtime distinctions. - (we provide our own tchar replacements) - - * toolbar.c: - use default object printer for toolbar-button. - - * unexcw.c: - make sure we don't encapsulate. - - * window.c (vars_of_window): - emphasize that temp-buffer-show-hook is obsolete. - -2000-08-05 Martin Buchholz <martin@xemacs.org> - - * glyphs.c (image_instance_hash): HASH2 wants EMACS_INT args. - (Fimage_instance_subwindow_id): make_int wants EMACS_INT arg. - - * events.c (Fevent_timestamp_lessp): - Not 64-bit clean. Use EMACS_INT, not int. - -2000-06-05 Andrew Begel <abegel@cs.berkeley.edu> - - * lrecord.h (lrecord_types): Changed lrecord_type_count to an - unsigned int and changed the last enum to - lrecord_type_last_built_in_type. - (lrecord_implementations_table): changed prototype to know how - long the array is supposed to be. - (lrecord_type_count): new unsigned int to keep track of the - current number of lisp lrecord types. - (DEFINE_EXTERNAL_LRECORD): - (DECLARE_EXTERNAL_LRECORD): Added these two for external - dynamic-modules to declare new lisp types. They are the same - as the non-EXTERNAL forms, but declare an lrecord_type unsigned - int for each new type, and increment lrecord_type_count by 1. - - * alloc.c (lrecord_implementations_table): Changed to reference - lrecord_type_last_built_in_type for the size of the array. - Moved MODULE_DEFINABLE_TYPE_COUNT to lrecord.h. - -2000-08-03 Yoshiki Hayashi <yoshiki@xemacs.org> - - * glyphs.h (check_valid_item_list): Renamed from - check_valid_item_list_1. - -2000-08-01 Alastair J. Houghton <ajhoughton@lineone.net> - - * select.c (Qselect_coerce): New. - * select.c (Vselection_coercion_alist): New. - * select.c (syms_of_select): Declare. - * select.c (get-selection-internal): Use it. - Use the new select-coerce functionality. - - * select.c (select_coerce): New. - * select.h (select_coerce): Declare. - New function to coerce one type of data into another. - -2000-08-03 Martin Buchholz <martin@xemacs.org> - - * callproc.c (Fcall_process_internal): - (Fcall_process_internal): - * process-unix.c (unix_create_process): - Save and restore the value of errno, so that error messages are accurate. - -2000-08-01 Martin Buchholz <martin@xemacs.org> - - * elhash.c (print_hash_table): - Fix printing of hash tables to also use `key-and-value' instead of `t'. - Prettify docstrings and indentation. - -2000-07-31 Yoshiki Hayashi <yoshiki@xemacs.org> - - * window.c (Fwindow_pixel_edges): Subtract frame border and - gutter size. - -2000-07-31 Andy Piper <andy@xemacs.org> - - * buffer.c (Frecord_buffer): make absolutely sure that redisplay - will acknowledge the change. - - * glyphs.h: declare tab_control_order_only_changed. - - * glyphs-x.c (x_tab_control_redisplay): use - tab_control_order_only_changed. - - * glyphs-widget.c (tab_control_order_only_changed): new function. - - * glyphs-msw.c (mswindows_tab_control_redisplay): use - tab_control_order_only_changed. - - * gui.c (gui_item_equal_sans_selected): new function. - (gui_item_equal): use it. - - * glyphs-msw.c (mswindows_combo_box_instantiate): deprecate - :properties in favor of :items.. - - * glyphs-widget.c (check_valid_item_list): rename from - check_valid_item_list_1. - (check_valid_item_list_1): renamed. - (combo_box_validate): deprecate :properties in favor of :items. - (widget_instantiate): ditto. - (tab_control_update): ditto. - (image_instantiator_combo_box): ditto. - (image_instantiator_tree_view): ditto. - (image_instantiator_tab_control): ditto. - (layout_post_instantiate): remove dead code. - - * print.c (debug_print_no_newline): only write to debugger if in - WIN32_NATIVE. - - * elhash.c (Fmake_hash_table): update doc string. - - * event-msw.c (mswindows_wnd_proc): don't allow processing of - messages whilst in GC. This at least stops XEmacs crashing but has - the potential for wierd behaviour. - -2000-07-31 Martin Buchholz <martin@xemacs.org> - - * config.h.in: - Make existence of s&m files optional. - - * s/bsd386.h: Remove HAVE_GETLOADAVG. - * s/freebsd.h: Remove HAVE_GETLOADAVG. - * s/gnu.h: Remove HAVE_GETLOADAVG. - * s/netbsd.h: Remove HAVE_GETLOADAVG. - * s/sol2.h: Remove HAVE_GETLOADAVG. - * lisp.h: Remove getloadavg() declaration. - * fns.c: - Include <sys/loadavg.h> if available. - Don't declare our own getloadavg() if HAVE_GETLOADAVG. - * config.h.in: Group together getloadavg()-related macros. - Use only configure-time tests to detect getloadavg(). - -2000-07-30 Martin Buchholz <martin@xemacs.org> - - * Makefile.in.in (TransientEmacsShell.o): Fix race condition. - -2000-07-25 Andy Piper <andy@xemacs.org> - - * syswindows.h: add tchar.h for native builds. - - * frame.c (syms_of_frame): remove set-glyph-image. - - * general-slots.h: add Qset_glyph_image. - - * glyphs-widget.c (layout_update): add domain arg to - set-glyph-image. - (syms_of_glyphs_widget): remove set-glyph-image. - -2000-07-23 Ben Wing <ben@xemacs.org> - - * dialog-msw.c (vars_of_dialog_mswindows): need to staticpro - Vpopup_frame_list. - -2000-07-22 Andy Piper <andy@xemacs.org> - - * symsinit.h: add syms_of_win32(). - - * gui-msw.c (syms_of_gui_mswindows): remove - Fmswindows_shell_execute. - (Fmswindows_shell_execute): moved to win32.c. - - * emacs.c (main_1): add syms_of_win32 (). - - * win32.c (init_potentially_nonexistent_functions): rewrite in - compiler-friendly terms. - (Fmswindows_shell_execute): move here from gui-msw.c. - (syms_of_win32): new. - - * device-msw.c (Fmswindows_printer_list): clean up args to - EnumPrinters. - Don't include tchar under cygwin or mingw. - (msprinter_default_printer): make cygwin-friendly. - -2000-07-21 Andy Piper <andy@xemacs.org> - - * glyphs-widget.c (image_instantiator_tree_view): use tab - control's update function. - (layout_property): new function. Retrieve items. - - * glyphs-msw.c (mswindows_tree_view_redisplay): new - function. Re-populate the tree view from the pending items. - - * glyphs.c (instantiate_image_instantiator): Make sure the domain - is designated the parent if the domain is an image instance. This - is needed so that dirtiness can be cascade up the hierarchy and - thus for layout children to be redisplayed correctly. - (allocate_image_instance): rename glyph -> parent. - - * redisplay.h: change redisplay_output_layout signature. - - * redisplay-msw.c (mswindows_output_display_block): use domain - arg. - - * redisplay-x.c (x_output_display_block): use domain arg. - -2000-07-10 Andy Piper <andy@xemacs.org> - - * window.c (Fset_window_configuration): add comment. - - * redisplay-output.c (compare_runes): - (redisplay_output_subwindow): redisplay rather than update subwindow. - (redisplay_output_layout): ditto. - - * redisplay-msw.c (mswindows_frame_output_end): - (mswindows_frame_output_end): make defer window pos optional. - - * lisp.h: add Flast. - - * glyphs.h (struct image_instantiator_methods): add dest_mask top - normalize method. Change update method to be for changed - instantiators. Add redisplay method. Change signature of layout - method. - (struct Lisp_Image_Instance): add instantiator. - (IMAGE_INSTANCE_INSTANTIATOR): new. - (IMAGE_INSTANCE_SUBWINDOW_FACE): new. - (XIMAGE_INSTANCE_INSTANTIATOR): new. - (XIMAGE_INSTANCE_SUBWINDOW_FACE): new. - - * glyphs.c: - (find_instantiator_differences): new function. - (Fset_instantiator_property): new convenience function. - (check_image_instance_structure): strictly check for vector - instantiators. - (normalize_image_instantiator): make non-static. - (instantiate_image_instantiator): pass on dest_mask and use new - signatures for image_instance_layout and friends. - (mark_image_instance): mark the instantiator. Mark the subwindow - face not the widget face. - (image_instance_equal): add instantiator. - (image_instance_hash): ditto. - (allocate_image_instance): ditto. - (Fset_image_instance_property): removed. - (Fimage_instance_file_name): ditto. - (Fcolorize_image_instance): ditto. - (image_instance_layout): add offsets to be set. - (update_image_instance): new function. update an image instance - from its changed instantiator. - (inherit_normalize): add dest_mask. - (xbm_normalize): ditto. - (xface_normalize): ditto. - (xpm_normalize): ditto. - (text_update): set_property -> update. - (image_instantiate): use the glyph identity as a hash key, not the - instantiator. - (glyph_width): use new image_instance_layout signature. - (glyph_ascent): ditto. - (glyph_descent): ditto. - (glyph_height): ditto. - (glyph_query_geometry): ressurrect. - (glyph_layout): ditto. - (redisplay_subwindow): update -> redisplay. - (syms_of_glyphs): add Fset_instantiator_property. - (image_instantiator_format_create): set_property -> update. - - * glyphs-x.c: - (autodetect_normalize): add dest_maks to signature. - (x_redisplay_subwindow): update -> redisplay. - (x_redisplay_widget): ditto. - (x_button_redisplay): ditto. - (x_progress_gauge_redisplay): ditto. - (x_tab_control_redisplay): ditto. Rewrite to cope with changed - stacking order. - (console_type_create_glyphs_x): update -> redisplay. - (image_instantiator_format_create_glyphs_x): ditto. - - * glyphs-widget.c: - (check_valid_instantiator): disallow glyphs in the instantiator, - they must now be vectors. - (check_valid_instantiator_list): ditto. - (glyph_instantiator_to_glyph): use internal symbol rather than - intern. - (widget_update): renamed from widget_set_property. Call cascaded - update methods. - (redisplay_widget): renamed from update_widget. - (widget_layout): image_instance_layout now takes position as well - as size. - (widget_normalize): ditto. - (widget_instantiate): ditto. - (tab_control_query_geometry) ditto.: - (tab_control_update): renamed from tab_control_set_property. - (progress_gauge_update): set_property -> update. - (layout_normalize): rewrite so that child instantiators are - normalized also. - (layout_update): new function. Create glyphs from the normalized - children and cope with any other layout keywords. We do not - instantiate children here that will be take care of by - redisplay_output_layout. - (layout_instantiate): call layout_update and not much else. - (layout_post_instantiate): not sure whether this is needed - anymore. - (layout_query_geometry): query glyph geometry rather than - image_instance geometry. - (layout_layout): set offsets from pass in parameters. Use glyph - geometry and layout functions rather than image instance ones. - (native_layout_layout): ditto. - (syms_of_glyphs_widget): add make-glyph and set-glyph-image. - (image_instantiator_widget): set_property -> update. - (image_instantiator_buttons): ditto. - (image_instantiator_progress_guage): ditto. - (image_instantiator_tab_control): ditto. - (VALID_LAYOUT_KEYWORDS): instantiators must now be vectors. - (image_instantiator_layout): add update method. - - * glyphs-msw.c (bmp_normalize): - (mswindows_resource_normalize): add dest_mask so that it can be - proprogated by layout_normalize. - (begin_defer_window_pos): make optional because it may not be the - right thing to do and it introduces differences with X. - (mswindows_unmap_subwindow): ditto. - (mswindows_map_subwindow): ditto. - (mswindows_redisplay_subwindow): renamed from - mswindows_update_subwindow. - (mswindows_redisplay_widget): ditto. - (mswindows_button_redisplay): renamed from - mswindows_button_update. Update is now what the instantiation - function does for a changed instantiator. - (mswindows_progress_gauge_instantiate): set the progress value - here if appropriate. - (mswindows_tab_control_redisplay): cope with re-ordering of the - members of the tab widget by simply selecting the new top - widget. This makes things appear ok if you click on a tab. - (mswindows_combo_box_instantiate): image_instance_layout now takes - position as well as size. - (mswindows_progress_gauge_redisplay): renamed from - mswindows_progress_gauge_update. - (console_type_create_glyphs_mswindows): fix update -> redisplay. - (image_instantiator_format_create_glyphs_mswindows): ditto. - - * glyphs-eimage.c (jpeg_normalize): - (gif_normalize): - (png_normalize): - (tiff_normalize): add dest_mask so that it can be proprogated by - layout_normalize. - - * elhash.c: - (print_hash_table): - (hash_table_weakness_validate): - (decode_hash_table_weakness): - (Fhash_table_weakness): - (Fhash_table_type): - (syms_of_elhash): use Ben's naming scheme for hashtable types.. - - * console.h (struct console_methods): move update_* to - redisplay_*. - -2000-07-20 Ben Wing <ben@xemacs.org> - - * *.[ch] (XSETOBJ): remove unused middle argument. - lisp-disunion.h: correct wrap_object() to one argument. - -2000-07-15 Ben Wing <ben@xemacs.org> - - * s/cygwin32.h: - * s/cygwin32.h (CYGWIN_CONV_PATH): - Add missing logb prototype for v1.1. - Use post-b20 names and alias to pre-b20 names when pre-b20. - - * s/windowsnt.h: [5]. - -2000-07-15 Ben Wing <ben@xemacs.org> - - * Makefile.in.in (x_objs): - * Makefile.in.in (sheap_objs): - * Makefile.in.in (objs): - added win32.o, cosmetic cleanups. - - * alloc.c (Fmake_byte_code): - [[[1]]]: Changes for new LIST_LOOP, EXTERNAL_LIST_LOOP, - etc. macros which declare their own args now. - - * alloc.c (syms_of_alloc): - [[[2]]]: Use DEFSYMBOL, DEFKEYWORD, DEFERROR and friends. - - * buffer.c: - Moved buffer-dedicated-frame, set-buffer-dedicated-frame into lisp. - - * buffer.c (Fget_file_buffer): - Fixed GCPRO problem. - - * buffer.c (get_truename_buffer): - Fixed comment about GC checking. - - * buffer.c (syms_of_buffer): - Undeclared those dedicated frame funs. - [2]. - - * buffer.h: - Define convenience macros for internal/external conversions. - [[[3]]]: Define codesys aliases Qcommand_argument_encoding - and Qenvironment_variable_encoding for cleaner code. - - * bufslots.h: - Remove dedicated-frame; in lisp. - - * bytecode.c (funcall_compiled_function): - [1]. - - * bytecode.c (syms_of_bytecode): - [2]. - - * console-msw.c: - * console-msw.c (mswindows_show_console): Rewrote. - - * console-msw.c (Fmswindows_debugging_output): New. - Sends to OutputDebugString (special MSWin debugger interface). - - * console-msw.c (Fmswindows_message_box): - Fixed stupid bugs so it works when called from kill-emacs. - - * console-msw.c (syms_of_console_mswindows): - Declare Fmswindows_debugging_output. - - * console-msw.h: - New MSWin prototypes. - - * console-msw.h (struct mswindows_frame): - New entry last-click-mods for improved button-modifier support. - - * console-msw.h (FRAME_MSWINDOWS_POPUP): - New struct entry `popup' with corresponding accessor. - - * console-x.c: - * console-x.c (split_up_display_spec): - * console-x.c (get_display_arg_connection): - * console-x.c (x_semi_canonicalize_console_connection): - * console-x.c (x_canonicalize_device_connection): - [[[6]]]: Change char to more specific type. - [[[8]]]: Make use of abstracting codesys aliases defined in [3], [4]; - - * console-x.c (x_semi_canonicalize_console_connection): - * console-x.c (x_canonicalize_device_connection): - [[[9]]]: Fix up error signalling to use new structured error system. - - * console-x.h: - [[[4]]]: Define codesys aliases: - Qlwlib_encoding, Qx_atom_name_encoding, Qx_font_name_encoding, - Qx_color_name_encoding, Qx_display_name_encoding. - - * console.h (struct console_methods): - New method make_dialog_box_internal supersedes older - popup_dialog_box method. - - * data.c: - Define many new errors, part of new structured errors. - - * data.c (init_errors_once_early): - * data.c (syms_of_data): - [2]. - - * device-msw.c (mswindows_init_device): - [[[5]]]: Cleanup to support NT 3.51. - - * device-msw.c (decode_devmode): Cleanup. - - * device-msw.c (mswindows_handle_print_setup_dialog_box): - * device-msw.c (mswindows_handle_print_dialog_box): - * device-msw.c (mswindows_handle_page_setup_dialog_box): - * device-msw.c (syms_of_device_mswindows): - Delete the dialog box primitives recently introduced by Kirill and - instead interface to general dialog box interface. - - * device-x.c: - * device-x.c (compute_x_app_name): - * device-x.c (x_init_device): - * device-x.c (Fx_valid_keysym_name_p): - * device-x.c (Fx_set_font_path): - [6]. - [7]. - - * device.h (wrap_device): New. - First of its kind; meant to replace XSETDEVICE. - - * dialog-msw.c: Many file-dialog symbols. - - * dialog-msw.c (mswindows_register_popup_frame): New. - * dialog-msw.c (mswindows_is_dialog_msg): New. - For supporting kbd traversal in dialog boxes. - - * dialog-msw.c (dialog_proc): - Support hitting ESC in dialogs. - - * dialog-msw.c (struct): - Common dialog box errors. - - * dialog-msw.c (handle_file_dialog_box): New. - Add file dialog code. - - * dialog-msw.c (handle_question_dialog_box): - Redo existing code to support new question dialog syntax. - - * dialog-msw.c (console_type_create_dialog_mswindows): - We support new dialog console method. - - * dialog-msw.c (syms_of_dialog_mswindows): - * dialog-msw.c (vars_of_dialog_mswindows): - New file dialog symbols, vars. - - * dialog-x.c: - * dialog-x.c (maybe_run_dbox_text_callback): - * dialog-x.c (dbox_descriptor_to_widget_value): - * dialog-x.c (x_make_dialog_box_internal): - * dialog-x.c (console_type_create_dialog_x): - Mule-ize entire file. - Redo to support question dialog syntax. - [6]. - - * dialog.c: - * dialog.c (Fmake_dialog_box_internal): - * dialog.c (syms_of_dialog): - Kill old popup-dialog-box, replace with new primitive. - Just call device method or signal error. - - * eldap.c (Fldap_open): - * eldap.c (Fldap_search_basic): - * eldap.c (Fldap_add): - * eldap.c (Fldap_modify): - [1]. - [7]. - - * emacs.c: - * emacs.c (make_arg_list_1): - * emacs.c (make_arg_list): - Mule-ize call to dll_init(). - [6]. - [8]. - - * emacs.c (make_argc_argv): - * emacs.c (free_argc_argv): - * emacs.c (init_cmdargs): - * emacs.c (main_1): - * emacs.c (Fkill_emacs): - * emacs.c (Fdump_emacs): - Update comments about what can be used in syms_* etc. - Call init_win32() when necessary. - Fix up MS Win dialog box in kill-buffer to actually work right. - [7]. - - * eval.c: - * eval.c (For): - * eval.c (Fand): - * eval.c (Fprogn): - * eval.c (Fprog1): - * eval.c (Fprog2): - * eval.c (FletX): - * eval.c (Flet): - * eval.c (condition_case_3): - * eval.c (Feval): - * eval.c (function_argcount): - * eval.c (funcall_lambda): - [1]. - - * eval.c (type_error): New. - * eval.c (maybe_type_error): New. - * eval.c (continuable_type_error): New. - * eval.c (maybe_continuable_type_error): New. - * eval.c (type_error_with_frob): New. - * eval.c (maybe_type_error_with_frob): New. - * eval.c (continuable_type_error_with_frob): New. - * eval.c (maybe_continuable_type_error_with_frob): New. - New functions for use with structured errors. - - * event-Xt.c: - * event-Xt.c (x_event_to_emacs_event): - Buttons are now modifiers too. - - * event-Xt.c (emacs_Xt_current_event_timestamp): - Implement new event method. - * event-Xt.c (reinit_vars_of_event_Xt): Set it. - - * event-msw.c: - * event-msw.c (ntpipe_shove_writer): [5]. - * event-msw.c (mswindows_enqueue_mouse_button_event): - * event-msw.c (mswindows_drain_windows_queue): - * event-msw.c (mswindows_wnd_proc): [7]. - * event-msw.c (mswindows_current_layout_has_AltGr): [5]. - * event-msw.c (mswindows_modifier_state): - Throughout: support new button modifiers. - - * event-msw.c (emacs_mswindows_current_event_timestamp): - Implement new event method. - * event-msw.c (reinit_vars_of_event_mswindows): Set it. - - * event-stream.c: - * event-stream.c (event_stream_current_event_timestamp): New. - * event-stream.c (maybe_kbd_translate): New functionality. - * event-stream.c (vars_of_event_stream): - Document new kbd-translate-table functionality. - - * event-stream.c (Fcurrent_event_timestamp): New. - New primitive for use in fabricated events. - * event-stream.c (syms_of_event_stream): [2]. Declare new primitive. - - * events-mod.h (XEMACS_MOD_BUTTON1): new button modifiers. - - * events.c: - * events.c (Fmake_event): - * events.c (WRONG_EVENT_TYPE_FOR_PROPERTY): - [1]. - [9]. - - * events.c (format_event_object): fix gcc warnings. - - * events.c (Fevent_timestamp): Document new primitives. - - * events.c (TIMESTAMP_HALFSPACE): New. - - * events.c (Fevent_timestamp_lessp): New. New primitive for - comparing timestamps correctly (half-space algorithm). - - * events.c (Fevent_modifier_bits): Doc fix. - - * events.c (Fevent_modifiers): Major doc addition. - * events.c (event_x_y_pixel_internal): Typo fix. - * events.c (syms_of_events): Declare new primitives. - - * events.h: - Update long comment for button modifiers, timestamps. - - * events.h (struct event_stream): - New current_event_timestamp method. - - * extents.c: - * extents.c (extent_in_region_p): - * extents.c (decode_extent): - * extents.c (Fset_extent_parent): - * extents.c (decode_map_extents_flags): - Fix gcc warnings. - [9]. - - * extents.c (struct extent_at_arg): - * extents.c (decode_extent_at_flag): - * extents.c (extent_at_mapper): - * extents.c (extent_at_bytind): - * extents.c (Fextent_at): Adapt to new lower-level interface. [9]. - * extents.c (Fextents_at): New primitive. [9]. - * extents.c (symbol_to_glyph_layout): [9]. - Support new primitive `extents-at'. - - - * extents.c (get_text_property_bytind): - extent_at_bytind has another arg. - [9]. - - * extents.c (syms_of_extents): New primitive. - - * file-coding.c (Fmake_coding_system): [1]. - * file-coding.c (subsidiary_coding_system): fix gcc warning - * file-coding.c (syms_of_file_coding): [2]. - - * fileio.c (Fexpand_file_name): - * fileio.c (Fsysnetunam): - * fileio.c (Ffile_exists_p): - * fileio.c (Ffile_executable_p): - * fileio.c (Fverify_visited_file_modtime): - Clean up GCPROing. - - * fileio.c (syms_of_fileio): [2]. - - * filelock.c (lock_file_1): - * filelock.c (current_lock_owner): - * filelock.c (lock_if_free): - * filelock.c (lock_file): - * filelock.c (unlock_file): - Clean up GCPROing. - - * fns.c (concat): Fix gcc warning. - - * fns.c (Fmember): - * fns.c (Fold_member): - * fns.c (Fmemq): - * fns.c (Fold_memq): - * fns.c (memq_no_quit): - * fns.c (Fassoc): - * fns.c (Fold_assoc): - * fns.c (Fassq): - * fns.c (Fold_assq): - * fns.c (assq_no_quit): - * fns.c (Frassoc): - * fns.c (Fold_rassoc): - * fns.c (Frassq): - * fns.c (Fold_rassq): - * fns.c (rassq_no_quit): - * fns.c (Fdelete): - * fns.c (Fold_delete): - * fns.c (Fdelq): - * fns.c (Fold_delq): - * fns.c (delq_no_quit): - * fns.c (Fremassoc): - * fns.c (Fremassq): - * fns.c (remassq_no_quit): - * fns.c (Fremrassoc): - * fns.c (Fremrassq): - * fns.c (remrassq_no_quit): - * fns.c (Freverse): - * fns.c (mapcar1): - [1]. - - * frame-msw.c (mswindows_init_frame_1): - * frame-msw.c (mswindows_delete_frame): - Register popups with dialog code so keyboard traversing works. - - * frame-tty.c (tty_raise_frame_no_select): [1]. - - * frame-x.c: - * frame-x.c (x_set_frame_text_value): - * frame-x.c (x_set_frame_properties): - * frame-x.c (x_create_widgets): - [7]. - - * frame.c: - * frame.c (Fmouse_pixel_position): Minor doc fixes. - - * frame.h (wrap_frame): New. - Macro like wrap_device. - - * general.c: - * general.c (SYMBOL): - * general.c (syms_of_general): - Major reorg. This is now just a wrapper and symbols themselves - are listed in general-slots.h. - - * glyphs-eimage.c (tiff_instantiate): Need cast to fix warning. - * glyphs-msw.c (mswindows_resource_instantiate): [5]. - - * glyphs-msw.c (mswindows_native_layout_instantiate): - Add DS_CONTROL so keyboard traversal will work. - - * glyphs-widget.c: - * glyphs-widget.c (syms_of_glyphs_widget): - Move some symbols to general-slots.h. - - * glyphs-x.c: - * glyphs-x.c (xbm_instantiate_1): - * glyphs-x.c (x_xbm_instantiate): - * glyphs-x.c (x_xface_instantiate): - * glyphs-x.c (autodetect_instantiate): - * glyphs-x.c (cursor_font_instantiate): - * glyphs-x.c (x_update_widget): - * glyphs-x.c (x_widget_instantiate): - * glyphs.c (bitmap_to_lisp_data): - * glyphs.c (pixmap_to_lisp_data): - [7]. - - * glyphs.c (syms_of_glyphs): - [2]. - - * gui-x.c: - * gui-x.c (print_widget_value): - * gui-x.c (menu_separator_style_and_to_external): - * gui-x.c (add_accel_and_to_external): - * gui-x.c (button_item_to_widget_value): - * gui-x.c (gui_items_to_widget_values_1): - * gui-x.c (gui_items_to_widget_values): - * gui-x.c (syms_of_gui_x): - * gui-x.c (vars_of_gui_x): - Mule-ize entire file. Move menu-no-selection-hook to gui.c. - [9]. - - * gui-x.h: - Muleize, prototype changes matching gui-x.c. - - * gui.c: - * gui.c (separator_string_p): - * gui.c (gui_item_add_keyval_pair): - * gui.c (make_gui_item_from_keywords_internal): - * gui.c (signal_too_long_error): - * gui.c (parse_gui_item_tree_item): - * gui.c (syms_of_gui): - * gui.c (vars_of_gui): - * gui.h: - menu-no-selection-hook moved here (used by MSWin). - Move some symbols to general-slots.h. - [6]. - [9]. - - * insdel.c (get_buffer_pos_char): - * insdel.c (get_buffer_range_char): - Add GC comments. - - * keymap.c (keymap_lookup_directly): - * keymap.c (keymap_store): - * keymap.c (ensure_meta_prefix_char_keymapp): - * keymap.c (describe_map): - * keymap.h: - Support new button modifiers. - - * lisp-disunion.h (wrap_object): - * lisp-disunion.h (XSETOBJ): - Rename make_obj to wrap_object. - - * lisp-union.h: - * lisp-union.h (make_int): - * lisp-union.h (make_char): - Support wrap_object. - - * lisp.h: - * lisp.h (LIST_LOOP): - * lisp.h (EXTERNAL_LIST_LOOP): - * lisp.h (LIST_LOOP_2): - * lisp.h (EXTERNAL_LIST_LOOP_1): - * lisp.h (EXTERNAL_LIST_LOOP_2): - * lisp.h (EXTERNAL_LIST_LOOP_3): - * lisp.h (EXTERNAL_LIST_LOOP_4_NO_DECLARE): - * lisp.h (PRIVATE_EXTERNAL_LIST_LOOP_6): - * lisp.h (GET_EXTERNAL_LIST_LENGTH): - * lisp.h (EXTERNAL_ALIST_LOOP_5): - * lisp.h (EXTERNAL_ALIST_LOOP_6): - * lisp.h (EXTERNAL_ALIST_LOOP_6_NO_DECLARE): - * lisp.h (EXTERNAL_PROPERTY_LIST_LOOP_5_NO_DECLARE): - * lisp.h (EXTERNAL_PROPERTY_LIST_LOOP_7): - * lisp.h (struct Lisp_Symbol): - * lisp.h (maybe_continuable_error_with_frob): - Fix up section comments. - Add new types for char to indicate usage. - Delete symbols auto-generated from general-slots.h. - Add prototypes for structured error functions. - Add long comments describing looping macros and change interface - so that lvalues are automatically declared. - Add NO_DECLARE macro in case callers want to declare lvalues - themselves. - - * lread.c (read_syntax_error): - * lread.c (continuable_read_syntax_error): - * lread.c (read_structure): - * lread.c (sequence_reader): - * lread.c (read_list_conser): - * lread.c (read_compiled_function): - Rename syntax_error and continuable_syntax_error to avoid clash - with same-named structured error functions. - - * menubar-msw.c (mswindows_translate_menu_or_dialog_item): - * menubar-msw.c (populate_menu_add_item): - * menubar-msw.c (populate_or_checksum_helper): - [5]. - [9]. - - * menubar-x.c: - * menubar-x.c (menu_item_descriptor_to_widget_value_1): - Mule-ize whole file. - - * menubar.c (Fnormalize_menu_item_name): Add optimization. - - * mule-charset.c (Fmake_charset): - * mule-wnnfns.c (Fwnn_set_param): - [1]. - - * ntproc.c (create_child): - * ntproc.c (Fwin32_set_current_locale): - Add comments portending doom. - - * objects-msw.c: - * objects-msw.c (old_font_enum_callback_2): - * objects-msw.c (font_enum_callback_1): - * objects-msw.c (mswindows_enumerate_fonts): - [5]. - - * objects-x.c: - * objects-x.c (allocate_nearest_color): - * objects-x.c (x_parse_nearest_color): - * objects-x.c (x_initialize_color_instance): - * objects-x.c (x_print_color_instance): - * objects-x.c (x_finalize_color_instance): - * objects-x.c (x_valid_color_name_p): - * objects-x.c (x_initialize_font_instance): - * objects-x.c (x_print_font_instance): - * objects-x.c (valid_x_font_name_p): - * objects-x.c (truename_via_FONT_prop): - * objects-x.c (truename_via_random_props): - * objects-x.c (truename_via_XListFonts): - * objects-x.c (x_font_truename): - * objects-x.c (x_font_instance_truename): - * objects-x.c (x_font_instance_properties): - * objects-x.c (x_list_fonts): - * objects-x.c (x_find_charset_font): - Mule-ize entire file. - [7]. - - * objects-x.h: - Mule-verify. - - * print.c: - * print.c (std_handle_out_external): - * print.c (debug_print_no_newline): - * print.c (syms_of_print): - Output to all debugger kinds in debug-print. - Fix console-output code under MSWin to actually work. - - * process-nt.c (send_signal): - * process-nt.c (nt_create_process): - Use newer Unicode macros. - - * process-unix.c (unix_create_process): - * process-unix.c (unix_canonicalize_host_name): - * process-unix.c (unix_open_network_stream): - [7]. - - * scrollbar-x.c: - Mule-verify. - - * search.c (syms_of_search): - [2]. - - * select-msw.c (mswindows_destroy_selection): - Use LIST_LOOP_2. - - * select-x.c (symbol_to_x_atom): - [7]. - - * select.c (syms_of_select): - [2]. - - * sound.c (Fplay_sound_file): - [7]. - - * specifier.c: - * specifier.c (decode_specifier_type): - * specifier.c (Fvalid_specifier_locale_type_p): - * specifier.c (check_valid_locale_or_locale_type): - * specifier.c (decode_locale): - * specifier.c (decode_locale_type): - * specifier.c (decode_locale_list): - * specifier.c (check_valid_domain): - * specifier.c (decode_specifier_tag_set): - * specifier.c (Fcanonicalize_tag_set): - * specifier.c (Fdefine_specifier_tag): - * specifier.c (Fspecifier_tag_predicate): - * specifier.c (check_valid_inst_list): - * specifier.c (check_valid_spec_list): - * specifier.c (decode_how_to_add_specification): - * specifier.c (check_modifiable_specifier): - * specifier.c (specifier_add_spec): - * specifier.c (boolean_validate): - * specifier.c (display_table_validate): - [9]. - - * specifier.c (syms_of_specifier): - Move some symbols to general-slots.h. - [2]. - - * symbols.c: - * symbols.c (Fmapatoms): - * symbols.c (Fapropos_internal): - Add GCPROs. - - * symbols.c (set_default_buffer_slot_variable): - * symbols.c (set_default_console_slot_variable): - [1]. - - * symbols.c (defsymbol_massage_name_1): - * symbols.c (defkeyword_massage_name): - * symbols.c (deferror_1): - * symbols.c (deferror): - * symbols.c (deferror_massage_name_and_message): - * symeval.h: - * symeval.h (DEFSYMBOL): - Support DEFSYMBOL*, DEFKEYWORD, DEFERROR - - * symbols.c (syms_of_symbols): - [2]. - - * symsinit.h: - * symsinit.h (init_win32): New. - Also new is syms_of_dialog_mswindows. - - * syswindows.h: - Add new Unicode macros, missing Cygwin wide-char functions, - convenience conversion macros for Qmswindows_tstr, macros for - encapsulating required MSWin <-> Cygwin filename conversions, - prototype for dynamically-extracted (not in NT 3.51) functions. - - * toolbar-x.c: - Mule-verify. - - * tooltalk.c (Fadd_tooltalk_message_arg): - * tooltalk.c (Fadd_tooltalk_pattern_attribute): - * tooltalk.c (Fadd_tooltalk_pattern_arg): - [7]. - - * tooltalk.c (syms_of_tooltalk): - [2]. - - * unexnt.c: - * unexnt.c (unexec): - Fix up headers, declaration of unexec() to be more standard. - -2000-07-20 Martin Buchholz <martin@xemacs.org> - - * offix.h: Revert change to guard macros - they're used in offix.c! - -2000-07-18 Kirill 'Big K' Katsnelson <kkm@dtmx.com> - - * lisp.h: Defsubred Fdelete. - - * console-msw.h: (msprinter_default_printer): Added. - - * console-msw.c (msprinter_canonicalize_console_connection): - (msprinter_canonicalize_device_connection): Added. - - * device-msw.c (msprinter_default_printer): - (Fmswingows_get_default_printer): - (signal_enum_priner_error): - (Fmswingows_printer_list): Added. - -2000-07-19 Martin Buchholz <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! - - * select-x.c (x_own_selection): Changed comment. - - * select-x.c (x_handle_selection_request): Use select_convert_out. - Don't mess with selection-alist; it's an internal variable of select.c. - - * select-x.c (x_get_foreign_selection): Use select_convert_in. - - * select-x.c (x_handle_selection_clear): Use get-selection-timestamp, - rather than messing with selection-alist. - - * select-msw.c (mswindows_get_foreign_selection): - Use TO_INTERNAL_FORMAT rather than hacking. - -2000-07-14 Martin Buchholz <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 (mswindows_destroy_selection): Declare it. New - function & alist to track GlobalAlloc()'d handles that need - releasing when the clipboard data gets replaced or emptied. - - * event-msw.c (mswindows_wnd_proc): Call it. - - * lisp.h, general.c (Qappend): New symbol representing a - `how-to-add' mode. - - * select.c (own-selection-internal): - * select.c (selection-exists-p): - * select.c (available-selection-types): New. - * select.c (register-selection-data-type): New. - * select.c (selection-data-type-name): New. New functions to deal - with device-specific selection data formats. - * select.c (selection-converter-out-alist): Renamed. - * select.c (selection-converter-in-alist): New. - * select.c (selection-appender-alist): New. Added new alists. - * select.c (syms_of_select, vars_of_select): Added new symbols & - variables. - * select.c (get_local_selection): Split. - * select.c: Removed spurious type checking - selections may now be - of any type, not just strings. - * select.c (own-selection-internal): - - * select.h, select.c (convert_selection): New. Created - convert_selection() function based on get_local_selection(). - * select.h, select.c (QCF_*): New symbols representing mswindows - clipboard formats. - * select.h, select.c (Qreplace_all, Qreplace_existing): New - symbols representing `how-to-add' modes. - - * select-msw.c (x_sym_p): New. - * select-msw.c (symbol_to_ms_cf): New. - * select-msw.c (ms_cf_to_symbol): New. New functions to deal with - symbols & clipboard formats. Can also handle string names. - * select-msw.c (mswindows_own_selection): - * select-msw.c (mswindows_selection_exists_p): - Added `data-type' parameter. Use it. - * select-msw.c (mswindows_available_selection_types): New. - * select-msw.c (mswindows_register_selection_data_type): New. - * select-msw.c (mswindows_selection_data_type_name): New. - * select-msw.c (mswindows_own_selection): - * select-msw.c (mswindows_get_foreign_selection): - * select-msw.c (mswindows_selection_exists_p): Rewrote. - * select-msw.c (console_create_select_mswindows): Added new methods. - * select-msw.c (mswindows_destroy_selection): New. - * select-msw.c (Vhandle_alist): New list. - * select-msw.c (mswindows_own_selection): - - * select-x.c (x_own_selection): - * select-x.c (x_selection_exists_p): - * select-x.c: Added some comments about maybe using new - functionality. - * select-x.c (x_own_selection): - - * specifier.c: Remove definition of Qappend (now in general.c) - * specifier.c (syms_of_specifier): Remove Qappend. - -2000-07-12 Martin Buchholz <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. - - 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): - * 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): - * callproc.c (child_setup): - * callproc.c (getenv_internal): - * callproc.c (init_callproc): - * callproc.c (vars_of_callproc): - [[[[1]]]]: WINDOWSNT -> WIN32_NATIVE. - __CYGWIN32__ -> CYGWIN. - DOS_NT -> WIN32_NATIVE. - Remove MSDOS support/references, converting to WIN32_NATIVE - where correct. - __MINGW32__ -> MINGW. - Fix windows.h includes. - Remove bogus HAVE_NTGUI. - - * config.h.in: - [2]. - - * console-msw.c: - mswindows_message_outputted added for use in allowing startup - errors on the console to be seen. - - * console-msw.c (msw_ensure_console_allocated): - * console-msw.c (msw_output_console_string): - * console-msw.c (DHEADER): - * console-msw.c (DOPAQUE_DATA): - * console-msw.c (DEVENT): - * console-msw.c (DCONS): - * console-msw.c (DCONSCDR): - * console-msw.c (DSTRING): - * console-msw.c (DVECTOR): - * console-msw.c (DSYMBOL): - * console-msw.c (DSYMNAME): - Fix warnings. - - * console-stream.c (stream_init_console): - Fix text/binary problems. - - * device-msw.c: - * device-msw.c (mswindows_finish_init_device): - * device-msw.c (mswindows_delete_device): - [1]. - - * device.c (handle_asynch_device_change): - [3]. - - * dgif_lib.c: - * dgif_lib.c (DGifOpenFileName): - * dgif_lib.c (DGifOpenFileHandle): - * dgif_lib.c (DGifGetLine): - * dgif_lib.c (DGifGetPixel): - Added config.h/lisp.h, fix up includes. - [1]. - - * dired-msw.c: - [4]. - - * dired.c: - * dired.c (file_name_completion): - * dired.c (Ffile_attributes): - * dired.c (syms_of_dired): - [1]. - - * dumper.c: - * dumper.c (pdump_file_unmap): - * dumper.c (pdump_load): - [1]. - - * editfns.c: - * editfns.c (Ftemp_directory): - * editfns.c (user_login_name): - * editfns.c (Fuser_real_login_name): - * editfns.c (get_home_directory): - [1]. - - * elhash.c (finish_marking_weak_hash_tables): - [[[[5]]]]: Fix GCC warnings. - - * emacs.c: - * emacs.c (mswindows_handle_hardware_exceptions): - * emacs.c (make_arg_list_1): - * emacs.c (main_1): - * emacs.c (Fkill_emacs): - * emacs.c (Fdump_emacs): - [1]. - Fix problems with nested crashes, add long comment. - - * event-Xt.c (init_event_Xt_late): - [1]. - - * event-msw.c: - * event-msw.c (mswindows_dde_callback): - * event-msw.c (mswindows_handle_sticky_modifiers): - * event-msw.c (mswindows_wnd_proc): - [1]. - [5]. - - * events.c (character_to_event): - [1]. - - * fileio.c: - * fileio.c (Ffile_name_directory): - * fileio.c (Ffile_name_nondirectory): - * fileio.c (directory_file_name): - * fileio.c (Fexpand_file_name): - * fileio.c (Fsubstitute_in_file_name): - * fileio.c (Ffile_name_absolute_p): - * fileio.c (check_executable): - * fileio.c (Ffile_readable_p): - * fileio.c (Ffile_accessible_directory_p): - * fileio.c (Ffile_modes): - * fileio.c (Funix_sync): - * fileio.c (vars_of_fileio): - [1]. [4]. - - [[[[7]]]]: Move CORRECT_DIR_SEPS to s\windowsnt.h. - - Expand getdefdir defn. - Fix bogus rename() comment. - - [[[[6]]]]: Fix Windows includes w.r.t. removed nt\inc. Attempt - to use standard XEmacs include files, e.g. sysfile.h, rather - than system-specific includes. - - * fns.c: - * fns.c (Fsubseq): - [5]. [6]. - - * frame.c (vars_of_frame): - [1]. - - * getloadavg.c: - * getloadavg.c (getloadavg): - [1]. [6]. - #ifdef XEMACS not defined on Cygwin. Remove this; no need for it. - (We don't use it elsewhere in the code; just add a comment.) - - * gif_io.c: - [6]. - Add config.h. - - * glyphs-msw.c: - * glyphs-msw.c (mswindows_resource_instantiate): - [1]. - - * glyphs-x.c (x_native_layout_instantiate): - [5]. - - * gui-msw.c (Fmswindows_shell_execute): - [1]. - - * insdel.c: - [4]. - - * lisp.h: - [4]. [5]. - - * lread.c (locate_file_in_directory_mapper): - [1]. - - * lstream.c: - [4]. - - * mem-limits.h: - * mem-limits.h (get_lim_data): - [1]. - - * menubar-msw.c: - [4]. - - * ndir.h: - [1]. - - * nt.c: - * nt.c (getwd): - * nt.c (closedir): - * nt.c (rva_to_section): - * nt.c (mswindows_executable_type): - [1]. [6]. - Fix closedir() defn. - - * nt.h: - [[[[8]]]]: *_OK defs moved to sysfile.h. - - * ntproc.c: - [6]. [7]. - - * objects-x.c: - [4]. - - * print.c: - * print.c (std_handle_out_external): - [1]. [4]. - - * process-nt.c: - * process-nt.c (nt_create_process): - [6]. - try to fix process quoting somewhat. - - * process-unix.c (unix_create_process): - [1]. - - * process.c: - * process.c (vars_of_process): - Add Vnull_device. - - * process.h: - [1]. - - * realpath.c: - * realpath.c (xrealpath): - [1]. - - * redisplay-tty.c (init_tty_for_redisplay): - [3]. - - * redisplay.c: - [4]. [6]. - - * scrollbar-msw.c: - [4]. - - * sheap.c: - * sheap.c (more_static_core): - * sheap.c (report_sheap_usage): - [5]. [6]. - - * signal.c: - * signal.c (alarm_signal): - [1]. [6]. - - * sound.c: - [6]. - - * strftime.c: - * strftime.c (zone_name): - [1]. [5]. - - * symsinit.h (init_sunpro): - [1]. - - * syscommctrl.h: - commctrl.h not in Cygwin b20.1. - - * sysdep.c: - * sysdep.c (endif): - * sysdep.c (sys_subshell): - * sysdep.c (init_baud_rate): - * sysdep.c (emacs_get_tty): - * sysdep.c (emacs_set_tty): - * sysdep.c (tty_init_sys_modes_on_device): - * sysdep.c (init_system_name): - * sysdep.c (sys_open): - * sysdep.c (interruptible_open): - * sysdep.c (sys_fopen): - * sysdep.c (sys_mkdir): - * sysdep.c (sys_rename): - * sysdep.c (get_process_times_1): - [1]. [6]. - - * sysdep.h: - [1]. - - * sysdir.h: - * sysdir.h (DIRENTRY_NONEMPTY): - [1]. [6]. - - * sysdll.c (dll_init): - * sysdll.h: - [1]. - - * sysfile.h: - [1]. [6]. [8]. - added text/binary defs. - - * sysfloat.h: - [1]. - - * sysproc.h: - * sysproc.h (EDESTADDRREQ): - * sysproc.h (poll_fds_for_input): - [1]. [6]. - - * syspwd.h: - [6]. - - * syssignal.h: - [1]. - - * systime.h: - [1]. [6]. - - * systty.h: - [1]. - - * syswindows.h: - [1]. - Always define WIN32_LEAN_AND_MEAN. - - * unexcw.c (unexec): - [5]. - - * unexec.c: - * unexec.c (copy_text_and_data): - * unexec.c (adjust_lnnoptrs): - [1]. - - * unexnt.c: - * unexnt.c (_start): - [1]. - -2000-06-07 Ben Wing <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. - - * 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. - - * 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. - - * 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, ntheap.h: + Removed unused find_section() and get_section_size(). * 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. - (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 initialized. - (layout_query_geometry): ditto. - (image_instantiator_native_layout): new function. Initialized the - native layout type. - (widget_instantiate): don't do layout stuff here. - - * glyphs.c (instantiate_image_instantiator): reorded calling or - instantiate and post_instantiate with layout in between. - (image_instance_layout): be more selective about deciding whether - the layout has been done or not. - - * glyphs.h (struct image_instantiator_methods): return a value - from layout_method. - -2000-04-26 Andy Piper <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. - (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. - (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> - - * frame-msw.c (mswindows_init_frame_1): - * frame-msw.c (mswindows_mark_frame): - * event-msw.c (mswindows_enqueue_dispatch_event): - * console-msw.h: - * console-msw.h (struct mswindows_frame): - * console-msw.h (FRAME_MSWINDOWS_WIDGET_HASH_TABLE1): - there are now three hash tables for callbacks. - mswindows_enqueue_dispatch_event is no longer static. - - * dialog-x.c (maybe_run_dbox_text_callback): - * dialog-x.c (dbox_descriptor_to_widget_value): - switch to new cons3 form for callbacks. - - * glyphs-msw.c (mswindows_register_gui_item): - * glyphs-msw.c (mswindows_widget_instantiate): - * glyphs-msw.c (add_tree_item): - * glyphs-msw.c (add_tab_item): - new image instance parameter, so it can be passed to callback-ex. - respect :callback-ex as well as :callback. - - * glyphs-widget.c (VALID_GUI_KEYWORDS): - add :callback-ex. - - * glyphs.c (print_image_instance): - prettify, e.g. now prints widget type. - - * gui-x.h: - certain funs have new image instance parameter. - - * gui.c: - * gui.c (get_gui_callback): - * gui.c (gui_item_add_keyval_pair): - * gui.c (gui_item_init): - * gui.c (gui_add_item_keywords_to_plist): - * gui.c (mark_gui_item): - * gui.c (gui_item_hash): - * gui.c (gui_item_equal): - * gui.c (copy_gui_item): - * gui.c (syms_of_gui): - recognize callback-ex in a number of places. - also, fix the annoying "can't get out of yes-no dialog" bug. - - * gui.h: - * gui.h (struct Lisp_Gui_Item): - recognize callback-ex in a number of places. - - * menubar-x.c (menu_item_descriptor_to_widget_value_1): - new parameter in button_item_to_widget_value. - - * glyphs-x.c (x_update_widget): - * glyphs-x.c (x_button_instantiate): - * glyphs-x.c (x_button_update): - * glyphs-x.c (x_progress_gauge_instantiate): - * glyphs-x.c (x_edit_field_instantiate): - * glyphs-x.c (x_combo_box_instantiate): - * glyphs-x.c (x_tab_control_instantiate): - * glyphs-x.c (x_label_instantiate): - new image instance parameter in various places. - - * event-Xt.c: - * event-Xt.c (enqueue_Xt_dispatch_event): - this fun gets exported. - - * gui-msw.c: - * gui-msw.c (mswindows_handle_gui_wm_command): - handle both :callback and :callback-ex, and generate our own - event because it's one of the callback-ex arguments. - - * gui-x.c: - * gui-x.c (popup_selection_callback): - handle both :callback and :callback-ex, and generate our own - event because it's one of the callback-ex arguments. - * gui-x.c (button_item_to_widget_value): - * gui-x.c (gui_items_to_widget_values_1): - * gui-x.c (gui_item_children_to_widget_values): - * gui-x.c (gui_items_to_widget_values): - new image instance parameter in various places. - - * fns.c (Freplace_list): - fix small typo in doc string. - - * lisp.h: - declare enqueue_Xt_dispatch_event. - -2000-04-28 Ben Wing <ben@xemacs.org> - - * 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*. + 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. - * postgresql.h: Remove references to PGsetenvHandler object. - * lrecord.h (lrecord_type): Ditto. +1998-07-09 Jonathan Harris <jhar@tardis.ed.ac.uk> -2000-04-11 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * filelock.c: Removed Vconfigure_lock_directory - already + defined in emacs.c. - * glyphs-msw.h (struct mswindows_image_instance_data): Added - real_heigh and real_width members, and accessor macros for these. + * frame-msw.c: Removed Qinitially_unmapped and Qpopup - already + defined in frame.c and general.c respectively. - * 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. + * glyphs-msw.c: Removed Qresource - already defined in + general.c. - * redisplay-msw.c (mswindows_output_dibitmap): Stretch real mask - and bitmap to their surface size. +1998-07-05 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> -2000-04-11 Jan Vroonhof <jan@xemacs.org> + * eldap.c (Fldap_search_internal): Docstring fixes - * process-unix.c (unix_send_process): Guard against process MIA - after Faccept_process_output. +1998-07-04 Jonathan Harris <jhar@tardis.ed.ac.uk> -2000-04-11 Ben Wing <ben@xemacs.org> + * nt.c (init_environment): Removed unused PRELOAD_WINSOCK, + EMACSDOC and TERM variables. Added EMACSDEBUGPATHS, + EMACSPACKAGEPATH and INFOPATH variables. + Removed unused get_emacs_configuration function. - * eval.c (unbind_to_hairy): fix brokenness introduced by - nanosecond speed improvements. + * s/windowsnt.h: Don't define EMACS_CONFIGURATION here because + it is now defined at build-time by the makefile. -2000-04-07 Raymond Toy <toy@rtp.ericsson.se> +1998-07-01 James N. Potts <jnpotts@plutonium.net> - * sunplay.c (init_device): To play sounds correctly, the device - apparently needs to be initialized at least once by XEmacs. Make - it so. + * 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. -2000-04-10 IKEYAMA Tomonori <tomonori@suiyokai.org> +1998-07-05 Andy Piper <andyp@parallax.co.uk> - * redisplay.c (add_margin_runes): Add text image glyph - handling. + * 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. -2000-04-06 Yoshiki Hayashi <yoshiki@xemacs.org> +1998-07-06 Olivier Galibert <galibert@pobox.com> - * lisp.h (DOESNT_RETURN): Don't declare as volatile when - gcc is newer than 2.5. + * glyphs-x.c (convert_EImage_to_XImage): Fix pixel writing problem + when the X server endianness is different than the client's one. -2000-04-06 Colin Rafferty <colin@xemacs.org> +1998-06-29 Kyle Jones <kyle_jones@wonderworks.com> - * lisp.h (FLEXIBLE_ARRAY_STRUCT_SIZEOF): Created. + * 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. - * 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. +1998-06-24 Jonathan Harris <jhar@tardis.ed.ac.uk> -2000-04-06 Andy Piper <andy@xemacs.org> + * 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. - * gmalloc.c (malloc): undo previous change. - (malloc): ditto. - (free): ditto. - (realloc): ditto. +1998-06-24 Adrian Aichner <aichner@ecf.teradyne.com> -2000-04-06 IKEYAMA Tomonori <tomonori@suiyokai.org> + * process-nt.c (nt_create_process): Try appending the standard + executable file extensions to the filename if none supplied. - * line-number.c (buffer_line_number): Revert to former version. +1998-06-29 SL Baur <steve@altair.xemacs.org> -2000-04-06 Andy Piper <andy@xemacs.org> + * fileio.c (Fsubstitute_in_file_name): Enable double slash notation + for cygwin32. + From Keisuke Mori <ksk@ntts.com> - * gmalloc.c (malloc): add error checking. - (malloc): ditto. - (free): ditto. - (realloc): ditto. +1998-06-24 Andy Piper <andyp@parallax.co.uk> - * dialog-x.c (dbox_descriptor_to_widget_value): add extra - button_item_to_widget_value arg. + * 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. - * 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. +1998-06-29 Kyle Jones <kyle_jones@wonderworks.com> - * 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. + * 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. - * gui-x.h: change signature of button_item_to_widget_value. +1998-06-29 SL Baur <steve@altair.xemacs.org> - * menubar-x.c (menu_item_descriptor_to_widget_value_1): add extra - button_item_to_widget_value arg. + * 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. -2000-04-03 Yoshiki Hayashi <yoshiki@xemacs.org> +1998-06-22 Jonathan Harris <jhar@tardis.ed.ac.uk> - * buffer.h (struct buffer): auto_save_modified should be long. + * event-msw.c: Guard against recursion when freeing + FRAME_MSWINDOWS_TARGET_RECT struture in WM_SIZE processing. -2000-04-05 Andy Piper <andy@xemacs.org> + * frame-msw.c: Don't set WS_VISIBLE attribute on first frame. + Call ShowWindow twice in init_frame_3 to get round runemacs + weirdness. - * glyphs-widget.c (widget_instantiate): pixwidth != pixheight - type. - (button_query_geometry): give a little more room so that athena - buttons fit. +1998-06-27 Hrvoje Niksic <hniksic@srce.hr> -2000-04-05 Andy Piper <andy@xemacs.org> + * scrollbar.c (vertical_scrollbar_changed_in_window): Ditto. - * faces.c (complex_vars_of_faces): The widget face should inherit - the font of the gui-element face. + * winslots.h: Rename. -2000-04-04 Andy Piper <andy@xemacs.org> + * 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. - * 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. +1998-06-22 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> -2000-04-02 Andy Piper <andy@xemacs.org> + * unexaix.c: Line number information works correctly again. - * frame.c (change_frame_size_1): The introduction of gutters means - that we need to allow 0 as a potential frame dimension. +1998-06-22 Olivier Galibert <galibert@pobox.com> -2000-04-02 IKEYAMA Tomonori <tomonori@suiyokai.org> + * emacs.c (__sti__iflPNGFile_c___): Added. See comment. Cry. - * 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. +1998-06-21 Martin Buchholz <martin@xemacs.org> - * 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. + * 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> -2000-03-16 IKEYAMA Tomonori <tomonori@suiyokai.org> + * console-msw.h: added a list of fonts to device data. - * redisplay.c (add_glyph_rune): Adding text image as text runes. + * device-msw.c: enumerate list of available fonts in + mswindows_init_device. Free list in mswindows_delete_device. - * redisplay-output.c (redisplay_move_cursor): NO_CURSOR if text - not in buffer + * 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. - * 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 +1998-06-23 Greg Klanderman <greg@alphatech.com> -2000-02-02 Mike Alexander <mta@arbortext.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. - Note: Some of these were committed by accident as part of other - patches. + * redisplay.c (decode_mode_spec): for current-column, show + window's point's column, not buffer's point's column. - * regex.c (regex_compile): Avoid compiler warnings. +1998-06-23 Andy Piper <andyp@parallax.co.uk> - * ntproc.c (sys_spawnve): Avoid compiler warnings. + * 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. - * nt.h: Declare term_ntproc correctly. + * console-msw.h: declare mswindows_enqueue_magic_event. - * nt.c: Remove incorrect declaration of get_home_directory which - is declared correctly in lisp.h. + * event-msw.c (mswindows_enqueue_magic_event): make global. - * keymap.c (get_keyelt): Avoid compiler warnings. - (raw_lookup_key_mapper): Avoid compiler warnings. +1998-06-24 Hrvoje Niksic <hniksic@srce.hr> - * gutter.c (gutter_was_visible): Add return statement to avoid warning. + * 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. - * glyphs-eimage.c (png_instantiate): Avoid compiler warnings. +1998-06-21 Olivier Galibert <galibert@pobox.com> - * filemode.c (mode_string): Avoid compiler warnings. + * lisp-disunion.h (XMARKBIT): Have XMARKBIT return something + suitable for an int used as a boolean (btw, C sucks.). - * file-coding.c (Fcoding_system_aliasee): Add return statement to - avoid warning. +1998-06-18 Andy Piper <andyp@parallax.co.uk> - * events-mod.h: Undef some things that winuser.h defines differently. + * object-msw.c: remove warnings. - * data.c (Faset): Avoid compiler warnings. + * device-msw.c: #define wrongly named cygwin structure elements. - * alloc.c (Fmake_byte_code): Avoid compiler warnings. + * s/cygwin32.h: define DEMI_BOLD -2000-03-03 Jan Vroonhof <vroonhof@math.ethz.ch> +1998-06-19 Jonathan Harris <jhar@tardis.ed.ac.uk> - * sound.c (Fplay_sound_file): Wrap ESD in start/stop_interrupts. - Fall through to simple beep on error. - Replace "extern" by real header file. + * 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. - * linuxplay.c: Use nativesound.h - (play_sound_data): Return error code. Be less verbose on error. +1998-06-19 Jonathan Harris <jhar@tardis.ed.ac.uk> - * sunplay.c: Use nativesound.h - (play_sound_data): Return error code. Be less verbose on error. + * console-msw.h: added a list of fonts to device data. - * ntplay.c: Use nativesound.h - (play_sound_data): Return fake error code + * device-msw.c: enumerate list of available fonts in + mswindows_init_device. Free list in mswindows_delete_device. - * sgiplay.c: Use nativesound.h - (play_sound_data): Return error code + * 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. - * hpplay.c: Use nativesound.h, partially implement - new error code. Break compilation until finished. - (play_sound_data): error code. +1998-06-15 Jonathan Harris <jhar@tardis.ed.ac.uk> - * 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. + * 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. -2000-03-27 Andy Piper <andy@xemacs.org> +1998-06-19 David Bush <david.bush@adn.alcatel.com> - * glyphs.c (image_instantiate): be careful to check in the same - way we assigned. + * 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 -2000-03-27 Didier Verna <didier@xemacs.org> + * 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. - * config.h.in: define the proper SMART_INCLUDE macro. - handle renaming of `foo_h_path' to `foo_h_file'. + * lisp.h: Declare user_login_name - * database.c: ditto. +1998-06-18 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> - * emacs.c: ditto. + * unexaix.c (make_hdr): Fixed bias computations so debugging info + works again. + Some other insignificant nitpicks. - * linuxplay.c: ditto. +1998-06-18 Andy Piper <andyp@parallax.co.uk> - * terminfo.c: ditto. + * toolbar-msw.c (mswindows_output_toolbar): specify ILC_MASK when + creating the image list and make sure he bk color is transparent. - * tooltalk.h: ditto. +1998-06-18 Jan Vroonhof <vroonhof@math.ethz.ch> -2000-03-27 Andy Piper <andy@xemacs.org> + * event-Xt.c (emacs_Xt_remove_timeout): Also remove timeout from + completed_timeouts. The timer could have expired. - * glyphs-msw.c (mswindows_update_widget): make sure the widget - gets updated whenever the face might have changed. +1998-06-17 Andy Piper <andyp@parallax.co.uk> -2000-03-26 Mike Alexander <mta@arbortext.com> + * console-msw.h: move XEMACS_RECT_WH inside frame + parameters. define macors to access it. - * dumper.c (pdump_resource_free): Fix the comment. + * 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. -2000-03-21 Olivier Galibert <galibert@pobox.com> + * event-msw.c: in WM_SIZE use mswindows_size_frame_internal rather + than duplicated code. - * input-method-xlib.c (XIM_init_frame): Remove painful warning. +1998-06-15 Colin Rafferty <colin@xemacs.org> -2000-03-22 Mike Alexander <mta@arbortext.com> + * Makefile.in.in: Made EXTW_LINK expand properly. - * 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. +1998-06-12 Martin Buchholz <martin@xemacs.org> -2000-03-25 Mike Alexander <mta@arbortext.com> + * redisplay.c (vars_of_redisplay): default value of + column-number-start-at-one should be NIL! - * gui.c (copy_gui_item_tree): Return a value in all cases +1998-06-11 Martin Buchholz <martin@xemacs.org> -2000-03-21 Didier Verna <didier@xemacs.org> + * casefiddle.c: + (upcase-initials "fooBar") ==> "FooBar" instead of "Foobar" - * 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. +1998-06-05 Hrvoje Niksic <hniksic@srce.hr> - * postgresql.c: use it. + * eldap.c (Fldap_search_internal): Use build_ext_string instead of + build_string to avoid crashes under Mule. - * inline.c: ditto. +1998-06-13 Andy Piper <andyp@parallax.co.uk> -2000-03-24 Andy Piper <andy@xemacs.org> + * ntplay.c (play_sound_data_1): don't delete the sound data until + the next sound is played and the previous one finished. - * gutter.c (redraw_exposed_gutters): must be "in display" when we - do this. +1998-06-10 Samuel Mikes <smikes@alumni.hmc.edu> -2000-03-24 Andy Piper <andy@xemacs.org> + * fileio.c (directory-sep-char): Escape backslashes. - * 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. +1998-06-10 Hrvoje Niksic <hniksic@srce.hr> - * glyphs.h: declare new functions. - (struct Lisp_Image_Instance): remove percent and associated - accessors. + * event-stream.c: Fix docstring reference. - * gui.h: declare new copying functions. +1998-06-12 Hrvoje Niksic <hniksic@srce.hr> - * 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. + * alloc.c (make_float): Remove useless initialization of `next' + field. + (make_pure_float): Ditto. - * 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. + * lisp.h (struct Lisp_Float): Rename `next' to `__unused__next'. - * glyphs-widget.c (update_widget): update items here. - (progress_gauge_set_property): use items for storing value. Put - new value in pending items. +1998-06-08 Kirill M. Katsnelson <kkm@kis.ru> - * 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. + * fileio.c (Fmake_directory_internal): Remove conditionals + on WINDOWSNT when calling mkdir. - * 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. + * ntproc.c: Deleted the following unused functions: + register_child, reap_subprocess, sys_wait. - * gutter.c (syms_of_gutter): use -hook. + * 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. -2000-03-20 Yoshiki Hayashi <yoshiki@xemacs.org> + * sysdep.c: Removed MS-DOS code. + (sys_rename): Deal with Microsoft rename weirdness. + (sys_open): Implemented for Windows. + (sys_fopen): Ditto. + (sys_mkdir): Ditto. - * 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. +1998-06-08 Kirill M. Katsnelson <kkm@kis.ru> -2000-03-21 Ben Wing <ben@xemacs.org> + * buffer.c (complex_vars_of_buffer): Removed %t description from + the docstring. - * ntproc.c (create_child): remove bogus HAVE_NTGUI's. - From Mike Alexander <mta@arbortext.com>. +1998-06-04 Rick Rankin <Rick_Rankin-P15254@email.mot.com> -2000-03-21 Ben Wing <ben@xemacs.org> + * 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). - * 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. +1998-06-04 Kirill M. Katsnelson <kkm@kis.ru> -2000-03-21 Martin Buchholz <martin@xemacs.org> + * event-stream.c: Defined Qcancel_mode_internal. + (syms_of_event_stream): defsymbol'ed it. - * Makefile.in.in: Coalesce HAVE_NATIVE_SOUND code fragments. + * events.h: Externed it. -2000-03-20 Andy Piper <andy@xemacs.org> + * event-msw.c (mswindows_wnd_proc, WM_CANCELMODE): Added this handler. - * glyphs.c (full_list_hash): make hashes of the same elements in - different orders return different values. +1998-06-04 Oliver Graf <ograf@fga.de> -2000-03-20 Martin Buchholz <martin@xemacs.org> + * 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 - * XEmacs 21.2.32 is released. +1998-06-03 Kirill M. Katsnelson <kkm@kis.ru> -2000-03-20 Martin Buchholz <martin@xemacs.org> + * process-nt.c (signal_cannot_launch): Use signal_simple_error() + instead of error(). - * 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. +1998-06-03 Kirill M. Katsnelson <kkm@kis.ru> - * 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. + * dialog-msw.c (button_width): Removed `inline' from the function + declaration. -2000-03-16 Martin Buchholz <martin@xemacs.org> +1998-06-03 Rick Rankin <Rick_Rankin-P15254@email.mot.com> - * sysfile.h: - Make sure PATH_MAX is always defined. - Include limits.h for PATH_MAX. - Deprecate use of MAXPATHLEN. + * frame-msw.c: add WS_VISIBLE flag to the first frame created. + Note that adding this flag to subsequent frames causes problems. -2000-03-10 Martin Buchholz <martin@xemacs.org> +1998-06-03 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> - * 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. + * glyphs-eimage.c (png_instantiate) move 'struct + png_memory_storage tbr' out of nested block to avoid dangling + reference -2000-03-20 Andy Piper <andy@xemacs.org> +1998-06-02 Andy Piper <andyp@parallax.co.uk> - * glyphs.c (image_instantiate): allow text glyphs to be - instantiated in the minibuffer window. + * faces.h: + * faces.c: rename 3d-object -> gui-element. add toolbar face which + inherits from gui-element. -2000-03-19 Andy Piper <andy@xemacs.org> + * glyphs-msw.c: use DIBitmaps for xbm bitmaps to be consistent + with existing code, generate masks correctly. - * glyphs.c (image_instance_hash): be careful about which items we - hash on. +1998-06-03 P. E. Jareth Hein <jareth@camelot-soft.com> - * glyphs-widget.c (tab_control_set_property): record into pending - items rather than the actual items. + * glyphs-eimage.c: Changed included header for gifs to use + Gifreader instead of giflib. - * glyphs-x.c (x_update_widget): use pending items to update with. + * glyphs-x.c: removed the image-related functions that were + moved into glyphs-eimage. - * glyphs-msw.c (mswindows_tab_control_update): use pending items - to update with. +1998-06-02 David Bush <david.bush@adnb.alcatel.com> - * glyphs.c (mark_image_instance): mark pending items. + * glyphs.c (bitmap_to_lisp_data) Define XFree to be free + if built without X Windows support. - * window.c (Fset_window_configuration): record the buffer. - (Fselect_window): totally revert previous change which breaks many - things. +1998-06-02 Hrvoje Niksic <hniksic@srce.hr> -2000-03-18 Andy Piper <andy@xemacs.org> + * fns.c (Fconcat): Synch docstring with new reality. - * glyphs-msw.c (mswindows_tab_control_update): force selected - item. +1998-06-03 SL Baur <steve@altair.xemacs.org> - * 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. + * frame.c: Remove reference to msdos.h (which is going away). + Suggested by Hrvoje Niksic and Kirill Katsnelson. - * gui.c (parse_gui_item_tree_list): add probably unnecessary - gcpros. - (parse_gui_item_tree_children): ditto. - (parse_gui_item_tree_item): ditto. +1998-06-02 P. E. Jareth Hein <jareth@camelot-soft.com> - * glyphs.c (Fupdate_widget_instances): return something. + * glyphs-eimage.c (jpeg_instantiate): Fix handling of + grayscale images/ -2000-03-18 Yoshiki Hayashi <yoshiki@xemacs.org> - * window.c (Fselect_window): Undo 2000-03-17 change. +1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> -2000-03-17 SL Baur <steve@musashimaru.m17n.org> + * events.h: Fixed commentary about misc-user scrollbar events. - * postgresql.c (Fpq_setenv): Remove this turkey when linking - against v7.0 libraries. Insta-coredump city until the postgres - folks fix it. + * 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. -2000-03-17 Andy Piper <andy@xemacs.org> +1998-05-29 Andy Piper <andyp@parallax.co.uk> - * faces.c (complex_vars_of_faces): don't give the widget face an - inherited background pixmap. + * 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. - * glyphs-msw.c (mswindows_tab_control_instantiate): select the - selected item. +1998-06-01 SL Baur <steve@altair.xemacs.org> - * event-stream.c (Fdispatch_non_command_events): return something. + * mule-mcpath.c (mc_chdir): Reverse parameters in call to memcpy. + * msdos.c (Frecent_doskeys): Ditto. - * gutter.c (output_gutter): use widget face. - (clear_gutter): ditto. + * unexalpha.c (unexec): Reverse parameters in call to memcpy. + Suggested by Reggie Perry <perry@zso.dec.com> - * NEWS: adjust again. + * buffer.h: Eliminate size in declaration. - * 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. +1998-06-01 Olivier Galibert <galibert@pobox.com> - * glyphs.h (IMAGE_INSTANCE_HASH_DEPTH): increase. + * unexelfsgi.c (unexec): Cleanup n/nn and remove useless kludge. -2000-03-16 Olivier Galibert <galibert@pobox.com> +1998-06-01 Kirill M. Katsnelson <kkm@kis.ru> - * emacs.c (Frunning_temacs_p): Revert previous patch. - (main_1): Reinitialize running_temacs_argc if pdump_load succeeds. + * gui.c (gui_item_init): Changed the default value for config member + from Qunbound to Qnil. -2000-03-16 Andy Piper <andy@xemacs.org> +1998-06-01 Greg Klanderman <greg@alphatech.com> - * glyphs-x.c (x_tab_control_update): if no widget values then - return. + * indent.c (vmotion_pixels): Don't #define abs(). - * NEWS: update for new features. +1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> - * 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. + * s/windowsnt.h: Defined popen and pclose to be _popen and _pclose + respectively. - * events.h (struct event_stream): add force_event_pending. +1998-05-30 Andy Piper <andyp@parallax.co.uk> - * specifier.c (recompute_one_cached_specifier_in_window): add - comment. + * glyphs.h: add xbm declarations. - * redisplay.c (redisplay_frame): don't call - update_frame_subwindows. Reset subwindow cachels when - subwindows_changed, removing this was an optimization too far. + * console.h: add xbm_instantiate_method device method. - * 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. + * 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. - * 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. + * 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. - * gutter.c: (specifier_vars_of_gutter): use new spec changed + * 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. - (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> +1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> - * config.h.in: Add symbols HAVE_POSTGRESQL and HAVE_POSTGRESQLV7 + * 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. - * inline.c: Include postgresql.h lrecord stuffs to placate buggy - GCCs. + * procimpl.h (struct process_methods): Changed semantics of + create_process method so it accepts lisp strings instead of + char pointers. - * emacs.c (main_1): Call postgres initialization code. + * process.c (Fstart_process_internal): Moved building of + unix style argv from here to process-unix.c, ... - * postgresql.h: New file. PostgreSQL RDBMS support. - * postgresql.c: New file. + * process-unix.c (unix_create_process): ... right here. -2000-03-08 Yoshiki Hayashi <yoshiki@xemacs.org> + * process-nt.c (nt_create_process): Changed this function to + support new semantics, so avoided a GC problem. - * redisplay-output.c (redisplay_output_display_block): Disable - redundant code. + * 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. -2000-03-09 Yoshiki Hayashi <yoshiki@xemacs.org> + * 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. - * 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. + * console-msw.h: Removed prototype for mswindows_bump_queue(). + Added prototype for mswindows_enqueue_misc_user_event(). -2000-03-09 Yoshiki Hayashi <yoshiki@xemacs.org> + * menubar-msw.c (mswindows_handle_wm_command): Use + mswindows_enqueue_misc_user_event(). - * emacs.c (main_1): Always call syms_of_gui. - * inline.c: include gui.h + * toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto. -2000-03-09 Yoshiki Hayashi <yoshiki@xemacs.org> + * dialog-msw.c (dialog_proc): Ditto. - * 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. + * scrollbar-msw.c (mswindows_handle_scrollbar_event): Ditto. + (mswindows_handle_scrollbar_event): Use frame, not window, for misc + user events channel. -2000-03-08 Andy Piper <andy@xemacs.org> +1998-05-29 Greg Klanderman <greg@alphatech.com> - * buffer.c (Frename_buffer): record new buffer name the right way. + * 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. -2000-03-08 Andy Piper <andy@xemacs.org> + * 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. - * glyphs.c (update_subwindow): increase hash depth so that widget - items get picked up properly. +1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> - * redisplay-output.c (compare_runes): increase hash depth so that - widget items get picked up properly. + * toolbar.h: Removed misleading commentary, as Martin suggested. -2000-03-08 Andy Piper <andy@xemacs.org> +1998-05-30 Kirill M. Katsnelson <kkm@kis.ru> - * gutter.c (output_gutter): add some debug. + * lisp.h: Extern Qactivate_menubar_hook. - * glyphs.h (struct Lisp_Image_Instance): add display_hash. - (IMAGE_INSTANCE_DISPLAY_HASH): new macro. - (XIMAGE_INSTANCE_DISPLAY_HASH): ditto. + * menubar-msw.c (unsafe_handle_wm_initmenu_1): Pass correct value to + run_hook (). - * redisplay-output.c (compare_runes): use display_hash to - determine if glyphs really are not the same. +1998-05-29 Andy Piper <andyp@parallax.co.uk> - * 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. + * glyphs-msw.c: use BPLINE macro. -2000-03-07 Yoshiki Hayashi <yoshiki@xemacs.org> + * select-msw.c (mswindows-selection-exists-p) + (mswindows-delete-selection): doc string fixes. - * redisplay.h: Fix comment style. + * toolbar-msw.c (mswindows_output_toolbar): make disabled buttons + unpressable. warning elimination. -2000-03-08 Jonathan Harris <jhar@tardis.ed.ac.uk> +1998-05-28 Martin Buchholz <martin@xemacs.org> - * 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. + * alloc.c (dbg_constants): + * dbxrc: + * gdbinit: + Remove toolbar_data debugging code, since that lrecord has + also been removed. - * 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. +Wed May 27, 1998 Darryl Okahata <darrylo@sr.hp.com> - * frame-msw.c (mswindows_init_frame_1): initialise paint_pending flag. + * alloc.c: zap cached value of (user-home-directory), so that + it's not undumped. -2000-03-07 Didier Verna <didier@xemacs.org> + * 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. - * dired.c: #include `regex.h' after `sysfile.h'. + * buffer.h: Added extern entries for initial_directory[] and + init_initial_directory(). -2000-03-06 Martin Buchholz <martin@xemacs.org> + * 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. - * sound.c (init_nas_sound): Fix compiler warning. + * emacs.c: Rearrange NT initialization order so that + environment/registry variables will be properly entered into + Vprocess_enviroment. - * alloc.c (ALIASING_VOIDPP_DEREFERENCE): New. - (FREE_STRUCT_P): - (MARK_STRUCT_AS_FREE): - (MARK_STRUCT_AS_NOT_FREE): - Make `gcc -fstrict-aliasing' work properly. + * fileio.c: replaced egetenv("HOME") with calls to the new + get_home_directory(). -2000-03-07 Jonathan Harris <jhar@tardis.ed.ac.uk> + * lisp.h: Added function prototypes for uncache_home_directory() + and get_home_directory(), along with lisp prototypes for + Fuser_home_directory() and friends. - * device-msw.c (mswindows_finish_init_device): Call CoInitialize(). - (mswindows_delete_device): Call CoUnnitialize(). + * nt.c: replaced getenv("HOME") with calls to the new + get_home_directory(). - * event-msw.c (mswindows_wnd_proc): WM_DROPFILES: Decode Shortcuts. + * sysfile.h: for WINDOWSNT, #include <direct.h>, to suppress + warnings about getcwd(), etc. not having prototypes. -2000-02-25 <CraigL@DyCon.com> +1998-05-28 Kirill M. Katsnelson <kkm@kis.ru> - * process-nt.c: MinGW now has <shellapi.h>, but still needs - <errno.h>. + * process-nt.c (send_signal): Emulate SIGHUP. + (validate_signal_number): Ditto. - * sysdep.c: This extern declaration for environ prevents MinGW - from finding the variable in CRTDLL.DLL. + * 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. - * 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. +1998-05-24 Oliver Graf <ograf@fga.de> -2000-02-03 IKEYAMA Tomonori <tomonori@suiyokai.org> + * frame-x.c (cde-start-drag-internal): added filename and multi- + data transfers + (x_cde_convert_callback) dito - * chartab.h (XCHAR_TABLE_VALUE_UNSAFE): New macro. - * syntax.c (syntax_match): Use it. +1998-05-26 Oliver Graf <ograf@fga.de> - * 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. + * frame-x.c: include event-mod.h also with CDE + (x_cde_convert_callback) made the thing working + (cde-start-drag-internal) also debugging -2000-03-05 Jonathan Harris <jhar@tardis.ed.ac.uk> +1998-05-25 Hans Guenter Weigand <hgweigand@wiesbaden.netsurf.de> - * 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. + * 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. - * redisplay.h: declare sync_display_line_structs. +1998-05-15 Greg Klanderman <greg@alphatech.com> - * redisplay.c (add_glyph_rune): add a better comment. + * window.c (Fwindow_displayed_text_pixel_height): New function. + (syms_of_window): DEFSUBR it. - * redisplay-output.c (sync_display_line_structs): made non-static. - (compare_runes): remove unneccesary glyph cachel access. + * indent.c (Fvertical_motion_pixels): New function - request + movement in pixels. + (vmotion_pixels): helper. + (syms_of_indent): DEFSUBR. + * lisp.h: declaration for vmotion_pixels(). - * gutter.h: declare gutter_extent_signal_changed_region_maybe. + * 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. - * 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. + * window.c: rename window-text-pixel-{height,width,edges} to + window-text-area-pixel-*. - * frame.h (struct frame): add 4 sets of gutter display lines. +1998-05-26 Gunnar Evermann <Gunnar.Evermann@nats.informatik.uni-hamburg.de> - * extents.c: (extent_changed_for_redisplay): signal changes to - extents in strings in the gutter as well as extents in buffers. + * tooltalk.c (vars_of_tooltalk) added staticpro for + Tooltalk_Message_plist_str and Tooltalk_Pattern_plist_str -2000-03-02 Andy Piper <andy@xemacs.org> +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. - * gutter.c (specifier_vars_of_gutter): cosmetic changes. +1998-05-21 Andy Piper <andyp@parallax.co.uk> - * 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. + * s/cygwin32.h: define charsets for cygwin. - * device.c (Fset_device_class): mark gutters changed. +1998-05-25 Andy Piper <andyp@parallax.co.uk> -2000-03-01 Andy Piper <andy@xemacs.org> + * toolbar-msw.c (mswindows_output_toolbar): fix up button sizes + and coordinates. resize bitmaps if we have already settled on a + different size. - * 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. + * glyphs-msw.c (xpm_to_eimage): add ';' for mswindows compiler. - * scrollbar.c (update_scrollbar_instance): don't take gutters into account. - (update_scrollbar_instance): ditto. +1998-05-25 Hrvoje Niksic <hniksic@srce.hr> - * redisplay.c (generate_modeline): don't take gutters into account. - (generate_modeline): ditto. - (redisplay_frame): small gutter display optimization. + * toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto. - * redisplay-x.c (x_output_vertical_divider): don't take gutters into account. + * menubar-msw.c (mswindows_handle_wm_command): Ditto. - * redisplay-msw.c (mswindows_output_vertical_divider): don't take - gutters into account. + * gui.h: Ditto. - * gutter.h (WINDOW_REAL_*_GUTTER_BOUNDS): remove bogus checks - for window position and type. + * gui-x.c (popup_selection_callback): Ditto. - * 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. + * dialog-msw.c (dialog_proc): get_callback -> get_gui_callback. - * glyphs-msw.c (mswindows_subwindow_instantiate): remove unused - var. - (mswindows_widget_instantiate): ditto. + * gui.c (get_callback): Renamed to get_gui_callback. - * frame.h (struct frame): add current_gutter_bounds. +1998-05-17 Martin Buchholz <martin@xemacs.org> - * frame.c (change_frame_size_1): position window and minibuffer - appropriately taking into account the frame gutters. + * glyphs.h: order rearrangement. - * frame-x.c: (x_initialize_frame_size): take into account the - frame gutters. + * 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. -2000-02-29 Stephen J. Turnbull <stephen@xemacs.org> +1998-05-24 Martin Buchholz <martin@xemacs.org> - * emacs.c (data-directory): Xref `locate-data-file' in docstring. + * general.c: multiple definition of `Qicon'. general.c seems + like a good home for Qicon. -2000-02-29 Stephen J. Turnbull <stephen@xemacs.org> +1998-05-20 Kirill M. Katsnelson <kkm@kis.ru> - * alloc.c (dumpopaquevec): Increase dimension for --with-canna. + * This patch is to fix compilation warnings under Windows. -1999-12-30 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + * 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). - * file-coding.c (reset_decoding_stream): Clear previous - detection state when autodetect. + * sysfloat.h (logb): Finally, get logb() prototyped. -2000-02-29 Didier Verna <didier@xemacs.org> + * sysfile.h: Added Windows specific includes. + Removed old Windows specific code bracketed with #if 0. - * extents.c (set_extent_glyph_1): don't require extents to be - attached. + * sysdep.h: Added prototype for xrealpath(). -2000-02-27 Andy Piper <andy@xemacs.org> + * sysdep.c (sys_getpid): Added function, to support '95 negative pids. - * 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. + * symsinit.h: Added prototypes for syms_of_dired_mswindows, + vars_of_dired_mswindows and init_ntproc (Grrr). -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. + * realpath.c: Added Windows specific include files. + (xrealpath): Conditionalized declaration of some auto variables on + S_IFLNK, to avoid warnings. - * 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. + * 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? - * winslots.h: add real_gutter slots. + * nt.h: Added prototypes for set_process_dir and convert_time. -2000-02-25 Andy Piper <andy@xemacs.org> + * 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. - * device-msw.c: Be kind to older cygwin versions. From Raymond - Toy <toy@rtp.ericsson.se>. + * floatfns.c (Flogb): Casted arguments to unary minus to signed. - * 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> + * gmalloc.c (morecore): Ditto. + (_free_internal): Ditto. - * elhash.c (MARK_OBJ): Practice macro hygiene. + * lread.c (parse_integer): Ditto. -2000-02-24 Martin Buchholz <martin@xemacs.org> + * dired-msw.c: Added several include files. - * 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' + * cmdloop.c (Fcommand_loop_1): Added Microsoft C to the Big List + of Compilers to Shut Up. -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. + * callproc.c: Added #includes to suppress warnings under Windows. + (init_callproc): Removed #if0'ed code and unused variables. -2000-02-25 Andy Piper <andy@xemacs.org> +1998-05-25 Andy Piper <andyp@parallax.co.uk> - * 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); + * device-msw.c (mswindows_device_system_metrics): do planes in a + way consistent with X. - * 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. + * 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. - * event-msw.c (mswindows_dde_callback): Removed extraneous ';'. + * toolbar-msw.c: only resize bitmaps when shrinking. Adjust look + to be closer to X version. - * s\windowsnt.h (DOESNT_RETURN): Defined to support the MSVC - __declspec(noreturn) syntax. + * event-msw.c: use tooltip string directly. -2000-02-19 Martin Buchholz <martin@xemacs.org> + * redisplay-msw.c: reinstate Kirill's bg pixmap change. - * eldap.c (Fldap_open): - (Fldap_search_basic): - (Fldap_add): - (Fldap_modify): - Use new coding system conversion macros. + * objects-msw.c: frob rgb colors that only Kyle uses. -2000-01-06 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + * dialog-msw.c (button_width): INLINE -> inline. - * console-tty.c (tty_init_console): Change MULE to FILE_CODING. +1998-05-23 SL Baur <steve@altair.xemacs.org> -1999-11-27 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> + * getloadavg.c (getloadavg): Fix typo. - * eldap.h (Fldap_search) Renamed from Fldap_search_internal: - (Fldap_add, Fldap_modify, Fldap_delete): New functions +1998-05-23 Kirill M. Katsnelson <kkm@kis.ru> - * 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 + * 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> -2000-02-17 Martin Buchholz <martin@xemacs.org> + * emacs.c (main_1): Added calls to vars_of_dialog_mswindows() and + console_type_create_dialog_mswindows(), to initialize Windows dialog + support. - * realpath.c: Determine PATH_MAX maximally portably. + * symsinit.h: Prototyped the above functions. - * 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. + * dialog-x.c (x_popup_dialog_box): Moved dialog descriptor consistency + checks to dialog.c... - * fileio.c (Ffile_truename): convert return from realpath() using - Qfile_name, not Qbinary. Fixes obvious bug with non-ASCII symlinks. - - Rewrite GCPROing slightly. + * 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. - * 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. + * dialog-msw.c: New file, dialogs for Windows. -2000-02-18 Martin Buchholz <martin@xemacs.org> +1998-05-21 Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> - * 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. + * eldap.c (ldap_search_unwind): Return Qnil instead of nothing + (Fldap_search_internal): Removed unused variable `err' -2000-02-18 Jonathan Harris <jhar@tardis.ed.ac.uk> + * eldap.h: Moved Lisp_LDAP declaration here instead of using a + forward declaration - * event-msw.c (mswindows_drain_windows_queue): - (emacs_mswindows_handle_magic_event): Remove attempt to optimise - away redundant repaint events. +1998-05-17 Martin Buchholz <martin@xemacs.org> -2000-02-17 Andy Piper <andy@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. - * redisplay.h: declare mark_redisplay_structs. + * 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. - * redisplay.c (redisplay_window): - (redisplay_frame): don't check subwindows_state_changed. - (mark_redisplay): mark gutters here. +1998-05-21 Kirill M. Katsnelson <kkm@kis.ru> - * 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. + * unexnt.c (copy_executable_and_dump_data_section): Suppress + printing dump stats when building without DEBUG_XEMACS. + (dump_bss_and_heap): Ditto. - * gutter.c (mark_gutters): new function. +1998-05-21 Andy Piper <andyp@parallax.co.uk> - * glyphs-x.c (x_update_widget): Always resize to get round a - widget bug. + * 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. - * glyphs-msw.c (mswindows_tab_control_update): remove `;' that was - breaking absolutely everything. +1998-05-20 Andy Piper <andyp@parallax.co.uk> - * gutter.h: declare mark_gutters. + * general.c: + * lisp.h: Qbitmap, Qcursor, Qicon moved here from glyphs-msw.c. -2000-02-16 Martin Buchholz <martin@xemacs.org> + * glyphs-msw.c: change cursor imgae type name to resource. Fix + some nits. - * XEmacs 21.2.29 is released. +1998-05-20 Kirill M. Katsnelson <kkm@kis.ru> -2000-02-15 Olivier Galibert <galibert@pobox.com> + * EmacsFrame.c (Xt_StringToScrollBarPlacement): Added support for + {top,bottom}-{left,right} values in addition to + {top,bottom}_{left,right}. - * fns.c (size_bit_vector): Fix computation of the size. +1998-05-18 Hrvoje Niksic <hniksic@srce.hr> -2000-02-15 Martin Buchholz <martin@xemacs.org> + * fileio.c (Fmake_temp_name): Remove unreached code. - * *.[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 + * process-nt.c (validate_signal_number): Use + signal_simple_error(). -2000-02-13 Jonathan Harris <jhar@tardis.ed.ac.uk> +1998-05-19 Martin Buchholz <martin@xemacs.org> - * 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. + * 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 -2000-02-13 Jonathan Harris <jhar@tardis.ed.ac.uk> +1998-05-19 Andy Piper <andyp@parallax.co.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. + * glyphs-msw.c (mswindows_create_resized_mask) + (mswindows_create_resized_bitmap): new funnctions split out from + mswindows_resize_dibitmap_instance. -2000-02-08 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> + * glyphs-msw.h: declare new resize functions. - * gui.c (gui_item_accelerator): Return the first underlined - character in item name. + * toolbar-msw.c (mswindows_output_toolbar): use new bitmap resize + functions so that the original bitmaps are preserved. -2000-02-11 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * sheap.c: fixup static heap exhausted error to avoid FAQs. - * lisp.h: Added Qprinter. + * redisplay-msw.c (mswindows_output_blank): fixup brush from bg + color if we are trying to output 0 depth bg pixmap. - * general.c (syms_of_general): Initialized it. + * scrollbar-msw.c: warning elimination. - * redisplay-msw.c (get_frame_dc): Conditionally start a new page. - (get_frame_dc): - (get_frame_compdc): Made inline. +1998-05-18 Martin Buchholz <martin@xemacs.org> - * console.h (struct console_methods): Added eject_page method. + * frame-x.c (x_update_frame_external_traits): Start preprocessor + directives in column 1. - * 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. + * search.c (skip_chars): Avoid using xzero with arrays, since some + compilers get confused by the construct &array. - * defice.h: Added DEVICE_DISPLAY_P and friends. +1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> - * device.c (Fdevice_printer_p): Used these. + * objects-msw.h: + * objects-msw.c: Changed the charset value for a new font from + "don't care" to "ansi". - * frame.c (allocate_frame_core): Initialize page number. - (Fprint_job_page_number): - (Fprint_job_eject_page): Implemented. + * glyphs-msw.c (convert_EImage_to_DIBitmap): Warnings fix. - * frame-msw.c (msprinter_eject_page): Added method. - (msprinter_start_page): Added. +1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> - * window.c (Fwindow_truncated_p): Fixed docstring. - (Fwindow_last_line_visible_height): Implemented. + * event-msw.c (mswindows_wnd_proc, WM_KEYDOWN): Do not clear shift + modifier on control chars. + Use IsCharAlpha() instead of isaplha(). -2000-02-09 Yoshiki Hayashi <yoshiki@xemacs.org> +1998-05-19 Kazuyuki IENAGA <ienaga@jsys.co.jp> - * frame.c (change_frame_size_1): Undo 2000-02-03 change. + * s/freebsd.h: FreeBSD 2.2.6 now supports setlocale(LC_ALL, ""). -1999-12-20 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> +1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> - * syntax.c (scan_words): Always advance at least one character. + * 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. -2000-02-13 Andy Piper <andy@xemacs.org> + * objects-msw.h (struct mswindows_color_instance_data): Removed + brush slot, and corresponding accessor macro. - * redisplay.c (add_glyph_rune): call get_glyph_cachel_index here - to make sure the glyph is in the cachels. +1998-05-18 Kirill M. Katsnelson <kkm@kis.ru> - * 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. + * 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. - * 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. + * 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. - * glyphs-x.h (IMAGE_INSTANCE_X_WIDGET_ID): undo C++ changes, they - should no longer be needed. + * toolbar-x.c (x_output_toolbar): The same change as in + toolbar-msw.c + (x_output_toolbar): Ditto. + (x_redraw_exposed_toolbar): Ditto. - * glyphs-x.c (x_update_widget): sanitize asserts. - (x_finalize_image_instance): sanitize assignment to widgets. + * 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. - * glyphs-widget.c (widget_instantiate): don't need to clear the - layout flag here. + * 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. -2000-02-13 Martin Buchholz <martin@xemacs.org> + * 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. - * sysdep.c (getcwd): Use standard prototype. - * sysdep.h (getcwd): Use standard prototype. + * 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. - * 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. +1998-05-17 Kirill M. Katsnelson <kkm@kis.ru> -2000-02-12 Martin Buchholz <martin@xemacs.org> + * symsinit.h: Externed syms_of_process_nt() - * glyphs-x.c (x_finalize_image_instance): Compile error fixes. + * emacs.c (main_1): Call syms_of_process_nt() - * s/sol2.h: Remove feature macro initialization. + * 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. - * alloc.c (alloc_lcrecord): Add more type checking assertions. - (vector_hash): New. Code from internal_hash. - * lrecord.h: - Fix up allocation subsystem comments. +1998-05-17 Martin Buchholz <martin@xemacs.org> - * config.h.in: Add __EXTENSIONS__ for Solaris. + * window.c (have_undivided_common_edge): Make file-local function + static. + (map_windows): Return 0 if all map functions successful. + Fix typos. - * systime.h (EMACS_GETTIMEOFDAY): New. - (EMACS_GET_TIME): Use EMACS_GETTIMEOFDAY. - Remove Solaris-specific code. - Use void* for the (ignored) second arg for gettimeofday(). + * winslots.h: Use unlikely names for local variables in macros to + avoid shadowing warnings. - * elhash.c (hash_table_hash): Implement it, finally. - * elhash.c: Use hashcode_t. +1998-05-17 Andy Piper <andyp@parallax.co.uk> - * linuxplay.c (sighandler): Fix prototypes to use SIGTYPE. - * sunplay.c (sighandler): Fix prototype to use SIGTYPE. + * toolbar-msw.c (mswindows_output_toolbar): hash on toolbar width + so that we re-output if the toolbar size has changed. - * 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. +1998-05-17 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> -2000-02-10 Martin Buchholz <martin@xemacs.org> + * s/aix4-2.h (ALIGN_DATA_RELOC): Undefined to support new unexaix.c. - * s/aix4.h: #define MAP_FAILED if sys/mman.h didn't. - Include strings.h to avoid warnings for bzero and strcasecmp. + * s/aix3-1.h (ALIGN_DATA_RELOC): Defined to support new unexaix.c. -2000-02-10 Olivier Galibert <galibert@pobox.com> + * unexaix.c: Massive cleanup and support of AIX 4.2 (and hopefully + greater). - * alloc.c: Move STRETCHY_STRUCT_SIZEOF from here... - * lisp.h (STRETCHY_STRUCT_SIZEOF): ...to here +1998-05-16 Kirill M. Katsnelson <kkm@kis.ru> - * fns.c (size_bit_vector): New. Declare bit vectors as a - sequence. + * glyphs-msw.c: Defined OEMRESOURCE before including windows.h to + get bitmap manifest constants defined. -2000-02-10 Olivier Galibert <galibert@pobox.com> + * console-msw.h: Include system files in angle brackets, not in + quotes. - * 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. + * window.c (specifier_vars_of_window): Fixed a typo in + `vertical-divider-line-width' docstirng. - * 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". +1998-05-16 Olivier Galibert <galibert@pobox.com> -2000-01-30 Martin Buchholz <martin@xemacs.org> + * 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. - * 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. + * insdel.c (buffer_delete_range): Use an EMACS_INT. - * print.c: Allow debug_print() to print readably by modifying - debug_print_readably. Use consistent variable names. + * cmds.c (Fforward_line): Use EMACS_INTs. - * .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> + * 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. - * unexnt.c (_start): Removed bogus code which caused loading heap - from differrent executable file. - Removed bogus assignment to _fmode, which caused inconsistencies. + * lisp.h: Change scan_buffer to pass EMACS_INTs. -2000-02-03 Kirill 'Big K' Katsnelson <kkm@dtmx.com> +1998-05-16 Hrvoje Niksic <hniksic@srce.hr> - * s\windowsnt.h: Removed lots of #if 0 blocks of Emacs heritage. - Have spawnve encapsulation regard DONT_ENCAPSULATE. - Do not preliminary `#define signal sigset'. + * menubar-msw.c (mswindows_handle_wm_command): Ditto. - * systime.h: Do not prototype environ on windows nt and cygwin, - this conflicts with system header. + * toolbar-msw.c (mswindows_handle_toolbar_wm_command): Ditto. - * syssignal.h: Use correct define for WINDOWSNT + * gui-x.c (popup_selection_callback): Use it. - * sysdep.h: Do not prototype environ on windows nt, this conflicts - with system header. + * gui.h (get_callback): Declare it. - * 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. + * gui.c (get_callback): New function. - * symsinit.h: Prototyped vars_of_nt(). +1998-05-15 SL Baur <steve@altair.xemacs.org> - * ntproc.c (windows9x_p): Added, instead of os_subtype. - (find_child_console): Use it. - (sys_kill): Use it. + * window.c (have_undivided_common_edge): Guard scrollbar specific + stuff. + (window_needs_vertical_divider_1): Ditto. - * ntheap.h: Do not extern os_subtype. +1998-05-16 Hrvoje Niksic <hniksic@srce.hr> - * 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. + * emacs.c (decode_path): Eliminate compiler warning. + (Fdecode_path): Renamed to Fsplit_path. + (Fsplit_string_by_char): New function. - * 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. +1998-05-14 Damon Lipparelli <lipp@primus.com> - * 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. + * winslots.h: close comment - * 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. +1998-05-16 Kirill M. Katsnelson <kkm@kis.ru> - * alloc.c (Fmemory_limit): Conditionalized out. - (pdump): Use OPEN_BINARY for the portable dump file. - (pdump_load): Ditto. + * callproc.c: Removed declared and unused variable Qbuffer_file_type. -2000-02-02 Mike Alexander <mta@arbortext.com> + * bufslots.h: Removed buffer_file_type slot. - * 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. + * 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. -2000-02-03 Daiki Ueno <ueno@ueda.info.waseda.ac.jp> +1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> - * frame.c (change_frame_size_1): Take f->internal_border_width - into consideration when calculating the width of the frame. + * faces.c (complex_vars_of_faces): Defined + Vvertical_divider_face. + (vars_of_faces): Staticpro it. -2000-02-01 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * faces.h: Externed Vvertical_divider_face. - * window.c (frame_min_height): - (frame_size_valid_p): - (frame_pixsize_valid_p): Added. - (check_frame_size): Generalized. + * redisplay-x.c (x_output_vertical_divider): Use + Vvertical_divider_face to draw the divider instead of modeline + face. - * window.h: Prototyped the above. + * redisplay-msw.c (mswindows_output_vertical_divider): Draw + divider face using Vvertical_divider_face background. + Fix drawing spacing gaps around the divider. - * lisp.h: - * general.c: Added Qbottom_margin, Qduplex, Qlandscape, - Qleft_margin, Qorientation, Qportrait, Qright_margin, Qtop_margin. - Deleted Vwin32_* and Vbinary_process_* unused variables. +1998-05-14 Didier Verna <verna@inf.enst.fr> - * device-msw.c (msprinter_init_device): Do not get printer font - list; Added DEVMODE functions. + * 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. - * frame-msw.c: Added lots of printer code. + * 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. - * faces.c: Moved 'left-margin and 'right-margin defsymbols to - general.c. + * winslots.h: new slots: vertical_specifier _line_width and + _spacing. Plus corrected a comment typo. - * console-msw.h: Added more msprinter device private slots. +1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> -2000-02-01 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * window.h: Declared window_divider_width(). - * event-msw.c (key_needs_default_processing_p): Added. - (mswindows_wnd_proc, WM_KEYUP, KEYDOWN): Call it. + * console-stream.c (stream_divider_width): Removed method. + (console_type_create_stream): And declaration for it. -2000-01-29 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * 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. - * 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. + * 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. - * glyphs.h: Prototyped it. + * console.h (struct console_methods): Removed divider_width_method. - * redisplay.c (add_glyph_rune): Call it. - (redisplay_window): Reset glyphs cachels when frame faces have - changed, thus forcing recomputation of built-in border glyphs. + * 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. -2000-01-30 Martin Buchholz <martin@xemacs.org> + * 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. - * 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. +1998-05-15 Andy Piper <andyp@parallax.co.uk> - * symbols.c (maybe_call_magic_handler): Remove one magic number. + * toolbar-msw.c: guess toolbar frame size a bit more accurately. -2000-01-28 Andy Piper <andy@xemacs.org> +1998-05-15 Andy Piper <andyp@parallax.co.uk> - * 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. + * 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. - * window.h: change Fset_window_buffer signature. +1998-05-14 Martin Buchholz <martin@xemacs.org> - * 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. + * sysdep.c (tty_init_sys_modes_on_device): Treat VSUSP just like + VINTR and VQUIT. -2000-01-23 Daniel Pittman <daniel@danann.net> + * process-unix.c (process_signal_char): Use VSUSP instead of + non-standard VSWTCH. Always prefer VSUSP to VSWTCH. - * config.h.in: Added template for `HAVE_ATHENA_3D' +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> -2000-01-29 Andy Piper <andy@xemacs.org> + * 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. - * glyphs-x.c (x_resize_subwindow): Try and catch bogus resizes. +1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> - * gutter.c (output_gutter): Don't output if the window isn't live. + ** Dialog separation into a device method from Andy Piper -2000-01-28 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * emacs.c (main_1): Call console_type_create_dialog_x(). - * glyphs-msw.c (mswindows_unmap_subwindow): Fix of corrupted patch - of 01/12/00: Moved SetFocus back here where it belongs. + * dialog-x.c (x_popup_dialog_box): Old Fpopup_dialog_box converted + into this device method. + (console_type_create_dialog_x): New function. -2000-01-23 Andy Piper <andy@xemacs.org> + * dialog.c (Fpopup_dialog_box): New function. + (syms_of_dialog): Defsubr it. - * s/cygwin32.h: declare printer things. + * console.h (struct console_methods): Declared + popup_dialog_box_method(). -2000-01-26 Andy Piper <andy@xemacs.org> + * symsinit.h: Defined console_type_create_dialog_{x,mswindows} - * select.c (Fown_selection_internal): GCPRO bug fix from Mike - Alexander. +1998-05-14 Oliver Graf <ograf@fga.de> -2000-01-24 Andy Piper <andy@xemacs.org> + * dragdrop.c (vars_of_dragdrop): dragdrop-protocols created + * frame-x.c (x_cde_transfer_callback): checked for merge errors - * glyphs-msw.c (mswindows_locate_pixmap_file): Expand filename. - (mswindows_button_instantiate): Make sure glyph is a pixmap. +1998-05-13 Oliver Graf <ograf@fga.de> - * glyphs-widget.c (widget_instantiate): Avoid shadows. + * dragdrop.c (vars_of_dragdrop): provide dragdrop-api - * frame-msw.c (msprinter_init_frame_3): Nuke warning. +1998-05-15 Kirill M. Katsnelson <kkm@kis.ru> - * glyphs-msw.c: (mswindows_string_to_color): remove declaration. + * console.h (device_metrics): Removed dbcs, input-method-editor + and right-to-left metrics. - * redisplay-msw.c (mswindows_output_cursor): Avoid shadows. - (mswindows_output_display_block): Avoid local shadows. + * device.c (Fdevice_system_metric): Ditto. + (Fdevice_system_metrics): Ditto. + (syms_of_device): Ditto. + (Fdevice_system_metric): Swapped DEVICE and METRIC parameters back + again. - * event-msw.c (mswindows_enqueue_magic_event): Avoid shadows. - (mswindows_enqueue_mouse_button_event): ditto. - (mswindows_handle_gui_wm_command): remove declaration. +1998-05-14 Hrvoje Niksic <hniksic@srce.hr> - * console-msw.c (mswindows_canonicalize_console_connection): Avoid - warnings. + * line-number.h (mark_line_number_cache): Remove unused + declaration. - * 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. + * line-number.c (LINE_NUMBER_FAR): Increase to 32768. + (get_nearest_line_number): Simplify. + (add_position_to_cache): Make the old marker point nowhere. - * device-msw.c (build_syscolor_string): Avoid shadows. +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> -2000-01-23 Andy Piper <andy@xemacs.org> + ** 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): - * glyphs-widget.c (widget_instantiate): reverse the items for - layouts so that children are in the expected order. + * redisplay.h (OVER_V_DIVIDER): Renamed so from OVER_DIVIDER. -2000-01-28 Martin Buchholz <martin@xemacs.org> + * redisplay.c (pixel_to_glyph_translation): Use OVER_V_DIVIDER. - * 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. +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> - * regex.c (regex_compile): Remove accidental use of trigraphs. + * 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. -2000-01-27 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * window.h: Prototype invalidate_vertical_divider_cache_in_window. + (struct window): Added need_vertical_divider_p and + need_vertical_divider_valid_p. - * event-msw.c (mswindows_enqueue_misc_user_event): Initialize - event timestamp. + * winslots.h: Added vertical_divider_draggable_p slot. -2000-01-26 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * scrollbar.c (vertical_scrollbar_changed_in_window): Implemented. + (specifier_vars_of_scrollbar): Used it in all vertical specifiers. - * 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. + * frame.c (invalidate_vertical_divider_cache_in_frame): New function. - * 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 - initialized, 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. + * frame.h (MARK_FRAME_WINDOWS_STRUCTURE_CHANGED): Call + invalidate_vertical_divider_cache_in_frame(). + Prototype it. -2000-01-24 Martin Buchholz <martin@xemacs.org> +1998-05-14 Andy Piper <andyp@parallax.co.uk> - * glyphs-widget.c (layout_query_geometry): - (layout_layout): Use correct types for gheight, gwidth. + * toolbar-msw.c: provide correct parameters to TB_SETROWS. -2000-01-24 Martin Buchholz <martin@xemacs.org> + * glyphs-msw.c (mswindows_initialize_image_instance_mask): size + masks correctly and don't select 0. - * EmacsManager.c (QueryGeometry): Purified. +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> -2000-01-23 Martin Buchholz <martin@xemacs.org> + * winslots.h: New file, declaration of some struct window and + struct saved_window members. - * alloc.c (make_float): Make sure entire object is initialized, to - avoid Purify warnings. - (pdump_register_sub): Remove useless assignment. - (pdump): Use xmalloc, not malloc. - (pdump_load): Use xmalloc, not malloc. + * window.h (struct window): Include it, with required preprocessor + magic. -2000-01-23 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * window.c (mark_window): Ditto. + (allocate_window): Ditto. + (struct saved_window): Ditto. + (mark_window_config): Ditto. + (saved_window_equal): Ditto. + (Fset_window_configuration): Ditto. - * 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 preceding - functions. +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> -2000-01-22 Martin Buchholz <martin@xemacs.org> + * redisplay-msw.c (mswindows_output_vertical_divider): Syntax fix. - * process.c (Fset_process_coding_system): - * device-x.c (Fx_keysym_hash_table): - Docstring fixes. +1998-05-12 Didier Verna <verna@inf.enst.fr> - * lstream.c (Lstream_write): Return documented value, not 0. + * 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. - * 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. +1998-05-12 Didier Verna <verna@inf.enst.fr> - * events.c (event_equal): Added abort() at unreached code. - (event_hash): Ditto. + * console.h (struct console_methods): the divider_width console + method now requires a struct window * argument. - * faces.c (complex_vars_of_faces): Added Qmsprinter to the list of - fallback tags of Windows devices. + * 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. - * general.c (syms_of_general): Initialized Qmsprinter. + * console-stream.c (stream_divider_width): pass a struct window * + argument. - * gutter.c (complex_vars_of_gutters): Added Qmsprinter to the list - of fallback tags of Windows devices. + * redisplay-tty.c (tty_divider_width): ditto. - * lisp.h: Declared Qmsprinter. + * window.c (window_right_gutter_width): totdi. - * 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 (generate_modeline): ittod. - * 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. + * 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. - * 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. +1998-05-14 Kirill M. Katsnelson <kkm@kis.ru> -2000-01-21 Olivier Galibert <galibert@pobox.com> + * device-msw.c (mswindows_device_system_metrics): Support a deluge + of metrics. - * 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. +1998-05-12 Oliver Graf <ograf@fga.de> -2000-01-19 Olivier Galibert <galibert@pobox.com> + * frame-x.c (x_cde_transfer_callback): fixed for the new protocol + * event-Xt.c (x_event_to_emacs_event): C++ compability - * 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. +1998-05-14 Hrvoje Niksic <hniksic@srce.hr> -2000-01-20 Martin Buchholz <martin@xemacs.org> + * emacs.c (Fdecode_path): Default SEPCHAR to value of + path-separator. - * emacs.c (main_1): Rearrange morass of #ifdef's for correctness. +1998-05-14 Hrvoje Niksic <hniksic@srce.hr> - * callproc.c (call_process_cleanup): Isolate WINDOWSNT code for clarity. + * emacs.c (vars_of_emacs): Do it here; change the meaning of + Vpath_separator. - * EmacsManager.c (GeometryManager): Avoid use of CPP for clarity. + * fileio.c (vars_of_fileio): Don't define Vpath_separator here. - * *.[ch]: global-replace 's/_of_xselect/_of_select_x/g' *.[ch] +1998-05-14 Hrvoje Niksic <hniksic@srce.hr> -2000-01-17 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * emacs.c (decode_path_1): New function. + (decode_path): Use it. + (Fdecode_path): Renamed from Fdecode_path_internal; use + decode_path_1. - * faces.h (FACE_STRIKETHRU_P): Added. +1998-05-12 Hrvoje Niksic <hniksic@srce.hr> - * glyphs-msw.c (mswindows_widget_hfont): Implemented, to take care - of font variants. + * macros.c (Fzap_last_kbd_macro_event): New function. + (Fend_kbd_macro): Remove REMOVE_LAST kludge. - * redisplay-msw.c (mswindows_apply_face_effects): Deleted. - (mswindows_set_dc_font): New function, aware of font variants, - separated from mswindows_update_dc. +1998-05-10 Andy Piper <andyp@parallax.co.uk> - * objects-msw.h (struct mswindows_font_instance_data): Added - definition. + * 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. - * 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. +1998-05-12 Martin Buchholz <martin@xemacs.org> -2000-01-13 Fabrice Popineau <Fabrice.Popineau@supelec.fr> + * inline.c: Include eldap.h - * dired-msw.c: permute "sysdir.h" with "sysfile.h" because of - prototyping problem with msvc. + * menubar-x.c (x_update_frame_menubar_internal): + Remove: unused variable `container' - * emacs.c (main_1): added syms_of_gui_mswindows() call +1998-05-11 Martin Buchholz <martin@xemacs.org> - * gui-msw.c: added "mswindows-shell-execute" lisp subr and - syms_of_gui_mswindows() function + * s/aix4.h: Allow AIX 4.3 XEmacs to compile cleanly. + Unfortunately, the resulting temacs still cannot dump. - * symsinit.h: added the prototype for syms_of_gui_mswindows() + * symbols.c (symbol_is_constant): + (verify_ok_for_buffer_local): + -Wswitch Warning suppression - add default case to switches. -2000-01-18 Martin Buchholz <martin@xemacs.org> + * 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. - * XEmacs 21.2.27 is released. + * buffer.c: + * fileio.c: + * lread.c: + * xselect.c: + Change empty docstrings into no doc strings at all. + Fix bogus FSF-format docstrings. -2000-01-18 Martin Buchholz <martin@xemacs.org> + * extents.c: + Standardize docstrings. - * glyphs-eimage.c (struct tiff_error_struct): - (tiff_error_func): - (tiff_warning_func): - #if HAVE_VSNPRINTF ==> #ifdef HAVE_VSNPRINTF + * floatfns.c: + Explain problems with matherr. - * 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(). + * glyphs.c: make DEFUNs etags-readable, i.e. single-line - * eval.c (Fbacktrace): Small Purify-cation. Fix docstring. + * 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) - * .dbxrc (run-temacs): Use the horrible ${1+"$@"} instead of "$@". + * gdbinit: + * dbxrc: + Take new EMACSBOOTSTRAPLOADPATH into account. + Update documentation strings -2000-01-16 Martin Buchholz <martin@xemacs.org> + * 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 - * mule-charset.c (Fchar_octet): Resurrect from earlier in 1999. - Optimize. +1998-05-12 Didier Verna <verna@inf.enst.fr> -2000-01-14 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + * redisplay.c: removed the scrolling modeline code that didn't + make it for 21.0. To be continued ... - * md5.c: - * file-coding.c: - * file-coding.h: - Change enum eol_type to eol_type_t. +1998-05-13 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de> -2000-01-17 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + * emacs.c (Fdecode_path_internal): Removed bogus handling of nil + and empty string inputs. - * gui.c (get_gui_callback): Check cons before accessing car. +1998-05-12 Hrvoje Niksic <hniksic@srce.hr> -2000-01-17 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + * redisplay-x.c (x_output_vertical_divider): Fixed typo. - * specifier.h (XSPECIFIER_TYPE): Add error checking version. - (XSETSPECIFIER_TYPE): Ditto. +1998-05-10 Oliver Graf <ograf@fga.de> -2000-01-17 Didier Verna <didier@xemacs.org> + * 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 - * redisplay.c (generate_fstring_runes): compute string size in - characters, not bytes. +1998-05-11 Oliver Graf <ograf@fga.de> -2000-01-09 Hrvoje Niksic <hniksic@iskon.hr> + * 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] - * window.c (Fwindow_minibuffer_p): Make WINDOW optional. +1998-05-12 Kirill M. Katsnelson <kkm@kis.ru> -2000-01-14 Hrvoje Niksic <hniksic@iskon.hr> + * 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. - * print.c (print_error_message): Call print_prepare(). + * scrollbar.c (update_scrollbar_instance): Position vertical + scrollbar left to divider if the latter present. -2000-01-14 Martin Buchholz <martin@xemacs.org> + * redisplay.h: Declared OVER_DIVIER constant. - * .dbxrc: Renamed from dbxrc. + * redisplay.c (pixel_to_glyph_translation): Handle OVER_DIVIDER + case. - * events.c (event_to_character): - Use `assert (foo)' instead of `if (!foo) abort()' + * 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. - * .gdbinit (xtype): Add documentation. - * .gdbinit (check-temacs): New function. - * .gdbinit (check-xemacs): New function. - * dbxrc (check-xemacs): New function. - * dbxrc (check-xemacs): New function. + * redisplay-tty.c (tty_output_vertical_divider): Uncondiionally + stick the divider to the right window side. -2000-01-14 Andy Piper <andy@xemacs.org> + * 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. - * glyphs-widget.c (widget_query_geometry): Make sure that we - calculate default dimensions correctly. + * 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. -2000-01-13 Kirill 'Big K' Katsnelson <kkm@dtmx.com> + * events.c (Fevent_over_divider_p): Added this function. - * symsinit.h: Added prototype for reinit_vars_of_frame_mswindows. + * events.h: EXFUNed it. - * event-msw.c (vars_of_event_mswindows): Fixed a mistyped - pdump_wire'd variable. +1998-05-12 Kirill M. Katsnelson <kkm@kis.ru> - * emacs.c: (main_1): Conditionalized calls to - reinit_vars_of_scrollbar_x and reinit_vars_of_module. + * toolbar.c (update_frame_toolbars): Re-layout frame windows if + toolbar geometry is suspected to change. -2000-01-13 Martin Buchholz <martin@xemacs.org> +1998-05-11 Jonathan Harris <jhar@tardis.ed.ac.uk> - * 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. + * src/device-msw.c + * src/event-msw.c + Condition dnd and dde code on HAVE_DRAGNDROP. - * bytecode.c (funcall_compiled_function): Use the original - function symbol on the backtrace list in preference to the - compiled_function object in error messages. +1998-05-11 Hrvoje Niksic <hniksic@srce.hr> -2000-01-13 Andy Piper <andy@xemacs.org> + * events.c (format_event_object): Print space as SPC etc. - * glyphs-x.c (update_widget_face): Make sure we update the widget - background as well as foreground. +1998-05-11 Hrvoje Niksic <hniksic@srce.hr> -2000-01-13 Andy Piper <andy@xemacs.org> + * print.c (print_internal): In the default case, abort() if + ERROR_CHECK_TYPECHECK. - * 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. + * fileio.c (Fmake_temp_name): Doc fix. - * 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. +1998-05-10 Hrvoje Niksic <hniksic@srce.hr> - * glyphs-msw.c: (mswindows_tab_control_instantiate): assign - appropriate creation flags for left, right and bottom tabs. + * xgccache.c (describe_gc_cache): Define only if DEBUG_XEMACS. - * s/cygwin32.h: add tab definitions. + * undo.c (Fprimitive_undo): Fixed typo. -2000-01-12 Kirill 'Big K' Katsnelson <kkm@dtmx.com> +1998-05-11 Hrvoje Niksic <hniksic@srce.hr> - * 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. + * fns.c (concat): Signal error on integer argument. -2000-01-12 Didier Verna <didier@xemacs.org> +1998-05-10 Kirill M. Katsnelson <kkm@kis.ru> - * 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. + * console.h (device_metrics): Prefixed each constatnt with DM_ - * keymap.c (get_relevant_keymaps): retreive the keymaps from the - glyphs'extents in the modeline. + * 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. -1999-01-11 Mike Woolley <mike@bulsara.com> + * device-msw.c (mswindows_device_system_metrics): Renamed + device_metrics enum constants. + Return Qunbound instead of Qnil. - * ntheap.c: Reduced the reserved heap space from 1Gb down to - 256Mb, as a workaround for the non-starting problem many people - have experienced. + * device-tty.c (tty_device_system_metrics): Ditto. -2000-01-06 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + * device-x.c (x_device_system_metrics): Ditto. - * console-tty.c (Fset_console_tty_output_coding_system): - Force redrawing tty frame. +1998-05-10 Andy Piper <andyp@parallax.co.uk> -2000-01-10 Didier Verna <didier@xemacs.org> + * 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. - * redisplay.c (generate_fstring_runes): fix size computation bug. + * toolbar-msw.c: use masks if they exist. -2000-01-09 William M. Perry <wmperry@aventail.com> + * glyphs-msw.c: set up masks correctly. - * gpmevent.c: (gpm_next_event_cb): Don't return value from void function. + * event-msw.c: typedef SOCKET if cygwin and not msg select(). -2000-01-09 Andy Piper <andy@xemacs.org> +1998-05-10 Hrvoje Niksic <hniksic@srce.hr> - * 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. + * regex.c (re_match_2_internal): Check for quit. - * 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. +1998-05-10 Hrvoje Niksic <hniksic@srce.hr> -2000-01-09 Hrvoje Niksic <hniksic@iskon.hr> + * frame.c (Ffocus_frame): New function. - * insdel.c (signal_after_change): Remove extraneous unbind_to(). diff --git a/src/ChangeLog.2 b/src/ChangeLog.2 index aab648a..c480ddf 100644 --- a/src/ChangeLog.2 +++ b/src/ChangeLog.2 @@ -8,9 +8,9 @@ * lisp.h (xfree_1): Make non-public. * (xzero): Use '\0' in memset call for clarity. * (ALIGNOF): Use __alignof__ instead of undocumented __alignof. - * alloc.c (allocate_string_chars_struct): - (make_uninit_string): - (resize_string): + * alloc.c (allocate_string_chars_struct): + (make_uninit_string): + (resize_string): (verify_string_chars_integrity): (compact_string_chars): Now only called for small strings. (sweep_strings): @@ -216,7 +216,7 @@ 2000-01-04 Martin Buchholz <martin@xemacs.org> - * mule-charset.h (REP_BYTES_BY_FIRST_BYTE): + * mule-charset.h (REP_BYTES_BY_FIRST_BYTE): Remove macro, always use inline function. * mule-charset.c (make_charset): Don't assign to rep_bytes_by_first_byte. (rep_bytes_by_first_byte): Make const. @@ -331,31 +331,31 @@ 1999-12-21 Martin Buchholz <martin@xemacs.org> - * editfns.c (Fpoint_min): - (Fpoint_min_marker): - (Fpoint_max): - (Fpoint_max_marker): - (Fchar_after): - (Fchar_before): + * editfns.c (Fpoint_min): + (Fpoint_min_marker): + (Fpoint_max): + (Fpoint_max_marker): + (Fchar_after): + (Fchar_before): Docstring fixes. What's a `buffer pointer' anyways? * editfns.c (char=): Remove unused and undocumented optional third BUFFER argument. - * toolbar.h (DEVICE_SUPPORTS_TOOLBARS_P): - * fns.c (plists_differ): - * elhash.c (HASH_CODE): - * elhash.c (KEYS_EQUAL_P): - * redisplay-output.c (redisplay_move_cursor): - * redisplay.c (create_text_block): - * floatfns.c (Flogb): - * glyphs-msw.c (mswindows_initialize_image_instance_mask): - * glyphs-msw.c (xpm_to_eimage): - * buffer.h (POINT_MARKER_P): - * syntax.c (scan_lists): - * cmdloop.c (Fcommand_loop_1): - * widget.c (Fwidget_apply): - * regex.c (STREQ): + * toolbar.h (DEVICE_SUPPORTS_TOOLBARS_P): + * fns.c (plists_differ): + * elhash.c (HASH_CODE): + * elhash.c (KEYS_EQUAL_P): + * redisplay-output.c (redisplay_move_cursor): + * redisplay.c (create_text_block): + * floatfns.c (Flogb): + * glyphs-msw.c (mswindows_initialize_image_instance_mask): + * glyphs-msw.c (xpm_to_eimage): + * buffer.h (POINT_MARKER_P): + * syntax.c (scan_lists): + * cmdloop.c (Fcommand_loop_1): + * widget.c (Fwidget_apply): + * regex.c (STREQ): Remove extra parens, esp. of the form ((expr)) * floatfns.c (Flogb): Make 64-bit clean. @@ -405,7 +405,7 @@ * glyphs-widget.c (VALID_GUI_KEYWORDS): use NONCOPY keyword for callbacks and other things that could recurse. - (VALID_GUI_KEYWORDS): + (VALID_GUI_KEYWORDS): * event-msw.c: fix cpp stuff for cygwin < b20. @@ -456,10 +456,10 @@ 1999-12-18 Martin Buchholz <martin@xemacs.org> - * fns.c (mapcar1): - (Fmapconcat): - (Fmapcar): - (Fmapvector): + * fns.c (mapcar1): + (Fmapconcat): + (Fmapcar): + (Fmapvector): Docstring fixes. Make them consistent with the lispref and ANSI Lisp. 1999-12-17 Martin Buchholz <martin@xemacs.org> @@ -479,7 +479,7 @@ * window.c: * event-stream.c: Remove last vestigial uses of GC_* - + * fns.c (mapcar1): Fix ***THREE*** obscure crashes in one function! - Two of those involve evil mapping functions that destructively modify a list being mapped over. @@ -519,7 +519,7 @@ 1999-12-10 Shenghuo ZHU <zsh@cs.rochester.edu> - * file-coding.c (add_coding_system_to_list_mapper): + * file-coding.c (add_coding_system_to_list_mapper): - (coding-system-list) should list aliases correctly. 1999-12-07 Andy Piper <andy@xemacs.org> @@ -548,7 +548,7 @@ found. (nt_open_network_stream): warn_when_safe if network stream fails to open. - + * ntproc.c (create_child): Remove negative pid hack for Windows 95. Remove incorrect and unnecessary USE_UNION_TYPE handling. @@ -568,7 +568,7 @@ * events.c (Fcopy_event): Don't copy the lrecord_header. - * lisp.h (DO_REALLOC): + * lisp.h (DO_REALLOC): Optimize. Remove redundant parens. Remove generic hygienic macro comment. @@ -577,7 +577,7 @@ 1999-12-05 Martin Buchholz <martin@xemacs.org> - * lstream.c (Lstream_adding): + * lstream.c (Lstream_adding): - Never compare a size_t and a possibly negative number. - Optimize. @@ -614,11 +614,11 @@ 1999-12-04 Martin Buchholz <martin@xemacs.org> - * lstream.c: (filedesc_reader): + * lstream.c: (filedesc_reader): (filedesc_writer): Try number 2: Support broken systems where return type of read() and write() is different from ssize_t. - * systty.h: + * systty.h: * sysdep.h: * sysdep.c: - Replace macro calls to EMACS_GET_TTY and EMACS_SET_TTY with @@ -637,7 +637,7 @@ (menu_move_right): Ditto. * lrecord.h (copy_lcrecord): - (zero_lcrecord): + (zero_lcrecord): Always add parentheses around uses of macro arguments. * sysdll.c: #include <stdlib.h> for exit(). @@ -762,7 +762,7 @@ * file-coding.c (convert_to_external_format): * file-coding.c (convert_from_external_format): - Lstream functions mirror Unix98 read(),write(). Therefore use - Unix98 types size_t and ssize_t. + Unix98 types size_t and ssize_t. - Try to make Lstream* functions 64-bit clean. Someday someone may actually want to read from a Lstream with more than 2**32 bytes. - Add configure support for ssize_t. @@ -790,12 +790,12 @@ 1999-11-26 Martin Buchholz <martin@xemacs.org> - * device-x.c (x_init_device): + * device-x.c (x_init_device): - Replace magic number `17' with equivalent expn using sizeof. - Replace strcmp with marginally more efficient memcmp. - Avoid using C++ reserved word `class'. - * file-coding.c (determine_real_coding_system): + * file-coding.c (determine_real_coding_system): - Look for both initial and final -*- cookies. - Replace EQ (foo, Qnil) with NILP (foo) - Make searching for cookies more efficient. @@ -848,7 +848,7 @@ * redisplay.h (struct rune): Do not use bitfields for members. (struct rune): Add various comments about further optimizations. - + 1999-11-19 Eric Darve <darve@crocco.stanford.edu> * abbrev.c (abbrev_oblookup): Check whether wordend <= wordstart @@ -914,16 +914,16 @@ * tooltalk.c (tt_build_string): Remove extra parens. * process.c (print_process): Remove extra parens. - * buffer.h (BI_BUF_PTR_BYTE_POS): - (BUF_PTR_BYTE_POS): - (BI_BUF_BYTE_ADDRESS): - (BI_BUF_BYTE_ADDRESS_BEFORE): - (valid_memind_p): - (bytind_to_memind): + * buffer.h (BI_BUF_PTR_BYTE_POS): + (BUF_PTR_BYTE_POS): + (BI_BUF_BYTE_ADDRESS): + (BI_BUF_BYTE_ADDRESS_BEFORE): + (valid_memind_p): + (bytind_to_memind): (memind_to_bytind): Remove extra parens. Inline functions are not macros. - * editfns.c (Fuser_login_name): + * editfns.c (Fuser_login_name): (user_login_name): Use proper type uid_t. @@ -992,18 +992,18 @@ 1999-10-25 Martin Buchholz <martin@xemacs.org> - * redisplay.h (CLASS_RESET_CHANGED_FLAGS): - (GLOBAL_RESET_CHANGED_FLAGS): - (CLASS_REDISPLAY_FLAGS_CHANGEDP): - (RESET_CHANGED_SET_FLAGS): + * redisplay.h (CLASS_RESET_CHANGED_FLAGS): + (GLOBAL_RESET_CHANGED_FLAGS): + (CLASS_REDISPLAY_FLAGS_CHANGEDP): + (RESET_CHANGED_SET_FLAGS): Fix C++ compile errors/warnings. These macros were just a tad too clever. * process-unix.c (unix_open_network_stream): * objects-x.c (allocate_nearest_color): - * mule-charset.c (vars_of_mule_charset): - * fileio.c (Ffile_truename): - * file-coding.c (vars_of_file_coding): + * mule-charset.c (vars_of_mule_charset): + * fileio.c (Ffile_truename): + * file-coding.c (vars_of_file_coding): Fix compile errors/warnings. * alloc.c (xstrdup): Use fact that memcpy returns its first arg. @@ -1039,8 +1039,8 @@ * sound.c: support HAVE_ESD_SOUND - * miscplay.c: - * miscplay.h: + * miscplay.c: + * miscplay.h: * linuxplay.c: Move large part of linuxplay to generalized file miscplay. Make it platform independent. @@ -1062,7 +1062,7 @@ 1999-10-24 Jan Vroonhof <vroonhof@math.ethz.ch> - * unexelf.c: Merge Martin's c++ fixes back in + * unexelf.c: Merge Martin's c++ fixes back in 1999-10-20 Jan Vroonhof <vroonhof@math.ethz.ch> @@ -1141,7 +1141,7 @@ * lisp.h (DUMPEDP): Added. Removed dumped flag from dynarr. * alloc.c: Removed hash_next linked list pointer. - + * *.c *.h: Removed markobj and mark_object parameters, removed GC_ and XGC macros. @@ -1731,7 +1731,7 @@ XEmacs slow down to a crawl. I also hope to be able to create a list with more than INT_MAX cons cells. - * redisplay.c (decode_mode_spec): + * redisplay.c (decode_mode_spec): The %p and %P specs in the mode line were not correct for buffers larger than MAX_INT/100! The %p spec was off by .5% even for small buffers! @@ -1741,7 +1741,7 @@ * cmdloop.c (num_input_keys): * print.c (debug_temp): * emacs.c (Vinfo_directory): - Delete unused variables + Delete unused variables * console-x.h (x_interline_space): Mark as unimplemented. * redisplay-x.c (x_interline_space): Mark as unimplemented. @@ -1801,7 +1801,7 @@ * scrollbar-x.c (x_window_is_scrollbar): deleted. * scrollbar-x.h: ditto. - + 1999-09-23 Martin Buchholz <martin@xemacs.org> * alloc.c (this_marks_a_marked_record): Remove. @@ -2560,7 +2560,7 @@ * console.h (struct console_methods): new console methods for outputting pixmaps and strings. -1999-08-23 Didier Verna <didier@xemacs.org> +1999-08-23 Didier Verna <verna@inf.enst.fr> * sound.c: revert the renaming of `bell_volume' to `Vbell_volume' and `bell_inhibit_time' to `Vbell_inhibit_time'. @@ -2806,7 +2806,7 @@ (mswindows_tab_control_instantiate): ditto. (mswindows_tab_control_set_property): ditto. (image_instantiator_format_create_glyphs_mswindows): predicate - existence of widgets on HAVE_WIDGETS. + existance of widgets on HAVE_WIDGETS. * frame.h (struct frame): add subwindow_exposures variables. @@ -2914,7 +2914,7 @@ (CCL_ReadMultibyteCharacter, CCL_WriteMultibyteCharacter): New macros for CCL Commands. (EXCMD): New macro. - (ccl_driver): New case label `CCL_Extension'. + (ccl_driver): New case lable `CCL_Extention'. (setup_ccl_program): Initialize the member `private_state' of CCL. 1999-07-08 Katsumi Yamaoka <yamaoka@jpl.org> @@ -3184,7 +3184,7 @@ * s/linux.h: gcc-2.8 changes for powerpc From Justin Vallon <vallon@mindspring.com> -1999-07-05 Didier Verna <didier@xemacs.org> +1999-07-05 Didier Verna <verna@inf.enst.fr> * indent.c: new symbol Qcoerce. (Fmove_to_column): use it + doc string update. @@ -3973,7 +3973,7 @@ * systime.h: ditto. * systty.h: ditto. - * config.h.in: don't turn on DEBUG_ENCAPSULATION by default because + * 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. @@ -5150,7 +5150,7 @@ * bytecode.c (Ffetch_bytecode): Fix crash when loading lazy-loaded bytecode. -1998-12-02 Didier Verna <didier@xemacs.org> +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. @@ -5161,7 +5161,7 @@ Escape occurrences of '&' and support occurrences of the '%_' accelerator indicator in menus. -1998-11-26 Didier Verna <didier@xemacs.org> +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 @@ -5551,7 +5551,7 @@ subwindows on a msw frame. (mswindows_map_subwindow): ditto. (mswindows_register_image_instance): register instantiated widgets - with the widget hashtable. + with the widget hastable. (mswindows_button_instantiate): instantiate a button type widget on an msw frame. (mswindows_subwindow_instantiate): instanttiate a subwindow on a @@ -6460,14 +6460,14 @@ * chartab.c (canonicalize_char_table_value): Coerce ints to chars for tables of type `char'. -1998-11-26 Didier Verna <didier@xemacs.org> +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 <didier@xemacs.org> +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 @@ -6912,7 +6912,7 @@ * fns.c (Fremrassq, remrassq_no_quit): A XCAR that should have been an XCDR turned Fremrassq into Fremassq -1998-07-17 Didier Verna <didier@xemacs.org> +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. @@ -7121,7 +7121,7 @@ * fileio.c: (expand_file_name): under win32: Don't treat names as UNC names if a drive letter has been specified. If a drive - has been specified, strip out extra directory-separators that + has been specified, strip out extra directory-seperators that reportedly cause problems under Win95. 1998-07-09 Jonathan Harris <jhar@tardis.ed.ac.uk> @@ -7171,7 +7171,7 @@ * fileio.c: (expand_file_name): under win32: Don't treat names as UNC names if a drive letter has been specified. If a drive has - been specified, strip out extra directory-separators that + been specified, strip out extra directory-seperators that reportedly cause problems under Win95. 1998-07-05 Andy Piper <andyp@parallax.co.uk> @@ -7194,7 +7194,7 @@ 1998-06-24 Jonathan Harris <jhar@tardis.ed.ac.uk> - * fileio.c: Don't do directory separator canonicalisation in + * 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. @@ -7278,7 +7278,7 @@ * objects-msw.c: Added helper function match_font used by mswindows_initialize_font_instance and mswindows_list_fonts. Allow a charset to be specified in a font string, even if - previous fields haven't been specified. + previous fields havn't been specified. 1998-06-23 Greg Klanderman <greg@alphatech.com> @@ -7335,7 +7335,7 @@ * objects-msw.c: Added helper function match_font used by mswindows_initialize_font_instance and mswindows_list_fonts. Allow a charset to be specified in a font string, even if - previous fields haven't been specified. + previous fields havn't been specified. 1998-06-15 Jonathan Harris <jhar@tardis.ed.ac.uk> @@ -7379,7 +7379,7 @@ parameters. define macors to access it. * frame-msw.c (mswindows_init_frame_1): use new target_rect - parameter to initialize desired sizing. (mswindows_init_frame_2): + 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 @@ -7721,7 +7721,7 @@ Wed May 27, 1998 Darryl Okahata <darrylo@sr.hp.com> * emacs.c: Rearrange NT initialization order so that environment/registry variables will be properly entered into - Vprocess_environment. + Vprocess_enviroment. * fileio.c: replaced egetenv("HOME") with calls to the new get_home_directory(). @@ -8081,7 +8081,7 @@ Wed May 27, 1998 Darryl Okahata <darrylo@sr.hp.com> (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 because toolbars are + 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; @@ -8250,7 +8250,7 @@ Wed May 27, 1998 Darryl Okahata <darrylo@sr.hp.com> divider face using Vvertical_divider_face background. Fix drawing spacing gaps around the divider. -1998-05-14 Didier Verna <didier@xemacs.org> +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 @@ -8449,13 +8449,13 @@ Wed May 27, 1998 Darryl Okahata <darrylo@sr.hp.com> * redisplay-msw.c (mswindows_output_vertical_divider): Syntax fix. -1998-05-12 Didier Verna <didier@xemacs.org> +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 <didier@xemacs.org> +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. @@ -8593,7 +8593,7 @@ Wed May 27, 1998 Darryl Okahata <darrylo@sr.hp.com> hand-crafted regexps. - Use standard coding conventions for modules/Makefile.in -1998-05-12 Didier Verna <didier@xemacs.org> +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 ... diff --git a/src/abbrev.c b/src/abbrev.c index 34bf815..e18efdd 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -69,7 +69,7 @@ Lisp_Object Vlast_abbrev; Lisp_Object Vlast_abbrev_text; /* Character address of start of last abbrev expanded */ -Fixnum last_abbrev_location; +int last_abbrev_location; /* Hook to run before expanding any abbrev. */ Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook; @@ -77,9 +77,9 @@ Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook; 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 @@ abbrev_match_mapper (Lisp_Object symbol, void *arg) 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 @@ abbrev_match_mapper (Lisp_Object symbol, void *arg) /* 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; @@ -172,10 +172,10 @@ abbrev_match (struct buffer *buf, Lisp_Object obarray) It is an order of magnitude faster than the proper abbrev_match(), but then again, vi is an order of magnitude faster than Emacs. - This speed difference should be unnoticeable, though. I have tested + This speed difference should be unnoticable, 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 @@ abbrev_oblookup (struct buffer *buf, Lisp_Object obarray) 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 @@ If no abbrev matched, but `pre-abbrev-expand-hook' changed the buffer, 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 --git a/src/acldef.h b/src/acldef.h new file mode 100644 index 0000000..eba2c59 --- /dev/null +++ b/src/acldef.h @@ -0,0 +1,65 @@ +/* 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. */ + +/* Authorship: + + FSF: Original version; a long time ago. + No changes for XEmacs. + */ + +#define ACL$K_LENGTH 12 +#define ACL$C_LENGTH 12 +#define ACL$C_FILE 1 +#define ACL$C_DEVICE 2 +#define ACL$C_JOBCTL_QUEUE 3 +#define ACL$C_COMMON_EF_CLUSTER 4 +#define ACL$C_LOGICAL_NAME_TABLE 5 +#define ACL$C_PROCESS 6 +#define ACL$C_GROUP_GLOBAL_SECTION 7 +#define ACL$C_SYSTEM_GLOBAL_SECTION 8 +#define ACL$C_ADDACLENT 1 +#define ACL$C_DELACLENT 2 +#define ACL$C_MODACLENT 3 +#define ACL$C_FNDACLENT 4 +#define ACL$C_FNDACETYP 5 +#define ACL$C_DELETEACL 6 +#define ACL$C_READACL 7 +#define ACL$C_ACLLENGTH 8 +#define ACL$C_READACE 9 +#define ACL$C_RLOCK_ACL 10 +#define ACL$C_WLOCK_ACL 11 +#define ACL$C_UNLOCK_ACL 12 +#define ACL$S_ADDACLENT 255 +#define ACL$S_DELACLENT 255 +#define ACL$S_MODACLENT 255 +#define ACL$S_FNDACLENT 255 +#define ACL$S_FNDACETYP 255 +#define ACL$S_DELETEACL 255 +#define ACL$S_READACL 512 +#define ACL$S_ACLLENGTH 4 +#define ACL$S_READACE 255 +#define ACL$S_RLOCK_ACL 4 +#define ACL$S_WLOCK_ACL 4 +#define ACL$S_UNLOCK_ACL 4 +#define ACL$S_ACLDEF 16 +#define ACL$L_FLINK 0 +#define ACL$L_BLINK 4 +#define ACL$W_SIZE 8 +#define ACL$B_TYPE 10 +#define ACL$L_LIST 12 diff --git a/src/alloc.c b/src/alloc.c index a063313..8765c62 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -36,7 +36,6 @@ Boston, MA 02111-1307, USA. */ 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) */ #include <config.h> @@ -52,30 +51,33 @@ Boston, MA 02111-1307, USA. */ #include "extents.h" #include "frame.h" #include "glyphs.h" -#include "opaque.h" #include "redisplay.h" #include "specifier.h" #include "sysfile.h" -#include "sysdep.h" #include "window.h" -#include "console-stream.h" #ifdef DOUG_LEA_MALLOC #include <malloc.h> #endif -#ifdef PDUMP -#include "dumper.h" -#endif - EXFUN (Fgarbage_collect, 0); +/* #define GDB_SUCKS */ + #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 #endif #endif +/* Define this to see where all that space is going... */ +/* But the length of the printout is obnoxious, so limit it to testers */ +/* If somebody wants to see this they can ask for it. +#ifdef DEBUG_XEMACS +#define PURESTAT +#endif +*/ + /* Define this to use malloc/free with no freelist for all datatypes, the hope being that some debugging tools may help detect freed memory references */ @@ -84,14 +86,27 @@ EXFUN (Fgarbage_collect, 0); #define ALLOC_NO_POOLS #endif +#include "puresize.h" + #ifdef DEBUG_XEMACS -static Fixnum debug_allocation; -static Fixnum debug_allocation_backtrace_length; +int debug_allocation; + +int debug_allocation_backtrace_length; #endif /* Number of bytes of consing done since the last gc */ EMACS_INT consing_since_gc; +#ifdef EMACS_BTL +extern void cadillac_record_backtrace (); +#define INCREMENT_CONS_COUNTER_1(size) \ + do { \ + EMACS_INT __sz__ = ((EMACS_INT) (size)); \ + consing_since_gc += __sz__; \ + cadillac_record_backtrace (2, __sz__); \ + } while (0) +#else #define INCREMENT_CONS_COUNTER_1(size) (consing_since_gc += (size)) +#endif /* EMACS_BTL */ #define debug_allocation_backtrace() \ do { \ @@ -124,11 +139,14 @@ do { \ INCREMENT_CONS_COUNTER_1 (size) #endif -#define DECREMENT_CONS_COUNTER(size) do { \ - consing_since_gc -= (size); \ - if (consing_since_gc < 0) \ - consing_since_gc = 0; \ -} while (0) +#define DECREMENT_CONS_COUNTER(size) \ + do { \ + EMACS_INT __sz__ = ((EMACS_INT) (size)); \ + if (consing_since_gc >= __sz__) \ + consing_since_gc -= __sz__; \ + else \ + consing_since_gc = 0; \ + } while (0) /* Number of bytes of consing since gc before another gc should be done. */ EMACS_INT gc_cons_threshold; @@ -155,12 +173,47 @@ Lisp_Object Vpost_gc_hook, Qpost_gc_hook; /* "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; -/* Non-zero means we're in the process of doing the dump */ +#ifndef VIRT_ADDR_VARIES +extern +#endif /* VIRT_ADDR_VARIES */ + EMACS_INT malloc_sbrk_used; + +#ifndef VIRT_ADDR_VARIES +extern +#endif /* VIRT_ADDR_VARIES */ + EMACS_INT malloc_sbrk_unused; + +/* Non-zero means defun should do purecopy on the function definition */ int purify_flag; +#ifdef HEAP_IN_DATA +extern void sheap_adjust_h(); +#endif + +#define PUREBEG ((char *) pure) + +#if 0 /* This is breathing_space in XEmacs */ +/* Points to memory space allocated as "spare", + to be freed if we run out of memory. */ +static char *spare_memory; + +/* Amount of spare memory to keep in reserve. */ +#define SPARE_MEMORY (1 << 14) +#endif + +/* Index in pure at which next pure object will be allocated. */ +static size_t pure_bytes_used; + +#define PURIFIED(ptr) \ +((char *) (ptr) >= PUREBEG && \ + (char *) (ptr) < PUREBEG + get_PURESIZE()) + +/* Non-zero if pure_bytes_used > get_PURESIZE(); accounts for excess purespace needs. */ +static size_t pure_lossage; + #ifdef ERROR_CHECK_TYPECHECK Error_behavior ERROR_ME, ERROR_ME_NOT, ERROR_ME_WARN; @@ -168,22 +221,108 @@ Error_behavior ERROR_ME, ERROR_ME_NOT, ERROR_ME_WARN; #endif int -c_readonly (Lisp_Object obj) +purified (Lisp_Object obj) { - return POINTER_TYPE_P (XTYPE (obj)) && C_READONLY (obj); + return POINTER_TYPE_P (XGCTYPE (obj)) && PURIFIED (XPNTR (obj)); } -int -lisp_readonly (Lisp_Object obj) +size_t +purespace_usage (void) +{ + return pure_bytes_used; +} + +static int +check_purespace (size_t size) +{ + if (pure_lossage) + { + pure_lossage += size; + return 0; + } + else if (pure_bytes_used + size > get_PURESIZE()) + { + /* This can cause recursive bad behavior, we'll yell at the end */ + /* when we're done. */ + /* message ("\nERROR: Pure Lisp storage exhausted!\n"); */ + pure_lossage = size; + return 0; + } + else + return 1; +} + + + +#ifndef PURESTAT + +#define bump_purestat(p,b) DO_NOTHING + +#else /* PURESTAT */ + +static int purecopying_for_bytecode; + +static size_t pure_sizeof (Lisp_Object /*, int recurse */); + +/* Keep statistics on how much of what is in purespace */ +static struct purestat +{ + int nobjects; + int nbytes; + CONST char *name; +} + purestat_cons = {0, 0, "cons cells"}, + purestat_float = {0, 0, "float objects"}, + purestat_string_pname = {0, 0, "symbol-name strings"}, + purestat_bytecode = {0, 0, "compiled-function objects"}, + purestat_string_bytecodes = {0, 0, "byte-code strings"}, + purestat_vector_bytecode_constants = {0, 0, "byte-constant vectors"}, + purestat_string_interactive = {0, 0, "interactive strings"}, +#ifdef I18N3 + purestat_string_domain = {0, 0, "domain strings"}, +#endif + purestat_string_documentation = {0, 0, "documentation strings"}, + purestat_string_other_function = {0, 0, "other function strings"}, + purestat_vector_other = {0, 0, "other vectors"}, + purestat_string_other = {0, 0, "other strings"}, + purestat_string_all = {0, 0, "all strings"}, + purestat_vector_all = {0, 0, "all vectors"}; + +static struct purestat *purestats[] = +{ + &purestat_cons, + &purestat_float, + &purestat_string_pname, + &purestat_bytecode, + &purestat_string_bytecodes, + &purestat_vector_bytecode_constants, + &purestat_string_interactive, +#ifdef I18N3 + &purestat_string_domain, +#endif + &purestat_string_documentation, + &purestat_string_other_function, + &purestat_vector_other, + &purestat_string_other, + 0, + &purestat_string_all, + &purestat_vector_all +}; + +static void +bump_purestat (struct purestat *purestat, size_t nbytes) { - return POINTER_TYPE_P (XTYPE (obj)) && LISP_READONLY (obj); + if (pure_lossage) return; + purestat->nobjects += 1; + purestat->nbytes += nbytes; } +#endif /* PURESTAT */ /* Maximum amount of C stack to save when a GC happens. */ #ifndef MAX_SAVE_STACK -#define MAX_SAVE_STACK 0 /* 16000 */ +#define MAX_SAVE_STACK 16000 #endif /* Non-zero means ignore malloc warnings. Set during initialization. */ @@ -205,7 +344,7 @@ release_breathing_space (void) /* 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; @@ -241,39 +380,37 @@ memory_full (void) /* like malloc and realloc but check for no memory left, and block input. */ +#ifdef xmalloc #undef xmalloc +#endif + void * xmalloc (size_t size) { - void *val = malloc (size); + void *val = (void *) malloc (size); if (!val && (size != 0)) memory_full (); return val; } -#undef xcalloc -static void * -xcalloc (size_t nelem, size_t elsize) -{ - void *val = calloc (nelem, elsize); - - if (!val && (nelem != 0)) memory_full (); - return val; -} - void * xmalloc_and_zero (size_t size) { - return xcalloc (size, sizeof (char)); + void *val = xmalloc (size); + memset (val, 0, size); + return val; } +#ifdef xrealloc #undef xrealloc +#endif + void * xrealloc (void *block, size_t size) { /* We must call malloc explicitly when BLOCK is 0, since some reallocs don't do this. */ - void *val = block ? realloc (block, size) : malloc (size); + void *val = (void *) (block ? realloc (block, size) : malloc (size)); if (!val && (size != 0)) memory_full (); return val; @@ -326,20 +463,24 @@ deadbeef_memory (void *ptr, size_t size) #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); } @@ -349,31 +490,44 @@ strdup (const char *s) static void * allocate_lisp_storage (size_t size) { - return xmalloc (size); + void *p = xmalloc (size); +#ifndef USE_MINIMAL_TAGBITS + char *lim = ((char *) p) + size; + Lisp_Object val; + + XSETOBJ (val, Lisp_Type_Record, lim); + if ((char *) XPNTR (val) != lim) + { + xfree (p); + memory_full (); + } +#endif /* ! USE_MINIMAL_TAGBITS */ + 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))); + if (size <= 0) abort (); + if (implementation->static_size == 0) + { + if (!implementation->size_in_bytes_method) + abort (); + } + else if (implementation->static_size != size) + abort (); 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++; @@ -418,7 +572,7 @@ free_lcrecord (struct lcrecord_header *lcrecord) } } if (lrecord->implementation->finalizer) - lrecord->implementation->finalizer (lrecord, 0); + ((lrecord->implementation->finalizer) (lrecord, 0)); xfree (lrecord); return; } @@ -432,60 +586,131 @@ disksave_object_finalization_1 (void) 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)); } } - -/************************************************************************/ -/* 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. */ - -EMACS_UINT dbg_valmask = ((1UL << VALBITS) - 1) << GCBITS; -EMACS_UINT dbg_typemask = (1UL << GCTYPEBITS) - 1; -#ifdef USE_UNION_TYPE -unsigned char dbg_USE_UNION_TYPE = 1; -#else -unsigned char dbg_USE_UNION_TYPE = 0; -#endif +/* 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 (); +} -unsigned char dbg_valbits = VALBITS; -unsigned char dbg_gctypebits = GCTYPEBITS; +/* 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. */ -/* On some systems, the above definitions will be optimized away by - the compiler or linker unless they are referenced in some function. */ -long dbg_inhibit_dbg_symbol_deletion (void); -long -dbg_inhibit_dbg_symbol_deletion (void) +Lisp_Object +this_one_is_unmarkable (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - return - (dbg_valmask + - dbg_typemask + - dbg_USE_UNION_TYPE + - dbg_valbits + - dbg_gctypebits); + abort (); + return Qnil; } -/* Macros turned into functions for ease of debugging. - Debuggers don't know about macros! */ -int dbg_eq (Lisp_Object obj1, Lisp_Object obj2); +/* XGCTYPE for records */ int -dbg_eq (Lisp_Object obj1, Lisp_Object obj2) +gc_record_type_p (Lisp_Object frob, CONST struct lrecord_implementation *type) { - return EQ (obj1, obj2); + CONST struct lrecord_implementation *imp; + + if (XGCTYPE (frob) != Lisp_Type_Record) + return 0; + + imp = XRECORD_LHEADER_IMPLEMENTATION (frob); +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION + return imp == type; +#else + return imp == type || imp == type + 1; +#endif } -/************************************************************************/ -/* Fixed-size type macros */ -/************************************************************************/ +/**********************************************************************/ +/* Debugger support */ +/**********************************************************************/ +/* Give gdb/dbx enough information to decode Lisp Objects. + We make sure certain symbols are defined, so gdb doesn't complain + about expressions in src/gdbinit. Values are randomly chosen. + See src/gdbinit or src/dbxrc to see how this is used. */ + +enum dbg_constants +{ +#ifdef USE_MINIMAL_TAGBITS + dbg_valmask = (EMACS_INT) (((1UL << VALBITS) - 1) << GCBITS), + dbg_typemask = (EMACS_INT) ((1UL << GCTYPEBITS) - 1), + dbg_USE_MINIMAL_TAGBITS = 1, + dbg_Lisp_Type_Int = 100, +#else /* ! USE_MIMIMAL_TAGBITS */ + dbg_valmask = (EMACS_INT) ((1UL << VALBITS) - 1), + dbg_typemask = (EMACS_INT) (((1UL << GCTYPEBITS) - 1) << (VALBITS + GCMARKBITS)), + dbg_USE_MINIMAL_TAGBITS = 0, + dbg_Lisp_Type_Int = Lisp_Type_Int, +#endif /* ! USE_MIMIMAL_TAGBITS */ +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION + dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 1, +#else + dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 0, +#endif + dbg_Lisp_Type_Char = Lisp_Type_Char, + dbg_Lisp_Type_Record = Lisp_Type_Record, +#ifdef LRECORD_CONS + dbg_Lisp_Type_Cons = 101, +#else + dbg_Lisp_Type_Cons = Lisp_Type_Cons, + lrecord_cons = 201, +#endif +#ifdef LRECORD_STRING + dbg_Lisp_Type_String = 102, +#else + dbg_Lisp_Type_String = Lisp_Type_String, + lrecord_string = 202, +#endif +#ifdef LRECORD_VECTOR + dbg_Lisp_Type_Vector = 103, +#else + dbg_Lisp_Type_Vector = Lisp_Type_Vector, + lrecord_vector = 203, +#endif +#ifdef LRECORD_SYMBOL + dbg_Lisp_Type_Symbol = 104, +#else + dbg_Lisp_Type_Symbol = Lisp_Type_Symbol, + lrecord_symbol = 204, +#endif +#ifndef MULE + lrecord_char_table_entry = 205, + lrecord_charset = 206, + lrecord_coding_system = 207, +#endif +#ifndef HAVE_TOOLBARS + lrecord_toolbar_button = 208, +#endif +#ifndef HAVE_TOOLTALK + lrecord_tooltalk_message = 210, + lrecord_tooltalk_pattern = 211, +#endif +#ifndef HAVE_DATABASE + lrecord_database = 212, +#endif + dbg_valbits = VALBITS, + dbg_gctypebits = GCTYPEBITS + /* If we don't have an actual object of this enum, pgcc (and perhaps + other compilers) might optimize away the entire type declaration :-( */ +} dbg_dummy; + + +/**********************************************************************/ +/* Fixed-size type macros */ +/**********************************************************************/ /* For fixed-size types that are commonly used, we malloc() large blocks of memory at a time and subdivide them into chunks of the correct @@ -515,9 +740,9 @@ dbg_eq (Lisp_Object obj1, Lisp_Object obj2) 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 @@ -558,27 +783,35 @@ dbg_eq (Lisp_Object obj1, Lisp_Object obj2) currently executing functions; the gcpro list; etc.) and recursively marking all objects that are accessible. - At the beginning of the sweep stage, the conses in the cons blocks - are in one of three states: in use and marked, in use but not - marked, and not in use (already freed). Any conses that are marked - have been marked in the mark stage just executed, because as part - of the sweep stage we unmark any marked objects. The way we tell - whether or not a cons cell is in use is through the LRECORD_FREE_P - macro. This uses a special lrecord type `lrecord_type_free', - which is never associated with any valid object. - - Conses on the free_cons_list are threaded through a pointer stored - in the conses themselves. Because the cons is still in a - cons_block and needs to remain marked as not in use for the next - time that GC happens, we need room to store both the "free" - indicator and the chaining pointer. So this pointer is stored - after the lrecord header (actually where C places a pointer after - the lrecord header; they are not necessarily contiguous). This - implies that all fixed-size types must be big enough to contain at - least one pointer. This is true for all current fixed-size types, - with the possible exception of Lisp_Floats, for which we define the - meat of the struct using a union of a pointer and a double to - ensure adequate space for the free list chain pointer. + At the beginning of the sweep stage, the conses in the cons + blocks are in one of three states: in use and marked, in use + but not marked, and not in use (already freed). Any conses + that are marked have been marked in the mark stage just + executed, because as part of the sweep stage we unmark any + marked objects. The way we tell whether or not a cons cell + is in use is through the FREE_STRUCT_P macro. This basically + looks at the first 4 bytes (or however many bytes a pointer + fits in) to see if all the bits in those bytes are 1. The + resulting value (0xFFFFFFFF) is not a valid pointer and is + not a valid Lisp_Object. All current fixed-size types have + a pointer or Lisp_Object as their first element with the + exception of strings; they have a size value, which can + never be less than zero, and so 0xFFFFFFFF is invalid for + strings as well. Now assuming that a cons cell is in use, + the way we tell whether or not it is marked is to look at + the mark bit of its car (each Lisp_Object has one bit + reserved as a mark bit, in case it's needed). Note that + different types of objects use different fields to indicate + whether the object is marked, but the principle is the same. + + Conses on the free_cons_list are threaded through a pointer + stored in the bytes directly after the bytes that are set + to 0xFFFFFFFF (we cannot overwrite these because the cons + is still in a cons_block and needs to remain marked as + not in use for the next time that GC happens). This + implies that all fixed-size types must be at least big + enough to store two pointers, which is indeed the case + for all current fixed-size types. Some types of objects need additional "finalization" done when an object is converted from in use to not in use; @@ -592,18 +825,19 @@ dbg_eq (Lisp_Object obj1, Lisp_Object obj2) WARNING: Things are in an extremely bizarre state when the ADDITIONAL_FREE_type macros are called, so beware! - When ERROR_CHECK_GC is defined, we do things differently so as to - maximize our chances of catching places where there is insufficient - GCPROing. The thing we want to avoid is having an object that - we're using but didn't GCPRO get freed by GC and then reallocated - while we're in the process of using it -- this will result in - something seemingly unrelated getting trashed, and is extremely - difficult to track down. If the object gets freed but not - reallocated, we can usually catch this because we set most of the - bytes of a freed object to 0xDEADBEEF. (The lisp object type is set - to the invalid type `lrecord_type_free', however, and a pointer - used to chain freed objects together is stored after the lrecord - header; we play some tricks with this pointer to make it more + When ERROR_CHECK_GC is defined, we do things differently + so as to maximize our chances of catching places where + there is insufficient GCPROing. The thing we want to + avoid is having an object that we're using but didn't + GCPRO get freed by GC and then reallocated while we're + in the process of using it -- this will result in something + seemingly unrelated getting trashed, and is extremely + difficult to track down. If the object gets freed but + not reallocated, we can usually catch this because we + set all bytes of a freed object to 0xDEADBEEF. (The + first four bytes, however, are 0xFFFFFFFF, and the next + four are a pointer used to chain freed objects together; + we play some tricks with this pointer to make it more bogus, so crashes are more likely to occur right away.) We want freed objects to stay free as long as possible, @@ -622,7 +856,8 @@ dbg_eq (Lisp_Object obj1, Lisp_Object obj2) 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 @@ -642,7 +877,7 @@ dbg_eq (Lisp_Object obj1, Lisp_Object obj2) 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); @@ -657,46 +892,45 @@ refill_memory_reserve (void) / sizeof (structtype)) #endif /* ALLOC_NO_POOLS */ -#define DECLARE_FIXED_TYPE_ALLOC(type, structtype) \ - \ -struct type##_block \ -{ \ - struct type##_block *prev; \ - structtype block[TYPE_ALLOC_SIZE (type, structtype)]; \ -}; \ - \ -static struct type##_block *current_##type##_block; \ -static int current_##type##_block_index; \ - \ -static Lisp_Free *type##_free_list; \ -static Lisp_Free *type##_free_list_tail; \ - \ -static void \ -init_##type##_alloc (void) \ -{ \ - current_##type##_block = 0; \ - current_##type##_block_index = \ - countof (current_##type##_block->block); \ - type##_free_list = 0; \ - type##_free_list_tail = 0; \ -} \ - \ -static int gc_count_num_##type##_in_use; \ -static int gc_count_num_##type##_freelist - -#define ALLOCATE_FIXED_TYPE_FROM_BLOCK(type, result) do { \ - if (current_##type##_block_index \ - == countof (current_##type##_block->block)) \ +#define DECLARE_FIXED_TYPE_ALLOC(type, structtype) \ + \ +struct type##_block \ +{ \ + struct type##_block *prev; \ + structtype block[TYPE_ALLOC_SIZE (type, structtype)]; \ +}; \ + \ +static struct type##_block *current_##type##_block; \ +static int current_##type##_block_index; \ + \ +static structtype *type##_free_list; \ +static structtype *type##_free_list_tail; \ + \ +static void \ +init_##type##_alloc (void) \ +{ \ + current_##type##_block = 0; \ + current_##type##_block_index = countof (current_##type##_block->block); \ + type##_free_list = 0; \ + type##_free_list_tail = 0; \ +} \ + \ +static int gc_count_num_##type##_in_use, gc_count_num_##type##_freelist + +#define ALLOCATE_FIXED_TYPE_FROM_BLOCK(type, result) \ + do { \ + if (current_##type##_block_index \ + == countof (current_##type##_block->block)) \ { \ - struct type##_block *AFTFB_new = (struct type##_block *) \ - allocate_lisp_storage (sizeof (struct type##_block)); \ - AFTFB_new->prev = current_##type##_block; \ - current_##type##_block = AFTFB_new; \ + struct type##_block *__new__ = (struct type##_block *) \ + allocate_lisp_storage (sizeof (struct type##_block)); \ + __new__->prev = current_##type##_block; \ + current_##type##_block = __new__; \ current_##type##_block_index = 0; \ } \ - (result) = \ - &(current_##type##_block->block[current_##type##_block_index++]); \ -} while (0) + (result) = \ + &(current_##type##_block->block[current_##type##_block_index++]); \ + } while (0) /* Allocate an instance of a type that is stored in blocks. TYPE is the "name" of the type, STRUCTTYPE is the corresponding @@ -709,38 +943,43 @@ static int gc_count_num_##type##_freelist cell was not GC-protected and was getting collected before free_cons() was called. */ -#define ALLOCATE_FIXED_TYPE_1(type, structtype, result) do { \ - if (gc_count_num_##type##_freelist > \ - MINIMUM_ALLOWED_FIXED_TYPE_CELLS_##type) \ - { \ - result = (structtype *) type##_free_list; \ - /* Before actually using the chain pointer, \ - we complement all its bits; see FREE_FIXED_TYPE(). */ \ - type##_free_list = (Lisp_Free *) \ - (~ (EMACS_UINT) (type##_free_list->chain)); \ - gc_count_num_##type##_freelist--; \ - } \ - else \ - ALLOCATE_FIXED_TYPE_FROM_BLOCK (type, result); \ - MARK_LRECORD_AS_NOT_FREE (result); \ +#define ALLOCATE_FIXED_TYPE_1(type, structtype, result) \ +do \ +{ \ + if (gc_count_num_##type##_freelist > \ + MINIMUM_ALLOWED_FIXED_TYPE_CELLS_##type) \ + { \ + result = type##_free_list; \ + /* Before actually using the chain pointer, we complement all its \ + bits; see FREE_FIXED_TYPE(). */ \ + type##_free_list = \ + (structtype *) ~(unsigned long) \ + (* (structtype **) ((char *) result + sizeof (void *))); \ + gc_count_num_##type##_freelist--; \ + } \ + else \ + ALLOCATE_FIXED_TYPE_FROM_BLOCK (type, result); \ + MARK_STRUCT_AS_NOT_FREE (result); \ } while (0) #else /* !ERROR_CHECK_GC */ -#define ALLOCATE_FIXED_TYPE_1(type, structtype, result) do { \ +#define ALLOCATE_FIXED_TYPE_1(type, structtype, result) \ +do \ +{ \ if (type##_free_list) \ { \ - result = (structtype *) type##_free_list; \ - type##_free_list = type##_free_list->chain; \ + result = type##_free_list; \ + type##_free_list = \ + * (structtype **) ((char *) result + sizeof (void *)); \ } \ else \ ALLOCATE_FIXED_TYPE_FROM_BLOCK (type, result); \ - MARK_LRECORD_AS_NOT_FREE (result); \ + MARK_STRUCT_AS_NOT_FREE (result); \ } while (0) #endif /* !ERROR_CHECK_GC */ - #define ALLOCATE_FIXED_TYPE(type, structtype, result) \ do \ { \ @@ -755,66 +994,74 @@ do \ NOSEEUM_INCREMENT_CONS_COUNTER (sizeof (structtype), #type); \ } while (0) - -/* Lisp_Free is the type to represent a free list member inside a frob - block of any lisp object type. */ -typedef struct Lisp_Free -{ - struct lrecord_header lheader; - struct Lisp_Free *chain; -} Lisp_Free; - -#define LRECORD_FREE_P(ptr) \ -((ptr)->lheader.type == lrecord_type_free) - -#define MARK_LRECORD_AS_FREE(ptr) \ -((void) ((ptr)->lheader.type = lrecord_type_free)) - -#ifdef ERROR_CHECK_GC -#define MARK_LRECORD_AS_NOT_FREE(ptr) \ -((void) ((ptr)->lheader.type = lrecord_type_undefined)) +/* INVALID_POINTER_VALUE should be a value that is invalid as a pointer + to a Lisp object and invalid as an actual Lisp_Object value. We have + to make sure that this value cannot be an integer in Lisp_Object form. + 0xFFFFFFFF could be so on a 64-bit system, so we extend it to 64 bits. + On a 32-bit system, the type bits will be non-zero, making the value + be a pointer, and the pointer will be misaligned. + + Even if Emacs is run on some weirdo system that allows and allocates + byte-aligned pointers, this pointer is at the very top of the address + space and so it's almost inconceivable that it could ever be valid. */ + +#if INTBITS == 32 +# define INVALID_POINTER_VALUE 0xFFFFFFFF +#elif INTBITS == 48 +# define INVALID_POINTER_VALUE 0xFFFFFFFFFFFF +#elif INTBITS == 64 +# define INVALID_POINTER_VALUE 0xFFFFFFFFFFFFFFFF #else -#define MARK_LRECORD_AS_NOT_FREE(ptr) DO_NOTHING +You have some weird system and need to supply a reasonable value here. #endif +#define FREE_STRUCT_P(ptr) \ + (* (void **) ptr == (void *) INVALID_POINTER_VALUE) +#define MARK_STRUCT_AS_FREE(ptr) \ + (* (void **) ptr = (void *) INVALID_POINTER_VALUE) +#define MARK_STRUCT_AS_NOT_FREE(ptr) \ + (* (void **) ptr = 0) + #ifdef ERROR_CHECK_GC -#define PUT_FIXED_TYPE_ON_FREE_LIST(type, structtype, ptr) do { \ - if (type##_free_list_tail) \ - { \ - /* When we store the chain pointer, we complement all \ - its bits; this should significantly increase its \ - bogosity in case someone tries to use the value, and \ - should make us crash faster if someone overwrites the \ - pointer because when it gets un-complemented in \ - ALLOCATED_FIXED_TYPE(), the resulting pointer will be \ - extremely bogus. */ \ - type##_free_list_tail->chain = \ - (Lisp_Free *) ~ (EMACS_UINT) (ptr); \ - } \ - else \ - type##_free_list = (Lisp_Free *) (ptr); \ - type##_free_list_tail = (Lisp_Free *) (ptr); \ -} while (0) +#define PUT_FIXED_TYPE_ON_FREE_LIST(type, structtype, ptr) \ +do { if (type##_free_list_tail) \ + { \ + /* When we store the chain pointer, we complement all \ + its bits; this should significantly increase its \ + bogosity in case someone tries to use the value, and \ + should make us dump faster if someone stores something \ + over the pointer because when it gets un-complemented in \ + ALLOCATED_FIXED_TYPE(), the resulting pointer will be \ + extremely bogus. */ \ + * (structtype **) \ + ((char *) type##_free_list_tail + sizeof (void *)) = \ + (structtype *) ~(unsigned long) ptr; \ + } \ + else \ + type##_free_list = ptr; \ + type##_free_list_tail = ptr; \ + } while (0) #else /* !ERROR_CHECK_GC */ -#define PUT_FIXED_TYPE_ON_FREE_LIST(type, structtype, ptr) do { \ - ((Lisp_Free *) (ptr))->chain = type##_free_list; \ - type##_free_list = (Lisp_Free *) (ptr); \ -} while (0) \ +#define PUT_FIXED_TYPE_ON_FREE_LIST(type, structtype, ptr) \ +do { * (structtype **) ((char *) ptr + sizeof (void *)) = \ + type##_free_list; \ + type##_free_list = ptr; \ + } while (0) #endif /* !ERROR_CHECK_GC */ /* TYPE and STRUCTTYPE are the same as in ALLOCATE_FIXED_TYPE(). */ -#define FREE_FIXED_TYPE(type, structtype, ptr) do { \ - structtype *FFT_ptr = (ptr); \ - ADDITIONAL_FREE_##type (FFT_ptr); \ - deadbeef_memory (FFT_ptr, sizeof (structtype)); \ - PUT_FIXED_TYPE_ON_FREE_LIST (type, structtype, FFT_ptr); \ - MARK_LRECORD_AS_FREE (FFT_ptr); \ -} while (0) +#define FREE_FIXED_TYPE(type, structtype, ptr) \ +do { structtype *_weird_ = (ptr); \ + ADDITIONAL_FREE_##type (_weird_); \ + deadbeef_memory (ptr, sizeof (structtype)); \ + PUT_FIXED_TYPE_ON_FREE_LIST (type, structtype, ptr); \ + MARK_STRUCT_AS_FREE (_weird_); \ + } while (0) /* Like FREE_FIXED_TYPE() but used when we are explicitly freeing a structure through free_cons(), free_marker(), etc. @@ -834,45 +1081,39 @@ do { FREE_FIXED_TYPE (type, structtype, ptr); \ -/************************************************************************/ -/* Cons allocation */ -/************************************************************************/ +/**********************************************************************/ +/* 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 +#ifdef LRECORD_CONS static Lisp_Object -mark_cons (Lisp_Object obj) +mark_cons (Lisp_Object obj, void (*markobj) (Lisp_Object)) { if (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, @@ -882,8 +1123,8 @@ DEFINE_BASIC_LRECORD_IMPLEMENTATION ("cons", cons, * handle conses. */ 0, - cons_description, - Lisp_Cons); + struct Lisp_Cons); +#endif /* LRECORD_CONS */ DEFUN ("cons", Fcons, 2, 2, 0, /* Create a new cons, give it CAR and CDR as components, and return it. @@ -892,10 +1133,12 @@ Create a new cons, give it CAR and CDR as components, and return it. { /* This cannot GC. */ Lisp_Object val; - Lisp_Cons *c; + struct Lisp_Cons *c; - ALLOCATE_FIXED_TYPE (cons, Lisp_Cons, c); - set_lheader_implementation (&c->lheader, &lrecord_cons); + ALLOCATE_FIXED_TYPE (cons, struct Lisp_Cons, c); +#ifdef LRECORD_CONS + set_lheader_implementation (&(c->lheader), lrecord_cons); +#endif XSETCONS (val, c); c->car = car; c->cdr = cdr; @@ -909,10 +1152,12 @@ Lisp_Object noseeum_cons (Lisp_Object car, Lisp_Object cdr) { Lisp_Object val; - Lisp_Cons *c; + struct Lisp_Cons *c; - NOSEEUM_ALLOCATE_FIXED_TYPE (cons, Lisp_Cons, c); - set_lheader_implementation (&c->lheader, &lrecord_cons); + NOSEEUM_ALLOCATE_FIXED_TYPE (cons, struct Lisp_Cons, c); +#ifdef LRECORD_CONS + set_lheader_implementation (&(c->lheader), lrecord_cons); +#endif XSETCONS (val, c); XCAR (val) = car; XCDR (val) = cdr; @@ -928,7 +1173,7 @@ Any number of arguments, even zero arguments, are allowed. Lisp_Object val = Qnil; Lisp_Object *argp = args + nargs; - while (argp > args) + while (nargs-- > 0) val = Fcons (*--argp, val); return val; } @@ -991,45 +1236,40 @@ list6 (Lisp_Object obj0, Lisp_Object obj1, Lisp_Object obj2, Lisp_Object obj3, } DEFUN ("make-list", Fmake_list, 2, 2, 0, /* -Return a new list of length LENGTH, with each element being OBJECT. +Return a new list of length LENGTH, with each element being INIT. */ - (length, object)) + (length, init)) { CHECK_NATNUM (length); { Lisp_Object val = Qnil; - size_t size = XINT (length); + int size = XINT (length); - while (size--) - val = Fcons (object, val); + while (size-- > 0) + val = Fcons (init, val); return val; } } -/************************************************************************/ -/* Float allocation */ -/************************************************************************/ +/**********************************************************************/ +/* Float allocation */ +/**********************************************************************/ #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); + struct 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); + 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; @@ -1038,105 +1278,138 @@ make_float (double float_value) #endif /* LISP_FLOAT_TYPE */ -/************************************************************************/ -/* Vector allocation */ -/************************************************************************/ +/**********************************************************************/ +/* Vector allocation */ +/**********************************************************************/ +#ifdef LRECORD_VECTOR static Lisp_Object -mark_vector (Lisp_Object obj) +mark_vector (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Vector *ptr = XVECTOR (obj); + struct 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, Lisp_Object, contents, - ((Lisp_Vector *) lheader)->size); + /* * -1 because struct Lisp_Vector includes 1 slot */ + return sizeof (struct Lisp_Vector) + + ((((struct Lisp_Vector *) lheader)->size - 1) * sizeof (Lisp_Object)); } static int -vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +vector_equal (Lisp_Object o1, Lisp_Object o2, int depth) { - int len = XVECTOR_LENGTH (obj1); - if (len != XVECTOR_LENGTH (obj2)) + int indice; + int len = XVECTOR_LENGTH (o1); + if (len != XVECTOR_LENGTH (o2)) return 0; - - { - Lisp_Object *ptr1 = XVECTOR_DATA (obj1); - Lisp_Object *ptr2 = XVECTOR_DATA (obj2); - while (len--) - if (!internal_equal (*ptr1++, *ptr2++, depth + 1)) + for (indice = 0; indice < len; indice++) + { + if (!internal_equal (XVECTOR_DATA (o1) [indice], + XVECTOR_DATA (o2) [indice], + depth + 1)) return 0; - } + } return 1; } -static hashcode_t -vector_hash (Lisp_Object obj, int depth) +DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION("vector", vector, + mark_vector, print_vector, 0, + vector_equal, + /* + * No `hash' method needed for + * vectors. internal_hash + * knows how to handle vectors. + */ + 0, + size_vector, struct Lisp_Vector); + +/* #### should allocate `small' vectors from a frob-block */ +static struct Lisp_Vector * +make_vector_internal (size_t sizei) { - return HASH2 (XVECTOR_LENGTH (obj), - internal_array_hash (XVECTOR_DATA (obj), - XVECTOR_LENGTH (obj), - depth + 1)); + size_t sizem = (sizeof (struct Lisp_Vector) + /* -1 because struct Lisp_Vector includes 1 slot */ + + (sizei - 1) * sizeof (Lisp_Object)); + struct Lisp_Vector *p = + (struct Lisp_Vector *) alloc_lcrecord (sizem, lrecord_vector); + + p->size = sizei; + return p; } -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 } -}; +#else /* ! LRECORD_VECTOR */ -DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION("vector", vector, - mark_vector, print_vector, 0, - vector_equal, - vector_hash, - vector_description, - size_vector, Lisp_Vector); +static Lisp_Object all_vectors; /* #### should allocate `small' vectors from a frob-block */ -static Lisp_Vector * +static struct Lisp_Vector * make_vector_internal (size_t sizei) { - /* no vector_next */ - size_t sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, Lisp_Object, - contents, sizei); - Lisp_Vector *p = (Lisp_Vector *) alloc_lcrecord (sizem, &lrecord_vector); + size_t sizem = (sizeof (struct Lisp_Vector) + /* -1 because struct Lisp_Vector includes 1 slot, + * +1 to account for vector_next */ + + (sizei - 1 + 1) * sizeof (Lisp_Object)); + struct Lisp_Vector *p = (struct Lisp_Vector *) allocate_lisp_storage (sizem); + + INCREMENT_CONS_COUNTER (sizem, "vector"); p->size = sizei; + vector_next (p) = all_vectors; + XSETVECTOR (all_vectors, p); return p; } +#endif /* ! LRECORD_VECTOR */ + Lisp_Object -make_vector (size_t length, Lisp_Object object) +make_vector (EMACS_INT length, Lisp_Object init) { - Lisp_Vector *vecp = make_vector_internal (length); - Lisp_Object *p = vector_data (vecp); + int elt; + Lisp_Object vector; + struct Lisp_Vector *p; + + if (length < 0) + length = XINT (wrong_type_argument (Qnatnump, make_int (length))); - while (length--) - *p++ = object; + p = make_vector_internal (length); + XSETVECTOR (vector, p); +#if 0 + /* Initialize big arrays full of 0's quickly, for what that's worth */ { - Lisp_Object vector; - XSETVECTOR (vector, vecp); + char *travesty = (char *) &init; + for (i = 1; i < sizeof (Lisp_Object); i++) + { + if (travesty[i] != travesty[0]) + goto fill; + } + memset (vector_data (p), travesty[0], length * sizeof (Lisp_Object)); return vector; } + fill: +#endif + for (elt = 0; elt < length; elt++) + vector_data(p)[elt] = init; + + return vector; } DEFUN ("make-vector", Fmake_vector, 2, 2, 0, /* -Return a new vector of length LENGTH, with each element being OBJECT. +Return a new vector of length LENGTH, with each element being INIT. See also the function `vector'. */ - (length, object)) + (length, init)) { - CONCHECK_NATNUM (length); - return make_vector (XINT (length), object); + CHECK_NATNUM (length); + return make_vector (XINT (length), init); } DEFUN ("vector", Fvector, 0, MANY, 0, /* @@ -1145,17 +1418,15 @@ Any number of arguments, even zero arguments, are allowed. */ (int nargs, Lisp_Object *args)) { - Lisp_Vector *vecp = make_vector_internal (nargs); - Lisp_Object *p = vector_data (vecp); + Lisp_Object vector; + int elt; + struct Lisp_Vector *p = make_vector_internal (nargs); - while (nargs--) - *p++ = *args++; + for (elt = 0; elt < nargs; elt++) + vector_data(p)[elt] = args[elt]; - { - Lisp_Object vector; - XSETVECTOR (vector, vecp); - return vector; - } + XSETVECTOR (vector, p); + return vector; } Lisp_Object @@ -1258,285 +1529,365 @@ vector8 (Lisp_Object obj0, Lisp_Object obj1, Lisp_Object obj2, } #endif /* unused */ -/************************************************************************/ -/* Bit Vector allocation */ -/************************************************************************/ +/**********************************************************************/ +/* Bit Vector allocation */ +/**********************************************************************/ 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, unsigned long, - bits, num_longs); - Lisp_Bit_Vector *p = (Lisp_Bit_Vector *) allocate_lisp_storage (sizem); - set_lheader_implementation (&p->lheader, &lrecord_bit_vector); + size_t sizem = sizeof (struct Lisp_Bit_Vector) + + /* -1 because struct Lisp_Bit_Vector includes 1 slot */ + sizeof (long) * (BIT_VECTOR_LONG_STORAGE (sizei) - 1); + struct Lisp_Bit_Vector *p = + (struct Lisp_Bit_Vector *) allocate_lisp_storage (sizem); + set_lheader_implementation (&(p->lheader), lrecord_bit_vector); INCREMENT_CONS_COUNTER (sizem, "bit-vector"); bit_vector_length (p) = sizei; - bit_vector_next (p) = all_bit_vectors; + bit_vector_next (p) = all_bit_vectors; /* make sure the extra bits in the last long are 0; the calling functions might not set them. */ - p->bits[num_longs - 1] = 0; + p->bits[BIT_VECTOR_LONG_STORAGE (sizei) - 1] = 0; XSETBIT_VECTOR (all_bit_vectors, p); return p; } Lisp_Object -make_bit_vector (size_t length, Lisp_Object bit) +make_bit_vector (EMACS_INT length, Lisp_Object init) { - Lisp_Bit_Vector *p = make_bit_vector_internal (length); - size_t num_longs = BIT_VECTOR_LONG_STORAGE (length); + Lisp_Object bit_vector; + struct Lisp_Bit_Vector *p; + EMACS_INT num_longs; + + CHECK_BIT (init); - CHECK_BIT (bit); + num_longs = BIT_VECTOR_LONG_STORAGE (length); + p = make_bit_vector_internal (length); + XSETBIT_VECTOR (bit_vector, p); - if (ZEROP (bit)) + if (ZEROP (init)) memset (p->bits, 0, num_longs * sizeof (long)); else { - size_t bits_in_last = length & (LONGBITS_POWER_OF_2 - 1); + EMACS_INT bits_in_last = length & (LONGBITS_POWER_OF_2 - 1); memset (p->bits, ~0, num_longs * sizeof (long)); /* But we have to make sure that the unused bits in the - last long are 0, so that equal/hash is easy. */ + last integer are 0, so that equal/hash is easy. */ if (bits_in_last) p->bits[num_longs - 1] &= (1 << bits_in_last) - 1; } - { - Lisp_Object bit_vector; - XSETBIT_VECTOR (bit_vector, p); - return bit_vector; - } + return bit_vector; } Lisp_Object -make_bit_vector_from_byte_vector (unsigned char *bytevec, size_t length) +make_bit_vector_from_byte_vector (unsigned char *bytevec, EMACS_INT length) { - size_t i; - Lisp_Bit_Vector *p = make_bit_vector_internal (length); + Lisp_Object bit_vector; + struct Lisp_Bit_Vector *p; + int i; + + if (length < 0) + length = XINT (wrong_type_argument (Qnatnump, make_int (length))); + + p = make_bit_vector_internal (length); + XSETBIT_VECTOR (bit_vector, p); for (i = 0; i < length; i++) set_bit_vector_bit (p, i, bytevec[i]); - { - Lisp_Object bit_vector; - XSETBIT_VECTOR (bit_vector, p); - return bit_vector; - } + return bit_vector; } DEFUN ("make-bit-vector", Fmake_bit_vector, 2, 2, 0, /* -Return a new bit vector of length LENGTH. with each bit set to BIT. -BIT must be one of the integers 0 or 1. See also the function `bit-vector'. +Return a new bit vector of length LENGTH. with each bit being INIT. +Each element is set to INIT. See also the function `bit-vector'. */ - (length, bit)) + (length, init)) { CONCHECK_NATNUM (length); - return make_bit_vector (XINT (length), bit); + return make_bit_vector (XINT (length), init); } DEFUN ("bit-vector", Fbit_vector, 0, MANY, 0, /* Return a newly created bit vector with specified arguments as elements. Any number of arguments, even zero arguments, are allowed. -Each argument must be one of the integers 0 or 1. */ (int nargs, Lisp_Object *args)) { - int i; - Lisp_Bit_Vector *p = make_bit_vector_internal (nargs); + Lisp_Object bit_vector; + int elt; + struct Lisp_Bit_Vector *p; - for (i = 0; i < nargs; i++) - { - CHECK_BIT (args[i]); - set_bit_vector_bit (p, i, !ZEROP (args[i])); - } + for (elt = 0; elt < nargs; elt++) + CHECK_BIT (args[elt]); - { - Lisp_Object bit_vector; - XSETBIT_VECTOR (bit_vector, p); - return bit_vector; - } + p = make_bit_vector_internal (nargs); + + for (elt = 0; elt < nargs; elt++) + set_bit_vector_bit (p, elt, !ZEROP (args[elt])); + + XSETBIT_VECTOR (bit_vector, p); + return bit_vector; } -/************************************************************************/ -/* Compiled-function allocation */ -/************************************************************************/ +/**********************************************************************/ +/* Compiled-function allocation */ +/**********************************************************************/ -DECLARE_FIXED_TYPE_ALLOC (compiled_function, Lisp_Compiled_Function); +DECLARE_FIXED_TYPE_ALLOC (compiled_function, struct Lisp_Compiled_Function); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_compiled_function 1000 static Lisp_Object -make_compiled_function (void) -{ - Lisp_Compiled_Function *f; - Lisp_Object fun; - - ALLOCATE_FIXED_TYPE (compiled_function, Lisp_Compiled_Function, f); - set_lheader_implementation (&f->lheader, &lrecord_compiled_function); - - f->stack_depth = 0; - f->specpdl_depth = 0; - f->flags.documentationp = 0; - f->flags.interactivep = 0; - f->flags.domainp = 0; /* I18N3 */ - f->instructions = Qzero; - f->constants = Qzero; - f->arglist = Qnil; - f->doc_and_interactive = Qnil; +make_compiled_function (int make_pure) +{ + struct Lisp_Compiled_Function *b; + Lisp_Object new; + size_t size = sizeof (struct Lisp_Compiled_Function); + + if (make_pure && check_purespace (size)) + { + b = (struct Lisp_Compiled_Function *) (PUREBEG + pure_bytes_used); + set_lheader_implementation (&(b->lheader), lrecord_compiled_function); +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION + b->lheader.pure = 1; +#endif + pure_bytes_used += size; + bump_purestat (&purestat_bytecode, size); + } + else + { + ALLOCATE_FIXED_TYPE (compiled_function, struct Lisp_Compiled_Function, + b); + set_lheader_implementation (&(b->lheader), lrecord_compiled_function); + } + b->maxdepth = 0; + b->flags.documentationp = 0; + b->flags.interactivep = 0; + b->flags.domainp = 0; /* I18N3 */ + b->bytecodes = Qzero; + b->constants = Qzero; + b->arglist = Qnil; + b->doc_and_interactive = Qnil; #ifdef COMPILED_FUNCTION_ANNOTATION_HACK - f->annotated = Qnil; + b->annotated = Qnil; #endif - XSETCOMPILED_FUNCTION (fun, f); - return fun; + XSETCOMPILED_FUNCTION (new, b); + return new; } DEFUN ("make-byte-code", Fmake_byte_code, 4, MANY, 0, /* Return a new compiled-function object. -Usage: (arglist instructions constants stack-depth - &optional doc-string interactive) +Usage: (arglist instructions constants stack-size + &optional doc-string interactive-spec) Note that, unlike all other emacs-lisp functions, calling this with five arguments is NOT the same as calling it with six arguments, the last of which is nil. If the INTERACTIVE arg is specified as nil, then that means that this function was defined with `(interactive)'. If the arg is not specified, then that means the function is not interactive. This is terrible behavior which is retained for compatibility with old -`.elc' files which expect these semantics. +`.elc' files which expected these semantics. */ (int nargs, Lisp_Object *args)) { -/* In a non-insane world this function would have this arglist... - (arglist instructions constants stack_depth &optional doc_string interactive) +/* In a non-insane world this function would have this arglist... + (arglist, instructions, constants, stack_size, doc_string, interactive) + Lisp_Object arglist, instructions, constants, stack_size, doc_string, + interactive; */ - Lisp_Object fun = make_compiled_function (); - Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun); - Lisp_Object arglist = args[0]; Lisp_Object instructions = args[1]; Lisp_Object constants = args[2]; - Lisp_Object stack_depth = args[3]; + Lisp_Object stack_size = args[3]; Lisp_Object doc_string = (nargs > 4) ? args[4] : Qnil; Lisp_Object interactive = (nargs > 5) ? args[5] : Qunbound; - - if (nargs < 4 || nargs > 6) + /* Don't purecopy the doc references in instructions because it's + wasteful; they will get fixed up later. + + #### If something goes wrong and they don't get fixed up, + we're screwed, because pure stuff isn't marked and thus the + cons references won't be marked and will get reused. + + Note: there will be a window after the byte code is created and + before the doc references are fixed up in which there will be + impure objects inside a pure object, which apparently won't + get marked, leading the trouble. But during that entire window, + the objects are sitting on Vload_force_doc_string_list, which + is staticpro'd, so we're OK. */ + int purecopy_instructions = 1; + + if (nargs > 6) return Fsignal (Qwrong_number_of_arguments, list2 (intern ("make-byte-code"), make_int (nargs))); - /* Check for valid formal parameter list now, to allow us to use - SPECBIND_FAST_UNSAFE() later in funcall_compiled_function(). */ - { - EXTERNAL_LIST_LOOP_3 (symbol, arglist, tail) - { - CHECK_SYMBOL (symbol); - if (EQ (symbol, Qt) || - EQ (symbol, Qnil) || - SYMBOL_IS_KEYWORD (symbol)) - signal_simple_error_2 - ("Invalid constant symbol in formal parameter list", - symbol, arglist); - } - } - f->arglist = arglist; - - /* `instructions' is a string or a cons (string . int) for a + CHECK_LIST (arglist); + /* instructions is a string or a cons (string . int) for a lazy-loaded function. */ if (CONSP (instructions)) { CHECK_STRING (XCAR (instructions)); CHECK_INT (XCDR (instructions)); + if (!NILP (constants)) + CHECK_VECTOR (constants); + purecopy_instructions = 0; } else { CHECK_STRING (instructions); + CHECK_VECTOR (constants); } - f->instructions = instructions; - - if (!NILP (constants)) - CHECK_VECTOR (constants); - f->constants = constants; + CHECK_NATNUM (stack_size); + /* doc_string may be nil, string, int, or a cons (string . int). */ - CHECK_NATNUM (stack_depth); - f->stack_depth = (unsigned short) XINT (stack_depth); + /* interactive may be list or string (or unbound). */ -#ifdef COMPILED_FUNCTION_ANNOTATION_HACK - if (!NILP (Vcurrent_compiled_function_annotation)) - f->annotated = Fcopy (Vcurrent_compiled_function_annotation); - else if (!NILP (Vload_file_name_internal_the_purecopy)) - f->annotated = Vload_file_name_internal_the_purecopy; - else if (!NILP (Vload_file_name_internal)) + if (purify_flag) { - struct gcpro gcpro1; - GCPRO1 (fun); /* don't let fun get reaped */ - Vload_file_name_internal_the_purecopy = - Ffile_name_nondirectory (Vload_file_name_internal); - f->annotated = Vload_file_name_internal_the_purecopy; - UNGCPRO; + if (!purified (arglist)) + arglist = Fpurecopy (arglist); + if (purecopy_instructions && !purified (instructions)) + instructions = Fpurecopy (instructions); + if (!purified (doc_string)) + doc_string = Fpurecopy (doc_string); + if (!purified (interactive) && !UNBOUNDP (interactive)) + interactive = Fpurecopy (interactive); + + /* Statistics are kept differently for the constants */ + if (!purified (constants)) +#ifdef PURESTAT + { + int old = purecopying_for_bytecode; + purecopying_for_bytecode = 1; + constants = Fpurecopy (constants); + purecopying_for_bytecode = old; + } +#else + constants = Fpurecopy (constants); +#endif /* PURESTAT */ + +#ifdef PURESTAT + if (STRINGP (instructions)) + bump_purestat (&purestat_string_bytecodes, pure_sizeof (instructions)); + if (VECTORP (constants)) + bump_purestat (&purestat_vector_bytecode_constants, + pure_sizeof (constants)); + if (STRINGP (doc_string)) + /* These should be have been snagged by make-docfile... */ + bump_purestat (&purestat_string_documentation, + pure_sizeof (doc_string)); + if (STRINGP (interactive)) + bump_purestat (&purestat_string_interactive, + pure_sizeof (interactive)); +#endif /* PURESTAT */ } + + { + int docp = !NILP (doc_string); + int intp = !UNBOUNDP (interactive); +#ifdef I18N3 + int domp = !NILP (Vfile_domain); +#endif + Lisp_Object val = make_compiled_function (purify_flag); + struct Lisp_Compiled_Function *b = XCOMPILED_FUNCTION (val); + b->flags.documentationp = docp; + b->flags.interactivep = intp; +#ifdef I18N3 + b->flags.domainp = domp; +#endif + b->maxdepth = XINT (stack_size); + b->bytecodes = instructions; + b->constants = constants; + b->arglist = arglist; +#ifdef COMPILED_FUNCTION_ANNOTATION_HACK + if (!NILP (Vcurrent_compiled_function_annotation)) + b->annotated = Fpurecopy (Vcurrent_compiled_function_annotation); + else if (!NILP (Vload_file_name_internal_the_purecopy)) + b->annotated = Vload_file_name_internal_the_purecopy; + else if (!NILP (Vload_file_name_internal)) + { + struct gcpro gcpro1; + GCPRO1(val); /* don't let val or b get reaped */ + Vload_file_name_internal_the_purecopy = + Fpurecopy (Ffile_name_nondirectory (Vload_file_name_internal)); + b->annotated = Vload_file_name_internal_the_purecopy; + UNGCPRO; + } #endif /* COMPILED_FUNCTION_ANNOTATION_HACK */ - /* doc_string may be nil, string, int, or a cons (string . int). - interactive may be list or string (or unbound). */ - f->doc_and_interactive = Qunbound; #ifdef I18N3 - if ((f->flags.domainp = !NILP (Vfile_domain)) != 0) - f->doc_and_interactive = Vfile_domain; + if (docp && intp && domp) + b->doc_and_interactive = (((purify_flag) ? pure_cons : Fcons) + (doc_string, + (((purify_flag) ? pure_cons : Fcons) + (interactive, Vfile_domain)))); + else if (docp && domp) + b->doc_and_interactive = (((purify_flag) ? pure_cons : Fcons) + (doc_string, Vfile_domain)); + else if (intp && domp) + b->doc_and_interactive = (((purify_flag) ? pure_cons : Fcons) + (interactive, Vfile_domain)); + else #endif - if ((f->flags.interactivep = !UNBOUNDP (interactive)) != 0) - { - f->doc_and_interactive - = (UNBOUNDP (f->doc_and_interactive) ? interactive : - Fcons (interactive, f->doc_and_interactive)); - } - if ((f->flags.documentationp = !NILP (doc_string)) != 0) - { - f->doc_and_interactive - = (UNBOUNDP (f->doc_and_interactive) ? doc_string : - Fcons (doc_string, f->doc_and_interactive)); - } - if (UNBOUNDP (f->doc_and_interactive)) - f->doc_and_interactive = Qnil; + if (docp && intp) + b->doc_and_interactive = (((purify_flag) ? pure_cons : Fcons) + (doc_string, interactive)); + else if (intp) + b->doc_and_interactive = interactive; +#ifdef I18N3 + else if (domp) + b->doc_and_interactive = Vfile_domain; +#endif + else + b->doc_and_interactive = doc_string; - return fun; + return val; + } } -/************************************************************************/ -/* Symbol allocation */ -/************************************************************************/ +/**********************************************************************/ +/* 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, /* Return a newly allocated uninterned symbol whose name is NAME. Its value and function definition are void, and its property list is nil. */ - (name)) + (str)) { Lisp_Object val; - Lisp_Symbol *p; + struct Lisp_Symbol *p; - CHECK_STRING (name); + CHECK_STRING (str); - ALLOCATE_FIXED_TYPE (symbol, Lisp_Symbol, p); - set_lheader_implementation (&p->lheader, &lrecord_symbol); - p->name = XSTRING (name); - p->plist = Qnil; - p->value = Qunbound; + ALLOCATE_FIXED_TYPE (symbol, struct Lisp_Symbol, p); +#ifdef LRECORD_SYMBOL + set_lheader_implementation (&(p->lheader), lrecord_symbol); +#endif + p->name = XSTRING (str); + p->plist = Qnil; + p->value = Qunbound; p->function = Qunbound; + p->obarray = Qnil; symbol_next (p) = 0; XSETSYMBOL (val, p); return val; } -/************************************************************************/ -/* Extent allocation */ -/************************************************************************/ +/**********************************************************************/ +/* Extent allocation */ +/**********************************************************************/ DECLARE_FIXED_TYPE_ALLOC (extent, struct extent); #define MINIMUM_ALLOWED_FIXED_TYPE_CELLS_extent 1000 @@ -1547,7 +1898,8 @@ allocate_extent (void) struct extent *e; ALLOCATE_FIXED_TYPE (extent, struct extent, e); - set_lheader_implementation (&e->lheader, &lrecord_extent); + /* xzero (*e); */ + set_lheader_implementation (&(e->lheader), lrecord_extent); extent_object (e) = Qnil; set_extent_start (e, -1); set_extent_end (e, -1); @@ -1563,32 +1915,32 @@ allocate_extent (void) } -/************************************************************************/ -/* Event allocation */ -/************************************************************************/ +/**********************************************************************/ +/* 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; + struct Lisp_Event *e; - ALLOCATE_FIXED_TYPE (event, Lisp_Event, e); - set_lheader_implementation (&e->lheader, &lrecord_event); + ALLOCATE_FIXED_TYPE (event, struct Lisp_Event, e); + set_lheader_implementation (&(e->lheader), lrecord_event); XSETEVENT (val, e); return val; } -/************************************************************************/ -/* Marker allocation */ -/************************************************************************/ +/**********************************************************************/ +/* 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, /* @@ -1597,10 +1949,10 @@ Return a new marker which does not point at any place. ()) { Lisp_Object val; - Lisp_Marker *p; + struct Lisp_Marker *p; - ALLOCATE_FIXED_TYPE (marker, Lisp_Marker, p); - set_lheader_implementation (&p->lheader, &lrecord_marker); + 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; @@ -1614,10 +1966,10 @@ Lisp_Object noseeum_make_marker (void) { Lisp_Object val; - Lisp_Marker *p; + struct Lisp_Marker *p; - NOSEEUM_ALLOCATE_FIXED_TYPE (marker, Lisp_Marker, p); - set_lheader_implementation (&p->lheader, &lrecord_marker); + 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; @@ -1628,9 +1980,9 @@ noseeum_make_marker (void) } -/************************************************************************/ -/* String allocation */ -/************************************************************************/ +/**********************************************************************/ +/* String allocation */ +/**********************************************************************/ /* The data for "short" strings generally resides inside of structs of type string_chars_block. The Lisp_String structure is allocated just like any @@ -1645,97 +1997,45 @@ noseeum_make_marker (void) 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 +#ifdef LRECORD_STRING static Lisp_Object -mark_string (Lisp_Object obj) +mark_string (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_String *ptr = XSTRING (obj); + struct Lisp_String *ptr = XSTRING (obj); - if (CONSP (ptr->plist) && EXTENT_INFOP (XCAR (ptr->plist))) + if (GC_CONSP (ptr->plist) && GC_EXTENT_INFOP (XCAR (ptr->plist))) flush_cached_extent_info (XCAR (ptr->plist)); return ptr->plist; } static int -string_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +string_equal (Lisp_Object o1, Lisp_Object o2, int depth) { Bytecount len; - return (((len = XSTRING_LENGTH (obj1)) == XSTRING_LENGTH (obj2)) && - !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len)); + return (((len = XSTRING_LENGTH (o1)) == XSTRING_LENGTH (o2)) && + !memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), 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); +#endif /* LRECORD_STRING */ /* String blocks contain this many useful bytes. */ #define STRING_CHARS_BLOCK_SIZE \ @@ -1753,32 +2053,34 @@ struct string_chars_block 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 STRING_CHARS_FREE_P(ptr) ((ptr)->string == NULL) -#define MARK_STRING_CHARS_AS_FREE(ptr) ((void) ((ptr)->string = NULL)) +#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; }; @@ -1793,14 +2095,19 @@ init_string_chars_alloc (void) } 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 *) @@ -1811,13 +2118,13 @@ allocate_string_chars_struct (Lisp_String *string_it_goes_with, else { /* Make a new current string chars block */ - struct string_chars_block *new_scb = xnew (struct string_chars_block); + struct string_chars_block *new = xnew (struct string_chars_block); - current_string_chars_block->next = new_scb; - new_scb->prev = current_string_chars_block; - new_scb->next = 0; - current_string_chars_block = new_scb; - new_scb->pos = fullsize; + current_string_chars_block->next = new; + new->prev = current_string_chars_block; + new->next = 0; + current_string_chars_block = new; + new->pos = fullsize; s_chars = (struct string_chars *) current_string_chars_block->string_chars; } @@ -1832,20 +2139,23 @@ allocate_string_chars_struct (Lisp_String *string_it_goes_with, 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); + ALLOCATE_FIXED_TYPE (string, struct Lisp_String, s); +#ifdef LRECORD_STRING + set_lheader_implementation (&(s->lheader), lrecord_string); +#endif - set_string_data (s, BIG_STRING_FULLSIZE_P (fullsize) - ? xnew_array (Bufbyte, length + 1) - : allocate_string_chars_struct (s, fullsize)->chars); + s_chars = allocate_string_chars_struct (s, fullsize); + set_string_data (s, &(s_chars->chars[0])); set_string_length (s, length); s->plist = Qnil; @@ -1866,9 +2176,8 @@ static void verify_string_chars_integrity (void); */ 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 @@ -1887,62 +2196,47 @@ resize_string (Lisp_String *s, Bytecount pos, Bytecount delta) } #endif /* ERROR_CHECK_BUFPOS */ - 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. */ + /* 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)) + if (delta == 0) + /* simplest case: no size change. */ + return; + else { - if (BIG_STRING_FULLSIZE_P (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); + Bytecount oldfullsize = STRING_FULLSIZE (string_length (s)); + Bytecount newfullsize = STRING_FULLSIZE (string_length (s) + delta); + if (oldfullsize == newfullsize) + { + /* 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); @@ -1954,52 +2248,58 @@ resize_string (Lisp_String *s, Bytecount pos, Bytecount delta) } 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_STRING_CHARS_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'; + 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); + 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 @@ -2010,12 +2310,14 @@ resize_string (Lisp_String *s, Bytecount pos, Bytecount delta) #ifdef MULE void -set_string_char (Lisp_String *s, Charcount i, Emchar c) +set_string_char (struct Lisp_String *s, Charcount i, Emchar c) { + Bytecount oldlen, newlen; Bufbyte newstr[MAX_EMCHAR_LEN]; Bytecount bytoff = charcount_to_bytecount (string_data (s), i); - Bytecount oldlen = charcount_to_bytecount (string_data (s) + bytoff, 1); - Bytecount newlen = set_charptr_emchar (newstr, c); + + oldlen = charcount_to_bytecount (string_data (s) + bytoff, 1); + newlen = set_charptr_emchar (newstr, c); if (oldlen != newlen) resize_string (s, bytoff, newlen - oldlen); @@ -2026,40 +2328,35 @@ set_string_char (Lisp_String *s, Charcount i, Emchar c) #endif /* MULE */ DEFUN ("make-string", Fmake_string, 2, 2, 0, /* -Return a new string consisting of LENGTH copies of CHARACTER. -LENGTH must be a non-negative integer. +Return a new string of length LENGTH, with each character being INIT. +LENGTH must be an integer and INIT must be a character. */ - (length, character)) + (length, init)) { + Lisp_Object val; + CHECK_NATNUM (length); - CHECK_CHAR_COERCE_INT (character); + CHECK_CHAR_COERCE_INT (init); { - Bufbyte init_str[MAX_EMCHAR_LEN]; - int len = set_charptr_emchar (init_str, XCHAR (character)); - Lisp_Object val = make_uninit_string (len * XINT (length)); + Bufbyte str[MAX_EMCHAR_LEN]; + int len = set_charptr_emchar (str, XCHAR (init)); + val = make_uninit_string (len * XINT (length)); if (len == 1) /* Optimize the single-byte case */ - memset (XSTRING_DATA (val), XCHAR (character), XSTRING_LENGTH (val)); + memset (XSTRING_DATA (val), XCHAR (init), XSTRING_LENGTH (val)); else { - size_t i; + int i, j, k; Bufbyte *ptr = XSTRING_DATA (val); - for (i = XINT (length); i; i--) - { - Bufbyte *init_ptr = init_str; - switch (len) - { - case 4: *ptr++ = *init_ptr++; - case 3: *ptr++ = *init_ptr++; - case 2: *ptr++ = *init_ptr++; - case 1: *ptr++ = *init_ptr++; - } - } + k = 0; + for (i = 0; i < XINT (length); i++) + for (j = 0; j < len; j++) + ptr[k++] = str[j]; } - return val; } + return val; } DEFUN ("string", Fstring, 0, MANY, 0, /* @@ -2079,11 +2376,10 @@ Concatenate all the argument characters and make the result a string. return make_string (storage, p - storage); } - /* 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; @@ -2100,60 +2396,36 @@ make_string (const Bufbyte *contents, Bytecount length) /* 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) -{ - Lisp_String *s; - Lisp_Object val; - - /* Make sure we find out about bad make_string_nocopy's when they happen */ -#if defined (ERROR_CHECK_BUFPOS) && defined (MULE) - bytecount_to_charcount (contents, length); /* Just for the assertions */ -#endif - - /* Allocate the string header */ - ALLOCATE_FIXED_TYPE (string, 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); - set_string_length (s, length); - - XSETSTRING (val, s); - return val; -} - /************************************************************************/ /* lcrecord lists */ @@ -2167,7 +2439,7 @@ make_string_nocopy (const Bufbyte *contents, Bytecount length) 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() @@ -2188,7 +2460,7 @@ make_string_nocopy (const Bufbyte *contents, Bytecount length) */ 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; @@ -2199,23 +2471,22 @@ mark_lcrecord_list (Lisp_Object obj) 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; @@ -2226,13 +2497,13 @@ mark_lcrecord_list (Lisp_Object obj) 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); + lrecord_lcrecord_list); Lisp_Object val; p->implementation = implementation; @@ -2253,21 +2524,23 @@ allocate_managed_lcrecord (Lisp_Object lcrecord_list) (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; @@ -2276,7 +2549,8 @@ allocate_managed_lcrecord (Lisp_Object lcrecord_list) { Lisp_Object val; - XSETOBJ (val, alloc_lcrecord (list->size, list->implementation)); + XSETOBJ (val, Lisp_Type_Record, + alloc_lcrecord (list->size, list->implementation)); return val; } } @@ -2287,174 +2561,883 @@ free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord) 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); + ((implementation->finalizer) (lheader, 0)); free_header->chain = list->free; free_header->lcheader.free = 1; list->free = lcrecord; } +/**********************************************************************/ +/* Purity of essence, peace on earth */ +/**********************************************************************/ + +static int symbols_initialized; + +Lisp_Object +make_pure_string (CONST Bufbyte *data, Bytecount length, + Lisp_Object plist, int no_need_to_copy_data) +{ + Lisp_Object new; + struct Lisp_String *s; + size_t size = sizeof (struct Lisp_String) + + (no_need_to_copy_data ? 0 : (length + 1)); /* + 1 for terminating 0 */ + size = ALIGN_SIZE (size, ALIGNOF (Lisp_Object)); + + if (symbols_initialized && !pure_lossage) + { + /* Try to share some names. Saves a few kbytes. */ + Lisp_Object tem = oblookup (Vobarray, data, length); + if (SYMBOLP (tem)) + { + s = XSYMBOL (tem)->name; + if (!PURIFIED (s)) abort (); + XSETSTRING (new, s); + return new; + } + } + + if (!check_purespace (size)) + return make_string (data, length); + + s = (struct Lisp_String *) (PUREBEG + pure_bytes_used); +#ifdef LRECORD_STRING + set_lheader_implementation (&(s->lheader), lrecord_string); +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION + s->lheader.pure = 1; +#endif +#endif + set_string_length (s, length); + if (no_need_to_copy_data) + { + set_string_data (s, (Bufbyte *) data); + } + else + { + set_string_data (s, (Bufbyte *) s + sizeof (struct Lisp_String)); + memcpy (string_data (s), data, length); + set_string_byte (s, length, 0); + } + s->plist = Qnil; + pure_bytes_used += size; + +#ifdef PURESTAT + bump_purestat (&purestat_string_all, size); + if (purecopying_for_bytecode) + bump_purestat (&purestat_string_other_function, size); +#endif /* PURESTAT */ + + /* Do this after the official "completion" of the purecopying. */ + s->plist = Fpurecopy (plist); + + XSETSTRING (new, s); + return new; +} + + +Lisp_Object +make_pure_pname (CONST Bufbyte *data, Bytecount length, + int no_need_to_copy_data) +{ + Lisp_Object name = make_pure_string (data, length, Qnil, + no_need_to_copy_data); + bump_purestat (&purestat_string_pname, pure_sizeof (name)); + + /* We've made (at least) Qnil now, and Vobarray will soon be set up. */ + symbols_initialized = 1; + + return name; +} + + +Lisp_Object +pure_cons (Lisp_Object car, Lisp_Object cdr) +{ + Lisp_Object new; + struct Lisp_Cons *c; + + if (!check_purespace (sizeof (struct Lisp_Cons))) + return Fcons (Fpurecopy (car), Fpurecopy (cdr)); + + c = (struct Lisp_Cons *) (PUREBEG + pure_bytes_used); +#ifdef LRECORD_CONS + set_lheader_implementation (&(c->lheader), lrecord_cons); +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION + c->lheader.pure = 1; +#endif +#endif + pure_bytes_used += sizeof (struct Lisp_Cons); + bump_purestat (&purestat_cons, sizeof (struct Lisp_Cons)); + + c->car = Fpurecopy (car); + c->cdr = Fpurecopy (cdr); + XSETCONS (new, c); + return new; +} + +Lisp_Object +pure_list (int nargs, Lisp_Object *args) +{ + Lisp_Object val = Qnil; + + for (--nargs; nargs >= 0; nargs--) + val = pure_cons (args[nargs], val); + + return val; +} + +#ifdef LISP_FLOAT_TYPE + +static Lisp_Object +make_pure_float (double num) +{ + struct Lisp_Float *f; + Lisp_Object val; + + /* Make sure that PUREBEG + pure_bytes_used is aligned on at least a sizeof + (double) boundary. Some architectures (like the sparc) require + this, and I suspect that floats are rare enough that it's no + tragedy for those that don't. */ + { +#if defined (__GNUC__) && (__GNUC__ >= 2) + /* In gcc, we can directly ask what the alignment constraints of a + structure are, but in general, that's not possible... Arrgh!! + */ + int alignment = __alignof (struct Lisp_Float); +#else /* !GNUC */ + /* Best guess is to make the `double' slot be aligned to the size + of double (which is probably 8 bytes). This assumes that it's + ok to align the beginning of the structure to the same boundary + that the `double' slot in it is supposed to be aligned to; this + should be ok because presumably there is padding in the layout + of the struct to account for this. + */ + int alignment = sizeof (float_data (f)); +#endif /* !GNUC */ + char *p = ((char *) PUREBEG + pure_bytes_used); + + p = (char *) (((EMACS_UINT) p + alignment - 1) & - alignment); + pure_bytes_used = p - (char *) PUREBEG; + } + + if (!check_purespace (sizeof (struct Lisp_Float))) + return make_float (num); + + f = (struct Lisp_Float *) (PUREBEG + pure_bytes_used); + set_lheader_implementation (&(f->lheader), lrecord_float); +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION + f->lheader.pure = 1; +#endif + pure_bytes_used += sizeof (struct Lisp_Float); + bump_purestat (&purestat_float, sizeof (struct Lisp_Float)); + + float_data (f) = num; + XSETFLOAT (val, f); + return val; +} + +#endif /* LISP_FLOAT_TYPE */ + +Lisp_Object +make_pure_vector (size_t len, Lisp_Object init) +{ + Lisp_Object new; + struct Lisp_Vector *v; + size_t size = (sizeof (struct Lisp_Vector) + + (len - 1) * sizeof (Lisp_Object)); + + init = Fpurecopy (init); + + if (!check_purespace (size)) + return make_vector (len, init); + + v = (struct Lisp_Vector *) (PUREBEG + pure_bytes_used); +#ifdef LRECORD_VECTOR + set_lheader_implementation (&(v->header.lheader), lrecord_vector); +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION + v->header.lheader.pure = 1; +#endif +#endif + pure_bytes_used += size; + bump_purestat (&purestat_vector_all, size); + + v->size = len; + + for (size = 0; size < len; size++) + v->contents[size] = init; + + XSETVECTOR (new, v); + return new; +} + +#if 0 +/* Presently unused */ +void * +alloc_pure_lrecord (int size, struct lrecord_implementation *implementation) +{ + struct lrecord_header *header = (void *) (PUREBEG + pure_bytes_used); + + if (pure_bytes_used + size > get_PURESIZE()) + pure_storage_exhausted (); + + set_lheader_implementation (header, implementation); + header->next = 0; + return header; +} +#endif /* unused */ + DEFUN ("purecopy", Fpurecopy, 1, 1, 0, /* -Kept for compatibility, returns its argument. -Old: Make a copy of OBJECT in pure storage. Recursively copies contents of vectors and cons cells. Does not copy symbols. */ - (object)) + (obj)) { - return object; -} + int i; + if (!purify_flag) + return obj; - -/************************************************************************/ -/* Garbage Collection */ -/************************************************************************/ + if (!POINTER_TYPE_P (XTYPE (obj)) + || PURIFIED (XPNTR (obj)) + /* happens when bootstrapping Qnil */ + || EQ (obj, Qnull_pointer)) + return obj; -/* All the built-in lisp object types are enumerated in `enum lrecord_type'. - Additional ones may be defined by a module (none yet). We leave some - room in `lrecord_implementations_table' for such new lisp object types. */ -const struct lrecord_implementation *lrecord_implementations_table[(unsigned int)lrecord_type_last_built_in_type + MODULE_DEFINABLE_TYPE_COUNT]; -unsigned int lrecord_type_count = (unsigned int)lrecord_type_last_built_in_type; -/* Object marker functions are in the lrecord_implementation structure. - But copying them to a parallel array is much more cache-friendly. - This hack speeds up (garbage-collect) by about 5%. */ -Lisp_Object (*lrecord_markers[countof (lrecord_implementations_table)]) (Lisp_Object); + switch (XTYPE (obj)) + { +#ifndef LRECORD_CONS + case Lisp_Type_Cons: + return pure_cons (XCAR (obj), XCDR (obj)); +#endif -struct gcpro *gcprolist; +#ifndef LRECORD_STRING + case Lisp_Type_String: + return make_pure_string (XSTRING_DATA (obj), + XSTRING_LENGTH (obj), + XSTRING (obj)->plist, + 0); +#endif /* ! LRECORD_STRING */ -/* We want the staticpros relocated, but not the pointers found therein. - Hence we use a trivial description, as for pointerless objects. */ -static const struct lrecord_description staticpro_description_1[] = { - { XD_END } -}; +#ifndef LRECORD_VECTOR + case Lisp_Type_Vector: + { + struct Lisp_Vector *o = XVECTOR (obj); + Lisp_Object new = make_pure_vector (vector_length (o), Qnil); + for (i = 0; i < vector_length (o); i++) + XVECTOR_DATA (new)[i] = Fpurecopy (o->contents[i]); + return new; + } +#endif /* !LRECORD_VECTOR */ -static const struct struct_description staticpro_description = { - sizeof (Lisp_Object *), - staticpro_description_1 -}; + default: + { + if (COMPILED_FUNCTIONP (obj)) + { + struct Lisp_Compiled_Function *o = XCOMPILED_FUNCTION (obj); + Lisp_Object new = make_compiled_function (1); + /* How on earth could this code have worked before? -sb */ + struct Lisp_Compiled_Function *n = XCOMPILED_FUNCTION (new); + n->flags = o->flags; + n->bytecodes = Fpurecopy (o->bytecodes); + n->constants = Fpurecopy (o->constants); + n->arglist = Fpurecopy (o->arglist); + n->doc_and_interactive = Fpurecopy (o->doc_and_interactive); + n->maxdepth = o->maxdepth; + return new; + } +#ifdef LRECORD_CONS + else if (CONSP (obj)) + return pure_cons (XCAR (obj), XCDR (obj)); +#endif /* LRECORD_CONS */ +#ifdef LRECORD_VECTOR + else if (VECTORP (obj)) + { + struct Lisp_Vector *o = XVECTOR (obj); + Lisp_Object new = make_pure_vector (vector_length (o), Qnil); + for (i = 0; i < vector_length (o); i++) + XVECTOR_DATA (new)[i] = Fpurecopy (o->contents[i]); + return new; + } +#endif /* LRECORD_VECTOR */ +#ifdef LRECORD_STRING + else if (STRINGP (obj)) + { + return make_pure_string (XSTRING_DATA (obj), + XSTRING_LENGTH (obj), + XSTRING (obj)->plist, + 0); + } +#endif /* LRECORD_STRING */ +#ifdef LISP_FLOAT_TYPE + else if (FLOATP (obj)) + return make_pure_float (float_data (XFLOAT (obj))); +#endif /* LISP_FLOAT_TYPE */ + else if (SYMBOLP (obj)) + { + /* + * Symbols can't be made pure (and thus read-only), + * because assigning to their function, value or plist + * slots would produced a SEGV in the dumped XEmacs. So + * we previously would just return the symbol unchanged. + * + * But purified aggregate objects like lists and vectors + * can contain uninterned symbols. If there are no + * other non-pure references to the symbol, then the + * symbol is not protected from garbage collection + * because the collector does not mark the contents of + * purified objects. So to protect the symbols, an impure + * reference has to be kept for each uninterned symbol + * that is referenced by a pure object. All such + * symbols are stored in the hashtable pointed to by + * Vpure_uninterned_symbol_table, which is itself + * staticpro'd. + */ + if (!NILP (XSYMBOL (obj)->obarray)) + return obj; + Fputhash (obj, Qnil, Vpure_uninterned_symbol_table); + return obj; + } + else + signal_simple_error ("Can't purecopy %S", obj); + } + } + return obj; +} -static const struct lrecord_description staticpros_description_1[] = { - XD_DYNARR_DESC (Lisp_Object_ptr_dynarr, &staticpro_description), - { XD_END } -}; -static const struct struct_description staticpros_description = { - sizeof (Lisp_Object_ptr_dynarr), - staticpros_description_1 -}; + +static void +puresize_adjust_h (size_t puresize) +{ + FILE *stream = fopen ("puresize-adjust.h", "w"); -Lisp_Object_ptr_dynarr *staticpros; + if (stream == NULL) + report_file_error ("Opening puresize adjustment file", + Fcons (build_string ("puresize-adjust.h"), Qnil)); + + fprintf (stream, + "/*\tDo not edit this file!\n" + "\tAutomatically generated by XEmacs */\n" + "# define PURESIZE_ADJUSTMENT (%ld)\n", + (long) (puresize - RAW_PURESIZE)); + fclose (stream); +} -/* Mark the Lisp_Object at non-heap VARADDRESS as a root object for - garbage collection, and for dumping. */ void -staticpro (Lisp_Object *varaddress) +report_pure_usage (int report_impurities, + int die_if_pure_storage_exceeded) { - Dynarr_add (staticpros, varaddress); - dump_add_root_object (varaddress); + int rc = 0; + + if (pure_lossage) + { + message ("\n****\tPure Lisp storage exhausted!\n" + "\tPurespace usage: %ld of %ld\n" + "****", + (long) get_PURESIZE() + pure_lossage, + (long) get_PURESIZE()); + if (die_if_pure_storage_exceeded) + { + puresize_adjust_h (get_PURESIZE() + pure_lossage); +#ifdef HEAP_IN_DATA + sheap_adjust_h(); +#endif + rc = -1; + } + } + else + { + size_t lost = (get_PURESIZE() - pure_bytes_used) / 1024; + char buf[200]; + /* extern Lisp_Object Vemacs_beta_version; */ + /* This used to be NILP(Vemacs_beta_version) ? 512 : 4; */ +#ifndef PURESIZE_SLOP +#define PURESIZE_SLOP 0 +#endif + size_t slop = PURESIZE_SLOP; + + sprintf (buf, "Purespace usage: %ld of %ld (%d%%", + (long) pure_bytes_used, + (long) get_PURESIZE(), + (int) (pure_bytes_used / (get_PURESIZE() / 100.0) + 0.5)); + if (lost > ((slop ? slop : 1) / 1024)) { + sprintf (buf + strlen (buf), " -- %ldk wasted", (long)lost); + if (die_if_pure_storage_exceeded) { + puresize_adjust_h (pure_bytes_used + slop); +#ifdef HEAP_IN_DATA + sheap_adjust_h(); +#endif + rc = -1; + } + } + + strcat (buf, ")."); + message ("%s", buf); + } + +#ifdef PURESTAT + + purestat_vector_other.nbytes = + purestat_vector_all.nbytes - + purestat_vector_bytecode_constants.nbytes; + purestat_vector_other.nobjects = + purestat_vector_all.nobjects - + purestat_vector_bytecode_constants.nobjects; + + purestat_string_other.nbytes = + purestat_string_all.nbytes - + (purestat_string_pname.nbytes + + purestat_string_bytecodes.nbytes + + purestat_string_interactive.nbytes + + purestat_string_documentation.nbytes + +#ifdef I18N3 + purestat_string_domain.nbytes + +#endif + purestat_string_other_function.nbytes); + + purestat_string_other.nobjects = + purestat_string_all.nobjects - + (purestat_string_pname.nobjects + + purestat_string_bytecodes.nobjects + + purestat_string_interactive.nobjects + + purestat_string_documentation.nobjects + +#ifdef I18N3 + purestat_string_domain.nobjects + +#endif + purestat_string_other_function.nobjects); + + message (" %-26s Total Bytes", ""); + + { + int j; + + for (j = 0; j < countof (purestats); j++) + if (!purestats[j]) + clear_message (); + else + { + char buf [100]; + sprintf(buf, "%s:", purestats[j]->name); + message (" %-26s %5d %7d %2d%%", + buf, + purestats[j]->nobjects, + purestats[j]->nbytes, + (int) (purestats[j]->nbytes / (pure_bytes_used / 100.0) + 0.5)); + } + } +#endif /* PURESTAT */ + + + if (report_impurities) + { + Lisp_Object tem = Felt (Fgarbage_collect (), make_int (5)); + struct gcpro gcpro1; + GCPRO1 (tem); + message ("\nImpurities:"); + while (!NILP (tem)) + { + if (CONSP (tem) && SYMBOLP (Fcar (tem)) && CONSP (Fcdr (tem))) + { + int total = XINT (Fcar (Fcdr (tem))); + if (total > 0) + { + char buf [100]; + char *s = buf; + memcpy (buf, string_data (XSYMBOL (Fcar (tem))->name), + string_length (XSYMBOL (Fcar (tem))->name) + 1); + while (*s++) if (*s == '-') *s = ' '; + s--; *s++ = ':'; *s = 0; + message (" %-33s %6d", buf, total); + } + tem = Fcdr (Fcdr (tem)); + } + else /* WTF?! */ + { + Fprin1 (tem, Qexternal_debugging_output); + tem = Qnil; + } + } + UNGCPRO; + garbage_collect_1 (); /* GC garbage_collect's garbage */ + } + clear_message (); + + if (rc < 0) { + unlink("SATISFIED"); + fatal ("Pure size adjusted, Don't Panic! I will restart the `make'"); + } else if (pure_lossage && die_if_pure_storage_exceeded) { + fatal ("Pure storage exhausted"); + } } + +/**********************************************************************/ +/* staticpro */ +/**********************************************************************/ -Lisp_Object_ptr_dynarr *staticpros_nodump; +struct gcpro *gcprolist; -/* Mark the Lisp_Object at non-heap VARADDRESS as a root object for - garbage collection, but not for dumping. */ +/* 415 used Mly 29-Jun-93 */ +/* 1327 used slb 28-Feb-98 */ +#ifdef HAVE_SHLIB +#define NSTATICS 4000 +#else +#define NSTATICS 2000 +#endif +/* Not "static" because of linker lossage on some systems */ +Lisp_Object *staticvec[NSTATICS] + /* Force it into data space! */ + = {0}; +static int staticidx; + +/* Put an entry in staticvec, pointing at the variable whose address is given + */ void -staticpro_nodump (Lisp_Object *varaddress) +staticpro (Lisp_Object *varaddress) { - Dynarr_add (staticpros_nodump, varaddress); + if (staticidx >= countof (staticvec)) + /* #### This is now a dubious abort() since this routine may be called */ + /* by Lisp attempting to load a DLL. */ + abort (); + staticvec[staticidx++] = varaddress; } + +/* Mark reference to a Lisp_Object. If the object referred to has not been + seen yet, recursively mark all the references contained in it. */ + +static void +mark_object (Lisp_Object obj) +{ + tail_recurse: + + if (EQ (obj, Qnull_pointer)) + return; + if (!POINTER_TYPE_P (XGCTYPE (obj))) + return; + if (PURIFIED (XPNTR (obj))) + return; + switch (XGCTYPE (obj)) + { +#ifndef LRECORD_CONS + case Lisp_Type_Cons: + { + struct Lisp_Cons *ptr = XCONS (obj); + if (CONS_MARKED_P (ptr)) + break; + MARK_CONS (ptr); + /* If the cdr is nil, tail-recurse on the car. */ + if (NILP (ptr->cdr)) + { + obj = ptr->car; + } + else + { + mark_object (ptr->car); + obj = ptr->cdr; + } + goto tail_recurse; + } +#endif + + case Lisp_Type_Record: + /* case Lisp_Symbol_Value_Magic: */ + { + struct lrecord_header *lheader = XRECORD_LHEADER (obj); + CONST struct lrecord_implementation *implementation + = LHEADER_IMPLEMENTATION (lheader); + + if (! MARKED_RECORD_HEADER_P (lheader) && + ! UNMARKABLE_RECORD_HEADER_P (lheader)) + { + MARK_RECORD_HEADER (lheader); #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) + if (!implementation->basic_p) + assert (! ((struct lcrecord_header *) lheader)->free); #endif + if (implementation->marker != 0) + { + obj = ((implementation->marker) (obj, mark_object)); + if (!NILP (obj)) goto tail_recurse; + } + } + } + break; + +#ifndef LRECORD_STRING + case Lisp_Type_String: + { + struct Lisp_String *ptr = XSTRING (obj); + + if (!XMARKBIT (ptr->plist)) + { + if (CONSP (ptr->plist) && + EXTENT_INFOP (XCAR (ptr->plist))) + flush_cached_extent_info (XCAR (ptr->plist)); + XMARK (ptr->plist); + obj = ptr->plist; + goto tail_recurse; + } + } + break; +#endif /* ! LRECORD_STRING */ + +#ifndef LRECORD_VECTOR + case Lisp_Type_Vector: + { + struct Lisp_Vector *ptr = XVECTOR (obj); + int len = vector_length (ptr); + int i; + + if (len < 0) + break; /* Already marked */ + ptr->size = -1 - len; /* Else mark it */ + for (i = 0; i < len - 1; i++) /* and then mark its elements */ + mark_object (ptr->contents[i]); + if (len > 0) + { + obj = ptr->contents[len - 1]; + goto tail_recurse; + } + } + break; +#endif /* !LRECORD_VECTOR */ + +#ifndef LRECORD_SYMBOL + case Lisp_Type_Symbol: + { + struct Lisp_Symbol *sym = XSYMBOL (obj); + + while (!XMARKBIT (sym->plist)) + { + XMARK (sym->plist); + mark_object (sym->value); + mark_object (sym->function); + { + /* + * symbol->name is a struct Lisp_String *, not a + * Lisp_Object. Fix it up and pass to mark_object. + */ + Lisp_Object symname; + XSETSTRING(symname, sym->name); + mark_object(symname); + } + if (!symbol_next (sym)) + { + obj = sym->plist; + goto tail_recurse; + } + mark_object (sym->plist); + /* Mark the rest of the symbols in the hash-chain */ + sym = symbol_next (sym); + } + } + break; +#endif /* !LRECORD_SYMBOL */ + + default: + abort (); + } +} + +/* mark all of the conses in a list and mark the final cdr; but + DO NOT mark the cars. + + Use only for internal lists! There should never be other pointers + to the cons cells, because if so, the cars will remain unmarked + even when they maybe should be marked. */ +void +mark_conses_in_list (Lisp_Object obj) +{ + Lisp_Object rest; + + for (rest = obj; CONSP (rest); rest = XCDR (rest)) + { + if (CONS_MARKED_P (XCONS (rest))) + return; + MARK_CONS (XCONS (rest)); + } + + mark_object (rest); +} -/* Mark reference to a Lisp_Object. If the object referred to has not been - seen yet, recursively mark all the references contained in it. */ +#ifdef PURESTAT +/* Simpler than mark-object, because pure structure can't + have any circularities */ + +#if 0 /* unused */ +static int idiot_c_doesnt_have_closures; +static void +idiot_c (Lisp_Object obj) +{ + idiot_c_doesnt_have_closures += pure_sizeof (obj, 1); +} +#endif /* unused */ + +static size_t +pure_string_sizeof (Lisp_Object obj) +{ + struct Lisp_String *ptr = XSTRING (obj); + + if (string_data (ptr) != (Bufbyte *) ptr + sizeof (*ptr)) + { + /* string-data not allocated contiguously. + Probably (better be!!) a pointer constant "C" data. */ + return sizeof (*ptr); + } + else + { + size_t size = sizeof (*ptr) + string_length (ptr) + 1; + size = ALIGN_SIZE (size, sizeof (Lisp_Object)); + return size; + } +} -void -mark_object (Lisp_Object obj) +/* recurse arg isn't actually used */ +static size_t +pure_sizeof (Lisp_Object obj /*, int recurse */) { - tail_recurse: + size_t total = 0; + + /*tail_recurse: */ + if (!POINTER_TYPE_P (XTYPE (obj)) + || !PURIFIED (XPNTR (obj))) + return total; - /* Checks we used to perform */ - /* if (EQ (obj, Qnull_pointer)) return; */ - /* if (!POINTER_TYPE_P (XGCTYPE (obj))) return; */ - /* if (PURIFIED (XPNTR (obj))) return; */ + /* symbol's sizes are accounted for separately */ + if (SYMBOLP (obj)) + return total; - if (XTYPE (obj) == Lisp_Type_Record) + switch (XTYPE (obj)) { - struct lrecord_header *lheader = XRECORD_LHEADER (obj); - GC_CHECK_LHEADER_INVARIANTS (lheader); +#ifndef LRECORD_STRING + case Lisp_Type_String: + total += pure_string_sizeof (obj); + break; +#endif /* ! LRECORD_STRING */ - gc_checking_assert (LHEADER_IMPLEMENTATION (lheader)->basic_p || - ! ((struct lcrecord_header *) lheader)->free); +#ifndef LRECORD_VECTOR + case Lisp_Type_Vector: + { + struct Lisp_Vector *ptr = XVECTOR (obj); + int len = vector_length (ptr); + + total += (sizeof (struct Lisp_Vector) + + (len - 1) * sizeof (Lisp_Object)); +#if 0 /* unused */ + if (!recurse) + break; + { + int i; + for (i = 0; i < len - 1; i++) + total += pure_sizeof (ptr->contents[i], 1); + } + if (len > 0) + { + obj = ptr->contents[len - 1]; + goto tail_recurse; + } +#endif /* unused */ + } + break; +#endif /* !LRECORD_VECTOR */ - /* All c_readonly objects have their mark bit set, - so that we only need to check the mark bit here. */ - if (! MARKED_RECORD_HEADER_P (lheader)) - { - MARK_RECORD_HEADER (lheader); + case Lisp_Type_Record: + { + struct lrecord_header *lheader = XRECORD_LHEADER (obj); + CONST struct lrecord_implementation *implementation + = LHEADER_IMPLEMENTATION (lheader); - if (RECORD_MARKER (lheader)) - { - obj = RECORD_MARKER (lheader) (obj); - if (!NILP (obj)) goto tail_recurse; - } - } - } -} +#ifdef LRECORD_STRING + if (STRINGP (obj)) + total += pure_string_sizeof (obj); + else +#endif + if (implementation->size_in_bytes_method) + total += ((implementation->size_in_bytes_method) (lheader)); + else + total += implementation->static_size; -/* mark all of the conses in a list and mark the final cdr; but - DO NOT mark the cars. +#if 0 /* unused */ + if (!recurse) + break; - Use only for internal lists! There should never be other pointers - to the cons cells, because if so, the cars will remain unmarked - even when they maybe should be marked. */ -void -mark_conses_in_list (Lisp_Object obj) -{ - Lisp_Object rest; + if (implementation->marker != 0) + { + int old = idiot_c_doesnt_have_closures; - for (rest = obj; CONSP (rest); rest = XCDR (rest)) - { - if (CONS_MARKED_P (XCONS (rest))) - return; - MARK_CONS (XCONS (rest)); - } + idiot_c_doesnt_have_closures = 0; + obj = ((implementation->marker) (obj, idiot_c)); + total += idiot_c_doesnt_have_closures; + idiot_c_doesnt_have_closures = old; - mark_object (rest); + if (!NILP (obj)) goto tail_recurse; + } +#endif /* unused */ + } + break; + +#ifndef LRECORD_CONS + case Lisp_Type_Cons: + { + struct Lisp_Cons *ptr = XCONS (obj); + total += sizeof (*ptr); +#if 0 /* unused */ + if (!recurse) + break; + /* If the cdr is nil, tail-recurse on the car. */ + if (NILP (ptr->cdr)) + { + obj = ptr->car; + } + else + { + total += pure_sizeof (ptr->car, 1); + obj = ptr->cdr; + } + goto tail_recurse; +#endif /* unused */ + } + break; +#endif + + /* Others can't be purified */ + default: + abort (); + } + return total; } +#endif /* PURESTAT */ + + /* Find all structures not marked, and free them. */ +#ifndef LRECORD_VECTOR +static int gc_count_num_vector_used, gc_count_vector_total_size; +static int gc_count_vector_storage; +#endif static int gc_count_num_bit_vector_used, gc_count_bit_vector_total_size; static int gc_count_bit_vector_storage; static int gc_count_num_short_string_in_use; @@ -2464,6 +3447,31 @@ static int gc_count_short_string_total_size; /* static int gc_count_total_records_used, gc_count_records_total_size; */ +/* 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) + +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) + { + if (last_lrecord_type_index_assigned == max_lrecord_type) + abort (); + 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 @@ -2473,27 +3481,41 @@ static struct int instances_freed; int bytes_freed; int instances_on_free_list; -} lcrecord_stats [countof (lrecord_implementations_table) - + MODULE_DEFINABLE_TYPE_COUNT]; +} lcrecord_stats [countof (lrecord_implementations_table)]; + + +static void +reset_lcrecord_stats (void) +{ + int i; + for (i = 0; i < countof (lcrecord_stats); i++) + { + lcrecord_stats[i].instances_in_use = 0; + lcrecord_stats[i].bytes_in_use = 0; + lcrecord_stats[i].instances_freed = 0; + lcrecord_stats[i].bytes_freed = 0; + lcrecord_stats[i].instances_on_free_list = 0; + } +} 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++; @@ -2515,8 +3537,7 @@ sweep_lcrecords_1 (struct lcrecord_header **prev, int *used) struct lcrecord_header *header; int num_used = 0; /* int total_size = 0; */ - - xzero (lcrecord_stats); /* Reset all statistics to 0. */ + reset_lcrecord_stats (); /* First go through and call all the finalize methods. Then go through and free the objects. There used to @@ -2531,13 +3552,10 @@ sweep_lcrecords_1 (struct lcrecord_header **prev, int *used) 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 (!MARKED_RECORD_HEADER_P (h) && ! (header->free)) { if (LHEADER_IMPLEMENTATION (h)->finalizer) - LHEADER_IMPLEMENTATION (h)->finalizer (h, 0); + ((LHEADER_IMPLEMENTATION (h)->finalizer) (h, 0)); } } @@ -2546,11 +3564,9 @@ sweep_lcrecords_1 (struct lcrecord_header **prev, int *used) struct lrecord_header *h = &(header->lheader); if (MARKED_RECORD_HEADER_P (h)) { - if (! C_READONLY_RECORD_HEADER_P (h)) - UNMARK_RECORD_HEADER (h); + UNMARK_RECORD_HEADER (h); num_used++; - /* total_size += n->implementation->size_in_bytes (h);*/ - /* #### May modify header->next on a C_READONLY lcrecord */ + /* total_size += ((n->implementation->size_in_bytes) (h));*/ prev = &(header->next); header = *prev; tick_lcrecord_stats (h, 0); @@ -2569,6 +3585,47 @@ sweep_lcrecords_1 (struct lcrecord_header **prev, int *used) /* *total = total_size; */ } +#ifndef LRECORD_VECTOR + +static void +sweep_vectors_1 (Lisp_Object *prev, + int *used, int *total, int *storage) +{ + Lisp_Object vector; + int num_used = 0; + int total_size = 0; + int total_storage = 0; + + for (vector = *prev; VECTORP (vector); ) + { + struct Lisp_Vector *v = XVECTOR (vector); + int len = v->size; + if (len < 0) /* marked */ + { + len = - (len + 1); + v->size = len; + total_size += len; + total_storage += (MALLOC_OVERHEAD + + sizeof (struct Lisp_Vector) + + (len - 1 + 1) * sizeof (Lisp_Object)); + num_used++; + prev = &(vector_next (v)); + vector = *prev; + } + else + { + Lisp_Object next = vector_next (v); + *prev = next; + xfree (v); + vector = next; + } + } + *used = num_used; + *total = total_size; + *storage = total_storage; +} + +#endif /* ! LRECORD_VECTOR */ static void sweep_bit_vectors_1 (Lisp_Object *prev, @@ -2583,19 +3640,17 @@ sweep_bit_vectors_1 (Lisp_Object *prev, their implementation */ for (bit_vector = *prev; !EQ (bit_vector, Qzero); ) { - Lisp_Bit_Vector *v = XBIT_VECTOR (bit_vector); + struct Lisp_Bit_Vector *v = XBIT_VECTOR (bit_vector); int len = v->size; if (MARKED_RECORD_P (bit_vector)) { - if (! C_READONLY_RECORD_HEADER_P(&(v->lheader))) - UNMARK_RECORD_HEADER (&(v->lheader)); + UNMARK_RECORD_HEADER (&(v->lheader)); total_size += len; - total_storage += - MALLOC_OVERHEAD + - FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, unsigned long, - bits, BIT_VECTOR_LONG_STORAGE (len)); + total_storage += (MALLOC_OVERHEAD + + sizeof (struct Lisp_Bit_Vector) + + (BIT_VECTOR_LONG_STORAGE (len) - 1) + * sizeof (long)); num_used++; - /* #### May modify next on a C_READONLY bitvector */ prev = &(bit_vector_next (v)); bit_vector = *prev; } @@ -2619,42 +3674,41 @@ sweep_bit_vectors_1 (Lisp_Object *prev, #define SWEEP_FIXED_TYPE_BLOCK(typename, obj_type) \ do { \ - struct typename##_block *SFTB_current; \ - int SFTB_limit; \ + struct typename##_block *_frob_current; \ + struct typename##_block **_frob_prev; \ + int _frob_limit; \ int num_free = 0, num_used = 0; \ \ - for (SFTB_current = current_##typename##_block, \ - SFTB_limit = current_##typename##_block_index; \ - SFTB_current; \ + for (_frob_prev = ¤t_##typename##_block, \ + _frob_current = current_##typename##_block, \ + _frob_limit = current_##typename##_block_index; \ + _frob_current; \ ) \ { \ - int SFTB_iii; \ + int _frob_iii; \ \ - for (SFTB_iii = 0; SFTB_iii < SFTB_limit; SFTB_iii++) \ + for (_frob_iii = 0; _frob_iii < _frob_limit; _frob_iii++) \ { \ - obj_type *SFTB_victim = &(SFTB_current->block[SFTB_iii]); \ + obj_type *_frob_victim = &(_frob_current->block[_frob_iii]); \ \ - if (LRECORD_FREE_P (SFTB_victim)) \ + if (FREE_STRUCT_P (_frob_victim)) \ { \ num_free++; \ } \ - else if (C_READONLY_RECORD_HEADER_P (&SFTB_victim->lheader)) \ - { \ - num_used++; \ - } \ - else if (! MARKED_RECORD_HEADER_P (&SFTB_victim->lheader)) \ + else if (!MARKED_##typename##_P (_frob_victim)) \ { \ num_free++; \ - FREE_FIXED_TYPE (typename, obj_type, SFTB_victim); \ + FREE_FIXED_TYPE (typename, obj_type, _frob_victim); \ } \ else \ { \ num_used++; \ - UNMARK_##typename (SFTB_victim); \ + UNMARK_##typename (_frob_victim); \ } \ } \ - SFTB_current = SFTB_current->prev; \ - SFTB_limit = countof (current_##typename##_block->block); \ + _frob_prev = &(_frob_current->prev); \ + _frob_current = _frob_current->prev; \ + _frob_limit = countof (current_##typename##_block->block); \ } \ \ gc_count_num_##typename##_in_use = num_used; \ @@ -2663,82 +3717,77 @@ do { \ #else /* !ERROR_CHECK_GC */ -#define SWEEP_FIXED_TYPE_BLOCK(typename, obj_type) \ -do { \ - struct typename##_block *SFTB_current; \ - struct typename##_block **SFTB_prev; \ - int SFTB_limit; \ - int num_free = 0, num_used = 0; \ - \ - typename##_free_list = 0; \ - \ - for (SFTB_prev = ¤t_##typename##_block, \ - SFTB_current = current_##typename##_block, \ - SFTB_limit = current_##typename##_block_index; \ - SFTB_current; \ - ) \ - { \ - int SFTB_iii; \ - int SFTB_empty = 1; \ - Lisp_Free *SFTB_old_free_list = typename##_free_list; \ - \ - for (SFTB_iii = 0; SFTB_iii < SFTB_limit; SFTB_iii++) \ - { \ - obj_type *SFTB_victim = &(SFTB_current->block[SFTB_iii]); \ - \ - if (LRECORD_FREE_P (SFTB_victim)) \ - { \ - num_free++; \ - PUT_FIXED_TYPE_ON_FREE_LIST (typename, obj_type, SFTB_victim); \ - } \ - else if (C_READONLY_RECORD_HEADER_P (&SFTB_victim->lheader)) \ - { \ - SFTB_empty = 0; \ - num_used++; \ - } \ - else if (! MARKED_RECORD_HEADER_P (&SFTB_victim->lheader)) \ - { \ - num_free++; \ - FREE_FIXED_TYPE (typename, obj_type, SFTB_victim); \ - } \ - else \ - { \ - SFTB_empty = 0; \ - num_used++; \ - UNMARK_##typename (SFTB_victim); \ - } \ - } \ - if (!SFTB_empty) \ - { \ - SFTB_prev = &(SFTB_current->prev); \ - SFTB_current = SFTB_current->prev; \ - } \ - else if (SFTB_current == current_##typename##_block \ - && !SFTB_current->prev) \ - { \ - /* No real point in freeing sole allocation block */ \ - break; \ - } \ - else \ - { \ - struct typename##_block *SFTB_victim_block = SFTB_current; \ - if (SFTB_victim_block == current_##typename##_block) \ - current_##typename##_block_index \ - = countof (current_##typename##_block->block); \ - SFTB_current = SFTB_current->prev; \ - { \ - *SFTB_prev = SFTB_current; \ - xfree (SFTB_victim_block); \ - /* Restore free list to what it was before victim was swept */ \ - typename##_free_list = SFTB_old_free_list; \ - num_free -= SFTB_limit; \ - } \ - } \ - SFTB_limit = countof (current_##typename##_block->block); \ - } \ - \ - gc_count_num_##typename##_in_use = num_used; \ - gc_count_num_##typename##_freelist = num_free; \ +#define SWEEP_FIXED_TYPE_BLOCK(typename, obj_type) \ +do { \ + struct typename##_block *_frob_current; \ + struct typename##_block **_frob_prev; \ + int _frob_limit; \ + int num_free = 0, num_used = 0; \ + \ + typename##_free_list = 0; \ + \ + for (_frob_prev = ¤t_##typename##_block, \ + _frob_current = current_##typename##_block, \ + _frob_limit = current_##typename##_block_index; \ + _frob_current; \ + ) \ + { \ + int _frob_iii; \ + int _frob_empty = 1; \ + obj_type *_frob_old_free_list = typename##_free_list; \ + \ + for (_frob_iii = 0; _frob_iii < _frob_limit; _frob_iii++) \ + { \ + obj_type *_frob_victim = &(_frob_current->block[_frob_iii]); \ + \ + if (FREE_STRUCT_P (_frob_victim)) \ + { \ + num_free++; \ + PUT_FIXED_TYPE_ON_FREE_LIST (typename, obj_type, _frob_victim); \ + } \ + else if (!MARKED_##typename##_P (_frob_victim)) \ + { \ + num_free++; \ + FREE_FIXED_TYPE (typename, obj_type, _frob_victim); \ + } \ + else \ + { \ + _frob_empty = 0; \ + num_used++; \ + UNMARK_##typename (_frob_victim); \ + } \ + } \ + if (!_frob_empty) \ + { \ + _frob_prev = &(_frob_current->prev); \ + _frob_current = _frob_current->prev; \ + } \ + else if (_frob_current == current_##typename##_block \ + && !_frob_current->prev) \ + { \ + /* No real point in freeing sole allocation block */ \ + break; \ + } \ + else \ + { \ + struct typename##_block *_frob_victim_block = _frob_current; \ + if (_frob_victim_block == current_##typename##_block) \ + current_##typename##_block_index \ + = countof (current_##typename##_block->block); \ + _frob_current = _frob_current->prev; \ + { \ + *_frob_prev = _frob_current; \ + xfree (_frob_victim_block); \ + /* Restore free list to what it was before victim was swept */ \ + typename##_free_list = _frob_old_free_list; \ + num_free -= _frob_limit; \ + } \ + } \ + _frob_limit = countof (current_##typename##_block->block); \ + } \ + \ + gc_count_num_##typename##_in_use = num_used; \ + gc_count_num_##typename##_freelist = num_free; \ } while (0) #endif /* !ERROR_CHECK_GC */ @@ -2749,15 +3798,21 @@ do { \ static void sweep_conses (void) { -#define UNMARK_cons(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) +#ifndef LRECORD_CONS +# define MARKED_cons_P(ptr) XMARKBIT ((ptr)->car) +# define UNMARK_cons(ptr) do { XUNMARK ((ptr)->car); } while (0) +#else /* LRECORD_CONS */ +# define MARKED_cons_P(ptr) MARKED_RECORD_HEADER_P (&((ptr)->lheader)) +# define UNMARK_cons(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) +#endif /* LRECORD_CONS */ #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 @@ -2771,7 +3826,7 @@ free_cons (Lisp_Cons *ptr) #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 */ } @@ -2813,10 +3868,12 @@ free_alist (Lisp_Object alist) static void sweep_compiled_functions (void) { +#define MARKED_compiled_function_P(ptr) \ + MARKED_RECORD_HEADER_P (&((ptr)->lheader)) #define UNMARK_compiled_function(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) #define ADDITIONAL_FREE_compiled_function(ptr) - SWEEP_FIXED_TYPE_BLOCK (compiled_function, Lisp_Compiled_Function); + SWEEP_FIXED_TYPE_BLOCK (compiled_function, struct Lisp_Compiled_Function); } @@ -2824,25 +3881,33 @@ sweep_compiled_functions (void) static void sweep_floats (void) { +#define MARKED_float_P(ptr) MARKED_RECORD_HEADER_P (&((ptr)->lheader)) #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 */ static void sweep_symbols (void) { -#define UNMARK_symbol(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) +#ifndef LRECORD_SYMBOL +# define MARKED_symbol_P(ptr) XMARKBIT ((ptr)->plist) +# define UNMARK_symbol(ptr) do { XUNMARK ((ptr)->plist); } while (0) +#else +# define MARKED_symbol_P(ptr) MARKED_RECORD_HEADER_P (&((ptr)->lheader)) +# define UNMARK_symbol(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) +#endif /* !LRECORD_SYMBOL */ #define ADDITIONAL_FREE_symbol(ptr) - SWEEP_FIXED_TYPE_BLOCK (symbol, Lisp_Symbol); + SWEEP_FIXED_TYPE_BLOCK (symbol, struct Lisp_Symbol); } static void sweep_extents (void) { +#define MARKED_extent_P(ptr) MARKED_RECORD_HEADER_P (&((ptr)->lheader)) #define UNMARK_extent(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) #define ADDITIONAL_FREE_extent(ptr) @@ -2852,15 +3917,17 @@ sweep_extents (void) static void sweep_events (void) { +#define MARKED_event_P(ptr) MARKED_RECORD_HEADER_P (&((ptr)->lheader)) #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 sweep_markers (void) { +#define MARKED_marker_P(ptr) MARKED_RECORD_HEADER_P (&((ptr)->lheader)) #define UNMARK_marker(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) #define ADDITIONAL_FREE_marker(ptr) \ do { Lisp_Object tem; \ @@ -2868,18 +3935,22 @@ sweep_markers (void) 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 */ } @@ -2900,15 +3971,15 @@ verify_string_chars_integrity (void) { struct string_chars *s_chars = (struct string_chars *) &(sb->string_chars[pos]); - Lisp_String *string; + struct Lisp_String *string; int size; int fullsize; - /* If the string_chars struct is marked as free (i.e. the - STRING pointer is NULL) then this is an unused chunk of - string storage. (See below.) */ + /* If the string_chars struct is marked as free (i.e. the STRING + pointer is 0xFFFFFFFF) then this is an unused chunk of string + storage. (See below.) */ - if (STRING_CHARS_FREE_P (s_chars)) + if (FREE_STRUCT_P (s_chars)) { fullsize = ((struct unused_string_chars *) s_chars)->fullsize; pos += fullsize; @@ -2951,20 +4022,20 @@ compact_string_chars (void) 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; - /* If the string_chars struct is marked as free (i.e. the - STRING pointer is NULL) then this is an unused chunk of - string storage. This happens under Mule when a string's - size changes in such a way that its fullsize changes. - (Strings can change size because a different-length - character can be substituted for another character.) - In this case, after the bogus string pointer is the - "fullsize" of this entry, i.e. how many bytes to skip. */ + /* If the string_chars struct is marked as free (i.e. the STRING + pointer is 0xFFFFFFFF) then this is an unused chunk of string + storage. This happens under Mule when a string's size changes + in such a way that its fullsize changes. (Strings can change + size because a different-length character can be substituted + for another character.) In this case, after the bogus string + pointer is the "fullsize" of this entry, i.e. how many bytes + to skip. */ - if (STRING_CHARS_FREE_P (from_s_chars)) + if (FREE_STRUCT_P (from_s_chars)) { fullsize = ((struct unused_string_chars *) from_s_chars)->fullsize; from_pos += fullsize; @@ -2972,15 +4043,20 @@ compact_string_chars (void) } string = from_s_chars->string; - assert (!(LRECORD_FREE_P (string))); + assert (!(FREE_STRUCT_P (string))); 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. */ +#ifdef LRECORD_STRING if (! MARKED_RECORD_HEADER_P (&(string->lheader))) +#else + if (!XMARKBIT (string->plist)) +#endif { from_pos += fullsize; continue; @@ -3035,11 +4111,11 @@ compact_string_chars (void) 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); @@ -3061,26 +4137,49 @@ sweep_strings (void) 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) +#ifdef LRECORD_STRING + +# define MARKED_string_P(ptr) MARKED_RECORD_HEADER_P (&((ptr)->lheader)) +# 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) + +#else + +# define MARKED_string_P(ptr) XMARKBIT ((ptr)->plist) +# define UNMARK_string(ptr) \ + do { struct Lisp_String *p = (ptr); \ + int size = string_length (p); \ + XUNMARK (p->plist); \ + 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) + +#endif /* ! LRECORD_STRING */ - SWEEP_FIXED_TYPE_BLOCK (string, Lisp_String); + 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; @@ -3089,23 +4188,36 @@ sweep_strings (void) /* I hate duplicating all this crap! */ -int +static int marked_p (Lisp_Object obj) { - /* 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 (EQ (obj, Qnull_pointer)) return 1; + if (!POINTER_TYPE_P (XGCTYPE (obj))) return 1; + if (PURIFIED (XPNTR (obj))) return 1; + switch (XGCTYPE (obj)) { - struct lrecord_header *lheader = XRECORD_LHEADER (obj); - - GC_CHECK_LHEADER_INVARIANTS (lheader); - - return MARKED_RECORD_HEADER_P (lheader); +#ifndef LRECORD_CONS + case Lisp_Type_Cons: + return XMARKBIT (XCAR (obj)); +#endif + case Lisp_Type_Record: + return MARKED_RECORD_HEADER_P (XRECORD_LHEADER (obj)); +#ifndef LRECORD_STRING + case Lisp_Type_String: + return XMARKBIT (XSTRING (obj)->plist); +#endif /* ! LRECORD_STRING */ +#ifndef LRECORD_VECTOR + case Lisp_Type_Vector: + return XVECTOR_LENGTH (obj) < 0; +#endif /* !LRECORD_VECTOR */ +#ifndef LRECORD_SYMBOL + case Lisp_Type_Symbol: + return XMARKBIT (XSYMBOL (obj)->plist); +#endif + default: + abort (); } - return 1; + return 0; /* suppress compiler warning */ } static void @@ -3141,6 +4253,13 @@ gc_sweep (void) /* Put all unmarked conses on free list */ sweep_conses (); +#ifndef LRECORD_VECTOR + /* Free all unmarked vectors */ + sweep_vectors_1 (&all_vectors, + &gc_count_num_vector_used, &gc_count_vector_total_size, + &gc_count_vector_storage); +#endif + /* Free all unmarked bit vectors */ sweep_bit_vectors_1 (&all_bit_vectors, &gc_count_num_bit_vector_used, @@ -3167,9 +4286,6 @@ gc_sweep (void) sweep_events (); -#ifdef PDUMP - pdump_objects_unmark (); -#endif } /* Clearing for disksave. */ @@ -3179,12 +4295,12 @@ disksave_object_finalization (void) { /* It's important that certain information from the environment not get dumped with the executable (pathnames, environment variables, etc.). - To make it easier to tell when this has happened with strings(1) we + To make it easier to tell when this has happend with strings(1) we clear some known-to-be-garbage blocks of memory, so that leftover 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; @@ -3196,8 +4312,6 @@ disksave_object_finalization (void) Vexec_path = Qnil; Vload_path = Qnil; /* Vdump_load_path = Qnil; */ - /* Release hash tables for locate_file */ - Flocate_file_clear_hashing (Qt); uncache_home_directory(); #if defined(LOADHIST) && !(defined(LOADHIST_DUMPED) || \ @@ -3211,6 +4325,14 @@ disksave_object_finalization (void) /* Run the disksave finalization methods of all live objects. */ disksave_object_finalization_1 (); +#if 0 /* I don't see any point in this. The purespace starts out all 0's */ + /* Zero out the unused portion of purespace */ + if (!pure_lossage) + memset ( (char *) (PUREBEG + pure_bytes_used), 0, + (((char *) (PUREBEG + get_PURESIZE())) - + ((char *) (PUREBEG + pure_bytes_used)))); +#endif + /* Zero out the uninitialized (really, unused) part of the containers for the live strings. */ { @@ -3220,11 +4342,10 @@ disksave_object_finalization (void) 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); + } } } @@ -3243,69 +4364,13 @@ restore_gc_inhibit (Lisp_Object val) /* Maybe we want to use this when doing a "panic" gc after memory_full()? */ static int gc_hooks_inhibited; -struct post_gc_action -{ - void (*fun) (void *); - void *arg; -}; - -typedef struct post_gc_action post_gc_action; - -typedef struct -{ - Dynarr_declare (post_gc_action); -} post_gc_action_dynarr; - -static post_gc_action_dynarr *post_gc_actions; - -/* Register an action to be called at the end of GC. - gc_in_progress is 0 when this is called. - This is used when it is discovered that an action needs to be taken, - but it's during GC, so it's not safe. (e.g. in a finalize method.) - - As a general rule, do not use Lisp objects here. - And NEVER signal an error. -*/ - -void -register_post_gc_action (void (*fun) (void *), void *arg) -{ - post_gc_action action; - - if (!post_gc_actions) - post_gc_actions = Dynarr_new (post_gc_action); - - action.fun = fun; - action.arg = arg; - - Dynarr_add (post_gc_actions, action); -} - -static void -run_post_gc_actions (void) -{ - int i; - - if (post_gc_actions) - { - for (i = 0; i < Dynarr_length (post_gc_actions); i++) - { - post_gc_action action = Dynarr_at (post_gc_actions, i); - (action.fun) (action.arg); - } - - Dynarr_reset (post_gc_actions); - } -} - void garbage_collect_1 (void) { -#if MAX_SAVE_STACK > 0 char stack_top_variable; extern char *stack_bottom; -#endif + int i; struct frame *f; int speccount; int cursor_changed; @@ -3318,24 +4383,13 @@ garbage_collect_1 (void) || preparing_for_armageddon) return; - /* We used to call selected_frame() here. - - The following functions cannot be called inside GC - so we move to after the above tests. */ - { - Lisp_Object frame; - Lisp_Object device = Fselected_device (Qnil); - if (NILP (device)) /* Could happen during startup, eg. if always_gc */ - return; - frame = DEVICE_SELECTED_FRAME (XDEVICE (device)); - if (NILP (frame)) - signal_simple_error ("No frames exist on device", device); - f = XFRAME (frame); - } - pre_gc_cursor = Qnil; cursor_changed = 0; + /* This function cannot be called inside GC so we move to after the */ + /* above tests */ + f = selected_frame (); + GCPRO1 (pre_gc_cursor); /* Very important to prevent GC during any of the following @@ -3376,7 +4430,7 @@ garbage_collect_1 (void) : 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, @@ -3422,85 +4476,82 @@ garbage_collect_1 (void) cleanup_specifiers (); /* Mark all the special slots that serve as the roots of accessibility. */ + { + struct gcpro *tail; + struct catchtag *catch; + struct backtrace *backlist; + struct specbinding *bind; - { /* staticpro() */ - Lisp_Object **p = Dynarr_begin (staticpros); - size_t count; - for (count = Dynarr_length (staticpros); count; count--) - mark_object (**p++); - } - - { /* staticpro_nodump() */ - Lisp_Object **p = Dynarr_begin (staticpros_nodump); - size_t count; - for (count = Dynarr_length (staticpros_nodump); count; count--) - mark_object (**p++); - } + for (i = 0; i < staticidx; i++) + { +#ifdef GDB_SUCKS + printf ("%d\n", i); + debug_print (*staticvec[i]); +#endif + mark_object (*(staticvec[i])); + } - { /* GCPRO() */ - struct gcpro *tail; - int i; for (tail = gcprolist; tail; tail = tail->next) - for (i = 0; i < tail->nvars; i++) - mark_object (tail->var[i]); - } + { + for (i = 0; i < tail->nvars; i++) + mark_object (tail->var[i]); + } - { /* specbind() */ - struct specbinding *bind; for (bind = specpdl; bind != specpdl_ptr; bind++) { mark_object (bind->symbol); mark_object (bind->old_value); } - } - { - struct catchtag *catch; for (catch = catchlist; catch; catch = catch->next) { mark_object (catch->tag); mark_object (catch->val); } - } - { - struct backtrace *backlist; for (backlist = backtrace_list; backlist; backlist = backlist->next) { int nargs = backlist->nargs; - int i; mark_object (*backlist->function); - if (nargs < 0 /* nargs == UNEVALLED || nargs == MANY */) + if (nargs == UNEVALLED || nargs == MANY) mark_object (backlist->args[0]); else for (i = 0; i < nargs; i++) mark_object (backlist->args[i]); } - } - 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). + are only marked when something else is marked (e.g. weak hashtables). There may be complex dependencies between such objects -- e.g. - a weak hash table might be unmarked, but after processing a later - weak hash table, the former one might get marked. So we have to + a weak hashtable might be unmarked, but after processing a later + weak hashtable, 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) - ; + { + int did_mark; + /* Need to iterate until there's nothing more to mark, in case + of chains of mark dependencies. */ + do + { + did_mark = 0; + did_mark += !!finish_marking_weak_hashtables (marked_p, mark_object); + did_mark += !!finish_marking_weak_lists (marked_p, mark_object); + } + while (did_mark); + } /* 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_hashtables (marked_p); + prune_weak_lists (marked_p); + prune_specifiers (marked_p); + prune_syntax_tables (marked_p); gc_sweep (); @@ -3513,8 +4564,6 @@ garbage_collect_1 (void) gc_in_progress = 0; - run_post_gc_actions (); - /******* End of garbage collection ********/ run_hook_trapping_errors ("Error in post-gc-hook", Qpost_gc_hook); @@ -3536,7 +4585,7 @@ garbage_collect_1 (void) { 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); @@ -3559,10 +4608,19 @@ garbage_collect_1 (void) return; } +#ifdef EMACS_BTL + /* This isn't actually called. BTL recognizes the stack frame of the top + of the garbage collector by noting that PC is between &garbage_collect_1 + and &BTL_after_garbage_collect_1_stub. So this fn must be right here. + There's not any other way to know the address of the end of a function. + */ +void BTL_after_garbage_collect_1_stub () { abort (); } +#endif /* EMACS_BTL */ + /* 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 @@ -3570,12 +4628,13 @@ gc_plist_hack (const char *name, int value, Lisp_Object tail) return cons3 (intern (name), make_int (value), tail); } -#define HACK_O_MATIC(type, name, pl) do { \ - int s = 0; \ - struct type##_block *x = current_##type##_block; \ - while (x) { s += sizeof (*x) + MALLOC_OVERHEAD; x = x->prev; } \ - (pl) = gc_plist_hack ((name), s, (pl)); \ -} while (0) +#define HACK_O_MATIC(type, name, pl) \ + { \ + int s = 0; \ + struct type##_block *x = current_##type##_block; \ + while (x) { s += sizeof (*x) + MALLOC_OVERHEAD; x = x->prev; } \ + (pl) = gc_plist_hack ((name), s, (pl)); \ + } DEFUN ("garbage-collect", Fgarbage_collect, 0, 0, "", /* Reclaim storage for Lisp objects no longer needed. @@ -3591,25 +4650,31 @@ Garbage collection happens automatically if you cons more than ()) { Lisp_Object pl = Qnil; - unsigned int i; + int i; +#ifdef LRECORD_VECTOR int gc_count_vector_total_size = 0; +#endif + + if (purify_flag && pure_lossage) + return Qnil; 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); +#ifdef LRECORD_VECTOR /* save this for the FSFmacs-compatible part of the summary */ - if (i == lrecord_type_vector) + if (i == *lrecord_vector[0].lrecord_type_index) gc_count_vector_total_size = lcrecord_stats[i].bytes_in_use + lcrecord_stats[i].bytes_freed; - +#endif sprintf (buf, "%s-storage", name); pl = gc_plist_hack (buf, lcrecord_stats[i].bytes_in_use, pl); /* Okay, simple pluralization check for `symbol-value-varalias' */ @@ -3668,6 +4733,13 @@ Garbage collection happens automatically if you cons more than pl = gc_plist_hack ("compiled-functions-used", gc_count_num_compiled_function_in_use, pl); +#ifndef LRECORD_VECTOR + pl = gc_plist_hack ("vector-storage", gc_count_vector_storage, pl); + pl = gc_plist_hack ("vectors-total-length", + gc_count_vector_total_size, pl); + pl = gc_plist_hack ("vectors-used", gc_count_num_vector_used, pl); +#endif + pl = gc_plist_hack ("bit-vector-storage", gc_count_bit_vector_storage, pl); pl = gc_plist_hack ("bit-vectors-total-length", gc_count_bit_vector_total_size, pl); @@ -3707,8 +4779,7 @@ If this value exceeds `gc-cons-threshold', a garbage collection happens. return make_int (consing_since_gc); } -#if 0 -DEFUN ("memory-limit", Fmemory_limit, 0, 0, 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. The value is divided by 1024 to make sure it will fit in a lisp integer. @@ -3717,7 +4788,7 @@ The value is divided by 1024 to make sure it will fit in a lisp integer. { return make_int ((EMACS_INT) sbrk (0) / 1024); } -#endif + int @@ -3871,10 +4942,56 @@ fixed_type_block_overhead (size_t size) /* Initialization */ void -reinit_alloc_once_early (void) +init_alloc_once_early (void) { + int iii; + +#ifdef PURESTAT + for (iii = 0; iii < countof (purestats); iii++) + { + if (! purestats[iii]) continue; + purestats[iii]->nobjects = 0; + purestats[iii]->nbytes = 0; + } + purecopying_for_bytecode = 0; +#endif /* PURESTAT */ + + last_lrecord_type_index_assigned = -1; + for (iii = 0; iii < countof (lrecord_implementations_table); iii++) + { + lrecord_implementations_table[iii] = 0; + } + +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION + /* + * If USE_INDEXED_LRECORD_IMPLEMENTATION is defined, 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[0].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[0].lrecord_type_index) == 1); +#endif /* USE_INDEXED_LRECORD_IMPLEMENTATION */ + + symbols_initialized = 0; + 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; + pure_bytes_used = 0; + pure_lossage = 0; breathing_space = 0; +#ifndef LRECORD_VECTOR + XSETINT (all_vectors, 0); /* Qzero may not be set yet. */ +#endif XSETINT (all_bit_vectors, 0); /* Qzero may not be set yet. */ XSETINT (Vgc_message, 0); all_lcrecords = 0; @@ -3899,18 +5016,17 @@ reinit_alloc_once_early (void) init_event_alloc (); ignore_malloc_warnings = 0; - - if (staticpros_nodump) - Dynarr_free (staticpros_nodump); - staticpros_nodump = Dynarr_new2 (Lisp_Object_ptr_dynarr, Lisp_Object *); - Dynarr_resize (staticpros_nodump, 100); /* merely a small optimization */ - + staticidx = 0; consing_since_gc = 0; #if 1 gc_cons_threshold = 500000; /* XEmacs change */ #else gc_cons_threshold = 15000; /* debugging */ #endif +#ifdef VIRT_ADDR_VARIES + malloc_sbrk_unused = 1<<22; /* A large number */ + malloc_sbrk_used = 100000; /* as reasonable as any number */ +#endif /* VIRT_ADDR_VARIES */ lrecord_uid_counter = 259; debug_string_purity = 0; gcprolist = 0; @@ -3930,27 +5046,6 @@ reinit_alloc_once_early (void) } 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); - - staticpros = Dynarr_new2 (Lisp_Object_ptr_dynarr, Lisp_Object *); - Dynarr_resize (staticpros, 1410); /* merely a small optimization */ - dump_add_root_struct_ptr (&staticpros, &staticpros_description); -} - -void reinit_alloc (void) { gcprolist = 0; @@ -3959,9 +5054,9 @@ reinit_alloc (void) void syms_of_alloc (void) { - DEFSYMBOL (Qpre_gc_hook); - DEFSYMBOL (Qpost_gc_hook); - DEFSYMBOL (Qgarbage_collecting); + defsymbol (&Qpre_gc_hook, "pre-gc-hook"); + defsymbol (&Qpost_gc_hook, "post-gc-hook"); + defsymbol (&Qgarbage_collecting, "garbage-collecting"); DEFSUBR (Fcons); DEFSUBR (Flist); @@ -3977,9 +5072,7 @@ syms_of_alloc (void) DEFSUBR (Fmake_marker); DEFSUBR (Fpurecopy); DEFSUBR (Fgarbage_collect); -#if 0 DEFSUBR (Fmemory_limit); -#endif DEFSUBR (Fconsing_since_gc); } @@ -4001,6 +5094,20 @@ prevent garbage collection during a part of the program. See also `consing-since-gc'. */ ); + DEFVAR_INT ("pure-bytes-used", &pure_bytes_used /* +Number of bytes of sharable Lisp data allocated so far. +*/ ); + +#if 0 + DEFVAR_INT ("data-bytes-used", &malloc_sbrk_used /* +Number of bytes of unshared memory allocated in this session. +*/ ); + + DEFVAR_INT ("data-bytes-free", &malloc_sbrk_unused /* +Number of bytes of unshared memory remaining available in this session. +*/ ); +#endif + #ifdef DEBUG_XEMACS DEFVAR_INT ("debug-allocation", &debug_allocation /* If non-zero, print out information to stderr about all objects allocated. @@ -4017,7 +5124,7 @@ Length (in stack frames) of short backtrace printed out by `debug-allocation'. DEFVAR_BOOL ("purify-flag", &purify_flag /* Non-nil means loading Lisp code in order to dump an executable. -This means that certain objects should be allocated in readonly space. +This means that certain objects should be allocated in shared (pure) space. */ ); DEFVAR_LISP ("pre-gc-hook", &Vpre_gc_hook /* @@ -4043,7 +5150,9 @@ window system and `gc-pointer-glyph' specifies a value (i.e. a pointer 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_pure_string ((CONST Bufbyte *) gc_default_message, + countof (gc_default_message) - 1, + Qnil, 1); DEFVAR_LISP ("gc-pointer-glyph", &Vgc_pointer_glyph /* Pointer glyph used to indicate that a garbage collection is in progress. diff --git a/src/alloc.h b/src/alloc.h new file mode 100644 index 0000000..2d06759 --- /dev/null +++ b/src/alloc.h @@ -0,0 +1,58 @@ +/* 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 --git a/src/buffer.c b/src/buffer.c index 8685e5a..81acfbc 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -70,23 +70,16 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" #include "chartab.h" -#include "casetab.h" #include "commands.h" #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 */ #include "window.h" @@ -102,7 +95,6 @@ struct buffer *current_buffer; /* the current buffer */ 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. @@ -133,14 +125,12 @@ struct buffer buffer_local_flags; /* This is the initial (startup) directory, as used for the *scratch* buffer. We're making this a global to make others aware of the startup directory. - `initial_directory' is stored in external format. */ char initial_directory[MAXPATHLEN+1]; /* 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, @@ -197,6 +187,7 @@ Lisp_Object QSscratch; /* "*scratch*" */ Lisp_Object Qdefault_directory; Lisp_Object Qkill_buffer_hook; +Lisp_Object Qbuffer_file_name, Qbuffer_undo_list; Lisp_Object Qrename_auto_save_file; @@ -208,8 +199,8 @@ Lisp_Object Qfind_file_compare_truenames; Lisp_Object Qswitch_to_buffer; /* Two thresholds controlling how much undo information to keep. */ -Fixnum undo_threshold; -Fixnum undo_high_threshold; +int undo_threshold; +int undo_high_threshold; int find_file_compare_truenames; int find_file_use_truenames; @@ -227,7 +218,7 @@ make_buffer (struct buffer *buf) } static Lisp_Object -mark_buffer (Lisp_Object obj) +mark_buffer (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct buffer *buf = XBUFFER (obj); @@ -236,13 +227,11 @@ mark_buffer (Lisp_Object obj) undo_threshold, undo_high_threshold); -#define MARKED_SLOT(x) mark_object (buf->x) +#define MARKED_SLOT(x) ((markobj) (buf->x)); #include "bufslots.h" #undef MARKED_SLOT - mark_object (buf->extent_info); - if (buf->text) - mark_object (buf->text->line_number_cache); + ((markobj) (buf->extent_info)); /* Don't mark normally through the children slot. (Actually, in this case, it doesn't matter.) */ @@ -283,7 +272,7 @@ print_buffer (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 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, /* @@ -319,9 +308,12 @@ returned instead. */ (frame)) { - return Fmapcar (Qcdr, - EQ (frame, Qt) ? Vbuffer_alist : - decode_frame (frame)->buffer_alist); + Lisp_Object list; + if (EQ (frame, Qt)) + list = Vbuffer_alist; + else + list = decode_frame (frame)->buffer_alist; + return Fmapcar (Qcdr, list); } Lisp_Object @@ -356,7 +348,7 @@ get_buffer (Lisp_Object name, int error_if_deleted_or_does_not_exist) struct buffer * decode_buffer (Lisp_Object buffer, int allow_string) { - if (NILP (buffer) || (!POINTER_TYPE_P( XTYPE(buffer)))) + if (NILP (buffer)) return current_buffer; if (allow_string && STRINGP (buffer)) @@ -403,10 +395,11 @@ assoc_ignore_text_properties (REGISTER Lisp_Object key, Lisp_Object list) #endif /* FSFmacs */ DEFUN ("get-buffer", Fget_buffer, 1, 1, 0, /* -Return the buffer named BUFFER-NAME (a string), or nil if there is none. -BUFFER-NAME may also be a buffer; if so, the value is that buffer. +Return the buffer named NAME (a string). +If there is no live buffer named NAME, return nil. +NAME may also be a buffer; if so, the value is that buffer. */ - (buffer_name)) + (name)) { #ifdef I18N3 /* #### Doc string should indicate that the buffer name will get @@ -415,9 +408,9 @@ BUFFER-NAME may also be a buffer; if so, the value is that buffer. /* #### This might return a dead buffer. This is gross. This is called FSF compatibility. */ - if (BUFFERP (buffer_name)) - return buffer_name; - return get_buffer (buffer_name, 0); + if (BUFFERP (name)) + return name; + return get_buffer (name, 0); /* FSFmacs 19.29 calls assoc_ignore_text_properties() here. Bleagh!! */ } @@ -439,8 +432,8 @@ the search will still be done on `buffer-file-name'. */ (filename)) { - /* This function can GC. GC checked and fixed 7-11-2000 ben. */ - REGISTER Lisp_Object buf; + /* This function can GC. GC checked 1997.04.06. */ + REGISTER Lisp_Object tail, buf, tem; struct gcpro gcpro1; #ifdef I18N3 @@ -474,29 +467,25 @@ the search will still be done on `buffer-file-name'. dn = Ffile_name_directory (filename); fn = Ffile_truename (dn, Qnil); if (! NILP (fn)) dn = fn; - /* Formerly the two calls below were combined, but that is - not GC-safe because the first call returns unprotected - data and the second call can GC. --ben */ - fn = Ffile_name_nondirectory (filename); - fn = Fexpand_file_name (fn, dn); + fn = Fexpand_file_name (Ffile_name_nondirectory (filename), + dn); } filename = fn; NUNGCPRO; } - { - LIST_LOOP_2 (elt, Vbuffer_alist) - { - buf = Fcdr (elt); - if (!BUFFERP (buf)) continue; - if (!STRINGP (XBUFFER (buf)->filename)) continue; - if (!NILP (Fstring_equal (filename, - (find_file_compare_truenames - ? XBUFFER (buf)->file_truename - : XBUFFER (buf)->filename)))) - return buf; - } - } + LIST_LOOP (tail, Vbuffer_alist) + { + buf = Fcdr (XCAR (tail)); + if (!BUFFERP (buf)) continue; + if (!STRINGP (XBUFFER (buf)->filename)) continue; + tem = Fstring_equal (filename, + (find_file_compare_truenames + ? XBUFFER (buf)->file_truename + : XBUFFER (buf)->filename)); + if (!NILP (tem)) + return buf; + } return Qnil; } @@ -536,7 +525,6 @@ delete_from_buffer_alist (Lisp_Object buf) Lisp_Object get_truename_buffer (REGISTER Lisp_Object filename) { - /* This function can GC. GC correct 7-11-00 ben */ /* FSFmacs has its own code here and doesn't call get-file-buffer. That's because their equivalent of find-file-compare-truenames (find-file-existing-other-name) isn't looked at in get-file-buffer. @@ -550,7 +538,7 @@ get_truename_buffer (REGISTER Lisp_Object filename) static struct buffer * allocate_buffer (void) { - struct buffer *b = alloc_lcrecord_type (struct buffer, &lrecord_buffer); + struct buffer *b = alloc_lcrecord_type (struct buffer, lrecord_buffer); copy_lcrecord (b, XBUFFER (Vbuffer_defaults)); @@ -570,7 +558,7 @@ finish_init_buffer (struct buffer *b, Lisp_Object name) 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; @@ -589,8 +577,8 @@ finish_init_buffer (struct buffer *b, Lisp_Object name) init_buffer_markers (b); b->generated_modeline_string = Fmake_string (make_int (84), make_int (' ')); - b->modeline_extent_table = make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, - HASH_TABLE_EQ); + b->modeline_extent_table = make_lisp_hashtable (20, HASHTABLE_KEY_WEAK, + HASHTABLE_EQ); return buf; } @@ -626,57 +614,61 @@ The value is never nil. b->text = &b->own_text; b->base_buffer = 0; b->indirect_children = Qnil; - init_buffer_text (b); + init_buffer_text (b, 0); return finish_init_buffer (b, name); } +#if 0 /* #### implement this! Need various changes in insdel.c */ DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, 2, 2, "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", /* -Create and return an indirect buffer for buffer BASE-BUFFER, named NAME. -BASE-BUFFER should be an existing buffer (or buffer name). +Create and return an indirect buffer for buffer BASE, named NAME. +BASE should be an existing buffer (or buffer name). NAME should be a string which is not the name of an existing buffer. - -If BASE-BUFFER is itself an indirect buffer, the base buffer for that buffer +If BASE is an indirect buffer itself, the base buffer for that buffer is made the base buffer for the newly created buffer. (Thus, there will never be indirect buffers whose base buffers are themselves indirect.) */ (base_buffer, name)) { - /* This function can GC */ - - /* #### The above interactive specification is totally bogus, - because it offers an existing buffer as default answer to the - second question. However, the second argument may not BE an - existing buffer! */ - struct buffer *b; - - base_buffer = get_buffer (base_buffer, 1); + Lisp_Object buf; + REGISTER struct buffer *b; #ifdef I18N3 /* #### Doc string should indicate that the buffer name will get translated. */ #endif - CHECK_STRING (name); + name = LISP_GETTEXT (name); - if (!NILP (Fget_buffer (name))) - signal_simple_error ("Buffer name already in use", name); + buf = Fget_buffer (name); + if (!NILP (buf)) + error ("Buffer name `%s' is in use", XSTRING_DATA (name)); + + base_buffer = Fget_buffer (base_buffer); + if (NILP (base_buffer)) + error ("No such buffer: `%s'", XSTRING_DATA (XBUFFER (base_buffer)->name)); + if (XSTRING_LENGTH (name) == 0) error ("Empty string for buffer name is not allowed"); b = allocate_buffer (); - b->base_buffer = BUFFER_BASE_BUFFER (XBUFFER (base_buffer)); + if (XBUFFER (base_buffer)->base_buffer) + b->base_buffer = XBUFFER (base_buffer)->base_buffer; + else + b->base_buffer = XBUFFER (base_buffer); /* Use the base buffer's text object. */ b->text = b->base_buffer->text; b->indirect_children = Qnil; + XSETBUFFER (buf, b); b->base_buffer->indirect_children = - Fcons (make_buffer (b), b->base_buffer->indirect_children); - init_buffer_text (b); + Fcons (buf, b->base_buffer->indirect_children); + init_buffer_text (b, 1); return finish_init_buffer (b, name); } +#endif /* 0 */ @@ -698,6 +690,28 @@ reset_buffer_local_variables (struct buffer *b, int first_time) } #include "bufslots.h" #undef MARKED_SLOT +#if 0 +#define STRING256_P(obj) \ + (STRINGP (obj) && XSTRING_CHAR_LENGTH (obj) == 256) + /* If the standard case table has been altered and invalidated, + fix up its insides first. */ + if (!(STRING256_P(Vascii_upcase_table) && + STRING256_P(Vascii_canon_table) && + STRING256_P(Vascii_eqv_table))) + { + Fset_standard_case_table (Vascii_downcase_table); + } + b->downcase_table = Vascii_downcase_table; + b->upcase_table = Vascii_upcase_table; + b->case_canon_table = Vascii_canon_table; + b->case_eqv_table = Vascii_eqv_table; +#ifdef MULE + b->mirror_downcase_table = Vmirror_ascii_downcase_table; + b->mirror_upcase_table = Vmirror_ascii_upcase_table; + b->mirror_case_canon_table = Vmirror_ascii_canon_table; + b->mirror_case_eqv_table = Vmirror_ascii_eqv_table; +#endif +#endif } @@ -800,6 +814,41 @@ If BUFFER is indirect, the return value will always be nil; see return Fcopy_sequence (buf->indirect_children); } +/* Map MAPFUN over all buffers that share the same text as BUF + (this includes BUF). Pass two arguments to MAPFUN: a buffer, + and CLOSURE. If any invocation of MAPFUN returns non-zero, + halt immediately and return that value. Otherwise, continue + the mapping to the end and return 0. */ + +int +map_over_sharing_buffers (struct buffer *buf, + int (*mapfun) (struct buffer *buf, void *closure), + void *closure) +{ + int result; + Lisp_Object tail; + + if (buf->base_buffer) + { + buf = buf->base_buffer; + assert (!buf->base_buffer); + } + + result = (mapfun) (buf, closure); + if (result) + return result; + + LIST_LOOP (tail, buf->indirect_children) + { + Lisp_Object buffer = XCAR (tail); + result = (mapfun) (XBUFFER (buffer), closure); + if (result) + return result; + } + + return 0; +} + DEFUN ("buffer-local-variables", Fbuffer_local_variables, 0, 1, 0, /* Return an alist of variables that are buffer-local in BUFFER. Most elements look like (SYMBOL . VALUE), describing one variable. @@ -851,6 +900,37 @@ No argument or nil as argument means use current buffer as BUFFER. return result; } +DEFUN ("buffer-dedicated-frame", Fbuffer_dedicated_frame, 0, 1, 0, /* +Return the frame dedicated to this BUFFER, or nil if there is none. +No argument or nil as argument means use current buffer as BUFFER. +*/ + (buffer)) +{ + struct buffer *buf = decode_buffer (buffer, 0); + + /* XEmacs addition: if the frame is dead, silently make it go away. */ + if (!NILP (buf->dedicated_frame) && + !FRAME_LIVE_P (XFRAME (buf->dedicated_frame))) + buf->dedicated_frame = Qnil; + + return buf->dedicated_frame; +} + +DEFUN ("set-buffer-dedicated-frame", Fset_buffer_dedicated_frame, 2, 2, 0, /* +For this BUFFER, set the FRAME dedicated to it. +FRAME must be a frame or nil. +*/ + (buffer, frame)) +{ + struct buffer *buf = decode_buffer (buffer, 0); + + if (!NILP (frame)) + CHECK_LIVE_FRAME (frame); /* XEmacs change */ + + return buf->dedicated_frame = frame; +} + + DEFUN ("buffer-modified-p", Fbuffer_modified_p, 0, 1, 0, /* Return t if BUFFER was modified since its file was last read or saved. @@ -903,7 +983,7 @@ as BUFFER means use current buffer. display). We still need to make sure redisplay realizes that the contents have potentially altered and it needs to do some work. */ - buf = decode_buffer (buffer, 0); + buf = decode_buffer(buffer, 0); BUF_MODIFF (buf)++; BUF_SAVE_MODIFF (buf) = NILP (flag) ? BUF_MODIFF (buf) : 0; MARK_MODELINE_CHANGED; @@ -978,7 +1058,6 @@ This does not change the name of the visited file (if any). /* 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); @@ -1057,7 +1136,7 @@ VISIBLE-OK. } DEFUN ("buffer-disable-undo", Fbuffer_disable_undo, 0, 1, "", /* -Stop keeping undo information for BUFFER. +Make BUFFER stop keeping undo information. Any undo records it already has are discarded. No argument or nil as argument means do this for the current buffer. */ @@ -1070,7 +1149,7 @@ No argument or nil as argument means do this for the current buffer. } DEFUN ("buffer-enable-undo", Fbuffer_enable_undo, 0, 1, "", /* -Start keeping undo information for BUFFER. +Start keeping undo information for buffer BUFFER. No argument or nil as argument means do this for the current buffer. */ (buffer)) @@ -1084,7 +1163,7 @@ No argument or nil as argument means do this for the current buffer. } DEFUN ("kill-buffer", Fkill_buffer, 1, 1, "bKill buffer: ", /* -Kill the buffer BUFFER. +Kill the buffer BUFNAME. The argument may be a buffer or may be the name of a buffer. An argument of nil means kill the current buffer. @@ -1098,21 +1177,21 @@ when the hook functions are called. Any processes that have this buffer as the `process-buffer' are killed with `delete-process'. */ - (buffer)) + (bufname)) { /* This function can call lisp */ Lisp_Object buf; REGISTER struct buffer *b; struct gcpro gcpro1, gcpro2; - if (NILP (buffer)) + if (NILP (bufname)) buf = Fcurrent_buffer (); - else if (BUFFERP (buffer)) - buf = buffer; + else if (BUFFERP (bufname)) + buf = bufname; else { - buf = get_buffer (buffer, 0); - if (NILP (buf)) nsberror (buffer); + buf = get_buffer (bufname, 0); + if (NILP (buf)) nsberror (bufname); } b = XBUFFER (buf); @@ -1134,11 +1213,11 @@ with `delete-process'. && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) { Lisp_Object killp; - GCPRO1 (buf); + GCPRO2 (buf, bufname); 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)) @@ -1172,13 +1251,15 @@ with `delete-process'. /* 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. */ @@ -1206,12 +1287,7 @@ with `delete-process'. GCPRO1 (buf); LIST_LOOP (rest, b->indirect_children) - { - Fkill_buffer (XCAR (rest)); - /* Keep indirect_children updated in case a - query-function/hook throws. */ - b->indirect_children = XCDR (rest); - } + Fkill_buffer (XCAR (rest)); UNGCPRO; } @@ -1254,16 +1330,12 @@ with `delete-process'. kill_buffer_processes (buf); - delete_from_buffer_alist (buf); - - /* Undedicate any windows of this buffer, and make sure no windows - show it. */ + /* #### 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); - undedicate_windows (buf, Qt); - - GCPRO1 (buf); - Freplace_buffer_in_windows (buf, Qnil, Qall); - UNGCPRO; + delete_from_buffer_alist (buf); font_lock_buffer_was_killed (b); @@ -1300,7 +1372,7 @@ with `delete-process'. kill_buffer_local_variables (b); b->name = Qnil; - uninit_buffer_text (b); + uninit_buffer_text (b, !!b->base_buffer); b->undo_list = Qnil; uninit_buffer_extents (b); if (b->base_buffer) @@ -1322,7 +1394,7 @@ with `delete-process'. } DEFUN ("record-buffer", Frecord_buffer, 1, 1, 0, /* -Place buffer BUFFER first in the buffer order. +Place buffer BUF first in the buffer order. Call this function when a buffer is selected "visibly". This function changes the global buffer order and the per-frame buffer @@ -1330,7 +1402,7 @@ order for the selected frame. The buffer order keeps track of recency of selection so that `other-buffer' will return a recently selected buffer. See `other-buffer' for more information. */ - (buffer)) + (buf)) { REGISTER Lisp_Object lynk, prev; struct frame *f = selected_frame (); @@ -1338,7 +1410,7 @@ buffer. See `other-buffer' for more information. prev = Qnil; for (lynk = Vbuffer_alist; CONSP (lynk); lynk = XCDR (lynk)) { - if (EQ (XCDR (XCAR (lynk)), buffer)) + if (EQ (XCDR (XCAR (lynk)), buf)) break; prev = lynk; } @@ -1355,7 +1427,7 @@ buffer. See `other-buffer' for more information. prev = Qnil; for (lynk = f->buffer_alist; CONSP (lynk); lynk = XCDR (lynk)) { - if (EQ (XCDR (XCAR (lynk)), buffer)) + if (EQ (XCDR (XCAR (lynk)), buf)) break; prev = lynk; } @@ -1366,7 +1438,6 @@ buffer. See `other-buffer' for more information. XCDR (prev) = XCDR (XCDR (prev)); XCDR (lynk) = f->buffer_alist; f->buffer_alist = lynk; - return Qnil; } @@ -1375,14 +1446,15 @@ Set an appropriate major mode for BUFFER, according to `default-major-mode'. Use this function before selecting the buffer, since it may need to inspect the current buffer's major mode. */ - (buffer)) + (buf)) { int speccount = specpdl_depth (); - Lisp_Object function = XBUFFER (Vbuffer_defaults)->major_mode; + REGISTER Lisp_Object function, tem; + function = XBUFFER (Vbuffer_defaults)->major_mode; if (NILP (function)) { - Lisp_Object tem = Fget (current_buffer->major_mode, Qmode_class, Qnil); + tem = Fget (current_buffer->major_mode, Qmode_class, Qnil); if (NILP (tem)) function = current_buffer->major_mode; } @@ -1395,7 +1467,7 @@ the current buffer's major mode. record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - Fset_buffer (buffer); + Fset_buffer (buf); call0 (function); return unbind_to (speccount, Qnil); @@ -1413,9 +1485,9 @@ Return the current buffer as a Lisp object. */ ()) { - Lisp_Object buffer; - XSETBUFFER (buffer, current_buffer); - return buffer; + Lisp_Object buf; + XSETBUFFER (buf, current_buffer); + return buf; } /* Set the current buffer to B. */ @@ -1435,6 +1507,20 @@ set_buffer_internal (struct buffer *b) 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 @@ -1507,7 +1593,7 @@ Use `switch-to-buffer' or `pop-to-buffer' to switch buffers permanently. DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only, 0, 3, 0, /* -Signal a `buffer-read-only' error if BUFFER is read-only. +Signal a `buffer-read-only' error if the buffer is read-only. Optional argument BUFFER defaults to the current buffer. If optional argument START is non-nil, all extents in the buffer @@ -1566,8 +1652,6 @@ thus, the least likely buffer for \\[switch-to-buffer] to select by default. 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. */ @@ -1626,6 +1710,7 @@ BUFFER defaults to the current buffer if omitted. implies that the future text is not really related to the past text. */ b->saved_size = Qzero; + zmacs_region_stays = 0; return Qnil; } @@ -1746,359 +1831,9 @@ represents all the memory concerned. #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) - { - Lstream_data_count 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'); /* NUL-terminate! */ - 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++) - { - Bufbyte 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) - { - Lstream_data_count 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'); /* NUL-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"); @@ -2114,6 +1849,8 @@ syms_of_buffer (void) 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"); @@ -2132,7 +1869,9 @@ syms_of_buffer (void) DEFSUBR (Fget_buffer); DEFSUBR (Fget_file_buffer); DEFSUBR (Fget_buffer_create); +#if 0 DEFSUBR (Fmake_indirect_buffer); +#endif DEFSUBR (Fgenerate_new_buffer_name); DEFSUBR (Fbuffer_name); @@ -2140,6 +1879,8 @@ syms_of_buffer (void) DEFSUBR (Fbuffer_base_buffer); DEFSUBR (Fbuffer_indirect_children); DEFSUBR (Fbuffer_local_variables); + DEFSUBR (Fbuffer_dedicated_frame); + DEFSUBR (Fset_buffer_dedicated_frame); DEFSUBR (Fbuffer_modified_p); DEFSUBR (Fset_buffer_modified_p); DEFSUBR (Fbuffer_modified_tick); @@ -2160,21 +1901,8 @@ syms_of_buffer (void) DEFSUBR (Fbuffer_memory_usage); #endif - DEFERROR (Qprotected_field, "Attempt to modify a protected field", - Qinvalid_change); -} - -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; + deferror (&Qprotected_field, "protected-field", + "Attempt to modify a protected field", Qerror); } /* initialize the buffer routines */ @@ -2182,13 +1910,15 @@ void vars_of_buffer (void) { /* This function can GC */ - reinit_vars_of_buffer (); - staticpro (&QSFundamental); staticpro (&QSscratch); + staticpro (&Vbuffer_alist); - QSFundamental = build_string ("Fundamental"); - QSscratch = build_string (DEFER_GETTEXT ("*scratch*")); + 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. @@ -2198,22 +1928,18 @@ the read-only state of the buffer. See also `kill-all-local-variables'. Vchange_major_mode_hook = Qnil; DEFVAR_BOOL ("find-file-compare-truenames", &find_file_compare_truenames /* -If this is true, then the `find-file' command will check the truenames +If this is true, then the find-file command will check the truenames of all visited files when deciding whether a given file is already in -a buffer, instead of just `buffer-file-name'. This means that if you -attempt to visit another file which is a symbolic link to a file which -is already in a buffer, the existing buffer will be found instead of a -newly-created one. This works if any component of the pathname -(including a non-terminal component) is a symbolic link as well, but -doesn't work with hard links (nothing does). - -See also the variable `find-file-use-truenames'. +a buffer, instead of just the buffer-file-name. This means that if you +attempt to visit another file which is a symbolic-link to a file which is +already in a buffer, the existing buffer will be found instead of a newly- +created one. This works if any component of the pathname (including a non- +terminal component) is a symbolic link as well, but doesn't work with hard +links (nothing does). + +See also the variable find-file-use-truenames. */ ); -#if defined(CYGWIN) || defined(WIN32_NATIVE) - find_file_compare_truenames = 1; -#else find_file_compare_truenames = 0; -#endif DEFVAR_BOOL ("find-file-use-truenames", &find_file_use_truenames /* If this is true, then a buffer's visited file-name will always be @@ -2222,7 +1948,7 @@ will never be a symbolic link anywhere in its directory path. That is, the buffer-file-name and buffer-file-truename will be equal. This doesn't work with hard links. -See also the variable `find-file-compare-truenames'. +See also the variable find-file-compare-truenames. */ ); find_file_use_truenames = 0; @@ -2323,82 +2049,96 @@ List of functions called with no args to query before killing a buffer. delete_auto_save_files = 1; } -/* The docstrings for DEFVAR_* are recorded externally by make-docfile. */ - +/* DOC is ignored because it is snagged and recorded externally + * by make-docfile */ /* Renamed from DEFVAR_PER_BUFFER because FSFmacs D_P_B takes - a bogus extra arg, which confuses an otherwise identical make-docfile.c */ -#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 \ - }; \ - \ - { \ - int offset = ((char *)symbol_value_forward_forward (&I_hate_C) - \ - (char *)&buffer_local_flags); \ - defvar_magic (lname, &I_hate_C); \ - \ - *((Lisp_Object *)(offset + (char *)XBUFFER (Vbuffer_local_symbols))) \ - = intern (lname); \ - } \ -} while (0) - -#define DEFVAR_BUFFER_LOCAL_MAGIC(lname, field_name, magicfun) \ - DEFVAR_BUFFER_LOCAL_1 (lname, field_name, \ - SYMVAL_CURRENT_BUFFER_FORWARD, magicfun) -#define DEFVAR_BUFFER_LOCAL(lname, field_name) \ - DEFVAR_BUFFER_LOCAL_MAGIC (lname, field_name, 0) -#define DEFVAR_CONST_BUFFER_LOCAL_MAGIC(lname, field_name, magicfun) \ - DEFVAR_BUFFER_LOCAL_1 (lname, field_name, \ - SYMVAL_CONST_CURRENT_BUFFER_FORWARD, magicfun) -#define DEFVAR_CONST_BUFFER_LOCAL(lname, field_name) \ - DEFVAR_CONST_BUFFER_LOCAL_MAGIC (lname, field_name, 0) - -#define DEFVAR_BUFFER_DEFAULTS_MAGIC(lname, field_name, magicfun) \ - DEFVAR_SYMVAL_FWD (lname, &(buffer_local_flags.field_name), \ - SYMVAL_DEFAULT_BUFFER_FORWARD, magicfun) -#define DEFVAR_BUFFER_DEFAULTS(lname, field_name) \ - DEFVAR_BUFFER_DEFAULTS_MAGIC (lname, field_name, 0) + * 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(lname, field_name) do { \ +static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ + = { { { symbol_value_forward_lheader_initializer, \ + (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 }, \ + SYMVAL_CURRENT_BUFFER_FORWARD }, 0 }; \ + defvar_buffer_local ((lname), &I_hate_C); \ + } while (0) + +#define DEFVAR_BUFFER_LOCAL_MAGIC(lname, field_name, magicfun) do { \ +static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ + = { { { symbol_value_forward_lheader_initializer, \ + (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 }, \ + SYMVAL_CURRENT_BUFFER_FORWARD }, magicfun }; \ + defvar_buffer_local ((lname), &I_hate_C); \ + } while (0) + +#define DEFVAR_CONST_BUFFER_LOCAL(lname, field_name) do { \ +static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ + = { { { symbol_value_forward_lheader_initializer, \ + (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 }, \ + SYMVAL_CONST_CURRENT_BUFFER_FORWARD }, 0 }; \ + defvar_buffer_local ((lname), &I_hate_C); \ + } while (0) + +#define DEFVAR_CONST_BUFFER_LOCAL_MAGIC(lname, field_name, magicfun) do{\ +static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ + = { { { symbol_value_forward_lheader_initializer, \ + (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 }, \ + SYMVAL_CONST_CURRENT_BUFFER_FORWARD }, magicfun }; \ + defvar_buffer_local ((lname), &I_hate_C); \ + } while (0) + +static void +defvar_buffer_local (CONST char *namestring, + CONST struct symbol_value_forward *m) +{ + int offset = ((char *)symbol_value_forward_forward (m) + - (char *)&buffer_local_flags); + + defvar_mumble (namestring, m, sizeof (*m)); + + *((Lisp_Object *)(offset + (char *)XBUFFER (Vbuffer_local_symbols))) + = intern (namestring); +} + +/* DOC is ignored because it is snagged and recorded externally + * by make-docfile */ +#define DEFVAR_BUFFER_DEFAULTS(lname, field_name) do { \ +static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ + = { { { symbol_value_forward_lheader_initializer, \ + (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 }, \ + SYMVAL_DEFAULT_BUFFER_FORWARD }, 0 }; \ + defvar_mumble ((lname), &I_hate_C, sizeof (I_hate_C)); \ + } while (0) + +#define DEFVAR_BUFFER_DEFAULTS_MAGIC(lname, field_name, magicfun) do { \ +static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ + = { { { symbol_value_forward_lheader_initializer, \ + (struct lcrecord_header *) &(buffer_local_flags.field_name), 69 }, \ + SYMVAL_DEFAULT_BUFFER_FORWARD }, magicfun }; \ + defvar_mumble ((lname), &I_hate_C, sizeof (I_hate_C)); \ + } while (0) static void nuke_all_buffer_slots (struct buffer *b, Lisp_Object zap) { zero_lcrecord (b); - b->extent_info = Qnil; - 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); + 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); @@ -2412,9 +2152,15 @@ common_init_complex_vars_of_buffer (void) defs->major_mode = Qfundamental_mode; defs->mode_name = QSFundamental; defs->abbrev_table = Qnil; /* real default setup by Lisp code */ - - defs->case_table = Vstandard_case_table; + defs->downcase_table = Vascii_downcase_table; + defs->upcase_table = Vascii_upcase_table; + defs->case_canon_table = Vascii_canon_table; + defs->case_eqv_table = Vascii_eqv_table; #ifdef MULE + defs->mirror_downcase_table = Vmirror_ascii_downcase_table; + defs->mirror_upcase_table = Vmirror_ascii_upcase_table; + defs->mirror_case_canon_table = Vmirror_ascii_canon_table; + defs->mirror_case_eqv_table = Vmirror_ascii_eqv_table; defs->category_table = Vstandard_category_table; #endif /* MULE */ defs->syntax_table = Vstandard_syntax_table; @@ -2432,7 +2178,6 @@ common_init_complex_vars_of_buffer (void) defs->auto_save_modified = 0; defs->auto_save_failure_time = -1; defs->invisibility_spec = Qt; - defs->buffer_local_face_property = 0; defs->indirect_children = Qnil; syms->indirect_children = Qnil; @@ -2449,7 +2194,7 @@ common_init_complex_vars_of_buffer (void) */ Lisp_Object always_local_no_default = make_int (0); Lisp_Object always_local_resettable = make_int (-1); - Lisp_Object resettable = make_int (-3); + Lisp_Object resettable = make_int (-3); /* Assign the local-flags to the slots that have default values. The local flag is a bit that is used in the buffer @@ -2458,104 +2203,59 @@ common_init_complex_vars_of_buffer (void) buffer. */ nuke_all_buffer_slots (&buffer_local_flags, make_int (-2)); - buffer_local_flags.filename = always_local_no_default; - buffer_local_flags.directory = always_local_no_default; - buffer_local_flags.backed_up = always_local_no_default; - buffer_local_flags.saved_size = always_local_no_default; + buffer_local_flags.filename = always_local_no_default; + buffer_local_flags.directory = always_local_no_default; + buffer_local_flags.backed_up = always_local_no_default; + buffer_local_flags.saved_size = always_local_no_default; buffer_local_flags.auto_save_file_name = always_local_no_default; - buffer_local_flags.read_only = always_local_no_default; + buffer_local_flags.read_only = always_local_no_default; - buffer_local_flags.major_mode = always_local_resettable; - buffer_local_flags.mode_name = always_local_resettable; - buffer_local_flags.undo_list = always_local_no_default; + buffer_local_flags.major_mode = always_local_resettable; + buffer_local_flags.mode_name = always_local_resettable; + buffer_local_flags.undo_list = always_local_no_default; #if 0 /* FSFmacs */ - buffer_local_flags.mark_active = always_local_resettable; + buffer_local_flags.mark_active = always_local_resettable; #endif buffer_local_flags.point_before_scroll = always_local_resettable; - buffer_local_flags.file_truename = always_local_no_default; - buffer_local_flags.invisibility_spec = always_local_resettable; - buffer_local_flags.file_format = always_local_resettable; + buffer_local_flags.file_truename = always_local_no_default; + buffer_local_flags.invisibility_spec = always_local_resettable; + buffer_local_flags.file_format = always_local_resettable; buffer_local_flags.generated_modeline_string = always_local_no_default; - buffer_local_flags.keymap = resettable; - buffer_local_flags.case_table = resettable; - buffer_local_flags.syntax_table = resettable; + buffer_local_flags.keymap = resettable; + buffer_local_flags.downcase_table = resettable; + buffer_local_flags.upcase_table = resettable; + buffer_local_flags.case_canon_table = resettable; + buffer_local_flags.case_eqv_table = resettable; + buffer_local_flags.syntax_table = resettable; #ifdef MULE - buffer_local_flags.category_table = resettable; + buffer_local_flags.category_table = resettable; #endif - buffer_local_flags.modeline_format = make_int (1<<0); - buffer_local_flags.abbrev_mode = make_int (1<<1); - buffer_local_flags.overwrite_mode = make_int (1<<2); - buffer_local_flags.case_fold_search = make_int (1<<3); - buffer_local_flags.auto_fill_function = make_int (1<<4); - buffer_local_flags.selective_display = make_int (1<<5); - buffer_local_flags.selective_display_ellipses = make_int (1<<6); - buffer_local_flags.tab_width = make_int (1<<7); - buffer_local_flags.truncate_lines = make_int (1<<8); - buffer_local_flags.ctl_arrow = make_int (1<<9); - buffer_local_flags.fill_column = make_int (1<<10); - buffer_local_flags.left_margin = make_int (1<<11); - buffer_local_flags.abbrev_table = make_int (1<<12); + buffer_local_flags.modeline_format = make_int (1); + buffer_local_flags.abbrev_mode = make_int (2); + buffer_local_flags.overwrite_mode = make_int (4); + buffer_local_flags.case_fold_search = make_int (8); + buffer_local_flags.auto_fill_function = make_int (0x10); + buffer_local_flags.selective_display = make_int (0x20); + buffer_local_flags.selective_display_ellipses = make_int (0x40); + buffer_local_flags.tab_width = make_int (0x80); + buffer_local_flags.truncate_lines = make_int (0x100); + buffer_local_flags.ctl_arrow = make_int (0x200); + buffer_local_flags.fill_column = make_int (0x400); + buffer_local_flags.left_margin = make_int (0x800); + buffer_local_flags.abbrev_table = make_int (0x1000); #ifdef REGION_CACHE_NEEDS_WORK - buffer_local_flags.cache_long_line_scans = make_int (1<<13); + buffer_local_flags.cache_long_line_scans = make_int (0x2000); #endif #ifdef FILE_CODING - buffer_local_flags.buffer_file_coding_system = make_int (1<<14); + buffer_local_flags.buffer_file_coding_system = make_int (0x4000); #endif - /* #### Warning: 1<<31 is the largest number currently allowable - due to the XINT() handling of this value. With some - rearrangement you can get 3 more bits. - - #### 3 more? 34 bits???? -ben */ + /* #### Warning, 0x4000000 (that's six zeroes) is the largest number + currently allowable due to the XINT() handling of this value. + With some rearrangement you can get 4 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; - dump_add_root_struct_ptr (&buffer_defaults_saved_slots, &buffer_slots_description); - dump_add_root_struct_ptr (&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. @@ -2608,31 +2308,31 @@ This is the same as (default-value 'case-fold-search). 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) @@ -2678,6 +2378,12 @@ Automatically becomes buffer-local when set in any fashion. DEFVAR_BUFFER_LOCAL ("case-fold-search", case_fold_search /* *Non-nil if searches should ignore case. Automatically becomes buffer-local when set in any fashion. + +BUG: Under XEmacs/Mule, translations to or from non-ASCII characters + (this includes chars in the range 128 - 255) are ignored by + the string/buffer-searching routines. Thus, `case-fold-search' + will not correctly conflate a-umlaut and A-umlaut even if the + case tables call for this. */ ); DEFVAR_BUFFER_LOCAL ("fill-column", fill_column /* @@ -2758,7 +2464,7 @@ its mnemonic abbreviation. The default value for this variable (which is normally used for buffers without associated files) is also used when automatic detection of a file's encoding is called for and there was no -discernible encoding in the file (i.e. it was entirely or almost +discernable encoding in the file (i.e. it was entirely or almost entirely ASCII). The default value should generally *not* be set to nil (equivalent to `no-conversion'), because if extended characters are ever inserted into the buffer, they will be lost when the file is @@ -2786,7 +2492,7 @@ particular operation, you should bind the variable variables just mentioned, which are intended to be used for global environment specification. */ ); -#endif /* FILE_CODING */ +#endif DEFVAR_BUFFER_LOCAL ("auto-fill-function", auto_fill_function /* Function called (if non-nil) to perform auto-fill. @@ -2892,8 +2598,8 @@ and VALUE is the old value. List of undo entries in current buffer. Recent changes come first; older changes follow newer. -An entry (START . END) represents an insertion which begins at -position START and ends at position END. +An entry (BEG . END) represents an insertion which begins at +position BEG and ends at position END. An entry (TEXT . POSITION) represents the deletion of the string TEXT from (abs POSITION). If POSITION is positive, point was at the front @@ -2977,8 +2683,8 @@ The default is t, which means that text is invisible if it has (or is covered by an extent with) a non-nil `invisible' property. If the value is a list, a text character is invisible if its `invisible' property is an element in that list. -If an element is a cons cell of the form (PROPERTY . ELLIPSIS), -then characters with property value PROPERTY are invisible, +If an element is a cons cell of the form (PROP . ELLIPSIS), +then characters with property value PROP are invisible, and they have an ellipsis as well if ELLIPSIS is non-nil. Note that the actual characters used for the ellipsis are controllable using `invisible-text-glyph', and default to "...". @@ -3041,65 +2747,47 @@ handled: } } -#ifndef WIN32_NATIVE -/* Is PWD another name for `.' ? */ -static int -directory_is_current_directory (Extbyte *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); - - return (IS_DIRECTORY_SEP (*pwd_internal) - && xemacs_stat ((char *) pwd_internal, &pwdstat) == 0 - && xemacs_stat (".", &dotstat) == 0 - && dotstat.st_ino == pwdstat.st_ino - && dotstat.st_dev == pwdstat.st_dev - && pwd_internal_len < MAXPATHLEN); -} -#endif - void init_initial_directory (void) { /* This function can GC */ -#ifndef WIN32_NATIVE - Extbyte *pwd; -#endif + char *pwd; + struct stat dotstat, pwdstat; + int rc; initial_directory[0] = 0; /* If PWD is accurate, use it instead of calling getcwd. This is faster when PWD is right, and may avoid a fatal error. */ -#ifndef WIN32_NATIVE - if ((pwd = (Extbyte *) getenv ("PWD")) != NULL - && directory_is_current_directory (pwd)) - strcpy (initial_directory, (char *) pwd); - else -#endif - if (getcwd (initial_directory, MAXPATHLEN) == NULL) - fatal ("`getcwd' failed: %s\n", strerror (errno)); - - /* Make sure pwd is DIRECTORY_SEP-terminated. - Maybe this should really use some standard subroutine + if ((pwd = getenv ("PWD")) != 0 && IS_DIRECTORY_SEP (*pwd) + && stat (pwd, &pwdstat) == 0 + && stat (".", &dotstat) == 0 + && dotstat.st_ino == pwdstat.st_ino + && dotstat.st_dev == pwdstat.st_dev + && (int) strlen (pwd) < MAXPATHLEN) + strcpy (initial_directory, pwd); + else if (getcwd (initial_directory, MAXPATHLEN) == NULL) + fatal ("`getcwd' failed: %s\n", strerror (errno)); + + /* Maybe this should really use some standard subroutine whose definition is filename syntax dependent. */ - { - int len = strlen (initial_directory); - - if (! IS_DIRECTORY_SEP (initial_directory[len - 1])) - { - initial_directory[len] = DIRECTORY_SEP; - initial_directory[len + 1] = '\0'; - } - } - -#ifdef CORRECT_DIR_SEPS - CORRECT_DIR_SEPS (initial_directory); + rc = strlen (initial_directory); + if (!(IS_DIRECTORY_SEP (initial_directory[rc - 1]))) + { + initial_directory[rc] = DIRECTORY_SEP; + initial_directory[rc + 1] = '\0'; + } + /* XEmacs change: store buffer's default directory + using prefered (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 } @@ -3110,8 +2798,7 @@ init_buffer (void) Fset_buffer (Fget_buffer_create (QSscratch)); - current_buffer->directory = - build_ext_string (initial_directory, Qfile_name); + current_buffer->directory = build_string (initial_directory); #if 0 /* FSFmacs */ /* #### is this correct? */ diff --git a/src/buffer.h b/src/buffer.h index 590219e..7e0ce23 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -29,16 +29,13 @@ Boston, MA 02111-1307, USA. */ 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" #endif -#include "casetab.h" -#include "chartab.h" - /************************************************************************/ /* */ /* definition of Lisp buffer object */ @@ -105,10 +102,6 @@ struct buffer_text Bytind mule_bytind_cache[16]; #endif - /* Similar to the above, we keep track of positions for which line - number has last been calculated. See line-number.c. */ - Lisp_Object line_number_cache; - /* Change data that goes with the text. */ struct buffer_text_change_data *changes; @@ -137,9 +130,6 @@ struct buffer int face_change; /* This is set when a change in how the text should be displayed (e.g., font, color) is made. */ - /* Whether buffer specific face is specified. */ - int buffer_local_face_property; - /* change data indicating what portion of the text has changed since the last time this was reset. Used by redisplay. Logically we should keep this with the text structure, but @@ -172,7 +162,7 @@ struct buffer /* 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). */ @@ -204,7 +194,7 @@ struct buffer 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. */ @@ -225,6 +215,7 @@ DECLARE_LRECORD (buffer, struct buffer); #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) @@ -243,31 +234,6 @@ DECLARE_LRECORD (buffer, struct buffer); } while (0) -#define BUFFER_BASE_BUFFER(b) ((b)->base_buffer ? (b)->base_buffer : (b)) - -/* Map over buffers sharing the same text as MPS_BUF. MPS_BUFVAR is a - variable that gets the buffer values (beginning with the base - buffer, then the children), and MPS_BUFCONS should be a temporary - Lisp_Object variable. */ -#define MAP_INDIRECT_BUFFERS(mps_buf, mps_bufvar, mps_bufcons) \ -for (mps_bufcons = Qunbound, \ - mps_bufvar = BUFFER_BASE_BUFFER (mps_buf); \ - UNBOUNDP (mps_bufcons) ? \ - (mps_bufcons = mps_bufvar->indirect_children, \ - 1) \ - : (!NILP (mps_bufcons) \ - && (mps_bufvar = XBUFFER (XCAR (mps_bufcons)), 1) \ - && (mps_bufcons = XCDR (mps_bufcons), 1)); \ - ) - - - -/************************************************************************/ -/* */ -/* working with raw internal-format data */ -/* */ -/************************************************************************/ - /* NOTE: In all the following macros, we follow these rules concerning multiple evaluation of the arguments: @@ -283,44 +249,52 @@ for (mps_bufcons = Qunbound, \ denoted with the word "unsafe" in their name and are generally meant to be called only by other macros that have already stored the calling values in temporary variables. + */ +/************************************************************************/ +/* */ +/* working with raw internal-format data */ +/* */ +/************************************************************************/ - Use the following functions/macros on contiguous strings of data. - If the text you're operating on is known to come from a buffer, use - the buffer-level functions below -- they know about the gap and may - be more efficient. +/* Use these on contiguous strings of data. If the text you're + operating on is known to come from a buffer, use the buffer-level + functions below -- they know about the gap and may be more + efficient. */ +/* Functions are as follows: - (A) For working with charptr's (pointers to internally-formatted text): - ----------------------------------------------------------------------- - VALID_CHARPTR_P (ptr): + (A) For working with charptr's (pointers to internally-formatted text): + ----------------------------------------------------------------------- + + VALID_CHARPTR_P(ptr): Given a charptr, does it point to the beginning of a character? - ASSERT_VALID_CHARPTR (ptr): + ASSERT_VALID_CHARPTR(ptr): If error-checking is enabled, assert that the given charptr - points to the beginning of a character. Otherwise, do nothing. + points to the beginning of a character. Otherwise, do nothing. - INC_CHARPTR (ptr): + INC_CHARPTR(ptr): Given a charptr (assumed to point at the beginning of a character), modify that pointer so it points to the beginning of the next character. - DEC_CHARPTR (ptr): + DEC_CHARPTR(ptr): Given a charptr (assumed to point at the beginning of a character or at the very end of the text), modify that pointer so it points to the beginning of the previous character. - VALIDATE_CHARPTR_BACKWARD (ptr): + VALIDATE_CHARPTR_BACKWARD(ptr): Make sure that PTR is pointing to the beginning of a character. - If not, back up until this is the case. Note that there are not + If not, back up until this is the case. Note that there are not too many places where it is legitimate to do this sort of thing. It's an error if you're passed an "invalid" char * pointer. NOTE: PTR *must* be pointing to a valid part of the string (i.e. not the very end, unless the string is zero-terminated or something) in order for this function to not cause crashes. - VALIDATE_CHARPTR_FORWARD (ptr): + VALIDATE_CHARPTR_FORWARD(ptr): Make sure that PTR is pointing to the beginning of a character. If not, move forward until this is the case. Note that there are not too many places where it is legitimate to do this sort @@ -332,34 +306,38 @@ for (mps_bufcons = Qunbound, \ section of internally-formatted text: -------------------------------------------------------------- - bytecount_to_charcount (ptr, nbi): + bytecount_to_charcount(ptr, nbi): Given a pointer to a text string and a length in bytes, return the equivalent length in characters. - charcount_to_bytecount (ptr, nch): + charcount_to_bytecount(ptr, nch): Given a pointer to a text string and a length in characters, return the equivalent length in bytes. - charptr_n_addr (ptr, n): + charptr_n_addr(ptr, n): Return a pointer to the beginning of the character offset N (in characters) from PTR. + charptr_length(ptr): + Given a zero-terminated pointer to Emacs characters, + return the number of Emacs characters contained within. + (C) For retrieving or changing the character pointed to by a charptr: --------------------------------------------------------------------- - charptr_emchar (ptr): + charptr_emchar(ptr): Retrieve the character pointed to by PTR as an Emchar. - charptr_emchar_n (ptr, n): + charptr_emchar_n(ptr, n): Retrieve the character at offset N (in characters) from PTR, as an Emchar. - set_charptr_emchar (ptr, ch): + set_charptr_emchar(ptr, ch): Store the character CH (an Emchar) as internally-formatted text starting at PTR. Return the number of bytes stored. - charptr_copy_char (ptr, ptr2): + charptr_copy_char(ptr, ptr2): Retrieve the character pointed to by PTR and store it as internally-formatted text in PTR2. @@ -371,16 +349,25 @@ for (mps_bufcons = Qunbound, \ in mule-charset.h, for retrieving the charset of an Emchar and such. These are only valid when MULE is defined.] - valid_char_p (ch): + valid_char_p(ch): Return whether the given Emchar is valid. - CHARP (ch): - Return whether the given Lisp_Object is a character. + CHARP(ch): + Return whether the given Lisp_Object is a valid character. + This is approximately the same as saying the Lisp_Object is + an int whose value is a valid Emchar. (But not exactly + because when MULE is not defined, we allow arbitrary values + in all but the lowest 8 bits and mask them off, for backward + compatibility.) - CHECK_CHAR_COERCE_INT (ch): - Signal an error if CH is not a valid character or integer Lisp_Object. - If CH is an integer Lisp_Object, convert it to a character Lisp_Object, - but merely by repackaging, without performing tests for char validity. + CHECK_CHAR_COERCE_INT(ch): + Signal an error if CH is not a valid character as per CHARP(). + Also canonicalize the value into a valid Emchar, as necessary. + (This only means anything when MULE is not defined.) + + COERCE_CHAR(ch): + Coerce an object that is known to satisfy CHARP() into a + valid Emchar. MAX_EMCHAR_LEN: Maximum number of buffer bytes per Emacs character. @@ -411,41 +398,38 @@ for (mps_bufcons = Qunbound, \ method because it doesn't have easy access to the first byte of the character it's moving over. */ -#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_inc_charptr_fun(ptr) \ + ((ptr) += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr))) +#ifdef ERROR_CHECK_BUFPOS +#define inc_charptr_fun(ptr) (ASSERT_VALID_CHARPTR (ptr), \ + real_inc_charptr_fun (ptr)) +#else +#define inc_charptr_fun(ptr) real_inc_charptr_fun (ptr) +#endif -#define REAL_DEC_CHARPTR(ptr) do { \ - (ptr)--; \ -} while (!VALID_CHARPTR_P (ptr)) +#define REAL_INC_CHARPTR(ptr) ((void) (real_inc_charptr_fun (ptr))) -#ifdef ERROR_CHECK_BUFPOS #define INC_CHARPTR(ptr) do { \ ASSERT_VALID_CHARPTR (ptr); \ REAL_INC_CHARPTR (ptr); \ } while (0) -#define INC_CHARBYTIND(ptr, pos) do { \ - ASSERT_VALID_CHARPTR (ptr); \ - REAL_INC_CHARBYTIND (ptr, pos); \ -} while (0) +#define REAL_DEC_CHARPTR(ptr) do { \ + (ptr)--; \ +} while (!VALID_CHARPTR_P (ptr)) -#define DEC_CHARPTR(ptr) do { \ - 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)); \ - (ptr) = (Bufbyte *) dc_ptr2; \ +#ifdef ERROR_CHECK_BUFPOS +#define DEC_CHARPTR(ptr) do { \ + CONST Bufbyte *__dcptr__ = (ptr); \ + CONST Bufbyte *__dcptr2__ = __dcptr__; \ + REAL_DEC_CHARPTR (__dcptr2__); \ + assert (__dcptr__ - __dcptr2__ == \ + REP_BYTES_BY_FIRST_BYTE (*__dcptr2__)); \ + (ptr) = __dcptr2__; \ } while (0) - -#else /* ! ERROR_CHECK_BUFPOS */ -#define INC_CHARBYTIND(ptr, pos) REAL_INC_CHARBYTIND (ptr, pos) -#define INC_CHARPTR(ptr) REAL_INC_CHARPTR (ptr) +#else #define DEC_CHARPTR(ptr) REAL_DEC_CHARPTR (ptr) -#endif /* ! ERROR_CHECK_BUFPOS */ +#endif #ifdef MULE @@ -457,11 +441,11 @@ for (mps_bufcons = Qunbound, \ the end of the string. */ #define VALIDATE_CHARPTR_FORWARD(ptr) do { \ - Bufbyte *vcf_ptr = (ptr); \ - VALIDATE_CHARPTR_BACKWARD (vcf_ptr); \ - if (vcf_ptr != (ptr)) \ + Bufbyte *__vcfptr__ = (ptr); \ + VALIDATE_CHARPTR_BACKWARD (__vcfptr__); \ + if (__vcfptr__ != (ptr)) \ { \ - (ptr) = vcf_ptr; \ + (ptr) = __vcfptr__; \ INC_CHARPTR (ptr); \ } \ } while (0) @@ -476,14 +460,21 @@ for (mps_bufcons = Qunbound, \ /* 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); } +INLINE Charcount charptr_length (CONST Bufbyte *ptr); +INLINE Charcount +charptr_length (CONST Bufbyte *ptr) +{ + return bytecount_to_charcount (ptr, strlen ((CONST char *) ptr)); +} + + /* -------------------------------------------------------------------- */ /* (C) For retrieving or changing the character pointed to by a charptr */ /* -------------------------------------------------------------------- */ @@ -494,21 +485,21 @@ charptr_n_addr (const Bufbyte *ptr, Charcount offset) #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 *src, Bufbyte *dst); +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) ? @@ -516,16 +507,13 @@ set_charptr_emchar (Bufbyte *ptr, Emchar x) non_ascii_set_charptr_emchar (ptr, x); } -/* Copy the character pointed to by SRC into DST. - Return the number of bytes copied. */ -INLINE_HEADER Bytecount -charptr_copy_char (const Bufbyte *src, Bufbyte *dst); -INLINE_HEADER Bytecount -charptr_copy_char (const Bufbyte *src, Bufbyte *dst) +INLINE Bytecount charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *ptr2); +INLINE Bytecount +charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *ptr2) { - return BYTE_ASCII_P (*src) ? - simple_charptr_copy_char (src, dst) : - non_ascii_charptr_copy_char (src, dst); + return BYTE_ASCII_P (*ptr) ? + simple_charptr_copy_char (ptr, ptr2) : + non_ascii_charptr_copy_char (ptr, ptr2); } #else /* not MULE */ @@ -548,16 +536,16 @@ charptr_copy_char (const Bufbyte *src, Bufbyte *dst) 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); + return (ch >= 0 && ch <= 255) || non_ascii_valid_char_p (ch); } #else /* not MULE */ -#define valid_char_p(ch) ((unsigned int) (ch) <= 0xff) +#define valid_char_p(ch) ((unsigned int) (ch) <= 255) #endif /* not MULE */ @@ -565,13 +553,22 @@ valid_char_p (Emchar ch) #define CHAR_OR_CHAR_INTP(x) (CHARP (x) || CHAR_INTP (x)) -INLINE_HEADER Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj); -INLINE_HEADER Emchar +#ifdef ERROR_CHECK_TYPECHECK + +INLINE Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj); +INLINE Emchar XCHAR_OR_CHAR_INT (Lisp_Object obj) { + assert (CHAR_OR_CHAR_INTP (obj)); return CHARP (obj) ? XCHAR (obj) : XINT (obj); } +#else + +#define XCHAR_OR_CHAR_INT(obj) (CHARP ((obj)) ? XCHAR ((obj)) : XINT ((obj))) + +#endif + #define CHECK_CHAR_COERCE_INT(x) do { \ if (CHARP (x)) \ ; \ @@ -623,25 +620,25 @@ XCHAR_OR_CHAR_INT (Lisp_Object obj) /*----------------------------------------------------------------------*/ /* 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)); } @@ -649,12 +646,12 @@ BI_BUF_BYTE_ADDRESS (struct buffer *buf, Bytind pos) 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)); } @@ -665,32 +662,32 @@ BI_BUF_BYTE_ADDRESS_BEFORE (struct buffer *buf, Bytind pos) /* 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); } @@ -851,10 +848,11 @@ memind_to_bytind (struct buffer *buf, Memind x) results with stupid compilers. */ #ifdef MULE -# define VALIDATE_BYTIND_BACKWARD(buf, x) do { \ - Bufbyte *VBB_ptr = BI_BUF_BYTE_ADDRESS (buf, x); \ - while (!BUFBYTE_FIRST_BYTE_P (*VBB_ptr)) \ - VBB_ptr--, (x)--; \ +# define VALIDATE_BYTIND_BACKWARD(buf, x) do \ +{ \ + Bufbyte *__ibptr = BI_BUF_BYTE_ADDRESS (buf, x); \ + while (!BUFBYTE_FIRST_BYTE_P (*__ibptr)) \ + __ibptr--, (x)--; \ } while (0) #else # define VALIDATE_BYTIND_BACKWARD(buf, x) @@ -866,10 +864,11 @@ memind_to_bytind (struct buffer *buf, Memind x) results with stupid compilers. */ #ifdef MULE -# define VALIDATE_BYTIND_FORWARD(buf, x) do { \ - Bufbyte *VBF_ptr = BI_BUF_BYTE_ADDRESS (buf, x); \ - while (!BUFBYTE_FIRST_BYTE_P (*VBF_ptr)) \ - VBF_ptr++, (x)++; \ +# define VALIDATE_BYTIND_FORWARD(buf, x) do \ +{ \ + Bufbyte *__ibptr = BI_BUF_BYTE_ADDRESS (buf, x); \ + while (!BUFBYTE_FIRST_BYTE_P (*__ibptr)) \ + __ibptr++, (x)++; \ } while (0) #else # define VALIDATE_BYTIND_FORWARD(buf, x) @@ -903,16 +902,16 @@ memind_to_bytind (struct buffer *buf, Memind x) 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); @@ -974,8 +973,8 @@ Bufpos bytind_to_bufpos_func (struct buffer *buf, Bytind x); 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) @@ -986,8 +985,8 @@ real_bufpos_to_bytind (struct buffer *buf, Bufpos x) 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) @@ -1039,295 +1038,306 @@ Bufpos bytind_to_bufpos (struct buffer *buf, Bytind x); #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; +/* WARNING: These use a static buffer. This can lead to disaster if + 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)) -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; +#endif /* ! MULE */ -/* 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_FORMAT() 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) - -/* 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; \ -} 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; \ -} 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; \ +/* 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. + */ + + +/* 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; \ + (len_out) = (Extcount) gceda_len_in; \ + } \ + else \ + { \ + (ptr_out) = (Extbyte *) alloca (1 + gceda_len_out); \ + memcpy ((void *) ptr_out, gceda_ptr_out, 1 + gceda_len_out); \ + (len_out) = (Extcount) gceda_len_out; \ + } \ } 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; \ + +#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) -/* 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; \ +#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) -#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; \ + +#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; \ + (len_out) = (Bytecount) gcida_len_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) -/* 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; \ +#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) -#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; \ + +#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_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; \ + +#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_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_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 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)) - -/* 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 - -#if defined (WIN32_NATIVE) || defined (CYGWIN) -/* #### kludge!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - Remove this as soon as my Mule code is integrated. */ -#define Qmswindows_tstr Qnative -#endif -/* More stand-ins */ -#define Qcommand_argument_encoding Qnative -#define Qenvironment_variable_encoding Qnative - -/* Convenience macros for extremely common invocations */ -#define C_STRING_TO_EXTERNAL(in, out, coding_system) \ - TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, coding_system) -#define C_STRING_TO_EXTERNAL_MALLOC(in, out, coding_system) \ - TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, coding_system) -#define EXTERNAL_TO_C_STRING(in, out, coding_system) \ - TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, coding_system) -#define EXTERNAL_TO_C_STRING_MALLOC(in, out, coding_system) \ - TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, coding_system) -#define LISP_STRING_TO_EXTERNAL(in, out, coding_system) \ - TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_ALLOCA, out, coding_system) -#define LISP_STRING_TO_EXTERNAL_MALLOC(in, out, coding_system) \ - TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_MALLOC, out, coding_system) +#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) + +#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) + +#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) + /************************************************************************/ @@ -1433,7 +1443,7 @@ do \ #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) @@ -1513,7 +1523,6 @@ extern struct buffer *current_buffer; /* This is the initial (startup) directory, as used for the *scratch* buffer. We're making this a global to make others aware of the startup directory. - `initial_directory' is stored in external format. */ extern char initial_directory[]; extern void init_initial_directory (void); /* initialize initial_directory */ @@ -1560,8 +1569,8 @@ extern struct buffer buffer_local_flags; #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) \ @@ -1574,7 +1583,7 @@ void r_alloc_free (unsigned char **); #else /* !REL_ALLOC */ #define BUFFER_ALLOC(data,size)\ - (data = xnew_array (Bufbyte, size)) + ((void) (data = xnew_array (Bufbyte, size))) #define BUFFER_REALLOC(data,size)\ ((Bufbyte *) xrealloc (data, (size) * sizeof(Bufbyte))) /* Avoid excess parentheses, or syntax errors may rear their heads. */ @@ -1594,19 +1603,19 @@ int beginning_of_line_p (struct buffer *b, Bufpos pt); /* 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, - Bytecount len, - Emchar *arr); +int convert_bufbyte_string_into_emchar_string (CONST Bufbyte *str, + Bytecount len, + Emchar *arr); void convert_emchar_string_into_bufbyte_dynarr (Emchar *arr, int nels, Bufbyte_dynarr *dyn); Bufbyte *convert_emchar_string_into_malloced_string (Emchar *arr, int nels, @@ -1683,47 +1692,68 @@ int map_over_sharing_buffers (struct buffer *buf, typically used to convert between uppercase and lowercase. For compatibility reasons, trt tables are currently in the form of a Lisp string of 256 characters, specifying the conversion for each - of the first 256 Emacs characters (i.e. the 256 Latin-1 characters). - This should be generalized at some point to support conversions for - all of the allowable Mule characters. + of the first 256 Emacs characters (i.e. the 256 extended-ASCII + characters). This should be generalized at some point to support + conversions for all of the allowable Mule characters. */ /* The _1 macros are named as such because they assume that you have already guaranteed that the character values are all in the range 0 - 255. Bad lossage will happen otherwise. */ -#define MAKE_TRT_TABLE() Fmake_char_table (Qgeneric) -INLINE_HEADER Emchar TRT_TABLE_CHAR_1 (Lisp_Object table, Emchar c); -INLINE_HEADER Emchar -TRT_TABLE_CHAR_1 (Lisp_Object table, Emchar ch) -{ - Lisp_Object TRT_char; - TRT_char = get_char_table (ch, XCHAR_TABLE (table)); - if (NILP (TRT_char)) - return ch; - else - return XCHAR (TRT_char); -} -#define SET_TRT_TABLE_CHAR_1(table, ch1, ch2) \ - Fput_char_table (make_char (ch1), make_char (ch2), table); +# define MAKE_TRT_TABLE() Fmake_string (make_int (256), make_char (0)) +# define TRT_TABLE_AS_STRING(table) XSTRING_DATA (table) +# define TRT_TABLE_CHAR_1(table, ch) \ + string_char (XSTRING (table), (Charcount) ch) +# define SET_TRT_TABLE_CHAR_1(table, ch1, ch2) \ + set_string_char (XSTRING (table), (Charcount) ch1, ch2) + +#ifdef MULE +# 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])) +# define SET_MIRROR_TRT_TABLE_CHAR_1(table, ch1, ch2) \ + (MIRROR_TRT_TABLE_AS_STRING (table)[ch1] = (Bufbyte) (ch2)) +#endif + +# define IN_TRT_TABLE_DOMAIN(c) (((EMACS_UINT) (c)) <= 255) + +#ifdef MULE +#define MIRROR_DOWNCASE_TABLE_AS_STRING(buf) \ + MIRROR_TRT_TABLE_AS_STRING (buf->mirror_downcase_table) +#define MIRROR_UPCASE_TABLE_AS_STRING(buf) \ + MIRROR_TRT_TABLE_AS_STRING (buf->mirror_upcase_table) +#define MIRROR_CANON_TABLE_AS_STRING(buf) \ + MIRROR_TRT_TABLE_AS_STRING (buf->mirror_case_canon_table) +#define MIRROR_EQV_TABLE_AS_STRING(buf) \ + MIRROR_TRT_TABLE_AS_STRING (buf->mirror_case_eqv_table) +#else +#define MIRROR_DOWNCASE_TABLE_AS_STRING(buf) \ + TRT_TABLE_AS_STRING (buf->downcase_table) +#define MIRROR_UPCASE_TABLE_AS_STRING(buf) \ + TRT_TABLE_AS_STRING (buf->upcase_table) +#define MIRROR_CANON_TABLE_AS_STRING(buf) \ + TRT_TABLE_AS_STRING (buf->case_canon_table) +#define MIRROR_EQV_TABLE_AS_STRING(buf) \ + 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 TRT_TABLE_CHAR_1 (trt, c); + return IN_TRT_TABLE_DOMAIN (c) ? TRT_TABLE_CHAR_1 (trt, c) : c; } /* Macros used below. */ -#define DOWNCASE_TABLE_OF(buf, c) \ - TRT_TABLE_OF (XCASE_TABLE_DOWNCASE (buf->case_table), c) -#define UPCASE_TABLE_OF(buf, c) \ - TRT_TABLE_OF (XCASE_TABLE_UPCASE (buf->case_table), c) +#define DOWNCASE_TABLE_OF(buf, c) TRT_TABLE_OF (buf->downcase_table, c) +#define UPCASE_TABLE_OF(buf, c) TRT_TABLE_OF (buf->upcase_table, c) /* 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; @@ -1731,8 +1761,8 @@ UPPERCASEP (struct buffer *buf, Emchar ch) /* 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 && @@ -1741,8 +1771,8 @@ LOWERCASEP (struct buffer *buf, Emchar ch) /* 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; @@ -1750,14 +1780,14 @@ NOCASEP (struct buffer *buf, Emchar ch) /* 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; } -/* Upcase a character known to be not upper case. Unused. */ +/* Upcase a character known to be not upper case. */ #define UPCASE1(buf, ch) UPCASE_TABLE_OF (buf, ch) @@ -1765,60 +1795,4 @@ UPCASE (struct buffer *buf, Emchar ch) #define DOWNCASE(buf, ch) DOWNCASE_TABLE_OF (buf, ch) -/************************************************************************/ -/* Lisp string representation convenience functions */ -/************************************************************************/ -/* Because the representation of internally formatted data is subject to change, - It's bad style to do something like strcmp (XSTRING_DATA (s), "foo") - Instead, use the portable: bufbyte_strcmp (XSTRING_DATA (s), "foo") - or bufbyte_memcmp (XSTRING_DATA (s), "foo", 3) */ - -/* Like strcmp, except first arg points at internally formatted data, - while the second points at a string of only ASCII chars. */ -INLINE_HEADER int -bufbyte_strcmp (const Bufbyte *bp, const char *ascii_string); -INLINE_HEADER int -bufbyte_strcmp (const Bufbyte *bp, const char *ascii_string) -{ -#ifdef MULE - while (1) - { - int diff; - type_checking_assert (BYTE_ASCII_P (*ascii_string)); - if ((diff = charptr_emchar (bp) - *(Bufbyte *) ascii_string) != 0) - return diff; - if (*ascii_string == '\0') - return 0; - ascii_string++; - INC_CHARPTR (bp); - } -#else - return strcmp ((char *)bp, ascii_string); -#endif -} - - -/* Like memcmp, except first arg points at internally formatted data, - while the second points at a string of only ASCII chars. */ -INLINE_HEADER int -bufbyte_memcmp (const Bufbyte *bp, const char *ascii_string, size_t len); -INLINE_HEADER int -bufbyte_memcmp (const Bufbyte *bp, const char *ascii_string, size_t len) -{ -#ifdef MULE - while (len--) - { - int diff = charptr_emchar (bp) - *(Bufbyte *) ascii_string; - type_checking_assert (BYTE_ASCII_P (*ascii_string)); - if (diff != 0) - return diff; - ascii_string++; - INC_CHARPTR (bp); - } - return 0; -#else - return memcmp (bp, ascii_string, len); -#endif -} - -#endif /* INCLUDED_buffer_h_ */ +#endif /* _XEMACS_BUFFER_H_ */ diff --git a/src/bufslots.h b/src/bufslots.h index 2b622c7..000a943 100644 --- a/src/bufslots.h +++ b/src/bufslots.h @@ -32,10 +32,6 @@ Boston, MA 02111-1307, USA. */ 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); @@ -73,7 +69,7 @@ Boston, MA 02111-1307, USA. */ Specifically, this lists those variables that have a buffer-local value in this buffer: i.e. those whose value does not shadow the default value. - (Remember that for any particular variable created + (Remember that for any particlar variable created with `make-local-variable' or `make-variable-buffer-local', it will have a per-buffer value in some buffers and a default value in others.) @@ -121,13 +117,33 @@ Boston, MA 02111-1307, USA. */ /* Function to call when insert space past fill column. */ MARKED_SLOT (auto_fill_function); - /* Case table for case-conversion in this buffer. */ - MARKED_SLOT (case_table); - /* It contais following char-tables: */ - /* Char-table maps each char into its lower-case version. */ + /* Case table for case-conversion in this buffer. + This char-table maps each char into its lower-case version. */ + MARKED_SLOT (downcase_table); /* Char-table mapping each char to its upper-case version. */ + MARKED_SLOT (upcase_table); + /* Char-table for conversion for case-folding search. */ + MARKED_SLOT (case_canon_table); /* Char-table of equivalences for case-folding search. */ + MARKED_SLOT (case_eqv_table); + +#ifdef MULE + /* #### The purpose of these bogos is to deal with the fact that + the Boyer-Moore and regex searching routines don't know how to + deal with translating multi-byte characters. Fixing this is hard, + so instead we maintain these mirror tables that have all incorrect + mappings (see casetab.c) sanitized out of them. If we don't do + this, we may get weird and unpredictable results in the presence + of extended chars and extended mappings, and it could even lead + to a crash. + + #### Eventually we should deal with this properly. */ + MARKED_SLOT (mirror_downcase_table); + MARKED_SLOT (mirror_upcase_table); + MARKED_SLOT (mirror_case_canon_table); + MARKED_SLOT (mirror_case_eqv_table); +#endif /* #### This ought to be a specifier: */ /* Non-nil means do not display continuation lines. */ @@ -169,7 +185,9 @@ Boston, MA 02111-1307, USA. */ /* FSFmacs has overlay stuff here. We have extent info elsewhere in the struct buffer. */ - /* dedicated_frame in lisp */ + /* If dedicated_frame is non-nil, display_buffer tries to use it instead + of the current frame */ + MARKED_SLOT (dedicated_frame); /* Lisp of symbols naming the file format used for visited file. */ MARKED_SLOT (file_format); @@ -217,14 +235,13 @@ Boston, MA 02111-1307, USA. */ /* 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 the next few times we add a new slot. */ MARKED_SLOT (extra1, extra2, extra3); #endif + /* The cache of positions for whilch line number has last been + calculated. See line-number.c. */ + MARKED_SLOT (line_number_cache); + diff --git a/src/casefiddle.c b/src/casefiddle.c index 49cf028..cb21d57 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -1,5 +1,5 @@ /* XEmacs case conversion functions. - Copyright (C) 1985, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1985, 1992, 1993, 1994 Free Software Foundation, Inc. This file is part of XEmacs. @@ -18,199 +18,170 @@ 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.34, but substantially rewritten by Martin. */ +/* Synched up with: FSF 19.34. */ #include <config.h> #include "lisp.h" #include "buffer.h" +#include "commands.h" #include "insdel.h" #include "syntax.h" enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP}; static Lisp_Object -casify_object (enum case_action flag, Lisp_Object string_or_char, - Lisp_Object buffer) +casify_object (enum case_action flag, Lisp_Object obj, Lisp_Object buffer) { struct buffer *buf = decode_buffer (buffer, 0); + REGISTER int inword = (flag == CASE_DOWN); + struct Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); - retry: - - if (CHAR_OR_CHAR_INTP (string_or_char)) - { - Emchar c; - CHECK_CHAR_COERCE_INT (string_or_char); - c = XCHAR (string_or_char); - c = (flag == CASE_DOWN) ? DOWNCASE (buf, c) : UPCASE (buf, c); - return make_char (c); - } - - if (STRINGP (string_or_char)) + while (1) { - Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); - Bufbyte *storage = - alloca_array (Bufbyte, XSTRING_LENGTH (string_or_char) * MAX_EMCHAR_LEN); - Bufbyte *newp = storage; - Bufbyte *oldp = XSTRING_DATA (string_or_char); - int wordp = 0, wordp_prev; - - while (*oldp) + if (CHAR_OR_CHAR_INTP (obj)) { - Emchar c = charptr_emchar (oldp); - switch (flag) + Emchar c; + CHECK_CHAR_COERCE_INT (obj); + c = XCHAR (obj); + if (IN_TRT_TABLE_DOMAIN (c)) { - case CASE_UP: - c = UPCASE (buf, c); - break; - case CASE_DOWN: - c = DOWNCASE (buf, c); - break; - case CASE_CAPITALIZE: - case CASE_CAPITALIZE_UP: - wordp_prev = wordp; - wordp = WORD_SYNTAX_P (syntax_table, c); - if (!wordp) break; - if (wordp_prev) - { - if (flag == CASE_CAPITALIZE) - c = DOWNCASE (buf, c); - } - else - c = UPCASE (buf, c); - break; + if (inword) + obj = make_char (DOWNCASE (buf, c)); + else if (!UPPERCASEP (buf, c)) + obj = make_char (UPCASE1 (buf, c)); } - - newp += set_charptr_emchar (newp, c); - INC_CHARPTR (oldp); + return obj; } - - return make_string (storage, newp - storage); + if (STRINGP (obj)) + { + Charcount i; + Charcount len = XSTRING_CHAR_LENGTH (obj); + obj = Fcopy_sequence (obj); + for (i = 0; i < len; i++) + { + Emchar c = string_char (XSTRING (obj), i); + if (inword && flag != CASE_CAPITALIZE_UP) + c = DOWNCASE (buf, c); + else if (!UPPERCASEP (buf, c) + && (!inword || flag != CASE_CAPITALIZE_UP)) + c = UPCASE1 (buf, c); + set_string_char (XSTRING (obj), i, c); + if ((int) flag >= (int) CASE_CAPITALIZE) + inword = WORD_SYNTAX_P (syntax_table, c); + } + return obj; + } + obj = wrong_type_argument (Qchar_or_string_p, obj); } - - string_or_char = wrong_type_argument (Qchar_or_string_p, string_or_char); - goto retry; } DEFUN ("upcase", Fupcase, 1, 2, 0, /* -Convert STRING-OR-CHAR to upper case and return that. -STRING-OR-CHAR may be a character or string. The result has the same type. -STRING-OR-CHAR is not altered--the value is a copy. +Convert argument to upper case and return that. +The argument may be a character or string. The result has the same type. +The argument object is not altered--the value is a copy. See also `capitalize', `downcase' and `upcase-initials'. Optional second arg BUFFER specifies which buffer's case tables to use, and defaults to the current buffer. */ - (string_or_char, buffer)) + (obj, buffer)) { - return casify_object (CASE_UP, string_or_char, buffer); + return casify_object (CASE_UP, obj, buffer); } DEFUN ("downcase", Fdowncase, 1, 2, 0, /* -Convert STRING-OR-CHAR to lower case and return that. -STRING-OR-CHAR may be a character or string. The result has the same type. -STRING-OR-CHAR is not altered--the value is a copy. +Convert argument to lower case and return that. +The argument may be a character or string. The result has the same type. +The argument object is not altered--the value is a copy. Optional second arg BUFFER specifies which buffer's case tables to use, and defaults to the current buffer. */ - (string_or_char, buffer)) + (obj, buffer)) { - return casify_object (CASE_DOWN, string_or_char, buffer); + return casify_object (CASE_DOWN, obj, buffer); } DEFUN ("capitalize", Fcapitalize, 1, 2, 0, /* -Convert STRING-OR-CHAR to capitalized form and return that. +Convert argument to capitalized form and return that. This means that each word's first character is upper case and the rest is lower case. -STRING-OR-CHAR may be a character or string. The result has the same type. -STRING-OR-CHAR is not altered--the value is a copy. +The argument may be a character or string. The result has the same type. +The argument object is not altered--the value is a copy. Optional second arg BUFFER specifies which buffer's case tables to use, and defaults to the current buffer. */ - (string_or_char, buffer)) + (obj, buffer)) { - return casify_object (CASE_CAPITALIZE, string_or_char, buffer); + return casify_object (CASE_CAPITALIZE, obj, buffer); } -/* Like Fcapitalize but change only the initial characters. */ +/* Like Fcapitalize but change only the initials. */ DEFUN ("upcase-initials", Fupcase_initials, 1, 2, 0, /* -Convert the initial of each word in STRING-OR-CHAR to upper case. +Convert the initial of each word in the argument to upper case. Do not change the other letters of each word. -STRING-OR-CHAR may be a character or string. The result has the same type. -STRING-OR-CHAR is not altered--the value is a copy. +The argument may be a character or string. The result has the same type. +The argument object is not altered--the value is a copy. Optional second arg BUFFER specifies which buffer's case tables to use, and defaults to the current buffer. */ - (string_or_char, buffer)) + (obj, buffer)) { - return casify_object (CASE_CAPITALIZE_UP, string_or_char, buffer); + return casify_object (CASE_CAPITALIZE_UP, obj, buffer); } /* flag is CASE_UP, CASE_DOWN or CASE_CAPITALIZE or CASE_CAPITALIZE_UP. - START and END specify range of buffer to operate on. */ + b and e specify range of buffer to operate on. */ static void -casify_region_internal (enum case_action flag, Lisp_Object start, - Lisp_Object end, struct buffer *buf) +casify_region_internal (enum case_action flag, Lisp_Object b, Lisp_Object e, + struct buffer *buf) { /* This function can GC */ - Bufpos pos, s, e; - Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); + REGISTER Bufpos i; + Bufpos start, end; + REGISTER int inword = (flag == CASE_DOWN); + struct Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); int mccount; - int wordp = 0, wordp_prev; - if (EQ (start, end)) + if (EQ (b, e)) /* Not modifying because nothing marked */ return; - get_buffer_range_char (buf, start, end, &s, &e, 0); + get_buffer_range_char (buf, b, e, &start, &end, 0); - mccount = begin_multiple_change (buf, s, e); - record_change (buf, s, e - s); + mccount = begin_multiple_change (buf, start, end); + record_change (buf, start, end - start); - for (pos = s; pos < e; pos++) + for (i = start; i < end; i++) { - Emchar oldc = BUF_FETCH_CHAR (buf, pos); - Emchar c = oldc; + Emchar c = BUF_FETCH_CHAR (buf, i); + Emchar oldc = c; - switch (flag) + if (inword && flag != CASE_CAPITALIZE_UP) + c = DOWNCASE (buf, c); + else if (!UPPERCASEP (buf, c) + && (!inword || flag != CASE_CAPITALIZE_UP)) + c = UPCASE1 (buf, c); + + if (oldc != c) { - case CASE_UP: - c = UPCASE (buf, oldc); - break; - case CASE_DOWN: - c = DOWNCASE (buf, oldc); - break; - case CASE_CAPITALIZE: - case CASE_CAPITALIZE_UP: - /* !!#### need to revalidate the start and end pointers in case - the buffer was changed */ - wordp_prev = wordp; - wordp = WORD_SYNTAX_P (syntax_table, c); - if (!wordp) continue; - if (wordp_prev) - { - if (flag == CASE_CAPITALIZE) - c = DOWNCASE (buf, c); - } - else - c = UPCASE (buf, c); - break; + buffer_replace_char (buf, i, c, 1, (i == start)); + BUF_MODIFF (buf)++; } - - if (oldc == c) continue; - buffer_replace_char (buf, pos, c, 1, (pos == s)); - BUF_MODIFF (buf)++; + /* !!#### need to revalidate the start and end pointers in case + the buffer was changed */ + if ((int) flag >= (int) CASE_CAPITALIZE) + inword = WORD_SYNTAX_P (syntax_table, c); } - end_multiple_change (buf, mccount); } static Lisp_Object -casify_region (enum case_action flag, Lisp_Object start, Lisp_Object end, +casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e, Lisp_Object buffer) { - casify_region_internal (flag, start, end, decode_buffer (buffer, 1)); + casify_region_internal (flag, b, e, decode_buffer (buffer, 1)); return Qnil; } @@ -222,10 +193,10 @@ These arguments specify the starting and ending character numbers of See also `capitalize-region'. Optional third arg BUFFER defaults to the current buffer. */ - (start, end, buffer)) + (b, e, buffer)) { /* This function can GC */ - return casify_region (CASE_UP, start, end, buffer); + return casify_region (CASE_UP, b, e, buffer); } DEFUN ("downcase-region", Fdowncase_region, 2, 3, "r", /* @@ -235,10 +206,10 @@ These arguments specify the starting and ending character numbers of point and the mark is operated on. Optional third arg BUFFER defaults to the current buffer. */ - (start, end, buffer)) + (b, e, buffer)) { /* This function can GC */ - return casify_region (CASE_DOWN, start, end, buffer); + return casify_region (CASE_DOWN, b, e, buffer); } DEFUN ("capitalize-region", Fcapitalize_region, 2, 3, "r", /* @@ -249,10 +220,10 @@ In programs, give two arguments, the starting and ending character positions to operate on. Optional third arg BUFFER defaults to the current buffer. */ - (start, end, buffer)) + (b, e, buffer)) { /* This function can GC */ - return casify_region (CASE_CAPITALIZE, start, end, buffer); + return casify_region (CASE_CAPITALIZE, b, e, buffer); } /* Like Fcapitalize_region but change only the initials. */ @@ -264,9 +235,9 @@ In programs, give two arguments, the starting and ending character positions to operate on. Optional third arg BUFFER defaults to the current buffer. */ - (start, end, buffer)) + (b, e, buffer)) { - return casify_region (CASE_CAPITALIZE_UP, start, end, buffer); + return casify_region (CASE_CAPITALIZE_UP, b, e, buffer); } @@ -288,39 +259,39 @@ casify_word (enum case_action flag, Lisp_Object arg, Lisp_Object buffer) } DEFUN ("upcase-word", Fupcase_word, 1, 2, "p", /* -Convert following word (or COUNT words) to upper case, moving over. +Convert following word (or ARG words) to upper case, moving over. With negative argument, convert previous words but do not move. See also `capitalize-word'. Optional second arg BUFFER defaults to the current buffer. */ - (count, buffer)) + (arg, buffer)) { /* This function can GC */ - return casify_word (CASE_UP, count, buffer); + return casify_word (CASE_UP, arg, buffer); } DEFUN ("downcase-word", Fdowncase_word, 1, 2, "p", /* -Convert following word (or COUNT words) to lower case, moving over. +Convert following word (or ARG words) to lower case, moving over. With negative argument, convert previous words but do not move. Optional second arg BUFFER defaults to the current buffer. */ - (count, buffer)) + (arg, buffer)) { /* This function can GC */ - return casify_word (CASE_DOWN, count, buffer); + return casify_word (CASE_DOWN, arg, buffer); } DEFUN ("capitalize-word", Fcapitalize_word, 1, 2, "p", /* -Capitalize the following word (or COUNT words), moving over. +Capitalize the following word (or ARG words), moving over. This gives the word(s) a first character in upper case and the rest lower case. With negative argument, capitalize previous words but do not move. Optional second arg BUFFER defaults to the current buffer. */ - (count, buffer)) + (arg, buffer)) { /* This function can GC */ - return casify_word (CASE_CAPITALIZE, count, buffer); + return casify_word (CASE_CAPITALIZE, arg, buffer); } diff --git a/src/casetab.c b/src/casetab.c index 656a592..ff9443c 100644 --- a/src/casetab.c +++ b/src/casetab.c @@ -30,233 +30,59 @@ Boston, MA 02111-1307, USA. */ /* Modified for Mule by Ben Wing. */ -/* Case table consists of four char-table. Those are for downcase, - upcase, canonical and equivalent respectively. - - It's entry is like this: - - downcase: a -> a, A -> a. - upcase: a -> A, A -> a. (The latter is for NOCASEP.) - canon: a -> a, A -> a. - eqv: a -> A, A -> a. -*/ +/* #### We do not currently deal properly with translating non-ASCII + (including Latin-1!) characters under Mule. Getting this right is + *hard*, way fucking hard. So we at least preserve consistency by + sanitizing all the case tables to remove translations that would + get us into trouble and possibly result in inconsistent internal + text, which would likely lead to crashes. */ #include <config.h> #include "lisp.h" #include "buffer.h" #include "opaque.h" -#include "chartab.h" -#include "casetab.h" -Lisp_Object Qcase_tablep, Qdowncase, Qupcase; -Lisp_Object Vstandard_case_table; +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); -Lisp_Object case_table_char (Lisp_Object ch, Lisp_Object table); - -#define STRING256_P(obj) ((STRINGP (obj) && XSTRING_CHAR_LENGTH (obj) == 256)) - -static Lisp_Object -mark_case_table (Lisp_Object obj) -{ - Lisp_Case_Table *ct = XCASE_TABLE (obj); - - mark_object (CASE_TABLE_DOWNCASE (ct)); - mark_object (CASE_TABLE_UPCASE (ct)); - mark_object (CASE_TABLE_CANON (ct)); - mark_object (CASE_TABLE_EQV (ct)); - return Qnil; -} - -static void -print_case_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) -{ - Lisp_Case_Table *ct = XCASE_TABLE (obj); - char buf[200]; - if (print_readably) - error ("printing unreadable object #<case-table 0x%x", ct->header.uid); - write_c_string ("#<case-table ", printcharfun); - sprintf (buf, "0x%x>", ct->header.uid); - write_c_string (buf, printcharfun); -} - -static const struct lrecord_description case_table_description [] = { - { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, downcase_table) }, - { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, upcase_table) }, - { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, case_canon_table) }, - { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, case_eqv_table) }, - { XD_END } -}; - -DEFINE_LRECORD_IMPLEMENTATION ("case-table", case_table, - mark_case_table, print_case_table, 0, - 0, 0, case_table_description, Lisp_Case_Table); - -static Lisp_Object -allocate_case_table (void) -{ - Lisp_Object val; - Lisp_Case_Table *ct = - alloc_lcrecord_type (Lisp_Case_Table, &lrecord_case_table); - SET_CASE_TABLE_DOWNCASE (ct, Qnil); - SET_CASE_TABLE_UPCASE (ct, Qnil); - SET_CASE_TABLE_CANON (ct, Qnil); - SET_CASE_TABLE_EQV (ct, Qnil); - - XSETCASE_TABLE (val, ct); - return val; -} +#define STRING256_P(obj) (STRINGP (obj) && XSTRING_CHAR_LENGTH (obj) == 256) DEFUN ("case-table-p", Fcase_table_p, 1, 1, 0, /* -Return t if OBJECT is a case table. +Return t if ARG is a case table. See `set-case-table' for more information on these data structures. */ - (object)) + (table)) { - if (CASE_TABLEP (object)) - return Qt; - else - { - Lisp_Object down, up, canon, eqv; - if (!CONSP (object)) - return Qnil; - down = XCAR (object); object = XCDR (object); - if (!CONSP (object)) - return Qnil; - up = XCAR (object); object = XCDR (object); - if (!CONSP (object)) - return Qnil; - canon = XCAR (object); object = XCDR (object); - if (!CONSP (object)) - return Qnil; - eqv = XCAR (object); - - return ((STRING256_P (down) - && (NILP (up) || STRING256_P (up)) - && ((NILP (canon) && NILP (eqv)) - || STRING256_P (canon)) - && (NILP (eqv) || STRING256_P (eqv))) - ? Qt : Qnil); - - } + Lisp_Object down, up, canon, eqv; + if (!CONSP (table)) return Qnil; down = XCAR (table); table = XCDR (table); + if (!CONSP (table)) return Qnil; up = XCAR (table); table = XCDR (table); + if (!CONSP (table)) return Qnil; canon = XCAR (table); table = XCDR (table); + if (!CONSP (table)) return Qnil; eqv = XCAR (table); + + return (STRING256_P (down) + && (NILP (up) || STRING256_P (up)) + && ((NILP (canon) && NILP (eqv)) + || (STRING256_P (canon) + && (NILP (eqv) || STRING256_P (eqv)))) + ? Qt : Qnil); } static Lisp_Object -check_case_table (Lisp_Object object) -{ - /* This function can GC */ - while (NILP (Fcase_table_p (object))) - object = wrong_type_argument (Qcase_tablep, object); - return object; -} - -Lisp_Object -case_table_char (Lisp_Object ch, Lisp_Object table) -{ - Lisp_Object ct_char; - ct_char = get_char_table (XCHAR (ch), XCHAR_TABLE (table)); - if (NILP (ct_char)) - return ch; - else - return ct_char; -} - -DEFUN ("get-case-table", Fget_case_table, 3, 3, 0, /* -Return CHAR-CASE version of CHARACTER in CASE-TABLE. - -CHAR-CASE is either downcase or upcase. -*/ - (char_case, character, case_table)) -{ - CHECK_CHAR (character); - CHECK_CASE_TABLE (case_table); - if (EQ (char_case, Qdowncase)) - return case_table_char (character, XCASE_TABLE_DOWNCASE (case_table)); - else if (EQ (char_case, Qupcase)) - return case_table_char (character, XCASE_TABLE_UPCASE (case_table)); - else - signal_simple_error ("Char case must be downcase or upcase", char_case); - - return Qnil; /* Not reached. */ -} - -DEFUN ("put-case-table", Fput_case_table, 4, 4, 0, /* -Set CHAR-CASE version of CHARACTER to be VALUE in CASE-TABLE. - -CHAR-CASE is either downcase or upcase. -See also `put-case-table-pair'. -*/ - (char_case, character, value, case_table)) -{ - CHECK_CHAR (character); - CHECK_CHAR (value); - - if (EQ (char_case, Qdowncase)) - { - Fput_char_table (character, value, XCASE_TABLE_DOWNCASE (case_table)); - /* This one is not at all intuitive. */ - Fput_char_table (character, value, XCASE_TABLE_UPCASE (case_table)); - Fput_char_table (character, value, XCASE_TABLE_CANON (case_table)); - Fput_char_table (value, value, XCASE_TABLE_CANON (case_table)); - Fput_char_table (value, character, XCASE_TABLE_EQV (case_table)); - Fput_char_table (character, value, XCASE_TABLE_EQV (case_table)); - } - else if (EQ (char_case, Qupcase)) - { - Fput_char_table (character, value, XCASE_TABLE_UPCASE (case_table)); - Fput_char_table (character, character, XCASE_TABLE_DOWNCASE (case_table)); - Fput_char_table (character, character, XCASE_TABLE_CANON (case_table)); - Fput_char_table (value, character, XCASE_TABLE_CANON (case_table)); - Fput_char_table (value, character, XCASE_TABLE_EQV (case_table)); - Fput_char_table (character, value, XCASE_TABLE_EQV (case_table)); - } - else - signal_simple_error ("Char case must be downcase or upcase", char_case); - - return Qnil; -} - -DEFUN ("put-case-table-pair", Fput_case_table_pair, 3, 3, 0, /* -Make UC and LC a pair of inter-case-converting letters in CASE-TABLE. -UC is an uppercase character and LC is a downcase character. -*/ - (uc, lc, case_table)) +check_case_table (Lisp_Object obj) { - CHECK_CHAR (uc); - CHECK_CHAR (lc); - CHECK_CASE_TABLE (case_table); - - Fput_char_table (lc, lc, XCASE_TABLE_DOWNCASE (case_table)); - Fput_char_table (uc, lc, XCASE_TABLE_UPCASE (case_table)); - Fput_char_table (uc, lc, XCASE_TABLE_DOWNCASE (case_table)); - Fput_char_table (lc, uc, XCASE_TABLE_UPCASE (case_table)); - - Fput_char_table (lc, lc, XCASE_TABLE_CANON (case_table)); - Fput_char_table (uc, lc, XCASE_TABLE_CANON (case_table)); - Fput_char_table (uc, lc, XCASE_TABLE_EQV (case_table)); - Fput_char_table (lc, uc, XCASE_TABLE_EQV (case_table)); - return Qnil; -} + REGISTER Lisp_Object tem; -DEFUN ("copy-case-table", Fcopy_case_table, 1, 1, 0, /* -Return a new case table which is a copy of CASE-TABLE -*/ - (case_table)) -{ - Lisp_Object new_obj; - CHECK_CASE_TABLE (case_table); - - new_obj = allocate_case_table (); - XSET_CASE_TABLE_DOWNCASE - (new_obj, Fcopy_char_table (XCASE_TABLE_DOWNCASE (case_table))); - XSET_CASE_TABLE_UPCASE - (new_obj, Fcopy_char_table (XCASE_TABLE_UPCASE (case_table))); - XSET_CASE_TABLE_CANON - (new_obj, Fcopy_char_table (XCASE_TABLE_CANON (case_table))); - XSET_CASE_TABLE_EQV - (new_obj, Fcopy_char_table (XCASE_TABLE_EQV (case_table))); - return new_obj; + while (tem = Fcase_table_p (obj), NILP (tem)) + obj = wrong_type_argument (Qcase_table_p, obj); + return (obj); } DEFUN ("current-case-table", Fcurrent_case_table, 0, 1, 0, /* @@ -266,7 +92,10 @@ Return the case table of BUFFER, which defaults to the current buffer. { struct buffer *buf = decode_buffer (buffer, 0); - return buf->case_table; + return list4 (buf->downcase_table, + buf->upcase_table, + buf->case_canon_table, + buf->case_eqv_table); } DEFUN ("standard-case-table", Fstandard_case_table, 0, 0, 0, /* @@ -275,17 +104,19 @@ This is the one used for new buffers. */ ()) { - return Vstandard_case_table; + return list4 (Vascii_downcase_table, + Vascii_upcase_table, + Vascii_canon_table, + Vascii_eqv_table); } static Lisp_Object set_case_table (Lisp_Object table, int standard); + DEFUN ("set-case-table", Fset_case_table, 1, 1, 0, /* -Select CASE-TABLE as the new case table for the current buffer. -A case table is a case-table object or list - (DOWNCASE UPCASE CANONICALIZE EQUIVALENCES) +Select a new case table for the current buffer. +A case table is a list (DOWNCASE UPCASE CANONICALIZE EQUIVALENCES) where each element is either nil or a string of length 256. -The latter is provided for backward-compatibility. DOWNCASE maps each character to its lower-case equivalent. UPCASE maps each character to its upper-case equivalent; if lower and upper case characters are in 1-1 correspondence, @@ -298,121 +129,134 @@ EQUIVALENCES is a map that cyclicly permutes each equivalence class (of characters with the same canonical equivalent); it may be nil, in which case it is deduced from CANONICALIZE. -See also `get-case-table', `put-case-table' and `put-case-table-pair'. +BUG: Under XEmacs/Mule, translations to or from non-ASCII characters + (this includes chars in the range 128 - 255) are ignored by + the string/buffer-searching routines. Thus, `case-fold-search' + will not correctly conflate a-umlaut and A-umlaut even if the + case tables call for this. */ - (case_table)) + (table)) { - /* This function can GC */ - return set_case_table (case_table, 0); + return set_case_table (table, 0); } DEFUN ("set-standard-case-table", Fset_standard_case_table, 1, 1, 0, /* -Select CASE-TABLE as the new standard case table for new buffers. +Select a new standard case table for new buffers. See `set-case-table' for more info on case tables. */ - (case_table)) + (table)) +{ + return set_case_table (table, 1); +} + +#ifdef MULE + +static Lisp_Object +make_mirror_trt_table (Lisp_Object table) { - /* This function can GC */ - return set_case_table (case_table, 1); + Lisp_Object new_table; + + if (!STRING256_P (table)) + { +#ifdef DEBUG_XEMACS + /* This should be caught farther up. */ + abort (); +#else + signal_simple_error ("Invalid translate table", table); +#endif + } + + new_table = MAKE_MIRROR_TRT_TABLE (); + { + int i; + + for (i = 0; i < 256; i++) + { + Emchar newval = string_char (XSTRING (table), i); + if ((i >= 128 && newval != i) + || (i < 128 && newval >= 128)) + { + newval = (Emchar) i; + } + SET_MIRROR_TRT_TABLE_CHAR_1 (new_table, i, newval); + } + } + return new_table; } +#endif /* MULE */ + static Lisp_Object set_case_table (Lisp_Object table, int standard) { - /* This function can GC */ - struct buffer *buf = - standard ? XBUFFER(Vbuffer_defaults) : current_buffer; + Lisp_Object down, up, canon, eqv, tail = table; + struct buffer *buf = current_buffer; check_case_table (table); - if (CASE_TABLEP (table)) - { - if (standard) - Vstandard_case_table = table; + down = XCAR (tail); tail = XCDR (tail); + up = XCAR (tail); tail = XCDR (tail); + canon = XCAR (tail); tail = XCDR (tail); + eqv = XCAR (tail); - buf->case_table = table; + if (NILP (up)) + { + up = MAKE_TRT_TABLE (); + compute_trt_inverse (down, up); } - else + + if (NILP (canon)) { - /* For backward compatibility. */ - Lisp_Object down, up, canon, eqv, tail = table; - Lisp_Object temp; - int i; - - down = XCAR (tail); tail = XCDR (tail); - up = XCAR (tail); tail = XCDR (tail); - canon = XCAR (tail); tail = XCDR (tail); - eqv = XCAR (tail); - - temp = down; - down = MAKE_TRT_TABLE (); - for (i = 0; i < 256; i++) - SET_TRT_TABLE_CHAR_1 (down, i, string_char (XSTRING (temp), i)); + REGISTER Charcount i; - if (NILP (up)) - { - up = MAKE_TRT_TABLE (); - compute_trt_inverse (down, up); - } - else - { - temp = up; - up = MAKE_TRT_TABLE (); - for (i = 0; i < 256; i++) - SET_TRT_TABLE_CHAR_1 (up, i, string_char (XSTRING (temp), i)); - } - if (NILP (canon)) - { - canon = MAKE_TRT_TABLE (); - - /* Set up the CANON table; for each character, - this sequence of upcasing and downcasing ought to - get the "preferred" lowercase equivalent. */ - for (i = 0; i < 256; i++) - SET_TRT_TABLE_CHAR_1 (canon, i, - TRT_TABLE_CHAR_1 - (down, - TRT_TABLE_CHAR_1 - (up, - TRT_TABLE_CHAR_1 (down, i)))); - } - else - { - temp = canon; - canon = MAKE_TRT_TABLE (); - for (i = 0; i < 256; i++) - SET_TRT_TABLE_CHAR_1 (canon, i, string_char (XSTRING (temp), i)); - } + canon = MAKE_TRT_TABLE (); - if (NILP (eqv)) - { - eqv = MAKE_TRT_TABLE (); - compute_trt_inverse (canon, eqv); - } - else - { - temp = eqv; - eqv = MAKE_TRT_TABLE (); - for (i = 0; i < 256; i++) - SET_TRT_TABLE_CHAR_1 (eqv, i, string_char (XSTRING (temp), i)); - } + /* Set up the CANON vector; for each character, + this sequence of upcasing and downcasing ought to + get the "preferred" lowercase equivalent. */ + for (i = 0; i < 256; i++) + SET_TRT_TABLE_CHAR_1 (canon, i, + TRT_TABLE_CHAR_1 + (down, + TRT_TABLE_CHAR_1 + (up, + TRT_TABLE_CHAR_1 (down, i)))); + } - if (standard) - { - XSET_CASE_TABLE_DOWNCASE (Vstandard_case_table, down); - XSET_CASE_TABLE_UPCASE (Vstandard_case_table, up); - XSET_CASE_TABLE_CANON (Vstandard_case_table, canon); - XSET_CASE_TABLE_EQV (Vstandard_case_table, eqv); - } + if (NILP (eqv)) + { + eqv = MAKE_TRT_TABLE (); - buf->case_table = allocate_case_table (); - XSET_CASE_TABLE_DOWNCASE (buf->case_table, down); - XSET_CASE_TABLE_UPCASE (buf->case_table, up); - XSET_CASE_TABLE_CANON (buf->case_table, canon); - XSET_CASE_TABLE_EQV (buf->case_table, eqv); + compute_trt_inverse (canon, eqv); } - return buf->case_table; + if (standard) + { + Vascii_downcase_table = down; + Vascii_upcase_table = up; + Vascii_canon_table = canon; + Vascii_eqv_table = eqv; +#ifdef MULE + Vmirror_ascii_downcase_table = make_mirror_trt_table (down); + Vmirror_ascii_upcase_table = make_mirror_trt_table (up); + Vmirror_ascii_canon_table = make_mirror_trt_table (canon); + Vmirror_ascii_eqv_table = make_mirror_trt_table (eqv); +#endif + } + else + { + buf->downcase_table = down; + buf->upcase_table = up; + buf->case_canon_table = canon; + buf->case_eqv_table = eqv; +#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); +#endif + } + return table; } /* Given a translate table TRT, store the inverse mapping into INVERSE. @@ -445,19 +289,12 @@ compute_trt_inverse (Lisp_Object trt, Lisp_Object inverse) void syms_of_casetab (void) { - INIT_LRECORD_IMPLEMENTATION (case_table); - - defsymbol (&Qcase_tablep, "case-table-p"); - defsymbol (&Qdowncase, "downcase"); - defsymbol (&Qupcase, "upcase"); + defsymbol (&Qcase_table_p, "case-table-p"); + defsymbol (&Qtranslate_table, "translate-table"); DEFSUBR (Fcase_table_p); - DEFSUBR (Fget_case_table); - DEFSUBR (Fput_case_table); - DEFSUBR (Fput_case_table_pair); DEFSUBR (Fcurrent_case_table); DEFSUBR (Fstandard_case_table); - DEFSUBR (Fcopy_case_table); DEFSUBR (Fset_case_table); DEFSUBR (Fset_standard_case_table); } @@ -468,13 +305,14 @@ complex_vars_of_casetab (void) REGISTER Emchar i; Lisp_Object tem; - staticpro (&Vstandard_case_table); - - Vstandard_case_table = allocate_case_table (); + staticpro (&Vascii_downcase_table); + staticpro (&Vascii_upcase_table); + staticpro (&Vascii_canon_table); + staticpro (&Vascii_eqv_table); tem = MAKE_TRT_TABLE (); - XSET_CASE_TABLE_DOWNCASE (Vstandard_case_table, tem); - XSET_CASE_TABLE_CANON (Vstandard_case_table, tem); + Vascii_downcase_table = tem; + Vascii_canon_table = tem; /* Under Mule, can't do set_string_char() until Vcharset_control_1 and Vcharset_ascii are initialized. */ @@ -485,9 +323,15 @@ complex_vars_of_casetab (void) SET_TRT_TABLE_CHAR_1 (tem, i, lowered); } +#ifdef MULE + tem = make_mirror_trt_table (tem); + Vmirror_ascii_downcase_table = tem; + Vmirror_ascii_canon_table = tem; +#endif + tem = MAKE_TRT_TABLE (); - XSET_CASE_TABLE_UPCASE (Vstandard_case_table, tem); - XSET_CASE_TABLE_EQV (Vstandard_case_table, tem); + Vascii_upcase_table = tem; + Vascii_eqv_table = tem; for (i = 0; i < 256; i++) { @@ -496,4 +340,10 @@ complex_vars_of_casetab (void) SET_TRT_TABLE_CHAR_1 (tem, i, flipped); } + +#ifdef MULE + tem = make_mirror_trt_table (tem); + Vmirror_ascii_upcase_table = tem; + Vmirror_ascii_eqv_table = tem; +#endif } diff --git a/src/chartab.c b/src/chartab.c index 3743698..470993b 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -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. @@ -40,6 +38,7 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" #include "chartab.h" +#include "commands.h" #include "syntax.h" Lisp_Object Qchar_tablep, Qchar_table; @@ -52,9 +51,6 @@ Lisp_Object Qcategory_designator_p; 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 +91,14 @@ Lisp_Object Vword_combining_categories, Vword_separating_categories; #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 +106,8 @@ mark_char_table_entry (Lisp_Object obj) 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,56 +120,50 @@ char_table_entry_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) 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; } /* WARNING: All functions of this nature need to be written extremely carefully to avoid crashes during GC. Cf. prune_specifiers() - and prune_weak_hash_tables(). */ + and prune_weak_hashtables(). */ 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 = @@ -187,7 +177,6 @@ char_table_type_to_symbol (enum char_table_type type) { switch (type) { - default: abort(); case CHAR_TABLE_TYPE_GENERIC: return Qgeneric; case CHAR_TABLE_TYPE_SYNTAX: return Qsyntax; case CHAR_TABLE_TYPE_DISPLAY: return Qdisplay; @@ -196,6 +185,9 @@ char_table_type_to_symbol (enum char_table_type type) case CHAR_TABLE_TYPE_CATEGORY: return Qcategory; #endif } + + abort (); + return Qnil; /* not reached */ } static enum char_table_type @@ -241,7 +233,7 @@ print_chartab_range (Emchar first, Emchar last, Lisp_Object val, 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 +281,7 @@ print_chartab_charset_row (Lisp_Object charset, 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 +311,7 @@ print_chartab_two_byte_charset (Lisp_Object charset, 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 +369,7 @@ print_char_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) } 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 +385,8 @@ print_char_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 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 +408,7 @@ char_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) 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 +418,10 @@ char_table_hash (Lisp_Object obj, int depth) 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. @@ -468,12 +449,12 @@ assigned values are -- all characters -- a single character -To create a char table, use `make-char-table'. -To modify a char table, use `put-char-table' or `remove-char-table'. -To retrieve the value for a particular character, use `get-char-table'. -See also `map-char-table', `clear-char-table', `copy-char-table', -`valid-char-table-type-p', `char-table-type-list', -`valid-char-table-value-p', and `check-char-table-value'. +To create a char table, use `make-char-table'. To modify a char +table, use `put-char-table' or `remove-char-table'. To retrieve the +value for a particular character, use `get-char-table'. See also +`map-char-table', `clear-char-table', `copy-char-table', +`valid-char-table-type-p', `char-table-type-list', `valid-char-table-value-p', +and `check-char-table-value'. */ (object)) { @@ -533,17 +514,17 @@ sorts of values. The different char table types are } DEFUN ("char-table-type", Fchar_table_type, 1, 1, 0, /* -Return the type of CHAR-TABLE. +Return the type of char table TABLE. See `valid-char-table-type-p'. */ - (char_table)) + (table)) { - CHECK_CHAR_TABLE (char_table); - return char_table_type_to_symbol (XCHAR_TABLE (char_table)->type); + CHECK_CHAR_TABLE (table); + return char_table_type_to_symbol (XCHAR_TABLE (table)->type); } void -fill_char_table (Lisp_Char_Table *ct, Lisp_Object value) +fill_char_table (struct Lisp_Char_Table *ct, Lisp_Object value) { int i; @@ -559,27 +540,25 @@ fill_char_table (Lisp_Char_Table *ct, Lisp_Object value) } DEFUN ("reset-char-table", Freset_char_table, 1, 1, 0, /* -Reset CHAR-TABLE to its default state. +Reset a char table to its default state. */ - (char_table)) + (table)) { - Lisp_Char_Table *ct; + struct Lisp_Char_Table *ct; - CHECK_CHAR_TABLE (char_table); - ct = XCHAR_TABLE (char_table); + CHECK_CHAR_TABLE (table); + ct = XCHAR_TABLE (table); switch (ct->type) { case CHAR_TABLE_TYPE_CHAR: - fill_char_table (ct, make_char (0)); - break; case CHAR_TABLE_TYPE_DISPLAY: case CHAR_TABLE_TYPE_GENERIC: #ifdef MULE case CHAR_TABLE_TYPE_CATEGORY: -#endif /* MULE */ fill_char_table (ct, Qnil); break; +#endif /* MULE */ case CHAR_TABLE_TYPE_SYNTAX: fill_char_table (ct, make_int (Sinherit)); @@ -599,11 +578,11 @@ and 'syntax. See `valid-char-table-type-p'. */ (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 +610,9 @@ make_char_table_entry (Lisp_Object initval) { 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 +624,12 @@ make_char_table_entry (Lisp_Object initval) 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++) { @@ -666,19 +647,19 @@ copy_char_table_entry (Lisp_Object entry) #endif /* MULE */ DEFUN ("copy-char-table", Fcopy_char_table, 1, 1, 0, /* -Return a new char table which is a copy of CHAR-TABLE. +Make a new char table which is a copy of OLD-TABLE. It will contain the same values for the same characters and ranges -as CHAR-TABLE. The values will not themselves be copied. +as OLD-TABLE. The values will not themselves be copied. */ - (char_table)) + (old_table)) { - Lisp_Char_Table *ct, *ctnew; + struct Lisp_Char_Table *ct, *ctnew; Lisp_Object obj; int i; - CHECK_CHAR_TABLE (char_table); - ct = XCHAR_TABLE (char_table); - ctnew = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table); + CHECK_CHAR_TABLE (old_table); + ct = XCHAR_TABLE (old_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 +688,7 @@ as CHAR-TABLE. The values will not themselves be copied. 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 +708,7 @@ decode_char_table_range (Lisp_Object range, struct chartab_range *outrange) #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 +748,7 @@ decode_char_table_range (Lisp_Object range, struct chartab_range *outrange) /* 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 +759,7 @@ get_non_ascii_char_table_value (Lisp_Char_Table *ct, int leading_byte, 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)) { @@ -800,8 +775,8 @@ get_non_ascii_char_table_value (Lisp_Char_Table *ct, int leading_byte, #endif /* MULE */ -Lisp_Object -get_char_table (Emchar ch, Lisp_Char_Table *ct) +static Lisp_Object +get_char_table (Emchar ch, struct Lisp_Char_Table *ct) { #ifdef MULE { @@ -821,7 +796,7 @@ get_char_table (Emchar ch, Lisp_Char_Table *ct) 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)) { @@ -842,29 +817,32 @@ get_char_table (Emchar ch, Lisp_Char_Table *ct) DEFUN ("get-char-table", Fget_char_table, 2, 2, 0, /* -Find value for CHARACTER in CHAR-TABLE. +Find value for char CH in TABLE. */ - (character, char_table)) + (ch, table)) { - CHECK_CHAR_TABLE (char_table); - CHECK_CHAR_COERCE_INT (character); + struct Lisp_Char_Table *ct; + + CHECK_CHAR_TABLE (table); + ct = XCHAR_TABLE (table); + CHECK_CHAR_COERCE_INT (ch); - return get_char_table (XCHAR (character), XCHAR_TABLE (char_table)); + return get_char_table (XCHAR (ch), ct); } DEFUN ("get-range-char-table", Fget_range_char_table, 2, 3, 0, /* -Find value for a range in CHAR-TABLE. +Find value for a range in TABLE. If there is more than one value, return MULTI (defaults to nil). */ - (range, char_table, multi)) + (range, table, multi)) { - Lisp_Char_Table *ct; + struct Lisp_Char_Table *ct; struct chartab_range rainj; if (CHAR_OR_CHAR_INTP (range)) - return Fget_char_table (range, char_table); - CHECK_CHAR_TABLE (char_table); - ct = XCHAR_TABLE (char_table); + return Fget_char_table (range, table); + CHECK_CHAR_TABLE (table); + ct = XCHAR_TABLE (table); decode_char_table_range (range, &rainj); switch (rainj.type) @@ -1009,10 +987,6 @@ canonicalize_char_table_value (Lisp_Object value, enum char_table_type type) CHECK_CHAR_COERCE_INT (cdr); return Fcons (car, cdr); } - break; - case CHAR_TABLE_TYPE_CHAR: - CHECK_CHAR_COERCE_INT (value); - break; default: break; } @@ -1043,7 +1017,7 @@ Signal an error if VALUE is not a valid value for CHAR-TABLE-TYPE. /* 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) @@ -1076,7 +1050,7 @@ put_char_table (Lisp_Char_Table *ct, struct chartab_range *range, 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])) @@ -1100,7 +1074,7 @@ put_char_table (Lisp_Char_Table *ct, struct chartab_range *range, 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])) @@ -1135,7 +1109,7 @@ put_char_table (Lisp_Char_Table *ct, struct chartab_range *range, } DEFUN ("put-char-table", Fput_char_table, 3, 3, 0, /* -Set the value for chars in RANGE to be VALUE in CHAR-TABLE. +Set the value for chars in RANGE to be VAL in TABLE. RANGE specifies one or more characters to be affected and should be one of the following: @@ -1146,27 +1120,27 @@ one of the following: (only allowed when Mule support is present) -- A single character -VALUE must be a value appropriate for the type of CHAR-TABLE. +VAL must be a value appropriate for the type of TABLE. See `valid-char-table-type-p'. */ - (range, value, char_table)) + (range, val, table)) { - Lisp_Char_Table *ct; + struct Lisp_Char_Table *ct; struct chartab_range rainj; - CHECK_CHAR_TABLE (char_table); - ct = XCHAR_TABLE (char_table); - check_valid_char_table_value (value, ct->type, ERROR_ME); + CHECK_CHAR_TABLE (table); + ct = XCHAR_TABLE (table); + check_valid_char_table_value (val, ct->type, ERROR_ME); decode_char_table_range (range, &rainj); - value = canonicalize_char_table_value (value, ct->type); - put_char_table (ct, &rainj, value); + val = canonicalize_char_table_value (val, ct->type); + put_char_table (ct, &rainj, val); return Qnil; } /* 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) @@ -1196,7 +1170,7 @@ map_over_charset_ascii (Lisp_Char_Table *ct, /* 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) @@ -1222,7 +1196,7 @@ map_over_charset_control_1 (Lisp_Char_Table *ct, 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), @@ -1262,7 +1236,7 @@ map_over_charset_row (Lisp_Char_Table_Entry *cte, 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) @@ -1285,7 +1259,7 @@ map_over_other_charset (Lisp_Char_Table *ct, int lb, } { - 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; @@ -1319,7 +1293,7 @@ map_over_other_charset (Lisp_Char_Table *ct, int lb, 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), @@ -1437,22 +1411,22 @@ slow_map_char_table_fun (struct chartab_range *range, } DEFUN ("map-char-table", Fmap_char_table, 2, 3, 0, /* -Map FUNCTION over entries in CHAR-TABLE, calling it with two args, +Map FUNCTION over entries in TABLE, calling it with two args, each key and value in the table. RANGE specifies a subrange to map over and is in the same format as the RANGE argument to `put-range-table'. If omitted or t, it defaults to the entire table. */ - (function, char_table, range)) + (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; - CHECK_CHAR_TABLE (char_table); - ct = XCHAR_TABLE (char_table); + CHECK_CHAR_TABLE (table); + ct = XCHAR_TABLE (table); if (NILP (range)) range = Qt; decode_char_table_range (range, &rainj); @@ -1569,7 +1543,7 @@ chartab_instantiate (Lisp_Object data) /************************************************************************/ DEFUN ("category-table-p", Fcategory_table_p, 1, 1, 0, /* -Return t if OBJECT is a category table. +Return t if ARG is a category table. 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 @@ -1592,29 +1566,29 @@ whether the character is in that category. Special Lisp functions are provided that abstract this, so you do not have to directly manipulate bit vectors. */ - (object)) + (obj)) { - return (CHAR_TABLEP (object) && - XCHAR_TABLE_TYPE (object) == CHAR_TABLE_TYPE_CATEGORY) ? + return (CHAR_TABLEP (obj) && + XCHAR_TABLE_TYPE (obj) == CHAR_TABLE_TYPE_CATEGORY) ? Qt : Qnil; } static Lisp_Object -check_category_table (Lisp_Object object, Lisp_Object default_) +check_category_table (Lisp_Object obj, Lisp_Object def) { - if (NILP (object)) - object = default_; - while (NILP (Fcategory_table_p (object))) - object = wrong_type_argument (Qcategory_table_p, object); - return object; + if (NILP (obj)) + obj = def; + while (NILP (Fcategory_table_p (obj))) + obj = wrong_type_argument (Qcategory_table_p, obj); + return obj; } int check_category_char (Emchar ch, Lisp_Object table, - unsigned int designator, unsigned int not_p) + 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); @@ -1622,40 +1596,39 @@ check_category_char (Emchar ch, Lisp_Object table, ctbl = XCHAR_TABLE (table); temp = get_char_table (ch, ctbl); if (NILP (temp)) - return not_p; + return not; designator -= ' '; - return bit_vector_bit (XBIT_VECTOR (temp), designator) ? !not_p : not_p; + return bit_vector_bit (XBIT_VECTOR (temp), designator) ? !not : not; } DEFUN ("check-category-at", Fcheck_category_at, 2, 4, 0, /* -Return t if category of the character at POSITION includes DESIGNATOR. -Optional third arg BUFFER specifies which buffer to use, and defaults -to the current buffer. -Optional fourth arg CATEGORY-TABLE specifies the category table to -use, and defaults to BUFFER's category table. +Return t if category of a character at POS includes DESIGNATOR, +else return nil. Optional third arg specifies which buffer +\(defaulting to current), and fourth specifies the CATEGORY-TABLE, +\(defaulting to the buffer's category table). */ - (position, designator, buffer, category_table)) + (pos, designator, buffer, category_table)) { Lisp_Object ctbl; Emchar ch; unsigned int des; struct buffer *buf = decode_buffer (buffer, 0); - CHECK_INT (position); + CHECK_INT (pos); CHECK_CATEGORY_DESIGNATOR (designator); des = XCHAR (designator); ctbl = check_category_table (category_table, Vstandard_category_table); - ch = BUF_FETCH_CHAR (buf, XINT (position)); + ch = BUF_FETCH_CHAR (buf, XINT (pos)); return check_category_char (ch, ctbl, des, 0) ? Qt : Qnil; } DEFUN ("char-in-category-p", Fchar_in_category_p, 2, 3, 0, /* -Return t if category of CHARACTER includes DESIGNATOR, else nil. -Optional third arg CATEGORY-TABLE specifies the category table to use, -and defaults to the standard category table. +Return t if category of character CHR includes DESIGNATOR, else nil. +Optional third arg specifies the CATEGORY-TABLE to use, +which defaults to the system default table. */ - (character, designator, category_table)) + (chr, designator, category_table)) { Lisp_Object ctbl; Emchar ch; @@ -1663,15 +1636,16 @@ and defaults to the standard category table. CHECK_CATEGORY_DESIGNATOR (designator); des = XCHAR (designator); - CHECK_CHAR (character); - ch = XCHAR (character); + CHECK_CHAR (chr); + ch = XCHAR (chr); ctbl = check_category_table (category_table, Vstandard_category_table); return check_category_char (ch, ctbl, des, 0) ? Qt : Qnil; } DEFUN ("category-table", Fcategory_table, 0, 1, 0, /* -Return BUFFER's current category table. -BUFFER defaults to the current buffer. +Return the current category table. +This is the one specified by the current buffer, or by BUFFER if it +is non-nil. */ (buffer)) { @@ -1688,124 +1662,57 @@ This is the one used for new buffers. } DEFUN ("copy-category-table", Fcopy_category_table, 0, 1, 0, /* -Return a new category table which is a copy of CATEGORY-TABLE. -CATEGORY-TABLE defaults to the standard category table. +Construct a new category table and return it. +It is a copy of the TABLE, which defaults to the standard category table. */ - (category_table)) + (table)) { if (NILP (Vstandard_category_table)) return Fmake_char_table (Qcategory); - category_table = - check_category_table (category_table, Vstandard_category_table); - return Fcopy_char_table (category_table); + table = check_category_table (table, Vstandard_category_table); + return Fcopy_char_table (table); } DEFUN ("set-category-table", Fset_category_table, 1, 2, 0, /* -Select CATEGORY-TABLE as the new category table for BUFFER. +Select a new category table for BUFFER. +One argument, a category table. BUFFER defaults to the current buffer if omitted. */ - (category_table, buffer)) + (table, buffer)) { struct buffer *buf = decode_buffer (buffer, 0); - category_table = check_category_table (category_table, Qnil); - buf->category_table = category_table; + table = check_category_table (table, Qnil); + buf->category_table = table; /* Indicate that this buffer now has a specified category table. */ buf->local_var_flags |= XINT (buffer_local_flags.category_table); - return category_table; + return table; } DEFUN ("category-designator-p", Fcategory_designator_p, 1, 1, 0, /* -Return t if OBJECT is a category designator (a char in the range ' ' to '~'). +Return t if ARG is a category designator (a char in the range ' ' to '~'). */ - (object)) + (obj)) { - return CATEGORY_DESIGNATORP (object) ? Qt : Qnil; + return CATEGORY_DESIGNATORP (obj) ? Qt : Qnil; } DEFUN ("category-table-value-p", Fcategory_table_value_p, 1, 1, 0, /* -Return t if OBJECT is a category table value. +Return t if ARG is a category table value. Valid values are nil or a bit vector of size 95. */ - (object)) + (obj)) { - return CATEGORY_TABLE_VALUEP (object) ? Qt : Qnil; + 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"); @@ -1840,14 +1747,8 @@ syms_of_chartab (void) 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; - dump_add_weak_object_chain (&Vall_syntax_tables); } void @@ -1871,50 +1772,5 @@ complex_vars_of_chartab (void) 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 --git a/src/chartab.h b/src/chartab.h index f96aa7d..ac23e00 100644 --- a/src/chartab.h +++ b/src/chartab.h @@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA. */ 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 @@ Boston, MA 02111-1307, USA. */ #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 @@ struct Lisp_Char_Table_Entry 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 @@ struct Lisp_Char_Table 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 @@ CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (Lisp_Char_Table *ct, Emchar ch) #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,21 +177,19 @@ struct chartab_range 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, +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); EXFUN (Fput_char_table, 3); -EXFUN (Fget_char_table, 2); extern Lisp_Object Vall_syntax_tables; @@ -201,7 +197,7 @@ extern Lisp_Object Vall_syntax_tables; #ifdef MULE int check_category_char(Emchar ch, Lisp_Object ctbl, - unsigned int designator, unsigned int not_p); + unsigned int designator, unsigned int not); extern Lisp_Object Vstandard_category_table; @@ -233,4 +229,4 @@ extern Lisp_Object Vstandard_category_table; #endif /* MULE */ -#endif /* INCLUDED_chartab_h_ */ +#endif /* _MULE_CHARTAB_H */ diff --git a/src/chpdef.h b/src/chpdef.h new file mode 100644 index 0000000..196196c --- /dev/null +++ b/src/chpdef.h @@ -0,0 +1,57 @@ +/* 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. */ + +#define CHP$_END 0 +#define CHP$_ACCESS 1 +#define CHP$_FLAGS 2 +#define CHP$_PRIV 3 +#define CHP$_ACMODE 4 +#define CHP$_ACCLASS 5 +#define CHP$_RIGHTS 6 +#define CHP$_ADDRIGHTS 7 +#define CHP$_MODE 8 +#define CHP$_MODES 9 +#define CHP$_MINCLASS 10 +#define CHP$_MAXCLASS 11 +#define CHP$_OWNER 12 +#define CHP$_PROT 13 +#define CHP$_ACL 14 +#define CHP$_AUDITNAME 15 +#define CHP$_ALARMNAME 16 +#define CHP$_MATCHEDACE 17 +#define CHP$_PRIVUSED 18 +#define CHP$_MAX_CODE 19 +#define CHP$M_SYSPRV 1 +#define CHP$M_BYPASS 2 +#define CHP$M_UPGRADE 4 +#define CHP$M_DOWNGRADE 8 +#define CHP$M_GRPPRV 16 +#define CHP$M_READALL 32 +#define CHP$V_SYSPRV 0 +#define CHP$V_BYPASS 1 +#define CHP$V_UPGRADE 2 +#define CHP$V_DOWNGRADE 3 +#define CHP$V_GRPPRV 4 +#define CHP$V_READALL 5 +#define CHP$M_READ 1 +#define CHP$M_WRITE 2 +#define CHP$M_USEREADALL 4 +#define CHP$V_READ 0 +#define CHP$V_WRITE 1 +#define CHP$V_USEREADALL 2 diff --git a/src/cmds.c b/src/cmds.c index 82a0675..ad38db4 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -41,41 +41,29 @@ Lisp_Object Vself_insert_face; /* 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 COUNT characters (left if COUNT is negative). +Move point right ARG characters (left if ARG negative). On attempt to pass end of buffer, stop and signal `end-of-buffer'. On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'. On reaching end of buffer, stop and signal error. - -The characters that are moved over may be added to the current selection -\(i.e. active region) if the Shift key is held down, a motion key is used -to invoke this command, and `shifted-motion-keys-select-region' is t; see -the documentation for this variable for more details. */ - (count, buffer)) + (arg, buffer)) { struct buffer *buf = decode_buffer (buffer, 1); - EMACS_INT n; - if (NILP (count)) - n = 1; + if (NILP (arg)) + arg = make_int (1); else - { - CHECK_INT (count); - n = XINT (count); - } + CHECK_INT (arg); - /* This used to just set point to point + XINT (count), and then check + /* This used to just set point to point + XINT (arg), and then check to see if it was within boundaries. But now that SET_PT can potentially do a lot of stuff (calling entering and exiting hooks, etcetera), that's not a good approach. So we validate the proposed position, then set point. */ { - Bufpos new_point = BUF_PT (buf) + n; + Bufpos new_point = BUF_PT (buf) + XINT (arg); if (new_point < BUF_BEGV (buf)) { @@ -97,59 +85,48 @@ the documentation for this variable for more details. } DEFUN ("backward-char", Fbackward_char, 0, 2, "_p", /* -Move point left COUNT characters (right if COUNT is negative). +Move point left ARG characters (right if ARG negative). On attempt to pass end of buffer, stop and signal `end-of-buffer'. On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'. - -The characters that are moved over may be added to the current selection -\(i.e. active region) if the Shift key is held down, a motion key is used -to invoke this command, and `shifted-motion-keys-select-region' is t; see -the documentation for this variable for more details. */ - (count, buffer)) + (arg, buffer)) { - if (NILP (count)) - count = make_int (-1); + if (NILP (arg)) + arg = make_int (1); else - { - CHECK_INT (count); - count = make_int (- XINT (count)); - } - return Fforward_char (count, buffer); + CHECK_INT (arg); + + XSETINT (arg, - XINT (arg)); + return Fforward_char (arg, buffer); } DEFUN ("forward-line", Fforward_line, 0, 2, "_p", /* -Move COUNT lines forward (backward if COUNT is negative). -Precisely, if point is on line I, move to the start of line I + COUNT. +Move ARG lines forward (backward if ARG is negative). +Precisely, if point is on line I, move to the start of line I + ARG. If there isn't room, go as far as possible (no error). Returns the count of lines left to move. If moving forward, -that is COUNT - number of lines moved; if backward, COUNT + number moved. -With positive COUNT, a non-empty line at the end counts as one line +that is ARG - number of lines moved; if backward, ARG + number moved. +With positive ARG, a non-empty line at the end counts as one line successfully moved (for the return value). If BUFFER is nil, the current buffer is assumed. - -The characters that are moved over may be added to the current selection -\(i.e. active region) if the Shift key is held down, a motion key is used -to invoke this command, and `shifted-motion-keys-select-region' is t; see -the documentation for this variable for more details. */ - (count, buffer)) + (arg, buffer)) { struct buffer *buf = decode_buffer (buffer, 1); Bufpos pos2 = BUF_PT (buf); Bufpos pos; - EMACS_INT n, shortage, negp; + EMACS_INT count, shortage, negp; - if (NILP (count)) - n = 1; + if (NILP (arg)) + count = 1; else { - CHECK_INT (count); - n = XINT (count); + CHECK_INT (arg); + count = XINT (arg); } - negp = n <= 0; - pos = scan_buffer (buf, '\n', pos2, 0, n - negp, &shortage, 1); + negp = count <= 0; + pos = scan_buffer (buf, '\n', pos2, 0, count - negp, &shortage, 1); if (shortage > 0 && (negp || (BUF_ZV (buf) > BUF_BEGV (buf) @@ -162,118 +139,96 @@ the documentation for this variable for more details. DEFUN ("point-at-bol", Fpoint_at_bol, 0, 2, 0, /* Return the character position of the first character on the current line. -With argument COUNT not nil or 1, move forward COUNT - 1 lines first. +With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. This function does not move point. */ - (count, buffer)) + (arg, buffer)) { struct buffer *b = decode_buffer (buffer, 1); REGISTER int orig, end; XSETBUFFER (buffer, b); - if (NILP (count)) - count = make_int (0); + if (NILP (arg)) + arg = make_int (1); else - { - CHECK_INT (count); - count = make_int (XINT (count) - 1); - } + CHECK_INT (arg); - orig = BUF_PT (b); - Fforward_line (count, buffer); - end = BUF_PT (b); - BUF_SET_PT (b, orig); + orig = BUF_PT(b); + Fforward_line (make_int (XINT (arg) - 1), buffer); + end = BUF_PT(b); + BUF_SET_PT(b, orig); return make_int (end); } DEFUN ("beginning-of-line", Fbeginning_of_line, 0, 2, "_p", /* Move point to beginning of current line. -With argument COUNT not nil or 1, move forward COUNT - 1 lines first. +With argument ARG not nil or 1, move forward ARG - 1 lines first. If scan reaches end of buffer, stop there without error. If BUFFER is nil, the current buffer is assumed. - -The characters that are moved over may be added to the current selection -\(i.e. active region) if the Shift key is held down, a motion key is used -to invoke this command, and `shifted-motion-keys-select-region' is t; see -the documentation for this variable for more details. */ - (count, buffer)) + (arg, buffer)) { struct buffer *b = decode_buffer (buffer, 1); - BUF_SET_PT (b, XINT (Fpoint_at_bol (count, buffer))); + BUF_SET_PT(b, XINT (Fpoint_at_bol(arg, buffer))); return Qnil; } DEFUN ("point-at-eol", Fpoint_at_eol, 0, 2, 0, /* Return the character position of the last character on the current line. -With argument COUNT not nil or 1, move forward COUNT - 1 lines first. +With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. This function does not move point. */ - (count, buffer)) + (arg, buffer)) { struct buffer *buf = decode_buffer (buffer, 1); - EMACS_INT n; - if (NILP (count)) - n = 1; + XSETBUFFER (buffer, buf); + + if (NILP (arg)) + arg = make_int (1); else - { - CHECK_INT (count); - n = XINT (count); - } + CHECK_INT (arg); return make_int (find_before_next_newline (buf, BUF_PT (buf), 0, - n - (n <= 0))); + XINT (arg) - (XINT (arg) <= 0))); } DEFUN ("end-of-line", Fend_of_line, 0, 2, "_p", /* Move point to end of current line. -With argument COUNT not nil or 1, move forward COUNT - 1 lines first. +With argument ARG not nil or 1, move forward ARG - 1 lines first. If scan reaches end of buffer, stop there without error. If BUFFER is nil, the current buffer is assumed. - -The characters that are moved over may be added to the current selection -\(i.e. active region) if the Shift key is held down, a motion key is used -to invoke this command, and `shifted-motion-keys-select-region' is t; see -the documentation for this variable for more details. */ - (count, buffer)) + (arg, buffer)) { struct buffer *b = decode_buffer (buffer, 1); - BUF_SET_PT (b, XINT (Fpoint_at_eol (count, buffer))); + BUF_SET_PT(b, XINT (Fpoint_at_eol (arg, buffer))); return Qnil; } -DEFUN ("delete-char", Fdelete_char, 0, 2, "*p\nP", /* -Delete the following COUNT characters (previous, with negative COUNT). -Optional second arg KILLP non-nil means kill instead (save in kill ring). -Interactively, COUNT is the prefix arg, and KILLP is set if -COUNT was explicitly specified. +DEFUN ("delete-char", Fdelete_char, 1, 2, "*p\nP", /* +Delete the following ARG characters (previous, with negative arg). +Optional second arg KILLFLAG non-nil means kill instead (save in kill ring). +Interactively, ARG is the prefix arg, and KILLFLAG is set if +ARG was explicitly specified. */ - (count, killp)) + (arg, killflag)) { /* This function can GC */ Bufpos pos; struct buffer *buf = current_buffer; - EMACS_INT n; - if (NILP (count)) - n = 1; - else - { - CHECK_INT (count); - n = XINT (count); - } + CHECK_INT (arg); - pos = BUF_PT (buf) + n; - if (NILP (killp)) + pos = BUF_PT (buf) + XINT (arg); + if (NILP (killflag)) { - if (n < 0) + if (XINT (arg) < 0) { if (pos < BUF_BEGV (buf)) signal_error (Qbeginning_of_buffer, Qnil); @@ -290,31 +245,22 @@ COUNT was explicitly specified. } else { - call1 (Qkill_forward_chars, count); + call1 (Qkill_forward_chars, arg); } return Qnil; } -DEFUN ("delete-backward-char", Fdelete_backward_char, 0, 2, "*p\nP", /* -Delete the previous COUNT characters (following, with negative COUNT). -Optional second arg KILLP non-nil means kill instead (save in kill ring). -Interactively, COUNT is the prefix arg, and KILLP is set if -COUNT was explicitly specified. +DEFUN ("delete-backward-char", Fdelete_backward_char, 1, 2, "*p\nP", /* +Delete the previous ARG characters (following, with negative ARG). +Optional second arg KILLFLAG non-nil means kill instead (save in kill ring). +Interactively, ARG is the prefix arg, and KILLFLAG is set if +ARG was explicitly specified. */ - (count, killp)) + (arg, killflag)) { /* This function can GC */ - EMACS_INT n; - - if (NILP (count)) - n = 1; - else - { - CHECK_INT (count); - n = XINT (count); - } - - return Fdelete_char (make_int (- n), killp); + CHECK_INT (arg); + return Fdelete_char (make_int (-XINT (arg)), killflag); } static void internal_self_insert (Emchar ch, int noautofill); @@ -322,17 +268,14 @@ static void internal_self_insert (Emchar ch, int noautofill); DEFUN ("self-insert-command", Fself_insert_command, 1, 1, "*p", /* Insert the character you type. Whichever character you type to run this command is inserted. -If a prefix arg COUNT is specified, the character is inserted COUNT times. */ - (count)) + (arg)) { /* This function can GC */ + int n; Emchar ch; Lisp_Object c; - EMACS_INT n; - - CHECK_NATNUM (count); - n = XINT (count); + CHECK_INT (arg); if (CHAR_OR_CHAR_INTP (Vlast_command_char)) c = Vlast_command_char; @@ -340,16 +283,36 @@ If a prefix arg COUNT is specified, the character is inserted COUNT times. c = Fevent_to_character (Vlast_command_event, Qnil, Qnil, Qt); if (NILP (c)) - signal_simple_error ("Last typed character has no ASCII equivalent", + signal_simple_error ("last typed character has no ASCII equivalent", Fcopy_event (Vlast_command_event, Qnil)); CHECK_CHAR_COERCE_INT (c); + n = XINT (arg); ch = XCHAR (c); - - while (n--) - internal_self_insert (ch, (n != 0)); - +#if 0 /* FSFmacs */ + /* #### This optimization won't work because of differences in + how the start-open and end-open properties default for text + properties. See internal_self_insert(). */ + if (n >= 2 && NILP (current_buffer->overwrite_mode)) + { + n -= 2; + /* The first one might want to expand an abbrev. */ + internal_self_insert (c, 1); + /* The bulk of the copies of this char can be inserted simply. + We don't have to handle a user-specified face specially + because it will get inherited from the first char inserted. */ + Finsert_char (make_char (c), make_int (n), Qt, Qnil); + /* The last one might want to auto-fill. */ + internal_self_insert (c, 0); + } + else +#endif /* 0 */ + while (n > 0) + { + n--; + internal_self_insert (ch, (n != 0)); + } return Qnil; } @@ -370,9 +333,8 @@ internal_self_insert (Emchar c1, int noautofill) 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; overwrite = buf->overwrite_mode; syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); @@ -392,9 +354,9 @@ internal_self_insert (Emchar c1, int noautofill) || (c1 != '\n' && BUF_FETCH_CHAR (buf, BUF_PT (buf)) != '\n')) && (EQ (overwrite, Qoverwrite_mode_binary) || BUF_FETCH_CHAR (buf, BUF_PT (buf)) != '\t' - || ((tab_width = XINT (buf->tab_width), tab_width <= 0) - || tab_width > 20 - || !((current_column (buf) + 1) % tab_width)))) + || XINT (buf->tab_width) <= 0 + || XINT (buf->tab_width) > 20 + || !((current_column (buf) + 1) % XINT (buf->tab_width)))) { buffer_delete_range (buf, BUF_PT (buf), BUF_PT (buf) + 1, 0); /* hairy = 2; */ @@ -439,9 +401,7 @@ internal_self_insert (Emchar c1, int noautofill) #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)) { @@ -487,13 +447,13 @@ internal_self_insert (Emchar c1, int noautofill) /* (this comes from Mule but is a generally good idea) */ DEFUN ("self-insert-internal", Fself_insert_internal, 1, 1, 0, /* -Invoke `self-insert-command' as if CHARACTER is entered from keyboard. +Invoke `self-insert-command' as if CH is entered from keyboard. */ - (character)) + (ch)) { /* This function can GC */ - CHECK_CHAR_COERCE_INT (character); - internal_self_insert (XCHAR (character), 0); + CHECK_CHAR_COERCE_INT (ch); + internal_self_insert (XCHAR (ch), 0); return Qnil; } @@ -543,12 +503,4 @@ Function called, if non-nil, whenever a close parenthesis is inserted. 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 have 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 --git a/src/config.h.in b/src/config.h.in index 50a3c11..d8508cc 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -1,5 +1,5 @@ /* XEmacs site configuration template file. -*- C -*- - Copyright (C) 1986, 1991-1994, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1986, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. This file is part of XEmacs. @@ -26,38 +26,27 @@ Boston, MA 02111-1307, USA. */ #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 #ifndef NOT_C_CODE -#if defined (__CYGWIN__) -/* We get complaints about redefinitions if we just use the __GNUC__ - definition: stdlib.h also includes alloca.h, which defines it slightly - differently */ -#include <alloca.h> -#elif defined (__GNUC__) +#ifdef __GNUC__ #define alloca __builtin_alloca -#elif defined __DECC -#include <alloca.h> -#pragma intrinsic(alloca) -#elif defined HAVE_ALLOCA_H +#elif HAVE_ALLOCA_H #include <alloca.h> #elif defined(_AIX) #pragma alloca #elif ! defined (alloca) -void *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 @@ -72,7 +61,6 @@ void *alloca (); /* 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 @@ -81,33 +69,18 @@ void *alloca (); #undef INFODOCK_MINOR_VERSION #undef INFODOCK_BUILD_VERSION -/* Make functions from IEEE Stds 1003.[123] available. */ -#undef _POSIX_C_SOURCE - -/* Make some functions from Unix98 available. */ -#undef _XOPEN_SOURCE - -/* Make "extensions" from Unix98 available. */ -#undef _XOPEN_SOURCE_EXTENDED - /* Make all functions available on AIX. See AC_AIX. */ #undef _ALL_SOURCE /* Make all functions available on GNU libc systems. See features.h. */ #undef _GNU_SOURCE -/* Make all functions available on Solaris 2 systems. */ -#undef __EXTENSIONS__ - /* Used to identify the XEmacs version in stack traces. */ #undef STACK_TRACE_EYE_CATCHER /* Allow the configurer to specify if she wants site-lisp. */ #undef INHIBIT_SITE_LISP -/* Allow the configurer to specify if she wants site-modules. */ -#undef INHIBIT_SITE_MODULES - /* This will be removed in 19.15. */ /* Hah! Try 20.3 ... */ /* Hah! Try never ... */ @@ -170,16 +143,8 @@ void *alloca (); #endif #endif /* HAVE_X_WINDOWS */ -/* Defines for building Gtk applications */ -#undef HAVE_GNOME -#undef HAVE_GTK -#undef HAVE_GDK_IMLIB_INIT -#undef HAVE_GLADE_GLADE_H -#undef HAVE_GLADE_H -#undef LIBGLADE_XML_TXTDOMAIN - /* Define HAVE_WINDOW_SYSTEM if any windowing system is available. */ -#if defined (HAVE_GTK) || defined (HAVE_X_WINDOWS) || defined(HAVE_MS_WINDOWS) /* || defined (HAVE_NEXTSTEP) */ +#if defined (HAVE_X_WINDOWS) || defined(HAVE_MS_WINDOWS) /* || defined (HAVE_NEXTSTEP) */ #define HAVE_WINDOW_SYSTEM #endif @@ -188,18 +153,13 @@ void *alloca (); #define HAVE_UNIXOID_EVENT_LOOP #endif -/* XFree86 has a different prototype for this function */ -#undef HAVE_XREGISTERIMINSTANTIATECALLBACK -#undef XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE +/* Are we using XFree386? */ +#undef HAVE_XFREE386 #undef THIS_IS_X11R4 #undef THIS_IS_X11R5 #undef THIS_IS_X11R6 -#undef HAVE_XCONVERTCASE - -#undef HAVE_BALLOON_HELP - /* Where do we find bitmaps? */ #undef BITMAPDIR @@ -220,29 +180,29 @@ void *alloca (); /* 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_ELF_H -#undef HAVE_CYGWIN_VERSION_H -#undef HAVE_FCNTL_H -#undef HAVE_INTTYPES_H -#undef HAVE_LIBGEN_H -#undef HAVE_LOCALE_H #undef HAVE_MACH_MACH_H -#undef HAVE_SYS_PARAM_H -#undef HAVE_SYS_PSTAT_H -#undef HAVE_SYS_TIME_H +#undef HAVE_SYS_STROPTS_H #undef HAVE_SYS_TIMEB_H -#undef HAVE_SYS_UN_H -#undef HAVE_ULIMIT_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_FCNTL_H +#undef HAVE_ULIMIT_H #undef HAVE_X11_XLOCALE_H +#undef HAVE_LINUX_VERSION_H +#undef HAVE_INTTYPES_H +#undef HAVE_SYS_UN_H +#undef HAVE_A_OUT_H #undef STDC_HEADERS #undef TIME_WITH_SYS_TIME #undef WORDS_BIGENDIAN #undef HAVE_VFORK_H +#undef HAVE_KSTAT_H +#undef HAVE_SYS_PSTAT_H #undef vfork #undef HAVE_LONG_FILE_NAMES @@ -253,11 +213,11 @@ void *alloca (); /* Have shared library support */ #undef HAVE_DLOPEN #undef HAVE_DLERROR -#undef HAVE__DLERROR #undef HAVE_SHL_LOAD #undef HAVE_DLD_INIT #undef HAVE_SHLIB +#undef HAVE_LIBKSTAT #undef HAVE_LIBINTL #undef HAVE_LIBDNET #undef HAVE_LIBRESOLV @@ -265,6 +225,9 @@ void *alloca (); /* Is `sys_siglist' declared by <signal.h>? */ #undef SYS_SIGLIST_DECLARED +/* Is `struct utimbuf' declared by <utime.h>? */ +#undef HAVE_STRUCT_UTIMBUF + /* Is `struct timeval' declared by <sys/time.h>? */ #undef HAVE_TIMEVAL @@ -273,13 +236,6 @@ void *alloca (); #undef HAVE_TM_ZONE #undef HAVE_TZNAME -/* For `getloadavg' provided by system */ -#undef HAVE_GETLOADAVG -#undef HAVE_SYS_LOADAVG_H -/* For implementing `getloadavg' ourselves */ -#undef HAVE_LIBKSTAT -#undef HAVE_KSTAT_H - /* Is `h_errno' declared by <netdb.h>? */ #undef HAVE_H_ERRNO @@ -304,9 +260,7 @@ void *alloca (); #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 @@ -333,41 +287,18 @@ void *alloca (); #undef HAVE_SIGPROCMASK #undef HAVE_SIGSETJMP #undef HAVE_SNPRINTF -#undef HAVE_STPCPY +#undef HAVE_STRCASECMP #undef HAVE_STRERROR #undef HAVE_TZSET #undef HAVE_ULIMIT #undef HAVE_USLEEP -#undef HAVE_UTIME #undef HAVE_UTIMES #undef HAVE_WAITPID #undef HAVE_VSNPRINTF - -/* PTY support functions */ -#undef HAVE_GETPT /* glibc's easy pty allocation function */ -#undef HAVE__GETPTY /* SGI's easy pty allocation function */ -#undef HAVE_OPENPTY /* BSD's easy pty allocation function */ -#undef HAVE_GRANTPT /* Unix98 */ -#undef HAVE_UNLOCKPT /* Unix98 */ -#undef HAVE_PTSNAME /* Unix98 */ -#undef HAVE_KILLPG /* BSD */ -#undef HAVE_TCGETPGRP /* Posix 1 */ -#undef HAVE_ISASTREAM /* SysV streams */ -#undef HAVE_PTY_H /* Linux, Tru64 openpty */ -#undef HAVE_LIBUTIL_H /* BSD openpty */ -#undef HAVE_UTIL_H /* NetBSD openpty */ -#undef HAVE_STROPTS_H /* SysV streams */ -#undef HAVE_STRTIO_H /* SysV streams TIOCSIGNAL */ - #undef HAVE_SOCKETS #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 @@ -379,9 +310,6 @@ void *alloca (); #undef NLIST_STRUCT -/* Do IPv6 hostname canonicalization before IPv4 in getaddrinfo()? */ -#undef IPV6_CANONICALIZE - /* Compile in support for SOCKS? */ #undef HAVE_SOCKS @@ -415,26 +343,17 @@ void *alloca (); /* 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. */ @@ -446,8 +365,8 @@ void *alloca (); /* 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 @@ -463,45 +382,18 @@ void *alloca (); /* 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 @@ -510,19 +402,11 @@ void *alloca (); determine where XEmacs' memory is going. */ #undef MEMORY_USAGE_STATS -/* Define QUANTIFY if using Quantify from Rational Software. +/* Define QUANTIFY if using Quantify from Pure/Atria Software. This adds some additional calls to control data collection. It is only intended for use by the developers. */ #undef QUANTIFY -/* Define PURIFY if using Purify from Rational Software. - It is only intended for use by the developers. */ -#undef PURIFY - -#if (defined (QUANTIFY) || defined (PURIFY)) && !defined (XLIB_ILLEGAL_ACCESS) -#define XLIB_ILLEGAL_ACCESS 1 -#endif - /* Define EXTERNAL_WIDGET to compile support for using the editor as a widget within another program. */ #undef EXTERNAL_WIDGET @@ -531,6 +415,11 @@ void *alloca (); #undef USE_GCC #undef USE_LCC +/* Allow the user to override the default value of PURESIZE at configure + time. This must come before we include the sys files in order for + it to be able to override any changes in them. */ +#undef RAW_PURESIZE + /* Define this if you want level 2 internationalization compliance (localized collation and formatting). Generally this should be defined, unless your system doesn't have the strcoll() and @@ -555,8 +444,8 @@ void *alloca (); /* 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 @@ -581,56 +470,55 @@ void *alloca (); /* 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 definitions isn't right with 64-bit systems. */ #undef USE_UNION_TYPE -/* The configuration script may define `opsysfile' to be the name of - the s/...h file that describes your operating system. - The file name is chosen based on the configuration name. */ +/* If defined, use a minimal number of tagbits. This allows usage of more + advanced versions of malloc (like the Doug Lea new GNU malloc) and larger + integers. */ +/* --use-minimal-tagbits */ +#undef USE_MINIMAL_TAGBITS + +/* --use-indexed-lrecord-implementation */ +#undef USE_INDEXED_LRECORD_IMPLEMENTATION + +/* The configuration script defines opsysfile to be the name of the + s/...h file that describes the system type you are using. + The file is chosen based on the configuration name you give. + + See the file ../etc/MACHINES for a list of systems and the + configuration names to use for them. + + See s/template.h for documentation on writing s/...h files. */ #if defined (__cplusplus) && !defined (NOT_C_CODE) extern "C" { #endif - #undef config_opsysfile -#ifdef config_opsysfile #include config_opsysfile -#endif -/* The configuration script may define `machfile' to be the name of - the m/...h file that describes the machine you are using. - The file name is chosen based on the configuration name. */ +/* The configuration script defines machfile to be the name of the + m/...h file that describes the machine you are using. The file is + chosen based on the configuration name you give. + + See the file ../etc/MACHINES for a list of machines and the + configuration names to use for them. + See m/template.h for documentation on writing m/...h files. */ #undef config_machfile -#ifdef config_machfile #include config_machfile -#endif - #if defined (__cplusplus) && !defined (NOT_C_CODE) } #endif @@ -652,6 +540,14 @@ extern "C" { #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 @@ -665,7 +561,7 @@ extern "C" { "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 @@ -673,16 +569,13 @@ extern "C" { #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 @@ -696,17 +589,12 @@ extern "C" { #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) @@ -725,7 +613,7 @@ extern "C" { Also, SunOS 4.1.1 contains buggy versions of strcmp and strcpy that sometimes reference memory past the end of the string, which can segv. - I don't know whether this has been fixed as of 4.1.2 or 4.1.3. */ + I don't know whether this is has been fixed as of 4.1.2 or 4.1.3. */ #if defined (sparc) && !defined (USG) #define OBJECTS_SYSTEM sunOS-fix.o strcmp.o strcpy.o #endif @@ -733,7 +621,7 @@ extern "C" { /* If you turn this flag on, it forces encapsulation in all circumstances; this can be used to make sure things compile OK on various systems. */ -#undef DEBUG_ENCAPSULATION +#define DEBUG_ENCAPSULATION /* basic system calls */ @@ -800,6 +688,10 @@ on various systems. */ # 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 @@ -823,34 +715,38 @@ on various systems. */ #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 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. @@ -882,25 +778,25 @@ on various systems. */ /* 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 - -#undef PREFIX_USER_DEFINED -#undef EXEC_PREFIX_USER_DEFINED -#undef MODULEDIR_USER_DEFINED -#undef SITEMODULEDIR_USER_DEFINED -#undef DOCDIR_USER_DEFINED +/* 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 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 --git a/src/console-stream.c b/src/console-stream.c index a02f7f4..393d19d 100644 --- a/src/console-stream.c +++ b/src/console-stream.c @@ -46,35 +46,41 @@ Lisp_Object Vterminal_frame; Lisp_Object Vstdio_str; static void +allocate_stream_console_struct (struct console *con) +{ + if (!CONSOLE_STREAM_DATA (con)) + CONSOLE_STREAM_DATA (con) = xnew_and_zero (struct stream_console); + else + xzero (*CONSOLE_STREAM_DATA (con)); +} + +static void stream_init_console (struct console *con, Lisp_Object params) { Lisp_Object tty = CONSOLE_CONNECTION (con); - struct stream_console *stream_con; - - if (CONSOLE_STREAM_DATA (con) == NULL) - CONSOLE_STREAM_DATA (con) = xnew (struct stream_console); - - stream_con = CONSOLE_STREAM_DATA (con); - - stream_con->needs_newline = 0; + FILE *infd, *outfd, *errfd; /* Open the specified console */ + if (NILP (tty) || internal_equal (tty, Vstdio_str, 0)) { - stream_con->in = stdin; - stream_con->out = stdout; - stream_con->err = stderr; + infd = stdin; + outfd = stdout; + errfd = stderr; } else { 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); - if (!stream_con->in) + infd = outfd = errfd = + fopen ((char *) XSTRING_DATA (tty), "r+"); + if (!infd) error ("Unable to open tty %s", XSTRING_DATA (tty)); } + + allocate_stream_console_struct (con); + CONSOLE_STREAM_DATA (con)->infd = infd; + CONSOLE_STREAM_DATA (con)->outfd = outfd; + CONSOLE_STREAM_DATA (con)->errfd = errfd; } static void @@ -82,8 +88,8 @@ stream_init_device (struct device *d, Lisp_Object params) { struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); - DEVICE_INFD (d) = fileno (CONSOLE_STREAM_DATA (con)->in); - DEVICE_OUTFD (d) = fileno (CONSOLE_STREAM_DATA (con)->out); + DEVICE_INFD (d) = fileno (CONSOLE_STREAM_DATA (con)->infd); + DEVICE_OUTFD (d) = fileno (CONSOLE_STREAM_DATA (con)->outfd); init_baud_rate (d); init_one_device (d); } @@ -94,26 +100,30 @@ stream_initially_selected_for_input (struct console *con) return noninteractive && initialized; } +static void +free_stream_console_struct (struct console *con) +{ + if (CONSOLE_STREAM_DATA (con)) + { + xfree (CONSOLE_STREAM_DATA (con)); + CONSOLE_STREAM_DATA (con) = NULL; + } +} + extern int stdout_needs_newline; static void stream_delete_console (struct console *con) { - struct stream_console *stream_con = CONSOLE_STREAM_DATA (con); - if (stream_con) + if (/* CONSOLE_STREAM_DATA (con)->needs_newline */ + stdout_needs_newline) /* #### clean this up */ { - if (/* stream_con->needs_newline */ - stdout_needs_newline) /* #### clean this up */ - { - fputc ('\n', stream_con->out); - fflush (stream_con->out); - } - if (stream_con->in != stdin) - fclose (stream_con->in); - - xfree (stream_con); - CONSOLE_STREAM_DATA (con) = NULL; + fputc ('\n', CONSOLE_STREAM_DATA (con)->outfd); + fflush (CONSOLE_STREAM_DATA (con)->outfd); } + if (CONSOLE_STREAM_DATA (con)->infd != stdin) + fclose (CONSOLE_STREAM_DATA (con)->infd); + free_stream_console_struct (con); } Lisp_Object @@ -173,7 +183,7 @@ stream_init_frame_1 (struct frame *f, Lisp_Object props) 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 +213,16 @@ stream_eol_cursor_width (void) } 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,10 +231,23 @@ stream_output_display_block (struct window *w, struct display_line *dl, } 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, - Lisp_Object background_pixmap) +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 locale, face_index findex, int x, int y, + int width, int height) +{ +} + +static void +stream_clear_frame (struct frame *f) { } @@ -228,8 +261,8 @@ static void stream_ring_bell (struct device *d, int volume, int pitch, int duration) { struct console *c = XCONSOLE (DEVICE_CONSOLE (d)); - fputc (07, CONSOLE_STREAM_DATA (c)->out); - fflush (CONSOLE_STREAM_DATA (c)->out); + fputc (07, CONSOLE_STREAM_DATA (c)->outfd); + fflush (CONSOLE_STREAM_DATA (c)->outfd); } @@ -262,34 +295,33 @@ console_type_create_stream (void) 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 /* -The initial console object, which represents XEmacs' stdout. +The initial console-object, which represents XEmacs' stdout. */ ); Vterminal_console = Qnil; DEFVAR_LISP ("terminal-device", &Vterminal_device /* -The initial device object, which represents XEmacs' stdout. +The initial device-object, which represents XEmacs' stdout. */ ); Vterminal_device = Qnil; DEFVAR_LISP ("terminal-frame", &Vterminal_frame /* -The initial frame object, which represents XEmacs' stdout. +The initial frame-object, which represents XEmacs' stdout. */ ); Vterminal_frame = Qnil; @@ -298,9 +330,8 @@ The initial frame object, which represents XEmacs' stdout. staticpro (&Vstdio_str); } -#ifndef PDUMP void -init_console_stream (int reinit) +init_console_stream (void) { /* This function can GC */ if (!initialized) @@ -318,25 +349,3 @@ init_console_stream (int reinit) 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 --git a/src/console-x.h b/src/console-x.h index 31252dd..91f91db 100644 --- a/src/console-x.h +++ b/src/console-x.h @@ -29,8 +29,8 @@ Boston, MA 02111-1307, USA. */ 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 @@ -40,6 +40,17 @@ Boston, MA 02111-1307, USA. */ #include <X11/cursorfont.h> #include <X11/keysym.h> #include <X11/Xatom.h> + +#if 0 /* mrb - Xos sux. */ +#ifdef USG +#undef USG /* ####KLUDGE for Solaris 2.2 and up */ +#include <X11/Xos.h> +#define USG +#else +#include <X11/Xos.h> +#endif +#endif /* 0 */ + #include <X11/StringDefs.h> #ifdef HAVE_XPM @@ -59,13 +70,10 @@ struct x_device /* The X connection of this device. */ Display *display; - /* Set by x_IO_error_handler(). */ - int being_deleted; - /* Xt application info. */ Widget Xt_app_shell; - /* Cache of GC's for frames on this device. */ + /* Cache of GC's for frame's on this device. */ struct gc_cache *gc_cache; /* Selected visual, depth and colormap for this device */ @@ -77,14 +85,14 @@ struct x_device Pixmap gray_pixmap; /* Atoms associated with this device. */ - /* allocated in Xatoms_of_device_x */ + /* allocated in Xatoms_of_xfns in xfns.c */ Atom Xatom_WM_PROTOCOLS; Atom Xatom_WM_DELETE_WINDOW; Atom Xatom_WM_SAVE_YOURSELF; Atom Xatom_WM_TAKE_FOCUS; Atom Xatom_WM_STATE; - /* allocated in Xatoms_of_select_x */ + /* allocated in Xatoms_of_xselect in xselect.c */ Atom Xatom_CLIPBOARD; Atom Xatom_TIMESTAMP; Atom Xatom_TEXT; @@ -97,7 +105,7 @@ struct x_device Atom Xatom_ATOM_PAIR; Atom Xatom_COMPOUND_TEXT; - /* allocated in Xatoms_of_objects_x */ + /* allocated in Xatoms_of_objects_x in objects-x.c */ Atom Xatom_FOUNDRY; Atom Xatom_FAMILY_NAME; Atom Xatom_WEIGHT_NAME; @@ -123,7 +131,7 @@ struct x_device int x_keysym_map_min_code; int x_keysym_map_max_code; int x_keysym_map_keysyms_per_code; - Lisp_Object x_keysym_map_hash_table; + Lisp_Object x_keysym_map_hashtable; /* frame that holds the WM_COMMAND property; there should be exactly one of these per device. */ @@ -170,14 +178,12 @@ struct x_device unsigned int need_to_add_mask, down_mask; KeyCode last_downkey; Time release_time; - Time modifier_release_time; }; #define DEVICE_X_DATA(d) DEVICE_TYPE_DATA (d, x) #define FRAME_X_DISPLAY(f) (DEVICE_X_DISPLAY (XDEVICE (f->device))) #define DEVICE_X_DISPLAY(d) (DEVICE_X_DATA (d)->display) -#define DEVICE_X_BEING_DELETED(d) (DEVICE_X_DATA (d)->being_deleted) #define DEVICE_X_VISUAL(d) (DEVICE_X_DATA (d)->visual) #define DEVICE_X_DEPTH(d) (DEVICE_X_DATA (d)->depth) #define DEVICE_X_COLORMAP(d) (DEVICE_X_DATA (d)->device_cmap) @@ -188,7 +194,7 @@ struct x_device #define DEVICE_X_MOUSE_TIMESTAMP(d) (DEVICE_X_DATA (d)->mouse_timestamp) #define DEVICE_X_GLOBAL_MOUSE_TIMESTAMP(d) (DEVICE_X_DATA (d)->global_mouse_timestamp) #define DEVICE_X_LAST_SERVER_TIMESTAMP(d) (DEVICE_X_DATA (d)->last_server_timestamp) -#define DEVICE_X_KEYSYM_MAP_HASH_TABLE(d) (DEVICE_X_DATA (d)->x_keysym_map_hash_table) +#define DEVICE_X_KEYSYM_MAP_HASHTABLE(d) (DEVICE_X_DATA (d)->x_keysym_map_hashtable) /* #define DEVICE_X_X_COMPOSE_STATUS(d) (DEVICE_X_DATA (d)->x_compose_status) */ #ifdef HAVE_XIM #define DEVICE_X_XIM(d) (DEVICE_X_DATA (d)->xim) @@ -196,14 +202,14 @@ struct x_device #define DEVICE_X_FONTSET(d) (DEVICE_X_DATA (d)->fontset) #endif /* HAVE_XIM */ -/* allocated in Xatoms_of_device_x */ +/* allocated in Xatoms_of_xfns in xfns.c */ #define DEVICE_XATOM_WM_PROTOCOLS(d) (DEVICE_X_DATA (d)->Xatom_WM_PROTOCOLS) #define DEVICE_XATOM_WM_DELETE_WINDOW(d) (DEVICE_X_DATA (d)->Xatom_WM_DELETE_WINDOW) #define DEVICE_XATOM_WM_SAVE_YOURSELF(d) (DEVICE_X_DATA (d)->Xatom_WM_SAVE_YOURSELF) #define DEVICE_XATOM_WM_TAKE_FOCUS(d) (DEVICE_X_DATA (d)->Xatom_WM_TAKE_FOCUS) #define DEVICE_XATOM_WM_STATE(d) (DEVICE_X_DATA (d)->Xatom_WM_STATE) -/* allocated in Xatoms_of_select_x */ +/* 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) @@ -216,7 +222,7 @@ struct x_device #define DEVICE_XATOM_ATOM_PAIR(d) (DEVICE_X_DATA (d)->Xatom_ATOM_PAIR) #define DEVICE_XATOM_COMPOUND_TEXT(d) (DEVICE_X_DATA (d)->Xatom_COMPOUND_TEXT) -/* allocated in Xatoms_of_objects_x */ +/* allocated in Xatoms_of_objects_x in objects-x.c */ #define DEVICE_XATOM_FOUNDRY(d) (DEVICE_X_DATA (d)->Xatom_FOUNDRY) #define DEVICE_XATOM_FAMILY_NAME(d) (DEVICE_X_DATA (d)->Xatom_FAMILY_NAME) #define DEVICE_XATOM_WEIGHT_NAME(d) (DEVICE_X_DATA (d)->Xatom_WEIGHT_NAME) @@ -371,9 +377,9 @@ extern struct console_type *x_console_type; 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 Fixnum x_selection_timeout; +extern int x_selection_timeout; struct frame *x_any_window_to_frame (struct device *d, Window); struct frame *x_any_widget_or_parent_to_frame (struct device *d, @@ -388,14 +394,14 @@ void x_handle_selection_request (XSelectionRequestEvent *event); 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); @@ -409,15 +415,16 @@ void x_output_string (struct window *w, struct display_line *dl, 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, @@ -428,10 +435,10 @@ int x_initialize_frame_menubar (struct frame *f); 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); @@ -481,23 +488,5 @@ extern int in_specifier_change_function; extern Lisp_Object Vx_initial_argv_list; /* #### ugh! */ -/* Standins for various X encodings, until we know them better */ - -/* !!#### Need to verify the encoding used in lwlib -- Qnative or Qctext? - Almost certainly the former. Use a standin for now. */ -#define Qlwlib_encoding Qnative - -#define Qx_atom_name_encoding Qctext -/* font names are often stored in atoms, so it gets sticky if we set this - to something different from atom-name encoding */ -#define Qx_font_name_encoding Qctext - -#define Qx_color_name_encoding Qctext - -/* the following probably must agree with Qcommand_argument_encoding and - Qenvironment_variable_encoding */ -#define Qx_display_name_encoding Qnative - #endif /* HAVE_X_WINDOWS */ - -#endif /* INCLUDED_console_x_h_ */ +#endif /* _XEMACS_DEVICE_X_H_ */ diff --git a/src/console.h b/src/console.h index 9d9d65c..2ba1b15 100644 --- a/src/console.h +++ b/src/console.h @@ -22,8 +22,8 @@ Boston, MA 02111-1307, USA. */ /* 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 @@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA. */ always tagged to a particular X window (i.e. frame), which exists on only one screen; therefore the event won't be reported multiple times even if there are multiple devices on - the same physical display. This is an implementation detail + the same physical display. This is an implementational detail specific to X consoles (e.g. under NeXTstep or Windows, this could be different, and input would come directly from the console). */ @@ -55,46 +55,20 @@ enum device_metrics 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; - - -/* - * 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 - -/* Do not preempt resiaply of frame or device once it starts */ -#define XDEVIMPF_DONT_PREEMPT_REDISPLAY 0x00000010L - 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; - unsigned int flags; /* Read-only implementation flags, set once upon - console type creation. INITIALIZE_CONSOLE_TYPE sets - this member to 0. */ /* 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) @@ -112,24 +86,10 @@ struct console_methods 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 (*own_selection_method)(Lisp_Object selection_name, - Lisp_Object selection_value, - Lisp_Object how_to_add, - Lisp_Object selection_type, - int owned_p); - 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); + Lisp_Object (*device_system_metrics_method) (struct device *, enum device_metrics); + unsigned int (*device_implementation_flags_method) (); /* frame methods */ Lisp_Object *device_specific_frame_props; @@ -138,13 +98,11 @@ struct console_methods 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 *); void (*lower_frame_method) (struct frame *); - void (*enable_frame_method) (struct frame *); - void (*disable_frame_method) (struct frame *); int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame, int *x, int *y); void (*set_mouse_position_method) (struct window *w, int x, int y); @@ -169,74 +127,62 @@ struct console_methods 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); int (*eol_cursor_width_method) (void); void (*output_vertical_divider_method) (struct window *, int); void (*clear_to_window_end_method) (struct window *, int, int); - void (*clear_region_method) (Lisp_Object, struct device*, struct frame*, face_index, - int, int, int, int, - Lisp_Object, Lisp_Object, Lisp_Object); + void (*clear_region_method) (Lisp_Object, face_index, int, int, int, int); 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, @@ -244,49 +190,53 @@ struct console_methods 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 (*redisplay_subwindow_method) (Lisp_Image_Instance *); - void (*redisplay_widget_method) (Lisp_Image_Instance *); - /* Maybe this should be a specifier. Unfortunately specifiers don't - allow us to represent things at the toolkit level, which is what - is required here. */ - int (*widget_border_width_method) (void); - int (*widget_spacing_method) (Lisp_Image_Instance *); - int (*image_instance_equal_method) (Lisp_Image_Instance *, - Lisp_Image_Instance *, + void (*finalize_image_instance_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, + unsigned char *eimage, int dest_mask, Lisp_Object instantiator, Lisp_Object domain); Lisp_Object (*locate_pixmap_file_method) (Lisp_Object file_method); int (*colorize_image_instance_method) (Lisp_Object image_instance, Lisp_Object fg, Lisp_Object bg); +#ifdef HAVE_XPM + /* which is more tacky - this or #defines in glyphs.c? */ + void (*xpm_instantiate_method)(Lisp_Object image_instance, + Lisp_Object instantiator, + Lisp_Object pointer_fg, + Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain); +#endif +#ifdef HAVE_WINDOW_SYSTEM + /* which is more tacky - this or #defines in glyphs.c? */ + void (*xbm_instantiate_method)(Lisp_Object image_instance, + Lisp_Object instantiator, + Lisp_Object pointer_fg, + Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain); +#endif Lisp_Object image_conversion_list; #ifdef HAVE_TOOLBARS /* toolbar methods */ void (*output_frame_toolbars_method) (struct frame *); - void (*clear_frame_toolbars_method) (struct frame *); void (*initialize_frame_toolbars_method) (struct frame *); void (*free_frame_toolbars_method) (struct frame *); void (*output_toolbar_button_method) (struct frame *, Lisp_Object); @@ -325,18 +275,20 @@ struct console_methods #ifdef HAVE_DIALOGS /* dialog methods */ - Lisp_Object (*make_dialog_box_internal_method) (struct frame *, - Lisp_Object type, - Lisp_Object keys); + void (*popup_dialog_box_method) (struct frame *, Lisp_Object dbox_desc); #endif }; -#define CONMETH_TYPE(meths) ((meths)->symbol) -#define CONMETH_IMPL_FLAG(meths, f) ((meths)->flags & (f)) +/* + * Constants returned by device_implementation_flags_method + */ +/* Set when device uses pixel-based geometry */ +#define XDEVIMPF_PIXEL_GEOMETRY 0x00000001L + #define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name) #define CONSOLE_TYPE(c) ((c)->conmeths->symbol) -#define CONSOLE_IMPL_FLAG(c, f) CONMETH_IMPL_FLAG ((c)->conmeths, (f)) +#define CONMETH_TYPE(meths) ((meths)->symbol) /******** Accessing / calling a console method *********/ @@ -345,9 +297,9 @@ struct console_methods /* Call a void-returning console method, if it exists */ #define MAYBE_CONTYPE_METH(meth, m, args) do { \ - struct console_methods *maybe_contype_meth_meth = (meth); \ - if (HAS_CONTYPE_METH_P (maybe_contype_meth_meth, m)) \ - CONTYPE_METH (maybe_contype_meth_meth, m, args); \ + struct console_methods *_maybe_contype_meth_meth = (meth); \ + if (HAS_CONTYPE_METH_P (_maybe_contype_meth_meth, m)) \ + CONTYPE_METH (_maybe_contype_meth_meth, m, args); \ } while (0) /* Call a console method, if it exists; otherwise return @@ -398,33 +350,17 @@ struct console_methods * type##_console_methods 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); \ - dump_add_root_struct_ptr (&type##_console_methods, &console_methods_description); \ -} while (0) - -#define REINITIALIZE_CONSOLE_TYPE(type) do { \ - staticpro_nodump (&type##_console_methods->predicate_symbol); \ - staticpro_nodump (&type##_console_methods->image_conversion_list); \ + staticpro (&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) - -/* Define console type implementation flags */ -#define CONSOLE_IMPLEMENTATION_FLAGS(type, flg) \ - (type##_console_methods->flags = flg) - struct console { struct lcrecord_header header; @@ -470,6 +406,7 @@ DECLARE_LRECORD (console, struct console); #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) @@ -487,9 +424,9 @@ DECLARE_LRECORD (console, struct console); #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)); @@ -521,12 +458,6 @@ error_check_console_type (struct console *con, Lisp_Object sym) too many places where the abstraction is broken. Need to fix. */ -#ifdef HAVE_GTK -#define CONSOLE_TYPESYM_GTK_P(typesym) EQ (typesym, Qgtk) -#else -#define CONSOLE_TYPESYM_GTK_P(typesym) 0 -#endif - #ifdef HAVE_X_WINDOWS #define CONSOLE_TYPESYM_X_P(typesym) EQ (typesym, Qx) #else @@ -545,16 +476,12 @@ error_check_console_type (struct console *con, Lisp_Object sym) #define CONSOLE_TYPESYM_STREAM_P(typesym) EQ (typesym, Qstream) #define CONSOLE_TYPESYM_WIN_P(typesym) \ - (CONSOLE_TYPESYM_GTK_P (typesym) || CONSOLE_TYPESYM_X_P (typesym) || CONSOLE_TYPESYM_MSWINDOWS_P (typesym)) + (CONSOLE_TYPESYM_X_P (typesym) || CONSOLE_TYPESYM_MSWINDOWS_P (typesym)) #define CONSOLE_X_P(con) CONSOLE_TYPESYM_X_P (CONSOLE_TYPE (con)) #define CHECK_X_CONSOLE(z) CHECK_CONSOLE_TYPE (z, x) #define CONCHECK_X_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, x) -#define CONSOLE_GTK_P(con) CONSOLE_TYPESYM_GTK_P (CONSOLE_TYPE (con)) -#define CHECK_GTK_CONSOLE(z) CHECK_CONSOLE_TYPE (z, gtk) -#define CONCHECK_GTK_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, gtk) - #define CONSOLE_TTY_P(con) CONSOLE_TYPESYM_TTY_P (CONSOLE_TYPE (con)) #define CHECK_TTY_CONSOLE(z) CHECK_CONSOLE_TYPE (z, tty) #define CONCHECK_TTY_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, tty) @@ -604,7 +531,7 @@ int valid_console_type_p (Lisp_Object type); #define CONSOLE_SELECTED_DEVICE(con) ((con)->selected_device) #define CONSOLE_SELECTED_FRAME(con) \ DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device)) -#define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->last_nonminibuf_frame) +#define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->_last_nonminibuf_frame) #define CONSOLE_QUIT_CHAR(con) ((con)->quit_char) #define CDFW_CONSOLE(obj) \ @@ -636,4 +563,4 @@ void io_error_delete_console (Lisp_Object console); void set_console_last_nonminibuf_frame (struct console *con, Lisp_Object frame); -#endif /* INCLUDED_console_h_ */ +#endif /* _XEMACS_CONSOLE_H_ */ diff --git a/src/data.c b/src/data.c index b90b3ca..c0f2c54 100644 --- a/src/data.c +++ b/src/data.c @@ -1,7 +1,6 @@ /* Primitive operations on Lisp data types for XEmacs Lisp interpreter. Copyright (C) 1985, 1986, 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - Copyright (C) 2000 Ben Wing. This file is part of XEmacs. @@ -40,53 +39,53 @@ Boston, MA 02111-1307, USA. */ Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; Lisp_Object Qerror_conditions, Qerror_message; -Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax; -Lisp_Object Qlist_formation_error; -Lisp_Object Qmalformed_list, Qmalformed_property_list; -Lisp_Object Qcircular_list, Qcircular_property_list; -Lisp_Object Qinvalid_argument, Qwrong_type_argument, Qargs_out_of_range; -Lisp_Object Qwrong_number_of_arguments, Qinvalid_function, Qno_catch; -Lisp_Object Qinternal_error, Qinvalid_state; +Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range; Lisp_Object Qvoid_variable, Qcyclic_variable_indirection; Lisp_Object Qvoid_function, Qcyclic_function_indirection; -Lisp_Object Qinvalid_operation, Qinvalid_change; -Lisp_Object Qsetting_constant; -Lisp_Object Qediting_error; -Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; +Lisp_Object Qsetting_constant, Qinvalid_read_syntax; +Lisp_Object Qmalformed_list, Qmalformed_property_list; +Lisp_Object Qcircular_list, Qcircular_property_list; +Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch; Lisp_Object Qio_error, Qend_of_file; Lisp_Object Qarith_error, Qrange_error, Qdomain_error; Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error; -Lisp_Object Qintegerp, Qnatnump, Qsymbolp; +Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; +Lisp_Object Qintegerp, Qnatnump, Qsymbolp, Qkeywordp; Lisp_Object Qlistp, Qtrue_list_p, Qweak_listp; -Lisp_Object Qconsp, Qsubrp; +Lisp_Object Qconsp, Qsubrp, Qcompiled_functionp; 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; +#ifdef LISP_FLOAT_TYPE Lisp_Object Qfloatp; +#endif #ifdef DEBUG_XEMACS int debug_issue_ebola_notices; -Fixnum debug_ebola_backtrace_length; +int debug_ebola_backtrace_length; + +#if 0 +/*#ifndef LRECORD_SYMBOL*/ +#include "backtrace.h" +#endif int eq_with_ebola_notice (Lisp_Object obj1, Lisp_Object obj2) { - if (debug_issue_ebola_notices - && ((CHARP (obj1) && INTP (obj2)) || (CHARP (obj2) && INTP (obj1)))) + if (((CHARP (obj1) && INTP (obj2)) || (CHARP (obj2) && INTP (obj1))) + && (debug_issue_ebola_notices >= 2 + || XCHAR_OR_INT (obj1) == XCHAR_OR_INT (obj2))) { - /* #### It would be really nice if this were a proper warning - instead of brain-dead print ro Qexternal_debugging_output. */ - write_c_string ("Comparison between integer and character is constant nil (", - Qexternal_debugging_output); + stderr_out("Comparison between integer and character is constant nil ("); Fprinc (obj1, Qexternal_debugging_output); - write_c_string (" and ", Qexternal_debugging_output); + stderr_out (" and "); Fprinc (obj2, Qexternal_debugging_output); - write_c_string (")\n", Qexternal_debugging_output); + stderr_out (")\n"); debug_short_backtrace (debug_ebola_backtrace_length); } return EQ (obj1, obj2); @@ -129,15 +128,9 @@ PREDICATE. At that point, the gotten value is returned. } DOESNT_RETURN -c_write_error (Lisp_Object obj) +pure_write_error (Lisp_Object obj) { - signal_simple_error ("Attempt to modify read-only object (c)", obj); -} - -DOESNT_RETURN -lisp_write_error (Lisp_Object obj) -{ - signal_simple_error ("Attempt to modify read-only object (lisp)", obj); + signal_simple_error ("Attempt to modify read-only object", obj); } DOESNT_RETURN @@ -153,7 +146,7 @@ args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) } 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)); @@ -166,8 +159,8 @@ EMACS_INT sign_extend_temp; /* 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))) @@ -182,9 +175,9 @@ sign_extend_lisp_int (EMACS_INT num) DEFUN ("eq", Feq, 2, 2, 0, /* Return t if the two args are the same Lisp object. */ - (object1, object2)) + (obj1, obj2)) { - return EQ_WITH_EBOLA_NOTICE (object1, object2) ? Qt : Qnil; + return EQ_WITH_EBOLA_NOTICE (obj1, obj2) ? Qt : Qnil; } DEFUN ("old-eq", Fold_eq, 2, 2, 0, /* @@ -199,10 +192,10 @@ functions with `old-foo' equivalents. Do not use this function! */ - (object1, object2)) + (obj1, obj2)) { /* #### blasphemy */ - return HACKEQ_UNSAFE (object1, object2) ? Qt : Qnil; + return HACKEQ_UNSAFE (obj1, obj2) ? Qt : Qnil; } DEFUN ("null", Fnull, 1, 1, 0, /* @@ -214,7 +207,7 @@ Return t if OBJECT is nil. } DEFUN ("consp", Fconsp, 1, 1, 0, /* -Return t if OBJECT is a cons cell. `nil' is not a cons cell. +Return t if OBJECT is a cons cell. */ (object)) { @@ -222,7 +215,7 @@ Return t if OBJECT is a cons cell. `nil' is not a cons cell. } DEFUN ("atom", Fatom, 1, 1, 0, /* -Return t if OBJECT is not a cons cell. `nil' is not a cons cell. +Return t if OBJECT is not a cons cell. Atoms include nil. */ (object)) { @@ -230,7 +223,7 @@ Return t if OBJECT is not a cons cell. `nil' is not a cons cell. } DEFUN ("listp", Flistp, 1, 1, 0, /* -Return t if OBJECT is a list. `nil' is a list. +Return t if OBJECT is a list. Lists includes nil. */ (object)) { @@ -238,7 +231,7 @@ Return t if OBJECT is a list. `nil' is a list. } DEFUN ("nlistp", Fnlistp, 1, 1, 0, /* -Return t if OBJECT is not a list. `nil' is a list. +Return t if OBJECT is not a list. Lists include nil. */ (object)) { @@ -270,7 +263,7 @@ Return t if OBJECT is a keyword. } DEFUN ("vectorp", Fvectorp, 1, 1, 0, /* -Return t if OBJECT is a vector. +REturn t if OBJECT is a vector. */ (object)) { @@ -309,7 +302,8 @@ Return t if OBJECT is a sequence (list or array). */ (object)) { - return (LISTP (object) || + return (CONSP (object) || + NILP (object) || VECTORP (object) || STRINGP (object) || BIT_VECTORP (object)) @@ -357,18 +351,26 @@ or nil if it takes an arbitrary number of arguments or is a special form. } DEFUN ("subr-interactive", Fsubr_interactive, 1, 1, 0, /* -Return the interactive spec of the subr object SUBR, or nil. +Return the interactive spec of the subr object, or nil. If non-nil, the return value will be a list whose first element is `interactive' and whose second element is the interactive spec. */ (subr)) { - const char *prompt; + CONST char *prompt; CHECK_SUBR (subr); prompt = XSUBR (subr)->prompt; return prompt ? list2 (Qinteractive, build_string (prompt)) : Qnil; } +DEFUN ("compiled-function-p", Fcompiled_function_p, 1, 1, 0, /* +Return t if OBJECT is a byte-compiled function object. +*/ + (object)) +{ + return COMPILED_FUNCTIONP (object) ? Qt : Qnil; +} + DEFUN ("characterp", Fcharacterp, 1, 1, 0, /* Return t if OBJECT is a character. @@ -395,7 +397,7 @@ as `char='. } DEFUN ("char-to-int", Fchar_to_int, 1, 1, 0, /* -Convert CHARACTER into an equivalent integer. +Convert a character into an equivalent integer. The resulting integer will always be non-negative. The integers in the range 0 - 255 map to characters as follows: @@ -409,14 +411,14 @@ values. When 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. */ - (character)) + (ch)) { - CHECK_CHAR (character); - return make_int (XCHAR (character)); + CHECK_CHAR (ch); + return make_int (XCHAR (ch)); } DEFUN ("int-to-char", Fint_to_char, 1, 1, 0, /* -Convert integer INTEGER into the equivalent character. +Convert an integer into the equivalent character. Not all integers correspond to valid characters; use `char-int-p' to determine whether this is the case. If the integer cannot be converted, nil is returned. @@ -549,15 +551,16 @@ Return a symbol representing the type of OBJECT. */ (object)) { - switch (XTYPE (object)) - { - case Lisp_Type_Record: - return intern (XRECORD_LHEADER_IMPLEMENTATION (object)->name); - - case Lisp_Type_Char: return Qcharacter; + if (CONSP (object)) return Qcons; + if (SYMBOLP (object)) return Qsymbol; + if (KEYWORDP (object)) return Qkeyword; + if (INTP (object)) return Qinteger; + if (CHARP (object)) return Qcharacter; + if (STRINGP (object)) return Qstring; + if (VECTORP (object)) return Qvector; - default: return Qinteger; - } + assert (LRECORDP (object)); + return intern (XRECORD_LHEADER_IMPLEMENTATION (object)->name); } @@ -614,61 +617,63 @@ Return the cdr of OBJECT if it is a cons cell, else nil. } DEFUN ("setcar", Fsetcar, 2, 2, 0, /* -Set the car of CONS-CELL to be NEWCAR. Return NEWCAR. +Set the car of CONSCELL to be NEWCAR. Return NEWCAR. */ - (cons_cell, newcar)) + (conscell, newcar)) { - if (!CONSP (cons_cell)) - cons_cell = wrong_type_argument (Qconsp, cons_cell); + if (!CONSP (conscell)) + conscell = wrong_type_argument (Qconsp, conscell); - XCAR (cons_cell) = newcar; + CHECK_IMPURE (conscell); + XCAR (conscell) = newcar; return newcar; } DEFUN ("setcdr", Fsetcdr, 2, 2, 0, /* -Set the cdr of CONS-CELL to be NEWCDR. Return NEWCDR. +Set the cdr of CONSCELL to be NEWCDR. Return NEWCDR. */ - (cons_cell, newcdr)) + (conscell, newcdr)) { - if (!CONSP (cons_cell)) - cons_cell = wrong_type_argument (Qconsp, cons_cell); + if (!CONSP (conscell)) + conscell = wrong_type_argument (Qconsp, conscell); - XCDR (cons_cell) = newcdr; + CHECK_IMPURE (conscell); + XCDR (conscell) = newcdr; return newcdr; } -/* Find the function at the end of a chain of symbol function indirections. +/* Find the function at the end of a chain of symbol function indirections. */ - If OBJECT is a symbol, find the end of its function chain and +/* If OBJECT is a symbol, find the end of its function chain and return the value found there. If OBJECT is not a symbol, just return it. If there is a cycle in the function chain, signal a cyclic-function-indirection error. - This is like Findirect_function when VOID_FUNCTION_ERRORP is true. - When VOID_FUNCTION_ERRORP is false, no error is signaled if the end - of the chain ends up being Qunbound. */ + This is like Findirect_function, except that it doesn't signal an + error if the chain ends up unbound. */ Lisp_Object -indirect_function (Lisp_Object object, int void_function_errorp) +indirect_function (Lisp_Object object, int errorp) { -#define FUNCTION_INDIRECTION_SUSPICION_LENGTH 16 - Lisp_Object tortoise, hare; - int count; + Lisp_Object tortoise = object; + Lisp_Object hare = object; - for (hare = tortoise = object, count = 0; - SYMBOLP (hare); - hare = XSYMBOL (hare)->function, count++) + for (;;) { - if (count < FUNCTION_INDIRECTION_SUSPICION_LENGTH) continue; + if (!SYMBOLP (hare) || UNBOUNDP (hare)) + break; + hare = XSYMBOL (hare)->function; + if (!SYMBOLP (hare) || UNBOUNDP (hare)) + break; + hare = XSYMBOL (hare)->function; + + tortoise = XSYMBOL (tortoise)->function; - if (count & 1) - tortoise = XSYMBOL (tortoise)->function; if (EQ (hare, tortoise)) return Fsignal (Qcyclic_function_indirection, list1 (object)); } - if (void_function_errorp && UNBOUNDP (hare)) - return signal_void_function_error (object); - + if (UNBOUNDP (hare) && errorp) + return Fsignal (Qvoid_function, list1 (object)); return hare; } @@ -690,44 +695,41 @@ function chain of symbols. DEFUN ("aref", Faref, 2, 2, 0, /* Return the element of ARRAY at index INDEX. -ARRAY may be a vector, bit vector, or string. INDEX starts at 0. +ARRAY may be a vector, bit vector, string, or byte-code object. +IDX starts at 0. */ - (array, index_)) + (array, idx)) { - EMACS_INT idx; + int idxval; retry: - - if (INTP (index_)) idx = XINT (index_); - else if (CHARP (index_)) idx = XCHAR (index_); /* yuck! */ - else + CHECK_INT_COERCE_CHAR (idx); /* yuck! */ + idxval = XINT (idx); + if (idxval < 0) { - index_ = wrong_type_argument (Qinteger_or_char_p, index_); - goto retry; + lose: + args_out_of_range (array, idx); } - - if (idx < 0) goto range_error; - if (VECTORP (array)) { - if (idx >= XVECTOR_LENGTH (array)) goto range_error; - return XVECTOR_DATA (array)[idx]; + if (idxval >= XVECTOR_LENGTH (array)) goto lose; + return XVECTOR_DATA (array)[idxval]; } else if (BIT_VECTORP (array)) { - if (idx >= bit_vector_length (XBIT_VECTOR (array))) goto range_error; - return make_int (bit_vector_bit (XBIT_VECTOR (array), idx)); + if (idxval >= bit_vector_length (XBIT_VECTOR (array))) goto lose; + return make_int (bit_vector_bit (XBIT_VECTOR (array), idxval)); } else if (STRINGP (array)) { - if (idx >= XSTRING_CHAR_LENGTH (array)) goto range_error; - return make_char (string_char (XSTRING (array), idx)); + if (idxval >= XSTRING_CHAR_LENGTH (array)) goto lose; + return make_char (string_char (XSTRING (array), idxval)); } #ifdef LOSING_BYTECODE else if (COMPILED_FUNCTIONP (array)) { /* Weird, gross compatibility kludge */ - return Felt (array, index_); + return Felt (array, idx); } #endif else @@ -736,146 +738,290 @@ ARRAY may be a vector, bit vector, or string. INDEX starts at 0. array = wrong_type_argument (Qarrayp, array); goto retry; } - - range_error: - args_out_of_range (array, index_); - return Qnil; /* not reached */ } DEFUN ("aset", Faset, 3, 3, 0, /* -Store into the element of ARRAY at index INDEX the value NEWVAL. -ARRAY may be a vector, bit vector, or string. INDEX starts at 0. +Store into the element of ARRAY at index IDX the value NEWVAL. +ARRAY may be a vector, bit vector, or string. IDX starts at 0. */ - (array, index_, newval)) + (array, idx, newval)) { - EMACS_INT idx; + int idxval; - retry: + CHECK_INT_COERCE_CHAR (idx); /* yuck! */ + if (!VECTORP (array) && !BIT_VECTORP (array) && !STRINGP (array)) + array = wrong_type_argument (Qarrayp, array); - if (INTP (index_)) idx = XINT (index_); - else if (CHARP (index_)) idx = XCHAR (index_); /* yuck! */ - else + idxval = XINT (idx); + if (idxval < 0) { - index_ = wrong_type_argument (Qinteger_or_char_p, index_); - goto retry; + lose: + args_out_of_range (array, idx); } - - if (idx < 0) goto range_error; + CHECK_IMPURE (array); if (VECTORP (array)) { - if (idx >= XVECTOR_LENGTH (array)) goto range_error; - XVECTOR_DATA (array)[idx] = newval; + if (idxval >= XVECTOR_LENGTH (array)) goto lose; + XVECTOR_DATA (array)[idxval] = newval; } else if (BIT_VECTORP (array)) { - if (idx >= bit_vector_length (XBIT_VECTOR (array))) goto range_error; + if (idxval >= bit_vector_length (XBIT_VECTOR (array))) goto lose; CHECK_BIT (newval); - set_bit_vector_bit (XBIT_VECTOR (array), idx, !ZEROP (newval)); + set_bit_vector_bit (XBIT_VECTOR (array), idxval, !ZEROP (newval)); } - else if (STRINGP (array)) + else /* string */ { CHECK_CHAR_COERCE_INT (newval); - if (idx >= XSTRING_CHAR_LENGTH (array)) goto range_error; - set_string_char (XSTRING (array), idx, XCHAR (newval)); + if (idxval >= XSTRING_CHAR_LENGTH (array)) goto lose; + set_string_char (XSTRING (array), idxval, XCHAR (newval)); bump_string_modiff (array); } - else - { - array = wrong_type_argument (Qarrayp, array); - goto retry; - } return newval; - - range_error: - args_out_of_range (array, index_); - return Qnil; /* not reached */ } /**********************************************************************/ -/* Arithmetic functions */ +/* Compiled-function objects */ /**********************************************************************/ -typedef struct + +/* The compiled_function->doc_and_interactive slot uses the minimal + number of conses, based on compiled_function->flags; it may take + any of the following forms: + + doc + interactive + domain + (doc . interactive) + (doc . domain) + (interactive . domain) + (doc . (interactive . domain)) + */ + +/* Caller must check flags.interactivep first */ +Lisp_Object +compiled_function_interactive (struct Lisp_Compiled_Function *b) { - int int_p; - union - { - EMACS_INT ival; - double dval; - } c; -} int_or_double; + assert (b->flags.interactivep); + if (b->flags.documentationp && b->flags.domainp) + return XCAR (XCDR (b->doc_and_interactive)); + else if (b->flags.documentationp) + return XCDR (b->doc_and_interactive); + else if (b->flags.domainp) + return XCAR (b->doc_and_interactive); -static void -number_char_or_marker_to_int_or_double (Lisp_Object obj, int_or_double *p) + /* if all else fails... */ + return b->doc_and_interactive; +} + +/* Caller need not check flags.documentationp first */ +Lisp_Object +compiled_function_documentation (struct Lisp_Compiled_Function *b) { - retry: - p->int_p = 1; - if (INTP (obj)) p->c.ival = XINT (obj); - else if (CHARP (obj)) p->c.ival = XCHAR (obj); - else if (MARKERP (obj)) p->c.ival = marker_position (obj); -#ifdef LISP_FLOAT_TYPE - else if (FLOATP (obj)) p->c.dval = XFLOAT_DATA (obj), p->int_p = 0; -#endif + if (! b->flags.documentationp) + return Qnil; + else if (b->flags.interactivep && b->flags.domainp) + return XCAR (b->doc_and_interactive); + else if (b->flags.interactivep) + return XCAR (b->doc_and_interactive); + else if (b->flags.domainp) + return XCAR (b->doc_and_interactive); else - { - obj = wrong_type_argument (Qnumber_char_or_marker_p, obj); - goto retry; - } + return b->doc_and_interactive; } -static double -number_char_or_marker_to_double (Lisp_Object obj) +/* Caller need not check flags.domainp first */ +Lisp_Object +compiled_function_domain (struct Lisp_Compiled_Function *b) { - retry: - if (INTP (obj)) return (double) XINT (obj); - else if (CHARP (obj)) return (double) XCHAR (obj); - else if (MARKERP (obj)) return (double) marker_position (obj); -#ifdef LISP_FLOAT_TYPE - else if (FLOATP (obj)) return XFLOAT_DATA (obj); -#endif + if (! b->flags.domainp) + return Qnil; + else if (b->flags.documentationp && b->flags.interactivep) + return XCDR (XCDR (b->doc_and_interactive)); + else if (b->flags.documentationp) + return XCDR (b->doc_and_interactive); + else if (b->flags.interactivep) + return XCDR (b->doc_and_interactive); else - { - obj = wrong_type_argument (Qnumber_char_or_marker_p, obj); - goto retry; - } + return b->doc_and_interactive; } -static EMACS_INT -integer_char_or_marker_to_int (Lisp_Object obj) +#ifdef COMPILED_FUNCTION_ANNOTATION_HACK + +Lisp_Object +compiled_function_annotation (struct Lisp_Compiled_Function *b) { - retry: - if (INTP (obj)) return XINT (obj); - else if (CHARP (obj)) return XCHAR (obj); - else if (MARKERP (obj)) return marker_position (obj); + return b->annotated; +} + +#endif + +/* used only by Snarf-documentation; there must be doc already. */ +void +set_compiled_function_documentation (struct Lisp_Compiled_Function *b, + Lisp_Object new) +{ + assert (b->flags.documentationp); + assert (INTP (new) || STRINGP (new)); + + if (b->flags.interactivep && b->flags.domainp) + XCAR (b->doc_and_interactive) = new; + else if (b->flags.interactivep) + XCAR (b->doc_and_interactive) = new; + else if (b->flags.domainp) + XCAR (b->doc_and_interactive) = new; else + b->doc_and_interactive = new; +} + +DEFUN ("compiled-function-instructions", Fcompiled_function_instructions, 1, 1, 0, /* +Return the byte-opcode string of the compiled-function object. +*/ + (function)) +{ + CHECK_COMPILED_FUNCTION (function); + return XCOMPILED_FUNCTION (function)->bytecodes; +} + +DEFUN ("compiled-function-constants", Fcompiled_function_constants, 1, 1, 0, /* +Return the constants vector of the compiled-function object. +*/ + (function)) +{ + CHECK_COMPILED_FUNCTION (function); + return XCOMPILED_FUNCTION (function)->constants; +} + +DEFUN ("compiled-function-stack-depth", Fcompiled_function_stack_depth, 1, 1, 0, /* +Return the max stack depth of the compiled-function object. +*/ + (function)) +{ + CHECK_COMPILED_FUNCTION (function); + return make_int (XCOMPILED_FUNCTION (function)->maxdepth); +} + +DEFUN ("compiled-function-arglist", Fcompiled_function_arglist, 1, 1, 0, /* +Return the argument list of the compiled-function object. +*/ + (function)) +{ + CHECK_COMPILED_FUNCTION (function); + return XCOMPILED_FUNCTION (function)->arglist; +} + +DEFUN ("compiled-function-interactive", Fcompiled_function_interactive, 1, 1, 0, /* +Return the interactive spec of the compiled-function object, or nil. +If non-nil, the return value will be a list whose first element is +`interactive' and whose second element is the interactive spec. +*/ + (function)) +{ + CHECK_COMPILED_FUNCTION (function); + return XCOMPILED_FUNCTION (function)->flags.interactivep + ? list2 (Qinteractive, + compiled_function_interactive (XCOMPILED_FUNCTION (function))) + : Qnil; +} + +DEFUN ("compiled-function-doc-string", Fcompiled_function_doc_string, 1, 1, 0, /* +Return the doc string of the compiled-function object, if available. +Functions that had their doc strings snarfed into the DOC file will have +an integer returned instead of a string. +*/ + (function)) +{ + CHECK_COMPILED_FUNCTION (function); + return compiled_function_documentation (XCOMPILED_FUNCTION (function)); +} + +#ifdef COMPILED_FUNCTION_ANNOTATION_HACK + +/* Remove the `xx' if you wish to restore this feature */ +xxDEFUN ("compiled-function-annotation", Fcompiled_function_annotation, 1, 1, 0, /* +Return the annotation of the compiled-function object, or nil. +The annotation is a piece of information indicating where this +compiled-function object came from. Generally this will be +a symbol naming a function; or a string naming a file, if the +compiled-function object was not defined in a function; or nil, +if the compiled-function object was not created as a result of +a `load'. +*/ + (function)) +{ + CHECK_COMPILED_FUNCTION (function); + return compiled_function_annotation (XCOMPILED_FUNCTION (function)); +} + +#endif /* COMPILED_FUNCTION_ANNOTATION_HACK */ + +DEFUN ("compiled-function-domain", Fcompiled_function_domain, 1, 1, 0, /* +Return the domain of the compiled-function object, or nil. +This is only meaningful if I18N3 was enabled when emacs was compiled. +*/ + (function)) +{ + CHECK_COMPILED_FUNCTION (function); + return XCOMPILED_FUNCTION (function)->flags.domainp + ? compiled_function_domain (XCOMPILED_FUNCTION (function)) + : Qnil; +} + + +/**********************************************************************/ +/* Arithmetic functions */ +/**********************************************************************/ + +Lisp_Object +arithcompare (Lisp_Object num1, Lisp_Object num2, + enum arith_comparison comparison) +{ + CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (num1); + CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (num2); + +#ifdef LISP_FLOAT_TYPE + if (FLOATP (num1) || FLOATP (num2)) { - obj = wrong_type_argument (Qinteger_char_or_marker_p, obj); - goto retry; + double f1 = FLOATP (num1) ? float_data (XFLOAT (num1)) : XINT (num1); + double f2 = FLOATP (num2) ? float_data (XFLOAT (num2)) : XINT (num2); + + switch (comparison) + { + case arith_equal: return f1 == f2 ? Qt : Qnil; + case arith_notequal: return f1 != f2 ? Qt : Qnil; + case arith_less: return f1 < f2 ? Qt : Qnil; + case arith_less_or_equal: return f1 <= f2 ? Qt : Qnil; + case arith_grtr: return f1 > f2 ? Qt : Qnil; + case arith_grtr_or_equal: return f1 >= f2 ? Qt : Qnil; + } } +#endif /* LISP_FLOAT_TYPE */ + + switch (comparison) + { + case arith_equal: return XINT (num1) == XINT (num2) ? Qt : Qnil; + case arith_notequal: return XINT (num1) != XINT (num2) ? Qt : Qnil; + case arith_less: return XINT (num1) < XINT (num2) ? Qt : Qnil; + case arith_less_or_equal: return XINT (num1) <= XINT (num2) ? Qt : Qnil; + case arith_grtr: return XINT (num1) > XINT (num2) ? Qt : Qnil; + case arith_grtr_or_equal: return XINT (num1) >= XINT (num2) ? Qt : Qnil; + } + + abort (); + return Qnil; /* suppress compiler warning */ } -#define ARITHCOMPARE_MANY(op) \ -{ \ - int_or_double iod1, iod2, *p = &iod1, *q = &iod2; \ - Lisp_Object *args_end = args + nargs; \ - \ - number_char_or_marker_to_int_or_double (*args++, p); \ - \ - while (args < args_end) \ - { \ - number_char_or_marker_to_int_or_double (*args++, q); \ - \ - if (!((p->int_p && q->int_p) ? \ - (p->c.ival op q->c.ival) : \ - ((p->int_p ? (double) p->c.ival : p->c.dval) op \ - (q->int_p ? (double) q->c.ival : q->c.dval)))) \ - return Qnil; \ - \ - { /* swap */ int_or_double *r = p; p = q; q = r; } \ - } \ - return Qt; \ +static Lisp_Object +arithcompare_many (enum arith_comparison comparison, + int nargs, Lisp_Object *args) +{ + for (; --nargs > 0; args++) + if (NILP (arithcompare (*args, *(args + 1), comparison))) + return Qnil; + + return Qt; } DEFUN ("=", Feqlsign, 1, MANY, 0, /* @@ -884,7 +1030,7 @@ The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) { - ARITHCOMPARE_MANY (==) + return arithcompare_many (arith_equal, nargs, args); } DEFUN ("<", Flss, 1, MANY, 0, /* @@ -893,7 +1039,7 @@ The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) { - ARITHCOMPARE_MANY (<) + return arithcompare_many (arith_less, nargs, args); } DEFUN (">", Fgtr, 1, MANY, 0, /* @@ -902,7 +1048,7 @@ The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) { - ARITHCOMPARE_MANY (>) + return arithcompare_many (arith_grtr, nargs, args); } DEFUN ("<=", Fleq, 1, MANY, 0, /* @@ -911,7 +1057,7 @@ The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) { - ARITHCOMPARE_MANY (<=) + return arithcompare_many (arith_less_or_equal, nargs, args); } DEFUN (">=", Fgeq, 1, MANY, 0, /* @@ -920,7 +1066,7 @@ The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) { - ARITHCOMPARE_MANY (>=) + return arithcompare_many (arith_grtr_or_equal, nargs, args); } DEFUN ("/=", Fneq, 1, MANY, 0, /* @@ -929,28 +1075,7 @@ The arguments may be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) { - Lisp_Object *args_end = args + nargs; - Lisp_Object *p, *q; - - /* Unlike all the other comparisons, this is an N*N algorithm. - We could use a hash table for nargs > 50 to make this linear. */ - for (p = args; p < args_end; p++) - { - int_or_double iod1, iod2; - number_char_or_marker_to_int_or_double (*p, &iod1); - - for (q = p + 1; q < args_end; q++) - { - number_char_or_marker_to_int_or_double (*q, &iod2); - - if (!((iod1.int_p && iod2.int_p) ? - (iod1.c.ival != iod2.c.ival) : - ((iod1.int_p ? (double) iod1.c.ival : iod1.c.dval) != - (iod2.int_p ? (double) iod2.c.ival : iod2.c.dval)))) - return Qnil; - } - } - return Qt; + return arithcompare_many (arith_notequal, nargs, args); } DEFUN ("zerop", Fzerop, 1, 1, 0, /* @@ -958,18 +1083,14 @@ Return t if NUMBER is zero. */ (number)) { - retry: - if (INTP (number)) - return EQ (number, Qzero) ? Qt : Qnil; + CHECK_INT_OR_FLOAT (number); + #ifdef LISP_FLOAT_TYPE - else if (FLOATP (number)) - return XFLOAT_DATA (number) == 0.0 ? Qt : Qnil; + if (FLOATP (number)) + return float_data (XFLOAT (number)) == 0.0 ? Qt : Qnil; #endif /* LISP_FLOAT_TYPE */ - else - { - number = wrong_type_argument (Qnumberp, number); - goto retry; - } + + return EQ (number, Qzero) ? Qt : Qnil; } /* Convert between a 32-bit value and a cons of two 16-bit values. @@ -1002,27 +1123,27 @@ lisp_to_word (Lisp_Object item) DEFUN ("number-to-string", Fnumber_to_string, 1, 1, 0, /* -Convert NUMBER to a string by printing it in decimal. +Convert NUM to a string by printing it in decimal. Uses a minus sign if negative. -NUMBER may be an integer or a floating point number. +NUM may be an integer or a floating point number. */ - (number)) + (num)) { char buffer[VALBITS]; - CHECK_INT_OR_FLOAT (number); + CHECK_INT_OR_FLOAT (num); #ifdef LISP_FLOAT_TYPE - if (FLOATP (number)) + if (FLOATP (num)) { char pigbuf[350]; /* see comments in float_to_string */ - float_to_string (pigbuf, XFLOAT_DATA (number)); + float_to_string (pigbuf, float_data (XFLOAT (num))); return build_string (pigbuf); } #endif /* LISP_FLOAT_TYPE */ - long_to_string (buffer, XINT (number)); + long_to_string (buffer, XINT (num)); return build_string (buffer); } @@ -1039,12 +1160,12 @@ digit_to_number (int character, int base) } DEFUN ("string-to-number", Fstring_to_number, 1, 2, 0, /* -Convert STRING to a number by parsing it as a number in base BASE. +Convert STRING to a number by parsing it as a decimal number. This parses both integers and floating point numbers. It ignores leading spaces and tabs. -If BASE is nil or omitted, base 10 is used. -BASE must be an integer between 2 and 16 (inclusive). +If BASE, interpret STRING as a number in that base. If BASE isn't +present, base 10 is used. BASE must be between 2 and 16 (inclusive). Floating point numbers always use base 10. */ (string, base)) @@ -1071,14 +1192,14 @@ Floating point numbers always use base 10. p++; #ifdef LISP_FLOAT_TYPE - if (isfloat_string (p) && b == 10) + if (isfloat_string (p)) return make_float (atof (p)); #endif /* LISP_FLOAT_TYPE */ if (b == 10) { /* Use the system-provided functions for base 10. */ -#if SIZEOF_EMACS_INT == SIZEOF_INT +#if SIZEOF_EMACS_INT == SIZEOF_INT return make_int (atoi (p)); #elif SIZEOF_EMACS_INT == SIZEOF_LONG return make_int (atol (p)); @@ -1088,7 +1209,7 @@ Floating point numbers always use base 10. } else { - int negative = 1; + int digit, negative = 1; EMACS_INT v = 0; if (*p == '-') @@ -1100,7 +1221,7 @@ Floating point numbers always use base 10. p++; while (1) { - int digit = digit_to_number (*p++, b); + digit = digit_to_number (*p++, b); if (digit < 0) break; v = v * b + digit; @@ -1109,323 +1230,195 @@ Floating point numbers always use base 10. } } +enum arithop + { Aadd, Asub, Amult, Adiv, Alogand, Alogior, Alogxor, Amax, Amin }; -DEFUN ("+", Fplus, 0, MANY, 0, /* -Return sum of any number of arguments. -The arguments should all be numbers, characters or markers. -*/ - (int nargs, Lisp_Object *args)) -{ - EMACS_INT iaccum = 0; - Lisp_Object *args_end = args + nargs; - - while (args < args_end) - { - int_or_double iod; - number_char_or_marker_to_int_or_double (*args++, &iod); - if (iod.int_p) - iaccum += iod.c.ival; - else - { - double daccum = (double) iaccum + iod.c.dval; - while (args < args_end) - daccum += number_char_or_marker_to_double (*args++); - return make_float (daccum); - } - } - - return make_int (iaccum); -} -DEFUN ("-", Fminus, 1, MANY, 0, /* -Negate number or subtract numbers, characters or markers. -With one arg, negates it. With more than one arg, -subtracts all but the first from the first. -*/ - (int nargs, Lisp_Object *args)) +#ifdef LISP_FLOAT_TYPE +static Lisp_Object +float_arith_driver (double accum, int argnum, enum arithop code, int nargs, + Lisp_Object *args) { - EMACS_INT iaccum; - double daccum; - Lisp_Object *args_end = args + nargs; - int_or_double iod; - - number_char_or_marker_to_int_or_double (*args++, &iod); - if (iod.int_p) - iaccum = nargs > 1 ? iod.c.ival : - iod.c.ival; - else - { - daccum = nargs > 1 ? iod.c.dval : - iod.c.dval; - goto do_float; - } + REGISTER Lisp_Object val; + double next; - while (args < args_end) + for (; argnum < nargs; argnum++) { - number_char_or_marker_to_int_or_double (*args++, &iod); - if (iod.int_p) - iaccum -= iod.c.ival; - else - { - daccum = (double) iaccum - iod.c.dval; - goto do_float; - } - } - - return make_int (iaccum); - - do_float: - for (; args < args_end; args++) - daccum -= number_char_or_marker_to_double (*args); - return make_float (daccum); -} - -DEFUN ("*", Ftimes, 0, MANY, 0, /* -Return product of any number of arguments. -The arguments should all be numbers, characters or markers. -*/ - (int nargs, Lisp_Object *args)) -{ - EMACS_INT iaccum = 1; - Lisp_Object *args_end = args + nargs; + /* using args[argnum] as argument to CHECK_INT_OR_FLOAT_... */ + val = args[argnum]; + CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (val); - while (args < args_end) - { - int_or_double iod; - number_char_or_marker_to_int_or_double (*args++, &iod); - if (iod.int_p) - iaccum *= iod.c.ival; - else + if (FLOATP (val)) { - double daccum = (double) iaccum * iod.c.dval; - while (args < args_end) - daccum *= number_char_or_marker_to_double (*args++); - return make_float (daccum); + next = float_data (XFLOAT (val)); } - } - - return make_int (iaccum); -} - -DEFUN ("/", Fquo, 1, MANY, 0, /* -Return first argument divided by all the remaining arguments. -The arguments must be numbers, characters or markers. -With one argument, reciprocates the argument. -*/ - (int nargs, Lisp_Object *args)) -{ - EMACS_INT iaccum; - double daccum; - Lisp_Object *args_end = args + nargs; - int_or_double iod; - - if (nargs == 1) - iaccum = 1; - else - { - number_char_or_marker_to_int_or_double (*args++, &iod); - if (iod.int_p) - iaccum = iod.c.ival; else { - daccum = iod.c.dval; - goto divide_floats; - } - } - - while (args < args_end) - { - number_char_or_marker_to_int_or_double (*args++, &iod); - if (iod.int_p) - { - if (iod.c.ival == 0) goto divide_by_zero; - iaccum /= iod.c.ival; + args[argnum] = val; /* runs into a compiler bug. */ + next = XINT (args[argnum]); } - else + switch (code) { - if (iod.c.dval == 0) goto divide_by_zero; - daccum = (double) iaccum / iod.c.dval; - goto divide_floats; + case Aadd: + accum += next; + break; + case Asub: + if (!argnum && nargs != 1) + next = - next; + accum -= next; + break; + case Amult: + accum *= next; + break; + case Adiv: + if (!argnum) + accum = next; + else + { + if (next == 0) + Fsignal (Qarith_error, Qnil); + accum /= next; + } + break; + case Alogand: + case Alogior: + case Alogxor: + return wrong_type_argument (Qinteger_char_or_marker_p, val); + case Amax: + if (!argnum || isnan (next) || next > accum) + accum = next; + break; + case Amin: + if (!argnum || isnan (next) || next < accum) + accum = next; + break; } } - return make_int (iaccum); - - divide_floats: - for (; args < args_end; args++) - { - double dval = number_char_or_marker_to_double (*args); - if (dval == 0) goto divide_by_zero; - daccum /= dval; - } - return make_float (daccum); - - divide_by_zero: - Fsignal (Qarith_error, Qnil); - return Qnil; /* not reached */ + return make_float (accum); } +#endif /* LISP_FLOAT_TYPE */ -DEFUN ("max", Fmax, 1, MANY, 0, /* -Return largest of all the arguments. -All arguments must be numbers, characters or markers. -The value is always a number; markers and characters are converted -to numbers. -*/ - (int nargs, Lisp_Object *args)) +static Lisp_Object +arith_driver (enum arithop code, int nargs, Lisp_Object *args) { - EMACS_INT imax; - double dmax; - Lisp_Object *args_end = args + nargs; - int_or_double iod; - - number_char_or_marker_to_int_or_double (*args++, &iod); - if (iod.int_p) - imax = iod.c.ival; - else - { - dmax = iod.c.dval; - goto max_floats; - } + Lisp_Object val; + REGISTER int argnum; + REGISTER EMACS_INT accum = 0; + REGISTER EMACS_INT next; - while (args < args_end) + switch (code) { - number_char_or_marker_to_int_or_double (*args++, &iod); - if (iod.int_p) - { - if (imax < iod.c.ival) imax = iod.c.ival; - } - else - { - dmax = (double) imax; - if (dmax < iod.c.dval) dmax = iod.c.dval; - goto max_floats; - } - } - - return make_int (imax); - - max_floats: - while (args < args_end) - { - double dval = number_char_or_marker_to_double (*args++); - if (dmax < dval) dmax = dval; + case Alogior: + case Alogxor: + case Aadd: + case Asub: + accum = 0; break; + case Amult: + accum = 1; break; + case Alogand: + accum = -1; break; + case Adiv: + case Amax: + case Amin: + accum = 0; break; + default: + abort (); } - return make_float (dmax); -} - -DEFUN ("min", Fmin, 1, MANY, 0, /* -Return smallest of all the arguments. -All arguments must be numbers, characters or markers. -The value is always a number; markers and characters are converted -to numbers. -*/ - (int nargs, Lisp_Object *args)) -{ - EMACS_INT imin; - double dmin; - Lisp_Object *args_end = args + nargs; - int_or_double iod; - number_char_or_marker_to_int_or_double (*args++, &iod); - if (iod.int_p) - imin = iod.c.ival; - else + for (argnum = 0; argnum < nargs; argnum++) { - dmin = iod.c.dval; - goto min_floats; - } + /* using args[argnum] as argument to CHECK_INT_OR_FLOAT_... */ + val = args[argnum]; + CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (val); - while (args < args_end) - { - number_char_or_marker_to_int_or_double (*args++, &iod); - if (iod.int_p) - { - if (imin > iod.c.ival) imin = iod.c.ival; - } - else +#ifdef LISP_FLOAT_TYPE + if (FLOATP (val)) /* time to do serious math */ + return float_arith_driver ((double) accum, argnum, code, + nargs, args); +#endif /* LISP_FLOAT_TYPE */ + args[argnum] = val; /* runs into a compiler bug. */ + next = XINT (args[argnum]); + switch (code) { - dmin = (double) imin; - if (dmin > iod.c.dval) dmin = iod.c.dval; - goto min_floats; + case Aadd: accum += next; break; + case Asub: + if (!argnum && nargs != 1) + next = - next; + accum -= next; + break; + case Amult: accum *= next; break; + case Adiv: + if (!argnum) accum = next; + else + { + if (next == 0) + Fsignal (Qarith_error, Qnil); + accum /= next; + } + break; + case Alogand: accum &= next; break; + case Alogior: accum |= next; break; + case Alogxor: accum ^= next; break; + case Amax: if (!argnum || next > accum) accum = next; break; + case Amin: if (!argnum || next < accum) accum = next; break; } } - return make_int (imin); - - min_floats: - while (args < args_end) - { - double dval = number_char_or_marker_to_double (*args++); - if (dmin > dval) dmin = dval; - } - return make_float (dmin); + XSETINT (val, accum); + return val; } -DEFUN ("logand", Flogand, 0, MANY, 0, /* -Return bitwise-and of all the arguments. -Arguments may be integers, or markers or characters converted to integers. +DEFUN ("+", Fplus, 0, MANY, 0, /* +Return sum of any number of arguments. +The arguments should all be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) { - EMACS_INT bits = ~0; - Lisp_Object *args_end = args + nargs; - - while (args < args_end) - bits &= integer_char_or_marker_to_int (*args++); - - return make_int (bits); + return arith_driver (Aadd, nargs, args); } -DEFUN ("logior", Flogior, 0, MANY, 0, /* -Return bitwise-or of all the arguments. -Arguments may be integers, or markers or characters converted to integers. +DEFUN ("-", Fminus, 0, MANY, 0, /* +Negate number or subtract numbers, characters or markers. +With one arg, negates it. With more than one arg, +subtracts all but the first from the first. */ (int nargs, Lisp_Object *args)) { - EMACS_INT bits = 0; - Lisp_Object *args_end = args + nargs; - - while (args < args_end) - bits |= integer_char_or_marker_to_int (*args++); - - return make_int (bits); + return arith_driver (Asub, nargs, args); } -DEFUN ("logxor", Flogxor, 0, MANY, 0, /* -Return bitwise-exclusive-or of all the arguments. -Arguments may be integers, or markers or characters converted to integers. +DEFUN ("*", Ftimes, 0, MANY, 0, /* +Return product of any number of arguments. +The arguments should all be numbers, characters or markers. */ (int nargs, Lisp_Object *args)) { - EMACS_INT bits = 0; - Lisp_Object *args_end = args + nargs; - - while (args < args_end) - bits ^= integer_char_or_marker_to_int (*args++); - - return make_int (bits); + return arith_driver (Amult, nargs, args); } -DEFUN ("lognot", Flognot, 1, 1, 0, /* -Return the bitwise complement of NUMBER. -NUMBER may be an integer, marker or character converted to integer. +DEFUN ("/", Fquo, 2, MANY, 0, /* +Return first argument divided by all the remaining arguments. +The arguments must be numbers, characters or markers. */ - (number)) + (int nargs, Lisp_Object *args)) { - return make_int (~ integer_char_or_marker_to_int (number)); + return arith_driver (Adiv, nargs, args); } DEFUN ("%", Frem, 2, 2, 0, /* Return remainder of first arg divided by second. Both must be integers, characters or markers. */ - (number1, number2)) + (num1, num2)) { - EMACS_INT ival1 = integer_char_or_marker_to_int (number1); - EMACS_INT ival2 = integer_char_or_marker_to_int (number2); + CHECK_INT_COERCE_CHAR_OR_MARKER (num1); + CHECK_INT_COERCE_CHAR_OR_MARKER (num2); - if (ival2 == 0) + if (ZEROP (num2)) Fsignal (Qarith_error, Qnil); - return make_int (ival1 % ival2); + return make_int (XINT (num1) % XINT (num2)); } /* Note, ANSI *requires* the presence of the fmod() library routine. @@ -1451,41 +1444,96 @@ If either argument is a float, a float will be returned. */ (x, y)) { - int_or_double iod1, iod2; - number_char_or_marker_to_int_or_double (x, &iod1); - number_char_or_marker_to_int_or_double (y, &iod2); + EMACS_INT i1, i2; #ifdef LISP_FLOAT_TYPE - if (!iod1.int_p || !iod2.int_p) + CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (x); + CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (y); + + if (FLOATP (x) || FLOATP (y)) { - double dval1 = iod1.int_p ? (double) iod1.c.ival : iod1.c.dval; - double dval2 = iod2.int_p ? (double) iod2.c.ival : iod2.c.dval; - if (dval2 == 0) goto divide_by_zero; - dval1 = fmod (dval1, dval2); + double f1, f2; - /* If the "remainder" comes out with the wrong sign, fix it. */ - if (dval2 < 0 ? dval1 > 0 : dval1 < 0) - dval1 += dval2; + f1 = ((FLOATP (x)) ? float_data (XFLOAT (x)) : XINT (x)); + f2 = ((FLOATP (y)) ? float_data (XFLOAT (y)) : XINT (y)); + if (f2 == 0) + Fsignal (Qarith_error, Qnil); - return make_float (dval1); + f1 = fmod (f1, f2); + + /* If the "remainder" comes out with the wrong sign, fix it. */ + if (f2 < 0 ? f1 > 0 : f1 < 0) + f1 += f2; + return make_float (f1); } -#endif /* LISP_FLOAT_TYPE */ - { - EMACS_INT ival; - if (iod2.c.ival == 0) goto divide_by_zero; +#else /* not LISP_FLOAT_TYPE */ + CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (x); + CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (y); +#endif /* not LISP_FLOAT_TYPE */ - ival = iod1.c.ival % iod2.c.ival; + i1 = XINT (x); + i2 = XINT (y); - /* If the "remainder" comes out with the wrong sign, fix it. */ - if (iod2.c.ival < 0 ? ival > 0 : ival < 0) - ival += iod2.c.ival; + if (i2 == 0) + Fsignal (Qarith_error, Qnil); - return make_int (ival); - } + i1 %= i2; - divide_by_zero: - Fsignal (Qarith_error, Qnil); - return Qnil; /* not reached */ + /* If the "remainder" comes out with the wrong sign, fix it. */ + if (i2 < 0 ? i1 > 0 : i1 < 0) + i1 += i2; + + return make_int (i1); +} + + +DEFUN ("max", Fmax, 1, MANY, 0, /* +Return largest of all the arguments. +All arguments must be numbers, characters or markers. +The value is always a number; markers and characters are converted +to numbers. +*/ + (int nargs, Lisp_Object *args)) +{ + return arith_driver (Amax, nargs, args); +} + +DEFUN ("min", Fmin, 1, MANY, 0, /* +Return smallest of all the arguments. +All arguments must be numbers, characters or markers. +The value is always a number; markers and characters are converted +to numbers. +*/ + (int nargs, Lisp_Object *args)) +{ + return arith_driver (Amin, nargs, args); +} + +DEFUN ("logand", Flogand, 0, MANY, 0, /* +Return bitwise-and of all the arguments. +Arguments may be integers, or markers or characters converted to integers. +*/ + (int nargs, Lisp_Object *args)) +{ + return arith_driver (Alogand, nargs, args); +} + +DEFUN ("logior", Flogior, 0, MANY, 0, /* +Return bitwise-or of all the arguments. +Arguments may be integers, or markers or characters converted to integers. +*/ + (int nargs, Lisp_Object *args)) +{ + return arith_driver (Alogior, nargs, args); +} + +DEFUN ("logxor", Flogxor, 0, MANY, 0, /* +Return bitwise-exclusive-or of all the arguments. +Arguments may be integers, or markers or characters converted to integers. +*/ + (int nargs, Lisp_Object *args)) +{ + return arith_driver (Alogxor, nargs, args); } DEFUN ("ash", Fash, 2, 2, 0, /* @@ -1496,7 +1544,7 @@ In this case, the sign bit is duplicated. (value, count)) { CHECK_INT_COERCE_CHAR (value); - CONCHECK_INT (count); + CHECK_INT (count); return make_int (XINT (count) > 0 ? XINT (value) << XINT (count) : @@ -1511,7 +1559,7 @@ In this case, zeros are shifted in on the left. (value, count)) { CHECK_INT_COERCE_CHAR (value); - CONCHECK_INT (count); + CHECK_INT (count); return make_int (XINT (count) > 0 ? XUINT (value) << XINT (count) : @@ -1519,41 +1567,44 @@ In this case, zeros are shifted in on the left. } DEFUN ("1+", Fadd1, 1, 1, 0, /* -Return NUMBER plus one. NUMBER may be a number, character or marker. +Return NUMBER plus one. NUMBER may be a number or a marker. Markers and characters are converted to integers. */ (number)) { - retry: + CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (number); - if (INTP (number)) return make_int (XINT (number) + 1); - if (CHARP (number)) return make_int (XCHAR (number) + 1); - if (MARKERP (number)) return make_int (marker_position (number) + 1); #ifdef LISP_FLOAT_TYPE - if (FLOATP (number)) return make_float (XFLOAT_DATA (number) + 1.0); + if (FLOATP (number)) + return make_float (1.0 + float_data (XFLOAT (number))); #endif /* LISP_FLOAT_TYPE */ - number = wrong_type_argument (Qnumber_char_or_marker_p, number); - goto retry; + return make_int (XINT (number) + 1); } DEFUN ("1-", Fsub1, 1, 1, 0, /* -Return NUMBER minus one. NUMBER may be a number, character or marker. +Return NUMBER minus one. NUMBER may be a number or a marker. Markers and characters are converted to integers. */ (number)) { - retry: + CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (number); - if (INTP (number)) return make_int (XINT (number) - 1); - if (CHARP (number)) return make_int (XCHAR (number) - 1); - if (MARKERP (number)) return make_int (marker_position (number) - 1); #ifdef LISP_FLOAT_TYPE - if (FLOATP (number)) return make_float (XFLOAT_DATA (number) - 1.0); + if (FLOATP (number)) + return make_float (-1.0 + (float_data (XFLOAT (number)))); #endif /* LISP_FLOAT_TYPE */ - number = wrong_type_argument (Qnumber_char_or_marker_p, number); - goto retry; + return make_int (XINT (number) - 1); +} + +DEFUN ("lognot", Flognot, 1, 1, 0, /* +Return the bitwise complement of NUMBER. NUMBER must be an integer. +*/ + (number)) +{ + CHECK_INT (number); + return make_int (~XINT (number)); } @@ -1565,7 +1616,7 @@ Markers and characters are converted to integers. disappear when no longer in use, i.e. when no longer GC-protected. The basic idea is that we don't mark the elements during GC, but wait for them to be marked elsewhere. If they're not marked, we - remove them. This is analogous to weak hash tables; see the explanation + remove them. This is analogous to weak hashtables; see the explanation there for more info. */ static Lisp_Object Vall_weak_lists; /* Gemarke es nicht!!! */ @@ -1573,7 +1624,7 @@ static Lisp_Object Vall_weak_lists; /* Gemarke es nicht!!! */ 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 */ } @@ -1593,10 +1644,10 @@ print_weak_list (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) } static int -weak_list_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +weak_list_equal (Lisp_Object o1, Lisp_Object o2, int depth) { - struct weak_list *w1 = XWEAK_LIST (obj1); - struct weak_list *w2 = XWEAK_LIST (obj2); + struct weak_list *w1 = XWEAK_LIST (o1); + struct weak_list *w2 = XWEAK_LIST (o2); return ((w1->type == w2->type) && internal_equal (w1->list, w2->list, depth + 1)); @@ -1616,7 +1667,7 @@ make_weak_list (enum weak_list_type type) { Lisp_Object result; struct weak_list *wl = - alloc_lcrecord_type (struct weak_list, &lrecord_weak_list); + alloc_lcrecord_type (struct weak_list, lrecord_weak_list); wl->list = Qnil; wl->type = type; @@ -1626,16 +1677,9 @@ make_weak_list (enum weak_list_type type) 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 @@ -1655,19 +1699,20 @@ DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, */ 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; @@ -1675,7 +1720,7 @@ finish_marking_weak_lists (void) /* 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; @@ -1690,7 +1735,7 @@ finish_marking_weak_lists (void) (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); @@ -1698,19 +1743,19 @@ finish_marking_weak_lists (void) 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 @@ -1720,13 +1765,13 @@ finish_marking_weak_lists (void) 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); @@ -1736,30 +1781,13 @@ finish_marking_weak_lists (void) break; case WEAK_LIST_VALUE_ASSOC: - if (!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)) + 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) (XCDR (elem))) { need_to_mark_cons = 1; /* We still need to mark elem and XCAR (elem); @@ -1772,23 +1800,23 @@ finish_marking_weak_lists (void) 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; } } @@ -1796,9 +1824,9 @@ finish_marking_weak_lists (void) /* 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; } } @@ -1807,18 +1835,18 @@ finish_marking_weak_lists (void) } 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 = @@ -1834,7 +1862,7 @@ prune_weak_lists (void) /* 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: @@ -1845,10 +1873,10 @@ prune_weak_lists (void) 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); @@ -1889,7 +1917,7 @@ prune_weak_lists (void) if (go_tortoise) tortoise = XCDR (tortoise); go_tortoise = !go_tortoise; - if (EQ (rest2, tortoise)) + if (GC_EQ (rest2, tortoise)) break; } } @@ -1908,7 +1936,6 @@ decode_weak_list_type (Lisp_Object symbol) 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 */ @@ -1923,7 +1950,6 @@ encode_weak_list_type (enum weak_list_type type) 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 (); } @@ -1943,7 +1969,7 @@ DEFUN ("make-weak-list", Fmake_weak_list, 0, 1, 0, /* Return a new weak list object of type TYPE. A weak list object is an object that contains a list. This list behaves like any other list except that its elements do not count towards -garbage collection -- if the only pointer to an object is inside a weak +garbage collection -- if the only pointer to an object in inside a weak list (other than pointers in similar objects such as weak hash tables), the object is garbage collected and automatically removed from the list. This is used internally, for example, to manage the list holding the @@ -1962,8 +1988,6 @@ to `simple'. Recognized types are 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)) { @@ -2034,8 +2058,8 @@ init_data_very_early (void) void init_errors_once_early (void) { - DEFSYMBOL (Qerror_conditions); - DEFSYMBOL (Qerror_message); + defsymbol (&Qerror_conditions, "error-conditions"); + defsymbol (&Qerror_message, "error-message"); /* We declare the errors here because some other deferrors depend on some of the errors below. */ @@ -2043,100 +2067,99 @@ init_errors_once_early (void) /* ERROR is used as a signaler for random errors for which nothing else is right */ - DEFERROR (Qerror, "error", Qnil); - DEFERROR_STANDARD (Qquit, Qnil); + deferror (&Qerror, "error", "error", Qnil); + deferror (&Qquit, "quit", "Quit", Qnil); - DEFERROR (Qunimplemented, "Feature not yet implemented", Qerror); - DEFERROR_STANDARD (Qsyntax_error, Qerror); - DEFERROR_STANDARD (Qinvalid_read_syntax, Qsyntax_error); - DEFERROR_STANDARD (Qlist_formation_error, Qsyntax_error); - - /* Generated by list traversal macros */ - DEFERROR_STANDARD (Qmalformed_list, Qlist_formation_error); - DEFERROR_STANDARD (Qmalformed_property_list, Qmalformed_list); - DEFERROR_STANDARD (Qcircular_list, Qlist_formation_error); - DEFERROR_STANDARD (Qcircular_property_list, Qcircular_list); - - DEFERROR_STANDARD (Qinvalid_argument, Qerror); - DEFERROR_STANDARD (Qwrong_type_argument, Qinvalid_argument); - DEFERROR_STANDARD (Qargs_out_of_range, Qinvalid_argument); - DEFERROR_STANDARD (Qwrong_number_of_arguments, Qinvalid_argument); - DEFERROR_STANDARD (Qinvalid_function, Qinvalid_argument); - DEFERROR (Qno_catch, "No catch for tag", Qinvalid_argument); + deferror (&Qwrong_type_argument, "wrong-type-argument", + "Wrong type argument", Qerror); + deferror (&Qargs_out_of_range, "args-out-of-range", "Args out of range", + Qerror); + deferror (&Qvoid_function, "void-function", + "Symbol's function definition is void", Qerror); + deferror (&Qcyclic_function_indirection, "cyclic-function-indirection", + "Symbol's chain of function indirections contains a loop", Qerror); + deferror (&Qvoid_variable, "void-variable", + "Symbol's value as variable is void", Qerror); + deferror (&Qcyclic_variable_indirection, "cyclic-variable-indirection", + "Symbol's chain of variable indirections contains a loop", Qerror); + deferror (&Qsetting_constant, "setting-constant", + "Attempt to set a constant symbol", Qerror); + deferror (&Qinvalid_read_syntax, "invalid-read-syntax", + "Invalid read syntax", Qerror); + deferror (&Qmalformed_list, "malformed-list", + "Malformed list", Qerror); + deferror (&Qmalformed_property_list, "malformed-property-list", + "Malformed property list", Qerror); + deferror (&Qcircular_list, "circular-list", + "Circular list", Qerror); + deferror (&Qcircular_property_list, "circular-property-list", + "Circular property list", Qerror); + deferror (&Qinvalid_function, "invalid-function", "Invalid function", + Qerror); + deferror (&Qwrong_number_of_arguments, "wrong-number-of-arguments", + "Wrong number of arguments", Qerror); + deferror (&Qno_catch, "no-catch", "No catch for tag", + Qerror); + deferror (&Qbeginning_of_buffer, "beginning-of-buffer", + "Beginning of buffer", Qerror); + deferror (&Qend_of_buffer, "end-of-buffer", "End of buffer", Qerror); + deferror (&Qbuffer_read_only, "buffer-read-only", "Buffer is read-only", + Qerror); - DEFERROR_STANDARD (Qinternal_error, Qerror); + deferror (&Qio_error, "io-error", "IO Error", Qerror); + deferror (&Qend_of_file, "end-of-file", "End of stream", Qio_error); - DEFERROR (Qinvalid_state, "Properties or values have been set incorrectly", - Qerror); - DEFERROR (Qvoid_function, "Symbol's function definition is void", - Qinvalid_state); - DEFERROR (Qcyclic_function_indirection, - "Symbol's chain of function indirections contains a loop", - Qinvalid_state); - DEFERROR (Qvoid_variable, "Symbol's value as variable is void", - Qinvalid_state); - DEFERROR (Qcyclic_variable_indirection, - "Symbol's chain of variable indirections contains a loop", - Qinvalid_state); - - DEFERROR (Qinvalid_operation, - "Operation not allowed or error during operation", Qerror); - DEFERROR (Qinvalid_change, "Attempt to set properties or values incorrectly", - Qinvalid_operation); - DEFERROR (Qsetting_constant, "Attempt to set a constant symbol", - Qinvalid_change); - - DEFERROR (Qediting_error, "Invalid operation during editing", - Qinvalid_operation); - DEFERROR_STANDARD (Qbeginning_of_buffer, Qediting_error); - DEFERROR_STANDARD (Qend_of_buffer, Qediting_error); - DEFERROR (Qbuffer_read_only, "Buffer is read-only", Qediting_error); - - DEFERROR (Qio_error, "IO Error", Qinvalid_operation); - DEFERROR (Qend_of_file, "End of file or stream", Qio_error); - - DEFERROR (Qarith_error, "Arithmetic error", Qinvalid_operation); - DEFERROR (Qrange_error, "Arithmetic range error", Qarith_error); - DEFERROR (Qdomain_error, "Arithmetic domain error", Qarith_error); - DEFERROR (Qsingularity_error, "Arithmetic singularity error", Qdomain_error); - DEFERROR (Qoverflow_error, "Arithmetic overflow error", Qdomain_error); - DEFERROR (Qunderflow_error, "Arithmetic underflow error", Qdomain_error); + deferror (&Qarith_error, "arith-error", "Arithmetic error", Qerror); + deferror (&Qrange_error, "range-error", "Arithmetic range error", + Qarith_error); + deferror (&Qdomain_error, "domain-error", "Arithmetic domain error", + Qarith_error); + deferror (&Qsingularity_error, "singularity-error", + "Arithmetic singularity error", Qdomain_error); + deferror (&Qoverflow_error, "overflow-error", + "Arithmetic overflow error", Qdomain_error); + deferror (&Qunderflow_error, "underflow-error", + "Arithmetic underflow error", Qdomain_error); } void syms_of_data (void) { - INIT_LRECORD_IMPLEMENTATION (weak_list); - - DEFSYMBOL (Qquote); - DEFSYMBOL (Qlambda); - DEFSYMBOL (Qlistp); - DEFSYMBOL (Qtrue_list_p); - DEFSYMBOL (Qconsp); - DEFSYMBOL (Qsubrp); - DEFSYMBOL (Qsymbolp); - DEFSYMBOL (Qintegerp); - DEFSYMBOL (Qcharacterp); - DEFSYMBOL (Qnatnump); - DEFSYMBOL (Qstringp); - DEFSYMBOL (Qarrayp); - DEFSYMBOL (Qsequencep); - DEFSYMBOL (Qbufferp); - DEFSYMBOL (Qbitp); - DEFSYMBOL_MULTIWORD_PREDICATE (Qbit_vectorp); - DEFSYMBOL (Qvectorp); - DEFSYMBOL (Qchar_or_string_p); - DEFSYMBOL (Qmarkerp); - DEFSYMBOL (Qinteger_or_marker_p); - DEFSYMBOL (Qinteger_or_char_p); - DEFSYMBOL (Qinteger_char_or_marker_p); - DEFSYMBOL (Qnumberp); - DEFSYMBOL (Qnumber_char_or_marker_p); - DEFSYMBOL (Qcdr); - DEFSYMBOL_MULTIWORD_PREDICATE (Qweak_listp); + 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"); + defsymbol (&Qstringp, "stringp"); + defsymbol (&Qarrayp, "arrayp"); + defsymbol (&Qsequencep, "sequencep"); + defsymbol (&Qbufferp, "bufferp"); + defsymbol (&Qbitp, "bitp"); + defsymbol (&Qbit_vectorp, "bit-vector-p"); + defsymbol (&Qvectorp, "vectorp"); + defsymbol (&Qcompiled_functionp, "compiled-function-p"); + defsymbol (&Qchar_or_string_p, "char-or-string-p"); + defsymbol (&Qmarkerp, "markerp"); + defsymbol (&Qinteger_or_marker_p, "integer-or-marker-p"); + defsymbol (&Qinteger_or_char_p, "integer-or-char-p"); + defsymbol (&Qinteger_char_or_marker_p, "integer-char-or-marker-p"); + defsymbol (&Qnumberp, "numberp"); + defsymbol (&Qnumber_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"); #ifdef LISP_FLOAT_TYPE - DEFSYMBOL (Qfloatp); + defsymbol (&Qfloatp, "floatp"); #endif /* LISP_FLOAT_TYPE */ DEFSUBR (Fwrong_type_argument); @@ -2144,7 +2167,6 @@ syms_of_data (void) DEFSUBR (Feq); DEFSUBR (Fold_eq); DEFSUBR (Fnull); - Ffset (intern ("not"), intern ("null")); DEFSUBR (Flistp); DEFSUBR (Fnlistp); DEFSUBR (Ftrue_list_p); @@ -2180,6 +2202,7 @@ syms_of_data (void) DEFSUBR (Fsubr_min_args); DEFSUBR (Fsubr_max_args); DEFSUBR (Fsubr_interactive); + DEFSUBR (Fcompiled_function_p); DEFSUBR (Ftype_of); DEFSUBR (Fcar); DEFSUBR (Fcdr); @@ -2191,6 +2214,17 @@ syms_of_data (void) DEFSUBR (Faref); DEFSUBR (Faset); + DEFSUBR (Fcompiled_function_instructions); + DEFSUBR (Fcompiled_function_constants); + DEFSUBR (Fcompiled_function_stack_depth); + DEFSUBR (Fcompiled_function_arglist); + DEFSUBR (Fcompiled_function_interactive); + DEFSUBR (Fcompiled_function_doc_string); + DEFSUBR (Fcompiled_function_domain); +#ifdef COMPILED_FUNCTION_ANNOTATION_HACK + DEFSUBR (Fcompiled_function_annotation); +#endif + DEFSUBR (Fnumber_to_string); DEFSUBR (Fstring_to_number); DEFSUBR (Feqlsign); @@ -2229,13 +2263,12 @@ vars_of_data (void) { /* This must not be staticpro'd */ Vall_weak_lists = Qnil; - dump_add_weak_object_chain (&Vall_weak_lists); #ifdef DEBUG_XEMACS - DEFVAR_BOOL ("debug-issue-ebola-notices", &debug_issue_ebola_notices /* -If non-zero, note when your code may be suffering from char-int confoundance. + DEFVAR_INT ("debug-issue-ebola-notices", &debug_issue_ebola_notices /* +If non-nil, note when your code may be suffering from char-int confoundance. That is to say, if XEmacs encounters a usage of `eq', `memq', `equal', -etc. where an int and a char with the same value are being compared, +etc. where a int and a char with the same value are being compared, it will issue a notice on stderr to this effect, along with a backtrace. In such situations, the result would be different in XEmacs 19 versus XEmacs 20, and you probably don't want this. @@ -2246,7 +2279,7 @@ have its chars and ints all confounded in the byte code, making it impossible to accurately determine Ebola infection. */ ); - debug_issue_ebola_notices = 0; + debug_issue_ebola_notices = 2; /* #### temporary hack */ DEFVAR_INT ("debug-ebola-backtrace-length", &debug_ebola_backtrace_length /* diff --git a/src/database.c b/src/database.c index 79dd595..c30e990 100644 --- a/src/database.c +++ b/src/database.c @@ -27,7 +27,6 @@ Boston, MA 02111-1307, USA. */ #include <config.h> #include "lisp.h" #include "sysfile.h" -#include "buffer.h" #include <errno.h> #ifndef HAVE_DATABASE @@ -53,15 +52,12 @@ typedef uint64_t u_int64_t; #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 */ Lisp_Object Qberkeley_db; Lisp_Object Qhash, Qbtree, Qrecno, Qunknown; -#if DB_VERSION_MAJOR > 2 -Lisp_Object Qqueue; -#endif #endif /* HAVE_BERKELEY_DB */ #ifdef HAVE_DBM @@ -69,31 +65,29 @@ Lisp_Object Qqueue; Lisp_Object Qdbm; #endif /* HAVE_DBM */ -#ifdef MULE -/* #### The following should be settable on a per-database level. - But the whole coding-system infrastructure should be rewritten someday. - We really need coding-system aliases. -- martin */ -Lisp_Object Vdatabase_coding_system; -#endif - Lisp_Object Qdatabasep; +typedef enum { DB_DBM, DB_BERKELEY, DB_IS_UNKNOWN } XEMACS_DB_TYPE; + +struct Lisp_Database; + typedef struct { - Lisp_Object (*get_subtype) (Lisp_Database *); - Lisp_Object (*get_type) (Lisp_Database *); - Lisp_Object (*get) (Lisp_Database *, Lisp_Object); - int (*put) (Lisp_Database *, Lisp_Object, Lisp_Object, Lisp_Object); - int (*rem) (Lisp_Database *, Lisp_Object); - void (*map) (Lisp_Database *, Lisp_Object); - void (*close) (Lisp_Database *); - Lisp_Object (*last_error) (Lisp_Database *); + Lisp_Object (*get_subtype) (struct Lisp_Database *); + Lisp_Object (*get_type) (struct Lisp_Database *); + Lisp_Object (*get) (struct Lisp_Database *, Lisp_Object); + int (*put) (struct Lisp_Database *, Lisp_Object, Lisp_Object, Lisp_Object); + int (*rem) (struct Lisp_Database *, Lisp_Object); + void (*map) (struct Lisp_Database *, Lisp_Object); + void (*close) (struct Lisp_Database *); + Lisp_Object (*last_error) (struct Lisp_Database *); } DB_FUNCS; struct Lisp_Database { struct lcrecord_header header; Lisp_Object fname; + XEMACS_DB_TYPE type; int mode; int access_; int dberrno; @@ -110,9 +104,10 @@ struct Lisp_Database #endif }; -#define XDATABASE(x) XRECORD (x, database, Lisp_Database) +#define XDATABASE(x) XRECORD (x, database, struct 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) @@ -124,10 +119,11 @@ struct Lisp_Database } while (0) -static Lisp_Database * +static struct Lisp_Database * allocate_database (void) { - Lisp_Database *db = alloc_lcrecord_type (Lisp_Database, &lrecord_database); + struct Lisp_Database *db = + alloc_lcrecord_type (struct Lisp_Database, lrecord_database); db->fname = Qnil; db->live_p = 0; @@ -140,6 +136,7 @@ allocate_database (void) db->access_ = 0; db->mode = 0; db->dberrno = 0; + db->type = DB_IS_UNKNOWN; #ifdef MULE db->coding_system = Fget_coding_system (Qbinary); #endif @@ -147,17 +144,19 @@ allocate_database (void) } static Lisp_Object -mark_database (Lisp_Object object) +mark_database (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Database *db = XDATABASE (object); - return db->fname; + struct Lisp_Database *db = XDATABASE (obj); + + ((markobj) (db->fname)); + return Qnil; } static void print_database (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { char buf[64]; - Lisp_Database *db = XDATABASE (obj); + struct Lisp_Database *db = XDATABASE (obj); if (print_readably) error ("printing unreadable object #<database 0x%x>", db->header.uid); @@ -177,30 +176,30 @@ print_database (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) static void finalize_database (void *header, int for_disksave) { - Lisp_Database *db = (Lisp_Database *) header; + struct Lisp_Database *db = (struct Lisp_Database *) header; if (for_disksave) { - Lisp_Object object; - XSETDATABASE (object, db); + Lisp_Object obj; + XSETOBJ (obj, Lisp_Type_Record, (void *) db); signal_simple_error - ("Can't dump an emacs containing database objects", object); + ("Can't dump an emacs containing database objects", obj); } db->funcs->close (db); } DEFINE_LRECORD_IMPLEMENTATION ("database", database, mark_database, print_database, - finalize_database, 0, 0, 0, - Lisp_Database); + finalize_database, 0, 0, + struct Lisp_Database); DEFUN ("close-database", Fclose_database, 1, 1, 0, /* Close database DATABASE. */ (database)) { - Lisp_Database *db; + struct Lisp_Database *db; CHECK_LIVE_DATABASE (database); db = XDATABASE (database); db->funcs->close (db); @@ -229,12 +228,11 @@ Return the subtype of database DATABASE, if any. } DEFUN ("database-live-p", Fdatabase_live_p, 1, 1, 0, /* -Return t if OBJECT is an active database. +Return t if OBJ is an active database. */ - (object)) + (obj)) { - return DATABASEP (object) && DATABASE_LIVE_P (XDATABASE (object)) ? - Qt : Qnil; + return DATABASEP (obj) && DATABASE_LIVE_P (XDATABASE (obj)) ? Qt : Qnil; } DEFUN ("database-file-name", Fdatabase_file_name, 1, 1, 0, /* @@ -248,16 +246,16 @@ Return the filename associated with the database DATABASE. } DEFUN ("databasep", Fdatabasep, 1, 1, 0, /* -Return t if OBJECT is a database. +Return t if OBJ is a database. */ - (object)) + (obj)) { - return DATABASEP (object) ? Qt : Qnil; + return DATABASEP (obj) ? Qt : Qnil; } #ifdef HAVE_DBM static void -dbm_map (Lisp_Database *db, Lisp_Object func) +dbm_map (struct Lisp_Database *db, Lisp_Object func) { datum keydatum, valdatum; Lisp_Object key, val; @@ -274,7 +272,7 @@ dbm_map (Lisp_Database *db, Lisp_Object func) } static Lisp_Object -dbm_get (Lisp_Database *db, Lisp_Object key) +dbm_get (struct Lisp_Database *db, Lisp_Object key) { datum keydatum, valdatum; @@ -288,7 +286,7 @@ dbm_get (Lisp_Database *db, Lisp_Object key) } static int -dbm_put (Lisp_Database *db, +dbm_put (struct Lisp_Database *db, Lisp_Object key, Lisp_Object val, Lisp_Object replace) { datum keydatum, valdatum; @@ -303,7 +301,7 @@ dbm_put (Lisp_Database *db, } static int -dbm_remove (Lisp_Database *db, Lisp_Object key) +dbm_remove (struct Lisp_Database *db, Lisp_Object key) { datum keydatum; @@ -314,25 +312,25 @@ dbm_remove (Lisp_Database *db, Lisp_Object key) } static Lisp_Object -dbm_type (Lisp_Database *db) +dbm_type (struct Lisp_Database *db) { return Qdbm; } static Lisp_Object -dbm_subtype (Lisp_Database *db) +dbm_subtype (struct Lisp_Database *db) { return Qnil; } static Lisp_Object -dbm_lasterr (Lisp_Database *db) +dbm_lasterr (struct Lisp_Database *db) { return lisp_strerror (db->dberrno); } static void -dbm_closeit (Lisp_Database *db) +dbm_closeit (struct Lisp_Database *db) { if (db->dbm_handle) { @@ -356,13 +354,13 @@ static DB_FUNCS ndbm_func_block = #ifdef HAVE_BERKELEY_DB static Lisp_Object -berkdb_type (Lisp_Database *db) +berkdb_type (struct Lisp_Database *db) { return Qberkeley_db; } static Lisp_Object -berkdb_subtype (Lisp_Database *db) +berkdb_subtype (struct Lisp_Database *db) { if (!db->db_handle) return Qnil; @@ -372,28 +370,28 @@ berkdb_subtype (Lisp_Database *db) case DB_BTREE: return Qbtree; case DB_HASH: return Qhash; case DB_RECNO: return Qrecno; -#if DB_VERSION_MAJOR > 2 - case DB_QUEUE: return Qqueue; -#endif default: return Qunknown; } } static Lisp_Object -berkdb_lasterr (Lisp_Database *db) +berkdb_lasterr (struct Lisp_Database *db) { return lisp_strerror (db->dberrno); } static Lisp_Object -berkdb_get (Lisp_Database *db, Lisp_Object key) +berkdb_get (struct Lisp_Database *db, Lisp_Object key) { + /* #### Needs mule-izing */ DBT keydatum, valdatum; int status = 0; - /* DB Version 2 requires DBT's to be zeroed before use. */ +#if DB_VERSION_MAJOR == 2 + /* Always initialize keydatum, valdatum. */ xzero (keydatum); xzero (valdatum); +#endif /* DV_VERSION_MAJOR = 2 */ keydatum.data = XSTRING_DATA (key); keydatum.size = XSTRING_LENGTH (key); @@ -405,7 +403,6 @@ berkdb_get (Lisp_Database *db, Lisp_Object key) #endif /* DB_VERSION_MAJOR */ if (!status) - /* #### Not mule-ized! will crash! */ return make_string ((Bufbyte *) valdatum.data, valdatum.size); #if DB_VERSION_MAJOR == 1 @@ -418,7 +415,7 @@ berkdb_get (Lisp_Database *db, Lisp_Object key) } static int -berkdb_put (Lisp_Database *db, +berkdb_put (struct Lisp_Database *db, Lisp_Object key, Lisp_Object val, Lisp_Object replace) @@ -426,9 +423,11 @@ berkdb_put (Lisp_Database *db, DBT keydatum, valdatum; int status = 0; - /* DB Version 2 requires DBT's to be zeroed before use. */ +#if DB_VERSION_MAJOR == 2 + /* Always initalize keydatum, valdatum. */ xzero (keydatum); xzero (valdatum); +#endif /* DV_VERSION_MAJOR = 2 */ keydatum.data = XSTRING_DATA (key); keydatum.size = XSTRING_LENGTH (key); @@ -448,13 +447,15 @@ berkdb_put (Lisp_Database *db, } static int -berkdb_remove (Lisp_Database *db, Lisp_Object key) +berkdb_remove (struct Lisp_Database *db, Lisp_Object key) { DBT keydatum; int status; - /* DB Version 2 requires DBT's to be zeroed before use. */ +#if DB_VERSION_MAJOR == 2 + /* Always initialize keydatum. */ xzero (keydatum); +#endif /* DV_VERSION_MAJOR = 2 */ keydatum.data = XSTRING_DATA (key); keydatum.size = XSTRING_LENGTH (key); @@ -478,51 +479,45 @@ berkdb_remove (Lisp_Database *db, Lisp_Object key) } static void -berkdb_map (Lisp_Database *db, Lisp_Object func) +berkdb_map (struct Lisp_Database *db, Lisp_Object func) { DBT keydatum, valdatum; Lisp_Object key, val; DB *dbp = db->db_handle; int status; - xzero (keydatum); - xzero (valdatum); - #if DB_VERSION_MAJOR == 1 for (status = dbp->seq (dbp, &keydatum, &valdatum, R_FIRST); 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); } #else - { - DBC *dbcp; + DBC *dbcp; + /* Initialize the key/data pair so the flags aren't set. */ + xzero (keydatum); + xzero (valdatum); -#if DB_VERSION_MAJOR > 2 || DB_VERSION_MINOR >=6 - status = dbp->cursor (dbp, NULL, &dbcp, 0); -#else - status = dbp->cursor (dbp, NULL, &dbcp); -#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 */ - key = make_string ((Bufbyte *) keydatum.data, keydatum.size); - val = make_string ((Bufbyte *) valdatum.data, valdatum.size); - call2 (func, key, val); - } - dbcp->c_close (dbcp); - } + status = dbp->cursor (dbp, NULL, &dbcp); + for (status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_FIRST); + status == 0; + status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_NEXT)) + { + /* ### Needs mule-izing */ + key = make_string ((Bufbyte *) keydatum.data, keydatum.size); + val = make_string ((Bufbyte *) valdatum.data, valdatum.size); + call2 (func, key, val); + } + dbcp->c_close (dbcp); #endif /* DB_VERSION_MAJOR */ } static void -berkdb_close (Lisp_Database *db) +berkdb_close (struct Lisp_Database *db) { if (db->db_handle) { @@ -576,7 +571,7 @@ and defaults to 0755. /* This function can GC */ int modemask; int accessmask = 0; - Lisp_Database *db = NULL; + struct Lisp_Database *db = NULL; char *filename; struct gcpro gcpro1, gcpro2; @@ -584,10 +579,7 @@ and defaults to 0755. GCPRO2 (file, access_); file = Fexpand_file_name (file, Qnil); UNGCPRO; - - TO_EXTERNAL_FORMAT (LISP_STRING, file, - C_STRING_ALLOCA, filename, - Qfile_name); + filename = (char *) XSTRING_DATA (file); if (NILP (access_)) { @@ -630,6 +622,7 @@ and defaults to 0755. db = allocate_database (); db->dbm_handle = dbase; + db->type = DB_DBM; db->funcs = &ndbm_func_block; goto db_done; } @@ -650,10 +643,6 @@ and defaults to 0755. real_subtype = DB_BTREE; else if (EQ (subtype, Qrecno)) real_subtype = DB_RECNO; -#if DB_VERSION_MAJOR > 2 - else if (EQ (subtype, Qqueue)) - real_subtype = DB_QUEUE; -#endif else signal_simple_error ("Unsupported subtype", subtype); @@ -679,29 +668,15 @@ and defaults to 0755. if (strchr (acc, 'r') && !strchr (acc, 'w')) accessmask |= DB_RDONLY; } -#if DB_VERSION_MAJOR == 2 status = db_open (filename, real_subtype, accessmask, modemask, NULL , NULL, &dbase); if (status) return Qnil; -#else - status = db_create (&dbase, NULL, 0); - if (status) - return Qnil; - status = dbase->open (dbase, filename, NULL, - real_subtype, accessmask, modemask); - if (status) - { - dbase->close (dbase, 0); - return Qnil; - } -#endif /* DB_VERSION_MAJOR > 2 */ - /* Normalize into system specific file modes. Only for printing */ - accessmask = accessmask & DB_RDONLY ? O_RDONLY : O_RDWR; #endif /* DB_VERSION_MAJOR */ db = allocate_database (); db->db_handle = dbase; + db->type = DB_BERKELEY; db->funcs = &berk_func_block; goto db_done; } @@ -734,7 +709,7 @@ replace any existing entry in the database. CHECK_STRING (key); CHECK_STRING (value); { - Lisp_Database *db = XDATABASE (database); + struct Lisp_Database *db = XDATABASE (database); int status = db->funcs->put (db, key, value, replace); return status ? Qt : Qnil; } @@ -748,7 +723,7 @@ Remove KEY from DATABASE. CHECK_LIVE_DATABASE (database); CHECK_STRING (key); { - Lisp_Database *db = XDATABASE (database); + struct Lisp_Database *db = XDATABASE (database); int status = db->funcs->rem (db, key); return status ? Qt : Qnil; } @@ -763,7 +738,7 @@ If there is no corresponding value, return DEFAULT (defaults to nil). CHECK_LIVE_DATABASE (database); CHECK_STRING (key); { - Lisp_Database *db = XDATABASE (database); + struct Lisp_Database *db = XDATABASE (database); Lisp_Object retval = db->funcs->get (db, key); return NILP (retval) ? default_ : retval; } @@ -785,8 +760,6 @@ each key and value in the database. void syms_of_database (void) { - INIT_LRECORD_IMPLEMENTATION (database); - defsymbol (&Qdatabasep, "databasep"); #ifdef HAVE_DBM defsymbol (&Qdbm, "dbm"); @@ -796,9 +769,6 @@ syms_of_database (void) defsymbol (&Qhash, "hash"); defsymbol (&Qbtree, "btree"); defsymbol (&Qrecno, "recno"); -#if DB_VERSION_MAJOR > 2 - defsymbol (&Qqueue, "queue"); -#endif defsymbol (&Qunknown, "unknown"); #endif @@ -825,13 +795,4 @@ vars_of_database (void) #ifdef HAVE_BERKELEY_DB Fprovide (Qberkeley_db); #endif - -#if 0 /* #### implement me! */ -#ifdef MULE - DEFVAR_LISP ("database-coding-system", &Vdatabase_coding_system /* -Coding system used to convert data in database files. -*/ ); - Vdatabase_coding_system = Qnil; -#endif -#endif /* 0 */ } diff --git a/src/database.h b/src/database.h index aad2ca5..d9555ca 100644 --- a/src/database.h +++ b/src/database.h @@ -18,13 +18,12 @@ 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 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 --git a/src/dbxrc b/src/dbxrc new file mode 100644 index 0000000..b9ae837 --- /dev/null +++ b/src/dbxrc @@ -0,0 +1,318 @@ +# -*- 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: +# test -r ./dbxrc && . ./dbxrc + +# 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 { + eval $(echo $(whatis -t `alloc.c`dbg_constants) | \ + perl -e 'print "@{[map {s/=(-\d+)/sprintf(q[=0x%x],$1)/oge; /\w+=[0-9a-fx]+/og} <>]}\n"') + xemacs_initted=yes + #printvar dbg_valbits dbg_valmask +} + +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 { + test -z "$xemacs_initted" && XEmacsInit + obj=$[*(void**)(&$1)] + test "$obj" = "(nil)" && obj="0x0" + if test $dbg_USE_MINIMAL_TAGBITS = 1; then + if test $[(int)($obj & 1)] = 1; then + # It's an int + val=$[(long)(((unsigned long long)$obj) >> 1)] + type=$dbg_Lisp_Type_Int + else + type=$[(int)(((void*)$obj) & $dbg_typemask)] + if test $type = $dbg_Lisp_Type_Char; then + val=$[(void*)(long)(((unsigned long long)($obj & $dbg_valmask)) >> $dbg_gctypebits)] + else + # It's a record pointer + val=$[(void*)$obj] + fi + fi + else + # not dbg_USE_MINIMAL_TAGBITS + val=$[(void*)($obj & $dbg_valmask)] + test "$val" = "(nil)" && val="0x0" + type=$[(int)(((unsigned long long)($obj & $dbg_typemask)) >> ($dbg_valbits + 1))] + fi + + if test $type = $dbg_Lisp_Type_Record; then + typeset lheader="((struct lrecord_header *) $val)" + if test $dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 1; then + imp=$[(void*)(lrecord_implementations_table[$lheader->type])] + else + imp=$[(void*)($lheader->implementation)] + fi + else + imp="0xdeadbeef" + fi + #printvar obj val type imp +} + +function xint { + decode_object "$*" + print (long) ($val) +} + +function xtype { + decode_object "$*" + if test $type = $dbg_Lisp_Type_Int; then echo "int" + elif test $type = $dbg_Lisp_Type_Char; then echo "char" + elif test $type = $dbg_Lisp_Type_Symbol; then echo "symbol" + elif test $type = $dbg_Lisp_Type_String; then echo "string" + elif test $type = $dbg_Lisp_Type_Vector; then echo "vector" + elif test $type = $dbg_Lisp_Type_Cons; then echo "cons" + else + echo "record type with name: $[((struct lrecord_implementation *)$imp)->name]" + fi +} + +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 { + unset EMACSLOADPATH + export EMACSBOOTSTRAPLOADPATH=../lisp/:.. + 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 { + unset EMACSLOADPATH + export EMACSBOOTSTRAPLOADPATH=../lisp/:.. + run -batch -l ../lisp/update-elc.el +} + + +function dump-temacs { + unset EMACSLOADPATH + export EMACSBOOTSTRAPLOADPATH=../lisp/:.. + 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 = $dbg_Lisp_Type_Int; then + print -f"Integer: %d" $val + elif test $type = $dbg_Lisp_Type_Char; then + if $val < 128; then + print -f"Char: %c" $val + else + print -f"Char: %d" $val + fi + elif test $type = $dbg_Lisp_Type_String || lrecord_type_p string; then + pstruct Lisp_String + elif test $type = $dbg_Lisp_Type_Cons || lrecord_type_p cons; then + pstruct Lisp_Cons + elif test $type = $dbg_Lisp_Type_Symbol || lrecord_type_p symbol; then + pstruct Lisp_Symbol + echo "Symbol name: $[(char *)($xstruct->name->_data)]" + elif test $type = $dbg_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 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 hashtable; then + pstruct hashtable + elif lrecord_type_p image_instance; then + pstruct Lisp_Image_Instance + elif lrecord_type_p keymap; then + pstruct 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 + 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 + +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) +} diff --git a/src/depend b/src/depend index e120125..f1fefdc 100644 --- a/src/depend +++ b/src/depend @@ -1,244 +1,209 @@ -## This file is automatically generated by `make-src-depend'. Do not modify. +## This file automatically generated by make-src-depend. Do not modify. -#if defined(USE_UNION_TYPE) +#ifdef USE_UNION_TYPE LISP_UNION_H=lisp-union.h #else LISP_UNION_H=lisp-disunion.h #endif -LISP_H=lisp.h config.h general-slots.h lrecord.h symeval.h symsinit.h $(LISP_UNION_H) -#if defined(HAVE_MS_WINDOWS) -console-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h events.h mule-charset.h opaque.h syscommctrl.h systime.h syswindows.h -device-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysdep.h systime.h syswindows.h toolbar.h window.h winslots.h -dialog-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h -dired-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h ndir.h nt.h regex.h sysdir.h sysfile.h sysproc.h systime.h syswindows.h -event-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console-tty.h console.h device.h dragdrop.h events-mod.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h menubar-msw.h menubar.h mule-charset.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h select.h specifier.h syscommctrl.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h toolbar.h window.h winslots.h -frame-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h -glyphs-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h device.h elhash.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h lstream.h mule-charset.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysfile.h syswindows.h toolbar.h window.h winslots.h -gui-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h -menubar-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h menubar-msw.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h -objects-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h device.h hash.h insdel.h mule-charset.h objects-msw.h objects.h specifier.h syscommctrl.h syswindows.h -redisplay-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h gutter.h mule-ccl.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysdep.h systime.h syswindows.h toolbar.h window.h winslots.h -scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h -select-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h device.h file-coding.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h select.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h -toolbar-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h +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 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 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) conslots.h console-msw.h console.h device.h dragdrop.h events-mod.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h menubar-msw.h mule-charset.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h systime.h syswait.h toolbar.h +frame-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.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 faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.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 scrollbar.h specifier.h symeval.h symsinit.h sysfile.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 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 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 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 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 -#if defined(HAVE_X_WINDOWS) -balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-x.h console.h device.h xintrinsic.h -console-x.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h mule-charset.h process.h redisplay.h xintrinsic.h -device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h -dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h -glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lstream.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h toolbar.h window.h winslots.h xintrinsic.h xmu.h -gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h keymap.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -objects-x.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h insdel.h mule-charset.h objects-x.h objects.h specifier.h xintrinsic.h -redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h mule-ccl.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h -scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h redisplay.h scrollbar-x.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h -select-x.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h +#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 events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.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 EmacsManager.h EmacsShell.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.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 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 imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h opaque.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.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 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 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 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 EmacsManager.h EmacsShell.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.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 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 EmacsManager.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.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 EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h 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 xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h #endif -#if defined(HAVE_TTY) -console-tty.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h window.h winslots.h -device-tty.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h -event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h -frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h -objects-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h insdel.h mule-charset.h objects-tty.h objects.h specifier.h syssignal.h systty.h -redisplay-tty.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h +#ifdef HAVE_DATABASE +database.o: $(LISP_H) database.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h #endif -#if defined(HAVE_GTK) -console-gtk.o: $(LISP_H) conslots.h console-gtk.h console.h process.h redisplay.h -device-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gtk-xemacs.h gui.h mule-charset.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h -dialog-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console-gtk.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-gtk.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h -event-gtk.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console-gtk.h console-tty.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gtk-xemacs.h gui.h lstream.h mule-charset.h objects-gtk.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h -frame-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h dragdrop.h events.h extents.h faces.h frame.h frameslots.h glyphs-gtk.h glyphs.h gtk-xemacs.h gui.h mule-charset.h objects-gtk.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h sysdll.h systime.h toolbar.h ui-gtk.h window.h winslots.h -gccache-gtk.o: $(LISP_H) gccache-gtk.h hash.h -glyphs-gtk.o: $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui-gtk.h gui.h imgproc.h insdel.h lstream.h mule-charset.h objects-gtk.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdll.h sysfile.h toolbar.h ui-gtk.h window.h winslots.h -gui-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h frame.h frameslots.h glyphs.h gui-gtk.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -menubar-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console-gtk.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-gtk.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h sysdll.h systime.h toolbar.h ui-gtk.h window.h winslots.h -objects-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h insdel.h mule-charset.h objects-gtk.h objects.h specifier.h -redisplay-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gui.h gutter.h mule-ccl.h mule-charset.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h -scrollbar-gtk.o: $(LISP_H) conslots.h console-gtk.h console.h device.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui-gtk.h gui.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h toolbar.h window.h winslots.h -select-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h select.h specifier.h systime.h toolbar.h window.h winslots.h -toolbar-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h faces.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gtk-xemacs.h gui.h mule-charset.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -ui-gtk.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h elhash.h emacs-marshals.c emacs-widget-accessors.c events.h faces.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui-gtk.h gui.h hash.h mule-charset.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h sysdll.h systime.h ui-byhand.c ui-gtk.h window.h winslots.h +#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-charset.h symeval.h symsinit.h +mule-coding.o: $(LISP_H) buffer.h bufslots.h elhash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-ccl.h mule-charset.h mule-coding.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 #endif -#if defined(HAVE_DATABASE) -database.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h database.h mule-charset.h sysfile.h -#endif -#if defined(MULE) -mule-canna.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h file-coding.h mule-charset.h -mule-ccl.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h file-coding.h mule-ccl.h mule-charset.h -mule-charset.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h elhash.h faces.h lstream.h mule-ccl.h mule-charset.h -mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h redisplay.h scrollbar.h sysdep.h window.h winslots.h -mule.o: $(LISP_H) regex.h -#endif -#if defined(EXTERNAL_WIDGET) +#ifdef EXTERNAL_WIDGET ExternalClient-Xlib.o: extw-Xlib.h ExternalClient.o: ExternalClient.h ExternalClientP.h config.h extw-Xlib.h extw-Xt.h xintrinsicp.h ExternalShell.o: ExternalShell.h ExternalShellP.h config.h extw-Xlib.h extw-Xt.h xintrinsic.h xintrinsicp.h extw-Xlib.o: config.h extw-Xlib.h extw-Xt.o: config.h extw-Xlib.h extw-Xt.h #endif -EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h +EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h EmacsManager.o: EmacsManager.h EmacsManagerP.h config.h xintrinsicp.h xmmanagerp.h EmacsShell-sub.o: EmacsShell.h EmacsShellP.h config.h xintrinsic.h xintrinsicp.h EmacsShell.o: EmacsShell.h ExternalShell.h config.h xintrinsicp.h -abbrev.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h insdel.h mule-charset.h redisplay.h scrollbar.h syntax.h window.h winslots.h -alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console-stream.h console.h device.h dumper.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h +abbrev.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h syntax.h window.h winslots.h +alloc.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h device.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h puresize.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 -buffer.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h process.h redisplay.h scrollbar.h select.h specifier.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h -bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h chartab.h mule-charset.h opaque.h syntax.h -callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h commands.h events.h insdel.h mule-charset.h redisplay.h scrollbar.h systime.h window.h winslots.h -callproc.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h file-coding.h insdel.h lstream.h mule-charset.h nt.h process.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h window.h winslots.h -casefiddle.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h insdel.h mule-charset.h syntax.h -casetab.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h opaque.h -chartab.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h syntax.h -cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systty.h toolbar.h window.h winslots.h -cmdloop.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h -cmds.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h insdel.h mule-charset.h syntax.h -console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h -console.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h -data.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h mule-charset.h sysfloat.h syssignal.h -debug.o: $(LISP_H) bytecode.h debug.h -device.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs.h gui.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h -dgif_lib.o: $(LISP_H) gifrlib.h sysfile.h -dialog.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -dired.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h elhash.h mule-charset.h ndir.h opaque.h regex.h syntax.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h -doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h insdel.h keymap.h mule-charset.h sysfile.h -doprnt.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h lstream.h mule-charset.h -dragdrop.o: $(LISP_H) dragdrop.h -dumper.o: $(LISP_H) conslots.h console-stream.h console.h dumper.h elhash.h nt.h specifier.h sysfile.h syswindows.h -dynarr.o: $(LISP_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 frame.h frameslots.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) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.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 paths.h process.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h window.h winslots.h +casefiddle.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h +casetab.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h +chartab.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h +cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h +cmdloop.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h 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 +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 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 gpmevent.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h +console.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h 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) backtrace.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 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 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 +dialog.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.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 sysdir.h sysfile.h +dll.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysdll.h +doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h +doprnt.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h +dragdrop.o: $(LISP_H) dragdrop.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +dynarr.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h ecrt0.o: config.h -editfns.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syspwd.h systime.h toolbar.h window.h winslots.h -eldap.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h eldap.h mule-charset.h opaque.h sysdep.h -elhash.o: $(LISP_H) bytecode.h elhash.h -emacs-marshals.o: hash.h -emacs-widget-accessors.o: -emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h dumper.h frame.h frameslots.h glyphs.h gui.h mule-charset.h nt.h paths.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h syswindows.h toolbar.h window.h winslots.h -emodules.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h emodules.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h toolbar.h window.h winslots.h -esd.o: $(LISP_H) miscplay.h -eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h chartab.h commands.h conslots.h console.h mule-charset.h opaque.h -event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h -event-stream.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lstream.h macros.h menubar.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h -event-unixoid.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h lstream.h mule-charset.h process.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h -events.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h gui.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h -extents.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h keymap.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -faces.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -file-coding.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h elhash.h file-coding.h insdel.h lstream.h mule-ccl.h mule-charset.h opaque.h -fileio.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h ndir.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h -filelock.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h ndir.h paths.h sysdir.h sysfile.h syspwd.h syssignal.h -filemode.o: $(LISP_H) sysfile.h -floatfns.o: $(LISP_H) sysfloat.h syssignal.h -fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h toolbar.h window.h winslots.h -font-lock.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h insdel.h mule-charset.h syntax.h -frame.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h -free-hook.o: $(LISP_H) hash.h -general.o: $(LISP_H) -getloadavg.o: $(LISP_H) sysfile.h -gif_io.o: config.h gifrlib.h sysfile.h -glade.o: bytecode.h -glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h faces.h file-coding.h frame.h frameslots.h gifrlib.h glyphs.h gui.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h toolbar.h window.h winslots.h -glyphs-widget.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -glyphs.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +editfns.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.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) eldap.h lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h sysdep.h +elhash.o: $(LISP_H) bytecode.h elhash.h hash.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 lisp-disunion.h lisp-union.h lrecord.h mule-charset.h paths.h process.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h +eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h commands.h conslots.h console.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h +event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h blocktype.h buffer.h bufslots.h commands.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 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 gui-x.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 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 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 hash.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 hash.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 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 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 commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.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 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 sysdep.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 +glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h file-coding.h frame.h frameslots.h glyphs.h imgproc.h insdel.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.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h insdel.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 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 lstream.h mule-charset.h process.h sysdep.h sysproc.h syssignal.h systime.h systty.h -gtk-glue.o: -gtk-xemacs.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h faces.h frame.h frameslots.h glyphs.h gtk-xemacs.h gui.h mule-charset.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -gui.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h elhash.h gui.h mule-charset.h -gutter.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -hash.o: $(LISP_H) hash.h -hftctl.o: $(LISP_H) -hpplay.o: $(LISP_H) nativesound.h -imgproc.o: $(LISP_H) imgproc.h -indent.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console-gtk.h console-msw.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lstream.h mule-charset.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h syscommctrl.h sysdll.h systime.h syswindows.h toolbar.h tooltalk.h ui-gtk.h window.h winslots.h xintrinsic.h -input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h -input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -insdel.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h -keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h -lastfile.o: config.h -libsst.o: $(LISP_H) libsst.h -line-number.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h line-number.h mule-charset.h -linuxplay.o: $(LISP_H) miscplay.h nativesound.h sysfile.h syssignal.h -lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h elhash.h file-coding.h lstream.h mule-charset.h opaque.h sysfile.h sysfloat.h -lstream.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h insdel.h lstream.h mule-charset.h sysfile.h -macros.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h keymap.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +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 gui.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +hash.o: $(LISP_H) elhash.h hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +hftctl.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +hpplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +imgproc.o: $(LISP_H) imgproc.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +indent.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h 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 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 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 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 commands.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.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 insdel.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 symeval.h symsinit.h sysfile.h syssignal.h +lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h paths.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 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 casetab.h chartab.h mule-charset.h -md5.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h file-coding.h lstream.h mule-charset.h -menubar.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h keymap.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -minibuf.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h -miscplay.o: $(LISP_H) miscplay.h sysfile.h syssignal.h -nas.o: $(LISP_H) sysdep.h syssignal.h -native-gtk-toolbar.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-gtk.h console.h device.h faces.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui.h mule-charset.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -nt.o: $(LISP_H) ndir.h nt.h ntheap.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h -ntheap.o: $(LISP_H) ntheap.h syswindows.h -ntplay.o: $(LISP_H) nativesound.h nt.h sysfile.h syswindows.h -ntproc.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h mule-charset.h nt.h ntheap.h process.h syscommctrl.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h -objects.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +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 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 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 +nas.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h syssignal.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 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 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) opaque.h -postgresql.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h postgresql.h sysdep.h -print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console-msw.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysfile.h syssignal.h systty.h syswindows.h toolbar.h window.h winslots.h -process-nt.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-msw.h console.h hash.h lstream.h mule-charset.h nt.h process.h procimpl.h syscommctrl.h sysdep.h syswindows.h -process-unix.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h -process.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h insdel.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h -profile.o: $(LISP_H) backtrace.h bytecode.h elhash.h hash.h syssignal.h systime.h -ralloc.o: $(LISP_H) getpagesize.h -rangetab.o: $(LISP_H) rangetab.h -realpath.o: $(LISP_H) syswindows.h -redisplay-output.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -redisplay.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console-tty.h console.h debug.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h menubar.h mule-charset.h objects.h process.h redisplay.h scrollbar.h specifier.h sysfile.h syssignal.h systty.h toolbar.h window.h winslots.h -regex.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h regex.h syntax.h -scrollbar.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -search.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h insdel.h mule-charset.h opaque.h regex.h syntax.h -select.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h toolbar.h window.h winslots.h -sgiplay.o: $(LISP_H) libst.h -sheap.o: $(LISP_H) sheap-adjust.h -signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h -sound.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h mule-charset.h nativesound.h redisplay.h sysdep.h sysfile.h sysproc.h systime.h xintrinsic.h -specifier.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +opaque.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h +print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h conslots.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h 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 commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.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 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 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 sysdep.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 hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h syssignal.h systime.h +pure.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h puresize-adjust.h puresize.h symeval.h symsinit.h +ralloc.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h +rangetab.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h rangetab.h symeval.h symsinit.h +realpath.o: config.h +redisplay-output.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h faces.h frame.h frameslots.h glyphs.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.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 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 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 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 commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h regex.h symeval.h symsinit.h syntax.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 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 commands.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 conslots.h console.h device.h frame.h frameslots.h glyphs.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 window.h winslots.h strcat.o: config.h strcmp.o: config.h strcpy.o: config.h -strftime.o: $(LISP_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) nativesound.h sysdep.h syssignal.h -sunpro.o: $(LISP_H) -symbols.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h elhash.h mule-charset.h -syntax.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h extents.h mule-charset.h syntax.h -sysdep.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h ndir.h nt.h ntheap.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h toolbar.h window.h winslots.h +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 commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h +sysdep.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h ntheap.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h sysdll.o: config.h sysdll.h -termcap.o: $(LISP_H) conslots.h console.h device.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 casetab.h chartab.h lstream.h mule-charset.h opaque.h -toolbar.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -tooltalk.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h elhash.h mule-charset.h process.h syssignal.h tooltalk.h +toolbar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.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 -ui-byhand.o: gui.h -undo.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h extents.h mule-charset.h -unexaix.o: $(LISP_H) getpagesize.h +undo.o: $(LISP_H) buffer.h bufslots.h extents.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h +unexaix.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h unexalpha.o: config.h unexapollo.o: config.h unexconvex.o: config.h getpagesize.h -unexcw.o: $(LISP_H) sysfile.h -unexec.o: $(LISP_H) getpagesize.h +unexcw.o: config.h sysfile.h +unexec.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h unexelf.o: config.h -unexelfsgi.o: config.h +unexelfsgi.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h unexenix.o: config.h unexfreebsd.o: config.h unexhp9k3.o: config.h sysdep.h -unexhp9k800.o: $(LISP_H) +unexhp9k800.o: config.h unexmips.o: config.h getpagesize.h -unexnt.o: $(LISP_H) nt.h ntheap.h syswindows.h +unexnt.o: ntheap.h unexsunos4.o: config.h -vm-limit.o: $(LISP_H) mem-limits.h -widget.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h -win32.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h mule-charset.h syswindows.h -window.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h commands.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -xgccache.o: $(LISP_H) hash.h xgccache.h +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 insdel.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 faces.h frame.h frameslots.h glyphs.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 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 --git a/src/device-gtk.c b/src/device-gtk.c index c17c597..408bc7f 100644 --- a/src/device-gtk.c +++ b/src/device-gtk.c @@ -126,9 +126,6 @@ extern void emacs_gtk_selection_handle (GtkWidget *, guint info, guint time_stamp, gpointer data); -extern void emacs_gtk_selection_clear_event_handle (GtkWidget *widget, - GdkEventSelection *event, - gpointer data); extern void emacs_gtk_selection_received (GtkWidget *widget, GtkSelectionData *selection_data, gpointer user_data); @@ -287,15 +284,9 @@ gtk_init_device (struct device *d, Lisp_Object props) /* Need to set up some selection handlers */ gtk_selection_add_target (GTK_WIDGET (app_shell), GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 0); - gtk_selection_add_target (GTK_WIDGET (app_shell), - gdk_atom_intern("CLIPBOARD", FALSE), - GDK_SELECTION_TYPE_STRING, 0); gtk_signal_connect (GTK_OBJECT (app_shell), "selection_get", GTK_SIGNAL_FUNC (emacs_gtk_selection_handle), NULL); - gtk_signal_connect (GTK_OBJECT (app_shell), "selection_clear_event", - GTK_SIGNAL_FUNC (emacs_gtk_selection_clear_event_handle), - NULL); gtk_signal_connect (GTK_OBJECT (app_shell), "selection_received", GTK_SIGNAL_FUNC (emacs_gtk_selection_received), NULL); @@ -689,6 +680,12 @@ Get the style information for a Gtk device. return (result); } +static unsigned int +gtk_device_implementation_flags (void) +{ + return 0; /* XDEVIMPF_PIXEL_GEOMETRY; */ +} + /************************************************************************/ /* initialization */ @@ -720,10 +717,7 @@ console_type_create_device_gtk (void) CONSOLE_HAS_METHOD (gtk, mark_device); CONSOLE_HAS_METHOD (gtk, delete_device); CONSOLE_HAS_METHOD (gtk, device_system_metrics); - /* CONSOLE_IMPLEMENTATION_FLAGS (gtk, XDEVIMPF_PIXEL_GEOMETRY); */ - /* I inserted the above commented out statement, as the original - implementation of gtk_device_implementation_flags(), which I - deleted, contained commented out XDEVIMPF_PIXEL_GEOMETRY - kkm*/ + CONSOLE_HAS_METHOD (gtk, device_implementation_flags); } void diff --git a/src/dll.c b/src/dll.c new file mode 100644 index 0000000..94225cf --- /dev/null +++ b/src/dll.c @@ -0,0 +1,94 @@ +/* Lisp interface to dynamic loading. + Copyright (C) 1998 Joshua Rowe. + Additional cleanup by Hrvoje Niksic. + +This file is part of XEmacs. + +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; 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. */ + +/* A shared object must have the symbol `emacs_initialize' defined. + It should contain initialization of functions, symbols, etc. and + their loading into Lisp-land. The function will be called without + arguments and is not expected to return any. + + All of this needs lots and LOTS of work. Some things to work on: + + 1) A good foreign interface. This is probably tough, because it + implies drawing a new border between "external" and "internal" + stuff (traditionally, Lisp code was external, while C was + internal). Also, we need a modules/ directory with a few nice + sample modules, a sample Makefile, etc. so people can start + hacking. + + 2) All of this is sooo simple-minded. As it gets more complex, + we'll have to look at how others have done similar things + (e.g. Perl 5 and Zsh 3.1), to avoid botching it up. */ + +#include <config.h> +#include "lisp.h" +#include "buffer.h" +#include "sysdll.h" +#include <errno.h> + +DEFUN ("dll-open", Fdll_open, 1, 1, "FShared object: ", /* +Load LIBRARY as a shared object file. + +After the LIBRARY is dynamically linked with the executable, the +`emacs_initialize' function will be called without arguments. It +should define all the symbols, subr's and variables the module +introduces. + +After this point, any lisp symbols defined in the shared object are +available for use. +*/ + (library)) +{ + /* This function can GC */ + dll_handle *handle; + void (*function) (void); + CONST char *filename; + + CHECK_STRING (library); + library = Fexpand_file_name (library, Qnil); + + GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (XSTRING_DATA (library), filename); + + handle = (dll_handle *) dll_open (filename); + if (handle == NULL) + { + signal_error (Qerror, + list3 (build_translated_string ("Cannot load shared library"), + library, build_translated_string (dll_error (handle)))); + } + + /* #### Perhaps emacs_initialize() should return a Lisp_Object, so + we can return it? */ + + function = (void (*)(void)) dll_function (handle, "emacs_initialize"); + if (!function) + signal_simple_error ("Shared library does not define `emacs_initialize'", + library); + (*function) (); + + return Qnil; +} + +void syms_of_dll () +{ + DEFSUBR (Fdll_open); +} diff --git a/src/doprnt.c b/src/doprnt.c index b9951ae..5dac446 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -31,12 +31,13 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" #include "lstream.h" -static const char * const valid_flags = "-+ #0"; -static const char * const valid_converters = "dic" "ouxX" "feEgG" "sS"; -static const char * const int_converters = "dic"; -static const char * const unsigned_int_converters = "ouxX"; -static const char * const double_converters = "feEgG"; -static const char * const string_converters = "sS"; +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"; typedef struct printf_spec printf_spec; struct printf_spec @@ -65,6 +66,8 @@ struct printf_spec typedef union printf_arg printf_arg; union printf_arg { + int i; + unsigned int ui; long l; unsigned long ul; double d; @@ -87,41 +90,58 @@ typedef struct Dynarr_declare (union printf_arg); } printf_arg_dynarr; -/* Append STRING (of length LEN bytes) to STREAM. - MINLEN is the minimum field width. - If MINUS_FLAG is set, left-justify the string in its field; - otherwise, right-justify. - If ZERO_FLAG is set, pad with 0's; otherwise pad with spaces. - If MAXLEN is non-negative, the string is first truncated on the - right to that many characters. +/* Append STRING (of length LEN) to STREAM. MINLEN is the minimum field + width. If MINUS_FLAG is set, left-justify the string in its field; + otherwise, right-justify. If ZERO_FLAG is set, pad with 0's; otherwise + pad with spaces. If MAXLEN is non-negative, the string is first + truncated to that many character. 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; + Bufbyte pad; Lstream *lstr = XLSTREAM (stream); - Charcount cclen = bytecount_to_charcount (string, len); - int to_add = minlen - cclen; + + cclen = bytecount_to_charcount (string, len); + + if (zero_flag) + pad = '0'; + else + pad = ' '; /* Padding at beginning to right-justify ... */ - if (!minus_flag) - while (to_add-- > 0) - Lstream_putc (lstr, zero_flag ? '0' : ' '); + if (minlen > cclen && !minus_flag) + { + int to_add = minlen - cclen; + while (to_add > 0) + { + Lstream_putc (lstr, pad); + to_add--; + } + } - if (0 <= maxlen && maxlen < cclen) - len = charcount_to_bytecount (string, maxlen); + if (maxlen >= 0) + len = charcount_to_bytecount (string, min (maxlen, cclen)); Lstream_write (lstr, string, len); /* Padding at end to left-justify ... */ - if (minus_flag) - while (to_add-- > 0) - Lstream_putc (lstr, zero_flag ? '0' : ' '); + if (minlen > cclen && minus_flag) + { + int to_add = minlen - cclen; + while (to_add > 0) + { + Lstream_putc (lstr, pad); + to_add--; + } + } } -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; @@ -158,17 +178,17 @@ parse_off_posnum (const Bufbyte *start, const Bufbyte *end, int *returned_num) } 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); @@ -196,7 +216,7 @@ parse_doprnt_spec (const Bufbyte *format, Bytecount format_length) /* Is there a field number specifier? */ { - const Bufbyte *ptr; + CONST Bufbyte *ptr; int fieldspec; ptr = parse_off_posnum (fmt, fmt_end, &fieldspec); @@ -217,11 +237,11 @@ parse_doprnt_spec (const Bufbyte *format, Bytecount format_length) { switch (ch) { - case '-': spec.minus_flag = 1; break; - case '+': spec.plus_flag = 1; break; - case ' ': spec.space_flag = 1; break; + case '-': spec.minus_flag = 1; break; + case '+': spec.plus_flag = 1; break; + case ' ': spec.space_flag = 1; break; case '#': spec.number_flag = 1; break; - case '0': spec.zero_flag = 1; break; + case '0': spec.zero_flag = 1; break; default: abort (); } NEXT_ASCII_BYTE (ch); @@ -360,24 +380,26 @@ get_doprnt_args (printf_spec_dynarr *specs, va_list vargs) ch = spec->converter; + /* int even if ch == 'c': "the type used in va_arg is supposed to + match the actual type **after default promotions**." */ + if (strchr (int_converters, ch)) { - if (spec->l_flag) + if (spec->h_flag) + arg.i = va_arg (vargs, short); + else if (spec->l_flag) arg.l = va_arg (vargs, long); else - /* int even if ch == 'c' or spec->h_flag: - "the type used in va_arg is supposed to match the - actual type **after default promotions**." - Hence we read an int, not a short, if spec->h_flag. */ - arg.l = va_arg (vargs, int); + arg.i = va_arg (vargs, int); } else if (strchr (unsigned_int_converters, ch)) { - if (spec->l_flag) + if (spec->h_flag) + arg.ui = va_arg (vargs, unsigned short); + else if (spec->l_flag) arg.ul = va_arg (vargs, unsigned long); else - /* unsigned int even if ch == 'c' or spec->h_flag */ - arg.ul = (unsigned long) va_arg (vargs, unsigned int); + arg.ui = va_arg (vargs, unsigned int); } else if (strchr (double_converters, ch)) arg.d = va_arg (vargs, double); @@ -401,11 +423,11 @@ get_doprnt_args (printf_spec_dynarr *specs, va_list vargs) 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; @@ -418,12 +440,12 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, 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) { - /* allow too many args for string, but not too few */ + /* allow too many args for string, but not too few */ if (nargs < get_args_needed (specs)) signal_error (Qwrong_number_of_arguments, list3 (Qformat, @@ -444,9 +466,8 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, /* Copy the text before */ if (!NILP (format_reloc)) /* refetch in case of GC below */ format_nonreloc = XSTRING_DATA (format_reloc); - - doprnt_1 (stream, format_nonreloc + spec->text_before, - spec->text_before_len, 0, -1, 0, 0); + doprnt_1 (stream, format_nonreloc + spec->text_before, + spec->text_before_len, 0, -1, 0, 0); ch = spec->converter; @@ -477,17 +498,17 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, else { nextspec->minwidth = XINT (obj); - if (XINT (obj) < 0) + if (XINT(obj) < 0) { spec->minus_flag = 1; nextspec->minwidth = - nextspec->minwidth; } } - nextspec->minus_flag = spec->minus_flag; - nextspec->plus_flag = spec->plus_flag; - nextspec->space_flag = spec->space_flag; + nextspec->minus_flag = spec->minus_flag; + nextspec->plus_flag = spec->plus_flag; + nextspec->space_flag = spec->space_flag; nextspec->number_flag = spec->number_flag; - nextspec->zero_flag = spec->zero_flag; + nextspec->zero_flag = spec->zero_flag; } continue; } @@ -517,7 +538,7 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, else { Lisp_Object obj = largs[spec->argnum - 1]; - Lisp_String *ls; + struct Lisp_String *ls; if (ch == 'S') { @@ -555,7 +576,7 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, { Lisp_Object obj = largs[spec->argnum - 1]; if (CHARP (obj)) - obj = make_int (XCHAR (obj)); + CHECK_INT_COERCE_CHAR (obj); if (!INT_OR_FLOATP (obj)) { error ("format specifier %%%c doesn't match argument type", @@ -565,13 +586,26 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, arg.d = XFLOATINT (obj); else { - if (FLOATP (obj)) - obj = Ftruncate (obj); + int val; + if (FLOATP (obj)) + val = XINT (Ftruncate (obj)); + else + val = XINT (obj); if (strchr (unsigned_int_converters, ch)) - arg.ul = (unsigned long) XINT (obj); + { + if (spec->l_flag) + arg.ul = (unsigned long) val; + else + arg.ui = (unsigned int) val; + } else - arg.l = XINT (obj); + { + if (spec->l_flag) + arg.l = (long) val; + else + arg.i = val; + } } } @@ -582,7 +616,10 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, Bytecount charlen; Bufbyte charbuf[MAX_EMCHAR_LEN]; - a = (Emchar) arg.l; + if (spec->l_flag) + a = (Emchar) arg.l; + else + a = (Emchar) arg.i; if (!valid_char_p (a)) error ("invalid character value %d to %%c spec", a); @@ -591,57 +628,61 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, doprnt_1 (stream, charbuf, charlen, spec->minwidth, -1, spec->minus_flag, spec->zero_flag); } + else { - /* ASCII Decimal representation uses 2.4 times as many - bits as machine binary. */ - char *text_to_print = - alloca_array (char, 32 + - max (spec->minwidth, - (EMACS_INT) - max (sizeof (double), sizeof (long)) * 3 + - max (spec->precision, 0))); + char text_to_print[500]; char constructed_spec[100]; - char *p = constructed_spec; - /* Mostly reconstruct the spec and use sprintf() to + /* Partially reconstruct the spec and use sprintf() to format the string. */ - *p++ = '%'; - if (spec->plus_flag) *p++ = '+'; - if (spec->space_flag) *p++ = ' '; - if (spec->number_flag) *p++ = '#'; - if (spec->minus_flag) *p++ = '-'; - if (spec->zero_flag) *p++ = '0'; - - if (spec->minwidth >= 0) - p = long_to_string (p, spec->minwidth); + /* Make sure nothing stupid happens */ + /* DO NOT REMOVE THE (int) CAST! Incorrect results will + follow! */ + spec->precision = min (spec->precision, + (int) (sizeof (text_to_print) - 50)); + + constructed_spec[0] = 0; + strcat (constructed_spec, "%"); + if (spec->plus_flag) + strcat (constructed_spec, "+"); + if (spec->space_flag) + strcat (constructed_spec, " "); + if (spec->number_flag) + strcat (constructed_spec, "#"); if (spec->precision >= 0) { - *p++ = '.'; - p = long_to_string (p, spec->precision); + strcat (constructed_spec, "."); + long_to_string (constructed_spec + strlen (constructed_spec), + spec->precision); } - + sprintf (constructed_spec + strlen (constructed_spec), "%c", ch); + + /* sprintf the mofo */ + /* we have to use separate calls to sprintf(), rather than + a single big conditional, because of the different types + of the arguments */ if (strchr (double_converters, ch)) + sprintf (text_to_print, constructed_spec, arg.d); + else if (strchr (unsigned_int_converters, ch)) { - *p++ = ch; - *p++ = '\0'; - sprintf (text_to_print, constructed_spec, arg.d); + if (spec->l_flag) + sprintf (text_to_print, constructed_spec, arg.ul); + else + sprintf (text_to_print, constructed_spec, arg.ui); } else { - *p++ = 'l'; /* Always use longs with sprintf() */ - *p++ = ch; - *p++ = '\0'; - - if (strchr (unsigned_int_converters, ch)) - sprintf (text_to_print, constructed_spec, arg.ul); - else + if (spec->l_flag) sprintf (text_to_print, constructed_spec, arg.l); + else + sprintf (text_to_print, constructed_spec, arg.i); } doprnt_1 (stream, (Bufbyte *) text_to_print, - strlen (text_to_print), 0, -1, 0, 0); + strlen (text_to_print), + spec->minwidth, -1, spec->minus_flag, spec->zero_flag); } } } @@ -656,9 +697,9 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, /* 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; @@ -691,7 +732,7 @@ emacs_doprnt_2 (Lisp_Object stream, const Bufbyte *format_nonreloc, 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, ...) { @@ -708,7 +749,7 @@ emacs_doprnt_c (Lisp_Object stream, const Bufbyte *format_nonreloc, /* 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) { @@ -722,9 +763,9 @@ emacs_doprnt_va (Lisp_Object stream, const Bufbyte *format_nonreloc, 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); @@ -733,7 +774,7 @@ emacs_doprnt_lisp (Lisp_Object stream, const Bufbyte *format_nonreloc, /* 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, ...) { @@ -755,7 +796,7 @@ emacs_doprnt_lisp_2 (Lisp_Object stream, const Bufbyte *format_nonreloc, 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, ...) { @@ -778,7 +819,7 @@ emacs_doprnt_string_c (const Bufbyte *format_nonreloc, } 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) { @@ -801,9 +842,9 @@ emacs_doprnt_string_va (const Bufbyte *format_nonreloc, } 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 (); @@ -821,7 +862,7 @@ emacs_doprnt_string_lisp (const Bufbyte *format_nonreloc, } 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 --git a/src/dump-id.h b/src/dump-id.h new file mode 100644 index 0000000..45dc9c1 --- /dev/null +++ b/src/dump-id.h @@ -0,0 +1,6 @@ +#ifndef INCLUDED_dump_id_h_ +#define INCLUDED_dump_id_h_ + +extern unsigned int dump_id; + +#endif diff --git a/src/dumper.c b/src/dumper.c index 3c5b04d..1bb3172 100644 --- a/src/dumper.c +++ b/src/dumper.c @@ -1,6 +1,5 @@ /* Portable data dumper for XEmacs. Copyright (C) 1999-2000 Olivier Galibert - Copyright (C) 2001 Martin Buchholz This file is part of XEmacs. @@ -23,20 +22,17 @@ Boston, MA 02111-1307, USA. */ #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 ':' @@ -44,119 +40,6 @@ Boston, MA 02111-1307, USA. */ typedef struct { - void *varaddress; - size_t size; -} pdump_opaque; - -typedef struct -{ - Dynarr_declare (pdump_opaque); -} pdump_opaque_dynarr; - -typedef struct -{ - void **ptraddress; - const struct struct_description *desc; -} pdump_root_struct_ptr; - -typedef struct -{ - Dynarr_declare (pdump_root_struct_ptr); -} pdump_root_struct_ptr_dynarr; - -typedef struct -{ - Lisp_Object *address; - Lisp_Object value; -} pdump_static_Lisp_Object; - -typedef struct -{ - char **address; /* char * for ease of doing relocation */ - char * value; -} pdump_static_pointer; - -static pdump_opaque_dynarr *pdump_opaques; -static pdump_root_struct_ptr_dynarr *pdump_root_struct_ptrs; -static Lisp_Object_ptr_dynarr *pdump_root_objects; -static Lisp_Object_ptr_dynarr *pdump_weak_object_chains; - -/* Mark SIZE bytes at non-heap address VARADDRESS for dumping as is, - without any bit-twiddling. */ -void -dump_add_opaque (void *varaddress, size_t size) -{ - pdump_opaque info; - info.varaddress = varaddress; - info.size = size; - if (pdump_opaques == NULL) - pdump_opaques = Dynarr_new (pdump_opaque); - Dynarr_add (pdump_opaques, info); -} - -/* Mark the struct described by DESC and pointed to by the pointer at - non-heap address VARADDRESS for dumping. - All the objects reachable from this pointer will also be dumped. */ -void -dump_add_root_struct_ptr (void *ptraddress, const struct struct_description *desc) -{ - pdump_root_struct_ptr info; - info.ptraddress = (void **) ptraddress; - info.desc = desc; - if (pdump_root_struct_ptrs == NULL) - pdump_root_struct_ptrs = Dynarr_new (pdump_root_struct_ptr); - Dynarr_add (pdump_root_struct_ptrs, info); -} - -/* Mark the Lisp_Object at non-heap address VARADDRESS for dumping. - All the objects reachable from this var will also be dumped. */ -void -dump_add_root_object (Lisp_Object *varaddress) -{ - if (pdump_root_objects == NULL) - pdump_root_objects = Dynarr_new2 (Lisp_Object_ptr_dynarr, Lisp_Object *); - Dynarr_add (pdump_root_objects, varaddress); -} - -/* Mark the list pointed to by the Lisp_Object at VARADDRESS for dumping. */ -void -dump_add_weak_object_chain (Lisp_Object *varaddress) -{ - if (pdump_weak_object_chains == NULL) - pdump_weak_object_chains = Dynarr_new2 (Lisp_Object_ptr_dynarr, Lisp_Object *); - Dynarr_add (pdump_weak_object_chains, varaddress); -} - - -inline static void -pdump_align_stream (FILE *stream, size_t alignment) -{ - long offset = ftell (stream); - long adjustment = ALIGN_SIZE (offset, alignment) - offset; - if (adjustment) - fseek (stream, adjustment, SEEK_CUR); -} - -#define PDUMP_ALIGN_OUTPUT(type) pdump_align_stream (pdump_out, ALIGNOF (type)) - -#define PDUMP_WRITE(type, object) \ -fwrite (&object, sizeof (object), 1, pdump_out); - -#define PDUMP_WRITE_ALIGNED(type, object) do { \ - PDUMP_ALIGN_OUTPUT (type); \ - PDUMP_WRITE (type, object); \ -} while (0) - -#define PDUMP_READ(ptr, type) \ -(((type *) (ptr = (char*) (((type *) ptr) + 1)))[-1]) - -#define PDUMP_READ_ALIGNED(ptr, type) \ -((ptr = (char *) ALIGN_PTR (ptr, ALIGNOF (type))), PDUMP_READ (ptr, type)) - - - -typedef struct -{ const struct lrecord_description *desc; int count; } pdump_reloc_table; @@ -189,101 +72,101 @@ pdump_objects_unmark (void) /* The structure of the file - 0 - header - - dumped objects - stab_offset - nb_root_struct_ptrs*pair(void *, adr) - for pointers to structures - - nb_opaques*pair(void *, size) for raw bits to restore - - relocation table - - root lisp object address/value couples with the count - preceding the list + * + * 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 PDUMP_SIGNATURE "XEmacsDP" -#define PDUMP_SIGNATURE_LEN (sizeof (PDUMP_SIGNATURE) - 1) +#define DUMP_SIGNATURE "XEmacsDP" +#define DUMP_SIGNATURE_LEN (sizeof (DUMP_SIGNATURE) - 1) typedef struct { - char signature[PDUMP_SIGNATURE_LEN]; + char signature[DUMP_SIGNATURE_LEN]; unsigned int id; EMACS_UINT stab_offset; EMACS_UINT reloc_address; - int nb_root_struct_ptrs; - int nb_opaques; -} pdump_header; + int nb_staticpro; + int nb_structdmp; + int nb_opaquedmp; +} dump_header; -char *pdump_start; -char *pdump_end; +char *pdump_start, *pdump_end; static size_t pdump_length; +void (*pdump_free) (void); -#ifdef WIN32_NATIVE -/* Handle for the dump file */ -static HANDLE pdump_hFile = INVALID_HANDLE_VALUE; -/* Handle for the file mapping object for the dump file */ -static HANDLE pdump_hMap = INVALID_HANDLE_VALUE; -#endif - -static void (*pdump_free) (void); - -static unsigned char pdump_align_table[] = +static const unsigned char align_table[256] = { - 64, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, - 16, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, - 32, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, - 16, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1 + 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 }; -static inline unsigned int -pdump_size_to_align (size_t size) +typedef struct pdump_entry_list_elmt { - return pdump_align_table[size % countof (pdump_align_table)]; -} - -typedef struct pdump_entry_list_elt -{ - struct pdump_entry_list_elt *next; + struct pdump_entry_list_elmt *next; const void *obj; size_t size; int count; + int is_lrecord; EMACS_INT save_offset; -} pdump_entry_list_elt; +} pdump_entry_list_elmt; typedef struct { - pdump_entry_list_elt *first; + pdump_entry_list_elmt *first; int align; int count; } pdump_entry_list; -typedef struct pdump_struct_list_elt +typedef struct pdump_struct_list_elmt { pdump_entry_list list; const struct struct_description *sdesc; -} pdump_struct_list_elt; +} pdump_struct_list_elmt; typedef struct { - pdump_struct_list_elt *list; + pdump_struct_list_elmt *list; int count; int size; } pdump_struct_list; -static pdump_entry_list *pdump_object_table; +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; +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; -static FILE *pdump_out; #define PDUMP_HASHSIZE 200001 -static pdump_entry_list_elt **pdump_hash; +static pdump_entry_list_elmt **pdump_hash; /* Since most pointers are eight bytes aligned, the >>3 allows for a better hash */ static int @@ -292,11 +175,11 @@ pdump_make_hash (const void *obj) return ((unsigned long)(obj)>>3) % PDUMP_HASHSIZE; } -static pdump_entry_list_elt * +static pdump_entry_list_elmt * pdump_get_entry (const void *obj) { int pos = pdump_make_hash (obj); - pdump_entry_list_elt *e; + pdump_entry_list_elmt *e; assert (obj != 0); @@ -313,10 +196,10 @@ pdump_get_entry (const void *obj) } static void -pdump_add_entry (pdump_entry_list *list, const void *obj, size_t size, - int count) +pdump_add_entry (pdump_entry_list *list, const void *obj, size_t size, int count, int is_lrecord) { - pdump_entry_list_elt *e; + pdump_entry_list_elmt *e; + int align; int pos = pdump_make_hash (obj); while ((e = pdump_hash[pos]) != 0) @@ -329,23 +212,24 @@ pdump_add_entry (pdump_entry_list *list, const void *obj, size_t size, pos = 0; } - e = xnew (pdump_entry_list_elt); + 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; - { - int align = pdump_size_to_align (size); + align = align_table[size & 255]; + if (align < 2 && is_lrecord) + align = 2; - if (align < list->align) - list->align = align; - } + if (align < list->align) + list->align = align; } static pdump_entry_list * @@ -362,12 +246,12 @@ pdump_get_entry_list (const struct struct_description *sdesc) pdump_struct_table.size = 10; else pdump_struct_table.size = pdump_struct_table.size * 2; - pdump_struct_table.list = (pdump_struct_list_elt *) + pdump_struct_table.list = (pdump_struct_list_elmt *) xrealloc (pdump_struct_table.list, - pdump_struct_table.size * sizeof (pdump_struct_list_elt)); + 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 = ALIGNOF (max_align_t); + 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; @@ -383,17 +267,14 @@ static struct static int depth; -static void -pdump_backtrace (void) +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); + stderr_out (" - ind. (%d, %d)\n", backtrace[i].position, backtrace[i].offset); else { stderr_out (" - %s (%d, %d)\n", @@ -405,16 +286,12 @@ pdump_backtrace (void) } static void pdump_register_object (Lisp_Object obj); -static void pdump_register_struct (const void *data, - const struct struct_description *sdesc, - int count); +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) +pdump_get_indirect_count (EMACS_INT code, const struct lrecord_description *idesc, const void *idata) { - EMACS_INT count = 0; /* initialize to shut up GCC */ + EMACS_INT count; const void *irdata; int line = XD_INDIRECT_VAL (code); @@ -436,8 +313,7 @@ pdump_get_indirect_count (EMACS_INT code, count = *(Bytecount *)irdata; break; default: - stderr_out ("Unsupported count type : %d (line = %d, code=%ld)\n", - idesc[line].type, line, (long)code); + stderr_out ("Unsupported count type : %d (line = %d, code=%ld)\n", idesc[line].type, line, (long)code); pdump_backtrace (); abort (); } @@ -468,6 +344,7 @@ pdump_register_sub (const void *data, const struct lrecord_description *desc, in case XD_INT: case XD_LONG: case XD_BYTECOUNT: + case XD_LO_RESET_NIL: case XD_INT_RESET: case XD_LO_LINK: break; @@ -478,21 +355,24 @@ pdump_register_sub (const void *data, const struct lrecord_description *desc, in count = pdump_get_indirect_count (count, desc, data); pdump_add_entry (&pdump_opaque_data_list, - *(void **)rdata, count, 1); + *(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); + 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); + pdump_add_entry (&pdump_opaque_data_list, str, strlen (str)+1, 1, 0); break; } case XD_LISP_OBJECT: @@ -548,7 +428,6 @@ static void pdump_register_object (Lisp_Object obj) { struct lrecord_header *objh; - const struct lrecord_implementation *imp; if (!POINTER_TYPE_P (XTYPE (obj))) return; @@ -560,9 +439,7 @@ pdump_register_object (Lisp_Object obj) if (pdump_get_entry (objh)) return; - imp = LHEADER_IMPLEMENTATION (objh); - - if (imp->description) + if (LHEADER_IMPLEMENTATION (objh)->description) { int me = depth++; if (me>65536) @@ -576,25 +453,26 @@ pdump_register_object (Lisp_Object obj) pdump_add_entry (pdump_object_table + objh->type, objh, - imp->static_size ? - imp->static_size : - imp->size_in_bytes_method (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, imp->description, me); + pdump_register_sub (objh, + LHEADER_IMPLEMENTATION (objh)->description, + me); --depth; } else { pdump_alert_undump_object[objh->type]++; - stderr_out ("Undumpable object type : %s\n", imp->name); + 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) +pdump_register_struct (const void *data, const struct struct_description *sdesc, int count) { if (data && !pdump_get_entry (data)) { @@ -610,7 +488,10 @@ pdump_register_struct (const void *data, backtrace[me].offset = 0; pdump_add_entry (pdump_get_entry_list (sdesc), - data, sdesc->size, count); + data, + sdesc->size, + count, + 0); for (i=0; i<count; i++) { pdump_register_sub (((char *)data) + sdesc->size*i, @@ -622,15 +503,14 @@ pdump_register_struct (const void *data, } static void -pdump_dump_data (pdump_entry_list_elt *elt, - const struct lrecord_description *desc) +pdump_dump_data (pdump_entry_list_elmt *elmt, const struct lrecord_description *desc) { - size_t size = elt->size; - int count = elt->count; + size_t size = elmt->size; + int count = elmt->count; if (desc) { int pos, i; - memcpy (pdump_buf, elt->obj, size*count); + memcpy (pdump_buf, elmt->obj, size*count); for (i=0; i<count; i++) { @@ -642,18 +522,28 @@ pdump_dump_data (pdump_entry_list_elt *elt, switch (desc[pos].type) { case XD_SPECIFIER_END: - desc = ((const Lisp_Specifier *)(elt->obj))->methods->extra_description; + 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, elt->obj); + val = pdump_get_indirect_count (val, desc, elmt->obj); *(int *)rdata = val; break; } @@ -669,15 +559,15 @@ pdump_dump_data (pdump_entry_list_elt *elt, case XD_LO_LINK: { Lisp_Object obj = *(Lisp_Object *)rdata; - pdump_entry_list_elt *elt1; + pdump_entry_list_elmt *elmt1; for (;;) { - elt1 = pdump_get_entry (XRECORD_LHEADER (obj)); - if (elt1) + elmt1 = pdump_get_entry (XRECORD_LHEADER (obj)); + if (elmt1) break; obj = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj))); } - *(EMACS_INT *)rdata = elt1->save_offset; + *(EMACS_INT *)rdata = elmt1->save_offset; break; } case XD_LISP_OBJECT: @@ -696,7 +586,7 @@ pdump_dump_data (pdump_entry_list_elt *elt, EMACS_INT num = desc[pos].data1; int j; if (XD_IS_INDIRECT (num)) - num = pdump_get_indirect_count (num, desc, elt->obj); + num = pdump_get_indirect_count (num, desc, elmt->obj); for (j=0; j<num; j++) { @@ -717,16 +607,17 @@ pdump_dump_data (pdump_entry_list_elt *elt, default: stderr_out ("Unsupported dump type : %d\n", desc[pos].type); abort (); - } + }; } } } - fwrite (desc ? pdump_buf : elt->obj, size, count, pdump_out); + 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) +pdump_reloc_one (void *data, EMACS_INT delta, const struct lrecord_description *desc) { int pos; @@ -764,11 +655,12 @@ pdump_reloc_one (void *data, EMACS_INT delta, if (POINTER_TYPE_P (XTYPE (*pobj)) && ! EQ (*pobj, Qnull_pointer)) - XSETOBJ (*pobj, (char *) XPNTR (*pobj) + delta); + 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; @@ -781,7 +673,7 @@ pdump_reloc_one (void *data, EMACS_INT delta, if (POINTER_TYPE_P (XTYPE (*pobj)) && ! EQ (*pobj, Qnull_pointer)) - XSETOBJ (*pobj, (char *) XPNTR (*pobj) + delta); + XSETOBJ (*pobj, XTYPE (*pobj), (char *) XPNTR (*pobj) + delta); } break; } @@ -800,207 +692,221 @@ pdump_reloc_one (void *data, EMACS_INT delta, } static void -pdump_allocate_offset (pdump_entry_list_elt *elt, - const struct lrecord_description *desc) +pdump_allocate_offset (pdump_entry_list_elmt *elmt, const struct lrecord_description *desc) { - size_t size = elt->count * elt->size; - elt->save_offset = cur_offset; + 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_elt *, - const struct lrecord_description *)) +pdump_scan_by_alignment (void (*f)(pdump_entry_list_elmt *, const struct lrecord_description *)) { - int align; - - for (align = ALIGNOF (max_align_t); align; align>>=1) + int align, i; + const struct lrecord_description *idesc; + pdump_entry_list_elmt *elmt; + for (align=8; align>=0; align--) { - size_t i; - pdump_entry_list_elt *elt; - for (i=0; i<lrecord_type_count; i++) if (pdump_object_table[i].align == align) - for (elt = pdump_object_table[i].first; elt; elt = elt->next) - f (elt, lrecord_implementations_table[i]->description); + { + 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) { - pdump_struct_list_elt list = pdump_struct_table.list[i]; - if (list.list.align == align) - for (elt = list.list.first; elt; elt = elt->next) - f (elt, list.sdesc->description); + 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 (elt = pdump_opaque_data_list.first; elt; elt = elt->next) - if (pdump_size_to_align (elt->size) == align) - f (elt, 0); + 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_root_struct_ptrs (void) +pdump_dump_structvec (void) { - size_t i; - size_t count = Dynarr_length (pdump_root_struct_ptrs); - pdump_static_pointer *data = alloca_array (pdump_static_pointer, count); - for (i = 0; i < count; i++) + int i; + for (i=0; i<dumpstructidx; i++) { - data[i].address = (char **) Dynarr_atp (pdump_root_struct_ptrs, i)->ptraddress; - data[i].value = (char *) pdump_get_entry (* data[i].address)->save_offset; + 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)); } - PDUMP_ALIGN_OUTPUT (pdump_static_pointer); - fwrite (data, sizeof (pdump_static_pointer), count, pdump_out); } static void -pdump_dump_opaques (void) +pdump_dump_opaquevec (void) { int i; - for (i = 0; i < Dynarr_length (pdump_opaques); i++) + for (i=0; i<dumpopaqueidx; i++) { - pdump_opaque *info = Dynarr_atp (pdump_opaques, i); - PDUMP_WRITE_ALIGNED (pdump_opaque, *info); - fwrite (info->varaddress, info->size, 1, pdump_out); + 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) { - size_t i; - pdump_entry_list_elt *elt; + int i, j; + pdump_entry_list_elmt *elmt; pdump_reloc_table rt; for (i=0; i<lrecord_type_count; i++) { - elt = pdump_object_table[i].first; - if (!elt) + elmt = pdump_object_table[i].first; + if (!elmt) continue; rt.desc = lrecord_implementations_table[i]->description; rt.count = pdump_object_table[i].count; - PDUMP_WRITE_ALIGNED (pdump_reloc_table, rt); - while (elt) + write (pdump_fd, &rt, sizeof (rt)); + while (elmt) { - EMACS_INT rdata = pdump_get_entry (elt->obj)->save_offset; - PDUMP_WRITE_ALIGNED (EMACS_INT, rdata); - elt = elt->next; + 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; - PDUMP_WRITE_ALIGNED (pdump_reloc_table, rt); + write (pdump_fd, &rt, sizeof (rt)); for (i=0; i<pdump_struct_table.count; i++) { - elt = pdump_struct_table.list[i].list.first; + 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; - PDUMP_WRITE_ALIGNED (pdump_reloc_table, rt); - while (elt) + write (pdump_fd, &rt, sizeof (rt)); + while (elmt) { - EMACS_INT rdata = pdump_get_entry (elt->obj)->save_offset; - int j; - for (j=0; j<elt->count; j++) + EMACS_INT rdata = pdump_get_entry (elmt->obj)->save_offset; + for (j=0; j<elmt->count; j++) { - PDUMP_WRITE_ALIGNED (EMACS_INT, rdata); - rdata += elt->size; + write (pdump_fd, &rdata, sizeof (rdata)); + rdata += elmt->size; } - elt = elt->next; + elmt = elmt->next; } } rt.desc = 0; rt.count = 0; - PDUMP_WRITE_ALIGNED (pdump_reloc_table, rt); + write (pdump_fd, &rt, sizeof (rt)); } static void -pdump_dump_root_objects (void) +pdump_dump_wired (void) { - size_t count = (Dynarr_length (pdump_root_objects) + - Dynarr_length (pdump_weak_object_chains)); - EMACS_INT i; + EMACS_INT count = pdump_wireidx + pdump_wireidx_list; + int i; - PDUMP_WRITE_ALIGNED (size_t, count); - PDUMP_ALIGN_OUTPUT (pdump_static_Lisp_Object); + write (pdump_fd, &count, sizeof (count)); - for (i=0; i<Dynarr_length (pdump_root_objects); i++) + for (i=0; i<pdump_wireidx; i++) { - pdump_static_Lisp_Object obj; - obj.address = Dynarr_at (pdump_root_objects, i); - obj.value = * obj.address; - - if (POINTER_TYPE_P (XTYPE (obj.value))) - obj.value = wrap_object ((void *) pdump_get_entry (XRECORD_LHEADER (obj.value))->save_offset); - - PDUMP_WRITE (pdump_static_Lisp_Object, obj); + 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<Dynarr_length (pdump_weak_object_chains); i++) + for (i=0; i<pdump_wireidx_list; i++) { - pdump_entry_list_elt *elt; - pdump_static_Lisp_Object obj; - - obj.address = Dynarr_at (pdump_weak_object_chains, i); - obj.value = * obj.address; + Lisp_Object obj = *(pdump_wirevec_list[i]); + pdump_entry_list_elmt *elmt; + EMACS_INT res; for (;;) { const struct lrecord_description *desc; int pos; - elt = pdump_get_entry (XRECORD_LHEADER (obj.value)); - if (elt) + elmt = pdump_get_entry (XRECORD_LHEADER (obj)); + if (elmt) break; - desc = XRECORD_LHEADER_IMPLEMENTATION (obj.value)->description; + desc = XRECORD_LHEADER_IMPLEMENTATION (obj)->description; for (pos = 0; desc[pos].type != XD_LO_LINK; pos++) assert (desc[pos].type != XD_END); - obj.value = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj.value))); + obj = *(Lisp_Object *)(desc[pos].offset + (char *)(XRECORD_LHEADER (obj))); } - obj.value = wrap_object ((void *) elt->save_offset); + res = elmt->save_offset; - PDUMP_WRITE (pdump_static_Lisp_Object, obj); + write (pdump_fd, &pdump_wirevec_list[i], sizeof (pdump_wirevec_list[i])); + write (pdump_fd, &res, sizeof (res)); } } void pdump (void) { - size_t i; + int i; Lisp_Object t_console, t_device, t_frame; int none; - pdump_header header; - - pdump_object_table = xnew_array (pdump_entry_list, lrecord_type_count); - pdump_alert_undump_object = xnew_array (int, lrecord_type_count); - - assert (ALIGNOF (max_align_t) <= pdump_align_table[0]); - - for (i = 0; i < countof (pdump_align_table); i++) - if (pdump_align_table[i] > ALIGNOF (max_align_t)) - pdump_align_table[i] = ALIGNOF (max_align_t); - - flush_all_buffer_local_cache (); + dump_header hd; /* These appear in a DEFVAR_LISP, which does a staticpro() */ - t_console = Vterminal_console; Vterminal_console = Qnil; - t_frame = Vterminal_frame; Vterminal_frame = Qnil; - t_device = Vterminal_device; Vterminal_device = Qnil; + t_console = Vterminal_console; + t_frame = Vterminal_frame; + t_device = Vterminal_device; - dump_add_opaque (&lrecord_implementations_table, - lrecord_type_count * sizeof (lrecord_implementations_table[0])); - dump_add_opaque (&lrecord_markers, - lrecord_type_count * sizeof (lrecord_markers[0])); + Vterminal_console = Qnil; + Vterminal_frame = Qnil; + Vterminal_device = Qnil; - pdump_hash = xnew_array_and_zero (pdump_entry_list_elt *, PDUMP_HASHSIZE); + 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 = ALIGNOF (max_align_t); + pdump_object_table[i].align = 8; pdump_object_table[i].count = 0; pdump_alert_undump_object[i] = 0; } @@ -1008,12 +914,14 @@ pdump (void) pdump_struct_table.size = -1; pdump_opaque_data_list.first = 0; - pdump_opaque_data_list.align = ALIGNOF (max_align_t); + pdump_opaque_data_list.align = 8; pdump_opaque_data_list.count = 0; depth = 0; - for (i=0; i<Dynarr_length (pdump_root_objects); i++) - pdump_register_object (* Dynarr_at (pdump_root_objects, i)); + 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++) @@ -1027,47 +935,44 @@ pdump (void) if (!none) return; - for (i=0; i<(size_t)Dynarr_length (pdump_root_struct_ptrs); i++) - { - pdump_root_struct_ptr info = Dynarr_at (pdump_root_struct_ptrs, i); - pdump_register_struct (*(info.ptraddress), info.desc, 1); - } + for (i=0; i<dumpstructidx; i++) + pdump_register_struct (*(void **)(dumpstructvec[i].data), dumpstructvec[i].desc, 1); - memcpy (header.signature, PDUMP_SIGNATURE, PDUMP_SIGNATURE_LEN); - header.id = dump_id; - header.reloc_address = 0; - header.nb_root_struct_ptrs = Dynarr_length (pdump_root_struct_ptrs); - header.nb_opaques = Dynarr_length (pdump_opaques); + 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 = ALIGN_SIZE (sizeof (header), ALIGNOF (max_align_t)); + cur_offset = 256; max_size = 0; pdump_scan_by_alignment (pdump_allocate_offset); - cur_offset = ALIGN_SIZE (cur_offset, ALIGNOF (max_align_t)); - header.stab_offset = cur_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); - pdump_out = fdopen (pdump_fd, "w"); + hd.stab_offset = (cur_offset + 3) & ~3; - fwrite (&header, sizeof (header), 1, pdump_out); - PDUMP_ALIGN_OUTPUT (max_align_t); + write (pdump_fd, &hd, sizeof (hd)); + lseek (pdump_fd, 256, SEEK_SET); pdump_scan_by_alignment (pdump_dump_data); - fseek (pdump_out, header.stab_offset, SEEK_SET); + lseek (pdump_fd, hd.stab_offset, SEEK_SET); - pdump_dump_root_struct_ptrs (); - pdump_dump_opaques (); + pdump_dump_staticvec (); + pdump_dump_structvec (); + pdump_dump_opaquevec (); + pdump_dump_itable (); pdump_dump_rtables (); - pdump_dump_root_objects (); + pdump_dump_wired (); - fclose (pdump_out); close (pdump_fd); - free (pdump_buf); free (pdump_hash); @@ -1077,79 +982,95 @@ pdump (void) Vterminal_device = t_device; } -static int -pdump_load_check (void) +static int pdump_load_check (void) { - return (!memcmp (((pdump_header *)pdump_start)->signature, - PDUMP_SIGNATURE, PDUMP_SIGNATURE_LEN) - && ((pdump_header *)pdump_start)->id == dump_id); + return (!memcmp (((dump_header *)pdump_start)->signature, DUMP_SIGNATURE, DUMP_SIGNATURE_LEN) + && ((dump_header *)pdump_start)->id == dump_id); } -/*----------------------------------------------------------------------*/ -/* Reading the dump file */ -/*----------------------------------------------------------------------*/ -static int -pdump_load_finish (void) +static int pdump_load_finish (void) { int i; char *p; EMACS_INT delta; EMACS_INT count; - pdump_header *header = (pdump_header *)pdump_start; pdump_end = pdump_start + pdump_length; - delta = ((EMACS_INT)pdump_start) - header->reloc_address; - p = pdump_start + header->stab_offset; +#define PDUMP_READ(p, type) (p = (char*) (((type *) p) + 1), *((type *) p - 1)) - /* Put back the pdump_root_struct_ptrs */ - p = (char *) ALIGN_PTR (p, ALIGNOF (pdump_static_pointer)); - for (i=0; i<header->nb_root_struct_ptrs; i++) + 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++) { - pdump_static_pointer ptr = PDUMP_READ (p, pdump_static_pointer); - (* ptr.address) = ptr.value + delta; + 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 pdump_opaques */ - for (i=0; i<header->nb_opaques; i++) + /* Put back the dumpstructs */ + for (i=0; i<((dump_header *)pdump_start)->nb_structdmp; i++) { - pdump_opaque info = PDUMP_READ_ALIGNED (p, pdump_opaque); - memcpy (info.varaddress, p, info.size); - p += info.size; + 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_ALIGNED (p, pdump_reloc_table); - p = (char *) ALIGN_PTR (p, ALIGNOF (char *)); + pdump_reloc_table rt = PDUMP_READ (p, pdump_reloc_table); if (rt.desc) { - char **reloc = (char **)p; for (i=0; i < rt.count; i++) { - reloc[i] += delta; - pdump_reloc_one (reloc[i], delta, rt.desc); + char *adr = delta + *(char **)p; + *(char **)p = adr; + pdump_reloc_one (adr, delta, rt.desc); + p += sizeof (char *); } - p += rt.count * sizeof (char *); } else if (!(--count)) break; } - /* Put the pdump_root_objects variables in place */ - i = PDUMP_READ_ALIGNED (p, size_t); - p = (char *) ALIGN_PTR (p, ALIGNOF (pdump_static_Lisp_Object)); - while (i--) + /* Put the pdump_wire variables in place */ + count = PDUMP_READ (p, EMACS_INT); + + for (i=0; i<count; i++) { - pdump_static_Lisp_Object obj = PDUMP_READ (p, pdump_static_Lisp_Object); + Lisp_Object *var = PDUMP_READ (p, Lisp_Object *); + Lisp_Object obj = PDUMP_READ (p, Lisp_Object); - if (POINTER_TYPE_P (XTYPE (obj.value))) - obj.value = wrap_object ((char *) XPNTR (obj.value) + delta); + if (POINTER_TYPE_P (XTYPE (obj))) + XSETOBJ (obj, XTYPE (obj), (char *) XPNTR (obj) + delta); - (* obj.address) = obj.value; + *var = obj; } /* Final cleanups */ @@ -1157,8 +1078,7 @@ pdump_load_finish (void) p = pdump_rt_list; for (;;) { - pdump_reloc_table rt = PDUMP_READ_ALIGNED (p, pdump_reloc_table); - p = (char *) ALIGN_PTR (p, ALIGNOF (Lisp_Object)); + pdump_reloc_table rt = PDUMP_READ (p, pdump_reloc_table); if (!rt.desc) break; if (rt.desc == hash_table_description) @@ -1170,45 +1090,44 @@ pdump_load_finish (void) 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) +#ifdef WINDOWSNT +static void pdump_file_unmap(void) { - UnmapViewOfFile (pdump_start); - CloseHandle (pdump_hFile); - CloseHandle (pdump_hMap); } -static int -pdump_file_get (const char *path) +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) + HANDLE hFile; + HANDLE hMap; + + 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 (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) + pdump_length = GetFileSize (hFile, NULL); + hMap = CreateFileMapping (hFile, + NULL, /* No security attributes */ + PAGE_WRITECOPY, /* Copy on write */ + 0, /* Max size, high half */ + 0, /* Max size, low half */ + NULL); /* Unnamed */ + if (hMap == INVALID_HANDLE_VALUE) return 0; - pdump_start = MapViewOfFile (pdump_hMap, - FILE_MAP_COPY, /* Copy on write */ + pdump_start = MapViewOfFile (hMap, + FILE_MAP_COPY, /* Copy on write */ 0, /* Start at zero */ 0, 0); /* Map all of it */ @@ -1216,21 +1135,11 @@ pdump_file_get (const char *path) 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 void pdump_resource_free (void) +static int pdump_resource_get (void) { -} - -static int -pdump_resource_get (void) -{ - HRSRC hRes; /* Handle to dump resource */ - HRSRC hResLoad; /* Handle to loaded dump resource */ + 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. @@ -1256,7 +1165,7 @@ pdump_resource_get (void) pdump_free = pdump_resource_free; pdump_length = SizeofResource (NULL, hRes); - if (pdump_length <= sizeof (pdump_header)) + if (pdump_length <= sizeof(dump_header)) { pdump_start = 0; return 0; @@ -1265,31 +1174,30 @@ pdump_resource_get (void) return 1; } -#else /* !WIN32_NATIVE */ +#else /* !WINDOWSNT */ -static void -pdump_file_free (void) +static void *pdump_mallocadr; + +static void pdump_file_free(void) { - xfree (pdump_start); + xfree (pdump_mallocadr); } #ifdef HAVE_MMAP -static void -pdump_file_unmap (void) +static void pdump_file_unmap(void) { munmap (pdump_start, pdump_length); } #endif -static int -pdump_file_get (const char *path) +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 (pdump_header)) + if (pdump_length < sizeof (dump_header)) { close (fd); return 0; @@ -1298,35 +1206,31 @@ pdump_file_get (const char *path) lseek (fd, 0, SEEK_SET); #ifdef HAVE_MMAP -/* Unix 98 requires that sys/mman.h define MAP_FAILED, - but many earlier implementations don't. */ -# ifndef MAP_FAILED -# define MAP_FAILED ((void *) -1L) -# endif pdump_start = (char *) mmap (0, pdump_length, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); - if (pdump_start != (char *) MAP_FAILED) + if (pdump_start != MAP_FAILED) { pdump_free = pdump_file_unmap; close (fd); return 1; } -#endif /* HAVE_MMAP */ +#endif - pdump_start = xnew_array (char, pdump_length); + pdump_mallocadr = xmalloc(pdump_length+255); pdump_free = pdump_file_free; - read (fd, pdump_start, pdump_length); + pdump_start = (char *)((255 + (unsigned long)pdump_mallocadr) & ~255); + read (pdump_fd, pdump_start, pdump_length); - close (fd); + close (pdump_fd); return 1; } -#endif /* !WIN32_NATIVE */ +#endif /* !WINDOWSNT */ -static int -pdump_file_try (char *exe_path) +static int pdump_file_try(char *exe_path) { - char *w = exe_path + strlen (exe_path); + char *w; + w = exe_path + strlen(exe_path); do { sprintf (w, "-%s-%08x.dmp", EMACS_VERSION, dump_id); @@ -1334,53 +1238,52 @@ pdump_file_try (char *exe_path) { if (pdump_load_check ()) return 1; - pdump_free (); + pdump_free(); } - + sprintf (w, "-%08x.dmp", dump_id); if (pdump_file_get (exe_path)) { if (pdump_load_check ()) return 1; - pdump_free (); + pdump_free(); } - + sprintf (w, ".dmp"); if (pdump_file_get (exe_path)) { if (pdump_load_check ()) return 1; - pdump_free (); + pdump_free(); } - + do w--; - while (w>exe_path && !IS_DIRECTORY_SEP (*w) && (*w != '-') && (*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) +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; +#ifdef WINDOWSNT + GetModuleFileName (NULL, exe_name, PATH_MAX); +#else /* !WINDOWSNT */ const char *dir, *p; dir = argv0; if (dir[0] == '-') { /* XEmacs as a login shell, oh goody! */ - dir = getenv ("SHELL"); + dir = getenv("SHELL"); } - p = dir + strlen (dir); + p = dir + strlen(dir); while (p != dir && !IS_ANY_SEP (p[-1])) p--; - + if (p != dir) { /* invocation-name includes a directory component -- presumably it @@ -1410,13 +1313,13 @@ pdump_load (const char *argv0) { *w++ = '/'; } - strcpy (w, name); - + strcpy(w, name); + /* ### #$%$#^$^@%$^#%@$ ! */ #ifdef access #undef access #endif - + if (!access (exe_path, X_OK)) break; if (!*p) @@ -1425,10 +1328,10 @@ pdump_load (const char *argv0) sprintf (exe_path, "./%s", name); break; } - path = p+1; + path = p+1; } } -#endif /* WIN32_NATIVE */ +#endif /* WINDOWSNT */ if (pdump_file_try (exe_path)) { @@ -1436,7 +1339,7 @@ pdump_load (const char *argv0) return 1; } -#ifdef WIN32_NATIVE +#ifdef WINDOWSNT if (pdump_resource_get ()) { if (pdump_load_check ()) diff --git a/src/dumper.h b/src/dumper.h index d89e28d..901bd1c 100644 --- a/src/dumper.h +++ b/src/dumper.h @@ -26,6 +26,5 @@ Boston, MA 02111-1307, USA. */ void pdump_objects_unmark (void); void pdump (void); int pdump_load (const char *argv0); -extern unsigned int dump_id; #endif /* INCLUDED_dumper_h */ diff --git a/src/emacs.c b/src/emacs.c index 6d04500..5114354 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -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 @@ Boston, MA 02111-1307, USA. */ /* 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 @@ -171,27 +35,14 @@ version 18.59 released October 31, 1992. #include "commands.h" #include "console.h" #include "process.h" -#include "redisplay.h" -#include "frame.h" #include "sysdep.h" +#include <setjmp.h> #include "syssignal.h" /* Always include before systty.h */ #include "systty.h" #include "sysfile.h" #include "systime.h" -#ifdef PDUMP -#include "dumper.h" -#endif - -#ifndef SEPCHAR -#define SEPCHAR ':' -#endif - -#ifdef QUANTIFY -#include <quantify.h> -#endif - #ifdef HAVE_SHLIB #include "sysdll.h" #endif @@ -202,21 +53,23 @@ version 18.59 released October 31, 1992. #endif #ifdef TOOLTALK -#include TT_C_H_FILE +#include TT_C_H_PATH +#endif + +#ifdef APOLLO +#ifndef APOLLO_SR10 +#include <default_acl.h> +#endif #endif -#if defined (WIN32_NATIVE) -#include "nt.h" +#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 *); @@ -241,10 +94,6 @@ static void *malloc_state_ptr; void r_alloc_reinit (void); # endif -#ifdef HAVE_GTK -void console_type_create_select_gtk(void); -#endif - /* Variable whose value is symbol giving operating system type. */ Lisp_Object Vsystem_type; @@ -258,7 +107,6 @@ Lisp_Object Vsystem_configuration_options; /* 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 @@ -287,19 +135,15 @@ Lisp_Object Vemacs_program_name, Vemacs_program_version; Lisp_Object Vexec_path; Lisp_Object Vexec_directory, Vconfigure_exec_directory; Lisp_Object Vlisp_directory, Vconfigure_lisp_directory; -Lisp_Object Vmule_lisp_directory, Vconfigure_mule_lisp_directory; -Lisp_Object Vmodule_directory, Vconfigure_module_directory; -Lisp_Object Vsite_module_directory, Vconfigure_site_module_directory; Lisp_Object Vconfigure_package_path; Lisp_Object Vdata_directory, Vconfigure_data_directory; 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. */ @@ -308,12 +152,10 @@ Lisp_Object Vconfigure_exec_prefix_directory, Vconfigure_prefix_directory; /* If nonzero, set XEmacs to run at this priority. This is also used in child_setup and sys_suspend to make sure subshells run at normal priority. */ -Fixnum emacs_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. */ @@ -322,7 +164,7 @@ int display_arg; /* 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. */ @@ -342,188 +184,69 @@ uintptr_t bss_end = 0; /* Number of bytes of writable memory we can expect to be able to get */ unsigned int lim_data; -/* WARNING! - - Some LISP-visible command-line options are set by XEmacs _before_ the - data is dumped in building a --pdump XEmacs, but used _after_ it is - restored in normal operation. Thus the dump-time values overwrite the - values XEmacs is getting at runtime. Such variables must be saved - before loading the dumpfile, and restored afterward. - - Therefore these variables may not be initialized in vars_of_emacs(). - - The save/restore is done immediately before and after pdump_load() in - main_1(). See that function for the current list of protected variables. - - Note that saving/restoring is only necessary for a few variables that are - o command line arguments effective at runtime (as opposed to dump-time), - o parsed before pdump_load, and - o exported to Lisp via a DEFVAR. -*/ - /* Nonzero means running XEmacs without interactive terminal. */ int noninteractive; /* Value of Lisp variable `noninteractive'. Normally same as C variable `noninteractive' - but nothing terrible happens if user sets this one. - - Shadowed from the pdumper by `noninteractive'. */ + but nothing terrible happens if user sets this one. */ int noninteractive1; /* Nonzero means don't perform site-lisp searches at startup */ int inhibit_site_lisp; -/* Nonzero means don't perform site-modules searches at startup */ -int inhibit_site_modules; - /* Nonzero means don't respect early packages at startup */ int inhibit_early_packages; /* 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 Extbyte **initial_argv; /* #### currently unused */ -static int initial_argc; /* #### currently unused */ +char **initial_argv; +int initial_argc; static void sort_args (int argc, char **argv); +extern int always_gc; /* hack */ + Lisp_Object Qkill_emacs_hook; Lisp_Object Qsave_buffers_kill_emacs; -extern Lisp_Object Vlisp_EXEC_SUFFIXES; - +/* Signal code for the fatal signal that was received */ +static int fatal_error_code; -/* 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; +/* Nonzero if handling a fatal error already */ +static int fatal_error_in_progress; -static int run_temacs_argc; -static char **run_temacs_argv; -static char *run_temacs_args; -static EMACS_INT run_temacs_argv_size; -static EMACS_INT 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; -} +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) - { - 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); + EMACS_UNBLOCK_SIGNAL (fatal_error_code); - /* 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) + if (! fatal_error_in_progress) { - 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]; @@ -536,96 +259,65 @@ fatal_error_signal (int sig) # 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; + va_list args; + va_start (args, fmt); - ensure_no_quitting_from_now_on (); + fprintf (stderr, "\nXEmacs: "); + vfprintf (stderr, GETTEXT (fmt), args); + fprintf (stderr, "\n"); - /* 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"); + va_end (args); + fflush (stderr); + exit (1); +} - /* 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 - */ +/* #### 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. */ - __except (EXCEPTION_EXECUTE_HANDLER) {} +int +stderr_out (CONST char *fmt, ...) +{ + int retval; + va_list args; + va_start (args, fmt); + retval = vfprintf (stderr, GETTEXT (fmt), args); - /* pretend we didn't handle this, so that the debugger is invoked and/or - the normal GPF box appears. */ - return EXCEPTION_CONTINUE_SEARCH; + va_end (args); + /* fflush (stderr); */ + return retval; } -#endif /* _MSC_VER */ +/* 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 @@ -648,7 +340,7 @@ memory_warning_signal (int sig) /* Code for dealing with Lisp access to the Unix command line */ static Lisp_Object -make_arg_list_1 (int argc, Extbyte **argv, int skip_args) +make_arg_list_1 (int argc, char **argv, int skip_args) { Lisp_Object result = Qnil; REGISTER int i; @@ -657,38 +349,28 @@ make_arg_list_1 (int argc, Extbyte **argv, int skip_args) { 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]; - Lisp_Object fullpath; - + char full_exe_path [MAX_PATH]; GetModuleFileName (NULL, full_exe_path, MAX_PATH); - fullpath = build_ext_string (full_exe_path, Qmswindows_tstr); - result = Fcons (fullpath, result); + result = Fcons (build_ext_string (full_exe_path, FORMAT_FILENAME), + result); #if defined(HAVE_SHLIB) - { - Extbyte *fullpathext; - - LISP_STRING_TO_EXTERNAL (fullpath, fullpathext, - Qdll_filename_encoding); - (void) dll_init (fullpathext); - } + (void)dll_init(full_exe_path); #endif } else #endif - result = Fcons (build_ext_string (argv[i], - Qcommand_argument_encoding), - result); + result = Fcons (build_ext_string (argv [i], FORMAT_FILENAME), result); } } return result; } Lisp_Object -make_arg_list (int argc, Extbyte **argv) +make_arg_list (int argc, char **argv) { return make_arg_list_1 (argc, argv, 0); } @@ -696,19 +378,19 @@ make_arg_list (int argc, Extbyte **argv) /* Calling functions are also responsible for calling free_argc_argv when they are done with the generated list. */ void -make_argc_argv (Lisp_Object argv_list, int *argc, Extbyte ***argv) +make_argc_argv (Lisp_Object argv_list, int *argc, char ***argv) { Lisp_Object next; int n = XINT (Flength (argv_list)); REGISTER int i; - *argv = (Extbyte**) xmalloc ((n+1) * sizeof (Extbyte*)); + *argv = (char**) xmalloc ((n+1) * sizeof (char*)); for (i = 0, next = argv_list; i < n; i++, next = XCDR (next)) { - const Extbyte *temp; + CONST char *temp; CHECK_STRING (XCAR (next)); - LISP_STRING_TO_EXTERNAL (XCAR (next), temp, Qcommand_argument_encoding); + GET_C_STRING_EXT_DATA_ALLOCA (XCAR (next), FORMAT_OS, temp); (*argv) [i] = xstrdup (temp); } (*argv) [n] = 0; @@ -716,7 +398,7 @@ make_argc_argv (Lisp_Object argv_list, int *argc, Extbyte ***argv) } void -free_argc_argv (Extbyte **argv) +free_argc_argv (char **argv) { int elt = 0; @@ -729,7 +411,7 @@ free_argc_argv (Extbyte **argv) } static void -init_cmdargs (int argc, Extbyte **argv, int skip_args) +init_cmdargs (int argc, char **argv, int skip_args) { initial_argv = argv; initial_argc = argc; @@ -762,6 +444,15 @@ Return the directory name in which the Emacs executable was located. # undef RUN_TIME_REMAP #endif +#if defined (MULE) && defined (MSDOS) && defined (EMX) +/* Setup all of files be input/output'ed with binary translation mdoe. */ +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 @@ -799,7 +490,7 @@ argmatch (char **argv, int argc, char *sstr, char *lstr, return 1; } arglen = (valptr != NULL && (p = strchr (arg, '=')) != NULL - ? p - arg : (int) strlen (arg)); + ? p - arg : strlen (arg)); if (lstr == 0 || arglen < minlen || strncmp (arg, lstr, arglen) != 0) return 0; else if (valptr == NULL) @@ -828,25 +519,7 @@ argmatch (char **argv, int argc, char *sstr, char *lstr, /* Make stack traces always identify version + configuration */ #define main_1 STACK_TRACE_EYE_CATCHER -/* This function is not static, so that the compiler is less likely to - inline it, which would make it not show up in stack traces. - - The restart argument is a flag that indicates that main_1 is now - being called for the second time in this invocation of xemacs; this can - only happen in an xemacs that is not loaded with dumped data (temacs - with the conventional dumper or xemacs -nd with the pdumper). See - Frun_emacs_from_temacs(). - - restart interacts with initialized as follows (per Olivier Galibert): - - It's perverted. - - initialized==0 => temacs - initialized!=0 && restart!=0 => run-temacs - initialized!=0 && restart==0 => xemacs/post pdump_load() -*/ -DECLARE_DOESNT_RETURN (main_1 (int, char **, char **, int)); -DOESNT_RETURN +static DOESNT_RETURN main_1 (int argc, char **argv, char **envp, int restart) { char stack_bottom_variable; @@ -857,8 +530,7 @@ main_1 (int argc, char **argv, char **envp, int restart) 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, */ @@ -866,7 +538,7 @@ main_1 (int argc, char **argv, char **envp, int restart) __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; @@ -880,7 +552,7 @@ main_1 (int argc, char **argv, char **envp, int restart) * 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 */ /* @@ -898,7 +570,23 @@ main_1 (int argc, char **argv, char **envp, int restart) 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 @@ -912,12 +600,18 @@ main_1 (int argc, char **argv, char **envp, int restart) 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 (); -#elif defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC) - if (initialized) - init_ralloc(); #endif #ifdef HAVE_SOCKS @@ -931,6 +625,15 @@ main_1 (int argc, char **argv, char **envp, int restart) 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); @@ -947,17 +650,6 @@ main_1 (int argc, char **argv, char **envp, int restart) 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 ("Portable dumper not configured; -sd just forces exit.\n"); -#endif - exit (0); - } - /* Handle the -t switch, which specifies filename to use as terminal */ { char *term; @@ -979,12 +671,6 @@ main_1 (int argc, char **argv, char **envp, int restart) } } - /* 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; @@ -1011,16 +697,6 @@ main_1 (int argc, char **argv, char **envp, int restart) inhibit_early_packages = 1; skip_args--; } -#ifdef HAVE_SHLIB - if (argmatch (argv, argc, "-no-site-modules", "--no-site-modules", - 9, NULL, &skip_args)) - { - inhibit_site_modules = 1; - skip_args--; - } -#else - inhibit_site_modules = 1; -#endif if (argmatch (argv, argc, "-vanilla", "--vanilla", 7, NULL, &skip_args)) { @@ -1116,13 +792,6 @@ main_1 (int argc, char **argv, char **envp, int restart) display_use = "x"; #endif /* HAVE_X_WINDOWS */ -#ifdef HAVE_GTK - { - char *dpy = getenv ("DISPLAY"); - if (dpy && dpy[0]) - display_use = "gtk"; - } -#endif #ifdef HAVE_MS_WINDOWS if (strcmp(display_use, "x") != 0) display_use = "mswindows"; @@ -1148,11 +817,6 @@ main_1 (int argc, char **argv, char **envp, int restart) so we can be fairly accurate. */ init_intl_very_early (); /* set up the locale and domain for gettext and such. */ -#ifdef HAVE_MS_WINDOWS - init_mswindows_very_early (); /* Some things - like dde need to be - initialized early so that the - client doesn't give up waiting. */ -#endif /* Now initialize the Lisp engine and the like. Done only during dumping. No dependence on anything that may be in the user's @@ -1161,58 +825,6 @@ main_1 (int argc, char **argv, char **envp, int restart) 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 { - - /* Keep command options from getting stomped. - - Some LISP-visible options are changed by XEmacs _after_ the data is - dumped in building a --pdump XEmacs, but _before_ it is restored in - normal operation. Thus the restored values overwrite the values - XEmacs is getting at run-time. Such variables must be saved here, - and restored after loading the dumped data. - - Boy, this is ugly, but how else to do it? - */ - - /* noninteractive1 is saved in noninteractive, which isn't LISP-visible */ - int inhibit_early_packages_save = inhibit_early_packages; - int inhibit_autoloads_save = inhibit_autoloads; - int debug_paths_save = debug_paths; - /* #### Give inhibit-site-lisp a command switch? If so, uncomment: */ - /* int inhibit_site_lisp_save = inhibit_site_lisp; */ - int inhibit_site_modules_save = inhibit_site_modules; - - initialized = pdump_load (argv[0]); - - /* Now unstomp everything */ - noninteractive1 = noninteractive; - inhibit_early_packages = inhibit_early_packages_save; - inhibit_autoloads = inhibit_autoloads_save; - debug_paths = debug_paths_save; - /* #### Give inhibit-site-lisp a command switch? If so, uncomment: */ - /* inhibit_site_lisp = inhibit_site_lisp_save; */ - inhibit_site_modules = inhibit_site_modules_save; - - 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 @@ -1224,11 +836,11 @@ main_1 (int argc, char **argv, char **envp, int restart) /* 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, - So that DEFERROR*() can be called. */ + So that deferror() can be called. */ init_errors_once_early (); /* Make sure that opaque pointers can be created. */ @@ -1237,19 +849,21 @@ main_1 (int argc, char **argv, char **envp, int restart) /* Now declare all the symbols and define all the Lisp primitives. The *only* thing that the syms_of_*() functions are allowed to do - is call one of the following: + is call one of the following three functions: - INIT_LRECORD_IMPLEMENTATION() - defsymbol(), DEFSYMBOL(), or DEFSYMBOL_MULTIWORD_PREDICATE() + defsymbol() defsubr() (i.e. DEFSUBR) - deferror(), DEFERROR(), or DEFERROR_STANDARD() - defkeyword() or DEFKEYWORD() + deferror() + defkeyword() Order does not matter in these functions. */ syms_of_abbrev (); syms_of_alloc (); +#ifdef HAVE_X_WINDOWS + syms_of_balloon_x (); +#endif syms_of_buffer (); syms_of_bytecode (); syms_of_callint (); @@ -1263,24 +877,20 @@ main_1 (int argc, char **argv, char **envp, int restart) syms_of_data (); #ifdef DEBUG_XEMACS syms_of_debug (); - syms_of_tests (); #endif /* DEBUG_XEMACS */ syms_of_device (); #ifdef HAVE_DIALOGS syms_of_dialog (); #endif syms_of_dired (); +#ifdef HAVE_SHLIB + syms_of_dll (); +#endif syms_of_doc (); syms_of_editfns (); syms_of_elhash (); syms_of_emacs (); syms_of_eval (); -#ifdef HAVE_X_WINDOWS - syms_of_event_Xt (); -#endif -#ifdef HAVE_GTK - syms_of_event_gtk (); -#endif #ifdef HAVE_DRAGNDROP syms_of_dragdrop (); #endif @@ -1299,9 +909,9 @@ main_1 (int argc, char **argv, char **envp, int restart) syms_of_general (); 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 (); @@ -1316,9 +926,6 @@ main_1 (int argc, char **argv, char **envp, int restart) syms_of_menubar (); #endif syms_of_minibuf (); -#ifdef HAVE_SHLIB - syms_of_module (); -#endif syms_of_objects (); syms_of_print (); #if !defined (NO_SUBPROCESSES) @@ -1334,7 +941,6 @@ main_1 (int argc, char **argv, char **envp, int restart) syms_of_rangetab (); syms_of_redisplay (); syms_of_search (); - syms_of_select (); syms_of_signal (); syms_of_sound (); syms_of_specifier (); @@ -1355,77 +961,42 @@ main_1 (int argc, char **argv, char **envp, int restart) syms_of_device_tty (); syms_of_objects_tty (); #endif - -#ifdef HAVE_GTK - syms_of_device_gtk (); - syms_of_frame_gtk (); - syms_of_glyphs_gtk (); - syms_of_objects_gtk (); - syms_of_ui_gtk (); - syms_of_select_gtk (); -#ifdef HAVE_DIALOGS - syms_of_dialog_gtk (); -#endif -#ifdef HAVE_MENUBARS - syms_of_menubar_gtk (); -#endif - syms_of_select_gtk (); - -#if defined (HAVE_MENUBARS) || defined(HAVE_SCROLLBARS) || defined(HAVE_DIALOGS) || defined(HAVE_TOOLBARS) - syms_of_gui_gtk (); -#endif -#endif /* HAVE_GTK */ - #ifdef HAVE_X_WINDOWS -#ifdef HAVE_BALLOON_HELP - syms_of_balloon_x (); -#endif syms_of_device_x (); #ifdef HAVE_DIALOGS syms_of_dialog_x (); #endif + syms_of_event_Xt (); syms_of_frame_x (); syms_of_glyphs_x (); syms_of_objects_x (); #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 syms_of_console_mswindows (); syms_of_device_mswindows (); - syms_of_dialog_mswindows (); + syms_of_event_mswindows (); syms_of_frame_mswindows (); syms_of_objects_mswindows (); syms_of_select_mswindows (); syms_of_glyphs_mswindows (); - syms_of_gui_mswindows (); #ifdef HAVE_MENUBARS syms_of_menubar_mswindows (); #endif #ifdef HAVE_SCROLLBARS syms_of_scrollbar_mswindows (); #endif -#endif /* HAVE_MS_WINDOWS */ #ifdef HAVE_MSW_C_DIRED syms_of_dired_mswindows (); #endif -#ifdef WIN32_NATIVE - syms_of_ntproc (); -#endif -#if defined (WIN32_NATIVE) || defined (CYGWIN) - syms_of_win32 (); -#endif +#endif /* HAVE_MS_WINDOWS */ #ifdef MULE syms_of_mule (); @@ -1433,7 +1004,7 @@ main_1 (int argc, char **argv, char **envp, int restart) syms_of_mule_charset (); #endif #ifdef FILE_CODING - syms_of_file_coding (); + syms_of_mule_coding (); #endif #ifdef MULE #ifdef HAVE_WNN @@ -1452,6 +1023,10 @@ main_1 (int argc, char **argv, char **envp, int restart) SYMS_MACHINE; #endif +#ifdef EMACS_BTL + syms_of_btl (); +#endif + /* #if defined (GNU_MALLOC) && \ defined (ERROR_CHECK_MALLOC) && \ @@ -1474,14 +1049,6 @@ main_1 (int argc, char **argv, char **envp, int restart) 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. */ @@ -1508,34 +1075,11 @@ main_1 (int argc, char **argv, char **envp, int restart) console_type_create_redisplay_tty (); #endif -#ifdef HAVE_GTK - console_type_create_gtk (); - console_type_create_select_gtk (); - console_type_create_device_gtk (); - console_type_create_frame_gtk (); - console_type_create_objects_gtk (); - console_type_create_glyphs_gtk (); - console_type_create_redisplay_gtk (); -#ifdef HAVE_MENUBARS - console_type_create_menubar_gtk (); -#endif -#ifdef HAVE_SCROLLBARS - console_type_create_scrollbar_gtk (); -#endif -#ifdef HAVE_TOOLBARS - console_type_create_toolbar_gtk (); -#endif -#ifdef HAVE_DIALOGS - console_type_create_dialog_gtk (); -#endif -#endif /* HAVE_GTK */ - #ifdef HAVE_X_WINDOWS console_type_create_x (); 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 @@ -1559,7 +1103,6 @@ main_1 (int argc, char **argv, char **envp, int restart) 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 @@ -1587,7 +1130,6 @@ main_1 (int argc, char **argv, char **envp, int restart) specifier_type_create (); specifier_type_create_image (); - specifier_type_create_gutter (); specifier_type_create_objects (); #ifdef HAVE_TOOLBARS specifier_type_create_toolbar (); @@ -1607,7 +1149,7 @@ main_1 (int argc, char **argv, char **envp, int restart) structure_type_create_chartab (); structure_type_create_faces (); structure_type_create_rangetab (); - structure_type_create_hash_table (); + structure_type_create_hashtable (); /* Now initialize the image instantiator formats and associated symbols. Other than the first function below, the functions may @@ -1622,19 +1164,12 @@ main_1 (int argc, char **argv, char **envp, int restart) 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 */ #ifdef HAVE_MS_WINDOWS image_instantiator_format_create_glyphs_mswindows (); #endif /* HAVE_MSWINDOWS_WINDOWS */ -#ifdef HAVE_GTK - image_instantiator_format_create_glyphs_gtk (); -#endif /* Now initialize the lstream types and associated symbols. Other than the first function below, the functions may @@ -1646,12 +1181,12 @@ main_1 (int argc, char **argv, char **envp, int restart) 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 (); #endif - + /* Initialize processes implementation. The functions may make exactly the following function/macro calls: @@ -1677,7 +1212,7 @@ main_1 (int argc, char **argv, char **envp, int restart) 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 @@ -1687,9 +1222,10 @@ main_1 (int argc, char **argv, char **envp, int restart) 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() @@ -1699,35 +1235,29 @@ main_1 (int argc, char **argv, char **envp, int restart) Fcons() listN() make_opaque_ptr() + make_opaque_long() perhaps a few others. - - NB: Initialization or assignment should not be done here to certain - variables settable from the command line. See the comment above - the call to pdump_load() in main_1(). This caveat should only - apply to vars_of_emacs(). */ /* 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 (); @@ -1743,18 +1273,7 @@ main_1 (int argc, char **argv, char **envp, int restart) vars_of_elhash (); vars_of_emacs (); vars_of_eval (); - -#ifdef HAVE_X_WINDOWS - vars_of_event_Xt (); -#endif -#if defined(HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) - vars_of_event_tty (); -#endif -#ifdef HAVE_MS_WINDOWS - vars_of_event_mswindows (); -#endif vars_of_event_stream (); - vars_of_events (); vars_of_extents (); vars_of_faces (); @@ -1767,9 +1286,9 @@ main_1 (int argc, char **argv, char **envp, int restart) vars_of_frame (); 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 (); @@ -1792,13 +1311,6 @@ main_1 (int argc, char **argv, char **envp, int restart) vars_of_menubar (); #endif vars_of_minibuf (); -#ifdef HAVE_SHLIB - vars_of_module (); -#endif -#ifdef WIN32_NATIVE - vars_of_nt (); - vars_of_ntproc (); -#endif vars_of_objects (); vars_of_print (); @@ -1821,8 +1333,8 @@ main_1 (int argc, char **argv, char **envp, int restart) 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 @@ -1833,59 +1345,36 @@ main_1 (int argc, char **argv, char **envp, int restart) #ifdef HAVE_TTY vars_of_console_tty (); + vars_of_event_tty (); vars_of_frame_tty (); vars_of_objects_tty (); #endif -#ifdef HAVE_GTK - vars_of_device_gtk (); -#ifdef HAVE_DIALOGS - vars_of_dialog_gtk (); -#endif - vars_of_event_gtk (); - vars_of_frame_gtk (); - vars_of_glyphs_gtk (); - vars_of_ui_gtk (); -#ifdef HAVE_MENUBARS - vars_of_menubar_gtk (); -#endif - vars_of_objects_gtk (); - vars_of_select_gtk (); -#ifdef HAVE_SCROLLBARS - vars_of_scrollbar_gtk (); -#endif -#if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS) - vars_of_gui_gtk (); -#endif -#endif /* HAVE_GTK */ - #ifdef HAVE_X_WINDOWS -#ifdef HAVE_BALLOON_HELP - vars_of_balloon_x (); -#endif vars_of_device_x (); #ifdef HAVE_DIALOGS vars_of_dialog_x (); #endif + vars_of_event_Xt (); vars_of_frame_x (); vars_of_glyphs_x (); #ifdef HAVE_MENUBARS 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 (); vars_of_console_mswindows (); + vars_of_event_mswindows (); vars_of_frame_mswindows (); vars_of_objects_mswindows (); vars_of_select_mswindows (); @@ -1906,11 +1395,10 @@ main_1 (int argc, char **argv, char **envp, int restart) #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 @@ -1933,14 +1421,6 @@ main_1 (int argc, char **argv, char **envp, int restart) 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. @@ -1956,8 +1436,6 @@ main_1 (int argc, char **argv, char **envp, int restart) */ specifier_vars_of_glyphs (); - specifier_vars_of_glyphs_widget (); - specifier_vars_of_gutter (); #ifdef HAVE_MENUBARS specifier_vars_of_menubar (); #endif @@ -1980,19 +1458,19 @@ main_1 (int argc, char **argv, char **envp, int restart) /* Calls Fmake_range_table(). */ complex_vars_of_search (); - /* Calls make_lisp_hash_table(). */ + /* Calls make_lisp_hashtable(). */ complex_vars_of_extents (); - /* Depends on hash tables and specifiers. */ + /* Depends on hashtables and specifiers. */ complex_vars_of_faces (); #ifdef MULE - /* These two depend on hash tables and various variables declared + /* These two depend on hashtables and various variables declared 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 @@ -2004,9 +1482,6 @@ main_1 (int argc, char **argv, char **envp, int restart) /* These rely on the glyphs just created in the previous function, and call Fadd_spec_to_specifier(), which relies on various variables initialized above. */ -#ifdef HAVE_GTK - complex_vars_of_glyphs_gtk (); -#endif #ifdef HAVE_X_WINDOWS complex_vars_of_glyphs_x (); #endif @@ -2060,161 +1535,34 @@ main_1 (int argc, char **argv, char **envp, int restart) might depend on all sorts of things; I'm not sure. */ complex_vars_of_emacs (); +#ifdef CLASH_DETECTION + complex_vars_of_filelock (); +#endif /* CLASH_DETECTION */ + /* This creates a couple of basic keymaps and depends on Lisp - hash tables and Ffset() (both of which depend on some variables + hashtables and Ffset() (both of which depend on some variables initialized in the vars_of_*() section) and possibly other stuff. */ complex_vars_of_keymap (); - - /* Calls make_lisp_hash_table() and creates a keymap */ + /* Calls Fmake_hashtable() and creates a keymap */ complex_vars_of_event_stream (); -#ifdef ERROR_CHECK_GC - { - extern int always_gc; - if (always_gc) /* purification debugging hack */ - garbage_collect_1 (); - } -#endif -#ifdef PDUMP - } else if (!restart) { /* after successful pdump_load() */ - 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 -#ifdef HAVE_GTK - reinit_console_type_create_gtk (); -#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 -#ifdef HAVE_GTK - reinit_vars_of_event_gtk (); -#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_GTK - reinit_vars_of_menubar_gtk (); -#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 */ + if (always_gc) /* purification debugging hack */ + garbage_collect_1 (); } - /* CONGRATULATIONS!!! We have successfully initialized the Lisp engine. */ if (initialized) { - /* Stuff that should not be done at dump time, including stuff that - needs to be reset at run time. Order below should not matter. - - Many initializations taken from the environment should go here. */ + /* Stuff that needs to be reset at run time. Order below should + not matter. */ reinit_alloc (); reinit_eval (); #ifdef MULE_REGEXP reinit_mule_category (); #endif -#ifdef HAVE_POSTGRESQL - init_postgresql_from_environment(); -#endif } /* Now do further initialization/setup of stuff that is not needed by the @@ -2227,10 +1575,10 @@ main_1 (int argc, char **argv, char **envp, int restart) 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. + * variables will be properly entered into Vprocess_envonment. */ init_environment(); #endif @@ -2242,17 +1590,21 @@ main_1 (int argc, char **argv, char **envp, int restart) first because many of the functions below call egetenv() to get environment variables. */ init_lread (); /* Set up the Lisp reader. */ - init_cmdargs (argc, (Extbyte **) argv, - skip_args); /* Create list Vcommand_line_args */ +#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 */ @@ -2260,16 +1612,13 @@ main_1 (int argc, char **argv, char **envp, int restart) #ifdef SUNPRO init_sunpro (); /* Set up Sunpro usage tracking */ #endif -#if defined (WIN32_NATIVE) || defined (CYGWIN) - init_win32 (); -#endif #if defined (HAVE_NATIVE_SOUND) && defined (hp9000s800) init_hpplay (); #endif #ifdef HAVE_TTY init_device_tty (); #endif - init_console_stream (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) @@ -2293,8 +1642,7 @@ main_1 (int argc, char **argv, char **envp, int restart) else { Vinvocation_path = decode_env_path ("PATH", NULL); - locate_file (Vinvocation_path, Vinvocation_name, - Vlisp_EXEC_SUFFIXES, + locate_file (Vinvocation_path, Vinvocation_name, EXEC_SUFFIXES, &Vinvocation_directory, X_OK); } @@ -2305,7 +1653,7 @@ main_1 (int argc, char **argv, char **envp, int restart) 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. */ @@ -2313,11 +1661,11 @@ main_1 (int argc, char **argv, char **envp, int restart) char *buf = (char *)alloca (XSTRING_LENGTH (Vinvocation_directory) + XSTRING_LENGTH (Vinvocation_name) + 2); - sprintf (buf, "%s/%s", XSTRING_DATA (Vinvocation_directory), - XSTRING_DATA (Vinvocation_name)); + sprintf (buf, "%s/%s", XSTRING_DATA(Vinvocation_directory), + XSTRING_DATA(Vinvocation_name)); /* All we can do is cry if an error happens, so ignore it. */ - (void) dll_init (buf); + (void)dll_init(buf); } #endif @@ -2363,18 +1711,17 @@ main_1 (int argc, char **argv, char **envp, int restart) 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 }, @@ -2448,7 +1795,7 @@ static const struct standard_args standard_args[] = static void sort_args (int argc, char **argv) { - char **new_argv = xnew_array (char *, argc); + char **new = xnew_array (char *, argc); /* For each element of argv, the corresponding element of options is: 0 for an option that takes no arguments, @@ -2528,8 +1875,8 @@ sort_args (int argc, char **argv) } } - /* Copy the arguments, in order of decreasing priority, to NEW_ARGV. */ - new_argv[0] = argv[0]; + /* Copy the arguments, in order of decreasing priority, to NEW. */ + new[0] = argv[0]; while (to < argc) { int best = -1; @@ -2552,10 +1899,10 @@ sort_args (int argc, char **argv) if (best < 0) abort (); - /* Copy the highest priority remaining option, with its args, to NEW_ARGV. */ - new_argv[to++] = argv[best]; + /* Copy the highest priority remaining option, with its args, to NEW. */ + new[to++] = argv[best]; for (i = 0; i < options[best]; i++) - new_argv[to++] = argv[best + i + 1]; + new[to++] = argv[best + i + 1]; /* Clear out this option in ARGV. */ argv[best] = 0; @@ -2563,12 +1910,17 @@ sort_args (int argc, char **argv) argv[best + i + 1] = 0; } - memcpy (argv, new_argv, sizeof (char *) * argc); - xfree (new_argv); - xfree (options); - xfree (priority); + memcpy (argv, new, sizeof (char *) * argc); } +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 @@ -2590,17 +1942,15 @@ Do not call this. It will reinitialize your XEmacs. You'll be sorry. a dumped version in case you want to rerun it. This function is most useful when used as part of the `make all-elc' command. --ben] This will "restart" emacs with the specified command-line arguments. - - Martin thinks this function is most useful when using debugging - tools like Purify or tcov that get confused by XEmacs' dumping. */ + */ (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); @@ -2611,22 +1961,21 @@ Do not call this. It will reinitialize your XEmacs. You'll be sorry. /* 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]; } DO_REALLOC (run_temacs_args, run_temacs_args_size, total_len, char); - DO_REALLOC (run_temacs_argv, run_temacs_argv_size, nargs+2, char *); + DO_REALLOC (run_temacs_argv, run_temacs_argv_size, nargs+1, char *); memcpy (run_temacs_args, wampum, namesize); run_temacs_argv [0] = run_temacs_args; @@ -2643,8 +1992,10 @@ Do not call this. It will reinitialize your XEmacs. You'll be sorry. 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); +#ifdef REPORT_PURE_USAGE + report_pure_usage (1, 0); +#else + report_pure_usage (0, 0); #endif LONGJMP (run_temacs_catch, 1); return Qnil; /* not reached; warning suppression */ @@ -2654,46 +2005,31 @@ Do not call this. It will reinitialize your XEmacs. You'll be sorry. 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; - /* This is hairy. We need to compute where the XEmacs binary was invoked - from because temacs initialization requires it to find the lisp - directories. The code that recomputes the path is guarded by the - restarted flag. There are three possible paths I've found so far - through this: - - temacs -- When running temacs for basic build stuff, the first main_1 - will be the only one invoked. It must compute the path else there - will be a very ugly bomb in startup.el (can't find obvious location - for doc-directory data-directory, etc.). - - temacs w/ run-temacs on the command line -- This is run to bytecompile - all the out of date dumped lisp. It will execute both of the main_1 - calls and the second one must not touch the first computation because - argc/argv are hosed the second time through. - - xemacs -- Only the second main_1 is executed. The invocation path must - computed but this only matters when running in place or when running - as a login shell. - - As a bonus for straightening this out, XEmacs can now be run in place - as a login shell. This never used to work. - - As another bonus, we can now guarantee that - (concat invocation-directory invocation-name) contains the filename - of the XEmacs binary we are running. This can now be used in a - definite test for out of date dumped files. -slb */ + /* This is hairy. We need to compute where the XEmacs binary was invoked */ + /* from because temacs initialization requires it to find the lisp */ + /* directories. The code that recomputes the path is guarded by the */ + /* restarted flag. There are three possible paths I've found so far */ + /* through this: */ + /* temacs -- When running temacs for basic build stuff, the first main_1 */ + /* will be the only one invoked. It must compute the path else there */ + /* will be a very ugly bomb in startup.el (can't find obvious location */ + /* for doc-directory data-directory, etc.). */ + /* temacs w/ run-temacs on the command line -- This is run to bytecompile */ + /* all the out of date dumped lisp. It will execute both of the main_1 */ + /* calls and the second one must not touch the first computation because */ + /* argc/argv are hosed the second time through. */ + /* xemacs -- Only the second main_1 is executed. The invocation path must */ + /* computed but this only matters when running in place or when running */ + /* as a login shell. */ + /* As a bonus for straightening this out, XEmacs can now be run in place */ + /* as a login shell. This never used to work. */ + /* As another bonus, we can now guarantee that */ + /* (concat invocation-directory invocation-name) contains the filename */ + /* of the XEmacs binary we are running. This can now be used in a */ + /* definite test for out of date dumped files. -slb */ int restarted = 0; #ifdef QUANTIFY quantify_stop_recording_data (); @@ -2739,16 +2075,16 @@ main (int argc, char **argv, char **envp) 06/20/96 robertl@dgii.com */ { - extern char **_environ; + extern char *_environ; if ((unsigned) environ == 0) environ=_environ; } #endif /* _SCO_DS */ vol_envp = environ; } -#if defined (RUN_TIME_REMAP) && ! defined (PDUMP) +#ifdef RUN_TIME_REMAP else - /* obviously no-one uses this because where it was before initialized was + /* obviously no-one uses this because where it was before initalized was *always* true */ run_time_remap (argv[0]); #endif @@ -2759,7 +2095,7 @@ main (int argc, char **argv, char **envp) 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 @@ -2781,14 +2117,6 @@ main (int argc, char **argv, char **envp) 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 */ } @@ -2799,17 +2127,13 @@ main (int argc, char **argv, char **envp) /* GCC >= 2.8. -slb */ #if defined(GNU_MALLOC) static void -voodoo_free_hook (void *mem) +voodoo_free_hook(void *mem) { /* 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)) -#endif - voodoo_free_hook; + __free_hook = voodoo_free_hook; } -#endif /* GNU_MALLOC */ +#endif DEFUN ("kill-emacs", Fkill_emacs, 0, 1, "P", /* Exit the XEmacs job and kill it. Ask for confirmation, without argument. @@ -2833,7 +2157,9 @@ all of which are called before XEmacs is actually killed. 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) { @@ -2847,7 +2173,7 @@ all of which are called before XEmacs is actually killed. 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 @@ -2861,30 +2187,13 @@ all of which are called before XEmacs is actually killed. UNGCPRO; -#ifdef HAVE_MS_WINDOWS - /* If we displayed a message on the console, then we must allow the - user to see this message. This may be unnecessary, but can't - hurt, and we can't necessarily check arg; e.g. xemacs --help - kills with argument 0. - - Don't do this in batch mode, it makes no sense and is more - annoying than useful. --andyp */ - if (mswindows_message_outputted && !noninteractive) - Fmswindows_message_box (build_string ("Messages outputted. XEmacs is exiting."), - 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)) -#endif - voodoo_free_hook; + __free_hook = 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 */ } @@ -2897,95 +2206,80 @@ all of which are called before XEmacs is actually killed. 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" - "Your version of XEmacs was distributed with a PROBLEMS file that may describe\n" - "your crash, and with luck a workaround. Please check it first, but do report\n" - "the crash anyway. " #ifdef INFODOCK - "\n\nPlease report this bug by selecting `Report-Bug' in the InfoDock menu.\n" - "*BE SURE* to include the XEmacs configuration from M-x describe-installation,\n" - "or the file Installation in the top directory of the build tree.\n" + "Please report this bug by selecting `Report-Bug' in the InfoDock\n" + "menu.\n" #else - "Please report this bug by invoking M-x report-emacs-bug,\n" - "or by selecting `Send Bug Report' from the Help menu. If necessary, send\n" - "ordinary email to `crashes@xemacs.org'. *MAKE SURE* to include the XEmacs\n" - "configuration from M-x describe-installation, or equivalently the file\n" - "Installation in the top of the build tree.\n" + "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 -#ifndef _MSC_VER + "*MAKE SURE* to include the information in the command\n" + "M-x describe-installation.\n" "\n" - "*Please* try *hard* to obtain a C stack backtrace; without it, we are unlikely\n" - "to be able to analyze the problem. Locate the core file produced as a result\n" - "of this crash (often called `core' or `core.<process-id>', and located in\n" - "the directory in which you started XEmacs or your home directory), and type\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" + "To do this, locate the core file that was produced as a result\n" + "of this crash (it's usually called `core' and is located in the\n" + "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); @@ -2995,13 +2289,11 @@ shut_down_emacs (int sig, Lisp_Object stuff, int no_auto_save) stderr_out ("%s%s", dir, name); } stderr_out - (" core\n" - "\n" - "then type `where' at the debugger prompt. No GDB on your system? You may\n" - "have DBX, or XDB, or SDB. (Ask your system administrator if you need help.)\n" - "If no core file was produced, enable them (often with `ulimit -c unlimited'\n" - "in case of future recurrance of the crash.\n"); -#endif /* _MSC_VER */ + (" core\n\n" + "then type `where' when the debugger prompt comes up.\n" + "(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"); } stuff_buffered_input (stuff); @@ -3024,11 +2316,50 @@ shut_down_emacs (int sig, Lisp_Object stuff, int no_auto_save) #ifndef CANNOT_DUMP +/* Nothing like this can be implemented on an Apollo. + What a loss! */ -#if !defined(PDUMP) || !defined(SYSTEM_MALLOC) 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, /* @@ -3040,13 +2371,13 @@ Remember to set `command-line-processed' to nil before dumping if you want the dumped XEmacs to process its command line and announce itself normally when it is run. */ - (filename, symfile)) + (intoname, symname)) { /* This function can GC */ struct gcpro gcpro1, gcpro2; int opurify; - GCPRO2 (filename, symfile); + GCPRO2 (intoname, symname); #ifdef FREE_CHECKING Freally_free (Qnil); @@ -3054,27 +2385,29 @@ and announce itself normally when it is run. /* When we're dumping, we can't use the debugging free() */ disable_free_hook (); #endif +#if 1 /* martin */ +#endif - CHECK_STRING (filename); - filename = Fexpand_file_name (filename, Qnil); - if (!NILP (symfile)) + CHECK_STRING (intoname); + intoname = Fexpand_file_name (intoname, Qnil); + if (!NILP (symname)) { - CHECK_STRING (symfile); - if (XSTRING_LENGTH (symfile) > 0) - symfile = Fexpand_file_name (symfile, Qnil); + CHECK_STRING (symname); + if (XSTRING_LENGTH (symname) > 0) + symname = Fexpand_file_name (symname, Qnil); else - symfile = Qnil; + symname = Qnil; } opurify = purify_flag; purify_flag = 0; -#if defined (HEAP_IN_DATA) && !defined(PDUMP) - report_sheap_usage (1); +#ifdef DEBUG_XEMACS + report_pure_usage (1, 1); +#else + report_pure_usage (0, 1); #endif - clear_message (); - fflush (stderr); fflush (stdout); @@ -3089,23 +2422,29 @@ and announce itself normally when it is run. UNGCPRO; +#if defined (MSDOS) && defined (EMX) { - char *filename_ext; - char *symfile_ext; - - LISP_STRING_TO_EXTERNAL (filename, filename_ext, Qfile_name); + 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; - if (STRINGP (symfile)) - LISP_STRING_TO_EXTERNAL (symfile, symfile_ext, Qfile_name); + GET_C_STRING_FILENAME_DATA_ALLOCA (intoname, intoname_ext); + if (STRINGP (symname)) + GET_C_STRING_FILENAME_DATA_ALLOCA (symname, symname_ext); else - symfile_ext = 0; + symname_ext = 0; garbage_collect_1 (); - -#ifdef PDUMP - pdump (); -#else - #ifdef DOUG_LEA_MALLOC malloc_state_ptr = malloc_get_state (); #endif @@ -3114,34 +2453,39 @@ and announce itself normally when it is run. It's a whole lot easier to do the conversion here than to modify all the unexec routines to ensure that filename conversion is applied everywhere. Don't worry about memory - leakage because this call only happens once. */ - unexec (filename_ext, symfile_ext, (uintptr_t) my_edata, 0, 0); + leakage because this call only happens once. */ + unexec (intoname_ext, symname_ext, (uintptr_t) my_edata, 0, 0); #ifdef DOUG_LEA_MALLOC - free (malloc_state_ptr); + 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) @@ -3161,32 +2505,33 @@ split_string_by_emchar_1 (const Bufbyte *string, Bytecount size, } /* 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 (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) @@ -3197,7 +2542,7 @@ decode_env_path (const char *evarname, const char *default_) /* Ben thinks this function should not exist or be exported to Lisp. We use it to define split-path-string in subr.el (not!). */ -DEFUN ("split-string-by-char", Fsplit_string_by_char, 2, 2, 0, /* +DEFUN ("split-string-by-char", Fsplit_string_by_char, 1, 2, 0, /* Split STRING into a list of substrings originally separated by SEPCHAR. */ (string, sepchar)) @@ -3248,81 +2593,23 @@ Non-nil return value means XEmacs is running without interactive terminal. #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 */ #ifdef QUANTIFY DEFUN ("quantify-start-recording-data", Fquantify_start_recording_data, - 0, 0, "", /* + 0, 0, 0, /* Start recording Quantify data. */ ()) @@ -3332,7 +2619,7 @@ Start recording Quantify data. } DEFUN ("quantify-stop-recording-data", Fquantify_stop_recording_data, - 0, 0, "", /* + 0, 0, 0, /* Stop recording Quantify data. */ ()) @@ -3341,7 +2628,7 @@ Stop recording Quantify data. return Qnil; } -DEFUN ("quantify-clear-data", Fquantify_clear_data, 0, 0, "", /* +DEFUN ("quantify-clear-data", Fquantify_clear_data, 0, 0, 0, /* Clear all Quantify data. */ ()) @@ -3355,7 +2642,11 @@ void 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); @@ -3426,7 +2717,7 @@ Symbol indicating type of operating system you are using. 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" @@ -3434,7 +2725,8 @@ String naming the configuration XEmacs was built for. 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. @@ -3452,20 +2744,7 @@ Warning: this variable did not exist in Emacs versions earlier than: */ ); 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 @@ -3500,13 +2779,8 @@ Codename of this version of Emacs (a string). #ifndef XEMACS_CODENAME #define XEMACS_CODENAME "Noname" #endif - Vxemacs_codename = build_string (XEMACS_CODENAME); + Vxemacs_codename = Fpurecopy (build_string (XEMACS_CODENAME)); - /* Lisp variables which contain command line flags. - - The portable dumper stomps on these; they must be saved and restored - if they are processed before the call to pdump_load() in main_1(). - */ DEFVAR_BOOL ("noninteractive", &noninteractive1 /* Non-nil means XEmacs is running without interactive terminal. */ ); @@ -3530,13 +2804,6 @@ Set to non-nil when the site-lisp should not be searched at startup. inhibit_site_lisp = 1; #endif - DEFVAR_BOOL ("inhibit-site-modules", &inhibit_site_modules /* -Set to non-nil when site-modules should not be searched at startup. -*/ ); -#ifdef INHIBIT_SITE_MODULES - inhibit_site_modules = 1; -#endif - DEFVAR_INT ("emacs-priority", &emacs_priority /* Priority for XEmacs to run at. This value is effective only if set before XEmacs is dumped, @@ -3557,8 +2824,6 @@ typecheck - check types strictly, aborting in case of error; 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 @@ -3581,50 +2846,7 @@ quick-build - user has requested the "quick-build" configure option. 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. @@ -3639,7 +2861,7 @@ void complex_vars_of_emacs (void) { /* This is all related to path searching. */ - + DEFVAR_LISP ("emacs-program-name", &Vemacs_program_name /* *Name of the Emacs variant. For example, this may be \"xemacs\" or \"infodock\". @@ -3649,7 +2871,7 @@ This is mainly meant for use in path searching. DEFVAR_LISP ("emacs-program-version", &Vemacs_program_version /* *Version of the Emacs variant. -This typically has the form NN.NN-bNN. +This typically has the form XX.XX[-bXX]. This is mainly meant for use in path searching. */ ); Vemacs_program_version = build_string ((char *) PATH_VERSION); @@ -3668,7 +2890,7 @@ especially executable programs intended for XEmacs to invoke. DEFVAR_LISP ("configure-exec-directory", &Vconfigure_exec_directory /* For internal use by the build procedure only. -configure's idea of what `exec-directory' will be. +configure's idea of what EXEC-DIRECTORY will be. */ ); #ifdef PATH_EXEC Vconfigure_exec_directory = Ffile_name_as_directory @@ -3684,7 +2906,7 @@ configure's idea of what `exec-directory' will be. DEFVAR_LISP ("configure-lisp-directory", &Vconfigure_lisp_directory /* For internal use by the build procedure only. -configure's idea of what `lisp-directory' will be. +configure's idea of what LISP-DIRECTORY will be. */ ); #ifdef PATH_LOADSEARCH Vconfigure_lisp_directory = Ffile_name_as_directory @@ -3693,38 +2915,6 @@ configure's idea of what `lisp-directory' will be. Vconfigure_lisp_directory = Qnil; #endif - DEFVAR_LISP ("mule-lisp-directory", &Vmule_lisp_directory /* -*Directory of Mule Lisp files that come with XEmacs. -*/ ); - Vmule_lisp_directory = Qnil; - - DEFVAR_LISP ("configure-mule-lisp-directory", &Vconfigure_mule_lisp_directory /* -For internal use by the build procedure only. -configure's idea of what `mule-lisp-directory' will be. -*/ ); -#ifdef PATH_MULELOADSEARCH - Vconfigure_mule_lisp_directory = Ffile_name_as_directory - (build_string ((char *) PATH_MULELOADSEARCH)); -#else - Vconfigure_mule_lisp_directory = Qnil; -#endif - - DEFVAR_LISP ("module-directory", &Vmodule_directory /* -*Directory of core dynamic modules that come with XEmacs. -*/ ); - Vmodule_directory = Qnil; - - DEFVAR_LISP ("configure-module-directory", &Vconfigure_module_directory /* -For internal use by the build procedure only. -configure's idea of what `module-directory' will be. -*/ ); -#ifdef PATH_MODULESEARCH - Vconfigure_module_directory = Ffile_name_as_directory - (build_string ((char *) PATH_MODULESEARCH)); -#else - Vconfigure_module_directory = Qnil; -#endif - DEFVAR_LISP ("configure-package-path", &Vconfigure_package_path /* For internal use by the build procedure only. configure's idea of what the package path will be. @@ -3739,14 +2929,13 @@ configure's idea of what the package path will be. *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; DEFVAR_LISP ("configure-data-directory", &Vconfigure_data_directory /* For internal use by the build procedure only. -configure's idea of what `data-directory' will be. +configure's idea of what DATA-DIRECTORY will be. */ ); #ifdef PATH_DATA Vconfigure_data_directory = Ffile_name_as_directory @@ -3761,6 +2950,19 @@ or were installed as packages, and are intended for XEmacs to use. */ ); 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. */ ); @@ -3768,7 +2970,7 @@ or were installed as packages, and are intended for XEmacs to use. DEFVAR_LISP ("configure-site-directory", &Vconfigure_site_directory /* For internal use by the build procedure only. -configure's idea of what `site-directory' will be. +configure's idea of what SITE-DIRECTORY will be. */ ); #ifdef PATH_SITE Vconfigure_site_directory = Ffile_name_as_directory @@ -3777,31 +2979,15 @@ configure's idea of what `site-directory' will be. Vconfigure_site_directory = Qnil; #endif - DEFVAR_LISP ("site-module-directory", &Vsite_module_directory /* -*Directory of site-specific loadable modules that come with XEmacs. -*/ ); - Vsite_module_directory = Qnil; - - DEFVAR_LISP ("configure-site-module-directory", &Vconfigure_site_module_directory /* -For internal use by the build procedure only. -configure's idea of what `site-directory' will be. -*/ ); -#ifdef PATH_SITE_MODULES - Vconfigure_site_module_directory = Ffile_name_as_directory - (build_string ((char *) PATH_SITE_MODULES)); -#else - Vconfigure_site_module_directory = Qnil; -#endif - DEFVAR_LISP ("doc-directory", &Vdoc_directory /* *Directory containing the DOC file that comes with XEmacs. -This is usually the same as `exec-directory'. +This is usually the same as exec-directory. */ ); Vdoc_directory = Qnil; DEFVAR_LISP ("configure-doc-directory", &Vconfigure_doc_directory /* For internal use by the build procedure only. -configure's idea of what `doc-directory' will be. +configure's idea of what DOC-DIRECTORY will be. */ ); #ifdef PATH_DOC Vconfigure_doc_directory = Ffile_name_as_directory @@ -3812,7 +2998,7 @@ configure's idea of what `doc-directory' will be. DEFVAR_LISP ("configure-exec-prefix-directory", &Vconfigure_exec_prefix_directory /* For internal use by the build procedure only. -configure's idea of what `exec-prefix-directory' will be. +configure's idea of what EXEC-PREFIX-DIRECTORY will be. */ ); #ifdef PATH_EXEC_PREFIX Vconfigure_exec_prefix_directory = Ffile_name_as_directory @@ -3823,7 +3009,7 @@ configure's idea of what `exec-prefix-directory' will be. DEFVAR_LISP ("configure-prefix-directory", &Vconfigure_prefix_directory /* For internal use by the build procedure only. -configure's idea of what `prefix-directory' will be. +configure's idea of what PREFIX-DIRECTORY will be. */ ); #ifdef PATH_PREFIX Vconfigure_prefix_directory = Ffile_name_as_directory @@ -3855,16 +3041,14 @@ The configured initial path for info documentation. #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 masquerading as libz, and + * libiflPNG.so library which is maskerading as libz, and * cores on us when re-started from the dumped executable. * This will have to go for 21.1 -- OG. */ -void __sti__iflPNGFile_c___ (void); -void -__sti__iflPNGFile_c___ (void) +void __sti__iflPNGFile_c___() { } diff --git a/src/event-gtk.c b/src/event-gtk.c index d9360e3..9dd0394 100644 --- a/src/event-gtk.c +++ b/src/event-gtk.c @@ -1253,26 +1253,6 @@ gtk_event_to_emacs_event (struct frame *frame, GdkEvent *gdk_event, struct Lisp_ if (*state & gd->HyperMask) modifiers |= XEMACS_MOD_HYPER; if (*state & gd->AltMask) modifiers |= XEMACS_MOD_ALT; - { - int numero_de_botao = -1; - - if (!key_event_p) - numero_de_botao = gdk_event->button.button; - - /* the button gets noted either in the button or the modifiers - field, but not both. */ - if (numero_de_botao != 1 && (*state & GDK_BUTTON1_MASK)) - modifiers |= XEMACS_MOD_BUTTON1; - if (numero_de_botao != 2 && (*state & GDK_BUTTON2_MASK)) - modifiers |= XEMACS_MOD_BUTTON2; - if (numero_de_botao != 3 && (*state & GDK_BUTTON3_MASK)) - modifiers |= XEMACS_MOD_BUTTON3; - if (numero_de_botao != 4 && (*state & GDK_BUTTON4_MASK)) - modifiers |= XEMACS_MOD_BUTTON4; - if (numero_de_botao != 5 && (*state & GDK_BUTTON5_MASK)) - modifiers |= XEMACS_MOD_BUTTON5; - } - /* Ignore the Caps_Lock key if: - any other modifiers are down, so that Caps_Lock doesn't turn C-x into C-X, which would suck. @@ -1393,13 +1373,7 @@ gtk_event_to_emacs_event (struct frame *frame, GdkEvent *gdk_event, struct Lisp_ if (mask & gd->MetaMask) modifiers |= XEMACS_MOD_META; if (mask & gd->SuperMask) modifiers |= XEMACS_MOD_SUPER; if (mask & gd->HyperMask) modifiers |= XEMACS_MOD_HYPER; - if (mask & gd->AltMask) modifiers |= XEMACS_MOD_ALT; - if (mask & GDK_BUTTON1_MASK) modifiers |= XEMACS_MOD_BUTTON1; - if (mask & GDK_BUTTON2_MASK) modifiers |= XEMACS_MOD_BUTTON2; - if (mask & GDK_BUTTON3_MASK) modifiers |= XEMACS_MOD_BUTTON3; - if (mask & GDK_BUTTON4_MASK) modifiers |= XEMACS_MOD_BUTTON4; - if (mask & GDK_BUTTON5_MASK) modifiers |= XEMACS_MOD_BUTTON5; - + if (mask & gd->AltMask) modifiers |= XEMACS_MOD_ALT; /* Currently ignores Shift_Lock but probably shouldn't (but it definitely should ignore Caps_Lock). */ emacs_event->event.motion.modifiers = modifiers; @@ -1753,7 +1727,6 @@ vars_of_event_gtk (void) dispatch_event_queue = Qnil; staticpro (&dispatch_event_queue); dispatch_event_queue_tail = Qnil; - staticpro (&dispatch_event_queue_tail); DEFVAR_BOOL ("gtk-allow-sendevents", >k_allow_sendevents /* *Non-nil means to allow synthetic events. Nil means they are ignored. diff --git a/src/faces.c b/src/faces.c index 551415e..750055c 100644 --- a/src/faces.c +++ b/src/faces.c @@ -36,6 +36,7 @@ Boston, MA 02111-1307, USA. */ #include "faces.h" #include "frame.h" #include "glyphs.h" +#include "hash.h" #include "objects.h" #include "specifier.h" #include "window.h" @@ -55,10 +56,11 @@ Lisp_Object Qinit_global_faces; calling Ffind_face. */ Lisp_Object Vdefault_face, Vmodeline_face, Vgui_element_face; Lisp_Object Vleft_margin_face, Vright_margin_face, Vtext_cursor_face; -Lisp_Object Vpointer_face, Vvertical_divider_face, Vtoolbar_face, Vwidget_face; +Lisp_Object Vpointer_face, Vvertical_divider_face, Vtoolbar_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 +74,26 @@ Lisp_Object Vbuilt_in_face_specifiers; 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 +101,7 @@ mark_face (Lisp_Object obj) 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) { @@ -127,10 +129,10 @@ print_face (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) This isn't concerned with "unspecified" attributes, that's what #'face-differs-from-default-p is for. */ static int -face_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +face_equal (Lisp_Object o1, Lisp_Object o2, int depth) { - Lisp_Face *f1 = XFACE (obj1); - Lisp_Face *f2 = XFACE (obj2); + struct Lisp_Face *f1 = XFACE (o1); + struct Lisp_Face *f2 = XFACE (o2); depth++; @@ -153,7 +155,7 @@ face_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) static unsigned long face_hash (Lisp_Object obj, int depth) { - Lisp_Face *f = XFACE (obj); + struct Lisp_Face *f = XFACE (obj); depth++; @@ -167,28 +169,28 @@ face_hash (Lisp_Object obj, int depth) 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 +220,7 @@ face_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value) 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 +247,7 @@ face_remprop (Lisp_Object obj, Lisp_Object prop) 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 +265,11 @@ face_plist (Lisp_Object obj) 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 +335,7 @@ face_instantiate (Lisp_Object data) ****************************************************************************/ static void -reset_face (Lisp_Face *f) +reset_face (struct Lisp_Face *f) { f->name = Qnil; f->doc_string = Qnil; @@ -372,10 +355,11 @@ reset_face (Lisp_Face *f) 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; @@ -391,14 +375,19 @@ struct face_list_closure }; static int -add_face_to_list_mapper (Lisp_Object key, Lisp_Object value, +add_face_to_list_mapper (CONST void *hash_key, void *hash_contents, void *face_list_closure) { /* This function can GC */ + Lisp_Object key, contents; + Lisp_Object *face_list; struct face_list_closure *fcl = (struct face_list_closure *) face_list_closure; + CVOID_TO_LISP (key, hash_key); + VOID_TO_LISP (contents, hash_contents); + face_list = fcl->face_list; - *(fcl->face_list) = Fcons (XFACE (value)->name, (*fcl->face_list)); + *face_list = Fcons (XFACE (contents)->name, *face_list); return 0; } @@ -431,12 +420,15 @@ temporary_faces_list (void) static int -mark_face_as_clean_mapper (Lisp_Object key, Lisp_Object value, +mark_face_as_clean_mapper (CONST void *hash_key, void *hash_contents, void *flag_closure) { /* This function can GC */ + Lisp_Object key, contents; int *flag = (int *) flag_closure; - XFACE (value)->dirty = *flag; + CVOID_TO_LISP (key, hash_key); + VOID_TO_LISP (contents, hash_contents); + XFACE (contents)->dirty = *flag; return 0; } @@ -496,7 +488,7 @@ update_inheritance_mapper_internal (Lisp_Object cur_face, } 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; @@ -596,7 +588,7 @@ face_property_matching_instance (Lisp_Object face, Lisp_Object property, DEFUN ("facep", Ffacep, 1, 1, 0, /* -Return t if OBJECT is a face. +Return non-nil if OBJECT is a face. */ (object)) { @@ -762,15 +754,15 @@ other non-nil value both permanent and temporary are included. } DEFUN ("make-face", Fmake_face, 1, 3, 0, /* -Define a new face with name NAME (a symbol), described by DOC-STRING. -You can modify the font, color, etc. of a face with the set-face-* functions. +Define and return a new FACE described by DOC-STRING. +You can modify the font, color, etc of a face with the set-face-* functions. If the face already exists, it is unmodified. If TEMPORARY is non-nil, this face will cease to exist if not in use. */ (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 +990,8 @@ Here's an approach that should keep things clean and unconfused: /* 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 +1007,13 @@ mark_face_cachels (face_cachel_dynarr *elements) 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 +1131,7 @@ face_cachel_charset_font_metric_info (struct face_cachel *cachel, { 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)); @@ -1154,6 +1147,22 @@ face_cachel_charset_font_metric_info (struct face_cachel *cachel, } } +/* Called when the updated flag has been cleared on a cachel. */ + +void +update_face_cachel_data (struct face_cachel *cachel, + Lisp_Object domain, + Lisp_Object face) +{ + if (XFACE (face)->dirty || UNBOUNDP (cachel->face)) + { + int default_face = EQ (face, Vdefault_face); + cachel->face = face; + + /* We normally only set the _specified flags if the value was + actually bound. The exception is for the default face where + we always set it since it is the ultimate fallback. */ + #define FROB(field) \ do { \ Lisp_Object new_val = \ @@ -1172,125 +1181,31 @@ face_cachel_charset_font_metric_info (struct face_cachel *cachel, cachel->field##_specified = (bound || default_face); \ } while (0) -/* - * A face's background pixmap will override the face's - * background color. But the background pixmap of the - * default face should not override the background color of - * a face if the background color has been specified or - * inherited. - * - * To accomplish this we remove the background pixmap of the - * cachel and mark it as having been specified so that cachel - * merging won't override it later. - */ -#define MAYBE_UNFROB_BACKGROUND_PIXMAP \ -do \ -{ \ - if (! default_face \ - && cachel->background_specified \ - && ! cachel->background_pixmap_specified) \ - { \ - cachel->background_pixmap = Qunbound; \ - cachel->background_pixmap_specified = 1; \ - } \ -} while (0) - - -/* Add a cachel for the given face to the given window's cache. */ - -static void -add_face_cachel (struct window *w, Lisp_Object face) -{ - int must_finish_frobbing = ! WINDOW_FACE_CACHEL (w, DEFAULT_INDEX); - struct face_cachel new_cachel; - Lisp_Object domain; - - reset_face_cachel (&new_cachel); - XSETWINDOW (domain, w); - update_face_cachel_data (&new_cachel, domain, face); - Dynarr_add (w->face_cachels, new_cachel); - - /* The face's background pixmap have not yet been frobbed (see comment - int update_face_cachel_data), so we have to do it now */ - if (must_finish_frobbing) - { - int default_face = EQ (face, Vdefault_face); - struct face_cachel *cachel - = Dynarr_atp (w->face_cachels, Dynarr_length (w->face_cachels) - 1); - - FROB (background_pixmap); - MAYBE_UNFROB_BACKGROUND_PIXMAP; - } -} - -/* Called when the updated flag has been cleared on a cachel. - This function returns 1 if the caller must finish the update (see comment - below), 0 otherwise. -*/ - -void -update_face_cachel_data (struct face_cachel *cachel, - Lisp_Object domain, - Lisp_Object face) -{ - if (XFACE (face)->dirty || UNBOUNDP (cachel->face)) - { - int default_face = EQ (face, Vdefault_face); - cachel->face = face; - - /* We normally only set the _specified flags if the value was - actually bound. The exception is for the default face where - we always set it since it is the ultimate fallback. */ - FROB (foreground); FROB (background); FROB (display_table); + FROB (background_pixmap); - /* #### WARNING: the background pixmap property of faces is currently - the only one dealing with images. The problem we have here is that - frobbing the background pixmap might lead to image instantiation - which in turn might require that the cache we're building be up to - date, hence a crash. Here's a typical scenario of this: - - - a new window is created and it's face cache elements are - initialized through a call to reset_face_cachels[1]. At that point, - the cache for the default and modeline faces (normaly taken care of - by redisplay itself) are null. - - the default face has a background pixmap which needs to be - instantiated right here, as a consequence of cache initialization. - - the background pixmap image happens to be instantiated as a string - (this happens on tty's for instance). - - In order to do this, we need to compute the string geometry. - - In order to do this, we might have to access the window's default - face cache. But this is the cache we're building right now, it is - null. - - BARF !!!!! - - To sum up, this means that it is in general unsafe to instantiate - images before face cache updating is complete (appart from image - related face attributes). The solution we use below is to actually - detect whether we're building the window's face_cachels for the first - time, and simply NOT frob the background pixmap in that case. If - other image-related face attributes are ever implemented, they should - be protected the same way right here. - - One note: - * See comment in `default_face_font_info' in face.c. Who wrote it ? - Maybe we have the begining of an answer here ? - - Footnotes: - [1] See comment at the top of `allocate_window' in window.c. - - -- didier - */ - if (! WINDOWP (domain) - || WINDOW_FACE_CACHEL (DOMAIN_XWINDOW (domain), DEFAULT_INDEX)) + /* + * A face's background pixmap will override the face's + * background color. But the background pixmap of the + * default face should not override the background color of + * a face if the background color has been specified or + * inherited. + * + * To accomplish this we remove the background pixmap of the + * cachel and mark it as having been specified so that cachel + * merging won't override it later. + */ + if (! default_face + && cachel->background_specified + && ! cachel->background_pixmap_specified) { - FROB (background_pixmap); - MAYBE_UNFROB_BACKGROUND_PIXMAP; + cachel->background_pixmap = Qunbound; + cachel->background_pixmap_specified = 1; } + #undef FROB -#undef MAYBE_UNFROB_BACKGROUND_PIXMAP ensure_face_cachel_contains_charset (cachel, domain, Vcharset_ascii); @@ -1395,6 +1310,20 @@ reset_face_cachel (struct face_cachel *cachel) cachel->background_pixmap = Qunbound; } +/* Add a cachel for the given face to the given window's cache. */ + +static void +add_face_cachel (struct window *w, Lisp_Object face) +{ + struct face_cachel new_cachel; + Lisp_Object window; + + reset_face_cachel (&new_cachel); + XSETWINDOW (window, w); + update_face_cachel_data (&new_cachel, window, face); + Dynarr_add (w->face_cachels, new_cachel); +} + /* Retrieve the index to a cachel for window W that corresponds to the specified face. If necessary, add a new element to the cache. */ @@ -1639,16 +1568,7 @@ get_extent_fragment_face_cache_index (struct window *w, findex = get_builtin_face_cache_index (w, Vdefault_face); merge_face_cachel_data (w, findex, &cachel); - findex = get_merged_face_cache_index (w, &cachel); - if (cachel.merged_faces && - /* merged_faces did not get stored and available via return value */ - Dynarr_at (w->face_cachels, findex).merged_faces != - cachel.merged_faces) - { - Dynarr_free (cachel.merged_faces); - cachel.merged_faces = 0; - } - return findex; + return get_merged_face_cache_index (w, &cachel); } } @@ -1718,19 +1638,23 @@ face_property_was_changed (Lisp_Object face, Lisp_Object property, if (WINDOWP (locale)) { - MARK_FRAME_FACES_CHANGED (XFRAME (XWINDOW (locale)->frame)); + struct frame *f = XFRAME (XWINDOW (locale)->frame); + MARK_FRAME_FACES_CHANGED (f); } else if (FRAMEP (locale)) { - MARK_FRAME_FACES_CHANGED (XFRAME (locale)); + struct frame *f = XFRAME (locale); + MARK_FRAME_FACES_CHANGED (f); } else if (DEVICEP (locale)) { - MARK_DEVICE_FRAMES_FACES_CHANGED (XDEVICE (locale)); + struct device *d = XDEVICE (locale); + MARK_DEVICE_FRAMES_FACES_CHANGED (d); } else { Lisp_Object devcons, concons; + DEVICE_LOOP_NO_BREAK (devcons, concons) MARK_DEVICE_FRAMES_FACES_CHANGED (XDEVICE (XCAR (devcons))); } @@ -1763,7 +1687,7 @@ LOCALE, TAG-SET, EXACT-P, and HOW-TO-ADD are as in `copy-specifier'. */ (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; @@ -1825,11 +1749,11 @@ LOCALE, TAG-SET, EXACT-P, and HOW-TO-ADD are as in `copy-specifier'. void syms_of_faces (void) { - INIT_LRECORD_IMPLEMENTATION (face); - - /* Qdefault, Qwidget, Qleft_margin, Qright_margin defined in general.c */ + /* Qdefault 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"); @@ -1882,8 +1806,6 @@ vars_of_faces (void) Vdefault_face = Qnil; staticpro (&Vgui_element_face); Vgui_element_face = Qnil; - staticpro (&Vwidget_face); - Vwidget_face = Qnil; staticpro (&Vmodeline_face); Vmodeline_face = Qnil; staticpro (&Vtoolbar_face); @@ -1916,7 +1838,7 @@ vars_of_faces (void) syms[n++] = Qblinking; syms[n++] = Qreverse; - Vbuilt_in_face_specifiers = Flist (n, syms); + Vbuilt_in_face_specifiers = pure_list (n, syms); staticpro (&Vbuilt_in_face_specifiers); } } @@ -1924,10 +1846,10 @@ vars_of_faces (void) void complex_vars_of_faces (void) { - Vpermanent_faces_cache = - make_lisp_hash_table (10, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); - Vtemporary_faces_cache = - make_lisp_hash_table (0, HASH_TABLE_WEAK, HASH_TABLE_EQ); + Vpermanent_faces_cache = make_lisp_hashtable (10, HASHTABLE_NONWEAK, + HASHTABLE_EQ); + Vtemporary_faces_cache = make_lisp_hashtable (0, HASHTABLE_WEAK, + HASHTABLE_EQ); /* Create the default face now so we know what it is immediately. */ @@ -1942,10 +1864,6 @@ complex_vars_of_faces (void) { Lisp_Object fg_fb = Qnil, bg_fb = Qnil; -#ifdef HAVE_GTK - fg_fb = acons (list1 (Qgtk), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qgtk), build_string ("white"), bg_fb); -#endif #ifdef HAVE_X_WINDOWS fg_fb = acons (list1 (Qx), build_string ("black"), fg_fb); bg_fb = acons (list1 (Qx), build_string ("white"), bg_fb); @@ -1955,8 +1873,6 @@ complex_vars_of_faces (void) 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 @@ -1968,20 +1884,12 @@ complex_vars_of_faces (void) support is compiled in. */ { Lisp_Object inst_list = Qnil; - -#if defined(HAVE_X_WINDOWS) || defined(HAVE_GTK) - /* This is kind of ugly because stephen wanted this to be CPP - ** identical to the old version, at least for the initial - ** checkin - ** - ** WMP March 9, 2001 - */ - +#ifdef HAVE_X_WINDOWS /* The same gory list from x-faces.el. (#### 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-*", @@ -1999,39 +1907,20 @@ complex_vars_of_faces (void) "-*-*-*-*-*-*-*-120-*-*-*-*-*-*", "*" }; - const char **fontptr; + CONST char **fontptr; -#ifdef HAVE_X_WINDOWS for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--) inst_list = Fcons (Fcons (list1 (Qx), build_string (*fontptr)), inst_list); #endif /* HAVE_X_WINDOWS */ -#ifdef HAVE_GTK - for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--) - inst_list = Fcons (Fcons (list1 (Qgtk), build_string (*fontptr)), - inst_list); -#endif /* HAVE_GTK */ -#endif /* HAVE_X_WINDOWS || HAVE_GTK */ - - #ifdef HAVE_TTY inst_list = Fcons (Fcons (list1 (Qtty), build_string ("normal")), 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), - build_string ("Courier:Regular:10::Western")), inst_list); - inst_list = Fcons (Fcons (list1 (Qmswindows), - build_string ("Courier New:Regular:10::Western")), inst_list); + inst_list = Fcons (Fcons (list1 (Qmswindows), build_string ("Courier New")), + inst_list); #endif /* HAVE_MS_WINDOWS */ set_specifier_fallback (Fget (Vdefault_face, Qfont, Qnil), inst_list); } @@ -2048,7 +1937,7 @@ complex_vars_of_faces (void) list1 (Fcons (Qnil, Qnil))); set_specifier_fallback (Fget (Vdefault_face, Qreverse, Qnil), list1 (Fcons (Qnil, Qnil))); - + /* gui-element is the parent face of all gui elements such as modeline, vertical divider and toolbar. */ Vgui_element_face = Fmake_face (Qgui_element, @@ -2060,13 +1949,6 @@ complex_vars_of_faces (void) { Lisp_Object fg_fb = Qnil, bg_fb = Qnil; -#ifdef HAVE_GTK - /* We need to put something in there, or error checking gets - #%!@#ed up before the styles are set, which override the - fallbacks. */ - fg_fb = acons (list1 (Qgtk), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qgtk), build_string ("Gray80"), bg_fb); -#endif #ifdef HAVE_X_WINDOWS fg_fb = acons (list1 (Qx), build_string ("black"), fg_fb); bg_fb = acons (list1 (Qx), build_string ("Gray80"), bg_fb); @@ -2076,8 +1958,6 @@ complex_vars_of_faces (void) 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 @@ -2100,7 +1980,7 @@ complex_vars_of_faces (void) set_specifier_fallback (Fget (Vmodeline_face, Qbackground_pixmap, Qnil), Fget (Vgui_element_face, Qbackground_pixmap, Qunbound)); - + /* toolbar is another gui element */ Vtoolbar_face = Fmake_face (Qtoolbar, build_string ("toolbar face"), @@ -2127,18 +2007,6 @@ complex_vars_of_faces (void) Fget (Vgui_element_face, Qbackground_pixmap, Qunbound)); - /* widget is another gui element */ - 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. */ - Vleft_margin_face = Fmake_face (Qleft_margin, build_string ("left margin face"), Qnil); diff --git a/src/faces.h b/src/faces.h index 1969fe0..7d4523e 100644 --- a/src/faces.h +++ b/src/faces.h @@ -21,14 +21,14 @@ Boston, MA 02111-1307, USA. */ /* 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 @@ struct face_cachel 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 @@ -215,17 +215,18 @@ struct face_cachel right sort are available on the system. In this case, the whole program will just crash. For the moment, this is OK (for debugging purposes) but we should fix this by - storing a "blank font" if the instantiation fails. */ + storing a "blank font" if the instantation fails. */ unsigned int dirty :1; unsigned int updated :1; /* #### Of course we should use a bit array or something. */ 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 update_face_cachel_data (struct face_cachel *cachel, 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,8 +260,8 @@ EXFUN (Fget_face, 1); 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 Vtoolbar_face, Vgui_element_face, Vwidget_face; +extern Lisp_Object Vtext_cursor_face, Vvertical_divider_face; +extern Lisp_Object Vtoolbar_face, Vgui_element_face; void mark_all_faces_as_clean (void); void init_frame_faces (struct frame *f); @@ -341,9 +343,9 @@ Lisp_Object face_property_matching_instance (Lisp_Object face, #define FACE_PROPERTY_SPEC_LIST(face, property, locale) \ Fspecifier_spec_list (FACE_PROPERTY_SPECIFIER (face, property), \ locale, Qnil, Qnil) -#define SET_FACE_PROPERTY(face, property, value, locale, tag, how_to_add) \ +#define SET_FACE_PROPERTY(face, property, locale, value, tag, how_to_add) \ Fadd_spec_to_specifier (FACE_PROPERTY_SPECIFIER (face, property), \ - value, locale, tag, how_to_add) + locale, value, tag, how_to_add) #define FACE_FOREGROUND(face, domain) \ FACE_PROPERTY_INSTANCE (face, Qforeground, domain, 0, Qzero) @@ -358,8 +360,6 @@ Lisp_Object face_property_matching_instance (Lisp_Object face, 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 @@ Lisp_Object face_property_matching_instance (Lisp_Object face, #define FACE_REVERSE_P(face, domain) \ (!NILP (FACE_PROPERTY_INSTANCE (face, Qreverse, domain, 0, Qzero))) -#endif /* INCLUDED_faces_h_ */ +#endif /* _XEMACS_FACES_H_ */ diff --git a/src/file-coding.c b/src/file-coding.c index fe42ebd..48363a4 100644 --- a/src/file-coding.c +++ b/src/file-coding.c @@ -25,19 +25,16 @@ Boston, MA 02111-1307, USA. */ #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; @@ -46,41 +43,18 @@ Lisp_Object Vcoding_system_for_write; Lisp_Object Vfile_name_coding_system; /* Table of symbols identifying each coding category. */ -Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST]; - - - -struct file_coding_dump { - /* Coding system currently associated with each coding category. */ - Lisp_Object coding_category_system[CODING_CATEGORY_LAST]; - - /* 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]; - -#ifdef MULE - Lisp_Object ucs_to_mule_table[65536]; -#endif -} *fcd; +Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST + 1]; -static const struct lrecord_description fcd_description_1[] = { - { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, coding_category_system), CODING_CATEGORY_LAST }, -#ifdef MULE - { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, ucs_to_mule_table), countof (fcd->ucs_to_mule_table) }, -#endif - { XD_END } -}; - -static const struct struct_description fcd_description = { - sizeof (struct file_coding_dump), - fcd_description_1 -}; +/* Coding system currently associated with each coding category. */ +Lisp_Object coding_category_system[CODING_CATEGORY_LAST + 1]; -Lisp_Object mule_to_ucs_table; +/* 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_systemp; +Lisp_Object Qcoding_system_p; -Lisp_Object Qraw_text, Qno_conversion, Qccl, Qiso2022; +Lisp_Object Qno_conversion, Qccl, Qiso2022; /* Qinternal in general.c */ Lisp_Object Qmnemonic, Qeol_type; @@ -90,19 +64,18 @@ Lisp_Object Qpost_read_conversion; Lisp_Object Qpre_write_conversion; #ifdef MULE -Lisp_Object Qucs4, Qutf8; Lisp_Object Qbig5, Qshift_jis; Lisp_Object Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3; Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output; 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; -Lisp_Object Vcoding_system_hash_table; +Lisp_Object Vcoding_system_hashtable; int enable_multibyte_characters; @@ -130,10 +103,8 @@ struct iso2022_decoder /* Index for next byte to store in ISO escape sequence. */ int esc_bytes_index; -#ifdef ENABLE_COMPOSITE_CHARS /* Stuff seen so far when composing a string. */ unsigned_char_dynarr *composite_chars; -#endif /* If we saw an invalid designation sequence for a particular register, we flag it here and switch to ASCII. The next time we @@ -176,47 +147,50 @@ EXFUN (Fcopy_coding_system, 2); #ifdef MULE struct detection_state; static int detect_coding_sjis (struct detection_state *st, - const Extbyte *src, Lstream_data_count n); -static void decode_coding_sjis (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); -static void encode_coding_sjis (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); + CONST unsigned char *src, + unsigned int n); +static void decode_coding_sjis (Lstream *decoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, + unsigned int n); +static void encode_coding_sjis (Lstream *encoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, + unsigned int n); static int detect_coding_big5 (struct detection_state *st, - const Extbyte *src, Lstream_data_count n); -static void decode_coding_big5 (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); -static void encode_coding_big5 (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); -static int detect_coding_ucs4 (struct detection_state *st, - const Extbyte *src, Lstream_data_count n); -static void decode_coding_ucs4 (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); -static void encode_coding_ucs4 (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); -static int detect_coding_utf8 (struct detection_state *st, - const Extbyte *src, Lstream_data_count n); -static void decode_coding_utf8 (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); -static void encode_coding_utf8 (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); + CONST unsigned char *src, + unsigned int n); +static void decode_coding_big5 (Lstream *decoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n); +static void encode_coding_big5 (Lstream *encoding, + 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 Extbyte *src, Lstream_data_count n); -static void decode_coding_iso2022 (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); -static void encode_coding_iso2022 (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); + CONST unsigned char *src, + unsigned int n); +static void decode_coding_iso2022 (Lstream *decoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n); +static void encode_coding_iso2022 (Lstream *encoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n); #endif /* MULE */ -static void decode_coding_no_conversion (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); -static void encode_coding_no_conversion (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); -static void mule_decode (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); -static void mule_encode (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n); +static void decode_coding_no_conversion (Lstream *decoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, + unsigned int n); +static void encode_coding_no_conversion (Lstream *encoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, + unsigned int n); +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, + unsigned_char_dynarr *dst, unsigned int n); typedef struct codesys_prop codesys_prop; struct codesys_prop @@ -230,26 +204,6 @@ typedef struct 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 @@ -264,69 +218,26 @@ enum codesys_prop_enum /* 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); + struct 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)) { @@ -334,15 +245,15 @@ mark_coding_system (Lisp_Object obj) 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) @@ -351,22 +262,22 @@ mark_coding_system (Lisp_Object obj) { 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); } @@ -374,7 +285,7 @@ static void print_coding_system (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { - Lisp_Coding_System *c = XCODING_SYSTEM (obj); + struct Lisp_Coding_System *c = XCODING_SYSTEM (obj); if (print_readably) error ("printing unreadable object #<coding_system 0x%x>", c->header.uid); @@ -387,7 +298,7 @@ print_coding_system (Lisp_Object obj, Lisp_Object printcharfun, static void finalize_coding_system (void *header, int for_disksave) { - Lisp_Coding_System *c = (Lisp_Coding_System *) header; + struct Lisp_Coding_System *c = (struct Lisp_Coding_System *) header; /* Since coding systems never go away, this function is not necessary. But it would be necessary if we changed things so that coding systems could go away. */ @@ -415,7 +326,7 @@ finalize_coding_system (void *header, int for_disksave) } } -static eol_type_t +static enum eol_type symbol_to_eol_type (Lisp_Object symbol) { CHECK_SYMBOL (symbol); @@ -429,20 +340,20 @@ symbol_to_eol_type (Lisp_Object symbol) } static Lisp_Object -eol_type_to_symbol (eol_type_t type) +eol_type_to_symbol (enum eol_type type) { switch (type) { - default: abort (); case EOL_LF: return Qlf; case EOL_CRLF: return Qcrlf; case EOL_CR: return Qcr; case EOL_AUTODETECT: return Qnil; + default: abort (); return Qnil; /* not reached */ } } static void -setup_eol_coding_systems (Lisp_Coding_System *codesys) +setup_eol_coding_systems (struct Lisp_Coding_System *codesys) { Lisp_Object codesys_obj; int len = string_length (XSYMBOL (CODING_SYSTEM_NAME (codesys))->name); @@ -520,21 +431,15 @@ associated coding system object is returned. */ (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_hashtable, Qnil); } DEFUN ("get-coding-system", Fget_coding_system, 1, 1, 0, /* @@ -560,15 +465,20 @@ struct coding_system_list_closure }; static int -add_coding_system_to_list_mapper (Lisp_Object key, Lisp_Object value, +add_coding_system_to_list_mapper (CONST void *hash_key, void *hash_contents, void *coding_system_list_closure) { /* This function can GC */ + Lisp_Object key, contents; + Lisp_Object *coding_system_list; struct coding_system_list_closure *cscl = (struct coding_system_list_closure *) coding_system_list_closure; - Lisp_Object *coding_system_list = cscl->coding_system_list; + CVOID_TO_LISP (key, hash_key); + VOID_TO_LISP (contents, hash_contents); + coding_system_list = cscl->coding_system_list; - *coding_system_list = Fcons (key, *coding_system_list); + *coding_system_list = Fcons (XCODING_SYSTEM (contents)->name, + *coding_system_list); return 0; } @@ -583,7 +493,7 @@ Return a list of the names of all defined coding systems. GCPRO1 (coding_system_list); coding_system_list_closure.coding_system_list = &coding_system_list; - elisp_maphash (add_coding_system_to_list_mapper, Vcoding_system_hash_table, + elisp_maphash (add_coding_system_to_list_mapper, Vcoding_system_hashtable, &coding_system_list_closure); UNGCPRO; @@ -599,11 +509,11 @@ Return the name of the given coding system. return XCODING_SYSTEM_NAME (coding_system); } -static Lisp_Coding_System * +static struct Lisp_Coding_System * allocate_coding_system (enum coding_system_type type, Lisp_Object name) { - Lisp_Coding_System *codesys = - alloc_lcrecord_type (Lisp_Coding_System, &lrecord_coding_system); + struct Lisp_Coding_System *codesys = + alloc_lcrecord_type (struct Lisp_Coding_System, lrecord_coding_system); zero_lcrecord (codesys); CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = Qnil; @@ -702,16 +612,12 @@ nil or 'undecided characters will only be present if you explicitly insert them.) 'shift-jis Shift-JIS (a Japanese encoding commonly used in PC operating systems). -'ucs-4 - ISO 10646 UCS-4 encoding. -'utf-8 - ISO 10646 UTF-8 encoding. 'iso2022 Any ISO2022-compliant encoding. Among other things, this includes JIS (the Japanese encoding commonly used for e-mail), EUC (the standard Unix encoding for Japanese and other languages), and Compound Text (the encoding used in X11). You can specify more - specific information about the conversion with the PROPS argument. + specific information about the conversion with the FLAGS argument. 'big5 Big5 (the encoding commonly used for Taiwanese). 'ccl @@ -768,12 +674,12 @@ character set. Recognized properties are: 'post-read-conversion Function called after a file has been read in, to perform the - decoding. Called with two arguments, START and END, denoting + decoding. Called with two arguments, BEG and END, denoting a region of the current buffer to be decoded. 'pre-write-conversion Function called before a file is written out, to perform the - encoding. Called with two arguments, START and END, denoting + encoding. Called with two arguments, BEG and END, denoting a region of the current buffer to be encoded. @@ -860,7 +766,8 @@ if TYPE is 'ccl: */ (name, type, doc_string, props)) { - Lisp_Coding_System *codesys; + struct Lisp_Coding_System *codesys; + Lisp_Object rest, key, value; enum coding_system_type ty; int need_to_setup_eol_systems = 1; @@ -871,8 +778,6 @@ if TYPE is 'ccl: else if (EQ (type, Qshift_jis)) { ty = CODESYS_SHIFT_JIS; } else if (EQ (type, Qiso2022)) { ty = CODESYS_ISO2022; } else if (EQ (type, Qbig5)) { ty = CODESYS_BIG5; } - else if (EQ (type, Qucs4)) { ty = CODESYS_UCS4; } - else if (EQ (type, Qutf8)) { ty = CODESYS_UTF8; } else if (EQ (type, Qccl)) { ty = CODESYS_CCL; } #endif else if (EQ (type, Qno_conversion)) { ty = CODESYS_NO_CONVERSION; } @@ -892,118 +797,92 @@ if TYPE is 'ccl: CHECK_STRING (doc_string); CODING_SYSTEM_DOC_STRING (codesys) = doc_string; - { - EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, props) - { - if (EQ (key, Qmnemonic)) - { - if (!NILP (value)) - CHECK_STRING (value); - CODING_SYSTEM_MNEMONIC (codesys) = value; - } + EXTERNAL_PROPERTY_LIST_LOOP (rest, key, value, props) + { + if (EQ (key, Qmnemonic)) + { + if (!NILP (value)) + CHECK_STRING (value); + CODING_SYSTEM_MNEMONIC (codesys) = value; + } - else if (EQ (key, Qeol_type)) - { - need_to_setup_eol_systems = NILP (value); - if (EQ (value, Qt)) - value = Qnil; - CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value); - } + else if (EQ (key, Qeol_type)) + { + need_to_setup_eol_systems = NILP (value); + if (EQ (value, Qt)) + value = Qnil; + CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value); + } - else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value; - else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value; + else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value; + else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value; #ifdef MULE - else if (ty == CODESYS_ISO2022) - { + else if (ty == CODESYS_ISO2022) + { #define FROB_INITIAL_CHARSET(charset_num) \ CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, charset_num) = \ ((EQ (value, Qt) || EQ (value, Qnil)) ? value : Fget_charset (value)) - if (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0); - else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1); - else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2); - else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3); + if (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0); + else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1); + else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2); + else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3); #define FROB_FORCE_CHARSET(charset_num) \ CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (codesys, charset_num) = !NILP (value) - else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0); - else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1); - else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2); - else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3); + else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0); + else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1); + else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2); + else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3); #define FROB_BOOLEAN_PROPERTY(prop) \ CODING_SYSTEM_ISO2022_##prop (codesys) = !NILP (value) - else if (EQ (key, Qshort)) FROB_BOOLEAN_PROPERTY (SHORT); - else if (EQ (key, Qno_ascii_eol)) FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL); - else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL); - else if (EQ (key, Qseven)) FROB_BOOLEAN_PROPERTY (SEVEN); - else if (EQ (key, Qlock_shift)) FROB_BOOLEAN_PROPERTY (LOCK_SHIFT); - else if (EQ (key, Qno_iso6429)) FROB_BOOLEAN_PROPERTY (NO_ISO6429); - else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED); - - else if (EQ (key, Qinput_charset_conversion)) - { - codesys->iso2022.input_conv = - Dynarr_new (charset_conversion_spec); - parse_charset_conversion_specs (codesys->iso2022.input_conv, - value); - } - else if (EQ (key, Qoutput_charset_conversion)) - { - codesys->iso2022.output_conv = - Dynarr_new (charset_conversion_spec); - parse_charset_conversion_specs (codesys->iso2022.output_conv, - value); - } - else - signal_simple_error ("Unrecognized property", key); - } - else if (EQ (type, Qccl)) - { - Lisp_Object sym; - struct ccl_program test_ccl; - Extbyte *suffix; - - /* Check key first. */ - if (EQ (key, Qdecode)) - suffix = "-ccl-decode"; - else if (EQ (key, Qencode)) - suffix = "-ccl-encode"; - else - signal_simple_error ("Unrecognized property", key); - - /* If value is vector, register it as a ccl program - associated with an newly created symbol for - backward compatibility. */ - if (VECTORP (value)) - { - sym = Fintern (concat2 (Fsymbol_name (name), - build_string (suffix)), - Qnil); - Fregister_ccl_program (sym, value); - } - else - { - CHECK_SYMBOL (value); - sym = value; - } - /* check if the given ccl programs are valid. */ - if (setup_ccl_program (&test_ccl, sym) < 0) - signal_simple_error ("Invalid CCL program", value); - - if (EQ (key, Qdecode)) - CODING_SYSTEM_CCL_DECODE (codesys) = sym; - else if (EQ (key, Qencode)) - CODING_SYSTEM_CCL_ENCODE (codesys) = sym; + else if (EQ (key, Qshort)) FROB_BOOLEAN_PROPERTY (SHORT); + else if (EQ (key, Qno_ascii_eol)) FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL); + else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL); + else if (EQ (key, Qseven)) FROB_BOOLEAN_PROPERTY (SEVEN); + else if (EQ (key, Qlock_shift)) FROB_BOOLEAN_PROPERTY (LOCK_SHIFT); + else if (EQ (key, Qno_iso6429)) FROB_BOOLEAN_PROPERTY (NO_ISO6429); + else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED); - } + else if (EQ (key, Qinput_charset_conversion)) + { + codesys->iso2022.input_conv = + Dynarr_new (charset_conversion_spec); + parse_charset_conversion_specs (codesys->iso2022.input_conv, + value); + } + else if (EQ (key, Qoutput_charset_conversion)) + { + codesys->iso2022.output_conv = + Dynarr_new (charset_conversion_spec); + parse_charset_conversion_specs (codesys->iso2022.output_conv, + value); + } + else + signal_simple_error ("Unrecognized property", key); + } + else if (EQ (type, Qccl)) + { + if (EQ (key, Qdecode)) + { + CHECK_VECTOR (value); + CODING_SYSTEM_CCL_DECODE (codesys) = value; + } + else if (EQ (key, Qencode)) + { + CHECK_VECTOR (value); + CODING_SYSTEM_CCL_ENCODE (codesys) = value; + } + else + signal_simple_error ("Unrecognized property", key); + } #endif /* MULE */ - else - signal_simple_error ("Unrecognized property", key); - } - } + else + signal_simple_error ("Unrecognized property", key); + } if (need_to_setup_eol_systems) setup_eol_coding_systems (codesys); @@ -1011,7 +890,7 @@ if TYPE is 'ccl: { Lisp_Object codesys_obj; XSETCODING_SYSTEM (codesys_obj, codesys); - Fputhash (name, codesys_obj, Vcoding_system_hash_table); + Fputhash (name, codesys_obj, Vcoding_system_hashtable); return codesys_obj; } } @@ -1032,12 +911,12 @@ be created. allocate_coding_system (XCODING_SYSTEM_TYPE (old_coding_system), new_name)); - Fputhash (new_name, new_coding_system, Vcoding_system_hash_table); + Fputhash (new_name, new_coding_system, Vcoding_system_hashtable); } { - Lisp_Coding_System *to = XCODING_SYSTEM (new_coding_system); - Lisp_Coding_System *from = XCODING_SYSTEM (old_coding_system); + struct Lisp_Coding_System *to = XCODING_SYSTEM (new_coding_system); + struct Lisp_Coding_System *from = XCODING_SYSTEM (old_coding_system); memcpy (((char *) to ) + sizeof (to->header), ((char *) from) + sizeof (from->header), sizeof (*from) - sizeof (from->header)); @@ -1046,171 +925,10 @@ be created. 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'. -*/ - (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) -{ - 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)) - { - 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; - } - - 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], - 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); + struct Lisp_Coding_System *cs = XCODING_SYSTEM (coding_system); Lisp_Object new_coding_system; if (CODING_SYSTEM_EOL_TYPE (cs) != EOL_AUTODETECT) @@ -1222,7 +940,7 @@ subsidiary_coding_system (Lisp_Object coding_system, eol_type_t type) case EOL_LF: new_coding_system = CODING_SYSTEM_EOL_LF (cs); break; case EOL_CR: new_coding_system = CODING_SYSTEM_EOL_CR (cs); break; case EOL_CRLF: new_coding_system = CODING_SYSTEM_EOL_CRLF (cs); break; - default: abort (); return Qnil; + default: abort (); } return NILP (new_coding_system) ? coding_system : new_coding_system; @@ -1260,21 +978,22 @@ Return the type of CODING-SYSTEM. { switch (XCODING_SYSTEM_TYPE (Fget_coding_system (coding_system))) { - default: abort (); case CODESYS_AUTODETECT: return Qundecided; #ifdef MULE case CODESYS_SHIFT_JIS: return Qshift_jis; case CODESYS_ISO2022: return Qiso2022; case CODESYS_BIG5: return Qbig5; - case CODESYS_UCS4: return Qucs4; - case CODESYS_UTF8: return Qutf8; case CODESYS_CCL: return Qccl; #endif case CODESYS_NO_CONVERSION: return Qno_conversion; #ifdef DEBUG_XEMACS case CODESYS_INTERNAL: return Qinternal; #endif + default: + abort (); } + + return Qnil; /* not reached */ } #ifdef MULE @@ -1433,7 +1152,7 @@ decode_coding_category (Lisp_Object symbol) int i; CHECK_SYMBOL (symbol); - for (i = 0; i < CODING_CATEGORY_LAST; i++) + for (i = 0; i <= CODING_CATEGORY_LAST; i++) if (EQ (coding_category_symbol[i], symbol)) return i; @@ -1449,7 +1168,7 @@ Return a list of all recognized coding categories. int i; Lisp_Object list = Qnil; - for (i = CODING_CATEGORY_LAST - 1; i >= 0; i--) + for (i = CODING_CATEGORY_LAST; i >= 0; i--) list = Fcons (coding_category_symbol[i], list); return list; } @@ -1463,13 +1182,13 @@ previously. */ (list)) { - int category_to_priority[CODING_CATEGORY_LAST]; + int category_to_priority[CODING_CATEGORY_LAST + 1]; int i, j; Lisp_Object rest; /* First generate a list that maps coding categories to priorities. */ - for (i = 0; i < CODING_CATEGORY_LAST; i++) + for (i = 0; i <= CODING_CATEGORY_LAST; i++) category_to_priority[i] = -1; /* Highest priority comes from the specified list. */ @@ -1486,9 +1205,9 @@ previously. /* Now go through the existing categories by priority to retrieve the categories not yet specified and preserve their priority order. */ - for (j = 0; j < CODING_CATEGORY_LAST; j++) + 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++; } @@ -1496,8 +1215,8 @@ previously. /* Now we need to construct the inverse of the mapping we just constructed. */ - for (i = 0; i < CODING_CATEGORY_LAST; i++) - fcd->coding_category_by_priority[category_to_priority[i]] = i; + for (i = 0; i <= CODING_CATEGORY_LAST; i++) + coding_category_by_priority[category_to_priority[i]] = i; /* Phew! That was confusing. */ return Qnil; @@ -1511,8 +1230,8 @@ Return a list of coding categories in descending order of priority. int i; Lisp_Object list = Qnil; - for (i = CODING_CATEGORY_LAST - 1; i >= 0; i--) - list = Fcons (coding_category_symbol[fcd->coding_category_by_priority[i]], + for (i = CODING_CATEGORY_LAST; i >= 0; i--) + list = Fcons (coding_category_symbol[coding_category_by_priority[i]], list); return list; } @@ -1525,7 +1244,7 @@ Change the coding system associated with a coding category. 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; } @@ -1535,7 +1254,7 @@ Return the coding system associated with a coding category. (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); @@ -1549,7 +1268,7 @@ Return the coding system associated with a coding category. struct detection_state { - eol_type_t eol_type; + enum eol_type eol_type; int seen_non_ascii; int mask; #ifdef MULE @@ -1570,20 +1289,6 @@ struct detection_state struct { int mask; - int in_byte; - } - ucs4; - - struct - { - int mask; - int in_byte; - } - utf8; - - struct - { - int mask; int initted; struct iso2022_decoder iso; unsigned int flags; @@ -1630,26 +1335,30 @@ mask_has_at_most_one_bit_p (int mask) return (mask & (mask - 1)) == 0; } -static eol_type_t -detect_eol_type (struct detection_state *st, const Extbyte *src, - Lstream_data_count n) +static enum eol_type +detect_eol_type (struct detection_state *st, CONST unsigned char *src, + unsigned int n) { + int c; + while (n--) { - unsigned char c = *(unsigned char *)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') + c = *src++; + 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; } @@ -1674,9 +1383,11 @@ detect_eol_type (struct detection_state *st, const Extbyte *src, */ static int -detect_coding_type (struct detection_state *st, const Extbyte *src, - Lstream_data_count n, int just_do_eol) +detect_coding_type (struct detection_state *st, CONST unsigned char *src, + unsigned int n, int just_do_eol) { + int c; + if (st->eol_type == EOL_AUTODETECT) st->eol_type = detect_eol_type (st, src, n); @@ -1687,15 +1398,13 @@ detect_coding_type (struct detection_state *st, const Extbyte *src, { for (; n; n--, src++) { - unsigned char c = *(unsigned char *) src; + c = *src; if ((c < 0x20 && !acceptable_control_char_p (c)) || c >= 0x80) { st->seen_non_ascii = 1; #ifdef MULE st->shift_jis.mask = ~0; st->big5.mask = ~0; - st->ucs4.mask = ~0; - st->utf8.mask = ~0; st->iso2022.mask = ~0; #endif break; @@ -1712,14 +1421,8 @@ detect_coding_type (struct detection_state *st, const Extbyte *src, st->shift_jis.mask = detect_coding_sjis (st, src, n); if (!mask_has_at_most_one_bit_p (st->big5.mask)) st->big5.mask = detect_coding_big5 (st, src, n); - if (!mask_has_at_most_one_bit_p (st->utf8.mask)) - st->utf8.mask = detect_coding_utf8 (st, src, n); - if (!mask_has_at_most_one_bit_p (st->ucs4.mask)) - st->ucs4.mask = detect_coding_ucs4 (st, src, n); - - st->mask - = st->iso2022.mask | st->shift_jis.mask | st->big5.mask - | st->utf8.mask | st->ucs4.mask; + + st->mask = st->iso2022.mask | st->shift_jis.mask | st->big5.mask; #endif { int retval = mask_has_at_most_one_bit_p (st->mask); @@ -1749,7 +1452,7 @@ coding_system_from_mask (int mask) } } if (NILP (retval)) - retval = Fget_coding_system (Qraw_text); + retval = Fget_coding_system (Qno_conversion); return retval; } else @@ -1761,36 +1464,32 @@ coding_system_from_mask (int mask) #endif /* Look through the coding categories by priority and find the first one that is allowed. */ - for (i = 0; i < CODING_CATEGORY_LAST; i++) + 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) -/* number of leading lines to check for a coding cookie */ -#define LINES_TO_CHECK 2 - 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; @@ -1802,123 +1501,27 @@ determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, 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; - Lstream_data_count nread = Lstream_read (stream, buf, sizeof (buf)); - Extbyte *scan_end; - int lines_checked = 0; - - /* Look for initial "-*-"; mode line prefix */ - for (p = buf, - scan_end = buf + nread - LENGTH ("-*-coding:?-*-"); - p <= scan_end - && lines_checked < LINES_TO_CHECK; - 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 - && lines_checked < LINES_TO_CHECK; - 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; - } - /* #### file must use standard EOLs or we miss 2d line */ - /* #### not to mention this is broken for UTF-16 DOS files */ - else if (*p == '\n' || *p == '\r') - { - lines_checked++; - /* skip past multibyte (DOS) newline */ - if (*p == '\r' && *(p+1) == '\n') p++; - } - break; - } - /* #### file must use standard EOLs or we miss 2d line */ - /* #### not to mention this is broken for UTF-16 DOS files */ - else if (*p == '\n' || *p == '\r') - { - lines_checked++; - /* skip past multibyte (DOS) newline */ - if (*p == '\r' && *(p+1) == '\n') p++; - } - 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); + while (1) + { + unsigned char random_buffer[4096]; + int nread; - 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); + nread = Lstream_read (stream, random_buffer, sizeof (random_buffer)); + if (!nread) + break; + 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. */ @@ -1930,8 +1533,8 @@ determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, DEFUN ("detect-coding-region", Fdetect_coding_region, 2, 3, 0, /* Detect coding system of the text in the region between START and END. -Return a list of possible coding systems ordered by priority. -If only ASCII characters are found, return 'undecided or one of +Returned a list of possible coding systems ordered by priority. +If only ASCII characters are found, it returns 'undecided or one of its subsidiary coding systems according to a detected end-of-line type. Optional arg BUFFER defaults to the current buffer. */ @@ -1956,8 +1559,8 @@ type. Optional arg BUFFER defaults to the current buffer. decst.mask = ~0; while (1) { - Extbyte random_buffer[4096]; - Lstream_data_count nread = Lstream_read (istr, random_buffer, sizeof (random_buffer)); + unsigned char random_buffer[4096]; + int nread = Lstream_read (istr, random_buffer, sizeof (random_buffer)); if (!nread) break; @@ -1976,12 +1579,12 @@ type. Optional arg BUFFER defaults to the current buffer. #ifdef MULE decst.mask = postprocess_iso2022_mask (decst.mask); #endif - for (i = CODING_CATEGORY_LAST - 1; i >= 0; i--) + 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); @@ -2070,12 +1673,10 @@ do { \ #define DECODE_HANDLE_END_OF_CONVERSION(flags, ch, dst) \ do { \ - if (flags & CODING_STATE_END) \ - { \ - DECODE_OUTPUT_PARTIAL_CHAR (ch); \ - if (flags & CODING_STATE_CR) \ - Dynarr_add (dst, '\r'); \ - } \ + DECODE_OUTPUT_PARTIAL_CHAR (ch); \ + if ((flags & CODING_STATE_END) && \ + (flags & CODING_STATE_CR)) \ + Dynarr_add (dst, '\r'); \ } while (0) #define DECODING_STREAM_DATA(stream) LSTREAM_TYPE_DATA (stream, decoding) @@ -2083,7 +1684,7 @@ do { \ struct decoding_stream { /* Coding system that governs the conversion. */ - Lisp_Coding_System *codesys; + struct Lisp_Coding_System *codesys; /* Stream that we read the encoded data from or write the decoded data to. */ @@ -2108,7 +1709,7 @@ struct decoding_stream 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. */ @@ -2117,29 +1718,25 @@ struct decoding_stream /* 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 Lstream_data_count decoding_reader (Lstream *stream, - unsigned char *data, Lstream_data_count size); -static Lstream_data_count decoding_writer (Lstream *stream, - const unsigned char *data, Lstream_data_count 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; @@ -2149,9 +1746,9 @@ decoding_marker (Lisp_Object stream) 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; } @@ -2159,12 +1756,12 @@ decoding_marker (Lisp_Object stream) /* 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 Lstream_data_count -decoding_reader (Lstream *stream, unsigned char *data, Lstream_data_count size) +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; - Lstream_data_count read_size; + int read_size; int error_occurred = 0; /* We need to interface to mule_decode(), which expects to take some @@ -2180,7 +1777,7 @@ decoding_reader (Lstream *stream, unsigned char *data, Lstream_data_count size) most SIZE bytes, and delete the data from the runoff. */ if (Dynarr_length (str->runoff) > 0) { - Lstream_data_count chunk = min (size, (Lstream_data_count) Dynarr_length (str->runoff)); + size_t chunk = min (size, (size_t) Dynarr_length (str->runoff)); memcpy (data, Dynarr_atp (str->runoff, 0), chunk); Dynarr_delete_many (str->runoff, 0, chunk); data += chunk; @@ -2212,7 +1809,7 @@ decoding_reader (Lstream *stream, unsigned char *data, Lstream_data_count size) /* There might be some more end data produced in the translation. See the comment above. */ str->flags |= CODING_STATE_END; - mule_decode (stream, (Extbyte *) data, str->runoff, read_size); + mule_decode (stream, data, str->runoff, read_size); } if (data - orig_data == 0) @@ -2221,16 +1818,16 @@ decoding_reader (Lstream *stream, unsigned char *data, Lstream_data_count size) return data - orig_data; } -static Lstream_data_count -decoding_writer (Lstream *stream, const unsigned char *data, Lstream_data_count size) +static int +decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct decoding_stream *str = DECODING_STREAM_DATA (stream); - Lstream_data_count 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 in writing. */ - mule_decode (stream, (Extbyte *) data, str->runoff, size); + mule_decode (stream, data, str->runoff, size); retval = Lstream_write (str->other_end, Dynarr_atp (str->runoff, 0), Dynarr_length (str->runoff)); if (retval > 0) @@ -2255,15 +1852,7 @@ reset_decoding_stream (struct decoding_stream *str) { 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; } @@ -2301,11 +1890,9 @@ decoding_closer (Lstream *stream) } Dynarr_free (str->runoff); #ifdef MULE -#ifdef ENABLE_COMPOSITE_CHARS if (str->iso2022.composite_chars) Dynarr_free (str->iso2022.composite_chars); #endif -#endif return Lstream_close (str->other_end); } @@ -2322,7 +1909,7 @@ decoding_stream_coding_system (Lstream *stream) void set_decoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys) { - Lisp_Coding_System *cs = XCODING_SYSTEM (codesys); + struct Lisp_Coding_System *cs = XCODING_SYSTEM (codesys); struct decoding_stream *str = DECODING_STREAM_DATA (lstr); str->codesys = cs; if (CODING_SYSTEM_EOL_TYPE (cs) != EOL_AUTODETECT) @@ -2339,7 +1926,7 @@ set_decoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys) 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); @@ -2382,8 +1969,8 @@ make_decoding_output_stream (Lstream *stream, Lisp_Object codesys) be used for both reading and writing. */ static void -mule_decode (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) +mule_decode (Lstream *decoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) { struct decoding_stream *str = DECODING_STREAM_DATA (decoding); @@ -2439,18 +2026,8 @@ mule_decode (Lstream *decoding, const Extbyte *src, case CODESYS_BIG5: decode_coding_big5 (decoding, src, dst, n); break; - case CODESYS_UCS4: - decode_coding_ucs4 (decoding, src, dst, n); - break; - case CODESYS_UTF8: - decode_coding_utf8 (decoding, src, dst, n); - break; case CODESYS_CCL: - str->ccl.last_block = str->flags & CODING_STATE_END; - /* When applying ccl program to stream, MUST NOT set NULL - pointer to src. */ - ccl_driver (&str->ccl, (src ? (unsigned char *)src : (unsigned char*)""), - 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); @@ -2505,7 +2082,7 @@ BUFFER defaults to the current buffer if unspecified. char tempbuf[1024]; /* some random amount */ Bufpos newpos, even_newer_pos; Bufpos oldpos = lisp_buffer_stream_startpos (istr); - Lstream_data_count size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); + int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); if (!size_in_bytes) break; @@ -2540,7 +2117,7 @@ BUFFER defaults to the current buffer if unspecified. struct encoding_stream { /* Coding system that governs the conversion. */ - Lisp_Coding_System *codesys; + struct Lisp_Coding_System *codesys; /* Stream that we read the encoded data from or write the decoded data to. */ @@ -2590,21 +2167,22 @@ struct encoding_stream #endif /* MULE */ }; -static Lstream_data_count encoding_reader (Lstream *stream, unsigned char *data, Lstream_data_count size); -static Lstream_data_count encoding_writer (Lstream *stream, const unsigned char *data, - Lstream_data_count 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; @@ -2614,9 +2192,9 @@ encoding_marker (Lisp_Object stream) 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; } @@ -2624,12 +2202,12 @@ encoding_marker (Lisp_Object stream) /* 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 Lstream_data_count -encoding_reader (Lstream *stream, unsigned char *data, Lstream_data_count size) +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; - Lstream_data_count read_size; + int read_size; int error_occurred = 0; /* We need to interface to mule_encode(), which expects to take some @@ -2686,11 +2264,11 @@ encoding_reader (Lstream *stream, unsigned char *data, Lstream_data_count size) return data - orig_data; } -static Lstream_data_count -encoding_writer (Lstream *stream, const unsigned char *data, Lstream_data_count size) +static int +encoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) { struct encoding_stream *str = ENCODING_STREAM_DATA (stream); - Lstream_data_count 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 @@ -2790,7 +2368,7 @@ encoding_stream_coding_system (Lstream *stream) void set_encoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys) { - Lisp_Coding_System *cs = XCODING_SYSTEM (codesys); + struct Lisp_Coding_System *cs = XCODING_SYSTEM (codesys); struct encoding_stream *str = ENCODING_STREAM_DATA (lstr); str->codesys = cs; reset_encoding_stream (str); @@ -2798,7 +2376,7 @@ set_encoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys) 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); @@ -2829,8 +2407,8 @@ make_encoding_output_stream (Lstream *stream, Lisp_Object codesys) Store the encoded data into DST. */ static void -mule_encode (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) +mule_encode (Lstream *encoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) { struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); @@ -2854,18 +2432,8 @@ mule_encode (Lstream *encoding, const Bufbyte *src, case CODESYS_BIG5: encode_coding_big5 (encoding, src, dst, n); break; - case CODESYS_UCS4: - encode_coding_ucs4 (encoding, src, dst, n); - break; - case CODESYS_UTF8: - encode_coding_utf8 (encoding, src, dst, n); - break; case CODESYS_CCL: - str->ccl.last_block = str->flags & CODING_STATE_END; - /* When applying ccl program to stream, MUST NOT set NULL - pointer to src. */ - ccl_driver (&str->ccl, ((src) ? src : (unsigned char*)""), - 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); @@ -2916,7 +2484,7 @@ text. BUFFER defaults to the current buffer if unspecified. char tempbuf[1024]; /* some random amount */ Bufpos newpos, even_newer_pos; Bufpos oldpos = lisp_buffer_stream_startpos (istr); - Lstream_data_count size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); + int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); if (!size_in_bytes) break; @@ -2949,9 +2517,9 @@ text. BUFFER defaults to the current buffer if unspecified. /* Shift-JIS is a coding system encoding three character sets: ASCII, right half of JISX0201-Kana, and JISX0208. An ASCII character is encoded - as is. A character of JISX0201-Kana (DIMENSION1_CHARS94 character set) is + as is. A character of JISX0201-Kana (TYPE94 character set) is encoded by "position-code + 0x80". A character of JISX0208 - (DIMENSION2_CHARS94 character set) is encoded in 2-byte but two + (TYPE94x94 character set) is encoded in 2-byte but two position-codes are divided and shifted so that it fit in the range below. @@ -2979,11 +2547,14 @@ text. BUFFER defaults to the current buffer if unspecified. ((c) >= 0xA1 && (c) <= 0xDF) static int -detect_coding_sjis (struct detection_state *st, const Extbyte *src, Lstream_data_count n) +detect_coding_sjis (struct detection_state *st, CONST unsigned char *src, + unsigned int n) { + int c; + while (n--) { - unsigned char c = *(unsigned char *)src++; + c = *src++; if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO) return 0; if (st->shift_jis.in_second_byte) @@ -3001,17 +2572,20 @@ detect_coding_sjis (struct detection_state *st, const Extbyte *src, Lstream_data /* Convert Shift-JIS data to internal format. */ static void -decode_coding_sjis (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) +decode_coding_sjis (Lstream *decoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) { + unsigned char c; + unsigned int flags, ch; + enum eol_type eol_type; 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; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = str->eol_type; while (n--) { - unsigned char c = *(unsigned char *)src++; + c = *src++; if (ch) { @@ -3050,24 +2624,26 @@ decode_coding_sjis (Lstream *decoding, const Extbyte *src, DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst); - str->flags = flags; - str->ch = ch; + CODING_STREAM_COMPOSE (str, flags, ch); } /* Convert internally-formatted data to Shift-JIS. */ static void -encode_coding_sjis (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) +encode_coding_sjis (Lstream *encoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) { + unsigned char c; struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - unsigned int flags = str->flags; - unsigned int ch = str->ch; - eol_type_t eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); + unsigned int flags, ch; + enum eol_type eol_type; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); while (n--) { - Bufbyte c = *src++; + c = *src++; if (c == '\n') { if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) @@ -3106,8 +2682,7 @@ encode_coding_sjis (Lstream *encoding, const Bufbyte *src, } } - str->flags = flags; - str->ch = ch; + CODING_STREAM_COMPOSE (str, flags, ch); } DEFUN ("decode-shift-jis-char", Fdecode_shift_jis_char, 1, 1, 0, /* @@ -3136,16 +2711,16 @@ Return the corresponding character. } DEFUN ("encode-shift-jis-char", Fencode_shift_jis_char, 1, 1, 0, /* -Encode a JISX0208 character CHARACTER to SHIFT-JIS coding-system. +Encode a JISX0208 character CHAR to SHIFT-JIS coding-system. Return the corresponding character code in SHIFT-JIS as a cons of two bytes. */ - (character)) + (ch)) { Lisp_Object charset; int c1, c2, s1, s2; - CHECK_CHAR_COERCE_INT (character); - BREAKUP_CHAR (XCHAR (character), charset, c1, c2); + CHECK_CHAR_COERCE_INT (ch); + BREAKUP_CHAR (XCHAR (ch), charset, c1, c2); if (EQ (charset, Vcharset_japanese_jisx0208)) { ENCODE_SJIS (c1 | 0x80, c2 | 0x80, s1, s2); @@ -3173,8 +2748,8 @@ Return the corresponding character code in SHIFT-JIS as a cons of two bytes. Since the number of characters in Big5 is larger than maximum characters in Emacs' charset (96x96), it can't be handled as one - charset. So, in Emacs, Big5 is divided into two: `charset-big5-1' - and `charset-big5-2'. Both <type>s are DIMENSION2_CHARS94. The former + charset. So, in Emacs, Big5 is devided into two: `charset-big5-1' + and `charset-big5-2'. Both <type>s are TYPE94x94. The former contains frequently used characters and the latter contains less frequently used characters. */ @@ -3260,11 +2835,14 @@ Return the corresponding character code in SHIFT-JIS as a cons of two bytes. } while (0) static int -detect_coding_big5 (struct detection_state *st, const Extbyte *src, Lstream_data_count n) +detect_coding_big5 (struct detection_state *st, CONST unsigned char *src, + unsigned int n) { + int c; + while (n--) { - unsigned char c = *(unsigned char *)src++; + c = *src++; if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO || (c >= 0x80 && c <= 0xA0)) return 0; @@ -3283,17 +2861,20 @@ detect_coding_big5 (struct detection_state *st, const Extbyte *src, Lstream_data /* Convert Big5 data to internal format. */ static void -decode_coding_big5 (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) +decode_coding_big5 (Lstream *decoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) { + unsigned char c; + unsigned int flags, ch; + enum eol_type eol_type; 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; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = str->eol_type; while (n--) { - unsigned char c = *(unsigned char *)src++; + c = *src++; if (ch) { /* Previous character was first byte of Big5 char. */ @@ -3325,21 +2906,22 @@ decode_coding_big5 (Lstream *decoding, const Extbyte *src, DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst); - str->flags = flags; - str->ch = ch; + CODING_STREAM_COMPOSE (str, flags, ch); } /* Convert internally-formatted data to Big5. */ static void -encode_coding_big5 (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) +encode_coding_big5 (Lstream *encoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) { unsigned char c; struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - unsigned int flags = str->flags; - unsigned int ch = str->ch; - eol_type_t eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); + unsigned int flags, ch; + enum eol_type eol_type; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); while (n--) { @@ -3387,8 +2969,7 @@ encode_coding_big5 (Lstream *encoding, const Bufbyte *src, ch = 0; } - str->flags = flags; - str->ch = ch; + CODING_STREAM_COMPOSE (str, flags, ch); } @@ -3420,16 +3001,16 @@ Return the corresponding character. } DEFUN ("encode-big5-char", Fencode_big5_char, 1, 1, 0, /* -Encode the Big5 character CHARACTER in the BIG5 coding-system. +Encode the Big5 character CH to BIG5 coding-system. Return the corresponding character code in Big5. */ - (character)) + (ch)) { Lisp_Object charset; int c1, c2, b1, b2; - CHECK_CHAR_COERCE_INT (character); - BREAKUP_CHAR (XCHAR (character), charset, c1, c2); + CHECK_CHAR_COERCE_INT (ch); + BREAKUP_CHAR (XCHAR (ch), charset, c1, c2); if (EQ (charset, Vcharset_chinese_big5_1) || EQ (charset, Vcharset_chinese_big5_2)) { @@ -3443,695 +3024,46 @@ Return the corresponding character code in Big5. /************************************************************************/ -/* UCS-4 methods */ -/* */ -/* UCS-4 character codes are implemented as nonnegative integers. */ -/* */ +/* ISO2022 methods */ /************************************************************************/ +/* The following note describes the coding system ISO2022 briefly. + Since the intention of this note is to help understanding of the + programs in this file, some parts are NOT ACCURATE or OVERLY + SIMPLIFIED. For thorough understanding, please refer to the + original document of ISO2022. -DEFUN ("set-ucs-char", Fset_ucs_char, 2, 2, 0, /* -Map UCS-4 code CODE to Mule character CHARACTER. - -Return T on success, NIL on failure. -*/ - (code, character)) -{ - size_t c; + ISO2022 provides many mechanisms to encode several character sets + in 7-bit and 8-bit environments. If one chooses 7-bit environment, + all text is encoded by codes of less than 128. This may make the + encoded text a little bit longer, but the text get more stability + to pass through several gateways (some of them strip off MSB). - CHECK_CHAR (character); - CHECK_NATNUM (code); - c = XINT (code); + There are two kind of character sets: control character set and + graphic character set. The former contains control characters such + as `newline' and `escape' to provide control functions (control + functions are provided also by escape sequence). The latter + contains graphic characters such as 'A' and '-'. Emacs recognizes + two control character sets and many graphic character sets. - if (c < countof (fcd->ucs_to_mule_table)) - { - fcd->ucs_to_mule_table[c] = character; - return Qt; - } - else - return Qnil; -} + Graphic character sets are classified into one of four types, + according to the dimension and number of characters in the set: + TYPE94, TYPE96, TYPE94x94, and TYPE96x96. In addition, each + character set is assigned an identification byte, unique for each + type, called "final character" (denoted as <F> hereafter). The <F> + of each character set is decided by ECMA(*) when it is registered + in ISO. Code range of <F> is 0x30..0x7F (0x30..0x3F are for + private use only). -static Lisp_Object -ucs_to_char (unsigned long code) -{ - if (code < countof (fcd->ucs_to_mule_table)) - { - return fcd->ucs_to_mule_table[code]; - } - else if ((0xe00000 <= code) && (code <= 0xe00000 + 94 * 94 * 14)) - { - unsigned int c; - - code -= 0xe00000; - c = code % (94 * 94); - return make_char - (MAKE_CHAR (CHARSET_BY_ATTRIBUTES - (CHARSET_TYPE_94X94, code / (94 * 94) + '@', - CHARSET_LEFT_TO_RIGHT), - c / 94 + 33, c % 94 + 33)); - } - else - return Qnil; -} + Note (*): ECMA = European Computer Manufacturers Association -DEFUN ("ucs-char", Fucs_char, 1, 1, 0, /* -Return Mule character corresponding to UCS code CODE (a positive integer). -*/ - (code)) -{ - CHECK_NATNUM (code); - return ucs_to_char (XINT (code)); -} + Here are examples of graphic character set [NAME(<F>)]: + o TYPE94 -- ASCII('B'), right-half-of-JISX0201('I'), ... + o TYPE96 -- right-half-of-ISO8859-1('A'), ... + o TYPE94x94 -- GB2312('A'), JISX0208('B'), ... + o TYPE96x96 -- none for the moment -DEFUN ("set-char-ucs", Fset_char_ucs, 2, 2, 0, /* -Map Mule character CHARACTER to UCS code CODE (a positive integer). -*/ - (character, code)) -{ - /* #### Isn't this gilding the lily? Fput_char_table checks its args. - Fset_char_ucs is more restrictive on index arg, but should - check code arg in a char_table method. */ - CHECK_CHAR (character); - CHECK_NATNUM (code); - return Fput_char_table (character, code, mule_to_ucs_table); -} - -DEFUN ("char-ucs", Fchar_ucs, 1, 1, 0, /* -Return the UCS code (a positive integer) corresponding to CHARACTER. -*/ - (character)) -{ - return Fget_char_table (character, mule_to_ucs_table); -} - -/* Decode a UCS-4 character into a buffer. If the lookup fails, use - <GETA MARK> (U+3013) of JIS X 0208, which means correct character - is not found, instead. - #### do something more appropriate (use blob?) - Danger, Will Robinson! Data loss. Should we signal user? */ -static void -decode_ucs4 (unsigned long ch, unsigned_char_dynarr *dst) -{ - Lisp_Object chr = ucs_to_char (ch); - - if (! NILP (chr)) - { - Bufbyte work[MAX_EMCHAR_LEN]; - int len; - - ch = XCHAR (chr); - len = (ch < 128) ? - simple_set_charptr_emchar (work, ch) : - non_ascii_set_charptr_emchar (work, ch); - Dynarr_add_many (dst, work, len); - } - else - { - Dynarr_add (dst, LEADING_BYTE_JAPANESE_JISX0208); - Dynarr_add (dst, 34 + 128); - Dynarr_add (dst, 46 + 128); - } -} - -static unsigned long -mule_char_to_ucs4 (Lisp_Object charset, - unsigned char h, unsigned char l) -{ - Lisp_Object code - = Fget_char_table (make_char (MAKE_CHAR (charset, h & 127, l & 127)), - mule_to_ucs_table); - - if (INTP (code)) - { - return XINT (code); - } - else if ( (XCHARSET_DIMENSION (charset) == 2) && - (XCHARSET_CHARS (charset) == 94) ) - { - unsigned char final = XCHARSET_FINAL (charset); - - if ( ('@' <= final) && (final < 0x7f) ) - { - return 0xe00000 + (final - '@') * 94 * 94 - + ((h & 127) - 33) * 94 + (l & 127) - 33; - } - else - { - return '?'; - } - } - else - { - return '?'; - } -} - -static void -encode_ucs4 (Lisp_Object charset, - unsigned char h, unsigned char l, unsigned_char_dynarr *dst) -{ - unsigned long code = mule_char_to_ucs4 (charset, h, l); - Dynarr_add (dst, code >> 24); - Dynarr_add (dst, (code >> 16) & 255); - Dynarr_add (dst, (code >> 8) & 255); - Dynarr_add (dst, code & 255); -} - -static int -detect_coding_ucs4 (struct detection_state *st, const Extbyte *src, Lstream_data_count n) -{ - while (n--) - { - unsigned char c = *(unsigned char *)src++; - switch (st->ucs4.in_byte) - { - case 0: - if (c >= 128) - return 0; - else - st->ucs4.in_byte++; - break; - case 3: - st->ucs4.in_byte = 0; - break; - default: - st->ucs4.in_byte++; - } - } - return CODING_CATEGORY_UCS4_MASK; -} - -static void -decode_coding_ucs4 (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count 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 = *(unsigned char *)src++; - switch (counter) - { - case 0: - ch = c; - counter = 3; - break; - case 1: - decode_ucs4 ( ( ch << 8 ) | c, dst); - ch = 0; - counter = 0; - break; - default: - ch = ( ch << 8 ) | c; - counter--; - } - } - if (counter & 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 Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) -{ - struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - unsigned int flags = str->flags; - unsigned int ch = str->ch; - unsigned char char_boundary = str->iso2022.current_char_boundary; - Lisp_Object charset = str->iso2022.current_charset; - -#ifdef ENABLE_COMPOSITE_CHARS - /* 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; - int in_composite = 0; - - back_to_square_n: -#endif - - while (n--) - { - unsigned char c = *src++; - - if (BYTE_ASCII_P (c)) - { /* Processing ASCII character */ - ch = 0; - encode_ucs4 (Vcharset_ascii, c, 0, dst); - char_boundary = 1; - } - else if (BUFBYTE_LEADING_BYTE_P (c) || BUFBYTE_LEADING_BYTE_P (ch)) - { /* Processing Leading Byte */ - ch = 0; - charset = CHARSET_BY_LEADING_BYTE (c); - if (LEADING_BYTE_PREFIX_P(c)) - ch = c; - char_boundary = 0; - } - else - { /* Processing Non-ASCII character */ - char_boundary = 1; - if (EQ (charset, Vcharset_control_1)) - { - encode_ucs4 (Vcharset_control_1, c, 0, dst); - } - else - { - switch (XCHARSET_REP_BYTES (charset)) - { - case 2: - encode_ucs4 (charset, c, 0, dst); - break; - case 3: - if (XCHARSET_PRIVATE_P (charset)) - { - encode_ucs4 (charset, c, 0, dst); - ch = 0; - } - else if (ch) - { -#ifdef ENABLE_COMPOSITE_CHARS - if (EQ (charset, Vcharset_composite)) - { - if (in_composite) - { - /* #### Bother! We don't know how to - handle this yet. */ - Dynarr_add (dst, '\0'); - Dynarr_add (dst, '\0'); - Dynarr_add (dst, '\0'); - Dynarr_add (dst, '~'); - } - else - { - Emchar emch = MAKE_CHAR (Vcharset_composite, - ch & 0x7F, c & 0x7F); - Lisp_Object lstr = composite_char_string (emch); - saved_n = n; - saved_src = src; - in_composite = 1; - src = XSTRING_DATA (lstr); - n = XSTRING_LENGTH (lstr); - } - } - else -#endif /* ENABLE_COMPOSITE_CHARS */ - { - encode_ucs4(charset, ch, c, dst); - } - ch = 0; - } - else - { - ch = c; - char_boundary = 0; - } - break; - case 4: - if (ch) - { - encode_ucs4 (charset, ch, c, dst); - ch = 0; - } - else - { - ch = c; - char_boundary = 0; - } - break; - default: - abort (); - } - } - } - } - -#ifdef ENABLE_COMPOSITE_CHARS - if (in_composite) - { - n = saved_n; - src = saved_src; - in_composite = 0; - goto back_to_square_n; /* Wheeeeeeeee ..... */ - } -#endif /* ENABLE_COMPOSITE_CHARS */ - - str->flags = flags; - str->ch = ch; - str->iso2022.current_char_boundary = char_boundary; - str->iso2022.current_charset = charset; - - /* Verbum caro factum est! */ -} - - -/************************************************************************/ -/* UTF-8 methods */ -/************************************************************************/ - -static int -detect_coding_utf8 (struct detection_state *st, const Extbyte *src, Lstream_data_count n) -{ - while (n--) - { - unsigned char c = *(unsigned char *)src++; - switch (st->utf8.in_byte) - { - case 0: - if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO) - return 0; - else if (c >= 0xfc) - st->utf8.in_byte = 5; - else if (c >= 0xf8) - st->utf8.in_byte = 4; - else if (c >= 0xf0) - st->utf8.in_byte = 3; - else if (c >= 0xe0) - st->utf8.in_byte = 2; - else if (c >= 0xc0) - st->utf8.in_byte = 1; - else if (c >= 0x80) - return 0; - break; - default: - if ((c & 0xc0) != 0x80) - return 0; - else - st->utf8.in_byte--; - } - } - return CODING_CATEGORY_UTF8_MASK; -} - -static void -decode_coding_utf8 (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count 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 = *(unsigned char *)src++; - switch (counter) - { - case 0: - if ( c >= 0xfc ) - { - ch = c & 0x01; - counter = 5; - } - else if ( c >= 0xf8 ) - { - ch = c & 0x03; - counter = 4; - } - else if ( c >= 0xf0 ) - { - ch = c & 0x07; - counter = 3; - } - else if ( c >= 0xe0 ) - { - ch = c & 0x0f; - counter = 2; - } - else if ( c >= 0xc0 ) - { - ch = c & 0x1f; - counter = 1; - } - else - { - DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); - decode_ucs4 (c, dst); - } - break; - case 1: - ch = ( ch << 6 ) | ( c & 0x3f ); - decode_ucs4 (ch, dst); - ch = 0; - counter = 0; - break; - default: - ch = ( ch << 6 ) | ( c & 0x3f ); - counter--; - } - label_continue_loop:; - } - - if (flags & CODING_STATE_END) - DECODE_OUTPUT_PARTIAL_CHAR (ch); - - str->flags = flags; - str->ch = ch; - str->counter = counter; -} - -static void -encode_utf8 (Lisp_Object charset, - unsigned char h, unsigned char l, unsigned_char_dynarr *dst) -{ - unsigned long code = mule_char_to_ucs4 (charset, h, l); - if ( code <= 0x7f ) - { - Dynarr_add (dst, code); - } - else if ( code <= 0x7ff ) - { - Dynarr_add (dst, (code >> 6) | 0xc0); - Dynarr_add (dst, (code & 0x3f) | 0x80); - } - else if ( code <= 0xffff ) - { - Dynarr_add (dst, (code >> 12) | 0xe0); - Dynarr_add (dst, ((code >> 6) & 0x3f) | 0x80); - Dynarr_add (dst, (code & 0x3f) | 0x80); - } - else if ( code <= 0x1fffff ) - { - Dynarr_add (dst, (code >> 18) | 0xf0); - Dynarr_add (dst, ((code >> 12) & 0x3f) | 0x80); - Dynarr_add (dst, ((code >> 6) & 0x3f) | 0x80); - Dynarr_add (dst, (code & 0x3f) | 0x80); - } - else if ( code <= 0x3ffffff ) - { - Dynarr_add (dst, (code >> 24) | 0xf8); - Dynarr_add (dst, ((code >> 18) & 0x3f) | 0x80); - Dynarr_add (dst, ((code >> 12) & 0x3f) | 0x80); - Dynarr_add (dst, ((code >> 6) & 0x3f) | 0x80); - Dynarr_add (dst, (code & 0x3f) | 0x80); - } - else - { - Dynarr_add (dst, (code >> 30) | 0xfc); - Dynarr_add (dst, ((code >> 24) & 0x3f) | 0x80); - Dynarr_add (dst, ((code >> 18) & 0x3f) | 0x80); - Dynarr_add (dst, ((code >> 12) & 0x3f) | 0x80); - Dynarr_add (dst, ((code >> 6) & 0x3f) | 0x80); - Dynarr_add (dst, (code & 0x3f) | 0x80); - } -} - -static void -encode_coding_utf8 (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) -{ - struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - unsigned int flags = str->flags; - unsigned int ch = str->ch; - eol_type_t eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); - unsigned char char_boundary = str->iso2022.current_char_boundary; - Lisp_Object charset = str->iso2022.current_charset; - -#ifdef ENABLE_COMPOSITE_CHARS - /* 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; - int in_composite = 0; - - back_to_square_n: -#endif /* ENABLE_COMPOSITE_CHARS */ - - while (n--) - { - unsigned char c = *src++; - - if (BYTE_ASCII_P (c)) - { /* Processing ASCII character */ - ch = 0; - if (c == '\n') - { - if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) - Dynarr_add (dst, '\r'); - if (eol_type != EOL_CR) - Dynarr_add (dst, c); - } - else - encode_utf8 (Vcharset_ascii, c, 0, dst); - char_boundary = 1; - } - else if (BUFBYTE_LEADING_BYTE_P (c) || BUFBYTE_LEADING_BYTE_P (ch)) - { /* Processing Leading Byte */ - ch = 0; - charset = CHARSET_BY_LEADING_BYTE (c); - if (LEADING_BYTE_PREFIX_P(c)) - ch = c; - char_boundary = 0; - } - else - { /* Processing Non-ASCII character */ - char_boundary = 1; - if (EQ (charset, Vcharset_control_1)) - { - encode_utf8 (Vcharset_control_1, c, 0, dst); - } - else - { - switch (XCHARSET_REP_BYTES (charset)) - { - case 2: - encode_utf8 (charset, c, 0, dst); - break; - case 3: - if (XCHARSET_PRIVATE_P (charset)) - { - encode_utf8 (charset, c, 0, dst); - ch = 0; - } - else if (ch) - { -#ifdef ENABLE_COMPOSITE_CHARS - if (EQ (charset, Vcharset_composite)) - { - if (in_composite) - { - /* #### Bother! We don't know how to - handle this yet. */ - encode_utf8 (Vcharset_ascii, '~', 0, dst); - } - else - { - Emchar emch = MAKE_CHAR (Vcharset_composite, - ch & 0x7F, c & 0x7F); - Lisp_Object lstr = composite_char_string (emch); - saved_n = n; - saved_src = src; - in_composite = 1; - src = XSTRING_DATA (lstr); - n = XSTRING_LENGTH (lstr); - } - } - else -#endif /* ENABLE_COMPOSITE_CHARS */ - { - encode_utf8 (charset, ch, c, dst); - } - ch = 0; - } - else - { - ch = c; - char_boundary = 0; - } - break; - case 4: - if (ch) - { - encode_utf8 (charset, ch, c, dst); - ch = 0; - } - else - { - ch = c; - char_boundary = 0; - } - break; - default: - abort (); - } - } - } - } - -#ifdef ENABLE_COMPOSITE_CHARS - if (in_composite) - { - n = saved_n; - src = saved_src; - in_composite = 0; - goto back_to_square_n; /* Wheeeeeeeee ..... */ - } -#endif - - str->flags = flags; - str->ch = ch; - str->iso2022.current_char_boundary = char_boundary; - str->iso2022.current_charset = charset; - - /* Verbum caro factum est! */ -} - - -/************************************************************************/ -/* ISO2022 methods */ -/************************************************************************/ - -/* The following note describes the coding system ISO2022 briefly. - Since the intention of this note is to help understand the - functions in this file, some parts are NOT ACCURATE or OVERLY - SIMPLIFIED. For thorough understanding, please refer to the - original document of ISO2022. - - ISO2022 provides many mechanisms to encode several character sets - in 7-bit and 8-bit environments. For 7-bit environments, all text - is encoded using bytes less than 128. This may make the encoded - text a little bit longer, but the text passes more easily through - several gateways, some of which strip off MSB (Most Signigant Bit). - - There are two kinds of character sets: control character set and - graphic character set. The former contains control characters such - as `newline' and `escape' to provide control functions (control - functions are also provided by escape sequences). The latter - contains graphic characters such as 'A' and '-'. Emacs recognizes - two control character sets and many graphic character sets. - - Graphic character sets are classified into one of the following - four classes, according to the number of bytes (DIMENSION) and - number of characters in one dimension (CHARS) of the set: - - DIMENSION1_CHARS94 - - DIMENSION1_CHARS96 - - DIMENSION2_CHARS94 - - DIMENSION2_CHARS96 - - In addition, each character set is assigned an identification tag, - unique for each set, called "final character" (denoted as <F> - hereafter). The <F> of each character set is decided by ECMA(*) - when it is registered in ISO. The code range of <F> is 0x30..0x7F - (0x30..0x3F are for private use only). - - Note (*): ECMA = European Computer Manufacturers Association - - Here are examples of graphic character set [NAME(<F>)]: - o DIMENSION1_CHARS94 -- ASCII('B'), right-half-of-JISX0201('I'), ... - o DIMENSION1_CHARS96 -- right-half-of-ISO8859-1('A'), ... - o DIMENSION2_CHARS94 -- GB2312('A'), JISX0208('B'), ... - o DIMENSION2_CHARS96 -- none for the moment - - A code area (1 byte = 8 bits) is divided into 4 areas, C0, GL, C1, and GR. + A code area (1byte=8bits) is divided into 4 areas, C0, GL, C1, and GR. C0 [0x00..0x1F] -- control character plane 0 GL [0x20..0x7F] -- graphic character plane 0 C1 [0x80..0x9F] -- control character plane 1 @@ -4155,72 +3087,70 @@ encode_coding_utf8 (Lstream *encoding, const Bufbyte *src, these invocations and designations are omitted in encoded text. In a 7-bit environment, only GL can be used. - When a graphic character set of CHARS94 is invoked to GL, codes - 0x20 and 0x7F of the GL area work as control characters SPACE and - DEL respectively, and codes 0xA0 and 0xFF of the GR area should not - be used. + When a graphic character set of TYPE94 or TYPE94x94 is invoked to + GL, codes 0x20 and 0x7F of the GL area work as control characters + SPACE and DEL respectively, and code 0xA0 and 0xFF of GR area + should not be used. There are two ways of invocation: locking-shift and single-shift. With locking-shift, the invocation lasts until the next different - invocation, whereas with single-shift, the invocation affects the - following character only and doesn't affect the locking-shift - state. Invocations are done by the following control characters or - escape sequences: + invocation, whereas with single-shift, the invocation works only + for the following character and doesn't affect locking-shift. + Invocations are done by the following control characters or escape + sequences. ---------------------------------------------------------------------- abbrev function cntrl escape seq description ---------------------------------------------------------------------- SI/LS0 (shift-in) 0x0F none invoke G0 into GL SO/LS1 (shift-out) 0x0E none invoke G1 into GL + LS1R (locking-shift-1 right) none ESC '~' invoke G1 into GR LS2 (locking-shift-2) none ESC 'n' invoke G2 into GL + LS2R (locking-shift-2 right) none ESC '}' invoke G2 into GR LS3 (locking-shift-3) none ESC 'o' invoke G3 into GL - LS1R (locking-shift-1 right) none ESC '~' invoke G1 into GR (*) - LS2R (locking-shift-2 right) none ESC '}' invoke G2 into GR (*) - LS3R (locking-shift 3 right) none ESC '|' invoke G3 into GR (*) + LS3R (locking-shift 3 right) none ESC '|' invoke G3 into GR SS2 (single-shift-2) 0x8E ESC 'N' invoke G2 for one char SS3 (single-shift-3) 0x8F ESC 'O' invoke G3 for one char ---------------------------------------------------------------------- - (*) These are not used by any known coding system. + The first four are for locking-shift. Control characters for these + functions are defined by macros ISO_CODE_XXX in `coding.h'. - Control characters for these functions are defined by macros - ISO_CODE_XXX in `coding.h'. - - Designations are done by the following escape sequences: + Designations are done by the following escape sequences. ---------------------------------------------------------------------- escape sequence description ---------------------------------------------------------------------- - ESC '(' <F> designate DIMENSION1_CHARS94<F> to G0 - ESC ')' <F> designate DIMENSION1_CHARS94<F> to G1 - ESC '*' <F> designate DIMENSION1_CHARS94<F> to G2 - ESC '+' <F> designate DIMENSION1_CHARS94<F> to G3 - ESC ',' <F> designate DIMENSION1_CHARS96<F> to G0 (*) - ESC '-' <F> designate DIMENSION1_CHARS96<F> to G1 - ESC '.' <F> designate DIMENSION1_CHARS96<F> to G2 - ESC '/' <F> designate DIMENSION1_CHARS96<F> to G3 - ESC '$' '(' <F> designate DIMENSION2_CHARS94<F> to G0 (**) - ESC '$' ')' <F> designate DIMENSION2_CHARS94<F> to G1 - ESC '$' '*' <F> designate DIMENSION2_CHARS94<F> to G2 - ESC '$' '+' <F> designate DIMENSION2_CHARS94<F> to G3 - ESC '$' ',' <F> designate DIMENSION2_CHARS96<F> to G0 (*) - ESC '$' '-' <F> designate DIMENSION2_CHARS96<F> to G1 - ESC '$' '.' <F> designate DIMENSION2_CHARS96<F> to G2 - ESC '$' '/' <F> designate DIMENSION2_CHARS96<F> to G3 + ESC '(' <F> designate TYPE94<F> to G0 + ESC ')' <F> designate TYPE94<F> to G1 + ESC '*' <F> designate TYPE94<F> to G2 + ESC '+' <F> designate TYPE94<F> to G3 + ESC ',' <F> designate TYPE96<F> to G0 (*) + ESC '-' <F> designate TYPE96<F> to G1 + ESC '.' <F> designate TYPE96<F> to G2 + ESC '/' <F> designate TYPE96<F> to G3 + ESC '$' '(' <F> designate TYPE94x94<F> to G0 (**) + ESC '$' ')' <F> designate TYPE94x94<F> to G1 + ESC '$' '*' <F> designate TYPE94x94<F> to G2 + ESC '$' '+' <F> designate TYPE94x94<F> to G3 + ESC '$' ',' <F> designate TYPE96x96<F> to G0 (*) + ESC '$' '-' <F> designate TYPE96x96<F> to G1 + ESC '$' '.' <F> designate TYPE96x96<F> to G2 + ESC '$' '/' <F> designate TYPE96x96<F> to G3 ---------------------------------------------------------------------- - - In this list, "DIMENSION1_CHARS94<F>" means a graphic character set - of dimension 1, chars 94, and final character <F>, etc... + In this list, "TYPE94<F>" means a graphic character set of type TYPE94 + and final character <F>, and etc. Note (*): Although these designations are not allowed in ISO2022, Emacs accepts them on decoding, and produces them on encoding - CHARS96 character sets in a coding system which is characterized as - 7-bit environment, non-locking-shift, and non-single-shift. + TYPE96 or TYPE96x96 character set in a coding system which is + characterized as 7-bit environment, non-locking-shift, and + non-single-shift. Note (**): If <F> is '@', 'A', or 'B', the intermediate character - '(' can be omitted. We refer to this as "short-form" hereafter. + '(' can be omitted. We call this as "short-form" here after. Now you may notice that there are a lot of ways for encoding the same multilingual text in ISO2022. Actually, there exist many - coding systems such as Compound Text (used in X11's inter client + coding systems such as Compound Text (used in X's inter client communication, ISO-2022-JP (used in Japanese internet), ISO-2022-KR (used in Korean internet), EUC (Extended UNIX Code, used in Asian localized platforms), and all of these are variants of ISO2022. @@ -4229,19 +3159,19 @@ encode_coding_utf8 (Lstream *encoding, const Bufbyte *src, sequences: ISO6429's direction specification and Emacs' private sequence for specifying character composition. - ISO6429's direction specification takes the following form: + ISO6429's direction specification takes the following format: o CSI ']' -- end of the current direction o CSI '0' ']' -- end of the current direction o CSI '1' ']' -- start of left-to-right text o CSI '2' ']' -- start of right-to-left text The control character CSI (0x9B: control sequence introducer) is - abbreviated to the escape sequence ESC '[' in a 7-bit environment. + abbreviated to the escape sequence ESC '[' in 7-bit environment. - Character composition specification takes the following form: + Character composition specification takes the following format: o ESC '0' -- start character composition o ESC '1' -- end character composition - Since these are not standard escape sequences of any ISO standard, - their use with these meanings is restricted to Emacs only. */ + Since these are not standard escape sequences of any ISO, the use + of them for these meanings is restricted to Emacs only. */ static void reset_iso2022 (Lisp_Object coding_system, struct iso2022_decoder *iso) @@ -4265,10 +3195,8 @@ reset_iso2022 (Lisp_Object coding_system, struct iso2022_decoder *iso) iso->invalid_switch_dir = 0; iso->output_direction_sequence = 0; iso->output_literally = 0; -#ifdef ENABLE_COMPOSITE_CHARS if (iso->composite_chars) Dynarr_reset (iso->composite_chars); -#endif } static int @@ -4299,48 +3227,7 @@ fit_to_be_escape_quoted (unsigned char c) If CHECK_INVALID_CHARSETS is non-zero, check for designation or invocation of an invalid character set and treat that as - an unrecognized escape sequence. - - ******************************************************************** - - #### Strategies for error annotation and coding orthogonalization - - We really want to separate out a number of things. Conceptually, - there is a nested syntax. - - At the top level is the ISO 2022 extension syntax, including charset - designation and invocation, and certain auxiliary controls such as the - ISO 6429 direction specification. These are octet-oriented, with the - single exception (AFAIK) of the "exit Unicode" sequence which uses the - UTF's natural width (1 byte for UTF-7 and UTF-8, 2 bytes for UCS-2 and - UTF-16, and 4 bytes for UCS-4 and UTF-32). This will be treated as a - (deprecated) special case in Unicode processing. - - The middle layer is ISO 2022 character interpretation. This will depend - on the current state of the ISO 2022 registers, and assembles octets - into the character's internal representation. - - The lowest level is translating system control conventions. At present - this is restricted to newline translation, but one could imagine doing - tab conversion or line wrapping here. "Escape from Unicode" processing - would be done at this level. - - At each level the parser will verify the syntax. In the case of a - syntax error or warning (such as a redundant escape sequence that affects - no characters), the parser will take some action, typically inserting the - erroneous octets directly into the output and creating an annotation - which can be used by higher level I/O to mark the affected region. - - This should make it possible to do something sensible about separating - newline convention processing from character construction, and about - preventing ISO 2022 escape sequences from being recognized - inappropriately. - - The basic strategy will be to have octet classification tables, and - switch processing according to the table entry. - - It's possible that, by doing the processing with tables of functions or - the like, the parser can be used for both detection and translation. */ + an unrecognized escape sequence. */ static int parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso, @@ -4437,7 +3324,6 @@ parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso, reg = 3; half = 1; goto locking_shift; -#ifdef ENABLE_COMPOSITE_CHARS /**** composite ****/ case '0': @@ -4451,7 +3337,6 @@ parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso, *flags = (*flags & CODING_STATE_ISO2022_LOCK) & ~CODING_STATE_COMPOSITE; return 1; -#endif /* ENABLE_COMPOSITE_CHARS */ /**** directionality ****/ @@ -4610,7 +3495,6 @@ parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso, { /* Can this ever be reached? -slb */ abort(); - return 0; } cs = CHARSET_BY_ATTRIBUTES (type, c, @@ -4706,17 +3590,14 @@ parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso, } static int -detect_coding_iso2022 (struct detection_state *st, const Extbyte *src, Lstream_data_count n) +detect_coding_iso2022 (struct detection_state *st, CONST unsigned char *src, + unsigned int n) { + int c; int mask; /* #### There are serious deficiencies in the recognition mechanism - here. This needs to be much smarter if it's going to cut it. - The sequence "\xff\x0f" is currently detected as LOCK_SHIFT while - it should be detected as Latin-1. - All the ISO2022 stuff in this file should be synced up with the - code from FSF Emacs-20.4, in which Mule should be more or less stable. - Perhaps we should wait till R2L works in FSF Emacs? */ + here. This needs to be much smarter if it's going to cut it. */ if (!st->iso2022.initted) { @@ -4736,7 +3617,7 @@ detect_coding_iso2022 (struct detection_state *st, const Extbyte *src, Lstream_d while (n--) { - unsigned char c = *(unsigned char *)src++; + c = *src++; if (c >= 0xA0) { mask &= ~CODING_CATEGORY_ISO_7_MASK; @@ -4835,7 +3716,7 @@ postprocess_iso2022_mask (int mask) need to handle the CSI differently. */ static void -restore_left_to_right_direction (Lisp_Coding_System *codesys, +restore_left_to_right_direction (struct Lisp_Coding_System *codesys, unsigned_char_dynarr *dst, unsigned int *flags, int internal_p) @@ -4866,7 +3747,7 @@ restore_left_to_right_direction (Lisp_Coding_System *codesys, need to handle the CSI differently. */ static void -ensure_correct_direction (int direction, Lisp_Coding_System *codesys, +ensure_correct_direction (int direction, struct Lisp_Coding_System *codesys, unsigned_char_dynarr *dst, unsigned int *flags, int internal_p) { @@ -4896,28 +3777,26 @@ ensure_correct_direction (int direction, Lisp_Coding_System *codesys, /* Convert ISO2022-format data to internal format. */ static void -decode_coding_iso2022 (Lstream *decoding, const Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) +decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) { + unsigned char c; + unsigned int flags, ch; + enum eol_type eol_type; 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; -#ifdef ENABLE_COMPOSITE_CHARS - unsigned_char_dynarr *real_dst = dst; -#endif Lisp_Object coding_system; + unsigned_char_dynarr *real_dst = dst; + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = str->eol_type; XSETCODING_SYSTEM (coding_system, str->codesys); -#ifdef ENABLE_COMPOSITE_CHARS if (flags & CODING_STATE_COMPOSITE) dst = str->iso2022.composite_chars; -#endif /* ENABLE_COMPOSITE_CHARS */ while (n--) { - unsigned char c = *(unsigned char *)src++; + c = *src++; if (flags & CODING_STATE_ESCAPE) { /* Within ESC sequence */ int retval = parse_iso2022_esc (coding_system, &str->iso2022, @@ -4927,7 +3806,6 @@ decode_coding_iso2022 (Lstream *decoding, const Extbyte *src, { switch (str->iso2022.esc) { -#ifdef ENABLE_COMPOSITE_CHARS case ISO_ESC_START_COMPOSITE: if (str->iso2022.composite_chars) Dynarr_reset (str->iso2022.composite_chars); @@ -4946,7 +3824,6 @@ decode_coding_iso2022 (Lstream *decoding, const Extbyte *src, Dynarr_add_many (dst, comstr, len); break; } -#endif /* ENABLE_COMPOSITE_CHARS */ case ISO_ESC_LITERAL: DECODE_ADD_BINARY_CHAR (c, dst); @@ -5034,8 +3911,7 @@ decode_coding_iso2022 (Lstream *decoding, const Extbyte *src, charset = str->iso2022.charset[reg]; /* Error checking: */ - if (! CHARSETP (charset) - || str->iso2022.invalid_designated[reg] + if (NILP (charset) || str->iso2022.invalid_designated[reg] || (((c & 0x7F) == ' ' || (c & 0x7F) == ISO_CODE_DEL) && XCHARSET_CHARS (charset) == 94)) /* Mrmph. We are trying to invoke a register that has no @@ -5124,8 +4000,7 @@ decode_coding_iso2022 (Lstream *decoding, const Extbyte *src, if (flags & CODING_STATE_END) DECODE_OUTPUT_PARTIAL_CHAR (ch); - str->flags = flags; - str->ch = ch; + CODING_STREAM_COMPOSE (str, flags, ch); } @@ -5137,8 +4012,7 @@ static void iso2022_designate (Lisp_Object charset, unsigned char reg, struct encoding_stream *str, unsigned_char_dynarr *dst) { - static const char inter94[] = "()*+"; - static const char inter96[] = ",-./"; + CONST char *inter94 = "()*+", *inter96= ",-./"; unsigned int type; unsigned char final; Lisp_Object old_charset = str->iso2022.charset[reg]; @@ -5222,35 +4096,32 @@ ensure_shift_out (struct encoding_stream *str, unsigned_char_dynarr *dst) /* Convert internally-formatted data to ISO2022 format. */ static void -encode_coding_iso2022 (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) +encode_coding_iso2022 (Lstream *encoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) { unsigned char charmask, c; + unsigned int flags, ch; + enum eol_type eol_type; unsigned char char_boundary; struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - unsigned int flags = str->flags; - unsigned int ch = str->ch; - Lisp_Coding_System *codesys = str->codesys; - eol_type_t eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); + struct Lisp_Coding_System *codesys = str->codesys; int i; Lisp_Object charset; int half; -#ifdef ENABLE_COMPOSITE_CHARS /* 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 */ + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); char_boundary = str->iso2022.current_char_boundary; charset = str->iso2022.current_charset; half = str->iso2022.current_half; -#ifdef ENABLE_COMPOSITE_CHARS back_to_square_n: -#endif while (n--) { c = *src++; @@ -5309,10 +4180,7 @@ encode_coding_iso2022 (Lstream *encoding, const Bufbyte *src, if (LEADING_BYTE_PREFIX_P(c)) ch = c; else if (!EQ (charset, Vcharset_control_1) -#ifdef ENABLE_COMPOSITE_CHARS - && !EQ (charset, Vcharset_composite) -#endif - ) + && !EQ (charset, Vcharset_composite)) { int reg; @@ -5432,7 +4300,6 @@ encode_coding_iso2022 (Lstream *encoding, const Bufbyte *src, } else if (ch) { -#ifdef ENABLE_COMPOSITE_CHARS if (EQ (charset, Vcharset_composite)) { if (in_composite) @@ -5456,7 +4323,6 @@ encode_coding_iso2022 (Lstream *encoding, const Bufbyte *src, } } else -#endif /* ENABLE_COMPOSITE_CHARS */ { Dynarr_add (dst, ch & charmask); Dynarr_add (dst, c & charmask); @@ -5489,7 +4355,6 @@ encode_coding_iso2022 (Lstream *encoding, const Bufbyte *src, } } -#ifdef ENABLE_COMPOSITE_CHARS if (in_composite) { n = saved_n; @@ -5499,7 +4364,6 @@ encode_coding_iso2022 (Lstream *encoding, const Bufbyte *src, Dynarr_add (dst, '1'); /* end composing */ goto back_to_square_n; /* Wheeeeeeeee ..... */ } -#endif /* ENABLE_COMPOSITE_CHARS */ if (char_boundary && flags & CODING_STATE_END) { @@ -5513,8 +4377,7 @@ encode_coding_iso2022 (Lstream *encoding, const Bufbyte *src, } } - str->flags = flags; - str->ch = ch; + CODING_STREAM_COMPOSE (str, flags, ch); str->iso2022.current_char_boundary = char_boundary; str->iso2022.current_charset = charset; str->iso2022.current_half = half; @@ -5531,17 +4394,20 @@ encode_coding_iso2022 (Lstream *encoding, const Bufbyte *src, 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 Extbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) +decode_coding_no_conversion (Lstream *decoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) { + unsigned char c; + unsigned int flags, ch; + enum eol_type eol_type; 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; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = str->eol_type; while (n--) { - unsigned char c = *(unsigned char *)src++; + c = *src++; DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); DECODE_ADD_BINARY_CHAR (c, dst); @@ -5550,19 +4416,20 @@ decode_coding_no_conversion (Lstream *decoding, const Extbyte *src, DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst); - str->flags = flags; - str->ch = ch; + CODING_STREAM_COMPOSE (str, flags, ch); } static void -encode_coding_no_conversion (Lstream *encoding, const Bufbyte *src, - unsigned_char_dynarr *dst, Lstream_data_count n) +encode_coding_no_conversion (Lstream *encoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) { unsigned char c; struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); - unsigned int flags = str->flags; - unsigned int ch = str->ch; - eol_type_t eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); + unsigned int flags, ch; + enum eol_type eol_type; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); while (n--) { @@ -5604,22 +4471,174 @@ encode_coding_no_conversion (Lstream *encoding, const Bufbyte *src, } } - str->flags = flags; - str->ch = ch; + CODING_STREAM_COMPOSE (str, flags, ch); } +/************************************************************************/ +/* Simple internal/external functions */ +/************************************************************************/ + +static Extbyte_dynarr *conversion_out_dynarr; +static Bufbyte_dynarr *conversion_in_dynarr; + +/* Determine coding system from coding format */ + +#define FILE_NAME_CODING_SYSTEM \ + ((NILP (Vfile_name_coding_system) || \ + (EQ ((Vfile_name_coding_system), Qbinary))) ? \ + Qnil : Fget_coding_system (Vfile_name_coding_system)) + +/* #### not correct for all values of `fmt'! */ +#ifdef MULE +#define FMT_CODING_SYSTEM(fmt) \ + (((fmt) == FORMAT_FILENAME) ? FILE_NAME_CODING_SYSTEM : \ + ((fmt) == FORMAT_CTEXT ) ? Fget_coding_system (Qctext) : \ + ((fmt) == FORMAT_TERMINAL) ? FILE_NAME_CODING_SYSTEM : \ + Qnil) +#else +#define FMT_CODING_SYSTEM(fmt) \ + (((fmt) == FORMAT_FILENAME) ? FILE_NAME_CODING_SYSTEM : \ + ((fmt) == FORMAT_TERMINAL) ? FILE_NAME_CODING_SYSTEM : \ + Qnil) +#endif + +Extbyte * +convert_to_external_format (CONST Bufbyte *ptr, + Bytecount len, + Extcount *len_out, + enum external_data_format fmt) +{ + Lisp_Object coding_system = FMT_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 = FMT_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); - - DEFERROR_STANDARD (Qcoding_system_error, Qio_error); + defsymbol (&Qbuffer_file_coding_system, "buffer-file-coding-system"); + deferror (&Qcoding_system_error, "coding-system-error", + "Coding-system error", Qio_error); DEFSUBR (Fcoding_system_p); DEFSUBR (Ffind_coding_system); @@ -5628,10 +4647,6 @@ syms_of_file_coding (void) 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); DEFSUBR (Fcoding_system_type); @@ -5655,19 +4670,12 @@ syms_of_file_coding (void) DEFSUBR (Fencode_shift_jis_char); DEFSUBR (Fdecode_big5_char); DEFSUBR (Fencode_big5_char); - DEFSUBR (Fset_ucs_char); - DEFSUBR (Fucs_char); - 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"); - defsymbol (&Qucs4, "ucs-4"); - defsymbol (&Qutf8, "utf-8"); defsymbol (&Qccl, "ccl"); defsymbol (&Qiso2022, "iso2022"); #endif /* MULE */ @@ -5706,14 +4714,11 @@ syms_of_file_coding (void) 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], "big5"); - defsymbol (&coding_category_symbol[CODING_CATEGORY_UCS4], - "ucs-4"); - defsymbol (&coding_category_symbol[CODING_CATEGORY_UTF8], - "utf-8"); defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_7], "iso-7"); defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_DESIGNATE], @@ -5730,7 +4735,7 @@ syms_of_file_coding (void) } void -lstream_type_create_file_coding (void) +lstream_type_create_mule_coding (void) { LSTREAM_HAS_METHOD (decoding, reader); LSTREAM_HAS_METHOD (decoding, writer); @@ -5750,18 +4755,15 @@ lstream_type_create_file_coding (void) } void -vars_of_file_coding (void) +vars_of_mule_coding (void) { int i; - fcd = xnew (struct file_coding_dump); - dump_add_root_struct_ptr (&fcd, &fcd_description); - /* Initialize to something reasonable ... */ - for (i = 0; i < CODING_CATEGORY_LAST; i++) + 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")); @@ -5779,24 +4781,24 @@ Not used under a windowing system. 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 /* @@ -5815,14 +4817,13 @@ Setting this to nil does not do anything. } 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); + staticpro (&Vcoding_system_hashtable); + Vcoding_system_hashtable = make_lisp_hashtable (50, HASHTABLE_NONWEAK, + HASHTABLE_EQ); the_codesys_prop_dynarr = Dynarr_new (codesys_prop); - dump_add_root_struct_ptr (&the_codesys_prop_dynarr, &codesys_prop_dynarr_description); #define DEFINE_CODESYS_PROP(Prop_Type, Sym) do \ { \ @@ -5862,36 +4863,13 @@ complex_vars_of_file_coding (void) 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); + Fmake_coding_system (Qno_conversion, Qno_conversion, build_string ("No conversion"), + list2 (Qmnemonic, build_string ("Noconv"))); - Fdefine_coding_system_alias (Qfile_name, Qbinary); - - Fdefine_coding_system_alias (Qterminal, Qbinary); - Fdefine_coding_system_alias (Qkeyboard, Qbinary); + 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); - -#ifdef MULE - { - size_t i; - - for (i = 0; i < countof (fcd->ucs_to_mule_table); i++) - fcd->ucs_to_mule_table[i] = Qnil; - } - staticpro (&mule_to_ucs_table); - mule_to_ucs_table = Fmake_char_table(Qgeneric); -#endif /* MULE */ + coding_category_system[CODING_CATEGORY_NO_CONVERSION] = + Fget_coding_system (Qno_conversion); } diff --git a/src/file-coding.h b/src/file-coding.h index 322dbec..2643f4c 100644 --- a/src/file-coding.h +++ b/src/file-coding.h @@ -24,14 +24,14 @@ Boston, MA 02111-1307, USA. */ /* 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 { @@ -42,8 +42,6 @@ enum coding_system_type CODESYS_ISO2022, /* Any ISO2022-compliant coding system. Includes JIS, EUC, CTEXT */ CODESYS_BIG5, /* BIG5 (used for Taiwanese). */ - CODESYS_UCS4, /* ISO 10646 UCS-4 */ - CODESYS_UTF8, /* ISO 10646 UTF-8 */ CODESYS_CCL, /* Converter written in CCL. */ #endif CODESYS_NO_CONVERSION /* "No conversion"; used for binary files. @@ -63,7 +61,6 @@ enum eol_type EOL_CRLF, EOL_CR }; -typedef enum eol_type eol_type_t; #ifdef MULE typedef struct charset_conversion_spec charset_conversion_spec; @@ -84,8 +81,7 @@ struct Lisp_Coding_System 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 +91,14 @@ struct Lisp_Coding_System 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 +127,16 @@ struct Lisp_Coding_System { /* 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) @@ -253,20 +245,18 @@ EXFUN (Fset_coding_category_system, 2); EXFUN (Fset_coding_priority_list, 1); 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; -extern Lisp_Object Vcoding_system_for_write, Vcoding_system_hash_table; +extern Lisp_Object Vcoding_system_for_write, Vcoding_system_hashtable; extern Lisp_Object Vfile_name_coding_system, Vkeyboard_coding_system; extern Lisp_Object Vterminal_coding_system; @@ -315,26 +305,20 @@ extern Lisp_Object Vterminal_coding_system; CODING_STATE_SS2 overrides; but this probably indicates an error in the text encoding. */ -#ifdef ENABLE_COMPOSITE_CHARS #define CODING_STATE_COMPOSITE (1 << 8) /* If set, we're currently processing a composite character (i.e. a character constructed by overstriking two or more characters). */ -#endif /* ENABLE_COMPOSITE_CHARS */ /* CODING_STATE_ISO2022_LOCK is the mask of flags that remain on until explicitly turned off when in the ISO2022 encoder/decoder. Other flags are turned off at the end of processing each character or escape sequence. */ -#ifdef ENABLE_COMPOSITE_CHARS # define CODING_STATE_ISO2022_LOCK \ (CODING_STATE_END | CODING_STATE_COMPOSITE | CODING_STATE_R2L) -#else -# define CODING_STATE_ISO2022_LOCK (CODING_STATE_END | CODING_STATE_R2L) -#endif - -#define CODING_STATE_BIG5_LOCK CODING_STATE_END +#define CODING_STATE_BIG5_LOCK \ + CODING_STATE_END /* Flags indicating what we've seen so far when parsing an ISO2022 escape sequence. */ @@ -377,15 +361,16 @@ enum iso_esc_flag starts a directionality-control sequence. The next character must be 0, 1, 2, or ]. */ - ISO_ESC_5_11_0, /* We've seen 0x9B 0. The next character must be ]. */ - ISO_ESC_5_11_1, /* We've seen 0x9B 1. The next character must be ]. */ - ISO_ESC_5_11_2, /* We've seen 0x9B 2. The next character must be ]. */ + ISO_ESC_5_11_0, /* We've seen 0x9B 0. The next + character must be ]. */ + ISO_ESC_5_11_1, /* We've seen 0x9B 1. The next + character must be ]. */ + ISO_ESC_5_11_2, /* We've seen 0x9B 2. The next + character must be ]. */ /* Full sequences. */ -#ifdef ENABLE_COMPOSITE_CHARS ISO_ESC_START_COMPOSITE, /* Private usage for START COMPOSING */ - ISO_ESC_END_COMPOSITE, /* Private usage for END COMPOSING */ -#endif /* ENABLE_COMPOSITE_CHARS */ + ISO_ESC_END_COMPOSITE, /* Private usage for END COMPOSING */ ISO_ESC_SINGLE_SHIFT, /* We've seen a complete single-shift sequence. */ ISO_ESC_LOCKING_SHIFT,/* We've seen a complete locking-shift sequence. */ ISO_ESC_DESIGNATE, /* We've seen a complete designation sequence. */ @@ -408,50 +393,45 @@ enum iso_esc_flag #define ISO_CODE_CSI 0x9B /* control-sequence-introduce */ #endif /* MULE */ -/* Distinguishable categories of encodings. +/* Macros to access an encoding stream or decoding stream */ - This list determines the initial priority of the categories. - - For better or worse, currently Mule files are encoded in 7-bit ISO 2022. - For this reason, under Mule ISO_7 gets highest priority. +#define CODING_STREAM_DECOMPOSE(str, flags, ch) \ +do { \ + flags = (str)->flags; \ + ch = (str)->ch; \ +} while (0) - Putting NO_CONVERSION second prevents "binary corruption" in the - default case in all but the (presumably) extremely rare case of a - binary file which contains redundant escape sequences but no 8-bit - characters. +#define CODING_STREAM_COMPOSE(str, flags, ch) \ +do { \ + (str)->flags = flags; \ + (str)->ch = ch; \ +} while (0) - The remaining priorities are based on perceived "internationalization - political correctness." An exception is UCS-4 at the bottom, since - basically everything is compatible with UCS-4, but it is likely to - be very rare as an external encoding. */ +/* For detecting the encoding of text */ enum coding_category_type { - /* must be a contiguous range of values 0 -- CODING_CATEGORY_LAST - 1 */ #ifdef MULE + CODING_CATEGORY_SHIFT_JIS, CODING_CATEGORY_ISO_7, /* ISO2022 system using only seven-bit bytes, no locking shift */ - CODING_CATEGORY_NO_CONVERSION, - CODING_CATEGORY_UTF8, + CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes, + no locking shift, no single shift, + using designation to switch charsets */ CODING_CATEGORY_ISO_8_1, /* ISO2022 system using eight-bit bytes, no locking shift, no designation sequences, one-dimension characters in the upper half. */ CODING_CATEGORY_ISO_8_2, /* ISO2022 system using eight-bit bytes, no locking shift, no designation sequences, two-dimension characters in the upper half. */ - CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes, - no locking shift, no single shift, - using designation to switch charsets */ CODING_CATEGORY_ISO_LOCK_SHIFT, /* ISO2022 system using locking shift */ - CODING_CATEGORY_SHIFT_JIS, CODING_CATEGORY_BIG5, - CODING_CATEGORY_UCS4, -#else /* not MULE */ - CODING_CATEGORY_NO_CONVERSION, #endif /* MULE */ - CODING_CATEGORY_LAST /* not a real coding category */ + CODING_CATEGORY_NO_CONVERSION }; +#define CODING_CATEGORY_LAST CODING_CATEGORY_NO_CONVERSION + #ifdef MULE #define CODING_CATEGORY_SHIFT_JIS_MASK \ (1 << CODING_CATEGORY_SHIFT_JIS) @@ -467,10 +447,6 @@ enum coding_category_type (1 << CODING_CATEGORY_ISO_LOCK_SHIFT) #define CODING_CATEGORY_BIG5_MASK \ (1 << CODING_CATEGORY_BIG5) -#define CODING_CATEGORY_UCS4_MASK \ - (1 << CODING_CATEGORY_UCS4) -#define CODING_CATEGORY_UTF8_MASK \ - (1 << CODING_CATEGORY_UTF8) #endif #define CODING_CATEGORY_NO_CONVERSION_MASK \ (1 << CODING_CATEGORY_NO_CONVERSION) @@ -523,21 +499,18 @@ void set_decoding_stream_coding_system (Lstream *stream, 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 #define MIN_LEADING_BYTE 0x80 /* These need special treatment in a string and/or character */ -#ifdef ENABLE_COMPOSITE_CHARS #define LEADING_BYTE_COMPOSITE 0x80 /* for a composite character */ -#endif #define LEADING_BYTE_CONTROL_1 0x8F /* represent normal 80-9F */ #define LEADING_BYTE_LATIN_ISO8859_1 0x81 /* Right half of ISO 8859-1 */ #define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20) #define BUFBYTE_FIRST_BYTE_P(c) ((c) < 0xA0) #define BUFBYTE_LEADING_BYTE_P(c) BYTE_C1_P (c) #endif /* not MULE */ - -#endif /* INCLUDED_file_coding_h_ */ +#endif /* _XEMACS_MULE_CODING_H_ */ diff --git a/src/fns.c b/src/fns.c index 9227b81..22cba39 100644 --- a/src/fns.c +++ b/src/fns.c @@ -36,18 +36,19 @@ Boston, MA 02111-1307, USA. */ #include "lisp.h" -#include "sysfile.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#include <errno.h> #include "buffer.h" #include "bytecode.h" +#include "commands.h" #include "device.h" #include "events.h" #include "extents.h" #include "frame.h" #include "systime.h" -#include "insdel.h" -#include "lstream.h" -#include "opaque.h" /* NOTE: This symbol is also used in lread.c */ #define FEATUREP_SYNTAX @@ -56,10 +57,9 @@ Lisp_Object Qstring_lessp; Lisp_Object Qidentity; static int internal_old_equal (Lisp_Object, Lisp_Object, int); -Lisp_Object safe_copy_tree (Lisp_Object arg, Lisp_Object vecp, int depth); static Lisp_Object -mark_bit_vector (Lisp_Object obj) +mark_bit_vector (Lisp_Object obj, void (*markobj) (Lisp_Object)) { return Qnil; } @@ -67,13 +67,13 @@ mark_bit_vector (Lisp_Object obj) 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 ((EMACS_INT) len, XINT (Vprint_length)); + last = min (len, XINT (Vprint_length)); write_c_string ("#*", printcharfun); for (i = 0; i < last; i++) { @@ -88,10 +88,10 @@ print_bit_vector (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) } static int -bit_vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +bit_vector_equal (Lisp_Object o1, Lisp_Object o2, int depth) { - Lisp_Bit_Vector *v1 = XBIT_VECTOR (obj1); - Lisp_Bit_Vector *v2 = XBIT_VECTOR (obj2); + struct Lisp_Bit_Vector *v1 = XBIT_VECTOR (o1); + struct Lisp_Bit_Vector *v2 = XBIT_VECTOR (o2); return ((bit_vector_length (v1) == bit_vector_length (v2)) && !memcmp (v1->bits, v2->bits, @@ -102,32 +102,17 @@ bit_vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) 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, unsigned long, 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. @@ -190,10 +175,10 @@ length_with_bytecode_hack (Lisp_Object seq) return XINT (Flength (seq)); else { - Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (seq); + struct Lisp_Compiled_Function *b = XCOMPILED_FUNCTION (seq); - return (f->flags.interactivep ? COMPILED_INTERACTIVE : - f->flags.domainp ? COMPILED_DOMAIN : + return (b->flags.interactivep ? COMPILED_INTERACTIVE : + b->flags.domainp ? COMPILED_DOMAIN : COMPILED_DOC_STRING) + 1; } @@ -202,7 +187,7 @@ length_with_bytecode_hack (Lisp_Object seq) #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 @@ -221,9 +206,16 @@ Return the length of vector, bit vector, list or string SEQUENCE. return make_int (XSTRING_CHAR_LENGTH (sequence)); else if (CONSP (sequence)) { - size_t len; - GET_EXTERNAL_LIST_LENGTH (sequence, len); - return make_int (len); + Lisp_Object tail; + int i = 0; + + EXTERNAL_LIST_LOOP (tail, sequence) + { + QUIT; + i++; + } + + return make_int (i); } else if (VECTORP (sequence)) return make_int (XVECTOR_LENGTH (sequence)); @@ -239,6 +231,9 @@ Return the length of vector, bit vector, list or string SEQUENCE. } } +/* This does not check for quits. That is safe + since it must terminate. */ + DEFUN ("safe-length", Fsafe_length, 1, 1, 0, /* Return the length of a list, but avoid error or infinite loop. This function never gets an error. If LIST is not really a list, @@ -247,15 +242,17 @@ which is at least the number of distinct elements. */ (list)) { - Lisp_Object hare, tortoise; - size_t len; + Lisp_Object halftail = list; /* Used to detect circular lists. */ + Lisp_Object tail; + int len = 0; - for (hare = tortoise = list, len = 0; - CONSP (hare) && (! EQ (hare, tortoise) || len == 0); - hare = XCDR (hare), len++) + for (tail = list; CONSP (tail); tail = XCDR (tail)) { - if (len & 1) - tortoise = XCDR (tortoise); + if (EQ (tail, halftail) && len != 0) + break; + len++; + if ((len & 1) == 0) + halftail = XCDR (halftail); } return make_int (len); @@ -271,25 +268,25 @@ strings, but this is not the case under FSF Emacs 19. In FSF Emacs 20 `equal' is the same as in XEmacs, in that respect.) Symbols are also allowed; their print names are used instead. */ - (string1, string2)) + (s1, s2)) { Bytecount len; - Lisp_String *p1, *p2; + struct Lisp_String *p1, *p2; - if (SYMBOLP (string1)) - p1 = XSYMBOL (string1)->name; + if (SYMBOLP (s1)) + p1 = XSYMBOL (s1)->name; else { - CHECK_STRING (string1); - p1 = XSTRING (string1); + CHECK_STRING (s1); + p1 = XSTRING (s1); } - if (SYMBOLP (string2)) - p2 = XSYMBOL (string2)->name; + if (SYMBOLP (s2)) + p2 = XSYMBOL (s2)->name; else { - CHECK_STRING (string2); - p2 = XSTRING (string2); + CHECK_STRING (s2); + p2 = XSTRING (s2); } return (((len = string_length (p1)) == string_length (p2)) && @@ -319,26 +316,26 @@ it is quite likely that a collation table exists (or will exist) for Unicode. When Unicode support is added to XEmacs/Mule, this problem may be solved. */ - (string1, string2)) + (s1, s2)) { - Lisp_String *p1, *p2; + struct Lisp_String *p1, *p2; Charcount end, len2; int i; - if (SYMBOLP (string1)) - p1 = XSYMBOL (string1)->name; + if (SYMBOLP (s1)) + p1 = XSYMBOL (s1)->name; else { - CHECK_STRING (string1); - p1 = XSTRING (string1); + CHECK_STRING (s1); + p1 = XSTRING (s1); } - if (SYMBOLP (string2)) - p2 = XSYMBOL (string2)->name; + if (SYMBOLP (s2)) + p2 = XSYMBOL (s2)->name; else { - CHECK_STRING (string2); - p2 = XSTRING (string2); + CHECK_STRING (s2); + p2 = XSTRING (s2); } end = string_char_length (p1); @@ -352,41 +349,32 @@ may be solved. 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. */ + 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; - } - } + 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 */ @@ -400,7 +388,7 @@ of the string are changed (e.g. with `aset'). It wraps around occasionally. */ (string)) { - Lisp_String *s; + struct Lisp_String *s; CHECK_STRING (string); s = XSTRING (string); @@ -413,7 +401,7 @@ of the string are changed (e.g. with `aset'). It wraps around occasionally. 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 @@ -436,40 +424,40 @@ static Lisp_Object concat (int nargs, Lisp_Object *args, int last_special); Lisp_Object -concat2 (Lisp_Object string1, Lisp_Object string2) +concat2 (Lisp_Object s1, Lisp_Object s2) { Lisp_Object args[2]; - args[0] = string1; - args[1] = string2; + args[0] = s1; + args[1] = s2; return concat (2, args, c_string, 0); } Lisp_Object -concat3 (Lisp_Object string1, Lisp_Object string2, Lisp_Object string3) +concat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3) { Lisp_Object args[3]; - args[0] = string1; - args[1] = string2; - args[2] = string3; + args[0] = s1; + args[1] = s2; + args[2] = s3; return concat (3, args, c_string, 0); } Lisp_Object -vconcat2 (Lisp_Object vec1, Lisp_Object vec2) +vconcat2 (Lisp_Object s1, Lisp_Object s2) { Lisp_Object args[2]; - args[0] = vec1; - args[1] = vec2; + args[0] = s1; + args[1] = s2; return concat (2, args, c_vector, 0); } Lisp_Object -vconcat3 (Lisp_Object vec1, Lisp_Object vec2, Lisp_Object vec3) +vconcat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3) { Lisp_Object args[3]; - args[0] = vec1; - args[1] = vec2; - args[2] = vec3; + args[0] = s1; + args[1] = s2; + args[2] = s3; return concat (3, args, c_vector, 0); } @@ -520,65 +508,38 @@ arguments. Each argument may be a list, vector, bit vector, or string. return concat (nargs, args, c_bit_vector, 0); } -/* Copy a (possibly dotted) list. LIST must be a cons. - Can't use concat (1, &alist, c_cons, 0) - doesn't handle dotted lists. */ -static Lisp_Object -copy_list (Lisp_Object list) -{ - Lisp_Object list_copy = Fcons (XCAR (list), XCDR (list)); - Lisp_Object last = list_copy; - Lisp_Object hare, tortoise; - size_t len; - - for (tortoise = hare = XCDR (list), len = 1; - CONSP (hare); - hare = XCDR (hare), len++) - { - XCDR (last) = Fcons (XCAR (hare), XCDR (hare)); - last = XCDR (last); - - if (len < CIRCULAR_LIST_SUSPICION_LENGTH) - continue; - if (len & 1) - tortoise = XCDR (tortoise); - if (EQ (tortoise, hare)) - signal_circular_list_error (list); - } - - return list_copy; -} - -DEFUN ("copy-list", Fcopy_list, 1, 1, 0, /* -Return a copy of list LIST, which may be a dotted list. -The elements of LIST are not copied; they are shared +DEFUN ("copy-sequence", Fcopy_sequence, 1, 1, 0, /* +Return a copy of a list, vector, bit vector or string. +The elements of a list or vector are not copied; they are shared with the original. */ - (list)) + (arg)) { again: - if (NILP (list)) return list; - if (CONSP (list)) return copy_list (list); + if (NILP (arg)) return arg; + /* We handle conses separately because concat() is big and hairy and + doesn't handle (copy-sequence '(a b . c)) and it's easier to redo this + than to fix concat() without worrying about breaking other things. + */ + if (CONSP (arg)) + { + Lisp_Object head = Fcons (XCAR (arg), XCDR (arg)); + Lisp_Object tail = head; - list = wrong_type_argument (Qlistp, list); - goto again; -} + for (arg = XCDR (arg); CONSP (arg); arg = XCDR (arg)) + { + XCDR (tail) = Fcons (XCAR (arg), XCDR (arg)); + tail = XCDR (tail); + QUIT; + } + return head; + } + if (STRINGP (arg)) return concat (1, &arg, c_string, 0); + if (VECTORP (arg)) return concat (1, &arg, c_vector, 0); + if (BIT_VECTORP (arg)) return concat (1, &arg, c_bit_vector, 0); -DEFUN ("copy-sequence", Fcopy_sequence, 1, 1, 0, /* -Return a copy of list, vector, bit vector or string SEQUENCE. -The elements of a list or vector are not copied; they are shared -with the original. SEQUENCE may be a dotted list. -*/ - (sequence)) -{ - again: - if (NILP (sequence)) return sequence; - if (CONSP (sequence)) return copy_list (sequence); - if (STRINGP (sequence)) return concat (1, &sequence, c_string, 0); - if (VECTORP (sequence)) return concat (1, &sequence, c_vector, 0); - if (BIT_VECTORP (sequence)) return concat (1, &sequence, c_bit_vector, 0); - - check_losing_bytecode ("copy-sequence", sequence); - sequence = wrong_type_argument (Qsequencep, sequence); + check_losing_bytecode ("copy-sequence", arg); + arg = wrong_type_argument (Qsequencep, arg); goto again; } @@ -711,7 +672,6 @@ concat (int nargs, Lisp_Object *args, string_result_ptr = string_result; break; default: - val = Qnil; abort (); } } @@ -864,15 +824,6 @@ are not copied. */ (arg, vecp)) { - return safe_copy_tree (arg, vecp, 0); -} - -Lisp_Object -safe_copy_tree (Lisp_Object arg, Lisp_Object vecp, int depth) -{ - if (depth > 200) - signal_simple_error ("Stack overflow in copy-tree", arg); - if (CONSP (arg)) { Lisp_Object rest; @@ -882,9 +833,9 @@ safe_copy_tree (Lisp_Object arg, Lisp_Object vecp, int depth) Lisp_Object elt = XCAR (rest); QUIT; if (CONSP (elt) || VECTORP (elt)) - XCAR (rest) = safe_copy_tree (elt, vecp, depth + 1); + XCAR (rest) = Fcopy_tree (elt, vecp); if (VECTORP (XCDR (rest))) /* hack for (a b . [c d]) */ - XCDR (rest) = safe_copy_tree (XCDR (rest), vecp, depth +1); + XCDR (rest) = Fcopy_tree (XCDR (rest), vecp); rest = XCDR (rest); } } @@ -898,113 +849,117 @@ safe_copy_tree (Lisp_Object arg, Lisp_Object vecp, int depth) Lisp_Object elt = XVECTOR_DATA (arg) [j]; QUIT; if (CONSP (elt) || VECTORP (elt)) - XVECTOR_DATA (arg) [j] = safe_copy_tree (elt, vecp, depth + 1); + XVECTOR_DATA (arg) [j] = Fcopy_tree (elt, vecp); } } return arg; } DEFUN ("substring", Fsubstring, 2, 3, 0, /* -Return the substring of STRING starting at START and ending before END. -END may be nil or omitted; then the substring runs to the end of STRING. -If START or END is negative, it counts from the end. -Relevant parts of the string-extent-data are copied to the new string. +Return a substring of STRING, starting at index FROM and ending before TO. +TO may be nil or omitted; then the substring runs to the end of STRING. +If FROM or TO is negative, it counts from the end. +Relevant parts of the string-extent-data are copied in the new string. */ - (string, start, end)) + (string, from, to)) { - Charcount ccstart, ccend; - Bytecount bstart, blen; + Charcount ccfr, ccto; + Bytecount bfr, bto; Lisp_Object val; CHECK_STRING (string); - CHECK_INT (start); - get_string_range_char (string, start, end, &ccstart, &ccend, + /* Historically, FROM could not be omitted. Whatever ... */ + CHECK_INT (from); + get_string_range_char (string, from, to, &ccfr, &ccto, GB_HISTORICAL_STRING_BEHAVIOR); - bstart = charcount_to_bytecount (XSTRING_DATA (string), ccstart); - blen = charcount_to_bytecount (XSTRING_DATA (string) + bstart, ccend - ccstart); - val = make_string (XSTRING_DATA (string) + bstart, blen); - /* Copy any applicable extent information into the new string. */ - copy_string_extents (val, string, 0, bstart, blen); + bfr = charcount_to_bytecount (XSTRING_DATA (string), ccfr); + 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, 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; + int len, f, t; - if (STRINGP (sequence)) - return Fsubstring (sequence, start, end); + if (STRINGP (seq)) + return Fsubstring (seq, from, to); - len = XINT (Flength (sequence)); + if (!LISTP (seq) && !VECTORP (seq) && !BIT_VECTORP (seq)) + { + check_losing_bytecode ("subseq", seq); + seq = wrong_type_argument (Qsequencep, seq); + } - CHECK_INT (start); - s = XINT (start); - if (s < 0) - s = len + s; + len = XINT (Flength (seq)); - if (NILP (end)) - e = len; + 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 (!(0 <= f && f <= t && t <= len)) + args_out_of_range_3 (seq, make_int (f), make_int (t)); - if (VECTORP (sequence)) + 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; + int i; - sequence = Fnthcdr (make_int (s), sequence); + seq = Fnthcdr (make_int (f), seq); - for (i = s; i < e; i++) + 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; + } } @@ -1013,7 +968,7 @@ Take cdr N times on LIST, and return the result. */ (n, list)) { - REGISTER size_t i; + REGISTER int i; REGISTER Lisp_Object tail = list; CHECK_NATNUM (n); for (i = XINT (n); i; i--) @@ -1065,14 +1020,14 @@ Return element of SEQUENCE at index N. args_out_of_range (sequence, n); #endif } - else if (STRINGP (sequence) || - VECTORP (sequence) || - BIT_VECTORP (sequence)) + else if (STRINGP (sequence) + || VECTORP (sequence) + || BIT_VECTORP (sequence)) return Faref (sequence, n); #ifdef LOSING_BYTECODE else if (COMPILED_FUNCTIONP (sequence)) { - EMACS_INT idx = XINT (n); + int idx = XINT (n); if (idx < 0) { lose: @@ -1080,24 +1035,24 @@ Return element of SEQUENCE at index N. } /* Utter perversity */ { - Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (sequence); + struct Lisp_Compiled_Function *b = XCOMPILED_FUNCTION (sequence); switch (idx) { case COMPILED_ARGLIST: - return compiled_function_arglist (f); - case COMPILED_INSTRUCTIONS: - return compiled_function_instructions (f); + return b->arglist; + case COMPILED_BYTECODE: + return b->bytecodes; case COMPILED_CONSTANTS: - return compiled_function_constants (f); + return b->constants; case COMPILED_STACK_DEPTH: - return compiled_function_stack_depth (f); + return make_int (b->maxdepth); case COMPILED_DOC_STRING: - return compiled_function_documentation (f); + return compiled_function_documentation (b); case COMPILED_DOMAIN: - return compiled_function_domain (f); + return compiled_function_domain (b); case COMPILED_INTERACTIVE: - if (f->flags.interactivep) - return compiled_function_interactive (f); + if (b->flags.interactivep) + return compiled_function_interactive (b); /* if we return nil, can't tell interactive with no args from noninteractive. */ goto lose; @@ -1115,125 +1070,19 @@ Return element of SEQUENCE at index N. } } -DEFUN ("last", Flast, 1, 2, 0, /* -Return the tail of list LIST, of length N (default 1). -LIST may be a dotted list, but not a circular list. -Optional argument N must be a non-negative integer. -If N is zero, then the atom that terminates the list is returned. -If N is greater than the length of LIST, then LIST itself is returned. -*/ - (list, n)) -{ - EMACS_INT int_n, count; - Lisp_Object retval, tortoise, hare; - - CHECK_LIST (list); - - if (NILP (n)) - int_n = 1; - else - { - CHECK_NATNUM (n); - int_n = XINT (n); - } - - for (retval = tortoise = hare = list, count = 0; - CONSP (hare); - hare = XCDR (hare), - (int_n-- <= 0 ? ((void) (retval = XCDR (retval))) : (void)0), - count++) - { - if (count < CIRCULAR_LIST_SUSPICION_LENGTH) continue; - - if (count & 1) - tortoise = XCDR (tortoise); - if (EQ (hare, tortoise)) - signal_circular_list_error (list); - } - - return retval; -} - -DEFUN ("nbutlast", Fnbutlast, 1, 2, 0, /* -Modify LIST to remove the last N (default 1) elements. -If LIST has N or fewer elements, nil is returned and LIST is unmodified. -*/ - (list, n)) -{ - EMACS_INT int_n; - - CHECK_LIST (list); - - if (NILP (n)) - int_n = 1; - else - { - CHECK_NATNUM (n); - int_n = XINT (n); - } - - { - Lisp_Object last_cons = list; - - EXTERNAL_LIST_LOOP_1 (list) - { - if (int_n-- < 0) - last_cons = XCDR (last_cons); - } - - if (int_n >= 0) - return Qnil; - - XCDR (last_cons) = Qnil; - return list; - } -} - -DEFUN ("butlast", Fbutlast, 1, 2, 0, /* -Return a copy of LIST with the last N (default 1) elements removed. -If LIST has N or fewer elements, nil is returned. -*/ - (list, n)) -{ - EMACS_INT int_n; - - CHECK_LIST (list); - - if (NILP (n)) - int_n = 1; - else - { - CHECK_NATNUM (n); - int_n = XINT (n); - } - - { - Lisp_Object retval = Qnil; - Lisp_Object tail = list; - - EXTERNAL_LIST_LOOP_1 (list) - { - if (--int_n < 0) - { - retval = Fcons (XCAR (tail), retval); - tail = XCDR (tail); - } - } - - return Fnreverse (retval); - } -} - DEFUN ("member", Fmember, 2, 2, 0, /* Return non-nil if ELT is an element of LIST. Comparison done with `equal'. The value is actually the tail of LIST whose car is ELT. */ (elt, list)) { - EXTERNAL_LIST_LOOP_3 (list_elt, list, tail) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (internal_equal (elt, list_elt, 0)) + CONCHECK_CONS (tail); + if (internal_equal (elt, XCAR (tail), 0)) return tail; + QUIT; } return Qnil; } @@ -1246,10 +1095,13 @@ Do not use it. */ (elt, list)) { - EXTERNAL_LIST_LOOP_3 (list_elt, list, tail) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (internal_old_equal (elt, list_elt, 0)) + CONCHECK_CONS (tail); + if (internal_old_equal (elt, XCAR (tail), 0)) return tail; + QUIT; } return Qnil; } @@ -1260,10 +1112,14 @@ The value is actually the tail of LIST whose car is ELT. */ (elt, list)) { - EXTERNAL_LIST_LOOP_3 (list_elt, list, tail) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (EQ_WITH_EBOLA_NOTICE (elt, list_elt)) + REGISTER Lisp_Object tem; + CONCHECK_CONS (tail); + if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem)) return tail; + QUIT; } return Qnil; } @@ -1276,10 +1132,14 @@ Do not use it. */ (elt, list)) { - EXTERNAL_LIST_LOOP_3 (list_elt, list, tail) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (HACKEQ_UNSAFE (elt, list_elt)) + REGISTER Lisp_Object tem; + CONCHECK_CONS (tail); + if (tem = XCAR (tail), HACKEQ_UNSAFE (elt, tem)) return tail; + QUIT; } return Qnil; } @@ -1287,80 +1147,102 @@ Do not use it. Lisp_Object memq_no_quit (Lisp_Object elt, Lisp_Object list) { - LIST_LOOP_3 (list_elt, list, tail) + REGISTER Lisp_Object tail; + for (tail = list; CONSP (tail); tail = XCDR (tail)) { - if (EQ_WITH_EBOLA_NOTICE (elt, list_elt)) + REGISTER Lisp_Object tem; + if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem)) return tail; } return Qnil; } DEFUN ("assoc", Fassoc, 2, 2, 0, /* -Return non-nil if KEY is `equal' to the car of an element of ALIST. -The value is actually the element of ALIST whose car equals KEY. +Return non-nil if KEY is `equal' to the car of an element of LIST. +The value is actually the element of LIST whose car equals KEY. */ - (key, alist)) + (key, list)) { /* This function can GC. */ - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (internal_equal (key, elt_car, 0)) + REGISTER Lisp_Object elt; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && internal_equal (XCAR (elt), key, 0)) return elt; + QUIT; } return Qnil; } DEFUN ("old-assoc", Fold_assoc, 2, 2, 0, /* -Return non-nil if KEY is `old-equal' to the car of an element of ALIST. -The value is actually the element of ALIST whose car equals KEY. +Return non-nil if KEY is `old-equal' to the car of an element of LIST. +The value is actually the element of LIST whose car equals KEY. */ - (key, alist)) + (key, list)) { /* This function can GC. */ - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (internal_old_equal (key, elt_car, 0)) + REGISTER Lisp_Object elt; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && internal_old_equal (XCAR (elt), key, 0)) return elt; + QUIT; } return Qnil; } Lisp_Object -assoc_no_quit (Lisp_Object key, Lisp_Object alist) +assoc_no_quit (Lisp_Object key, Lisp_Object list) { int speccount = specpdl_depth (); specbind (Qinhibit_quit, Qt); - return unbind_to (speccount, Fassoc (key, alist)); + return unbind_to (speccount, Fassoc (key, list)); } DEFUN ("assq", Fassq, 2, 2, 0, /* -Return non-nil if KEY is `eq' to the car of an element of ALIST. -The value is actually the element of ALIST whose car is KEY. -Elements of ALIST that are not conses are ignored. +Return non-nil if KEY is `eq' to the car of an element of LIST. +The value is actually the element of LIST whose car is KEY. +Elements of LIST that are not conses are ignored. */ - (key, alist)) + (key, list)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (EQ_WITH_EBOLA_NOTICE (key, elt_car)) + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) return elt; + QUIT; } return Qnil; } DEFUN ("old-assq", Fold_assq, 2, 2, 0, /* -Return non-nil if KEY is `old-eq' to the car of an element of ALIST. -The value is actually the element of ALIST whose car is KEY. -Elements of ALIST that are not conses are ignored. +Return non-nil if KEY is `old-eq' to the car of an element of LIST. +The value is actually the element of LIST whose car is KEY. +Elements of LIST that are not conses are ignored. This function is provided only for byte-code compatibility with v19. Do not use it. */ - (key, alist)) + (key, list)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (HACKEQ_UNSAFE (key, elt_car)) + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), HACKEQ_UNSAFE (key, tem))) return elt; + QUIT; } return Qnil; } @@ -1369,83 +1251,105 @@ Do not use it. Use only on lists known never to be circular. */ Lisp_Object -assq_no_quit (Lisp_Object key, Lisp_Object alist) +assq_no_quit (Lisp_Object key, Lisp_Object list) { /* This cannot GC. */ - LIST_LOOP_2 (elt, alist) + REGISTER Lisp_Object tail; + for (tail = list; CONSP (tail); tail = XCDR (tail)) { - Lisp_Object elt_car = XCAR (elt); - if (EQ_WITH_EBOLA_NOTICE (key, elt_car)) - return elt; + REGISTER Lisp_Object tem, elt; + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) + return elt; } return Qnil; } DEFUN ("rassoc", Frassoc, 2, 2, 0, /* -Return non-nil if VALUE is `equal' to the cdr of an element of ALIST. -The value is actually the element of ALIST whose cdr equals VALUE. +Return non-nil if KEY is `equal' to the cdr of an element of LIST. +The value is actually the element of LIST whose cdr equals KEY. */ - (value, alist)) + (key, list)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (internal_equal (value, elt_cdr, 0)) + REGISTER Lisp_Object elt; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && internal_equal (XCDR (elt), key, 0)) return elt; + QUIT; } return Qnil; } DEFUN ("old-rassoc", Fold_rassoc, 2, 2, 0, /* -Return non-nil if VALUE is `old-equal' to the cdr of an element of ALIST. -The value is actually the element of ALIST whose cdr equals VALUE. +Return non-nil if KEY is `old-equal' to the cdr of an element of LIST. +The value is actually the element of LIST whose cdr equals KEY. */ - (value, alist)) + (key, list)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (internal_old_equal (value, elt_cdr, 0)) + REGISTER Lisp_Object elt; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && internal_old_equal (XCDR (elt), key, 0)) return elt; + QUIT; } return Qnil; } DEFUN ("rassq", Frassq, 2, 2, 0, /* -Return non-nil if VALUE is `eq' to the cdr of an element of ALIST. -The value is actually the element of ALIST whose cdr is VALUE. +Return non-nil if KEY is `eq' to the cdr of an element of LIST. +The value is actually the element of LIST whose cdr is KEY. */ - (value, alist)) + (key, list)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (EQ_WITH_EBOLA_NOTICE (value, elt_cdr)) + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCDR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) return elt; + QUIT; } return Qnil; } DEFUN ("old-rassq", Fold_rassq, 2, 2, 0, /* -Return non-nil if VALUE is `old-eq' to the cdr of an element of ALIST. -The value is actually the element of ALIST whose cdr is VALUE. +Return non-nil if KEY is `old-eq' to the cdr of an element of LIST. +The value is actually the element of LIST whose cdr is KEY. */ - (value, alist)) + (key, list)) { - EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, alist) + REGISTER Lisp_Object tail; + LIST_LOOP (tail, list) { - if (HACKEQ_UNSAFE (value, elt_cdr)) + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCDR (elt), HACKEQ_UNSAFE (key, tem))) return elt; + QUIT; } return Qnil; } -/* Like Frassq, but caller must ensure that ALIST is properly - nil-terminated and ebola-free. */ Lisp_Object -rassq_no_quit (Lisp_Object value, Lisp_Object alist) +rassq_no_quit (Lisp_Object key, Lisp_Object list) { - LIST_LOOP_2 (elt, alist) + REGISTER Lisp_Object tail; + for (tail = list; CONSP (tail); tail = XCDR (tail)) { - Lisp_Object elt_cdr = XCDR (elt); - if (EQ_WITH_EBOLA_NOTICE (value, elt_cdr)) + REGISTER Lisp_Object elt, tem; + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCDR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) return elt; } return Qnil; @@ -1462,8 +1366,24 @@ Also see: `remove'. */ (elt, list)) { - EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list, - (internal_equal (elt, list_elt, 0))); + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + + while (!NILP (tail)) + { + CONCHECK_CONS (tail); + if (internal_equal (elt, XCAR (tail), 0)) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + QUIT; + } return list; } @@ -1476,8 +1396,24 @@ of changing the value of `foo'. */ (elt, list)) { - EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list, - (internal_old_equal (elt, list_elt, 0))); + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + + while (!NILP (tail)) + { + CONCHECK_CONS (tail); + if (internal_old_equal (elt, XCAR (tail), 0)) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + QUIT; + } return list; } @@ -1490,8 +1426,25 @@ changing the value of `foo'. */ (elt, list)) { - EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list, - (EQ_WITH_EBOLA_NOTICE (elt, list_elt))); + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + + while (!NILP (tail)) + { + REGISTER Lisp_Object tem; + CONCHECK_CONS (tail); + if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem)) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + QUIT; + } return list; } @@ -1504,19 +1457,50 @@ changing the value of `foo'. */ (elt, list)) { - EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list, - (HACKEQ_UNSAFE (elt, list_elt))); + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + + while (!NILP (tail)) + { + REGISTER Lisp_Object tem; + CONCHECK_CONS (tail); + if (tem = XCAR (tail), HACKEQ_UNSAFE (elt, tem)) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + QUIT; + } return list; } -/* Like Fdelq, but caller must ensure that LIST is properly - nil-terminated and ebola-free. */ +/* no quit, no errors; be careful */ Lisp_Object delq_no_quit (Lisp_Object elt, Lisp_Object list) { - LIST_LOOP_DELETE_IF (list_elt, list, - (EQ_WITH_EBOLA_NOTICE (elt, list_elt))); + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + + while (CONSP (tail)) + { + REGISTER Lisp_Object tem; + if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem)) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + } return list; } @@ -1532,116 +1516,217 @@ delq_no_quit_and_free_cons (Lisp_Object elt, Lisp_Object list) { REGISTER Lisp_Object tail = list; REGISTER Lisp_Object prev = Qnil; + struct Lisp_Cons *cons_to_free = NULL; - while (!NILP (tail)) + while (CONSP (tail)) { - REGISTER Lisp_Object tem = XCAR (tail); - if (EQ (elt, tem)) + REGISTER Lisp_Object tem; + if (tem = XCAR (tail), EQ_WITH_EBOLA_NOTICE (elt, tem)) { - Lisp_Object cons_to_free = tail; if (NILP (prev)) list = XCDR (tail); else XCDR (prev) = XCDR (tail); - tail = XCDR (tail); - free_cons (XCONS (cons_to_free)); + cons_to_free = XCONS (tail); } else + prev = tail; + tail = XCDR (tail); + if (cons_to_free) { - prev = tail; - tail = XCDR (tail); + free_cons (cons_to_free); + cons_to_free = NULL; } } return list; } DEFUN ("remassoc", Fremassoc, 2, 2, 0, /* -Delete by side effect any elements of ALIST whose car is `equal' to KEY. -The modified ALIST is returned. If the first member of ALIST has a car +Delete by side effect any elements of LIST whose car is `equal' to KEY. +The modified LIST is returned. If the first member of LIST has a car that is `equal' to KEY, there is no way to remove it by side effect; therefore, write `(setq foo (remassoc key foo))' to be sure of changing the value of `foo'. */ - (key, alist)) + (key, list)) { - EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist, - (CONSP (elt) && - internal_equal (key, XCAR (elt), 0))); - return alist; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + + while (!NILP (tail)) + { + REGISTER Lisp_Object elt; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && internal_equal (key, XCAR (elt), 0)) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + QUIT; + } + return list; } Lisp_Object -remassoc_no_quit (Lisp_Object key, Lisp_Object alist) +remassoc_no_quit (Lisp_Object key, Lisp_Object list) { int speccount = specpdl_depth (); specbind (Qinhibit_quit, Qt); - return unbind_to (speccount, Fremassoc (key, alist)); + return unbind_to (speccount, Fremassoc (key, list)); } DEFUN ("remassq", Fremassq, 2, 2, 0, /* -Delete by side effect any elements of ALIST whose car is `eq' to KEY. -The modified ALIST is returned. If the first member of ALIST has a car +Delete by side effect any elements of LIST whose car is `eq' to KEY. +The modified LIST is returned. If the first member of LIST has a car that is `eq' to KEY, there is no way to remove it by side effect; therefore, write `(setq foo (remassq key foo))' to be sure of changing the value of `foo'. */ - (key, alist)) + (key, list)) { - EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist, - (CONSP (elt) && - EQ_WITH_EBOLA_NOTICE (key, XCAR (elt)))); - return alist; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + + while (!NILP (tail)) + { + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + QUIT; + } + return list; } /* no quit, no errors; be careful */ Lisp_Object -remassq_no_quit (Lisp_Object key, Lisp_Object alist) +remassq_no_quit (Lisp_Object key, Lisp_Object list) { - LIST_LOOP_DELETE_IF (elt, alist, - (CONSP (elt) && - EQ_WITH_EBOLA_NOTICE (key, XCAR (elt)))); - return alist; -} + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; -DEFUN ("remrassoc", Fremrassoc, 2, 2, 0, /* -Delete by side effect any elements of ALIST whose cdr is `equal' to VALUE. -The modified ALIST is returned. If the first member of ALIST has a car + while (CONSP (tail)) + { + REGISTER Lisp_Object elt, tem; + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (key, tem))) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + } + return list; +} + +DEFUN ("remrassoc", Fremrassoc, 2, 2, 0, /* +Delete by side effect any elements of LIST whose cdr is `equal' to VALUE. +The modified LIST is returned. If the first member of LIST has a car that is `equal' to VALUE, there is no way to remove it by side effect; therefore, write `(setq foo (remrassoc value foo))' to be sure of changing the value of `foo'. */ - (value, alist)) + (value, list)) { - EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist, - (CONSP (elt) && - internal_equal (value, XCDR (elt), 0))); - return alist; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + + while (!NILP (tail)) + { + REGISTER Lisp_Object elt; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && internal_equal (value, XCDR (elt), 0)) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + QUIT; + } + return list; } DEFUN ("remrassq", Fremrassq, 2, 2, 0, /* -Delete by side effect any elements of ALIST whose cdr is `eq' to VALUE. -The modified ALIST is returned. If the first member of ALIST has a car +Delete by side effect any elements of LIST whose cdr is `eq' to VALUE. +The modified LIST is returned. If the first member of LIST has a car that is `eq' to VALUE, there is no way to remove it by side effect; therefore, write `(setq foo (remrassq value foo))' to be sure of changing the value of `foo'. */ - (value, alist)) + (value, list)) { - EXTERNAL_LIST_LOOP_DELETE_IF (elt, alist, - (CONSP (elt) && - EQ_WITH_EBOLA_NOTICE (value, XCDR (elt)))); - return alist; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + + while (!NILP (tail)) + { + REGISTER Lisp_Object elt, tem; + CONCHECK_CONS (tail); + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (value, tem))) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + QUIT; + } + return list; } -/* Like Fremrassq, fast and unsafe; be careful */ +/* no quit, no errors; be careful */ + Lisp_Object -remrassq_no_quit (Lisp_Object value, Lisp_Object alist) +remrassq_no_quit (Lisp_Object value, Lisp_Object list) { - LIST_LOOP_DELETE_IF (elt, alist, - (CONSP (elt) && - EQ_WITH_EBOLA_NOTICE (value, XCDR (elt)))); - return alist; + REGISTER Lisp_Object tail = list; + REGISTER Lisp_Object prev = Qnil; + + while (CONSP (tail)) + { + REGISTER Lisp_Object elt, tem; + elt = XCAR (tail); + if (CONSP (elt) && (tem = XCAR (elt), EQ_WITH_EBOLA_NOTICE (value, tem))) + { + if (NILP (prev)) + list = XCDR (tail); + else + XCDR (prev) = XCDR (tail); + } + else + prev = tail; + tail = XCDR (tail); + } + return list; } DEFUN ("nreverse", Fnreverse, 1, 1, 0, /* @@ -1660,6 +1745,7 @@ Also see: `reverse'. while (!NILP (tail)) { REGISTER Lisp_Object next; + QUIT; CONCHECK_CONS (tail); next = XCDR (tail); XCDR (tail) = prev; @@ -1676,12 +1762,17 @@ See also the function `nreverse', which is used more often. */ (list)) { - Lisp_Object reversed_list = Qnil; - EXTERNAL_LIST_LOOP_2 (elt, list) + REGISTER Lisp_Object tail; + Lisp_Object new = Qnil; + + for (tail = list; CONSP (tail); tail = XCDR (tail)) { - reversed_list = Fcons (elt, reversed_list); + new = Fcons (XCAR (tail), new); + QUIT; } - return reversed_list; + if (!NILP (tail)) + dead_wrong_type_argument (Qlistp, tail); + return new; } static Lisp_Object list_merge (Lisp_Object org_l1, Lisp_Object org_l2, @@ -1699,11 +1790,12 @@ list_sort (Lisp_Object list, Lisp_Object back, tem; Lisp_Object front = list; Lisp_Object len = Flength (list); + int length = XINT (len); - if (XINT (len) < 2) + if (length < 2) return list; - len = make_int (XINT (len) / 2 - 1); + XSETINT (len, (length / 2) - 1); tem = Fnthcdr (len, list); back = Fcdr (tem); Fsetcdr (tem, Qnil); @@ -1744,9 +1836,9 @@ Returns the sorted list. LIST is modified by side effects. PREDICATE is called with two elements of LIST, and should return T if the first element is "less" than the second. */ - (list, predicate)) + (list, pred)) { - return list_sort (list, predicate, merge_pred_function); + return list_sort (list, pred, merge_pred_function); } Lisp_Object @@ -1835,7 +1927,7 @@ int 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; @@ -1879,10 +1971,10 @@ plists_differ (Lisp_Object a, Lisp_Object b, int nil_means_not_present, { 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; @@ -1986,12 +2078,13 @@ If optional arg NIL-MEANS-NOT-PRESENT is non-nil, then a property with Lisp_Object internal_plist_get (Lisp_Object plist, Lisp_Object property) { - Lisp_Object tail; + Lisp_Object tail = plist; - for (tail = plist; !NILP (tail); tail = XCDR (XCDR (tail))) + for (; !NILP (tail); tail = XCDR (XCDR (tail))) { - if (EQ (XCAR (tail), property)) - return XCAR (XCDR (tail)); + struct Lisp_Cons *c = XCONS (tail); + if (EQ (c->car, property)) + return XCAR (c->cdr); } return Qunbound; @@ -2021,22 +2114,26 @@ internal_plist_put (Lisp_Object *plist, Lisp_Object property, int internal_remprop (Lisp_Object *plist, Lisp_Object property) { - Lisp_Object tail, prev; + Lisp_Object tail = *plist; + + if (NILP (tail)) + return 0; - for (tail = *plist, prev = Qnil; - !NILP (tail); + if (EQ (XCAR (tail), property)) + { + *plist = XCDR (XCDR (tail)); + return 1; + } + + for (tail = XCDR (tail); !NILP (XCDR (tail)); tail = XCDR (XCDR (tail))) { - if (EQ (XCAR (tail), property)) + struct Lisp_Cons *c = XCONS (tail); + if (EQ (XCAR (c->cdr), property)) { - if (NILP (prev)) - *plist = XCDR (XCDR (tail)); - else - XCDR (XCDR (prev)) = XCDR (XCDR (tail)); + c->cdr = XCDR (XCDR (c->cdr)); return 1; } - else - prev = tail; } return 0; @@ -2077,6 +2174,8 @@ static Lisp_Object bad_bad_turtle (Lisp_Object *plist, Lisp_Object *badplace, Error_behavior errb) { if (ERRB_EQ (errb, ERROR_ME)) + /* #### Eek, this will probably result in another error + when PLIST is printed out */ return Fsignal (Qcircular_property_list, list1 (*plist)); else { @@ -2109,7 +2208,7 @@ advance_plist_pointers (Lisp_Object *plist, Lisp_Object *tortsave = *tortoise; /* Note that our "fixing" may be more brutal than necessary, - but it's the user's own problem, not ours, if they went in and + but it's the user's own problem, not ours. if they went in and manually fucked up a plist. */ for (i = 0; i < 2; i++) @@ -2276,54 +2375,52 @@ external_remprop (Lisp_Object *plist, Lisp_Object property, DEFUN ("plist-get", Fplist_get, 2, 3, 0, /* Extract a value from a property list. PLIST is a property list, which is a list of the form -\(PROPERTY1 VALUE1 PROPERTY2 VALUE2...). -PROPERTY is usually a symbol. -This function returns the value corresponding to the PROPERTY, -or DEFAULT if PROPERTY is not one of the properties on the list. +\(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value +corresponding to the given PROP, or DEFAULT if PROP is not +one of the properties on the list. */ - (plist, property, default_)) + (plist, prop, default_)) { - Lisp_Object value = external_plist_get (&plist, property, 0, ERROR_ME); - return UNBOUNDP (value) ? default_ : value; + Lisp_Object val = external_plist_get (&plist, prop, 0, ERROR_ME); + if (UNBOUNDP (val)) + return default_; + return val; } DEFUN ("plist-put", Fplist_put, 3, 3, 0, /* -Change value in PLIST of PROPERTY to VALUE. -PLIST is a property list, which is a list of the form -\(PROPERTY1 VALUE1 PROPERTY2 VALUE2 ...). -PROPERTY is usually a symbol and VALUE is any object. -If PROPERTY is already a property on the list, its value is set to VALUE, -otherwise the new PROPERTY VALUE pair is added. -The new plist is returned; use `(setq x (plist-put x property value))' -to be sure to use the new value. PLIST is modified by side effect. +Change value in PLIST of PROP to VAL. +PLIST is a property list, which is a list of the form \(PROP1 VALUE1 +PROP2 VALUE2 ...). PROP is usually a symbol and VAL is any object. +If PROP is already a property on the list, its value is set to VAL, +otherwise the new PROP VAL pair is added. The new plist is returned; +use `(setq x (plist-put x prop val))' to be sure to use the new value. +The PLIST is modified by side effects. */ - (plist, property, value)) + (plist, prop, val)) { - external_plist_put (&plist, property, value, 0, ERROR_ME); + external_plist_put (&plist, prop, val, 0, ERROR_ME); return plist; } DEFUN ("plist-remprop", Fplist_remprop, 2, 2, 0, /* -Remove from PLIST the property PROPERTY and its value. -PLIST is a property list, which is a list of the form -\(PROPERTY1 VALUE1 PROPERTY2 VALUE2 ...). -PROPERTY is usually a symbol. -The new plist is returned; use `(setq x (plist-remprop x property))' -to be sure to use the new value. PLIST is modified by side effect. +Remove from PLIST the property PROP and its value. +PLIST is a property list, which is a list of the form \(PROP1 VALUE1 +PROP2 VALUE2 ...). PROP is usually a symbol. The new plist is +returned; use `(setq x (plist-remprop x prop val))' to be sure to use +the new value. The PLIST is modified by side effects. */ - (plist, property)) + (plist, prop)) { - external_remprop (&plist, property, 0, ERROR_ME); + external_remprop (&plist, prop, 0, ERROR_ME); return plist; } DEFUN ("plist-member", Fplist_member, 2, 2, 0, /* -Return t if PROPERTY has a value specified in PLIST. +Return t if PROP has a value specified in PLIST. */ - (plist, property)) + (plist, prop)) { - Lisp_Object value = Fplist_get (plist, property, Qunbound); - return UNBOUNDP (value) ? Qnil : Qt; + return UNBOUNDP (Fplist_get (plist, prop, Qunbound)) ? Qnil : Qt; } DEFUN ("check-valid-plist", Fcheck_valid_plist, 1, 1, 0, /* @@ -2354,7 +2451,8 @@ This means that it's a malformed or circular plist. 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)) { @@ -2411,8 +2509,7 @@ The new plist is returned. If NIL-MEANS-NOT-PRESENT is given, the /* external_remprop returns 1 if it removed any property. We have to loop till it didn't remove anything, in case the property occurs many times. */ - while (external_remprop (&XCDR (next), prop, 0, ERROR_ME)) - DO_NOTHING; + while (external_remprop (&XCDR (next), prop, 0, ERROR_ME)); plist = Fcdr (next); } @@ -2421,60 +2518,60 @@ The new plist is returned. If NIL-MEANS-NOT-PRESENT is given, the DEFUN ("lax-plist-get", Flax_plist_get, 2, 3, 0, /* Extract a value from a lax property list. -LAX-PLIST is a lax property list, which is a list of the form -\(PROPERTY1 VALUE1 PROPERTY2 VALUE2...), where comparisons between -properties is done using `equal' instead of `eq'. -PROPERTY is usually a symbol. -This function returns the value corresponding to PROPERTY, -or DEFAULT if PROPERTY is not one of the properties on the list. + +LAX-PLIST is a lax property list, which is a list of the form \(PROP1 +VALUE1 PROP2 VALUE2...), where comparions between properties is done +using `equal' instead of `eq'. This function returns the value +corresponding to the given PROP, or DEFAULT if PROP is not one of the +properties on the list. */ - (lax_plist, property, default_)) + (lax_plist, prop, default_)) { - Lisp_Object value = external_plist_get (&lax_plist, property, 1, ERROR_ME); - return UNBOUNDP (value) ? default_ : value; + Lisp_Object val = external_plist_get (&lax_plist, prop, 1, ERROR_ME); + if (UNBOUNDP (val)) + return default_; + return val; } DEFUN ("lax-plist-put", Flax_plist_put, 3, 3, 0, /* -Change value in LAX-PLIST of PROPERTY to VALUE. -LAX-PLIST is a lax property list, which is a list of the form -\(PROPERTY1 VALUE1 PROPERTY2 VALUE2...), where comparisons between -properties is done using `equal' instead of `eq'. -PROPERTY is usually a symbol and VALUE is any object. -If PROPERTY is already a property on the list, its value is set to -VALUE, otherwise the new PROPERTY VALUE pair is added. -The new plist is returned; use `(setq x (lax-plist-put x property value))' -to be sure to use the new value. LAX-PLIST is modified by side effect. -*/ - (lax_plist, property, value)) -{ - external_plist_put (&lax_plist, property, value, 1, ERROR_ME); +Change value in LAX-PLIST of PROP to VAL. +LAX-PLIST is a lax property list, which is a list of the form \(PROP1 +VALUE1 PROP2 VALUE2...), where comparions between properties is done +using `equal' instead of `eq'. PROP is usually a symbol and VAL is +any object. If PROP is already a property on the list, its value is +set to VAL, otherwise the new PROP VAL pair is added. The new plist +is returned; use `(setq x (lax-plist-put x prop val))' to be sure to +use the new value. The LAX-PLIST is modified by side effects. +*/ + (lax_plist, prop, val)) +{ + external_plist_put (&lax_plist, prop, val, 1, ERROR_ME); return lax_plist; } DEFUN ("lax-plist-remprop", Flax_plist_remprop, 2, 2, 0, /* -Remove from LAX-PLIST the property PROPERTY and its value. -LAX-PLIST is a lax property list, which is a list of the form -\(PROPERTY1 VALUE1 PROPERTY2 VALUE2...), where comparisons between -properties is done using `equal' instead of `eq'. -PROPERTY is usually a symbol. -The new plist is returned; use `(setq x (lax-plist-remprop x property))' -to be sure to use the new value. LAX-PLIST is modified by side effect. +Remove from LAX-PLIST the property PROP and its value. +LAX-PLIST is a lax property list, which is a list of the form \(PROP1 +VALUE1 PROP2 VALUE2...), where comparions between properties is done +using `equal' instead of `eq'. PROP is usually a symbol. The new +plist is returned; use `(setq x (lax-plist-remprop x prop val))' to be +sure to use the new value. The LAX-PLIST is modified by side effects. */ - (lax_plist, property)) + (lax_plist, prop)) { - external_remprop (&lax_plist, property, 1, ERROR_ME); + external_remprop (&lax_plist, prop, 1, ERROR_ME); return lax_plist; } DEFUN ("lax-plist-member", Flax_plist_member, 2, 2, 0, /* -Return t if PROPERTY has a value specified in LAX-PLIST. -LAX-PLIST is a lax property list, which is a list of the form -\(PROPERTY1 VALUE1 PROPERTY2 VALUE2...), where comparisons between -properties is done using `equal' instead of `eq'. +Return t if PROP has a value specified in LAX-PLIST. +LAX-PLIST is a lax property list, which is a list of the form \(PROP1 +VALUE1 PROP2 VALUE2...), where comparions between properties is done +using `equal' instead of `eq'. */ - (lax_plist, property)) + (lax_plist, prop)) { - return UNBOUNDP (Flax_plist_get (lax_plist, property, Qunbound)) ? Qnil : Qt; + return UNBOUNDP (Flax_plist_get (lax_plist, prop, Qunbound)) ? Qnil : Qt; } DEFUN ("canonicalize-lax-plist", Fcanonicalize_lax_plist, 1, 2, 0, /* @@ -2512,8 +2609,7 @@ The new plist is returned. If NIL-MEANS-NOT-PRESENT is given, the /* external_remprop returns 1 if it removed any property. We have to loop till it didn't remove anything, in case the property occurs many times. */ - while (external_remprop (&XCDR (next), prop, 1, ERROR_ME)) - DO_NOTHING; + while (external_remprop (&XCDR (next), prop, 1, ERROR_ME)); lax_plist = Fcdr (next); } @@ -2553,87 +2649,230 @@ See also `alist-to-plist'. 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_)) { + Lisp_Object val; + /* 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)) + val = symbol_getprop (object, propname, default_); + else if (STRINGP (object)) + val = string_getprop (XSTRING (object), propname, default_); + else if (LRECORDP (object)) + { + CONST struct lrecord_implementation + *imp = XRECORD_LHEADER_IMPLEMENTATION (object); + if (imp->getprop) + { + val = (imp->getprop) (object, propname); + if (UNBOUNDP (val)) + val = default_; + } + else + goto noprops; + } else - signal_simple_error ("Object type has no properties", object); + { + noprops: + signal_simple_error ("Object type has no properties", object); + } - return UNBOUNDP (val) ? default_ : val; + return val; } 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_LISP_WRITEABLE (object); + CHECK_SYMBOL (propname); + CHECK_IMPURE (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_LISP_WRITEABLE (object); + CHECK_SYMBOL (propname); + CHECK_IMPURE (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); + { + noprops: + signal_simple_error ("Object type has no removable properties", object); + } - return ret ? Qt : Qnil; + 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); @@ -2642,25 +2881,63 @@ this may or may not have the desired effects. Use `put' instead. int -internal_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +internal_equal (Lisp_Object o1, Lisp_Object o2, int depth) { if (depth > 200) error ("Stack overflow in equal"); +#ifndef LRECORD_CONS + do_cdr: +#endif QUIT; - if (EQ_WITH_EBOLA_NOTICE (obj1, obj2)) + if (EQ_WITH_EBOLA_NOTICE (o1, o2)) return 1; /* Note that (equal 20 20.0) should be nil */ - if (XTYPE (obj1) != XTYPE (obj2)) + else if (XTYPE (o1) != XTYPE (o2)) return 0; - if (LRECORDP (obj1)) +#ifndef LRECORD_CONS + else if (CONSP (o1)) { - const struct lrecord_implementation - *imp1 = XRECORD_LHEADER_IMPLEMENTATION (obj1), - *imp2 = XRECORD_LHEADER_IMPLEMENTATION (obj2); - - return (imp1 == imp2) && + if (!internal_equal (XCAR (o1), XCAR (o2), depth + 1)) + return 0; + o1 = XCDR (o1); + o2 = XCDR (o2); + goto do_cdr; + } +#endif +#ifndef LRECORD_VECTOR + else if (VECTORP (o1)) + { + Lisp_Object *v1 = XVECTOR_DATA (o1); + Lisp_Object *v2 = XVECTOR_DATA (o2); + int len = XVECTOR_LENGTH (o1); + if (len != XVECTOR_LENGTH (o2)) + return 0; + while (len--) + if (!internal_equal (*v1++, *v2++, depth + 1)) + return 0; + return 1; + } +#endif +#ifndef LRECORD_STRING + else if (STRINGP (o1)) + { + Bytecount len; + return (((len = XSTRING_LENGTH (o1)) == XSTRING_LENGTH (o2)) && + !memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), len)); + } +#endif + else if (LRECORDP (o1)) + { + CONST struct lrecord_implementation + *imp1 = XRECORD_LHEADER_IMPLEMENTATION (o1), + *imp2 = XRECORD_LHEADER_IMPLEMENTATION (o2); + if (imp1 != imp2) + return 0; + else if (imp1->equal == 0) /* EQ-ness of the objects was noticed above */ - (imp1->equal && (imp1->equal) (obj1, obj2, depth)); + return 0; + else + return (imp1->equal) (o1, o2, depth); } return 0; @@ -2672,18 +2949,72 @@ internal_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) but that seems unlikely. */ static int -internal_old_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +internal_old_equal (Lisp_Object o1, Lisp_Object o2, int depth) { if (depth > 200) error ("Stack overflow in equal"); +#ifndef LRECORD_CONS + do_cdr: +#endif QUIT; - if (HACKEQ_UNSAFE (obj1, obj2)) + if (HACKEQ_UNSAFE (o1, o2)) return 1; /* Note that (equal 20 20.0) should be nil */ - if (XTYPE (obj1) != XTYPE (obj2)) + else if (XTYPE (o1) != XTYPE (o2)) return 0; +#ifndef LRECORD_CONS + else if (CONSP (o1)) + { + if (!internal_old_equal (XCAR (o1), XCAR (o2), depth + 1)) + return 0; + o1 = XCDR (o1); + o2 = XCDR (o2); + goto do_cdr; + } +#endif +#ifndef LRECORD_VECTOR + else if (VECTORP (o1)) + { + int indice; + int len = XVECTOR_LENGTH (o1); + if (len != XVECTOR_LENGTH (o2)) + return 0; + for (indice = 0; indice < len; indice++) + { + if (!internal_old_equal (XVECTOR_DATA (o1) [indice], + XVECTOR_DATA (o2) [indice], + depth + 1)) + return 0; + } + return 1; + } +#endif +#ifndef LRECORD_STRING + else if (STRINGP (o1)) + { + Bytecount len = XSTRING_LENGTH (o1); + if (len != XSTRING_LENGTH (o2)) + return 0; + if (memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), len)) + return 0; + return 1; + } +#endif + else if (LRECORDP (o1)) + { + CONST struct lrecord_implementation + *imp1 = XRECORD_LHEADER_IMPLEMENTATION (o1), + *imp2 = XRECORD_LHEADER_IMPLEMENTATION (o2); + if (imp1 != imp2) + return 0; + else if (imp1->equal == 0) + /* EQ-ness of the objects was noticed above */ + return 0; + else + return (imp1->equal) (o1, o2, depth); + } - return internal_equal (obj1, obj2, depth); + return 0; } DEFUN ("equal", Fequal, 2, 2, 0, /* @@ -2693,9 +3024,9 @@ Conses are compared by comparing the cars and the cdrs. Vectors and strings are compared element by element. Numbers are compared by value. Symbols must match exactly. */ - (object1, object2)) + (o1, o2)) { - return internal_equal (object1, object2, 0) ? Qt : Qnil; + return internal_equal (o1, o2, 0) ? Qt : Qnil; } DEFUN ("old-equal", Fold_equal, 2, 2, 0, /* @@ -2707,14 +3038,14 @@ this is known as the "char-int confoundance disease." See `eq' and This function is provided only for byte-code compatibility with v19. Do not use it. */ - (object1, object2)) + (o1, o2)) { - return internal_old_equal (object1, object2, 0) ? Qt : Qnil; + return internal_old_equal (o1, o2, 0) ? Qt : Qnil; } 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)) @@ -2722,46 +3053,33 @@ ARRAY is a vector, bit vector, or string. 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'; - + CHECK_IMPURE (array); + charval = XCHAR (item); + for (i = 0; i < len; i++) + set_string_char (s, i, charval); bump_string_modiff (array); } else if (VECTORP (array)) { Lisp_Object *p = XVECTOR_DATA (array); - size_t len = XVECTOR_LENGTH (array); - CHECK_LISP_WRITEABLE (array); + int len = XVECTOR_LENGTH (array); + CHECK_IMPURE (array); while (len--) *p++ = item; } else if (BIT_VECTORP (array)) { - Lisp_Bit_Vector *v = XBIT_VECTOR (array); - size_t len = bit_vector_length (v); + struct Lisp_Bit_Vector *v = XBIT_VECTOR (array); + int len = bit_vector_length (v); int bit; CHECK_BIT (item); + CHECK_IMPURE (array); bit = XINT (item); - CHECK_LISP_WRITEABLE (array); while (len--) set_bit_vector_bit (v, len, bit); } @@ -2774,53 +3092,12 @@ ARRAY is a vector, bit vector, or string. } Lisp_Object -nconc2 (Lisp_Object arg1, Lisp_Object arg2) +nconc2 (Lisp_Object s1, Lisp_Object s2) { Lisp_Object args[2]; - struct gcpro gcpro1; - args[0] = arg1; - args[1] = arg2; - - GCPRO1 (args[0]); - gcpro1.nvars = 2; - - RETURN_UNGCPRO (bytecode_nconc2 (args)); -} - -Lisp_Object -bytecode_nconc2 (Lisp_Object *args) -{ - retry: - - if (CONSP (args[0])) - { - /* (setcdr (last args[0]) args[1]) */ - Lisp_Object tortoise, hare; - size_t count; - - for (hare = tortoise = args[0], count = 0; - CONSP (XCDR (hare)); - hare = XCDR (hare), count++) - { - if (count < CIRCULAR_LIST_SUSPICION_LENGTH) continue; - - if (count & 1) - tortoise = XCDR (tortoise); - if (EQ (hare, tortoise)) - signal_circular_list_error (args[0]); - } - XCDR (hare) = args[1]; - return args[0]; - } - else if (NILP (args[0])) - { - return args[1]; - } - else - { - args[0] = wrong_type_argument (args[0], Qlistp); - goto retry; - } + args[0] = s1; + args[1] = s2; + return Fnconc (2, args); } DEFUN ("nconc", Fnconc, 0, MANY, 0, /* @@ -2848,37 +3125,25 @@ changing the value of `foo'. while (argnum < nargs) { - Lisp_Object val; - retry: - val = args[argnum]; + Lisp_Object val = args[argnum]; if (CONSP (val)) { - /* `val' is the first cons, which will be our return value. */ - /* `last_cons' will be the cons cell to mutate. */ - Lisp_Object last_cons = val; - Lisp_Object tortoise = val; + /* Found the first cons, which will be our return value. */ + Lisp_Object last = val; for (argnum++; argnum < nargs; argnum++) { Lisp_Object next = args[argnum]; - retry_next: + redo: if (CONSP (next) || argnum == nargs -1) { /* (setcdr (last val) next) */ - size_t count; - - for (count = 0; - CONSP (XCDR (last_cons)); - last_cons = XCDR (last_cons), count++) + while (CONSP (XCDR (last))) { - if (count < CIRCULAR_LIST_SUSPICION_LENGTH) continue; - - if (count & 1) - tortoise = XCDR (tortoise); - if (EQ (last_cons, tortoise)) - signal_circular_list_error (args[argnum-1]); + last = XCDR (last); + QUIT; } - XCDR (last_cons) = next; + XCDR (last) = next; } else if (NILP (next)) { @@ -2886,8 +3151,8 @@ changing the value of `foo'. } else { - next = wrong_type_argument (Qlistp, next); - goto retry_next; + next = wrong_type_argument (next, Qlistp); + goto redo; } } RETURN_UNGCPRO (val); @@ -2897,268 +3162,169 @@ changing the value of `foo'. else if (argnum == nargs - 1) /* last arg? */ RETURN_UNGCPRO (val); else - { - args[argnum] = wrong_type_argument (Qlistp, val); - goto retry; - } + args[argnum] = wrong_type_argument (val, Qlistp); } RETURN_UNGCPRO (Qnil); /* No non-nil args provided. */ } -/* 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. */ + 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 (int leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) { + Lisp_Object tail; + Lisp_Object dummy = Qnil; + int i; + struct gcpro gcpro1, gcpro2, gcpro3; Lisp_Object result; - Lisp_Object args[2]; - struct gcpro gcpro1; + + GCPRO3 (dummy, fn, seq); if (vals) { - GCPRO1 (vals[0]); - gcpro1.nvars = 0; + /* Don't let vals contain any garbage when GC happens. */ + for (i = 0; i < leni; i++) + vals[i] = Qnil; + gcpro1.var = vals; + gcpro1.nvars = leni; } - args[0] = function; + /* We need not explicitly protect `tail' because it is used only on + lists, and 1) lists are not relocated and 2) the list is marked + via `seq' so will not be freed */ - if (LISTP (sequence)) + if (VECTORP (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_NO_DECLARE and GCPRO the tail. */ - - if (vals) - { - Lisp_Object *val = vals; - size_t i; - - 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 + for (i = 0; i < leni; i++) { - Lisp_Object elt, tail; - EMACS_INT len_unused; - struct gcpro ngcpro1; - - NGCPRO1 (tail); - - { - EXTERNAL_LIST_LOOP_4_NO_DECLARE (elt, sequence, tail, len_unused) - { - args[1] = elt; - Ffuncall (2, args); - } - } - - NUNGCPRO; + dummy = XVECTOR_DATA (seq)[i]; + result = call1 (fn, dummy); + if (vals) + vals[i] = result; } } - else if (VECTORP (sequence)) + else if (BIT_VECTORP (seq)) { - Lisp_Object *objs = XVECTOR_DATA (sequence); - size_t i; + struct Lisp_Bit_Vector *v = XBIT_VECTOR (seq); for (i = 0; i < leni; i++) { - args[1] = *objs++; - result = Ffuncall (2, args); - if (vals) vals[gcpro1.nvars++] = result; + XSETINT (dummy, bit_vector_bit (v, i)); + result = call1 (fn, dummy); + if (vals) + vals[i] = 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) + for (i = 0; i < leni; i++) { - args[1] = make_char (charptr_emchar (p)); - INC_CHARPTR (p); - result = Ffuncall (2, args); - if (vals) vals[gcpro1.nvars++] = result; + result = call1 (fn, make_char (string_char (XSTRING (seq), i))); + if (vals) + vals[i] = result; } } - else if (BIT_VECTORP (sequence)) + else /* Must be a list, since Flength did not get an error */ { - Lisp_Bit_Vector *v = XBIT_VECTOR (sequence); - size_t i; + tail = seq; for (i = 0; i < leni; i++) { - args[1] = make_int (bit_vector_bit (v, i)); - result = Ffuncall (2, args); - if (vals) vals[gcpro1.nvars++] = result; + result = call1 (fn, Fcar (tail)); + if (vals) + vals[i] = result; + tail = Fcdr (tail); } } - else - abort (); /* unreachable, since Flength (sequence) did not get an error */ - if (vals) - UNGCPRO; + UNGCPRO; } DEFUN ("mapconcat", Fmapconcat, 3, 3, 0, /* -Apply FUNCTION to each element of SEQUENCE, and concat the results to a string. -Between each pair of results, insert SEPARATOR. - -Each result, and SEPARATOR, should be strings. Thus, using " " as SEPARATOR -results in spaces between the values returned by FUNCTION. SEQUENCE itself -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)) { - EMACS_INT len = XINT (Flength (sequence)); + int len = XINT (Flength (seq)); Lisp_Object *args; - EMACS_INT i; - EMACS_INT nargs = len + len - 1; + 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)); + int 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)); + int len = XINT (Flength (seq)); + /* Ideally, this should call make_vector_internal, because we don't + need initialization. */ 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; + mapcar1 (XINT (Flength (seq)), 0, fn, seq); - return old; + return seq; } /* #### this function doesn't belong in this file! */ -#ifdef HAVE_GETLOADAVG -#ifdef HAVE_SYS_LOADAVG_H -#include <sys/loadavg.h> -#endif -#else -int getloadavg (double loadavg[], int nelem); /* Defined in getloadavg.c */ -#endif - DEFUN ("load-average", Fload_average, 0, 1, 0, /* Return list of 1 minute, 5 minute and 15 minute load averages. Each of the three load averages is multiplied by 100, @@ -3228,13 +3394,10 @@ Examples: (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)) { @@ -3330,7 +3493,7 @@ If FEATURE is not a member of the list `features', then the feature is not loaded; so load the file FILENAME. If FILENAME is omitted, the printname of FEATURE is used as the file name. */ - (feature, filename)) + (feature, file_name)) { Lisp_Object tem; CHECK_SYMBOL (feature); @@ -3346,7 +3509,7 @@ If FILENAME is omitted, the printname of FEATURE is used as the file name. record_unwind_protect (un_autoload, Vautoload_queue); Vautoload_queue = Qt; - call4 (Qload, NILP (filename) ? Fsymbol_name (feature) : filename, + call4 (Qload, NILP (file_name) ? Fsymbol_name (feature) : file_name, Qnil, Qt, Qnil); tem = Fmemq (feature, Vfeatures); @@ -3359,415 +3522,13 @@ If FILENAME is omitted, the printname of FEATURE is used as the file name. return unbind_to (speccount, feature); } } - -/* 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 - -#define IS_ASCII(Character) \ - ((Character) < 128) -#define IS_BASE64(Character) \ - (IS_ASCII (Character) && base64_char_to_value[Character] >= 0) - -/* Table of characters coding the 64 values. */ -static char base64_value_to_char[64] = -{ - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', /* 0- 9 */ - 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', /* 10-19 */ - 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', /* 20-29 */ - 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', /* 30-39 */ - 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', /* 40-49 */ - 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', /* 50-59 */ - '8', '9', '+', '/' /* 60-63 */ -}; - -/* Table of base64 values for first 128 characters. */ -static short base64_char_to_value[128] = -{ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0- 9 */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 10- 19 */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 20- 29 */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 30- 39 */ - -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, /* 40- 49 */ - 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, /* 50- 59 */ - -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, /* 60- 69 */ - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /* 70- 79 */ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, /* 80- 89 */ - 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, /* 90- 99 */ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, /* 100-109 */ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, /* 110-119 */ - 49, 50, 51, -1, -1, -1, -1, -1 /* 120-127 */ -}; - -/* The following diagram shows the logical steps by which three octets - get transformed into four base64 characters. - - .--------. .--------. .--------. - |aaaaaabb| |bbbbcccc| |ccdddddd| - `--------' `--------' `--------' - 6 2 4 4 2 6 - .--------+--------+--------+--------. - |00aaaaaa|00bbbbbb|00cccccc|00dddddd| - `--------+--------+--------+--------' - - .--------+--------+--------+--------. - |AAAAAAAA|BBBBBBBB|CCCCCCCC|DDDDDDDD| - `--------+--------+--------+--------' - - The octets are divided into 6 bit chunks, which are then encoded into - base64 characters. */ - -#define ADVANCE_INPUT(c, stream) \ - ((ec = Lstream_get_emchar (stream)) == -1 ? 0 : \ - ((ec > 255) ? \ - (signal_simple_error ("Non-ascii character in base64 input", \ - make_char (ec)), 0) \ - : (c = (Bufbyte)ec), 1)) - -static Bytind -base64_encode_1 (Lstream *istream, Bufbyte *to, int line_break) -{ - EMACS_INT counter = 0; - Bufbyte *e = to; - Emchar ec; - unsigned int value; - - while (1) - { - Bufbyte c; - if (!ADVANCE_INPUT (c, istream)) - break; - - /* Wrap line every 76 characters. */ - if (line_break) - { - if (counter < MIME_LINE_LENGTH / 4) - counter++; - else - { - *e++ = '\n'; - counter = 1; - } - } - - /* Process first byte of a triplet. */ - *e++ = base64_value_to_char[0x3f & c >> 2]; - value = (0x03 & c) << 4; - - /* Process second byte of a triplet. */ - if (!ADVANCE_INPUT (c, istream)) - { - *e++ = base64_value_to_char[value]; - *e++ = '='; - *e++ = '='; - break; - } - - *e++ = base64_value_to_char[value | (0x0f & c >> 4)]; - value = (0x0f & c) << 2; - - /* Process third byte of a triplet. */ - if (!ADVANCE_INPUT (c, istream)) - { - *e++ = base64_value_to_char[value]; - *e++ = '='; - break; - } - - *e++ = base64_value_to_char[value | (0x03 & c >> 6)]; - *e++ = base64_value_to_char[0x3f & c]; - } - - return e - to; -} -#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 { \ - pos += set_charptr_emchar (pos, (Emchar)((unsigned char)(val))); \ - ++ccnt; \ -} while (0) - -static Bytind -base64_decode_1 (Lstream *istream, Bufbyte *to, Charcount *ccptr) -{ - Charcount ccnt = 0; - Bufbyte *e = to; - EMACS_INT streampos = 0; - - while (1) - { - Emchar ec; - unsigned long value; - - /* 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; - - /* 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); - - /* Process third byte of a quadruplet. */ - ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); - if (ec < 0) - error ("Premature EOF while decoding base64"); - - if (ec == '=') - { - 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)); - continue; - } - - value |= base64_char_to_value[ec] << 6; - STORE_BYTE (e, 0xff & value >> 8, ccnt); - - /* Process fourth byte of a quadruplet. */ - ADVANCE_INPUT_IGNORE_NONBASE64 (ec, istream, streampos); - if (ec < 0) - error ("Premature EOF while decoding base64"); - if (ec == '=') - continue; - - value |= base64_char_to_value[ec]; - STORE_BYTE (e, 0xff & value, ccnt); - } - - *ccptr = ccnt; - return e - to; -} -#undef ADVANCE_INPUT -#undef ADVANCE_INPUT_IGNORE_NONBASE64 -#undef STORE_BYTE - -static Lisp_Object -free_malloced_ptr (Lisp_Object unwind_obj) -{ - void *ptr = (void *)get_opaque_ptr (unwind_obj); - xfree (ptr); - free_opaque_ptr (unwind_obj); - return Qnil; -} - -/* Don't use alloca for regions larger than this, lest we overflow - the stack. */ -#define MAX_ALLOCA 65536 - -/* We need to setup proper unwinding, because there is a number of - ways these functions can blow up, and we don't want to have memory - leaks in those cases. */ -#define XMALLOC_OR_ALLOCA(ptr, len, type) do { \ - size_t XOA_len = (len); \ - if (XOA_len > MAX_ALLOCA) \ - { \ - ptr = xnew_array (type, XOA_len); \ - record_unwind_protect (free_malloced_ptr, \ - make_opaque_ptr ((void *)ptr)); \ - } \ - else \ - ptr = alloca_array (type, XOA_len); \ -} while (0) - -#define XMALLOC_UNBIND(ptr, len, speccount) do { \ - if ((len) > MAX_ALLOCA) \ - unbind_to (speccount, Qnil); \ -} while (0) - -DEFUN ("base64-encode-region", Fbase64_encode_region, 2, 3, "r", /* -Base64-encode the region between START and END. -Return the length of the encoded text. -Optional third argument NO-LINE-BREAK means do not break long lines -into shorter lines. -*/ - (start, end, no_line_break)) -{ - Bufbyte *encoded; - Bytind encoded_length; - Charcount allength, length; - struct buffer *buf = current_buffer; - Bufpos begv, zv, old_pt = BUF_PT (buf); - Lisp_Object input; - int speccount = specpdl_depth(); - - get_buffer_range_char (buf, start, end, &begv, &zv, 0); - barf_if_buffer_read_only (buf, begv, zv); - - /* We need to allocate enough room for encoding the text. - We need 33 1/3% more space, plus a newline every 76 - characters, and then we round up. */ - length = zv - begv; - allength = length + length/3 + 1; - allength += allength / MIME_LINE_LENGTH + 1 + 6; - - input = make_lisp_buffer_input_stream (buf, begv, zv, 0); - /* We needn't multiply allength with MAX_EMCHAR_LEN because all the - base64 characters will be single-byte. */ - XMALLOC_OR_ALLOCA (encoded, allength, Bufbyte); - encoded_length = base64_encode_1 (XLSTREAM (input), encoded, - NILP (no_line_break)); - if (encoded_length > allength) - abort (); - Lstream_delete (XLSTREAM (input)); - - /* Now we have encoded the region, so we insert the new contents - and delete the old. (Insert first in order to preserve markers.) */ - buffer_insert_raw_string_1 (buf, begv, encoded, encoded_length, 0); - 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. */ - if (old_pt >= begv && old_pt < zv) - BUF_SET_PT (buf, begv); - - /* We return the length of the encoded text. */ - return make_int (encoded_length); -} - -DEFUN ("base64-encode-string", Fbase64_encode_string, 1, 2, 0, /* -Base64 encode STRING and return the result. -Optional argument NO-LINE-BREAK means do not break long lines -into shorter lines. -*/ - (string, no_line_break)) -{ - Charcount allength, length; - Bytind encoded_length; - Bufbyte *encoded; - Lisp_Object input, result; - int speccount = specpdl_depth(); - - CHECK_STRING (string); - length = XSTRING_CHAR_LENGTH (string); - allength = length + length/3 + 1; - allength += allength / MIME_LINE_LENGTH + 1 + 6; - - input = make_lisp_string_input_stream (string, 0, -1); - XMALLOC_OR_ALLOCA (encoded, allength, Bufbyte); - encoded_length = base64_encode_1 (XLSTREAM (input), encoded, - NILP (no_line_break)); - if (encoded_length > allength) - abort (); - Lstream_delete (XLSTREAM (input)); - result = make_string (encoded, encoded_length); - XMALLOC_UNBIND (encoded, allength, speccount); - return result; -} - -DEFUN ("base64-decode-region", Fbase64_decode_region, 2, 2, "r", /* -Base64-decode the region between START 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. -*/ - (start, end)) -{ - struct buffer *buf = current_buffer; - Bufpos begv, zv, old_pt = BUF_PT (buf); - Bufbyte *decoded; - Bytind decoded_length; - Charcount length, cc_decoded_length; - Lisp_Object input; - int speccount = specpdl_depth(); - - get_buffer_range_char (buf, start, end, &begv, &zv, 0); - barf_if_buffer_read_only (buf, begv, zv); - - length = zv - begv; - - input = make_lisp_buffer_input_stream (buf, begv, zv, 0); - /* We need to allocate enough room for decoding the text. */ - XMALLOC_OR_ALLOCA (decoded, length * MAX_EMCHAR_LEN, Bufbyte); - decoded_length = base64_decode_1 (XLSTREAM (input), decoded, &cc_decoded_length); - if (decoded_length > length * MAX_EMCHAR_LEN) - abort (); - Lstream_delete (XLSTREAM (input)); - - /* 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); - buffer_insert_raw_string_1 (buf, begv, decoded, decoded_length, 0); - XMALLOC_UNBIND (decoded, length * MAX_EMCHAR_LEN, speccount); - 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. */ - if (old_pt >= begv && old_pt < zv) - BUF_SET_PT (buf, begv); - - return make_int (cc_decoded_length); -} - -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)) -{ - Bufbyte *decoded; - Bytind decoded_length; - Charcount length, cc_decoded_length; - Lisp_Object input, result; - int speccount = specpdl_depth(); - - CHECK_STRING (string); - - length = XSTRING_CHAR_LENGTH (string); - /* We need to allocate enough room for decoding the text. */ - XMALLOC_OR_ALLOCA (decoded, length * MAX_EMCHAR_LEN, Bufbyte); - - input = make_lisp_string_input_stream (string, 0, -1); - decoded_length = base64_decode_1 (XLSTREAM (input), decoded, - &cc_decoded_length); - if (decoded_length > length * MAX_EMCHAR_LEN) - abort (); - Lstream_delete (XLSTREAM (input)); - - result = make_string (decoded, decoded_length); - XMALLOC_UNBIND (decoded, length * MAX_EMCHAR_LEN, speccount); - return result; -} Lisp_Object Qyes_or_no_p; 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"); @@ -3783,7 +3544,6 @@ syms_of_fns (void) DEFSUBR (Fconcat); DEFSUBR (Fvconcat); DEFSUBR (Fbvconcat); - DEFSUBR (Fcopy_list); DEFSUBR (Fcopy_sequence); DEFSUBR (Fcopy_alist); DEFSUBR (Fcopy_tree); @@ -3792,9 +3552,6 @@ syms_of_fns (void) DEFSUBR (Fnthcdr); DEFSUBR (Fnth); DEFSUBR (Felt); - DEFSUBR (Flast); - DEFSUBR (Fbutlast); - DEFSUBR (Fnbutlast); DEFSUBR (Fmember); DEFSUBR (Fold_member); DEFSUBR (Fmemq); @@ -3845,17 +3602,12 @@ syms_of_fns (void) DEFSUBR (Fnconc); DEFSUBR (Fmapcar); DEFSUBR (Fmapvector); - DEFSUBR (Fmapc_internal); + DEFSUBR (Fmapc); DEFSUBR (Fmapconcat); - DEFSUBR (Freplace_list); DEFSUBR (Fload_average); DEFSUBR (Ffeaturep); DEFSUBR (Frequire); DEFSUBR (Fprovide); - DEFSUBR (Fbase64_encode_region); - DEFSUBR (Fbase64_encode_string); - DEFSUBR (Fbase64_decode_region); - DEFSUBR (Fbase64_decode_string); } void @@ -3866,6 +3618,4 @@ A list of symbols which are the features of the executing emacs. Used by `featurep' and `require', and altered by `provide'. */ ); Vfeatures = Qnil; - - Fprovide (intern ("base64")); } diff --git a/src/font-lock.c b/src/font-lock.c index 1cfd739..cefa0d5 100644 --- a/src/font-lock.c +++ b/src/font-lock.c @@ -59,9 +59,7 @@ enum syntactic_context context_none, context_string, context_comment, - context_block_comment, - context_generic_comment, - context_generic_string + context_block_comment }; enum block_comment_context @@ -335,8 +333,6 @@ setup_context_cache (struct buffer *buf, Bufpos pt) context_cache.style = comment_style_none; context_cache.scontext = '\000'; context_cache.depth = 0; - /* #### shouldn't this be checking the character's syntax instead of - explicitly testing for backslash characters? */ context_cache.backslash_p = ((pt > 1) && (BUF_FETCH_CHAR (buf, pt - 1) == '\\')); /* Note that the BOL context cache may not be at the beginning @@ -372,8 +368,8 @@ setup_context_cache (struct buffer *buf, Bufpos pt) /* OK, fine. */ return; #if 0 - /* This appears to cause huge slowdowns in files which have no - top-level forms. + /* This appears to cause huge slowdowns in files like + emacsfns.h, which have no top-level forms. In any case, it's not really necessary that we know for sure the top-level form we're in; if we're in a form @@ -391,30 +387,26 @@ setup_context_cache (struct buffer *buf, Bufpos pt) } } -/* GCC 2.95.4 seems to need the casts */ -#define SYNTAX_START_STYLE(c1, c2) \ - ((enum comment_style) \ - (SYNTAX_CODES_MATCH_START_P (c1, c2, SYNTAX_COMMENT_STYLE_A) ? \ +#define SYNTAX_START_STYLE(table, c1, c2) \ + (SYNTAX_STYLES_MATCH_START_P (table, c1, c2, SYNTAX_COMMENT_STYLE_A) ? \ + comment_style_a : \ + SYNTAX_STYLES_MATCH_START_P (table, c1, c2, SYNTAX_COMMENT_STYLE_B) ? \ + comment_style_b : \ + comment_style_none) + +#define SYNTAX_END_STYLE(table, c1, c2) \ + (SYNTAX_STYLES_MATCH_END_P (table, c1, c2, SYNTAX_COMMENT_STYLE_A) ? \ comment_style_a : \ - SYNTAX_CODES_MATCH_START_P (c1, c2, SYNTAX_COMMENT_STYLE_B) ? \ + SYNTAX_STYLES_MATCH_END_P (table, c1, c2, SYNTAX_COMMENT_STYLE_B) ? \ comment_style_b : \ - comment_style_none)) - -#define SYNTAX_END_STYLE(c1, c2) \ - ((enum comment_style) \ - (SYNTAX_CODES_MATCH_END_P (c1, c2, SYNTAX_COMMENT_STYLE_A) ? \ - comment_style_a : \ - SYNTAX_CODES_MATCH_END_P (c1, c2, SYNTAX_COMMENT_STYLE_B) ? \ - comment_style_b : \ - comment_style_none)) - -#define SINGLE_SYNTAX_STYLE(c) \ - ((enum comment_style) \ - (SYNTAX_CODE_MATCHES_1CHAR_P (c, SYNTAX_COMMENT_STYLE_A) ? \ - comment_style_a : \ - SYNTAX_CODE_MATCHES_1CHAR_P (c, SYNTAX_COMMENT_STYLE_B) ? \ - comment_style_b : \ - comment_style_none)) + comment_style_none) + +#define SINGLE_SYNTAX_STYLE(table, c) \ + (SYNTAX_STYLES_MATCH_1CHAR_P (table, c, SYNTAX_COMMENT_STYLE_A) ? \ + comment_style_a : \ + SYNTAX_STYLES_MATCH_1CHAR_P (table, c, SYNTAX_COMMENT_STYLE_B) ? \ + comment_style_b : \ + comment_style_none) /* Set up context_cache for position PT in BUF. */ @@ -422,28 +414,18 @@ static void find_context (struct buffer *buf, Bufpos pt) { /* This function can GC */ -#ifndef emacs - 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; -#endif Emchar prev_c, c; - int prev_syncode, syncode; Bufpos target = pt; setup_context_cache (buf, pt); pt = context_cache.cur_point; - SCS_STATISTICS_SET_FUNCTION (scs_find_context); - SETUP_SYNTAX_CACHE (pt - 1, 1); if (pt > BUF_BEGV (buf)) - { - c = BUF_FETCH_CHAR (buf, pt - 1); - syncode = SYNTAX_CODE_FROM_CACHE (mirrortab, c); - } + c = BUF_FETCH_CHAR (buf, pt - 1); else - { - c = '\n'; /* to get bol_context_cache at point-min */ - syncode = Swhitespace; - } + c = '\n'; /* to get bol_context_cache at point-min */ for (; pt < target; pt++, context_cache.cur_point = pt) { @@ -478,11 +460,8 @@ find_context (struct buffer *buf, Bufpos pt) } } - UPDATE_SYNTAX_CACHE_FORWARD (pt); prev_c = c; - prev_syncode = syncode; c = BUF_FETCH_CHAR (buf, pt); - syncode = SYNTAX_CODE_FROM_CACHE (mirrortab, c); if (prev_c == '\n') bol_context_cache = context_cache; @@ -493,7 +472,7 @@ find_context (struct buffer *buf, Bufpos pt) continue; } - switch (SYNTAX_FROM_CACHE (mirrortab, c)) + switch (SYNTAX (mirrortab, c)) { case Sescape: context_cache.backslash_p = 1; @@ -514,13 +493,13 @@ find_context (struct buffer *buf, Bufpos pt) { context_cache.context = context_comment; context_cache.ccontext = ccontext_none; - context_cache.style = SINGLE_SYNTAX_STYLE (syncode); + context_cache.style = SINGLE_SYNTAX_STYLE (mirrortab, c); if (context_cache.style == comment_style_none) abort (); } break; case Sendcomment: - if (context_cache.style != SINGLE_SYNTAX_STYLE (syncode)) + if (context_cache.style != SINGLE_SYNTAX_STYLE (mirrortab, c)) ; else if (context_cache.context == context_comment) { @@ -547,8 +526,7 @@ find_context (struct buffer *buf, Bufpos pt) } else if (context_cache.context == context_none) { - Lisp_Object stringtermobj = - syntax_match (syntax_cache.current_syntax_table, c); + Lisp_Object stringtermobj = syntax_match (syntaxtab, c); Emchar stringterm; if (CHARP (stringtermobj)) @@ -561,35 +539,6 @@ find_context (struct buffer *buf, Bufpos pt) } break; } - - case Scomment_fence: - { - if (context_cache.context == context_generic_comment) - { - context_cache.context = context_none; - } - else if (context_cache.context == context_none) - { - context_cache.context = context_generic_comment; - context_cache.ccontext = ccontext_none; - } - break; - } - - case Sstring_fence: - { - if (context_cache.context == context_generic_string) - { - context_cache.context = context_none; - } - else if (context_cache.context == context_none) - { - context_cache.context = context_generic_string; - context_cache.ccontext = ccontext_none; - } - break; - } - default: ; } @@ -598,18 +547,18 @@ find_context (struct buffer *buf, Bufpos pt) Now we've got to hack multi-char sequences that start and end block comments. */ - if ((SYNTAX_CODE_COMMENT_BITS (syncode) & + if ((SYNTAX_COMMENT_BITS (mirrortab, c) & SYNTAX_SECOND_CHAR_START) && context_cache.context == context_none && context_cache.ccontext == ccontext_start1 && - SYNTAX_CODES_START_P (prev_syncode, syncode) /* the two chars match */ + SYNTAX_START_P (mirrortab, prev_c, c) /* the two chars match */ ) { context_cache.ccontext = ccontext_start2; - context_cache.style = SYNTAX_START_STYLE (prev_syncode, syncode); + context_cache.style = SYNTAX_START_STYLE (mirrortab, prev_c, c); if (context_cache.style == comment_style_none) abort (); } - else if ((SYNTAX_CODE_COMMENT_BITS (syncode) & + else if ((SYNTAX_COMMENT_BITS (mirrortab, c) & SYNTAX_FIRST_CHAR_START) && context_cache.context == context_none && (context_cache.ccontext == ccontext_none || @@ -618,35 +567,29 @@ find_context (struct buffer *buf, Bufpos pt) context_cache.ccontext = ccontext_start1; context_cache.style = comment_style_none; /* should be this already*/ } - else if ((SYNTAX_CODE_COMMENT_BITS (syncode) & + else if ((SYNTAX_COMMENT_BITS (mirrortab, c) & SYNTAX_SECOND_CHAR_END) && context_cache.context == context_block_comment && context_cache.ccontext == ccontext_end1 && - SYNTAX_CODES_END_P (prev_syncode, syncode) && + SYNTAX_END_P (mirrortab, prev_c, c) && /* the two chars match */ context_cache.style == - SYNTAX_END_STYLE (prev_syncode, syncode) + SYNTAX_END_STYLE (mirrortab, prev_c, c) ) { context_cache.context = context_none; context_cache.ccontext = ccontext_none; context_cache.style = comment_style_none; } - else if ((SYNTAX_CODE_COMMENT_BITS (syncode) & + else if ((SYNTAX_COMMENT_BITS (mirrortab, c) & SYNTAX_FIRST_CHAR_END) && context_cache.context == context_block_comment && -#if 0 - /* #### pre-Matt code had: */ (context_cache.style == - SYNTAX_END_STYLE (c, BUF_FETCH_CHAR (buf, pt+1))) && - /* why do these differ here?! */ -#endif - context_cache.style == SINGLE_SYNTAX_STYLE (syncode) && + SYNTAX_END_STYLE (mirrortab, c, + BUF_FETCH_CHAR (buf, pt+1))) && (context_cache.ccontext == ccontext_start2 || context_cache.ccontext == ccontext_end1)) - /* check end1, to detect a repetition of the first char of a - comment-end sequence. ie, '/xxx foo xxx/' or '/xxx foo x/', - where 'x' = '*' -- mct */ + /* #### is it right to check for end1 here?? */ { if (context_cache.style == comment_style_none) abort (); context_cache.ccontext = ccontext_end1; @@ -685,12 +628,10 @@ context_to_symbol (enum syntactic_context context) { switch (context) { - case context_none: return Qnil; - case context_string: return Qstring; - case context_comment: return Qcomment; - case context_block_comment: return Qblock_comment; - case context_generic_comment: return Qblock_comment; - case context_generic_string: return Qstring; + case context_none: return Qnil; + case context_string: return Qstring; + case context_comment: return Qcomment; + case context_block_comment: return Qblock_comment; default: abort (); return Qnil; /* suppress compiler warning */ } } @@ -781,9 +722,7 @@ WARNING: this may alter match-data. if (this_context == context_block_comment && context_cache.ccontext == ccontext_start2) estart -= 2; - else if (this_context == context_comment - || this_context == context_generic_comment - ) + else if (this_context == context_comment) estart -= 1; edepth = context_cache.depth; @@ -799,9 +738,7 @@ WARNING: this may alter match-data. a part of the comment. */ if ((this_context == context_block_comment || - this_context == context_comment - || this_context == context_generic_comment - ) + this_context == context_comment) && pt < e) eend++; @@ -832,14 +769,8 @@ syms_of_font_lock (void) } 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 --git a/src/frame-gtk.c b/src/frame-gtk.c index 3f3d754..963d259 100644 --- a/src/frame-gtk.c +++ b/src/frame-gtk.c @@ -847,11 +847,9 @@ gtk_create_widgets (struct frame *f, Lisp_Object lisp_window_id, Lisp_Object par } #endif /* HAVE_MENUBARS */ -#ifdef HAVE_GNOME if (GNOME_IS_APP (shell)) gnome_app_set_contents (GNOME_APP (shell), text); else -#endif /* Now comes the drawing area, which should fill the rest of the ** frame completely. */ diff --git a/src/frame.c b/src/frame.c index 6c98955..5891e24 100644 --- a/src/frame.c +++ b/src/frame.c @@ -34,12 +34,14 @@ Boston, MA 02111-1307, USA. */ #include "faces.h" #include "frame.h" #include "glyphs.h" -#include "gutter.h" #include "menubar.h" #include "redisplay.h" #include "scrollbar.h" #include "window.h" +#include <errno.h> +#include "sysdep.h" + Lisp_Object Vselect_frame_hook, Qselect_frame_hook; Lisp_Object Vdeselect_frame_hook, Qdeselect_frame_hook; Lisp_Object Vcreate_frame_hook, Qcreate_frame_hook; @@ -86,6 +88,7 @@ Lisp_Object Qborder_color; 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; @@ -102,7 +105,7 @@ Lisp_Object Qvisible, Qiconic, Qinvisible, Qvisible_iconic, Qinvisible_iconic; Lisp_Object Qnomini, Qvisible_nomini, Qiconic_nomini, Qinvisible_nomini; Lisp_Object Qvisible_iconic_nomini, Qinvisible_iconic_nomini; -Lisp_Object Qset_specifier, Qset_face_property; +Lisp_Object Qset_specifier, Qset_glyph_image, Qset_face_property; Lisp_Object Qface_property_instance; Lisp_Object Qframe_property_alias; @@ -116,26 +119,20 @@ Lisp_Object Vframe_being_created; Lisp_Object Qframe_being_created; static void store_minibuf_frame_prop (struct frame *f, Lisp_Object val); -static void frame_conversion_internal (struct frame *f, int pixel_to_char, - int *pixel_width, int *pixel_height, - int *char_width, int *char_height, - int real_face); -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) ((markobj) (f->x)); #include "frameslots.h" 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; } @@ -159,13 +156,13 @@ print_frame (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) } 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" } @@ -179,7 +176,7 @@ allocate_frame_core (Lisp_Object device) /* This function can GC */ Lisp_Object frame; Lisp_Object root_window; - struct frame *f = alloc_lcrecord_type (struct frame, &lrecord_frame); + struct frame *f = alloc_lcrecord_type (struct frame, lrecord_frame); zero_lcrecord (f); nuke_all_frame_slots (f); @@ -193,28 +190,22 @@ allocate_frame_core (Lisp_Object device) XWINDOW (root_window)->frame = frame; /* 10 is arbitrary, - Just so that there is "something there." + just so that there is "something there." Correct size will be set up later with change_frame_size. */ - f->width = 10; + f->width = 10; f->height = 10; XWINDOW (root_window)->pixel_width = 10; XWINDOW (root_window)->pixel_height = 9; + /* The size of the minibuffer window is now set in x_create_frame + in xfns.c. */ + f->root_window = root_window; f->selected_window = root_window; f->last_nonminibuf_window = root_window; - /* cache of subwindows visible on frame */ - f->subwindow_instance_cache = make_weak_list (WEAK_LIST_SIMPLE); - - /* associated exposure ignore list */ - f->subwindow_exposures = 0; - f->subwindow_exposures_tail = 0; - - FRAME_SET_PAGENUMBER (f, 1); - /* Choose a buffer for the frame's root window. */ XWINDOW (root_window)->buffer = Qt; { @@ -225,7 +216,7 @@ allocate_frame_core (Lisp_Object device) 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; @@ -248,7 +239,7 @@ setup_normal_frame (struct frame *f) 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. @@ -269,9 +260,7 @@ setup_frame_without_minibuffer (struct frame *f, Lisp_Object mini_window) 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. */ @@ -286,13 +275,8 @@ setup_frame_without_minibuffer (struct frame *f, Lisp_Object mini_window) } /* 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. */ @@ -322,7 +306,7 @@ setup_minibuffer_frame (struct frame *f) /* 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 @@ -386,7 +370,7 @@ See `set-frame-properties', `default-x-frame-plist', and 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); @@ -423,7 +407,7 @@ See `set-frame-properties', `default-x-frame-plist', and 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)); @@ -470,9 +454,9 @@ See `set-frame-properties', `default-x-frame-plist', and things. */ init_frame_toolbars (f); #endif + reset_face_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f))); reset_glyph_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f))); - change_frame_size (f, f->height, f->width, 0); } @@ -505,18 +489,6 @@ See `set-frame-properties', `default-x-frame-plist', and 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) @@ -608,7 +580,7 @@ unhold_frame_size_changes (void) void invalidate_vertical_divider_cache_in_frame (struct frame *f) { - /* Invalidate cached value of needs_vertical_divider_p in + /* Invalidate cached value of needs_vertical_divider_p in every and all windows */ map_windows (f, invalidate_vertical_divider_cache_in_window, 0); } @@ -917,19 +889,16 @@ set_frame_selected_window (struct frame *f, Lisp_Object window) f->selected_window = window; if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f)) { - if (!EQ (f->last_nonminibuf_window, window)) - { #ifdef HAVE_TOOLBARS - MARK_TOOLBAR_CHANGED; -#endif - MARK_GUTTER_CHANGED; - } + if (!EQ (f->last_nonminibuf_window, window)) + MARK_TOOLBAR_CHANGED; +#endif f->last_nonminibuf_window = window; } } DEFUN ("set-frame-selected-window", Fset_frame_selected_window, 2, 2, 0, /* -Set the selected window of FRAME to WINDOW. +Set the selected window of frame object FRAME to WINDOW. If FRAME is nil, the selected frame is used. If FRAME is the selected frame, this makes WINDOW the selected window. */ @@ -976,7 +945,7 @@ is_surrogate_for_selected_frame (struct frame *f) } static int -frame_matches_frame_spec (Lisp_Object frame, Lisp_Object type) +frame_matches_frametype (Lisp_Object frame, Lisp_Object type) { struct frame *f = XFRAME (frame); @@ -1037,141 +1006,160 @@ frame_matches_frame_spec (Lisp_Object frame, Lisp_Object type) } int -device_matches_device_spec (Lisp_Object device, Lisp_Object device_spec) +device_matches_console_spec (Lisp_Object frame, Lisp_Object device, + Lisp_Object console) { - if (EQ (device_spec, Qwindow_system)) + if (EQ (console, Qwindow_system)) return DEVICE_WIN_P (XDEVICE (device)); - if (DEVICEP (device_spec)) - return EQ (device, device_spec); - if (CONSOLEP (device_spec)) - return EQ (DEVICE_CONSOLE (XDEVICE (device)), device_spec); - if (valid_console_type_p (device_spec)) - return EQ (DEVICE_TYPE (XDEVICE (device)), device_spec); + if (NILP (console)) + console = (DEVICE_CONSOLE (XDEVICE (FRAME_DEVICE (XFRAME (frame))))); + if (DEVICEP (console)) + return EQ (device, console); + if (CONSOLEP (console)) + return EQ (DEVICE_CONSOLE (XDEVICE (device)), console); + if (valid_console_type_p (console)) + return EQ (DEVICE_TYPE (XDEVICE (device)), console); return 1; } /* Return the next frame in the frame list after FRAME. - WHICH-FRAMES and WHICH-DEVICES control which frames and devices + FRAMETYPE and CONSOLE control which frames and devices are considered; see `next-frame'. */ -Lisp_Object -next_frame (Lisp_Object frame, Lisp_Object which_frames, Lisp_Object which_devices) +static Lisp_Object +next_frame_internal (Lisp_Object frame, Lisp_Object frametype, + Lisp_Object console, int called_from_delete_device) { - Lisp_Object first = Qnil; - Lisp_Object devcons, concons; int passed = 0; + int started_over = 0; + /* If this frame is dead, it won't be in frame_list, and we'll loop + forever. Forestall that. */ CHECK_LIVE_FRAME (frame); - DEVICE_LOOP_NO_BREAK (devcons, concons) + while (1) { - Lisp_Object device = XCAR (devcons); - Lisp_Object frmcons; + Lisp_Object devcons, concons; - if (!device_matches_device_spec (device, which_devices)) + DEVICE_LOOP_NO_BREAK (devcons, concons) { - if (EQ (device, FRAME_DEVICE (XFRAME (frame)))) - passed = 1; - continue; - } + Lisp_Object device = XCAR (devcons); + Lisp_Object frmcons; - DEVICE_FRAME_LOOP (frmcons, XDEVICE (device)) - { - Lisp_Object f = XCAR (frmcons); + if (!device_matches_console_spec (frame, device, console)) + continue; - if (passed) - { - if (frame_matches_frame_spec (f, which_frames)) - return f; - } - else + DEVICE_FRAME_LOOP (frmcons, XDEVICE (device)) { - if (EQ (frame, f)) - { - passed = 1; - } - else + Lisp_Object f = XCAR (frmcons); + if (passed) { - if (NILP (first) && frame_matches_frame_spec (f, which_frames)) - first = f; + /* #### Doing this here is bad and is now + unnecessary. The real bug was that f->iconified + was never, ever updated unless a user explicitly + called frame-iconified-p. That has now been + fixed. With this change removed all of the other + changes made to support this routine having the + called_from_delete_device arg could be removed. + But it is too close to release to do that now. */ +#if 0 + /* Make sure the visibility and iconified flags are + up-to-date unless we're being deleted. */ + if (!called_from_delete_device) + { + Fframe_iconified_p (f); + Fframe_visible_p (f); + } +#endif + + /* Decide whether this frame is eligible to be returned. */ + + /* If we've looped all the way around without finding any + eligible frames, return the original frame. */ + if (EQ (f, frame)) + return f; + + if (frame_matches_frametype (f, frametype)) + return f; } + + if (EQ (frame, f)) + passed++; } } + /* We hit the end of the list, and need to start over again. */ + if (started_over) + return Qnil; + started_over++; } +} - if (NILP (first)) - /* We went through the whole frame list without finding a single - acceptable frame. Return the original frame. */ - return frame; - else - /* There were no acceptable frames in the list after FRAME; otherwise, - we would have returned directly from the loop. Since FIRST is the last - acceptable frame in the list, return it. */ - return first; +Lisp_Object +next_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) +{ + return next_frame_internal (frame, frametype, console, 0); } /* Return the previous frame in the frame list before FRAME. - WHICH-FRAMES and WHICH-DEVICES control which frames and devices + FRAMETYPE and CONSOLE control which frames and devices are considered; see `next-frame'. */ Lisp_Object -previous_frame (Lisp_Object frame, Lisp_Object which_frames, Lisp_Object which_devices) +prev_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console) { Lisp_Object devcons, concons; - Lisp_Object last = Qnil; + Lisp_Object prev; + /* If this frame is dead, it won't be in frame_list, and we'll loop + forever. Forestall that. */ CHECK_LIVE_FRAME (frame); + prev = Qnil; DEVICE_LOOP_NO_BREAK (devcons, concons) { Lisp_Object device = XCAR (devcons); Lisp_Object frmcons; - if (!device_matches_device_spec (device, which_devices)) - { - if (EQ (device, FRAME_DEVICE (XFRAME (frame))) - && !NILP (last)) - return last; - continue; - } + if (!device_matches_console_spec (frame, device, console)) + continue; DEVICE_FRAME_LOOP (frmcons, XDEVICE (device)) { Lisp_Object f = XCAR (frmcons); - if (EQ (frame, f)) - { - if (!NILP (last)) - return last; - } - else - { - if (frame_matches_frame_spec (f, which_frames)) - last = f; - } + if (EQ (frame, f) && !NILP (prev)) + return prev; + + /* Decide whether this frame is eligible to be returned, + according to frametype. */ + + if (frame_matches_frametype (f, frametype)) + prev = f; + } } - if (NILP (last)) + /* We've scanned the entire list. */ + if (NILP (prev)) /* We went through the whole frame list without finding a single acceptable frame. Return the original frame. */ return frame; else /* There were no acceptable frames in the list before FRAME; otherwise, - we would have returned directly from the loop. Since LAST is the last + we would have returned directly from the loop. Since PREV is the last acceptable frame in the list, return it. */ - return last; + return prev; } DEFUN ("next-frame", Fnext_frame, 0, 3, 0, /* Return the next frame of the right type in the frame list after FRAME. -WHICH-FRAMES controls which frames are eligible to be returned; all +FRAMETYPE controls which frames are eligible to be returned; all others will be skipped. Note that if there is only one eligible frame, then `next-frame' called repeatedly will always return the same frame, and if there is no eligible frame, then FRAME is returned. -Possible values for WHICH-FRAMES are +Possible values for FRAMETYPE are 'visible Consider only frames that are visible. 'iconic Consider only frames that are iconic. @@ -1189,44 +1177,43 @@ Possible values for WHICH-FRAMES are frames. any other value Consider all frames. -If WHICH-FRAMES is omitted, 'nomini is used. A value for WHICH-FRAMES -of 0 (a number) is treated like 'iconic, for backwards compatibility. +If FRAMETYPE is omitted, 'nomini is used. A FRAMETYPE of 0 (a number) +is treated like 'iconic, for backwards compatibility. -If WHICH-FRAMES is a window, include only its own frame and any frame -now using that window as the minibuffer. +If FRAMETYPE is a window, include only its own frame and any frame now +using that window as the minibuffer. -The optional third argument WHICH-DEVICES further clarifies on which -devices to search for frames as specified by WHICH-FRAMES. -If nil or omitted, search all devices on FRAME's console. -If a device, only search that device. -If a console, search all devices on that console. -If a device type, search all devices of that type. -If `window-system', search all window-system devices. -Any other non-nil value means search all devices. +Optional third argument CONSOLE controls which consoles or devices the +returned frame may be on. If CONSOLE is a console, return frames only +on that console. If CONSOLE is a device, return frames only on that +device. If CONSOLE is a console type, return frames only on consoles +of that type. If CONSOLE is 'window-system, return any frames on any +window-system consoles. If CONSOLE is nil or omitted, return frames only +on the FRAME's console. Otherwise, all frames are considered. */ - (frame, which_frames, which_devices)) + (frame, frametype, console)) { XSETFRAME (frame, decode_frame (frame)); - return next_frame (frame, which_frames, which_devices); + return next_frame (frame, frametype, console); } DEFUN ("previous-frame", Fprevious_frame, 0, 3, 0, /* Return the next frame of the right type in the frame list after FRAME. -WHICH-FRAMES controls which frames are eligible to be returned; all +FRAMETYPE controls which frames are eligible to be returned; all others will be skipped. Note that if there is only one eligible frame, then `previous-frame' called repeatedly will always return the same frame, and if there is no eligible frame, then FRAME is returned. -See `next-frame' for an explanation of the WHICH-FRAMES and WHICH-DEVICES +See `next-frame' for an explanation of the FRAMETYPE and CONSOLE arguments. */ - (frame, which_frames, which_devices)) + (frame, frametype, console)) { XSETFRAME (frame, decode_frame (frame)); - return previous_frame (frame, which_frames, which_devices); + return prev_frame (frame, frametype, console); } /* Return any frame for which PREDICATE is non-zero, or return Qnil @@ -1258,15 +1245,23 @@ find_some_frame (int (*predicate) (Lisp_Object, void *), (Exception: if F is a stream frame, it's OK to delete if any other frames exist.) */ -int -other_visible_frames (struct frame *f) +static int +other_visible_frames_internal (struct frame *f, int called_from_delete_device) { Lisp_Object frame; XSETFRAME (frame, f); if (FRAME_STREAM_P (f)) - return !EQ (frame, next_frame (frame, Qt, Qt)); - return !EQ (frame, next_frame (frame, Qvisible_iconic_nomini, Qt)); + return !EQ (frame, next_frame_internal (frame, Qt, Qt, + called_from_delete_device)); + return !EQ (frame, next_frame_internal (frame, Qvisible_iconic_nomini, Qt, + called_from_delete_device)); +} + +int +other_visible_frames (struct frame *f) +{ + return other_visible_frames_internal (f, 0); } /* Delete frame F. @@ -1308,8 +1303,7 @@ delete_frame_internal (struct frame *f, int force, console = DEVICE_CONSOLE (d); con = XCONSOLE (console); - if (!called_from_delete_device - && !DEVICE_IMPL_FLAG (d, XDEVIMPF_FRAMELESS_OK)) + if (!called_from_delete_device) { /* If we're deleting the only non-minibuffer frame on the device, delete the device. */ @@ -1328,7 +1322,7 @@ delete_frame_internal (struct frame *f, int force, losing any way of communicating with the still running XEmacs process. So we put it back. */ if (!force && !allow_deletion_of_last_visible_frame && - !other_visible_frames (f)) + !other_visible_frames_internal (f, called_from_delete_device)) error ("Attempt to delete the sole visible or iconified frame"); /* Does this frame have a minibuffer, and is it the surrogate @@ -1454,17 +1448,22 @@ delete_frame_internal (struct frame *f, int force, next = DEVMETH_OR_GIVEN (d, get_frame_parent, (f), Qnil); if (NILP (next) || EQ (next, frame) || ! FRAME_LIVE_P (XFRAME (next))) - next = next_frame (frame, Qvisible, device); + next = next_frame_internal (frame, Qvisible, device, + called_from_delete_device); if (NILP (next) || EQ (next, frame)) - next = next_frame (frame, Qvisible, console); + next = next_frame_internal (frame, Qvisible, console, + called_from_delete_device); if (NILP (next) || EQ (next, frame)) - next = next_frame (frame, Qvisible, Qt); + next = next_frame_internal (frame, Qvisible, Qt, + called_from_delete_device); if (NILP (next) || EQ (next, frame)) - next = next_frame (frame, Qt, device); + next = next_frame_internal (frame, Qt, device, + called_from_delete_device); if (NILP (next) || EQ (next, frame)) - next = next_frame (frame, Qt, console); + next = next_frame_internal (frame, Qt, console, + called_from_delete_device); if (NILP (next) || EQ (next, frame)) - next = next_frame (frame, Qt, Qt); + next = next_frame_internal (frame, Qt, Qt, called_from_delete_device); /* if we haven't found another frame at this point then there aren't any. */ @@ -1486,9 +1485,11 @@ delete_frame_internal (struct frame *f, int force, */ if (!EQ (device, FRAME_DEVICE(XFRAME(next)))) { - Lisp_Object next_f = next_frame (frame, Qt, device); + Lisp_Object next_f = + 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); } @@ -1503,7 +1504,7 @@ delete_frame_internal (struct frame *f, int force, { 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, @@ -1523,13 +1524,6 @@ delete_frame_internal (struct frame *f, int force, #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 all instance caches calling the - finalize method for each instance. */ - free_frame_subwindow_instances (f); /* This must be done before the window and window_mirror structures are freed. The scrollbar information is attached to them. */ @@ -1540,9 +1534,6 @@ delete_frame_internal (struct frame *f, int force, delete_all_subwindows (XWINDOW (f->root_window)); f->root_window = Qnil; - /* clear out the cached glyph information */ - f->subwindow_instance_cache = Qnil; - /* Remove the frame now from the list. This way, any events generated on this frame by the maneuvers below will disperse themselves. */ @@ -1715,14 +1706,13 @@ mouse_pixel_position_1 (struct device *d, Lisp_Object *frame, DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 0, 1, 0, /* Return a list (WINDOW X . Y) giving the current mouse window and position. -The position is given in pixel units, where (0, 0) is the upper-left corner -of the window. +The position is given in pixel units, where (0, 0) is the upper-left corner. When the cursor is not over a window, the return value is a list (nil nil). DEVICE specifies the device on which to read the mouse position, and defaults to the selected device. If the device is a mouseless terminal -or XEmacs hasn't been programmed to read its mouse position, it returns +or Emacs hasn't been programmed to read its mouse position, it returns the device's selected window for WINDOW and nil for X and Y. */ (device)) @@ -1839,7 +1829,7 @@ Note also: Warping the mouse is contrary to the ICCCM, so be very sure struct window *w; int pix_x, pix_y; - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); CHECK_INT (x); CHECK_INT (y); @@ -1863,7 +1853,7 @@ before calling this function on it, like this. { struct window *w; - CHECK_LIVE_WINDOW (window); + CHECK_WINDOW (window); CHECK_INT (x); CHECK_INT (y); @@ -1912,7 +1902,7 @@ you may do so. 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; } @@ -1938,7 +1928,7 @@ If omitted, FRAME defaults to the currently selected frame. 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; } @@ -1965,7 +1955,7 @@ Return non NIL if FRAME is now "visible" (actually in use for display). A frame that is not visible is not updated, and, if it works through a window system, may not show at all. N.B. Under X "visible" means Mapped. It the window is mapped but not -actually visible on screen then `frame-visible-p' returns 'hidden. +actually visible on screen then frame_visible returns 'hidden. */ (frame)) { @@ -2004,8 +1994,8 @@ frame is iconified, it will not be visible. DEFUN ("visible-frame-list", Fvisible_frame_list, 0, 1, 0, /* Return a list of all frames now "visible" (being updated). If DEVICE is specified only frames on that device will be returned. -Note that under virtual window managers not all these frames are -necessarily really updated. +Note that under virtual window managers not all these frame are necessarily +really updated. */ (device)) { @@ -2068,61 +2058,8 @@ doesn't support multiple overlapping frames, this function does nothing. return Qnil; } - -DEFUN ("disable-frame", Fdisable_frame, 1, 1, 0, /* -Disable frame FRAME, so that it cannot have the focus or receive user input. -This is normally used during modal dialog boxes. -WARNING: Be very careful not to wedge XEmacs! -Use an `unwind-protect' that re-enables the frame to avoid this. -*/ - (frame)) -{ - struct frame *f = decode_frame (frame); - - f->disabled = 1; - MAYBE_FRAMEMETH (f, disable_frame, (f)); - return Qnil; -} - -DEFUN ("enable-frame", Fenable_frame, 1, 1, 0, /* -Enable frame FRAME, so that it can have the focus and receive user input. -Frames are normally enabled, unless explicitly disabled using `disable-frame'. -*/ - (frame)) -{ - struct frame *f = decode_frame (frame); - f->disabled = 0; - MAYBE_FRAMEMETH (f, enable_frame, (f)); - return Qnil; -} - /* Ben thinks there is no need for `redirect-frame-focus' or `frame-focus', crockish FSFmacs functions. See summary on focus in event-stream.c. */ - -DEFUN ("print-job-page-number", Fprint_job_page_number, 1, 1, 0, /* -Return current page number for the print job FRAME. -*/ - (frame)) -{ - CHECK_PRINTER_FRAME (frame); - return make_int (FRAME_PAGENUMBER (XFRAME (frame))); -} - -DEFUN ("print-job-eject-page", Fprint_job_eject_page, 1, 1, 0, /* -Eject page in the print job FRAME. -*/ - (frame)) -{ - struct frame *f; - - CHECK_PRINTER_FRAME (frame); - f = XFRAME (frame); - FRAMEMETH (f, eject_page, (f)); - FRAME_SET_PAGENUMBER (f, 1 + FRAME_PAGENUMBER (f)); - f->clear = 1; - - return Qnil; -} /***************************************************************************/ @@ -2178,7 +2115,7 @@ dissect_as_face_setting (Lisp_Object sym, Lisp_Object *face_out, Lisp_Object *face_prop_out) { Lisp_Object list = Vbuilt_in_face_specifiers; - Lisp_String *s; + struct Lisp_String *s; if (!SYMBOLP (sym)) return 0; @@ -2188,7 +2125,7 @@ dissect_as_face_setting (Lisp_Object sym, Lisp_Object *face_out, while (!NILP (list)) { Lisp_Object prop = Fcar (list); - Lisp_String *prop_name; + struct Lisp_String *prop_name; if (!SYMBOLP (prop)) continue; @@ -2266,9 +2203,8 @@ The following symbols etc. have predefined meanings: 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'. @@ -2282,13 +2218,7 @@ The following symbols etc. have predefined meanings: 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' @@ -2409,7 +2339,6 @@ recognized for particular types of frames. DEFUN ("frame-property", Fframe_property, 2, 3, 0, /* Return FRAME's value for property PROPERTY. -Return DEFAULT if there is no such property. See `set-frame-properties' for the built-in property names. */ (frame, property, default_)) @@ -2605,21 +2534,21 @@ Specify that the frame FRAME has LINES lines. Optional third arg non-nil means that redisplay should use LINES lines but that the idea of the actual height of the frame should not be changed. */ - (frame, lines, pretend)) + (frame, rows, pretend)) { struct frame *f = decode_frame (frame); int height, width; XSETFRAME (frame, f); - CHECK_INT (lines); + CHECK_INT (rows); if (window_system_pixelated_geometry (frame)) { - char_to_real_pixel_size (f, 0, XINT (lines), 0, &height); + char_to_real_pixel_size (f, 0, XINT (rows), 0, &height); width = FRAME_PIXWIDTH (f); } else { - height = XINT (lines); + height = XINT (rows); width = FRAME_WIDTH (f); } @@ -2627,37 +2556,6 @@ but that the idea of the actual height of the frame should not be changed. return frame; } -DEFUN ("set-frame-pixel-height", Fset_frame_pixel_height, 2, 3, 0, /* -Specify that the frame FRAME is HEIGHT pixels tall. -Optional third arg non-nil means that redisplay should be HEIGHT pixels tall -but that the idea of the actual height of the frame should not be changed. -*/ - (frame, height, pretend)) -{ - struct frame *f = decode_frame (frame); - int pheight, width; - XSETFRAME (frame, f); - CHECK_INT (height); - - if (!window_system_pixelated_geometry (frame)) - { - int h = XINT (height); - width = FRAME_WIDTH (f); - /* Simply using pixel_to_real_char_size here is not good - enough since we end up with a total frame size of HEIGHT - rather than a displayable height of HEIGHT. */ - frame_conversion_internal (f, 2, 0, &h, 0, &pheight, 0); - } - else - { - width = FRAME_PIXWIDTH (f); - pheight = XINT (height); - } - - internal_set_frame_size (f, width, pheight, !NILP (pretend)); - return frame; -} - DEFUN ("set-frame-width", Fset_frame_width, 2, 3, 0, /* Specify that the frame FRAME has COLS columns. Optional third arg non-nil means that redisplay should use COLS columns @@ -2685,39 +2583,8 @@ but that the idea of the actual width of the frame should not be changed. return frame; } -DEFUN ("set-frame-pixel-width", Fset_frame_pixel_width, 2, 3, 0, /* -Specify that the frame FRAME is WIDTH pixels wide. -Optional third arg non-nil means that redisplay should be WIDTH wide -but that the idea of the actual height of the frame should not be changed. -*/ - (frame, width, pretend)) -{ - struct frame *f = decode_frame (frame); - int height, pwidth; - XSETFRAME (frame, f); - CHECK_INT (width); - - if (!window_system_pixelated_geometry (frame)) - { - int w = XINT (width); - height = FRAME_HEIGHT (f); - /* Simply using pixel_to_real_char_size here is not good - enough since we end up with a total frame size of WIDTH - rather than a displayable height of WIDTH. */ - frame_conversion_internal (f, 2, &w, 0, &pwidth, 0, 0); - } - else - { - height = FRAME_PIXHEIGHT (f); - pwidth = XINT (width); - } - - internal_set_frame_size (f, pwidth, height, !NILP (pretend)); - return frame; -} - DEFUN ("set-frame-size", Fset_frame_size, 3, 4, 0, /* -Set the size of FRAME to COLS by ROWS, measured in characters. +Set the size of FRAME to COLS by ROWS. Optional fourth arg non-nil means that redisplay should use COLS by ROWS but that the idea of the actual size of the frame should not be changed. */ @@ -2741,38 +2608,6 @@ but that the idea of the actual size of the frame should not be changed. return frame; } -DEFUN ("set-frame-pixel-size", Fset_frame_pixel_size, 3, 4, 0, /* -Set the size of FRAME to WIDTH by HEIGHT, measured in pixels. -Optional fourth arg non-nil means that redisplay should use WIDTH by HEIGHT -but that the idea of the actual size of the frame should not be changed. -*/ - (frame, width, height, pretend)) -{ - struct frame *f = decode_frame (frame); - int pheight, pwidth; - XSETFRAME (frame, f); - CHECK_INT (width); - CHECK_INT (height); - - if (!window_system_pixelated_geometry (frame)) - { - int w = XINT (width); - int h = XINT (height); - /* Simply using pixel_to_real_char_size here is not good enough - since we end up with a total frame size of WIDTH x HEIGHT - rather than a displayable height of WIDTH x HEIGHT. */ - frame_conversion_internal (f, 2, &w, &h, &pwidth, &pheight, 0); - } - else - { - pheight = XINT (height); - pwidth = XINT (width); - } - - internal_set_frame_size (f, pwidth, pheight, !NILP (pretend)); - return frame; -} - DEFUN ("set-frame-position", Fset_frame_position, 3, 3, 0, /* Set position of FRAME in pixels to XOFFSET by YOFFSET. This is actually the position of the upper left corner of the frame. @@ -2816,8 +2651,8 @@ frame_conversion_internal (struct frame *f, int pixel_to_char, 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) + @@ -2829,21 +2664,7 @@ frame_conversion_internal (struct frame *f, int pixel_to_char, 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f) + 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); - /* Convert to chars so that the displayable area is pixel_width x - pixel_height. - - #### Consider rounding up to 0.5 characters to avoid adding too - much space. */ - if (pixel_to_char > 1) - { - if (char_width) - *char_width = ROUND_UP (*pixel_width, cpw) / cpw; - if (char_height) - *char_height = ROUND_UP (*pixel_height, cph) / cph; - } - /* Convert to chars so that the total frame size is pixel_width x - pixel_height. */ - else if (pixel_to_char) + if (pixel_to_char) { if (char_width) *char_width = 1 + ((*pixel_width - egw) - bdr - obw) / cpw; @@ -2974,7 +2795,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth) /* when frame_conversion_internal() calculated the number of rows/cols in the frame, the theoretical toolbar sizes were subtracted out. - The calculations below adjust for real toolbar height/width in + The caluclations below adjust for real toolbar height/width in frame, which may be different from frame spec, taking the above fact into account */ new_pixheight += @@ -2982,7 +2803,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth) + 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f) - FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) - 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f); - + new_pixheight += + FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f) + 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f) @@ -2994,21 +2815,21 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth) + 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f) - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f); - + new_pixwidth += + FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f) + 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); - + /* Adjust the width for the end glyph which may be a different width than the default character width. */ { 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); @@ -3022,14 +2843,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth) 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)) @@ -3055,10 +2869,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth) 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); } @@ -3073,20 +2884,13 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth) 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); } @@ -3103,9 +2907,8 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth) FRAME_CHARWIDTH (f) = FRAME_WIDTH (f); FRAME_CHARHEIGHT (f) = FRAME_HEIGHT (f); } - + MARK_FRAME_TOOLBARS_CHANGED (f); - MARK_FRAME_GUTTERS_CHANGED (f); MARK_FRAME_CHANGED (f); f->echo_area_garbaged = 1; } @@ -3118,15 +2921,9 @@ change_frame_size (struct frame *f, int newheight, int newwidth, int delay) So deal. */ check_frame_size (f, &newheight, &newwidth); - /* Unconditionally mark that the frame has changed size. This is - because many things need to know after the - fact. f->size_change_pending will get reset below. The most that - can happen is that we will cycle through redisplay once more - --andy. */ - MARK_FRAME_SIZE_CHANGED (f); - if (delay || in_display || gc_in_progress) { + MARK_FRAME_SIZE_CHANGED (f); f->new_width = newwidth; f->new_height = newheight; return; @@ -3147,37 +2944,6 @@ change_frame_size (struct frame *f, int newheight, int newwidth, int delay) } -/* 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) { @@ -3201,8 +2967,8 @@ update_frame_title (struct frame *f) 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)); } @@ -3213,8 +2979,8 @@ update_frame_title (struct frame *f) 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)); } @@ -3273,29 +3039,9 @@ icon_glyph_changed (Lisp_Object glyph, Lisp_Object property, } -/***************************************************************************/ -/* */ -/* 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"); @@ -3308,6 +3054,8 @@ syms_of_frame (void) 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"); @@ -3356,6 +3104,7 @@ syms_of_frame (void) defsymbol (&Qborder_width, "border-width"); /* Qwidth, Qheight, Qleft, Qtop in general.c */ defsymbol (&Qset_specifier, "set-specifier"); + defsymbol (&Qset_glyph_image, "set-glyph-image"); defsymbol (&Qset_face_property, "set-face-property"); defsymbol (&Qface_property_instance, "face-property-instance"); defsymbol (&Qframe_property_alias, "frame-property-alias"); @@ -3393,8 +3142,6 @@ syms_of_frame (void) DEFSUBR (Fvisible_frame_list); DEFSUBR (Fraise_frame); DEFSUBR (Flower_frame); - DEFSUBR (Fdisable_frame); - DEFSUBR (Fenable_frame); DEFSUBR (Fframe_property); DEFSUBR (Fframe_properties); DEFSUBR (Fset_frame_properties); @@ -3405,13 +3152,8 @@ syms_of_frame (void) DEFSUBR (Fset_frame_height); DEFSUBR (Fset_frame_width); DEFSUBR (Fset_frame_size); - DEFSUBR (Fset_frame_pixel_height); - DEFSUBR (Fset_frame_pixel_width); - DEFSUBR (Fset_frame_pixel_size); DEFSUBR (Fset_frame_position); DEFSUBR (Fset_frame_pointer); - DEFSUBR (Fprint_job_page_number); - DEFSUBR (Fprint_job_eject_page); } void @@ -3525,34 +3267,27 @@ visible frames. 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 --git a/src/gdbinit b/src/gdbinit new file mode 100644 index 0000000..162b641 --- /dev/null +++ b/src/gdbinit @@ -0,0 +1,421 @@ +# -*- 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 +# USE_MINIMAL_TAGBITS +# USE_INDEXED_LRECORD_IMPLEMENTATION +# LRECORD_(SYMBOL|STRING|VECTOR) + +# (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 dbg_USE_MINIMAL_TAGBITS + if $obj & 1 + # It's an int + set $val = $obj >> 1 + set $type = dbg_Lisp_Type_Int + else + set $type = $obj & dbg_typemask + if $type == dbg_Lisp_Type_Char + set $val = ($obj & dbg_valmask) >> dbg_gctypebits + else + # It's a record pointer + set $val = $obj + end + end + else + # not dbg_USE_MINIMAL_TAGBITS + set $val = $obj & dbg_valmask + set $type = ($obj & dbg_typemask) >> (dbg_valbits + 1) + end + + if $type == dbg_Lisp_Type_Record + set $lheader = (struct lrecord_header *) $val + if dbg_USE_INDEXED_LRECORD_IMPLEMENTATION + set $imp = lrecord_implementations_table[$lheader->type] + else + set $imp = $lheader->implementation + end + 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 == dbg_Lisp_Type_Int + echo int\n + else + if $type == dbg_Lisp_Type_Char + echo char\n + else + if $type == dbg_Lisp_Type_Symbol + echo symbol\n + else + if $type == dbg_Lisp_Type_String + echo string\n + else + if $type == dbg_Lisp_Type_Vector + echo vector\n + else + if $type == dbg_Lisp_Type_Cons + echo cons\n + else + printf "record type: %s\n", $imp->name + # barf + end + end + end + end + end + end +end + +define run-temacs + unset env EMACSLOADPATH + set env EMACSBOOTSTRAPLOADPATH ../lisp/:.. + 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 + unset env EMACSLOADPATH + set env EMACSBOOTSTRAPLOADPATH ../lisp/:.. + 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 + unset env EMACSLOADPATH + set env EMACSBOOTSTRAPLOADPATH ../lisp/:.. + 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 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 == dbg_Lisp_Type_Int + printf "Integer: %d\n", $val + else + if $type == dbg_Lisp_Type_Char + if $val < 128 + printf "Char: %c\n", $val + else + printf "Char: %d\n", $val + end + else + if $type == dbg_Lisp_Type_String || $imp == lrecord_string + pstruct Lisp_String + else + if $type == dbg_Lisp_Type_Cons || $imp == lrecord_cons + pstruct Lisp_Cons + else + if $type == dbg_Lisp_Type_Symbol || $imp == lrecord_symbol + pstruct Lisp_Symbol + printf "Symbol name: %s\n", $xstruct->name->_data + else + if $type == dbg_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 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_hashtable + pstruct hashtable + else + if $imp == lrecord_image_instance + pstruct Lisp_Image_Instance + else + if $imp == lrecord_keymap + pstruct 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 + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + end + 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 structure of a underlying Lisp Object. +end diff --git a/src/general-slots.h b/src/general-slots.h index ebdec9b..fac3a82 100644 --- a/src/general-slots.h +++ b/src/general-slots.h @@ -92,7 +92,6 @@ SYMBOL_KEYWORD (Q_descriptor); SYMBOL (Qdevice); SYMBOL_KEYWORD (Q_device); SYMBOL (Qdialog); -SYMBOL (Qdirectory); SYMBOL (Qdimension); SYMBOL (Qdisplay); SYMBOL (Qdoc_string); @@ -119,7 +118,6 @@ SYMBOL (Qgap_overhead); SYMBOL (Qgeneric); SYMBOL (Qgeometry); SYMBOL (Qglobal); -SYMBOL (Qgtk); SYMBOL (Qgutter); SYMBOL (Qheight); SYMBOL_KEYWORD (Q_height); @@ -139,8 +137,6 @@ SYMBOL (Qinteger); SYMBOL (Qinternal); SYMBOL_KEYWORD (Q_items); SYMBOL_KEYWORD (Q_justify); -SYMBOL_KEYWORD (Q_vertically_justify); -SYMBOL_KEYWORD (Q_horizontally_justify); SYMBOL (Qkey); SYMBOL (Qkey_assoc); SYMBOL_KEYWORD (Q_key_sequence); @@ -187,13 +183,13 @@ SYMBOL (Qorientation); SYMBOL_KEYWORD (Q_orientation); SYMBOL (Qother); SYMBOL (Qpage_setup); -SYMBOL (Qpages); SYMBOL (Qpeer); SYMBOL (Qpointer); SYMBOL (Qpopup); SYMBOL (Qportrait); SYMBOL (Qprepend); SYMBOL (Qprint); +SYMBOL (Qprint_setup); SYMBOL (Qprinter); SYMBOL_KEYWORD (Q_printer_settings); SYMBOL (Qprocess); @@ -215,7 +211,6 @@ SYMBOL (Qright_margin); SYMBOL (Qsearch); SYMBOL (Qselected); SYMBOL_KEYWORD (Q_selected); -SYMBOL (Qselection); SYMBOL (Qset_glyph_image); SYMBOL (Qsignal); SYMBOL (Qsimple); diff --git a/src/glyphs-eimage.c b/src/glyphs-eimage.c index 3308449..c4daa12 100644 --- a/src/glyphs-eimage.c +++ b/src/glyphs-eimage.c @@ -49,15 +49,15 @@ Boston, MA 02111-1307, USA. */ #include "lstream.h" #include "console.h" #include "device.h" -#include "faces.h" #include "glyphs.h" #include "objects.h" #include "buffer.h" #include "frame.h" +#include "insdel.h" #include "opaque.h" -#include "window.h" +#include "imgproc.h" #include "sysfile.h" #ifdef HAVE_PNG @@ -75,6 +75,16 @@ extern "C" { #include "file-coding.h" #endif +#if INTBITS == 32 +# define FOUR_BYTE_TYPE unsigned int +#elif LONGBITS == 32 +# define FOUR_BYTE_TYPE unsigned long +#elif SHORTBITS == 32 +# define FOUR_BYTE_TYPE unsigned short +#else +#error What kind of strange-ass system are we running on? +#endif + #ifdef HAVE_TIFF DEFINE_IMAGE_INSTANTIATOR_FORMAT (tiff); Lisp_Object Qtiff; @@ -119,8 +129,7 @@ jpeg_validate (Lisp_Object instantiator) } static Lisp_Object -jpeg_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) +jpeg_normalize (Lisp_Object inst, Lisp_Object console_type) { return simple_image_type_normalize (inst, console_type, Qjpeg); } @@ -234,7 +243,7 @@ our_skip_input_data (j_decompress_ptr cinfo, long num_bytes) if (!src) { return; - } else if (num_bytes > (long) src->bytes_in_buffer) + } else if (num_bytes > src->bytes_in_buffer) { ERREXIT(cinfo, JERR_INPUT_EOF); /*NOTREACHED*/ @@ -316,7 +325,7 @@ jpeg_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); + 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. */ @@ -374,13 +383,13 @@ jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, { 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); } @@ -409,7 +418,7 @@ jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, { /* we're relying on the jpeg driver to do any other conversions, or signal an error if the conversion isn't supported. */ - cinfo.out_color_space = JCS_RGB; + cinfo.out_color_space = JCS_RGB; } /* Step 5: Start decompressor */ @@ -444,7 +453,7 @@ jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, */ while (cinfo.output_scanline < cinfo.output_height) { - unsigned int i; + int i; /* jpeg_read_scanlines expects an array of pointers to scanlines. * Here the array is only one element long, but you could ask for @@ -455,7 +464,7 @@ jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, for (i = 0; i < cinfo.output_width; i++) { int clr; - if (jpeg_gray) + if (jpeg_gray) { unsigned char val; #if (BITS_IN_JSAMPLE == 8) @@ -482,10 +491,10 @@ jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, /* 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, - unwind.eimage, dest_mask, + (ii, cinfo.output_width, cinfo.output_height, + unwind.eimage, dest_mask, instantiator, domain)); /* Step 7: Finish decompression */ @@ -507,7 +516,7 @@ jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, * GIF * **********************************************************************/ -#include "gifrlib.h" +#include <gifrlib.h> static void gif_validate (Lisp_Object instantiator) @@ -516,8 +525,7 @@ gif_validate (Lisp_Object instantiator) } static Lisp_Object -gif_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) +gif_normalize (Lisp_Object inst, Lisp_Object console_type) { return simple_image_type_normalize (inst, console_type, Qgif); } @@ -567,9 +575,9 @@ static size_t gif_read_from_memory(GifByteType *buf, size_t size, VoidPtr data) { gif_memory_storage *mem = (gif_memory_storage*)data; - - if ((ssize_t) size > (mem->len - mem->index)) - return (size_t) -1; + + if (size > (mem->len - mem->index)) + return -1; memcpy(buf, mem->bytes + mem->index, size); mem->index = mem->index + size; return size; @@ -583,12 +591,12 @@ gif_memory_close(VoidPtr data) 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; @@ -602,7 +610,7 @@ gif_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); + 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. */ @@ -614,20 +622,20 @@ gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, Extcount len; int height = 0; int width = 0; - + xzero (unwind); record_unwind_protect (gif_instantiate_unwind, make_opaque_ptr (&unwind)); - + /* 1. Now decode the data. */ - + { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - + 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)) { @@ -638,109 +646,76 @@ gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, signal_image_error_2 ("GIF decoding error", errstring, instantiator); } 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; GifSetReadFunc(unwind.giffile, gif_read_from_memory, (VoidPtr)&mem_struct); GifSetCloseFunc(unwind.giffile, gif_memory_close, (VoidPtr)&mem_struct); DGifInitRead(unwind.giffile); - + /* Then slurp the image into memory, decoding along the way. The result is the image in a simple one-byte-per-pixel format (#### the GIF routines only support 8-bit GIFs, it appears). */ 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, ... */ static int InterlacedOffset[] = { 0, 4, 2, 1 }; static int InterlacedJumps[] = { 8, 8, 4, 2 }; - + 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 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 && 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); } @@ -759,8 +734,7 @@ png_validate (Lisp_Object instantiator) } static Lisp_Object -png_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) +png_normalize (Lisp_Object inst, Lisp_Object console_type) { return simple_image_type_normalize (inst, console_type, Qpng); } @@ -773,7 +747,7 @@ png_possible_dest_types (void) 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? */ }; @@ -785,7 +759,7 @@ png_read_from_memory(png_structp png_ptr, png_bytep data, struct png_memory_storage *tbr = (struct png_memory_storage *) png_get_io_ptr (png_ptr); - if ((ssize_t) length > (tbr->len - tbr->index)) + if (length > (tbr->len - tbr->index)) png_error (png_ptr, (png_const_charp) "Read Error"); memcpy (data,tbr->bytes + tbr->index,length); tbr->index = tbr->index + length; @@ -793,13 +767,13 @@ png_read_from_memory(png_structp png_ptr, png_bytep data, struct png_error_struct { - const char *err_str; + CONST char *err_str; jmp_buf setjmp_buffer; /* for return to caller */ }; /* jh 98/03/12 - #### AARRRGH! libpng includes jmp_buf inside its own structure, and there are cases where the size can be different from - between inside the library, and inside the code! To do an end run + between inside the libarary, and inside the code! To do an end run around this, use our own error functions, and don't rely on things passed in the png_ptr to them. This is an ugly hack and must go away when the lisp engine is threaded! */ @@ -838,8 +812,6 @@ png_instantiate_unwind (Lisp_Object unwind_obj) if (data->instream) fclose (data->instream); - if (data->eimage) xfree(data->eimage); - return Qnil; } @@ -848,7 +820,7 @@ png_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); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); struct png_unwind_data unwind; int speccount = specpdl_depth (); int height, width; @@ -869,7 +841,7 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL); signal_image_error ("Error obtaining memory for png_read", instantiator); } - + xzero (unwind); unwind.png_ptr = png_ptr; unwind.info_ptr = info_ptr; @@ -884,7 +856,7 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, and is no longer usable for previous versions. jh */ - /* Set the jmp_buf return context for png_error ... if this returns !0, then + /* Set the jmp_buf reurn context for png_error ... if this returns !0, then we ran into a problem somewhere, and need to clean up after ourselves. */ if (setjmp (png_err_stct.setjmp_buffer)) { @@ -897,14 +869,14 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, /* 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; @@ -924,51 +896,15 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, /* libpng expects that the image buffer passed in contains a picture to draw on top of if the png has any transparencies. This could be a good place to pass that in... */ - + row_pointers = xnew_array (png_byte *, height); for (y = 0; y < height; y++) row_pointers[y] = unwind.eimage + (width * 3 * y); - { - /* if the png specifies a background chunk, go ahead and - use it, else use what we can get from the default face. */ - png_color_16 my_background, *image_background; - Lisp_Object bkgd = Qnil; - - my_background.red = 0x7fff; - my_background.green = 0x7fff; - my_background.blue = 0x7fff; - bkgd = FACE_BACKGROUND (Vdefault_face, domain); - if (!COLOR_INSTANCEP (bkgd)) - { - warn_when_safe (Qpng, Qinfo, "Couldn't get background color!"); - } - else - { - 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)))); - } - - if (png_get_bKGD (png_ptr, info_ptr, &image_background)) - png_set_background (png_ptr, image_background, - PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); - else - png_set_background (png_ptr, &my_background, - PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); - } - /* Now that we're using EImage, ask for 8bit RGB triples for any type of image*/ - /* convert palette images to full RGB */ + /* convert palatte images to full RGB */ if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) png_set_expand (png_ptr); /* send grayscale images to RGB too */ @@ -978,6 +914,12 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, /* we can't handle alpha values */ if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) png_set_strip_alpha (png_ptr); + /* rip out any transparancy layers/colors */ + if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) + { + png_set_expand (png_ptr); + png_set_strip_alpha (png_ptr); + } /* tell libpng to strip 16 bit depth files down to 8 bits */ if (info_ptr->bit_depth == 16) png_set_strip_16 (png_ptr); @@ -990,9 +932,28 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, png_set_packing (png_ptr); } +#if 1 /* tests? or permanent? */ + { + /* if the png specifies a background chunk, go ahead and + use it */ + png_color_16 my_background, *image_background; + + /* ### how do I get the background of the current frame? */ + my_background.red = 0x7fff; + my_background.green = 0x7fff; + my_background.blue = 0x7fff; + + if (png_get_bKGD (png_ptr, info_ptr, &image_background)) + png_set_background (png_ptr, image_background, + PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); + else + png_set_background (png_ptr, &my_background, + PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); + } +#endif png_read_image (png_ptr, row_pointers); png_read_end (png_ptr, info_ptr); - + #ifdef PNG_SHOW_COMMENTS /* #### * I turn this off by default now, because the !%^@#!% comments @@ -1021,9 +982,9 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, } /* 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. */ @@ -1046,8 +1007,7 @@ tiff_validate (Lisp_Object instantiator) } static Lisp_Object -tiff_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) +tiff_normalize (Lisp_Object inst, Lisp_Object console_type) { return simple_image_type_normalize (inst, console_type, Qtiff); } @@ -1128,7 +1088,7 @@ static toff_t tiff_memory_seek(thandle_t data, toff_t off, int whence) if ((newidx > mem->len) || (newidx < 0)) return -1; - + mem->index = newidx; return newidx; } @@ -1160,7 +1120,7 @@ tiff_memory_size(thandle_t data) struct tiff_error_struct { -#ifdef HAVE_VSNPRINTF +#if HAVE_VSNPRINTF char err_str[256]; #else char err_str[1024]; /* return the error string */ @@ -1175,12 +1135,12 @@ struct tiff_error_struct 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... */ @@ -1192,17 +1152,17 @@ tiff_error_func(const char *module, const char *fmt, ...) } 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); @@ -1217,7 +1177,7 @@ tiff_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); + 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 @@ -1228,7 +1188,7 @@ tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, xzero (unwind); record_unwind_protect (tiff_instantiate_unwind, make_opaque_ptr (&unwind)); - + /* set up error facilities */ if (setjmp (tiff_err_data.setjmp_buffer)) { @@ -1252,32 +1212,30 @@ tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, /* #### 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; - unwind.tiff = TIFFClientOpen ("memfile", "r", (thandle_t) &mem_struct, + unwind.tiff = TIFFClientOpen ("memfile", "r", &mem_struct, (TIFFReadWriteProc)tiff_memory_read, (TIFFReadWriteProc)tiff_memory_write, 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. - It needs to be reimplemented via scanline reads for both memory + /* ### This is little more than proof-of-concept/function testing. + It needs to be reimplimented via scanline reads for both memory compactness. */ raster = (uint32*) _TIFFmalloc (width * height * sizeof (uint32)); if (raster != NULL) { - unsigned int i,j; + int i,j; uint32 *rp; ep = unwind.eimage; rp = raster; @@ -1304,9 +1262,9 @@ tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, } /* 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 --git a/src/glyphs-gtk.c b/src/glyphs-gtk.c index 69e59e1..ce6e345 100644 --- a/src/glyphs-gtk.c +++ b/src/glyphs-gtk.c @@ -1576,15 +1576,13 @@ gtk_resource_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, type = resource_symbol_to_type (resource_type); -#if 0 - if (dest_mask & IMAGE_POINTER_MASK && type == IMAGE_POINTER_MASK) - iitype = IMAGE_POINTER; - else if (dest_mask & IMAGE_COLOR_PIXMAP_MASK) - iitype = IMAGE_COLOR_PIXMAP; - else - incompatible_image_types (instantiator, dest_mask, - IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK); -#endif + // if (dest_mask & IMAGE_POINTER_MASK && type == IMAGE_POINTER_MASK) + // iitype = IMAGE_POINTER; + // else if (dest_mask & IMAGE_COLOR_PIXMAP_MASK) + // iitype = IMAGE_COLOR_PIXMAP; + // else + // incompatible_image_types (instantiator, dest_mask, + // IMAGE_COLOR_PIXMAP_MASK | IMAGE_POINTER_MASK); /* mess with the keyword info we were provided with */ gtk_initialize_pixmap_image_instance (ii, 1, type); diff --git a/src/glyphs.c b/src/glyphs.c index 6fbe951..b481ce8 100644 --- a/src/glyphs.c +++ b/src/glyphs.c @@ -1,9 +1,8 @@ /* 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 This file is part of XEmacs. @@ -24,29 +23,23 @@ Boston, MA 02111-1307, USA. */ /* 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 "glyphs.h" #include "objects.h" -#include "opaque.h" -#include "rangetab.h" #include "redisplay.h" -#include "specifier.h" #include "window.h" -#if defined (HAVE_XPM) && !defined (HAVE_GTK) +#ifdef HAVE_XPM #include <X11/xpm.h> #endif @@ -59,11 +52,11 @@ Lisp_Object Qmono_pixmap_image_instance_p; Lisp_Object Qcolor_pixmap_image_instance_p; Lisp_Object Qpointer_image_instance_p; Lisp_Object Qsubwindow_image_instance_p; -Lisp_Object Qwidget_image_instance_p; Lisp_Object Qconst_glyph_variable; Lisp_Object Qmono_pixmap, Qcolor_pixmap, Qsubwindow; -Lisp_Object Q_file, Q_data, Q_face, Q_pixel_width, Q_pixel_height; +Lisp_Object Q_file, Q_data, Q_face; Lisp_Object Qformatted_string; + Lisp_Object Vcurrent_display_table; Lisp_Object Vtruncation_glyph, Vcontinuation_glyph, Voctal_escape_glyph; Lisp_Object Vcontrol_arrow_glyph, Vinvisible_text_glyph, Vhscroll_glyph; @@ -73,15 +66,10 @@ Lisp_Object Vimage_instantiator_format_list; 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); @@ -97,11 +85,6 @@ Lisp_Object Q_foreground, Q_background; #endif #endif -#ifdef HAVE_XFACE -DEFINE_IMAGE_INSTANTIATOR_FORMAT (xface); -Lisp_Object Qxface; -#endif - #ifdef HAVE_XPM DEFINE_IMAGE_INSTANTIATOR_FORMAT (xpm); Lisp_Object Qxpm; @@ -112,7 +95,6 @@ typedef struct image_instantiator_format_entry image_instantiator_format_entry; struct image_instantiator_format_entry { Lisp_Object symbol; - Lisp_Object device; struct image_instantiator_methods *meths; }; @@ -121,40 +103,24 @@ typedef struct 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 parent, - Lisp_Object instantiator); +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); -static void update_image_instance (Lisp_Object image_instance, - Lisp_Object instantiator); -/* Unfortunately windows and X are different. In windows BeginPaint() - will prevent WM_PAINT messages being generated so it is unnecessary - to register exposures as they will not occur. Under X they will - always occur. */ -int hold_ignored_expose_registration; - EXFUN (Fimage_instance_type, 1); EXFUN (Fglyph_type, 1); -EXFUN (Fnext_window, 4); /**************************************************************************** * Image Instantiators * ****************************************************************************/ -struct image_instantiator_methods * -decode_device_ii_format (Lisp_Object device, Lisp_Object format, - Error_behavior errb) +static struct image_instantiator_methods * +decode_image_instantiator_format (Lisp_Object format, Error_behavior errb) { int i; @@ -168,19 +134,10 @@ decode_device_ii_format (Lisp_Object device, Lisp_Object format, for (i = 0; i < Dynarr_length (the_image_instantiator_format_entry_dynarr); i++) { - if ( EQ (format, - Dynarr_at (the_image_instantiator_format_entry_dynarr, i). - symbol) ) - { - Lisp_Object d = Dynarr_at (the_image_instantiator_format_entry_dynarr, i). - device; - if ((NILP (d) && NILP (device)) - || - (!NILP (device) && - EQ (CONSOLE_TYPE (XCONSOLE - (DEVICE_CONSOLE (XDEVICE (device)))), d))) - return Dynarr_at (the_image_instantiator_format_entry_dynarr, i).meths; - } + if (EQ (format, + Dynarr_at (the_image_instantiator_format_entry_dynarr, i). + symbol)) + return Dynarr_at (the_image_instantiator_format_entry_dynarr, i).meths; } maybe_signal_simple_error ("Invalid image-instantiator format", format, @@ -189,57 +146,22 @@ decode_device_ii_format (Lisp_Object device, Lisp_Object format, return 0; } -struct image_instantiator_methods * -decode_image_instantiator_format (Lisp_Object format, Error_behavior errb) -{ - return decode_device_ii_format (Qnil, format, errb); -} - 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 locale. -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, 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; } @@ -253,26 +175,17 @@ Return a list of valid image-instantiator formats. } void -add_entry_to_device_ii_format_list (Lisp_Object device, Lisp_Object symbol, - struct image_instantiator_methods *meths) +add_entry_to_image_instantiator_format_list (Lisp_Object symbol, + struct + image_instantiator_methods *meths) { struct image_instantiator_format_entry entry; entry.symbol = symbol; - 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); -} - -void -add_entry_to_image_instantiator_format_list (Lisp_Object symbol, - struct - image_instantiator_methods *meths) -{ - add_entry_to_device_ii_format_list (Qnil, symbol, meths); + Vimage_instantiator_format_list = + Fcons (symbol, Vimage_instantiator_format_list); } static Lisp_Object * @@ -283,7 +196,7 @@ get_image_conversion_list (Lisp_Object console_type) DEFUN ("set-console-type-image-conversion-list", Fset_console_type_image_conversion_list, 2, 2, 0, /* -Set the image-conversion-list for consoles of the given CONSOLE-TYPE. +Set the image-conversion-list for consoles of the given TYPE. The image-conversion-list specifies how image instantiators that are strings should be interpreted. Each element of the list should be a list of two elements (a regular expression string and a vector) or @@ -351,7 +264,7 @@ specifiers will not be affected. DEFUN ("console-type-image-conversion-list", Fconsole_type_image_conversion_list, 1, 1, 0, /* -Return the image-conversion-list for devices of the given CONSOLE-TYPE. +Return the image-conversion-list for devices of the given TYPE. The image-conversion-list specifies how to interpret image string instantiators for the specified console type. See `set-console-type-image-conversion-list' for a description of its syntax. @@ -382,7 +295,7 @@ process_image_string_instantiator (Lisp_Object data, skip it. */ if (!(dest_mask & IIFORMAT_METH (decode_image_instantiator_format - (INSTANTIATOR_TYPE (typevec), ERROR_ME), + (XVECTOR_DATA (typevec)[0], ERROR_ME), possible_dest_types, ()))) continue; if (fast_string_match (exp, 0, data, 0, -1, 0, ERROR_ME, 0) >= 0) @@ -436,98 +349,13 @@ find_keyword_in_vector (Lisp_Object vector, Lisp_Object keyword) return find_keyword_in_vector_or_given (vector, keyword, Qnil); } -static Lisp_Object -find_instantiator_differences (Lisp_Object new, Lisp_Object old) -{ - Lisp_Object alist = Qnil; - Lisp_Object *elt = XVECTOR_DATA (new); - Lisp_Object *old_elt = XVECTOR_DATA (old); - int len = XVECTOR_LENGTH (new); - struct gcpro gcpro1; - - /* If the vector length has changed then consider everything - changed. We could try and figure out what properties have - disappeared or been added, but this code is only used as an - optimization anyway so lets not bother. */ - if (len != XVECTOR_LENGTH (old)) - return new; - - GCPRO1 (alist); - - for (len -= 2; len >= 1; len -= 2) - { - /* Keyword comparisons can be done with eq, the value must be - done with equal. - #### Note that this does not optimize re-ordering. */ - if (!EQ (elt[len], old_elt[len]) - || !internal_equal (elt[len+1], old_elt[len+1], 0)) - alist = Fcons (Fcons (elt[len], elt[len+1]), alist); - } - - { - Lisp_Object result = alist_to_tagged_vector (elt[0], alist); - free_alist (alist); - RETURN_UNGCPRO (result); - } -} - -DEFUN ("set-instantiator-property", Fset_instantiator_property, - 3, 3, 0, /* -Destructively set the property KEYWORD of INSTANTIATOR to VALUE. -If the property is not set then it is added to a copy of the -instantiator and the new instantiator returned. -Use `set-glyph-image' on glyphs to register instantiator changes. */ - (instantiator, keyword, value)) -{ - Lisp_Object *elt; - int len; - - CHECK_VECTOR (instantiator); - if (!KEYWORDP (keyword)) - signal_simple_error ("instantiator property must be a keyword", keyword); - - elt = XVECTOR_DATA (instantiator); - len = XVECTOR_LENGTH (instantiator); - - for (len -= 2; len >= 1; len -= 2) - { - if (EQ (elt[len], keyword)) - { - elt[len+1] = value; - break; - } - } - - /* Didn't find it so add it. */ - if (len < 1) - { - Lisp_Object alist = Qnil, result; - struct gcpro gcpro1; - - GCPRO1 (alist); - alist = tagged_vector_to_alist (instantiator); - alist = Fcons (Fcons (keyword, value), alist); - result = alist_to_tagged_vector (elt[0], alist); - free_alist (alist); - RETURN_UNGCPRO (result); - } - - return instantiator; -} - void check_valid_string (Lisp_Object data) { CHECK_STRING (data); } -void -check_valid_vector (Lisp_Object data) -{ - CHECK_VECTOR (data); -} - -void +static void check_valid_face (Lisp_Object data) { Fget_face (data); @@ -633,90 +461,7 @@ alist_to_tagged_vector (Lisp_Object tag, Lisp_Object alist) return Fvector (len, elt); } -#ifdef ERROR_CHECK_GLYPHS -static int -check_instance_cache_mapper (Lisp_Object key, Lisp_Object value, - void *flag_closure) -{ - /* This function can GC */ - /* value can be nil; we cache failures as well as successes */ - if (!NILP (value)) - { - Lisp_Object window; - VOID_TO_LISP (window, flag_closure); - assert (EQ (XIMAGE_INSTANCE_DOMAIN (value), window)); - } - - return 0; -} - -void -check_window_subwindow_cache (struct window* w) -{ - Lisp_Object window; - - XSETWINDOW (window, w); - - assert (!NILP (w->subwindow_instance_cache)); - elisp_maphash (check_instance_cache_mapper, - w->subwindow_instance_cache, - LISP_TO_VOID (window)); -} - -void -check_image_instance_structure (Lisp_Object instance) -{ - /* Weird nothing images exist at startup when the console is - deleted. */ - if (!NOTHING_IMAGE_INSTANCEP (instance)) - { - assert (DOMAIN_LIVE_P (instance)); - assert (VECTORP (XIMAGE_INSTANCE_INSTANTIATOR (instance))); - } - if (WINDOWP (XIMAGE_INSTANCE_DOMAIN (instance))) - check_window_subwindow_cache - (XWINDOW (XIMAGE_INSTANCE_DOMAIN (instance))); -} -#endif - -/* Determine what kind of domain governs the image instance. - Verify that the given domain is at least as specific, and extract - the governing domain from it. */ static Lisp_Object -get_image_instantiator_governing_domain (Lisp_Object instantiator, - Lisp_Object domain) -{ - int governing_domain; - - struct image_instantiator_methods *meths = - decode_image_instantiator_format (INSTANTIATOR_TYPE (instantiator), - ERROR_ME); - governing_domain = IIFORMAT_METH_OR_GIVEN (meths, governing_domain, (), - GOVERNING_DOMAIN_DEVICE); - - if (governing_domain == GOVERNING_DOMAIN_WINDOW - && NILP (DOMAIN_WINDOW (domain))) - signal_simple_error_2 ("Domain for this instantiator must be resolvable to a window", - instantiator, domain); - else if (governing_domain == GOVERNING_DOMAIN_FRAME - && NILP (DOMAIN_FRAME (domain))) - signal_simple_error_2 - ("Domain for this instantiator must be resolvable to a frame", - instantiator, domain); - - if (governing_domain == GOVERNING_DOMAIN_WINDOW) - domain = DOMAIN_WINDOW (domain); - else if (governing_domain == GOVERNING_DOMAIN_FRAME) - domain = DOMAIN_FRAME (domain); - else if (governing_domain == GOVERNING_DOMAIN_DEVICE) - domain = DOMAIN_DEVICE (domain); - else - abort (); - - return domain; -} - -Lisp_Object normalize_image_instantiator (Lisp_Object instantiator, Lisp_Object contype, Lisp_Object dest_mask) @@ -727,9 +472,8 @@ normalize_image_instantiator (Lisp_Object instantiator, if (STRINGP (instantiator)) instantiator = process_image_string_instantiator (instantiator, contype, XINT (dest_mask)); - /* Subsequent validation will pick this up. */ - if (!VECTORP (instantiator)) - return instantiator; + + assert (VECTORP (instantiator)); /* We have to always store the actual pixmap data and not the filename even though this is a potential memory pig. We have to do this because it is quite possible that we will need to @@ -737,91 +481,37 @@ normalize_image_instantiator (Lisp_Object instantiator, longer exist (e.g. w3 pixmaps are almost always from temporary files). */ { - struct gcpro gcpro1; - struct image_instantiator_methods *meths; - - GCPRO1 (instantiator); - - meths = decode_image_instantiator_format (INSTANTIATOR_TYPE (instantiator), - ERROR_ME); - RETURN_UNGCPRO (IIFORMAT_METH_OR_GIVEN (meths, normalize, - (instantiator, contype, dest_mask), - instantiator)); + struct image_instantiator_methods * meths = + decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], + ERROR_ME); + return IIFORMAT_METH_OR_GIVEN (meths, normalize, + (instantiator, contype), + instantiator); } } 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, - IMAGE_INSTANCEP (domain) ? - domain : glyph, instantiator); - 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; GCPRO1 (ii); - if (!valid_image_instantiator_format_p (INSTANTIATOR_TYPE (instantiator), - DOMAIN_DEVICE (governing_domain))) - signal_simple_error - ("Image instantiator format is invalid in this locale.", - instantiator); - - meths = decode_image_instantiator_format (INSTANTIATOR_TYPE (instantiator), + meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], ERROR_ME); - 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), - INSTANTIATOR_TYPE (instantiator), - ERROR_ME_NOT); - - if (!HAS_IIFORMAT_METH_P (meths, instantiate) - && (!device_meths || !HAS_IIFORMAT_METH_P (device_meths, instantiate))) + if (!HAS_IIFORMAT_METH_P (meths, instantiate)) signal_simple_error ("Don't know how to instantiate this image instantiator?", instantiator); + IIFORMAT_METH (meths, instantiate, (ii, instantiator, pointer_fg, + pointer_bg, dest_mask, domain)); + UNGCPRO; - /* In general native window system methods will require sane - geometry values, thus the instance needs to have been laid-out - before they get called. */ - image_instance_layout (ii, XIMAGE_INSTANCE_WIDTH (ii), - XIMAGE_INSTANCE_HEIGHT (ii), - IMAGE_UNCHANGED_GEOMETRY, - IMAGE_UNCHANGED_GEOMETRY, domain); - - MAYBE_IIFORMAT_METH (device_meths, instantiate, (ii, instantiator, pointer_fg, - pointer_bg, dest_mask, domain)); - /* Do post instantiation. */ - MAYBE_IIFORMAT_METH (meths, post_instantiate, (ii, instantiator, domain)); - MAYBE_IIFORMAT_METH (device_meths, post_instantiate, (ii, instantiator, domain)); - - /* We're done. */ - IMAGE_INSTANCE_INITIALIZED (p) = 1; - /* Now that we're done verify that we really are laid out. */ - if (IMAGE_INSTANCE_LAYOUT_CHANGED (p)) - image_instance_layout (ii, XIMAGE_INSTANCE_WIDTH (ii), - XIMAGE_INSTANCE_HEIGHT (ii), - IMAGE_UNCHANGED_GEOMETRY, - IMAGE_UNCHANGED_GEOMETRY, domain); - - /* We *must* have a clean image at this point. */ - IMAGE_INSTANCE_TEXT_CHANGED (p) = 0; - IMAGE_INSTANCE_SIZE_CHANGED (p) = 0; - IMAGE_INSTANCE_LAYOUT_CHANGED (p) = 0; - IMAGE_INSTANCE_DIRTYP (p) = 0; - - assert ( XIMAGE_INSTANCE_HEIGHT (ii) >= 0 - && XIMAGE_INSTANCE_WIDTH (ii) >= 0 ); - - ERROR_CHECK_IMAGE_INSTANCE (ii); - - RETURN_UNGCPRO (ii); + return ii; } @@ -832,67 +522,33 @@ instantiate_image_instantiator (Lisp_Object governing_domain, 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); - mark_object (i->instantiator); - /* Is this legal in marking? We may get in the situation where the - domain has been deleted - making the instance unusable. It seems - better to remove the domain so that it can be finalized. */ - if (!DOMAIN_LIVE_P (i->domain)) - i->domain = Qnil; - else - mark_object (i->domain); + struct Lisp_Image_Instance *i = XIMAGE_INSTANCE (obj); - /* We don't mark the glyph reference since that would create a - circularity preventing GC. Ditto the instantiator. */ + (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_SUBWINDOW_FACE (i)); - mark_object (IMAGE_INSTANCE_WIDGET_ITEMS (i)); - mark_object (IMAGE_INSTANCE_LAYOUT_CHILDREN (i)); - mark_object (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (i)); - mark_object (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i)); - mark_object (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i)); case IMAGE_SUBWINDOW: + /* #### implement me */ break; - default: break; } - /* The image may have been previously finalized (yes that's weird, - see Fdelete_frame() and mark_window_as_deleted()), in which case - the domain will be nil, so cope with this. */ - if (!NILP (IMAGE_INSTANCE_DEVICE (i))) - MAYBE_DEVMETH (XDEVICE (IMAGE_INSTANCE_DEVICE (i)), - mark_image_instance, (i)); + MAYBE_DEVMETH (XDEVICE (i->device), mark_image_instance, (i, markobj)); return i->device; } @@ -902,7 +558,7 @@ print_image_instance (Lisp_Object obj, Lisp_Object printcharfun, 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>", @@ -916,7 +572,7 @@ print_image_instance (Lisp_Object obj, Lisp_Object printcharfun, 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)) { @@ -989,53 +645,15 @@ print_image_instance (Lisp_Object obj, Lisp_Object printcharfun, } break; - case IMAGE_WIDGET: - print_internal (IMAGE_INSTANCE_WIDGET_TYPE (ii), printcharfun, 0); - - if (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_ITEM (ii))) - { - write_c_string (" ", printcharfun); - print_internal (IMAGE_INSTANCE_WIDGET_TEXT (ii), printcharfun, 1); - } - - if (!NILP (IMAGE_INSTANCE_WIDGET_FACE (ii))) - { - write_c_string (" face=", printcharfun); - print_internal - (IMAGE_INSTANCE_WIDGET_FACE (ii), printcharfun, 0); - } - /* fallthrough */ - case IMAGE_SUBWINDOW: - sprintf (buf, " %dx%d", IMAGE_INSTANCE_WIDTH (ii), - IMAGE_INSTANCE_HEIGHT (ii)); - write_c_string (buf, printcharfun); - - /* This is stolen from frame.c. Subwindows are strange in that they - are specific to a particular frame so we want to print in their - description what that frame is. */ - - write_c_string (" on #<", printcharfun); - { - struct frame* f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); - - if (!FRAME_LIVE_P (f)) - write_c_string ("dead", printcharfun); - else - write_c_string (DEVICE_TYPE_NAME (XDEVICE (FRAME_DEVICE (f))), - printcharfun); - } - write_c_string ("-frame>", printcharfun); - sprintf (buf, " 0x%p", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); - write_c_string (buf, printcharfun); - + /* #### implement me */ 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); @@ -1044,48 +662,29 @@ print_image_instance (Lisp_Object obj, Lisp_Object printcharfun, static void finalize_image_instance (void *header, int for_disksave) { - Lisp_Image_Instance *i = (Lisp_Image_Instance *) header; + struct Lisp_Image_Instance *i = (struct 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))) + 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; + 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)) +image_instance_equal (Lisp_Object o1, Lisp_Object o2, int depth) +{ + struct Lisp_Image_Instance *i1 = XIMAGE_INSTANCE (o1); + struct Lisp_Image_Instance *i2 = XIMAGE_INSTANCE (o2); + struct device *d1 = XDEVICE (i1->device); + struct device *d2 = XDEVICE (i2->device); + + if (d1 != d2) return 0; - if (!internal_equal (IMAGE_INSTANCE_NAME (i1), IMAGE_INSTANCE_NAME (i2), - depth + 1)) + if (IMAGE_INSTANCE_TYPE (i1) != IMAGE_INSTANCE_TYPE (i2)) return 0; - if (!internal_equal (IMAGE_INSTANCE_INSTANTIATOR (i1), - IMAGE_INSTANCE_INSTANTIATOR (i2), + if (!internal_equal (IMAGE_INSTANCE_NAME (i1), IMAGE_INSTANCE_NAME (i2), depth + 1)) return 0; @@ -1104,10 +703,12 @@ image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) 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), @@ -1121,85 +722,23 @@ image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) return 0; break; - 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) - && internal_equal (IMAGE_INSTANCE_WIDGET_PROPS (i1), - IMAGE_INSTANCE_WIDGET_PROPS (i2), - depth + 1) - && internal_equal (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i1), - IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (i2), - depth + 1) - && internal_equal (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i1), - IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (i2), - depth + 1) - )) - return 0; - break; - case IMAGE_SUBWINDOW: - if (!(IMAGE_INSTANCE_SUBWINDOW_ID (i1) == - IMAGE_INSTANCE_SUBWINDOW_ID (i2))) - return 0; + /* #### implement me */ break; default: 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 = HASH5 (LISP_HASH (IMAGE_INSTANCE_DOMAIN (i)), - IMAGE_INSTANCE_WIDTH (i), - IMAGE_INSTANCE_MARGIN_WIDTH (i), - IMAGE_INSTANCE_HEIGHT (i), - internal_hash (IMAGE_INSTANCE_INSTANTIATOR (i), - depth + 1)); - - 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)) { @@ -1214,78 +753,43 @@ image_instance_hash (Lisp_Object obj, int depth) 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)), - 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)); case IMAGE_SUBWINDOW: - hash = HASH2 (hash, (EMACS_INT) IMAGE_INSTANCE_SUBWINDOW_ID (i)); + /* #### implement me */ 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 parent, - Lisp_Object instantiator) +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 = parent; - lp->instantiator = instantiator; - /* So that layouts get done. */ - lp->layout_changed = 1; - lp->initialized = 0; - XSETIMAGE_INSTANCE (val, lp); - MARK_GLYPHS_CHANGED; - return val; } @@ -1301,7 +805,6 @@ decode_image_instance_type (Lisp_Object type, Error_behavior errb) if (EQ (type, Qcolor_pixmap)) return IMAGE_COLOR_PIXMAP; if (EQ (type, Qpointer)) return IMAGE_POINTER; if (EQ (type, Qsubwindow)) return IMAGE_SUBWINDOW; - if (EQ (type, Qwidget)) return IMAGE_WIDGET; maybe_signal_simple_error ("Invalid image-instance type", type, Qimage, errb); @@ -1320,7 +823,6 @@ encode_image_instance_type (enum image_instance_type type) case IMAGE_COLOR_PIXMAP: return Qcolor_pixmap; case IMAGE_POINTER: return Qpointer; case IMAGE_SUBWINDOW: return Qsubwindow; - case IMAGE_WIDGET: return Qwidget; default: abort (); } @@ -1329,6 +831,16 @@ encode_image_instance_type (enum image_instance_type type) } 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; @@ -1380,7 +892,7 @@ incompatible_image_types (Lisp_Object instantiator, int given_dest_mask, (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), @@ -1397,7 +909,7 @@ valid_image_instance_type_p (Lisp_Object type) 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)) { @@ -1413,11 +925,11 @@ Return a list of valid image-instance types. } Error_behavior -decode_error_behavior_flag (Lisp_Object noerror) +decode_error_behavior_flag (Lisp_Object no_error) { - if (NILP (noerror)) return ERROR_ME; - else if (EQ (noerror, Qt)) return ERROR_ME_NOT; - else return ERROR_ME_WARN; + if (NILP (no_error)) return ERROR_ME; + else if (EQ (no_error, Qt)) return ERROR_ME_NOT; + else return ERROR_ME_WARN; } Lisp_Object @@ -1434,47 +946,28 @@ encode_error_behavior_flag (Error_behavior errb) } } -/* 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; - if (IMAGE_INSTANCEP (data)) - signal_simple_error ("Image instances not allowed here", data); - image_validate (data); - domain = decode_domain (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); 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 (INSTANTIATOR_TYPE (data), 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); + if (VECTORP (data) && EQ (XVECTOR_DATA (data)[0], Qinherit)) + signal_simple_error ("inheritance not allowed here", data); + ii = instantiate_image_instantiator (device, device, data, + Qnil, Qnil, dest_mask); RETURN_UNGCPRO (ii); } @@ -1488,7 +981,7 @@ However, it may occasionally be useful to explicitly create image 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 @@ -1513,72 +1006,37 @@ be generated. The recognized image instance types are '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. - -NOERROR controls what happens when the image cannot be generated. +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, noerror)) + (data, device, dest_types, no_error)) { - Error_behavior errb = decode_error_behavior_flag (noerror); + 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, /* @@ -1597,7 +1055,6 @@ The return value will be one of 'nothing, 'text, 'mono-pixmap, (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); return encode_image_instance_type (XIMAGE_INSTANCE_TYPE (image_instance)); } @@ -1610,80 +1067,25 @@ Return the name of the given image instance. 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. +This will only be non-nil for text image instances. */ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); if (XIMAGE_INSTANCE_TYPE (image_instance) == IMAGE_TEXT) return XIMAGE_INSTANCE_TEXT_STRING (image_instance); - else if (XIMAGE_INSTANCE_TYPE (image_instance) == IMAGE_WIDGET) - return XIMAGE_INSTANCE_WIDGET_TEXT (image_instance); else return Qnil; } -DEFUN ("image-instance-property", Fimage_instance_property, 2, 2, 0, /* -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. -*/ - (image_instance, prop)) -{ - 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), - type, ERROR_ME_NOT); - if (meths && HAS_IIFORMAT_METH_P (meths, property) - && - !UNBOUNDP (ret = IIFORMAT_METH (meths, property, (image_instance, prop)))) - { - return ret; - } - /* ... then format specific methods ... */ - meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT); - if (meths && HAS_IIFORMAT_METH_P (meths, property) - && - !UNBOUNDP (ret = IIFORMAT_METH (meths, property, (image_instance, prop)))) - { - return ret; - } - /* ... then fail */ - return Qnil; -} - DEFUN ("image-instance-file-name", Fimage_instance_file_name, 1, 1, 0, /* Return the file name from which IMAGE-INSTANCE was read, if known. */ (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1703,7 +1105,6 @@ Return the file name from which IMAGE-INSTANCE's mask was read, if known. (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1724,7 +1125,6 @@ This is 0 for a bitmap, or a positive integer for a pixmap. (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1744,16 +1144,13 @@ Return the height of the image instance, in pixels. (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: - case IMAGE_SUBWINDOW: - case IMAGE_WIDGET: - return make_int (XIMAGE_INSTANCE_HEIGHT (image_instance)); + return make_int (XIMAGE_INSTANCE_PIXMAP_HEIGHT (image_instance)); default: return Qnil; @@ -1766,16 +1163,13 @@ Return the width of the image instance, in pixels. (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: - case IMAGE_SUBWINDOW: - case IMAGE_WIDGET: - return make_int (XIMAGE_INSTANCE_WIDTH (image_instance)); + return make_int (XIMAGE_INSTANCE_PIXMAP_WIDTH (image_instance)); default: return Qnil; @@ -1793,7 +1187,6 @@ This will always be nil for a non-pointer image instance. (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1818,7 +1211,6 @@ This will always be nil for a non-pointer image instance. (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1840,7 +1232,6 @@ colorized mono pixmaps and for pointers.) (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1849,12 +1240,6 @@ colorized mono pixmaps and for pointers.) case IMAGE_POINTER: return XIMAGE_INSTANCE_PIXMAP_FG (image_instance); - case IMAGE_WIDGET: - return FACE_FOREGROUND ( - XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_FRAME - (image_instance)); - default: return Qnil; } @@ -1868,7 +1253,6 @@ colorized mono pixmaps and for pointers.) (image_instance)) { CHECK_IMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); switch (XIMAGE_INSTANCE_TYPE (image_instance)) { @@ -1877,12 +1261,6 @@ colorized mono pixmaps and for pointers.) case IMAGE_POINTER: return XIMAGE_INSTANCE_PIXMAP_BG (image_instance); - case IMAGE_WIDGET: - return FACE_BACKGROUND ( - XIMAGE_INSTANCE_WIDGET_FACE (image_instance), - XIMAGE_INSTANCE_FRAME - (image_instance)); - default: return Qnil; } @@ -1902,18 +1280,14 @@ instance is a mono pixmap; otherwise, the same image instance is returned. 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, 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 @@ -1924,265 +1298,51 @@ instance is a mono pixmap; otherwise, the same image instance is returned. return new; } - + /************************************************************************/ -/* Geometry calculations */ +/* error helpers */ /************************************************************************/ - -/* 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) +DOESNT_RETURN +signal_image_error (CONST char *reason, Lisp_Object frob) { - 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); - } + signal_error (Qimage_conversion_error, + list2 (build_translated_string (reason), frob)); } -/* 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 specify something (layout widgets). */ -void -image_instance_layout (Lisp_Object image_instance, - int width, int height, - int xoffset, int yoffset, - Lisp_Object domain) +DOESNT_RETURN +signal_image_error_2 (CONST char *reason, Lisp_Object frob0, Lisp_Object frob1) { - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object type; - struct image_instantiator_methods* meths; - - ERROR_CHECK_IMAGE_INSTANCE (image_instance); - - /* Nothing is as nothing does. */ - if (NOTHING_IMAGE_INSTANCEP (image_instance)) - return; - - /* We don't want carefully calculated offsets to be mucked up by - random layouts. */ - if (xoffset != IMAGE_UNCHANGED_GEOMETRY) - XIMAGE_INSTANCE_XOFFSET (image_instance) = xoffset; - if (yoffset != IMAGE_UNCHANGED_GEOMETRY) - XIMAGE_INSTANCE_YOFFSET (image_instance) = yoffset; - - assert (XIMAGE_INSTANCE_YOFFSET (image_instance) >= 0 - && XIMAGE_INSTANCE_XOFFSET (image_instance) >= 0); - - /* 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. */ - image_instance_query_geometry (image_instance, - &dwidth, &dheight, - IMAGE_DESIRED_GEOMETRY, - domain); - /* 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; + signal_error (Qimage_conversion_error, + list3 (build_translated_string (reason), frob0, frob1)); +} - type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii)); - meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT); +/**************************************************************************** + * nothing * + ****************************************************************************/ - MAYBE_IIFORMAT_METH (meths, layout, - (image_instance, width, height, xoffset, yoffset, - domain)); - /* Do not clear the dirty flag here - redisplay will do this for - us at the end. */ - IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 0; +static int +nothing_possible_dest_types (void) +{ + return IMAGE_NOTHING_MASK; } -/* Update an image instance from its changed instantiator. */ static void -update_image_instance (Lisp_Object image_instance, - Lisp_Object instantiator) +nothing_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, + Lisp_Object pointer_fg, Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain) { - struct image_instantiator_methods* meths; - Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - ERROR_CHECK_IMAGE_INSTANCE (image_instance); + if (dest_mask & IMAGE_NOTHING_MASK) + IMAGE_INSTANCE_TYPE (ii) = IMAGE_NOTHING; + else + incompatible_image_types (instantiator, dest_mask, IMAGE_NOTHING_MASK); +} - if (NOTHING_IMAGE_INSTANCEP (image_instance)) - return; - - assert (!internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, 0) - || (internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, 0) - && internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, -10))); - - /* If the instantiator is identical then do nothing. We must use - equal here because the specifier code copies the instantiator. */ - if (!internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, 0)) - { - /* Extract the changed properties so that device / format - methods only have to cope with these. We assume that - normalization has already been done. */ - Lisp_Object diffs = find_instantiator_differences - (instantiator, - IMAGE_INSTANCE_INSTANTIATOR (ii)); - Lisp_Object type = encode_image_instance_type - (IMAGE_INSTANCE_TYPE (ii)); - struct gcpro gcpro1; - GCPRO1 (diffs); - - /* try device specific methods first ... */ - meths = decode_device_ii_format (image_instance_device (image_instance), - type, ERROR_ME_NOT); - MAYBE_IIFORMAT_METH (meths, update, (image_instance, diffs)); - /* ... then format specific methods ... */ - meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT); - MAYBE_IIFORMAT_METH (meths, update, (image_instance, diffs)); - - /* Instance and therefore glyph has changed so mark as dirty. - If we don't do this output optimizations will assume the - glyph is unchanged. */ - set_image_instance_dirty_p (image_instance, 1); - /* Structure has changed. */ - IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 1; - - UNGCPRO; - } - /* We should now have a consistent instantiator so keep a record of - it. It is important that we don't actually update the window - system widgets here - we must do that when redisplay tells us - to. - - #### should we delay doing this until the display is up-to-date - also? */ - IMAGE_INSTANCE_INSTANTIATOR (ii) = instantiator; -} - -/* - * 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_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_error (Qimage_conversion_error, - list3 (build_translated_string (reason), frob0, frob1)); -} - -/**************************************************************************** - * nothing * - ****************************************************************************/ - -static int -nothing_possible_dest_types (void) -{ - return IMAGE_NOTHING_MASK; -} - -static void -nothing_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); - - if (dest_mask & IMAGE_NOTHING_MASK) - { - IMAGE_INSTANCE_TYPE (ii) = IMAGE_NOTHING; - IMAGE_INSTANCE_HEIGHT (ii) = 0; - IMAGE_INSTANCE_WIDTH (ii) = 0; - } - else - incompatible_image_types (instantiator, dest_mask, IMAGE_NOTHING_MASK); -} - - -/**************************************************************************** - * inherit * - ****************************************************************************/ + +/**************************************************************************** + * inherit * + ****************************************************************************/ static void inherit_validate (Lisp_Object instantiator) @@ -2191,8 +1351,7 @@ inherit_validate (Lisp_Object instantiator) } static Lisp_Object -inherit_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) +inherit_normalize (Lisp_Object inst, Lisp_Object console_type) { Lisp_Object face; @@ -2235,151 +1394,25 @@ string_possible_dest_types (void) 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); + Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); + struct 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))); + 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); - - CHECK_STRING (string); - - /* 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 void -text_update (Lisp_Object image_instance, Lisp_Object instantiator) -{ - Lisp_Object val = find_keyword_in_vector (instantiator, Q_data); - - if (!NILP (val)) - { - CHECK_STRING (val); - XIMAGE_INSTANCE_TEXT_STRING (image_instance) = val; - } -} - /**************************************************************************** * formatted-string * @@ -2403,12 +1436,20 @@ formatted_string_instantiate (Lisp_Object image_instance, 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); } @@ -2442,7 +1483,7 @@ potential_pixmap_file_instantiator (Lisp_Object instantiator, if (!NILP (file) && NILP (data)) { Lisp_Object retval = MAYBE_LISP_CONTYPE_METH - (decode_console_type(console_type, ERROR_ME), + (decode_console_type(console_type, ERROR_ME), locate_pixmap_file, (file)); if (!NILP (retval)) @@ -2450,7 +1491,7 @@ potential_pixmap_file_instantiator (Lisp_Object instantiator, else return Fcons (file, Qnil); /* should have been file */ } - + return Qnil; } @@ -2473,7 +1514,7 @@ simple_image_type_normalize (Lisp_Object inst, Lisp_Object console_type, Note that if we cannot generate any regular inline data, we skip out. */ - 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 */ @@ -2559,9 +1600,7 @@ xbm_validate (Lisp_Object instantiator) -- maybe return an error, or return Qnil. */ -#ifdef HAVE_X_WINDOWS -#include <X11/Xlib.h> -#else +#ifndef HAVE_X_WINDOWS #define XFree(data) free(data) #endif @@ -2572,11 +1611,11 @@ bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot, unsigned int w, h; Extbyte *data; int result; - const char *filename_ext; + CONST char *filename_ext; - LISP_STRING_TO_EXTERNAL (name, filename_ext, Qfile_name); - result = read_bitmap_data_from_file (filename_ext, &w, &h, - (unsigned char **) &data, xhot, yhot); + GET_C_STRING_FILENAME_DATA_ALLOCA (name, filename_ext); + result = read_bitmap_data_from_file (filename_ext, &w, &h, + &data, xhot, yhot); if (result == BitmapSuccess) { @@ -2584,8 +1623,8 @@ bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot, int len = (w + 7) / 8 * h; retval = list3 (make_int (w), make_int (h), - make_ext_string (data, len, Qbinary)); - XFree (data); + make_ext_string (data, len, FORMAT_BINARY)); + XFree ((char *) data); return retval; } @@ -2636,11 +1675,11 @@ xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file, && !NILP (file)) { mask_file = MAYBE_LISP_CONTYPE_METH - (decode_console_type(console_type, ERROR_ME), + (decode_console_type(console_type, ERROR_ME), locate_pixmap_file, (concat2 (file, build_string ("Mask")))); if (NILP (mask_file)) mask_file = MAYBE_LISP_CONTYPE_METH - (decode_console_type(console_type, ERROR_ME), + (decode_console_type(console_type, ERROR_ME), locate_pixmap_file, (concat2 (file, build_string ("msk")))); } @@ -2660,8 +1699,7 @@ xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file, /* Normalize method for XBM's. */ static Lisp_Object -xbm_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) +xbm_normalize (Lisp_Object inst, Lisp_Object console_type) { Lisp_Object file = Qnil, mask_file = Qnil; struct gcpro gcpro1, gcpro2, gcpro3; @@ -2729,82 +1767,20 @@ xbm_possible_dest_types (void) IMAGE_POINTER_MASK; } -#endif - - -#ifdef HAVE_XFACE -/********************************************************************** - * X-Face * - **********************************************************************/ - static void -xface_validate (Lisp_Object instantiator) -{ - file_or_data_must_be_present (instantiator); -} - -static Lisp_Object -xface_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) +xbm_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 file = Qnil, mask_file = Qnil; - struct gcpro gcpro1, gcpro2, gcpro3; - Lisp_Object alist = Qnil; - - GCPRO3 (file, mask_file, alist); - - /* Now, convert any file data into inline data for both the regular - data and the mask data. At the end of this, `data' will contain - the inline data (if any) or Qnil, and `file' will contain - the name this data was derived from (if known) or Qnil. - Likewise for `mask_file' and `mask_data'. - - Note that if we cannot generate any regular inline data, we - skip out. */ - - file = potential_pixmap_file_instantiator (inst, Q_file, Q_data, - console_type); - mask_file = potential_pixmap_file_instantiator (inst, Q_mask_file, - Q_mask_data, console_type); - - if (CONSP (file)) /* failure locating filename */ - signal_double_file_error ("Opening bitmap file", - "no such file or directory", - Fcar (file)); - - if (NILP (file) && NILP (mask_file)) /* no conversion necessary */ - RETURN_UNGCPRO (inst); - - alist = tagged_vector_to_alist (inst); - - { - Lisp_Object data = make_string_from_file (file); - alist = remassq_no_quit (Q_file, alist); - /* there can't be a :data at this point. */ - alist = Fcons (Fcons (Q_file, file), - Fcons (Fcons (Q_data, data), alist)); - } + Lisp_Object device= IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (image_instance)); - alist = xbm_mask_file_munging (alist, file, mask_file, console_type); - - { - Lisp_Object result = alist_to_tagged_vector (Qxface, alist); - free_alist (alist); - RETURN_UNGCPRO (result); - } -} - -static int -xface_possible_dest_types (void) -{ - return - IMAGE_MONO_PIXMAP_MASK | - IMAGE_COLOR_PIXMAP_MASK | - IMAGE_POINTER_MASK; + MAYBE_DEVMETH (XDEVICE (device), + xbm_instantiate, + (image_instance, instantiator, pointer_fg, + pointer_bg, dest_mask, domain)); } -#endif /* HAVE_XFACE */ +#endif #ifdef HAVE_XPM @@ -2813,23 +1789,13 @@ xface_possible_dest_types (void) * XPM * **********************************************************************/ -#ifdef HAVE_GTK -/* Gtk has to be gratuitously different, eh? */ -Lisp_Object -pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid) -{ - return (make_string_from_file (name)); -} -#else Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid) { char **data; int result; - char *fname = 0; - LISP_STRING_TO_EXTERNAL (name, fname, Qfile_name); - result = XpmReadFileToData (fname, &data); + result = XpmReadFileToData ((char *) XSTRING_DATA (name), &data); if (result == XpmSuccess) { @@ -2902,7 +1868,6 @@ pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid) return Qnil; /* not reached */ } -#endif /* !HAVE_GTK */ static void check_valid_xpm_color_symbols (Lisp_Object data) @@ -2961,8 +1926,7 @@ evaluate_xpm_color_symbols (void) } static Lisp_Object -xpm_normalize (Lisp_Object inst, Lisp_Object console_type, - Lisp_Object dest_mask) +xpm_normalize (Lisp_Object inst, Lisp_Object console_type) { Lisp_Object file = Qnil; Lisp_Object color_symbols; @@ -2979,7 +1943,7 @@ xpm_normalize (Lisp_Object inst, Lisp_Object console_type, Note that if we cannot generate any regular inline data, we skip out. */ - 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 */ @@ -2993,7 +1957,7 @@ xpm_normalize (Lisp_Object inst, Lisp_Object console_type, if (NILP (file) && !UNBOUNDP (color_symbols)) /* no conversion necessary */ RETURN_UNGCPRO (inst); - + alist = tagged_vector_to_alist (inst); if (!NILP (file)) @@ -3004,7 +1968,7 @@ xpm_normalize (Lisp_Object inst, Lisp_Object console_type, alist = Fcons (Fcons (Q_file, file), Fcons (Fcons (Q_data, data), alist)); } - + if (UNBOUNDP (color_symbols)) { color_symbols = evaluate_xpm_color_symbols (); @@ -3028,6 +1992,19 @@ xpm_possible_dest_types (void) IMAGE_POINTER_MASK; } +static void +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 device= IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (image_instance)); + + MAYBE_DEVMETH (XDEVICE (device), + xpm_instantiate, + (image_instance, instantiator, pointer_fg, + pointer_bg, dest_mask, domain)); +} + #endif /* HAVE_XPM */ @@ -3040,7 +2017,7 @@ DEFINE_SPECIFIER_TYPE (image); 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; @@ -3048,63 +2025,18 @@ image_create (Lisp_Object obj) } static void -image_mark (Lisp_Object obj) -{ - Lisp_Specifier *image = XIMAGE_SPECIFIER (obj); - - mark_object (IMAGE_SPECIFIER_ATTACHEE (image)); - mark_object (IMAGE_SPECIFIER_ATTACHEE_PROPERTY (image)); -} - -static int -instantiator_eq_equal (Lisp_Object obj1, Lisp_Object obj2) +image_mark (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - if (EQ (obj1, obj2)) - return 1; + struct Lisp_Specifier *image = XIMAGE_SPECIFIER (obj); - else if (CONSP (obj1) && CONSP (obj2)) - { - return instantiator_eq_equal (XCAR (obj1), XCAR (obj2)) - && - instantiator_eq_equal (XCDR (obj1), XCDR (obj2)); - } - return 0; -} - -static hashcode_t -instantiator_eq_hash (Lisp_Object obj) -{ - if (CONSP (obj)) - { - /* no point in worrying about tail recursion, since we're not - going very deep */ - return HASH2 (instantiator_eq_hash (XCAR (obj)), - instantiator_eq_hash (XCDR (obj))); - } - return LISP_HASH (obj); -} - -/* We need a special hash table for storing image instances. */ -Lisp_Object -make_image_instance_cache_hash_table (void) -{ - return make_general_lisp_hash_table - (instantiator_eq_hash, instantiator_eq_equal, - 30, -1.0, -1.0, - HASH_TABLE_KEY_CAR_VALUE_WEAK); + ((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)); @@ -3120,22 +2052,17 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, 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)); @@ -3146,174 +2073,98 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec, instantiator); } else - signal_simple_error_2 ("Wrong domain for image instance", - instantiator, domain); + signal_simple_error_2 ("Wrong device for image instance", + instantiator, device); } - /* How ugly !! An image instanciator that uses a kludgy syntax to snarf in - face properties. There's a design flaw here. -- didier */ else if (VECTORP (instantiator) - && EQ (INSTANTIATOR_TYPE (instantiator), Qinherit)) + && EQ (XVECTOR_DATA (instantiator)[0], Qinherit)) { assert (XVECTOR_LENGTH (instantiator) == 3); return (FACE_PROPERTY_INSTANCE (Fget_face (XVECTOR_DATA (instantiator)[2]), - Qbackground_pixmap, domain, 1, depth)); + Qbackground_pixmap, domain, 0, depth)); } else { - Lisp_Object instance = Qnil; - Lisp_Object subtable = Qnil; - /* #### Should this be GCPRO'd? */ - Lisp_Object hash_key = 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) { pointer_fg = FACE_FOREGROUND (Vpointer_face, domain); pointer_bg = FACE_BACKGROUND (Vpointer_face, domain); - hash_key = list4 (glyph, INSTANTIATOR_TYPE (instantiator), - pointer_fg, pointer_bg); - } - else - /* We cannot simply key on the glyph since fallbacks could use - the same glyph but have a totally different instantiator - type. Thus we key on the glyph and the type (but not any - other parts of the instantiator. */ - hash_key = list2 (glyph, INSTANTIATOR_TYPE (instantiator)); - - /* First look in the device cache. */ - if (DEVICEP (governing_domain)) - { - 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_image_instance_cache_hash_table (); - - Fputhash (make_int (dest_mask), subtable, - XDEVICE (governing_domain)->image_instance_cache); - instance = Qunbound; - } - else - { - instance = Fgethash (hash_key, subtable, Qunbound); - } + ls3 = list3 (instantiator, pointer_fg, pointer_bg); } - else if (WINDOWP (governing_domain)) + + /* First look in the hash table. */ + subtable = Fgethash (make_int (dest_mask), d->image_instance_cache, + Qunbound); + if (UNBOUNDP (subtable)) { - /* Subwindows have a per-window cache and have to be treated - differently. */ - instance = - Fgethash (hash_key, - XWINDOW (governing_domain)->subwindow_instance_cache, - Qunbound); + /* 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_hashtable (20, + pointerp ? HASHTABLE_KEY_CAR_WEAK + : HASHTABLE_KEY_WEAK, + pointerp ? HASHTABLE_EQUAL + : HASHTABLE_EQ); + Fputhash (make_int (dest_mask), subtable, + d->image_instance_cache); + instance = Qunbound; } else - abort (); /* We're not allowed anything else currently. */ + instance = Fgethash (pointerp ? ls3 : instantiator, + subtable, Qunbound); - /* If we don't have an instance at this point then create - one. */ if (UNBOUNDP (instance)) { Lisp_Object locative = noseeum_cons (Qnil, - noseeum_cons (hash_key, - DEVICEP (governing_domain) ? subtable - : XWINDOW (governing_domain) - ->subwindow_instance_cache)); + noseeum_cons (pointerp ? ls3 : instantiator, + 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 - if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance)) - & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK)) - assert (EQ (XIMAGE_INSTANCE_FRAME (instance), - DOMAIN_FRAME (domain))); -#endif unbind_to (speccount, Qnil); -#ifdef ERROR_CHECK_GLYPHS - if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance)) - & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK)) - assert (EQ (Fgethash (hash_key, - XWINDOW (governing_domain) - ->subwindow_instance_cache, - Qunbound), instance)); -#endif } - else if (NILP (instance)) - signal_simple_error ("Can't instantiate image (probably cached)", - instantiator); - /* We found an instance. However, because we are using the glyph - as the hash key instead of the instantiator, the current - instantiator may not be the same as the original. Thus we - must update the instance based on the new - instantiator. Preserving instance identity like this is - important to stop excessive window system widget creation and - deletion - and hence flashing. */ else - { - /* #### This function should be able to cope with *all* - changes to the instantiator, but currently only copes - with the most used properties. This means that it is - possible to make changes that don't get reflected in the - display. */ - update_image_instance (instance, instantiator); - free_list (hash_key); - } + free_list (ls3); -#ifdef ERROR_CHECK_GLYPHS - if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance)) - & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK)) - assert (EQ (XIMAGE_INSTANCE_FRAME (instance), - DOMAIN_FRAME (domain))); -#endif - ERROR_CHECK_IMAGE_INSTANCE (instance); - RETURN_UNGCPRO (instance); + if (NILP (instance)) + signal_simple_error ("Can't instantiate image (probably cached)", + instantiator); + return instance; } abort (); @@ -3391,11 +2242,7 @@ image_after_change (Lisp_Object specifier, Lisp_Object locale) Lisp_Object property = IMAGE_SPECIFIER_ATTACHEE_PROPERTY (XIMAGE_SPECIFIER (specifier)); if (FACEP (attachee)) - { - face_property_was_changed (attachee, property, locale); - if (BUFFERP (locale)) - XBUFFER (locale)->buffer_local_face_property = 1; - } + face_property_was_changed (attachee, property, locale); else if (GLYPHP (attachee)) glyph_property_was_changed (attachee, property, locale); } @@ -3404,7 +2251,7 @@ void 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; @@ -3459,79 +2306,166 @@ image_going_to_add (Lisp_Object specifier, Lisp_Object locale, 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); +DEFUN ("image-specifier-p", Fimage_specifier_p, 1, 1, 0, /* +Return non-nil if OBJECT is an image specifier. - instantiator = Fcopy_sequence (instantiator); - elt = XVECTOR_DATA (instantiator); - instantiator_len = XVECTOR_LENGTH (instantiator); +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 - 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. +'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 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. 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/GIF24 image; only if PNG support was compiled into this XEmacs. + Can be instanced as `color-pixmap'.) +'tiff + (A TIFF image; not currently implemented.) +'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.) +'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', 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)) { @@ -3544,14 +2478,14 @@ See `make-image-specifier' for a description of image instantiators. ****************************************************************************/ static Lisp_Object -mark_glyph (Lisp_Object obj) +mark_glyph (Lisp_Object obj, void (*markobj) (Lisp_Object)) { - Lisp_Glyph *glyph = XGLYPH (obj); + struct Lisp_Glyph *glyph = XGLYPH (obj); - mark_object (glyph->image); - mark_object (glyph->contrib_p); - mark_object (glyph->baseline); - mark_object (glyph->face); + ((markobj) (glyph->image)); + ((markobj) (glyph->contrib_p)); + ((markobj) (glyph->baseline)); + ((markobj) (glyph->face)); return glyph->plist; } @@ -3559,7 +2493,7 @@ mark_glyph (Lisp_Object obj) 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) @@ -3580,10 +2514,10 @@ print_glyph (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) This isn't concerned with "unspecified" attributes, that's what #'glyph-differs-from-default-p is for. */ static int -glyph_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) +glyph_equal (Lisp_Object o1, Lisp_Object o2, int depth) { - Lisp_Glyph *g1 = XGLYPH (obj1); - Lisp_Glyph *g2 = XGLYPH (obj2); + struct Lisp_Glyph *g1 = XGLYPH (o1); + struct Lisp_Glyph *g2 = XGLYPH (o2); depth++; @@ -3608,7 +2542,7 @@ glyph_hash (Lisp_Object obj, int depth) 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; @@ -3621,9 +2555,9 @@ glyph_getprop (Lisp_Object obj, Lisp_Object prop) 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)) @@ -3639,9 +2573,9 @@ glyph_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value) 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)) @@ -3656,7 +2590,7 @@ glyph_remprop (Lisp_Object obj, Lisp_Object prop) 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); @@ -3667,21 +2601,12 @@ glyph_plist (Lisp_Object obj) 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, @@ -3690,18 +2615,17 @@ allocate_glyph (enum glyph_type type, { /* 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_SUBWINDOW_MASK | IMAGE_WIDGET_MASK; + IMAGE_NOTHING_MASK | IMAGE_TEXT_MASK | IMAGE_MONO_PIXMAP_MASK | + IMAGE_COLOR_PIXMAP_MASK | IMAGE_SUBWINDOW_MASK; break; case GLYPH_POINTER: XIMAGE_SPECIFIER_ALLOWED (g->image) = @@ -3709,8 +2633,7 @@ allocate_glyph (enum glyph_type type, 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 (); @@ -3787,7 +2710,7 @@ Return a list of valid glyph types. } DEFUN ("make-glyph-internal", Fmake_glyph_internal, 0, 1, 0, /* -Create and return a new uninitialized glyph of type TYPE. +Create and return a new uninitialized glyph or type TYPE. TYPE specifies the type of the glyph; this should be one of `buffer', `pointer', or `icon', and defaults to `buffer'. The type of the glyph @@ -3816,13 +2739,11 @@ iconified. Their image can be instantiated as `mono-pixmap' and 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)) { @@ -3838,63 +2759,77 @@ The return value will be one of 'buffer, 'pointer, or 'icon. CHECK_GLYPH (glyph); switch (XGLYPH_TYPE (glyph)) { - default: abort (); case GLYPH_BUFFER: return Qbuffer; case GLYPH_POINTER: return Qpointer; case GLYPH_ICON: return Qicon; + default: + abort (); + return Qnil; /* not reached */ } } -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, - IMAGE_UNCHANGED_GEOMETRY, - IMAGE_UNCHANGED_GEOMETRY, domain); + 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; - return XIMAGE_INSTANCE_WIDTH (instance); + case IMAGE_SUBWINDOW: + /* #### implement me */ + return 0; + + default: + abort (); + return 0; + } } DEFUN ("glyph-width", Fglyph_width, 1, 2, 0, /* @@ -3907,66 +2842,123 @@ that redisplay will. 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)); } -unsigned short -glyph_ascent (Lisp_Object glyph_or_image, Lisp_Object domain) -{ - Lisp_Object instance = glyph_image_instance_maybe (glyph_or_image, - domain); - if (!IMAGE_INSTANCEP (instance)) - return 0; +#define RETURN_ASCENT 0 +#define RETURN_DESCENT 1 +#define RETURN_HEIGHT 2 - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) - image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNCHANGED_GEOMETRY, - IMAGE_UNCHANGED_GEOMETRY, domain); +Lisp_Object +glyph_image_instance (Lisp_Object glyph, Lisp_Object domain, + Error_behavior errb, int no_quit) +{ + Lisp_Object specifier = GLYPH_IMAGE (XGLYPH (glyph)); - if (XIMAGE_INSTANCE_TYPE (instance) == IMAGE_TEXT) - return XIMAGE_INSTANCE_TEXT_ASCENT (instance); - else - return XIMAGE_INSTANCE_HEIGHT (instance); + /* This can never return Qunbound. All glyphs have 'nothing as + a fallback. */ + return specifier_instance (specifier, Qunbound, domain, errb, no_quit, 0, + Qzero); } -unsigned short -glyph_descent (Lisp_Object glyph_or_image, Lisp_Object domain) +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 = glyph_image_instance_maybe (glyph_or_image, - domain); + 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; - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) - image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNCHANGED_GEOMETRY, - IMAGE_UNCHANGED_GEOMETRY, domain); + 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 */ + } + } - if (XIMAGE_INSTANCE_TYPE (instance) == IMAGE_TEXT) - return XIMAGE_INSTANCE_TEXT_DESCENT (instance); - else - return 0; + 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: + /* #### implement me */ + return 0; + + default: + abort (); + return 0; + } } -/* strictly a convenience function. */ unsigned short -glyph_height (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; + return glyph_height_internal (glyph, frame_face, window_findex, window, + RETURN_ASCENT); +} - if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) - image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNSPECIFIED_GEOMETRY, - IMAGE_UNCHANGED_GEOMETRY, - IMAGE_UNCHANGED_GEOMETRY, domain); +unsigned short +glyph_descent (Lisp_Object glyph, Lisp_Object frame_face, + face_index window_findex, Lisp_Object window) +{ + return glyph_height_internal (glyph, frame_face, window_findex, window, + RETURN_DESCENT); +} - return XIMAGE_INSTANCE_HEIGHT (instance); +/* strictly a convenience function. */ +unsigned short +glyph_height (Lisp_Object glyph, Lisp_Object frame_face, + face_index window_findex, Lisp_Object window) +{ + return glyph_height_internal (glyph, frame_face, window_findex, window, + RETURN_HEIGHT); } DEFUN ("glyph-ascent", Fglyph_ascent, 1, 2, 0, /* @@ -3979,7 +2971,7 @@ that redisplay will. 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, /* @@ -3992,7 +2984,7 @@ that redisplay will. 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. */ @@ -4006,45 +2998,12 @@ that redisplay will. XSETWINDOW (window, decode_window (window)); CHECK_GLYPH (glyph); - return make_int (glyph_height (glyph, 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; - } + return make_int (glyph_height (glyph, Qnil, DEFAULT_INDEX, window)); } -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? */ @@ -4100,48 +3059,20 @@ glyph_property_was_changed (Lisp_Object glyph, Lisp_Object property, (XGLYPH (glyph)->after_change) (glyph, property, locale); } -void -glyph_query_geometry (Lisp_Object glyph_or_image, int* width, int* height, - enum image_instance_geometry disp, Lisp_Object domain) -{ - Lisp_Object instance = glyph_or_image; - - if (GLYPHP (glyph_or_image)) - instance = glyph_image_instance (glyph_or_image, domain, ERROR_ME_NOT, 1); - - image_instance_query_geometry (instance, width, height, disp, domain); -} - -void -glyph_do_layout (Lisp_Object glyph_or_image, int width, int height, - int xoffset, int yoffset, Lisp_Object domain) -{ - Lisp_Object instance = glyph_or_image; - - if (GLYPHP (glyph_or_image)) - instance = glyph_image_instance (glyph_or_image, domain, ERROR_ME_NOT, 1); - - image_instance_layout (instance, width, height, xoffset, yoffset, domain); -} - /***************************************************************************** * glyph cachel functions * *****************************************************************************/ -/* #### All of this is 95% copied from face cachels. Consider - consolidating. - - 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; @@ -4151,7 +3082,7 @@ mark_glyph_cachels (glyph_cachel_dynarr *elements) for (elt = 0; elt < Dynarr_length (elements); elt++) { struct glyph_cachel *cachel = Dynarr_atp (elements, elt); - mark_object (cachel->glyph); + ((markobj) (cachel->glyph)); } } @@ -4159,32 +3090,19 @@ static void 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; @@ -4202,7 +3120,7 @@ add_glyph_cachel (struct window *w, Lisp_Object glyph) Dynarr_add (w->glyph_cachels, new_cachel); } -glyph_index +static glyph_index get_glyph_cachel_index (struct window *w, Lisp_Object glyph) { int elt; @@ -4217,7 +3135,8 @@ get_glyph_cachel_index (struct window *w, Lisp_Object glyph) 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; } } @@ -4260,24 +3179,7 @@ mark_glyph_cachels_as_not_updated (struct window *w) #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 @@ -4296,676 +3198,34 @@ compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels, #endif /* MEMORY_USAGE_STATS */ - - -/***************************************************************************** - * subwindow cachel functions * - *****************************************************************************/ -/* 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 - instantiator in the hashtable and when the instantiator goes away - we want the instance to go away also. However we also have a - 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. */ - -/* 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. */ -int -unmap_subwindow_instance_cache_mapper (Lisp_Object key, Lisp_Object value, - void* finalize) -{ - /* value can be nil; we cache failures as well as successes */ - if (!NILP (value)) - { - struct frame* f = XFRAME (XIMAGE_INSTANCE_FRAME (value)); - unmap_subwindow (value); - if (finalize) - { - /* In case GC doesn't catch up fast enough, remove from the frame - cache also. Otherwise code that checks the sanity of the instance - will fail. */ - XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)) - = delq_no_quit (value, - XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))); - finalize_image_instance (XIMAGE_INSTANCE (value), 0); - } - } - return 0; -} - -static void -finalize_all_subwindow_instances (struct window *w) -{ - if (!NILP (w->next)) finalize_all_subwindow_instances (XWINDOW (w->next)); - if (!NILP (w->vchild)) finalize_all_subwindow_instances (XWINDOW (w->vchild)); - if (!NILP (w->hchild)) finalize_all_subwindow_instances (XWINDOW (w->hchild)); - - elisp_maphash (unmap_subwindow_instance_cache_mapper, - w->subwindow_instance_cache, (void*)1); -} - -void -free_frame_subwindow_instances (struct frame* f) -{ - /* Make sure all instances are finalized. We have to do this via the - instance cache since some instances may be extant but not - displayed (and hence not in the frame cache). */ - finalize_all_subwindow_instances (XWINDOW (f->root_window)); -} - -/* Unmap all instances in the frame cache. */ -void -reset_frame_subwindow_instance_cache (struct frame* f) -{ - Lisp_Object rest; - - LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))) - { - Lisp_Object value = XCAR (rest); - unmap_subwindow (value); - } -} - -/***************************************************************************** - * subwindow exposure ignorance * - *****************************************************************************/ -/* 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) - { - /* Checking for exact matches just isn't good enough as we - might get exposures for partially obscured subwindows, thus - we have to check for overlaps. Being conservative, we will - check for exposures wholly contained by the subwindow - this - might give us what we want.*/ - if (ei->x <= (unsigned) x && ei->y <= (unsigned) y - && ei->x + ei->width >= (unsigned) (x + width) - && ei->y + ei->height >= (unsigned) (y + height)) - { -#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) <= (unsigned) x - && - IMAGE_INSTANCE_DISPLAY_Y (ii) <= (unsigned) y - && - IMAGE_INSTANCE_DISPLAY_X (ii) - + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) >= (unsigned) (x + width) - && - IMAGE_INSTANCE_DISPLAY_Y (ii) - + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) >= (unsigned) (y + height)) - { - return 1; - } - } - return 0; -} - - -/***************************************************************************** - * subwindow functions * - *****************************************************************************/ - -/* Update the displayed characteristics of a subwindow. This function - should generally only get called if the subwindow is actually - dirty. */ -void -redisplay_subwindow (Lisp_Object subwindow) -{ - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); - int count = specpdl_depth (); - - /* The update method is allowed to call eval. Since it is quite - common for this function to get called from somewhere in - redisplay we need to make sure that quits are ignored. Otherwise - Fsignal will abort. */ - specbind (Qinhibit_quit, Qt); - - ERROR_CHECK_IMAGE_INSTANCE (subwindow); - - if (WIDGET_IMAGE_INSTANCEP (subwindow)) - { - if (image_instance_changed (subwindow)) - redisplay_widget (subwindow); - /* Reset the changed flags. */ - IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) = 0; - IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 0; - IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii) = 0; - IMAGE_INSTANCE_TEXT_CHANGED (ii) = 0; - } - else if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW - && - !NILP (IMAGE_INSTANCE_FRAME (ii))) - { - MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), - redisplay_subwindow, (ii)); - } - - IMAGE_INSTANCE_SIZE_CHANGED (ii) = 0; - /* This function is typically called by redisplay just before - outputting the information to the screen. Thus we record a hash - of the output to determine whether on-screen is the same as - recorded structure. This approach has limitations in there is a - good chance that hash values will be different for the same - visual appearance. However, we would rather that then the other - way round - it simply means that we will get more displays than - we might need. We can get better hashing by making the depth - negative - currently it will recurse down 7 levels.*/ - IMAGE_INSTANCE_DISPLAY_HASH (ii) = internal_hash (subwindow, - IMAGE_INSTANCE_HASH_DEPTH); - - unbind_to (count, Qnil); -} - -/* Determine whether an image_instance has changed structurally and - hence needs redisplaying in some way. - - #### This should just look at the instantiator differences when we - get rid of the stored items altogether. In fact we should probably - store the new instantiator as well as the old - as we do with - gui_items currently - and then pick-up the new on the next - redisplay. This would obviate the need for any of this trickery - with hashcodes. */ -int -image_instance_changed (Lisp_Object subwindow) -{ - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); - - if (internal_hash (subwindow, IMAGE_INSTANCE_HASH_DEPTH) != - IMAGE_INSTANCE_DISPLAY_HASH (ii)) - return 1; - /* #### I think there is probably a bug here. This gets called for - layouts - and yet the pending items are always nil for - layouts. We are saved by layout optimization, but I'm undecided - as to what the correct fix is. */ - else if (WIDGET_IMAGE_INSTANCEP (subwindow) - && (!internal_equal (IMAGE_INSTANCE_WIDGET_ITEMS (ii), - IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii), 0) - || !NILP (IMAGE_INSTANCE_LAYOUT_CHILDREN (ii)) - || IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii))) - return 1; - else - return 0; -} - -/* Update all the subwindows on a frame. */ -void -update_widget_instances (Lisp_Object frame) -{ - struct frame* f; - Lisp_Object rest; - - /* Its possible for the preceding callback to have deleted the - frame, so cope with this. */ - if (!FRAMEP (frame) || !FRAME_LIVE_P (XFRAME (frame))) - return; - - CHECK_FRAME (frame); - f = XFRAME (frame); - - /* If we get called we know something has changed. */ - LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))) - { - Lisp_Object widget = XCAR (rest); - - if (XIMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (widget) - && - image_instance_changed (widget)) - { - set_image_instance_dirty_p (widget, 1); - MARK_FRAME_GLYPHS_CHANGED (f); - } - } -} - -/* remove a subwindow from its frame */ -void unmap_subwindow (Lisp_Object subwindow) -{ - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); - struct frame* f; - - ERROR_CHECK_IMAGE_INSTANCE (subwindow); - - if (!image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) - & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK) - || - !IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii)) - return; - -#ifdef DEBUG_WIDGETS - stderr_out ("unmapping subwindow %p\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)); - IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 0; - - MAYBE_DEVMETH (XDEVICE (IMAGE_INSTANCE_DEVICE (ii)), - unmap_subwindow, (ii)); -} - -/* show a subwindow in its frame */ -void map_subwindow (Lisp_Object subwindow, int x, int y, - struct display_glyph_area *dga) -{ - Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); - struct frame* f; - - ERROR_CHECK_IMAGE_INSTANCE (subwindow); - - if (!image_instance_type_to_mask (IMAGE_INSTANCE_TYPE (ii)) - & (IMAGE_WIDGET_MASK | IMAGE_SUBWINDOW_MASK)) - return; - -#ifdef DEBUG_WIDGETS - stderr_out ("mapping subwindow %p, %dx%d@%d+%d\n", - IMAGE_INSTANCE_SUBWINDOW_ID (ii), - dga->width, dga->height, x, y); -#endif - f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); - IMAGE_INSTANCE_DISPLAY_X (ii) = x; - IMAGE_INSTANCE_DISPLAY_Y (ii) = y; - IMAGE_INSTANCE_DISPLAY_WIDTH (ii) = dga->width; - IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) = dga->height; - - MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), - map_subwindow, (ii, x, y, dga)); - IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 1; -} - -static int -subwindow_possible_dest_types (void) -{ - 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); - 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_DISPLAYEDP (ii) = 0; - - if (INTP (width)) - { - int w = 1; - if (XINT (width) > 1) - w = XINT (width); - IMAGE_INSTANCE_WIDTH (ii) = w; - IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0; - } - - if (INTP (height)) - { - int h = 1; - if (XINT (height) > 1) - h = XINT (height); - IMAGE_INSTANCE_HEIGHT (ii) = h; - IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0; - } -} - -/* This is just a backup in case no-one has assigned a suitable geometry. - #### It should really query the enclose window for geometry. */ -static void -subwindow_query_geometry (Lisp_Object image_instance, int* width, - int* height, enum image_instance_geometry disp, - Lisp_Object domain) -{ - if (width) *width = 20; - if (height) *height = 20; -} - -DEFUN ("subwindowp", Fsubwindowp, 1, 1, 0, /* -Return non-nil if OBJECT is a subwindow. -*/ - (object)) -{ - CHECK_IMAGE_INSTANCE (object); - return (XIMAGE_INSTANCE_TYPE (object) == IMAGE_SUBWINDOW) ? Qt : Qnil; -} - -DEFUN ("image-instance-subwindow-id", Fimage_instance_subwindow_id, 1, 1, 0, /* -Return the window id of SUBWINDOW as a number. -*/ - (subwindow)) -{ - CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow); - return make_int ((EMACS_INT) XIMAGE_INSTANCE_SUBWINDOW_ID (subwindow)); -} - -DEFUN ("resize-subwindow", Fresize_subwindow, 1, 3, 0, /* -Resize SUBWINDOW to WIDTH x HEIGHT. -If a value is nil that parameter is not changed. -*/ - (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); - else - neww = XINT (width); - - if (NILP (height)) - newh = IMAGE_INSTANCE_HEIGHT (ii); - else - newh = XINT (height); - - /* The actual resizing gets done asynchronously by - update_subwindow. */ - IMAGE_INSTANCE_HEIGHT (ii) = newh; - IMAGE_INSTANCE_WIDTH (ii) = neww; - IMAGE_INSTANCE_SIZE_CHANGED (ii) = 1; - - return subwindow; -} - -DEFUN ("force-subwindow-map", Fforce_subwindow_map, 1, 1, 0, /* -Generate a Map event for SUBWINDOW. -*/ - (subwindow)) -{ - CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow); -#if 0 - map_subwindow (subwindow, 0, 0); -#endif - return subwindow; -} - /***************************************************************************** * display tables * *****************************************************************************/ -/* Get the display tables for use currently on window W with face - FACE. #### This will have to be redone. */ +/* Get the display table for use currently on window W with face FACE. + Precedence: -void -get_display_tables (struct window *w, face_index findex, - Lisp_Object *face_table, Lisp_Object *window_table) -{ - Lisp_Object tem; - tem = WINDOW_FACE_CACHEL_DISPLAY_TABLE (w, findex); - if (UNBOUNDP (tem)) - tem = Qnil; - if (!LISTP (tem)) - tem = noseeum_cons (tem, Qnil); - *face_table = tem; - tem = w->display_table; - if (UNBOUNDP (tem)) - tem = Qnil; - if (!LISTP (tem)) - tem = noseeum_cons (tem, Qnil); - *window_table = tem; -} - -Lisp_Object -display_table_entry (Emchar ch, Lisp_Object face_table, - Lisp_Object window_table) -{ - Lisp_Object tail; + -- FACE's display table + -- W's display table (comes from specifier `current-display-table') - /* Loop over FACE_TABLE, and then over WINDOW_TABLE. */ - for (tail = face_table; 1; tail = XCDR (tail)) - { - Lisp_Object table; - if (NILP (tail)) - { - if (!NILP (window_table)) - { - tail = window_table; - window_table = Qnil; - } - else - return Qnil; - } - table = XCAR (tail); + Ignore the specified tables if they are not valid; + if no valid table is specified, return 0. */ - if (VECTORP (table)) - { - if (ch < XVECTOR_LENGTH (table) && !NILP (XVECTOR_DATA (table)[ch])) - return XVECTOR_DATA (table)[ch]; - else - continue; - } - else if (CHAR_TABLEP (table) - && XCHAR_TABLE_TYPE (table) == CHAR_TABLE_TYPE_CHAR) - { - return get_char_table (ch, XCHAR_TABLE (table)); - } - else if (CHAR_TABLEP (table) - && XCHAR_TABLE_TYPE (table) == CHAR_TABLE_TYPE_GENERIC) - { - Lisp_Object gotit = get_char_table (ch, XCHAR_TABLE (table)); - if (!NILP (gotit)) - return gotit; - else - continue; - } - else if (RANGE_TABLEP (table)) - { - Lisp_Object gotit = Fget_range_table (make_char (ch), table, Qnil); - if (!NILP (gotit)) - return gotit; - else - continue; - } - else - 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)) +struct Lisp_Vector * +get_display_table (struct window *w, face_index findex) { - 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)); + Lisp_Object tem; - UNGCPRO; - } - return ret; -} + tem = WINDOW_FACE_CACHEL_DISPLAY_TABLE (w, findex); + if (VECTORP (tem) && XVECTOR_LENGTH (tem) == DISP_TABLE_SIZE) + return XVECTOR (tem); -void disable_glyph_animated_timeout (int i) -{ - Lisp_Object id; - XSETINT (id, i); + tem = w->display_table; + if (VECTORP (tem) && XVECTOR_LENGTH (tem) == DISP_TABLE_SIZE) + return XVECTOR (tem); - Fdisable_timeout (id); + return 0; } @@ -4976,9 +3236,6 @@ void disable_glyph_animated_timeout (int i) void syms_of_glyphs (void) { - INIT_LRECORD_IMPLEMENTATION (glyph); - INIT_LRECORD_IMPLEMENTATION (image_instance); - /* image instantiators */ DEFSUBR (Fimage_instantiator_format_list); @@ -4986,22 +3243,20 @@ syms_of_glyphs (void) DEFSUBR (Fset_console_type_image_conversion_list); DEFSUBR (Fconsole_type_image_conversion_list); - DEFKEYWORD (Q_file); - DEFKEYWORD (Q_data); - DEFKEYWORD (Q_face); - DEFKEYWORD (Q_pixel_height); - DEFKEYWORD (Q_pixel_width); + defkeyword (&Q_file, ":file"); + defkeyword (&Q_data, ":data"); + defkeyword (&Q_face, ":face"); #ifdef HAVE_XPM - DEFKEYWORD (Q_color_symbols); + defkeyword (&Q_color_symbols, ":color-symbols"); #endif #ifdef HAVE_WINDOW_SYSTEM - DEFKEYWORD (Q_mask_file); - DEFKEYWORD (Q_mask_data); - DEFKEYWORD (Q_hotspot_x); - DEFKEYWORD (Q_hotspot_y); - DEFKEYWORD (Q_foreground); - DEFKEYWORD (Q_background); + defkeyword (&Q_mask_file, ":mask-file"); + defkeyword (&Q_mask_data, ":mask-data"); + defkeyword (&Q_hotspot_x, ":hotspot-x"); + defkeyword (&Q_hotspot_y, ":hotspot-y"); + defkeyword (&Q_foreground, ":foreground"); + defkeyword (&Q_background, ":background"); #endif /* image specifiers */ @@ -5012,13 +3267,12 @@ syms_of_glyphs (void) defsymbol (&Qimage_instancep, "image-instance-p"); - DEFSYMBOL (Qnothing_image_instance_p); - DEFSYMBOL (Qtext_image_instance_p); - DEFSYMBOL (Qmono_pixmap_image_instance_p); - DEFSYMBOL (Qcolor_pixmap_image_instance_p); - DEFSYMBOL (Qpointer_image_instance_p); - DEFSYMBOL (Qwidget_image_instance_p); - DEFSYMBOL (Qsubwindow_image_instance_p); + defsymbol (&Qnothing_image_instance_p, "nothing-image-instance-p"); + defsymbol (&Qtext_image_instance_p, "text-image-instance-p"); + defsymbol (&Qmono_pixmap_image_instance_p, "mono-pixmap-image-instance-p"); + defsymbol (&Qcolor_pixmap_image_instance_p, "color-pixmap-image-instance-p"); + defsymbol (&Qpointer_image_instance_p, "pointer-image-instance-p"); + defsymbol (&Qsubwindow_image_instance_p, "subwindow-image-instance-p"); DEFSUBR (Fmake_image_instance); DEFSUBR (Fimage_instance_p); @@ -5026,7 +3280,6 @@ syms_of_glyphs (void) 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); @@ -5037,32 +3290,27 @@ syms_of_glyphs (void) DEFSUBR (Fimage_instance_hotspot_y); DEFSUBR (Fimage_instance_foreground); DEFSUBR (Fimage_instance_background); - DEFSUBR (Fimage_instance_property); DEFSUBR (Fcolorize_image_instance); - /* subwindows */ - DEFSUBR (Fsubwindowp); - DEFSUBR (Fimage_instance_subwindow_id); - DEFSUBR (Fresize_subwindow); - DEFSUBR (Fforce_subwindow_map); /* Qnothing defined as part of the "nothing" image-instantiator type. */ /* Qtext defined in general.c */ - DEFSYMBOL (Qmono_pixmap); - DEFSYMBOL (Qcolor_pixmap); + defsymbol (&Qmono_pixmap, "mono-pixmap"); + defsymbol (&Qcolor_pixmap, "color-pixmap"); /* Qpointer defined in general.c */ + defsymbol (&Qsubwindow, "subwindow"); /* glyphs */ - DEFSYMBOL (Qglyphp); - DEFSYMBOL (Qcontrib_p); - DEFSYMBOL (Qbaseline); + defsymbol (&Qglyphp, "glyphp"); + defsymbol (&Qcontrib_p, "contrib-p"); + defsymbol (&Qbaseline, "baseline"); - DEFSYMBOL (Qbuffer_glyph_p); - DEFSYMBOL (Qpointer_glyph_p); - DEFSYMBOL (Qicon_glyph_p); + defsymbol (&Qbuffer_glyph_p, "buffer-glyph-p"); + defsymbol (&Qpointer_glyph_p, "pointer-glyph-p"); + defsymbol (&Qicon_glyph_p, "icon-glyph-p"); - DEFSYMBOL (Qconst_glyph_variable); + defsymbol (&Qconst_glyph_variable, "const-glyph-variable"); DEFSUBR (Fglyph_type); DEFSUBR (Fvalid_glyph_type_p); @@ -5073,25 +3321,16 @@ syms_of_glyphs (void) DEFSUBR (Fglyph_ascent); DEFSUBR (Fglyph_descent); DEFSUBR (Fglyph_height); - DEFSUBR (Fset_instantiator_property); /* Qbuffer defined in general.c. */ /* Qpointer defined above */ - /* Unfortunately, timeout handlers must be lisp functions. This is - for animated glyphs. */ - DEFSYMBOL (Qglyph_animated_timeout_handler); - DEFSUBR (Fglyph_animated_timeout_handler); - /* Errors */ - DEFERROR_STANDARD (Qimage_conversion_error, Qio_error); -} + deferror (&Qimage_conversion_error, + "image-conversion-error", + "image-conversion error", Qio_error); -static const struct lrecord_description image_specifier_description[] = { - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct image_specifier, attachee) }, - { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct image_specifier, attachee_property) }, - { XD_END } -}; +} void specifier_type_create_image (void) @@ -5106,72 +3345,9 @@ specifier_type_create_image (void) 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 */ @@ -5182,8 +3358,6 @@ image_instantiator_format_create (void) Vimage_instantiator_format_list = Qnil; staticpro (&Vimage_instantiator_format_list); - dump_add_root_struct_ptr (&the_image_instantiator_format_entry_dynarr, &iifed_description); - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (nothing, "nothing"); IIFORMAT_HAS_METHOD (nothing, possible_dest_types); @@ -5201,39 +3375,18 @@ image_instantiator_format_create (void) 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, update); - 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); + IIFORMAT_VALID_KEYWORD (formatted_string, Q_data, check_valid_string); #ifdef HAVE_WINDOW_SYSTEM INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (xbm, "xbm"); @@ -5241,6 +3394,7 @@ image_instantiator_format_create (void) IIFORMAT_HAS_METHOD (xbm, validate); IIFORMAT_HAS_METHOD (xbm, normalize); IIFORMAT_HAS_METHOD (xbm, possible_dest_types); + IIFORMAT_HAS_METHOD (xbm, instantiate); IIFORMAT_VALID_KEYWORD (xbm, Q_data, check_valid_xbm_inline); IIFORMAT_VALID_KEYWORD (xbm, Q_file, check_valid_string); @@ -5252,27 +3406,13 @@ image_instantiator_format_create (void) IIFORMAT_VALID_KEYWORD (xbm, Q_background, check_valid_string); #endif /* HAVE_WINDOW_SYSTEM */ -#ifdef HAVE_XFACE - INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (xface, "xface"); - - IIFORMAT_HAS_METHOD (xface, validate); - IIFORMAT_HAS_METHOD (xface, normalize); - IIFORMAT_HAS_METHOD (xface, possible_dest_types); - - IIFORMAT_VALID_KEYWORD (xface, Q_data, check_valid_string); - IIFORMAT_VALID_KEYWORD (xface, Q_file, check_valid_string); - IIFORMAT_VALID_KEYWORD (xface, Q_hotspot_x, check_valid_int); - IIFORMAT_VALID_KEYWORD (xface, Q_hotspot_y, check_valid_int); - IIFORMAT_VALID_KEYWORD (xface, Q_foreground, check_valid_string); - IIFORMAT_VALID_KEYWORD (xface, Q_background, check_valid_string); -#endif - #ifdef HAVE_XPM INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (xpm, "xpm"); IIFORMAT_HAS_METHOD (xpm, validate); IIFORMAT_HAS_METHOD (xpm, normalize); IIFORMAT_HAS_METHOD (xpm, possible_dest_types); + IIFORMAT_HAS_METHOD (xpm, instantiate); IIFORMAT_VALID_KEYWORD (xpm, Q_data, check_valid_string); IIFORMAT_VALID_KEYWORD (xpm, Q_file, check_valid_string); @@ -5281,28 +3421,15 @@ image_instantiator_format_create (void) } 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, - Qpointer, Qsubwindow, Qwidget)); + Vimage_instance_type_list = list6 (Qnothing, Qtext, Qmono_pixmap, + Qcolor_pixmap, Qpointer, Qsubwindow); staticpro (&Vimage_instance_type_list); /* glyphs */ @@ -5338,9 +3465,7 @@ Normally this is three dots ("..."). What to display at the beginning of horizontally scrolled lines. */); Vhscroll_glyph = allocate_glyph (GLYPH_BUFFER, redisplay_glyph_changed); -#ifdef HAVE_WINDOW_SYSTEM - Fprovide (Qxbm); -#endif + #ifdef HAVE_XPM Fprovide (Qxpm); @@ -5357,15 +3482,6 @@ The default value of this variable defines the logical color names */ ); Vxpm_color_symbols = Qnil; /* initialized in x-faces.el */ #endif /* HAVE_XPM */ -#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 @@ -5378,61 +3494,21 @@ specifier_vars_of_glyphs (void) 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, 0); + 0, 0); } void diff --git a/src/gutter.c b/src/gutter.c index 55dc0f8..64d0df3 100644 --- a/src/gutter.c +++ b/src/gutter.c @@ -1,5 +1,5 @@ /* Gutter implementation. - Copyright (C) 1999, 2000 Andy Piper. + Copyright (C) 1999 Andy Piper. This file is part of XEmacs. @@ -20,8 +20,7 @@ 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 */ +/* Specifers ripped-off from toolbar.c */ #include <config.h> #include "lisp.h" @@ -46,32 +45,25 @@ 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 (); \ - } \ +#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) @@ -79,20 +71,18 @@ static int gutter_was_visible (struct frame* frame, enum gutter_pos pos) switch (pos) { case TOP_GUTTER: - return frame->top_gutter_was_visible; + return (frame)->top_gutter_was_visible; case BOTTOM_GUTTER: - return frame->bottom_gutter_was_visible; + return (frame)->bottom_gutter_was_visible; case LEFT_GUTTER: - return frame->left_gutter_was_visible; + return (frame)->left_gutter_was_visible; case RIGHT_GUTTER: - return frame->right_gutter_was_visible; + 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) { @@ -107,7 +97,6 @@ frame_topmost_window (struct frame *f) return w; } -#endif static Lisp_Object frame_bottommost_window (struct frame *f) @@ -170,11 +159,12 @@ frame_rightmost_window (struct frame *f) 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 +void get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y, int *width, int *height) { struct window + * top = XWINDOW (frame_topmost_window (f)), * bot = XWINDOW (frame_bottommost_window (f)); /* The top and bottom gutters take precedence over the left and right. */ @@ -183,34 +173,37 @@ get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y, case TOP_GUTTER: *x = FRAME_LEFT_BORDER_END (f); *y = FRAME_TOP_BORDER_END (f); - *width = FRAME_RIGHT_BORDER_START (f) + *width = FRAME_RIGHT_BORDER_START (f) - FRAME_LEFT_BORDER_END (f); *height = FRAME_TOP_GUTTER_BOUNDS (f); break; case BOTTOM_GUTTER: *x = FRAME_LEFT_BORDER_END (f); - *y = WINDOW_BOTTOM (bot); - *width = FRAME_RIGHT_BORDER_START (f) + *y = WINDOW_BOTTOM (bot) + - FRAME_BOTTOM_GUTTER_BOUNDS (f); + *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); + *y = WINDOW_TEXT_TOP (top); *width = FRAME_LEFT_GUTTER_BOUNDS (f); *height = WINDOW_BOTTOM (bot) - - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); + - (WINDOW_TEXT_TOP (top) + + FRAME_BOTTOM_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); + *y = WINDOW_TEXT_TOP (top); *width = FRAME_RIGHT_GUTTER_BOUNDS (f); *height = WINDOW_BOTTOM (bot) - - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); + - (WINDOW_TEXT_TOP (top) + + FRAME_BOTTOM_GUTTER_BOUNDS (f)); break; default: @@ -218,293 +211,99 @@ get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y, } } -/* - display_boxes_in_gutter_p - - Determine whether the required display_glyph_area is completely - inside the gutter. -1 means the display_box is not in the gutter. 1 - means the display_box and the display_glyph_area are in the - window. 0 means the display_box is in the gutter but the - display_glyph_area is not. */ -int display_boxes_in_gutter_p (struct frame *f, struct display_box* db, - struct display_glyph_area* dga) -{ - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) - { - if (FRAME_GUTTER_VISIBLE (f, pos)) - { - int x, y, width, height; - get_gutter_coords (f, pos, &x, &y, &width, &height); - if (db->xpos + dga->xoffset >= x - && - db->ypos + dga->yoffset >= y - && - db->xpos + dga->xoffset + dga->width <= x + width - && - db->ypos + dga->yoffset + dga->height <= y + height) - return 1; - else if (db->xpos >= x && db->ypos >= y - && db->xpos + db->width <= x + width - && db->ypos + db->height <= y + height) - return 0; - } - } - return -1; -} - -/* Convert the gutter specifier into something we can actually - display. */ -static Lisp_Object construct_window_gutter_spec (struct window* w, - enum gutter_pos pos) +static void +output_gutter (struct frame *f, enum gutter_pos pos) { - Lisp_Object rest, *args; - int nargs = 0; - Lisp_Object gutter = RAW_WINDOW_GUTTER (w, pos); + 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; + int border_width = FRAME_GUTTER_BORDER_WIDTH (f, pos); + face_index findex = get_builtin_face_cache_index (w, Vgui_element_face); + display_line_dynarr* ddla, *cdla; + struct display_line *dl; - if (STRINGP (gutter) || NILP (gutter)) - return gutter; + if (!f->current_display_lines) + f->current_display_lines = Dynarr_new (display_line); + if (!f->desired_display_lines) + f->desired_display_lines = Dynarr_new (display_line); + + ddla = f->desired_display_lines; + cdla = f->current_display_lines; - GET_LIST_LENGTH (gutter, nargs); - args = alloca_array (Lisp_Object, nargs >> 1); - nargs = 0; + XSETFRAME (frame, f); - for (rest = gutter; !NILP (rest); rest = XCDR (XCDR (rest))) + get_gutter_coords (f, pos, &x, &y, &width, &height); + /* clear out what we want to cover */ + /* 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); + /* Output each line. */ + for (line = 0; line < Dynarr_length (ddla); line++) { - /* 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)); - } + output_display_line (w, cdla, ddla, line, -1, -1); } - return Fconcat (nargs, args); -} + /* grab coordinates of last line and blank after it. */ + dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); + ypos = dl->ypos + dl->descent - dl->clip; + redisplay_clear_region (window, findex, x + border_width , ypos, + width - 2 * border_width, height - (ypos - y)); -/* Sizing gutters is a pain so we try and help the user by determining - what height will accommodate all lines. This is useless on left and - right gutters as we always have a maximal number of lines. */ -static int -calculate_gutter_size_from_display_lines (enum gutter_pos pos, - display_line_dynarr* ddla) -{ - int size = 0; - struct display_line *dl; - - /* For top and bottom the calculation is easy. */ - if (pos == TOP_GUTTER || pos == BOTTOM_GUTTER) - { - /* grab coordinates of last line */ - if (Dynarr_length (ddla)) - { - dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); - size = (dl->ypos + dl->descent - dl->clip) - - (Dynarr_atp (ddla, 0)->ypos - Dynarr_atp (ddla, 0)->ascent); - } - } - /* For left and right we have to do some maths. */ - else + /* bevel the gutter area if so desired */ + if (border_width != 0) { - int start_pos = 0, end_pos = 0, line; - for (line = 0; line < Dynarr_length (ddla); line++) - { - int block; - dl = Dynarr_atp (ddla, line); - - for (block = 0; block < Dynarr_largest (dl->display_blocks); block++) - { - struct display_block *db = Dynarr_atp (dl->display_blocks, block); - - if (db->type == TEXT) - { - start_pos = min (db->start_pos, start_pos); - end_pos = max (db->end_pos, end_pos); - } - } - } - size = end_pos - start_pos; + MAYBE_DEVMETH (d, bevel_area, + (w, findex, x, y, width, height, border_width)); } - - return size; } +/* sizing gutters is a pain so we try and help the user by detemining + what height will accomodate 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 count; + int ypos; display_line_dynarr* ddla; - Lisp_Object ret = Qnil; + 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)) + if (NILP (WINDOW_GUTTER (w, pos)) || - !FRAME_VISIBLE_P (f) - || - NILP (w->buffer)) + !FRAME_VISIBLE_P (f)) 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), - FRAME_TOP_BORDER_END (f), + 0, FRAME_RIGHT_BORDER_START (f) - FRAME_LEFT_BORDER_END (f), - FRAME_BOTTOM_BORDER_START (f) - - FRAME_TOP_BORDER_END (f), + 200, ddla, 0, 0); - - /* Let GC happen again. */ - unbind_to (count, Qnil); - - ret = make_int (calculate_gutter_size_from_display_lines (pos, ddla)); - free_display_lines (ddla); - - return ret; -} - -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])) + /* grab coordinates of last line */ + if (Dynarr_length (ddla)) { -#ifdef DEBUG_GUTTERS - printf ("gutter redisplay [%dx%d@%d+%d] triggered by %s,\n", - width, height, x, y, 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 && EQ (w->gutter_size[pos], Qautodetect) - && (dl->clip > 0 || - calculate_gutter_size_from_display_lines (pos, ddla) > - WINDOW_GUTTER_SIZE_INTERNAL (w, pos))) - { - /* #### 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)); - } + dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); + ypos = dl->ypos + dl->descent - dl->clip; + Dynarr_free (ddla); + return make_int (ypos); } 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); - } + Dynarr_free (ddla); + return Qnil; } - - w->gutter_extent_modiff [pos] = 0; } static void @@ -513,7 +312,7 @@ 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); + Vgui_element_face); get_gutter_coords (f, pos, &x, &y, &width, &height); SET_GUTTER_WAS_VISIBLE_FLAG (f, pos, 0); @@ -521,140 +320,24 @@ clear_gutter (struct frame *f, enum gutter_pos pos) 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_FRAME_LAYOUT_CHANGED (f); - } - - /* 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->frame_layout_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 || f->frame_layout_changed) + if (f->gutter_changed || f->frame_changed || f->clear) { - 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; - + int pos; /* and output */ - GUTTER_POS_LOOP (pos) + + for (pos = 0; pos < 4; pos++) { if (FRAME_GUTTER_VISIBLE (f, pos)) - output_gutter (f, pos, 0); - + output_gutter (f, pos); else if (gutter_was_visible (f, pos)) - clear_gutter (f, pos); + clear_gutter (f, pos); } - f->clip_changed = local_clip_changed; - f->buffers_changed = local_buffers_changed; - f->gutter_changed = 0; - } -} - -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]); } + f->gutter_changed = 0; } static void @@ -662,63 +345,54 @@ 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; + int newx, newy; 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) + if (((y + height) < g_y) || (y > (g_y + g_height))) 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); + if (f->current_display_lines) + Dynarr_reset (f->current_display_lines); + /* we have to do this in-case there were subwindows where we are + redrawing, unfortunately sometimes this also generates expose + events resulting in an endless cycle of redsplay. */ + newx = max (x, g_x); + newy = max (y, g_y); + width = min (x + width - newx, g_x + g_width - newx); + height = min (y + height - newy, g_y + g_height - newy); + redisplay_unmap_subwindows_maybe (f, newx, newy, width, height); /* 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); + output_gutter (f, pos); } 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); + int pos; + for (pos = 0; pos < 4; pos++) + { + if (FRAME_GUTTER_VISIBLE (f, pos)) + redraw_exposed_gutter (f, pos, x, y, width, height); + } } 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; - } - } + if (f->current_display_lines) + Dynarr_free (f->current_display_lines); + if (f->desired_display_lines) + Dynarr_free (f->desired_display_lines); } static enum gutter_pos @@ -761,15 +435,14 @@ See `default-gutter-position'. list1 (Fcons (Qnil, Qzero))); set_specifier_fallback (Vgutter_border_width[new], Vdefault_gutter_border_width); - set_specifier_fallback (Vgutter_visible_p[cur], list1 (Fcons (Qnil, Qt))); - set_specifier_fallback (Vgutter_visible_p[new], Vdefault_gutter_visible_p); - + set_specifier_fallback (Vgutter_visible_p[cur], + list1 (Fcons (Qnil, Qt))); + set_specifier_fallback (Vgutter_visible_p[new], + Vdefault_gutter_visible_p); Vdefault_gutter_position = position; unhold_frame_size_changes (); } - run_hook (Qdefault_gutter_position_changed_hook); - return position; } @@ -839,28 +512,20 @@ 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); - } - } + signal_simple_error ("Gutter spec must be string or nil", 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. +Gutter specifiers are used to specify the format of a gutter. +The values of the variables `default-gutter', `top-gutter', +`left-gutter', `right-gutter', and `bottom-gutter' are always +gutter specifiers. + +Valid gutter instantiators are called "gutter descriptors" +and are lists of vectors. See `default-gutter' for a description +of the exact format. */ (object)) { @@ -881,50 +546,22 @@ recompute_overlaying_specifier (Lisp_Object real_one[4]) static void gutter_specs_changed (Lisp_Object specifier, struct window *w, - Lisp_Object oldval, enum gutter_pos pos) + Lisp_Object oldval) { - 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])) + int pos; + for (pos = 0; pos< 4; pos++) { - w->real_gutter_size [pos] = calculate_gutter_size (w, pos); + w->real_gutter_size[pos] = w->gutter_size[pos]; + if (EQ (w->real_gutter_size[pos], Qautodetect) + && !NILP (w->gutter_visible_p[pos])) + { + w->real_gutter_size [pos] = calculate_gutter_size (w, pos); + } } MARK_GUTTER_CHANGED; - MARK_MODELINE_CHANGED; MARK_WINDOWS_CHANGED (w); } -/* 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) @@ -936,8 +573,8 @@ static void gutter_geometry_changed_in_window (Lisp_Object specifier, struct window *w, Lisp_Object oldval) { - enum gutter_pos pos; - GUTTER_POS_LOOP (pos) + int pos; + for (pos = 0; pos< 4; pos++) { w->real_gutter_size[pos] = w->gutter_size[pos]; if (EQ (w->real_gutter_size[pos], Qautodetect) @@ -946,9 +583,8 @@ gutter_geometry_changed_in_window (Lisp_Object specifier, struct window *w, w->real_gutter_size [pos] = calculate_gutter_size (w, pos); } } - + MARK_GUTTER_CHANGED; - MARK_MODELINE_CHANGED; MARK_WINDOWS_CHANGED (w); } @@ -973,143 +609,18 @@ default_gutter_visible_p_changed_in_window (Lisp_Object specifier, 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; + int 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) + for (pos = 0; pos< 4; 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])) @@ -1119,30 +630,16 @@ init_frame_gutters (struct frame *f) 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 @@ -1158,22 +655,9 @@ 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 @@ -1214,20 +698,21 @@ the visibility and thickness using `default-gutter-visible-p', 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. */ ); +The gutter value should be a string or nil. You can attach extents and +glyphs to the string and hence display glyphs and text in other fonts +in the gutter area. + +*/ ); 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), + slot_offset (struct window, + default_gutter), default_gutter_specs_changed, - 0, 0, 1); + 0, 0); DEFVAR_SPECIFIER ("top-gutter", &Vgutter[TOP_GUTTER] /* @@ -1237,9 +722,10 @@ 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, 1); + slot_offset (struct window, + gutter[TOP_GUTTER]), + gutter_specs_changed, + 0, 0); DEFVAR_SPECIFIER ("bottom-gutter", &Vgutter[BOTTOM_GUTTER] /* @@ -1254,9 +740,10 @@ 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, 1); + slot_offset (struct window, + gutter[BOTTOM_GUTTER]), + gutter_specs_changed, + 0, 0); DEFVAR_SPECIFIER ("left-gutter", &Vgutter[LEFT_GUTTER] /* @@ -1271,9 +758,10 @@ 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, 1); + slot_offset (struct window, + gutter[LEFT_GUTTER]), + gutter_specs_changed, + 0, 0); DEFVAR_SPECIFIER ("right-gutter", &Vgutter[RIGHT_GUTTER] /* @@ -1288,9 +776,10 @@ 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, 1); + slot_offset (struct window, + gutter[RIGHT_GUTTER]), + gutter_specs_changed, + 0, 0); /* initially, top inherits from default; this can be changed with `set-default-gutter-position'. */ @@ -1326,11 +815,12 @@ 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); + Vdefault_gutter_height = Fmake_specifier (Qgeneric); set_specifier_caching (Vdefault_gutter_height, - offsetof (struct window, default_gutter_height), + slot_offset (struct window, + default_gutter_height), default_gutter_size_changed_in_window, - 0, 0, 1); + 0, 0); DEFVAR_SPECIFIER ("default-gutter-width", &Vdefault_gutter_width /* *Width of the default gutter, if it's oriented vertically. @@ -1338,11 +828,12 @@ This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vdefault_gutter_width = Fmake_specifier (Qgutter_size); + Vdefault_gutter_width = Fmake_specifier (Qnatnum); set_specifier_caching (Vdefault_gutter_width, - offsetof (struct window, default_gutter_width), + slot_offset (struct window, + default_gutter_width), default_gutter_size_changed_in_window, - 0, 0, 1); + 0, 0); DEFVAR_SPECIFIER ("top-gutter-height", &Vgutter_size[TOP_GUTTER] /* @@ -1351,10 +842,12 @@ 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); + Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgeneric); set_specifier_caching (Vgutter_size[TOP_GUTTER], - offsetof (struct window, gutter_size[TOP_GUTTER]), - gutter_geometry_changed_in_window, 0, 0, 1); + slot_offset (struct window, + gutter_size[TOP_GUTTER]), + gutter_geometry_changed_in_window, + 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-height", &Vgutter_size[BOTTOM_GUTTER] /* @@ -1363,10 +856,12 @@ 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); + Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgeneric); set_specifier_caching (Vgutter_size[BOTTOM_GUTTER], - offsetof (struct window, gutter_size[BOTTOM_GUTTER]), - gutter_geometry_changed_in_window, 0, 0, 1); + slot_offset (struct window, + gutter_size[BOTTOM_GUTTER]), + gutter_geometry_changed_in_window, + 0, 0); DEFVAR_SPECIFIER ("left-gutter-width", &Vgutter_size[LEFT_GUTTER] /* @@ -1375,10 +870,12 @@ This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qgutter_size); + 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, 1); + slot_offset (struct window, + gutter_size[LEFT_GUTTER]), + gutter_geometry_changed_in_window, + 0, 0); DEFVAR_SPECIFIER ("right-gutter-width", &Vgutter_size[RIGHT_GUTTER] /* @@ -1387,23 +884,21 @@ This is a specifier; use `set-specifier' to change it. See `default-gutter-height' for more information. */ ); - Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qgutter_size); + 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, 1); + slot_offset (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_GTK - fb = Fcons (Fcons (list1 (Qgtk), 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)) @@ -1411,17 +906,14 @@ See `default-gutter-height' for more information. fb = Qnil; #ifdef HAVE_TTY - fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); + fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); #endif #ifdef HAVE_X_WINDOWS - fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb); -#endif -#ifdef HAVE_GTK - fb = Fcons (Fcons (list1 (Qgtk), Qautodetect), fb); + fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_WIDTH)), fb); #endif #ifdef HAVE_MS_WINDOWS - fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb); - fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb); + fb = Fcons (Fcons (list1 (Qmswindows), + make_int (DEFAULT_GUTTER_WIDTH)), fb); #endif if (!NILP (fb)) set_specifier_fallback (Vdefault_gutter_width, fb); @@ -1448,9 +940,10 @@ instead. */ ); Vdefault_gutter_border_width = Fmake_specifier (Qnatnum); set_specifier_caching (Vdefault_gutter_border_width, - offsetof (struct window, default_gutter_border_width), + slot_offset (struct window, + default_gutter_border_width), default_gutter_border_width_changed_in_window, - 0, 0, 0); + 0, 0); DEFVAR_SPECIFIER ("top-gutter-border-width", &Vgutter_border_width[TOP_GUTTER] /* @@ -1461,9 +954,10 @@ 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, 0); + slot_offset (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] /* @@ -1474,9 +968,10 @@ 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, 0); + slot_offset (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] /* @@ -1487,9 +982,10 @@ 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, 0); + slot_offset (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] /* @@ -1500,9 +996,10 @@ 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, 0); + slot_offset (struct window, + gutter_border_width[RIGHT_GUTTER]), + gutter_geometry_changed_in_window, + 0, 0); fb = Qnil; #ifdef HAVE_TTY @@ -1512,7 +1009,6 @@ See `default-gutter-height' for more information. 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)) @@ -1539,12 +1035,12 @@ 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); + Vdefault_gutter_visible_p = Fmake_specifier (Qboolean); set_specifier_caching (Vdefault_gutter_visible_p, - offsetof (struct window, - default_gutter_visible_p), + slot_offset (struct window, + default_gutter_visible_p), default_gutter_visible_p_changed_in_window, - 0, 0, 0); + 0, 0); DEFVAR_SPECIFIER ("top-gutter-visible-p", &Vgutter_visible_p[TOP_GUTTER] /* @@ -1553,11 +1049,12 @@ 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); + Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qboolean); set_specifier_caching (Vgutter_visible_p[TOP_GUTTER], - offsetof (struct window, - gutter_visible_p[TOP_GUTTER]), - top_gutter_specs_changed, 0, 0, 0); + slot_offset (struct window, + gutter_visible_p[TOP_GUTTER]), + gutter_geometry_changed_in_window, + 0, 0); DEFVAR_SPECIFIER ("bottom-gutter-visible-p", &Vgutter_visible_p[BOTTOM_GUTTER] /* @@ -1566,11 +1063,12 @@ 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); + Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qboolean); set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER], - offsetof (struct window, - gutter_visible_p[BOTTOM_GUTTER]), - bottom_gutter_specs_changed, 0, 0, 0); + slot_offset (struct window, + gutter_visible_p[BOTTOM_GUTTER]), + gutter_geometry_changed_in_window, + 0, 0); DEFVAR_SPECIFIER ("left-gutter-visible-p", &Vgutter_visible_p[LEFT_GUTTER] /* @@ -1579,11 +1077,12 @@ 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); + Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qboolean); set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER], - offsetof (struct window, - gutter_visible_p[LEFT_GUTTER]), - left_gutter_specs_changed, 0, 0, 0); + slot_offset (struct window, + gutter_visible_p[LEFT_GUTTER]), + gutter_geometry_changed_in_window, + 0, 0); DEFVAR_SPECIFIER ("right-gutter-visible-p", &Vgutter_visible_p[RIGHT_GUTTER] /* @@ -1592,11 +1091,12 @@ 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); + Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qboolean); set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER], - offsetof (struct window, - gutter_visible_p[RIGHT_GUTTER]), - right_gutter_specs_changed, 0, 0, 0); + slot_offset (struct window, + gutter_visible_p[RIGHT_GUTTER]), + gutter_geometry_changed_in_window, + 0, 0); /* initially, top inherits from default; this can be changed with `set-default-gutter-position'. */ @@ -1607,4 +1107,5 @@ See `default-gutter-visible-p' for more information. 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 --git a/src/gutter.h b/src/gutter.h index 0cd951f..d025865 100644 --- a/src/gutter.h +++ b/src/gutter.h @@ -20,12 +20,13 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: Not in FSF. */ -#ifndef INCLUDED_gutter_h_ -#define INCLUDED_gutter_h_ +#ifndef _XEMACS_GUTTER_H_ +#define _XEMACS_GUTTER_H_ #include "specifier.h" -#define DEVICE_SUPPORTS_GUTTERS_P(d) HAS_DEVMETH_P (d, output_frame_gutters) +#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) @@ -39,47 +40,34 @@ DECLARE_SPECIFIER_TYPE (gutter); enum gutter_pos { - TOP_GUTTER = 0, - BOTTOM_GUTTER = 1, - LEFT_GUTTER = 2, - RIGHT_GUTTER = 3 + TOP_GUTTER, + BOTTOM_GUTTER, + LEFT_GUTTER, + RIGHT_GUTTER }; -/* 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); -int display_boxes_in_gutter_p (struct frame *f, struct display_box* db, - struct display_glyph_area* dga); #define WINDOW_GUTTER_BORDER_WIDTH(w, pos) \ - (INTP ((w)->gutter_border_width[pos]) ? XINT ((w)->gutter_border_width[pos]) : 0) +(NILP ((w)->gutter_border_width[pos]) ? 0 : XINT ((w)->gutter_border_width[pos])) #define WINDOW_GUTTER_SIZE(w, pos) \ - (INTP ((w)->gutter_size[pos]) ? XINT ((w)->gutter_size[pos]) : 0) +(NILP ((w)->gutter_size[pos]) ? 0 : XINT ((w)->gutter_size[pos])) #define WINDOW_GUTTER_SIZE_INTERNAL(w, pos) \ - (INTP ((w)->real_gutter_size[pos]) ? XINT ((w)->real_gutter_size[pos]) : 0) +(NILP ((w)->real_gutter_size[pos]) ? 0 : XINT ((w)->real_gutter_size[pos])) #define WINDOW_GUTTER_VISIBLE(w, pos) \ - ((w)->gutter_visible_p[pos]) +((w)->gutter_visible_p[pos]) #define WINDOW_GUTTER(w, pos) \ - ((w)->real_gutter[pos]) -#define RAW_WINDOW_GUTTER(w, pos) \ - ((w)->gutter[pos]) +((w)->gutter[pos]) #define WINDOW_REAL_GUTTER_SIZE(w, pos) \ (!NILP (WINDOW_GUTTER_VISIBLE (w, pos)) \ @@ -98,13 +86,17 @@ int display_boxes_in_gutter_p (struct frame *f, struct display_box* db, /* these macros predicate size on position and type of window */ #define WINDOW_REAL_TOP_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,TOP_GUTTER) + ((!MINI_WINDOW_P (w) && window_is_highest (w)) ? \ + WINDOW_REAL_GUTTER_BOUNDS (w,TOP_GUTTER) : 0) #define WINDOW_REAL_BOTTOM_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,BOTTOM_GUTTER) + ((!MINI_WINDOW_P (w) && window_is_lowest (w)) ? \ + WINDOW_REAL_GUTTER_BOUNDS (w,BOTTOM_GUTTER) : 0) #define WINDOW_REAL_LEFT_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,LEFT_GUTTER) + ((!MINI_WINDOW_P (w) && window_is_leftmost (w)) ? \ + WINDOW_REAL_GUTTER_BOUNDS (w,LEFT_GUTTER) : 0) #define WINDOW_REAL_RIGHT_GUTTER_BOUNDS(w) \ - WINDOW_REAL_GUTTER_BOUNDS (w,RIGHT_GUTTER) + ((!MINI_WINDOW_P (w) && window_is_rightmost (w)) ? \ + WINDOW_REAL_GUTTER_BOUNDS (w,RIGHT_GUTTER) : 0) #define FRAME_GUTTER_VISIBLE(f, pos) \ WINDOW_REAL_GUTTER_VISIBLE (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) @@ -128,4 +120,4 @@ WINDOW_GUTTER (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) #define FRAME_RIGHT_GUTTER_BOUNDS(f) \ WINDOW_REAL_GUTTER_BOUNDS (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), RIGHT_GUTTER) -#endif /* INCLUDED_gutter_h_ */ +#endif /* _XEMACS_GUTTER_H_ */ diff --git a/src/indent.c b/src/indent.c index 0ef743f..9194ef8 100644 --- a/src/indent.c +++ b/src/indent.c @@ -40,8 +40,6 @@ Boston, MA 02111-1307, USA. */ #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 @@ column_at_point (struct buffer *buf, Bufpos init_pos, int cur_col) } 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 @@ -272,11 +223,11 @@ If BUFFER is nil, the current buffer is assumed. DEFUN ("indent-to", Findent_to, 1, 3, "NIndent to column: ", /* Indent from point with tabs and spaces until COLUMN is reached. -Optional second argument MINIMUM says always do at least MINIMUM spaces - even if that goes past COLUMN; by default, MINIMUM is zero. +Optional second argument MIN says always do at least MIN spaces + even if that goes past COLUMN; by default, MIN is zero. If BUFFER is nil, the current buffer is assumed. */ - (column, minimum, buffer)) + (col, minimum, buffer)) { /* This function can GC */ int mincol; @@ -285,7 +236,7 @@ If BUFFER is nil, the current buffer is assumed. int tab_width = XINT (buf->tab_width); Bufpos opoint = 0; - CHECK_INT (column); + CHECK_INT (col); if (NILP (minimum)) minimum = Qzero; else @@ -295,7 +246,7 @@ If BUFFER is nil, the current buffer is assumed. fromcol = current_column (buf); mincol = fromcol + XINT (minimum); - if (mincol < XINT (column)) mincol = XINT (column); + if (mincol < XINT (col)) mincol = XINT (col); if (fromcol == mincol) return make_int (mincol); @@ -391,11 +342,9 @@ and horizontal scrolling has no effect. 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 @@ Returns the actual column that it moved to. } /* 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 @@ vpix_motion (line_start_cache_dynarr *cache, int start, int end) 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 @@ Lisp_Object vertical_motion_1 (Lisp_Object lines, Lisp_Object window, 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 @@ Lisp_Object vertical_motion_1 (Lisp_Object lines, Lisp_Object window, 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 @@ vmotion_pixels (Lisp_Object window, Bufpos start, int pixels, int how, 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 @@ that the motion should be as close as possible to PIXELS. 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 @@ that the motion should be as close as possible to PIXELS. 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 @@ syms_of_indent (void) #endif DEFSUBR (Fvertical_motion); DEFSUBR (Fvertical_motion_pixels); - - defsymbol (&Qcoerce, "coerce"); } void diff --git a/src/input-method-xfs.c b/src/input-method-xfs.c new file mode 100644 index 0000000..ed9cd6d --- /dev/null +++ b/src/input-method-xfs.c @@ -0,0 +1,86 @@ +/* input-method-xfs.c provides just only locale initialize + for non Motif people. (stoled from input-method-xlib.c) + Why I made this code is to initialize X locale environment for + the purpose of use XFontSet correctly in lwlib/xlwmenu.c. + And this code donot provides input methods under Xlib while they + prefer to use Canna, Wnn, skk or something like that. + This code has been tested on FreeBSD 2.2.1 and Solaris2.5. + + Copyright (C) 1997 Kazuyuki IENAGA. + +This file is a 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 <config.h> +#include <X11/Xlocale.h> /* More portable than <locale.h> ? */ +#include "lisp.h" +#include "frame.h" +#include "device.h" +#include "window.h" +#include "buffer.h" +#include "console-x.h" +#include "EmacsFrame.h" +#include "events.h" + +#ifdef USE_XFONTSET +void +Initialize_Locale (void) +{ + char *locale; + + XtSetLanguageProc (NULL, (XtLanguageProc) NULL, NULL); + if ((locale = setlocale (LC_ALL, "")) == NULL) + { + 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) + { + stderr_out ("Can't even set locale to `C'!\n"); + return; + } + } + + if (!XSupportsLocale ()) + { + 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) + { + stderr_out ("Can't even set locale to `C'!\n"); + return; + } + if (!XSupportsLocale ()) + { + stderr_out ("X Windows does not even support locale `C'!\n"); + return; + } + } + + setlocale(LC_NUMERIC, "C"); + setlocale(LC_CTYPE, ""); /* take back CTYPE to previous state */ + + if (XSetLocaleModifiers ("") == NULL) + { + stderr_out ("XSetLocaleModifiers(\"\") failed\n"); + stderr_out ("Check the value of the XMODIFIERS environment variable.\n"); + } +} +#endif /* USE_XFONTSET */ diff --git a/src/insdel.c b/src/insdel.c index 937c3eb..01484b7 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -200,6 +200,7 @@ Boston, MA 02111-1307, USA. */ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "device.h" @@ -303,64 +304,65 @@ do \ 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) - - while (ptr < end) - { - if (BYTE_ASCII_P (*ptr)) + 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) { - /* 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; - } - } + if (!BYTE_ASCII_P (*ptr)) + goto bail; + count++, ptr++; } - else + /* Now do it. */ + while (ptr < aligned_end) { - /* 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++; + + if ((* (unsigned long *) ptr) & HIGH_BIT_MASK) + goto bail; + ptr += LONG_BYTES; + count += LONG_BYTES; } } +#endif /* LONGBITS == 32 || LONGBITS == 64 */ + + bail: + while (ptr < end) + { + 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 @@ bytecount_to_charcount (const Bufbyte *ptr, Bytecount len) 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) { @@ -1194,7 +1196,6 @@ bytind_to_bufpos (struct buffer *buf, Bytind x) Bufpos get_buffer_pos_char (struct buffer *b, Lisp_Object pos, unsigned int flags) { - /* Does not GC */ Bufpos ind; Bufpos min_allowed, max_allowed; @@ -1244,7 +1245,6 @@ void get_buffer_range_char (struct buffer *b, Lisp_Object from, Lisp_Object to, Bufpos *from_out, Bufpos *to_out, unsigned int flags) { - /* Does not GC */ Bufpos min_allowed, max_allowed; min_allowed = (flags & GB_ALLOW_PAST_ACCESSIBLE) ? @@ -1605,7 +1605,7 @@ static void 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); @@ -1617,7 +1617,7 @@ adjust_markers (struct buffer *buf, Memind from, Memind to, 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)) { @@ -1631,6 +1631,18 @@ adjust_markers_for_insert (struct buffer *buf, Memind ind, Bytecount amount) /* 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 @@ -1645,8 +1657,6 @@ gap_left (struct buffer *buf, Bytind pos) Bufbyte *to, *from; Bytecount i; Bytind new_s1; - struct buffer *mbuf; - Lisp_Object bufcons; from = BUF_GPT_ADDR (buf); to = from + BUF_GAP_SIZE (buf); @@ -1671,15 +1681,23 @@ gap_left (struct buffer *buf, Bytind pos) /* 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) @@ -1690,22 +1708,13 @@ gap_left (struct buffer *buf, Bytind pos) /* Adjust markers, and buffer data structure, to put the gap at POS. POS is where the loop above stopped, which may be what was specified or may be where a quit was detected. */ - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - adjust_markers (mbuf, pos, BI_BUF_GPT (mbuf), BUF_GAP_SIZE (mbuf)); - } - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - adjust_extents (make_buffer (mbuf), pos, BI_BUF_GPT (mbuf), - BUF_GAP_SIZE (mbuf)); - } + adjust_markers (buf, pos, BI_BUF_GPT (buf), BUF_GAP_SIZE (buf)); + adjust_extents (make_buffer (buf), pos, BI_BUF_GPT (buf), + BUF_GAP_SIZE (buf)); SET_BI_BUF_GPT (buf, pos); SET_GAP_SENTINEL (buf); #ifdef ERROR_CHECK_EXTENTS - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - sledgehammer_extent_check (make_buffer (mbuf)); - } + sledgehammer_extent_check (make_buffer (buf)); #endif QUIT; } @@ -1716,8 +1725,6 @@ gap_right (struct buffer *buf, Bytind pos) Bufbyte *to, *from; Bytecount i; Bytind new_s1; - struct buffer *mbuf; - Lisp_Object bufcons; to = BUF_GPT_ADDR (buf); from = to + BUF_GAP_SIZE (buf); @@ -1742,15 +1749,23 @@ gap_right (struct buffer *buf, Bytind pos) /* 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) @@ -1760,22 +1775,13 @@ gap_right (struct buffer *buf, Bytind pos) { int gsize = BUF_GAP_SIZE (buf); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - adjust_markers (mbuf, BI_BUF_GPT (mbuf) + gsize, pos + gsize, - gsize); - } - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - adjust_extents (make_buffer (mbuf), BI_BUF_GPT (mbuf) + gsize, - pos + gsize, - gsize); - } + adjust_markers (buf, BI_BUF_GPT (buf) + gsize, pos + gsize, - gsize); + adjust_extents (make_buffer (buf), BI_BUF_GPT (buf) + gsize, pos + gsize, + - gsize); SET_BI_BUF_GPT (buf, pos); SET_GAP_SENTINEL (buf); #ifdef ERROR_CHECK_EXTENTS - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - sledgehammer_extent_check (make_buffer (mbuf)); - } + sledgehammer_extent_check (make_buffer (buf)); #endif } if (pos == BI_BUF_Z (buf)) @@ -1858,7 +1864,7 @@ make_gap (struct buffer *buf, Bytecount increment) Bytecount old_gap_size; /* If we have to get more space, get enough to last a while. We use - a geometric progression that saves on realloc space. */ + a geometric progession that saves on realloc space. */ increment += 2000 + ((BI_BUF_Z (buf) - BI_BUF_BEG (buf)) / 8); if (increment > BUF_END_GAP_SIZE (buf)) @@ -2029,12 +2035,7 @@ multiple_change_finish_up (Lisp_Object buffer) 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) @@ -2079,11 +2080,8 @@ static int inside_change_hook; static Lisp_Object change_function_restore (Lisp_Object buffer) { - /* We should first reset the variable and then change the buffer, - because Fset_buffer() can throw. */ + Fset_buffer (buffer); inside_change_hook = 0; - if (XBUFFER (buffer) != current_buffer) - Fset_buffer (buffer); return Qnil; } @@ -2092,8 +2090,8 @@ static int in_first_change; static Lisp_Object first_change_hook_restore (Lisp_Object buffer) { - in_first_change = 0; Fset_buffer (buffer); + in_first_change = 0; return Qnil; } @@ -2108,7 +2106,8 @@ signal_first_change (struct buffer *buf) if (!in_first_change) { - if (!NILP (symbol_value_in_buffer (Qfirst_change_hook, buffer))) + if (!preparing_for_armageddon && + !NILP (symbol_value_in_buffer (Qfirst_change_hook, buffer))) { int speccount = specpdl_depth (); record_unwind_protect (first_change_hook_restore, buffer); @@ -2127,14 +2126,11 @@ static void signal_before_change (struct buffer *buf, Bufpos start, Bufpos end) { /* This function can GC */ - struct buffer *mbuf; - Lisp_Object bufcons; + Lisp_Object buffer; + XSETBUFFER (buffer, buf); if (!inside_change_hook) { - Lisp_Object buffer; - int speccount; - /* Are we in a multiple-change session? */ if (buf->text->changes->in_multiple_change && buf->text->changes->mc_begin != 0) @@ -2163,52 +2159,35 @@ signal_before_change (struct buffer *buf, Bufpos start, Bufpos end) /* If buffer is unmodified, run a special hook for that case. */ if (BUF_SAVE_MODIFF (buf) >= BUF_MODIFF (buf)) - { - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - signal_first_change (mbuf); - } - } + signal_first_change (buf); /* 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) + if (!preparing_for_armageddon && + (!NILP (symbol_value_in_buffer (Qbefore_change_functions, buffer)) || + /* Obsolete, for compatibility */ + !NILP (symbol_value_in_buffer (Qbefore_change_function, buffer)))) { - XSETBUFFER (buffer, mbuf); - if (!NILP (symbol_value_in_buffer (Qbefore_change_functions, buffer)) - /* Obsolete, for compatibility */ - || !NILP (symbol_value_in_buffer (Qbefore_change_function, buffer))) - { - set_buffer_internal (buf); - 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)); - } - } - - /* 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); + 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); } - unbind_to (speccount, Qnil); /* Only now do we indicate that the before-change-functions have been called, in case some function throws out. */ buf->text->changes->mc_begin_signaled = 1; } + + /* #### At this point we should map over extents calling + modification-hooks, insert-before-hooks and insert-after-hooks + of relevant extents */ } /* Signal a change immediately after it happens. @@ -2222,26 +2201,15 @@ signal_after_change (struct buffer *buf, Bufpos start, Bufpos orig_end, Bufpos new_end) { /* This function can GC */ - struct buffer *mbuf; - Lisp_Object bufcons; + Lisp_Object buffer; + XSETBUFFER (buffer, buf); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - /* always do this. */ - buffer_signal_changed_region (mbuf, start, new_end); - } - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - /* #### This seems inefficient. Wouldn't it be better to just - keep one cache per base buffer? */ - font_lock_maybe_update_syntactic_caches (mbuf, start, orig_end, new_end); - } + /* always do this. */ + buffer_signal_changed_region (buf, start, new_end); + font_lock_maybe_update_syntactic_caches (buf, start, orig_end, new_end); if (!inside_change_hook) { - Lisp_Object buffer; - int speccount; - if (buf->text->changes->in_multiple_change && buf->text->changes->mc_begin != 0) { @@ -2253,46 +2221,30 @@ signal_after_change (struct buffer *buf, Bufpos start, Bufpos orig_end, 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); - - if (!NILP (symbol_value_in_buffer (Qafter_change_functions, buffer)) - /* Obsolete, for compatibility */ - || !NILP (symbol_value_in_buffer (Qafter_change_function, buffer))) - { - set_buffer_internal (buf); - /* The actual after-change functions take slightly - different arguments than what we were passed. */ - va_run_hook_with_args (Qafter_change_functions, 3, - make_int (start), make_int (new_end), - make_int (orig_end - start)); - /* Obsolete, for compatibility */ - va_run_hook_with_args (Qafter_change_function, 3, - make_int (start), make_int (new_end), - make_int (orig_end - start)); - } - } - - /* 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) + if (!preparing_for_armageddon && + (!NILP (symbol_value_in_buffer (Qafter_change_functions, buffer)) || + /* Obsolete, for compatibility */ + !NILP (symbol_value_in_buffer (Qafter_change_function, buffer)))) { - XSETBUFFER (buffer, mbuf); - report_extent_modification (buffer, start, new_end, 1); + 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, + make_int (start), make_int (new_end), + make_int (orig_end - start)); + /* Obsolete, for compatibility */ + 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); } - unbind_to (speccount, Qnil); /* sets inside_change_hook back to 0 */ } + + /* #### At this point we should map over extents calling + some sort of modification hooks of relevant extents */ } /* Call this if you're about to change the region of BUFFER from START @@ -2308,14 +2260,10 @@ prepare_to_modify_buffer (struct buffer *buf, Bufpos start, Bufpos end, /* dmoore - This function can also kill the buffer buf, the current buffer, and do anything it pleases. So if you call it, be careful. */ - struct buffer *mbuf; - Lisp_Object buffer, bufcons; + Lisp_Object buffer; struct gcpro gcpro1; - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - barf_if_buffer_read_only (mbuf, start, end); - } + barf_if_buffer_read_only (buf, start, end); /* if this is the first modification, see about locking the buffer's file */ @@ -2324,15 +2272,16 @@ prepare_to_modify_buffer (struct buffer *buf, Bufpos start, Bufpos end, if (!NILP (buf->filename) && lockit && BUF_SAVE_MODIFF (buf) >= BUF_MODIFF (buf)) { +#ifdef CLASH_DETECTION + if (!NILP (buf->file_truename)) + /* Make binding buffer-file-name to nil effective. */ + lock_file (buf->file_truename); +#else /* At least warn if this file has changed on disk since it was visited.*/ if (NILP (Fverify_visited_file_modtime (buffer)) && !NILP (Ffile_exists_p (buf->filename))) call1_in_buffer (buf, intern ("ask-user-about-supersession-threat"), buf->filename); -#ifdef CLASH_DETECTION - if (!NILP (buf->file_truename)) - /* Make binding buffer-file-name to nil effective. */ - lock_file (buf->file_truename); #endif /* not CLASH_DETECTION */ } UNGCPRO; @@ -2358,10 +2307,7 @@ prepare_to_modify_buffer (struct buffer *buf, Bufpos start, Bufpos end, Vdeactivate_mark = Qt; #endif - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - mbuf->point_before_scroll = Qnil; - } + buf->point_before_scroll = Qnil; } @@ -2370,7 +2316,7 @@ prepare_to_modify_buffer (struct buffer *buf, Bufpos start, Bufpos end, /************************************************************************/ 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))); @@ -2378,7 +2324,7 @@ fixup_internal_substring (const Bufbyte *nonreloc, Lisp_Object reloc, if (*len < 0) { if (nonreloc) - *len = strlen ((const char *) nonreloc) - offset; + *len = strlen ((CONST char *) nonreloc) - offset; else *len = XSTRING_LENGTH (reloc) - offset; } @@ -2412,7 +2358,7 @@ fixup_internal_substring (const Bufbyte *nonreloc, Lisp_Object reloc, 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) { @@ -2421,8 +2367,6 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos, Bytind ind; Charcount cclen; int move_point = 0; - struct buffer *mbuf; - Lisp_Object bufcons; /* Defensive steps just in case a buffer gets deleted and a calling function doesn't notice it. */ @@ -2447,8 +2391,7 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos, if ((length + BUF_Z (buf)) > EMACS_INT_MAX) error ("Maximum buffer size exceeded"); - /* theoretically not necessary -- caller should GCPRO. - #### buffer_insert_from_buffer_1() doesn't! */ + /* theoretically not necessary -- caller should GCPRO */ GCPRO1 (reloc); prepare_to_modify_buffer (buf, pos, pos, !(flags & INSDEL_NO_LOCKING)); @@ -2490,11 +2433,7 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos, insert_invalidate_line_number_cache (buf, pos, nonreloc + offset, length); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - record_insert (mbuf, pos, cclen); - } - + record_insert (buf, pos, cclen); BUF_MODIFF (buf)++; MARK_BUFFERS_CHANGED; @@ -2506,10 +2445,7 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos, SET_BUF_GAP_SIZE (buf, BUF_GAP_SIZE (buf) - length); SET_BI_BUF_GPT (buf, BI_BUF_GPT (buf) + length); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - SET_BOTH_BUF_ZV (mbuf, BUF_ZV (mbuf) + cclen, BI_BUF_ZV (mbuf) + length); - } + SET_BOTH_BUF_ZV (buf, BUF_ZV (buf) + cclen, BI_BUF_ZV (buf) + length); SET_BOTH_BUF_Z (buf, BUF_Z (buf) + cclen, BI_BUF_Z (buf) + length); SET_GAP_SENTINEL (buf); @@ -2517,48 +2453,29 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos, buffer_mule_signal_inserted_region (buf, pos, length, cclen); #endif - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - process_extents_for_insertion (make_buffer (mbuf), ind, length); - } - - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - /* We know the gap is at IND so the cast is OK. */ - adjust_markers_for_insert (mbuf, (Memind) ind, length); - } + process_extents_for_insertion (make_buffer (buf), ind, length); + /* We know the gap is at IND so the cast is OK. */ + adjust_markers_for_insert (buf, (Memind) ind, length); /* Point logically doesn't move, but may need to be adjusted because it's a byte index. point-marker doesn't change because it's a memory index. */ - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - if (BI_BUF_PT (mbuf) > ind) - JUST_SET_POINT (mbuf, BUF_PT (mbuf) + cclen, - BI_BUF_PT (mbuf) + length); - } + if (BI_BUF_PT (buf) > ind) + JUST_SET_POINT (buf, BUF_PT (buf) + cclen, BI_BUF_PT (buf) + length); /* Well, point might move. */ if (move_point) BI_BUF_SET_PT (buf, ind + length); if (STRINGP (reloc)) - { - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - splice_in_string_extents (reloc, mbuf, ind, length, offset); - } - } + splice_in_string_extents (reloc, buf, ind, length, offset); if (flags & INSDEL_BEFORE_MARKERS) { - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - /* ind - 1 is correct because the FROM argument is exclusive. - I formerly used DEC_BYTIND() but that caused problems at the - beginning of the buffer. */ - adjust_markers (mbuf, ind - 1, ind, length); - } + /* ind - 1 is correct because the FROM argument is exclusive. + I formerly used DEC_BYTIND() but that caused problems at the + beginning of the buffer. */ + adjust_markers (buf, ind - 1, ind, length); } signal_after_change (buf, pos, pos, pos + cclen); @@ -2577,7 +2494,7 @@ buffer_insert_string_1 (struct buffer *buf, Bufpos pos, 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 */ @@ -2590,9 +2507,7 @@ buffer_insert_lisp_string_1 (struct buffer *buf, Bufpos pos, Lisp_Object str, int flags) { /* This function can GC */ -#ifdef ERROR_CHECK_TYPECHECK assert (STRINGP (str)); -#endif return buffer_insert_string_1 (buf, pos, 0, str, 0, XSTRING_LENGTH (str), flags); @@ -2601,12 +2516,13 @@ buffer_insert_lisp_string_1 (struct buffer *buf, Bufpos pos, Lisp_Object str, /* 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); } @@ -2616,7 +2532,9 @@ buffer_insert_emacs_char_1 (struct buffer *buf, Bufpos pos, Emchar ch, { /* This function can GC */ Bufbyte str[MAX_EMCHAR_LEN]; - Bytecount len = set_charptr_emchar (str, ch); + Bytecount len; + + len = set_charptr_emchar (str, ch); return buffer_insert_string_1 (buf, pos, str, Qnil, 0, len, flags); } @@ -2655,8 +2573,7 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags) Bytind bi_from, bi_to; Bytecount bc_numdel; EMACS_INT shortage; - struct buffer *mbuf; - Lisp_Object bufcons; + Lisp_Object bufobj; /* Defensive steps just in case a buffer gets deleted and a calling function doesn't notice it. */ @@ -2687,6 +2604,8 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags) if ((numdel = to - from) <= 0) return; + XSETBUFFER (bufobj, buf); + /* Redisplay needs to know if a newline was in the deleted region. If we've already marked the changed region as having a deleted newline there is no use in performing the check. */ @@ -2694,12 +2613,7 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags) { scan_buffer (buf, '\n', from, to, 1, &shortage, 1); if (!shortage) - { - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - mbuf->changes->newline_was_deleted = 1; - } - } + buf->changes->newline_was_deleted = 1; } bi_from = bufpos_to_bytind (buf, from); @@ -2713,70 +2627,49 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags) { /* avoid moving the gap just to delete from the bottom. */ - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - record_delete (mbuf, from, numdel); - } + record_delete (buf, from, numdel); BUF_MODIFF (buf)++; MARK_BUFFERS_CHANGED; - /* #### Point used to be modified here, but this causes problems - with MULE, as point is used to calculate bytinds, and if the - offset in bc_numdel causes point to move to a non first-byte - location, causing some other function to throw an assertion - in ASSERT_VALID_BYTIND. I've moved the code to right after - the other movements and adjustments, but before the gap is - moved. -- jh 970813 */ + /* ### Point used to be modified here, but this causes problems with MULE, + as point is used to calculate bytinds, and if the offset in bc_numdel causes + point to move to a non first-byte location, causing some other function to + throw an assertion in ASSERT_VALID_BYTIND. I've moved the code to right after + the other movements and adjustments, but before the gap is moved. + -- jh 970813 */ /* Detach any extents that are completely within the range [FROM, TO], if the extents are detachable. - This must come AFTER record_delete(), so that the appropriate - extents will be present to be recorded, and BEFORE the gap - size is increased, as otherwise we will be confused about - where the extents end. */ - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - process_extents_for_deletion (make_buffer (mbuf), bi_from, bi_to, 0); - } + This must come AFTER record_delete(), so that the appropriate extents + will be present to be recorded, and BEFORE the gap size is increased, + as otherwise we will be confused about where the extents end. */ + process_extents_for_deletion (bufobj, bi_from, bi_to, 0); - /* Relocate all markers pointing into the new, larger gap to - point at the end of the text before the gap. */ - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - adjust_markers (mbuf, - (bi_to + BUF_GAP_SIZE (mbuf)), - (bi_to + BUF_GAP_SIZE (mbuf)), - (- bc_numdel)); - } + /* Relocate all markers pointing into the new, larger gap + to point at the end of the text before the gap. */ + adjust_markers (buf, + (bi_to + BUF_GAP_SIZE (buf)), + (bi_to + BUF_GAP_SIZE (buf)), + (- bc_numdel)); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - /* Relocate any extent endpoints just like markers. */ - adjust_extents_for_deletion (make_buffer (mbuf), bi_from, bi_to, - BUF_GAP_SIZE (mbuf), bc_numdel, 0); - } + /* Relocate any extent endpoints just like markers. */ + adjust_extents_for_deletion (bufobj, bi_from, bi_to, + BUF_GAP_SIZE (buf), bc_numdel, 0); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) + /* Relocate point as if it were a marker. */ + if (bi_from < BI_BUF_PT (buf)) { - /* Relocate point as if it were a marker. */ - if (bi_from < BI_BUF_PT (mbuf)) - { - if (BI_BUF_PT (mbuf) < bi_to) - JUST_SET_POINT (mbuf, from, bi_from); - else - JUST_SET_POINT (mbuf, BUF_PT (mbuf) - numdel, - BI_BUF_PT (mbuf) - bc_numdel); - } + if (BI_BUF_PT (buf) < bi_to) + JUST_SET_POINT (buf, from, bi_from); + else + JUST_SET_POINT (buf, BUF_PT (buf) - numdel, + BI_BUF_PT (buf) - bc_numdel); } SET_BUF_END_GAP_SIZE (buf, BUF_END_GAP_SIZE (buf) + bc_numdel); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - SET_BOTH_BUF_ZV (mbuf, BUF_ZV (mbuf) - numdel, - BI_BUF_ZV (mbuf) - bc_numdel); - } + SET_BOTH_BUF_ZV (buf, BUF_ZV (buf) - numdel, BI_BUF_ZV (buf) - bc_numdel); SET_BOTH_BUF_Z (buf, BUF_Z (buf) - numdel, BI_BUF_Z (buf) - bc_numdel); SET_GAP_SENTINEL (buf); } @@ -2788,20 +2681,16 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags) if (bi_from > BI_BUF_GPT (buf)) gap_right (buf, bi_from); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - record_delete (mbuf, from, numdel); - } + record_delete (buf, from, numdel); BUF_MODIFF (buf)++; MARK_BUFFERS_CHANGED; - /* #### Point used to be modified here, but this causes problems - with MULE, as point is used to calculate bytinds, and if the - offset in bc_numdel causes point to move to a non first-byte - location, causing some other function to throw an assertion - in ASSERT_VALID_BYTIND. I've moved the code to right after - the other movements and adjustments, but before the gap is - moved. -- jh 970813 */ + /* ### Point used to be modified here, but this causes problems with MULE, + as point is used to calculate bytinds, and if the offset in bc_numdel causes + point to move to a non first-byte location, causing some other function to + throw an assertion in ASSERT_VALID_BYTIND. I've moved the code to right after + the other movements and adjustments, but before the gap is moved. + -- jh 970813 */ /* Detach any extents that are completely within the range [FROM, TO], if the extents are detachable. @@ -2809,48 +2698,31 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags) This must come AFTER record_delete(), so that the appropriate extents will be present to be recorded, and BEFORE the gap size is increased, as otherwise we will be confused about where the extents end. */ - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - process_extents_for_deletion (make_buffer (mbuf), bi_from, bi_to, 0); - } + process_extents_for_deletion (bufobj, bi_from, bi_to, 0); - /* Relocate all markers pointing into the new, larger gap to - point at the end of the text before the gap. */ - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - adjust_markers (mbuf, - (bi_to + BUF_GAP_SIZE (mbuf)), - (bi_to + BUF_GAP_SIZE (mbuf)), - (- bc_numdel - BUF_GAP_SIZE (mbuf))); - } + /* Relocate all markers pointing into the new, larger gap + to point at the end of the text before the gap. */ + adjust_markers (buf, + (bi_to + BUF_GAP_SIZE (buf)), + (bi_to + BUF_GAP_SIZE (buf)), + (- bc_numdel - BUF_GAP_SIZE (buf))); /* Relocate any extent endpoints just like markers. */ - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - adjust_extents_for_deletion (make_buffer (mbuf), bi_from, bi_to, - BUF_GAP_SIZE (mbuf), - bc_numdel, BUF_GAP_SIZE (mbuf)); - } + adjust_extents_for_deletion (bufobj, bi_from, bi_to, BUF_GAP_SIZE (buf), + bc_numdel, BUF_GAP_SIZE (buf)); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) + /* Relocate point as if it were a marker. */ + if (bi_from < BI_BUF_PT (buf)) { - /* Relocate point as if it were a marker. */ - if (bi_from < BI_BUF_PT (mbuf)) - { - if (BI_BUF_PT (mbuf) < bi_to) - JUST_SET_POINT (mbuf, from, bi_from); - else - JUST_SET_POINT (mbuf, BUF_PT (mbuf) - numdel, - BI_BUF_PT (mbuf) - bc_numdel); - } + if (BI_BUF_PT (buf) < bi_to) + JUST_SET_POINT (buf, from, bi_from); + else + JUST_SET_POINT (buf, BUF_PT (buf) - numdel, + BI_BUF_PT (buf) - bc_numdel); } SET_BUF_GAP_SIZE (buf, BUF_GAP_SIZE (buf) + bc_numdel); - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - SET_BOTH_BUF_ZV (mbuf, BUF_ZV (mbuf) - numdel, - BI_BUF_ZV (mbuf) - bc_numdel); - } + SET_BOTH_BUF_ZV (buf, BUF_ZV (buf) - numdel, BI_BUF_ZV (buf) - bc_numdel); SET_BOTH_BUF_Z (buf, BUF_Z (buf) - numdel, BI_BUF_Z (buf) - bc_numdel); SET_BI_BUF_GPT (buf, bi_from); SET_GAP_SENTINEL (buf); @@ -2861,10 +2733,7 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags) #endif #ifdef ERROR_CHECK_EXTENTS - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - sledgehammer_extent_check (make_buffer (mbuf)); - } + sledgehammer_extent_check (bufobj); #endif signal_after_change (buf, from, to, from); @@ -2878,7 +2747,7 @@ buffer_delete_range (struct buffer *buf, Bufpos from, Bufpos to, int flags) /* Replace the character at POS in buffer B with CH. */ void -buffer_replace_char (struct buffer *buf, Bufpos pos, Emchar ch, +buffer_replace_char (struct buffer *b, Bufpos pos, Emchar ch, int not_real_change, int force_lock_check) { /* This function can GC */ @@ -2888,54 +2757,42 @@ buffer_replace_char (struct buffer *buf, Bufpos pos, Emchar ch, /* Defensive steps just in case a buffer gets deleted and a calling function doesn't notice it. */ - if (!BUFFER_LIVE_P (buf)) + if (!BUFFER_LIVE_P (b)) return; - curlen = BUF_CHARPTR_COPY_CHAR (buf, pos, curstr); + curlen = BUF_CHARPTR_COPY_CHAR (b, pos, curstr); newlen = set_charptr_emchar (newstr, ch); if (curlen == newlen) { - struct buffer *mbuf; - Lisp_Object bufcons; - /* then we can just replace the text. */ - prepare_to_modify_buffer (buf, pos, pos + 1, + prepare_to_modify_buffer (b, pos, pos + 1, !not_real_change || force_lock_check); /* Defensive steps in case the before-change-functions fuck around */ - if (!BUFFER_LIVE_P (buf)) + if (!BUFFER_LIVE_P (b)) /* Bad bad pre-change function. */ return; /* Make args be valid again. prepare_to_modify_buffer() might have modified the buffer. */ - if (pos < BUF_BEGV (buf)) - pos = BUF_BEGV (buf); - if (pos >= BUF_ZV (buf)) - pos = BUF_ZV (buf) - 1; - if (pos < BUF_BEGV (buf)) + if (pos < BUF_BEGV (b)) + pos = BUF_BEGV (b); + if (pos >= BUF_ZV (b)) + pos = BUF_ZV (b) - 1; + if (pos < BUF_BEGV (b)) /* no more characters in buffer! */ return; - if (BUF_FETCH_CHAR (buf, pos) == '\n') - { - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - mbuf->changes->newline_was_deleted = 1; - } - } + if (BUF_FETCH_CHAR (b, pos) == '\n') + b->changes->newline_was_deleted = 1; MARK_BUFFERS_CHANGED; if (!not_real_change) { - MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) - { - record_change (mbuf, pos, 1); - } - BUF_MODIFF (buf)++; + record_change (b, pos, 1); + BUF_MODIFF (b)++; } - memcpy (BUF_BYTE_ADDRESS (buf, pos), newstr, newlen); - - signal_after_change (buf, pos, pos + 1, pos + 1); + memcpy (BUF_BYTE_ADDRESS (b, pos), newstr, newlen); + signal_after_change (b, pos, pos + 1, pos + 1); /* We do not have to adjust the Mule data; we just replaced a character with another of the same number of bytes. */ @@ -2950,21 +2807,21 @@ buffer_replace_char (struct buffer *buf, Bufpos pos, Emchar ch, * point. Point will drift backward by one position and stay * there otherwise. */ - int movepoint = (pos == BUF_PT (buf) - 1); + int movepoint = (pos == BUF_PT (b) - 1); - buffer_delete_range (buf, pos, pos + 1, 0); + buffer_delete_range (b, pos, pos + 1, 0); /* Defensive steps in case the before-change-functions fuck around */ - if (!BUFFER_LIVE_P (buf)) + if (!BUFFER_LIVE_P (b)) /* Bad bad pre-change function. */ return; /* Make args be valid again. prepare_to_modify_buffer() might have modified the buffer. */ - if (pos < BUF_BEGV (buf)) - pos = BUF_BEGV (buf); - if (pos >= BUF_ZV (buf)) - pos = BUF_ZV (buf) - 1; - if (pos < BUF_BEGV (buf)) + if (pos < BUF_BEGV (b)) + pos = BUF_BEGV (b); + if (pos >= BUF_ZV (b)) + pos = BUF_ZV (b) - 1; + if (pos < BUF_BEGV (b)) /* no more characters in buffer! */ return; /* @@ -2972,7 +2829,7 @@ buffer_replace_char (struct buffer *buf, Bufpos pos, Emchar ch, * insertion, which we must do if the deletion moved point * backward so that it now equals the insertion point. */ - buffer_insert_string_1 (buf, (movepoint ? -1 : pos), + buffer_insert_string_1 (b, (movepoint ? -1 : pos), newstr, Qnil, 0, newlen, 0); } } @@ -2985,20 +2842,22 @@ buffer_replace_char (struct buffer *buf, Bufpos pos, Emchar ch, /* Make a string from a buffer. This needs to take into account the gap, and add any necessary extents from the buffer. */ -static Lisp_Object -make_string_from_buffer_1 (struct buffer *buf, Bufpos pos, Charcount length, - int no_extents) +Lisp_Object +make_string_from_buffer (struct buffer *buf, Bufpos pos, Charcount length) { /* This function can GC */ - Bytind bi_ind = bufpos_to_bytind (buf, pos); - Bytecount bi_len = bufpos_to_bytind (buf, pos + length) - bi_ind; - Lisp_Object val = make_uninit_string (bi_len); - + Lisp_Object val; struct gcpro gcpro1; + Bytind bi_ind; + Bytecount bi_len; + + bi_ind = bufpos_to_bytind (buf, pos); + bi_len = bufpos_to_bytind (buf, pos + length) - bi_ind; + + val = make_uninit_string (bi_len); GCPRO1 (val); - if (!no_extents) - add_string_extents (val, buf, bi_ind, bi_len); + add_string_extents (val, buf, bi_ind, bi_len); { Bytecount len1 = BI_BUF_GPT (buf) - bi_ind; @@ -3030,19 +2889,6 @@ make_string_from_buffer_1 (struct buffer *buf, Bufpos pos, Charcount length, return val; } -Lisp_Object -make_string_from_buffer (struct buffer *buf, Bufpos pos, Charcount length) -{ - return make_string_from_buffer_1 (buf, pos, length, 0); -} - -Lisp_Object -make_string_from_buffer_no_extents (struct buffer *buf, Bufpos pos, - Charcount length) -{ - return make_string_from_buffer_1 (buf, pos, length, 1); -} - void barf_if_buffer_read_only (struct buffer *buf, Bufpos from, Bufpos to) { @@ -3072,23 +2918,16 @@ barf_if_buffer_read_only (struct buffer *buf, Bufpos from, Bufpos to) } 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; @@ -3098,7 +2937,7 @@ find_charsets_in_bufbyte_string (unsigned char *charsets, const Bufbyte *str, } 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 @@ -3108,14 +2947,6 @@ find_charsets_in_emchar_string (unsigned char *charsets, const Emchar *str, 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; @@ -3124,10 +2955,10 @@ find_charsets_in_emchar_string (unsigned char *charsets, const Emchar *str, } 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) { @@ -3144,7 +2975,7 @@ bufbyte_string_displayed_columns (const Bufbyte *str, Bytecount len) } int -emchar_string_displayed_columns (const Emchar *str, Charcount len) +emchar_string_displayed_columns (CONST Emchar *str, Charcount len) { #ifdef MULE int cols = 0; @@ -3162,10 +2993,10 @@ emchar_string_displayed_columns (const Emchar *str, Charcount len) /* 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,11 +3006,11 @@ convert_bufbyte_string_into_emchar_dynarr (const Bufbyte *str, Bytecount len, } } -Charcount -convert_bufbyte_string_into_emchar_string (const Bufbyte *str, Bytecount len, +int +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) { @@ -3242,7 +3073,7 @@ convert_emchar_string_into_malloced_string (Emchar *arr, int nels, /************************************************************************/ void -reinit_vars_of_insdel (void) +vars_of_insdel (void) { int i; @@ -3254,15 +3085,9 @@ reinit_vars_of_insdel (void) } void -vars_of_insdel (void) -{ - reinit_vars_of_insdel (); -} - -void -init_buffer_text (struct buffer *b) +init_buffer_text (struct buffer *b, int indirect_p) { - if (!b->base_buffer) + if (!indirect_p) { SET_BUF_GAP_SIZE (b, 20); BUFFER_ALLOC (b->text->beg, BUF_GAP_SIZE (b) + BUF_END_SENTINEL_SIZE); @@ -3290,7 +3115,6 @@ init_buffer_text (struct buffer *b) } } #endif /* MULE */ - b->text->line_number_cache = Qnil; BUF_MODIFF (b) = 1; BUF_SAVE_MODIFF (b) = 1; @@ -3321,9 +3145,9 @@ init_buffer_text (struct buffer *b) } void -uninit_buffer_text (struct buffer *b) +uninit_buffer_text (struct buffer *b, int indirect_p) { - if (!b->base_buffer) + if (!indirect_p) { BUFFER_FREE (b->text->beg); xfree (b->text->changes); diff --git a/src/lisp-disunion.h b/src/lisp-disunion.h index f2fdafc..2ac90c8 100644 --- a/src/lisp-disunion.h +++ b/src/lisp-disunion.h @@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA. */ /* Format of a non-union-type Lisp Object + For the USE_MINIMAL_TAGBITS implementation: + 3 2 1 0 bit 10987654321098765432109876543210 -------------------------------- @@ -37,75 +39,126 @@ Boston, MA 02111-1307, USA. */ -------------------------------- VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVT + For the non-USE_MINIMAL_TAGBITS implementation: + + 3 2 1 0 + bit 10987654321098765432109876543210 + -------------------------------- + TTTMVVVVVVVVVVVVVVVVVVVVVVVVVVVV + + V = value bits + T = type bits + M = mark bits + For integral Lisp types, i.e. integers and characters, the value - bits are the Lisp object. Some people call such Lisp_Objects "immediate". + bits are the Lisp object. + + The object is obtained by masking off the type and mark + bits. In the USE_MINIMAL_TAGBITS implementation, bit 1 is + used as a value bit by splitting the Lisp integer type into + two subtypes, Lisp_Type_Int_Even and Lisp_Type_Int_Odd. By + this trickery we get 31 bits for integers instead of 30. - The object is obtained by masking off the type bits. - Bit 1 is used as a value bit by splitting the Lisp integer type - into two subtypes, Lisp_Type_Int_Even and Lisp_Type_Int_Odd. - By this trickery we get 31 bits for integers instead of 30. + In the non-USE_MINIMAL_TAGBITS world, Lisp integers are 28 bits, + or more properly (BITS_PER_EMACS_INT - GCTYPEBITS - 1) bits. For non-integral types, the value bits of a Lisp_Object contain a pointer to a structure containing the object. The pointer is obtained by masking off the type and mark bits. - All pointer-based types are coalesced under a single type called - Lisp_Type_Record. The type bits for this type are required by the - implementation to be 00, just like the least significant bits of - word-aligned struct pointers on 32-bit hardware. This requires that - all structs implementing Lisp_Objects have an alignment of at least 4 - bytes. Because of this, Lisp_Object pointers don't have to be masked - and are full-sized. + In the USE_MINIMAL_TAGBITS implementation, all + pointer-based types are coalesced under a single type called + Lisp_Type_Record. The type bits for this type are required + by the implementation to be 00, just like the least + significant bits of word-aligned struct pointers on 32-bit + hardware. Because of this, Lisp_Object pointers don't have + to be masked and are full-sized. + + In the non-USE_MINIMAL_TAGBITS implementation, the type and + mark bits must be masked off and pointers are limited to 28 + bits (really BITS_PER_EMACS_INT - GCTYPEBITS - 1 bits). - There are no mark bits in the Lisp_Object itself (there used to be). + There are no mark bits in the USE_MINIMAL_TAGBITS implementation. + Integers and characters don't need to be marked. All other types + are lrecord-based, which means they get marked by incrementing + their ->implementation pointer. - Integers and characters don't need to be marked. All other types are - lrecord-based, which means they get marked by setting the mark bit in - the struct lrecord_header. + In the non-USE_MINIMAL_TAGBITS implementation, the markbit is stored + in the Lisp_Object itself. It is stored in the middle so that the + type bits can be obtained by simply shifting them. + + Outside of garbage collection, all mark bits are always zero. Here is a brief description of the following macros: + XMARKBIT Extract the mark bit (non-USE_MINIMAL_TAGBITS) + XMARK Set the mark bit of this Lisp_Object (non-USE_MINIMAL_TAGBITS) + XUNMARK Clear the mark bit of this Lisp_Object (non-USE_MINIMAL_TAGBITS) XTYPE The type bits of a Lisp_Object XPNTRVAL The value bits of a Lisp_Object storing a pointer XCHARVAL The value bits of a Lisp_Object storing a Emchar XREALINT The value bits of a Lisp_Object storing an integer, signed XUINT The value bits of a Lisp_Object storing an integer, unsigned - INTP Non-zero if this Lisp_Object is an integer + INTP Non-zero if this Lisp_Object an integer? Qzero Lisp Integer 0 - EQ Non-zero if two Lisp_Objects are identical, not merely equal. */ - + EQ Non-zero if two Lisp_Objects are identical + GC_EQ Version of EQ used during garbage collection +*/ typedef EMACS_INT Lisp_Object; -#define Lisp_Type_Int_Bit (Lisp_Type_Int_Even & Lisp_Type_Int_Odd) -#define wrap_object(ptr) ((Lisp_Object) (ptr)) -#define make_int(x) ((Lisp_Object) (((x) << INT_GCBITS) | Lisp_Type_Int_Bit)) -#define make_char(x) ((Lisp_Object) (((x) << GCBITS) | Lisp_Type_Char)) -#define VALMASK (((1UL << VALBITS) - 1UL) << GCTYPEBITS) -#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 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) +#ifdef USE_MINIMAL_TAGBITS + +# define XUNMARK(x) DO_NOTHING +# define make_obj(vartype, x) ((Lisp_Object) (x)) +# define make_int(x) ((Lisp_Object) (((x) << INT_GCBITS) + 1)) +# define make_char(x) ((Lisp_Object) (((x) << GCBITS) + Lisp_Type_Char)) +# define VALMASK (((1UL << VALBITS) - 1UL) << GCTYPEBITS) +# 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) & 1) +# define Qzero ((Lisp_Object) 1UL) + +#else /* !USE_MINIMAL_TAGBITS */ + +# define MARKBIT (1UL << VALBITS) +# define XMARKBIT(x) (((x) & MARKBIT) != 0) +# define XMARK(x) ((void) ((x) |= MARKBIT)) +# define XUNMARK(x) ((void) ((x) &= ~MARKBIT)) +# define make_obj(vartype, value) \ + ((Lisp_Object) (((EMACS_UINT) (vartype) << (VALBITS + GCMARKBITS)) \ + + ((EMACS_UINT) (value) & VALMASK))) +# define make_int(value) make_obj (Lisp_Type_Int, value) +# define make_char(value) make_obj (Lisp_Type_Char, value) +# define VALMASK ((1UL << VALBITS) - 1UL) +# define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) >> (VALBITS + GCMARKBITS))) +# define XPNTRVAL(x) ((x) & VALMASK) +# define XCHARVAL(x) XPNTRVAL(x) +# define GC_EQ(x,y) (((x) & ~MARKBIT) == ((y) & ~MARKBIT)) +# define XREALINT(x) (((x) << INT_GCBITS) >> INT_GCBITS) +# define XUINT(x) ((EMACS_UINT) ((x) & VALMASK)) +# define INTP(x) (XTYPE (x) == Lisp_Type_Int) +# define Qzero ((Lisp_Object) Lisp_Type_Int) + +#endif /* !USE_MINIMAL_TAGBITS */ + +#define Qnull_pointer 0 +#define XGCTYPE(x) XTYPE(x) #define EQ(x,y) ((x) == (y)) -#define XSETINT(var, value) ((void) ((var) = make_int (value))) +#define XSETINT(var, value) ((void) ((var) = make_int (value))) #define XSETCHAR(var, value) ((void) ((var) = make_char (value))) -#define XSETOBJ(var, value) ((void) ((var) = wrap_object (value))) +#define XSETOBJ(var, vartype, value) ((void) ((var) = make_obj (vartype, value))) /* 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) = ((Lisp_Object) (varg)))) #define CVOID_TO_LISP VOID_TO_LISP #define LISP_TO_VOID(larg) ((void *) (larg)) -#define LISP_TO_CVOID(larg) ((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 --git a/src/lisp.h b/src/lisp.h index a05b273..d8a1f7f 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1,7 +1,7 @@ /* Fundamental definitions for XEmacs Lisp interpreter. Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1993-1996 Richard Mlynarik. - Copyright (C) 1995, 1996, 2000 Ben Wing. + Copyright (C) 1995, 1996 Ben Wing. This file is part of XEmacs. @@ -22,15 +22,13 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: FSF 19.30. */ -#ifndef INCLUDED_lisp_h_ -#define INCLUDED_lisp_h_ +#ifndef _XEMACS_LISP_H_ +#define _XEMACS_LISP_H_ /************************************************************************/ -/* general definitions */ +/* general definitions */ /************************************************************************/ -/* ------------------------ include files ------------------- */ - /* We include the following generally useful header files so that you don't have to worry about prototypes when using the standard C library functions and macros. These files shouldn't be excessively @@ -41,11 +39,12 @@ Boston, MA 02111-1307, USA. */ #include <stdio.h> /* NULL, etc. */ #include <ctype.h> #include <stdarg.h> -#include <stddef.h> /* offsetof */ -#include <sys/types.h> -#include <limits.h> -/* ------------------------ dynamic arrays ------------------- */ +#ifdef __lucid +# include <sysent.h> +#endif + +/* ---- Dynamic arrays ---- */ #define Dynarr_declare(type) \ type *base; \ @@ -61,27 +60,22 @@ typedef struct dynarr 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_begin(d) Dynarr_atp (d, 0) -#define Dynarr_end(d) Dynarr_atp (d, Dynarr_length (d) - 1) -#define Dynarr_sizeof(d) ((d)->cur * (d)->elsize) #define Dynarr_length(d) ((d)->cur) #define Dynarr_largest(d) ((d)->largest) #define Dynarr_reset(d) ((d)->cur = 0) #define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur) #define Dynarr_insert_many_at_start(d, el, len) \ Dynarr_insert_many (d, el, len, 0) -#define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof (s) - 1) +#define Dynarr_add_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) @@ -96,11 +90,16 @@ void Dynarr_free (void *d); #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); #endif +#include "symsinit.h" /* compiler warning suppression */ + /* Also define min() and max(). (Some compilers put them in strange places that won't be referenced by the above include files, such as 'macros.h' under Solaris.) */ @@ -113,17 +112,19 @@ size_t Dynarr_memory_usage (void *d, struct overhead_stats *stats); #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))) @@ -135,16 +136,21 @@ char *xstrdup (const char *); 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 { \ - EMACS_INT 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)); \ - } \ +#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); \ + 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 @@ -157,6 +163,7 @@ void xfree_1 (void *); } while (0) #else void xfree (void *); +#define xfree_1 xfree #endif /* ERROR_CHECK_MALLOC */ #ifndef PRINTF_ARGS @@ -171,64 +178,51 @@ void xfree (void *); #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)) -# define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \ + 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 # define DECLARE_DOESNT_RETURN(decl) extern void volatile decl -# define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \ +# define DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS(decl,str,idx) \ extern void volatile decl PRINTF_ARGS(str,idx) # endif /* GNUC 2.5 */ # else # define DOESNT_RETURN void # define DECLARE_DOESNT_RETURN(decl) extern void decl -# define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \ +# define DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS(decl,str,idx) \ extern void decl PRINTF_ARGS(str,idx) # endif /* GNUC */ #endif -/* No type has a greater alignment requirement than max_align_t. - (except perhaps for types we don't use, like long double) */ -typedef union -{ - struct { long l; } l; - struct { void *p; } p; - struct { void (*f)(void); } f; - struct { double d; } d; -} max_align_t; - #ifndef ALIGNOF # if defined (__GNUC__) && (__GNUC__ >= 2) -/* gcc has an extension that gives us exactly what we want. */ -# define ALIGNOF(type) __alignof__ (type) -# elif ! defined (__cplusplus) -/* The following is mostly portable, except that: - - it doesn't work for inside out declarations like void (*) (void). - (so just call ALIGNOF with a typedef'ed name) - - it doesn't work with C++. The C++ committee has decided, - in its infinite wisdom, that: - "Types must be declared in declarations, not in expressions." */ -# define ALIGNOF(type) offsetof (struct { char c; type member; }, member) +# define ALIGNOF(x) __alignof (x) # else -/* C++ is annoying, but it has a big bag of tricks. - The following doesn't have the "inside out" declaration bug C does. */ -template<typename T> struct alignment_trick { char c; T member; }; -# define ALIGNOF(type) offsetof (alignment_trick<type>, member) +# define ALIGNOF(x) sizeof (x) # endif -#endif /* ALIGNOF */ +#endif #define ALIGN_SIZE(len, unit) \ ((((len) + (unit) - 1) / (unit)) * (unit)) /* #### Yuck, this is kind of evil */ #define ALIGN_PTR(ptr, unit) \ - ((void *) ALIGN_SIZE ((size_t) (ptr), unit)) + ((void *) ALIGN_SIZE ((long) (ptr), unit)) + +#ifdef QUANTIFY +#include "quantify.h" +#define QUANTIFY_START_RECORDING quantify_start_recording_data () +#define QUANTIFY_STOP_RECORDING quantify_stop_recording_data () +#else /* !QUANTIFY */ +#define QUANTIFY_START_RECORDING +#define QUANTIFY_STOP_RECORDING +#endif /* !QUANTIFY */ #ifndef DO_NOTHING #define DO_NOTHING do {} while (0) @@ -246,7 +240,7 @@ template<typename T> struct alignment_trick { char c; T member; }; #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 @@ -264,40 +258,9 @@ void assert_failed (const char *, int, const char *); /*#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. - - #### In point of fact, it would NOT be a good idea for config.h to mess - with EMACS_INT. A lot of code makes the basic assumption that EMACS_INT - is the size of a pointer. */ - -#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 */ +/* typedefs */ /************************************************************************/ /* We put typedefs here so that prototype declarations don't choke. @@ -305,50 +268,15 @@ void assert_failed (const char *, int, const char *); maybe for simple structures like Dynarrs); that keeps them private to the routines that actually use them. */ -/* ------------------------------- */ -/* basic char/int typedefs */ -/* ------------------------------- */ - -/* The definitions we put here use typedefs to attribute specific meaning - to types that by themselves are pretty general. Stuff pointed to by a - char * or unsigned char * will nearly always be one of four types: - a) pointer to internally-formatted text; b) pointer to text in some - external format, which can be defined as all formats other than the - internal one; c) pure ASCII text; d) binary data that is not meant to - be interpreted as text. [A fifth possible type "e) a general pointer - to memory" should be replaced with void *.] Using these more specific - types rather than the general ones helps avoid the confusions that - occur when the semantics of a char * argument being studied are unclear. */ - -typedef unsigned char UChar; - /* The data representing the text in a buffer is logically a set of Bufbytes, declared as follows. */ -typedef UChar Bufbyte; - -/* Explicitly signed or unsigned versions: */ -typedef UChar UBufbyte; -typedef char SBufbyte; - -/* The data representing a string in "external" format (binary or any - external encoding) is logically a set of Extbytes, declared as - follows. Extbyte is guaranteed to be just a char, so for example - strlen (Extbyte *) is OK. Extbyte is only a documentation device - for referring to external text. */ +typedef unsigned char Bufbyte; -typedef char Extbyte; - -/* A byte in a string in binary format: */ -typedef char Char_Binary; -typedef UChar UChar_Binary; - -/* A byte in a string in entirely US-ASCII format: (Nothing outside - the range 00 - 7F) */ - -typedef char Char_ASCII; -typedef UChar UChar_ASCII; +/* The data representing a string in "external" format (simple + binary format) is logically a set of Extbytes, declared as follows. */ +typedef unsigned char Extbyte; /* To the user, a buffer is made up of characters, declared as follows. In the non-Mule world, characters and Bufbytes are equivalent. @@ -358,31 +286,23 @@ typedef UChar UChar_ASCII; typedef int Emchar; /* Different ways of referring to a position in a buffer. We use - the typedefs in preference to 'EMACS_INT' to make it clearer what + the typedefs in preference to 'int' to make it clearer what sort of position is being used. See extents.c for a description of the different positions. We put them here instead of in 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; - -/* ------------------------------- */ -/* structure/other typedefs */ -/* ------------------------------- */ - -/* Counts of bytes or array elements */ -typedef EMACS_INT Memory_count; -typedef EMACS_INT Element_count; +typedef int Extcount; typedef struct lstream Lstream; @@ -412,17 +332,14 @@ struct extent; 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" */ +struct Lisp_Face; +struct Lisp_Process; /* "process.c" */ struct stat; /* <sys/stat.h> */ -typedef struct Lisp_Color_Instance Lisp_Color_Instance; -typedef struct Lisp_Font_Instance Lisp_Font_Instance; -typedef struct Lisp_Image_Instance Lisp_Image_Instance; -typedef struct Lisp_Gui_Item Lisp_Gui_Item; +struct Lisp_Color_Instance; +struct Lisp_Font_Instance; +struct Lisp_Image_Instance; struct display_line; -struct display_glyph_area; -struct display_box; struct redisplay_info; struct window_mirror; struct scrollbar_instance; @@ -492,6 +409,47 @@ typedef struct 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, @@ -509,14 +467,6 @@ enum toolbar_pos }; #endif -enum edge_style -{ - EDGE_ETCHED_IN, - EDGE_ETCHED_OUT, - EDGE_BEVEL_IN, - EDGE_BEVEL_OUT -}; - #ifndef ERROR_CHECK_TYPECHECK typedef enum error_behavior @@ -556,13 +506,62 @@ enum munge_me_out_the_door /************************************************************************/ -/* Definition of Lisp_Object data type */ +/* Definition of Lisp_Object data type */ /************************************************************************/ +#ifdef USE_MINIMAL_TAGBITS +# define LRECORD_CONS +# define LRECORD_VECTOR +# define LRECORD_SYMBOL +# define LRECORD_STRING +#endif + /* Define the fundamental Lisp data structures */ /* This is the set of Lisp data types */ +#ifndef USE_MINIMAL_TAGBITS + +enum Lisp_Type +{ + /* Integer. XINT(obj) is the integer value. */ + Lisp_Type_Int, + + /* XRECORD_LHEADER (object) points to a struct lrecord_header + lheader->implementation determines the type (and GC behaviour) + of the object. */ + Lisp_Type_Record, + +#ifndef LRECORD_CONS + /* Cons. XCONS (object) points to a struct Lisp_Cons. */ + Lisp_Type_Cons, +#endif + +#ifndef LRECORD_STRING + /* String. XSTRING (object) points to a struct Lisp_String. + The length of the string, and its contents, are stored therein. */ + Lisp_Type_String, +#endif + +#ifndef LRECORD_VECTOR + /* Vector of Lisp objects. XVECTOR(object) points to a struct Lisp_Vector. + The length of the vector, and its contents, are stored therein. */ + Lisp_Type_Vector, +#endif /* !LRECORD_VECTOR */ + +#ifndef LRECORD_SYMBOL + /* Symbol. XSYMBOL (object) points to a struct Lisp_Symbol. */ + Lisp_Type_Symbol, +#endif /* !LRECORD_SYMBOL */ + + Lisp_Type_Char +}; + +# define POINTER_TYPE_P(type) \ + ((type) != Lisp_Type_Int && (type) != Lisp_Type_Char) + +#else /* USE_MINIMAL_TAGBITS */ + enum Lisp_Type { Lisp_Type_Record, @@ -573,20 +572,48 @@ enum Lisp_Type #define POINTER_TYPE_P(type) ((type) == Lisp_Type_Record) +#endif /* USE_MINIMAL_TAGBITS */ + +/* This should be the underlying type into which a Lisp_Object must fit. + In a strict ANSI world, this must be `int', since ANSI says you can't + use bitfields on any type other than `int'. However, on a machine + where `int' and `long' are not the same size, this should be the + longer of the two. (This also must be something into which a pointer + to an arbitrary object will fit, modulo any DATA_SEG_BITS cruft.) + */ +/* ### We should be using uintptr_t and SIZEOF_VOID_P here */ +#if (LONGBITS > INTBITS) +# define EMACS_INT long +# define EMACS_UINT unsigned long +# define SIZEOF_EMACS_INT SIZEOF_LONG +#else +# define EMACS_INT int +# define EMACS_UINT unsigned int +# define SIZEOF_EMACS_INT SIZEOF_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)) #endif -#define GCMARKBITS 0 -#define GCTYPEBITS 2 -#define GCBITS 2 -#define INT_GCBITS 1 +#ifdef USE_MINIMAL_TAGBITS +# define GCMARKBITS 0 +# define GCTYPEBITS 2 +# define GCBITS 2 +# define INT_GCBITS 1 +#else +# define GCMARKBITS 1 +# define GCTYPEBITS 3 +# define GCBITS 4 +# define INT_GCBITS GCBITS +#endif #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 - 1)) -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" @@ -594,7 +621,25 @@ enum Lisp_Type # include "lisp-disunion.h" #endif /* !USE_UNION_TYPE */ -#define XPNTR(x) ((void *) XPNTRVAL(x)) +#ifdef HAVE_SHM +/* In this representation, data is found in two widely separated segments. */ +extern int pure_size; +# define XPNTR(x) \ + ((void *)(XPNTRVAL(x)) | (XPNTRVAL(x) > pure_size ? DATA_SEG_BITS : PURE_SEG_BITS))) +#else /* not HAVE_SHM */ +# ifdef DATA_SEG_BITS +/* This case is used for the rt-pc and hp-pa. + In the diffs I was given, it checked for ptr = 0 + and did not adjust it in that case. + But I don't think that zero should ever be found + in a Lisp object whose data type says it points to something. + */ +# define XPNTR(x) ((void *)((XPNTRVAL(x)) | DATA_SEG_BITS)) +# else /* not DATA_SEG_BITS */ +# define XPNTR(x) ((void *) (XPNTRVAL(x))) +# endif /* not DATA_SEG_BITS */ +#endif /* not HAVE_SHM */ + /* WARNING WARNING WARNING. You must ensure on your own that proper GC protection is provided for the elements in this array. */ @@ -603,16 +648,11 @@ typedef struct Dynarr_declare (Lisp_Object); } Lisp_Object_dynarr; -typedef struct -{ - Dynarr_declare (Lisp_Object *); -} Lisp_Object_ptr_dynarr; - /* 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 @@ -629,12 +669,12 @@ int eq_with_ebola_notice (Lisp_Object, Lisp_Object); /************************************************************************/ -/** Definitions of basic Lisp objects **/ +/* Definitions of basic Lisp objects */ /************************************************************************/ #include "lrecord.h" -/*------------------------------ unbound -------------------------------*/ +/********** unbound ***********/ /* Qunbound is a special Lisp_Object (actually of type symbol-value-forward), that can never be visible to @@ -642,17 +682,19 @@ int eq_with_ebola_notice (Lisp_Object, Lisp_Object); to mean "no such value". */ #define UNBOUNDP(val) EQ (val, Qunbound) +#define GC_UNBOUNDP(val) GC_EQ (val, Qunbound) -/*------------------------------- cons ---------------------------------*/ +/*********** cons ***********/ /* In a cons, the markbit of the car is the gc mark bit */ struct Lisp_Cons { +#ifdef LRECORD_CONS struct lrecord_header lheader; +#endif Lisp_Object car, cdr; }; -typedef struct Lisp_Cons Lisp_Cons; #if 0 /* FSFmacs */ /* Like a cons, but records info on where the text lives that it was read from */ @@ -666,19 +708,38 @@ struct Lisp_Buffer_Cons }; #endif -DECLARE_LRECORD (cons, Lisp_Cons); -#define XCONS(x) XRECORD (x, cons, Lisp_Cons) +#ifdef LRECORD_CONS + +DECLARE_LRECORD (cons, struct Lisp_Cons); +#define XCONS(x) XRECORD (x, cons, struct 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) #define CONS_MARKED_P(c) MARKED_RECORD_HEADER_P(&((c)->lheader)) #define MARK_CONS(c) MARK_RECORD_HEADER (&((c)->lheader)) -extern Lisp_Object Qnil; +#else /* ! LRECORD_CONS */ + +DECLARE_NONRECORD (cons, Lisp_Type_Cons, struct Lisp_Cons); +#define XCONS(a) XNONRECORD (a, cons, Lisp_Type_Cons, struct Lisp_Cons) +#define XSETCONS(c, p) XSETOBJ (c, Lisp_Type_Cons, p) +#define CONSP(x) (XTYPE (x) == Lisp_Type_Cons) +#define GC_CONSP(x) (XGCTYPE (x) == Lisp_Type_Cons) +#define CHECK_CONS(x) CHECK_NONRECORD (x, Lisp_Type_Cons, Qconsp) +#define CONCHECK_CONS(x) CONCHECK_NONRECORD (x, Lisp_Type_Cons, Qconsp) + +/* Define these because they're used in a few places, inside and + out of alloc.c */ +#define CONS_MARKED_P(c) XMARKBIT (c->car) +#define MARK_CONS(c) XMARK (c->car) + +#endif /* ! LRECORD_CONS */ #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)) @@ -693,477 +754,102 @@ extern Lisp_Object Qnil; x = wrong_type_argument (Qlistp, x); \ } while (0) -/*---------------------- list traversal macros -------------------------*/ - -/* Note: These macros are for traversing through a list in some format, - and executing code that you specify on each member of the list. - - There are two kinds of macros, those requiring surrounding braces, and - those not requiring this. Which type of macro will be indicated. - The general format for using a brace-requiring macro is - - { - LIST_LOOP_3 (elt, list, tail) - execute_code_here; - } - - or - - { - LIST_LOOP_3 (elt, list, tail) - { - execute_code_here; - } - } - - You can put variable declarations between the brace and beginning of - macro, but NOTHING ELSE. - - The brace-requiring macros typically declare themselves any arguments - that are initialized and iterated by the macros. If for some reason - you need to declare these arguments yourself (e.g. to do something on - them before the iteration starts, use the _NO_DECLARE versions of the - macros.) -*/ - -/* There are two basic kinds of macros: those that handle "internal" lists - that are known to be correctly structured (i.e. first element is a cons - or nil, and the car of each cons is also a cons or nil, and there are - no circularities), and those that handle "external" lists, where the - list may have any sort of invalid formation. This is reflected in - the names: those with "EXTERNAL_" work with external lists, and those - without this prefix work with internal lists. The internal-list - macros will hit an assertion failure if the structure is ill-formed; - the external-list macros will signal an error in this case, either a - malformed-list error or a circular-list error. - - Note also that the simplest external list iterator, EXTERNAL_LIST_LOOP, - does *NOT* check for circularities. Therefore, make sure you call - QUIT each iteration or so. However, it's probably easier just to use - EXTERNAL_LIST_LOOP_2, which is easier to use in any case. -*/ - -/* LIST_LOOP and EXTERNAL_LIST_LOOP are the simplest macros. They don't - require brace surrounding, and iterate through a list, which may or may - not known to be syntactically correct. EXTERNAL_LIST_LOOP is for those - not known to be correct, and it detects and signals a malformed list - error when encountering a problem. Circularities, however, are not - handled, and cause looping forever, so make sure to include a QUIT. - These functions also accept two args, TAIL (set progressively to each - cons starting with the first), and LIST, the list to iterate over. - TAIL needs to be defined by the program. - - In each iteration, you can retrieve the current list item using XCAR - (tail), or destructively modify the list using XSETCAR (tail, - ...). */ - -#define LIST_LOOP(tail, list) \ - for (tail = list; \ - !NILP (tail); \ - tail = XCDR (tail)) - -#define EXTERNAL_LIST_LOOP(tail, list) \ - for (tail = list; !NILP (tail); tail = XCDR (tail)) \ - if (!CONSP (tail)) \ - signal_malformed_list_error (list); \ - else - -/* The following macros are the "core" macros for list traversal. - - *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. *** - - LIST_LOOP_2 and EXTERNAL_LIST_LOOP_2 are the standard, most-often used - macros. They take two arguments, an element variable ELT and the list - LIST. ELT is automatically declared, and set to each element in turn - from LIST. - - LIST_LOOP_3 and EXTERNAL_LIST_LOOP_3 are the same, but they have a third - argument TAIL, another automatically-declared variable. At each iteration, - this one points to the cons cell for which ELT is the car. - - EXTERNAL_LIST_LOOP_4 is like EXTERNAL_LIST_LOOP_3 but takes an additional - LEN argument, again automatically declared, which counts the number of - iterations gone by. It is 0 during the first iteration. - - EXTERNAL_LIST_LOOP_4_NO_DECLARE is like EXTERNAL_LIST_LOOP_4 but none - of the variables are automatically declared, and so you need to declare - them yourself. (ELT and TAIL are Lisp_Objects, and LEN is an EMACS_INT.) -*/ - -#define LIST_LOOP_2(elt, list) \ - LIST_LOOP_3(elt, list, unused_tail_##elt) - -#define LIST_LOOP_3(elt, list, tail) \ - Lisp_Object elt, tail; \ - for (tail = list; \ - NILP (tail) ? \ - 0 : (elt = XCAR (tail), 1); \ - tail = XCDR (tail)) - -/* The following macros are for traversing lisp lists. - Signal an error if LIST is not properly acyclic and nil-terminated. - - Use tortoise/hare algorithm to check for cycles, but only if it - looks like the list is getting too long. Not only is the hare - faster than the tortoise; it even gets a head start! */ - -/* Optimized and safe macros for looping over external lists. */ -#define CIRCULAR_LIST_SUSPICION_LENGTH 1024 - -#define EXTERNAL_LIST_LOOP_1(list) \ -Lisp_Object ELL1_elt, ELL1_hare, ELL1_tortoise; \ -EMACS_INT ELL1_len; \ -PRIVATE_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 elt, hare_##elt, tortoise_##elt; \ -EMACS_INT len_##elt; \ -PRIVATE_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 elt, tail, tortoise_##elt; \ -EMACS_INT len_##elt; \ -PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, tail, \ - tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH) - -#define EXTERNAL_LIST_LOOP_4_NO_DECLARE(elt, list, tail, len) \ -Lisp_Object tortoise_##elt; \ -PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len, tail, \ - tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH) - -#define EXTERNAL_LIST_LOOP_4(elt, list, tail, len) \ -Lisp_Object elt, tail, tortoise_##elt; \ -EMACS_INT len; \ -PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len, tail, \ - tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH) - - -#define PRIVATE_EXTERNAL_LIST_LOOP_6(elt, list, len, hare, \ - tortoise, suspicion_length) \ - for (tortoise = hare = list, len = 0; \ - \ - (CONSP (hare) ? ((elt = XCAR (hare)), 1) : \ - (NILP (hare) ? 0 : \ - (signal_malformed_list_error (list), 0))); \ - \ - hare = XCDR (hare), \ - (void) \ - ((++len > suspicion_length) \ - && \ - ((((len & 1) != 0) && (tortoise = XCDR (tortoise), 0)), \ - (EQ (hare, tortoise) && (signal_circular_list_error (list), 0))))) - -/* GET_LIST_LENGTH and GET_EXTERNAL_LIST_LENGTH: - - These two macros return the length of LIST (either an internal or external - list, according to which macro is used), stored into LEN (which must - be declared by the caller). Circularities are trapped in external lists - (and cause errors). Neither macro need be declared inside brackets. */ - -#define GET_LIST_LENGTH(list, len) do { \ - Lisp_Object GLL_tail; \ - for (GLL_tail = list, len = 0; \ - !NILP (GLL_tail); \ - GLL_tail = XCDR (GLL_tail), ++len) \ - DO_NOTHING; \ -} while (0) - -#define GET_EXTERNAL_LIST_LENGTH(list, len) \ -do { \ - Lisp_Object GELL_elt, GELL_tail; \ - EXTERNAL_LIST_LOOP_4_NO_DECLARE (GELL_elt, list, GELL_tail, len) \ - ; \ -} while (0) +/* For a list that's known to be in valid list format -- + will abort() if the list is not in valid format */ +#define LIST_LOOP(consvar, list) \ + for (consvar = list; !NILP (consvar); consvar = XCDR (consvar)) /* For a list that's known to be in valid list format, where we may be deleting the current element out of the list -- will abort() if the list is not in valid format */ -#define LIST_LOOP_DELETING(consvar, nextconsvar, list) \ - for (consvar = list; \ - !NILP (consvar) ? (nextconsvar = XCDR (consvar), 1) :0; \ +#define LIST_LOOP_DELETING(consvar, nextconsvar, list) \ + for (consvar = list; \ + !NILP (consvar) ? (nextconsvar = XCDR (consvar), 1) : 0; \ consvar = nextconsvar) -/* LIST_LOOP_DELETE_IF and EXTERNAL_LIST_LOOP_DELETE_IF: - - These two macros delete all elements of LIST (either an internal or - external list, according to which macro is used) satisfying - CONDITION, a C expression referring to variable ELT. ELT is - automatically declared. Circularities are trapped in external - lists (and cause errors). Neither macro need be declared inside - brackets. */ - -#define LIST_LOOP_DELETE_IF(elt, list, condition) do { \ - /* Do not use ##list when creating new variables because \ - that may not be just a variable name. */ \ - Lisp_Object prev_tail_##elt = Qnil; \ - LIST_LOOP_3 (elt, list, tail_##elt) \ - { \ - if (condition) \ - { \ - if (NILP (prev_tail_##elt)) \ - list = XCDR (tail_##elt); \ - else \ - XCDR (prev_tail_##elt) = XCDR (tail_##elt); \ - } \ - else \ - prev_tail_##elt = tail_##elt; \ - } \ -} while (0) - -#define EXTERNAL_LIST_LOOP_DELETE_IF(elt, list, condition) do { \ - Lisp_Object prev_tail_##elt = Qnil; \ - EXTERNAL_LIST_LOOP_4 (elt, list, tail_##elt, len_##elt) \ - { \ - if (condition) \ - { \ - if (NILP (prev_tail_##elt)) \ - list = XCDR (tail_##elt); \ - else \ - XCDR (prev_tail_##elt) = XCDR (tail_##elt); \ - /* Keep tortoise from ever passing hare. */ \ - len_##elt = 0; \ - } \ - else \ - prev_tail_##elt = tail_##elt; \ - } \ -} while (0) - - -/* Macros for looping over external alists. - - *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. *** - - EXTERNAL_ALIST_LOOP_4 is similar to EXTERNAL_LIST_LOOP_2, but it - assumes the elements are aconses (the elements in an alist) and - sets two additional argument variables ELT_CAR and ELT_CDR to the - car and cdr of the acons. All of the variables ELT, ELT_CAR and - ELT_CDR are automatically declared. - - EXTERNAL_ALIST_LOOP_5 adds a TAIL argument to EXTERNAL_ALIST_LOOP_4, - just like EXTERNAL_LIST_LOOP_3 does, and again TAIL is automatically - declared. - - EXTERNAL_ALIST_LOOP_6 adds a LEN argument to EXTERNAL_ALIST_LOOP_5, - just like EXTERNAL_LIST_LOOP_4 does, and again LEN is automatically - declared. +/* For a list that may not be in valid list format -- + will signal an error if the list is not in valid format */ +#define EXTERNAL_LIST_LOOP(consvar, listp) \ + for (consvar = listp; !NILP (consvar); consvar = XCDR (consvar)) \ + if (!CONSP (consvar)) \ + signal_simple_error ("Invalid list format", listp); \ + else - EXTERNAL_ALIST_LOOP_6_NO_DECLARE does not declare any of its arguments, - just like EXTERNAL_LIST_LOOP_4_NO_DECLARE, and so these must be declared - manually. - */ +extern Lisp_Object Qnil; -/* Optimized and safe macros for looping over external alists. */ -#define EXTERNAL_ALIST_LOOP_4(elt, elt_car, elt_cdr, list) \ -Lisp_Object elt, elt_car, elt_cdr; \ -Lisp_Object hare_##elt, tortoise_##elt; \ -EMACS_INT len_##elt; \ -PRIVATE_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 elt, elt_car, elt_cdr, tail; \ -Lisp_Object tortoise_##elt; \ -EMACS_INT len_##elt; \ -PRIVATE_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 elt, elt_car, elt_cdr, tail; \ -EMACS_INT len; \ -Lisp_Object tortoise_##elt; \ -PRIVATE_EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list, \ - len, tail, tortoise_##elt, \ - CIRCULAR_LIST_SUSPICION_LENGTH) - -#define EXTERNAL_ALIST_LOOP_6_NO_DECLARE(elt, elt_car, elt_cdr, list, \ - tail, len) \ -Lisp_Object tortoise_##elt; \ -PRIVATE_EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list, \ - len, tail, tortoise_##elt, \ - CIRCULAR_LIST_SUSPICION_LENGTH) - - -#define PRIVATE_EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list, len, \ - hare, tortoise, suspicion_length) \ -PRIVATE_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 +INLINE int TRUE_LIST_P (Lisp_Object object); +INLINE int +TRUE_LIST_P (Lisp_Object object) +{ + while (CONSP (object)) + object = XCDR (object); + return NILP (object); +} -/* Macros for looping over external property lists. - - *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. *** - - EXTERNAL_PROPERTY_LIST_LOOP_3 maps over an external list assumed to - be a property list, consisting of alternating pairs of keys - (typically symbols or keywords) and values. Each iteration - processes one such pair out of LIST, assigning the two elements to - KEY and VALUE respectively. Malformed lists and circularities are - trapped as usual, and in addition, property lists with an odd number - of elements also signal an error. - - EXTERNAL_PROPERTY_LIST_LOOP_4 adds a TAIL argument to - EXTERNAL_PROPERTY_LIST_LOOP_3, just like EXTERNAL_LIST_LOOP_3 does, - and again TAIL is automatically declared. - - EXTERNAL_PROPERTY_LIST_LOOP_5 adds a LEN argument to - EXTERNAL_PROPERTY_LIST_LOOP_4, just like EXTERNAL_LIST_LOOP_4 does, - and again LEN is automatically declared. Note that in this case, - LEN counts the iterations, NOT the total number of list elements - processed, which is 2 * LEN. - - EXTERNAL_PROPERTY_LIST_LOOP_5_NO_DECLARE does not declare any of its - arguments, just like EXTERNAL_LIST_LOOP_4_NO_DECLARE, and so these - must be declared manually. */ - -/* 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, \ - 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, \ - 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, \ - tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH) - -#define EXTERNAL_PROPERTY_LIST_LOOP_5_NO_DECLARE(key, value, list, \ - tail, len) \ -Lisp_Object tortoise_##key; \ -EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len, tail, \ - tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH) - - -#define EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len, hare, \ - tortoise, suspicion_length) \ - for (tortoise = hare = list, len = 0; \ - \ - ((CONSP (hare) && \ - (key = XCAR (hare), \ - hare = XCDR (hare), \ - (CONSP (hare) ? 1 : \ - (signal_malformed_property_list_error (list), 0)))) ? \ - (value = XCAR (hare), 1) : \ - (NILP (hare) ? 0 : \ - (signal_malformed_property_list_error (list), 0))); \ - \ - hare = XCDR (hare), \ - ((++len < suspicion_length) ? \ - ((void) 0) : \ - (((len & 1) ? \ - ((void) (tortoise = XCDR (XCDR (tortoise)))) : \ - ((void) 0)) \ - , \ - (EQ (hare, tortoise) ? \ - ((void) signal_circular_property_list_error (list)) : \ - ((void) 0))))) +#define CHECK_TRUE_LIST(object) do { \ + if (!TRUE_LIST_P (object)) \ + dead_wrong_type_argument (Qtrue_list_p, object); \ +} while (0) /* For a property list (alternating keywords/values) that may not be in valid list format -- will signal an error if the list is not in valid format. CONSVAR is used to keep track of the iterations - without modifying PLIST. + without modifying LISTP. We have to be tricky to still keep the same C format.*/ -#define EXTERNAL_PROPERTY_LIST_LOOP(tail, key, value, plist) \ - for (tail = plist; \ - (CONSP (tail) && CONSP (XCDR (tail)) ? \ - (key = XCAR (tail), value = XCAR (XCDR (tail))) : \ - (key = Qunbound, value = Qunbound)), \ - !NILP (tail); \ - tail = XCDR (XCDR (tail))) \ - if (UNBOUNDP (key)) \ - Fsignal (Qmalformed_property_list, list1 (plist)); \ +#define EXTERNAL_PROPERTY_LIST_LOOP(consvar, keyword, value, listp) \ + for (consvar = listp; \ + (CONSP (consvar) && CONSP (XCDR (consvar)) ? \ + (keyword = XCAR (consvar), value = XCAR (XCDR (consvar))) : \ + (keyword = Qunbound, value = Qunbound)), \ + !NILP (consvar); \ + consvar = XCDR (XCDR (consvar))) \ + if (UNBOUNDP (keyword)) \ + signal_simple_error ("Invalid property list format", listp); \ else -#define PROPERTY_LIST_LOOP(tail, key, value, plist) \ - for (tail = plist; \ - NILP (tail) ? 0 : \ - (key = XCAR (tail), tail = XCDR (tail), \ - value = XCAR (tail), tail = XCDR (tail), 1); \ - ) - -/* Return 1 if LIST is properly acyclic and nil-terminated, else 0. */ -INLINE_HEADER int TRUE_LIST_P (Lisp_Object object); -INLINE_HEADER int -TRUE_LIST_P (Lisp_Object object) -{ - Lisp_Object hare, tortoise; - EMACS_INT len; - - for (hare = tortoise = object, len = 0; - CONSP (hare); - hare = XCDR (hare), len++) - { - if (len < CIRCULAR_LIST_SUSPICION_LENGTH) - continue; - - if (len & 1) - tortoise = XCDR (tortoise); - else if (EQ (hare, tortoise)) - return 0; - } - - return NILP (hare); -} - -/* Signal an error if LIST is not properly acyclic and nil-terminated. */ -#define CHECK_TRUE_LIST(list) do { \ - Lisp_Object CTL_list = (list); \ - Lisp_Object CTL_hare, CTL_tortoise; \ - EMACS_INT CTL_len; \ - \ - for (CTL_hare = CTL_tortoise = CTL_list, CTL_len = 0; \ - CONSP (CTL_hare); \ - CTL_hare = XCDR (CTL_hare), CTL_len++) \ - { \ - if (CTL_len < CIRCULAR_LIST_SUSPICION_LENGTH) \ - continue; \ - \ - if (CTL_len & 1) \ - CTL_tortoise = XCDR (CTL_tortoise); \ - else if (EQ (CTL_hare, CTL_tortoise)) \ - Fsignal (Qcircular_list, list1 (CTL_list)); \ - } \ - \ - if (! NILP (CTL_hare)) \ - signal_malformed_list_error (CTL_list); \ -} while (0) +/*********** string ***********/ -/*------------------------------ string --------------------------------*/ +/* In a string or vector, the sign bit of the `size' is the gc mark bit */ +/* (The size and data fields have underscores prepended to catch old + code that attempts to reference the fields directly) */ struct Lisp_String { +#ifdef LRECORD_STRING struct lrecord_header lheader; - Bytecount size; - Bufbyte *data; +#endif + Bytecount _size; + Bufbyte *_data; Lisp_Object plist; }; -typedef struct Lisp_String Lisp_String; -DECLARE_LRECORD (string, Lisp_String); -#define XSTRING(x) XRECORD (x, string, Lisp_String) +#ifdef LRECORD_STRING + +DECLARE_LRECORD (string, struct Lisp_String); +#define XSTRING(x) XRECORD (x, string, struct 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) +#else /* ! LRECORD_STRING */ + +DECLARE_NONRECORD (string, Lisp_Type_String, struct Lisp_String); +#define XSTRING(x) XNONRECORD (x, string, Lisp_Type_String, struct Lisp_String) +#define XSETSTRING(x, p) XSETOBJ (x, Lisp_Type_String, p) +#define STRINGP(x) (XTYPE (x) == Lisp_Type_String) +#define GC_STRINGP(x) (XGCTYPE (x) == Lisp_Type_String) +#define CHECK_STRING(x) CHECK_NONRECORD (x, Lisp_Type_String, Qstringp) +#define CONCHECK_STRING(x) CONCHECK_NONRECORD (x, Lisp_Type_String, Qstringp) + +#endif /* ! LRECORD_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 */ @@ -1172,91 +858,87 @@ Bytecount charcount_to_bytecount (const Bufbyte *ptr, Charcount len); #endif /* not MULE */ -#define string_length(s) ((s)->size) +#define string_length(s) ((s)->_size) #define XSTRING_LENGTH(s) string_length (XSTRING (s)) #define XSTRING_CHAR_LENGTH(s) string_char_length (XSTRING (s)) -#define string_data(s) ((s)->data + 0) +#define string_data(s) ((s)->_data + 0) #define XSTRING_DATA(s) string_data (XSTRING (s)) -#define string_byte(s, i) ((s)->data[i] + 0) +#define string_byte(s, i) ((s)->_data[i] + 0) #define XSTRING_BYTE(s, i) string_byte (XSTRING (s), i) -#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 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, c) ((void) ((s)->_data[i] = (c))) -void resize_string (Lisp_String *s, Bytecount pos, Bytecount delta); +void resize_string (struct Lisp_String *s, Bytecount pos, Bytecount delta); #ifdef MULE -INLINE_HEADER Charcount string_char_length (Lisp_String *s); -INLINE_HEADER Charcount -string_char_length (Lisp_String *s) +INLINE Charcount string_char_length (struct Lisp_String *s); +INLINE Charcount +string_char_length (struct Lisp_String *s) { return bytecount_to_charcount (string_data (s), string_length (s)); } # define string_char(s, i) charptr_emchar_n (string_data (s), i) # define string_char_addr(s, i) charptr_n_addr (string_data (s), i) -void set_string_char (Lisp_String *s, Charcount i, Emchar c); +void set_string_char (struct Lisp_String *s, Charcount i, Emchar c); #else /* not MULE */ # 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 aligned size of a struct whose last member is a - variable-length array field. (this is known as the "struct hack") */ -/* Implementation: in practice, structtype and fieldtype usually have - the same alignment, but we can't be sure. We need to use - ALIGN_SIZE to be absolutely sure of getting the correct alignment. - To help the compiler's optimizer, we use a ternary expression that - only a very stupid compiler would fail to correctly simplify. */ -#define FLEXIBLE_ARRAY_STRUCT_SIZEOF(structtype, \ - fieldtype, \ - fieldname, \ - array_length) \ -(ALIGNOF (structtype) == ALIGNOF (fieldtype) \ - ? (offsetof (structtype, fieldname) + \ - (offsetof (structtype, fieldname[1]) - \ - offsetof (structtype, fieldname[0])) * \ - (array_length)) \ - : (ALIGN_SIZE \ - ((offsetof (structtype, fieldname) + \ - (offsetof (structtype, fieldname[1]) - \ - offsetof (structtype, fieldname[0])) * \ - (array_length)), \ - ALIGNOF (structtype)))) - -/*------------------------------ vector --------------------------------*/ +/*********** vector ***********/ struct Lisp_Vector { +#ifdef LRECORD_VECTOR struct lcrecord_header header; +#endif long size; /* next is now chained through v->contents[size], terminated by Qzero. This means that pure vectors don't need a "next" */ /* struct Lisp_Vector *next; */ Lisp_Object contents[1]; }; -typedef struct Lisp_Vector Lisp_Vector; -DECLARE_LRECORD (vector, Lisp_Vector); -#define XVECTOR(x) XRECORD (x, vector, Lisp_Vector) +#ifdef LRECORD_VECTOR + +DECLARE_LRECORD (vector, struct Lisp_Vector); +#define XVECTOR(x) XRECORD (x, vector, struct 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) +#else + +DECLARE_NONRECORD (vector, Lisp_Type_Vector, struct Lisp_Vector); +#define XVECTOR(x) XNONRECORD (x, vector, Lisp_Type_Vector, struct Lisp_Vector) +#define XSETVECTOR(x, p) XSETOBJ (x, Lisp_Type_Vector, p) +#define VECTORP(x) (XTYPE (x) == Lisp_Type_Vector) +#define GC_VECTORP(x) (XGCTYPE (x) == Lisp_Type_Vector) +#define CHECK_VECTOR(x) CHECK_NONRECORD (x, Lisp_Type_Vector, Qvectorp) +#define CONCHECK_VECTOR(x) CONCHECK_NONRECORD (x, Lisp_Type_Vector, Qvectorp) + +#endif + #define vector_length(v) ((v)->size) #define XVECTOR_LENGTH(s) vector_length (XVECTOR (s)) #define vector_data(v) ((v)->contents) #define XVECTOR_DATA(s) vector_data (XVECTOR (s)) +#ifndef LRECORD_VECTOR +# define vector_next(v) ((v)->contents[(v)->size]) +#endif -/*---------------------------- bit vectors -----------------------------*/ +/*********** bit vector ***********/ #if (LONGBITS < 16) #error What the hell?! @@ -1277,19 +959,20 @@ struct Lisp_Bit_Vector { struct lrecord_header lheader; Lisp_Object next; - EMACS_INT size; - unsigned long bits[1]; + long size; + unsigned int bits[1]; }; -typedef struct Lisp_Bit_Vector Lisp_Bit_Vector; -DECLARE_LRECORD (bit_vector, Lisp_Bit_Vector); -#define XBIT_VECTOR(x) XRECORD (x, bit_vector, Lisp_Bit_Vector) +DECLARE_LRECORD (bit_vector, struct Lisp_Bit_Vector); +#define XBIT_VECTOR(x) XRECORD (x, bit_vector, struct 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)) \ @@ -1304,108 +987,123 @@ DECLARE_LRECORD (bit_vector, Lisp_Bit_Vector); #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 (struct Lisp_Bit_Vector *v, int i); +INLINE int +bit_vector_bit (struct 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 (struct Lisp_Bit_Vector *v, int i, int value); +INLINE void +set_bit_vector_bit (struct 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] |= (1 << (ui & (LONGBITS_POWER_OF_2 - 1))); else - v->bits[n >> LONGBITS_LOG2] &= ~(1UL << (n & (LONGBITS_POWER_OF_2 - 1))); + (v)->bits[ui >> LONGBITS_LOG2] &= ~(1 << (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 ***********/ -/*------------------------------ symbol --------------------------------*/ +/* In a symbol, the markbit of the plist is used as the gc mark bit */ -typedef struct Lisp_Symbol Lisp_Symbol; struct Lisp_Symbol { +#ifdef LRECORD_SYMBOL struct lrecord_header lheader; +#endif /* 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; + /* non-nil if the symbol is interned in Vobarray */ + Lisp_Object obarray; Lisp_Object plist; }; -#define SYMBOL_IS_KEYWORD(sym) \ - ((string_byte (symbol_name (XSYMBOL (sym)), 0) == ':') \ - && EQ (sym, oblookup (Vobarray, \ - string_data (symbol_name (XSYMBOL (sym))), \ - string_length (symbol_name (XSYMBOL (sym)))))) +#define SYMBOL_IS_KEYWORD(sym) (string_byte (XSYMBOL(sym)->name, 0) == ':') #define KEYWORDP(obj) (SYMBOLP (obj) && SYMBOL_IS_KEYWORD (obj)) -DECLARE_LRECORD (symbol, Lisp_Symbol); -#define XSYMBOL(x) XRECORD (x, symbol, Lisp_Symbol) +#ifdef LRECORD_SYMBOL + +DECLARE_LRECORD (symbol, struct Lisp_Symbol); +#define XSYMBOL(x) XRECORD (x, symbol, struct 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) +#else + +DECLARE_NONRECORD (symbol, Lisp_Type_Symbol, struct Lisp_Symbol); +#define XSYMBOL(x) XNONRECORD (x, symbol, Lisp_Type_Symbol, struct Lisp_Symbol) +#define XSETSYMBOL(s, p) XSETOBJ ((s), Lisp_Type_Symbol, (p)) +#define SYMBOLP(x) (XTYPE (x) == Lisp_Type_Symbol) +#define GC_SYMBOLP(x) (XGCTYPE (x) == Lisp_Type_Symbol) +#define CHECK_SYMBOL(x) CHECK_NONRECORD (x, Lisp_Type_Symbol, Qsymbolp) +#define CONCHECK_SYMBOL(x) CONCHECK_NONRECORD (x, Lisp_Type_Symbol, Qsymbolp) + +#endif + #define symbol_next(s) ((s)->next) #define symbol_name(s) ((s)->name) #define symbol_value(s) ((s)->value) #define symbol_function(s) ((s)->function) #define symbol_plist(s) ((s)->plist) -/*------------------------------- subr ---------------------------------*/ +/*********** subr ***********/ typedef Lisp_Object (*lisp_fn_t) (void); 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; -DECLARE_LRECORD (subr, Lisp_Subr); -#define XSUBR(x) XRECORD (x, subr, Lisp_Subr) +DECLARE_LRECORD (subr, struct Lisp_Subr); +#define XSUBR(x) XRECORD (x, subr, struct 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 --------------------------------*/ +/*********** 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; }; -DECLARE_LRECORD (marker, Lisp_Marker); -#define XMARKER(x) XRECORD (x, marker, Lisp_Marker) +DECLARE_LRECORD (marker, struct Lisp_Marker); +#define XMARKER(x) XRECORD (x, marker, struct 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) @@ -1415,14 +1113,15 @@ DECLARE_LRECORD (marker, Lisp_Marker); #define marker_next(m) ((m)->next) #define marker_prev(m) ((m)->prev) -/*------------------------------- char ---------------------------------*/ +/*********** 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)); @@ -1431,7 +1130,7 @@ XCHAR (Lisp_Object obj) #else -#define XCHAR(x) ((Emchar)XCHARVAL (x)) +#define XCHAR(x) XCHARVAL (x) #endif @@ -1439,11 +1138,11 @@ XCHAR (Lisp_Object obj) #define CONCHECK_CHAR(x) CONCHECK_NONRECORD (x, Lisp_Type_Char, Qcharacterp) -/*------------------------------ float ---------------------------------*/ +/*********** float ***********/ #ifdef LISP_FLOAT_TYPE -/* Note: the 'unused_next_' field exists only to ensure that the +/* Note: the 'unused__next__' field exists only to ensure that the `next' pointer fits within the structure, for the purposes of the free list. This makes a difference in the unlikely case of sizeof(double) being smaller than sizeof(void *). */ @@ -1451,19 +1150,18 @@ XCHAR (Lisp_Object obj) struct Lisp_Float { struct lrecord_header lheader; - union { double d; struct Lisp_Float *unused_next_; } data; + union { double d; struct Lisp_Float *unused__next__; } data; }; -typedef struct Lisp_Float Lisp_Float; -DECLARE_LRECORD (float, Lisp_Float); -#define XFLOAT(x) XRECORD (x, float, Lisp_Float) +DECLARE_LRECORD (float, struct Lisp_Float); +#define XFLOAT(x) XRECORD (x, float, struct 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) #define float_data(f) ((f)->data.d) -#define XFLOAT_DATA(x) float_data (XFLOAT (x)) #define XFLOATINT(n) extract_float (n) @@ -1477,39 +1175,71 @@ DECLARE_LRECORD (float, Lisp_Float); x = wrong_type_argument (Qnumberp, x); \ } while (0) +/* These are always continuable because they change their arguments + even when no error is signalled. */ + +#define CHECK_INT_OR_FLOAT_COERCE_MARKER(x) do { \ + if (INT_OR_FLOATP (x)) \ + ; \ + else if (MARKERP (x)) \ + x = make_int (marker_position (x)); \ + else \ + x = wrong_type_argument (Qnumber_or_marker_p, x); \ +} while (0) + +#define CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER(x) do { \ + if (INT_OR_FLOATP (x)) \ + ; \ + else if (CHARP (x)) \ + x = make_int (XCHAR (x)); \ + else if (MARKERP (x)) \ + x = make_int (marker_position (x)); \ + else \ + x = wrong_type_argument (Qnumber_char_or_marker_p, x); \ +} 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 CHECK_INT_OR_FLOAT_COERCE_MARKER CHECK_INT_COERCE_MARKER +#define CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER \ + CHECK_INT_COERCE_CHAR_OR_MARKER +#define INT_OR_FLOATP(x) (INTP (x)) +# define GC_INT_OR_FLOATP(x) (GC_INTP (x)) #endif /* not LISP_FLOAT_TYPE */ -/*-------------------------------- int ---------------------------------*/ +/*********** 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)); @@ -1534,6 +1264,7 @@ XCHAR_OR_INT (Lisp_Object obj) } 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)) \ @@ -1575,19 +1306,12 @@ XCHAR_OR_INT (Lisp_Object obj) x = wrong_type_argument (Qinteger_char_or_marker_p, x); \ } while (0) +/*********** pure space ***********/ -/*--------------------------- readonly objects -------------------------*/ - -#define CHECK_C_WRITEABLE(obj) \ - do { if (c_readonly (obj)) c_write_error (obj); } while (0) - -#define CHECK_LISP_WRITEABLE(obj) \ - do { if (lisp_readonly (obj)) lisp_write_error (obj); } while (0) - -#define C_READONLY(obj) (C_READONLY_RECORD_HEADER_P(XRECORD_LHEADER (obj))) -#define LISP_READONLY(obj) (LISP_READONLY_RECORD_HEADER_P(XRECORD_LHEADER (obj))) +#define CHECK_IMPURE(obj) \ + do { if (purified (obj)) pure_write_error (obj); } while (0) -/*----------------------------- structures -----------------------------*/ +/*********** structures ***********/ typedef struct structure_keyword_entry structure_keyword_entry; struct structure_keyword_entry @@ -1628,7 +1352,7 @@ void define_structure_type_keyword (struct structure_type *st, Lisp_Object value, Error_behavior errb)); -/*---------------------------- weak lists ------------------------------*/ +/*********** weak lists ***********/ enum weak_list_type { @@ -1640,10 +1364,7 @@ enum weak_list_type /* 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 @@ -1658,6 +1379,7 @@ DECLARE_LRECORD (weak_list, struct weak_list); #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) @@ -1666,36 +1388,38 @@ DECLARE_LRECORD (weak_list, struct weak_list); 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-list -----------------------------*/ +/*********** lcrecord lists ***********/ struct lcrecord_list { 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); /************************************************************************/ -/* Definitions of primitive Lisp functions and variables */ +/* Definitions of primitive Lisp functions and variables */ /************************************************************************/ @@ -1706,8 +1430,8 @@ void free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord); valid in a C identifier, with an "F" prepended. The name of the C constant structure that records information on this function for internal use is "S" concatenated with Fname. - `min_args' should be a number, the minimum number of arguments allowed. - `max_args' should be a number, the maximum number of arguments allowed, + `minargs' should be a number, the minimum number of arguments allowed. + `maxargs' should be a number, the maximum number of arguments allowed, or else MANY or UNEVALLED. MANY means pass a vector of evaluated arguments, in the form of an integer number-of-arguments @@ -1738,7 +1462,7 @@ Lisp_Object,Lisp_Object Lisp_Object,Lisp_Object,Lisp_Object #define EXFUN_MANY int, Lisp_Object* #define EXFUN_UNEVALLED Lisp_Object -#define EXFUN(sym, max_args) Lisp_Object sym (EXFUN_##max_args) +#define EXFUN(sym, maxargs) Lisp_Object sym (EXFUN_##maxargs) #define SUBR_MAX_ARGS 8 #define MANY -2 @@ -1747,27 +1471,20 @@ Lisp_Object,Lisp_Object,Lisp_Object /* Can't be const, because then subr->doc is read-only and Snarf_documentation chokes */ -#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 \ - }; \ - Lisp_Object Fname (DEFUN_##max_args arglist) +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION +# define subr_lheader_initializer { 0, 0, 0 } +#else +# define subr_lheader_initializer { lrecord_subr } +#endif + +#define DEFUN(lname, Fname, minargs, maxargs, prompt, arglist) \ + Lisp_Object Fname (EXFUN_##maxargs); \ + static struct Lisp_Subr S##Fname = { subr_lheader_initializer, \ + minargs, maxargs, prompt, 0, lname, (lisp_fn_t) Fname }; \ + Lisp_Object Fname (DEFUN_##maxargs arglist) /* Heavy ANSI C preprocessor hackery to get DEFUN to declare a - prototype that matches max_args, and add the obligatory + prototype that matches maxargs, and add the obligatory `Lisp_Object' type declaration to the formal C arguments. */ #define DEFUN_MANY(named_int, named_Lisp_Object) named_int, named_Lisp_Object @@ -1782,33 +1499,18 @@ Lisp_Object,Lisp_Object,Lisp_Object #define DEFUN_7(a,b,c,d,e,f,g) DEFUN_6(a,b,c,d,e,f), Lisp_Object g #define DEFUN_8(a,b,c,d,e,f,g,h) DEFUN_7(a,b,c,d,e,f,g),Lisp_Object h -/* WARNING: If you add defines here for higher values of max_args, - make sure to also fix the clauses in PRIMITIVE_FUNCALL(), +/* WARNING: If you add defines here for higher values of maxargs, + make sure to also fix the clauses in inline_funcall_fn(), and change the define of SUBR_MAX_ARGS above. */ #include "symeval.h" -/* `specpdl' is the special binding/unwind-protect stack. - - Knuth says (see the Jargon File): - At MIT, `pdl' [abbreviation for `Push Down List'] used to - be a more common synonym for `stack'. - Everywhere else `stack' seems to be the preferred term. - - specpdl_depth is the current depth of `specpdl'. - Save this for use later as arg to `unbind_to'. */ -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) +/* Depth of special binding/unwind-protect stack. Use as arg to `unbind_to' */ +int specpdl_depth (void); /************************************************************************/ -/* Checking for QUIT */ +/* Checking for QUIT */ /************************************************************************/ /* Asynchronous events set something_happened, and then are processed @@ -1852,7 +1554,7 @@ void signal_quit (void); /************************************************************************/ -/* hashing */ +/* hashing */ /************************************************************************/ /* #### for a 64-bit machine, we should substitute a prime just over 2^32 */ @@ -1866,25 +1568,27 @@ void signal_quit (void); #define HASH8(a,b,c,d,e,f,g,h) (GOOD_HASH * HASH7 (a,b,c,d,e,f,g) + (h)) #define HASH9(a,b,c,d,e,f,g,h,i) (GOOD_HASH * HASH8 (a,b,c,d,e,f,g,h) + (i)) +/* Enough already! */ + #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); /************************************************************************/ -/* String translation */ +/* String translation */ /************************************************************************/ #ifdef I18N3 #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) @@ -1902,7 +1606,7 @@ char *bindtextdomain (const char *, const char *); /************************************************************************/ -/* Garbage collection / GC-protection */ +/* Garbage collection / GC-protection */ /************************************************************************/ /* number of bytes of structure consed since last GC */ @@ -1911,7 +1615,7 @@ extern EMACS_INT consing_since_gc; /* threshold for doing another gc */ -extern Fixnum gc_cons_threshold; +extern EMACS_INT gc_cons_threshold; /* Structure for recording stack slots that need marking */ @@ -1999,117 +1703,117 @@ void debug_ungcpro(char *, int, struct gcpro *); #define NNGCPRO5(v1,v2,v3,v4,v5) \ debug_gcpro5 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&nngcpro4,\ &nngcpro5,&v1,&v2,&v3,&v4,&v5) -#define NNUNGCPRO \ +#define NUNNGCPRO \ debug_ungcpro(__FILE__, __LINE__,&nngcpro1) #else /* ! DEBUG_GCPRO */ -#define GCPRO1(var1) ((void) ( \ - gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \ - gcprolist = &gcpro1 )) - -#define GCPRO2(var1, var2) ((void) ( \ - gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \ - gcpro2.next = &gcpro1, gcpro2.var = &var2, gcpro2.nvars = 1, \ - gcprolist = &gcpro2 )) - -#define GCPRO3(var1, var2, var3) ((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, \ - gcprolist = &gcpro3 )) - -#define GCPRO4(var1, var2, var3, var4) ((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, \ - gcpro4.next = &gcpro3, gcpro4.var = &var4, gcpro4.nvars = 1, \ - gcprolist = &gcpro4 )) - -#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, \ - gcpro4.next = &gcpro3, gcpro4.var = &var4, gcpro4.nvars = 1, \ - gcpro5.next = &gcpro4, gcpro5.var = &var5, gcpro5.nvars = 1, \ - gcprolist = &gcpro5 )) - -#define UNGCPRO ((void) (gcprolist = gcpro1.next)) - -#define NGCPRO1(var1) ((void) ( \ - ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \ - gcprolist = &ngcpro1 )) - -#define NGCPRO2(var1, var2) ((void) ( \ - ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \ - ngcpro2.next = &ngcpro1, ngcpro2.var = &var2, ngcpro2.nvars = 1, \ - gcprolist = &ngcpro2 )) - -#define NGCPRO3(var1, var2, var3) ((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, \ - gcprolist = &ngcpro3 )) - -#define NGCPRO4(var1, var2, var3, var4) ((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, \ - ngcpro4.next = &ngcpro3, ngcpro4.var = &var4, ngcpro4.nvars = 1, \ - gcprolist = &ngcpro4 )) - -#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, \ - ngcpro4.next = &ngcpro3, ngcpro4.var = &var4, ngcpro4.nvars = 1, \ - ngcpro5.next = &ngcpro4, ngcpro5.var = &var5, ngcpro5.nvars = 1, \ - gcprolist = &ngcpro5 )) - -#define NUNGCPRO ((void) (gcprolist = ngcpro1.next)) - -#define NNGCPRO1(var1) ((void) ( \ - nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \ - gcprolist = &nngcpro1 )) - -#define NNGCPRO2(var1, var2) ((void) ( \ - nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \ - nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \ - gcprolist = &nngcpro2 )) - -#define NNGCPRO3(var1, var2, var3) ((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, \ - gcprolist = &nngcpro3 )) - -#define NNGCPRO4(var1, var2, var3, var4) ((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, \ - nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \ - gcprolist = &nngcpro4 )) - -#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, \ - nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \ - nngcpro5.next = &nngcpro4, nngcpro5.var = &var5, nngcpro5.nvars = 1, \ - gcprolist = &nngcpro5 )) - -#define NNUNGCPRO ((void) (gcprolist = nngcpro1.next)) +#define GCPRO1(varname) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ + gcprolist = &gcpro1; } + +#define GCPRO2(varname1, varname2) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcprolist = &gcpro2; } + +#define GCPRO3(varname1, varname2, varname3) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcprolist = &gcpro3; } + +#define GCPRO4(varname1, varname2, varname3, varname4) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcprolist = &gcpro4; } + +#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcprolist = &gcpro5; } + +#define UNGCPRO (gcprolist = gcpro1.next) + +#define NGCPRO1(varname) \ + {ngcpro1.next = gcprolist; ngcpro1.var = &varname; ngcpro1.nvars = 1; \ + gcprolist = &ngcpro1; } + +#define NGCPRO2(varname1, varname2) \ + {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \ + ngcpro2.next = &ngcpro1; ngcpro2.var = &varname2; ngcpro2.nvars = 1; \ + gcprolist = &ngcpro2; } + +#define NGCPRO3(varname1, varname2, varname3) \ + {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \ + ngcpro2.next = &ngcpro1; ngcpro2.var = &varname2; ngcpro2.nvars = 1; \ + ngcpro3.next = &ngcpro2; ngcpro3.var = &varname3; ngcpro3.nvars = 1; \ + gcprolist = &ngcpro3; } + +#define NGCPRO4(varname1, varname2, varname3, varname4) \ + {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \ + ngcpro2.next = &ngcpro1; ngcpro2.var = &varname2; ngcpro2.nvars = 1; \ + ngcpro3.next = &ngcpro2; ngcpro3.var = &varname3; ngcpro3.nvars = 1; \ + ngcpro4.next = &ngcpro3; ngcpro4.var = &varname4; ngcpro4.nvars = 1; \ + gcprolist = &ngcpro4; } + +#define NGCPRO5(varname1, varname2, varname3, varname4, varname5) \ + {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \ + ngcpro2.next = &ngcpro1; ngcpro2.var = &varname2; ngcpro2.nvars = 1; \ + ngcpro3.next = &ngcpro2; ngcpro3.var = &varname3; ngcpro3.nvars = 1; \ + ngcpro4.next = &ngcpro3; ngcpro4.var = &varname4; ngcpro4.nvars = 1; \ + ngcpro5.next = &ngcpro4; ngcpro5.var = &varname5; ngcpro5.nvars = 1; \ + gcprolist = &ngcpro5; } + +#define NUNGCPRO (gcprolist = ngcpro1.next) + +#define NNGCPRO1(varname) \ + {nngcpro1.next = gcprolist; nngcpro1.var = &varname; nngcpro1.nvars = 1; \ + gcprolist = &nngcpro1; } + +#define NNGCPRO2(varname1, varname2) \ + {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \ + nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \ + gcprolist = &nngcpro2; } + +#define NNGCPRO3(varname1, varname2, varname3) \ + {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \ + nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \ + nngcpro3.next = &nngcpro2; nngcpro3.var = &varname3; nngcpro3.nvars = 1; \ + gcprolist = &nngcpro3; } + +#define NNGCPRO4(varname1, varname2, varname3, varname4) \ + {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \ + nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \ + nngcpro3.next = &nngcpro2; nngcpro3.var = &varname3; nngcpro3.nvars = 1; \ + nngcpro4.next = &nngcpro3; nngcpro4.var = &varname4; nngcpro4.nvars = 1; \ + gcprolist = &nngcpro4; } + +#define NNGCPRO5(varname1, varname2, varname3, varname4, varname5) \ + {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \ + nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \ + nngcpro3.next = &nngcpro2; nngcpro3.var = &varname3; nngcpro3.nvars = 1; \ + nngcpro4.next = &nngcpro3; nngcpro4.var = &varname4; nngcpro4.nvars = 1; \ + nngcpro5.next = &nngcpro4; nngcpro5.var = &varname5; nngcpro5.nvars = 1; \ + gcprolist = &nngcpro5; } + +#define NNUNGCPRO (gcprolist = nngcpro1.next) #endif /* ! DEBUG_GCPRO */ /* Another try to fix SunPro C compiler warnings */ /* "end-of-loop code not reached" */ /* "statement not reached */ -#if defined __SUNPRO_C || defined __USLC__ -#define RETURN_SANS_WARNINGS if (1) return +#ifdef __SUNPRO_C +#define RETURN__ if (1) return #define RETURN_NOT_REACHED(value) #else -#define RETURN_SANS_WARNINGS return +#define RETURN__ return #define RETURN_NOT_REACHED(value) return value; #endif @@ -2118,7 +1822,7 @@ void debug_ungcpro(char *, int, struct gcpro *); { \ Lisp_Object ret_ungc_val = (expr); \ UNGCPRO; \ - RETURN_SANS_WARNINGS ret_ungc_val; \ + RETURN__ ret_ungc_val; \ } while (0) /* Evaluate expr, NUNGCPRO, UNGCPRO, and then return the value of expr. */ @@ -2127,7 +1831,7 @@ void debug_ungcpro(char *, int, struct gcpro *); Lisp_Object ret_ungc_val = (expr); \ NUNGCPRO; \ UNGCPRO; \ - RETURN_SANS_WARNINGS ret_ungc_val; \ + RETURN__ ret_ungc_val; \ } while (0) /* Evaluate expr, NNUNGCPRO, NUNGCPRO, UNGCPRO, and then return the @@ -2138,7 +1842,7 @@ void debug_ungcpro(char *, int, struct gcpro *); NNUNGCPRO; \ NUNGCPRO; \ UNGCPRO; \ - RETURN_SANS_WARNINGS ret_ungc_val; \ + RETURN__ ret_ungc_val; \ } while (0) /* Evaluate expr, return it if it's not Qunbound. */ @@ -2146,70 +1850,12 @@ void debug_ungcpro(char *, int, struct gcpro *); { \ Lisp_Object ret_nunb_val = (expr); \ if (!UNBOUNDP (ret_nunb_val)) \ - RETURN_SANS_WARNINGS ret_nunb_val; \ + RETURN__ ret_nunb_val; \ } while (0) -extern Lisp_Object_ptr_dynarr *staticpros; - -void register_post_gc_action (void (*fun) (void *), void *arg); - /* 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 *); - -/* dump_add_root_struct_ptr (&var, &desc) dumps the structure pointed to by `var'. */ -#ifdef PDUMP -void dump_add_root_struct_ptr (void *, const struct struct_description *); -#else -#define dump_add_root_struct_ptr(varaddr,descaddr) DO_NOTHING -#endif - -/* dump_add_opaque (&var, size) dumps the opaque static structure `var'. */ -#ifdef PDUMP -void dump_add_opaque (void *, size_t); -#else -#define dump_add_opaque(varaddr,size) DO_NOTHING -#endif - -/* Call dump_add_opaque_int (&int_var) to dump `int_var', of type `int'. */ -#ifdef PDUMP -#define dump_add_opaque_int(int_varaddr) do { \ - int *dao_ = (int_varaddr); /* type check */ \ - dump_add_opaque (dao_, sizeof (*dao_)); \ -} while (0) -#else -#define dump_add_opaque_int(int_varaddr) DO_NOTHING -#endif - -/* Call dump_add_opaque_fixnum (&fixnum_var) to dump `fixnum_var', of type `Fixnum'. */ -#ifdef PDUMP -#define dump_add_opaque_fixnum(fixnum_varaddr) do { \ - Fixnum *dao_ = (fixnum_varaddr); /* type check */ \ - dump_add_opaque (dao_, sizeof (*dao_)); \ -} while (0) -#else -#define dump_add_opaque_fixnum(fixnum_varaddr) DO_NOTHING -#endif - -/* Call dump_add_root_object (&var) to ensure that var is properly updated after pdump. */ -#ifdef PDUMP -void dump_add_root_object (Lisp_Object *); -#else -#define dump_add_root_object(varaddr) DO_NOTHING -#endif - -/* Call dump_add_root_object (&var) to ensure that var is properly updated after - pdump. var must point to a linked list of objects out of which - some may not be dumped */ -#ifdef PDUMP -void dump_add_weak_object_chain (Lisp_Object *); -#else -#define dump_add_weak_object_chain(varaddr) DO_NOTHING -#endif - /* Nonzero means Emacs has already been initialized. Used during startup to detect startup of dumped Emacs. */ extern int initialized; @@ -2249,17 +1895,17 @@ struct overhead_stats #define DIRECTORY_SEP '/' #endif #ifndef IS_DIRECTORY_SEP -#define IS_DIRECTORY_SEP(c) ((c) == DIRECTORY_SEP) +#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) #endif #ifndef IS_DEVICE_SEP #ifndef DEVICE_SEP -#define IS_DEVICE_SEP(c) 0 +#define IS_DEVICE_SEP(_c_) 0 #else -#define IS_DEVICE_SEP(c) ((c) == DEVICE_SEP) +#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP) #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 @@ -2279,35 +1925,15 @@ typedef long intptr_t; typedef unsigned long uintptr_t; #endif - -/************************************************************************/ -/* prototypes */ -/************************************************************************/ - -/* NOTE: Prototypes should go HERE, not in various header files, unless - they specifically reference a type that's not defined in lisp.h. - (And even then, you might consider adding the type to lisp.h.) - - The idea is that header files typically contain the innards of objects, - and we want to minimize the number of "dependencies" of one file on - the specifics of such objects. Putting prototypes here minimizes the - number of header files that need to be included -- good for a number - of reasons. --ben */ - -/*--------------- prototypes for various public c functions ------------*/ - -/* Prototypes for all init/syms_of/vars_of initialization functions. */ -#include "symsinit.h" - /* Defined in alloc.c */ void release_breathing_space (void); Lisp_Object noseeum_cons (Lisp_Object, Lisp_Object); -Lisp_Object make_vector (size_t, Lisp_Object); +Lisp_Object make_vector (EMACS_INT, Lisp_Object); Lisp_Object vector1 (Lisp_Object); Lisp_Object vector2 (Lisp_Object, Lisp_Object); Lisp_Object vector3 (Lisp_Object, Lisp_Object, Lisp_Object); -Lisp_Object make_bit_vector (size_t, Lisp_Object); -Lisp_Object make_bit_vector_from_byte_vector (unsigned char *, size_t); +Lisp_Object make_bit_vector (EMACS_INT, Lisp_Object); +Lisp_Object make_bit_vector_from_byte_vector (unsigned char *, EMACS_INT); Lisp_Object noseeum_make_marker (void); void garbage_collect_1 (void); Lisp_Object acons (Lisp_Object, Lisp_Object, Lisp_Object); @@ -2326,38 +1952,33 @@ extern int purify_flag; extern int gc_currently_forbidden; Lisp_Object restore_gc_inhibit (Lisp_Object); 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); +int purified (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); -void free_cons (Lisp_Cons *); +size_t purespace_usage (void); +void report_pure_usage (int, int); +Lisp_Object make_pure_string (CONST Bufbyte *, Bytecount, Lisp_Object, int); +Lisp_Object make_pure_pname (CONST Bufbyte *, Bytecount, int); +Lisp_Object pure_cons (Lisp_Object, Lisp_Object); +Lisp_Object pure_list (int, Lisp_Object *); +Lisp_Object make_pure_vector (size_t, Lisp_Object); +void free_cons (struct Lisp_Cons *); void free_list (Lisp_Object); void free_alist (Lisp_Object); void mark_conses_in_list (Lisp_Object); -void free_marker (Lisp_Marker *); +void free_marker (struct 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 *); @@ -2367,24 +1988,19 @@ extern int find_file_compare_truenames; 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)); +DECLARE_DOESNT_RETURN (pure_write_error (Lisp_Object)); DECLARE_DOESNT_RETURN (args_out_of_range (Lisp_Object, Lisp_Object)); DECLARE_DOESNT_RETURN (args_out_of_range_3 (Lisp_Object, Lisp_Object, 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, @@ -2395,14 +2011,11 @@ enum arith_comparison { arith_grtr_or_equal }; Lisp_Object arithcompare (Lisp_Object, Lisp_Object, enum arith_comparison); -/* Do NOT use word_to_lisp or wasteful_word_to_lisp to decode time_t's - unless you KNOW arg is non-negative. They cannot return negative - values! Use make_time. */ Lisp_Object word_to_lisp (unsigned int); 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 */ @@ -2410,33 +2023,31 @@ Lisp_Object unparesseuxify_doc_string (int, EMACS_INT, char *, Lisp_Object); 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_time (time_t); +Lisp_Object make_string_from_buffer (struct buffer *, int, int); Lisp_Object save_excursion_save (void); Lisp_Object save_restriction_save (void); Lisp_Object save_excursion_restore (Lisp_Object); @@ -2446,132 +2057,60 @@ Lisp_Object save_restriction_restore (Lisp_Object); 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, Extbyte **); -void make_argc_argv (Lisp_Object, int *, Extbyte ***); -void free_argc_argv (Extbyte **); -Lisp_Object decode_env_path (const char *, const char *); -Lisp_Object decode_path (const char *); +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 *); /* 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 Fixnum emacs_priority; +extern int emacs_priority; extern int running_asynch_code; extern int suppress_early_error_handler_backtrace; /* Defined in eval.c */ DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, Lisp_Object)); -void maybe_signal_error (Lisp_Object, Lisp_Object, Lisp_Object, - Error_behavior); +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 (type_error (Lisp_Object, - const char *, - ...), 2, 3); -void maybe_type_error (Lisp_Object, Lisp_Object, Error_behavior, const char *, - ...) PRINTF_ARGS (4, 5); -Lisp_Object continuable_type_error (Lisp_Object, const char *, ...) - PRINTF_ARGS (2, 3); -Lisp_Object maybe_continuable_type_error (Lisp_Object, Lisp_Object, - Error_behavior, - const char *, ...) - PRINTF_ARGS (4, 5); -DECLARE_DOESNT_RETURN (signal_type_error (Lisp_Object, const char *, - Lisp_Object)); -void maybe_signal_type_error (Lisp_Object, const char *, Lisp_Object, - Lisp_Object, Error_behavior); -Lisp_Object signal_type_continuable_error (Lisp_Object, const char *, - Lisp_Object); -Lisp_Object maybe_signal_type_continuable_error (Lisp_Object, const char *, - Lisp_Object, - Lisp_Object, Error_behavior); -DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (type_error_with_frob - (Lisp_Object, Lisp_Object, - const char *, - ...), 3, 4); -void maybe_type_error_with_frob (Lisp_Object, Lisp_Object, Lisp_Object, - Error_behavior, - const char *, ...) PRINTF_ARGS (5, 6); -Lisp_Object continuable_type_error_with_frob (Lisp_Object, Lisp_Object, - const char *, - ...) PRINTF_ARGS (3, 4); -Lisp_Object maybe_continuable_type_error_with_frob -(Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior, const char *, ...) - PRINTF_ARGS (5, 6); -DECLARE_DOESNT_RETURN (signal_type_error_2 (Lisp_Object, const char *, - Lisp_Object, Lisp_Object)); -void maybe_signal_type_error_2 (Lisp_Object, const char *, Lisp_Object, - Lisp_Object, Lisp_Object, Error_behavior); -Lisp_Object signal_type_continuable_error_2 (Lisp_Object, const char *, - Lisp_Object, Lisp_Object); -Lisp_Object maybe_signal_type_continuable_error_2 (Lisp_Object, const char *, - 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 *, +DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (error_with_frob + (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)); - -DECLARE_DOESNT_RETURN (syntax_error (const char *reason, Lisp_Object frob)); -DECLARE_DOESNT_RETURN (syntax_error_2 (const char *reason, Lisp_Object frob1, - Lisp_Object frob2)); -DECLARE_DOESNT_RETURN (invalid_argument (const char *reason, - Lisp_Object frob)); -DECLARE_DOESNT_RETURN (invalid_argument_2 (const char *reason, - Lisp_Object frob1, - Lisp_Object frob2)); -DECLARE_DOESNT_RETURN (invalid_operation (const char *reason, - Lisp_Object frob)); -DECLARE_DOESNT_RETURN (invalid_operation_2 (const char *reason, - Lisp_Object frob1, - Lisp_Object frob2)); -DECLARE_DOESNT_RETURN (invalid_change (const char *reason, - Lisp_Object frob)); -DECLARE_DOESNT_RETURN (invalid_change_2 (const char *reason, - Lisp_Object frob1, - Lisp_Object frob2)); - -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); - +Lisp_Object funcall_recording_as (Lisp_Object, int, 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); @@ -2611,13 +2150,13 @@ Lisp_Object call6_in_buffer (struct buffer *, Lisp_Object, Lisp_Object, 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, ...); @@ -2636,7 +2175,7 @@ void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); 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); @@ -2647,39 +2186,38 @@ void reset_this_command_keys (Lisp_Object, int); Lisp_Object enqueue_misc_user_event (Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object enqueue_misc_user_event_pos (Lisp_Object, Lisp_Object, 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 (struct 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 */ @@ -2710,6 +2248,7 @@ Lisp_Object remassoc_no_quit (Lisp_Object, Lisp_Object); 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); @@ -2725,8 +2264,10 @@ Lisp_Object concat3 (Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object vconcat2 (Lisp_Object, Lisp_Object); 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); /* Defined in glyphs.c */ Error_behavior decode_error_behavior_flag (Lisp_Object); @@ -2735,7 +2276,6 @@ Lisp_Object encode_error_behavior_flag (Error_behavior); /* 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 *); @@ -2747,9 +2287,8 @@ void where_is_to_char (Lisp_Object, char *); /* Defined in lread.c */ void ebolify_bytecode_constants (Lisp_Object); 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 locate_file (Lisp_Object, Lisp_Object, CONST char *, Lisp_Object *, int); +int isfloat_string (CONST char *); /* Well, I've decided to enable this. -- ben */ /* And I've decided to make it work right. -- sb */ @@ -2786,59 +2325,60 @@ extern int popup_menu_titles; /* 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); +void temp_output_buffer_setup (CONST char *); void temp_output_buffer_show (Lisp_Object, Lisp_Object); /* 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); -char *long_to_string (char *, long); +void long_to_string (char *, long); void print_internal (Lisp_Object, Lisp_Object, int); void print_symbol (Lisp_Object, Lisp_Object, int); void print_float (Lisp_Object, Lisp_Object, int); +void print_compiled_function (Lisp_Object, Lisp_Object, int); extern int print_escape_newlines; extern int print_readably; -Lisp_Object internal_with_output_to_temp_buffer (Lisp_Object, +Lisp_Object internal_with_output_to_temp_buffer (CONST char *, Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object); void float_to_string (char *, double); 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; @@ -2860,11 +2400,10 @@ Bufpos scan_buffer (struct buffer *, Emchar, Bufpos, Bufpos, EMACS_INT, EMACS_IN 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 *, - Lisp_Object, int, Error_behavior); -Bytecount fast_string_match (Lisp_Object, const Bufbyte *, + char *, int, Error_behavior); +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); @@ -2886,9 +2425,9 @@ Lisp_Object specifier_instance_no_quit (Lisp_Object, Lisp_Object, Lisp_Object, 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); @@ -2897,12 +2436,9 @@ int symbol_value_buffer_local_info (Lisp_Object, struct buffer *); Lisp_Object find_symbol_value (Lisp_Object); Lisp_Object find_symbol_value_quickly (Lisp_Object, int); Lisp_Object top_level_value (Lisp_Object); -void reject_constant_symbols (Lisp_Object sym, Lisp_Object newval, - int function_p, - 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); @@ -2918,16 +2454,15 @@ int run_time_remap (char *); #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); Lisp_Object display_buffer (Lisp_Object, Lisp_Object, Lisp_Object); -/*--------------- prototypes for Lisp primitives in C ------------*/ - /* The following were machine generated 19980312 */ + EXFUN (Faccept_process_output, 3); EXFUN (Fadd1, 1); EXFUN (Fadd_spec_to_specifier, 5); @@ -2955,8 +2490,8 @@ EXFUN (Fcdr, 1); 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 (Fclrhash, 1); EXFUN (Fcoding_category_list, 0); EXFUN (Fcoding_category_system, 1); EXFUN (Fcoding_priority_list, 0); @@ -2969,12 +2504,12 @@ EXFUN (Fcoding_system_property, 2); EXFUN (Fcoding_system_type, 1); EXFUN (Fcommand_execute, 3); EXFUN (Fcommandp, 1); +EXFUN (Fcompiled_function_domain, 1); EXFUN (Fconcat, MANY); EXFUN (Fcons, 2); EXFUN (Fcopy_alist, 1); EXFUN (Fcopy_coding_system, 2); EXFUN (Fcopy_event, 2); -EXFUN (Fcopy_list, 1); EXFUN (Fcopy_marker, 2); EXFUN (Fcopy_sequence, 1); EXFUN (Fcopy_tree, 2); @@ -2985,9 +2520,7 @@ EXFUN (Fdecode_shift_jis_char, 1); EXFUN (Fdefault_boundp, 1); EXFUN (Fdefault_value, 1); EXFUN (Fdefine_key, 3); -EXFUN (Fdelete, 2); EXFUN (Fdelete_region, 3); -EXFUN (Fdelete_process, 1); EXFUN (Fdelq, 2); EXFUN (Fdestructive_alist_to_plist, 1); EXFUN (Fdetect_coding_region, 3); @@ -3037,16 +2570,17 @@ EXFUN (Fforward_char, 2); EXFUN (Fforward_line, 2); EXFUN (Ffset, 2); EXFUN (Ffuncall, MANY); -EXFUN (Ffunctionp, 1); EXFUN (Fgeq, MANY); EXFUN (Fget, 3); EXFUN (Fget_buffer_process, 1); EXFUN (Fget_coding_system, 1); EXFUN (Fget_process, 1); EXFUN (Fget_range_table, 3); +EXFUN (Fgethash, 3); EXFUN (Fgettext, 1); EXFUN (Fgoto_char, 2); EXFUN (Fgtr, MANY); +EXFUN (Fhashtablep, 1); EXFUN (Findent_to, 3); EXFUN (Findirect_function, 1); EXFUN (Finsert, MANY); @@ -3059,20 +2593,17 @@ EXFUN (Fintern_soft, 2); EXFUN (Fkey_description, 1); EXFUN (Fkill_emacs, 1); EXFUN (Fkill_local_variable, 1); -EXFUN (Flast, 2); EXFUN (Flax_plist_get, 3); EXFUN (Flax_plist_remprop, 2); EXFUN (Flength, 1); EXFUN (Fleq, MANY); EXFUN (Flist, MANY); EXFUN (Flistp, 1); -EXFUN (Flist_modules, 0); -EXFUN (Fload_module, 3); -EXFUN (Flookup_key, 3); EXFUN (Flss, MANY); EXFUN (Fmake_byte_code, MANY); EXFUN (Fmake_coding_system, 4); EXFUN (Fmake_glyph_internal, 1); +EXFUN (Fmake_hashtable, 2); EXFUN (Fmake_list, 2); EXFUN (Fmake_marker, 0); EXFUN (Fmake_range_table, 0); @@ -3101,7 +2632,6 @@ EXFUN (Fold_equal, 2); EXFUN (Fold_member, 2); EXFUN (Fold_memq, 2); EXFUN (Fplist_get, 3); -EXFUN (Fplist_member, 2); EXFUN (Fplist_put, 3); EXFUN (Fplus, MANY); EXFUN (Fpoint, 1); @@ -3117,9 +2647,11 @@ EXFUN (Fprint, 2); 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); +EXFUN (Fputhash, 3); EXFUN (Fquo, MANY); EXFUN (Frassq, 2); EXFUN (Fread, 1); @@ -3127,7 +2659,6 @@ EXFUN (Fread_key_sequence, 3); 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); @@ -3158,7 +2689,6 @@ EXFUN (Fsymbol_function, 1); EXFUN (Fsymbol_name, 1); EXFUN (Fsymbol_plist, 1); EXFUN (Fsymbol_value, 1); -EXFUN (Fsystem_name, 0); EXFUN (Fthrow, 2); EXFUN (Ftimes, MANY); EXFUN (Ftruncate, 1); @@ -3176,120 +2706,89 @@ EXFUN (Fverify_visited_file_modtime, 1); EXFUN (Fvertical_motion, 3); EXFUN (Fwiden, 1); -/*--------------- prototypes for constant symbols ------------*/ - -extern Lisp_Object Q_style; -extern Lisp_Object Qactivate_menubar_hook; -extern Lisp_Object Qarith_error; -extern Lisp_Object Qarrayp, Qautoload; -extern Lisp_Object Qbackground, Qbackground_pixmap; -extern Lisp_Object Qbeginning_of_buffer, Qbig5; -extern Lisp_Object Qbitp, Qblinking; -extern Lisp_Object Qbuffer_glyph_p, Qbuffer_live_p, Qbuffer_read_only; -extern Lisp_Object Qbyte_code, Qcall_interactively; + +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, 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, Qcategory; extern Lisp_Object Qcategory_designator_p, Qcategory_table_value_p, Qccl, Qcdr; -extern Lisp_Object Qchar_or_string_p, Qcharacterp; -extern Lisp_Object Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3; -extern Lisp_Object Qcircular_list, Qcircular_property_list; -extern Lisp_Object Qcoding_system_error; -extern Lisp_Object Qcolor_pixmap_image_instance_p; -extern Lisp_Object Qcommandp, Qcompletion_ignore_case; -extern Lisp_Object Qconsole_live_p, Qconst_specifier, Qcr; -extern Lisp_Object Qcrlf, Qcurrent_menubar, Qctext; -extern Lisp_Object Qcyclic_variable_indirection, Qdecode; -extern Lisp_Object Qdefun, Qdevice_live_p; -extern Lisp_Object Qdim, Qdisabled, Qdisplay_table; -extern Lisp_Object Qdomain_error; -extern Lisp_Object Qediting_error; -extern Lisp_Object Qencode, Qend_of_buffer, Qend_of_file, Qend_open; -extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type; +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 Qcircular_property_list, Qcoding_system_error; +extern Lisp_Object Qcoding_system_p, Qcolor, Qcolor_pixmap_image_instance_p; +extern Lisp_Object Qcolumns, Qcommand, Qcommandp, Qcompletion_ignore_case; +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 Qdim, Qdimension, Qdisabled, Qdisplay, Qdisplay_table; +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 Qevent_live_p, Qexit, Qextent_live_p; -extern Lisp_Object Qexternal_debugging_output, Qfeaturep; -extern Lisp_Object Qfile_error; -extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output; +extern Lisp_Object Qeval, Qevent_live_p, Qexit, Qextent_live_p, Qextents; +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_live_p; -extern Lisp_Object Qicon_glyph_p, Qidentity; +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; +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; -extern Lisp_Object Qinternal_error, Qinvalid_argument; -extern Lisp_Object Qinvalid_change, Qinvalid_function, Qinvalid_operation; -extern Lisp_Object Qinvalid_read_syntax, Qinvalid_state; -extern Lisp_Object Qio_error; -extern Lisp_Object Qiso2022; -extern Lisp_Object Qlambda, Qlayout; -extern Lisp_Object Qlf; -extern Lisp_Object Qlist_formation_error; -extern Lisp_Object Qlistp, Qload, Qlock_shift, Qmacro; -extern Lisp_Object Qmakunbound, Qmalformed_list, Qmalformed_property_list; -extern Lisp_Object Qmark; -extern Lisp_Object Qmnemonic; -extern Lisp_Object Qmono_pixmap_image_instance_p; -extern Lisp_Object Qmouse_leave_buffer_hook; -extern Lisp_Object Qnas, Qnatnump, Qnative_layout; -extern Lisp_Object Qno_ascii_cntl, Qno_ascii_eol, Qno_catch; -extern Lisp_Object Qno_conversion, Qno_iso6429; -extern Lisp_Object Qnothing_image_instance_p; -extern Lisp_Object Qnumber_char_or_marker_p, Qnumberp; -extern Lisp_Object Qoutput_charset_conversion; -extern Lisp_Object Qoverflow_error, Qpoint, Qpointer_glyph_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, Qkeymap, Qlambda, Qleft, Qlf; +extern Lisp_Object Qlist, Qlistp, Qload, Qlock_shift, Qmacro, Qmagic; +extern Lisp_Object Qmalformed_property_list, Qmalloc_overhead, Qmark, Qmarkers; +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, Qmswindows, Qname, Qnas, Qnatnump; +extern Lisp_Object Qnil, 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, 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_length; -extern Lisp_Object Qprint_string_length, Qprogn, Qquit; -extern Lisp_Object Qquote, Qrange_error, Qread_char; +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; -extern Lisp_Object Qrun_hooks, Qsans_modifiers; -extern Lisp_Object Qsave_buffers_kill_emacs; -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 Qsingularity_error; -extern Lisp_Object Qstandard_input, Qstandard_output; -extern Lisp_Object Qstart_open; -extern Lisp_Object Qstring_lessp, Qsubwindow; -extern Lisp_Object Qsubwindow_image_instance_p; -extern Lisp_Object Qsyntax_error, Qt; -extern Lisp_Object Qtext_image_instance_p; -extern Lisp_Object Qtop_level; -extern Lisp_Object Qtrue_list_p; -extern Lisp_Object Qunbound, Qunderflow_error; -extern Lisp_Object Qunderline, Quser_files_and_directories; -extern Lisp_Object Qvalues; -extern Lisp_Object Qvariable_documentation, Qvariable_domain; -extern Lisp_Object Qvoid_function, Qvoid_variable; -extern Lisp_Object Qwindow_live_p, Qwrong_number_of_arguments; -extern Lisp_Object Qwrong_type_argument, Qyes_or_no_p; -extern Lisp_Object Qgtk; - -#define SYMBOL(fou) extern Lisp_Object fou -#define SYMBOL_KEYWORD(la_cle_est_fou) extern Lisp_Object la_cle_est_fou -#define SYMBOL_GENERAL(tout_le_monde, est_fou) \ - extern Lisp_Object tout_le_monde - -#include "general-slots.h" - -#undef SYMBOL -#undef SYMBOL_KEYWORD -#undef SYMBOL_GENERAL - -/*--------------- prototypes for variables of type Lisp_Object ------------*/ - -extern Lisp_Object Vactivate_menubar_hook; -extern Lisp_Object Vautoload_queue, Vblank_menubar; +extern Lisp_Object Qregion_beginning, Qregion_end, Qrequire, Qresource; +extern Lisp_Object Qreturn, Qreverse, Qright, Qrun_hooks, Qsans_modifiers; +extern Lisp_Object Qsave_buffers_kill_emacs, Qsearch, 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; +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, Qvector; +extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning, Qwidth, Qwindow; +extern Lisp_Object Qwindow_live_p, Qwindow_system, Qwrong_number_of_arguments; +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, 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; +extern Lisp_Object Vcoding_system_hashtable, Vcommand_history; extern Lisp_Object Vcommand_line_args, Vconfigure_info_directory; -extern Lisp_Object Vconfigure_site_directory, Vconfigure_site_module_directory; 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; @@ -3301,15 +2800,18 @@ extern Lisp_Object Vload_file_name_internal; extern Lisp_Object Vload_file_name_internal_the_purecopy, Vload_history; extern Lisp_Object Vload_path, Vmark_even_if_inactive, Vmenubar_configuration; extern Lisp_Object Vminibuf_preprompt, Vminibuf_prompt, Vminibuffer_zero; -extern Lisp_Object Vmodule_directory, Vmswindows_downcase_file_names; +extern Lisp_Object Vmirror_ascii_canon_table, Vmirror_ascii_downcase_table; +extern Lisp_Object Vmirror_ascii_eqv_table, Vmirror_ascii_upcase_table; +extern Lisp_Object Vmswindows_downcase_file_names; extern Lisp_Object Vmswindows_get_true_file_attributes, Vobarray; extern Lisp_Object Vprint_length, Vprint_level, Vprocess_environment; -extern Lisp_Object Vquit_flag; +extern Lisp_Object Vpure_uninterned_symbol_table, Vquit_flag; extern Lisp_Object Vrecent_keys_ring, Vshell_file_name, Vsite_directory; -extern Lisp_Object Vsite_module_directory; 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_ */ + +#endif /* _XEMACS_LISP_H_ */ diff --git a/src/lread.c b/src/lread.c index 807c07b..9c0fa8b 100644 --- a/src/lread.c +++ b/src/lread.c @@ -29,9 +29,11 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" #include "bytecode.h" -#include "elhash.h" +#include "commands.h" +#include "insdel.h" #include "lstream.h" #include "opaque.h" +#include <paths.h> #ifdef FILE_CODING #include "file-coding.h" #endif @@ -63,13 +65,9 @@ Lisp_Object Qvariable_domain; /* I18N3 */ Lisp_Object Vvalues, Vstandard_input, Vafter_load_alist; Lisp_Object Qcurrent_load_list; Lisp_Object Qload, Qload_file_name; +Lisp_Object Qlocate_file_hash_table; Lisp_Object Qfset; -/* Hash-table that maps directory names to hashes of their contents. */ -static Lisp_Object Vlocate_file_hash_table; - -Lisp_Object Qexists, Qreadable, Qwritable, Qexecutable; - /* See read_escape() for an explanation of this. */ #if 0 int fail_on_bucky_bit_character_escapes; @@ -93,6 +91,9 @@ int load_warn_when_source_only; /* Whether Fload_internal() should ignore .elc files when no suffix is given */ int load_ignore_elc_files; +/* Directory in which the sources were found. */ +Lisp_Object Vsource_directory; + /* Search path for files to be loaded. */ Lisp_Object Vload_path; @@ -122,7 +123,7 @@ Lisp_Object Vload_read_function; Each member of the list has the form (n . object), and is used to look up the object for the corresponding #n# construct. It must be set to nil before all top-level calls to read0. */ -Lisp_Object Vread_objects; +Lisp_Object read_objects; /* Nonzero means load should forcibly load all dynamic doc strings. */ /* Note that this always happens (with some special behavior) when @@ -218,14 +219,14 @@ EXFUN (Fread_from_string, 3); static DOESNT_RETURN -read_syntax_error (const char *string) +syntax_error (CONST char *string) { signal_error (Qinvalid_read_syntax, list1 (build_translated_string (string))); } static Lisp_Object -continuable_read_syntax_error (const char *string) +continuable_syntax_error (CONST char *string) { return Fsignal (Qinvalid_read_syntax, list1 (build_translated_string (string))); @@ -258,13 +259,12 @@ readchar (Lisp_Object readcharfun) Emchar c = Lstream_get_emchar (XLSTREAM (readcharfun)); #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); - } -#endif /* testing Mule */ + if (testing_mule) { + 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; } else if (MARKERP (readcharfun)) @@ -404,18 +404,22 @@ ebolify_bytecode_constants (Lisp_Object vector) something to `funcall', but who would really do that? As they say in law, we've made a "good-faith effort" to unfuckify ourselves. And doing it this way avoids screwing - up args to `make-hash-table' and such. As it is, we have to + up args to `make-hashtable' and such. As it is, we have to add an extra Ebola check in decode_weak_list_type(). --ben */ - if (EQ (el, Qassoc)) el = Qold_assoc; - else if (EQ (el, Qdelq)) el = Qold_delq; + if (EQ (el, Qassoc)) + el = Qold_assoc; + if (EQ (el, Qdelq)) + el = Qold_delq; #if 0 /* I think this is a bad idea because it will probably mess with keymap code. */ - else if (EQ (el, Qdelete)) el = Qold_delete; + if (EQ (el, Qdelete)) + el = Qold_delete; #endif - else if (EQ (el, Qrassq)) el = Qold_rassq; - else if (EQ (el, Qrassoc)) el = Qold_rassoc; - + if (EQ (el, Qrassq)) + el = Qold_rassq; + if (EQ (el, Qrassoc)) + el = Qold_rassoc; XVECTOR_DATA (vector)[i] = el; } } @@ -444,6 +448,12 @@ load_force_doc_string_unwind (Lisp_Object oldlist) 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. */ @@ -463,23 +473,24 @@ load_force_doc_string_unwind (Lisp_Object oldlist) Lisp_Object doc; assert (COMPILED_FUNCTIONP (john)); - if (CONSP (XCOMPILED_FUNCTION (john)->instructions)) + if (CONSP (XCOMPILED_FUNCTION (john)->bytecodes)) { struct gcpro ngcpro1; Lisp_Object juan = (pas_de_lache_ici - (fd, XCOMPILED_FUNCTION (john)->instructions)); + (fd, XCOMPILED_FUNCTION (john)->bytecodes)); Lisp_Object ivan; NGCPRO1 (juan); 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)->bytecodes = 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)); @@ -537,7 +548,7 @@ system that was used for the decoding is stored into it. It will in general be different from CODESYS if CODESYS specifies automatic encoding detection or end-of-line detection. */ - (file, noerror, nomessage, nosuffix, codesys, used_codesys)) + (file, no_error, nomessage, nosuffix, codesys, used_codesys)) { /* This function can GC */ int fd = -1; @@ -551,6 +562,7 @@ encoding detection or end-of-line detection. int message_p = NILP (nomessage); /*#ifdef DEBUG_XEMACS*/ static Lisp_Object last_file_loaded; + size_t pure_usage = 0; /*#endif*/ struct stat s1, s2; GCPRO3 (file, newer, found); @@ -562,13 +574,14 @@ encoding detection or end-of-line detection. { message_p = 1; last_file_loaded = file; + pure_usage = purespace_usage (); } /*#endif / * DEBUG_XEMACS */ /* If file name is magic, call the handler. */ handler = Ffind_file_name_handler (file, Qload); if (!NILP (handler)) - RETURN_UNGCPRO (call5 (handler, Qload, file, noerror, + RETURN_UNGCPRO (call5 (handler, Qload, file, no_error, nomessage, nosuffix)); /* Do this after the handler to avoid @@ -589,15 +602,15 @@ encoding detection or end-of-line detection. int foundlen; fd = locate_file (Vload_path, file, - ((!NILP (nosuffix)) ? Qnil : - build_string (load_ignore_elc_files ? ".el:" : - ".elc:.el:")), + ((!NILP (nosuffix)) ? "" : + load_ignore_elc_files ? ".el:" : + ".elc:.el:"), &found, -1); if (fd < 0) { - if (NILP (noerror)) + if (NILP (no_error)) signal_file_error ("Cannot open load file", file); else { @@ -624,7 +637,7 @@ encoding detection or end-of-line detection. int result; /* temporarily hack the 'c' off the end of the filename */ foundstr[foundlen - 1] = '\0'; - result = xemacs_stat (foundstr, &s2); + result = stat (foundstr, &s2); if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) { @@ -677,7 +690,7 @@ encoding detection or end-of-line detection. { /* 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); @@ -782,8 +795,11 @@ encoding detection or end-of-line detection. /*#ifdef DEBUG_XEMACS*/ if (purify_flag && noninteractive) { - if (!EQ (last_file_loaded, file)) - message ("Loading %s ...done", XSTRING_DATA (file)); + if (EQ (last_file_loaded, file)) + message_append (" (%d)", purespace_usage() - pure_usage); + else + message ("Loading %s ...done (%d)", XSTRING_DATA (file), + purespace_usage() - pure_usage); } /*#endif / * DEBUG_XEMACS */ @@ -795,57 +811,26 @@ encoding detection or end-of-line detection. } -/* ------------------------------- */ -/* locate_file */ -/* ------------------------------- */ - -static int -decode_mode_1 (Lisp_Object mode) -{ - if (EQ (mode, Qexists)) - return F_OK; - else if (EQ (mode, Qexecutable)) - return X_OK; - else if (EQ (mode, Qwritable)) - return W_OK; - else if (EQ (mode, Qreadable)) - return R_OK; - else if (INTP (mode)) - { - check_int_range (XINT (mode), 0, 7); - return XINT (mode); - } - else - signal_simple_error ("Invalid value", mode); - return 0; /* unreached */ -} - +#if 0 /* FSFmacs */ +/* not used */ static int -decode_mode (Lisp_Object mode) +complete_filename_p (Lisp_Object pathname) { - if (NILP (mode)) - return R_OK; - else if (CONSP (mode)) - { - Lisp_Object tail; - int mask = 0; - EXTERNAL_LIST_LOOP (tail, mode) - mask |= decode_mode_1 (XCAR (tail)); - return mask; - } - else - return decode_mode_1 (mode); + REGISTER unsigned char *s = XSTRING_DATA (pathname); + return (IS_DIRECTORY_SEP (s[0]) + || (XSTRING_LENGTH (pathname) > 2 + && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2])) +#ifdef ALTOS + || *s == '@' +#endif + ); } +#endif /* 0 */ DEFUN ("locate-file", Flocate_file, 2, 4, 0, /* -Search for FILENAME through PATH-LIST. - -If SUFFIXES is non-nil, it should be a list of suffixes to append to -file name when searching. - -If MODE is non-nil, it should be a symbol or a list of symbol representing -requirements. Allowed symbols are `exists', `executable', `writable', and -`readable'. If MODE is nil, it defaults to `readable'. +Search for FILENAME through PATH-LIST, expanded by one of the optional +SUFFIXES (string of suffixes separated by ":"s), checking for access +MODE (0|1|2|4 = exists|executable|writeable|readable), default readable. `locate-file' keeps hash tables of the directories it searches through, in order to speed things up. It tries valiantly to not get confused in @@ -860,288 +845,210 @@ for details. Lisp_Object tp; CHECK_STRING (filename); - - if (LISTP (suffixes)) - { - Lisp_Object tail; - EXTERNAL_LIST_LOOP (tail, suffixes) - CHECK_STRING (XCAR (tail)); - } - else + if (!NILP (suffixes)) CHECK_STRING (suffixes); + if (!NILP (mode)) + CHECK_NATNUM (mode); - locate_file (path_list, filename, suffixes, &tp, decode_mode (mode)); + locate_file (path_list, filename, + ((NILP (suffixes)) ? "" : + (char *) (XSTRING_DATA (suffixes))), + &tp, (NILP (mode) ? R_OK : XINT (mode))); return tp; } -/* Recalculate the hash table for the given string. DIRECTORY should - better have been through Fexpand_file_name() by now. */ +/* recalculate the hash table for the given string */ static Lisp_Object -locate_file_refresh_hashing (Lisp_Object directory) +locate_file_refresh_hashing (Lisp_Object str) { Lisp_Object hash = - make_directory_hash_table ((char *) XSTRING_DATA (directory)); - - if (!NILP (hash)) - Fputhash (directory, hash, Vlocate_file_hash_table); + make_directory_hash_table ((char *) XSTRING_DATA (str)); + Fput (str, Qlocate_file_hash_table, hash); return hash; } -/* find the hash table for the given directory, recalculating if necessary */ +/* find the hash table for the given string, recalculating if necessary */ static Lisp_Object -locate_file_find_directory_hash_table (Lisp_Object directory) -{ - Lisp_Object hash = Fgethash (directory, Vlocate_file_hash_table, Qnil); - if (NILP (hash)) - return locate_file_refresh_hashing (directory); - else - return hash; -} - -/* The SUFFIXES argument in any of the locate_file* functions can be - 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.) - 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. */ - -/* 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 -locate_file_map_suffixes (Lisp_Object filename, Lisp_Object suffixes, - int (*fun) (char *, void *), - void *arg) +locate_file_find_directory_hash_table (Lisp_Object str) { - /* This function can GC */ - char *fn; - int fn_len, max; - - /* Calculate maximum size of any filename made from - this path element/specified file name and any possible suffix. */ - if (CONSP (suffixes)) - { - /* We must traverse the list, so why not do it right. */ - Lisp_Object tail; - max = 0; - LIST_LOOP (tail, suffixes) - { - if (XSTRING_LENGTH (XCAR (tail)) > max) - max = XSTRING_LENGTH (XCAR (tail)); - } - } - else if (NILP (suffixes)) - max = 0; - else - /* Just take the easy way out */ - max = XSTRING_LENGTH (suffixes); - - fn_len = XSTRING_LENGTH (filename); - fn = (char *) alloca (max + fn_len + 1); - memcpy (fn, (char *) XSTRING_DATA (filename), fn_len); - - /* Loop over suffixes. */ - if (!STRINGP (suffixes)) - { - if (NILP (suffixes)) - { - /* Case a) discussed in the comment above. */ - fn[fn_len] = 0; - if ((*fun) (fn, arg)) - return; - } - else - { - /* Case b) */ - Lisp_Object tail; - LIST_LOOP (tail, suffixes) - { - memcpy (fn + fn_len, XSTRING_DATA (XCAR (tail)), - XSTRING_LENGTH (XCAR (tail))); - fn[fn_len + XSTRING_LENGTH (XCAR (tail))] = 0; - if ((*fun) (fn, arg)) - return; - } - } - } - else - { - /* Case c) */ - const char *nsuffix = (const char *) XSTRING_DATA (suffixes); - - while (1) - { - char *esuffix = (char *) strchr (nsuffix, ':'); - int lsuffix = esuffix ? esuffix - nsuffix : (int) strlen (nsuffix); - - /* Concatenate path element/specified name with the suffix. */ - strncpy (fn + fn_len, nsuffix, lsuffix); - fn[fn_len + lsuffix] = 0; - - if ((*fun) (fn, arg)) - return; - - /* Advance to next suffix. */ - if (esuffix == 0) - break; - nsuffix += lsuffix + 1; - } - } -} - -struct locate_file_in_directory_mapper_closure { - int fd; - Lisp_Object *storeptr; - int mode; -}; - -static int -locate_file_in_directory_mapper (char *fn, void *arg) -{ - struct locate_file_in_directory_mapper_closure *closure = - (struct locate_file_in_directory_mapper_closure *)arg; - struct stat st; - - /* Ignore file if it's a directory. */ - if (xemacs_stat (fn, &st) >= 0 - && (st.st_mode & S_IFMT) != S_IFDIR) - { - /* Check that we can access or open it. */ - if (closure->mode >= 0) - closure->fd = access (fn, closure->mode); - else - closure->fd = open (fn, O_RDONLY | OPEN_BINARY, 0); - - if (closure->fd >= 0) - { - /* We succeeded; return this descriptor and filename. */ - if (closure->storeptr) - *closure->storeptr = build_string (fn); - -#ifndef WIN32_NATIVE - /* If we actually opened the file, set close-on-exec flag - on the new descriptor so that subprocesses can't whack - at it. */ - if (closure->mode < 0) - (void) fcntl (closure->fd, F_SETFD, FD_CLOEXEC); -#endif - - return 1; - } - } - /* Keep mapping. */ - return 0; + Lisp_Object hash = Fget (str, Qlocate_file_hash_table, Qnil); + if (NILP (Fhashtablep (hash))) + return locate_file_refresh_hashing (str); + return hash; } - -/* look for STR in PATH, optionally adding SUFFIXES. DIRECTORY need - not have been expanded. */ +/* look for STR in PATH, optionally adding suffixes in SUFFIX */ static int -locate_file_in_directory (Lisp_Object directory, Lisp_Object str, - Lisp_Object suffixes, Lisp_Object *storeptr, +locate_file_in_directory (Lisp_Object path, Lisp_Object str, + CONST char *suffix, Lisp_Object *storeptr, int mode) { /* This function can GC */ - struct locate_file_in_directory_mapper_closure closure; + int fd; + int fn_size = 100; + char buf[100]; + char *fn = buf; + int want_size; + struct stat st; Lisp_Object filename = Qnil; struct gcpro gcpro1, gcpro2, gcpro3; + CONST char *nsuffix; - GCPRO3 (directory, str, filename); + GCPRO3 (path, str, filename); - filename = Fexpand_file_name (str, directory); + filename = Fexpand_file_name (str, path); if (NILP (filename) || NILP (Ffile_name_absolute_p (filename))) /* If there are non-absolute elts in PATH (eg ".") */ /* Of course, this could conceivably lose if luser sets default-directory to be something non-absolute ... */ { if (NILP (filename)) - /* NIL means current directory */ + /* NIL means current dirctory */ filename = current_buffer->directory; else filename = Fexpand_file_name (filename, current_buffer->directory); if (NILP (Ffile_name_absolute_p (filename))) { - /* Give up on this directory! */ + /* Give up on this path element! */ UNGCPRO; return -1; } } + /* Calculate maximum size of any filename made from + this path element/specified file name and any possible suffix. */ + want_size = strlen (suffix) + XSTRING_LENGTH (filename) + 1; + if (fn_size < want_size) + fn = (char *) alloca (fn_size = 100 + want_size); + + nsuffix = suffix; + + /* Loop over suffixes. */ + while (1) + { + char *esuffix = (char *) strchr (nsuffix, ':'); + int lsuffix = ((esuffix) ? (esuffix - nsuffix) : strlen (nsuffix)); + + /* Concatenate path element/specified name with the suffix. */ + strncpy (fn, (char *) XSTRING_DATA (filename), + XSTRING_LENGTH (filename)); + fn[XSTRING_LENGTH (filename)] = 0; + if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */ + strncat (fn, nsuffix, lsuffix); + + /* Ignore file if it's a directory. */ + if (stat (fn, &st) >= 0 + && (st.st_mode & S_IFMT) != S_IFDIR) + { + /* Check that we can access or open it. */ + if (mode >= 0) + fd = access (fn, mode); + else + fd = open (fn, O_RDONLY | OPEN_BINARY, 0); - closure.fd = -1; - closure.storeptr = storeptr; - closure.mode = mode; + if (fd >= 0) + { + /* We succeeded; return this descriptor and filename. */ + if (storeptr) + *storeptr = build_string (fn); + UNGCPRO; - locate_file_map_suffixes (filename, suffixes, locate_file_in_directory_mapper, - &closure); +#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. */ + if (mode < 0) + (void) fcntl (fd, F_SETFD, FD_CLOEXEC); +#endif + + return fd; + } + } + + /* Advance to next suffix. */ + if (esuffix == 0) + break; + nsuffix += lsuffix + 1; + } UNGCPRO; - return closure.fd; + return -1; } /* do the same as locate_file() but don't use any hash tables. */ static int locate_file_without_hash (Lisp_Object path, Lisp_Object str, - Lisp_Object suffixes, Lisp_Object *storeptr, + CONST char *suffix, Lisp_Object *storeptr, int mode) { /* This function can GC */ - int absolute = !NILP (Ffile_name_absolute_p (str)); + int absolute; + struct gcpro gcpro1; - EXTERNAL_LIST_LOOP (path, path) + /* is this necessary? */ + GCPRO1 (path); + + absolute = !NILP (Ffile_name_absolute_p (str)); + + for (; !NILP (path); path = Fcdr (path)) { - int val = locate_file_in_directory (XCAR (path), str, suffixes, storeptr, - mode); + int val = locate_file_in_directory (Fcar (path), str, suffix, + storeptr, mode); if (val >= 0) - return val; + { + UNGCPRO; + return val; + } if (absolute) break; } - return -1; -} -static int -locate_file_construct_suffixed_files_mapper (char *fn, void *arg) -{ - Lisp_Object *tail = (Lisp_Object *)arg; - *tail = Fcons (build_string (fn), *tail); - return 0; + UNGCPRO; + return -1; } -/* Construct a list of all files to search for. - It makes sense to have this despite locate_file_map_suffixes() - because we need Lisp strings to access the hash-table, and it would - be inefficient to create them on the fly, again and again for each - path component. See locate_file(). */ +/* Construct a list of all files to search for. */ static Lisp_Object -locate_file_construct_suffixed_files (Lisp_Object filename, - Lisp_Object suffixes) +locate_file_construct_suffixed_files (Lisp_Object str, CONST char *suffix) { - Lisp_Object tail = Qnil; - struct gcpro gcpro1; - GCPRO1 (tail); + int want_size; + int fn_size = 100; + char buf[100]; + char *fn = buf; + CONST char *nsuffix; + Lisp_Object suffixtab = Qnil; - locate_file_map_suffixes (filename, suffixes, - locate_file_construct_suffixed_files_mapper, - &tail); + /* Calculate maximum size of any filename made from + this path element/specified file name and any possible suffix. */ + want_size = strlen (suffix) + XSTRING_LENGTH (str) + 1; + if (fn_size < want_size) + fn = (char *) alloca (fn_size = 100 + want_size); - UNGCPRO; - return Fnreverse (tail); + nsuffix = suffix; + + while (1) + { + char *esuffix = (char *) strchr (nsuffix, ':'); + int lsuffix = ((esuffix) ? (esuffix - nsuffix) : strlen (nsuffix)); + + /* Concatenate path element/specified name with the suffix. */ + strncpy (fn, (char *) XSTRING_DATA (str), XSTRING_LENGTH (str)); + fn[XSTRING_LENGTH (str)] = 0; + if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */ + strncat (fn, nsuffix, lsuffix); + + suffixtab = Fcons (build_string (fn), suffixtab); + /* Advance to next suffix. */ + if (esuffix == 0) + break; + nsuffix += lsuffix + 1; + } + return Fnreverse (suffixtab); } DEFUN ("locate-file-clear-hashing", Flocate_file_clear_hashing, 1, 1, 0, /* @@ -1157,36 +1064,28 @@ track the following environmental changes: `locate-file' will primarily get confused if you add a file that shadows \(i.e. has the same name as) another file further down in the directory list. In this case, you must call `locate-file-clear-hashing'. - -If PATH is t, it means to fully clear all the accumulated hashes. This -can be used if the internal tables grow too large, or when dumping. */ (path)) { - if (EQ (path, Qt)) - Fclrhash (Vlocate_file_hash_table); - else + Lisp_Object pathtail; + + for (pathtail = path; !NILP (pathtail); pathtail = Fcdr (pathtail)) { - Lisp_Object pathtail; - EXTERNAL_LIST_LOOP (pathtail, path) - { - Lisp_Object pathel = Fexpand_file_name (XCAR (pathtail), Qnil); - Fremhash (pathel, Vlocate_file_hash_table); - } + Lisp_Object pathel = Fcar (pathtail); + if (!purified (pathel)) + Fput (pathel, Qlocate_file_hash_table, Qnil); } return Qnil; } /* Search for a file whose name is STR, looking in directories - in the Lisp list PATH, and trying suffixes from SUFFIXES. - SUFFIXES is a list of possible suffixes, or (for backward - compatibility) a string containing possible suffixes separated by - colons. + in the Lisp list PATH, and trying suffixes from SUFFIX. + SUFFIX is a string containing possible suffixes separated by colons. On success, returns a file descriptor. On failure, returns -1. MODE nonnegative means don't open the files, just look for one for which access(file,MODE) succeeds. In this case, - returns a nonnegative value on success. On failure, returns -1. + returns 1 on success. If STOREPTR is nonzero, it points to a slot where the name of the file actually found should be stored as a Lisp string. @@ -1195,45 +1094,43 @@ can be used if the internal tables grow too large, or when dumping. Called openp() in FSFmacs. */ int -locate_file (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, +locate_file (Lisp_Object path, Lisp_Object str, CONST char *suffix, Lisp_Object *storeptr, int mode) { /* This function can GC */ Lisp_Object suffixtab = Qnil; - Lisp_Object pathtail, pathel_expanded; + Lisp_Object pathtail; int val; - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; + struct gcpro gcpro1, gcpro2, gcpro3; if (storeptr) *storeptr = Qnil; - /* Is it really necessary to gcpro path and str? It shouldn't be - unless some caller has fucked up. There are known instances that - call us with build_string("foo:bar") as SUFFIXES, though. */ - GCPRO4 (path, str, suffixes, suffixtab); - /* if this filename has directory components, it's too complicated to try and use the hash tables. */ if (!NILP (Ffile_name_directory (str))) - { - val = locate_file_without_hash (path, str, suffixes, storeptr, mode); - UNGCPRO; - return val; - } + return locate_file_without_hash (path, str, suffix, storeptr, + mode); - suffixtab = locate_file_construct_suffixed_files (str, suffixes); + /* Is it really necessary to gcpro path and str? It shouldn't be + unless some caller has fucked up. */ + GCPRO3 (path, str, suffixtab); + + suffixtab = locate_file_construct_suffixed_files (str, suffix); - EXTERNAL_LIST_LOOP (pathtail, path) + for (pathtail = path; !NILP (pathtail); pathtail = Fcdr (pathtail)) { - Lisp_Object pathel = XCAR (pathtail); - Lisp_Object hash_table; + Lisp_Object pathel = Fcar (pathtail); + Lisp_Object hashtab; Lisp_Object tail; - int found = 0; + int found; - /* If this path element is relative, we have to look by hand. */ - if (NILP (pathel) || NILP (Ffile_name_absolute_p (pathel))) + /* If this path element is relative, we have to look by hand. + Can't set string property in a pure string. */ + if (NILP (pathel) || NILP (Ffile_name_absolute_p (pathel)) || + purified (pathel)) { - val = locate_file_in_directory (pathel, str, suffixes, storeptr, + val = locate_file_in_directory (pathel, str, suffix, storeptr, mode); if (val >= 0) { @@ -1243,25 +1140,21 @@ locate_file (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, continue; } - pathel_expanded = Fexpand_file_name (pathel, Qnil); - hash_table = locate_file_find_directory_hash_table (pathel_expanded); + hashtab = locate_file_find_directory_hash_table (pathel); - if (!NILP (hash_table)) + /* Loop over suffixes. */ + for (tail = suffixtab, found = 0; !found && CONSP (tail); + tail = XCDR (tail)) { - /* Loop over suffixes. */ - LIST_LOOP (tail, suffixtab) - if (!NILP (Fgethash (XCAR (tail), hash_table, Qnil))) - { - found = 1; - break; - } + if (!NILP (Fgethash (XCAR (tail), hashtab, Qnil))) + found = 1; } if (found) { /* This is a likely candidate. Look by hand in this directory so we don't get thrown off if someone byte-compiles a file. */ - val = locate_file_in_directory (pathel, str, suffixes, storeptr, + val = locate_file_in_directory (pathel, str, suffix, storeptr, mode); if (val >= 0) { @@ -1271,12 +1164,13 @@ locate_file (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, /* Hmm ... the file isn't actually there. (Or possibly it's a directory ...) So refresh our hashing. */ - locate_file_refresh_hashing (pathel_expanded); + locate_file_refresh_hashing (pathel); } } /* File is probably not there, but check the hard way just in case. */ - val = locate_file_without_hash (path, str, suffixes, storeptr, mode); + val = locate_file_without_hash (path, str, suffix, storeptr, + mode); if (val >= 0) { /* Sneaky user added a file without telling us. */ @@ -1382,9 +1276,9 @@ readevalloop (Lisp_Object readcharfun, { /* This function can GC */ REGISTER Emchar c; - REGISTER Lisp_Object val = Qnil; + REGISTER Lisp_Object val; int speccount = specpdl_depth (); - struct gcpro gcpro1, gcpro2; + struct gcpro gcpro1; struct buffer *b = 0; if (BUFFERP (readcharfun)) @@ -1401,7 +1295,7 @@ readevalloop (Lisp_Object readcharfun, #ifdef COMPILED_FUNCTION_ANNOTATION_HACK Vcurrent_compiled_function_annotation = Qnil; #endif - GCPRO2 (val, sourcename); + GCPRO1 (sourcename); LOADHIST_ATTACH (sourcename); @@ -1439,7 +1333,7 @@ readevalloop (Lisp_Object readcharfun, #else /* No "defun hack" -- Emacs 19 uses read-time syntax for bytecodes */ { unreadchar (readcharfun, c); - Vread_objects = Qnil; + read_objects = Qnil; if (NILP (Vload_read_function)) val = read0 (readcharfun); else @@ -1471,21 +1365,22 @@ Execute BUFFER as Lisp code. Programs can pass two arguments, BUFFER and PRINTFLAG. BUFFER is the buffer to evaluate (nil means use current buffer). PRINTFLAG controls printing of output: -nil means discard it; anything else is a stream for printing. +nil means discard it; anything else is stream for print. If there is no error, point does not move. If there is an error, point remains at the end of the last character read from the buffer. +Execute BUFFER as Lisp code. */ - (buffer, printflag)) + (bufname, printflag)) { /* This function can GC */ int speccount = specpdl_depth (); Lisp_Object tem, buf; - if (NILP (buffer)) + if (NILP (bufname)) buf = Fcurrent_buffer (); else - buf = Fget_buffer (buffer); + buf = Fget_buffer (bufname); if (NILP (buf)) error ("No such buffer."); @@ -1519,10 +1414,10 @@ point remains at the end of the last character read from the buffer. DEFUN ("eval-region", Feval_region, 2, 3, "r", /* Execute the region as Lisp code. -When called from programs, expects two arguments START and END +When called from programs, expects two arguments, giving starting and ending indices in the current buffer of the text to be executed. -Programs can pass third optional argument STREAM which controls output: +Programs can pass third argument PRINTFLAG which controls output: nil means discard it; anything else is stream for printing it. If there is no error, point does not move. If there is an error, @@ -1532,28 +1427,28 @@ Note: Before evaling the region, this function narrows the buffer to it. If the code being eval'd should happen to trigger a redisplay you may see some text temporarily disappear because of this. */ - (start, end, stream)) + (b, e, printflag)) { /* This function can GC */ int speccount = specpdl_depth (); Lisp_Object tem; Lisp_Object cbuf = Fcurrent_buffer (); - if (NILP (stream)) + if (NILP (printflag)) tem = Qsymbolp; /* #### #@[]*&$#*[& SI:NULL-STREAM */ else - tem = stream; + tem = printflag; specbind (Qstandard_output, tem); - if (NILP (stream)) + if (NILP (printflag)) record_unwind_protect (save_excursion_restore, save_excursion_save ()); record_unwind_protect (save_restriction_restore, save_restriction_save ()); - /* This both uses start and checks its type. */ - Fgoto_char (start, cbuf); - Fnarrow_to_region (make_int (BUF_BEGV (current_buffer)), end, cbuf); + /* This both uses b and checks its type. */ + Fgoto_char (b, cbuf); + Fnarrow_to_region (make_int (BUF_BEGV (current_buffer)), e, cbuf); readevalloop (cbuf, XBUFFER (cbuf)->filename, Feval, - !NILP (stream)); + !NILP (printflag)); return unbind_to (speccount, Qnil); } @@ -1576,7 +1471,7 @@ STREAM or the value of `standard-input' may be: if (EQ (stream, Qt)) stream = Qread_char; - Vread_objects = Qnil; + read_objects = Qnil; #ifdef COMPILED_FUNCTION_ANNOTATION_HACK Vcurrent_compiled_function_annotation = Qnil; @@ -1617,7 +1512,7 @@ START and END optionally delimit a substring of STRING from which to read; lispstream = make_lisp_string_input_stream (string, startval, endval - startval); - Vread_objects = Qnil; + read_objects = Qnil; tem = read0 (lispstream); /* Yeah, it's ugly. Gonna make something of it? @@ -1652,8 +1547,9 @@ backquote_unwind (Lisp_Object ptr) static Lisp_Object read0 (Lisp_Object readcharfun) { - Lisp_Object val = read1 (readcharfun); + Lisp_Object val; + val = read1 (readcharfun); if (CONSP (val) && UNBOUNDP (XCAR (val))) { Emchar c = XCHAR (XCDR (val)); @@ -1793,14 +1689,10 @@ read_escape (Lisp_Object readcharfun) } case 'x': - /* A hex escape, as in ANSI C, except that we only allow latin-1 - characters to be read this way. What is "\x4e03" supposed to - mean, anyways, if the internal representation is hidden? - This is also consistent with the treatment of octal escapes. */ + /* A hex escape, as in ANSI C. */ { REGISTER Emchar i = 0; - REGISTER int count = 0; - while (++count <= 2) + while (1) { c = readchar (readcharfun); /* Remember, can't use isdigit(), isalpha() etc. on Emchars */ @@ -1870,7 +1762,7 @@ read_atom_0 (Lisp_Object readcharfun, Emchar firstchar, int *saw_a_backslash) 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, @@ -1938,11 +1830,23 @@ read_atom (Lisp_Object readcharfun, { Lisp_Object sym; if (uninterned_symbol) - sym = Fmake_symbol ( make_string ((Bufbyte *) read_ptr, len)); + sym = (Fmake_symbol ((purify_flag) + ? make_pure_pname ((Bufbyte *) read_ptr, len, 0) + : 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); + + if (SYMBOL_IS_KEYWORD (sym)) + { + /* the LISP way is to put keywords in their own package, + but we don't have packages, so we do something simpler. + Someday, maybe we'll have packages and then this will + be reworked. --Stig. */ + XSYMBOL (sym)->value = sym; + } } return sym; } @@ -1950,10 +1854,10 @@ read_atom (Lisp_Object readcharfun, 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; @@ -2035,30 +1939,21 @@ static Lisp_Object read_bit_vector (Lisp_Object readcharfun) { unsigned_char_dynarr *dyn = Dynarr_new (unsigned_char); - Lisp_Object val; + Emchar c; while (1) { - unsigned char bit; - Emchar c = readchar (readcharfun); - if (c == '0') - bit = 0; - else if (c == '1') - bit = 1; - else - { - if (c >= 0) - unreadchar (readcharfun, c); - break; - } - Dynarr_add (dyn, bit); + c = readchar (readcharfun); + if (c != '0' && c != '1') + break; + Dynarr_add (dyn, (unsigned char) (c - '0')); } - val = make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0), - Dynarr_length (dyn)); - Dynarr_free (dyn); + if (c >= 0) + unreadchar (readcharfun, c); - return val; + return make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0), + Dynarr_length (dyn)); } @@ -2124,17 +2019,17 @@ read_structure (Lisp_Object readcharfun) GCPRO2 (orig_list, already_seen); if (c != '(') - RETURN_UNGCPRO (continuable_read_syntax_error ("#s not followed by paren")); + RETURN_UNGCPRO (continuable_syntax_error ("#s not followed by paren")); list = read_list (readcharfun, ')', 0, 0); orig_list = list; { int len = XINT (Flength (list)); if (len == 0) - RETURN_UNGCPRO (continuable_read_syntax_error + RETURN_UNGCPRO (continuable_syntax_error ("structure type not specified")); if (!(len & 1)) RETURN_UNGCPRO - (continuable_read_syntax_error + (continuable_syntax_error ("structures must have alternating keyword/value pairs")); } @@ -2501,18 +2396,18 @@ retry: case '+': case '-': { - Lisp_Object feature_exp, obj, tem; + Lisp_Object fexp, obj, tem; struct gcpro gcpro1, gcpro2; - feature_exp = read0(readcharfun); + fexp = read0(readcharfun); obj = read0(readcharfun); /* the call to `featurep' may GC. */ - GCPRO2 (feature_exp, obj); - tem = call1 (Qfeaturep, feature_exp); + GCPRO2(fexp, obj); + tem = call1(Qfeaturep, fexp); UNGCPRO; - if (c == '+' && NILP(tem)) goto retry; + if (c == '+' && NILP(tem)) goto retry; if (c == '-' && !NILP(tem)) goto retry; return obj; } @@ -2534,7 +2429,7 @@ retry: n += c - '0'; c = readchar (readcharfun); } - found = assq_no_quit (make_int (n), Vread_objects); + found = assq_no_quit (make_int (n), read_objects); if (c == '=') { /* #n=object returns object, but associates it with @@ -2546,8 +2441,7 @@ retry: ("Multiply defined symbol label"), make_int (n))); obj = read0 (readcharfun); - Vread_objects = Fcons (Fcons (make_int (n), obj), - Vread_objects); + read_objects = Fcons (Fcons (make_int (n), obj), read_objects); return obj; } else if (c == '#') @@ -2673,10 +2567,18 @@ retry: return Qzero; Lstream_flush (XLSTREAM (Vread_buffer_stream)); - return - make_string - (resizing_buffer_stream_ptr (XLSTREAM (Vread_buffer_stream)), - Lstream_byte_count (XLSTREAM (Vread_buffer_stream))); +#if 0 /* FSFmacs defun hack */ + if (read_pure) + return + make_pure_string + (resizing_buffer_stream_ptr (XLSTREAM (Vread_buffer_stream)), + Lstream_byte_count (XLSTREAM (Vread_buffer_stream))); + else +#endif + return + make_string + (resizing_buffer_stream_ptr (XLSTREAM (Vread_buffer_stream)), + Lstream_byte_count (XLSTREAM (Vread_buffer_stream))); } default: @@ -2700,10 +2602,10 @@ retry: #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++; @@ -2771,9 +2673,9 @@ sequence_reader (Lisp_Object readcharfun, unreadchar (readcharfun, ch); #ifdef FEATUREP_SYNTAX if (ch == ']') - read_syntax_error ("\"]\" in a list"); + syntax_error ("\"]\" in a list"); else if (ch == ')') - read_syntax_error ("\")\" in a vector"); + syntax_error ("\")\" in a vector"); #endif state = ((conser) (readcharfun, state, len)); } @@ -2813,15 +2715,15 @@ read_list_conser (Lisp_Object readcharfun, void *state, Charcount len) goto done; } else if (ch == ']') - read_syntax_error ("']' in a list"); + syntax_error ("']' in a list"); else if (ch == ')') - read_syntax_error ("')' in a vector"); + syntax_error ("')' in a vector"); else #endif if (ch != '.') signal_simple_error ("BUG! Internal reader error", elt); else if (!s->allow_dotted_lists) - read_syntax_error ("\".\" in a vector"); + syntax_error ("\".\" in a vector"); else { if (!NILP (s->tail)) @@ -2839,7 +2741,7 @@ read_list_conser (Lisp_Object readcharfun, void *state, Charcount len) goto done; } } - read_syntax_error (". in wrong context"); + syntax_error (". in wrong context"); } } @@ -3006,8 +2908,13 @@ read_vector (Lisp_Object readcharfun, 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,11 +2941,11 @@ read_compiled_function (Lisp_Object readcharfun, Emchar terminator) len = XINT (Flength (stuff)); if (len < COMPILED_STACK_DEPTH + 1 || len > COMPILED_DOMAIN + 1) return - continuable_read_syntax_error ("#[...] used with wrong number of elements"); + continuable_syntax_error ("#[...] used with wrong number of elements"); 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]) @@ -3086,7 +2993,7 @@ init_lread (void) Vvalues = Qnil; load_in_progress = 0; - + Vload_descriptor_list = Qnil; /* kludge: locate-file does not work for a null load-path, even if @@ -3123,6 +3030,7 @@ syms_of_lread (void) defsymbol (&Qcurrent_load_list, "current-load-list"); defsymbol (&Qload, "load"); defsymbol (&Qload_file_name, "load-file-name"); + defsymbol (&Qlocate_file_hash_table, "locate-file-hash-table"); defsymbol (&Qfset, "fset"); #ifdef LISP_BACKQUOTES @@ -3132,11 +3040,6 @@ syms_of_lread (void) defsymbol (&Qcomma_at, ",@"); defsymbol (&Qcomma_dot, ",."); #endif - - defsymbol (&Qexists, "exists"); - defsymbol (&Qreadable, "readable"); - defsymbol (&Qwritable, "writable"); - defsymbol (&Qexecutable, "executable"); } void @@ -3146,17 +3049,8 @@ structure_type_create (void) } 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. @@ -3259,6 +3153,12 @@ This is useful when the file being loaded is a temporary copy. */ ); load_force_doc_strings = 0; + DEFVAR_LISP ("source-directory", &Vsource_directory /* +Directory in which XEmacs sources were found when XEmacs was built. +You cannot count on them to still be there! +*/ ); + Vsource_directory = Qnil; + /* See read_escape(). */ #if 0 /* Used to be named `puke-on-fsf-keys' */ @@ -3274,6 +3174,9 @@ character escape syntaxes or just read them incorrectly. 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); @@ -3307,15 +3210,6 @@ character escape syntaxes or just read them incorrectly. Vfile_domain = Qnil; #endif - Vread_objects = Qnil; - staticpro (&Vread_objects); - - Vlocate_file_hash_table = make_lisp_hash_table (200, - HASH_TABLE_NON_WEAK, - HASH_TABLE_EQUAL); - staticpro (&Vlocate_file_hash_table); -#ifdef DEBUG_XEMACS - symbol_value (XSYMBOL (intern ("Vlocate-file-hash-table"))) - = Vlocate_file_hash_table; -#endif + read_objects = Qnil; + staticpro (&read_objects); } diff --git a/src/lrecord.h b/src/lrecord.h index bdf1c9e..dae210b 100644 --- a/src/lrecord.h +++ b/src/lrecord.h @@ -21,18 +21,18 @@ Boston, MA 02111-1307, USA. */ /* 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,15 +42,15 @@ Boston, MA 02111-1307, USA. */ 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 + lead of some existing type (e.g. hashtables). Note that you do not need to supply all the methods (see below); reasonable defaults are provided for many of them. Alternatively, if you're just looking for a way of encapsulating data (which possibly @@ -59,63 +59,85 @@ Boston, MA 02111-1307, USA. */ struct lrecord_header { + /* It would be better to put the mark-bit together with the + following datatype identification field in an 8- or 16-bit + integer rather than playing funny games with changing + header->implementation and "wasting" 32 bits on the below + pointer. The type-id would then be a 7 or 15 bit index into a + table of lrecord-implementations rather than a direct pointer. + There would be 24 (or 16) bits left over for datatype-specific + per-instance flags. + + The below is the simplest thing to do for the present, + and doesn't incur that much overhead as most Emacs records + are of such a size that the overhead isn't too bad. + (The marker datatype is the worst case.) + + It also has the very very very slight advantage that type-checking + involves one memory read (of the "implementation" slot) and a + comparison against a link-time constant address rather than a + read and a comparison against a variable value. (Variable since + it is a very good idea to assign the indices into the hypothetical + type-code table dynamically rather that pre-defining them.) + I think I remember that Elk Lisp does something like this. + Gee, I wonder if some cretin has patented it? */ + + /* + * If USE_INDEXED_LRECORD_IMPLEMENTATION is defined, we are + * implementing the scheme described in the 'It would be better + * ...' paragraph above. + */ +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION /* 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 type:8; + /* 1 if the object is marked during GC, 0 otherwise. */ + unsigned mark:1; + /* 1 if the object resides in pure (read-only) space */ + unsigned pure:1; +#else + CONST struct lrecord_implementation *implementation; +#endif }; struct lrecord_implementation; -int lrecord_type_index (const struct lrecord_implementation *implementation); - -#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; \ +int lrecord_type_index (CONST struct lrecord_implementation *implementation); + +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION +# define set_lheader_implementation(header,imp) do \ +{ \ + (header)->type = lrecord_type_index (imp); \ + (header)->mark = 0; \ + (header)->pure = 0; \ } while (0) +#else +# define set_lheader_implementation(header,imp) \ + ((void) ((header)->implementation = (imp))) +#endif 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. - - For example, the event and marker object types allocate members - out of memory chunks, and are able to find all unmarked members - by sweeping through the elements of the list of chunks. */ + The "next" field may be used for other purposes as long as some + other mechanism is provided for letting the GC do its work. (For + example, the event and marker datatypes allocate members out of + memory chunks, and are able to find all unmarked members by + sweeping through the elements of the list of chunks) */ struct lcrecord_header *next; - - /* The `uid' field is just for debugging/printing convenience. - Having this slot doesn't hurt us much spacewise, since an - lcrecord already has the above slots plus malloc overhead. */ + /* This is just for debugging/printing convenience. + Having this slot doesn't hurt us much spacewise, since an lcrecord + already has the above slots together with malloc overhead. */ unsigned int uid :31; - - /* The `free' field is a flag that indicates whether this lcrecord - is on a "free list". Free lists are used to minimize the number - of calls to malloc() when we're repeatedly allocating and freeing - a number of the same sort of lcrecord. Lcrecords on a free list - always get marked in a different fashion, so we can use this flag - as a sanity check to make sure that free lists only have freed - lcrecords and there are no freed lcrecords elsewhere. */ + /* A flag that indicates whether this lcrecord is on a "free list". + Free lists are used to minimize the number of calls to malloc() + when we're repeatedly allocating and freeing a number of the + same sort of lcrecord. Lcrecords on a free list always get + marked in a different fashion, so we can use this flag as a + sanity check to make sure that free lists only have freed lcrecords + and there are no freed lcrecords elsewhere. */ unsigned int free :1; }; @@ -126,84 +148,18 @@ struct free_lcrecord_header 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_mswindows_dialog_id, - lrecord_type_case_table, - lrecord_type_emacs_ffi, - lrecord_type_emacs_gtk_object, - lrecord_type_emacs_gtk_boxed, - lrecord_type_free, /* only used for "free" lrecords */ - lrecord_type_undefined, /* only used for debugging */ - lrecord_type_last_built_in_type /* must be last */ -}; +/* This as the value of lheader->implementation->finalizer + * means that this record is already marked */ +void this_marks_a_marked_record (void *, int); -extern unsigned int lrecord_type_count; +/* 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 @@ -212,219 +168,99 @@ struct lrecord_implementation 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; }; -/* All the built-in lisp object types are enumerated in `enum record_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 +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION +extern CONST struct lrecord_implementation *lrecord_implementations_table[]; -extern const struct lrecord_implementation *lrecord_implementations_table[(unsigned int)lrecord_type_last_built_in_type + MODULE_DEFINABLE_TYPE_COUNT]; - -#define XRECORD_LHEADER_IMPLEMENTATION(obj) \ - LHEADER_IMPLEMENTATION (XRECORD_LHEADER (obj)) -#define LHEADER_IMPLEMENTATION(lh) lrecord_implementations_table[(lh)->type] +# define XRECORD_LHEADER_IMPLEMENTATION(obj) \ + (lrecord_implementations_table[XRECORD_LHEADER (obj)->type]) +# define LHEADER_IMPLEMENTATION(lh) (lrecord_implementations_table[(lh)->type]) +#else +# define XRECORD_LHEADER_IMPLEMENTATION(obj) \ + (XRECORD_LHEADER (obj)->implementation) +# define LHEADER_IMPLEMENTATION(lh) ((lh)->implementation) +#endif 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-dependent. - - 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" - - 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_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. - - 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. +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION +# define MARKED_RECORD_P(obj) (gc_in_progress && XRECORD_LHEADER (obj)->mark) +#else +# define MARKED_RECORD_P(obj) (gc_in_progress && \ + XRECORD_LHEADER (obj)->implementation->finalizer == \ + this_marks_a_marked_record) +#endif +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION - 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 MARKED_RECORD_HEADER_P(lheader) (lheader)->mark +# define MARK_RECORD_HEADER(lheader) (lheader)->mark = 1 +# define UNMARK_RECORD_HEADER(lheader) (lheader)->mark = 0 -enum lrecord_description_type { - XD_LISP_OBJECT_ARRAY, - XD_LISP_OBJECT, - 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 -}; +#else /* ! USE_INDEXED_LRECORD_IMPLEMENTATION */ -struct lrecord_description { - enum lrecord_description_type type; - int offset; - EMACS_INT data1; - const struct struct_description *data2; -}; +# define MARKED_RECORD_HEADER_P(lheader) \ + (((lheader)->implementation->finalizer) == this_marks_a_marked_record) +# define MARK_RECORD_HEADER(lheader) \ + do { (((lheader)->implementation)++); } while (0) +# define UNMARK_RECORD_HEADER(lheader) \ + do { (((lheader)->implementation)--); } while (0) -struct struct_description { - size_t size; - const struct lrecord_description *description; -}; +#endif /* ! USE_INDEXED_LRECORD_IMPLEMENTATION */ -#define XD_INDIRECT(val, delta) (-1-((val)|(delta<<8))) +#define UNMARKABLE_RECORD_HEADER_P(lheader) \ + ((LHEADER_IMPLEMENTATION (lheader)->marker) \ + == this_one_is_unmarkable) -#define XD_IS_INDIRECT(code) (code<0) -#define XD_INDIRECT_VAL(code) ((-1-code) & 255) -#define XD_INDIRECT_DELTA(code) (((-1-code)>>8) & 255) +/* 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 */ -#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. @@ -436,242 +272,78 @@ struct struct_description { # 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_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_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_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_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_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_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 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_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) \ -#define MAKE_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \ +#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) \ -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_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \ -DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype) - -#define DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \ -MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof (structtype),0,0,structtype) - -#define DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \ -DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,sizer,structtype) - -#define DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \ -MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype) - -#define MAKE_EXTERNAL_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) \ -unsigned int lrecord_type_##c_name; \ -struct lrecord_implementation lrecord_##c_name = \ - { name, marker, printer, nuker, equal, hash, desc, \ - getprop, putprop, remprop, plist, size, sizer, \ - lrecord_type_last_built_in_type, basic_p } - - -extern Lisp_Object (*lrecord_markers[]) (Lisp_Object); - -#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 INIT_EXTERNAL_LRECORD_IMPLEMENTATION(type) do { \ - lrecord_type_##type = lrecord_type_count++; \ - lrecord_##type.lrecord_type_index = (enum lrecord_type) lrecord_type_##type; \ - INIT_LRECORD_IMPLEMENTATION(type); \ -} while (0) - -#define LRECORDP(a) (XTYPE (a) == Lisp_Type_Record) +static int lrecord_##c_name##_lrecord_type_index; \ +CONST_IF_NOT_DEBUG struct lrecord_implementation lrecord_##c_name[2] = \ + { { name, marker, printer, nuker, equal, hash, \ + getprop, putprop, remprop, props, size, sizer, \ + &(lrecord_##c_name##_lrecord_type_index), basic_p }, \ + { 0, 0, 0, this_marks_a_marked_record, 0, 0, 0, 0, 0, 0, 0, 0, 0, basic_p } } + +#define LRECORDP(a) (XTYPE ((a)) == Lisp_Type_Record) #define XRECORD_LHEADER(a) ((struct lrecord_header *) XPNTR (a)) -#define RECORD_TYPEP(x, ty) \ - (LRECORDP (x) && (((unsigned int)(XRECORD_LHEADER (x)->type)) == ((unsigned int)(ty)))) - -/* Steps to create a new object: - - 1. Declare the struct for your object in a header file somewhere. - Remember that it must begin with - - struct lcrecord_header header; - - 2. Put a DECLARE_LRECORD() for the object below the struct definition, - along with the standard XFOO/XSETFOO junk. - - 3. Add this header file to inline.c. - - 4. Create the methods for your object. Note that technically you don't - need any, but you will almost always want at least a mark method. - - 5. Define your object with DEFINE_LRECORD_IMPLEMENTATION() or some - variant. - - 6. Include the header file in the .c file where you defined the object. - - 7. Put a call to INIT_LRECORD_IMPLEMENTATION() for the object in the - .c file's syms_of_foo() function. - - 8. Add a type enum for the object to enum lrecord_type, earlier in this - file. - -An example: - ------------------------------- in toolbar.h ----------------------------- - -struct toolbar_button -{ - struct lcrecord_header header; - - Lisp_Object next; - Lisp_Object frame; - - Lisp_Object up_glyph; - Lisp_Object down_glyph; - Lisp_Object disabled_glyph; - - Lisp_Object cap_up_glyph; - Lisp_Object cap_down_glyph; - Lisp_Object cap_disabled_glyph; - - Lisp_Object callback; - Lisp_Object enabled_p; - Lisp_Object help_string; - - char enabled; - char down; - char pushright; - char blank; - - int x, y; - int width, height; - int dirty; - int vertical; - int border_width; -}; - -DECLARE_LRECORD (toolbar_button, struct toolbar_button); -#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 CHECK_TOOLBAR_BUTTON(x) CHECK_RECORD (x, toolbar_button) -#define CONCHECK_TOOLBAR_BUTTON(x) CONCHECK_RECORD (x, toolbar_button) - ------------------------------- in toolbar.c ----------------------------- - -#include "toolbar.h" - -... - -static Lisp_Object -mark_toolbar_button (Lisp_Object obj) -{ - 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); - return data->help_string; -} - -DEFINE_LRECORD_IMPLEMENTATION ("toolbar-button", toolbar_button, - mark_toolbar_button, 0, 0, 0, 0, 0, - struct toolbar_button); - -... - -void -syms_of_toolbar (void) -{ - INIT_LRECORD_IMPLEMENTATION (toolbar_button); - - ...; -} - ------------------------------- in inline.c ----------------------------- - -#ifdef HAVE_TOOLBARS -#include "toolbar.h" +#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION +# define RECORD_TYPEP(x, ty) \ + (LRECORDP (x) && \ + lrecord_implementations_table[XRECORD_LHEADER (x)->type] == (ty)) +#else +# define RECORD_TYPEP(x, ty) \ + (LRECORDP (x) && XRECORD_LHEADER (x)->implementation == (ty)) #endif ------------------------------- in lrecord.h ----------------------------- - -enum lrecord_type -{ - ... - lrecord_type_toolbar_button, - ... -}; - -*/ - -/* - -Note: Object types defined in external dynamically-loaded modules (not -part of the XEmacs main source code) should use DECLARE_EXTERNAL_LRECORD -and DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION rather than DECLARE_LRECORD -and DEFINE_LRECORD_IMPLEMENTATION. - -*/ +/* NOTE: the DECLARE_LRECORD() must come before the associated + DEFINE_LRECORD_*() or you will get compile errors. + Furthermore, you always need to put the DECLARE_LRECORD() in a header + file, and make sure the header file is included in inline.c, even + if the type is private to a particular file. Otherwise, you will + get undefined references for the error_check_foo() inline function + under GCC. */ #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 * \ -error_check_##c_name (Lisp_Object obj) \ +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)); \ - return (structtype *) XPNTR (obj); \ -} \ -extern Lisp_Object Q##c_name##p - -# define DECLARE_EXTERNAL_LRECORD(c_name, structtype) \ -extern unsigned int lrecord_type_##c_name; \ -extern struct lrecord_implementation lrecord_##c_name; \ -INLINE_HEADER structtype * \ -error_check_##c_name (Lisp_Object obj); \ -INLINE_HEADER structtype * \ -error_check_##c_name (Lisp_Object obj) \ -{ \ - assert (RECORD_TYPEP (obj, lrecord_type_##c_name)); \ - return (structtype *) XPNTR (obj); \ + XUNMARK (_obj); \ + 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 * \ -error_check_##c_name (Lisp_Object obj) \ +INLINE structtype *error_check_##c_name (Lisp_Object _obj); \ +INLINE structtype * \ +error_check_##c_name (Lisp_Object _obj) \ { \ - assert (XTYPE (obj) == type_enum); \ - return (structtype *) XPNTR (obj); \ + XUNMARK (_obj); \ + assert (XGCTYPE (_obj) == type_enum); \ + return (structtype *) XPNTR (_obj); \ } \ extern Lisp_Object Q##c_name##p @@ -680,29 +352,28 @@ extern Lisp_Object Q##c_name##p # define XSETRECORD(var, p, c_name) do \ { \ - XSETOBJ (var, p); \ - assert (RECORD_TYPEP (var, lrecord_type_##c_name)); \ + XSETOBJ (var, Lisp_Type_Record, p); \ + 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 -# define DECLARE_EXTERNAL_LRECORD(c_name, structtype) \ -extern Lisp_Object Q##c_name##p; \ -extern unsigned int lrecord_type_##c_name; \ -extern 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)) # define XNONRECORD(x, c_name, type_enum, structtype) \ ((structtype *) XPNTR (x)) -# define XSETRECORD(var, p, c_name) XSETOBJ (var, p) +# define XSETRECORD(var, p, c_name) XSETOBJ (var, Lisp_Type_Record, p) #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 @@ -728,7 +399,7 @@ extern Lisp_Object Q##c_name##p 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 {\ @@ -736,7 +407,7 @@ extern Lisp_Object Q##c_name##p 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 { \ @@ -744,21 +415,24 @@ extern Lisp_Object Q##c_name##p 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 --git a/src/lstream.h b/src/lstream.h index 309f722..e67bf4d 100644 --- a/src/lstream.h +++ b/src/lstream.h @@ -23,8 +23,8 @@ Boston, MA 02111-1307, USA. */ /* Written by Ben Wing. */ -#ifndef INCLUDED_lstream_h_ -#define INCLUDED_lstream_h_ +#ifndef _XEMACS_LSTREAM_H_ +#define _XEMACS_LSTREAM_H_ /************************************************************************/ /* definition of Lstream object */ @@ -42,26 +42,6 @@ DECLARE_LRECORD (lstream, struct lstream); #define EOF (-1) #endif -/* Typedef specifying a count of bytes in a data block to be written - out or read in, using Lstream_read(), Lstream_write(), and related - functions. This MUST BE SIGNED, since it also is used in functions - that return the number of bytes actually read to or written from in - an operation, and these functions can return -1 to signal error. - - Note that the standard Unix read() and write() functions define the - count going in as a size_t, which is UNSIGNED, and the count going - out as an ssize_t, which is SIGNED. This is a horrible design - flaw. Not only is it highly likely to lead to logic errors when a - -1 gets interpreted as a large positive number, but operations are - bound to fail in all sorts of horrible ways when a number in the - upper-half of the size_t range is passed in -- this number is - unrepresentable as an ssize_t, so code that checks to see how many - bytes are actually written (which is mandatory if you are dealing - with certain types of devices) will get completely screwed up. -*/ - -typedef EMACS_INT Lstream_data_count; - typedef enum lstream_buffering { /* No buffering. */ @@ -94,10 +74,9 @@ typedef enum lstream_buffering typedef struct lstream_implementation { - const char *name; - Lstream_data_count size; /* Number of additional bytes to be - allocated with this stream. Access this - data using Lstream_data(). */ + 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 can hold SIZE bytes. Return the number of bytes read. A return value of 0 means no bytes can be read at this time. This may @@ -113,11 +92,10 @@ typedef struct lstream_implementation the caller calls Lstream_read() with a very small size. This function can be NULL if the stream is output-only. */ - /* The omniscient mly, blinded by the irresistible thrall of Common + /* 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. */ - Lstream_data_count (*reader) (Lstream *stream, unsigned char *data, - Lstream_data_count 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 @@ -128,8 +106,7 @@ typedef struct lstream_implementation 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. */ - Lstream_data_count (*writer) (Lstream *stream, const unsigned char *data, - Lstream_data_count 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 */ @@ -152,7 +129,7 @@ typedef struct lstream_implementation 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) \ @@ -168,45 +145,42 @@ typedef struct lstream_implementation 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 */ - Lstream_data_count buffering_size; /* number of bytes buffered */ + size_t buffering_size; /* number of bytes buffered */ unsigned char *in_buffer; /* holds characters read from stream end */ - Lstream_data_count in_buffer_size; /* allocated size of buffer */ - Lstream_data_count in_buffer_current; /* number of characters in buffer */ - Lstream_data_count in_buffer_ind; /* pointer to next character to - take from buffer */ + size_t in_buffer_size; /* allocated size of buffer */ + size_t in_buffer_current; /* number of characters in buffer */ + size_t in_buffer_ind; /* pointer to next character to take from buffer */ unsigned char *out_buffer; /* holds characters to write to stream end */ - Lstream_data_count out_buffer_size; /* allocated size of buffer */ - Lstream_data_count out_buffer_ind; /* pointer to next buffer spot to - write a character */ + size_t out_buffer_size; /* allocated size of buffer */ + size_t out_buffer_ind; /* pointer to next buffer spot to write a character */ /* The unget buffer is more or less a stack -- things get pushed onto the end and read back from the end. Lstream_read() basically reads backwards from the end to get stuff; Lstream_unread() similarly has to push the data on backwards. */ unsigned char *unget_buffer; /* holds characters pushed back onto input */ - Lstream_data_count unget_buffer_size; /* allocated size of buffer */ - Lstream_data_count unget_buffer_ind; /* pointer to next buffer spot - to write a character */ + size_t unget_buffer_size; /* allocated size of buffer */ + size_t unget_buffer_ind; /* pointer to next buffer spot to write a character */ - Lstream_data_count byte_count; - int flags; - max_align_t data[1]; + size_t byte_count; + long flags; /* Align pointer for 64 bit machines (kny) */ + char data[1]; }; #define LSTREAM_TYPE_P(lstr, type) \ ((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; @@ -225,8 +199,8 @@ error_check_lstream_type (struct lstream *stream, (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); @@ -235,12 +209,10 @@ int Lstream_flush_out (Lstream *lstr); int Lstream_fputc (Lstream *lstr, int c); int Lstream_fgetc (Lstream *lstr); void Lstream_fungetc (Lstream *lstr, int c); -Lstream_data_count Lstream_read (Lstream *lstr, void *data, - Lstream_data_count size); -Lstream_data_count Lstream_write (Lstream *lstr, const void *data, - Lstream_data_count 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, Lstream_data_count 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); @@ -296,18 +268,17 @@ void Lstream_set_character_mode (Lstream *str); #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); - return (c < 0x80 /* c == EOF || BYTE_ASCII_P (c) */ - ? (Emchar) c - : Lstream_get_emchar_1 (stream, c)); + return BYTE_ASCII_P (c) ? (Emchar) c : + 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) ? @@ -315,8 +286,8 @@ Lstream_put_emchar (Lstream *stream, Emchar ch) 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)) @@ -368,11 +339,11 @@ int filedesc_stream_fd (Lstream *stream); Lisp_Object make_lisp_string_input_stream (Lisp_Object string, Bytecount offset, Bytecount len); -Lisp_Object make_fixed_buffer_input_stream (const void *buf, - Lstream_data_count size); -Lisp_Object make_fixed_buffer_output_stream (void *buf, - Lstream_data_count 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); @@ -385,4 +356,4 @@ Lisp_Object make_lisp_buffer_output_stream (struct buffer *buf, Bufpos pos, int flags); Bufpos lisp_buffer_stream_startpos (Lstream *stream); -#endif /* INCLUDED_lstream_h_ */ +#endif /* _XEMACS_LSTREAM_H_ */ diff --git a/src/m/iris6d.h b/src/m/iris6d.h index 913868b..caae6dc 100644 --- a/src/m/iris6d.h +++ b/src/m/iris6d.h @@ -20,6 +20,11 @@ Boston, MA 02111-1307, USA. */ /* 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 @@ Boston, MA 02111-1307, USA. */ #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. */ @@ -55,6 +68,15 @@ Boston, MA 02111-1307, USA. */ #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 @@ -83,7 +105,15 @@ Boston, MA 02111-1307, USA. */ #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 --git a/src/m/s390.h b/src/m/s390.h new file mode 100644 index 0000000..1407879 --- /dev/null +++ b/src/m/s390.h @@ -0,0 +1,34 @@ +/* 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 --git a/src/menubar-gtk.c b/src/menubar-gtk.c index 4af6659..8d2dac9 100644 --- a/src/menubar-gtk.c +++ b/src/menubar-gtk.c @@ -1216,21 +1216,11 @@ static void gtk_popup_menu (Lisp_Object menu_desc, Lisp_Object event) { struct Lisp_Event *eev = NULL; - GtkWidget *widget = NULL; - GtkWidget *menu = NULL; - gpointer id = NULL; - - /* Do basic error checking first... */ - if (SYMBOLP (menu_desc)) - menu_desc = Fsymbol_value (menu_desc); - CHECK_CONS (menu_desc); - CHECK_STRING (XCAR (menu_desc)); - - /* Now lets get down to business... */ - widget = menu_descriptor_to_widget (menu_desc); - menu = GTK_MENU_ITEM (widget)->submenu; + GtkWidget *widget = menu_descriptor_to_widget (menu_desc); + GtkWidget *menu = GTK_MENU_ITEM (widget)->submenu; + gpointer id = gtk_object_get_data (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG); + gtk_widget_set_name (widget, "XEmacsPopupMenu"); - id = gtk_object_get_data (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG); __activate_menu (GTK_MENU_ITEM (widget), id); diff --git a/src/miscplay.c b/src/miscplay.c index 2257634..37eeb17 100644 --- a/src/miscplay.c +++ b/src/miscplay.c @@ -32,6 +32,7 @@ #define UNUSED(x) ((void)(x)) #else #define UNUSED(x) +#define __inline__ #endif /* Maintain global variable for keeping parser state information; this struct @@ -113,7 +114,7 @@ static size_t parsevoc(void **data,size_t *sz,void **outbuf) 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) +static __inline__ int waverequire(void **data,size_t *sz,size_t rq) { int rc = 1; @@ -134,7 +135,7 @@ static inline int waverequire(void **data,size_t *sz,size_t rq) } /* ...and next we remove this many bytes from the buffer */ -static inline void waveremove(size_t rq) +static __inline__ void waveremove(size_t rq) { if (parsestate.wave.left <= rq) parsestate.wave.left = 0; @@ -360,11 +361,8 @@ size_t sndcnv8U_2mono(void **data,size_t *sz,void **outbuf) *outbuf = dest = miscplay_sndbuf; while (count--) - { - *dest++ = (unsigned char)(((int)*(src) + - (int)*(src+1)) / 2); - src += 2; - } + *dest++ = (unsigned char)(((int)*(src)++ + + (int)*(src)++) / 2); *data = src; return(rc); } @@ -384,11 +382,8 @@ size_t sndcnv8S_2mono(void **data,size_t *sz,void **outbuf) *outbuf = dest = miscplay_sndbuf; while (count--) - { - *dest++ = (unsigned char)(((int)*((signed char *)(src)) + - (int)*((signed char *)(src+1))) / 2); - src += 2; - } + *dest++ = (unsigned char)(((int)*((signed char *)(src++)) + + (int)*((signed char *)(src++))) / 2); *data = src; return(rc); } @@ -408,11 +403,8 @@ size_t sndcnv2monounsigned(void **data,size_t *sz,void **outbuf) *outbuf = dest = miscplay_sndbuf; while (count--) - { - *dest++ = (unsigned char)(((int)*((signed char *)(src)) + - (int)*((signed char *)(src+1))) / 2) ^ 0x80; - src += 2; - } + *dest++ = (unsigned char)(((int)*((signed char *)(src++)) + + (int)*((signed char *)(src++))) / 2) ^ 0x80; *data = src; return(rc); } @@ -439,7 +431,7 @@ size_t sndcnv2unsigned(void **data,size_t *sz,void **outbuf) /* 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) +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] = { @@ -502,10 +494,7 @@ size_t sndcnvULaw_2linear(void **data,size_t *sz,void **outbuf) *outbuf = *data; while ((*sz)--) - { - *p = ulaw_dsp[*p]; - p++; - } + *p++ = ulaw_dsp[*p]; *sz = 0; *data = p; return p - (unsigned char *)*outbuf; @@ -562,30 +551,26 @@ size_t sndcnvULaw_2mono(void **data,size_t *sz,void **outbuf) *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+1)]); - src += 2; - } + /* 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) { + /* #### Not aliasing-safe!! Must convert to use unions instead! */ size_t cnt = *sz / 2; unsigned short *p; *outbuf = *data; p = (unsigned short *) *outbuf; - while (cnt--) - { - *p = ((*p & 0x00ff) << 8) | (*p >> 8); - p++; - } + while (cnt--) { + *p++ = ((*p & 0x00ff) << 8) | (*p >> 8); + } *data = p; cnt = *sz; *sz = 0; diff --git a/src/miscplay.h b/src/miscplay.h index 5b26af0..c83030b 100644 --- a/src/miscplay.h +++ b/src/miscplay.h @@ -16,9 +16,6 @@ ** 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 */ @@ -59,5 +56,3 @@ fmtType analyze_format(unsigned char *format,int *fmt,int *speed, void **)); void reset_parsestate(void); int parse_wave_complete(void); - -#endif /* INCLUDED_miscplay_h_ */ diff --git a/src/mule-canna.c b/src/mule-canna.c index 224acc3..7ad6409 100644 --- a/src/mule-canna.c +++ b/src/mule-canna.c @@ -1,4 +1,4 @@ -/* CANNA interface -*- coding: euc-jp -*- +/* CANNA interface Copyright (C) 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. @@ -22,11 +22,9 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: Mule 2.3. Not in FSF. */ -/* Japanese comments were translated 2000-12-06 by Stephen Turnbull - <stephen@xemacs.org>. I haven't verified that the Japanese comments - were correct. YMMV, NO WARRANTY, not even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. (^^;;; as the - Japanese say. */ +/* #### The comments in this file are mostly in EUC-formatted Japanese. + It would be ***soooo*** much nicer if someone could translate + them ... */ /* @@ -167,39 +165,37 @@ Boston, MA 02111-1307, USA. */ #endif /* !CANNA2 */ extern char *jrKanjiError; -/* #### is this global really necessary? */ #define KEYTOSTRSIZE 2048 -static unsigned char key_buffer[KEYTOSTRSIZE]; +static unsigned char buf[KEYTOSTRSIZE]; static char **warning; -static int canna_empty_info, canna_through_info; -static int canna_underline; -static int canna_inhibit_hankakukana; +static int Vcanna_empty_info, Vcanna_through_info; +static int Vcanna_underline; +static int Vcanna_inhibit_hankakukana; static Lisp_Object Vcanna_kakutei_string; static Lisp_Object Vcanna_kakutei_yomi; static Lisp_Object Vcanna_kakutei_romaji; static Lisp_Object Vcanna_henkan_string; -static Fixnum canna_henkan_length; -static Fixnum canna_henkan_revPos; -static Fixnum canna_henkan_revLen; +static int Vcanna_henkan_length; +static int Vcanna_henkan_revPos; +static int Vcanna_henkan_revLen; static Lisp_Object Vcanna_ichiran_string; -static Fixnum canna_ichiran_length; -static Fixnum canna_ichiran_revPos; -static Fixnum canna_ichiran_revLen; +static int Vcanna_ichiran_length; +static int Vcanna_ichiran_revPos; +static int Vcanna_ichiran_revLen; static Lisp_Object Vcanna_mode_string; static int IRCP_context; 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 *); static Lisp_Object mule_make_string (unsigned char *, int); static int mule_strlen (unsigned char *, int); -static void count_char (unsigned char *,int, int, int, Fixnum *, Fixnum *, Fixnum *); +static void count_char (unsigned char *,int, int, int, int *, int *, int *); #define make_string mule_make_string #endif @@ -217,8 +213,8 @@ variables. int len; CHECK_CHAR_COERCE_INT (ch); - len = jrKanjiString (0, XCHAR (ch), key_buffer, KEYTOSTRSIZE, &ks); - return storeResults (key_buffer, len, &ks); + len = jrKanjiString (0, XCHAR (ch), buf, KEYTOSTRSIZE, &ks); + return storeResults (buf, len, &ks); } static Lisp_Object @@ -232,11 +228,10 @@ storeResults (unsigned char *buf, int len, jrKanjiStatus *ks) } else { - /* ³ÎÄꤷ¤¿Ê¸»úÎó (the confirmed string) */ + /* ³ÎÄꤷ¤¿Ê¸»úÎó */ Vcanna_kakutei_string = make_string (buf, len); val = make_int (len); - /* ³ÎÄꤷ¤¿Ê¸»úÎó¤ÎÆɤߤξðÊó... - (info about the reading of the confirmed string) */ + /* ³ÎÄꤷ¤¿Ê¸»úÎó¤ÎÆɤߤξðÊó... */ Vcanna_kakutei_yomi = Vcanna_kakutei_romaji = Qnil; if (ks->info & KanjiYomiInfo) { @@ -247,74 +242,68 @@ storeResults (unsigned char *buf, int len, jrKanjiStatus *ks) { int yomilen2; - Vcanna_kakutei_yomi = make_string (p, yomilen); /* ÆÉ¤ß - (reading) */ + Vcanna_kakutei_yomi = make_string (p, yomilen); /* ÆÉ¤ß */ p += yomilen + 1; yomilen2 = strlen (p); if (len + yomilen + yomilen2 + 2 < KEYTOSTRSIZE) { - Vcanna_kakutei_romaji = make_string (p, yomilen2); - /* ¥í¡¼¥Þ»ú (romanization) */ + Vcanna_kakutei_romaji = make_string (p, yomilen2); /* ¥í¡¼¥Þ»ú */ } } } - /* ¸õÊäɽ¼¨¤Îʸ»úÎó¤Ç¤¹¡£ - (string for displaying candidate translations) */ + /* ¸õÊäɽ¼¨¤Îʸ»úÎó¤Ç¤¹¡£*/ Vcanna_henkan_string = Qnil; if (ks->length >= 0) { Vcanna_henkan_string = make_string (ks->echoStr, ks->length); #ifndef CANNA_MULE - canna_henkan_length = ks->length; - canna_henkan_revPos = ks->revPos; - canna_henkan_revLen = ks->revLen; + Vcanna_henkan_length = ks->length; + Vcanna_henkan_revPos = ks->revPos; + Vcanna_henkan_revLen = ks->revLen; #else /* CANNA_MULE */ - if (canna_underline) + if (Vcanna_underline) { - canna_henkan_length = mule_strlen (ks->echoStr,ks->length); - canna_henkan_revPos = mule_strlen (ks->echoStr,ks->revPos); - canna_henkan_revLen = mule_strlen (ks->echoStr+ks->revPos, - ks->revLen); + Vcanna_henkan_length = mule_strlen (ks->echoStr,ks->length); + Vcanna_henkan_revPos = mule_strlen (ks->echoStr,ks->revPos); + Vcanna_henkan_revLen = mule_strlen (ks->echoStr+ks->revPos,ks->revLen); } else { count_char (ks->echoStr, ks->length, ks->revPos, ks->revLen, - &canna_henkan_length, &canna_henkan_revPos, - &canna_henkan_revLen); + &Vcanna_henkan_length, &Vcanna_henkan_revPos, + &Vcanna_henkan_revLen); } #endif /* CANNA_MULE */ } - /* °ìÍ÷¤Î¾ðÊó (information about the echo area menu) */ + /* °ìÍ÷¤Î¾ðÊó */ Vcanna_ichiran_string = Qnil; if (ks->info & KanjiGLineInfo && ks->gline.length >= 0) { - Vcanna_ichiran_string = make_string (ks->gline.line, - ks->gline.length); + Vcanna_ichiran_string = make_string (ks->gline.line, ks->gline.length); #ifndef CANNA_MULE - canna_ichiran_length = ks->gline.length; - canna_ichiran_revPos = ks->gline.revPos; - canna_ichiran_revLen = ks->gline.revLen; + Vcanna_ichiran_length = ks->gline.length; + Vcanna_ichiran_revPos = ks->gline.revPos; + Vcanna_ichiran_revLen = ks->gline.revLen; #else /* CANNA_MULE */ count_char (ks->gline.line, ks->gline.length, - ks->gline.revPos, ks->gline.revLen, - &canna_ichiran_length, - &canna_ichiran_revPos, &canna_ichiran_revLen); + ks->gline.revPos, ks->gline.revLen, &Vcanna_ichiran_length, + &Vcanna_ichiran_revPos, &Vcanna_ichiran_revLen); #endif /* CANNA_MULE */ } - /* ¥â¡¼¥É¤Î¾ðÊó (mode information) */ + /* ¥â¡¼¥É¤Î¾ðÊó */ Vcanna_mode_string = Qnil; if (ks->info & KanjiModeInfo) { Vcanna_mode_string = make_string (ks->mode, strlen (ks->mode)); } - /* ¤½¤Î¾¤Î¾ðÊó (other information) */ - canna_empty_info = (ks->info & KanjiEmptyInfo) ? 1 : 0; - canna_through_info = (ks->info & KanjiThroughInfo) ? 1 : 0; + /* ¤½¤Î¾¤Î¾ðÊó */ + Vcanna_empty_info = (ks->info & KanjiEmptyInfo) ? 1 : 0; + Vcanna_through_info = (ks->info & KanjiThroughInfo) ? 1 : 0; } return val; @@ -327,7 +316,7 @@ No separator will be used otherwise. */ (num)) { - int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© (display clause separator?) */ + int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© */ kugiri = NILP (num) ? 0 : 1; @@ -337,9 +326,10 @@ No separator will be used otherwise. } /* 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); } @@ -358,7 +348,7 @@ If nil is specified for each arg, the default value will be used. int res; unsigned char **p, **q; - int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© (display clause separator?) */ + int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© */ IRCP_context = -1; @@ -382,8 +372,8 @@ If nil is specified for each arg, the default value will be used. char servername[256]; CHECK_STRING (server); - strncpy (servername, XSTRING_DATA (server), XSTRING_LENGTH (server)); - servername[XSTRING_LENGTH (server)] = '\0'; + strncpy (servername, XSTRING (server)->_data, XSTRING (server)->_size); + servername[XSTRING (server)->_size] = '\0'; jrKanjiControl (0, KC_SETSERVERNAME, servername); } @@ -396,8 +386,8 @@ If nil is specified for each arg, the default value will be used. char rcname[256]; CHECK_STRING (rcfile); - strncpy (rcname, XSTRING_DATA (rcfile), XSTRING_LENGTH (rcfile)); - rcname[XSTRING_LENGTH (rcfile)] = '\0'; + strncpy (rcname, XSTRING (rcfile)->_data, XSTRING (rcfile)->_size); + rcname[XSTRING (rcfile)->_size] = '\0'; jrKanjiControl (0, KC_SETINITFILENAME, rcname); } @@ -424,14 +414,15 @@ If nil is specified for each arg, the default value will be used. if (res == -1) { - val = Fcons (make_string ((unsigned char*) jrKanjiError, + val = Fcons (make_string ((unsigned char*) jrKanjiError, strlen (jrKanjiError)), val); - /* ¥¤¥Ë¥·¥ã¥é¥¤¥º¤Ç¼ºÇÔ¤·¤¿¾ì¹ç¡£ (on initialization failure) */ + /* ¥¤¥Ë¥·¥ã¥é¥¤¥º¤Ç¼ºÇÔ¤·¤¿¾ì¹ç¡£ */ return Fcons (Qnil, val); } else { - extern void (*jrBeepFunc) (void); + extern void (*jrBeepFunc)(); + Lisp_Object CANNA_mode_keys (); jrBeepFunc = call_Fding; @@ -448,14 +439,11 @@ If nil is specified for each arg, the default value will be used. #ifndef CANNA_MULE jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1); #else - /* mule ¤À¤Ã¤¿¤éȾ³Ñ¥«¥¿¥«¥Ê¤â»È¤¨¤ë - (Mule can use half-width katakana) */ - if (canna_inhibit_hankakukana) + /* mule ¤À¤Ã¤¿¤éȾ³Ñ¥«¥¿¥«¥Ê¤â»È¤¨¤ë */ + if (Vcanna_inhibit_hankakukana) jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1); #endif - jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* ¢¨£²: ¥í¡¼¥Þ»ú¤Þ¤ÇÊÖ¤¹ - (*2: return to - romanized form) */ + jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* ¢¨£²: ¥í¡¼¥Þ»ú¤Þ¤ÇÊÖ¤¹ */ val = Fcons (Qnil, val); return Fcons (CANNA_mode_keys (), val); } @@ -499,24 +487,24 @@ Register Kanji words into kana-to-kanji conversion dictionary. #endif CHECK_STRING (str); - ksv.buffer = (unsigned char *) key_buffer; + ksv.buffer = (unsigned char *) buf; ksv.bytes_buffer = KEYTOSTRSIZE; #ifndef CANNA_MULE - ks.echoStr = XSTRING_DATA (str); - ks.length = XSTRING_LENGTH (str); + ks.echoStr = XSTRING (str)->_data; + ks.length = XSTRING (str)->_size; #else /* CANNA_MULE */ - m2c (XSTRING_DATA (str), XSTRING_LENGTH (str), cbuf); + m2c (XSTRING (str)->_data, XSTRING (str)->_size, cbuf); ks.echoStr = cbuf; ks.length = strlen (cbuf); #endif /* CANNA_MULE */ ksv.ks = &ks; len = jrKanjiControl (0, KC_DEFINEKANJI, (char *)&ksv); - val = storeResults (key_buffer, ksv.val, ksv.ks); + val = storeResults (buf, ksv.val, ksv.ks); return val; } DEFUN ("canna-set-width", Fcanna_set_width, 1, 1, 0, /* -Set status-line width information, which is used to display +Set status-line width information, which is used to display kanji candidates. */ (num)) @@ -538,16 +526,16 @@ Change Japanese pre-edit mode. CHECK_INT (num); - ksv.buffer = (unsigned char *) key_buffer; + ksv.buffer = (unsigned char *) buf; ksv.bytes_buffer = KEYTOSTRSIZE; ksv.ks = &ks; ksv.val = XINT (num); jrKanjiControl (0, KC_CHANGEMODE, (char *)&ksv); - val = storeResults (key_buffer, ksv.val, ksv.ks); + val = storeResults (buf, ksv.val, ksv.ks); return val; } -static Lisp_Object +Lisp_Object CANNA_mode_keys (void) { #define CANNAWORKBUFSIZE 32 @@ -576,12 +564,12 @@ Store yomi characters as a YOMI of kana-to-kanji conversion. CHECK_STRING (yomi); #ifndef CANNA_MULE - strncpy (key_buffer, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi)); - ks.length = XSTRING_LENGTH (yomi); - key_buffer[ks.length] = '\0'; + strncpy (buf, XSTRING (yomi)->_data, XSTRING (yomi)->_size); + ks.length = XSTRING (yomi)->_size; + buf[ks.length] = '\0'; #else /* CANNA_MULE */ - m2c (XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), key_buffer); - ks.length = strlen (key_buffer); + m2c (XSTRING (yomi)->_data, XSTRING (yomi)->_size, buf); + ks.length = strlen (buf); #endif /* CANNA_MULE */ if (NILP (roma)) @@ -593,24 +581,24 @@ Store yomi characters as a YOMI of kana-to-kanji conversion. CHECK_STRING (roma); #ifndef CANNA_MULE - strncpy (key_buffer + XSTRING_LENGTH (yomi) + 1, XSTRING_DATA (roma), - XSTRING_LENGTH (roma)); - key_buffer[XSTRING_LENGTH (yomi) + 1 + XSTRING_LENGTH (roma)] = '\0'; - ks.mode = (unsigned char *)(key_buffer + XSTRING_LENGTH (yomi) + 1); + strncpy (buf + XSTRING (yomi)->_size + 1, XSTRING (roma)->_data, + XSTRING (roma)->_size); + buf[XSTRING (yomi)->_size + 1 + XSTRING (roma)->_size] = '\0'; + ks.mode = (unsigned char *)(buf + XSTRING (yomi)->_size + 1); #else /* CANNA_MULE */ - ks.mode = (unsigned char *)(key_buffer + ks.length + 1); - m2c (XSTRING_DATA (roma), XSTRING_LENGTH (roma), ks.mode); + ks.mode = (unsigned char *)(buf + ks.length + 1); + m2c (XSTRING (roma)->_data, XSTRING (roma)->_size, ks.mode); #endif /* CANNA_MULE */ } - ks.echoStr = (unsigned char *) key_buffer; - ksv.buffer = (unsigned char *) key_buffer; /* ÊÖÃÍÍÑ (return value) */ + ks.echoStr = (unsigned char *) buf; + ksv.buffer = (unsigned char *) buf; /* ÊÖÃÍÍÑ */ ksv.bytes_buffer = KEYTOSTRSIZE; ksv.ks = &ks; jrKanjiControl (0, KC_STOREYOMI, (char *)&ksv); - return storeResults (key_buffer, ksv.val, ksv.ks); + return storeResults (buf, ksv.val, ksv.ks); } DEFUN ("canna-do-function", Fcanna_do_function, 1, 2, 0, /* @@ -626,20 +614,20 @@ Do specified function at current mode. if (NILP (ch)) { - *key_buffer = '@'; + *buf = '@'; } else { CHECK_CHAR (ch); - *key_buffer = XCHAR (ch); + *buf = XCHAR (ch); } - ksv.buffer = (unsigned char *) key_buffer; + ksv.buffer = (unsigned char *) buf; ksv.bytes_buffer = KEYTOSTRSIZE; ksv.ks = &ks; ksv.val = XINT (num); jrKanjiControl (0, KC_DO, (char *) &ksv); - val = storeResults (key_buffer, ksv.val, ksv.ks); + val = storeResults (buf, ksv.val, ksv.ks); return val; } @@ -655,12 +643,12 @@ Parse customize string. CHECK_STRING (str); #ifndef CANNA_MULE - strncpy (key_buffer, XSTRING_DATA (str), XSTRING_LENGTH (str)); - key_buffer[XSTRING_LENGTH (str)] = '\0'; + strncpy (buf, XSTRING (str)->_data, XSTRING (str)->_size); + buf[XSTRING (str)->_size] = '\0'; #else /* CANNA_MULE */ - m2c (XSTRING_DATA (str), XSTRING_LENGTH (str), key_buffer); + m2c (XSTRING (str)->_data, XSTRING (str)->_size, buf); #endif /* CANNA_MULE */ - p = (unsigned char**) key_buffer; + p = (unsigned char**) buf; n = jrKanjiControl (0, KC_PARSE, (char *) &p); val = Qnil; while (n > 0) @@ -730,8 +718,7 @@ byteLen (int bun, int len) } DEFUN ("canna-henkan-begin", Fcanna_henkan_begin, 1, 1, 0, /* -Return the result of kana-to-kanji conversion. -Clause separator is set. +¤«¤Ê´Á»úÊÑ´¹¤·¤¿·ë²Ì¤òÊÖ´Ô¤¹¤ë¡£Ê¸ÀáÀڤ꤬¤·¤Æ¤¢¤ë¡£ */ (yomi)) { @@ -743,12 +730,12 @@ Clause separator is set. return Qnil; } #ifndef CANNA_MULE - strncpy (yomibuf, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi)); - yomibuf[XSTRING_LENGTH (yomi)] = '\0'; - nbun = RkBgnBun (IRCP_context, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), + strncpy (yomibuf, XSTRING (yomi)->_data, XSTRING (yomi)->_size); + yomibuf[XSTRING (yomi)->_size] = '\0'; + nbun = RkBgnBun (IRCP_context, XSTRING (yomi)->_data, XSTRING (yomi)->_size, (RK_XFER << RK_XFERBITS) | RK_KFER); #else /* CANNA_MULE */ - m2c (XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), yomibuf); + m2c (XSTRING (yomi)->_data, XSTRING (yomi)->_size, yomibuf); nbun = RkBgnBun (IRCP_context, (char *) yomibuf, strlen (yomibuf), (RK_XFER << RK_XFERBITS) | RK_KFER); #endif /* CANNA_MULE */ @@ -786,7 +773,7 @@ kanjiYomiList (int context, int nbun) } DEFUN ("canna-henkan-next", Fcanna_henkan_next, 1, 1, 0, /* -Return the list of candidates. +¸õÊä°ìÍ÷¤òµá¤á¤ë¡£ */ (bunsetsu)) { @@ -811,7 +798,7 @@ Return the list of candidates. } else { - endp = XCDR (res) = Fcons (make_string (p, slen), Qnil); + endp = XCDR (endp) = Fcons (make_string (p, slen), Qnil); } p += slen + 1; } @@ -819,7 +806,7 @@ Return the list of candidates. } DEFUN ("canna-bunsetu-henkou", Fcanna_bunsetu_henkou, 2, 2, 0, /* -Specify the length of a clause. +ʸÀá¤ÎŤµ¤ò»ØÄꤹ¤ë¡£ */ (bunsetsu, bunlen)) { @@ -827,7 +814,7 @@ Specify the length of a clause. CHECK_INT (bunsetsu); CHECK_INT (bunlen); - + nbun = XINT (bunsetsu); if (confirmContext () == 0) { @@ -839,7 +826,7 @@ Specify the length of a clause. } DEFUN ("canna-henkan-kakutei", Fcanna_henkan_kakutei, 2, 2, 0, /* -Select a candidate. +¸õÊäÁªÂò¡£ */ (bun, kouho)) { @@ -858,7 +845,7 @@ Select a candidate. } DEFUN ("canna-henkan-end", Fcanna_henkan_end, 0, 0, 0, /* -End conversion. +ÊÑ´¹½ªÎ»¡£ */ ()) { @@ -866,14 +853,12 @@ End conversion. { return Qnil; } - RkEndBun (IRCP_context, 1); /* ³Ø½¬¤Ï¤¤¤Ä¤Ç¤â¹Ô¤Ã¤ÆÎɤ¤¤â¤Î¤Ê¤Î¤«¡© - (is it OK to invoke learning function - at arbitrary times?) */ + RkEndBun (IRCP_context, 1); /* ³Ø½¬¤Ï¤¤¤Ä¤Ç¤â¹Ô¤Ã¤ÆÎɤ¤¤â¤Î¤Ê¤Î¤«¡© */ return Qt; } DEFUN ("canna-henkan-quit", Fcanna_henkan_quit, 0, 0, 0, /* -Quit conversion. +ÊÑ´¹½ªÎ»¡£ */ ()) { @@ -887,149 +872,150 @@ Quit conversion. /* variables below this line is constants of Canna */ -static Fixnum canna_mode_AlphaMode; -static Fixnum canna_mode_EmptyMode; -static Fixnum canna_mode_KigoMode; -static Fixnum canna_mode_YomiMode; -static Fixnum canna_mode_JishuMode; -static Fixnum canna_mode_TankouhoMode; -static Fixnum canna_mode_IchiranMode; -static Fixnum canna_mode_YesNoMode; -static Fixnum canna_mode_OnOffMode; +static int Vcanna_mode_AlphaMode = IROHA_MODE_AlphaMode; +static int Vcanna_mode_EmptyMode = IROHA_MODE_EmptyMode; +static int Vcanna_mode_KigoMode = IROHA_MODE_KigoMode; +static int Vcanna_mode_YomiMode = IROHA_MODE_YomiMode; +static int Vcanna_mode_JishuMode = IROHA_MODE_JishuMode; +static int Vcanna_mode_TankouhoMode = IROHA_MODE_TankouhoMode; +static int Vcanna_mode_IchiranMode = IROHA_MODE_IchiranMode; +static int Vcanna_mode_YesNoMode = IROHA_MODE_YesNoMode; +static int Vcanna_mode_OnOffMode = IROHA_MODE_OnOffMode; #ifdef CANNA_MODE_AdjustBunsetsuMode -static Fixnum canna_mode_AdjustBunsetsuMode; +static int Vcanna_mode_AdjustBunsetsuMode = CANNA_MODE_AdjustBunsetsuMode; #endif #ifdef CANNA_MODE_ChikujiYomiMode -static Fixnum canna_mode_ChikujiYomiMode; -static Fixnum canna_mode_ChikujiTanMode; +static int Vcanna_mode_ChikujiYomiMode = CANNA_MODE_ChikujiYomiMode; +static int Vcanna_mode_ChikujiTanMode = CANNA_MODE_ChikujiTanMode; #endif -static Fixnum canna_mode_HenkanMode; +static int Vcanna_mode_HenkanMode = IROHA_MODE_HenkanMode; #ifdef CANNA_MODE_HenkanNyuryokuMode -static Fixnum canna_mode_HenkanNyuryokuMode; +static int Vcanna_mode_HenkanNyuryokuMode = CANNA_MODE_HenkanNyuryokuMode; #endif #ifdef CANNA_MODE_ZenHiraHenkanMode -static Fixnum canna_mode_ZenHiraHenkanMode; +static int Vcanna_mode_ZenHiraHenkanMode = CANNA_MODE_ZenHiraHenkanMode; #ifdef CANNA_MODE_HanHiraHenkanMode -static Fixnum canna_mode_HanHiraHenkanMode; +static int Vcanna_mode_HanHiraHenkanMode = CANNA_MODE_HanHiraHenkanMode; #endif -static Fixnum canna_mode_ZenKataHenkanMode; -static Fixnum canna_mode_HanKataHenkanMode; -static Fixnum canna_mode_ZenAlphaHenkanMode; -static Fixnum canna_mode_HanAlphaHenkanMode; +static int Vcanna_mode_ZenKataHenkanMode = CANNA_MODE_ZenKataHenkanMode; +static int Vcanna_mode_HanKataHenkanMode = CANNA_MODE_HanKataHenkanMode; +static int Vcanna_mode_ZenAlphaHenkanMode = CANNA_MODE_ZenAlphaHenkanMode; +static int Vcanna_mode_HanAlphaHenkanMode = CANNA_MODE_HanAlphaHenkanMode; #endif -static Fixnum canna_mode_ZenHiraKakuteiMode; +static int Vcanna_mode_ZenHiraKakuteiMode = IROHA_MODE_ZenHiraKakuteiMode; #ifdef CANNA_MODE_HanHiraKakuteiMode -static Fixnum canna_mode_HanHiraKakuteiMode; +static int Vcanna_mode_HanHiraKakuteiMode = CANNA_MODE_HanHiraKakuteiMode; #endif -static Fixnum canna_mode_ZenKataKakuteiMode; -static Fixnum canna_mode_HanKataKakuteiMode; -static Fixnum canna_mode_ZenAlphaKakuteiMode; -static Fixnum canna_mode_HanAlphaKakuteiMode; -static Fixnum canna_mode_HexMode; -static Fixnum canna_mode_BushuMode; -static Fixnum canna_mode_ExtendMode; -static Fixnum canna_mode_RussianMode; -static Fixnum canna_mode_GreekMode; -static Fixnum canna_mode_LineMode; -static Fixnum canna_mode_ChangingServerMode; -static Fixnum canna_mode_HenkanMethodMode; -static Fixnum canna_mode_DeleteDicMode; -static Fixnum canna_mode_TourokuMode; -static Fixnum canna_mode_TourokuEmptyMode; -static Fixnum canna_mode_TourokuHinshiMode; -static Fixnum canna_mode_TourokuDicMode; -static Fixnum canna_mode_QuotedInsertMode; -static Fixnum canna_mode_BubunMuhenkanMode; -static Fixnum canna_mode_MountDicMode; - -static Fixnum canna_fn_SelfInsert; -static Fixnum canna_fn_FunctionalInsert; -static Fixnum canna_fn_QuotedInsert; -static Fixnum canna_fn_JapaneseMode; -static Fixnum canna_fn_AlphaMode; -static Fixnum canna_fn_HenkanNyuryokuMode; -static Fixnum canna_fn_Forward; -static Fixnum canna_fn_Backward; -static Fixnum canna_fn_Next; -static Fixnum canna_fn_Prev; -static Fixnum canna_fn_BeginningOfLine; -static Fixnum canna_fn_EndOfLine; -static Fixnum canna_fn_DeleteNext; -static Fixnum canna_fn_DeletePrevious; -static Fixnum canna_fn_KillToEndOfLine; -static Fixnum canna_fn_Henkan; -static Fixnum canna_fn_Kakutei; -static Fixnum canna_fn_Extend; -static Fixnum canna_fn_Shrink; +static int Vcanna_mode_ZenKataKakuteiMode = IROHA_MODE_ZenKataKakuteiMode; +static int Vcanna_mode_HanKataKakuteiMode = IROHA_MODE_HanKataKakuteiMode; +static int Vcanna_mode_ZenAlphaKakuteiMode = IROHA_MODE_ZenAlphaKakuteiMode; +static int Vcanna_mode_HanAlphaKakuteiMode = IROHA_MODE_HanAlphaKakuteiMode; +static int Vcanna_mode_HexMode = IROHA_MODE_HexMode; +static int Vcanna_mode_BushuMode = IROHA_MODE_BushuMode; +static int Vcanna_mode_ExtendMode = IROHA_MODE_ExtendMode; +static int Vcanna_mode_RussianMode = IROHA_MODE_RussianMode; +static int Vcanna_mode_GreekMode = IROHA_MODE_GreekMode; +static int Vcanna_mode_LineMode = IROHA_MODE_LineMode; +static int Vcanna_mode_ChangingServerMode = IROHA_MODE_ChangingServerMode; +static int Vcanna_mode_HenkanMethodMode = IROHA_MODE_HenkanMethodMode; +static int Vcanna_mode_DeleteDicMode = IROHA_MODE_DeleteDicMode; +static int Vcanna_mode_TourokuMode = IROHA_MODE_TourokuMode; +static int Vcanna_mode_TourokuEmptyMode = IROHA_MODE_TourokuEmptyMode; +static int Vcanna_mode_TourokuHinshiMode = IROHA_MODE_TourokuHinshiMode; +static int Vcanna_mode_TourokuDicMode = IROHA_MODE_TourokuDicMode; +static int Vcanna_mode_QuotedInsertMode = IROHA_MODE_QuotedInsertMode; +static int Vcanna_mode_BubunMuhenkanMode = IROHA_MODE_BubunMuhenkanMode; +static int Vcanna_mode_MountDicMode = IROHA_MODE_MountDicMode; + +static int Vcanna_fn_SelfInsert = IROHA_FN_SelfInsert; +static int Vcanna_fn_FunctionalInsert = IROHA_FN_FunctionalInsert; +static int Vcanna_fn_QuotedInsert = IROHA_FN_QuotedInsert; +static int Vcanna_fn_JapaneseMode = IROHA_FN_JapaneseMode; +static int Vcanna_fn_AlphaMode = IROHA_FN_AlphaMode; +static int Vcanna_fn_HenkanNyuryokuMode = IROHA_FN_HenkanNyuryokuMode; +static int Vcanna_fn_Forward = IROHA_FN_Forward; +static int Vcanna_fn_Backward = IROHA_FN_Backward; +static int Vcanna_fn_Next = IROHA_FN_Next; +static int Vcanna_fn_Prev = IROHA_FN_Prev; +static int Vcanna_fn_BeginningOfLine = IROHA_FN_BeginningOfLine; +static int Vcanna_fn_EndOfLine = IROHA_FN_EndOfLine; +static int Vcanna_fn_DeleteNext = IROHA_FN_DeleteNext; +static int Vcanna_fn_DeletePrevious = IROHA_FN_DeletePrevious; +static int Vcanna_fn_KillToEndOfLine = IROHA_FN_KillToEndOfLine; +static int Vcanna_fn_Henkan = IROHA_FN_Henkan; +static int Vcanna_fn_Kakutei = IROHA_FN_Kakutei; +static int Vcanna_fn_Extend = IROHA_FN_Extend; +static int Vcanna_fn_Shrink = IROHA_FN_Shrink; #ifdef CANNA_FN_AdjustBunsetsu -static Fixnum canna_fn_AdjustBunsetsu; +static int Vcanna_fn_AdjustBunsetsu = CANNA_FN_AdjustBunsetsu; #endif -static Fixnum canna_fn_Quit; -static Fixnum canna_fn_ConvertAsHex; -static Fixnum canna_fn_ConvertAsBushu; -static Fixnum canna_fn_KouhoIchiran; -static Fixnum canna_fn_BubunMuhenkan; -static Fixnum canna_fn_Zenkaku; -static Fixnum canna_fn_Hankaku; -static Fixnum canna_fn_ToUpper; -static Fixnum canna_fn_Capitalize; -static Fixnum canna_fn_ToLower; -static Fixnum canna_fn_Hiragana; -static Fixnum canna_fn_Katakana; -static Fixnum canna_fn_Romaji; +static int Vcanna_fn_Quit = IROHA_FN_Quit; +static int Vcanna_fn_ConvertAsHex = IROHA_FN_ConvertAsHex; +static int Vcanna_fn_ConvertAsBushu = IROHA_FN_ConvertAsBushu; +static int Vcanna_fn_KouhoIchiran = IROHA_FN_KouhoIchiran; +static int Vcanna_fn_BubunMuhenkan = IROHA_FN_BubunMuhenkan; +static int Vcanna_fn_Zenkaku = IROHA_FN_Zenkaku; +static int Vcanna_fn_Hankaku = IROHA_FN_Hankaku; +static int Vcanna_fn_ToUpper = IROHA_FN_ToUpper; +static int Vcanna_fn_Capitalize = IROHA_FN_Capitalize; +static int Vcanna_fn_ToLower = IROHA_FN_ToLower; +static int Vcanna_fn_Hiragana = IROHA_FN_Hiragana; +static int Vcanna_fn_Katakana = IROHA_FN_Katakana; +static int Vcanna_fn_Romaji = IROHA_FN_Romaji; #ifdef CANNA_FN_BaseHiragana -static Fixnum canna_fn_BaseHiragana; -static Fixnum canna_fn_BaseKatakana; -static Fixnum canna_fn_BaseEisu; -static Fixnum canna_fn_BaseZenkaku; -static Fixnum canna_fn_BaseHankaku; -static Fixnum canna_fn_BaseKana; -static Fixnum canna_fn_BaseKakutei; -static Fixnum canna_fn_BaseHenkan; -static Fixnum canna_fn_BaseHiraKataToggle; -static Fixnum canna_fn_BaseZenHanToggle; -static Fixnum canna_fn_BaseKanaEisuToggle; -static Fixnum canna_fn_BaseKakuteiHenkanToggle; -static Fixnum canna_fn_BaseRotateForward; -static Fixnum canna_fn_BaseRotateBackward; +static int Vcanna_fn_BaseHiragana = CANNA_FN_BaseHiragana; +static int Vcanna_fn_BaseKatakana = CANNA_FN_BaseKatakana; +static int Vcanna_fn_BaseEisu = CANNA_FN_BaseEisu; +static int Vcanna_fn_BaseZenkaku = CANNA_FN_BaseZenkaku; +static int Vcanna_fn_BaseHankaku = CANNA_FN_BaseHankaku; +static int Vcanna_fn_BaseKana = CANNA_FN_BaseKana; +static int Vcanna_fn_BaseKakutei = CANNA_FN_BaseKakutei; +static int Vcanna_fn_BaseHenkan = CANNA_FN_BaseHenkan; +static int Vcanna_fn_BaseHiraKataToggle = CANNA_FN_BaseHiraKataToggle; +static int Vcanna_fn_BaseZenHanToggle = CANNA_FN_BaseZenHanToggle; +static int Vcanna_fn_BaseKanaEisuToggle = CANNA_FN_BaseKanaEisuToggle; +static int Vcanna_fn_BaseKakuteiHenkanToggle = + CANNA_FN_BaseKakuteiHenkanToggle; +static int Vcanna_fn_BaseRotateForward = CANNA_FN_BaseRotateForward; +static int Vcanna_fn_BaseRotateBackward = CANNA_FN_BaseRotateBackward; #endif -static Fixnum canna_fn_ExtendMode; -static Fixnum canna_fn_Touroku; -static Fixnum canna_fn_HexMode; -static Fixnum canna_fn_BushuMode; -static Fixnum canna_fn_KigouMode; +static int Vcanna_fn_ExtendMode = IROHA_FN_ExtendMode; +static int Vcanna_fn_Touroku = IROHA_FN_Touroku; +static int Vcanna_fn_HexMode = IROHA_FN_HexMode; +static int Vcanna_fn_BushuMode = IROHA_FN_BushuMode; +static int Vcanna_fn_KigouMode = IROHA_FN_KigouMode; #ifdef CANNA_FN_Mark -static Fixnum canna_fn_Mark; +static int Vcanna_fn_Mark = CANNA_FN_Mark; #endif #ifdef CANNA_FN_TemporalMode -static Fixnum canna_fn_TemporalMode; +static int Vcanna_fn_TemporalMode = CANNA_FN_TemporalMode; #endif -static Fixnum canna_key_Nfer; -static Fixnum canna_key_Xfer; -static Fixnum canna_key_Up; -static Fixnum canna_key_Left; -static Fixnum canna_key_Right; -static Fixnum canna_key_Down; -static Fixnum canna_key_Insert; -static Fixnum canna_key_Rollup; -static Fixnum canna_key_Rolldown; -static Fixnum canna_key_Home; -static Fixnum canna_key_Help; -static Fixnum canna_key_KP_Key; -static Fixnum canna_key_Shift_Nfer; -static Fixnum canna_key_Shift_Xfer; -static Fixnum canna_key_Shift_Up; -static Fixnum canna_key_Shift_Left; -static Fixnum canna_key_Shift_Right; -static Fixnum canna_key_Shift_Down; -static Fixnum canna_key_Cntrl_Nfer; -static Fixnum canna_key_Cntrl_Xfer; -static Fixnum canna_key_Cntrl_Up; -static Fixnum canna_key_Cntrl_Left; -static Fixnum canna_key_Cntrl_Right; -static Fixnum canna_key_Cntrl_Down; +static int Vcanna_key_Nfer = IROHA_KEY_Nfer; +static int Vcanna_key_Xfer = IROHA_KEY_Xfer; +static int Vcanna_key_Up = IROHA_KEY_Up; +static int Vcanna_key_Left = IROHA_KEY_Left; +static int Vcanna_key_Right = IROHA_KEY_Right; +static int Vcanna_key_Down = IROHA_KEY_Down; +static int Vcanna_key_Insert = IROHA_KEY_Insert; +static int Vcanna_key_Rollup = IROHA_KEY_Rollup; +static int Vcanna_key_Rolldown = IROHA_KEY_Rolldown; +static int Vcanna_key_Home = IROHA_KEY_Home; +static int Vcanna_key_Help = IROHA_KEY_Help; +static int Vcanna_key_KP_Key = IROHA_KEY_KP_Key; +static int Vcanna_key_Shift_Nfer = IROHA_KEY_Shift_Nfer; +static int Vcanna_key_Shift_Xfer = IROHA_KEY_Shift_Xfer; +static int Vcanna_key_Shift_Up = IROHA_KEY_Shift_Up; +static int Vcanna_key_Shift_Left = IROHA_KEY_Shift_Left; +static int Vcanna_key_Shift_Right = IROHA_KEY_Shift_Right; +static int Vcanna_key_Shift_Down = IROHA_KEY_Shift_Down; +static int Vcanna_key_Cntrl_Nfer = IROHA_KEY_Cntrl_Nfer; +static int Vcanna_key_Cntrl_Xfer = IROHA_KEY_Cntrl_Xfer; +static int Vcanna_key_Cntrl_Up = IROHA_KEY_Cntrl_Up; +static int Vcanna_key_Cntrl_Left = IROHA_KEY_Cntrl_Left; +static int Vcanna_key_Cntrl_Right = IROHA_KEY_Cntrl_Right; +static int Vcanna_key_Cntrl_Down = IROHA_KEY_Cntrl_Down; Lisp_Object VCANNA; /* by MORIOKA Tomohiko <morioka@jaist.ac.jp> 1996/6/7 */ @@ -1037,6 +1023,9 @@ Lisp_Object VCANNA; /* by MORIOKA Tomohiko <morioka@jaist.ac.jp> 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); @@ -1060,727 +1049,467 @@ syms_of_mule_canna (void) 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 /* */ ); - Vcanna_kakutei_string = Qnil; - DEFVAR_LISP ("canna-kakutei-yomi", &Vcanna_kakutei_yomi /* */ ); - Vcanna_kakutei_yomi = Qnil; - DEFVAR_LISP ("canna-kakutei-romaji", &Vcanna_kakutei_romaji /* */ ); - Vcanna_kakutei_romaji = Qnil; - DEFVAR_LISP ("canna-henkan-string", &Vcanna_henkan_string /* */ ); - Vcanna_henkan_string = Qnil; - - DEFVAR_INT ("canna-henkan-length", &canna_henkan_length /* + DEFVAR_INT ("canna-henkan-length", &Vcanna_henkan_length /* */ ); - canna_henkan_length = 0; - - DEFVAR_INT ("canna-henkan-revpos", &canna_henkan_revPos /* + DEFVAR_INT ("canna-henkan-revpos", &Vcanna_henkan_revPos /* */ ); - canna_henkan_revPos = 0; - - DEFVAR_INT ("canna-henkan-revlen", &canna_henkan_revLen /* + DEFVAR_INT ("canna-henkan-revlen", &Vcanna_henkan_revLen /* */ ); - canna_henkan_revLen = 0; - DEFVAR_LISP ("canna-ichiran-string", &Vcanna_ichiran_string /* */ ); - Vcanna_ichiran_string = Qnil; - - DEFVAR_INT ("canna-ichiran-length", &canna_ichiran_length /* + DEFVAR_INT ("canna-ichiran-length", &Vcanna_ichiran_length /* */ ); - canna_ichiran_length = 0; - - DEFVAR_INT ("canna-ichiran-revpos", &canna_ichiran_revPos /* + DEFVAR_INT ("canna-ichiran-revpos", &Vcanna_ichiran_revPos /* */ ); - canna_ichiran_revPos = 0; - - DEFVAR_INT ("canna-ichiran-revlen", &canna_ichiran_revLen /* + DEFVAR_INT ("canna-ichiran-revlen", &Vcanna_ichiran_revLen /* */ ); - canna_ichiran_revLen = 0; - DEFVAR_LISP ("canna-mode-string", &Vcanna_mode_string /* */ ); - Vcanna_mode_string = Qnil; - DEFVAR_BOOL ("canna-empty-info", &canna_empty_info /* + DEFVAR_BOOL ("canna-empty-info", &Vcanna_empty_info /* For canna */ ); - canna_empty_info = 0; - - DEFVAR_BOOL ("canna-through-info", &canna_through_info /* + DEFVAR_BOOL ("canna-through-info", &Vcanna_through_info /* For canna */ ); - canna_through_info = 0; - - DEFVAR_BOOL ("canna-underline", &canna_underline /* + DEFVAR_BOOL ("canna-underline", &Vcanna_underline /* For canna */ ); - canna_underline = 0; - - DEFVAR_BOOL ("canna-inhibit-hankakukana", &canna_inhibit_hankakukana /* + DEFVAR_BOOL ("canna-inhibit-hankakukana", &Vcanna_inhibit_hankakukana /* For canna */ ); - canna_inhibit_hankakukana = 0; - DEFVAR_INT ("canna-mode-alpha-mode", &canna_mode_AlphaMode /* + DEFVAR_INT ("canna-mode-alpha-mode", &Vcanna_mode_AlphaMode /* */ ); - canna_mode_AlphaMode = IROHA_MODE_AlphaMode; - - DEFVAR_INT ("canna-mode-empty-mode", &canna_mode_EmptyMode /* + DEFVAR_INT ("canna-mode-empty-mode", &Vcanna_mode_EmptyMode /* */ ); - canna_mode_EmptyMode = IROHA_MODE_EmptyMode; - - DEFVAR_INT ("canna-mode-kigo-mode", &canna_mode_KigoMode /* + DEFVAR_INT ("canna-mode-kigo-mode", &Vcanna_mode_KigoMode /* */ ); - canna_mode_KigoMode = IROHA_MODE_KigoMode; - - DEFVAR_INT ("canna-mode-yomi-mode", &canna_mode_YomiMode /* + DEFVAR_INT ("canna-mode-yomi-mode", &Vcanna_mode_YomiMode /* */ ); - canna_mode_YomiMode = IROHA_MODE_YomiMode; - - DEFVAR_INT ("canna-mode-jishu-mode", &canna_mode_JishuMode /* + DEFVAR_INT ("canna-mode-jishu-mode", &Vcanna_mode_JishuMode /* */ ); - canna_mode_JishuMode = IROHA_MODE_JishuMode; - - DEFVAR_INT ("canna-mode-tankouho-mode", &canna_mode_TankouhoMode /* + DEFVAR_INT ("canna-mode-tankouho-mode", &Vcanna_mode_TankouhoMode /* */ ); - canna_mode_TankouhoMode = IROHA_MODE_TankouhoMode; - - DEFVAR_INT ("canna-mode-ichiran-mode", &canna_mode_IchiranMode /* + DEFVAR_INT ("canna-mode-ichiran-mode", &Vcanna_mode_IchiranMode /* */ ); - canna_mode_IchiranMode = IROHA_MODE_IchiranMode; - - DEFVAR_INT ("canna-mode-yes-no-mode", &canna_mode_YesNoMode /* + DEFVAR_INT ("canna-mode-yes-no-mode", &Vcanna_mode_YesNoMode /* */ ); - canna_mode_YesNoMode = IROHA_MODE_YesNoMode; - - DEFVAR_INT ("canna-mode-on-off-mode", &canna_mode_OnOffMode /* + DEFVAR_INT ("canna-mode-on-off-mode", &Vcanna_mode_OnOffMode /* */ ); - canna_mode_OnOffMode = IROHA_MODE_OnOffMode; - #ifdef CANNA_MODE_AdjustBunsetsuMode DEFVAR_INT ("canna-mode-adjust-bunsetsu-mode", - &canna_mode_AdjustBunsetsuMode /* + &Vcanna_mode_AdjustBunsetsuMode /* */ ); - canna_mode_AdjustBunsetsuMode = CANNA_MODE_AdjustBunsetsuMode; #endif #ifdef CANNA_MODE_ChikujiYomiMode - DEFVAR_INT ("canna-mode-chikuji-yomi-mode", &canna_mode_ChikujiYomiMode /* + DEFVAR_INT ("canna-mode-chikuji-yomi-mode", &Vcanna_mode_ChikujiYomiMode /* */ ); - canna_mode_ChikujiYomiMode = CANNA_MODE_ChikujiYomiMode; - DEFVAR_INT ("canna-mode-chikuji-bunsetsu-mode", - &canna_mode_ChikujiTanMode /* + &Vcanna_mode_ChikujiTanMode /* */ ); - canna_mode_ChikujiTanMode = CANNA_MODE_ChikujiTanMode; #endif - DEFVAR_INT ("canna-mode-henkan-mode", &canna_mode_HenkanMode /* + DEFVAR_INT ("canna-mode-henkan-mode", &Vcanna_mode_HenkanMode /* */ ); - canna_mode_HenkanMode = IROHA_MODE_HenkanMode; - #ifdef CANNA_MODE_HenkanNyuryokuMode DEFVAR_INT ("canna-mode-henkan-nyuuryoku-mode", - &canna_mode_HenkanNyuryokuMode /* + &Vcanna_mode_HenkanNyuryokuMode /* */ ); - canna_mode_HenkanNyuryokuMode = CANNA_MODE_HenkanNyuryokuMode; #endif #ifdef CANNA_MODE_ZenHiraHenkanMode DEFVAR_INT ("canna-mode-zen-hira-henkan-mode", - &canna_mode_ZenHiraHenkanMode /* + &Vcanna_mode_ZenHiraHenkanMode /* */ ); - canna_mode_ZenHiraHenkanMode = CANNA_MODE_ZenHiraHenkanMode; #ifdef CANNA_MODE_HanHiraHenkanMode DEFVAR_INT ("canna-mode-han-hira-henkan-mode", - &canna_mode_HanHiraHenkanMode /* + &Vcanna_mode_HanHiraHenkanMode /* */ ); - canna_mode_HanHiraHenkanMode = CANNA_MODE_HanHiraHenkanMode; #endif DEFVAR_INT ("canna-mode-zen-kata-henkan-mode", - &canna_mode_ZenKataHenkanMode /* + &Vcanna_mode_ZenKataHenkanMode /* */ ); - canna_mode_ZenKataHenkanMode = CANNA_MODE_ZenKataHenkanMode; - DEFVAR_INT ("canna-mode-han-kata-henkan-mode", - &canna_mode_HanKataHenkanMode /* + &Vcanna_mode_HanKataHenkanMode /* */ ); - canna_mode_HanKataHenkanMode = CANNA_MODE_HanKataHenkanMode; - DEFVAR_INT ("canna-mode-zen-alpha-henkan-mode", - &canna_mode_ZenAlphaHenkanMode /* + &Vcanna_mode_ZenAlphaHenkanMode /* */ ); - canna_mode_ZenAlphaHenkanMode = CANNA_MODE_ZenAlphaHenkanMode; - DEFVAR_INT ("canna-mode-han-alpha-henkan-mode", - &canna_mode_HanAlphaHenkanMode /* + &Vcanna_mode_HanAlphaHenkanMode /* */ ); - canna_mode_HanAlphaHenkanMode = CANNA_MODE_HanAlphaHenkanMode; #endif DEFVAR_INT ("canna-mode-zen-hira-kakutei-mode", - &canna_mode_ZenHiraKakuteiMode /* + &Vcanna_mode_ZenHiraKakuteiMode /* */ ); - canna_mode_ZenHiraKakuteiMode = IROHA_MODE_ZenHiraKakuteiMode; #ifdef CANNA_MODE_HanHiraKakuteiMode DEFVAR_INT ("canna-mode-han-hira-kakutei-mode", - &canna_mode_HanHiraKakuteiMode /* + &Vcanna_mode_HanHiraKakuteiMode /* */ ); - canna_mode_HanHiraKakuteiMode = CANNA_MODE_HanHiraKakuteiMode; #endif DEFVAR_INT ("canna-mode-zen-kata-kakutei-mode", - &canna_mode_ZenKataKakuteiMode /* + &Vcanna_mode_ZenKataKakuteiMode /* */ ); - canna_mode_ZenKataKakuteiMode = IROHA_MODE_ZenKataKakuteiMode; - DEFVAR_INT ("canna-mode-han-kata-kakutei-mode", - &canna_mode_HanKataKakuteiMode /* + &Vcanna_mode_HanKataKakuteiMode /* */ ); - canna_mode_HanKataKakuteiMode = IROHA_MODE_HanKataKakuteiMode; - DEFVAR_INT ("canna-mode-zen-alpha-kakutei-mode", - &canna_mode_ZenAlphaKakuteiMode /* + &Vcanna_mode_ZenAlphaKakuteiMode /* */ ); - canna_mode_ZenAlphaKakuteiMode = IROHA_MODE_ZenAlphaKakuteiMode; - DEFVAR_INT ("canna-mode-han-alpha-kakutei-mode", - &canna_mode_HanAlphaKakuteiMode /* + &Vcanna_mode_HanAlphaKakuteiMode /* */ ); - canna_mode_HanAlphaKakuteiMode = IROHA_MODE_HanAlphaKakuteiMode; - - DEFVAR_INT ("canna-mode-hex-mode", &canna_mode_HexMode /* + DEFVAR_INT ("canna-mode-hex-mode", &Vcanna_mode_HexMode /* */ ); - canna_mode_HexMode = IROHA_MODE_HexMode; - - DEFVAR_INT ("canna-mode-bushu-mode", &canna_mode_BushuMode /* + DEFVAR_INT ("canna-mode-bushu-mode", &Vcanna_mode_BushuMode /* */ ); - canna_mode_BushuMode = IROHA_MODE_BushuMode; - - DEFVAR_INT ("canna-mode-extend-mode", &canna_mode_ExtendMode /* + DEFVAR_INT ("canna-mode-extend-mode", &Vcanna_mode_ExtendMode /* */ ); - canna_mode_ExtendMode = IROHA_MODE_ExtendMode; - - DEFVAR_INT ("canna-mode-russian-mode", &canna_mode_RussianMode /* + DEFVAR_INT ("canna-mode-russian-mode", &Vcanna_mode_RussianMode /* */ ); - canna_mode_RussianMode = IROHA_MODE_RussianMode; - - DEFVAR_INT ("canna-mode-greek-mode", &canna_mode_GreekMode /* + DEFVAR_INT ("canna-mode-greek-mode", &Vcanna_mode_GreekMode /* */ ); - canna_mode_GreekMode = IROHA_MODE_GreekMode; - - DEFVAR_INT ("canna-mode-line-mode", &canna_mode_LineMode /* + DEFVAR_INT ("canna-mode-line-mode", &Vcanna_mode_LineMode /* */ ); - canna_mode_LineMode = IROHA_MODE_LineMode; - DEFVAR_INT ("canna-mode-changing-server-mode", - &canna_mode_ChangingServerMode /* + &Vcanna_mode_ChangingServerMode /* */ ); - canna_mode_ChangingServerMode = IROHA_MODE_ChangingServerMode; - DEFVAR_INT ("canna-mode-henkan-method-mode", - &canna_mode_HenkanMethodMode /* + &Vcanna_mode_HenkanMethodMode /* */ ); - canna_mode_HenkanMethodMode = IROHA_MODE_HenkanMethodMode; - - DEFVAR_INT ("canna-mode-delete-dic-mode", &canna_mode_DeleteDicMode /* + DEFVAR_INT ("canna-mode-delete-dic-mode", &Vcanna_mode_DeleteDicMode /* */ ); - canna_mode_DeleteDicMode = IROHA_MODE_DeleteDicMode; - - DEFVAR_INT ("canna-mode-touroku-mode", &canna_mode_TourokuMode /* + DEFVAR_INT ("canna-mode-touroku-mode", &Vcanna_mode_TourokuMode /* */ ); - canna_mode_TourokuMode = IROHA_MODE_TourokuMode; - DEFVAR_INT ("canna-mode-touroku-empty-mode", - &canna_mode_TourokuEmptyMode /* + &Vcanna_mode_TourokuEmptyMode /* */ ); - canna_mode_TourokuEmptyMode = IROHA_MODE_TourokuEmptyMode; - DEFVAR_INT ("canna-mode-touroku-hinshi-mode", - &canna_mode_TourokuHinshiMode /* + &Vcanna_mode_TourokuHinshiMode /* */ ); - canna_mode_TourokuHinshiMode = IROHA_MODE_TourokuHinshiMode; - - DEFVAR_INT ("canna-mode-touroku-dic-mode", &canna_mode_TourokuDicMode /* + DEFVAR_INT ("canna-mode-touroku-dic-mode", &Vcanna_mode_TourokuDicMode /* */ ); - canna_mode_TourokuDicMode = IROHA_MODE_TourokuDicMode; - DEFVAR_INT ("canna-mode-quoted-insert-mode", - &canna_mode_QuotedInsertMode /* + &Vcanna_mode_QuotedInsertMode /* */ ); - canna_mode_QuotedInsertMode = IROHA_MODE_QuotedInsertMode; - DEFVAR_INT ("canna-mode-bubun-muhenkan-mode", - &canna_mode_BubunMuhenkanMode /* + &Vcanna_mode_BubunMuhenkanMode /* */ ); - canna_mode_BubunMuhenkanMode = IROHA_MODE_BubunMuhenkanMode; - - DEFVAR_INT ("canna-mode-mount-dic-mode", &canna_mode_MountDicMode /* + DEFVAR_INT ("canna-mode-mount-dic-mode", &Vcanna_mode_MountDicMode /* */ ); - canna_mode_MountDicMode = IROHA_MODE_MountDicMode; - DEFVAR_INT ("canna-func-self-insert", &canna_fn_SelfInsert /* + DEFVAR_INT ("canna-func-self-insert", &Vcanna_fn_SelfInsert /* */ ); - canna_fn_SelfInsert = IROHA_FN_SelfInsert; - - DEFVAR_INT ("canna-func-functional-insert", &canna_fn_FunctionalInsert /* + DEFVAR_INT ("canna-func-functional-insert", &Vcanna_fn_FunctionalInsert /* */ ); - canna_fn_FunctionalInsert = IROHA_FN_FunctionalInsert; - - DEFVAR_INT ("canna-func-quoted-insert", &canna_fn_QuotedInsert /* + DEFVAR_INT ("canna-func-quoted-insert", &Vcanna_fn_QuotedInsert /* */ ); - canna_fn_QuotedInsert = IROHA_FN_QuotedInsert; - - DEFVAR_INT ("canna-func-japanese-mode", &canna_fn_JapaneseMode /* + DEFVAR_INT ("canna-func-japanese-mode", &Vcanna_fn_JapaneseMode /* */ ); - canna_fn_JapaneseMode = IROHA_FN_JapaneseMode; - - DEFVAR_INT ("canna-func-alpha-mode", &canna_fn_AlphaMode /* + DEFVAR_INT ("canna-func-alpha-mode", &Vcanna_fn_AlphaMode /* */ ); - canna_fn_AlphaMode = IROHA_FN_AlphaMode; - DEFVAR_INT ("canna-func-henkan-nyuryoku-mode", - &canna_fn_HenkanNyuryokuMode /* + &Vcanna_fn_HenkanNyuryokuMode /* */ ); - canna_fn_HenkanNyuryokuMode = IROHA_FN_HenkanNyuryokuMode; - - DEFVAR_INT ("canna-func-forward", &canna_fn_Forward /* + DEFVAR_INT ("canna-func-forward", &Vcanna_fn_Forward /* */ ); - canna_fn_Forward = IROHA_FN_Forward; - - DEFVAR_INT ("canna-func-backward", &canna_fn_Backward /* + DEFVAR_INT ("canna-func-backward", &Vcanna_fn_Backward /* */ ); - canna_fn_Backward = IROHA_FN_Backward; - - DEFVAR_INT ("canna-func-next", &canna_fn_Next /* + DEFVAR_INT ("canna-func-next", &Vcanna_fn_Next /* */ ); - canna_fn_Next = IROHA_FN_Next; - - DEFVAR_INT ("canna-func-previous", &canna_fn_Prev /* + DEFVAR_INT ("canna-func-previous", &Vcanna_fn_Prev /* */ ); - canna_fn_Prev = IROHA_FN_Prev; - - DEFVAR_INT ("canna-func-beginning-of-line", &canna_fn_BeginningOfLine /* + DEFVAR_INT ("canna-func-beginning-of-line", &Vcanna_fn_BeginningOfLine /* */ ); - canna_fn_BeginningOfLine = IROHA_FN_BeginningOfLine; - - DEFVAR_INT ("canna-func-end-of-line", &canna_fn_EndOfLine /* + DEFVAR_INT ("canna-func-end-of-line", &Vcanna_fn_EndOfLine /* */ ); - canna_fn_EndOfLine = IROHA_FN_EndOfLine; - - DEFVAR_INT ("canna-func-delete-next", &canna_fn_DeleteNext /* + DEFVAR_INT ("canna-func-delete-next", &Vcanna_fn_DeleteNext /* */ ); - canna_fn_DeleteNext = IROHA_FN_DeleteNext; - - DEFVAR_INT ("canna-func-delete-previous", &canna_fn_DeletePrevious /* + DEFVAR_INT ("canna-func-delete_previous", &Vcanna_fn_DeletePrevious /* */ ); - canna_fn_DeletePrevious = IROHA_FN_DeletePrevious; - - DEFVAR_INT ("canna-func-kill-to-end-of-line", &canna_fn_KillToEndOfLine /* + DEFVAR_INT ("canna-func-kill-to-end-of-line", &Vcanna_fn_KillToEndOfLine /* */ ); - canna_fn_KillToEndOfLine = IROHA_FN_KillToEndOfLine; - - DEFVAR_INT ("canna-func-henkan", &canna_fn_Henkan /* + DEFVAR_INT ("canna-func-henkan", &Vcanna_fn_Henkan /* */ ); - canna_fn_Henkan = IROHA_FN_Henkan; - - DEFVAR_INT ("canna-func-kakutei", &canna_fn_Kakutei /* + DEFVAR_INT ("canna-func-kakutei", &Vcanna_fn_Kakutei /* */ ); - canna_fn_Kakutei = IROHA_FN_Kakutei; - - DEFVAR_INT ("canna-func-extend", &canna_fn_Extend /* + DEFVAR_INT ("canna-func-extend", &Vcanna_fn_Extend /* */ ); - canna_fn_Extend = IROHA_FN_Extend; - - DEFVAR_INT ("canna-func-shrink", &canna_fn_Shrink /* + DEFVAR_INT ("canna-func-shrink", &Vcanna_fn_Shrink /* */ ); - canna_fn_Shrink = IROHA_FN_Shrink; - #ifdef CANNA_FN_AdjustBunsetsu - DEFVAR_INT ("canna-func-adjust-bunsetsu", &canna_fn_AdjustBunsetsu /* + DEFVAR_INT ("canna-func-adjust-bunsetsu", &Vcanna_fn_AdjustBunsetsu /* */ ); - canna_fn_AdjustBunsetsu = CANNA_FN_AdjustBunsetsu; #endif - DEFVAR_INT ("canna-func-quit", &canna_fn_Quit /* + DEFVAR_INT ("canna-func-quit", &Vcanna_fn_Quit /* */ ); - canna_fn_Quit = IROHA_FN_Quit; - - DEFVAR_INT ("canna-func-convert-as-hex", &canna_fn_ConvertAsHex /* + DEFVAR_INT ("canna-func-convert-as-hex", &Vcanna_fn_ConvertAsHex /* */ ); - canna_fn_ConvertAsHex = IROHA_FN_ConvertAsHex; - - DEFVAR_INT ("canna-func-convert-as-bushu", &canna_fn_ConvertAsBushu /* + DEFVAR_INT ("canna-func-convert-as-bushu", &Vcanna_fn_ConvertAsBushu /* */ ); - canna_fn_ConvertAsBushu = IROHA_FN_ConvertAsBushu; - - DEFVAR_INT ("canna-func-kouho-ichiran", &canna_fn_KouhoIchiran /* + DEFVAR_INT ("canna-func-kouho-ichiran", &Vcanna_fn_KouhoIchiran /* */ ); - canna_fn_KouhoIchiran = IROHA_FN_KouhoIchiran; - - DEFVAR_INT ("canna-func-bubun-muhenkan", &canna_fn_BubunMuhenkan /* + DEFVAR_INT ("canna-func-bubun-muhenkan", &Vcanna_fn_BubunMuhenkan /* */ ); - canna_fn_BubunMuhenkan = IROHA_FN_BubunMuhenkan; - - DEFVAR_INT ("canna-func-zenkaku", &canna_fn_Zenkaku /* + DEFVAR_INT ("canna-func-zenkaku", &Vcanna_fn_Zenkaku /* */ ); - canna_fn_Zenkaku = IROHA_FN_Zenkaku; - - DEFVAR_INT ("canna-func-hankaku", &canna_fn_Hankaku /* + DEFVAR_INT ("canna-func-hankaku", &Vcanna_fn_Hankaku /* */ ); - canna_fn_Hankaku = IROHA_FN_Hankaku; - - DEFVAR_INT ("canna-func-to-upper", &canna_fn_ToUpper /* + DEFVAR_INT ("canna-func-to-upper", &Vcanna_fn_ToUpper /* */ ); - canna_fn_ToUpper = IROHA_FN_ToUpper; - - DEFVAR_INT ("canna-func-capitalize", &canna_fn_Capitalize /* + DEFVAR_INT ("canna-func-capitalize", &Vcanna_fn_Capitalize /* */ ); - canna_fn_Capitalize = IROHA_FN_Capitalize; - - DEFVAR_INT ("canna-func-to-lower", &canna_fn_ToLower /* + DEFVAR_INT ("canna-func-to-lower", &Vcanna_fn_ToLower /* */ ); - canna_fn_ToLower = IROHA_FN_ToLower; - - DEFVAR_INT ("canna-func-hiragana", &canna_fn_Hiragana /* + DEFVAR_INT ("canna-func-hiragana", &Vcanna_fn_Hiragana /* */ ); - canna_fn_Hiragana = IROHA_FN_Hiragana; - - DEFVAR_INT ("canna-func-katakana", &canna_fn_Katakana /* + DEFVAR_INT ("canna-func-katakana", &Vcanna_fn_Katakana /* */ ); - canna_fn_Katakana = IROHA_FN_Katakana; - - DEFVAR_INT ("canna-func-romaji", &canna_fn_Romaji /* + DEFVAR_INT ("canna-func-romaji", &Vcanna_fn_Romaji /* */ ); - canna_fn_Romaji = IROHA_FN_Romaji; - #ifdef CANNA_FN_BaseHiragana - DEFVAR_INT ("canna-func-base-hiragana", &canna_fn_BaseHiragana /* + DEFVAR_INT ("canna-func-base-hiragana", &Vcanna_fn_BaseHiragana /* */ ); - canna_fn_BaseHiragana = CANNA_FN_BaseHiragana; - - DEFVAR_INT ("canna-func-base-katakana", &canna_fn_BaseKatakana /* + DEFVAR_INT ("canna-func-base-katakana", &Vcanna_fn_BaseKatakana /* */ ); - canna_fn_BaseKatakana = CANNA_FN_BaseKatakana; - - DEFVAR_INT ("canna-func-base-eisu", &canna_fn_BaseEisu /* + DEFVAR_INT ("canna-func-base-eisu", &Vcanna_fn_BaseEisu /* */ ); - canna_fn_BaseEisu = CANNA_FN_BaseEisu; - - DEFVAR_INT ("canna-func-base-zenkaku", &canna_fn_BaseZenkaku /* + DEFVAR_INT ("canna-func-base-zenkaku", &Vcanna_fn_BaseZenkaku /* */ ); - canna_fn_BaseZenkaku = CANNA_FN_BaseZenkaku; - - DEFVAR_INT ("canna-func-base-hankaku", &canna_fn_BaseHankaku /* + DEFVAR_INT ("canna-func-base-hankaku", &Vcanna_fn_BaseHankaku /* */ ); - canna_fn_BaseHankaku = CANNA_FN_BaseHankaku; - - DEFVAR_INT ("canna-func-base-kana", &canna_fn_BaseKana /* + DEFVAR_INT ("canna-func-base-kana", &Vcanna_fn_BaseKana /* */ ); - canna_fn_BaseKana = CANNA_FN_BaseKana; - - DEFVAR_INT ("canna-func-base-kakutei", &canna_fn_BaseKakutei /* + DEFVAR_INT ("canna-func-base-kakutei", &Vcanna_fn_BaseKakutei /* */ ); - canna_fn_BaseKakutei = CANNA_FN_BaseKakutei; - - DEFVAR_INT ("canna-func-base-henkan", &canna_fn_BaseHenkan /* + DEFVAR_INT ("canna-func-base-henkan", &Vcanna_fn_BaseHenkan /* */ ); - canna_fn_BaseHenkan = CANNA_FN_BaseHenkan; - DEFVAR_INT ("canna-func-base-hiragana-katakana-toggle", - &canna_fn_BaseHiraKataToggle /* + &Vcanna_fn_BaseHiraKataToggle /* */ ); - canna_fn_BaseHiraKataToggle = CANNA_FN_BaseHiraKataToggle; - DEFVAR_INT ("canna-func-base-zenkaku-hankaku-toggle", - &canna_fn_BaseZenHanToggle /* + &Vcanna_fn_BaseZenHanToggle /* */ ); - canna_fn_BaseZenHanToggle = CANNA_FN_BaseZenHanToggle; - DEFVAR_INT ("canna-func-base-kana-eisu-toggle", - &canna_fn_BaseKanaEisuToggle /* + &Vcanna_fn_BaseKanaEisuToggle /* */ ); - canna_fn_BaseKanaEisuToggle = CANNA_FN_BaseKanaEisuToggle; - DEFVAR_INT ("canna-func-base-kakutei-henkan-toggle", - &canna_fn_BaseKakuteiHenkanToggle /* + &Vcanna_fn_BaseKakuteiHenkanToggle /* */ ); - canna_fn_BaseKakuteiHenkanToggle = CANNA_FN_BaseKakuteiHenkanToggle; - DEFVAR_INT ("canna-func-base-rotate-forward", - &canna_fn_BaseRotateForward /* + &Vcanna_fn_BaseRotateForward /* */ ); - canna_fn_BaseRotateForward = CANNA_FN_BaseRotateForward; - DEFVAR_INT ("canna-func-base-rotate-backward", - &canna_fn_BaseRotateBackward /* + &Vcanna_fn_BaseRotateBackward /* */ ); - canna_fn_BaseRotateBackward = CANNA_FN_BaseRotateBackward; - #endif - DEFVAR_INT ("canna-func-extend-mode", &canna_fn_ExtendMode /* + DEFVAR_INT ("canna-func-extend-mode", &Vcanna_fn_ExtendMode /* */ ); - canna_fn_ExtendMode = IROHA_FN_ExtendMode; - - DEFVAR_INT ("canna-func-touroku", &canna_fn_Touroku /* + DEFVAR_INT ("canna-func-touroku", &Vcanna_fn_Touroku /* */ ); - canna_fn_Touroku = IROHA_FN_Touroku; - - DEFVAR_INT ("canna-func-hex-mode", &canna_fn_HexMode /* + DEFVAR_INT ("canna-func-hex-mode", &Vcanna_fn_HexMode /* */ ); - canna_fn_HexMode = IROHA_FN_HexMode; - - DEFVAR_INT ("canna-func-bushu-mode", &canna_fn_BushuMode /* + DEFVAR_INT ("canna-func-bushu-mode", &Vcanna_fn_BushuMode /* */ ); - canna_fn_BushuMode = IROHA_FN_BushuMode; - - DEFVAR_INT ("canna-func-kigo-mode", &canna_fn_KigouMode /* + DEFVAR_INT ("canna-func-kigo-mode", &Vcanna_fn_KigouMode /* */ ); - canna_fn_KigouMode = IROHA_FN_KigouMode; - #ifdef CANNA_FN_Mark - DEFVAR_INT ("canna-func-mark", &canna_fn_Mark /* + DEFVAR_INT ("canna-func-mark", &Vcanna_fn_Mark /* */ ); - canna_fn_Mark = CANNA_FN_Mark; #endif #ifdef CANNA_FN_TemporalMode - DEFVAR_INT ("canna-func-temporal-mode", &canna_fn_TemporalMode /* + DEFVAR_INT ("canna-func-temporal-mode", &Vcanna_fn_TemporalMode /* */ ); - canna_fn_TemporalMode = CANNA_FN_TemporalMode; #endif - DEFVAR_INT ("canna-key-nfer", &canna_key_Nfer /* + DEFVAR_INT ("canna-key-nfer", &Vcanna_key_Nfer /* */ ); - canna_key_Nfer = IROHA_KEY_Nfer; - - DEFVAR_INT ("canna-key-xfer", &canna_key_Xfer /* + DEFVAR_INT ("canna-key-xfer", &Vcanna_key_Xfer /* */ ); - canna_key_Xfer = IROHA_KEY_Xfer; - - DEFVAR_INT ("canna-key-up", &canna_key_Up /* + DEFVAR_INT ("canna-key-up", &Vcanna_key_Up /* */ ); - canna_key_Up = IROHA_KEY_Up; - - DEFVAR_INT ("canna-key-left", &canna_key_Left /* + DEFVAR_INT ("canna-key-left", &Vcanna_key_Left /* */ ); - canna_key_Left = IROHA_KEY_Left; - - DEFVAR_INT ("canna-key-right", &canna_key_Right /* + DEFVAR_INT ("canna-key-right", &Vcanna_key_Right /* */ ); - canna_key_Right = IROHA_KEY_Right; - - DEFVAR_INT ("canna-key-down", &canna_key_Down /* + DEFVAR_INT ("canna-key-down", &Vcanna_key_Down /* */ ); - canna_key_Down = IROHA_KEY_Down; - - DEFVAR_INT ("canna-key-insert", &canna_key_Insert /* + DEFVAR_INT ("canna-key-insert", &Vcanna_key_Insert /* */ ); - canna_key_Insert = IROHA_KEY_Insert; - - DEFVAR_INT ("canna-key-rollup", &canna_key_Rollup /* + DEFVAR_INT ("canna-key-rollup", &Vcanna_key_Rollup /* */ ); - canna_key_Rollup = IROHA_KEY_Rollup; - - DEFVAR_INT ("canna-key-rolldown", &canna_key_Rolldown /* + DEFVAR_INT ("canna-key-rolldown", &Vcanna_key_Rolldown /* */ ); - canna_key_Rolldown = IROHA_KEY_Rolldown; - - DEFVAR_INT ("canna-key-home", &canna_key_Home /* + DEFVAR_INT ("canna-key-home", &Vcanna_key_Home /* */ ); - canna_key_Home = IROHA_KEY_Home; - - DEFVAR_INT ("canna-key-help", &canna_key_Help /* + DEFVAR_INT ("canna-key-help", &Vcanna_key_Help /* */ ); - canna_key_Help = IROHA_KEY_Help; - - DEFVAR_INT ("canna-key-kp-key", &canna_key_KP_Key /* + DEFVAR_INT ("canna-key-kp-key", &Vcanna_key_KP_Key /* */ ); - canna_key_KP_Key = IROHA_KEY_KP_Key; - - DEFVAR_INT ("canna-key-shift-nfer", &canna_key_Shift_Nfer /* + DEFVAR_INT ("canna-key-shift-nfer", &Vcanna_key_Shift_Nfer /* */ ); - canna_key_Shift_Nfer = IROHA_KEY_Shift_Nfer; - - DEFVAR_INT ("canna-key-shift-xfer", &canna_key_Shift_Xfer /* + DEFVAR_INT ("canna-key-shift-xfer", &Vcanna_key_Shift_Xfer /* */ ); - canna_key_Shift_Xfer = IROHA_KEY_Shift_Xfer; - - DEFVAR_INT ("canna-key-shift-up", &canna_key_Shift_Up /* + DEFVAR_INT ("canna-key-shift-up", &Vcanna_key_Shift_Up /* */ ); - canna_key_Shift_Up = IROHA_KEY_Shift_Up; - - DEFVAR_INT ("canna-key-shift-left", &canna_key_Shift_Left /* + DEFVAR_INT ("canna-key-shift-left", &Vcanna_key_Shift_Left /* */ ); - canna_key_Shift_Left = IROHA_KEY_Shift_Left; - - DEFVAR_INT ("canna-key-shift-right", &canna_key_Shift_Right /* + DEFVAR_INT ("canna-key-shift-right", &Vcanna_key_Shift_Right /* */ ); - canna_key_Shift_Right = IROHA_KEY_Shift_Right; - - DEFVAR_INT ("canna-key-shift-down", &canna_key_Shift_Down /* + DEFVAR_INT ("canna-key-shift-down", &Vcanna_key_Shift_Down /* */ ); - canna_key_Shift_Down = IROHA_KEY_Shift_Down; - - DEFVAR_INT ("canna-key-control-nfer", &canna_key_Cntrl_Nfer /* + DEFVAR_INT ("canna-key-control-nfer", &Vcanna_key_Cntrl_Nfer /* */ ); - canna_key_Cntrl_Nfer = IROHA_KEY_Cntrl_Nfer; - - DEFVAR_INT ("canna-key-control-xfer", &canna_key_Cntrl_Xfer /* + DEFVAR_INT ("canna-key-control-xfer", &Vcanna_key_Cntrl_Xfer /* */ ); - canna_key_Cntrl_Xfer = IROHA_KEY_Cntrl_Xfer; - - DEFVAR_INT ("canna-key-control-up", &canna_key_Cntrl_Up /* + DEFVAR_INT ("canna-key-control-up", &Vcanna_key_Cntrl_Up /* */ ); - canna_key_Cntrl_Up = IROHA_KEY_Cntrl_Up; - - DEFVAR_INT ("canna-key-control-left", &canna_key_Cntrl_Left /* + DEFVAR_INT ("canna-key-control-left", &Vcanna_key_Cntrl_Left /* */ ); - canna_key_Cntrl_Left = IROHA_KEY_Cntrl_Left; - - DEFVAR_INT ("canna-key-control-right", &canna_key_Cntrl_Right /* + DEFVAR_INT ("canna-key-control-right", &Vcanna_key_Cntrl_Right /* */ ); - canna_key_Cntrl_Right = IROHA_KEY_Cntrl_Right; - - DEFVAR_INT ("canna-key-control-down", &canna_key_Cntrl_Down /* + DEFVAR_INT ("canna-key-control-down", &Vcanna_key_Cntrl_Down /* */ ); - canna_key_Cntrl_Down = IROHA_KEY_Cntrl_Down; Fprovide(intern("CANNA")); } @@ -1792,10 +1521,10 @@ For canna /* 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)) { if ((unsigned char) ch == ISO_CODE_SS2) @@ -1824,8 +1553,8 @@ c2mu (unsigned char *cp, int l, unsigned char *mp) static void m2c (unsigned char *mp, int l, unsigned char *cp) { - unsigned char ch, *ep = mp + l; - + unsigned char ch, *ep = mp + l;; + while ((mp < ep) && (ch = *mp++)) { switch (ch) @@ -1844,7 +1573,7 @@ m2c (unsigned char *mp, int l, unsigned char *cp) *cp++ = ch; break; } - } + } *cp = 0; } @@ -1855,10 +1584,10 @@ static Lisp_Object mule_make_string (unsigned char *p, int l) { unsigned char cbuf[4096]; - + c2mu (p,l,cbuf); return (make_string (cbuf,strlen (cbuf))); -} +} /* return the MULE internal string length of EUC string */ /* Modified by sb to return a character count not byte count. */ @@ -1867,7 +1596,7 @@ mule_strlen (unsigned char *p, int l) { unsigned char ch, *cp = p; int len = 0; - + while ((cp < p + l) && (ch = *cp)) { if ((unsigned char) ch == ISO_CODE_SS2) @@ -1888,7 +1617,7 @@ mule_strlen (unsigned char *p, int l) else { len++; - cp++; + cp++; } } return (len); @@ -1896,11 +1625,11 @@ mule_strlen (unsigned char *p, int l) /* count number of characters */ static void -count_char (unsigned char *p, int len, int pos, int rev, - Fixnum *clen, Fixnum *cpos, Fixnum *crev) +count_char (unsigned char *p, int len, int pos, int rev, int *clen, int *cpos, + int *crev) { unsigned char *q = p; - + *clen = *cpos = *crev = 0; if (len == 0) return; while (q < p + pos) @@ -1914,7 +1643,7 @@ count_char (unsigned char *p, int len, int pos, int rev, (*clen)++; (*crev)++; if (*q++ & 0x80) q++; - } + } while (q < p + len) { (*clen)++; diff --git a/src/mule-ccl.c b/src/mule-ccl.c index 947d64b..6bf60e9 100644 --- a/src/mule-ccl.c +++ b/src/mule-ccl.c @@ -2,7 +2,7 @@ Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. -This file is part of GNU Emacs. +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 @@ -19,16 +19,11 @@ along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Synched up with : FSF Emacs 21.0.90 except TranslateCharacter */ - -#ifdef emacs -#include <config.h> -#endif - -#include <stdio.h> +/* Synched up with : FSF Emacs 20.2 */ #ifdef emacs +#include <config.h> #include "lisp.h" #include "buffer.h" #include "mule-charset.h" @@ -37,34 +32,15 @@ Boston, MA 02111-1307, USA. */ #else /* not emacs */ +#include <stdio.h> #include "mulelib.h" #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 associates 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_program_table. */ -Lisp_Object Qccl_program_idx; - -/* Table of registered CCL programs. Each element is a vector of - NAME, CCL_PROG, and RESOLVEDP where NAME (symbol) is the name of - the program, CCL_PROG (vector) is the compiled code of the program, - RESOLVEDP (t or nil) is the flag to tell if symbols in CCL_PROG is - already resolved to index numbers or not. */ +/* Vector of CCL program names vs corresponding program data. */ Lisp_Object Vccl_program_table; /* CCL (Code Conversion Language) is a simple language which has @@ -295,16 +271,10 @@ Lisp_Object Vccl_program_table; write (reg[RRR] OPERATION reg[Rrr]); */ -#define CCL_Call 0x13 /* Call the CCL program whose ID is - CC..C or cc..c. - 1:CCCCCCCCCCCCCCCCCCCCFFFXXXXX - [2:00000000cccccccccccccccccccc] +#define CCL_Call 0x13 /* Write a constant: + 1:CCCCCCCCCCCCCCCCCCCC000XXXXX ------------------------------ - if (FFF) - call (cc..c) - IC++; - else - call (CC..C) + call (CC..C) */ #define CCL_WriteConstString 0x14 /* Write a constant or a string: @@ -423,232 +393,14 @@ Lisp_Object Vccl_program_table; IC += 2; */ -#define CCL_Extension 0x1F /* Extended CCL code +#define CCL_Extention 0x1F /* Extended CCL code 1:ExtendedCOMMNDRrrRRRrrrXXXXX - 2:ARGUMENT + 2:ARGUEMENT 3:... ------------------------------ 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 */ - -/* 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 described 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 code 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?. When the mapping - process reached to the end of the map set, it moves to the next - map set. If the next does not exit, the mapping process terminates, - and regard the last value as a result. - - But, when VALm is mapped to VALn and VALn is not a number, the - mapping proceeds as follows: - - If VALn is nil, the lastest map is ignored and the mapping of VALm - proceeds to the next map. - - In VALn is t, VALm is reverted to reg[rrr] and the mapping of VALm - proceeds to the next map. - - If VALn is lambda, move to the next map set like reaching to the - end of the current map set. - - If VALn is a symbol, call the CCL program refered by it. - Then, use reg[rrr] as a mapped value except for -1, -2 and -3. - Such special values are regarded as nil, t, and lambda respectively. - - 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 30 - -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; - -/* If this variable is non-zero, it indicates the stack_idx - of immediately called by CCL_MapMultiple. */ -static int stack_idx_of_map_multiple; - -#define PUSH_MAPPING_STACK(restlen, orig) \ - do { \ - mapping_stack_pointer->rest_length = (restlen); \ - mapping_stack_pointer->orig_val = (orig); \ - mapping_stack_pointer++; \ - } while (0) - -#define POP_MAPPING_STACK(restlen, orig) \ - do { \ - mapping_stack_pointer--; \ - (restlen) = mapping_stack_pointer->rest_length; \ - (orig) = mapping_stack_pointer->orig_val; \ - } while (0) - -#define CCL_CALL_FOR_MAP_INSTRUCTION(symbol, ret_ic) \ - do { \ - struct ccl_program called_ccl; \ - if (stack_idx >= 256 \ - || (setup_ccl_program (&called_ccl, (symbol)) != 0)) \ - { \ - if (stack_idx > 0) \ - { \ - ccl_prog = ccl_prog_stack_struct[0].ccl_prog; \ - ic = ccl_prog_stack_struct[0].ic; \ - } \ - CCL_INVALID_CMD; \ - } \ - ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog; \ - ccl_prog_stack_struct[stack_idx].ic = (ret_ic); \ - stack_idx++; \ - ccl_prog = called_ccl.prog; \ - ic = CCL_HEADER_MAIN; \ - /* The "if (1)" prevents warning \ - "end-of loop code not reached" */ \ - if (1) goto ccl_repeat; \ - } while (0) - -#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 */ @@ -671,203 +423,84 @@ static int stack_idx_of_map_multiple; #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)) - r[7] = LOWER_BYTE (DE-SJIS (Y, Z)) */ -#define CCL_ENCODE_SJIS 0x17 /* X = HIGHER_BYTE (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)) */ -/* Terminate CCL program successfully. */ -#define CCL_SUCCESS \ - do { \ - ccl->status = CCL_STAT_SUCCESS; \ - /* The "if (1)" inhibits the warning \ - "end-of loop code not reached" */ \ - if (1) goto ccl_finish; \ - } while (0) - -/* 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. */ -#define CCL_SUSPEND(stat) \ - do { \ - ic--; \ - ccl->status = (stat); \ - /* The "if (1)" inhibits the warning \ - "end-of loop code not reached" */ \ - if (1) goto ccl_finish; \ - } while (0) - -/* Terminate CCL program because of invalid command. Should not occur - in the normal case. */ -#define CCL_INVALID_CMD \ - do { \ - ccl->status = CCL_STAT_INVALID_CMD; \ - /* The "if (1)" inhibits the warning \ - "end-of loop code not reached" */ \ - 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. At encoding time, if CH is less than 256, CH is - written as is. At decoding time, if CH cannot be regarded as an - ASCII character, write it in multibyte form. */ -#define CCL_WRITE_CHAR(ch) \ - do { \ - if (!destination) \ - CCL_INVALID_CMD; \ - if (conversion_mode == CCL_MODE_ENCODING) \ - { \ - if ((ch) == '\n') \ - { \ - if (ccl->eol_type == CCL_CODING_EOL_CRLF) \ - { \ - Dynarr_add (destination, '\r'); \ - Dynarr_add (destination, '\n'); \ - } \ - else if (ccl->eol_type == CCL_CODING_EOL_CR) \ - Dynarr_add (destination, '\r'); \ - else \ - Dynarr_add (destination, '\n'); \ - } \ - else if ((ch) < 0x100) \ - { \ - Dynarr_add (destination, ch); \ - } \ - else \ - { \ - Bufbyte work[MAX_EMCHAR_LEN]; \ - int len; \ - len = non_ascii_set_charptr_emchar (work, ch); \ - Dynarr_add_many (destination, work, len); \ - } \ - } \ - else \ - { \ - if (!CHAR_MULTIBYTE_P(ch)) \ - { \ - Dynarr_add (destination, ch); \ - } \ - else \ - { \ - Bufbyte work[MAX_EMCHAR_LEN]; \ - int len; \ - len = non_ascii_set_charptr_emchar (work, ch); \ - Dynarr_add_many (destination, work, len); \ - } \ - } \ - } while (0) + output buffer. If CH is less than 256, CH is written as is. */ +#define CCL_WRITE_CHAR(ch) do { \ + if (!destination) \ + { \ + ccl->status = CCL_STAT_INVALID_CMD; \ + goto ccl_error_handler; \ + } \ + else \ + { \ + Bufbyte work[MAX_EMCHAR_LEN]; \ + int len = ( ch < 256 ) ? \ + simple_set_charptr_emchar (work, ch) : \ + non_ascii_set_charptr_emchar (work, ch); \ + Dynarr_add_many (destination, work, len); \ + } \ +} while (0) /* Write a string at ccl_prog[IC] of length LEN to the current output - buffer. But this macro treat this string as a binary. Therefore, - cannot handle a multibyte string except for Control-1 characters. */ -#define CCL_WRITE_STRING(len) \ - do { \ - Bufbyte work[MAX_EMCHAR_LEN]; \ - int ch, bytes; \ - if (!destination) \ - CCL_INVALID_CMD; \ - else if (conversion_mode == CCL_MODE_ENCODING) \ - { \ - for (i = 0; i < (len); i++) \ - { \ - ch = ((XINT (ccl_prog[ic + (i / 3)])) \ - >> ((2 - (i % 3)) * 8)) & 0xFF; \ - if (ch == '\n') \ - { \ - if (ccl->eol_type == CCL_CODING_EOL_CRLF) \ - { \ - Dynarr_add (destination, '\r'); \ - Dynarr_add (destination, '\n'); \ - } \ - else if (ccl->eol_type == CCL_CODING_EOL_CR) \ - Dynarr_add (destination, '\r'); \ - else \ - Dynarr_add (destination, '\n'); \ - } \ - if (ch < 0x100) \ - { \ - Dynarr_add (destination, ch); \ - } \ - else \ - { \ - bytes = non_ascii_set_charptr_emchar (work, ch); \ - Dynarr_add_many (destination, work, len); \ - } \ - } \ - } \ - else \ - { \ - for (i = 0; i < (len); i++) \ - { \ - ch = ((XINT (ccl_prog[ic + (i / 3)])) \ - >> ((2 - (i % 3)) * 8)) & 0xFF; \ - if (!CHAR_MULTIBYTE_P(ch)) \ - { \ - Dynarr_add (destination, ch); \ - } \ - else \ - { \ - bytes = non_ascii_set_charptr_emchar (work, ch); \ - Dynarr_add_many (destination, work, len); \ - } \ - } \ - } \ - } while (0) + buffer. */ +#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_INVALID_CMD; \ - if (src < src_end) \ - (r) = *src++; \ - else \ - { \ - if (ccl->last_block) \ - { \ - ic = ccl->eof_ic; \ - goto ccl_repeat; \ - } \ - else \ - CCL_SUSPEND (CCL_STAT_SUSPEND_BY_SRC); \ - } \ - } while (0) - - -/* Set C to the character code made from CHARSET and CODE. This is - like MAKE_CHAR but check the validity of CHARSET and CODE. If they - are not valid, set C to (CODE & 0xFF) because that is usually the - case that CCL_ReadMultibyteChar2 read an invalid code and it set - CODE to that invalid byte. */ - -/* On XEmacs, TranslateCharacter is not supported. Thus, this - macro is not used. */ -#if 0 -#define CCL_MAKE_CHAR(charset, code, c) \ - do { \ - if ((charset) == CHARSET_ASCII) \ - (c) = (code) & 0xFF; \ - else if (CHARSET_DEFINED_P (charset) \ - && ((code) & 0x7F) >= 32 \ - && ((code) < 256 || ((code >> 7) & 0x7F) >= 32)) \ - { \ - int c1 = (code) & 0x7F, c2 = 0; \ - \ - if ((code) >= 256) \ - c2 = c1, c1 = ((code) >> 7) & 0x7F; \ - (c) = MAKE_CHAR (charset, c1, c2); \ - } \ - else \ - (c) = (code) & 0xFF; \ - } while (0) -#endif +#define CCL_READ_CHAR(r) do { \ + if (!src) \ + { \ + ccl->status = CCL_STAT_INVALID_CMD; \ + goto ccl_error_handler; \ + } \ + else if (src < src_end) \ + r = *src++; \ + else if (ccl->last_block) \ + { \ + ic = ccl->eof_ic; \ + goto ccl_finish; \ + } \ + else \ + /* 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. */ \ + { \ + ic--; \ + ccl->status = CCL_STAT_SUSPEND; \ + goto ccl_finish; \ + } \ +} while (0) /* Execute CCL code on SRC_BYTES length text at SOURCE. The resulting - text goes to a place pointed by DESTINATION, the length of which - should not exceed DST_BYTES. The bytes actually processed is - returned as *CONSUMED. The return value is the length of the - resulting text. As a side effect, the contents of CCL registers + text goes to a place pointed by DESTINATION. The bytes actually + processed is returned as *CONSUMED. The return value is the length + of the resulting text. As a side effect, the contents of CCL registers are updated. If SOURCE or DESTINATION is NULL, only operations on registers are permitted. */ @@ -883,45 +516,31 @@ struct ccl_prog_stack 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) { - register int *reg = ccl->reg; - register int ic = ccl->ic; - register int code = -1; - register int field1, field2; - register Lisp_Object *ccl_prog = ccl->prog; - const unsigned char *src = source, *src_end = src + src_bytes; - int jump_address; + 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; + 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 (ccl->buf_magnification ==0) /* We can't produce any bytes. */ - destination = NULL; - - /* Set mapping stack pointer. */ - mapping_stack_pointer = mapping_stack; - #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) @@ -940,7 +559,6 @@ ccl_driver (struct ccl_program *ccl, break; } - this_ic = ic; code = XINT (ccl_prog[ic]); ic++; field1 = code >> 8; field2 = (code & 0xFF) >> 5; @@ -949,7 +567,6 @@ ccl_driver (struct ccl_program *ccl, #define RRR (field1 & 7) #define Rrr ((field1 >> 3) & 7) #define ADDR field1 -#define EXCMD (field1 >> 6) switch (code & 0x1F) { @@ -1062,7 +679,7 @@ ccl_driver (struct ccl_program *ccl, i = reg[RRR]; j = XINT (ccl_prog[ic]); op = field1 >> 6; - jump_address = ic + 1; + ic++; goto ccl_set_expr; case CCL_WriteRegister: /* CCCCCCCCCCCCCCCCCCCrrrXXXXX */ @@ -1082,43 +699,32 @@ ccl_driver (struct ccl_program *ccl, i = reg[RRR]; j = reg[Rrr]; op = field1 >> 6; - jump_address = ic; goto ccl_set_expr; - case CCL_Call: /* 1:CCCCCCCCCCCCCCCCCCCCFFFXXXXX */ + case CCL_Call: /* CCCCCCCCCCCCCCCCCCCC000XXXXX */ { Lisp_Object slot; - int prog_id; - - /* If FFF is nonzero, the CCL program ID is in the - following code. */ - if (rrr) - { - prog_id = XINT (ccl_prog[ic]); - ic++; - } - else - prog_id = field1; if (stack_idx >= 256 - || prog_id < 0 - || prog_id >= XVECTOR (Vccl_program_table)->size - || (slot = XVECTOR (Vccl_program_table)->contents[prog_id], - !VECTORP (slot)) - || !VECTORP (XVECTOR (slot)->contents[1])) + || field1 < 0 + || field1 >= XVECTOR_LENGTH (Vccl_program_table) + || (slot = XVECTOR_DATA (Vccl_program_table)[field1], + !CONSP (slot)) + || !VECTORP (XCDR (slot))) { if (stack_idx > 0) { ccl_prog = ccl_prog_stack_struct[0].ccl_prog; ic = ccl_prog_stack_struct[0].ic; } - CCL_INVALID_CMD; + ccl->status = CCL_STAT_INVALID_CMD; + goto ccl_error_handler; } ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog; ccl_prog_stack_struct[stack_idx].ic = ic; stack_idx++; - ccl_prog = XVECTOR (XVECTOR (slot)->contents[1])->contents; + ccl_prog = XVECTOR_DATA (XCDR (slot)); ic = CCL_HEADER_MAIN; } break; @@ -1144,19 +750,16 @@ ccl_driver (struct ccl_program *ccl, break; case CCL_End: /* 0000000000000000000000XXXXX */ - if (stack_idx > 0) + if (stack_idx-- > 0) { - stack_idx--; ccl_prog = ccl_prog_stack_struct[stack_idx].ccl_prog; 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--; - CCL_SUCCESS; + /* Terminate CCL program successfully. */ + ccl->status = CCL_STAT_SUCCESS; + ccl->ic = CCL_HEADER_MAIN; + goto ccl_finish; case CCL_ExprSelfConst: /* 00000OPERATION000000rrrXXXXX */ i = XINT (ccl_prog[ic]); @@ -1190,7 +793,9 @@ ccl_driver (struct ccl_program *ccl, case CCL_LE: reg[rrr] = reg[rrr] <= i; break; case CCL_GE: reg[rrr] = reg[rrr] >= i; break; case CCL_NE: reg[rrr] = reg[rrr] != i; break; - default: CCL_INVALID_CMD; + default: + ccl->status = CCL_STAT_INVALID_CMD; + goto ccl_error_handler; } break; @@ -1251,507 +856,25 @@ ccl_driver (struct ccl_program *ccl, 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_DECODE_SJIS: - /* DECODE_SJIS set MSB for internal format - as opposed to Emacs. */ - DECODE_SJIS (i, j, reg[rrr], reg[7]); - reg[rrr] &= 0x7F; - reg[7] &= 0x7F; - break; - case CCL_ENCODE_SJIS: - /* ENCODE_SJIS assumes MSB of SJIS-char is set - as opposed to Emacs. */ - ENCODE_SJIS (i | 0x80, j | 0x80, reg[rrr], reg[7]); - break; - default: CCL_INVALID_CMD; + 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; + default: + ccl->status = CCL_STAT_INVALID_CMD; + goto ccl_error_handler; } code &= 0x1F; if (code == CCL_WriteExprConst || code == CCL_WriteExprRegister) { i = reg[rrr]; CCL_WRITE_CHAR (i); - ic = jump_address; } else if (!reg[rrr]) ic = jump_address; break; - case CCL_Extension: - switch (EXCMD) - { - case CCL_ReadMultibyteChar2: - if (!src) - CCL_INVALID_CMD; - - if (src >= src_end) - { - src++; - goto ccl_read_multibyte_character_suspend; - } - - i = *src++; - 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; - - 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; - else if (XCHARSET_DIMENSION (CHARSET_BY_LEADING_BYTE (i)) == 1) - i = (((i - FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7) - | (reg[rrr] & 0x7F)); - else if (i < MAX_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; - - case CCL_TranslateCharacter: -#if 0 - /* XEmacs does not have translate_char, and its - equivalent nor. We do nothing on this operation. */ - CCL_MAKE_CHAR (reg[RRR], reg[rrr], i); - 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; -#endif - break; - - case CCL_TranslateCharacterConstTbl: -#if 0 - /* XEmacs does not have translate_char, and its - equivalent nor. We do nothing on this operation. */ - op = XINT (ccl_prog[ic]); /* table */ - ic++; - CCL_MAKE_CHAR (reg[RRR], reg[rrr], i); - 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; -#endif - 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 validity. */ - if (!CONSP (map)) continue; - map = XCDR (map); - 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 (INTP (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 (INTP (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 = XCAR (content); - value = XCDR (content); - if (!INTP (attrib) || !INTP (value)) - continue; - reg[RRR] = i; - reg[rrr] = XUINT (value); - break; - } - else if (SYMBOLP (content)) - CCL_CALL_FOR_MAP_INSTRUCTION (content, fin_ic); - else - CCL_INVALID_CMD; - } - 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; - int current_ic = this_ic; - - /* inhibit recursive call on MapMultiple. */ - if (stack_idx_of_map_multiple > 0) - { - if (stack_idx_of_map_multiple <= stack_idx) - { - stack_idx_of_map_multiple = 0; - mapping_stack_pointer = mapping_stack; - CCL_INVALID_CMD; - } - } - else - mapping_stack_pointer = mapping_stack; - stack_idx_of_map_multiple = 0; - - map_set_rest_length = - XINT (ccl_prog[ic++]); /* number of maps and separators. */ - fin_ic = ic + map_set_rest_length; - op = reg[rrr]; - - 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; - mapping_stack_pointer = mapping_stack; - break; - } - - if (mapping_stack_pointer <= (mapping_stack + 1)) - { - /* Set up initial state. */ - mapping_stack_pointer = mapping_stack; - PUSH_MAPPING_STACK (0, op); - reg[RRR] = -1; - } - else - { - /* Recover after calling other ccl program. */ - int orig_op; - - POP_MAPPING_STACK (map_set_rest_length, orig_op); - POP_MAPPING_STACK (map_set_rest_length, reg[rrr]); - switch (op) - { - case -1: - /* Regard it as Qnil. */ - op = orig_op; - i++; - ic++; - map_set_rest_length--; - break; - case -2: - /* Regard it as Qt. */ - op = reg[rrr]; - i++; - ic++; - map_set_rest_length--; - break; - case -3: - /* Regard it as Qlambda. */ - op = orig_op; - i += map_set_rest_length; - ic += map_set_rest_length; - map_set_rest_length = 0; - break; - default: - /* Regard it as normal mapping. */ - i += map_set_rest_length; - ic += map_set_rest_length; - POP_MAPPING_STACK (map_set_rest_length, reg[rrr]); - break; - } - } - map_vector_size = XVECTOR (Vcode_conversion_map_vector)->size; - - do { - for (;map_set_rest_length > 0;i++, ic++, map_set_rest_length--) - { - point = XINT(ccl_prog[ic]); - if (point < 0) - { - /* +1 is for including separator. */ - point = -point + 1; - if (mapping_stack_pointer - >= mapping_stack + countof (mapping_stack)) - CCL_INVALID_CMD; - PUSH_MAPPING_STACK (map_set_rest_length - point, - reg[rrr]); - map_set_rest_length = point; - reg[rrr] = op; - continue; - } - - if (point >= map_vector_size) continue; - map = (XVECTOR (Vcode_conversion_map_vector) - ->contents[point]); - - /* Check map validity. */ - if (!CONSP (map)) continue; - map = XCDR (map); - 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 (INTP (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; - - reg[RRR] = i; - if (INTP (content)) - { - op = XINT (content); - i += map_set_rest_length - 1; - ic += map_set_rest_length - 1; - POP_MAPPING_STACK (map_set_rest_length, reg[rrr]); - map_set_rest_length++; - } - else if (CONSP (content)) - { - attrib = XCAR (content); - value = XCDR (content); - if (!INTP (attrib) || !INTP (value)) - continue; - op = XUINT (value); - i += map_set_rest_length - 1; - ic += map_set_rest_length - 1; - POP_MAPPING_STACK (map_set_rest_length, reg[rrr]); - map_set_rest_length++; - } - else if (EQ (content, Qt)) - { - op = reg[rrr]; - } - else if (EQ (content, Qlambda)) - { - i += map_set_rest_length; - ic += map_set_rest_length; - break; - } - else if (SYMBOLP (content)) - { - if (mapping_stack_pointer - >= mapping_stack + countof (mapping_stack)) - CCL_INVALID_CMD; - PUSH_MAPPING_STACK (map_set_rest_length, reg[rrr]); - PUSH_MAPPING_STACK (map_set_rest_length, op); - stack_idx_of_map_multiple = stack_idx + 1; - CCL_CALL_FOR_MAP_INSTRUCTION (content, current_ic); - } - else - CCL_INVALID_CMD; - } - if (mapping_stack_pointer <= (mapping_stack + 1)) - break; - POP_MAPPING_STACK (map_set_rest_length, reg[rrr]); - i += map_set_rest_length; - ic += map_set_rest_length; - POP_MAPPING_STACK (map_set_rest_length, reg[rrr]); - } while (1); - - 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 = XCDR (map); - 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 - { - reg[RRR] = 0; - content = XVECTOR (map)->contents[point]; - if (NILP (content)) - reg[RRR] = -1; - else if (INTP (content)) - reg[rrr] = XINT (content); - else if (EQ (content, Qt)); - else if (CONSP (content)) - { - attrib = XCAR (content); - value = XCDR (content); - if (!INTP (attrib) || !INTP (value)) - continue; - reg[rrr] = XUINT(value); - break; - } - else if (SYMBOLP (content)) - CCL_CALL_FOR_MAP_INSTRUCTION (content, ic); - else - reg[RRR] = -1; - } - } - break; - - default: - CCL_INVALID_CMD; - } - break; - default: - CCL_INVALID_CMD; + ccl->status = CCL_STAT_INVALID_CMD; + goto ccl_error_handler; } } @@ -1765,9 +888,11 @@ ccl_driver (struct ccl_program *ccl, 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; @@ -1783,13 +908,12 @@ ccl_driver (struct ccl_program *ccl, 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: Exited."); + sprintf(msg, "\nCCL: Quited."); break; default: @@ -1801,264 +925,100 @@ ccl_driver (struct ccl_program *ccl, ccl_finish: ccl->ic = ic; - ccl->stack_idx = stack_idx; - ccl->prog = ccl_prog; if (consumed) *consumed = src - source; - if (!destination) + if (destination) + return Dynarr_length (destination); + else return 0; - return Dynarr_length (destination); -} - -/* Resolve symbols in the specified CCL code (Lisp vector). This - function converts symbols of code conversion maps and character - translation tables embedded in the CCL code into their ID numbers. - - The return value is a vector (CCL itself or a new vector in which - all symbols are resolved), Qt if resolving of some symbol failed, - or nil if CCL contains invalid data. */ - -static Lisp_Object -resolve_symbol_ccl_program (Lisp_Object ccl) -{ - int i, veclen, unresolved = 0; - Lisp_Object result, contents, val; - - result = ccl; - veclen = XVECTOR (result)->size; - - for (i = 0; i < veclen; i++) - { - contents = XVECTOR (result)->contents[i]; - if (INTP (contents)) - continue; - else if (CONSP (contents) - && SYMBOLP (XCAR (contents)) - && SYMBOLP (XCDR (contents))) - { - /* This is the new style for embedding symbols. The form is - (SYMBOL . PROPERTY). (get SYMBOL PROPERTY) should give - an index number. */ - - if (EQ (result, ccl)) - result = Fcopy_sequence (ccl); - - val = Fget (XCAR (contents), XCDR (contents), Qnil); - if (NATNUMP (val)) - XVECTOR (result)->contents[i] = val; - else - unresolved = 1; - continue; - } - else if (SYMBOLP (contents)) - { - /* This is the old style for embedding symbols. This style - may lead to a bug if, for instance, a translation table - and a code conversion map have the same name. */ - if (EQ (result, ccl)) - result = Fcopy_sequence (ccl); - - val = Fget (contents, Qcode_conversion_map_id, Qnil); - if (NATNUMP (val)) - XVECTOR (result)->contents[i] = val; - else - { - val = Fget (contents, Qccl_program_idx, Qnil); - if (NATNUMP (val)) - XVECTOR (result)->contents[i] = val; - else - unresolved = 1; - } - continue; - } - return Qnil; - } - - return (unresolved ? Qt : result); -} - -/* Return the compiled code (vector) of CCL program CCL_PROG. - CCL_PROG is a name (symbol) of the program or already compiled - code. If necessary, resolve symbols in the compiled code to index - numbers. If we failed to get the compiled code or to resolve - symbols, return Qnil. */ - -static Lisp_Object -ccl_get_compiled_code (Lisp_Object ccl_prog) -{ - Lisp_Object val, slot; - - if (VECTORP (ccl_prog)) - { - val = resolve_symbol_ccl_program (ccl_prog); - return (VECTORP (val) ? val : Qnil); - } - if (!SYMBOLP (ccl_prog)) - return Qnil; - - val = Fget (ccl_prog, Qccl_program_idx, Qnil); - if (! NATNUMP (val) - || XINT (val) >= XVECTOR_LENGTH (Vccl_program_table)) - return Qnil; - slot = XVECTOR_DATA (Vccl_program_table)[XINT (val)]; - if (! VECTORP (slot) - || XVECTOR (slot)->size != 3 - || ! VECTORP (XVECTOR_DATA (slot)[1])) - return Qnil; - if (NILP (XVECTOR_DATA (slot)[2])) - { - val = resolve_symbol_ccl_program (XVECTOR_DATA (slot)[1]); - if (! VECTORP (val)) - return Qnil; - XVECTOR_DATA (slot)[1] = val; - XVECTOR_DATA (slot)[2] = Qt; - } - return XVECTOR_DATA (slot)[1]; } /* Setup fields of the structure pointed by CCL appropriately for the - execution of CCL program CCL_PROG. CCL_PROG is the name (symbol) - of the CCL program or the already compiled code (vector). - Return 0 if we succeed this setup, else return -1. - - If CCL_PROG is nil, we just reset the structure pointed by CCL. */ -int -setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog) + execution of compiled CCL code in VEC (vector of integer). */ +void +setup_ccl_program (struct ccl_program *ccl, Lisp_Object vec) { int i; - if (! NILP (ccl_prog)) - { - ccl_prog = ccl_get_compiled_code (ccl_prog); - if (! VECTORP (ccl_prog)) - return -1; - ccl->size = XVECTOR_LENGTH (ccl_prog); - ccl->prog = XVECTOR_DATA (ccl_prog); - ccl->eof_ic = XINT (XVECTOR_DATA (ccl_prog)[CCL_HEADER_EOF]); - ccl->buf_magnification = XINT (XVECTOR_DATA (ccl_prog)[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; - ccl->eol_type = CCL_CODING_EOL_LF; - return 0; } #ifdef emacs -DEFUN ("ccl-program-p", Fccl_program_p, 1, 1, 0, /* -Return t if OBJECT is a CCL program name or a compiled CCL program code. -See the documentation of `define-ccl-program' for the detail of CCL program. -*/ - (object)) -{ - Lisp_Object val; - - if (VECTORP (object)) - { - val = resolve_symbol_ccl_program (object); - return (VECTORP (val) ? Qt : Qnil); - } - if (!SYMBOLP (object)) - return Qnil; - - val = Fget (object, Qccl_program_idx, Qnil); - return ((! NATNUMP (val) - || XINT (val) >= XVECTOR_LENGTH (Vccl_program_table)) - ? Qnil : Qt); -} - DEFUN ("ccl-execute", Fccl_execute, 2, 2, 0, /* Execute CCL-PROGRAM with registers initialized by REGISTERS. - -CCL-PROGRAM is a CCL program name (symbol) -or a compiled code generated by `ccl-compile' (for backward compatibility, -in this case, the overhead of the execution is bigger than the former case). -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 REGISTERS holds the value of +As side effect, each element of REGISTER holds the value of corresponding register after the execution. - -See the documentation of `define-ccl-program' for the detail of CCL program. */ - (ccl_prog, reg)) + (ccl_prog, reg)) { struct ccl_program ccl; int i; - if (setup_ccl_program (&ccl, ccl_prog) < 0) - error ("Invalid CCL program"); - + CHECK_VECTOR (ccl_prog); CHECK_VECTOR (reg); if (XVECTOR_LENGTH (reg) != 8) - error ("Length of vector REGISTERS is not 8"); + signal_simple_error ("Vector should be of length 8", reg); + setup_ccl_program (&ccl, ccl_prog); for (i = 0; i < 8; i++) ccl.reg[i] = (INTP (XVECTOR_DATA (reg)[i]) ? 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); for (i = 0; i < 8; i++) - XSETINT (XVECTOR (reg)->contents[i], ccl.reg[i]); + XSETINT (XVECTOR_DATA (reg)[i], ccl.reg[i]); return Qnil; } -DEFUN ("ccl-execute-on-string", Fccl_execute_on_string, - 3, 4, 0, /* +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. - 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 exhausted, else, IC is always set to the end of +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. - -See the documentation of `define-ccl-program' for the detail of CCL program. */ - (ccl_prog, status, string, continue_)) + (ccl_prog, status, str, contin)) { Lisp_Object val; struct ccl_program ccl; int i, produced; unsigned_char_dynarr *outbuf; - struct gcpro gcpro1, gcpro2; - - if (setup_ccl_program (&ccl, ccl_prog) < 0) - error ("Invalid CCL program"); + struct gcpro gcpro1, gcpro2, gcpro3; + CHECK_VECTOR (ccl_prog); CHECK_VECTOR (status); - if (XVECTOR (status)->size != 9) - error ("Length of vector STATUS is not 9"); - CHECK_STRING (string); - - GCPRO2 (status, string); + if (XVECTOR_LENGTH (status) != 9) + signal_simple_error ("Vector should be of length 9", status); + CHECK_STRING (str); + GCPRO3 (ccl_prog, status, str); + setup_ccl_program (&ccl, ccl_prog); for (i = 0; i < 8; i++) { if (NILP (XVECTOR_DATA (status)[i])) @@ -2066,191 +1026,80 @@ See the documentation of `define-ccl-program' for the detail of CCL program. if (INTP (XVECTOR_DATA (status)[i])) ccl.reg[i] = XINT (XVECTOR_DATA (status)[i]); } - if (INTP (XVECTOR (status)->contents[i])) + if (INTP (XVECTOR_DATA (status)[8])) { i = XINT (XVECTOR_DATA (status)[8]); if (ccl.ic < i && i < ccl.size) ccl.ic = i; } outbuf = Dynarr_new (unsigned_char); - ccl.last_block = NILP (continue_); - produced = ccl_driver (&ccl, XSTRING_DATA (string), outbuf, - XSTRING_LENGTH (string), - (int *) 0, - CCL_MODE_DECODING); + ccl.last_block = NILP (contin); + produced = ccl_driver (&ccl, XSTRING_DATA (str), outbuf, + XSTRING_LENGTH (str), (int *)0); for (i = 0; i < 8; i++) - XSETINT (XVECTOR_DATA (status)[i], ccl.reg[i]); + XVECTOR_DATA (status)[i] = make_int(ccl.reg[i]); XSETINT (XVECTOR_DATA (status)[8], ccl.ic); UNGCPRO; val = make_string (Dynarr_atp (outbuf, 0), produced); Dynarr_free (outbuf); QUIT; - if (ccl.status == CCL_STAT_SUSPEND_BY_DST) - error ("Output buffer for the CCL programs overflow"); if (ccl.status != CCL_STAT_SUCCESS - && ccl.status != CCL_STAT_SUSPEND_BY_SRC) + && ccl.status != CCL_STAT_SUSPEND) error ("Error in CCL program at %dth code", ccl.ic); return val; } -DEFUN ("register-ccl-program", Fregister_ccl_program, - 2, 2, 0, /* -Register CCL program CCL-PROG as NAME in `ccl-program-table'. -CCL-PROG should be a compiled CCL program (vector), or nil. -If it is nil, just reserve NAME as a CCL program name. +DEFUN ("register-ccl-program", Fregister_ccl_program, 2, 2, 0, /* +Register CCL program PROGRAM of NAME in `ccl-program-table'. +PROGRAM should be a compiled code of CCL program, or nil. Return index number of the registered CCL program. */ - (name, ccl_prog)) + (name, ccl_prog)) { int len = XVECTOR_LENGTH (Vccl_program_table); - int idx; - Lisp_Object resolved; + int i; CHECK_SYMBOL (name); - resolved = Qnil; if (!NILP (ccl_prog)) - { - CHECK_VECTOR (ccl_prog); - resolved = resolve_symbol_ccl_program (ccl_prog); - if (! NILP (resolved)) - { - ccl_prog = resolved; - resolved = Qt; - } - } - - for (idx = 0; idx < len; idx++) - { - Lisp_Object slot; - - slot = XVECTOR_DATA (Vccl_program_table)[idx]; - if (!VECTORP (slot)) - /* This is the first unused slot. Register NAME here. */ - break; - - if (EQ (name, XVECTOR_DATA (slot)[0])) - { - /* Update this slot. */ - XVECTOR_DATA (slot)[1] = ccl_prog; - XVECTOR_DATA (slot)[2] = resolved; - return make_int (idx); - } - } - - if (idx == len) - { - /* Extend the table. */ - Lisp_Object new_table; - int j; - - new_table = Fmake_vector (make_int (len * 2), Qnil); - for (j = 0; j < len; j++) - XVECTOR_DATA (new_table)[j] - = XVECTOR_DATA (Vccl_program_table)[j]; - Vccl_program_table = new_table; - } - - { - Lisp_Object elt; - - elt = Fmake_vector (make_int (3), Qnil); - XVECTOR_DATA (elt)[0] = name; - XVECTOR_DATA (elt)[1] = ccl_prog; - XVECTOR_DATA (elt)[2] = resolved; - XVECTOR_DATA (Vccl_program_table)[idx] = elt; - } - - Fput (name, Qccl_program_idx, make_int (idx)); - return make_int (idx); -} - -/* 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 means to terminate mapping here. -*/ - -DEFUN ("register-code-conversion-map", Fregister_code_conversion_map, - 2, 2, 0, /* -Register SYMBOL as code conversion map MAP. -Return index number of the registered map. -*/ - (symbol, map)) -{ - int len = XVECTOR_LENGTH (Vcode_conversion_map_vector); - int i; - Lisp_Object idx; - - CHECK_SYMBOL (symbol); - CHECK_VECTOR (map); + CHECK_VECTOR (ccl_prog); for (i = 0; i < len; i++) { - Lisp_Object slot = XVECTOR_DATA (Vcode_conversion_map_vector)[i]; + Lisp_Object slot = XVECTOR_DATA (Vccl_program_table)[i]; if (!CONSP (slot)) break; - if (EQ (symbol, XCAR (slot))) + if (EQ (name, XCAR (slot))) { - idx = make_int (i); - XCDR (slot) = map; - Fput (symbol, Qcode_conversion_map, map); - Fput (symbol, Qcode_conversion_map_id, idx); - return idx; + XCDR (slot) = ccl_prog; + return make_int (i); } } if (i == len) { - Lisp_Object new_vector = Fmake_vector (make_int (len * 2), Qnil); + Lisp_Object new_table = Fmake_vector (make_int (len * 2), Qnil); int j; for (j = 0; j < len; j++) - XVECTOR_DATA (new_vector)[j] - = XVECTOR_DATA (Vcode_conversion_map_vector)[j]; - Vcode_conversion_map_vector = new_vector; + XVECTOR_DATA (new_table)[j] + = XVECTOR_DATA (Vccl_program_table)[j]; + Vccl_program_table = new_table; } - idx = make_int (i); - Fput (symbol, Qcode_conversion_map, map); - Fput (symbol, Qcode_conversion_map_id, idx); - XVECTOR_DATA (Vcode_conversion_map_vector)[i] = Fcons (symbol, map); - return idx; + XVECTOR_DATA (Vccl_program_table)[i] = Fcons (name, ccl_prog); + return make_int (i); } - void syms_of_mule_ccl (void) { - DEFSUBR (Fccl_program_p); - DEFSUBR (Fccl_execute); - DEFSUBR (Fccl_execute_on_string); - DEFSUBR (Fregister_ccl_program); - DEFSUBR (Fregister_code_conversion_map); -} - -void -vars_of_mule_ccl (void) -{ staticpro (&Vccl_program_table); Vccl_program_table = Fmake_vector (make_int (32), Qnil); - defsymbol (&Qccl_program, "ccl-program"); - defsymbol (&Qccl_program_idx, "ccl-program-idx"); - defsymbol (&Qcode_conversion_map, "code-conversion-map"); - defsymbol (&Qcode_conversion_map_id, "code-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); - 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), @@ -2264,6 +1113,10 @@ The code point in the font is set in CCL registers R1 and R2 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 --git a/src/mule-charset.c b/src/mule-charset.c index 8c5b697..eb86610 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -19,7 +19,7 @@ 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 20.3. Not in FSF. */ +/* Synched up with: Mule 2.3. Not in FSF. */ /* Rewritten by Ben Wing <ben@xemacs.org>. */ @@ -32,7 +32,6 @@ Boston, MA 02111-1307, USA. */ #include "lstream.h" #include "device.h" #include "faces.h" -#include "mule-ccl.h" /* The various pre-defined charsets. */ @@ -42,49 +41,39 @@ Lisp_Object Vcharset_latin_iso8859_1; Lisp_Object Vcharset_latin_iso8859_2; Lisp_Object Vcharset_latin_iso8859_3; Lisp_Object Vcharset_latin_iso8859_4; -Lisp_Object Vcharset_thai_tis620; -Lisp_Object Vcharset_greek_iso8859_7; +Lisp_Object Vcharset_cyrillic_iso8859_5; Lisp_Object Vcharset_arabic_iso8859_6; +Lisp_Object Vcharset_greek_iso8859_7; Lisp_Object Vcharset_hebrew_iso8859_8; +Lisp_Object Vcharset_latin_iso8859_9; +Lisp_Object Vcharset_thai_tis620; Lisp_Object Vcharset_katakana_jisx0201; Lisp_Object Vcharset_latin_jisx0201; -Lisp_Object Vcharset_cyrillic_iso8859_5; -Lisp_Object Vcharset_latin_iso8859_9; Lisp_Object Vcharset_japanese_jisx0208_1978; -Lisp_Object Vcharset_chinese_gb2312; Lisp_Object Vcharset_japanese_jisx0208; -Lisp_Object Vcharset_korean_ksc5601; Lisp_Object Vcharset_japanese_jisx0212; -Lisp_Object Vcharset_chinese_cns11643_1; -Lisp_Object Vcharset_chinese_cns11643_2; +Lisp_Object Vcharset_chinese_gb2312; Lisp_Object Vcharset_chinese_big5_1; Lisp_Object Vcharset_chinese_big5_2; - -#ifdef ENABLE_COMPOSITE_CHARS +Lisp_Object Vcharset_chinese_cns11643_1; +Lisp_Object Vcharset_chinese_cns11643_2; +Lisp_Object Vcharset_korean_ksc5601; Lisp_Object Vcharset_composite; -/* Hash tables for composite chars. One maps string representing +/* Hashtables for composite chars. One maps string representing composed chars to their equivalent chars; one goes the other way. */ -Lisp_Object Vcomposite_char_char2string_hash_table; -Lisp_Object Vcomposite_char_string2char_hash_table; - -static int composite_char_row_next; -static int composite_char_col_next; - -#endif /* ENABLE_COMPOSITE_CHARS */ +Lisp_Object Vcomposite_char_char2string_hashtable; +Lisp_Object Vcomposite_char_string2char_hashtable; -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 } -}; +/* Table of charsets indexed by type/final-byte/direction. */ +Lisp_Object charset_by_attributes[4][128][2]; -static const struct struct_description charset_lookup_description = { - sizeof (struct charset_lookup), - charset_lookup_description_1 -}; +static int composite_char_row_next; +static int composite_char_col_next; /* Table of number of bytes in the string representation of a character indexed by the first byte of that representation. @@ -92,9 +81,9 @@ static const struct struct_description charset_lookup_description = { 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,37 +107,39 @@ Lisp_Object Qcharsetp; Lisp_Object Qregistry, Qfinal, Qgraphic; Lisp_Object Qdirection; Lisp_Object Qreverse_direction_charset; -Lisp_Object Qleading_byte; -Lisp_Object Qshort_name, Qlong_name; +Lisp_Object Qccl_program; + +Lisp_Object Qascii, Qcontrol_1, -Lisp_Object Qascii, - Qcontrol_1, Qlatin_iso8859_1, Qlatin_iso8859_2, Qlatin_iso8859_3, Qlatin_iso8859_4, - Qthai_tis620, - Qgreek_iso8859_7, + Qcyrillic_iso8859_5, Qarabic_iso8859_6, + Qgreek_iso8859_7, Qhebrew_iso8859_8, - Qkatakana_jisx0201, - Qlatin_jisx0201, - Qcyrillic_iso8859_5, Qlatin_iso8859_9, + + Qthai_tis620, + + Qkatakana_jisx0201, Qlatin_jisx0201, Qjapanese_jisx0208_1978, - Qchinese_gb2312, Qjapanese_jisx0208, - Qkorean_ksc5601, Qjapanese_jisx0212, - Qchinese_cns11643_1, - Qchinese_cns11643_2, - Qchinese_big5_1, - Qchinese_big5_2, - Qcomposite; + + Qchinese_gb2312, + Qchinese_big5_1, Qchinese_big5_2, + Qchinese_cns11643_1, Qchinese_cns11643_2, + + Qkorean_ksc5601, Qcomposite; Lisp_Object Ql2r, Qr2l; -Lisp_Object Vcharset_hash_table; +Lisp_Object Vcharset_hashtable; + +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 +208,7 @@ non_ascii_set_charptr_emchar (Bufbyte *str, Emchar c) 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 +255,7 @@ non_ascii_valid_char_p (Emchar ch) 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 +264,6 @@ non_ascii_valid_char_p (Emchar ch) 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 @@ -289,19 +277,16 @@ non_ascii_valid_char_p (Emchar ch) if (f2 < 0x20 || f3 < 0x20) return 0; -#ifdef ENABLE_COMPOSITE_CHARS if (f1 + FIELD1_TO_OFFICIAL_LEADING_BYTE == LEADING_BYTE_COMPOSITE) { if (UNBOUNDP (Fgethash (make_int (ch), - Vcomposite_char_char2string_hash_table, + Vcomposite_char_char2string_hashtable, Qunbound))) return 0; return 1; } -#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 +296,6 @@ non_ascii_valid_char_p (Emchar ch) charset = CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_PRIVATE_LEADING_BYTE); - if (EQ (charset, Qnil)) - return 0; return (XCHARSET_CHARS (charset) == 96); } } @@ -322,18 +305,26 @@ non_ascii_valid_char_p (Emchar ch) /* Basic string functions */ /************************************************************************/ -/* Copy the character pointed to by SRC into DST. Do not call this - directly. Use the macro charptr_copy_char() instead. - Return the number of bytes copied. */ +/* Copy the character pointed to by PTR into STR, assuming it's + non-ASCII. Do not call this directly. Use the macro + charptr_copy_char() instead. */ Bytecount -non_ascii_charptr_copy_char (const Bufbyte *src, Bufbyte *dst) +non_ascii_charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *str) { - unsigned int bytes = REP_BYTES_BY_FIRST_BYTE (*src); - unsigned int i; - for (i = bytes; i; i--, dst++, src++) - *dst = *src; - return bytes; + Bufbyte *strptr = str; + *strptr = *ptr++; + switch (REP_BYTES_BY_FIRST_BYTE (*strptr)) + { + /* Notice fallthrough. */ + case 4: *++strptr = *ptr++; + case 3: *++strptr = *ptr++; + case 2: *++strptr = *ptr; + break; + default: + abort (); + } + return strptr + 1 - str; } @@ -350,15 +341,26 @@ Lstream_get_emchar_1 (Lstream *stream, int ch) { Bufbyte str[MAX_EMCHAR_LEN]; Bufbyte *strptr = str; - unsigned int bytes; str[0] = (Bufbyte) ch; - - for (bytes = REP_BYTES_BY_FIRST_BYTE (ch) - 1; bytes; bytes--) + switch (REP_BYTES_BY_FIRST_BYTE (ch)) { - int c = Lstream_getc (stream); - bufpos_checking_assert (c >= 0); - *++strptr = (Bufbyte) c; + /* Notice fallthrough. */ + case 4: + ch = Lstream_getc (stream); + assert (ch >= 0); + *++strptr = (Bufbyte) ch; + case 3: + ch = Lstream_getc (stream); + assert (ch >= 0); + *++strptr = (Bufbyte) ch; + case 2: + ch = Lstream_getc (stream); + assert (ch >= 0); + *++strptr = (Bufbyte) ch; + break; + default: + abort (); } return charptr_emchar (str); } @@ -385,22 +387,20 @@ Lstream_funget_emchar (Lstream *stream, Emchar ch) /************************************************************************/ 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->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) @@ -411,10 +411,6 @@ print_charset (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) write_c_string ("#<charset ", printcharfun); print_internal (CHARSET_NAME (cs), printcharfun, 0); write_c_string (" ", printcharfun); - print_internal (CHARSET_SHORT_NAME (cs), printcharfun, 1); - write_c_string (" ", printcharfun); - print_internal (CHARSET_LONG_NAME (cs), printcharfun, 1); - write_c_string (" ", printcharfun); print_internal (CHARSET_DOC_STRING (cs), printcharfun, 1); sprintf (buf, " %s %s cols=%d g%d final='%c' reg=", CHARSET_TYPE (cs) == CHARSET_TYPE_94 ? "94" : @@ -431,41 +427,25 @@ print_charset (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 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. */ -/* #### SJT Should generic properties be allowed? */ + static Lisp_Object -make_charset (int id, Lisp_Object name, unsigned char rep_bytes, +make_charset (int id, Lisp_Object name, Bufbyte leading_byte, unsigned char rep_bytes, unsigned char type, unsigned char columns, unsigned char graphic, - Bufbyte final, unsigned char direction, Lisp_Object short_name, - Lisp_Object long_name, Lisp_Object doc, + Bufbyte final, unsigned char direction, Lisp_Object doc, 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; CHARSET_NAME (cs) = name; - CHARSET_SHORT_NAME (cs) = short_name; - CHARSET_LONG_NAME (cs) = long_name; + CHARSET_LEADING_BYTE (cs) = leading_byte; CHARSET_REP_BYTES (cs) = rep_bytes; CHARSET_DIRECTION (cs) = direction; CHARSET_TYPE (cs) = type; @@ -481,23 +461,26 @@ make_charset (int id, Lisp_Object name, unsigned char rep_bytes, CHARSET_TYPE (cs) == CHARSET_TYPE_96) ? 1 : 2; CHARSET_CHARS (cs) = (CHARSET_TYPE (cs) == CHARSET_TYPE_94 || CHARSET_TYPE (cs) == CHARSET_TYPE_94X94) ? 94 : 96; - + if (final) { /* 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[leading_byte - 128])); + charset_by_leading_byte[leading_byte - 128] = obj; + if (leading_byte < 0xA0) + /* official leading byte */ + rep_bytes_by_first_byte[leading_byte] = rep_bytes; /* Some charsets are "faux" and don't have names or really exist at all except in the leading-byte table. */ if (!NILP (name)) - Fputhash (name, obj, Vcharset_hash_table); + Fputhash (name, obj, Vcharset_hashtable); return obj; } @@ -508,17 +491,17 @@ get_unallocated_leading_byte (int dimension) 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) @@ -554,7 +537,7 @@ nil is returned. Otherwise the associated charset object is returned. return charset_or_name; CHECK_SYMBOL (charset_or_name); - return Fgethash (charset_or_name, Vcharset_hash_table, Qnil); + return Fgethash (charset_or_name, Vcharset_hashtable, Qnil); } DEFUN ("get-charset", Fget_charset, 1, 1, 0, /* @@ -580,15 +563,19 @@ struct charset_list_closure }; static int -add_charset_to_list_mapper (Lisp_Object key, Lisp_Object value, +add_charset_to_list_mapper (CONST void *hash_key, void *hash_contents, void *charset_list_closure) { /* This function can GC */ + Lisp_Object key, contents; + Lisp_Object *charset_list; struct charset_list_closure *chcl = (struct charset_list_closure*) charset_list_closure; - Lisp_Object *charset_list = chcl->charset_list; + CVOID_TO_LISP (key, hash_key); + VOID_TO_LISP (contents, hash_contents); + charset_list = chcl->charset_list; - *charset_list = Fcons (XCHARSET_NAME (value), *charset_list); + *charset_list = Fcons (XCHARSET_NAME (contents), *charset_list); return 0; } @@ -603,7 +590,7 @@ Return a list of the names of all defined charsets. GCPRO1 (charset_list); charset_list_closure.charset_list = &charset_list; - elisp_maphash (add_charset_to_list_mapper, Vcharset_hash_table, + elisp_maphash (add_charset_to_list_mapper, Vcharset_hashtable, &charset_list_closure); UNGCPRO; @@ -611,14 +598,13 @@ Return a list of the names of all defined charsets. } DEFUN ("charset-name", Fcharset_name, 1, 1, 0, /* -Return the name of charset CHARSET. +Return the name of the given charset. */ (charset)) { return XCHARSET_NAME (Fget_charset (charset)); } -/* #### SJT Should generic properties be allowed? */ DEFUN ("make-charset", Fmake_charset, 3, 3, 0, /* Define a new character set. This function is for use with Mule support. @@ -627,8 +613,6 @@ DOC-STRING is a string describing the character set. PROPS is a property list, describing the specific nature of the character set. Recognized properties are: -'short-name Short version of the charset name (ex: Latin-1) -'long-name Long version of the charset name (ex: ISO8859-1 (Latin-1)) 'registry A regular expression matching the font registry field for this character set. 'dimension Number of octets used to index a character in this charset. @@ -668,13 +652,13 @@ character set. Recognized properties are: */ (name, doc_string, props)) { - int id, dimension = 1, chars = 94, graphic = 0, final = 0, columns = -1; + int lb, dimension = 1, chars = 94, graphic = 0, final = 0, columns = -1; int direction = CHARSET_LEFT_TO_RIGHT; int type; Lisp_Object registry = Qnil; Lisp_Object charset; + Lisp_Object rest, keyword, value; Lisp_Object ccl_program = Qnil; - Lisp_Object short_name = Qnil, long_name = Qnil; CHECK_SYMBOL (name); if (!NILP (doc_string)) @@ -684,90 +668,73 @@ character set. Recognized properties are: if (!NILP (charset)) signal_simple_error ("Cannot redefine existing charset", name); - { - EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, props) - { - if (EQ (keyword, Qshort_name)) - { - CHECK_STRING (value); - short_name = value; - } - - else if (EQ (keyword, Qlong_name)) - { - CHECK_STRING (value); - long_name = value; - } - - else if (EQ (keyword, Qdimension)) - { - CHECK_INT (value); - dimension = XINT (value); - if (dimension < 1 || dimension > 2) - signal_simple_error ("Invalid value for 'dimension", value); - } - - else if (EQ (keyword, Qchars)) - { - CHECK_INT (value); - chars = XINT (value); - if (chars != 94 && chars != 96) - signal_simple_error ("Invalid value for 'chars", value); - } - - else if (EQ (keyword, Qcolumns)) - { - CHECK_INT (value); - columns = XINT (value); - if (columns != 1 && columns != 2) - signal_simple_error ("Invalid value for 'columns", value); - } - - else if (EQ (keyword, Qgraphic)) - { - CHECK_INT (value); - graphic = XINT (value); - if (graphic < 0 || graphic > 1) - signal_simple_error ("Invalid value for 'graphic", value); - } - - else if (EQ (keyword, Qregistry)) - { - CHECK_STRING (value); - registry = value; - } - - else if (EQ (keyword, Qdirection)) - { - if (EQ (value, Ql2r)) - direction = CHARSET_LEFT_TO_RIGHT; - else if (EQ (value, Qr2l)) - direction = CHARSET_RIGHT_TO_LEFT; - else - signal_simple_error ("Invalid value for 'direction", value); - } - - else if (EQ (keyword, Qfinal)) - { - CHECK_CHAR_COERCE_INT (value); - final = XCHAR (value); - if (final < '0' || final > '~') - signal_simple_error ("Invalid value for 'final", value); - } - - else if (EQ (keyword, Qccl_program)) - { - struct ccl_program test_ccl; - - if (setup_ccl_program (&test_ccl, value) < 0) - signal_simple_error ("Invalid value for 'ccl-program", value); - ccl_program = value; - } - - else - signal_simple_error ("Unrecognized property", keyword); - } - } + EXTERNAL_PROPERTY_LIST_LOOP (rest, keyword, value, props) + { + if (EQ (keyword, Qdimension)) + { + CHECK_INT (value); + dimension = XINT (value); + if (dimension < 1 || dimension > 2) + signal_simple_error ("Invalid value for 'dimension", value); + } + + else if (EQ (keyword, Qchars)) + { + CHECK_INT (value); + chars = XINT (value); + if (chars != 94 && chars != 96) + signal_simple_error ("Invalid value for 'chars", value); + } + + else if (EQ (keyword, Qcolumns)) + { + CHECK_INT (value); + columns = XINT (value); + if (columns != 1 && columns != 2) + signal_simple_error ("Invalid value for 'columns", value); + } + + else if (EQ (keyword, Qgraphic)) + { + CHECK_INT (value); + graphic = XINT (value); + if (graphic < 0 || graphic > 1) + signal_simple_error ("Invalid value for 'graphic", value); + } + + else if (EQ (keyword, Qregistry)) + { + CHECK_STRING (value); + registry = value; + } + + else if (EQ (keyword, Qdirection)) + { + if (EQ (value, Ql2r)) + direction = CHARSET_LEFT_TO_RIGHT; + else if (EQ (value, Qr2l)) + direction = CHARSET_RIGHT_TO_LEFT; + else + signal_simple_error ("Invalid value for 'direction", value); + } + + else if (EQ (keyword, Qfinal)) + { + CHECK_CHAR_COERCE_INT (value); + final = XCHAR (value); + if (final < '0' || final > '~') + signal_simple_error ("Invalid value for 'final", value); + } + + else if (EQ (keyword, Qccl_program)) + { + CHECK_VECTOR (value); + ccl_program = value; + } + + else + signal_simple_error ("Unrecognized property", keyword); + } if (!final) error ("'final must be specified"); @@ -786,7 +753,7 @@ character set. Recognized properties are: error ("Character set already defined for this DIMENSION/CHARS/FINAL combo"); - id = get_unallocated_leading_byte (dimension); + lb = get_unallocated_leading_byte (dimension); if (NILP (doc_string)) doc_string = build_string (""); @@ -794,16 +761,10 @@ character set. Recognized properties are: if (NILP (registry)) registry = build_string (""); - if (NILP (short_name)) - XSETSTRING (short_name, XSYMBOL (name)->name); - - if (NILP (long_name)) - long_name = doc_string; - if (columns == -1) columns = dimension; - charset = make_charset (id, name, dimension + 2, type, columns, graphic, - final, direction, short_name, long_name, doc_string, registry); + charset = make_charset (-1, name, lb, dimension + 2, type, columns, graphic, + final, direction, doc_string, registry); if (!NILP (ccl_program)) XCHARSET_CCL_PROGRAM (charset) = ccl_program; return charset; @@ -817,10 +778,10 @@ NEW-NAME is the name of the new charset. Return the new charset. (charset, new_name)) { Lisp_Object new_charset = Qnil; - int id, dimension, columns, graphic, final; + int lb, dimension, columns, graphic, final; int direction, type; - Lisp_Object registry, doc_string, short_name, long_name; - Lisp_Charset *cs; + Lisp_Object registry, doc_string; + struct Lisp_Charset *cs; charset = Fget_charset (charset); if (!NILP (XCHARSET_REVERSE_DIRECTION_CHARSET (charset))) @@ -836,7 +797,7 @@ NEW-NAME is the name of the new charset. Return the new charset. type = CHARSET_TYPE (cs); columns = CHARSET_COLUMNS (cs); dimension = CHARSET_DIMENSION (cs); - id = get_unallocated_leading_byte (dimension); + lb = get_unallocated_leading_byte (dimension); graphic = CHARSET_GRAPHIC (cs); final = CHARSET_FINAL (cs); @@ -844,13 +805,10 @@ NEW-NAME is the name of the new charset. Return the new charset. if (CHARSET_DIRECTION (cs) == CHARSET_RIGHT_TO_LEFT) direction = CHARSET_LEFT_TO_RIGHT; doc_string = CHARSET_DOC_STRING (cs); - short_name = CHARSET_SHORT_NAME (cs); - long_name = CHARSET_LONG_NAME (cs); registry = CHARSET_REGISTRY (cs); - new_charset = make_charset (id, new_name, dimension + 2, type, columns, - graphic, final, direction, short_name, long_name, - doc_string, registry); + new_charset = make_charset (-1, new_name, lb, dimension + 2, type, columns, + graphic, final, direction, doc_string, registry); CHARSET_REVERSE_DIRECTION_CHARSET (cs) = new_charset; XCHARSET_REVERSE_DIRECTION_CHARSET (new_charset) = charset; @@ -930,24 +888,8 @@ will be returned if character sets exist for both directions). return obj; } -DEFUN ("charset-short-name", Fcharset_short_name, 1, 1, 0, /* -Return short name of CHARSET. -*/ - (charset)) -{ - return XCHARSET_SHORT_NAME (Fget_charset (charset)); -} - -DEFUN ("charset-long-name", Fcharset_long_name, 1, 1, 0, /* -Return long name of CHARSET. -*/ - (charset)) -{ - return XCHARSET_LONG_NAME (Fget_charset (charset)); -} - -DEFUN ("charset-description", Fcharset_description, 1, 1, 0, /* -Return description of CHARSET. +DEFUN ("charset-doc-string", Fcharset_doc_string, 1, 1, 0, /* +Return doc string of CHARSET. */ (charset)) { @@ -963,21 +905,19 @@ Return dimension of CHARSET. } DEFUN ("charset-property", Fcharset_property, 2, 2, 0, /* -Return property PROP of CHARSET, a charset object or symbol naming a charset. +Return property PROP of CHARSET. Recognized properties are those listed in `make-charset', as well as 'name and 'doc-string. */ (charset, prop)) { - Lisp_Charset *cs; + struct Lisp_Charset *cs; charset = Fget_charset (charset); cs = XCHARSET (charset); CHECK_SYMBOL (prop); if (EQ (prop, Qname)) return CHARSET_NAME (cs); - if (EQ (prop, Qshort_name)) return CHARSET_SHORT_NAME (cs); - if (EQ (prop, Qlong_name)) return CHARSET_LONG_NAME (cs); if (EQ (prop, Qdoc_string)) return CHARSET_DOC_STRING (cs); if (EQ (prop, Qdimension)) return make_int (CHARSET_DIMENSION (cs)); if (EQ (prop, Qcolumns)) return make_int (CHARSET_COLUMNS (cs)); @@ -991,8 +931,10 @@ Recognized properties are those listed in `make-charset', as well as if (EQ (prop, Qreverse_direction_charset)) { Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs); - /* #### Is this translation OK? If so, error checking sufficient? */ - return CHARSETP (obj) ? XCHARSET_NAME (obj) : obj; + if (NILP (obj)) + return Qnil; + else + return XCHARSET_NAME (obj); } signal_simple_error ("Unrecognized charset property name", prop); return Qnil; /* not reached */ @@ -1003,7 +945,7 @@ Return charset identification number of CHARSET. */ (charset)) { - return make_int(XCHARSET_LEADING_BYTE (Fget_charset (charset))); + return make_int(XCHARSET_ID (Fget_charset (charset))); } /* #### We need to figure out which properties we really want to @@ -1014,11 +956,8 @@ Set the 'ccl-program property of CHARSET to CCL-PROGRAM. */ (charset, ccl_program)) { - struct ccl_program test_ccl; - charset = Fget_charset (charset); - if (setup_ccl_program (&test_ccl, ccl_program) < 0) - signal_simple_error ("Invalid ccl-program", ccl_program); + CHECK_VECTOR (ccl_program); XCHARSET_CCL_PROGRAM (charset) = ccl_program; return Qnil; } @@ -1027,13 +966,13 @@ static void invalidate_charset_font_caches (Lisp_Object charset) { /* Invalidate font cache entries for charset on all devices. */ - Lisp_Object devcons, concons, hash_table; + Lisp_Object devcons, concons, hashtab; DEVICE_LOOP_NO_BREAK (devcons, concons) { struct device *d = XDEVICE (XCAR (devcons)); - hash_table = Fgethash (charset, d->charset_font_cache, Qunbound); - if (!UNBOUNDP (hash_table)) - Fclrhash (hash_table); + hashtab = Fgethash (charset, d->charset_font_cache, Qunbound); + if (!UNBOUNDP (hashtab)) + Fclrhash (hashtab); } } @@ -1057,14 +996,11 @@ Set the 'registry property of CHARSET to REGISTRY. /************************************************************************/ 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; @@ -1077,11 +1013,7 @@ character s with caron. 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 because 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)); @@ -1094,7 +1026,7 @@ character s with caron. } 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)); @@ -1102,68 +1034,40 @@ character s with caron. } DEFUN ("char-charset", Fchar_charset, 1, 1, 0, /* -Return the character set of CHARACTER. +Return the character set of char CH. */ - (character)) + (ch)) { - CHECK_CHAR_COERCE_INT (character); + CHECK_CHAR_COERCE_INT (ch); return XCHARSET_NAME (CHARSET_BY_LEADING_BYTE - (CHAR_LEADING_BYTE (XCHAR (character)))); + (CHAR_LEADING_BYTE (XCHAR (ch)))); } DEFUN ("char-octet", Fchar_octet, 1, 2, 0, /* -Return the octet numbered N (should be 0 or 1) of CHARACTER. +Return the octet numbered N (should be 0 or 1) of char CH. N defaults to 0 if omitted. */ - (character, n)) + (ch, n)) { Lisp_Object charset; - int octet0, octet1; - - CHECK_CHAR_COERCE_INT (character); + int c1, c2, int_n; - BREAKUP_CHAR (XCHAR (character), charset, octet0, octet1); - - if (NILP (n) || EQ (n, Qzero)) - return make_int (octet0); - else if (EQ (n, make_int (1))) - return make_int (octet1); + CHECK_CHAR_COERCE_INT (ch); + if (NILP (n)) + int_n = 0; 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 CHARACTER. -*/ - (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)); + 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); } - else - { - rc = list2 (XCHARSET_NAME (charset), make_int (c1)); - } - UNGCPRO; - - return rc; + BREAKUP_CHAR (XCHAR (ch), charset, c1, c2); + return make_int (int_n == 0 ? c1 : c2); } -#ifdef ENABLE_COMPOSITE_CHARS /************************************************************************/ /* composite character functions */ /************************************************************************/ @@ -1173,7 +1077,7 @@ lookup_composite_char (Bufbyte *str, int len) { Lisp_Object lispstr = make_string (str, len); Lisp_Object ch = Fgethash (lispstr, - Vcomposite_char_string2char_hash_table, + Vcomposite_char_string2char_hashtable, Qunbound); Emchar emch; @@ -1184,9 +1088,9 @@ lookup_composite_char (Bufbyte *str, int len) emch = MAKE_CHAR (Vcharset_composite, composite_char_row_next, composite_char_col_next); Fputhash (make_char (emch), lispstr, - Vcomposite_char_char2string_hash_table); + Vcomposite_char_char2string_hashtable); Fputhash (lispstr, make_char (emch), - Vcomposite_char_string2char_hash_table); + Vcomposite_char_string2char_hashtable); composite_char_col_next++; if (composite_char_col_next >= 128) { @@ -1203,13 +1107,13 @@ Lisp_Object composite_char_string (Emchar ch) { Lisp_Object str = Fgethash (make_char (ch), - Vcomposite_char_char2string_hash_table, + Vcomposite_char_char2string_hashtable, Qunbound); assert (!UNBOUNDP (str)); return str; } -xxDEFUN ("make-composite-char", Fmake_composite_char, 1, 1, 0, /* +DEFUN ("make-composite-char", Fmake_composite_char, 1, 1, 0, /* Convert a string into a single composite character. The character is the result of overstriking all the characters in the string. @@ -1221,7 +1125,7 @@ the string. XSTRING_LENGTH (string))); } -xxDEFUN ("composite-char-string", Fcomposite_char_string, 1, 1, 0, /* +DEFUN ("composite-char-string", Fcomposite_char_string, 1, 1, 0, /* Return a string of the characters comprising a composite character. */ (ch)) @@ -1234,7 +1138,6 @@ Return a string of the characters comprising a composite character. signal_simple_error ("Must be composite char", ch); return composite_char_string (emch); } -#endif /* ENABLE_COMPOSITE_CHARS */ /************************************************************************/ @@ -1244,8 +1147,6 @@ Return a string of the characters comprising a composite character. void syms_of_mule_charset (void) { - INIT_LRECORD_IMPLEMENTATION (charset); - DEFSUBR (Fcharsetp); DEFSUBR (Ffind_charset); DEFSUBR (Fget_charset); @@ -1255,9 +1156,7 @@ syms_of_mule_charset (void) DEFSUBR (Fmake_reverse_direction_charset); /* DEFSUBR (Freverse_direction_charset); */ DEFSUBR (Fcharset_from_attributes); - DEFSUBR (Fcharset_short_name); - DEFSUBR (Fcharset_long_name); - DEFSUBR (Fcharset_description); + DEFSUBR (Fcharset_doc_string); DEFSUBR (Fcharset_dimension); DEFSUBR (Fcharset_property); DEFSUBR (Fcharset_id); @@ -1267,12 +1166,9 @@ syms_of_mule_charset (void) DEFSUBR (Fmake_char); DEFSUBR (Fchar_charset); DEFSUBR (Fchar_octet); - DEFSUBR (Fsplit_char); -#ifdef ENABLE_COMPOSITE_CHARS DEFSUBR (Fmake_composite_char); DEFSUBR (Fcomposite_char_string); -#endif defsymbol (&Qcharsetp, "charsetp"); defsymbol (&Qregistry, "registry"); @@ -1280,13 +1176,12 @@ syms_of_mule_charset (void) defsymbol (&Qgraphic, "graphic"); defsymbol (&Qdirection, "direction"); defsymbol (&Qreverse_direction_charset, "reverse-direction-charset"); - defsymbol (&Qshort_name, "short-name"); - defsymbol (&Qlong_name, "long-name"); + defsymbol (&Qccl_program, "ccl-program"); defsymbol (&Ql2r, "l2r"); defsymbol (&Qr2l, "r2l"); - /* Charsets, compatible with FSF 20.3 + /* Charsets, compatible with Emacs/Mule 19.33-delta Naming convention is Script-Charset[-Edition] */ defsymbol (&Qascii, "ascii"); defsymbol (&Qcontrol_1, "control-1"); @@ -1294,24 +1189,26 @@ syms_of_mule_charset (void) defsymbol (&Qlatin_iso8859_2, "latin-iso8859-2"); defsymbol (&Qlatin_iso8859_3, "latin-iso8859-3"); defsymbol (&Qlatin_iso8859_4, "latin-iso8859-4"); - defsymbol (&Qthai_tis620, "thai-tis620"); - defsymbol (&Qgreek_iso8859_7, "greek-iso8859-7"); + defsymbol (&Qcyrillic_iso8859_5, "cyrillic-iso8859-5"); defsymbol (&Qarabic_iso8859_6, "arabic-iso8859-6"); + defsymbol (&Qgreek_iso8859_7, "greek-iso8859-7"); defsymbol (&Qhebrew_iso8859_8, "hebrew-iso8859-8"); + defsymbol (&Qlatin_iso8859_9, "latin-iso8859-9"); + defsymbol (&Qthai_tis620, "thai-tis620"); + defsymbol (&Qkatakana_jisx0201, "katakana-jisx0201"); defsymbol (&Qlatin_jisx0201, "latin-jisx0201"); - defsymbol (&Qcyrillic_iso8859_5, "cyrillic-iso8859-5"); - defsymbol (&Qlatin_iso8859_9, "latin-iso8859-9"); defsymbol (&Qjapanese_jisx0208_1978, "japanese-jisx0208-1978"); - defsymbol (&Qchinese_gb2312, "chinese-gb2312"); defsymbol (&Qjapanese_jisx0208, "japanese-jisx0208"); - defsymbol (&Qkorean_ksc5601, "korean-ksc5601"); defsymbol (&Qjapanese_jisx0212, "japanese-jisx0212"); - defsymbol (&Qchinese_cns11643_1, "chinese-cns11643-1"); - defsymbol (&Qchinese_cns11643_2, "chinese-cns11643-2"); + + defsymbol (&Qchinese_gb2312, "chinese-gb2312"); defsymbol (&Qchinese_big5_1, "chinese-big5-1"); defsymbol (&Qchinese_big5_2, "chinese-big5-2"); + defsymbol (&Qchinese_cns11643_1, "chinese-cns11643-1"); + defsymbol (&Qchinese_cns11643_2, "chinese-cns11643-2"); + defsymbol (&Qkorean_ksc5601, "korean-ksc5601"); defsymbol (&Qcomposite, "composite"); } @@ -1320,273 +1217,204 @@ vars_of_mule_charset (void) { int i, j, k; - chlook = xnew_and_zero (struct charset_lookup); /* zero for Purify. */ - dump_add_root_struct_ptr (&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 complex_vars_of_mule_charset (void) { - staticpro (&Vcharset_hash_table); - Vcharset_hash_table = - make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); + staticpro (&Vcharset_hashtable); + Vcharset_hashtable = make_lisp_hashtable (50, HASHTABLE_NONWEAK, + HASHTABLE_EQ); /* Predefined character sets. We store them into variables for ease of access. */ - staticpro (&Vcharset_ascii); Vcharset_ascii = - make_charset (LEADING_BYTE_ASCII, Qascii, 1, + make_charset (0, Qascii, LEADING_BYTE_ASCII, 1, CHARSET_TYPE_94, 1, 0, 'B', CHARSET_LEFT_TO_RIGHT, - build_string ("ASCII"), - build_string ("ASCII)"), - build_string ("ASCII (ISO646 IRV)"), - build_string ("\\(iso8859-[0-9]*\\|-ascii\\)")); - staticpro (&Vcharset_control_1); + build_string ("ASCII (ISO 646 IRV)"), + build_string ("iso8859-1")); Vcharset_control_1 = - make_charset (LEADING_BYTE_CONTROL_1, Qcontrol_1, 2, - CHARSET_TYPE_94, 1, 1, 0, + make_charset (-1, Qcontrol_1, LEADING_BYTE_CONTROL_1, 2, + CHARSET_TYPE_94, 1, 0, 0, CHARSET_LEFT_TO_RIGHT, - build_string ("C1"), 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, + make_charset (129, Qlatin_iso8859_1, LEADING_BYTE_LATIN_ISO8859_1, 2, CHARSET_TYPE_96, 1, 1, 'A', CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-1"), - build_string ("ISO8859-1 (Latin-1)"), - build_string ("ISO8859-1 (Latin-1)"), + build_string ("ISO 8859-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, + make_charset (130, Qlatin_iso8859_2, LEADING_BYTE_LATIN_ISO8859_2, 2, CHARSET_TYPE_96, 1, 1, 'B', CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-2"), - build_string ("ISO8859-2 (Latin-2)"), - build_string ("ISO8859-2 (Latin-2)"), + build_string ("ISO 8859-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, + make_charset (131, Qlatin_iso8859_3, LEADING_BYTE_LATIN_ISO8859_3, 2, CHARSET_TYPE_96, 1, 1, 'C', CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-3"), - build_string ("ISO8859-3 (Latin-3)"), - build_string ("ISO8859-3 (Latin-3)"), + build_string ("ISO 8859-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, + make_charset (132, Qlatin_iso8859_4, LEADING_BYTE_LATIN_ISO8859_4, 2, CHARSET_TYPE_96, 1, 1, 'D', CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-4"), - build_string ("ISO8859-4 (Latin-4)"), - build_string ("ISO8859-4 (Latin-4)"), + build_string ("ISO 8859-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', - CHARSET_LEFT_TO_RIGHT, - build_string ("TIS620"), - 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', + Vcharset_cyrillic_iso8859_5 = + make_charset (140, Qcyrillic_iso8859_5, LEADING_BYTE_CYRILLIC_ISO8859_5, 2, + CHARSET_TYPE_96, 1, 1, 'L', CHARSET_LEFT_TO_RIGHT, - build_string ("ISO8859-7"), - build_string ("ISO8859-7 (Greek)"), - build_string ("ISO8859-7 (Greek)"), - build_string ("iso8859-7")); - staticpro (&Vcharset_arabic_iso8859_6); + build_string ("ISO 8859-5 (Cyrillic)"), + build_string ("iso8859-5")); Vcharset_arabic_iso8859_6 = - make_charset (LEADING_BYTE_ARABIC_ISO8859_6, Qarabic_iso8859_6, 2, + make_charset (135, Qarabic_iso8859_6, LEADING_BYTE_ARABIC_ISO8859_6, 2, CHARSET_TYPE_96, 1, 1, 'G', CHARSET_RIGHT_TO_LEFT, - build_string ("ISO8859-6"), - build_string ("ISO8859-6 (Arabic)"), - build_string ("ISO8859-6 (Arabic)"), + build_string ("ISO 8859-6 (Arabic)"), build_string ("iso8859-6")); - staticpro (&Vcharset_hebrew_iso8859_8); + Vcharset_greek_iso8859_7 = + make_charset (134, Qgreek_iso8859_7, LEADING_BYTE_GREEK_ISO8859_7, 2, + CHARSET_TYPE_96, 1, 1, 'F', + CHARSET_LEFT_TO_RIGHT, + build_string ("ISO 8859-7 (Greek)"), + build_string ("iso8859-7")); Vcharset_hebrew_iso8859_8 = - make_charset (LEADING_BYTE_HEBREW_ISO8859_8, Qhebrew_iso8859_8, 2, + make_charset (136, Qhebrew_iso8859_8, LEADING_BYTE_HEBREW_ISO8859_8, 2, CHARSET_TYPE_96, 1, 1, 'H', CHARSET_RIGHT_TO_LEFT, - build_string ("ISO8859-8"), - build_string ("ISO8859-8 (Hebrew)"), - build_string ("ISO8859-8 (Hebrew)"), + build_string ("ISO 8859-8 (Hebrew)"), build_string ("iso8859-8")); - staticpro (&Vcharset_katakana_jisx0201); + Vcharset_latin_iso8859_9 = + make_charset (141, Qlatin_iso8859_9, LEADING_BYTE_LATIN_ISO8859_9, 2, + CHARSET_TYPE_96, 1, 1, 'M', + CHARSET_LEFT_TO_RIGHT, + build_string ("ISO 8859-9 (Latin-5)"), + build_string ("iso8859-9")); + Vcharset_thai_tis620 = + make_charset (133, Qthai_tis620, LEADING_BYTE_THAI_TIS620, 2, + CHARSET_TYPE_96, 1, 1, 'T', + CHARSET_LEFT_TO_RIGHT, + build_string ("TIS 620.2529 (Thai)"), + build_string ("tis620")); + + /* Japanese */ Vcharset_katakana_jisx0201 = - make_charset (LEADING_BYTE_KATAKANA_JISX0201, Qkatakana_jisx0201, 2, + make_charset (137, Qkatakana_jisx0201, + LEADING_BYTE_KATAKANA_JISX0201, 2, CHARSET_TYPE_94, 1, 1, 'I', CHARSET_LEFT_TO_RIGHT, - build_string ("JISX0201 Kana"), - build_string ("JISX0201.1976 (Japanese Kana)"), - build_string ("JISX0201.1976 Japanese Kana"), + build_string ("JIS X0201-Katakana"), build_string ("jisx0201.1976")); - staticpro (&Vcharset_latin_jisx0201); Vcharset_latin_jisx0201 = - make_charset (LEADING_BYTE_LATIN_JISX0201, Qlatin_jisx0201, 2, + make_charset (138, Qlatin_jisx0201, + LEADING_BYTE_LATIN_JISX0201, 2, CHARSET_TYPE_94, 1, 0, 'J', CHARSET_LEFT_TO_RIGHT, - build_string ("JISX0201 Roman"), - build_string ("JISX0201.1976 (Japanese Roman)"), - build_string ("JISX0201.1976 Japanese Roman"), + build_string ("JIS X0201-Latin"), 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', - CHARSET_LEFT_TO_RIGHT, - build_string ("ISO8859-5"), - 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', - CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-5"), - 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, + make_charset (144, Qjapanese_jisx0208_1978, + LEADING_BYTE_JAPANESE_JISX0208_1978, 3, CHARSET_TYPE_94X94, 2, 0, '@', CHARSET_LEFT_TO_RIGHT, - build_string ("JISX0208.1978"), - build_string ("JISX0208.1978 (Japanese)"), build_string - ("JISX0208.1978 Japanese Kanji (so called \"old JIS\")"), - build_string ("\\(jisx0208\\|jisc6226\\)\\.1978")); - staticpro (&Vcharset_chinese_gb2312); - Vcharset_chinese_gb2312 = - make_charset (LEADING_BYTE_CHINESE_GB2312, Qchinese_gb2312, 3, - CHARSET_TYPE_94X94, 2, 0, 'A', - CHARSET_LEFT_TO_RIGHT, - build_string ("GB2312"), - build_string ("GB2312)"), - build_string ("GB2312 Chinese simplified"), - build_string ("gb2312")); - staticpro (&Vcharset_japanese_jisx0208); + ("JIS X0208-1978 (Japanese Kanji; Old Version)"), + build_string ("\\(jisx0208\\|jisc6226\\).19")); Vcharset_japanese_jisx0208 = - make_charset (LEADING_BYTE_JAPANESE_JISX0208, Qjapanese_jisx0208, 3, + make_charset (146, Qjapanese_jisx0208, + LEADING_BYTE_JAPANESE_JISX0208, 3, CHARSET_TYPE_94X94, 2, 0, 'B', CHARSET_LEFT_TO_RIGHT, - build_string ("JISX0208"), - build_string ("JISX0208.1983/1990 (Japanese)"), - build_string ("JISX0208.1983/1990 Japanese Kanji"), + build_string ("JIS X0208-1983 (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', - CHARSET_LEFT_TO_RIGHT, - build_string ("KSC5601"), - 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, + make_charset (148, Qjapanese_jisx0212, + LEADING_BYTE_JAPANESE_JISX0212, 3, CHARSET_TYPE_94X94, 2, 0, 'D', CHARSET_LEFT_TO_RIGHT, - build_string ("JISX0212"), - build_string ("JISX0212 (Japanese)"), - build_string ("JISX0212 Japanese Supplement"), + build_string ("JIS X0212 (Japanese Supplement)"), build_string ("jisx0212")); + /* Chinese */ + Vcharset_chinese_gb2312 = + make_charset (145, Qchinese_gb2312, LEADING_BYTE_CHINESE_GB2312, 3, + CHARSET_TYPE_94X94, 2, 0, 'A', + CHARSET_LEFT_TO_RIGHT, + build_string ("GB 2312 (Simplified Chinese)"), + build_string ("gb2312")); #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, + make_charset (149, Qchinese_cns11643_1, + LEADING_BYTE_CHINESE_CNS11643_1, 3, CHARSET_TYPE_94X94, 2, 0, 'G', CHARSET_LEFT_TO_RIGHT, - build_string ("CNS11643-1"), - build_string ("CNS11643-1 (Chinese traditional)"), build_string - ("CNS 11643 Plane 1 Chinese traditional"), + ("CNS 11643 Plane 1 (Traditional Chinese for daily use)"), 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, + make_charset (150, Qchinese_cns11643_2, + LEADING_BYTE_CHINESE_CNS11643_2, 3, CHARSET_TYPE_94X94, 2, 0, 'H', CHARSET_LEFT_TO_RIGHT, - build_string ("CNS11643-2"), - build_string ("CNS11643-2 (Chinese traditional)"), build_string - ("CNS 11643 Plane 2 Chinese traditional"), + ("CNS 11643 Plane 2 (Traditional Chinese for daily use)"), 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, + make_charset (152, Qchinese_big5_1, LEADING_BYTE_CHINESE_BIG5_1, 3, CHARSET_TYPE_94X94, 2, 0, '0', CHARSET_LEFT_TO_RIGHT, - build_string ("Big5"), - build_string ("Big5 (Level-1)"), build_string - ("Big5 Level-1 Chinese traditional"), + ("Big5 Level 1 (Traditional Chinese for daily use)"), build_string ("big5")); - staticpro (&Vcharset_chinese_big5_2); Vcharset_chinese_big5_2 = - make_charset (LEADING_BYTE_CHINESE_BIG5_2, Qchinese_big5_2, 3, + make_charset (153, Qchinese_big5_2, LEADING_BYTE_CHINESE_BIG5_2, 3, CHARSET_TYPE_94X94, 2, 0, '1', CHARSET_LEFT_TO_RIGHT, - build_string ("Big5"), - build_string ("Big5 (Level-2)"), build_string - ("Big5 Level-2 Chinese traditional"), + ("Big5 Level 2 (Traditional Chinese for daily use)"), build_string ("big5")); - -#ifdef ENABLE_COMPOSITE_CHARS + Vcharset_korean_ksc5601 = + make_charset (147, Qkorean_ksc5601, LEADING_BYTE_KOREAN_KSC5601, 3, + CHARSET_TYPE_94X94, 2, 0, 'C', + CHARSET_LEFT_TO_RIGHT, + build_string ("KS C5601 (Hangul and Korean Hanja)"), + build_string ("ksc5601")); /* #### 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, + make_charset (-1, Qcomposite, LEADING_BYTE_COMPOSITE, 3, CHARSET_TYPE_96X96, 2, 0, 0, CHARSET_LEFT_TO_RIGHT, - build_string ("Composite"), - build_string ("Composite characters"), build_string ("Composite characters"), build_string ("")); - /* #### not dumped properly */ composite_char_row_next = 32; composite_char_col_next = 32; - Vcomposite_char_string2char_hash_table = - make_lisp_hash_table (500, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); - Vcomposite_char_char2string_hash_table = - make_lisp_hash_table (500, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); - staticpro (&Vcomposite_char_string2char_hash_table); - staticpro (&Vcomposite_char_char2string_hash_table); -#endif /* ENABLE_COMPOSITE_CHARS */ + Vcomposite_char_string2char_hashtable = + make_lisp_hashtable (500, HASHTABLE_NONWEAK, HASHTABLE_EQUAL); + Vcomposite_char_char2string_hashtable = + make_lisp_hashtable (500, HASHTABLE_NONWEAK, HASHTABLE_EQ); + staticpro (&Vcomposite_char_string2char_hashtable); + staticpro (&Vcomposite_char_char2string_hashtable); } diff --git a/src/mule-charset.h b/src/mule-charset.h index 46cd3a0..ee7dcc2 100644 --- a/src/mule-charset.h +++ b/src/mule-charset.h @@ -23,8 +23,8 @@ Boston, MA 02111-1307, USA. */ /* 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 @@ Boston, MA 02111-1307, USA. */ 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 @@ -327,53 +327,43 @@ Boston, MA 02111-1307, USA. */ #define MIN_LEADING_BYTE 0x80 /* These need special treatment in a string and/or character */ #define LEADING_BYTE_ASCII 0x8E /* Omitted in a buffer */ -#ifdef ENABLE_COMPOSITE_CHARS -#endif #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. **/ -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,19 +391,19 @@ enum LEADING_BYTE_OFFICIAL_2 /* Is this a prefix for a private leading byte? */ -INLINE_HEADER int LEADING_BYTE_PREFIX_P (Bufbyte lb); -INLINE_HEADER int -LEADING_BYTE_PREFIX_P (Bufbyte lb) +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 || lb == PRE_LEADING_BYTE_PRIVATE_2); } /* Given a private leading byte, return the leading byte prefix stored - in a string. */ + in a string */ #define PRIVATE_LEADING_BYTE_PREFIX(lb) \ - ((unsigned int) (lb) < MIN_LEADING_BYTE_PRIVATE_2 ? \ + ((lb) < MIN_LEADING_BYTE_PRIVATE_2 ? \ PRE_LEADING_BYTE_PRIVATE_1 : \ PRE_LEADING_BYTE_PRIVATE_2) @@ -423,12 +413,13 @@ LEADING_BYTE_PREFIX_P (Bufbyte lb) /* of any format */ /************************************************************************/ -/* These are carefully designed to work if BYTE is signed or unsigned. */ -/* Note that SPC and DEL are considered ASCII, not control. */ +/* Argument `c' should be (unsigned int) or (unsigned char). */ +/* Note that SP and DEL are not included. */ -#define BYTE_ASCII_P(byte) (((byte) & ~0x7f) == 0) -#define BYTE_C0_P(byte) (((byte) & ~0x1f) == 0) -#define BYTE_C1_P(byte) (((byte) & ~0x1f) == 0x80) +#define BYTE_ASCII_P(c) ((c) < 0x80) +#define BYTE_C0_P(c) ((c) < 0x20) +/* Do some forced casting just to make *sure* things are gotten right. */ +#define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20) /************************************************************************/ @@ -436,13 +427,13 @@ LEADING_BYTE_PREFIX_P (Bufbyte lb) /* in a Mule-formatted string */ /************************************************************************/ -/* Does BYTE represent the first byte of a character? */ +/* Does this byte represent the first byte of a character? */ -#define BUFBYTE_FIRST_BYTE_P(byte) ((byte) < 0xA0) +#define BUFBYTE_FIRST_BYTE_P(c) ((c) < 0xA0) -/* Does BYTE represent the first byte of a multi-byte character? */ +/* Does this byte represent the first byte of a multi-byte character? */ -#define BUFBYTE_LEADING_BYTE_P(byte) BYTE_C1_P (byte) +#define BUFBYTE_LEADING_BYTE_P(c) BYTE_C1_P (c) /************************************************************************/ @@ -455,15 +446,14 @@ struct Lisp_Charset 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; Lisp_Object reverse_direction_charset; Lisp_Object ccl_program; + Bufbyte leading_byte; + /* Final byte of this character set in ISO2022 designating escape sequence */ Bufbyte final; @@ -491,12 +481,12 @@ struct Lisp_Charset /* 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) @@ -508,12 +498,9 @@ DECLARE_LRECORD (charset, Lisp_Charset); #define CHARSET_LEFT_TO_RIGHT 0 #define CHARSET_RIGHT_TO_LEFT 1 -/* 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_NAME(cs) ((cs)->name) -#define CHARSET_SHORT_NAME(cs) ((cs)->short_name) -#define CHARSET_LONG_NAME(cs) ((cs)->long_name) +#define CHARSET_LEADING_BYTE(cs) ((cs)->leading_byte) #define CHARSET_REP_BYTES(cs) ((cs)->rep_bytes) #define CHARSET_COLUMNS(cs) ((cs)->columns) #define CHARSET_GRAPHIC(cs) ((cs)->graphic) @@ -532,8 +519,6 @@ DECLARE_LRECORD (charset, Lisp_Charset); #define XCHARSET_ID(cs) CHARSET_ID (XCHARSET (cs)) #define XCHARSET_NAME(cs) CHARSET_NAME (XCHARSET (cs)) -#define XCHARSET_SHORT_NAME(cs) CHARSET_SHORT_NAME (XCHARSET (cs)) -#define XCHARSET_LONG_NAME(cs) CHARSET_LONG_NAME (XCHARSET (cs)) #define XCHARSET_REP_BYTES(cs) CHARSET_REP_BYTES (XCHARSET (cs)) #define XCHARSET_COLUMNS(cs) CHARSET_COLUMNS (XCHARSET (cs)) #define XCHARSET_GRAPHIC(cs) CHARSET_GRAPHIC (XCHARSET (cs)) @@ -550,61 +535,59 @@ DECLARE_LRECORD (charset, Lisp_Charset); #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. */ - Lisp_Object charset_by_attributes[4][128][2]; - Bufbyte next_allocated_1_byte_leading_byte; - Bufbyte next_allocated_2_byte_leading_byte; -}; +/* Table of charsets indexed by type/final-byte/direction. */ +extern Lisp_Object charset_by_attributes[4][128][2]; -INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (Bufbyte lb); -INLINE_HEADER Lisp_Object -CHARSET_BY_LEADING_BYTE (Bufbyte lb) -{ - extern struct charset_lookup *chlook; +/* 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 + + (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 - /* When error-checking is on, x86 GCC 2.95.2 -O3 miscompiles the - following unless we introduce `tem'. */ - int tem = lb; - type_checking_assert (tem >= 0x80 && tem <= 0xFF); -#endif - return chlook->charset_by_leading_byte[lb - 128]; +/* 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 Lisp_Object CHARSET_BY_LEADING_BYTE (int lb); +INLINE Lisp_Object +CHARSET_BY_LEADING_BYTE (int lb) +{ + assert (lb >= 0x80 && lb <= 0xFF); + return charset_by_leading_byte[lb - 128]; } -INLINE_HEADER Lisp_Object -CHARSET_BY_ATTRIBUTES (unsigned int type, unsigned char final, int dir); -INLINE_HEADER Lisp_Object -CHARSET_BY_ATTRIBUTES (unsigned int type, unsigned char final, int dir) -{ - extern struct charset_lookup *chlook; +#else - type_checking_assert (type < countof (chlook->charset_by_attributes) && - final < countof (chlook->charset_by_attributes[0]) && - dir < countof (chlook->charset_by_attributes[0][0])); - return chlook->charset_by_attributes[type][final][dir]; -} +#define CHARSET_BY_LEADING_BYTE(lb) (charset_by_leading_byte[(lb) - 128]) -/* Table of number of bytes in the string representation of a character - indexed by the first byte of that representation. +#endif - 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]; +#define CHARSET_BY_ATTRIBUTES(type, final, dir) \ + (charset_by_attributes[type][final][dir]) + +#ifdef ERROR_CHECK_TYPECHECK -/* Number of bytes in the string representation of a character. */ -INLINE_HEADER int REP_BYTES_BY_FIRST_BYTE (Bufbyte fb); -INLINE_HEADER int -REP_BYTES_BY_FIRST_BYTE (Bufbyte fb) +/* 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) { - type_checking_assert (fb < 0xA0); + 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 */ @@ -678,8 +661,8 @@ REP_BYTES_BY_FIRST_BYTE (Bufbyte fb) 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)) @@ -693,14 +676,7 @@ CHAR_LEADING_BYTE (Emchar c) else if (c < MIN_CHAR_COMPOSITION) return CHAR_FIELD1 (c) + FIELD1_TO_PRIVATE_LEADING_BYTE; else - { -#ifdef ENABLE_COMPOSITE_CHARS - return LEADING_BYTE_COMPOSITE; -#else - abort(); - return 0; -#endif /* ENABLE_COMPOSITE_CHARS */ - } + return LEADING_BYTE_COMPOSITE; } #define CHAR_CHARSET(c) CHARSET_BY_LEADING_BYTE (CHAR_LEADING_BYTE (c)) @@ -713,18 +689,16 @@ CHAR_LEADING_BYTE (Emchar c) 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)) return c1; else if (EQ (charset, Vcharset_control_1)) return c1 | 0x80; -#ifdef ENABLE_COMPOSITE_CHARS else if (EQ (charset, Vcharset_composite)) return (0x1F << 14) | ((c1) << 7) | (c2); -#endif else if (XCHARSET_DIMENSION (charset) == 1) return ((XCHARSET_LEADING_BYTE (charset) - FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7) | (c1); @@ -751,8 +725,8 @@ MAKE_CHAR (Lisp_Object charset, int c1, int c2) : ((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); @@ -764,14 +738,12 @@ breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2) -#ifdef ENABLE_COMPOSITE_CHARS /************************************************************************/ /* Composite characters */ /************************************************************************/ Emchar lookup_composite_char (Bufbyte *str, int len); Lisp_Object composite_char_string (Emchar ch); -#endif /* ENABLE_COMPOSITE_CHARS */ /************************************************************************/ @@ -789,9 +761,9 @@ Emchar Lstream_get_emchar_1 (Lstream *stream, int first_char); 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 --git a/src/mule-coding.c b/src/mule-coding.c new file mode 100644 index 0000000..a0a4ff9 --- /dev/null +++ b/src/mule-coding.c @@ -0,0 +1,4807 @@ +/* Code conversion functions. + Copyright (C) 1991, 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. */ + +/* Rewritten by Ben Wing <ben@xemacs.org>. */ + +#if 0 /* while file-coding not split up */ + +#include <config.h> +#include "lisp.h" + +#include "buffer.h" +#include "elhash.h" +#include "insdel.h" +#include "lstream.h" +#include "mule-ccl.h" +#include "mule-coding.h" + +Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error; + +Lisp_Object Vkeyboard_coding_system; +Lisp_Object Vterminal_coding_system; +Lisp_Object Vcoding_system_for_read; +Lisp_Object Vcoding_system_for_write; +Lisp_Object Vfile_name_coding_system; + +/* Table of symbols identifying each coding category. */ +Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST + 1]; + +/* 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 Qbig5, Qshift_jis, Qno_conversion, Qccl, Qiso2022; +/* Qinternal in general.c */ + +Lisp_Object Qmnemonic, Qeol_type; +Lisp_Object Qcr, Qcrlf, Qlf; +Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf; +Lisp_Object Qpost_read_conversion; +Lisp_Object Qpre_write_conversion; + +Lisp_Object Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3; +Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output; +Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output; +Lisp_Object Qshort, Qno_ascii_eol, Qno_ascii_cntl, Qseven, Qlock_shift; +Lisp_Object Qno_iso6429, Qescape_quoted; +Lisp_Object Qinput_charset_conversion, Qoutput_charset_conversion; + +Lisp_Object Qencode, Qdecode; + +Lisp_Object Qctext; + +Lisp_Object Vcoding_system_hashtable; + +int enable_multibyte_characters; + +/* Additional information used by the ISO2022 decoder and detector. */ +struct iso2022_decoder +{ + /* CHARSET holds the character sets currently assigned to the G0 + through G3 variables. It is initialized from the array + INITIAL_CHARSET in CODESYS. */ + Lisp_Object charset[4]; + + /* Which registers are currently invoked into the left (GL) and + right (GR) halves of the 8-bit encoding space? */ + int register_left, register_right; + + /* ISO_ESC holds a value indicating part of an escape sequence + that has already been seen. */ + enum iso_esc_flag esc; + + /* This records the bytes we've seen so far in an escape sequence, + in case the sequence is invalid (we spit out the bytes unchanged). */ + unsigned char esc_bytes[8]; + + /* Index for next byte to store in ISO escape sequence. */ + int esc_bytes_index; + + /* Stuff seen so far when composing a string. */ + unsigned_char_dynarr *composite_chars; + + /* If we saw an invalid designation sequence for a particular + register, we flag it here and switch to ASCII. The next time we + see a valid designation for this register, we turn off the flag + and do the designation normally, but pretend the sequence was + invalid. The effect of all this is that (most of the time) the + escape sequences for both the switch to the unknown charset, and + the switch back to the known charset, get inserted literally into + the buffer and saved out as such. The hope is that we can + preserve the escape sequences so that the resulting written out + file makes sense. If we don't do any of this, the designation + to the invalid charset will be preserved but that switch back + to the known charset will probably get eaten because it was + the same charset that was already present in the register. */ + unsigned char invalid_designated[4]; + + /* We try to do similar things as above for direction-switching + sequences. If we encountered a direction switch while an + invalid designation was present, or an invalid designation + just after a direction switch (i.e. no valid designation + encountered yet), we insert the direction-switch escape + sequence literally into the output stream, and later on + insert the corresponding direction-restoring escape sequence + literally also. */ + unsigned int switched_dir_and_no_valid_charset_yet :1; + unsigned int invalid_switch_dir :1; + + /* Tells the decoder to output the escape sequence literally + even though it was valid. Used in the games we play to + avoid lossage when we encounter invalid designations. */ + unsigned int output_literally :1; + /* We encountered a direction switch followed by an invalid + designation. We didn't output the direction switch + literally because we didn't know about the invalid designation; + but we have to do so now. */ + unsigned int output_direction_sequence :1; +}; + +EXFUN (Fcopy_coding_system, 2); +struct detection_state; +static int detect_coding_sjis (struct detection_state *st, + CONST unsigned char *src, + unsigned int n); +static void decode_coding_sjis (Lstream *decoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, + unsigned int n); +static void encode_coding_sjis (Lstream *encoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, + unsigned int n); +static int detect_coding_big5 (struct detection_state *st, + CONST unsigned char *src, + unsigned int n); +static void decode_coding_big5 (Lstream *decoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n); +static void encode_coding_big5 (Lstream *encoding, + 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, + unsigned int n); +static void decode_coding_iso2022 (Lstream *decoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n); +static void encode_coding_iso2022 (Lstream *encoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n); +static void decode_coding_no_conversion (Lstream *decoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, + unsigned int n); +static void encode_coding_no_conversion (Lstream *encoding, + CONST unsigned char *src, + unsigned_char_dynarr *dst, + unsigned int n); +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, + unsigned_char_dynarr *dst, unsigned int n); + +typedef struct codesys_prop codesys_prop; +struct codesys_prop +{ + Lisp_Object sym; + int prop_type; +}; + +typedef struct +{ + Dynarr_declare (codesys_prop); +} codesys_prop_dynarr; + +codesys_prop_dynarr *the_codesys_prop_dynarr; + +enum codesys_prop_enum +{ + CODESYS_PROP_ALL_OK, + CODESYS_PROP_ISO2022, + CODESYS_PROP_CCL +}; + + +/************************************************************************/ +/* Coding system functions */ +/************************************************************************/ + +static Lisp_Object +mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object)) +{ + struct Lisp_Coding_System *codesys = XCODING_SYSTEM (obj); + + (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)) + { + int i; + case CODESYS_ISO2022: + for (i = 0; i < 4; 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); + (markobj) (ccs->from_charset); + (markobj) (ccs->to_charset); + } + } + if (codesys->iso2022.output_conv) + { + for (i = 0; i < Dynarr_length (codesys->iso2022.output_conv); i++) + { + struct charset_conversion_spec *ccs = + Dynarr_atp (codesys->iso2022.output_conv, i); + (markobj) (ccs->from_charset); + (markobj) (ccs->to_charset); + } + } + break; + + case CODESYS_CCL: + (markobj) (CODING_SYSTEM_CCL_DECODE (codesys)); + (markobj) (CODING_SYSTEM_CCL_ENCODE (codesys)); + break; + default: + break; + } + + (markobj) (CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys)); + return CODING_SYSTEM_POST_READ_CONVERSION (codesys); +} + +static void +print_coding_system (Lisp_Object obj, Lisp_Object printcharfun, + int escapeflag) +{ + struct Lisp_Coding_System *c = XCODING_SYSTEM (obj); + if (print_readably) + error ("printing unreadable object #<coding_system 0x%x>", + c->header.uid); + + write_c_string ("#<coding_system ", printcharfun); + print_internal (c->name, printcharfun, 1); + write_c_string (">", printcharfun); +} + +static void +finalize_coding_system (void *header, int for_disksave) +{ + struct Lisp_Coding_System *c = (struct Lisp_Coding_System *) header; + /* Since coding systems never go away, this function is not + necessary. But it would be necessary if we changed things + so that coding systems could go away. */ + if (!for_disksave) /* see comment in lstream.c */ + { + switch (CODING_SYSTEM_TYPE (c)) + { + case CODESYS_ISO2022: + if (c->iso2022.input_conv) + { + Dynarr_free (c->iso2022.input_conv); + c->iso2022.input_conv = 0; + } + if (c->iso2022.output_conv) + { + Dynarr_free (c->iso2022.output_conv); + c->iso2022.output_conv = 0; + } + break; + + default: + break; + } + } +} + +DEFINE_LRECORD_IMPLEMENTATION ("coding-system", coding_system, + mark_coding_system, print_coding_system, + finalize_coding_system, + 0, 0, struct Lisp_Coding_System); + +static enum eol_type +symbol_to_eol_type (Lisp_Object symbol) +{ + CHECK_SYMBOL (symbol); + if (NILP (symbol)) return EOL_AUTODETECT; + if (EQ (symbol, Qlf)) return EOL_LF; + if (EQ (symbol, Qcrlf)) return EOL_CRLF; + if (EQ (symbol, Qcr)) return EOL_CR; + + signal_simple_error ("Unrecognized eol type", symbol); + return EOL_AUTODETECT; /* not reached */ +} + +static Lisp_Object +eol_type_to_symbol (enum eol_type type) +{ + switch (type) + { + case EOL_LF: return Qlf; + case EOL_CRLF: return Qcrlf; + case EOL_CR: return Qcr; + case EOL_AUTODETECT: return Qnil; + default: abort (); return Qnil; /* not reached */ + } +} + +static void +setup_eol_coding_systems (struct Lisp_Coding_System *codesys) +{ + Lisp_Object codesys_obj; + int len = string_length (XSYMBOL (CODING_SYSTEM_NAME (codesys))->name); + char *codesys_name = (char *) alloca (len + 7); + Lisp_Object codesys_name_sym, sub_codesys_obj; + + /* kludge */ + + XSETCODING_SYSTEM (codesys_obj, codesys); + + memcpy (codesys_name, + string_data (XSYMBOL (CODING_SYSTEM_NAME (codesys))->name), len); + +#define DEFINE_SUB_CODESYS(op_sys, Type) do { \ + strcpy (codesys_name + len, "-" op_sys); \ + codesys_name_sym = intern (codesys_name); \ + sub_codesys_obj = Fcopy_coding_system (codesys_obj, codesys_name_sym); \ + XCODING_SYSTEM_EOL_TYPE (sub_codesys_obj) = Type; \ + CODING_SYSTEM_##Type (codesys) = sub_codesys_obj; \ +} while (0) + + DEFINE_SUB_CODESYS("unix", EOL_LF); + DEFINE_SUB_CODESYS("dos", EOL_CRLF); + DEFINE_SUB_CODESYS("mac", EOL_CR); +} + +DEFUN ("coding-system-p", Fcoding_system_p, 1, 1, 0, /* +Return t if OBJECT is a coding system. +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 ISO2022-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 "ESC $ ( B"; ASCII is invoked +with "ESC ( B"; and Cyrillic is invoked with "ESC - L". See +`make-coding-system' for more information. + +Coding systems are normally identified using a symbol, and the +symbol is accepted in place of the actual coding system object whenever +a coding system is called for. (This is similar to how faces work.) +*/ + (object)) +{ + return CODING_SYSTEMP (object) ? Qt : Qnil; +} + +DEFUN ("find-coding-system", Ffind_coding_system, 1, 1, 0, /* +Retrieve the coding system of the given name. + +If CODING-SYSTEM-OR-NAME is a coding-system object, it is simply +returned. Otherwise, CODING-SYSTEM-OR-NAME should be a symbol. +If there is no such coding system, nil is returned. Otherwise the +associated coding system object is returned. +*/ + (coding_system_or_name)) +{ + if (NILP (coding_system_or_name)) + coding_system_or_name = Qbinary; + if (CODING_SYSTEMP (coding_system_or_name)) + return coding_system_or_name; + CHECK_SYMBOL (coding_system_or_name); + + return Fgethash (coding_system_or_name, Vcoding_system_hashtable, Qnil); +} + +DEFUN ("get-coding-system", Fget_coding_system, 1, 1, 0, /* +Retrieve the coding system of the given name. +Same as `find-coding-system' except that if there is no such +coding system, an error is signaled instead of returning nil. +*/ + (name)) +{ + Lisp_Object coding_system = Ffind_coding_system (name); + + if (NILP (coding_system)) + signal_simple_error ("No such coding system", name); + return coding_system; +} + +/* We store the coding systems in hash tables with the names as the key and the + actual coding system object as the value. Occasionally we need to use them + in a list format. These routines provide us with that. */ +struct coding_system_list_closure +{ + Lisp_Object *coding_system_list; +}; + +static int +add_coding_system_to_list_mapper (CONST void *hash_key, void *hash_contents, + void *coding_system_list_closure) +{ + /* This function can GC */ + Lisp_Object key, contents; + Lisp_Object *coding_system_list; + struct coding_system_list_closure *cscl = + (struct coding_system_list_closure *) coding_system_list_closure; + CVOID_TO_LISP (key, hash_key); + VOID_TO_LISP (contents, hash_contents); + coding_system_list = cscl->coding_system_list; + + *coding_system_list = Fcons (XCODING_SYSTEM (contents)->name, + *coding_system_list); + return 0; +} + +DEFUN ("coding-system-list", Fcoding_system_list, 0, 0, 0, /* +Return a list of the names of all defined coding systems. +*/ + ()) +{ + Lisp_Object coding_system_list = Qnil; + struct gcpro gcpro1; + struct coding_system_list_closure coding_system_list_closure; + + GCPRO1 (coding_system_list); + coding_system_list_closure.coding_system_list = &coding_system_list; + elisp_maphash (add_coding_system_to_list_mapper, Vcoding_system_hashtable, + &coding_system_list_closure); + UNGCPRO; + + return coding_system_list; +} + +DEFUN ("coding-system-name", Fcoding_system_name, 1, 1, 0, /* +Return the name of the given coding system. +*/ + (coding_system)) +{ + coding_system = Fget_coding_system (coding_system); + return XCODING_SYSTEM_NAME (coding_system); +} + +static struct Lisp_Coding_System * +allocate_coding_system (enum coding_system_type type, Lisp_Object name) +{ + struct Lisp_Coding_System *codesys = + alloc_lcrecord_type (struct Lisp_Coding_System, lrecord_coding_system); + + zero_lcrecord (codesys); + CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = Qnil; + CODING_SYSTEM_POST_READ_CONVERSION (codesys) = Qnil; + CODING_SYSTEM_EOL_TYPE (codesys) = EOL_AUTODETECT; + CODING_SYSTEM_EOL_CRLF (codesys) = Qnil; + CODING_SYSTEM_EOL_CR (codesys) = Qnil; + CODING_SYSTEM_EOL_LF (codesys) = Qnil; + CODING_SYSTEM_TYPE (codesys) = type; + + if (type == CODESYS_ISO2022) + { + int i; + for (i = 0; i < 4; i++) + CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i) = Qnil; + } + else if (type == CODESYS_CCL) + { + CODING_SYSTEM_CCL_DECODE (codesys) = Qnil; + CODING_SYSTEM_CCL_ENCODE (codesys) = Qnil; + } + + CODING_SYSTEM_NAME (codesys) = name; + + return codesys; +} + +/* Given a list of charset conversion specs as specified in a Lisp + program, parse it into STORE_HERE. */ + +static void +parse_charset_conversion_specs (charset_conversion_spec_dynarr *store_here, + Lisp_Object spec_list) +{ + Lisp_Object rest; + + EXTERNAL_LIST_LOOP (rest, spec_list) + { + Lisp_Object car = XCAR (rest); + Lisp_Object from, to; + struct charset_conversion_spec spec; + + if (!CONSP (car) || !CONSP (XCDR (car)) || !NILP (XCDR (XCDR (car)))) + signal_simple_error ("Invalid charset conversion spec", car); + from = Fget_charset (XCAR (car)); + to = Fget_charset (XCAR (XCDR (car))); + if (XCHARSET_TYPE (from) != XCHARSET_TYPE (to)) + signal_simple_error_2 + ("Attempted conversion between different charset types", + from, to); + spec.from_charset = from; + spec.to_charset = to; + + Dynarr_add (store_here, spec); + } +} + +/* Given a dynarr LOAD_HERE of internally-stored charset conversion + specs, return the equivalent as the Lisp programmer would see it. + + If LOAD_HERE is 0, return Qnil. */ + +static Lisp_Object +unparse_charset_conversion_specs (charset_conversion_spec_dynarr *load_here) +{ + int i; + Lisp_Object result = Qnil; + + if (!load_here) + return Qnil; + for (i = 0; i < Dynarr_length (load_here); i++) + { + struct charset_conversion_spec *ccs = + Dynarr_atp (load_here, i); + result = Fcons (list2 (ccs->from_charset, ccs->to_charset), result); + } + + return Fnreverse (result); +} + +DEFUN ("make-coding-system", Fmake_coding_system, 2, 4, 0, /* +Register symbol NAME as a coding system. + +TYPE describes the conversion method used and should be one of + +nil or 'undecided + Automatic conversion. XEmacs attempts to detect the coding system + used in the file. +'no-conversion + No conversion. Use this for binary files and such. On output, + graphic characters that are not in ASCII or Latin-1 will be + replaced by a ?. (For a no-conversion-encoded buffer, these + characters will only be present if you explicitly insert them.) +'shift-jis + Shift-JIS (a Japanese encoding commonly used in PC operating systems). +'iso2022 + Any ISO2022-compliant encoding. Among other things, this includes + JIS (the Japanese encoding commonly used for e-mail), EUC (the + standard Unix encoding for Japanese and other languages), and + Compound Text (the encoding used in X11). You can specify more + specific information about the conversion with the FLAGS argument. +'big5 + Big5 (the encoding commonly used for Taiwanese). +'ccl + The conversion is performed using a user-written pseudo-code + program. CCL (Code Conversion Language) is the name of this + pseudo-code. +'internal + Write out or read in the raw contents of the memory representing + the buffer's text. This is primarily useful for debugging + purposes, and is only enabled when XEmacs has been compiled with + DEBUG_XEMACS defined (via the --debug configure option). + WARNING: Reading in a file using 'internal conversion can result + in an internal inconsistency in the memory representing a + buffer's text, which will produce unpredictable results and may + cause XEmacs to crash. Under normal circumstances you should + never use 'internal conversion. + +DOC-STRING is a string describing the coding system. + +PROPS is a property list, describing the specific nature of the +character set. Recognized properties are: + +'mnemonic + String to be displayed in the modeline when this coding system is + active. + +'eol-type + End-of-line conversion to be used. It should be one of + + nil + Automatically detect the end-of-line type (LF, CRLF, + or CR). Also generate subsidiary coding systems named + `NAME-unix', `NAME-dos', and `NAME-mac', that are + identical to this coding system but have an EOL-TYPE + value of 'lf, 'crlf, and 'cr, respectively. + 'lf + The end of a line is marked externally using ASCII LF. + Since this is also the way that XEmacs represents an + end-of-line internally, specifying this option results + in no end-of-line conversion. This is the standard + format for Unix text files. + 'crlf + The end of a line is marked externally using ASCII + CRLF. This is the standard format for MS-DOS text + files. + 'cr + The end of a line is marked externally using ASCII CR. + This is the standard format for Macintosh text files. + t + Automatically detect the end-of-line type but do not + generate subsidiary coding systems. (This value is + converted to nil when stored internally, and + `coding-system-property' will return nil.) + +'post-read-conversion + Function called after a file has been read in, to perform the + decoding. Called with two arguments, BEG and END, denoting + a region of the current buffer to be decoded. + +'pre-write-conversion + Function called before a file is written out, to perform the + encoding. Called with two arguments, BEG and END, denoting + a region of the current buffer to be encoded. + + +The following additional properties are recognized if TYPE is 'iso2022: + +'charset-g0 +'charset-g1 +'charset-g2 +'charset-g3 + The character set initially designated to the G0 - G3 registers. + The value should be one of + + -- A charset object (designate that character set) + -- nil (do not ever use this register) + -- t (no character set is initially designated to + the register, but may be later on; this automatically + sets the corresponding `force-g*-on-output' property) + +'force-g0-on-output +'force-g1-on-output +'force-g2-on-output +'force-g2-on-output + If non-nil, send an explicit designation sequence on output before + using the specified register. + +'short + If non-nil, use the short forms "ESC $ @", "ESC $ A", and + "ESC $ B" on output in place of the full designation sequences + "ESC $ ( @", "ESC $ ( A", and "ESC $ ( B". + +'no-ascii-eol + If non-nil, don't designate ASCII to G0 at each end of line on output. + Setting this to non-nil also suppresses other state-resetting that + normally happens at the end of a line. + +'no-ascii-cntl + If non-nil, don't designate ASCII to G0 before control chars on output. + +'seven + If non-nil, use 7-bit environment on output. Otherwise, use 8-bit + environment. + +'lock-shift + If non-nil, use locking-shift (SO/SI) instead of single-shift + or designation by escape sequence. + +'no-iso6429 + If non-nil, don't use ISO6429's direction specification. + +'escape-quoted + If non-nil, literal control characters that are the same as + the beginning of a recognized ISO2022 or ISO6429 escape sequence + (in particular, ESC (0x1B), SO (0x0E), SI (0x0F), SS2 (0x8E), + SS3 (0x8F), and CSI (0x9B)) are "quoted" with an escape character + so that they can be properly distinguished from an escape sequence. + (Note that doing this results in a non-portable encoding.) This + encoding flag is used for byte-compiled files. Note that ESC + is a good choice for a quoting character because there are no + escape sequences whose second byte is a character from the Control-0 + or Control-1 character sets; this is explicitly disallowed by the + ISO2022 standard. + +'input-charset-conversion + A list of conversion specifications, specifying conversion of + characters in one charset to another when decoding is performed. + Each specification is a list of two elements: the source charset, + and the destination charset. + +'output-charset-conversion + A list of conversion specifications, specifying conversion of + characters in one charset to another when encoding is performed. + The form of each specification is the same as for + 'input-charset-conversion. + + +The following additional properties are recognized (and required) +if TYPE is 'ccl: + +'decode + CCL program used for decoding (converting to internal format). + +'encode + CCL program used for encoding (converting to external format). +*/ + (name, type, doc_string, props)) +{ + struct Lisp_Coding_System *codesys; + Lisp_Object rest, key, value; + enum coding_system_type ty; + int need_to_setup_eol_systems = 1; + + /* Convert type to constant */ + if (NILP (type) || EQ (type, Qundecided)) + { ty = CODESYS_AUTODETECT; } + else if (EQ (type, Qshift_jis)) { ty = CODESYS_SHIFT_JIS; } + else if (EQ (type, Qiso2022)) { ty = CODESYS_ISO2022; } + else if (EQ (type, Qbig5)) { ty = CODESYS_BIG5; } + else if (EQ (type, Qccl)) { ty = CODESYS_CCL; } + else if (EQ (type, Qno_conversion)) { ty = CODESYS_NO_CONVERSION; } +#ifdef DEBUG_XEMACS + else if (EQ (type, Qinternal)) { ty = CODESYS_INTERNAL; } +#endif + else + signal_simple_error ("Invalid coding system type", type); + + CHECK_SYMBOL (name); + + codesys = allocate_coding_system (ty, name); + + if (NILP (doc_string)) + doc_string = build_string (""); + else + CHECK_STRING (doc_string); + CODING_SYSTEM_DOC_STRING (codesys) = doc_string; + + EXTERNAL_PROPERTY_LIST_LOOP (rest, key, value, props) + { + if (EQ (key, Qmnemonic)) + { + if (!NILP (value)) + CHECK_STRING (value); + CODING_SYSTEM_MNEMONIC (codesys) = value; + } + + else if (EQ (key, Qeol_type)) + { + need_to_setup_eol_systems = NILP (value); + if (EQ (value, Qt)) + value = Qnil; + CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value); + } + + else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value; + else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value; + else if (ty == CODESYS_ISO2022) + { +#define FROB_INITIAL_CHARSET(charset_num) \ + CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, charset_num) = \ + ((EQ (value, Qt) || EQ (value, Qnil)) ? value : Fget_charset (value)) + + if (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0); + else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1); + else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2); + else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3); + +#define FROB_FORCE_CHARSET(charset_num) \ + CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (codesys, charset_num) = !NILP (value) + + else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0); + else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1); + else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2); + else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3); + +#define FROB_BOOLEAN_PROPERTY(prop) \ + CODING_SYSTEM_ISO2022_##prop (codesys) = !NILP (value) + + else if (EQ (key, Qshort)) FROB_BOOLEAN_PROPERTY (SHORT); + else if (EQ (key, Qno_ascii_eol)) FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL); + else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL); + else if (EQ (key, Qseven)) FROB_BOOLEAN_PROPERTY (SEVEN); + else if (EQ (key, Qlock_shift)) FROB_BOOLEAN_PROPERTY (LOCK_SHIFT); + else if (EQ (key, Qno_iso6429)) FROB_BOOLEAN_PROPERTY (NO_ISO6429); + else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED); + + else if (EQ (key, Qinput_charset_conversion)) + { + codesys->iso2022.input_conv = + Dynarr_new (charset_conversion_spec); + parse_charset_conversion_specs (codesys->iso2022.input_conv, + value); + } + else if (EQ (key, Qoutput_charset_conversion)) + { + codesys->iso2022.output_conv = + Dynarr_new (charset_conversion_spec); + parse_charset_conversion_specs (codesys->iso2022.output_conv, + value); + } + else + signal_simple_error ("Unrecognized property", key); + } + else if (EQ (type, Qccl)) + { + if (EQ (key, Qdecode)) + { + CHECK_VECTOR (value); + CODING_SYSTEM_CCL_DECODE (codesys) = value; + } + else if (EQ (key, Qencode)) + { + CHECK_VECTOR (value); + CODING_SYSTEM_CCL_ENCODE (codesys) = value; + } + else + signal_simple_error ("Unrecognized property", key); + } + else + signal_simple_error ("Unrecognized property", key); + } + + if (need_to_setup_eol_systems) + setup_eol_coding_systems (codesys); + + { + Lisp_Object codesys_obj; + XSETCODING_SYSTEM (codesys_obj, codesys); + Fputhash (name, codesys_obj, Vcoding_system_hashtable); + return codesys_obj; + } +} + +DEFUN ("copy-coding-system", Fcopy_coding_system, 2, 2, 0, /* +Copy OLD-CODING-SYSTEM to NEW-NAME. +If NEW-NAME does not name an existing coding system, a new one will +be created. +*/ + (old_coding_system, new_name)) +{ + Lisp_Object new_coding_system; + old_coding_system = Fget_coding_system (old_coding_system); + new_coding_system = Ffind_coding_system (new_name); + if (NILP (new_coding_system)) + { + XSETCODING_SYSTEM (new_coding_system, + allocate_coding_system + (XCODING_SYSTEM_TYPE (old_coding_system), + new_name)); + Fputhash (new_name, new_coding_system, Vcoding_system_hashtable); + } + + { + struct Lisp_Coding_System *to = XCODING_SYSTEM (new_coding_system); + struct Lisp_Coding_System *from = XCODING_SYSTEM (old_coding_system); + memcpy (((char *) to ) + sizeof (to->header), + ((char *) from) + sizeof (from->header), + sizeof (*from) - sizeof (from->header)); + to->name = new_name; + } + return new_coding_system; +} + +static Lisp_Object +subsidiary_coding_system (Lisp_Object coding_system, enum eol_type type) +{ + struct Lisp_Coding_System *cs = XCODING_SYSTEM (coding_system); + Lisp_Object new_coding_system; + + if (CODING_SYSTEM_EOL_TYPE (cs) != EOL_AUTODETECT) + return coding_system; + + switch (type) + { + case EOL_AUTODETECT: return coding_system; + case EOL_LF: new_coding_system = CODING_SYSTEM_EOL_LF (cs); break; + case EOL_CR: new_coding_system = CODING_SYSTEM_EOL_CR (cs); break; + case EOL_CRLF: new_coding_system = CODING_SYSTEM_EOL_CRLF (cs); break; + default: abort (); + } + + return NILP (new_coding_system) ? coding_system : new_coding_system; +} + +DEFUN ("subsidiary-coding-system", Fsubsidiary_coding_system, 2, 2, 0, /* +Return the subsidiary coding system of CODING-SYSTEM with eol type EOL-TYPE. +*/ + (coding_system, eol_type)) +{ + coding_system = Fget_coding_system (coding_system); + + return subsidiary_coding_system (coding_system, + symbol_to_eol_type (eol_type)); +} + + +/************************************************************************/ +/* Coding system accessors */ +/************************************************************************/ + +DEFUN ("coding-system-doc-string", Fcoding_system_doc_string, 1, 1, 0, /* +Return the doc string for CODING-SYSTEM. +*/ + (coding_system)) +{ + coding_system = Fget_coding_system (coding_system); + return XCODING_SYSTEM_DOC_STRING (coding_system); +} + +DEFUN ("coding-system-type", Fcoding_system_type, 1, 1, 0, /* +Return the type of CODING-SYSTEM. +*/ + (coding_system)) +{ + switch (XCODING_SYSTEM_TYPE (Fget_coding_system (coding_system))) + { + case CODESYS_AUTODETECT: return Qundecided; + case CODESYS_SHIFT_JIS: return Qshift_jis; + case CODESYS_ISO2022: return Qiso2022; + case CODESYS_BIG5: return Qbig5; + case CODESYS_CCL: return Qccl; + case CODESYS_NO_CONVERSION: return Qno_conversion; +#ifdef DEBUG_XEMACS + case CODESYS_INTERNAL: return Qinternal; +#endif + default: + abort (); + } + + return Qnil; /* not reached */ +} + +static +Lisp_Object coding_system_charset (Lisp_Object coding_system, int gnum) +{ + Lisp_Object cs + = XCODING_SYSTEM_ISO2022_INITIAL_CHARSET (coding_system, gnum); + + return CHARSETP (cs) ? XCHARSET_NAME (cs) : Qnil; +} + +DEFUN ("coding-system-charset", Fcoding_system_charset, 2, 2, 0, /* +Return initial charset of CODING-SYSTEM designated to GNUM. +GNUM allows 0 .. 3. +*/ + (coding_system, gnum)) +{ + coding_system = Fget_coding_system (coding_system); + CHECK_INT (gnum); + + return coding_system_charset (coding_system, XINT (gnum)); +} + +DEFUN ("coding-system-property", Fcoding_system_property, 2, 2, 0, /* +Return the PROP property of CODING-SYSTEM. +*/ + (coding_system, prop)) +{ + int i, ok = 0; + enum coding_system_type type; + + coding_system = Fget_coding_system (coding_system); + CHECK_SYMBOL (prop); + type = XCODING_SYSTEM_TYPE (coding_system); + + for (i = 0; !ok && i < Dynarr_length (the_codesys_prop_dynarr); i++) + if (EQ (Dynarr_at (the_codesys_prop_dynarr, i).sym, prop)) + { + ok = 1; + switch (Dynarr_at (the_codesys_prop_dynarr, i).prop_type) + { + case CODESYS_PROP_ALL_OK: + break; + + case CODESYS_PROP_ISO2022: + if (type != CODESYS_ISO2022) + signal_simple_error + ("Property only valid in ISO2022 coding systems", + prop); + break; + + case CODESYS_PROP_CCL: + if (type != CODESYS_CCL) + signal_simple_error + ("Property only valid in CCL coding systems", + prop); + break; + + default: + abort (); + } + } + + if (!ok) + signal_simple_error ("Unrecognized property", prop); + + if (EQ (prop, Qname)) + return XCODING_SYSTEM_NAME (coding_system); + else if (EQ (prop, Qtype)) + return Fcoding_system_type (coding_system); + else if (EQ (prop, Qdoc_string)) + return XCODING_SYSTEM_DOC_STRING (coding_system); + else if (EQ (prop, Qmnemonic)) + return XCODING_SYSTEM_MNEMONIC (coding_system); + else if (EQ (prop, Qeol_type)) + return eol_type_to_symbol (XCODING_SYSTEM_EOL_TYPE (coding_system)); + else if (EQ (prop, Qeol_lf)) + return XCODING_SYSTEM_EOL_LF (coding_system); + else if (EQ (prop, Qeol_crlf)) + return XCODING_SYSTEM_EOL_CRLF (coding_system); + else if (EQ (prop, Qeol_cr)) + return XCODING_SYSTEM_EOL_CR (coding_system); + else if (EQ (prop, Qpost_read_conversion)) + return XCODING_SYSTEM_POST_READ_CONVERSION (coding_system); + else if (EQ (prop, Qpre_write_conversion)) + return XCODING_SYSTEM_PRE_WRITE_CONVERSION (coding_system); + else if (type == CODESYS_ISO2022) + { + if (EQ (prop, Qcharset_g0)) + return coding_system_charset (coding_system, 0); + else if (EQ (prop, Qcharset_g1)) + return coding_system_charset (coding_system, 1); + else if (EQ (prop, Qcharset_g2)) + return coding_system_charset (coding_system, 2); + else if (EQ (prop, Qcharset_g3)) + return coding_system_charset (coding_system, 3); + +#define FORCE_CHARSET(charset_num) \ + (XCODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT \ + (coding_system, charset_num) ? Qt : Qnil) + + else if (EQ (prop, Qforce_g0_on_output)) return FORCE_CHARSET (0); + else if (EQ (prop, Qforce_g1_on_output)) return FORCE_CHARSET (1); + else if (EQ (prop, Qforce_g2_on_output)) return FORCE_CHARSET (2); + else if (EQ (prop, Qforce_g3_on_output)) return FORCE_CHARSET (3); + +#define LISP_BOOLEAN(prop) \ + (XCODING_SYSTEM_ISO2022_##prop (coding_system) ? Qt : Qnil) + + else if (EQ (prop, Qshort)) return LISP_BOOLEAN (SHORT); + else if (EQ (prop, Qno_ascii_eol)) return LISP_BOOLEAN (NO_ASCII_EOL); + else if (EQ (prop, Qno_ascii_cntl)) return LISP_BOOLEAN (NO_ASCII_CNTL); + else if (EQ (prop, Qseven)) return LISP_BOOLEAN (SEVEN); + else if (EQ (prop, Qlock_shift)) return LISP_BOOLEAN (LOCK_SHIFT); + else if (EQ (prop, Qno_iso6429)) return LISP_BOOLEAN (NO_ISO6429); + else if (EQ (prop, Qescape_quoted)) return LISP_BOOLEAN (ESCAPE_QUOTED); + + else if (EQ (prop, Qinput_charset_conversion)) + return + unparse_charset_conversion_specs + (XCODING_SYSTEM (coding_system)->iso2022.input_conv); + else if (EQ (prop, Qoutput_charset_conversion)) + return + unparse_charset_conversion_specs + (XCODING_SYSTEM (coding_system)->iso2022.output_conv); + else + abort (); + } + else if (type == CODESYS_CCL) + { + if (EQ (prop, Qdecode)) + return XCODING_SYSTEM_CCL_DECODE (coding_system); + else if (EQ (prop, Qencode)) + return XCODING_SYSTEM_CCL_ENCODE (coding_system); + else + abort (); + } + else + abort (); + + return Qnil; /* not reached */ +} + + +/************************************************************************/ +/* Coding category functions */ +/************************************************************************/ + +static int +decode_coding_category (Lisp_Object symbol) +{ + int i; + + CHECK_SYMBOL (symbol); + for (i = 0; i <= CODING_CATEGORY_LAST; i++) + if (EQ (coding_category_symbol[i], symbol)) + return i; + + signal_simple_error ("Unrecognized coding category", symbol); + return 0; /* not reached */ +} + +DEFUN ("coding-category-list", Fcoding_category_list, 0, 0, 0, /* +Return a list of all recognized coding categories. +*/ + ()) +{ + int i; + Lisp_Object list = Qnil; + + for (i = CODING_CATEGORY_LAST; i >= 0; i--) + list = Fcons (coding_category_symbol[i], list); + return list; +} + +DEFUN ("set-coding-priority-list", Fset_coding_priority_list, 1, 1, 0, /* +Change the priority order of the coding categories. +LIST should be list of coding categories, in descending order of +priority. Unspecified coding categories will be lower in priority +than all specified ones, in the same relative order they were in +previously. +*/ + (list)) +{ + int category_to_priority[CODING_CATEGORY_LAST + 1]; + int i, j; + Lisp_Object rest; + + /* First generate a list that maps coding categories to priorities. */ + + for (i = 0; i <= CODING_CATEGORY_LAST; i++) + category_to_priority[i] = -1; + + /* Highest priority comes from the specified list. */ + i = 0; + EXTERNAL_LIST_LOOP (rest, list) + { + int cat = decode_coding_category (XCAR (rest)); + + if (category_to_priority[cat] >= 0) + signal_simple_error ("Duplicate coding category in list", XCAR (rest)); + category_to_priority[cat] = i++; + } + + /* Now go through the existing categories by priority to retrieve + the categories not yet specified and preserve their priority + order. */ + for (j = 0; j <= CODING_CATEGORY_LAST; j++) + { + int cat = coding_category_by_priority[j]; + if (category_to_priority[cat] < 0) + category_to_priority[cat] = i++; + } + + /* Now we need to construct the inverse of the mapping we just + constructed. */ + + for (i = 0; i <= CODING_CATEGORY_LAST; i++) + coding_category_by_priority[category_to_priority[i]] = i; + + /* Phew! That was confusing. */ + return Qnil; +} + +DEFUN ("coding-priority-list", Fcoding_priority_list, 0, 0, 0, /* +Return a list of coding categories in descending order of priority. +*/ + ()) +{ + int i; + Lisp_Object list = Qnil; + + for (i = CODING_CATEGORY_LAST; i >= 0; i--) + list = Fcons (coding_category_symbol[coding_category_by_priority[i]], + list); + return list; +} + +DEFUN ("set-coding-category-system", Fset_coding_category_system, 2, 2, 0, /* +Change the coding system associated with a coding category. +*/ + (coding_category, coding_system)) +{ + int cat = decode_coding_category (coding_category); + + coding_system = Fget_coding_system (coding_system); + coding_category_system[cat] = coding_system; + return Qnil; +} + +DEFUN ("coding-category-system", Fcoding_category_system, 1, 1, 0, /* +Return the coding system associated with a coding category. +*/ + (coding_category)) +{ + int cat = decode_coding_category (coding_category); + Lisp_Object sys = coding_category_system[cat]; + + if (!NILP (sys)) + return XCODING_SYSTEM_NAME (sys); + return Qnil; +} + + +/************************************************************************/ +/* Detecting the encoding of data */ +/************************************************************************/ + +struct detection_state +{ + enum eol_type eol_type; + int seen_non_ascii; + int mask; + + struct + { + int mask; + int in_second_byte; + } + big5; + + struct + { + int mask; + int in_second_byte; + } + shift_jis; + + struct + { + int mask; + int initted; + struct iso2022_decoder iso; + unsigned int flags; + int high_byte_count; + unsigned int saw_single_shift:1; + } + iso2022; + + struct + { + int seen_anything; + int just_saw_cr; + } + eol; +}; + +static int +acceptable_control_char_p (int c) +{ + switch (c) + { + /* Allow and ignore control characters that you might + reasonably see in a text file */ + case '\r': + case '\n': + case '\t': + case 7: /* bell */ + case 8: /* backspace */ + case 11: /* vertical tab */ + case 12: /* form feed */ + case 26: /* MS-DOS C-z junk */ + case 31: /* '^_' -- for info */ + return 1; + default: + return 0; + } +} + +static int +mask_has_at_most_one_bit_p (int mask) +{ + /* Perhaps the only thing useful you learn from intensive Microsoft + technical interviews */ + return (mask & (mask - 1)) == 0; +} + +static enum eol_type +detect_eol_type (struct detection_state *st, CONST unsigned char *src, + unsigned int n) +{ + int c; + + while (n--) + { + c = *src++; + if (c == '\r') + st->eol.just_saw_cr = 1; + else + { + 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; + } + + return EOL_AUTODETECT; +} + +/* Attempt to determine the encoding and EOL type of the given text. + Before calling this function for the first type, you must initialize + st->eol_type as appropriate and initialize st->mask to ~0. + + st->eol_type holds the determined EOL type, or EOL_AUTODETECT if + not yet known. + + st->mask holds the determined coding category mask, or ~0 if only + ASCII has been seen so far. + + Returns: + + 0 == st->eol_type is EOL_AUTODETECT and/or more than coding category + is present in st->mask + 1 == definitive answers are here for both st->eol_type and st->mask +*/ + +static int +detect_coding_type (struct detection_state *st, CONST unsigned char *src, + unsigned int n, int just_do_eol) +{ + int c; + + if (st->eol_type == EOL_AUTODETECT) + st->eol_type = detect_eol_type (st, src, n); + + if (just_do_eol) + return st->eol_type != EOL_AUTODETECT; + + if (!st->seen_non_ascii) + { + for (; n; n--, src++) + { + c = *src; + if ((c < 0x20 && !acceptable_control_char_p (c)) || c >= 0x80) + { + st->seen_non_ascii = 1; + st->shift_jis.mask = ~0; + st->big5.mask = ~0; + st->iso2022.mask = ~0; + break; + } + } + } + + if (!n) + return 0; + + if (!mask_has_at_most_one_bit_p (st->iso2022.mask)) + st->iso2022.mask = detect_coding_iso2022 (st, src, n); + if (!mask_has_at_most_one_bit_p (st->shift_jis.mask)) + st->shift_jis.mask = detect_coding_sjis (st, src, n); + if (!mask_has_at_most_one_bit_p (st->big5.mask)) + st->big5.mask = detect_coding_big5 (st, src, n); + + st->mask = st->iso2022.mask | st->shift_jis.mask | st->big5.mask; + + { + int retval = mask_has_at_most_one_bit_p (st->mask); + st->mask |= CODING_CATEGORY_NO_CONVERSION_MASK; + return retval && st->eol_type != EOL_AUTODETECT; + } +} + +static Lisp_Object +coding_system_from_mask (int mask) +{ + if (mask == ~0) + { + /* If the file was entirely or basically ASCII, use the + default value of `buffer-file-coding-system'. */ + Lisp_Object retval = + XBUFFER (Vbuffer_defaults)->buffer_file_coding_system; + if (!NILP (retval)) + { + retval = Ffind_coding_system (retval); + if (NILP (retval)) + { + warn_when_safe + (Qbad_variable, Qwarning, + "Invalid `default-buffer-file-coding-system', set to nil"); + XBUFFER (Vbuffer_defaults)->buffer_file_coding_system = Qnil; + } + } + if (NILP (retval)) + retval = Fget_coding_system (Qno_conversion); + return retval; + } + else + { + int i; + int cat = -1; + + mask = postprocess_iso2022_mask (mask); + + /* Look through the coding categories by priority and find + the first one that is allowed. */ + for (i = 0; i <= CODING_CATEGORY_LAST; i++) + { + cat = coding_category_by_priority[i]; + if ((mask & (1 << cat)) && + !NILP (coding_category_system[cat])) + break; + } + if (cat >= 0) + return coding_category_system[cat]; + else + 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 + 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. */ + +void +determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, + enum eol_type *eol_type_in_out) +{ + struct detection_state decst; + + if (*eol_type_in_out == EOL_AUTODETECT) + *eol_type_in_out = XCODING_SYSTEM_EOL_TYPE (*codesys_in_out); + + xzero (decst); + decst.eol_type = *eol_type_in_out; + 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) + { + + while (1) + { + unsigned char random_buffer[4096]; + int nread; + + nread = Lstream_read (stream, random_buffer, sizeof (random_buffer)); + if (!nread) + break; + 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) + *codesys_in_out = coding_system_from_mask (decst.mask); + } + + /* If we absolutely can't determine the EOL type, just assume LF. */ + if (*eol_type_in_out == EOL_AUTODETECT) + *eol_type_in_out = EOL_LF; + + Lstream_rewind (stream); +} + +DEFUN ("detect-coding-region", Fdetect_coding_region, 2, 3, 0, /* +Detect coding system of the text in the region between START and END. +Returned a list of possible coding systems ordered by priority. +If only ASCII characters are found, it returns 'undecided or one of +its subsidiary coding systems according to a detected end-of-line +type. Optional arg BUFFER defaults to the current buffer. +*/ + (start, end, buffer)) +{ + Lisp_Object val = Qnil; + struct buffer *buf = decode_buffer (buffer, 0); + Bufpos b, e; + Lisp_Object instream, lb_instream; + Lstream *istr, *lb_istr; + struct detection_state decst; + struct gcpro gcpro1, gcpro2; + + get_buffer_range_char (buf, start, end, &b, &e, 0); + lb_instream = make_lisp_buffer_input_stream (buf, b, e, 0); + lb_istr = XLSTREAM (lb_instream); + instream = make_encoding_input_stream (lb_istr, Fget_coding_system (Qbinary)); + istr = XLSTREAM (instream); + GCPRO2 (instream, lb_instream); + xzero (decst); + decst.eol_type = EOL_AUTODETECT; + decst.mask = ~0; + while (1) + { + unsigned char random_buffer[4096]; + int nread = Lstream_read (istr, random_buffer, sizeof (random_buffer)); + + if (!nread) + break; + if (detect_coding_type (&decst, random_buffer, nread, 0)) + break; + } + + if (decst.mask == ~0) + val = subsidiary_coding_system (Fget_coding_system (Qundecided), + decst.eol_type); + else + { + int i; + + val = Qnil; + + decst.mask = postprocess_iso2022_mask (decst.mask); + + for (i = CODING_CATEGORY_LAST; i >= 0; i--) + { + int sys = coding_category_by_priority[i]; + if (decst.mask & (1 << sys)) + { + Lisp_Object codesys = coding_category_system[sys]; + if (!NILP (codesys)) + codesys = subsidiary_coding_system (codesys, decst.eol_type); + val = Fcons (codesys, val); + } + } + } + Lstream_close (istr); + UNGCPRO; + Lstream_delete (istr); + Lstream_delete (lb_istr); + return val; +} + + +/************************************************************************/ +/* Converting to internal Mule format ("decoding") */ +/************************************************************************/ + +/* A decoding stream is a stream used for decoding text (i.e. + converting from some external format to internal format). + The decoding-stream object keeps track of the actual coding + stream, the stream that is at the other end, and data that + needs to be persistent across the lifetime of the stream. */ + +/* Handle the EOL stuff related to just-read-in character C. + EOL_TYPE is the EOL type of the coding stream. + FLAGS is the current value of FLAGS in the coding stream, and may + be modified by this macro. (The macro only looks at the + CODING_STATE_CR flag.) DST is the Dynarr to which the decoded + bytes are to be written. You need to also define a local goto + label "label_continue_loop" that is at the end of the main + character-reading loop. + + If C is a CR character, then this macro handles it entirely and + jumps to label_continue_loop. Otherwise, this macro does not add + anything to DST, and continues normally. You should continue + processing C normally after this macro. */ + +#define DECODE_HANDLE_EOL_TYPE(eol_type, c, flags, dst) \ +do { \ + if (c == '\r') \ + { \ + if (eol_type == EOL_CR) \ + Dynarr_add (dst, '\n'); \ + else if (eol_type != EOL_CRLF || flags & CODING_STATE_CR) \ + Dynarr_add (dst, c); \ + else \ + flags |= CODING_STATE_CR; \ + goto label_continue_loop; \ + } \ + else if (flags & CODING_STATE_CR) \ + { /* eol_type == CODING_SYSTEM_EOL_CRLF */ \ + if (c != '\n') \ + Dynarr_add (dst, '\r'); \ + flags &= ~CODING_STATE_CR; \ + } \ +} while (0) + +/* C should be a binary character in the range 0 - 255; convert + to internal format and add to Dynarr DST. */ + +#define DECODE_ADD_BINARY_CHAR(c, dst) \ +do { \ + if (BYTE_ASCII_P (c)) \ + Dynarr_add (dst, c); \ + else if (BYTE_C1_P (c)) \ + { \ + Dynarr_add (dst, LEADING_BYTE_CONTROL_1); \ + Dynarr_add (dst, c + 0x20); \ + } \ + else \ + { \ + Dynarr_add (dst, LEADING_BYTE_LATIN_ISO8859_1); \ + Dynarr_add (dst, c); \ + } \ +} while (0) + +#define DECODE_OUTPUT_PARTIAL_CHAR(ch) \ +do { \ + if (ch) \ + { \ + DECODE_ADD_BINARY_CHAR (ch, dst); \ + ch = 0; \ + } \ +} while (0) + +#define DECODE_HANDLE_END_OF_CONVERSION(flags, ch, dst) \ +do { \ + DECODE_OUTPUT_PARTIAL_CHAR (ch); \ + if ((flags & CODING_STATE_END) && \ + (flags & CODING_STATE_CR)) \ + Dynarr_add (dst, '\r'); \ +} while (0) + +#define DECODING_STREAM_DATA(stream) LSTREAM_TYPE_DATA (stream, decoding) + +struct decoding_stream +{ + /* Coding system that governs the conversion. */ + struct Lisp_Coding_System *codesys; + + /* Stream that we read the encoded data from or + write the decoded data to. */ + Lstream *other_end; + + /* If we are reading, then we can return only a fixed amount of + data, so if the conversion resulted in too much data, we store it + here for retrieval the next time around. */ + unsigned_char_dynarr *runoff; + + /* FLAGS holds flags indicating the current state of the decoding. + Some of these flags are dependent on the coding system. */ + unsigned int flags; + + /* CH holds a partially built-up character. Since we only deal + with one- and two-byte characters at the moment, we only use + this to store the first byte of a two-byte character. */ + unsigned int ch; + + /* EOL_TYPE specifies the type of end-of-line conversion that + currently applies. We need to keep this separate from the + EOL type stored in CODESYS because the latter might indicate + automatic EOL-type detection while the former will always + indicate a particular EOL type. */ + enum eol_type eol_type; + + /* Additional ISO2022 information. We define the structure above + because it's also needed by the detection routines. */ + struct iso2022_decoder iso2022; + + /* Additional information (the state of the running CCL program) + used by the CCL decoder. */ + struct ccl_program ccl; + + struct detection_state decst; +}; + +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, + void (*markobj) (Lisp_Object)); + +DEFINE_LSTREAM_IMPLEMENTATION ("decoding", lstream_decoding, + sizeof (struct decoding_stream)); + +static Lisp_Object +decoding_marker (Lisp_Object stream, void (*markobj) (Lisp_Object)) +{ + Lstream *str = DECODING_STREAM_DATA (XLSTREAM (stream))->other_end; + Lisp_Object str_obj; + + /* We do not need to mark the coding systems or charsets stored + within the stream because they are stored in a global list + and automatically marked. */ + + XSETLSTREAM (str_obj, str); + (markobj) (str_obj); + if (str->imp->marker) + return (str->imp->marker) (str_obj, markobj); + else + return Qnil; +} + +/* 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 int +decoding_reader (Lstream *stream, unsigned char *data, size_t size) +{ + struct decoding_stream *str = DECODING_STREAM_DATA (stream); + unsigned char *orig_data = data; + int read_size; + int error_occurred = 0; + + /* We need to interface to mule_decode(), which expects to take some + amount of data and store the result into a Dynarr. We have + mule_decode() store into str->runoff, and take data from there + as necessary. */ + + /* We loop until we have enough data, reading chunks from the other + end and decoding it. */ + while (1) + { + /* Take data from the runoff if we can. Make sure to take at + most SIZE bytes, and delete the data from the runoff. */ + if (Dynarr_length (str->runoff) > 0) + { + size_t chunk = min (size, (size_t) Dynarr_length (str->runoff)); + memcpy (data, Dynarr_atp (str->runoff, 0), chunk); + Dynarr_delete_many (str->runoff, 0, chunk); + data += chunk; + size -= chunk; + } + + if (size == 0) + break; /* No more room for data */ + + if (str->flags & CODING_STATE_END) + /* This means that on the previous iteration, we hit the EOF on + the other end. We loop once more so that mule_decode() can + output any final stuff it may be holding, or any "go back + to a sane state" escape sequences. (This latter makes sense + during encoding.) */ + break; + + /* Exhausted the runoff, so get some more. DATA has at least + SIZE bytes left of storage in it, so it's OK to read directly + into it. (We'll be overwriting above, after we've decoded it + into the runoff.) */ + read_size = Lstream_read (str->other_end, data, size); + if (read_size < 0) + { + error_occurred = 1; + break; + } + if (read_size == 0) + /* There might be some more end data produced in the translation. + See the comment above. */ + str->flags |= CODING_STATE_END; + mule_decode (stream, data, str->runoff, read_size); + } + + if (data - orig_data == 0) + return error_occurred ? -1 : 0; + else + return data - orig_data; +} + +static int +decoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) +{ + struct decoding_stream *str = DECODING_STREAM_DATA (stream); + 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 + in writing. */ + mule_decode (stream, data, str->runoff, size); + retval = Lstream_write (str->other_end, Dynarr_atp (str->runoff, 0), + Dynarr_length (str->runoff)); + if (retval > 0) + Dynarr_delete_many (str->runoff, 0, retval); + /* Do NOT return retval. The return value indicates how much + of the incoming data was written, not how many bytes were + written. */ + return size; +} + +static void +reset_decoding_stream (struct decoding_stream *str) +{ + if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_ISO2022) + { + Lisp_Object coding_system; + XSETCODING_SYSTEM (coding_system, str->codesys); + reset_iso2022 (coding_system, &str->iso2022); + } + else if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_CCL) + { + setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_DECODE (str->codesys)); + } + + str->flags = str->ch = 0; +} + +static int +decoding_rewinder (Lstream *stream) +{ + struct decoding_stream *str = DECODING_STREAM_DATA (stream); + reset_decoding_stream (str); + Dynarr_reset (str->runoff); + return Lstream_rewind (str->other_end); +} + +static int +decoding_seekable_p (Lstream *stream) +{ + struct decoding_stream *str = DECODING_STREAM_DATA (stream); + return Lstream_seekable_p (str->other_end); +} + +static int +decoding_flusher (Lstream *stream) +{ + struct decoding_stream *str = DECODING_STREAM_DATA (stream); + return Lstream_flush (str->other_end); +} + +static int +decoding_closer (Lstream *stream) +{ + struct decoding_stream *str = DECODING_STREAM_DATA (stream); + if (stream->flags & LSTREAM_FL_WRITE) + { + str->flags |= CODING_STATE_END; + decoding_writer (stream, 0, 0); + } + Dynarr_free (str->runoff); + if (str->iso2022.composite_chars) + Dynarr_free (str->iso2022.composite_chars); + return Lstream_close (str->other_end); +} + +Lisp_Object +decoding_stream_coding_system (Lstream *stream) +{ + Lisp_Object coding_system; + struct decoding_stream *str = DECODING_STREAM_DATA (stream); + + XSETCODING_SYSTEM (coding_system, str->codesys); + return subsidiary_coding_system (coding_system, str->eol_type); +} + +void +set_decoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys) +{ + struct Lisp_Coding_System *cs = XCODING_SYSTEM (codesys); + struct decoding_stream *str = DECODING_STREAM_DATA (lstr); + str->codesys = cs; + if (CODING_SYSTEM_EOL_TYPE (cs) != EOL_AUTODETECT) + str->eol_type = CODING_SYSTEM_EOL_TYPE (cs); + reset_decoding_stream (str); +} + +/* WARNING WARNING WARNING WARNING!!!!! If you open up a decoding + stream for writing, no automatic code detection will be performed. + The reason for this is that automatic code detection requires a + seekable input. Things will also fail if you open a decoding + stream for reading using a non-fully-specified coding system and + a non-seekable input stream. */ + +static Lisp_Object +make_decoding_stream_1 (Lstream *stream, Lisp_Object codesys, + CONST char *mode) +{ + Lstream *lstr = Lstream_new (lstream_decoding, mode); + struct decoding_stream *str = DECODING_STREAM_DATA (lstr); + Lisp_Object obj; + + xzero (*str); + str->other_end = stream; + str->runoff = (unsigned_char_dynarr *) Dynarr_new (unsigned_char); + str->eol_type = EOL_AUTODETECT; + if (!strcmp (mode, "r") + && Lstream_seekable_p (stream)) + /* We can determine the coding system now. */ + determine_real_coding_system (stream, &codesys, &str->eol_type); + set_decoding_stream_coding_system (lstr, codesys); + str->decst.eol_type = str->eol_type; + str->decst.mask = ~0; + XSETLSTREAM (obj, lstr); + return obj; +} + +Lisp_Object +make_decoding_input_stream (Lstream *stream, Lisp_Object codesys) +{ + return make_decoding_stream_1 (stream, codesys, "r"); +} + +Lisp_Object +make_decoding_output_stream (Lstream *stream, Lisp_Object codesys) +{ + return make_decoding_stream_1 (stream, codesys, "w"); +} + +/* Note: the decode_coding_* functions all take the same + arguments as mule_decode(), which is to say some SRC data of + size N, which is to be stored into dynamic array DST. + DECODING is the stream within which the decoding is + taking place, but no data is actually read from or + written to that stream; that is handled in decoding_reader() + or decoding_writer(). This allows the same functions to + be used for both reading and writing. */ + +static void +mule_decode (Lstream *decoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) +{ + struct decoding_stream *str = DECODING_STREAM_DATA (decoding); + + /* If necessary, do encoding-detection now. We do this when + we're a writing stream or a non-seekable reading stream, + meaning that we can't just process the whole input, + rewind, and start over. */ + + if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT || + str->eol_type == EOL_AUTODETECT) + { + Lisp_Object codesys; + + XSETCODING_SYSTEM (codesys, str->codesys); + detect_coding_type (&str->decst, src, n, + CODING_SYSTEM_TYPE (str->codesys) != + CODESYS_AUTODETECT); + if (CODING_SYSTEM_TYPE (str->codesys) == CODESYS_AUTODETECT && + str->decst.mask != ~0) + /* #### This is cheesy. What we really ought to do is + buffer up a certain amount of data so as to get a + less random result. */ + codesys = coding_system_from_mask (str->decst.mask); + str->eol_type = str->decst.eol_type; + if (XCODING_SYSTEM (codesys) != str->codesys) + { + /* Preserve the CODING_STATE_END flag in case it was set. + If we erase it, bad things might happen. */ + int was_end = str->flags & CODING_STATE_END; + set_decoding_stream_coding_system (decoding, codesys); + if (was_end) + str->flags |= CODING_STATE_END; + } + } + + switch (CODING_SYSTEM_TYPE (str->codesys)) + { +#ifdef DEBUG_XEMACS + case CODESYS_INTERNAL: + Dynarr_add_many (dst, src, n); + break; +#endif + case CODESYS_AUTODETECT: + /* If we got this far and still haven't decided on the coding + system, then do no conversion. */ + case CODESYS_NO_CONVERSION: + decode_coding_no_conversion (decoding, src, dst, n); + break; + case CODESYS_SHIFT_JIS: + decode_coding_sjis (decoding, src, dst, n); + break; + case CODESYS_BIG5: + decode_coding_big5 (decoding, src, dst, n); + break; + case CODESYS_CCL: + ccl_driver (&str->ccl, src, dst, n, 0); + break; + case CODESYS_ISO2022: + decode_coding_iso2022 (decoding, src, dst, n); + break; + default: + abort (); + } +} + +DEFUN ("decode-coding-region", Fdecode_coding_region, 3, 4, 0, /* +Decode the text between START and END which is encoded in CODING-SYSTEM. +This is useful if you've read in encoded text from a file without decoding +it (e.g. you read in a JIS-formatted file but used the `binary' or +`no-conversion' coding system, so that it shows up as "^[$B!<!+^[(B"). +Return length of decoded text. +BUFFER defaults to the current buffer if unspecified. +*/ + (start, end, coding_system, buffer)) +{ + Bufpos b, e; + struct buffer *buf = decode_buffer (buffer, 0); + Lisp_Object instream, lb_outstream, de_outstream, outstream; + Lstream *istr, *ostr; + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; + + get_buffer_range_char (buf, start, end, &b, &e, 0); + + barf_if_buffer_read_only (buf, b, e); + + coding_system = Fget_coding_system (coding_system); + instream = make_lisp_buffer_input_stream (buf, b, e, 0); + lb_outstream = make_lisp_buffer_output_stream (buf, b, 0); + de_outstream = make_decoding_output_stream (XLSTREAM (lb_outstream), + coding_system); + outstream = make_encoding_output_stream (XLSTREAM (de_outstream), + Fget_coding_system (Qbinary)); + istr = XLSTREAM (instream); + ostr = XLSTREAM (outstream); + GCPRO4 (instream, lb_outstream, de_outstream, outstream); + + /* The chain of streams looks like this: + + [BUFFER] <----- send through + ------> [ENCODE AS BINARY] + ------> [DECODE AS SPECIFIED] + ------> [BUFFER] + */ + + while (1) + { + char tempbuf[1024]; /* some random amount */ + Bufpos newpos, even_newer_pos; + Bufpos oldpos = lisp_buffer_stream_startpos (istr); + int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); + + if (!size_in_bytes) + break; + newpos = lisp_buffer_stream_startpos (istr); + Lstream_write (ostr, tempbuf, size_in_bytes); + even_newer_pos = lisp_buffer_stream_startpos (istr); + buffer_delete_range (buf, even_newer_pos - (newpos - oldpos), + even_newer_pos, 0); + } + Lstream_close (istr); + Lstream_close (ostr); + UNGCPRO; + Lstream_delete (istr); + Lstream_delete (ostr); + Lstream_delete (XLSTREAM (de_outstream)); + Lstream_delete (XLSTREAM (lb_outstream)); + return Qnil; +} + + +/************************************************************************/ +/* Converting to an external encoding ("encoding") */ +/************************************************************************/ + +/* An encoding stream is an output stream. When you create the + stream, you specify the coding system that governs the encoding + and another stream that the resulting encoded data is to be + sent to, and then start sending data to it. */ + +#define ENCODING_STREAM_DATA(stream) LSTREAM_TYPE_DATA (stream, encoding) + +struct encoding_stream +{ + /* Coding system that governs the conversion. */ + struct Lisp_Coding_System *codesys; + + /* Stream that we read the encoded data from or + write the decoded data to. */ + Lstream *other_end; + + /* If we are reading, then we can return only a fixed amount of + data, so if the conversion resulted in too much data, we store it + here for retrieval the next time around. */ + unsigned_char_dynarr *runoff; + + /* FLAGS holds flags indicating the current state of the encoding. + Some of these flags are dependent on the coding system. */ + unsigned int flags; + + /* CH holds a partially built-up character. Since we only deal + with one- and two-byte characters at the moment, we only use + this to store the first byte of a two-byte character. */ + unsigned int ch; + + /* Additional information used by the ISO2022 encoder. */ + struct + { + /* CHARSET holds the character sets currently assigned to the G0 + through G3 registers. It is initialized from the array + INITIAL_CHARSET in CODESYS. */ + Lisp_Object charset[4]; + + /* Which registers are currently invoked into the left (GL) and + right (GR) halves of the 8-bit encoding space? */ + int register_left, register_right; + + /* Whether we need to explicitly designate the charset in the + G? register before using it. It is initialized from the + array FORCE_CHARSET_ON_OUTPUT in CODESYS. */ + unsigned char force_charset_on_output[4]; + + /* Other state variables that need to be preserved across + invocations. */ + Lisp_Object current_charset; + int current_half; + int current_char_boundary; + } iso2022; + + /* Additional information (the state of the running CCL program) + used by the CCL encoder. */ + struct ccl_program ccl; +}; + +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, + void (*markobj) (Lisp_Object)); + +DEFINE_LSTREAM_IMPLEMENTATION ("encoding", lstream_encoding, + sizeof (struct encoding_stream)); + +static Lisp_Object +encoding_marker (Lisp_Object stream, void (*markobj) (Lisp_Object)) +{ + Lstream *str = ENCODING_STREAM_DATA (XLSTREAM (stream))->other_end; + Lisp_Object str_obj; + + /* We do not need to mark the coding systems or charsets stored + within the stream because they are stored in a global list + and automatically marked. */ + + XSETLSTREAM (str_obj, str); + (markobj) (str_obj); + if (str->imp->marker) + return (str->imp->marker) (str_obj, markobj); + else + return Qnil; +} + +/* 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 int +encoding_reader (Lstream *stream, unsigned char *data, size_t size) +{ + struct encoding_stream *str = ENCODING_STREAM_DATA (stream); + unsigned char *orig_data = data; + int read_size; + int error_occurred = 0; + + /* We need to interface to mule_encode(), which expects to take some + amount of data and store the result into a Dynarr. We have + mule_encode() store into str->runoff, and take data from there + as necessary. */ + + /* We loop until we have enough data, reading chunks from the other + end and encoding it. */ + while (1) + { + /* Take data from the runoff if we can. Make sure to take at + most SIZE bytes, and delete the data from the runoff. */ + if (Dynarr_length (str->runoff) > 0) + { + int chunk = min ((int) size, Dynarr_length (str->runoff)); + memcpy (data, Dynarr_atp (str->runoff, 0), chunk); + Dynarr_delete_many (str->runoff, 0, chunk); + data += chunk; + size -= chunk; + } + + if (size == 0) + break; /* No more room for data */ + + if (str->flags & CODING_STATE_END) + /* This means that on the previous iteration, we hit the EOF on + the other end. We loop once more so that mule_encode() can + output any final stuff it may be holding, or any "go back + to a sane state" escape sequences. (This latter makes sense + during encoding.) */ + break; + + /* Exhausted the runoff, so get some more. DATA at least SIZE bytes + left of storage in it, so it's OK to read directly into it. + (We'll be overwriting above, after we've encoded it into the + runoff.) */ + read_size = Lstream_read (str->other_end, data, size); + if (read_size < 0) + { + error_occurred = 1; + break; + } + if (read_size == 0) + /* There might be some more end data produced in the translation. + See the comment above. */ + str->flags |= CODING_STATE_END; + mule_encode (stream, data, str->runoff, read_size); + } + + if (data == orig_data) + return error_occurred ? -1 : 0; + else + return data - orig_data; +} + +static int +encoding_writer (Lstream *stream, CONST unsigned char *data, size_t size) +{ + struct encoding_stream *str = ENCODING_STREAM_DATA (stream); + 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 + in writing. */ + mule_encode (stream, data, str->runoff, size); + retval = Lstream_write (str->other_end, Dynarr_atp (str->runoff, 0), + Dynarr_length (str->runoff)); + if (retval > 0) + Dynarr_delete_many (str->runoff, 0, retval); + /* Do NOT return retval. The return value indicates how much + of the incoming data was written, not how many bytes were + written. */ + return size; +} + +static void +reset_encoding_stream (struct encoding_stream *str) +{ + switch (CODING_SYSTEM_TYPE (str->codesys)) + { + case CODESYS_ISO2022: + { + int i; + + for (i = 0; i < 4; i++) + { + str->iso2022.charset[i] = + CODING_SYSTEM_ISO2022_INITIAL_CHARSET (str->codesys, i); + str->iso2022.force_charset_on_output[i] = + CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (str->codesys, i); + } + str->iso2022.register_left = 0; + str->iso2022.register_right = 1; + str->iso2022.current_charset = Qnil; + str->iso2022.current_half = 0; + str->iso2022.current_char_boundary = 1; + break; + } + case CODESYS_CCL: + setup_ccl_program (&str->ccl, CODING_SYSTEM_CCL_ENCODE (str->codesys)); + break; + default: + break; + } + + str->flags = str->ch = 0; +} + +static int +encoding_rewinder (Lstream *stream) +{ + struct encoding_stream *str = ENCODING_STREAM_DATA (stream); + reset_encoding_stream (str); + Dynarr_reset (str->runoff); + return Lstream_rewind (str->other_end); +} + +static int +encoding_seekable_p (Lstream *stream) +{ + struct encoding_stream *str = ENCODING_STREAM_DATA (stream); + return Lstream_seekable_p (str->other_end); +} + +static int +encoding_flusher (Lstream *stream) +{ + struct encoding_stream *str = ENCODING_STREAM_DATA (stream); + return Lstream_flush (str->other_end); +} + +static int +encoding_closer (Lstream *stream) +{ + struct encoding_stream *str = ENCODING_STREAM_DATA (stream); + if (stream->flags & LSTREAM_FL_WRITE) + { + str->flags |= CODING_STATE_END; + encoding_writer (stream, 0, 0); + } + Dynarr_free (str->runoff); + return Lstream_close (str->other_end); +} + +Lisp_Object +encoding_stream_coding_system (Lstream *stream) +{ + Lisp_Object coding_system; + struct encoding_stream *str = ENCODING_STREAM_DATA (stream); + + XSETCODING_SYSTEM (coding_system, str->codesys); + return coding_system; +} + +void +set_encoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys) +{ + struct Lisp_Coding_System *cs = XCODING_SYSTEM (codesys); + struct encoding_stream *str = ENCODING_STREAM_DATA (lstr); + str->codesys = cs; + reset_encoding_stream (str); +} + +static Lisp_Object +make_encoding_stream_1 (Lstream *stream, Lisp_Object codesys, + CONST char *mode) +{ + Lstream *lstr = Lstream_new (lstream_encoding, mode); + struct encoding_stream *str = ENCODING_STREAM_DATA (lstr); + Lisp_Object obj; + + xzero (*str); + str->runoff = Dynarr_new (unsigned_char); + str->other_end = stream; + set_encoding_stream_coding_system (lstr, codesys); + XSETLSTREAM (obj, lstr); + return obj; +} + +Lisp_Object +make_encoding_input_stream (Lstream *stream, Lisp_Object codesys) +{ + return make_encoding_stream_1 (stream, codesys, "r"); +} + +Lisp_Object +make_encoding_output_stream (Lstream *stream, Lisp_Object codesys) +{ + return make_encoding_stream_1 (stream, codesys, "w"); +} + +/* Convert N bytes of internally-formatted data stored in SRC to an + external format, according to the encoding stream ENCODING. + Store the encoded data into DST. */ + +static void +mule_encode (Lstream *encoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) +{ + struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); + + switch (CODING_SYSTEM_TYPE (str->codesys)) + { +#ifdef DEBUG_XEMACS + case CODESYS_INTERNAL: + Dynarr_add_many (dst, src, n); + break; +#endif + case CODESYS_AUTODETECT: + /* If we got this far and still haven't decided on the coding + system, then do no conversion. */ + case CODESYS_NO_CONVERSION: + encode_coding_no_conversion (encoding, src, dst, n); + break; + case CODESYS_SHIFT_JIS: + encode_coding_sjis (encoding, src, dst, n); + break; + case CODESYS_BIG5: + encode_coding_big5 (encoding, src, dst, n); + break; + case CODESYS_CCL: + ccl_driver (&str->ccl, src, dst, n, 0); + break; + case CODESYS_ISO2022: + encode_coding_iso2022 (encoding, src, dst, n); + break; + default: + abort (); + } +} + +DEFUN ("encode-coding-region", Fencode_coding_region, 3, 4, 0, /* +Encode the text between START and END using CODING-SYSTEM. +This will, for example, convert Japanese characters into stuff such as +"^[$B!<!+^[(B" if you use the JIS encoding. Return length of encoded +text. BUFFER defaults to the current buffer if unspecified. +*/ + (start, end, coding_system, buffer)) +{ + Bufpos b, e; + struct buffer *buf = decode_buffer (buffer, 0); + Lisp_Object instream, lb_outstream, de_outstream, outstream; + Lstream *istr, *ostr; + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; + + get_buffer_range_char (buf, start, end, &b, &e, 0); + + barf_if_buffer_read_only (buf, b, e); + + coding_system = Fget_coding_system (coding_system); + instream = make_lisp_buffer_input_stream (buf, b, e, 0); + lb_outstream = make_lisp_buffer_output_stream (buf, b, 0); + de_outstream = make_decoding_output_stream (XLSTREAM (lb_outstream), + Fget_coding_system (Qbinary)); + outstream = make_encoding_output_stream (XLSTREAM (de_outstream), + coding_system); + istr = XLSTREAM (instream); + ostr = XLSTREAM (outstream); + GCPRO4 (instream, outstream, de_outstream, lb_outstream); + /* The chain of streams looks like this: + + [BUFFER] <----- send through + ------> [ENCODE AS SPECIFIED] + ------> [DECODE AS BINARY] + ------> [BUFFER] + */ + while (1) + { + char tempbuf[1024]; /* some random amount */ + Bufpos newpos, even_newer_pos; + Bufpos oldpos = lisp_buffer_stream_startpos (istr); + int size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); + + if (!size_in_bytes) + break; + newpos = lisp_buffer_stream_startpos (istr); + Lstream_write (ostr, tempbuf, size_in_bytes); + even_newer_pos = lisp_buffer_stream_startpos (istr); + buffer_delete_range (buf, even_newer_pos - (newpos - oldpos), + even_newer_pos, 0); + } + + { + Charcount retlen = + lisp_buffer_stream_startpos (XLSTREAM (instream)) - b; + Lstream_close (istr); + Lstream_close (ostr); + UNGCPRO; + Lstream_delete (istr); + Lstream_delete (ostr); + Lstream_delete (XLSTREAM (de_outstream)); + Lstream_delete (XLSTREAM (lb_outstream)); + return make_int (retlen); + } +} + + +/************************************************************************/ +/* Shift-JIS methods */ +/************************************************************************/ + +/* Shift-JIS is a coding system encoding three character sets: ASCII, right + half of JISX0201-Kana, and JISX0208. An ASCII character is encoded + as is. A character of JISX0201-Kana (TYPE94 character set) is + encoded by "position-code + 0x80". A character of JISX0208 + (TYPE94x94 character set) is encoded in 2-byte but two + position-codes are divided and shifted so that it fit in the range + below. + + --- CODE RANGE of Shift-JIS --- + (character set) (range) + ASCII 0x00 .. 0x7F + JISX0201-Kana 0xA0 .. 0xDF + JISX0208 (1st byte) 0x80 .. 0x9F and 0xE0 .. 0xEF + (2nd byte) 0x40 .. 0x7E and 0x80 .. 0xFC + ------------------------------- + +*/ + +/* Is this the first byte of a Shift-JIS two-byte char? */ + +#define BYTE_SJIS_TWO_BYTE_1_P(c) \ + (((c) >= 0x81 && (c) <= 0x9F) || ((c) >= 0xE0 && (c) <= 0xEF)) + +/* Is this the second byte of a Shift-JIS two-byte char? */ + +#define BYTE_SJIS_TWO_BYTE_2_P(c) \ + (((c) >= 0x40 && (c) <= 0x7E) || ((c) >= 0x80 && (c) <= 0xFC)) + +#define BYTE_SJIS_KATAKANA_P(c) \ + ((c) >= 0xA1 && (c) <= 0xDF) + +static int +detect_coding_sjis (struct detection_state *st, CONST unsigned char *src, + unsigned int n) +{ + int c; + + while (n--) + { + c = *src++; + if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO) + return 0; + if (st->shift_jis.in_second_byte) + { + st->shift_jis.in_second_byte = 0; + if (c < 0x40) + return 0; + } + else if ((c >= 0x80 && c < 0xA0) || c >= 0xE0) + st->shift_jis.in_second_byte = 1; + } + return CODING_CATEGORY_SHIFT_JIS_MASK; +} + +/* Convert Shift-JIS data to internal format. */ + +static void +decode_coding_sjis (Lstream *decoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) +{ + unsigned char c; + unsigned int flags, ch; + enum eol_type eol_type; + struct decoding_stream *str = DECODING_STREAM_DATA (decoding); + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = str->eol_type; + + while (n--) + { + c = *src++; + + if (ch) + { + /* Previous character was first byte of Shift-JIS Kanji char. */ + if (BYTE_SJIS_TWO_BYTE_2_P (c)) + { + unsigned char e1, e2; + + Dynarr_add (dst, LEADING_BYTE_JAPANESE_JISX0208); + DECODE_SJIS (ch, c, e1, e2); + Dynarr_add (dst, e1); + Dynarr_add (dst, e2); + } + else + { + DECODE_ADD_BINARY_CHAR (ch, dst); + DECODE_ADD_BINARY_CHAR (c, dst); + } + ch = 0; + } + else + { + DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); + if (BYTE_SJIS_TWO_BYTE_1_P (c)) + ch = c; + else if (BYTE_SJIS_KATAKANA_P (c)) + { + Dynarr_add (dst, LEADING_BYTE_KATAKANA_JISX0201); + Dynarr_add (dst, c); + } + else + DECODE_ADD_BINARY_CHAR (c, dst); + } + label_continue_loop:; + } + + DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst); + + CODING_STREAM_COMPOSE (str, flags, ch); +} + +/* Convert internally-formatted data to Shift-JIS. */ + +static void +encode_coding_sjis (Lstream *encoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) +{ + unsigned char c; + struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); + unsigned int flags, ch; + enum eol_type eol_type; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); + + while (n--) + { + c = *src++; + if (c == '\n') + { + if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) + Dynarr_add (dst, '\r'); + if (eol_type != EOL_CR) + Dynarr_add (dst, '\n'); + ch = 0; + } + else if (BYTE_ASCII_P (c)) + { + Dynarr_add (dst, c); + ch = 0; + } + else if (BUFBYTE_LEADING_BYTE_P (c)) + ch = (c == LEADING_BYTE_KATAKANA_JISX0201 || + c == LEADING_BYTE_JAPANESE_JISX0208_1978 || + c == LEADING_BYTE_JAPANESE_JISX0208) ? c : 0; + else if (ch) + { + if (ch == LEADING_BYTE_KATAKANA_JISX0201) + { + Dynarr_add (dst, c); + ch = 0; + } + else if (ch == LEADING_BYTE_JAPANESE_JISX0208_1978 || + ch == LEADING_BYTE_JAPANESE_JISX0208) + ch = c; + else + { + unsigned char j1, j2; + ENCODE_SJIS (ch, c, j1, j2); + Dynarr_add (dst, j1); + Dynarr_add (dst, j2); + ch = 0; + } + } + } + + CODING_STREAM_COMPOSE (str, flags, ch); +} + +DEFUN ("decode-shift-jis-char", Fdecode_shift_jis_char, 1, 1, 0, /* +Decode a JISX0208 character of Shift-JIS coding-system. +CODE is the character code in Shift-JIS as a cons of type bytes. +Return the corresponding character. +*/ + (code)) +{ + unsigned char c1, c2, s1, s2; + + CHECK_CONS (code); + CHECK_INT (XCAR (code)); + CHECK_INT (XCDR (code)); + s1 = XINT (XCAR (code)); + s2 = XINT (XCDR (code)); + if (BYTE_SJIS_TWO_BYTE_1_P (s1) && + BYTE_SJIS_TWO_BYTE_2_P (s2)) + { + DECODE_SJIS (s1, s2, c1, c2); + return make_char (MAKE_CHAR (Vcharset_japanese_jisx0208, + c1 & 0x7F, c2 & 0x7F)); + } + else + return Qnil; +} + +DEFUN ("encode-shift-jis-char", Fencode_shift_jis_char, 1, 1, 0, /* +Encode a JISX0208 character CHAR to SHIFT-JIS coding-system. +Return the corresponding character code in SHIFT-JIS as a cons of two bytes. +*/ + (ch)) +{ + Lisp_Object charset; + int c1, c2, s1, s2; + + CHECK_CHAR_COERCE_INT (ch); + BREAKUP_CHAR (XCHAR (ch), charset, c1, c2); + if (EQ (charset, Vcharset_japanese_jisx0208)) + { + ENCODE_SJIS (c1 | 0x80, c2 | 0x80, s1, s2); + return Fcons (make_int (s1), make_int (s2)); + } + else + return Qnil; +} + + +/************************************************************************/ +/* Big5 methods */ +/************************************************************************/ + +/* BIG5 is a coding system encoding two character sets: ASCII and + Big5. An ASCII character is encoded as is. Big5 is a two-byte + character set and is encoded in two-byte. + + --- CODE RANGE of BIG5 --- + (character set) (range) + ASCII 0x00 .. 0x7F + Big5 (1st byte) 0xA1 .. 0xFE + (2nd byte) 0x40 .. 0x7E and 0xA1 .. 0xFE + -------------------------- + + Since the number of characters in Big5 is larger than maximum + characters in Emacs' charset (96x96), it can't be handled as one + charset. So, in Emacs, Big5 is devided into two: `charset-big5-1' + and `charset-big5-2'. Both <type>s are TYPE94x94. The former + contains frequently used characters and the latter contains less + frequently used characters. */ + +#define BYTE_BIG5_TWO_BYTE_1_P(c) \ + ((c) >= 0xA1 && (c) <= 0xFE) + +/* Is this the second byte of a Shift-JIS two-byte char? */ + +#define BYTE_BIG5_TWO_BYTE_2_P(c) \ + (((c) >= 0x40 && (c) <= 0x7E) || ((c) >= 0xA1 && (c) <= 0xFE)) + +/* Number of Big5 characters which have the same code in 1st byte. */ + +#define BIG5_SAME_ROW (0xFF - 0xA1 + 0x7F - 0x40) + +/* Code conversion macros. These are macros because they are used in + inner loops during code conversion. + + Note that temporary variables in macros introduce the classic + dynamic-scoping problems with variable names. We use capital- + lettered variables in the assumption that XEmacs does not use + capital letters in variables except in a very formalized way + (e.g. Qstring). */ + +/* Convert Big5 code (b1, b2) into its internal string representation + (lb, c1, c2). */ + +/* There is a much simpler way to split the Big5 charset into two. + For the moment I'm going to leave the algorithm as-is because it + claims to separate out the most-used characters into a single + charset, which perhaps will lead to optimizations in various + places. + + The way the algorithm works is something like this: + + Big5 can be viewed as a 94x157 charset, where the row is + encoded into the bytes 0xA1 .. 0xFE and the column is encoded + into the bytes 0x40 .. 0x7E and 0xA1 .. 0xFE. As for frequency, + the split between low and high column numbers is apparently + meaningless; ascending rows produce less and less frequent chars. + Therefore, we assign the lower half of rows (0xA1 .. 0xC8) to + the first charset, and the upper half (0xC9 .. 0xFE) to the + second. To do the conversion, we convert the character into + a single number where 0 .. 156 is the first row, 157 .. 313 + is the second, etc. That way, the characters are ordered by + decreasing frequency. Then we just chop the space in two + and coerce the result into a 94x94 space. + */ + +#define DECODE_BIG5(b1, b2, lb, c1, c2) do \ +{ \ + int B1 = b1, B2 = b2; \ + unsigned int I \ + = (B1 - 0xA1) * BIG5_SAME_ROW + B2 - (B2 < 0x7F ? 0x40 : 0x62); \ + \ + if (B1 < 0xC9) \ + { \ + lb = LEADING_BYTE_CHINESE_BIG5_1; \ + } \ + else \ + { \ + lb = LEADING_BYTE_CHINESE_BIG5_2; \ + I -= (BIG5_SAME_ROW) * (0xC9 - 0xA1); \ + } \ + c1 = I / (0xFF - 0xA1) + 0xA1; \ + c2 = I % (0xFF - 0xA1) + 0xA1; \ +} while (0) + +/* Convert the internal string representation of a Big5 character + (lb, c1, c2) into Big5 code (b1, b2). */ + +#define ENCODE_BIG5(lb, c1, c2, b1, b2) do \ +{ \ + unsigned int I = ((c1) - 0xA1) * (0xFF - 0xA1) + ((c2) - 0xA1); \ + \ + if (lb == LEADING_BYTE_CHINESE_BIG5_2) \ + { \ + I += BIG5_SAME_ROW * (0xC9 - 0xA1); \ + } \ + b1 = I / BIG5_SAME_ROW + 0xA1; \ + b2 = I % BIG5_SAME_ROW; \ + b2 += b2 < 0x3F ? 0x40 : 0x62; \ +} while (0) + +static int +detect_coding_big5 (struct detection_state *st, CONST unsigned char *src, + unsigned int n) +{ + int c; + + while (n--) + { + c = *src++; + if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO || + (c >= 0x80 && c <= 0xA0)) + return 0; + if (st->big5.in_second_byte) + { + st->big5.in_second_byte = 0; + if (c < 0x40 || (c >= 0x80 && c <= 0xA0)) + return 0; + } + else if (c >= 0xA1) + st->big5.in_second_byte = 1; + } + return CODING_CATEGORY_BIG5_MASK; +} + +/* Convert Big5 data to internal format. */ + +static void +decode_coding_big5 (Lstream *decoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) +{ + unsigned char c; + unsigned int flags, ch; + enum eol_type eol_type; + struct decoding_stream *str = DECODING_STREAM_DATA (decoding); + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = str->eol_type; + + while (n--) + { + c = *src++; + if (ch) + { + /* Previous character was first byte of Big5 char. */ + if (BYTE_BIG5_TWO_BYTE_2_P (c)) + { + unsigned char b1, b2, b3; + DECODE_BIG5 (ch, c, b1, b2, b3); + Dynarr_add (dst, b1); + Dynarr_add (dst, b2); + Dynarr_add (dst, b3); + } + else + { + DECODE_ADD_BINARY_CHAR (ch, dst); + DECODE_ADD_BINARY_CHAR (c, dst); + } + ch = 0; + } + else + { + DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); + if (BYTE_BIG5_TWO_BYTE_1_P (c)) + ch = c; + else + DECODE_ADD_BINARY_CHAR (c, dst); + } + label_continue_loop:; + } + + DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst); + + CODING_STREAM_COMPOSE (str, flags, ch); +} + +/* Convert internally-formatted data to Big5. */ + +static void +encode_coding_big5 (Lstream *encoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) +{ + unsigned char c; + struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); + unsigned int flags, ch; + enum eol_type eol_type; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); + + while (n--) + { + c = *src++; + if (c == '\n') + { + if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) + Dynarr_add (dst, '\r'); + if (eol_type != EOL_CR) + Dynarr_add (dst, '\n'); + } + else if (BYTE_ASCII_P (c)) + { + /* ASCII. */ + Dynarr_add (dst, c); + } + else if (BUFBYTE_LEADING_BYTE_P (c)) + { + if (c == LEADING_BYTE_CHINESE_BIG5_1 || + c == LEADING_BYTE_CHINESE_BIG5_2) + { + /* A recognized leading byte. */ + ch = c; + continue; /* not done with this character. */ + } + /* otherwise just ignore this character. */ + } + else if (ch == LEADING_BYTE_CHINESE_BIG5_1 || + ch == LEADING_BYTE_CHINESE_BIG5_2) + { + /* Previous char was a recognized leading byte. */ + ch = (ch << 8) | c; + continue; /* not done with this character. */ + } + else if (ch) + { + /* Encountering second byte of a Big5 character. */ + unsigned char b1, b2; + + ENCODE_BIG5 (ch >> 8, ch & 0xFF, c, b1, b2); + Dynarr_add (dst, b1); + Dynarr_add (dst, b2); + } + + ch = 0; + } + + CODING_STREAM_COMPOSE (str, flags, ch); +} + + +DEFUN ("decode-big5-char", Fdecode_big5_char, 1, 1, 0, /* +Decode a Big5 character CODE of BIG5 coding-system. +CODE is the character code in BIG5, a cons of two integers. +Return the corresponding character. +*/ + (code)) +{ + unsigned char c1, c2, b1, b2; + + CHECK_CONS (code); + CHECK_INT (XCAR (code)); + CHECK_INT (XCDR (code)); + b1 = XINT (XCAR (code)); + b2 = XINT (XCDR (code)); + if (BYTE_BIG5_TWO_BYTE_1_P (b1) && + BYTE_BIG5_TWO_BYTE_2_P (b2)) + { + int leading_byte; + Lisp_Object charset; + DECODE_BIG5 (b1, b2, leading_byte, c1, c2); + charset = CHARSET_BY_LEADING_BYTE (leading_byte); + return make_char (MAKE_CHAR (charset, c1 & 0x7F, c2 & 0x7F)); + } + else + return Qnil; +} + +DEFUN ("encode-big5-char", Fencode_big5_char, 1, 1, 0, /* +Encode the Big5 character CH to BIG5 coding-system. +Return the corresponding character code in Big5. +*/ + (ch)) +{ + Lisp_Object charset; + int c1, c2, b1, b2; + + CHECK_CHAR_COERCE_INT (ch); + BREAKUP_CHAR (XCHAR (ch), charset, c1, c2); + if (EQ (charset, Vcharset_chinese_big5_1) || + EQ (charset, Vcharset_chinese_big5_2)) + { + ENCODE_BIG5 (XCHARSET_LEADING_BYTE (charset), c1 | 0x80, c2 | 0x80, + b1, b2); + return Fcons (make_int (b1), make_int (b2)); + } + else + return Qnil; +} + + +/************************************************************************/ +/* ISO2022 methods */ +/************************************************************************/ + +/* The following note describes the coding system ISO2022 briefly. + Since the intention of this note is to help understanding of the + programs in this file, some parts are NOT ACCURATE or OVERLY + SIMPLIFIED. For thorough understanding, please refer to the + original document of ISO2022. + + ISO2022 provides many mechanisms to encode several character sets + in 7-bit and 8-bit environments. If one chooses 7-bit environment, + all text is encoded by codes of less than 128. This may make the + encoded text a little bit longer, but the text get more stability + to pass through several gateways (some of them strip off MSB). + + There are two kind of character sets: control character set and + graphic character set. The former contains control characters such + as `newline' and `escape' to provide control functions (control + functions are provided also by escape sequence). The latter + contains graphic characters such as 'A' and '-'. Emacs recognizes + two control character sets and many graphic character sets. + + Graphic character sets are classified into one of four types, + according to the dimension and number of characters in the set: + TYPE94, TYPE96, TYPE94x94, and TYPE96x96. In addition, each + character set is assigned an identification byte, unique for each + type, called "final character" (denoted as <F> hereafter). The <F> + of each character set is decided by ECMA(*) when it is registered + in ISO. Code range of <F> is 0x30..0x7F (0x30..0x3F are for + private use only). + + Note (*): ECMA = European Computer Manufacturers Association + + Here are examples of graphic character set [NAME(<F>)]: + o TYPE94 -- ASCII('B'), right-half-of-JISX0201('I'), ... + o TYPE96 -- right-half-of-ISO8859-1('A'), ... + o TYPE94x94 -- GB2312('A'), JISX0208('B'), ... + o TYPE96x96 -- none for the moment + + A code area (1byte=8bits) is divided into 4 areas, C0, GL, C1, and GR. + C0 [0x00..0x1F] -- control character plane 0 + GL [0x20..0x7F] -- graphic character plane 0 + C1 [0x80..0x9F] -- control character plane 1 + GR [0xA0..0xFF] -- graphic character plane 1 + + A control character set is directly designated and invoked to C0 or + C1 by an escape sequence. The most common case is that: + - ISO646's control character set is designated/invoked to C0, and + - ISO6429's control character set is designated/invoked to C1, + and usually these designations/invocations are omitted in encoded + text. In a 7-bit environment, only C0 can be used, and a control + character for C1 is encoded by an appropriate escape sequence to + fit into the environment. All control characters for C1 are + defined to have corresponding escape sequences. + + A graphic character set is at first designated to one of four + graphic registers (G0 through G3), then these graphic registers are + invoked to GL or GR. These designations and invocations can be + done independently. The most common case is that G0 is invoked to + GL, G1 is invoked to GR, and ASCII is designated to G0. Usually + these invocations and designations are omitted in encoded text. + In a 7-bit environment, only GL can be used. + + When a graphic character set of TYPE94 or TYPE94x94 is invoked to + GL, codes 0x20 and 0x7F of the GL area work as control characters + SPACE and DEL respectively, and code 0xA0 and 0xFF of GR area + should not be used. + + There are two ways of invocation: locking-shift and single-shift. + With locking-shift, the invocation lasts until the next different + invocation, whereas with single-shift, the invocation works only + for the following character and doesn't affect locking-shift. + Invocations are done by the following control characters or escape + sequences. + + ---------------------------------------------------------------------- + abbrev function cntrl escape seq description + ---------------------------------------------------------------------- + SI/LS0 (shift-in) 0x0F none invoke G0 into GL + SO/LS1 (shift-out) 0x0E none invoke G1 into GL + LS1R (locking-shift-1 right) none ESC '~' invoke G1 into GR + LS2 (locking-shift-2) none ESC 'n' invoke G2 into GL + LS2R (locking-shift-2 right) none ESC '}' invoke G2 into GR + LS3 (locking-shift-3) none ESC 'o' invoke G3 into GL + LS3R (locking-shift 3 right) none ESC '|' invoke G3 into GR + SS2 (single-shift-2) 0x8E ESC 'N' invoke G2 for one char + SS3 (single-shift-3) 0x8F ESC 'O' invoke G3 for one char + ---------------------------------------------------------------------- + The first four are for locking-shift. Control characters for these + functions are defined by macros ISO_CODE_XXX in `coding.h'. + + Designations are done by the following escape sequences. + ---------------------------------------------------------------------- + escape sequence description + ---------------------------------------------------------------------- + ESC '(' <F> designate TYPE94<F> to G0 + ESC ')' <F> designate TYPE94<F> to G1 + ESC '*' <F> designate TYPE94<F> to G2 + ESC '+' <F> designate TYPE94<F> to G3 + ESC ',' <F> designate TYPE96<F> to G0 (*) + ESC '-' <F> designate TYPE96<F> to G1 + ESC '.' <F> designate TYPE96<F> to G2 + ESC '/' <F> designate TYPE96<F> to G3 + ESC '$' '(' <F> designate TYPE94x94<F> to G0 (**) + ESC '$' ')' <F> designate TYPE94x94<F> to G1 + ESC '$' '*' <F> designate TYPE94x94<F> to G2 + ESC '$' '+' <F> designate TYPE94x94<F> to G3 + ESC '$' ',' <F> designate TYPE96x96<F> to G0 (*) + ESC '$' '-' <F> designate TYPE96x96<F> to G1 + ESC '$' '.' <F> designate TYPE96x96<F> to G2 + ESC '$' '/' <F> designate TYPE96x96<F> to G3 + ---------------------------------------------------------------------- + In this list, "TYPE94<F>" means a graphic character set of type TYPE94 + and final character <F>, and etc. + + Note (*): Although these designations are not allowed in ISO2022, + Emacs accepts them on decoding, and produces them on encoding + TYPE96 or TYPE96x96 character set in a coding system which is + characterized as 7-bit environment, non-locking-shift, and + non-single-shift. + + Note (**): If <F> is '@', 'A', or 'B', the intermediate character + '(' can be omitted. We call this as "short-form" here after. + + Now you may notice that there are a lot of ways for encoding the + same multilingual text in ISO2022. Actually, there exist many + coding systems such as Compound Text (used in X's inter client + communication, ISO-2022-JP (used in Japanese internet), ISO-2022-KR + (used in Korean internet), EUC (Extended UNIX Code, used in Asian + localized platforms), and all of these are variants of ISO2022. + + In addition to the above, Emacs handles two more kinds of escape + sequences: ISO6429's direction specification and Emacs' private + sequence for specifying character composition. + + ISO6429's direction specification takes the following format: + o CSI ']' -- end of the current direction + o CSI '0' ']' -- end of the current direction + o CSI '1' ']' -- start of left-to-right text + o CSI '2' ']' -- start of right-to-left text + The control character CSI (0x9B: control sequence introducer) is + abbreviated to the escape sequence ESC '[' in 7-bit environment. + + Character composition specification takes the following format: + o ESC '0' -- start character composition + o ESC '1' -- end character composition + Since these are not standard escape sequences of any ISO, the use + of them for these meanings is restricted to Emacs only. */ + +static void +reset_iso2022 (Lisp_Object coding_system, struct iso2022_decoder *iso) +{ + int i; + + for (i = 0; i < 4; i++) + { + if (!NILP (coding_system)) + iso->charset[i] = + XCODING_SYSTEM_ISO2022_INITIAL_CHARSET (coding_system, i); + else + iso->charset[i] = Qt; + iso->invalid_designated[i] = 0; + } + iso->esc = ISO_ESC_NOTHING; + iso->esc_bytes_index = 0; + iso->register_left = 0; + iso->register_right = 1; + iso->switched_dir_and_no_valid_charset_yet = 0; + iso->invalid_switch_dir = 0; + iso->output_direction_sequence = 0; + iso->output_literally = 0; + if (iso->composite_chars) + Dynarr_reset (iso->composite_chars); +} + +static int +fit_to_be_escape_quoted (unsigned char c) +{ + switch (c) + { + case ISO_CODE_ESC: + case ISO_CODE_CSI: + case ISO_CODE_SS2: + case ISO_CODE_SS3: + case ISO_CODE_SO: + case ISO_CODE_SI: + return 1; + + default: + return 0; + } +} + +/* Parse one byte of an ISO2022 escape sequence. + If the result is an invalid escape sequence, return 0 and + do not change anything in STR. Otherwise, if the result is + an incomplete escape sequence, update ISO2022.ESC and + ISO2022.ESC_BYTES and return -1. Otherwise, update + all the state variables (but not ISO2022.ESC_BYTES) and + return 1. + + If CHECK_INVALID_CHARSETS is non-zero, check for designation + or invocation of an invalid character set and treat that as + an unrecognized escape sequence. */ + +static int +parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso, + unsigned char c, unsigned int *flags, + int check_invalid_charsets) +{ + /* (1) If we're at the end of a designation sequence, CS is the + charset being designated and REG is the register to designate + it to. + + (2) If we're at the end of a locking-shift sequence, REG is + the register to invoke and HALF (0 == left, 1 == right) is + the half to invoke it into. + + (3) If we're at the end of a single-shift sequence, REG is + the register to invoke. */ + Lisp_Object cs = Qnil; + int reg, half; + + /* NOTE: This code does goto's all over the fucking place. + The reason for this is that we're basically implementing + a state machine here, and hierarchical languages like C + don't really provide a clean way of doing this. */ + + if (! (*flags & CODING_STATE_ESCAPE)) + /* At beginning of escape sequence; we need to reset our + escape-state variables. */ + iso->esc = ISO_ESC_NOTHING; + + iso->output_literally = 0; + iso->output_direction_sequence = 0; + + switch (iso->esc) + { + case ISO_ESC_NOTHING: + iso->esc_bytes_index = 0; + switch (c) + { + case ISO_CODE_ESC: /* Start escape sequence */ + *flags |= CODING_STATE_ESCAPE; + iso->esc = ISO_ESC; + goto not_done; + + case ISO_CODE_CSI: /* ISO6429 (specifying directionality) */ + *flags |= CODING_STATE_ESCAPE; + iso->esc = ISO_ESC_5_11; + goto not_done; + + case ISO_CODE_SO: /* locking shift 1 */ + reg = 1; half = 0; + goto locking_shift; + case ISO_CODE_SI: /* locking shift 0 */ + reg = 0; half = 0; + goto locking_shift; + + case ISO_CODE_SS2: /* single shift */ + reg = 2; + goto single_shift; + case ISO_CODE_SS3: /* single shift */ + reg = 3; + goto single_shift; + + default: /* Other control characters */ + return 0; + } + + case ISO_ESC: + switch (c) + { + /**** single shift ****/ + + case 'N': /* single shift 2 */ + reg = 2; + goto single_shift; + case 'O': /* single shift 3 */ + reg = 3; + goto single_shift; + + /**** locking shift ****/ + + case '~': /* locking shift 1 right */ + reg = 1; half = 1; + goto locking_shift; + case 'n': /* locking shift 2 */ + reg = 2; half = 0; + goto locking_shift; + case '}': /* locking shift 2 right */ + reg = 2; half = 1; + goto locking_shift; + case 'o': /* locking shift 3 */ + reg = 3; half = 0; + goto locking_shift; + case '|': /* locking shift 3 right */ + reg = 3; half = 1; + goto locking_shift; + + /**** composite ****/ + + case '0': + iso->esc = ISO_ESC_START_COMPOSITE; + *flags = (*flags & CODING_STATE_ISO2022_LOCK) | + CODING_STATE_COMPOSITE; + return 1; + + case '1': + iso->esc = ISO_ESC_END_COMPOSITE; + *flags = (*flags & CODING_STATE_ISO2022_LOCK) & + ~CODING_STATE_COMPOSITE; + return 1; + + /**** directionality ****/ + + case '[': + iso->esc = ISO_ESC_5_11; + goto not_done; + + /**** designation ****/ + + case '$': /* multibyte charset prefix */ + iso->esc = ISO_ESC_2_4; + goto not_done; + + default: + if (0x28 <= c && c <= 0x2F) + { + iso->esc = (enum iso_esc_flag) (c - 0x28 + ISO_ESC_2_8); + goto not_done; + } + + /* This function is called with CODESYS equal to nil when + doing coding-system detection. */ + if (!NILP (codesys) + && XCODING_SYSTEM_ISO2022_ESCAPE_QUOTED (codesys) + && fit_to_be_escape_quoted (c)) + { + iso->esc = ISO_ESC_LITERAL; + *flags &= CODING_STATE_ISO2022_LOCK; + return 1; + } + + /* bzzzt! */ + return 0; + } + + + + /**** directionality ****/ + + case ISO_ESC_5_11: /* ISO6429 direction control */ + if (c == ']') + { + *flags &= (CODING_STATE_ISO2022_LOCK & ~CODING_STATE_R2L); + goto directionality; + } + if (c == '0') iso->esc = ISO_ESC_5_11_0; + else if (c == '1') iso->esc = ISO_ESC_5_11_1; + else if (c == '2') iso->esc = ISO_ESC_5_11_2; + else return 0; + goto not_done; + + case ISO_ESC_5_11_0: + if (c == ']') + { + *flags &= (CODING_STATE_ISO2022_LOCK & ~CODING_STATE_R2L); + goto directionality; + } + return 0; + + case ISO_ESC_5_11_1: + if (c == ']') + { + *flags = (CODING_STATE_ISO2022_LOCK & ~CODING_STATE_R2L); + goto directionality; + } + return 0; + + case ISO_ESC_5_11_2: + if (c == ']') + { + *flags = (*flags & CODING_STATE_ISO2022_LOCK) | CODING_STATE_R2L; + goto directionality; + } + return 0; + + directionality: + iso->esc = ISO_ESC_DIRECTIONALITY; + /* Various junk here to attempt to preserve the direction sequences + literally in the text if they would otherwise be swallowed due + to invalid designations that don't show up as actual charset + changes in the text. */ + if (iso->invalid_switch_dir) + { + /* We already inserted a direction switch literally into the + text. We assume (#### this may not be right) that the + next direction switch is the one going the other way, + and we need to output that literally as well. */ + iso->output_literally = 1; + iso->invalid_switch_dir = 0; + } + else + { + int jj; + + /* If we are in the thrall of an invalid designation, + then stick the directionality sequence literally into the + output stream so it ends up in the original text again. */ + for (jj = 0; jj < 4; jj++) + if (iso->invalid_designated[jj]) + break; + if (jj < 4) + { + iso->output_literally = 1; + iso->invalid_switch_dir = 1; + } + else + /* Indicate that we haven't yet seen a valid designation, + so that if a switch-dir is directly followed by an + invalid designation, both get inserted literally. */ + iso->switched_dir_and_no_valid_charset_yet = 1; + } + return 1; + + + /**** designation ****/ + + case ISO_ESC_2_4: + if (0x28 <= c && c <= 0x2F) + { + iso->esc = (enum iso_esc_flag) (c - 0x28 + ISO_ESC_2_4_8); + goto not_done; + } + if (0x40 <= c && c <= 0x42) + { + cs = CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_94X94, c, + *flags & CODING_STATE_R2L ? + CHARSET_RIGHT_TO_LEFT : + CHARSET_LEFT_TO_RIGHT); + reg = 0; + goto designated; + } + return 0; + + default: + { + int type =-1; + + if (c < '0' || c > '~') + return 0; /* bad final byte */ + + if (iso->esc >= ISO_ESC_2_8 && + iso->esc <= ISO_ESC_2_15) + { + type = ((iso->esc >= ISO_ESC_2_12) ? + CHARSET_TYPE_96 : CHARSET_TYPE_94); + reg = (iso->esc - ISO_ESC_2_8) & 3; + } + else if (iso->esc >= ISO_ESC_2_4_8 && + iso->esc <= ISO_ESC_2_4_15) + { + type = ((iso->esc >= ISO_ESC_2_4_12) ? + CHARSET_TYPE_96X96 : CHARSET_TYPE_94X94); + reg = (iso->esc - ISO_ESC_2_4_8) & 3; + } + else + { + /* Can this ever be reached? -slb */ + abort(); + } + + cs = CHARSET_BY_ATTRIBUTES (type, c, + *flags & CODING_STATE_R2L ? + CHARSET_RIGHT_TO_LEFT : + CHARSET_LEFT_TO_RIGHT); + goto designated; + } + } + + not_done: + iso->esc_bytes[iso->esc_bytes_index++] = (unsigned char) c; + return -1; + + single_shift: + if (check_invalid_charsets && !CHARSETP (iso->charset[reg])) + /* can't invoke something that ain't there. */ + return 0; + iso->esc = ISO_ESC_SINGLE_SHIFT; + *flags &= CODING_STATE_ISO2022_LOCK; + if (reg == 2) + *flags |= CODING_STATE_SS2; + else + *flags |= CODING_STATE_SS3; + return 1; + + locking_shift: + if (check_invalid_charsets && + !CHARSETP (iso->charset[reg])) + /* can't invoke something that ain't there. */ + return 0; + if (half) + iso->register_right = reg; + else + iso->register_left = reg; + *flags &= CODING_STATE_ISO2022_LOCK; + iso->esc = ISO_ESC_LOCKING_SHIFT; + return 1; + + designated: + if (NILP (cs) && check_invalid_charsets) + { + iso->invalid_designated[reg] = 1; + iso->charset[reg] = Vcharset_ascii; + iso->esc = ISO_ESC_DESIGNATE; + *flags &= CODING_STATE_ISO2022_LOCK; + iso->output_literally = 1; + if (iso->switched_dir_and_no_valid_charset_yet) + { + /* We encountered a switch-direction followed by an + invalid designation. Ensure that the switch-direction + gets outputted; otherwise it will probably get eaten + when the text is written out again. */ + iso->switched_dir_and_no_valid_charset_yet = 0; + iso->output_direction_sequence = 1; + /* And make sure that the switch-dir going the other + way gets outputted, as well. */ + iso->invalid_switch_dir = 1; + } + return 1; + } + /* This function is called with CODESYS equal to nil when + doing coding-system detection. */ + if (!NILP (codesys)) + { + charset_conversion_spec_dynarr *dyn = + XCODING_SYSTEM (codesys)->iso2022.input_conv; + + if (dyn) + { + int i; + + for (i = 0; i < Dynarr_length (dyn); i++) + { + struct charset_conversion_spec *spec = Dynarr_atp (dyn, i); + if (EQ (cs, spec->from_charset)) + cs = spec->to_charset; + } + } + } + + iso->charset[reg] = cs; + iso->esc = ISO_ESC_DESIGNATE; + *flags &= CODING_STATE_ISO2022_LOCK; + if (iso->invalid_designated[reg]) + { + iso->invalid_designated[reg] = 0; + iso->output_literally = 1; + } + if (iso->switched_dir_and_no_valid_charset_yet) + iso->switched_dir_and_no_valid_charset_yet = 0; + return 1; +} + +static int +detect_coding_iso2022 (struct detection_state *st, CONST unsigned char *src, + unsigned int n) +{ + int c; + int mask; + + /* #### There are serious deficiencies in the recognition mechanism + here. This needs to be much smarter if it's going to cut it. */ + + if (!st->iso2022.initted) + { + reset_iso2022 (Qnil, &st->iso2022.iso); + st->iso2022.mask = (CODING_CATEGORY_ISO_7_MASK | + CODING_CATEGORY_ISO_8_DESIGNATE_MASK | + CODING_CATEGORY_ISO_8_1_MASK | + CODING_CATEGORY_ISO_8_2_MASK | + CODING_CATEGORY_ISO_LOCK_SHIFT_MASK); + st->iso2022.flags = 0; + st->iso2022.high_byte_count = 0; + st->iso2022.saw_single_shift = 0; + st->iso2022.initted = 1; + } + + mask = st->iso2022.mask; + + while (n--) + { + c = *src++; + if (c >= 0xA0) + { + mask &= ~CODING_CATEGORY_ISO_7_MASK; + st->iso2022.high_byte_count++; + } + else + { + if (st->iso2022.high_byte_count && !st->iso2022.saw_single_shift) + { + if (st->iso2022.high_byte_count & 1) + /* odd number of high bytes; assume not iso-8-2 */ + mask &= ~CODING_CATEGORY_ISO_8_2_MASK; + } + st->iso2022.high_byte_count = 0; + st->iso2022.saw_single_shift = 0; + if (c > 0x80) + mask &= ~CODING_CATEGORY_ISO_7_MASK; + } + if (!(st->iso2022.flags & CODING_STATE_ESCAPE) + && (BYTE_C0_P (c) || BYTE_C1_P (c))) + { /* control chars */ + switch (c) + { + /* Allow and ignore control characters that you might + reasonably see in a text file */ + case '\r': + case '\n': + case '\t': + case 7: /* bell */ + case 8: /* backspace */ + case 11: /* vertical tab */ + case 12: /* form feed */ + case 26: /* MS-DOS C-z junk */ + case 31: /* '^_' -- for info */ + goto label_continue_loop; + + default: + break; + } + } + + if ((st->iso2022.flags & CODING_STATE_ESCAPE) || BYTE_C0_P (c) + || BYTE_C1_P (c)) + { + if (parse_iso2022_esc (Qnil, &st->iso2022.iso, c, + &st->iso2022.flags, 0)) + { + switch (st->iso2022.iso.esc) + { + case ISO_ESC_DESIGNATE: + mask &= ~CODING_CATEGORY_ISO_8_1_MASK; + mask &= ~CODING_CATEGORY_ISO_8_2_MASK; + break; + case ISO_ESC_LOCKING_SHIFT: + mask = CODING_CATEGORY_ISO_LOCK_SHIFT_MASK; + goto ran_out_of_chars; + case ISO_ESC_SINGLE_SHIFT: + mask &= ~CODING_CATEGORY_ISO_8_DESIGNATE_MASK; + st->iso2022.saw_single_shift = 1; + break; + default: + break; + } + } + else + { + mask = 0; + goto ran_out_of_chars; + } + } + label_continue_loop:; + } + + ran_out_of_chars: + + return mask; +} + +static int +postprocess_iso2022_mask (int mask) +{ + /* #### kind of cheesy */ + /* If seven-bit ISO is allowed, then assume that the encoding is + entirely seven-bit and turn off the eight-bit ones. */ + if (mask & CODING_CATEGORY_ISO_7_MASK) + mask &= ~ (CODING_CATEGORY_ISO_8_DESIGNATE_MASK | + CODING_CATEGORY_ISO_8_1_MASK | + CODING_CATEGORY_ISO_8_2_MASK); + return mask; +} + +/* If FLAGS is a null pointer or specifies right-to-left motion, + output a switch-dir-to-left-to-right sequence to DST. + Also update FLAGS if it is not a null pointer. + If INTERNAL_P is set, we are outputting in internal format and + need to handle the CSI differently. */ + +static void +restore_left_to_right_direction (struct Lisp_Coding_System *codesys, + unsigned_char_dynarr *dst, + unsigned int *flags, + int internal_p) +{ + if (!flags || (*flags & CODING_STATE_R2L)) + { + if (CODING_SYSTEM_ISO2022_SEVEN (codesys)) + { + Dynarr_add (dst, ISO_CODE_ESC); + Dynarr_add (dst, '['); + } + else if (internal_p) + DECODE_ADD_BINARY_CHAR (ISO_CODE_CSI, dst); + else + Dynarr_add (dst, ISO_CODE_CSI); + Dynarr_add (dst, '0'); + Dynarr_add (dst, ']'); + if (flags) + *flags &= ~CODING_STATE_R2L; + } +} + +/* If FLAGS is a null pointer or specifies a direction different from + DIRECTION (which should be either CHARSET_RIGHT_TO_LEFT or + CHARSET_LEFT_TO_RIGHT), output the appropriate switch-dir escape + sequence to DST. Also update FLAGS if it is not a null pointer. + If INTERNAL_P is set, we are outputting in internal format and + need to handle the CSI differently. */ + +static void +ensure_correct_direction (int direction, struct Lisp_Coding_System *codesys, + unsigned_char_dynarr *dst, unsigned int *flags, + int internal_p) +{ + if ((!flags || (*flags & CODING_STATE_R2L)) && + direction == CHARSET_LEFT_TO_RIGHT) + restore_left_to_right_direction (codesys, dst, flags, internal_p); + else if (!CODING_SYSTEM_ISO2022_NO_ISO6429 (codesys) + && (!flags || !(*flags & CODING_STATE_R2L)) && + direction == CHARSET_RIGHT_TO_LEFT) + { + if (CODING_SYSTEM_ISO2022_SEVEN (codesys)) + { + Dynarr_add (dst, ISO_CODE_ESC); + Dynarr_add (dst, '['); + } + else if (internal_p) + DECODE_ADD_BINARY_CHAR (ISO_CODE_CSI, dst); + else + Dynarr_add (dst, ISO_CODE_CSI); + Dynarr_add (dst, '2'); + Dynarr_add (dst, ']'); + if (flags) + *flags |= CODING_STATE_R2L; + } +} + +/* Convert ISO2022-format data to internal format. */ + +static void +decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) +{ + unsigned char c; + unsigned int flags, ch; + enum eol_type eol_type; + struct decoding_stream *str = DECODING_STREAM_DATA (decoding); + Lisp_Object coding_system; + unsigned_char_dynarr *real_dst = dst; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = str->eol_type; + XSETCODING_SYSTEM (coding_system, str->codesys); + + if (flags & CODING_STATE_COMPOSITE) + dst = str->iso2022.composite_chars; + + while (n--) + { + c = *src++; + if (flags & CODING_STATE_ESCAPE) + { /* Within ESC sequence */ + int retval = parse_iso2022_esc (coding_system, &str->iso2022, + c, &flags, 1); + + if (retval) + { + switch (str->iso2022.esc) + { + case ISO_ESC_START_COMPOSITE: + if (str->iso2022.composite_chars) + Dynarr_reset (str->iso2022.composite_chars); + else + str->iso2022.composite_chars = Dynarr_new (unsigned_char); + dst = str->iso2022.composite_chars; + break; + case ISO_ESC_END_COMPOSITE: + { + Bufbyte comstr[MAX_EMCHAR_LEN]; + Bytecount len; + Emchar emch = lookup_composite_char (Dynarr_atp (dst, 0), + Dynarr_length (dst)); + dst = real_dst; + len = set_charptr_emchar (comstr, emch); + Dynarr_add_many (dst, comstr, len); + break; + } + + case ISO_ESC_LITERAL: + DECODE_ADD_BINARY_CHAR (c, dst); + break; + + default: + /* Everything else handled already */ + break; + } + } + + /* Attempted error recovery. */ + if (str->iso2022.output_direction_sequence) + ensure_correct_direction (flags & CODING_STATE_R2L ? + CHARSET_RIGHT_TO_LEFT : + CHARSET_LEFT_TO_RIGHT, + str->codesys, dst, 0, 1); + /* More error recovery. */ + if (!retval || str->iso2022.output_literally) + { + /* Output the (possibly invalid) sequence */ + int i; + for (i = 0; i < str->iso2022.esc_bytes_index; i++) + DECODE_ADD_BINARY_CHAR (str->iso2022.esc_bytes[i], dst); + flags &= CODING_STATE_ISO2022_LOCK; + if (!retval) + n++, src--;/* Repeat the loop with the same character. */ + else + { + /* No sense in reprocessing the final byte of the + escape sequence; it could mess things up anyway. + Just add it now. */ + DECODE_ADD_BINARY_CHAR (c, dst); + } + } + ch = 0; + } + else if (BYTE_C0_P (c) || BYTE_C1_P (c)) + { /* Control characters */ + + /***** Error-handling *****/ + + /* If we were in the middle of a character, dump out the + partial character. */ + DECODE_OUTPUT_PARTIAL_CHAR (ch); + + /* If we just saw a single-shift character, dump it out. + This may dump out the wrong sort of single-shift character, + but least it will give an indication that something went + wrong. */ + if (flags & CODING_STATE_SS2) + { + DECODE_ADD_BINARY_CHAR (ISO_CODE_SS2, dst); + flags &= ~CODING_STATE_SS2; + } + if (flags & CODING_STATE_SS3) + { + DECODE_ADD_BINARY_CHAR (ISO_CODE_SS3, dst); + flags &= ~CODING_STATE_SS3; + } + + /***** Now handle the control characters. *****/ + + /* Handle CR/LF */ + DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); + + flags &= CODING_STATE_ISO2022_LOCK; + + if (!parse_iso2022_esc (coding_system, &str->iso2022, c, &flags, 1)) + DECODE_ADD_BINARY_CHAR (c, dst); + } + else + { /* Graphic characters */ + Lisp_Object charset; + int lb; + int reg; + + DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); + + /* Now determine the charset. */ + reg = ((flags & CODING_STATE_SS2) ? 2 + : (flags & CODING_STATE_SS3) ? 3 + : !BYTE_ASCII_P (c) ? str->iso2022.register_right + : str->iso2022.register_left); + charset = str->iso2022.charset[reg]; + + /* Error checking: */ + if (NILP (charset) || str->iso2022.invalid_designated[reg] + || (((c & 0x7F) == ' ' || (c & 0x7F) == ISO_CODE_DEL) + && XCHARSET_CHARS (charset) == 94)) + /* Mrmph. We are trying to invoke a register that has no + or an invalid charset in it, or trying to add a character + outside the range of the charset. Insert that char literally + to preserve it for the output. */ + { + DECODE_OUTPUT_PARTIAL_CHAR (ch); + DECODE_ADD_BINARY_CHAR (c, dst); + } + + else + { + /* Things are probably hunky-dorey. */ + + /* Fetch reverse charset, maybe. */ + if (((flags & CODING_STATE_R2L) && + XCHARSET_DIRECTION (charset) == CHARSET_LEFT_TO_RIGHT) + || + (!(flags & CODING_STATE_R2L) && + XCHARSET_DIRECTION (charset) == CHARSET_RIGHT_TO_LEFT)) + { + Lisp_Object new_charset = + XCHARSET_REVERSE_DIRECTION_CHARSET (charset); + if (!NILP (new_charset)) + charset = new_charset; + } + + lb = XCHARSET_LEADING_BYTE (charset); + switch (XCHARSET_REP_BYTES (charset)) + { + case 1: /* ASCII */ + DECODE_OUTPUT_PARTIAL_CHAR (ch); + Dynarr_add (dst, c & 0x7F); + break; + + case 2: /* one-byte official */ + DECODE_OUTPUT_PARTIAL_CHAR (ch); + Dynarr_add (dst, lb); + Dynarr_add (dst, c | 0x80); + break; + + case 3: /* one-byte private or two-byte official */ + if (XCHARSET_PRIVATE_P (charset)) + { + DECODE_OUTPUT_PARTIAL_CHAR (ch); + Dynarr_add (dst, PRE_LEADING_BYTE_PRIVATE_1); + Dynarr_add (dst, lb); + Dynarr_add (dst, c | 0x80); + } + else + { + if (ch) + { + Dynarr_add (dst, lb); + Dynarr_add (dst, ch | 0x80); + Dynarr_add (dst, c | 0x80); + ch = 0; + } + else + ch = c; + } + break; + + default: /* two-byte private */ + if (ch) + { + Dynarr_add (dst, PRE_LEADING_BYTE_PRIVATE_2); + Dynarr_add (dst, lb); + Dynarr_add (dst, ch | 0x80); + Dynarr_add (dst, c | 0x80); + ch = 0; + } + else + ch = c; + } + } + + if (!ch) + flags &= CODING_STATE_ISO2022_LOCK; + } + + label_continue_loop:; + } + + if (flags & CODING_STATE_END) + DECODE_OUTPUT_PARTIAL_CHAR (ch); + + CODING_STREAM_COMPOSE (str, flags, ch); +} + + +/***** ISO2022 encoder *****/ + +/* Designate CHARSET into register REG. */ + +static void +iso2022_designate (Lisp_Object charset, unsigned char reg, + struct encoding_stream *str, unsigned_char_dynarr *dst) +{ + CONST char *inter94 = "()*+", *inter96= ",-./"; + unsigned int type; + unsigned char final; + Lisp_Object old_charset = str->iso2022.charset[reg]; + + str->iso2022.charset[reg] = charset; + if (!CHARSETP (charset)) + /* charset might be an initial nil or t. */ + return; + type = XCHARSET_TYPE (charset); + final = XCHARSET_FINAL (charset); + if (!str->iso2022.force_charset_on_output[reg] && + CHARSETP (old_charset) && + XCHARSET_TYPE (old_charset) == type && + XCHARSET_FINAL (old_charset) == final) + return; + + str->iso2022.force_charset_on_output[reg] = 0; + + { + charset_conversion_spec_dynarr *dyn = + str->codesys->iso2022.output_conv; + + if (dyn) + { + int i; + + for (i = 0; i < Dynarr_length (dyn); i++) + { + struct charset_conversion_spec *spec = Dynarr_atp (dyn, i); + if (EQ (charset, spec->from_charset)) + charset = spec->to_charset; + } + } + } + + Dynarr_add (dst, ISO_CODE_ESC); + switch (type) + { + case CHARSET_TYPE_94: + Dynarr_add (dst, inter94[reg]); + break; + case CHARSET_TYPE_96: + Dynarr_add (dst, inter96[reg]); + break; + case CHARSET_TYPE_94X94: + Dynarr_add (dst, '$'); + if (reg != 0 + || !(CODING_SYSTEM_ISO2022_SHORT (str->codesys)) + || final < '@' + || final > 'B') + Dynarr_add (dst, inter94[reg]); + break; + case CHARSET_TYPE_96X96: + Dynarr_add (dst, '$'); + Dynarr_add (dst, inter96[reg]); + break; + } + Dynarr_add (dst, final); +} + +static void +ensure_normal_shift (struct encoding_stream *str, unsigned_char_dynarr *dst) +{ + if (str->iso2022.register_left != 0) + { + Dynarr_add (dst, ISO_CODE_SI); + str->iso2022.register_left = 0; + } +} + +static void +ensure_shift_out (struct encoding_stream *str, unsigned_char_dynarr *dst) +{ + if (str->iso2022.register_left != 1) + { + Dynarr_add (dst, ISO_CODE_SO); + str->iso2022.register_left = 1; + } +} + +/* Convert internally-formatted data to ISO2022 format. */ + +static void +encode_coding_iso2022 (Lstream *encoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) +{ + unsigned char charmask, c; + unsigned int flags, ch; + enum eol_type eol_type; + unsigned char char_boundary; + struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); + struct Lisp_Coding_System *codesys = str->codesys; + int i; + Lisp_Object charset; + int half; + + /* 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; + int in_composite = 0; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); + char_boundary = str->iso2022.current_char_boundary; + charset = str->iso2022.current_charset; + half = str->iso2022.current_half; + + back_to_square_n: + while (n--) + { + c = *src++; + + if (BYTE_ASCII_P (c)) + { /* Processing ASCII character */ + ch = 0; + + restore_left_to_right_direction (codesys, dst, &flags, 0); + + /* Make sure G0 contains ASCII */ + if ((c > ' ' && c < ISO_CODE_DEL) || + !CODING_SYSTEM_ISO2022_NO_ASCII_CNTL (codesys)) + { + ensure_normal_shift (str, dst); + iso2022_designate (Vcharset_ascii, 0, str, dst); + } + + /* If necessary, restore everything to the default state + at end-of-line */ + if (c == '\n' && + !(CODING_SYSTEM_ISO2022_NO_ASCII_EOL (codesys))) + { + restore_left_to_right_direction (codesys, dst, &flags, 0); + + ensure_normal_shift (str, dst); + + for (i = 0; i < 4; i++) + { + Lisp_Object initial_charset = + CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i); + iso2022_designate (initial_charset, i, str, dst); + } + } + if (c == '\n') + { + if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) + Dynarr_add (dst, '\r'); + if (eol_type != EOL_CR) + Dynarr_add (dst, c); + } + else + { + if (CODING_SYSTEM_ISO2022_ESCAPE_QUOTED (codesys) + && fit_to_be_escape_quoted (c)) + Dynarr_add (dst, ISO_CODE_ESC); + Dynarr_add (dst, c); + } + char_boundary = 1; + } + + else if (BUFBYTE_LEADING_BYTE_P (c) || BUFBYTE_LEADING_BYTE_P (ch)) + { /* Processing Leading Byte */ + ch = 0; + charset = CHARSET_BY_LEADING_BYTE (c); + if (LEADING_BYTE_PREFIX_P(c)) + ch = c; + else if (!EQ (charset, Vcharset_control_1) + && !EQ (charset, Vcharset_composite)) + { + int reg; + + ensure_correct_direction (XCHARSET_DIRECTION (charset), + codesys, dst, &flags, 0); + + /* Now determine which register to use. */ + reg = -1; + for (i = 0; i < 4; i++) + { + if (EQ (charset, str->iso2022.charset[i]) || + EQ (charset, + CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i))) + { + reg = i; + break; + } + } + + if (reg == -1) + { + if (XCHARSET_GRAPHIC (charset) != 0) + { + if (!NILP (str->iso2022.charset[1]) && + (!CODING_SYSTEM_ISO2022_SEVEN (codesys) || + CODING_SYSTEM_ISO2022_LOCK_SHIFT (codesys))) + reg = 1; + else if (!NILP (str->iso2022.charset[2])) + reg = 2; + else if (!NILP (str->iso2022.charset[3])) + reg = 3; + else + reg = 0; + } + else + reg = 0; + } + + iso2022_designate (charset, reg, str, dst); + + /* Now invoke that register. */ + switch (reg) + { + case 0: + ensure_normal_shift (str, dst); + half = 0; + break; + + case 1: + if (CODING_SYSTEM_ISO2022_SEVEN (codesys)) + { + ensure_shift_out (str, dst); + half = 0; + } + else + half = 1; + break; + + case 2: + if (CODING_SYSTEM_ISO2022_SEVEN (str->codesys)) + { + Dynarr_add (dst, ISO_CODE_ESC); + Dynarr_add (dst, 'N'); + half = 0; + } + else + { + Dynarr_add (dst, ISO_CODE_SS2); + half = 1; + } + break; + + case 3: + if (CODING_SYSTEM_ISO2022_SEVEN (str->codesys)) + { + Dynarr_add (dst, ISO_CODE_ESC); + Dynarr_add (dst, 'O'); + half = 0; + } + else + { + Dynarr_add (dst, ISO_CODE_SS3); + half = 1; + } + break; + + default: + abort (); + } + } + char_boundary = 0; + } + else + { /* Processing Non-ASCII character */ + charmask = (half == 0 ? 0x7F : 0xFF); + char_boundary = 1; + if (EQ (charset, Vcharset_control_1)) + { + if (CODING_SYSTEM_ISO2022_ESCAPE_QUOTED (codesys) + && fit_to_be_escape_quoted (c)) + Dynarr_add (dst, ISO_CODE_ESC); + /* you asked for it ... */ + Dynarr_add (dst, c - 0x20); + } + else + { + switch (XCHARSET_REP_BYTES (charset)) + { + case 2: + Dynarr_add (dst, c & charmask); + break; + case 3: + if (XCHARSET_PRIVATE_P (charset)) + { + Dynarr_add (dst, c & charmask); + ch = 0; + } + else if (ch) + { + if (EQ (charset, Vcharset_composite)) + { + if (in_composite) + { + /* #### Bother! We don't know how to + handle this yet. */ + Dynarr_add (dst, '~'); + } + else + { + Emchar emch = MAKE_CHAR (Vcharset_composite, + ch & 0x7F, c & 0x7F); + Lisp_Object lstr = composite_char_string (emch); + saved_n = n; + saved_src = src; + in_composite = 1; + src = XSTRING_DATA (lstr); + n = XSTRING_LENGTH (lstr); + Dynarr_add (dst, ISO_CODE_ESC); + Dynarr_add (dst, '0'); /* start composing */ + } + } + else + { + Dynarr_add (dst, ch & charmask); + Dynarr_add (dst, c & charmask); + } + ch = 0; + } + else + { + ch = c; + char_boundary = 0; + } + break; + case 4: + if (ch) + { + Dynarr_add (dst, ch & charmask); + Dynarr_add (dst, c & charmask); + ch = 0; + } + else + { + ch = c; + char_boundary = 0; + } + break; + default: + abort (); + } + } + } + } + + if (in_composite) + { + n = saved_n; + src = saved_src; + in_composite = 0; + Dynarr_add (dst, ISO_CODE_ESC); + Dynarr_add (dst, '1'); /* end composing */ + goto back_to_square_n; /* Wheeeeeeeee ..... */ + } + + if (char_boundary && flags & CODING_STATE_END) + { + restore_left_to_right_direction (codesys, dst, &flags, 0); + ensure_normal_shift (str, dst); + for (i = 0; i < 4; i++) + { + Lisp_Object initial_charset = + CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i); + iso2022_designate (initial_charset, i, str, dst); + } + } + + CODING_STREAM_COMPOSE (str, flags, ch); + str->iso2022.current_char_boundary = char_boundary; + str->iso2022.current_charset = charset; + str->iso2022.current_half = half; + + /* Verbum caro factum est! */ +} + + +/************************************************************************/ +/* No-conversion methods */ +/************************************************************************/ + +/* This is used when reading in "binary" files -- i.e. files that may + 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, + unsigned_char_dynarr *dst, unsigned int n) +{ + unsigned char c; + unsigned int flags, ch; + enum eol_type eol_type; + struct decoding_stream *str = DECODING_STREAM_DATA (decoding); + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = str->eol_type; + + while (n--) + { + c = *src++; + + DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst); + DECODE_ADD_BINARY_CHAR (c, dst); + label_continue_loop:; + } + + DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst); + + CODING_STREAM_COMPOSE (str, flags, ch); +} + +static void +encode_coding_no_conversion (Lstream *encoding, CONST unsigned char *src, + unsigned_char_dynarr *dst, unsigned int n) +{ + unsigned char c; + struct encoding_stream *str = ENCODING_STREAM_DATA (encoding); + unsigned int flags, ch; + enum eol_type eol_type; + + CODING_STREAM_DECOMPOSE (str, flags, ch); + eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys); + + while (n--) + { + c = *src++; + if (c == '\n') + { + if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT) + Dynarr_add (dst, '\r'); + if (eol_type != EOL_CR) + Dynarr_add (dst, '\n'); + ch = 0; + } + else if (BYTE_ASCII_P (c)) + { + assert (ch == 0); + Dynarr_add (dst, c); + } + else if (BUFBYTE_LEADING_BYTE_P (c)) + { + assert (ch == 0); + if (c == LEADING_BYTE_LATIN_ISO8859_1 || + c == LEADING_BYTE_CONTROL_1) + ch = c; + else + Dynarr_add (dst, '~'); /* untranslatable character */ + } + else + { + if (ch == LEADING_BYTE_LATIN_ISO8859_1) + Dynarr_add (dst, c); + else if (ch == LEADING_BYTE_CONTROL_1) + { + assert (c < 0xC0); + Dynarr_add (dst, c - 0x20); + } + /* else it should be the second or third byte of an + untranslatable character, so ignore it */ + ch = 0; + } + } + + CODING_STREAM_COMPOSE (str, flags, ch); +} + + +/************************************************************************/ +/* Simple internal/external functions */ +/************************************************************************/ + +static Extbyte_dynarr *conversion_out_dynarr; +static Bufbyte_dynarr *conversion_in_dynarr; + +/* Determine coding system from coding format */ + +#define FILE_NAME_CODING_SYSTEM \ + ((NILP (Vfile_name_coding_system) || \ + (EQ ((Vfile_name_coding_system), Qbinary))) ? \ + Qnil : Fget_coding_system (Vfile_name_coding_system)) + +/* #### not correct for all values of `fmt'! */ +#define FMT_CODING_SYSTEM(fmt) \ + (((fmt) == FORMAT_FILENAME) ? FILE_NAME_CODING_SYSTEM : \ + ((fmt) == FORMAT_CTEXT ) ? Fget_coding_system (Qctext) : \ + ((fmt) == FORMAT_TERMINAL) ? FILE_NAME_CODING_SYSTEM : \ + Qnil) + +CONST Extbyte * +convert_to_external_format (CONST Bufbyte *ptr, + Bytecount len, + Extcount *len_out, + enum external_data_format fmt) +{ + Lisp_Object coding_system = FMT_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); +} + +CONST Bufbyte * +convert_from_external_format (CONST Extbyte *ptr, + Extcount len, + Bytecount *len_out, + enum external_data_format fmt) +{ + Lisp_Object coding_system = FMT_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_mule_coding (void) +{ + defsymbol (&Qbuffer_file_coding_system, "buffer-file-coding-system"); + deferror (&Qcoding_system_error, "coding-system-error", + "Coding-system error", Qio_error); + + DEFSUBR (Fcoding_system_p); + DEFSUBR (Ffind_coding_system); + DEFSUBR (Fget_coding_system); + DEFSUBR (Fcoding_system_list); + DEFSUBR (Fcoding_system_name); + DEFSUBR (Fmake_coding_system); + DEFSUBR (Fcopy_coding_system); + DEFSUBR (Fsubsidiary_coding_system); + + DEFSUBR (Fcoding_system_type); + DEFSUBR (Fcoding_system_doc_string); + DEFSUBR (Fcoding_system_charset); + DEFSUBR (Fcoding_system_property); + + DEFSUBR (Fcoding_category_list); + DEFSUBR (Fset_coding_priority_list); + DEFSUBR (Fcoding_priority_list); + DEFSUBR (Fset_coding_category_system); + DEFSUBR (Fcoding_category_system); + + DEFSUBR (Fdetect_coding_region); + DEFSUBR (Fdecode_coding_region); + DEFSUBR (Fencode_coding_region); + DEFSUBR (Fdecode_shift_jis_char); + DEFSUBR (Fencode_shift_jis_char); + DEFSUBR (Fdecode_big5_char); + DEFSUBR (Fencode_big5_char); + + defsymbol (&Qcoding_system_p, "coding-system-p"); + + defsymbol (&Qbig5, "big5"); + defsymbol (&Qshift_jis, "shift-jis"); + defsymbol (&Qno_conversion, "no-conversion"); + defsymbol (&Qccl, "ccl"); + defsymbol (&Qiso2022, "iso2022"); + + defsymbol (&Qmnemonic, "mnemonic"); + defsymbol (&Qeol_type, "eol-type"); + defsymbol (&Qpost_read_conversion, "post-read-conversion"); + defsymbol (&Qpre_write_conversion, "pre-write-conversion"); + + defsymbol (&Qcr, "cr"); + defsymbol (&Qlf, "lf"); + defsymbol (&Qcrlf, "crlf"); + defsymbol (&Qeol_cr, "eol-cr"); + defsymbol (&Qeol_lf, "eol-lf"); + defsymbol (&Qeol_crlf, "eol-crlf"); + + defsymbol (&Qcharset_g0, "charset-g0"); + defsymbol (&Qcharset_g1, "charset-g1"); + defsymbol (&Qcharset_g2, "charset-g2"); + defsymbol (&Qcharset_g3, "charset-g3"); + defsymbol (&Qforce_g0_on_output, "force-g0-on-output"); + defsymbol (&Qforce_g1_on_output, "force-g1-on-output"); + defsymbol (&Qforce_g2_on_output, "force-g2-on-output"); + defsymbol (&Qforce_g3_on_output, "force-g3-on-output"); + defsymbol (&Qshort, "short"); + defsymbol (&Qno_ascii_eol, "no-ascii-eol"); + defsymbol (&Qno_ascii_cntl, "no-ascii-cntl"); + defsymbol (&Qseven, "seven"); + defsymbol (&Qlock_shift, "lock-shift"); + defsymbol (&Qno_iso6429, "no-iso6429"); + defsymbol (&Qescape_quoted, "escape-quoted"); + defsymbol (&Qinput_charset_conversion, "input-charset-conversion"); + defsymbol (&Qoutput_charset_conversion, "output-charset-conversion"); + + defsymbol (&Qencode, "encode"); + defsymbol (&Qdecode, "decode"); + + defsymbol (&Qctext, "ctext"); + + defsymbol (&coding_category_symbol[CODING_CATEGORY_SHIFT_JIS], + "shift-jis"); + defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_7], + "iso-7"); + defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_DESIGNATE], + "iso-8-designate"); + defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_1], + "iso-8-1"); + defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_2], + "iso-8-2"); + defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_LOCK_SHIFT], + "iso-lock-shift"); + defsymbol (&coding_category_symbol[CODING_CATEGORY_BIG5], + "big5"); + defsymbol (&coding_category_symbol[CODING_CATEGORY_NO_CONVERSION], + "no-conversion"); +} + +void +lstream_type_create_mule_coding (void) +{ + LSTREAM_HAS_METHOD (decoding, reader); + LSTREAM_HAS_METHOD (decoding, writer); + LSTREAM_HAS_METHOD (decoding, rewinder); + LSTREAM_HAS_METHOD (decoding, seekable_p); + LSTREAM_HAS_METHOD (decoding, flusher); + LSTREAM_HAS_METHOD (decoding, closer); + LSTREAM_HAS_METHOD (decoding, marker); + + LSTREAM_HAS_METHOD (encoding, reader); + LSTREAM_HAS_METHOD (encoding, writer); + LSTREAM_HAS_METHOD (encoding, rewinder); + LSTREAM_HAS_METHOD (encoding, seekable_p); + LSTREAM_HAS_METHOD (encoding, flusher); + LSTREAM_HAS_METHOD (encoding, closer); + LSTREAM_HAS_METHOD (encoding, marker); +} + +void +vars_of_mule_coding (void) +{ + int i; + + /* Initialize to something reasonable ... */ + for (i = 0; i <= CODING_CATEGORY_LAST; i++) + { + coding_category_system[i] = Qnil; + coding_category_by_priority[i] = i; + } + + DEFVAR_LISP ("keyboard-coding-system", &Vkeyboard_coding_system /* +Coding system used for TTY keyboard input. +Not used under a windowing system. +*/ ); + Vkeyboard_coding_system = Qnil; + + DEFVAR_LISP ("terminal-coding-system", &Vterminal_coding_system /* +Coding system used for TTY display output. +Not used under a windowing system. +*/ ); + Vterminal_coding_system = Qnil; + + DEFVAR_LISP ("coding-system-for-read", &Vcoding_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. +*/ ); + Vcoding_system_for_read = Qnil; + + DEFVAR_LISP ("coding-system-for-write", + &Vcoding_system_for_write /* +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 /* +Coding system used to convert pathnames when accessing files. +*/ ); + Vfile_name_coding_system = Qnil; + + DEFVAR_BOOL ("enable-multibyte-characters", &enable_multibyte_characters /* +Non-nil means the buffer contents are regarded as multi-byte form +of characters, not a binary code. This affects the display, file I/O, +and behaviors of various editing commands. + +Setting this to nil does not do anything. +*/ ); + enable_multibyte_characters = 1; +} + +void +complex_vars_of_mule_coding (void) +{ + staticpro (&Vcoding_system_hashtable); + Vcoding_system_hashtable = make_lisp_hashtable (50, HASHTABLE_NONWEAK, + HASHTABLE_EQ); + + the_codesys_prop_dynarr = Dynarr_new (codesys_prop); + +#define DEFINE_CODESYS_PROP(Prop_Type, Sym) do \ +{ \ + struct codesys_prop csp; \ + csp.sym = (Sym); \ + csp.prop_type = (Prop_Type); \ + Dynarr_add (the_codesys_prop_dynarr, csp); \ +} while (0) + + DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qmnemonic); + DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qeol_type); + DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qeol_cr); + DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qeol_crlf); + DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qeol_lf); + DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qpost_read_conversion); + DEFINE_CODESYS_PROP (CODESYS_PROP_ALL_OK, Qpre_write_conversion); + + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g0); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g1); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g2); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qcharset_g3); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g0_on_output); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g1_on_output); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g2_on_output); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qforce_g3_on_output); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qshort); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qno_ascii_eol); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qno_ascii_cntl); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qseven); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qlock_shift); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qno_iso6429); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qescape_quoted); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qinput_charset_conversion); + DEFINE_CODESYS_PROP (CODESYS_PROP_ISO2022, Qoutput_charset_conversion); + + DEFINE_CODESYS_PROP (CODESYS_PROP_CCL, Qencode); + DEFINE_CODESYS_PROP (CODESYS_PROP_CCL, Qdecode); + + /* Need to create this here or we're really screwed. */ + 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 */ + coding_category_system[CODING_CATEGORY_NO_CONVERSION] = + Fget_coding_system (Qno_conversion); +} + +#endif diff --git a/src/mule-coding.h b/src/mule-coding.h new file mode 100644 index 0000000..7c631d9 --- /dev/null +++ b/src/mule-coding.h @@ -0,0 +1,450 @@ +/* Header for code conversion stuff + Copyright (C) 1991, 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. */ + +/* 91.10.09 written by K.Handa <handa@etl.go.jp> */ +/* Rewritten by Ben Wing <ben@xemacs.org>. */ + +#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 + struct Lisp_Coding_System. */ + +enum coding_system_type +{ + CODESYS_AUTODETECT, /* Automatic conversion. */ + CODESYS_SHIFT_JIS, /* Shift-JIS; Hankaku (half-width) KANA + is also supported. */ + CODESYS_ISO2022, /* Any ISO2022-compliant coding system. + Includes JIS, EUC, CTEXT */ + CODESYS_BIG5, /* BIG5 (used for Taiwanese). */ + CODESYS_CCL, /* Converter written in CCL. */ + CODESYS_NO_CONVERSION /* "No conversion"; used for binary files. + We use quotes because there really + is some conversion being applied, + but it appears to the user as if + the text is read in without conversion. */ +#ifdef DEBUG_XEMACS + ,CODESYS_INTERNAL /* Raw (internally-formatted) data. */ +#endif +}; + +enum eol_type +{ + EOL_AUTODETECT, + EOL_LF, + EOL_CRLF, + EOL_CR +}; + +typedef struct charset_conversion_spec charset_conversion_spec; +struct charset_conversion_spec +{ + Lisp_Object from_charset; + Lisp_Object to_charset; +}; + +typedef struct +{ + Dynarr_declare (charset_conversion_spec); +} charset_conversion_spec_dynarr; + +struct Lisp_Coding_System +{ + struct lcrecord_header header; + + /* Name and doc string of this coding system. */ + 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. */ + enum coding_system_type type; + + /* Mnemonic string displayed in the modeline when this coding + system is active for a particular buffer. */ + Lisp_Object mnemonic; + + Lisp_Object post_read_conversion, pre_write_conversion; + + 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, eol_crlf, eol_cr; + + struct + { + /* What are the charsets to be initially designated to G0, G1, + G2, G3? If t, no charset is initially designated. If nil, + no charset is initially designated and no charset is allowed + to be designated. */ + Lisp_Object initial_charset[4]; + + /* If true, a designation escape sequence needs to be sent on output + for the charset in G[0-3] before that charset is used. */ + unsigned char force_charset_on_output[4]; + + charset_conversion_spec_dynarr *input_conv; + charset_conversion_spec_dynarr *output_conv; + + unsigned int shoort :1; /* C makes you speak Dutch */ + unsigned int no_ascii_eol :1; + unsigned int no_ascii_cntl :1; + unsigned int seven :1; + unsigned int lock_shift :1; + unsigned int no_iso6429 :1; + unsigned int escape_quoted :1; + } iso2022; + + struct + { + /* For a CCL coding system, these specify the CCL programs used for + decoding (input) and encoding (output). */ + Lisp_Object decode, encode; + } ccl; +}; + +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) + +#define CODING_SYSTEM_NAME(codesys) ((codesys)->name) +#define CODING_SYSTEM_DOC_STRING(codesys) ((codesys)->doc_string) +#define CODING_SYSTEM_TYPE(codesys) ((codesys)->type) +#define CODING_SYSTEM_MNEMONIC(codesys) ((codesys)->mnemonic) +#define CODING_SYSTEM_POST_READ_CONVERSION(codesys) \ + ((codesys)->post_read_conversion) +#define CODING_SYSTEM_PRE_WRITE_CONVERSION(codesys) \ + ((codesys)->pre_write_conversion) +#define CODING_SYSTEM_EOL_TYPE(codesys) ((codesys)->eol_type) +#define CODING_SYSTEM_EOL_LF(codesys) ((codesys)->eol_lf) +#define CODING_SYSTEM_EOL_CRLF(codesys) ((codesys)->eol_crlf) +#define CODING_SYSTEM_EOL_CR(codesys) ((codesys)->eol_cr) +#define CODING_SYSTEM_ISO2022_INITIAL_CHARSET(codesys, g) \ + ((codesys)->iso2022.initial_charset[g]) +#define CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT(codesys, g) \ + ((codesys)->iso2022.force_charset_on_output[g]) +#define CODING_SYSTEM_ISO2022_SHORT(codesys) ((codesys)->iso2022.shoort) +#define CODING_SYSTEM_ISO2022_NO_ASCII_EOL(codesys) \ + ((codesys)->iso2022.no_ascii_eol) +#define CODING_SYSTEM_ISO2022_NO_ASCII_CNTL(codesys) \ + ((codesys)->iso2022.no_ascii_cntl) +#define CODING_SYSTEM_ISO2022_SEVEN(codesys) ((codesys)->iso2022.seven) +#define CODING_SYSTEM_ISO2022_LOCK_SHIFT(codesys) \ + ((codesys)->iso2022.lock_shift) +#define CODING_SYSTEM_ISO2022_NO_ISO6429(codesys) \ + ((codesys)->iso2022.no_iso6429) +#define CODING_SYSTEM_ISO2022_ESCAPE_QUOTED(codesys) \ + ((codesys)->iso2022.escape_quoted) +#define CODING_SYSTEM_CCL_DECODE(codesys) ((codesys)->ccl.decode) +#define CODING_SYSTEM_CCL_ENCODE(codesys) ((codesys)->ccl.encode) + +#define XCODING_SYSTEM_NAME(codesys) \ + CODING_SYSTEM_NAME (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_DOC_STRING(codesys) \ + CODING_SYSTEM_DOC_STRING (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_TYPE(codesys) \ + CODING_SYSTEM_TYPE (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_MNEMONIC(codesys) \ + CODING_SYSTEM_MNEMONIC (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_POST_READ_CONVERSION(codesys) \ + CODING_SYSTEM_POST_READ_CONVERSION (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_PRE_WRITE_CONVERSION(codesys) \ + CODING_SYSTEM_PRE_WRITE_CONVERSION (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_EOL_TYPE(codesys) \ + CODING_SYSTEM_EOL_TYPE (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_EOL_LF(codesys) \ + CODING_SYSTEM_EOL_LF (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_EOL_CRLF(codesys) \ + CODING_SYSTEM_EOL_CRLF (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_EOL_CR(codesys) \ + CODING_SYSTEM_EOL_CR (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_ISO2022_INITIAL_CHARSET(codesys, g) \ + CODING_SYSTEM_ISO2022_INITIAL_CHARSET (XCODING_SYSTEM (codesys), g) +#define XCODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT(codesys, g) \ + CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (XCODING_SYSTEM (codesys), g) +#define XCODING_SYSTEM_ISO2022_SHORT(codesys) \ + CODING_SYSTEM_ISO2022_SHORT (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_ISO2022_NO_ASCII_EOL(codesys) \ + CODING_SYSTEM_ISO2022_NO_ASCII_EOL (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_ISO2022_NO_ASCII_CNTL(codesys) \ + CODING_SYSTEM_ISO2022_NO_ASCII_CNTL (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_ISO2022_SEVEN(codesys) \ + CODING_SYSTEM_ISO2022_SEVEN (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_ISO2022_LOCK_SHIFT(codesys) \ + CODING_SYSTEM_ISO2022_LOCK_SHIFT (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_ISO2022_NO_ISO6429(codesys) \ + CODING_SYSTEM_ISO2022_NO_ISO6429 (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_ISO2022_ESCAPE_QUOTED(codesys) \ + CODING_SYSTEM_ISO2022_ESCAPE_QUOTED (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_CCL_DECODE(codesys) \ + CODING_SYSTEM_CCL_DECODE (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_CCL_ENCODE(codesys) \ + CODING_SYSTEM_CCL_ENCODE (XCODING_SYSTEM (codesys)) + +extern Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error; + +extern Lisp_Object Vkeyboard_coding_system; +extern Lisp_Object Vterminal_coding_system; +extern Lisp_Object Vcoding_system_for_read; +extern Lisp_Object Vcoding_system_for_write; +extern Lisp_Object Vpathname_coding_system; + +extern Lisp_Object Qescape_quoted; + +/* Flags indicating current state while converting code. */ + +/* Used by everyone. */ + +#define CODING_STATE_END (1 << 0) /* If set, this is the last chunk of + data being processed. When this + is finished, output any necessary + terminating control characters, + escape sequences, etc. */ +#define CODING_STATE_CR (1 << 1) /* If set, we just saw a CR. */ + + +/* Used by Big 5 on output. */ + +#define CODING_STATE_BIG5_1 (1 << 2) /* If set, we just encountered + LEADING_BYTE_BIG5_1. */ +#define CODING_STATE_BIG5_2 (1 << 3) /* If set, we just encountered + LEADING_BYTE_BIG5_2. */ + + +/* Used by ISO2022 on input and output. */ + +#define CODING_STATE_R2L (1 << 4) /* If set, the current + directionality is right-to-left. + Otherwise, it's left-to-right. */ + + +/* Used by ISO2022 on input. */ + +#define CODING_STATE_ESCAPE (1 << 5) /* If set, we're currently parsing + an escape sequence and the upper + 16 bits should be looked at to + indicate what partial escape + sequence we've seen so far. + Otherwise, we're running + through actual text. */ +#define CODING_STATE_SS2 (1 << 6) /* If set, G2 is invoked into GL, but + only for the next character. */ +#define CODING_STATE_SS3 (1 << 7) /* If set, G3 is invoked into GL, + but only for the next character. + If both CODING_STATE_SS2 and + CODING_STATE_SS3 are set, + CODING_STATE_SS2 overrides; but + this probably indicates an error + in the text encoding. */ +#define CODING_STATE_COMPOSITE (1 << 8) /* If set, we're currently processing + a composite character (i.e. a + character constructed by + overstriking two or more + characters). */ + + +/* CODING_STATE_ISO2022_LOCK is the mask of flags that remain on until + explicitly turned off when in the ISO2022 encoder/decoder. Other flags are + turned off at the end of processing each character or escape sequence. */ +# define CODING_STATE_ISO2022_LOCK \ + (CODING_STATE_END | CODING_STATE_COMPOSITE | CODING_STATE_R2L) +#define CODING_STATE_BIG5_LOCK \ + CODING_STATE_END + +/* Flags indicating what we've seen so far when parsing an + ISO2022 escape sequence. */ +enum iso_esc_flag +{ + /* Partial sequences */ + ISO_ESC_NOTHING, /* Nothing has been seen. */ + ISO_ESC, /* We've seen ESC. */ + ISO_ESC_2_4, /* We've seen ESC $. This indicates + that we're designating a multi-byte, rather + than a single-byte, character set. */ + ISO_ESC_2_8, /* We've seen ESC 0x28, i.e. ESC (. + This means designate a 94-character + character set into G0. */ + ISO_ESC_2_9, /* We've seen ESC 0x29 -- designate a + 94-character character set into G1. */ + ISO_ESC_2_10, /* We've seen ESC 0x2A. */ + ISO_ESC_2_11, /* We've seen ESC 0x2B. */ + ISO_ESC_2_12, /* We've seen ESC 0x2C -- designate a + 96-character character set into G0. + (This is not ISO2022-standard. + The following 96-character + control sequences are standard, + though.) */ + ISO_ESC_2_13, /* We've seen ESC 0x2D -- designate a + 96-character character set into G1. + */ + ISO_ESC_2_14, /* We've seen ESC 0x2E. */ + ISO_ESC_2_15, /* We've seen ESC 0x2F. */ + ISO_ESC_2_4_8, /* We've seen ESC $ 0x28 -- designate + a 94^N character set into G0. */ + ISO_ESC_2_4_9, /* We've seen ESC $ 0x29. */ + ISO_ESC_2_4_10, /* We've seen ESC $ 0x2A. */ + ISO_ESC_2_4_11, /* We've seen ESC $ 0x2B. */ + ISO_ESC_2_4_12, /* We've seen ESC $ 0x2C. */ + ISO_ESC_2_4_13, /* We've seen ESC $ 0x2D. */ + ISO_ESC_2_4_14, /* We've seen ESC $ 0x2E. */ + ISO_ESC_2_4_15, /* We've seen ESC $ 0x2F. */ + ISO_ESC_5_11, /* We've seen ESC [ or 0x9B. This + starts a directionality-control + sequence. The next character + must be 0, 1, 2, or ]. */ + ISO_ESC_5_11_0, /* We've seen 0x9B 0. The next + character must be ]. */ + ISO_ESC_5_11_1, /* We've seen 0x9B 1. The next + character must be ]. */ + ISO_ESC_5_11_2, /* We've seen 0x9B 2. The next + character must be ]. */ + + /* Full sequences. */ + ISO_ESC_START_COMPOSITE, /* Private usage for START COMPOSING */ + ISO_ESC_END_COMPOSITE, /* Private usage for END COMPOSING */ + ISO_ESC_SINGLE_SHIFT, /* We've seen a complete single-shift sequence. */ + ISO_ESC_LOCKING_SHIFT,/* We've seen a complete locking-shift sequence. */ + ISO_ESC_DESIGNATE, /* We've seen a complete designation sequence. */ + ISO_ESC_DIRECTIONALITY,/* We've seen a complete ISO6429 directionality + sequence. */ + ISO_ESC_LITERAL /* We've seen a literal character ala + escape-quoting. */ +}; + +/* Macros to define code of control characters for ISO2022's functions. */ + /* code */ /* function */ +#define ISO_CODE_LF 0x0A /* line-feed */ +#define ISO_CODE_CR 0x0D /* carriage-return */ +#define ISO_CODE_SO 0x0E /* shift-out */ +#define ISO_CODE_SI 0x0F /* shift-in */ +#define ISO_CODE_ESC 0x1B /* escape */ +#define ISO_CODE_DEL 0x7F /* delete */ +#define ISO_CODE_SS2 0x8E /* single-shift-2 */ +#define ISO_CODE_SS3 0x8F /* single-shift-3 */ +#define ISO_CODE_CSI 0x9B /* control-sequence-introduce */ + +/* Macros to access an encoding stream or decoding stream */ + +#define CODING_STREAM_DECOMPOSE(str, flags, ch) \ +do { \ + flags = (str)->flags; \ + ch = (str)->ch; \ +} while (0) + +#define CODING_STREAM_COMPOSE(str, flags, ch) \ +do { \ + (str)->flags = flags; \ + (str)->ch = ch; \ +} while (0) + + +/* For detecting the encoding of text */ +enum coding_category_type +{ + CODING_CATEGORY_SHIFT_JIS, + CODING_CATEGORY_ISO_7, /* ISO2022 system using only seven-bit bytes, + no locking shift */ + CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes, + no locking shift, no single shift, + using designation to switch charsets */ + CODING_CATEGORY_ISO_8_1, /* ISO2022 system using eight-bit bytes, + no locking shift, no designation sequences, + one-dimension characters in the upper half. */ + CODING_CATEGORY_ISO_8_2, /* ISO2022 system using eight-bit bytes, + no locking shift, no designation sequences, + two-dimension characters in the upper half. */ + CODING_CATEGORY_ISO_LOCK_SHIFT, /* ISO2022 system using locking shift */ + CODING_CATEGORY_BIG5, + CODING_CATEGORY_NO_CONVERSION +}; + +#define CODING_CATEGORY_LAST CODING_CATEGORY_NO_CONVERSION + +#define CODING_CATEGORY_SHIFT_JIS_MASK \ + (1 << CODING_CATEGORY_SHIFT_JIS) +#define CODING_CATEGORY_ISO_7_MASK \ + (1 << CODING_CATEGORY_ISO_7) +#define CODING_CATEGORY_ISO_8_DESIGNATE_MASK \ + (1 << CODING_CATEGORY_ISO_8_DESIGNATE) +#define CODING_CATEGORY_ISO_8_1_MASK \ + (1 << CODING_CATEGORY_ISO_8_1) +#define CODING_CATEGORY_ISO_8_2_MASK \ + (1 << CODING_CATEGORY_ISO_8_2) +#define CODING_CATEGORY_ISO_LOCK_SHIFT_MASK \ + (1 << CODING_CATEGORY_ISO_LOCK_SHIFT) +#define CODING_CATEGORY_BIG5_MASK \ + (1 << CODING_CATEGORY_BIG5) +#define CODING_CATEGORY_NO_CONVERSION_MASK \ + (1 << CODING_CATEGORY_NO_CONVERSION) +#define CODING_CATEGORY_NOT_FINISHED_MASK \ + (1 << 30) + +/* Convert shift-JIS code (sj1, sj2) into internal string + representation (c1, c2). (The leading byte is assumed.) */ + +#define DECODE_SJIS(sj1, sj2, c1, c2) \ +do { \ + int I1 = sj1, I2 = sj2; \ + if (I2 >= 0x9f) \ + c1 = (I1 << 1) - ((I1 >= 0xe0) ? 0xe0 : 0x60), \ + c2 = I2 + 2; \ + else \ + c1 = (I1 << 1) - ((I1 >= 0xe0) ? 0xe1 : 0x61), \ + c2 = I2 + ((I2 >= 0x7f) ? 0x60 : 0x61); \ +} while (0) + +/* Convert the internal string representation of a Shift-JIS character + (c1, c2) into Shift-JIS code (sj1, sj2). The leading byte is + assumed. */ + +#define ENCODE_SJIS(c1, c2, sj1, sj2) \ +do { \ + int I1 = c1, I2 = c2; \ + if (I1 & 1) \ + sj1 = (I1 >> 1) + ((I1 < 0xdf) ? 0x31 : 0x71), \ + sj2 = I2 - ((I2 >= 0xe0) ? 0x60 : 0x61); \ + else \ + sj1 = (I1 >> 1) + ((I1 < 0xdf) ? 0x30 : 0x70), \ + sj2 = I2 - 2; \ +} while (0) + +Lisp_Object make_decoding_input_stream (Lstream *stream, Lisp_Object codesys); +Lisp_Object make_encoding_input_stream (Lstream *stream, Lisp_Object codesys); +Lisp_Object make_decoding_output_stream (Lstream *stream, Lisp_Object codesys); +Lisp_Object make_encoding_output_stream (Lstream *stream, Lisp_Object codesys); +Lisp_Object decoding_stream_coding_system (Lstream *stream); +Lisp_Object encoding_stream_coding_system (Lstream *stream); +void set_decoding_stream_coding_system (Lstream *stream, Lisp_Object codesys); +void set_encoding_stream_coding_system (Lstream *stream, Lisp_Object codesys); +void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, + enum eol_type *eol_type_in_out); +#endif /* _XEMACS_MULE_CODING_H_ */ diff --git a/src/mule-mcpath.c b/src/mule-mcpath.c new file mode 100644 index 0000000..9e10b70 --- /dev/null +++ b/src/mule-mcpath.c @@ -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, shoule 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 --git a/src/mule-mcpath.h b/src/mule-mcpath.h new file mode 100644 index 0000000..0033b62 --- /dev/null +++ b/src/mule-mcpath.h @@ -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 --git a/src/mule-wnnfns.c b/src/mule-wnnfns.c index a393b25..a4c3629 100644 --- a/src/mule-wnnfns.c +++ b/src/mule-wnnfns.c @@ -1,4 +1,4 @@ -/* -*- coding: iso-2022-jp -*- +/* Copyright (C) 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. @@ -285,7 +285,7 @@ Boston, MA 02111-1307, USA. */ #define WNNSERVER_T 2 #define WNNSERVER_K 3 -int check_wnn_server_type (void); +int check_wnn_server_type (void); void w2m (w_char *wp, unsigned char *mp, unsigned char lb); void m2w (unsigned char *mp, w_char *wp); void w2y (w_char *w); @@ -321,14 +321,14 @@ Lisp_Object Vwnn_server_type; Lisp_Object Vcwnn_zhuyin; Lisp_Object Vwnnenv_sticky; Lisp_Object Vwnn_uniq_level; -Fixnum lb_sisheng; +int lb_sisheng; /* Lisp functions definition */ DEFUN ("wnn-server-open", Fwnn_open, 2, 2, 0, /* Connect to jserver of host HNAME, make an environment with login name LNAME in the server. -Return nil if error occurs. +Return nil if error occurs */ (hname, lname)) { @@ -348,7 +348,7 @@ Return nil if error occurs. case WNNSERVER_C: langname = "zh_CN"; break; -/* +/* case WNNSERVER_T: strcpy (langname, "zh_TW"); break; @@ -408,7 +408,7 @@ Return nil if error occurs. DEFUN ("wnn-server-close", Fwnn_close, 0, 0, 0, /* -Close the connection to jserver, Dictionary and frequency files +Close the connection to jserver, Dictionary and friquency files are not saved. */ ()) @@ -418,13 +418,13 @@ are not saved. if (!wnnfns_buf[snum]) return Qnil; if (wnnfns_env_norm[snum]) { - if (NILP (Vwnnenv_sticky)) jl_env_un_sticky_e (wnnfns_env_norm[snum]); + if (EQ(Vwnnenv_sticky, Qnil)) jl_env_un_sticky_e (wnnfns_env_norm[snum]); else jl_env_sticky_e (wnnfns_env_norm[snum]); jl_disconnect (wnnfns_env_norm[snum]); } if (wnnfns_env_rev[snum]) { - if (NILP (Vwnnenv_sticky)) jl_env_un_sticky_e (wnnfns_env_rev[snum]); + if (EQ(Vwnnenv_sticky, Qnil)) jl_env_un_sticky_e (wnnfns_env_rev[snum]); else jl_env_sticky_e (wnnfns_env_rev[snum]); jl_disconnect (wnnfns_env_rev[snum]); } @@ -447,21 +447,21 @@ Specify password files of dictionary and frequency, PW1 and PW2, if needed. CHECK_STRING (args[0]); CHECK_STRING (args[1]); CHECK_INT (args[2]); - if (! NILP (args[5])) CHECK_STRING (args[5]); - if (! NILP (args[6])) CHECK_STRING (args[6]); + if (!EQ(args[5], Qnil)) CHECK_STRING (args[5]); + if (!EQ(args[6], Qnil)) CHECK_STRING (args[6]); if ((snum = check_wnn_server_type ()) == -1) return Qnil; if (!wnnfns_buf[snum]) return Qnil; GCPRO1 (*args); gcpro1.nvars = nargs; if (jl_dic_add (wnnfns_buf[snum], - XSTRING_DATA (args[0]), - XSTRING_DATA (args[1]), + XSTRING (args[0])->_data, + XSTRING (args[1])->_data, wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV, XINT (args[2]), - NILP (args[3]) ? WNN_DIC_RDONLY : WNN_DIC_RW, - NILP (args[4]) ? WNN_DIC_RDONLY : WNN_DIC_RW, - NILP (args[5]) ? 0 : XSTRING_DATA (args[5]), - NILP (args[6]) ? 0 : XSTRING_DATA (args[6]), + (EQ(args[3], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW, + (EQ(args[4], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW, + (EQ(args[5], Qnil)) ? 0 : XSTRING (args[5])->_data, + (EQ(args[6], Qnil)) ? 0 : XSTRING (args[6])->_data, yes_or_no, puts2 ) < 0) { @@ -496,7 +496,7 @@ Return information of dictionaries. int cnt, i; unsigned char comment[1024]; Lisp_Object val; - int snum; + int snum; unsigned char lb; if ((snum = check_wnn_server_type ()) == -1) return Qnil; @@ -528,8 +528,8 @@ Return information of dictionaries. DEFUN ("wnn-server-dict-comment", Fwnn_dict_comment, 2, 2, 0, /* Set comment to dictionary specified by DIC-NUMBER. -Comment string COMMENT. -*/ +Comment string COMMENT +*/ (dicno, comment)) { w_char wbuf[512]; @@ -538,8 +538,8 @@ Comment string COMMENT. CHECK_STRING (comment); if ((snum = check_wnn_server_type ()) == -1) return Qnil; if (!wnnfns_buf[snum]) return Qnil; - m2w (XSTRING_DATA (comment), wbuf); - if (jl_dic_comment_set (wnnfns_buf[snum], XINT (dicno), wbuf) < 0) + m2w (XSTRING (comment)->_data, wbuf); + if (jl_dic_comment_set (wnnfns_buf[snum], XINT (dicno), wbuf) < 0) return Qnil; return Qt; } @@ -552,7 +552,7 @@ Switch the translation mode to normal if T, or reverse if NIL. { int snum; if ((snum = check_wnn_server_type ()) == -1) return Qnil; - if (NILP (rev)) + if (EQ(rev, Qnil)) { if ((!wnnfns_buf[snum]) || (!wnnfns_env_norm[snum])) return Qnil; jl_env_set (wnnfns_buf[snum], wnnfns_env_norm[snum]); @@ -578,15 +578,15 @@ Translate YOMI string to kanji. Retuen the number of bunsetsu. CHECK_STRING (hstring); if ((snum = check_wnn_server_type ()) == -1) return Qnil; if (!wnnfns_buf[snum]) return Qnil; - m2w (XSTRING_DATA (hstring), wbuf); + m2w (XSTRING (hstring)->_data, wbuf); if (snum == WNNSERVER_C) w2y (wbuf); #ifdef WNN6 - if ((cnt = jl_fi_ren_conv (wnnfns_buf[snum], wbuf, 0, -1, WNN_USE_MAE)) < 0) + if ((cnt = jl_fi_ren_conv (wnnfns_buf[snum], wbuf, 0, -1, WNN_USE_MAE)) < 0) return Qnil; #else - if ((cnt = jl_ren_conv (wnnfns_buf[snum], wbuf, 0, -1, WNN_USE_MAE)) < 0) + if ((cnt = jl_ren_conv (wnnfns_buf[snum], wbuf, 0, -1, WNN_USE_MAE)) < 0) return Qnil; #endif return make_int (cnt); @@ -696,7 +696,7 @@ Set candidate with OFFSET, DAI. DAI is T if dai-bunsetsu. CHECK_INT (offset); if ((snum = check_wnn_server_type ()) == -1) return Qnil; if (!wnnfns_buf[snum]) return Qnil; - if (NILP (dai)) + if (EQ(dai, Qnil)) { if (jl_set_jikouho (wnnfns_buf[snum], XINT (offset)) < 0) return Qnil; } @@ -722,11 +722,11 @@ Change length of BUN-NUMBER bunsetu to LEN. DAI is T if dai-bunsetsu. no = XINT (bunNo); #ifdef WNN6 if ((cnt = jl_fi_nobi_conv (wnnfns_buf[snum], no, XINT(len), -1, WNN_USE_MAE, - NILP (dai) ? WNN_SHO : WNN_DAI)) < 0) + (EQ(dai, Qnil)) ? WNN_SHO : WNN_DAI)) < 0) return Qnil; #else if ((cnt = jl_nobi_conv (wnnfns_buf[snum], no, XINT(len), -1, WNN_USE_MAE, - NILP (dai) ? WNN_SHO : WNN_DAI)) < 0) + (EQ(dai, Qnil)) ? WNN_SHO : WNN_DAI)) < 0) return Qnil; #endif return make_int (cnt); @@ -771,7 +771,7 @@ Get bunsetsu information specified by BUN-NUMBER. DEFUN ("wnn-server-henkan-quit", Fwnn_quit_henkan, 0, 0, 0, /* -do nothing. +do nothing */ ()) { @@ -844,7 +844,7 @@ Update frequency of bunsetsu specified by NUM-NUMBER. int no; int snum; if ((snum = check_wnn_server_type ()) == -1) return Qnil; - if (NILP (bunNo)) no = -1; + if (EQ(bunNo, Qnil)) no = -1; else { CHECK_INT (bunNo); @@ -862,7 +862,7 @@ Update frequency of bunsetsu specified by NUM-NUMBER. DEFUN ("wnn-server-word-add", Fwnn_word_toroku, 5, 5, 0, /* Add a word to dictionary. Arguments are -DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER. +DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER */ (dicno, kanji, yomi, comment, hinsi)) { @@ -875,20 +875,20 @@ DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER. CHECK_INT (hinsi); if ((snum = check_wnn_server_type ()) == -1) return Qnil; if (!wnnfns_buf[snum]) return Qnil; - m2w (XSTRING_DATA (yomi), yomi_buf); + m2w (XSTRING (yomi)->_data, yomi_buf); if (snum == WNNSERVER_C) w2y (yomi_buf); - m2w (XSTRING_DATA (kanji), kanji_buf); - m2w (XSTRING_DATA (comment), comment_buf); + m2w (XSTRING (kanji)->_data, kanji_buf); + m2w (XSTRING (comment)->_data, comment_buf); if (jl_word_add (wnnfns_buf[snum], XINT (dicno), yomi_buf, kanji_buf, - comment_buf, XINT (hinsi), 0) < 0) + comment_buf, XINT (hinsi), 0) < 0) return Qnil; else return Qt; } DEFUN ("wnn-server-word-delete", Fwnn_word_sakujo, 2, 2, 0, /* -Delete a word from dictionary, specified by DIC-NUMBER, SERIAL-NUMBER. +Delete a word from dictionary, specified by DIC-NUMBER, SERIAL-NUMBER */ (no, serial)) { @@ -904,7 +904,7 @@ Delete a word from dictionary, specified by DIC-NUMBER, SERIAL-NUMBER. DEFUN ("wnn-server-word-use", Fwnn_word_use, 2, 2, 0, /* -Toggle on/off word, specified by DIC-NUMBER and SERIAL-NUMBER. +Toggle on/off word, specified by DIC-NUMBER and SERIAL-NUMBER */ (no, serial)) { @@ -955,7 +955,7 @@ Return list of yomi, kanji, comment, hindo, hinshi. DEFUN ("wnn-server-word-hindo-set", Fwnn_hindo_set, 3, 3, 0, /* Set frequency to arbitrary value. Specified by DIC-NUMBER, -SERIAL-NUMBER, FREQUENCY. +SERIAL-NUMBER, FREQUENCY */ (no, serial, hindo)) { @@ -992,7 +992,7 @@ Return list of (kanji hinshi freq dic_no serial). if ((snum = check_wnn_server_type ()) == -1) return Qnil; lb = lb_wnn_server_type[snum]; if (!wnnfns_buf[snum]) return Qnil; - m2w (XSTRING_DATA (yomi), wbuf); + m2w (XSTRING (yomi)->_data, wbuf); if (snum == WNNSERVER_C) w2y (wbuf); if ((count = jl_word_search_by_env (wnnfns_buf[snum], @@ -1066,6 +1066,7 @@ or wnn_kaikakko and the CDR contains the value. { int rc; struct wnn_param param; + Lisp_Object tail, key, val; int snum; if ((snum = check_wnn_server_type ()) == -1) return Qnil; @@ -1073,55 +1074,53 @@ or wnn_kaikakko and the CDR contains the value. rc = jl_param_get (wnnfns_buf[snum], ¶m); if (rc < 0) return Qnil; - { - EXTERNAL_PROPERTY_LIST_LOOP_3 (key, val, Vsetvalues_alist) - { - int setval; - CHECK_INT (val); - setval = XINT (val); - if (EQ (key, Qwnn_n)) param.n = setval; - else if (EQ (key, Qwnn_nsho)) param.nsho = setval; - else if (EQ (key, Qwnn_hindo)) param.p1 = setval; - else if (EQ (key, Qwnn_len)) param.p2 = setval; - else if (EQ (key, Qwnn_jiri)) param.p3 = setval; - else if (EQ (key, Qwnn_flag)) param.p4 = setval; - else if (EQ (key, Qwnn_jisho)) param.p5 = setval; - else if (EQ (key, Qwnn_sbn)) param.p6 = setval; - else if (EQ (key, Qwnn_dbn_len)) param.p7 = setval; - else if (EQ (key, Qwnn_sbn_cnt)) param.p8 = setval; - else if (EQ (key, Qwnn_suuji)) param.p9 = setval; - else if (EQ (key, Qwnn_kana)) param.p10 = setval; - else if (EQ (key, Qwnn_eisuu)) param.p11 = setval; - else if (EQ (key, Qwnn_kigou)) param.p12 = setval; - else if (EQ (key, Qwnn_toji_kakko)) param.p13 = setval; - else if (EQ (key, Qwnn_fuzokogo)) param.p14 = setval; - else if (EQ (key, Qwnn_kaikakko)) param.p15 = setval; - else - { - signal_simple_error ("Invalid wnn keyword", key); - return Qnil; - } - } - } + EXTERNAL_PROPERTY_LIST_LOOP (tail, key, val, Vsetvalues_alist) + { + int setval; + CHECK_INT (val); + setval = XINT (val); + if (EQ (key, Qwnn_n)) param.n = setval; + else if (EQ (key, Qwnn_nsho)) param.nsho = setval; + else if (EQ (key, Qwnn_hindo)) param.p1 = setval; + else if (EQ (key, Qwnn_len)) param.p2 = setval; + else if (EQ (key, Qwnn_jiri)) param.p3 = setval; + else if (EQ (key, Qwnn_flag)) param.p4 = setval; + else if (EQ (key, Qwnn_jisho)) param.p5 = setval; + else if (EQ (key, Qwnn_sbn)) param.p6 = setval; + else if (EQ (key, Qwnn_dbn_len)) param.p7 = setval; + else if (EQ (key, Qwnn_sbn_cnt)) param.p8 = setval; + else if (EQ (key, Qwnn_suuji)) param.p9 = setval; + else if (EQ (key, Qwnn_kana)) param.p10 = setval; + else if (EQ (key, Qwnn_eisuu)) param.p11 = setval; + else if (EQ (key, Qwnn_kigou)) param.p12 = setval; + else if (EQ (key, Qwnn_toji_kakko)) param.p13 = setval; + else if (EQ (key, Qwnn_fuzokogo)) param.p14 = setval; + else if (EQ (key, Qwnn_kaikakko)) param.p15 = setval; + else + { + signal_simple_error ("Invalid wnn keyword", key); + return Qnil; + } + } #if 0 printf("wnn_n = %d\n",param.n); printf("wnn_nsho = %d\n",param.nsho); - printf("wnn_hindo = %d\n",param.p1); - printf("wnn_len = %d\n",param.p2); - printf("wnn_jiri = %d\n",param.p3); - printf("wnn_flag = %d\n",param.p4); - printf("wnn_jisho = %d\n",param.p5); - printf("wnn_sbn = %d\n",param.p6); - printf("wnn_dbn_len = %d\n",param.p7); - printf("wnn_sbn_cnt = %d\n",param.p8); - printf("wnn_suuji = %d\n",param.p9); - printf("wnn_kana = %d\n",param.p10); - printf("wnn_eisuu = %d\n",param.p11); - printf("wnn_kigou = %d\n",param.p12); - printf("wnn_toji_kakko = %d\n",param.p13); - printf("wnn_fuzokogo = %d\n",param.p14); - printf("wnn_kaikakko = %d\n",param.p15); + printf("wnn_hindo = %d\n",param.p1); + printf("wnn_len = %d\n",param.p2); + printf("wnn_jiri = %d\n",param.p3); + printf("wnn_flag = %d\n",param.p4); + printf("wnn_jisho = %d\n",param.p5); + printf("wnn_sbn = %d\n",param.p6); + printf("wnn_dbn_len = %d\n",param.p7); + printf("wnn_sbn_cnt = %d\n",param.p8); + printf("wnn_suuji = %d\n",param.p9); + printf("wnn_kana = %d\n",param.p10); + printf("wnn_eisuu = %d\n",param.p11); + printf("wnn_kigou = %d\n",param.p12); + printf("wnn_toji_kakko = %d\n",param.p13); + printf("wnn_fuzokogo = %d\n",param.p14); + printf("wnn_kaikakko = %d\n",param.p15); #endif rc = jl_param_set (wnnfns_buf[snum], ¶m); @@ -1176,7 +1175,7 @@ For Wnn. CHECK_STRING (file); if ((snum = check_wnn_server_type ()) == -1) return Qnil; if (!wnnfns_buf[snum]) return Qnil; - if (jl_fuzokugo_set (wnnfns_buf[snum], XSTRING_DATA (file)) < 0) + if (jl_fuzokugo_set (wnnfns_buf[snum], XSTRING (file)->_data) < 0) return Qnil; return Qt; } @@ -1247,7 +1246,7 @@ For Wnn. if ((snum = check_wnn_server_type ()) == -1) return Qnil; lb = lb_wnn_server_type[snum]; if (!wnnfns_buf[snum]) return Qnil; - m2w (XSTRING_DATA (name), wbuf); + m2w (XSTRING (name)->_data, wbuf); if ((cnt = jl_hinsi_list (wnnfns_buf[snum], XINT (dicno), wbuf, &area)) < 0) return Qnil; if (cnt == 0) return make_int (0); @@ -1290,21 +1289,21 @@ Specify password files of dictionary and frequency, PW1 and PW2, if needed. int snum; CHECK_STRING (args[0]); CHECK_STRING (args[1]); - if (! NILP (args[3])) CHECK_STRING (args[3]); + if (!EQ(args[3], Qnil)) CHECK_STRING (args[3]); if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; GCPRO1 (*args); gcpro1.nvars = nargs; if(jl_fi_dic_add(wnnfns_buf[snum], - XSTRING_DATA (args[0]), - XSTRING_DATA (args[1]), - WNN_FI_SYSTEM_DICT, - WNN_DIC_RDONLY, - NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW, - 0, - NILP (args[3]) ? 0 : XSTRING_DATA (args[3]), - yes_or_no, - puts2 ) < 0) { + XSTRING(args[0])->_data, + XSTRING(args[1])->_data, + WNN_FI_SYSTEM_DICT, + WNN_DIC_RDONLY, + (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW, + 0, + (EQ(args[3], Qnil)) ? 0 : XSTRING(args[3])->_data, + yes_or_no, + puts2 ) < 0) { UNGCPRO; return Qnil; } @@ -1323,22 +1322,22 @@ Specify password files of dictionary and frequency, PW1 and PW2, if needed. int snum; CHECK_STRING (args[0]); CHECK_STRING (args[1]); - if (! NILP (args[4])) CHECK_STRING (args[4]); - if (! NILP (args[5])) CHECK_STRING (args[5]); + if (!EQ(args[4], Qnil)) CHECK_STRING (args[4]); + if (!EQ(args[5], Qnil)) CHECK_STRING (args[5]); if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; GCPRO1 (*args); gcpro1.nvars = nargs; if(jl_fi_dic_add(wnnfns_buf[snum], - XSTRING_DATA (args[0]), - XSTRING_DATA (args[1]), - WNN_FI_USER_DICT, - NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW, - NILP (args[3]) ? WNN_DIC_RDONLY : WNN_DIC_RW, - NILP (args[4]) ? 0 : XSTRING_DATA (args[4]), - NILP (args[5]) ? 0 : XSTRING_DATA (args[5]), - yes_or_no, - puts2 ) < 0) { + XSTRING(args[0])->_data, + XSTRING(args[1])->_data, + WNN_FI_USER_DICT, + (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW, + (EQ(args[3], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW, + (EQ(args[4], Qnil)) ? 0 : XSTRING(args[4])->_data, + (EQ(args[5], Qnil)) ? 0 : XSTRING(args[5])->_data, + yes_or_no, + puts2 ) < 0) { UNGCPRO; return Qnil; } @@ -1360,7 +1359,7 @@ Specify password files of dictionary and frequency PW1 if needed. struct wnn_henkan_env henv; CHECK_STRING (args[0]); CHECK_INT (args[1]); - if (! NILP (args[3])) CHECK_STRING (args[3]); + if (!EQ(args[3], Qnil)) CHECK_STRING (args[3]); if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; GCPRO1 (*args); @@ -1372,12 +1371,12 @@ Specify password files of dictionary and frequency PW1 if needed. dic_no = js_get_autolearning_dic(cur_env, WNN_MUHENKAN_LEARNING); if (dic_no == WNN_NO_LEARNING) { if((dic_no = jl_dic_add(wnnfns_buf[snum], - XSTRING_DATA (args[0]), + XSTRING(args[0])->_data, 0, wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV, XINT(args[1]), WNN_DIC_RW, WNN_DIC_RW, - NILP (args[3]) ? 0 : XSTRING_DATA (args[3]), + (EQ(args[3], Qnil)) ? 0 : XSTRING(args[3])->_data, 0, yes_or_no, puts2)) < 0) { @@ -1394,7 +1393,7 @@ Specify password files of dictionary and frequency PW1 if needed. } } vmask |= WNN_ENV_MUHENKAN_LEARN_MASK; - henv.muhenkan_flag = NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW; + henv.muhenkan_flag = (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW; if(jl_set_henkan_env(wnnfns_buf[snum], vmask, &henv) < 0) { @@ -1419,7 +1418,7 @@ Specify password files of dictionary and frequency PW1 if needed. struct wnn_henkan_env henv; CHECK_STRING (args[0]); CHECK_INT (args[1]); - if (! NILP (args[3])) CHECK_STRING (args[3]); + if (!EQ(args[3], Qnil)) CHECK_STRING (args[3]); if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; GCPRO1 (*args); @@ -1431,12 +1430,12 @@ Specify password files of dictionary and frequency PW1 if needed. dic_no = js_get_autolearning_dic(cur_env, WNN_BUNSETSUGIRI_LEARNING); if (dic_no == WNN_NO_LEARNING) { if((dic_no = jl_dic_add(wnnfns_buf[snum], - XSTRING_DATA (args[0]), + XSTRING(args[0])->_data, 0, wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV, XINT(args[1]), WNN_DIC_RW, WNN_DIC_RW, - NILP (args[3]) ? 0 : XSTRING_DATA (args[3]), + (EQ(args[3], Qnil)) ? 0 : XSTRING(args[3])->_data, 0, yes_or_no, puts2)) < 0) { @@ -1453,7 +1452,7 @@ Specify password files of dictionary and frequency PW1 if needed. } } vmask |= WNN_ENV_BUNSETSUGIRI_LEARN_MASK; - henv.bunsetsugiri_flag = NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW; + henv.bunsetsugiri_flag = (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW; if(jl_set_henkan_env(wnnfns_buf[snum], vmask, &henv) < 0) { @@ -1474,8 +1473,8 @@ For FI-Wnn. struct wnn_henkan_env henv; if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; - vmask |= WNN_ENV_LAST_IS_FIRST_MASK; - henv.last_is_first_flag = NILP (mode) ? False : True; + vmask |= WNN_ENV_LAST_IS_FIRST_MASK; + henv.last_is_first_flag = (EQ(mode, Qnil)) ? False : True; if(jl_set_henkan_env(wnnfns_buf[snum], vmask, &henv) < 0) return Qnil; @@ -1493,7 +1492,7 @@ For FI-Wnn. if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; vmask |= WNN_ENV_COMPLEX_CONV_MASK; - henv.complex_flag = NILP (mode) ? False : True; + henv.complex_flag = (EQ(mode, Qnil)) ? False : True; if(jl_set_henkan_env(wnnfns_buf[snum], vmask, &henv) < 0) return Qnil; @@ -1511,7 +1510,7 @@ For FI-Wnn. if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; vmask |= WNN_ENV_OKURI_LEARN_MASK; - henv.okuri_learn_flag = NILP (mode) ? False : True; + henv.okuri_learn_flag = (EQ(mode, Qnil)) ? False : True; if(jl_set_henkan_env(wnnfns_buf[snum], vmask, &henv) < 0) return Qnil; @@ -1554,7 +1553,7 @@ For FI-Wnn. if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; vmask |= WNN_ENV_PREFIX_LEARN_MASK; - henv.prefix_learn_flag = NILP (mode) ? False : True; + henv.prefix_learn_flag = (EQ(mode, Qnil)) ? False : True; if(jl_set_henkan_env(wnnfns_buf[snum], vmask, &henv) < 0) return Qnil; @@ -1595,7 +1594,7 @@ For FI-Wnn. if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; vmask |= WNN_ENV_SUFFIX_LEARN_MASK; - henv.suffix_learn_flag = NILP (mode) ? False : True; + henv.suffix_learn_flag = (EQ(mode, Qnil)) ? False : True; if(jl_set_henkan_env(wnnfns_buf[snum], vmask, &henv) < 0) return Qnil; @@ -1613,7 +1612,7 @@ For FI-Wnn. if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; vmask |= WNN_ENV_COMMON_LAERN_MASK; - henv.common_learn_flag = NILP (mode) ? False : True; + henv.common_learn_flag = (EQ(mode, Qnil)) ? False : True; if(jl_set_henkan_env(wnnfns_buf[snum], vmask, &henv) < 0) return Qnil; @@ -1729,7 +1728,7 @@ For FI-Wnn. if ((snum = check_wnn_server_type()) == -1) return Qnil; if(!wnnfns_buf[snum]) return Qnil; vmask |= WNN_ENV_YURAGI_MASK; - henv.yuragi_flag = NILP (mode) ? False : True; + henv.yuragi_flag = (EQ(mode, Qnil)) ? False : True; if(jl_set_henkan_env(wnnfns_buf[snum], vmask, &henv) < 0) return Qnil; @@ -1779,7 +1778,7 @@ For Wnn. CHECK_STRING (name); if ((snum = check_wnn_server_type ()) == -1) return Qnil; if (!wnnfns_buf[snum]) return Qnil; - m2w (XSTRING_DATA (name), w_buf); + m2w (XSTRING (name)->_data, w_buf); if ((no = jl_hinsi_number (wnnfns_buf[snum], w_buf)) < 0) return Qnil; return make_int (no); } @@ -1876,22 +1875,9 @@ syms_of_mule_wnn (void) } void -reinit_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 (); + int i; DEFVAR_INT ("lb-sisheng", &lb_sisheng /* Leading character for Sisheng. @@ -1915,6 +1901,13 @@ Leading character for Sisheng. 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")); } @@ -1933,7 +1926,7 @@ w2m (w_char *wp, unsigned char *mp, unsigned char lb) if (EQ(Vwnn_server_type, Qcserver)) { len = cwnn_yincod_pzy (pzy, wc, - NILP (Vcwnn_zhuyin) + (EQ(Vcwnn_zhuyin, Qnil)) ? CWNN_PINYIN : CWNN_ZHUYIN); for (i = 0; i < len; i++) @@ -1979,7 +1972,7 @@ void m2w (unsigned char *mp, w_char *wp) { unsigned int ch; - + while ((ch = *mp++) != 0) { if (BUFBYTE_LEADING_BYTE_P (ch)) @@ -2039,7 +2032,7 @@ w2y (w_char *w) w++; pin++; } len = cwnn_pzy_yincod (ybuf, pbuf, - NILP (Vcwnn_zhuyin) ? CWNN_PINYIN : CWNN_ZHUYIN); + (EQ(Vcwnn_zhuyin, Qnil)) ? CWNN_PINYIN : CWNN_ZHUYIN); if (len <= 0) return; diff --git a/src/mule.c b/src/mule.c index 9f4cdef..36274cf 100644 --- a/src/mule.c +++ b/src/mule.c @@ -40,7 +40,7 @@ accept a pattern compiled by 'regexp-compile' with word-option t. int i, len; char *p; Lisp_Object temp; - Lisp_String *s; + struct Lisp_String *s; CHECK_CONS (pattern); len = XINT (Flength (pattern)); diff --git a/src/objects-msw.c b/src/objects-msw.c index 3621a12..255d3fd 100644 --- a/src/objects-msw.c +++ b/src/objects-msw.c @@ -49,733 +49,676 @@ Boston, MA 02111-1307, USA. */ #include "device.h" #include "insdel.h" -typedef struct colormap_t +#ifdef __CYGWIN32__ +#define stricmp strcasecmp +#endif + +typedef struct colormap_t { - const char *name; + char *name; 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 likelihood of - * mswindows_color_to_string() finding a named match. - */ -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) } -}; - - -typedef struct fontmap_t +static CONST colormap_t mswindows_X_color_map[] = { - const char *name; - int value; -} fontmap_t; - -/* Default weight first, preferred names listed before synonyms */ -static const fontmap_t fontweight_map[] = -{ - {"Regular" , FW_REGULAR}, /* The standard font weight */ - {"Thin" , FW_THIN}, - {"Extra Light" , FW_EXTRALIGHT}, - {"Ultra Light" , FW_ULTRALIGHT}, - {"Light" , FW_LIGHT}, - {"Normal" , FW_NORMAL}, - {"Medium" , FW_MEDIUM}, - {"Semi Bold" , FW_SEMIBOLD}, - {"Demi Bold" , FW_DEMIBOLD}, - {"Bold" , FW_BOLD}, /* The standard bold font weight */ - {"Extra Bold" , FW_EXTRABOLD}, - {"Ultra Bold" , FW_ULTRABOLD}, - {"Heavy" , FW_HEAVY}, - {"Black" , FW_BLACK} -}; - -/* 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[] = -{ - {"Western" , ANSI_CHARSET}, - {"Symbol" , SYMBOL_CHARSET}, - {"Shift JIS" , SHIFTJIS_CHARSET}, /* #### Name to be verified */ - {"GB2312" , GB2312_CHARSET}, /* #### Name to be verified */ - {"Hanguel" , HANGEUL_CHARSET}, - {"Chinese Big 5" , CHINESEBIG5_CHARSET}, /* #### Name to be verified */ -#if (WINVER >= 0x0400) - {"Johab" , JOHAB_CHARSET}, /* #### Name to be verified */ - {"Hebrew" , HEBREW_CHARSET}, /* #### Name to be verified */ - {"Arabic" , ARABIC_CHARSET}, /* #### Name to be verified */ - {"Greek" , GREEK_CHARSET}, - {"Turkish" , TURKISH_CHARSET}, - {"Vietnamese" , VIETNAMESE_CHARSET}, /* #### Name to be verified */ - {"Thai" , THAI_CHARSET}, /* #### Name to be verified */ - {"Central European" , EASTEUROPE_CHARSET}, - {"Cyrillic" , RUSSIAN_CHARSET}, - {"Mac" , MAC_CHARSET}, - {"Baltic" , BALTIC_CHARSET}, -#endif - {"OEM/DOS" , OEM_CHARSET} + {"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) } }; @@ -784,7 +727,7 @@ static const fontmap_t charset_map[] = /************************************************************************/ static int -hexval (char c) +hexval (char c) { /* assumes ASCII and isxdigit(c) */ if (c >= 'a') @@ -796,7 +739,7 @@ hexval (char c) } COLORREF -mswindows_string_to_color(const char *name) +mswindows_string_to_color(CONST char *name) { int i; @@ -805,7 +748,7 @@ mswindows_string_to_color(const char *name) /* numeric names look like "#RRGGBB", "#RRRGGGBBB" or "#RRRRGGGGBBBB" or "rgb:rrrr/gggg/bbbb" */ unsigned int r, g, b; - + for (i=1; i<strlen(name); i++) { if (!isxdigit ((int)name[i])) @@ -854,44 +797,27 @@ mswindows_string_to_color(const char *name) } return (PALETTERGB (r, g, b)); } - else + else return (COLORREF) -1; } 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 @@ -946,237 +872,19 @@ match_font (char *pattern1, char *pattern2, char *fontname) return 1; } - - - - -/************************************************************************/ -/* exports */ -/************************************************************************/ - -struct font_enum_t -{ - HDC hdc; - Lisp_Object list; -}; - -static int CALLBACK -old_font_enum_callback_2 (ENUMLOGFONT FAR *lpelfe, NEWTEXTMETRIC FAR *lpntme, - int FontType, struct font_enum_t *font_enum) -{ - char fontname[MSW_FONTSIZE]; - Lisp_Object fontname_lispstr; - int i; - - /* - * The enumerated font weights are not to be trusted because: - * a) lpelfe->elfStyle is only filled in for TrueType fonts. - * b) Not all Bold and Italic styles of all fonts (including some Vector, - * Truetype and Raster fonts) are enumerated. - * I guess that fonts for which Bold and Italic styles are generated - * 'on-the-fly' are not enumerated. It would be overly restrictive to - * disallow Bold And Italic weights for these fonts, so we just leave - * weights unspecified. This means that we have to weed out duplicates of - * those fonts that do get enumerated with different weights. - */ - if (FontType == 0 /*vector*/ || FontType == TRUETYPE_FONTTYPE) - /* Scalable, so leave pointsize blank */ - sprintf (fontname, "%s::::", lpelfe->elfLogFont.lfFaceName); - else - /* Formula for pointsize->height from LOGFONT docs in Platform SDK */ - sprintf (fontname, "%s::%d::", lpelfe->elfLogFont.lfFaceName, - MulDiv (lpntme->tmHeight - lpntme->tmInternalLeading, - 72, GetDeviceCaps (font_enum->hdc, LOGPIXELSY))); - - /* - * The enumerated font character set strings are not to be trusted because - * lpelfe->elfScript is returned in the host language and not in English. - * We can't know a priori the translations of "Western", "Central European" - * etc into the host language, so we must use English. The same argument - * applies to the font weight string when matching fonts. - */ - for (i=0; i<countof (charset_map); i++) - if (lpelfe->elfLogFont.lfCharSet == charset_map[i].value) - { - strcat (fontname, charset_map[i].name); - break; - } - 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); - - return 1; -} - -static int CALLBACK -old_font_enum_callback_1 (ENUMLOGFONT FAR *lpelfe, NEWTEXTMETRIC FAR *lpntme, - int FontType, struct font_enum_t *font_enum) -{ - /* This function gets called once per facename per character set. - * We call a second callback to enumerate the fonts in each facename */ - return EnumFontFamilies (font_enum->hdc, lpelfe->elfLogFont.lfFaceName, - (FONTENUMPROC) old_font_enum_callback_2, - (LPARAM) font_enum); -} - -static int CALLBACK -font_enum_callback_2 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, - int FontType, struct font_enum_t *font_enum) -{ - char fontname[MSW_FONTSIZE]; - Lisp_Object fontname_lispstr; - int i; - - /* - * The enumerated font weights are not to be trusted because: - * a) lpelfe->elfStyle is only filled in for TrueType fonts. - * b) Not all Bold and Italic styles of all fonts (including some Vector, - * Truetype and Raster fonts) are enumerated. - * I guess that fonts for which Bold and Italic styles are generated - * 'on-the-fly' are not enumerated. It would be overly restrictive to - * disallow Bold And Italic weights for these fonts, so we just leave - * weights unspecified. This means that we have to weed out duplicates of - * those fonts that do get enumerated with different weights. - */ - if (FontType == 0 /*vector*/ || FontType == TRUETYPE_FONTTYPE) - /* Scalable, so leave pointsize blank */ - sprintf (fontname, "%s::::", lpelfe->elfLogFont.lfFaceName); - else - /* 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))); - - /* - * The enumerated font character set strings are not to be trusted because - * lpelfe->elfScript is returned in the host language and not in English. - * We can't know a priori the translations of "Western", "Central European" - * etc into the host language, so we must use English. The same argument - * applies to the font weight string when matching fonts. - */ - for (i=0; i<countof (charset_map); i++) - if (lpelfe->elfLogFont.lfCharSet == charset_map[i].value) - { - strcat (fontname, charset_map[i].name); - break; - } - 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); - - return 1; -} - -static int CALLBACK -font_enum_callback_1 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, - int FontType, struct font_enum_t *font_enum) -{ - /* This function gets called once per facename per character set. - * We call a second callback to enumerate the fonts in each facename */ - return xEnumFontFamiliesExA (font_enum->hdc, &lpelfe->elfLogFont, - (FONTENUMPROC) font_enum_callback_2, - (LPARAM) font_enum, 0); -} - -/* - * Enumerate the available on the HDC fonts and return a list of string - * font names. - */ -Lisp_Object -mswindows_enumerate_fonts (HDC hdc) -{ - /* This cannot CG */ - LOGFONT logfont; - struct font_enum_t font_enum; - - assert (hdc!=NULL); - logfont.lfCharSet = DEFAULT_CHARSET; - logfont.lfFaceName[0] = '\0'; - logfont.lfPitchAndFamily = DEFAULT_PITCH; - font_enum.hdc = hdc; - font_enum.list = Qnil; - if (xEnumFontFamiliesExA) - xEnumFontFamiliesExA (hdc, &logfont, (FONTENUMPROC) font_enum_callback_1, - (LPARAM) (&font_enum), 0); - else /* NT 3.5x */ - EnumFontFamilies (hdc, 0, (FONTENUMPROC) old_font_enum_callback_1, - (LPARAM) (&font_enum)); - - return font_enum.list; -} - -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) { @@ -1184,21 +892,22 @@ mswindows_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name, COLOR_INSTANCE_MSWINDOWS_COLOR (c) = color; return 1; } - maybe_signal_simple_error ("Unrecognized color", name, Qcolor, errb); + maybe_signal_simple_error ("unrecognized color", name, Qcolor, errb); return(0); } #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); @@ -1208,7 +917,7 @@ mswindows_print_color_instance (Lisp_Color_Instance *c, } static void -mswindows_finalize_color_instance (Lisp_Color_Instance *c) +mswindows_finalize_color_instance (struct Lisp_Color_Instance *c) { if (c->data) { @@ -1218,21 +927,21 @@ mswindows_finalize_color_instance (Lisp_Color_Instance *c) } 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), @@ -1243,39 +952,37 @@ mswindows_color_instance_rgb_components (Lisp_Color_Instance *c) 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_instance 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 fields; int pt; char fontname[LF_FACESIZE], weight[LF_FACESIZE], *style, points[8]; char effects[LF_FACESIZE], charset[LF_FACESIZE]; char *c; - HFONT hfont, hfont2; - TEXTMETRIC metrics; - - extname = XSTRING_DATA (name); + + GET_C_STRING_CTEXT_DATA_ALLOCA (f->name, extname); /* * mswindows fonts look like: @@ -1296,12 +1003,12 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, /* This function is implemented in a fairly ad-hoc manner. * The general idea is to validate and canonicalize each of the above fields * at the same time as we build up the win32 LOGFONT structure. This enables - * us to use match_font() on a canonicalized font string to check the + * us to use math_font() on a canonicalized font string to check the * availability of the requested font */ - if (fields < 0) + if (fields<0) { - maybe_signal_simple_error ("Invalid font", name, Qfont, errb); + maybe_signal_simple_error ("Invalid font", f->name, Qfont, errb); return (0); } @@ -1312,13 +1019,13 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, } else { - maybe_signal_simple_error ("Must specify a font name", name, Qfont, errb); + maybe_signal_simple_error ("Must specify a font name", f->name, Qfont, errb); return (0); } /* weight */ if (fields < 2) - strcpy (weight, fontweight_map[0].name); + strcpy (weight, "Regular"); /* Maybe split weight into weight and style */ if ((c=strchr(weight, ' '))) @@ -1329,26 +1036,37 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, else style = NULL; - for (i=0; i<countof (fontweight_map); i++) - if (!stricmp (weight, fontweight_map[i].name)) - { - logfont.lfWeight = fontweight_map[i].value; - break; - } - if (i == countof (fontweight_map)) /* No matching weight */ +#define FROB(wgt) \ + if (stricmp (weight, #wgt) == 0) \ + logfont.lfWeight = FW_##wgt + + FROB (REGULAR); + else FROB (THIN); + else FROB (EXTRALIGHT); + else FROB (ULTRALIGHT); + else FROB (LIGHT); + else FROB (NORMAL); + else FROB (MEDIUM); + else FROB (SEMIBOLD); + else FROB (DEMIBOLD); + else FROB (BOLD); + else FROB (EXTRABOLD); + else FROB (ULTRABOLD); + else FROB (HEAVY); + else FROB (BLACK); + else if (!style) { - if (!style) - { - logfont.lfWeight = FW_REGULAR; - style = weight; /* May have specified style without weight */ - } - else - { - maybe_signal_simple_error ("Invalid font weight", name, Qfont, errb); - return (0); - } + logfont.lfWeight = FW_REGULAR; + style = weight; /* May have specified style without weight */ + } + else + { + maybe_signal_simple_error ("Invalid font weight", f->name, Qfont, errb); + return (0); } +#undef FROB + if (style) { /* #### what about oblique? */ @@ -1356,7 +1074,7 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, logfont.lfItalic = TRUE; else { - maybe_signal_simple_error ("Invalid font weight or style", name, Qfont, errb); + maybe_signal_simple_error ("Invalid font weight or style", f->name, Qfont, errb); return (0); } @@ -1371,12 +1089,12 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, pt = 10; /* #### Should we reject strings that don't specify a size? */ else if ((pt=atoi(points)) == 0) { - maybe_signal_simple_error ("Invalid font pointsize", name, Qfont, errb); + maybe_signal_simple_error ("Invalid font pointsize", f->name, Qfont, errb); return (0); } /* 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 */ @@ -1401,7 +1119,8 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, logfont.lfStrikeOut = TRUE; else { - maybe_signal_simple_error ("Invalid font effect", name, Qfont, errb); + maybe_signal_simple_error ("Invalid font effect", f->name, + Qfont, errb); return (0); } @@ -1413,7 +1132,7 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, logfont.lfStrikeOut = TRUE; else { - maybe_signal_simple_error ("Invalid font effect", name, + maybe_signal_simple_error ("Invalid font effect", f->name, Qfont, errb); return (0); } @@ -1433,33 +1152,82 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, else effects[0] = '\0'; - /* Charset */ - /* charset can be specified even if earlier fields haven't been */ - if (fields < 5) +#define FROB(cs) \ + else if (stricmp (charset, #cs) == 0) \ + logfont.lfCharSet = cs##_CHARSET + + /* Charset aliases. Hangeul = Hangul is defined in windows.h. + We do not use the name "russian", only "cyrillic", as it is + the common name of this charset, used in other languages + than Russian. */ +#define CYRILLIC_CHARSET RUSSIAN_CHARSET +#define CENTRALEUROPEAN_CHARSET EASTEUROPE_CHARSET +#define CENTRALEUROPEAN_CHARSET EASTEUROPE_CHARSET + + /* charset can be specified even if earlier fields havn't been */ + if ((fields < 5) && (c=strchr (extname, ':')) && (c=strchr (c+1, ':')) && + (c=strchr (c+1, ':')) && (c=strchr (c+1, ':'))) { - if ((c=strchr (extname, ':')) && (c=strchr (c+1, ':')) && - (c=strchr (c+1, ':')) && (c=strchr (c+1, ':'))) - { - strncpy (charset, c+1, LF_FACESIZE); - charset[LF_FACESIZE-1] = '\0'; - } - else - strcpy (charset, charset_map[0].name); + strncpy (charset, c+1, LF_FACESIZE); + charset[LF_FACESIZE-1] = '\0'; } - - for (i=0; i<countof (charset_map); i++) - if (!stricmp (charset, charset_map[i].name)) - { - logfont.lfCharSet = charset_map[i].value; - break; - } - - if (i == countof (charset_map)) /* No matching charset */ + else + charset[0] = '\0'; + + if (charset[0] == '\0' || (stricmp (charset, "ansi") == 0) || + (stricmp (charset, "western") == 0)) + { + logfont.lfCharSet = ANSI_CHARSET; + strcpy (charset, "western"); + } + FROB (SYMBOL); + FROB (SHIFTJIS); + FROB (GB2312); + FROB (HANGEUL); + FROB (CHINESEBIG5); + FROB (JOHAB); + FROB (HEBREW); + FROB (ARABIC); + FROB (GREEK); + FROB (TURKISH); + FROB (THAI); + FROB (EASTEUROPE); + FROB (CENTRALEUROPEAN); + FROB (CYRILLIC); + FROB (MAC); + FROB (BALTIC); + else if (stricmp (charset, "oem/dos") == 0) + logfont.lfCharSet = OEM_CHARSET; + else { - maybe_signal_simple_error ("Invalid charset", name, Qfont, errb); + maybe_signal_simple_error ("Invalid charset", f->name, Qfont, errb); return 0; } +#undef FROB + + /* 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", f->name, Qfont, errb); + return 0; + } + } + /* Misc crud */ logfont.lfEscapement = logfont.lfOrientation = 0; #if 1 @@ -1471,201 +1239,90 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, logfont.lfClipPrecision = CLIP_STROKE_PRECIS; logfont.lfQuality = PROOF_QUALITY; #endif - /* Default to monospaced if the specified fontname doesn't exist. */ + /* Default to monospaced if the specified fontname doesn't exist. + * The match_font calls above should mean that this can't happen. */ 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]; - - 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); + maybe_signal_simple_error ("Couldn't create font", f->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) - { - mswindows_finalize_font_instance (f); - maybe_signal_simple_error ("Couldn't map font", name, Qfont, errb); - return 0; - } - 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)); - } + { + HDC hdc; + HFONT holdfont; + TEXTMETRIC metrics; - xfree (f->data); - f->data = 0; - } + hdc = CreateCompatibleDC (NULL); + if (hdc) + { + 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); + } + mswindows_finalize_font_instance (f); + maybe_signal_simple_error ("Couldn't map font", f->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; - - TO_EXTERNAL_FORMAT (LISP_STRING, pattern, - C_STRING_ALLOCA, extpattern, - Qctext); + Lisp_Object result = Qnil; + struct mswindows_font_enum *fontlist; + char fontname[MSW_FONTSIZE], *extpattern; - 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); } -/* Fill in missing parts of a font spec. This is primarily intended as a - * helper function for the functions below. - * mswindows fonts look like: - * fontname[:[weight][ style][:pointsize[:effects]]][:charset] - * A minimal mswindows font spec looks like: - * Courier New - * A maximal mswindows font spec looks like: - * Courier New:Bold Italic:10:underline strikeout:Western - * 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) -{ - int nsep=0; - char *name = (char *) XSTRING_DATA (f->name); - char* ptr = name; - char* extname = (char*) alloca (strlen (name) + 19); - strcpy (extname, name); - - while ((ptr = strchr (ptr, ':')) != 0) - { - ptr++; - nsep++; - } - - switch (nsep) - { - case 0: - strcat (extname, ":Regular:10::Western"); - break; - case 1: - strcat (extname, ":10::Western"); - break; - case 2: - strcat (extname, "::Western"); - break; - case 3: - strcat (extname, ":Western"); - break; - default:; - } - - return build_ext_string (extname, Qnative); -} - #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 */ if (UNBOUNDP (charset)) return 1; - + return 1; } @@ -1729,35 +1386,12 @@ console_type_create_objects_mswindows (void) /* CONSOLE_HAS_METHOD (mswindows, mark_font_instance); */ CONSOLE_HAS_METHOD (mswindows, print_font_instance); CONSOLE_HAS_METHOD (mswindows, finalize_font_instance); - CONSOLE_HAS_METHOD (mswindows, font_instance_truename); +/* CONSOLE_HAS_METHOD (mswindows, font_instance_truename); */ CONSOLE_HAS_METHOD (mswindows, list_fonts); #ifdef MULE 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 --git a/src/objects-tty.c b/src/objects-tty.c index b598c8d..513349d 100644 --- a/src/objects-tty.c +++ b/src/objects-tty.c @@ -143,7 +143,7 @@ See `set-tty-dynamic-color-specs'. #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 @@ tty_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name, } 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 @@ tty_color_instance_equal (Lisp_Color_Instance *c1, } 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 @@ tty_valid_color_name_p (struct device *d, Lisp_Object color) 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 @@ tty_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, 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 @@ tty_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name, } 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 @@ tty_list_fonts (Lisp_Object pattern, Lisp_Object device) 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 @@ tty_font_spec_matches_charset (struct device *d, Lisp_Object charset, 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 @@ tty_find_charset_font (Lisp_Object device, Lisp_Object font, { 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 --git a/src/postgresql.c b/src/postgresql.c index 66807a3..724b043 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -57,6 +57,9 @@ TODO (in rough order of priority): PQgetlineAsync (copy in/out Asynch.) PQputnbytes (copy in/out Asynch.) PQendcopy (copy in/out) + PQsetenvStart (Asynch. Queries) + PQsetenvPoll (Asynch. Queries) + PQsetenvHandle (Asynch. Queries) Unsupported functions: PQsetdbLogin -- This function is deprecated, has a subset of the @@ -99,12 +102,18 @@ TODO (in rough order of priority): #include "lisp.h" #include "sysdep.h" #include "buffer.h" + +#include <libpq-fe.h> +/* Undefine the following when asynchronous setenvs are fixed in libpq. */ +/* #define LIBPQ_7_0_IS_FIXED */ #include "postgresql.h" #ifdef RUNNING_XEMACS_21_1 /* handle interface changes */ +#define I_HATE_CONST CONST #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 +#define I_HATE_CONST const #ifdef MULE #define PG_OS_CODING Fget_coding_system(Vpg_coding_system) #else @@ -387,11 +396,114 @@ DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult, Lisp_PGresult); #endif +/****/ +#ifdef HAVE_POSTGRESQLV7 +/* PGsetenvHandle is an opaque object and we need to be able to store them in + Lisp code so we can make asynchronous environmental calls. + + Asynchronous setenv calls were introduced in libpq-7.0. +*/ +#ifdef LIBPQ_7_0_IS_FIXED + +Lisp_Object Qpgsetenvp; + +static Lisp_Object +make_pgsetenv (Lisp_PGsetenvHandle *pgsetenv) +{ + Lisp_Object lisp_pgsetenv; + XSETPGSETENV (lisp_pgsetenv, pgsetenv); + return lisp_pgsetenv; +} + +static Lisp_Object +#ifdef RUNNING_XEMACS_21_1 +mark_pgsetenv (Lisp_Object obj, void (*markobj) (Lisp_Object)) +#else +mark_pgsetenv (Lisp_Object obj) +#endif +{ + return Qnil; +} + +static void +print_pgsetenv (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +{ + char *fmt = "#<PGsetenvHandle %s>"; + char buf[1024]; + PGsetenvHandle *h; + + h = (XPGSETENV (obj))->pgsetenv; + + sprintf (buf, fmt, h ? "live" : "DEAD"); + + /* There are no accessor functions to retrieve any fields, so we must */ + /* treat this as being completely opaque. */ + if (print_readably) + error ("printing unreadable object %s", buf); + else + write_c_string (buf, printcharfun); +} + +static Lisp_PGsetenvHandle * +allocate_pgresult (void) +{ +#ifdef RUNNING_XEMACS_21_1 + Lisp_PGsetenvHandle *pgsetenv = + alloc_lcrecord_type (Lisp_PGsetenvHandle, lrecord_pgsetenv); +#else + Lisp_PGsetenvHandle *pgsetenv = + alloc_lcrecord_type (Lisp_PGsetenvHandle, &lrecord_pgsetenv); +#endif + pgsetenv->pgsetenv = (PGsetenvState *)NULL; + return pgsetenv; +} + +static void +finalize_pgsetenv (void *header, int for_disksave) +{ + Lisp_PGsetenvHandle *pgsetenv = (Lisp_PGsetenvHandle *)header; + + if (for_disksave) + signal_simple_error ("Can't dump an emacs containing PGsetenvHandle objects", + make_pgsetenv (pgsetenv)); + + /* #### PGsetenvHandle's are allocated with malloc(), however in + libpq-7.0 the treatment of them is little short of disastrous. + We don't dare attempt to free it, because there are many code + paths which lead to the handle being freed internally. The + connection routines leak setenv handles and so will we until + libpq gets cleaned up. + Actually, in 7.0b1 asynchronous setenv cannot work outside libpq, so + these functions are disabled in this API. + */ + if (pgsetenv->pgsetenv) + { + free (pgsetenv->pgsetenv); + pgsetenv->pgsetenv = (PGsetenvHandle *)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 /* RUNNING_XEMACS_21_1 */ + +#endif /* LIBPQ_7_0_IS_FIXED */ +#endif /* HAVE_POSTGRESQLV7 */ + /***********************/ /* notices */ static void -xemacs_notice_processor (void *arg, const char *msg) +xemacs_notice_processor (void *arg, I_HATE_CONST char *msg) { warn_when_safe (Qpostgresql, Qnotice, "%s", msg); } @@ -535,15 +647,15 @@ Poll an asynchronous connection for completion (conn)) { PGconn *P; - PostgresPollingStatusType polling_status; + PostgresPollingStatusType PS; CHECK_PGCONN (conn); P = (XPGCONN (conn))->pgconn; CHECK_LIVE_CONNECTION (P); - polling_status = PQconnectPoll (P); - switch (polling_status) + PS = PQconnectPoll (P); + switch (PS) { case PGRES_POLLING_FAILED: /* Something Bad has happened */ @@ -561,7 +673,7 @@ Poll an asynchronous connection for completion 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); + error ("Help! Unknown status code %08x from backend!", PS); } } @@ -720,20 +832,20 @@ Reset connection to the backend asynchronously. } DEFUN ("pq-reset-poll", Fpq_reset_poll, 1, 1, 0, /* -Poll an asynchronous reset for completion. +Poll an asynchronous reset for completion */ (conn)) { PGconn *P; - PostgresPollingStatusType polling_status; + PostgresPollingStatusType PS; CHECK_PGCONN (conn); P = (XPGCONN (conn))->pgconn; CHECK_LIVE_CONNECTION (P); - polling_status = PQresetPoll (P); - switch (polling_status) + PS = PQresetPoll (P); + switch (PS) { case PGRES_POLLING_FAILED: /* Something Bad has happened */ @@ -751,7 +863,7 @@ Poll an asynchronous reset for completion. 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); + error ("Help! Unknown status code %08x from backend!", PS); } } #endif @@ -841,12 +953,12 @@ pq::backend-pid Process ID of backend process return build_ext_string (PQoptions(P), PG_OS_CODING); else if (EQ (field, Qpqstatus)) { - ConnStatusType cst; + ExecStatusType est; /* PQstatus Returns the status of the connection. The status can be CONNECTION_OK or CONNECTION_BAD. ConnStatusType PQstatus(PGconn *conn) */ - switch ((cst = PQstatus (P))) + switch ((est = PQstatus (P))) { case CONNECTION_OK: return Qpg_connection_ok; case CONNECTION_BAD: return Qpg_connection_bad; @@ -859,7 +971,7 @@ pq::backend-pid Process ID of backend process #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); + error ("Help! Unknown exec status code %08x from backend!", est); } } else if (EQ (field, Qpqerrormessage)) @@ -1252,7 +1364,7 @@ Returns the command status string from the SQL command that generated the result } DEFUN ("pq-cmd-tuples", Fpq_cmd_tuples, 1, 1, 0, /* -Returns the number of rows affected by the SQL command. +Returns the number of rows affected by the SQL command */ (result)) { @@ -1304,7 +1416,7 @@ Needs to be called only on a connected database connection. } DEFUN ("pq-is-nonblocking", Fpq_is_nonblocking, 1, 1, 0, /* -Return the blocking status of the database connection. +Return the blocking status of the database connection */ (conn)) { @@ -1318,7 +1430,7 @@ Return the blocking status of the database connection. } DEFUN ("pq-flush", Fpq_flush, 1, 1, 0, /* -Force the write buffer to be written (or at least try). +Force the write buffer to be written (or at least try) */ (conn)) { @@ -1538,7 +1650,7 @@ The returned string is *not* null-terminated. 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)); + make_ext_string (buffer, ret, PG_OS_CODING)); } DEFUN ("pq-put-nbytes", Fpq_put_nbytes, 2, 2, 0, /* @@ -1575,12 +1687,114 @@ End a copying operation. return PQendcopy (P) ? Qt : Qnil; } +/* The setenv suite of functions. The author of the libpq manual doesn't + know a whole lot about them, and neither do I. +*/ +#if !defined (HAVE_POSTGRESQLV7) || defined (LIBPQ_7_0_IS_FIXED) +DEFUN ("pq-setenv", Fpq_setenv, 1, 1, 0, /* +Set environmental parameters on the backend synchronously. +Returns t if the operation was successful, nil otherwise. +*/ + (conn)) +{ + PGconn *P; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + return PQsetenv (P) ? Qt : Qnil; +} +#endif + +#ifdef LIBPQ_7_0_IS_FIXED + +DEFUN ("pq-setenv-start", Fpq_setenv_start, 1, 1, 0, /* +Set environmental parameters on the backend asynchronously. +A PGsetenvHandle is returned on success, nil otherwise. +*/ + (conn)) +{ + PGconn *P; + PGsetenvHandle *handle; + Lisp_setenvHandle *lseh; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + handle = PQsetenvStart (P); + if (!handle) error ("out of memory?"); + + lseh = allocate_pgsetenv (); + lseh->setenv = handle; + + return make_pgsetenv (lseh); +} + +DEFUN ("pq-setenv-poll", Fpq_setenv_poll, 1, 1, 0, /* +Poll an asynchronous setenv operation for completion. +*/ + (conn)) +{ + PGconn *P; + PostgresPollingStatusType pst; + + CHECK_PGCONN (conn); + P = (XPGCONN (conn))->pgconn; + CHECK_LIVE_CONNECTION (P); + + pst = PQsetenvPoll (P); + switch (pst) + { + 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!", PS); + } +} + +DEFUN ("pq-setenv-abort", Fpq_setenv_abort, 1, 1, 0, /* +Attempt to abort an in-progress asynchronous setenv operation. +*/ + (handle)) +{ + PGsetenvHandle *h; + + CHECK_PGSETENV (handle); + h = (XPGSETENV (handle))->pgsetenv; + PUKE_IF_NULL (h); + + PQsetenvAbort (h); + /* PQsetenvAbort usually free(3)'s the handle, don't take any chances. */ + (XSETENV (handle))->pgsetenv = (PGsetenvHandle *)NULL; + + return Qt; +} +#endif /* LIBPQ_7_0_IS_FIXED */ + void syms_of_postgresql(void) { #ifndef RUNNING_XEMACS_21_1 INIT_LRECORD_IMPLEMENTATION (pgconn); INIT_LRECORD_IMPLEMENTATION (pgresult); +#ifdef LIBPQ_7_0_IS_FIXED + INIT_LRECORD_IMPLEMENTATION (pgsetenv); +#endif #endif defsymbol (&Qpostgresql, "postgresql"); @@ -1693,11 +1907,23 @@ syms_of_postgresql(void) DEFSUBR (Fpq_get_line_async); DEFSUBR (Fpq_put_nbytes); DEFSUBR (Fpq_end_copy); + + /* The value of the setenv functions is questioned in the libpq manual. */ +#if !defined (HAVE_POSTGRESQLV7) || defined (LIBPQ_7_0_IS_FIXED) + DEFSUBR (Fpq_setenv); +#endif +#ifdef LIBPQ_7_0_IS_FIXED + DEFSUBR (Fpq_setenv_start); + DEFSUBR (Fpq_setenv_poll); + DEFSUBR (Fpq_setenv_abort); +#endif /* LIBPQ_7_0_IS_FIXED */ } void vars_of_postgresql(void) { + char *p; + Fprovide (Qpostgresql); #ifdef HAVE_POSTGRESQLV7 Fprovide (intern ("postgresqlv7")); @@ -1709,97 +1935,6 @@ Default Postgres client coding system. */ ); #endif - 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. -*/ ); - - 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. -*/ ); - - 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. -*/ ); - - 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. -*/ ); - - 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. -*/ ); - - DEFVAR_LISP ("pg:database", &VXPGDATABASE /* -Default database to connect to. -The initial value is set from the PGDATABASE environment variable. -*/ ); - - 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. */ - 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) - 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 - - DEFVAR_LISP ("pg:geqo", &VXPGGEQO /* -Genetic Query Optimizer options. -The initial value is set from the PGGEQO environment variable. -*/ ); - - DEFVAR_LISP ("pg:cost-index", &VXPGCOSTINDEX /* -Default cost index options. -The initial value is set from the PGCOSTINDEX environment variable. -*/ ); - - DEFVAR_LISP ("pg:cost-heap", &VXPGCOSTHEAP /* -Default cost heap options. -The initial value is set from the PGCOSTHEAP environment variable. -*/ ); - - DEFVAR_LISP ("pg:tz", &VXPGTZ /* -Default timezone to use. -The initial value is set from the PGTZ environment variable. -*/ ); - - DEFVAR_LISP ("pg:date-style", &VXPGDATESTYLE /* -Default date style to use. -The initial value is set from the PGDATESTYLE environment variable. -*/ ); -} - -/* These initializations should not be done at dump-time. */ -void -init_postgresql_from_environment(void) -{ - char *p; - if ((p = getenv ("PGHOST"))) { VXPGHOST = build_ext_string (p, PG_OS_CODING); @@ -1808,6 +1943,11 @@ init_postgresql_from_environment(void) { 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"))) { @@ -1817,6 +1957,11 @@ init_postgresql_from_environment(void) { 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"))) { @@ -1826,6 +1971,11 @@ init_postgresql_from_environment(void) { 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"))) { @@ -1835,6 +1985,11 @@ init_postgresql_from_environment(void) { 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"))) { @@ -1844,6 +1999,11 @@ init_postgresql_from_environment(void) { 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"))) { @@ -1853,6 +2013,10 @@ init_postgresql_from_environment(void) { 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"))) { @@ -1862,6 +2026,10 @@ init_postgresql_from_environment(void) { 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 @@ -1874,6 +2042,10 @@ init_postgresql_from_environment(void) { 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) @@ -1885,6 +2057,13 @@ init_postgresql_from_environment(void) { 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"))) @@ -1895,6 +2074,10 @@ init_postgresql_from_environment(void) { 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"))) { @@ -1904,6 +2087,10 @@ init_postgresql_from_environment(void) { 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"))) { @@ -1913,6 +2100,10 @@ init_postgresql_from_environment(void) { 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"))) { @@ -1922,6 +2113,10 @@ init_postgresql_from_environment(void) { 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"))) { @@ -1931,5 +2126,8 @@ init_postgresql_from_environment(void) { VXPGDATESTYLE = Qnil; } + DEFVAR_LISP ("pg:date-style", &VXPGDATESTYLE /* +Default date style to use. +The initial value is set from the PGDATESTYLE environment variable. +*/ ); } - diff --git a/src/postgresql.h b/src/postgresql.h index acfda83..e13d96a 100644 --- a/src/postgresql.h +++ b/src/postgresql.h @@ -10,12 +10,10 @@ Please send patches to this file to me first before submitting them to xemacs-patches. */ -#ifndef INCLUDED_postgresql_h_ -#define INCLUDED_postgresql_h_ 1 +#ifndef XEMACS_POSTGRESQL_H__ +#define XEMACS_POSTGRESQL_H__ 1 -#include LIBPQ_FE_H_FILE /* main PostgreSQL header file */ - -#define BLCKSZ 8192 /* size of a default Postgres disk block */ +#define BLCKSZ 8192 /* size of a default Postres disk block */ /* This file contains the GCC bug workaround code for the private LRECORD types. @@ -59,4 +57,31 @@ DECLARE_LRECORD (pgresult, Lisp_PGresult); #define CHECK_PGRESULT(x) CHECK_RECORD (x, pgresult) #define CONCHECK_PGRESULT(x) CONCHECK_RECORD (x, pgresult) -#endif /* INCLUDED_postgresql_h_ */ +/****/ +#ifdef HAVE_POSTGRESQLV7 + +#ifdef LIBPQ_7_0_IS_FIXED /* this is broken in released 7.0b1 */ + +/* PGsetenvHandle is an opaque object and we need to be able to store + them in Lisp code in order to make asynchronous environment calls. +*/ +struct Lisp_PGsetenvHandle +{ + struct lcrecord_header header; + PGsetenvHandle *pgsetenv; +}; +typedef struct Lisp_PGsetenvHandle Lisp_PGsetenvHandle; + +DECLARE_LRECORD (pgsetenv, Lisp_PGsetenvHandle); + +#define XPGSETENV(x) XRECORD (x, pgsetenv, Lisp_PGsetenvHandle) +#define XSETPGSETENV(x, p) XSETRECORD (x, p, pgsetenv) +#define PGSETENVP(x) RECORDP (x, pgsetenv) +#define CHECK_PGSETENV(x) CHECK_RECORD (x, pgsetenv) +#define CONCHECK_PGSETENV(x) CONCHECK_RECORD (x, pgsetenv) + +#endif /* LIBPQ_7_0_IS_FIXED */ + +#endif /* HAVE_POSTGRESQLV7 */ + +#endif /* XEMACS_POSTGRESQL_H__ */ diff --git a/src/pure.c b/src/pure.c new file mode 100644 index 0000000..0d15775 --- /dev/null +++ b/src/pure.c @@ -0,0 +1,36 @@ +/* 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. Split out of alloc.c. */ + +#include <config.h> +#include "lisp.h" +#include "puresize.h" + +/* Moved from puresize.h to here so alloc.c does not get recompiled */ + +# include <puresize-adjust.h> +#define PURESIZE ((RAW_PURESIZE) + (PURESIZE_ADJUSTMENT)) + +size_t +get_PURESIZE (void) +{ + return PURESIZE; +} + +/* Force linker to put it into data space! */ +EMACS_INT pure[PURESIZE / sizeof (EMACS_INT)] = { (EMACS_INT) 0}; diff --git a/src/puresize.h b/src/puresize.h new file mode 100644 index 0000000..0e4bc33 --- /dev/null +++ b/src/puresize.h @@ -0,0 +1,169 @@ +/* Definition of PURESIZE. + Copyright (C) 1986, 1988, 1992, 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1995, 1996 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +#ifndef PURESIZE_H +#define PURESIZE_H + +/* If RAW_PURESIZE is already defined then the user overrode it at + configure time. */ +#ifndef RAW_PURESIZE + +/* Basic amount of purespace to use, in the absence of extra + things configured in. */ + + +/* This computation is Barbra Streisand, BS +#if (LONGBITS == 64) +# define BASE_PURESIZE 938000 +#else +# define BASE_PURESIZE 563000 +#endif +*/ + +#define BASE_PURESIZE 1400000 + +/* If any particular systems need to change the base puresize, they + should define SYSTEM_PURESIZE_EXTRA. Note that this can be + negative as well as positive. + + Do NOT define PURESIZE or any other values. This allows the + other values to shift while still keeping things in sync. */ + +#ifndef SYSTEM_PURESIZE_EXTRA +# define SYSTEM_PURESIZE_EXTRA 0 +#endif + +/* Extra amount of purespace needed for menubars. */ + +#ifdef HAVE_DIALOGS +# if (LONGBITS == 64) +# define DIALOG_PURESIZE_EXTRA 43000 +# else +# define DIALOG_PURESIZE_EXTRA 1800 +# endif +#else +# define DIALOG_PURESIZE_EXTRA 0 +#endif + +#ifdef HAVE_MENUBARS +# if (LONGBITS == 64) +# define MENUBAR_PURESIZE_EXTRA 43000 +# else +# define MENUBAR_PURESIZE_EXTRA 36000 +# endif +#else +# define MENUBAR_PURESIZE_EXTRA 0 +#endif + +#ifdef HAVE_SCROLLBARS +# if (LONGBITS == 64) +# define SCROLLBAR_PURESIZE_EXTRA 4000 +# else +# define SCROLLBAR_PURESIZE_EXTRA 1800 +# endif +#else +# define SCROLLBAR_PURESIZE_EXTRA 0 +#endif + +#ifdef HAVE_TOOLBARS +# if (LONGBITS == 64) +# define TOOLBAR_PURESIZE_EXTRA 4000 +# else +# define TOOLBAR_PURESIZE_EXTRA 8400 +# endif +#else +# define TOOLBAR_PURESIZE_EXTRA 0 +#endif + +/* Extra amount of purespace needed for X11, separate from menubars + and scrollbars. */ + +#ifdef HAVE_X_WINDOWS +# if (LONGBITS == 64) +# define X11_PURESIZE_EXTRA 95000 +# else +# define X11_PURESIZE_EXTRA 68000 +# endif +#else +# define X11_PURESIZE_EXTRA 0 +#endif + +/* Extra amount of purespace needed for Mule. */ + +#ifdef MULE +#ifdef HAVE_CANNA +# define MULE_PURESIZE_CANNA 5000 +#else +# define MULE_PURESIZE_CANNA 0 +#endif +#ifdef HAVE_WNN +# define MULE_PURESIZE_WNN 5000 +#else +# define MULE_PURESIZE_WNN 0 +#endif +# if (LONGBITS == 64) +# define MULE_PURESIZE_EXTRA 99000+MULE_PURESIZE_CANNA+MULE_PURESIZE_WNN +# else +# define MULE_PURESIZE_EXTRA 78000+MULE_PURESIZE_CANNA+MULE_PURESIZE_WNN +# endif +#else +# define MULE_PURESIZE_EXTRA 0 +#endif + +/* Extra amount of purespace needed for Tooltalk. */ + +#ifdef TOOLTALK +# if (LONGBITS == 64) +# define TOOLTALK_PURESIZE_EXTRA 100000 +# else +# define TOOLTALK_PURESIZE_EXTRA 8300 +# endif +#else +# define TOOLTALK_PURESIZE_EXTRA 0 +#endif + +/* Extra amount of purespace needed for Sunpro builds. */ + +#ifdef SUNPRO +#define SUNPRO_PURESIZE_EXTRA 95000 +#else +# define SUNPRO_PURESIZE_EXTRA 0 +#endif + +#define RAW_PURESIZE ((BASE_PURESIZE) + \ + (DIALOG_PURESIZE_EXTRA) + \ + (MENUBAR_PURESIZE_EXTRA) + \ + (SCROLLBAR_PURESIZE_EXTRA) + \ + (TOOLBAR_PURESIZE_EXTRA) + \ + (X11_PURESIZE_EXTRA) + \ + (SYSTEM_PURESIZE_EXTRA) + \ + (MULE_PURESIZE_EXTRA) + \ + (TOOLTALK_PURESIZE_EXTRA) + \ + (SUNPRO_PURESIZE_EXTRA)) + +#endif /* !RAW_PURESIZE */ + +size_t get_PURESIZE (void); +extern EMACS_INT pure[]; + +#endif /* PURESIZE_H */ diff --git a/src/redisplay-gtk.c b/src/redisplay-gtk.c index 119109e..f1ee926 100644 --- a/src/redisplay-gtk.c +++ b/src/redisplay-gtk.c @@ -51,10 +51,6 @@ Boston, MA 02111-1307, USA. */ #include "file-coding.h" /* for CCL conversion */ #endif -#ifdef HAVE_POLL -#include <sys/poll.h> -#endif - #define CONST const #define EOL_CURSOR_WIDTH 5 @@ -421,8 +417,8 @@ gtk_output_display_block (struct window *w, struct display_line *dl, int block, struct display_box dbox; struct display_glyph_area dga; redisplay_calculate_display_boxes (dl, rb->xpos, rb->object.dglyph.xoffset, - rb->object.dglyph.yoffset ,start_pixpos, - rb->width, &dbox, &dga); + start_pixpos, rb->width, + &dbox, &dga); XSETWINDOW (window, w); instance = glyph_image_instance (rb->object.dglyph.glyph, diff --git a/src/redisplay-msw.c b/src/redisplay-msw.c index 8098d0e..17394f4 100644 --- a/src/redisplay-msw.c +++ b/src/redisplay-msw.c @@ -26,9 +26,8 @@ Boston, MA 02111-1307, USA. */ 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 @@ Boston, MA 02111-1307, USA. */ #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" @@ -55,19 +54,29 @@ Boston, MA 02111-1307, USA. */ #define MSWINDOWS_EOL_CURSOR_WIDTH 5 /* - * Random forward declarations + * Random forward delarations */ -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_clear_region (Lisp_Object locale, face_index findex, + int x, int y, int width, int height); 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 +101,7 @@ typedef struct textual_run 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 @@ -134,9 +143,9 @@ separate_textual_runs (unsigned char *text_storage, #ifdef MULE { Lisp_Object ccl_prog = XCHARSET_CCL_PROGRAM (charset); - if ((!NILP (ccl_prog)) - && (setup_ccl_program (&char_converter, ccl_prog) >= 0)) - need_ccl_conversion = 1; + need_ccl_conversion = !NILP (ccl_prog); + if (need_ccl_conversion) + setup_ccl_program (&char_converter, ccl_prog); } #endif } @@ -158,7 +167,7 @@ separate_textual_runs (unsigned char *text_storage, 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 +194,7 @@ mswindows_text_width_single_run (HDC hdc, struct face_cachel *cachel, 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 +202,12 @@ mswindows_text_width_single_run (HDC hdc, struct face_cachel *cachel, 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 +215,18 @@ get_frame_compdc (struct frame *f) 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 +238,54 @@ mswindows_update_dc (HDC hdc, Lisp_Object fg, Lisp_Object bg, } } -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,45 +304,37 @@ mswindows_output_hline (struct window *w, struct display_line *dl, struct rune * 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, - /*rb->object.dglyph.yoffset*/ 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); } } @@ -338,27 +351,23 @@ mswindows_output_cursor (struct window *w, struct display_line *dl, int xpos, { struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device); - struct face_cachel *cachel=0; + struct face_cachel *cachel; 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 */ @@ -381,16 +390,16 @@ mswindows_output_cursor (struct window *w, struct display_line *dl, int xpos, /* 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) @@ -399,9 +408,9 @@ mswindows_output_cursor (struct window *w, struct display_line *dl, int xpos, 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) @@ -417,12 +426,16 @@ mswindows_output_cursor (struct window *w, struct display_line *dl, int xpos, 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); } } @@ -451,17 +464,15 @@ mswindows_output_cursor (struct window *w, struct display_line *dl, int xpos, 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); @@ -493,15 +504,11 @@ mswindows_output_string (struct window *w, struct display_line *dl, xpos -= xoffset; /* sort out the destination rectangle */ - height = DISPLAY_LINE_HEIGHT (dl); + height = dl->ascent + dl->descent - dl->clip; 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; @@ -511,14 +518,13 @@ mswindows_output_string (struct window *w, struct display_line *dl, if (!NILP(bg_pmap)) { - struct display_box db; - struct display_glyph_area dga; - redisplay_calculate_display_boxes (dl, xpos + xoffset, 0, 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 */ @@ -531,27 +537,26 @@ mswindows_output_string (struct window *w, struct display_line *dl, 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), + mswindows_clear_region (window, findex, clear_start, + dl->ypos - dl->ascent, clear_end - clear_start, height); /* output pixmap calls this so we have to recall to get correct @@ -565,165 +570,245 @@ mswindows_output_string (struct window *w, struct display_line *dl, 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; - 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); + COLORREF bgcolor = GetBkColor (hdc); + int need_clipping = (clip_x || clip_y); + int yoffset=0; + int xoffset=0; + /* 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 */ + } - /* first blit the mask */ - if (IMAGE_INSTANCE_MSWINDOWS_MASK (p)) + if (need_clipping) { - RGBQUAD bg; - COLORREF bgcolor; + } - old = SelectObject (hcompdc, IMAGE_INSTANCE_MSWINDOWS_MASK (p)); + /* first blt the mask */ + if (IMAGE_INSTANCE_MSWINDOWS_MASK (p)) + { + RGBQUAD col; + col.rgbBlue = GetBValue (bgcolor); + col.rgbRed = GetRValue (bgcolor); + col.rgbGreen = GetGValue (bgcolor); + col.rgbReserved = 0; + + old = SelectObject (FRAME_MSWINDOWS_CDC (f), + IMAGE_INSTANCE_MSWINDOWS_MASK (p)); - if (IMAGE_INSTANCE_TYPE (p) == IMAGE_MONO_PIXMAP) - { - COLORREF fgcolor; - RGBQUAD fg; - - fgcolor = GetTextColor (hdc); - fg.rgbBlue = GetBValue (fgcolor); - fg.rgbRed = GetRValue (fgcolor); - fg.rgbGreen = GetGValue (fgcolor); - fg.rgbReserved = 0; - SetDIBColorTable (hcompdc, 0, 1, &fg); - } - - bgcolor = GetBkColor (hdc); - bg.rgbBlue = GetBValue (bgcolor); - bg.rgbRed = GetRValue (bgcolor); - bg.rgbGreen = GetGValue (bgcolor); - bg.rgbReserved = 0; - SetDIBColorTable (hcompdc, 1, 1, &bg); - - 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); - - SelectObject (hcompdc, old); + SetDIBColorTable (FRAME_MSWINDOWS_CDC (f), 1, 1, &col); + + BitBlt (hdc, + x,y, + width, height, + FRAME_MSWINDOWS_CDC (f), + xoffset,yoffset, + SRCCOPY); + + 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))); - - 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); - - SelectObject (hcompdc, old); + /* now blt the bitmap itself. */ + old = SelectObject (FRAME_MSWINDOWS_CDC (f), + IMAGE_INSTANCE_MSWINDOWS_BITMAP (p)); + + BitBlt (hdc, + x,y, + width, height, + FRAME_MSWINDOWS_CDC (f), + xoffset, yoffset, + IMAGE_INSTANCE_MSWINDOWS_MASK (p) ? SRCINVERT : SRCCOPY); + + 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) + { + pheight = min (pheight, IMAGE_INSTANCE_PIXMAP_HEIGHT (p) - + y % IMAGE_INSTANCE_PIXMAP_HEIGHT (p)); + } + + while (pheight > 0) { - xdga.width = min (min (db->width, IMAGE_INSTANCE_PIXMAP_WIDTH (p)), + if (offset_bitmap) + { + pwidth = min (min (width, IMAGE_INSTANCE_PIXMAP_WIDTH (p)), IMAGE_INSTANCE_PIXMAP_WIDTH (p) - - db->xpos % IMAGE_INSTANCE_PIXMAP_WIDTH (p)); - pxoffset = 0; - while (xdga.width > 0) + x % IMAGE_INSTANCE_PIXMAP_WIDTH (p)); + pxoffset = 0; + } + while (pwidth > 0) { - 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)); + 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 += xdga.height; - xdga.height = min ((db->height - pyoffset), - IMAGE_INSTANCE_PIXMAP_HEIGHT (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); - Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); + struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); Lisp_Object window; + int lheight = dl->ascent + dl->descent - dl->clip; + 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 */ + mswindows_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 @@ -735,7 +820,7 @@ mswindows_output_pixmap (struct window *w, Lisp_Object image_instance, * 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); @@ -758,7 +843,7 @@ mswindows_redisplay_deadbox_maybe (struct window *w, const RECT* prc) 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)); } } @@ -815,11 +900,12 @@ mswindows_redraw_exposed_window (struct window *w, int x, int y, int width, 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; @@ -880,7 +966,6 @@ mswindows_redraw_exposed_area (struct frame *f, int x, int y, int width, int hei 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) { @@ -893,55 +978,38 @@ mswindows_redraw_exposed_area (struct frame *f, int x, int y, int width, int hei /***************************************************************************** - 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; - 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; - } + color = WINDOW_FACE_CACHEL_BACKGROUND (w, MODELINE_INDEX); + mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, color, Qnil); + + 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); } @@ -972,38 +1040,22 @@ mswindows_eol_cursor_width (void) } /***************************************************************************** - 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) -{ -#ifdef DEFER_WINDOW_POS - HDWP hdwp = FRAME_MSWINDOWS_DATA (f)->hdwp; - - if (hdwp != 0) - { - EndDeferWindowPos (hdwp); - FRAME_MSWINDOWS_DATA (f)->hdwp = 0; - } -#endif - GdiFlush(); -} - -/* Printer version is more lightweight. */ -static void -msprinter_frame_output_end (struct frame *f) +mswindows_output_end (struct device *d) { GdiFlush(); } @@ -1012,14 +1064,13 @@ static int 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; } @@ -1036,7 +1087,7 @@ mswindows_ring_bell (struct device *d, int volume, int pitch, int duration) Given a display line, a block number for that start line, output all runes between start and end in the specified display block. - Ripped off with minimal thought from the corresponding X routine. + Ripped off with mininmal thought from the corresponding X routine. ****************************************************************************/ static void mswindows_output_display_block (struct window *w, struct display_line *dl, int block, @@ -1060,14 +1111,18 @@ mswindows_output_display_block (struct window *w, struct display_line *dl, int b 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); @@ -1090,7 +1145,7 @@ mswindows_output_display_block (struct window *w, struct display_line *dl, int b 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; } @@ -1124,9 +1179,10 @@ mswindows_output_display_block (struct window *w, struct display_line *dl, int b 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; + + mswindows_clear_region (window, findex, xpos, dl->ypos - dl->ascent, + rb->width, height); elt++; } } @@ -1162,12 +1218,6 @@ mswindows_output_display_block (struct window *w, struct display_line *dl, int b 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, - rb->object.dglyph.yoffset, - start_pixpos, rb->width, &dbox, &dga); XSETWINDOW (window, w); instance = glyph_image_instance (rb->object.dglyph.glyph, @@ -1175,52 +1225,54 @@ mswindows_output_display_block (struct window *w, struct display_line *dl, int b 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); - 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 (window, 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); + /* #### 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_NOTHING: - /* nothing is as nothing does */ - break; - - case IMAGE_TEXT: - case IMAGE_POINTER: - default: - abort (); + 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); } - IMAGE_INSTANCE_OPTIMIZE_OUTPUT - (XIMAGE_INSTANCE (instance)) = 0; - } + 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_POINTER: + abort (); + + case IMAGE_SUBWINDOW: + /* #### implement me */ + break; + + case IMAGE_NOTHING: + /* nothing is as nothing does */ + break; + + default: + abort (); + } + xpos += rb->width; elt++; } @@ -1230,15 +1282,14 @@ mswindows_output_display_block (struct window *w, struct display_line *dl, int b } 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); } @@ -1253,53 +1304,51 @@ static void 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 */ if (shadow != 0) { - /* #### This will be fixed to support arbitrary thickness */ + /* #### This will be fixed to support arbitrary thichkness */ InflateRect (&rect, abs_shadow, abs_shadow); - DrawEdge (hdc, &rect, + DrawEdge (FRAME_MSWINDOWS_DC (f), &rect, shadow > 0 ? EDGE_RAISED : EDGE_SUNKEN, BF_RECT); } } @@ -1312,9 +1361,8 @@ mswindows_output_vertical_divider (struct window *w, int clear_unused) ****************************************************************************/ 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); @@ -1324,7 +1372,7 @@ mswindows_text_width (struct frame *f, struct face_cachel *cachel, 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; @@ -1338,35 +1386,140 @@ mswindows_text_width (struct frame *f, struct face_cachel *cachel, given face. ****************************************************************************/ static void -mswindows_clear_region (Lisp_Object locale, struct device* d, struct frame* f, - face_index findex, int x, int y, - int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, - Lisp_Object background_pixmap) +mswindows_clear_region (Lisp_Object locale, face_index findex, int x, int y, + int width, int height) { + struct window *w; + struct frame *f; + Lisp_Object background_pixmap = Qunbound; + Lisp_Object temp; RECT rect = { x, y, x+width, y+height }; - HDC hdc = get_frame_dc (f, 1); - if (!NILP (background_pixmap)) + if (!(width && height)) /* We often seem to get called with width==0 */ + return; + + if (WINDOWP (locale)) + { + w = XWINDOW (locale); + f = XFRAME (w->frame); + } + else if (FRAMEP (locale)) + { + w = NULL; + f = XFRAME (locale); + } + else + abort (); + + if (w) { - struct display_box db = { x, y, width, height }; - mswindows_update_dc (hdc, - fcolor, bcolor, background_pixmap); + temp = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, findex); + + if (IMAGE_INSTANCEP (temp) + && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp))) + { + /* #### maybe we could implement such that a string + can be a background pixmap? */ + background_pixmap = temp; + } + } + 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)) + { + Lisp_Object fcolor, bcolor; + + if (w) + { + fcolor = WINDOW_FACE_CACHEL_FOREGROUND (w, findex); + bcolor = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); + } + else + { + fcolor = FACE_FOREGROUND (Vdefault_face, locale); + bcolor = FACE_BACKGROUND (Vdefault_face, locale); + } + + 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, - &rect, NULL, 0, NULL); + Lisp_Object color = (w ? WINDOW_FACE_CACHEL_BACKGROUND (w, findex) : + FACE_BACKGROUND (Vdefault_face, locale)); + mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, color, Qnil); + ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); } #ifdef HAVE_SCROLLBARS if (WINDOWP (locale)) - mswindows_redisplay_deadbox_maybe (XWINDOW (locale), &rect); + mswindows_redisplay_deadbox_maybe (w, &rect); #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)) + mswindows_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f), + ypos1, FRAME_BORDER_WIDTH (f), height); + + if (bounds.left_in - bounds.left_out > 0) + mswindows_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) + mswindows_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1, + bounds.right_in - bounds.left_in, height); + + if (bounds.right_out - bounds.right_in > 0) + mswindows_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)) + mswindows_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) @@ -1383,33 +1536,17 @@ mswindows_clear_frame (struct frame *f) 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 --git a/src/redisplay-output.c b/src/redisplay-output.c index b19d74f..6266fd5 100644 --- a/src/redisplay-output.c +++ b/src/redisplay-output.c @@ -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, 2002 Andy Piper. This file is part of XEmacs. @@ -27,11 +26,9 @@ Boston, MA 02111-1307, USA. */ /* Author: Chuck Thompson */ -/* Heavily hacked for modularity, gutter and subwindow support by Andy - Piper. */ - #include <config.h> #include "lisp.h" +#include "debug.h" #include "buffer.h" #include "window.h" @@ -40,25 +37,13 @@ Boston, MA 02111-1307, USA. */ #include "glyphs.h" #include "redisplay.h" #include "faces.h" -#include "gutter.h" + +#include "sysdep.h" static int compare_runes (struct window *w, struct rune *crb, struct rune *drb); static void redraw_cursor_in_window (struct window *w, 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_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 @@ -102,7 +87,7 @@ sync_rune_structs (struct window *w, rune_dynarr *cra, rune_dynarr *dra) 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) @@ -182,7 +167,7 @@ sync_display_line_structs (struct window *w, int line, int do_blocks, /***************************************************************************** compare_runes - Compare two runes to see if each of their fields is equal. If so, + Compare to runes to see if each of their fields is equal. If so, return true otherwise return false. ****************************************************************************/ static int @@ -191,28 +176,10 @@ compare_runes (struct window *w, struct rune *crb, struct rune *drb) /* 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; @@ -223,81 +190,14 @@ compare_runes (struct window *w, struct rune *crb, struct rune *drb) 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 || - crb->object.dglyph.yoffset != drb->object.dglyph.yoffset || - crb->object.dglyph.ascent != drb->object.dglyph.ascent || - crb->object.dglyph.descent != drb->object.dglyph.descent)) + 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 for 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)) - { - /* 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; @@ -405,6 +305,8 @@ compare_display_blocks (struct window *w, struct display_line *cdl, int cursor_height) { struct frame *f = XFRAME (w->frame); + struct device *d = XDEVICE (f->device); + struct display_block *cdb, *ddb; int start_pos; int stop_pos; @@ -450,14 +352,8 @@ compare_display_blocks (struct window *w, struct display_line *cdl, 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 || @@ -520,10 +416,10 @@ compare_display_blocks (struct window *w, struct display_line *cdl, stop_pos = elt + 1; } - redisplay_output_display_block (w, ddl, d_block, start_pos, - stop_pos, start_pixpos, - cursor_start, cursor_width, - cursor_height); + DEVMETH (d, output_display_block, (w, ddl, d_block, start_pos, + stop_pos, start_pixpos, + cursor_start, cursor_width, + cursor_height)); return 1; } @@ -539,12 +435,13 @@ static void clear_left_border (struct window *w, int y, int height) { struct frame *f = XFRAME (w->frame); + struct device *d = XDEVICE (f->device); Lisp_Object window; XSETWINDOW (window, w); - redisplay_clear_region (window, DEFAULT_INDEX, - FRAME_LEFT_BORDER_START (f), y, - FRAME_BORDER_WIDTH (f), height); + DEVMETH (d, clear_region, (window, DEFAULT_INDEX, + FRAME_LEFT_BORDER_START (f), y, + FRAME_BORDER_WIDTH (f), height)); } /***************************************************************************** @@ -556,12 +453,13 @@ static void clear_right_border (struct window *w, int y, int height) { struct frame *f = XFRAME (w->frame); + struct device *d = XDEVICE (f->device); Lisp_Object window; XSETWINDOW (window, w); - redisplay_clear_region (window, DEFAULT_INDEX, - FRAME_RIGHT_BORDER_START (f), - y, FRAME_BORDER_WIDTH (f), height); + DEVMETH (d, clear_region, (window, DEFAULT_INDEX, + FRAME_RIGHT_BORDER_START (f), + y, FRAME_BORDER_WIDTH (f), height)); } /***************************************************************************** @@ -578,6 +476,7 @@ output_display_line (struct window *w, display_line_dynarr *cdla, { struct frame *f = XFRAME (w->frame); + struct device *d = XDEVICE (f->device); struct buffer *b = XBUFFER (w->buffer); struct buffer *old_b = window_display_buffer (w); struct display_line *cdl, *ddl; @@ -639,7 +538,7 @@ output_display_line (struct window *w, display_line_dynarr *cdla, a TEXT block. */ if (ddl->modeline) { - /* The shadow thickness check is necessary if only the sign of + /* The shadow thickness check is necesssary if only the sign of the size changed. */ if (cdba && !w->shadow_thickness_changed) { @@ -648,8 +547,8 @@ output_display_line (struct window *w, display_line_dynarr *cdla, } else { - redisplay_output_display_block (w, ddl, 0, 0, -1, start_pixpos, - 0, 0, 0); + DEVMETH (d, output_display_block, (w, ddl, 0, 0, -1, start_pixpos, + 0, 0, 0)); must_sync = 1; } @@ -694,46 +593,37 @@ output_display_line (struct window *w, display_line_dynarr *cdla, (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); + DEVMETH (d, 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 @@ -764,11 +654,7 @@ output_display_line (struct window *w, display_line_dynarr *cdla, 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, @@ -800,11 +686,11 @@ output_display_line (struct window *w, display_line_dynarr *cdla, } must_sync = 1; - redisplay_output_display_block (w, ddl, block, first_elt, - last_elt, - start_pixpos, - cursor_start, cursor_width, - cursor_height); + DEVMETH (d, output_display_block, (w, ddl, block, first_elt, + last_elt, + start_pixpos, + cursor_start, cursor_width, + cursor_height)); } start_pixpos = next_start_pixpos; @@ -819,23 +705,19 @@ output_display_line (struct window *w, display_line_dynarr *cdla, 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)); - } - - if (window_is_leftmost (w)) - clear_left_border (w, y, height); - if (window_is_rightmost (w)) - clear_right_border (w, y, height); + 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 (cdla) @@ -902,11 +784,16 @@ redisplay_move_cursor (struct window *w, Bufpos new_point, int no_output_end) } 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); } @@ -920,10 +807,7 @@ redisplay_move_cursor (struct window *w, Bufpos new_point, int no_output_end) 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; } @@ -942,10 +826,7 @@ redisplay_move_cursor (struct window *w, Bufpos new_point, int no_output_end) 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 @@ -977,7 +858,7 @@ redisplay_move_cursor (struct window *w, Bufpos new_point, int no_output_end) } } - 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); @@ -1009,10 +890,7 @@ redisplay_move_cursor (struct window *w, Bufpos new_point, int no_output_end) 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; } @@ -1025,10 +903,7 @@ redisplay_move_cursor (struct window *w, Bufpos new_point, int no_output_end) } 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 @@ -1083,18 +958,12 @@ redraw_cursor_in_window (struct window *w, int run_end_begin_meths) (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)); } } @@ -1119,869 +988,12 @@ redisplay_redraw_cursor (struct frame *f, int run_end_begin_meths) redraw_cursor_in_window (XWINDOW (window), run_end_begin_meths); } -/**************************************************************************** - redisplay_output_display_block - - Given a display line, a block number for that start line, output all - runes between start and end in the specified display block. - ****************************************************************************/ -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_height) -{ - 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) -{ - 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) - + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) > (unsigned) x - && - IMAGE_INSTANCE_DISPLAY_X (ii) < (unsigned) (x + width) - && - IMAGE_INSTANCE_DISPLAY_Y (ii) - + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) > (unsigned) y - && - IMAGE_INSTANCE_DISPLAY_Y (ii) < (unsigned) (y + height) - && - !EQ (XCAR (rest), ignored_window)) - { - unmap_subwindow (XCAR (rest)); - } - } -} - -/**************************************************************************** - redisplay_unmap_subwindows_maybe - - Potentially subwindows from the area in the box defined by the given - parameters. - ****************************************************************************/ -void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height) -{ - if (!NILP (XWEAK_LIST_LIST (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_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) -{ - 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. */ - redisplay_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 - || - /* We only want to do full subwindow display for windows that - are completely in the gutter, otherwise we must clip to be - safe. */ - display_boxes_in_gutter_p (XFRAME (w->frame), 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 - necessary changes in update_subwindow. This has all now been - implemented, Viva la revolution! - ****************************************************************************/ -void -redisplay_output_layout (Lisp_Object domain, - 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 rest, window = DOMAIN_WINDOW (domain); - Emchar_dynarr *buf = Dynarr_new (Emchar); - struct window *w = XWINDOW (window); - struct device *d = DOMAIN_XDEVICE (domain); - int layout_height, layout_width; - - layout_height = glyph_height (image_instance, domain); - layout_width = glyph_width (image_instance, domain); - - 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)) - { - /* 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 xpos = db->xpos; - int height = dga->height; - int width = dga->width; - - /* The bevel_area routines always draw in from the specified - area so there is no need to adjust the displayed area to - make sure that the lines are visible. */ - 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; - - 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, xpos, ypos, width, height, - DEFAULT_WIDGET_SHADOW_WIDTH, 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 = glyph_image_instance (XCAR (rest), image_instance, - ERROR_ME_NOT, 1); - - 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, image_instance); - cdga.height = glyph_height (child, image_instance); - - 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; - - 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, image_instance); - dl.ascent = glyph_ascent (child, image_instance); - dl.descent = glyph_descent (child, image_instance); - 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 (image_instance, 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; - - case IMAGE_NOTHING: - /* nothing is as nothing does */ - break; - - case IMAGE_POINTER: - default: - abort (); - } - } - IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) = 0; - } - } - - /* Update any display properties. I'm not sure whether this actually - does anything for layouts except clear the changed flags. */ - redisplay_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); - -#ifdef DEBUG_REDISPLAY - printf ("redisplay_output_pixmap(request) \ -[%dx%d@%d+%d] in [%dx%d@%d+%d]\n", - db->width, db->height, db->xpos, db->ypos, - dga->width, dga->height, dga->xoffset, dga->yoffset); -#endif - - /* This makes the glyph area fit into the display area. */ - if (!redisplay_normalize_glyph_area (db, dga)) - return; - -#ifdef DEBUG_REDISPLAY - printf ("redisplay_output_pixmap(normalized) \ -[%dx%d@%d+%d] in [%dx%d@%d+%d]\n", - db->width, db->height, db->xpos, db->ypos, - dga->width, dga->height, dga->xoffset, dga->yoffset); -#endif - - /* 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) - { - redisplay_clear_clipped_region (window, findex, - db, dga, - (IMAGE_INSTANCE_PIXMAP_MASK (p) != 0), - Qnil); - - /* This shrinks the display box to exactly enclose the glyph - area. */ - redisplay_normalize_display_box (db, dga); - } - 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)); -} - -/**************************************************************************** - redisplay_clear_region - - Clear the area in the box defined by the given parameters using the - given face. This has been generalised so that subwindows can be - coped with effectively. - ****************************************************************************/ -void -redisplay_clear_region (Lisp_Object locale, face_index findex, int x, int y, - int width, int height) -{ - struct window *w = NULL; - struct frame *f = NULL; - struct device *d; - Lisp_Object background_pixmap = Qunbound; - Lisp_Object fcolor = Qnil, bcolor = Qnil; - - if (!width || !height) - return; - - if (WINDOWP (locale)) - { - w = XWINDOW (locale); - f = XFRAME (w->frame); - } - else if (FRAMEP (locale)) - { - w = NULL; - f = XFRAME (locale); - } - else - abort (); - - 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); - - /* #### 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) - && y >= FRAME_TOP_BORDER_END (f) - && 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))) - { - /* #### maybe we could implement such that a string - can be a background pixmap? */ - background_pixmap = temp; - } - } - 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) - { - if (w) - { - fcolor = WINDOW_FACE_CACHEL_FOREGROUND (w, findex); - bcolor = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); - } - else - { - fcolor = FACE_FOREGROUND (Vdefault_face, locale); - bcolor = FACE_BACKGROUND (Vdefault_face, locale); - } - } - else - { - fcolor = (w ? - WINDOW_FACE_CACHEL_BACKGROUND (w, findex) : - FACE_BACKGROUND (Vdefault_face, locale)); - - } - - if (UNBOUNDP (background_pixmap)) - background_pixmap = Qnil; - - 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 occurrence - 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 glyphsrc in dest. - - display_box and display_glyph_area 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. - - dest - display_box - - xpos - absolute horizontal position of area. - - ypos - absolute vertical position of area. - - glyphsrc - display_glyph_area - - xoffset - horizontal offset of the glyph, +ve means display - the glyph with the x position offset by xoffset, -ve means - display starting xoffset into the glyph. - - yoffset - vertical offset of the glyph, +ve means display the - glyph with y position offset by yoffset, -ve means display - starting xoffset into the glyph. - - ****************************************************************************/ -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 - || - /* #### Not sure why this wasn't coped with before but normalizing - to zero width or height is definitely wrong. */ - (dest->xpos + glyphsrc->xoffset + glyphsrc->width > dest->xpos + dest->width - && - dest->width - glyphsrc->xoffset <= 0) - || - (dest->ypos + glyphsrc->yoffset + glyphsrc->height > dest->ypos + dest->height - && - dest->height - glyphsrc->yoffset <= 0)) - { - /* It's all clipped out */ - return 0; - } - - /* Horizontal offsets. This works because xoffset can be -ve as well - as +ve. When we enter this function the glyphsrc width and - height are set to the actual glyph width and height irrespective - of how much can be displayed. We are trying to clip both the - offset into the image and the rightmost bounding box. Its - possible for the glyph width to be much larger than the area we - are displaying into (e.g. a large glyph in a small frame). */ - if (dest->xpos + glyphsrc->xoffset + glyphsrc->width > dest->xpos + dest->width) - { - /* glyphsrc offset is +ve we are trying to display offset from the - origin (the bounding box contains some space and then the - glyph). At most the width we want to display is dest->width - - glyphsrc->xoffset. */ - if (glyphsrc->xoffset > 0) - glyphsrc->width = dest->width - glyphsrc->xoffset; - /* glyphsrc offset is -ve we are trying to display hard up - against the dest corner inset into the glyphsrc by - xoffset.*/ - else if (glyphsrc->xoffset < 0) - { - glyphsrc->width += glyphsrc->xoffset; - glyphsrc->width = min (glyphsrc->width, dest->width); - } - else - glyphsrc->width = dest->width; - } - - else 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) && (dest->height > glyphsrc->yoffset)) - glyphsrc->height = dest->height - glyphsrc->yoffset; - else if (glyphsrc->yoffset < 0) - { - glyphsrc->height += glyphsrc->yoffset; - glyphsrc->height = min (glyphsrc->height, dest->height); - } - else - glyphsrc->height = dest->height; - } - - else 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 required display_glyph_area is completely inside - the window. -1 means the display_box is not in the window. 1 means the - display_box and the display_glyph_area are in the window. 0 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 -1; - - 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 0; -} - -/***************************************************************************** - 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 yoffset, 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->width = 0; - src->height = 0; - - src->yoffset = -dl->top_clip + yoffset; - - 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 If window is topmost, clear the internal border above it. ****************************************************************************/ -void +static void redisplay_clear_top_of_window (struct window *w) { Lisp_Object window; @@ -1990,6 +1002,7 @@ redisplay_clear_top_of_window (struct window *w) if (!NILP (Fwindow_highest_p (window))) { struct frame *f = XFRAME (w->frame); + struct device *d = XDEVICE (f->device); int x, y, width, height; x = w->pixel_left; @@ -2006,64 +1019,7 @@ redisplay_clear_top_of_window (struct window *w) y = FRAME_TOP_BORDER_START (f) - 1; height = FRAME_BORDER_HEIGHT (f) + 1; - redisplay_clear_region (window, DEFAULT_INDEX, x, y, width, height); - } -} - -/***************************************************************************** - 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); - } + DEVMETH (d, clear_region, (window, DEFAULT_INDEX, x, y, width, height)); } } @@ -2079,6 +1035,7 @@ redisplay_clear_bottom_of_window (struct window *w, display_line_dynarr *ddla, 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); @@ -2122,7 +1079,7 @@ redisplay_clear_bottom_of_window (struct window *w, display_line_dynarr *ddla, if (ypos2 <= ypos1) return; - redisplay_clear_to_window_end (w, ypos1, ypos2); + DEVMETH (d, clear_to_window_end, (w, ypos1, ypos2)); } /***************************************************************************** @@ -2142,7 +1099,7 @@ redisplay_update_line (struct window *w, int first_line, int last_line, 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) { @@ -2218,7 +1175,6 @@ redisplay_update_line (struct window *w, int first_line, int last_line, larger impact on their sizing. */ /* #### See if we can get away with only calling this if max_line_len is greater than the window_char_width. */ - /* #### BILL!!! Should we do this for GTK as well? */ #if defined(HAVE_SCROLLBARS) && defined(HAVE_X_WINDOWS) { extern int stupid_vertical_scrollbar_drag_hack; @@ -2228,8 +1184,14 @@ redisplay_update_line (struct window *w, int first_line, int last_line, } #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)); } /***************************************************************************** @@ -2343,11 +1305,11 @@ redisplay_output_window (struct window *w) } /* 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). */ - if (f->windows_structure_changed || f->faces_changed) + if (f->windows_structure_changed) redisplay_clear_top_of_window (w); /* Output each line. */ @@ -2366,7 +1328,7 @@ redisplay_output_window (struct window *w) 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. */ @@ -2400,43 +1362,15 @@ redisplay_output_window (struct window *w) 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 --git a/src/redisplay-tty.c b/src/redisplay-tty.c index 187cd47..9e8515d 100644 --- a/src/redisplay-tty.c +++ b/src/redisplay-tty.c @@ -53,12 +53,17 @@ Boston, MA 02111-1307, USA. */ 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 @@ static void term_get_fkeys (Lisp_Object keymap, char **address); 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,40 @@ tty_eol_cursor_width (void) } /***************************************************************************** - 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 console *c = XCONSOLE (FRAME_CONSOLE (f)); + struct console *c = XCONSOLE (DEVICE_CONSOLE (d)); CONSOLE_TTY_CURSOR_X (c) = CONSOLE_TTY_FINAL_CURSOR_X (c); CONSOLE_TTY_CURSOR_Y (c) = CONSOLE_TTY_FINAL_CURSOR_Y (c); @@ -284,7 +289,7 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block, elt++; } } - /* #### RUNE_HLINE is actually a little more complicated than this + /* #### RUNE_HLINE is actualy a little more complicated than this but at the moment it is only used to draw a turned off modeline and this will suffice for that. */ else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE) @@ -328,28 +333,77 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block, 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; - - case IMAGE_NOTHING: - /* nothing is as nothing does */ - break; - - case IMAGE_TEXT: - case IMAGE_POINTER: - default: - abort (); + 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); + } + + /* 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); + + 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: + /* just do nothing here */ + break; + + case IMAGE_POINTER: + abort (); + + case IMAGE_NOTHING: + /* nothing is as nothing does */ + break; + + default: + abort (); + } xpos += rb->width; elt++; @@ -407,14 +461,16 @@ tty_output_vertical_divider (struct window *w, int clear) Clear the area in the box defined by the given parameters. ****************************************************************************/ 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, - Lisp_Object background_pixmap) +tty_clear_region (Lisp_Object window, face_index findex, int x, int y, + int width, int height) { + struct window *w = XWINDOW (window); + struct frame *f = XFRAME (w->frame); struct console *c = XCONSOLE (FRAME_CONSOLE (f)); int line; - struct window* w = XWINDOW (window); + + if (!width || !height) + return; tty_turn_on_face (w, findex); for (line = y; line < y + height; line++) @@ -478,7 +534,7 @@ tty_clear_to_window_end (struct window *w, int ypos1, int ypos2) Lisp_Object window; XSETWINDOW (window, w); - redisplay_clear_region (window, DEFAULT_INDEX, x, ypos1, width, ypos2 - ypos1); + tty_clear_region (window, DEFAULT_INDEX, x, ypos1, width, ypos2 - ypos1); } } @@ -510,7 +566,7 @@ tty_clear_frame (struct frame *f) 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); @@ -881,13 +937,7 @@ reset_tty_modes (struct console *c) OUTPUT1_IF (c, TTY_SD (c).keypad_off); OUTPUT1_IF (c, TTY_SD (c).cursor_normal); OUTPUT1_IF (c, TTY_SD (c).end_motion); - - { - Lisp_Object frm = CONSOLE_SELECTED_FRAME (c); - - if (!NILP (frm)) - tty_frame_output_end (XFRAME (frm)); - } + tty_output_end (XDEVICE (CONSOLE_SELECTED_DEVICE (c))); } /***************************************************************************** @@ -900,21 +950,21 @@ tty_redisplay_shutdown (struct console *c) { 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); /* Clear the bottom line of the frame. */ - redisplay_clear_region (FRAME_SELECTED_WINDOW (f), DEFAULT_INDEX, 0, + tty_clear_region (FRAME_SELECTED_WINDOW (f), DEFAULT_INDEX, 0, f->height, f->width, 1); /* 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)); } } } @@ -924,15 +974,15 @@ tty_redisplay_shutdown (struct console *c) up or removed. */ -#ifdef NOT_YET /* 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 */ static int alternate_mode_on; /* nonzero if in alternate char set */ static int attributes_on; /* nonzero if any attributes on */ +#ifdef NOT_YET static void turn_on_insert (struct frame *f) { @@ -1059,12 +1109,12 @@ init_tty_for_redisplay (struct device *d, char *terminal_type) 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 @@ -1218,7 +1268,6 @@ init_tty_for_redisplay (struct device *d, char *terminal_type) */ cm_cost_init (c); -#ifdef NOT_YET /* * Initialize local flags. */ @@ -1227,7 +1276,6 @@ init_tty_for_redisplay (struct device *d, char *terminal_type) underline_mode_on = 0; alternate_mode_on = 0; attributes_on = 0; -#endif /* * Attempt to initialize the function_key_map to @@ -1257,8 +1305,7 @@ init_tty_for_redisplay (struct device *d, char *terminal_type) struct fkey_table { - const char *cap; - const char *name; + CONST char *cap, *name; }; /* Termcap capability names that correspond directly to X keysyms. @@ -1390,7 +1437,7 @@ term_get_fkeys_1 (Lisp_Object function_key_map) 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))); } @@ -1398,18 +1445,22 @@ term_get_fkeys_1 (Lisp_Object function_key_map) 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. */ @@ -1432,46 +1483,47 @@ term_get_fkeys_1 (Lisp_Object function_key_map) { 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"); - - /* 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"); + /* 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"); #undef CONDITIONAL_REASSIGN + } return Qnil; } @@ -1493,8 +1545,8 @@ console_type_create_redisplay_tty (void) 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 --git a/src/redisplay-x.c b/src/redisplay-x.c index d74bb3e..b6247a5 100644 --- a/src/redisplay-x.c +++ b/src/redisplay-x.c @@ -40,7 +40,6 @@ Boston, MA 02111-1307, USA. */ #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 @@ Boston, MA 02111-1307, USA. */ #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, @@ -68,10 +74,13 @@ static void x_redraw_exposed_window (struct window *w, int x, int y, int width, int height); static void x_redraw_exposed_windows (Lisp_Object window, int x, int y, int width, int height); +static void x_clear_region (Lisp_Object window, face_index findex, int x, + int y, int width, int height); static void x_output_eol_cursor (struct window *w, struct display_line *dl, int xpos, face_index findex); static void x_clear_frame (struct frame *f); 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 +132,7 @@ struct textual_run 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 @@ -165,9 +174,9 @@ separate_textual_runs (unsigned char *text_storage, #ifdef MULE { Lisp_Object ccl_prog = XCHARSET_CCL_PROGRAM (charset); - if ((!NILP (ccl_prog)) - && (setup_ccl_program (&char_converter, ccl_prog) >= 0)) - need_ccl_conversion = 1; + need_ccl_conversion = !NILP (ccl_prog); + if (need_ccl_conversion) + setup_ccl_program (&char_converter, ccl_prog); } #endif } @@ -188,7 +197,7 @@ separate_textual_runs (unsigned char *text_storage, 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 +228,7 @@ static int 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 +250,7 @@ x_text_width_single_run (struct face_cachel *cachel, struct textual_run *run) */ 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 +295,24 @@ x_eol_cursor_width (void) } /***************************************************************************** - 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 +336,7 @@ x_output_display_block (struct window *w, struct display_line *dl, int block, 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 +344,18 @@ x_output_display_block (struct window *w, struct display_line *dl, int block, 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 +414,10 @@ x_output_display_block (struct window *w, struct display_line *dl, int block, 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; + + x_clear_region (window, findex, xpos, dl->ypos - dl->ascent, + rb->width, height); elt++; } } @@ -437,56 +451,56 @@ x_output_display_block (struct window *w, struct display_line *dl, int block, 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, - rb->object.dglyph.yoffset, start_pixpos, - rb->width, &dbox, &dga); - - XSETWINDOW (window, w); + XSETWINDOW (window, w); instance = glyph_image_instance (rb->object.dglyph.glyph, window, ERROR_ME_NOT, 1); 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 (window, 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_SUBWINDOW: + /* #### implement me */ + break; + + case IMAGE_NOTHING: + /* nothing is as nothing does */ + break; + + default: + abort (); + } xpos += rb->width; elt++; @@ -507,41 +521,38 @@ x_output_display_block (struct window *w, struct display_line *dl, int block, && (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 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. */ @@ -552,14 +563,12 @@ x_bevel_area (struct window *w, face_index findex, 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; @@ -573,16 +582,15 @@ x_bevel_area (struct window *w, face_index findex, 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; @@ -608,9 +616,7 @@ x_bevel_area (struct window *w, face_index findex, 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; @@ -619,22 +625,15 @@ x_bevel_area (struct window *w, face_index findex, bottom_shadow_gc = temp; } - if (style == EDGE_ETCHED_IN || style == EDGE_ETCHED_OUT) - shadow_thickness /= 2; + shadow_thickness = MODELINE_SHADOW_THICKNESS (w); - /* 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); + 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 (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_output_shadows (f, x, y, width, height, top_shadow_gc, bottom_shadow_gc, + background_gc, shadow_thickness); } /***************************************************************************** @@ -671,7 +670,7 @@ x_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg, { /* #### 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; } @@ -694,18 +693,8 @@ x_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg, mask |= GCBackground; } - /* This special case comes from a request to draw text with a face which has - the dim property. We'll use a stippled foreground GC. */ - if (EQ (bg_pmap, Qdim)) - { - assert (DEVICE_X_GRAY_PIXMAP (d) != None); - - gcv.fill_style = FillStippled; - gcv.stipple = DEVICE_X_GRAY_PIXMAP (d); - mask |= (GCFillStyle | GCStipple); - } - else if (IMAGE_INSTANCEP (bg_pmap) - && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) + if (IMAGE_INSTANCEP (bg_pmap) + && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) { if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0) { @@ -802,7 +791,7 @@ x_output_string (struct window *w, struct display_line *dl, 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. */ @@ -815,10 +804,6 @@ x_output_string (struct window *w, struct display_line *dl, 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)); @@ -863,13 +848,13 @@ x_output_string (struct window *w, struct display_line *dl, 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; @@ -884,7 +869,7 @@ x_output_string (struct window *w, struct display_line *dl, 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); @@ -895,8 +880,8 @@ x_output_string (struct window *w, struct display_line *dl, 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. */ @@ -907,22 +892,22 @@ x_output_string (struct window *w, struct display_line *dl, if (ypos1_line < ypos1_string) { - redisplay_clear_region (window, findex, clear_start, ypos1_line, + x_clear_region (window, findex, clear_start, ypos1_line, clear_end - clear_start, ypos1_string - ypos1_line); } if (ypos2_line > ypos2_string) { - redisplay_clear_region (window, findex, clear_start, ypos2_string, + x_clear_region (window, findex, clear_start, ypos2_string, clear_end - clear_start, ypos2_line - ypos2_string); } } else { - redisplay_clear_region (window, findex, clear_start, - DISPLAY_LINE_YPOS (dl), clear_end - clear_start, + x_clear_region (window, findex, clear_start, + dl->ypos - dl->ascent, clear_end - clear_start, height); } } @@ -930,18 +915,6 @@ x_output_string (struct window *w, struct display_line *dl, if (cursor && cursor_cachel && focus && NILP (bar_cursor_value)) gc = x_get_gc (d, font, cursor_cachel->foreground, cursor_cachel->background, Qnil, Qnil); - else if (cachel->dim) - { - /* Ensure the gray bitmap exists */ - if (DEVICE_X_GRAY_PIXMAP (d) == None) - DEVICE_X_GRAY_PIXMAP (d) = - XCreateBitmapFromData (dpy, x_win, (char *)gray_bits, - gray_width, gray_height); - - /* Request a GC with the gray stipple pixmap to draw dimmed text */ - gc = x_get_gc (d, font, cachel->foreground, cachel->background, - Qdim, Qnil); - } else gc = x_get_gc (d, font, cachel->foreground, cachel->background, Qnil, Qnil); @@ -955,7 +928,7 @@ x_output_string (struct window *w, struct display_line *dl, 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); } @@ -972,8 +945,7 @@ x_output_string (struct window *w, struct display_line *dl, /* We draw underlines in the same color as the text. */ if (cachel->underline) { - long upos; - long uthick; + unsigned long upos, uthick; XFontStruct *xfont; xfont = FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)); @@ -1056,7 +1028,7 @@ x_output_string (struct window *w, struct display_line *dl, 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) @@ -1116,12 +1088,12 @@ x_output_string (struct window *w, struct display_line *dl, 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) @@ -1156,10 +1128,10 @@ x_output_string (struct window *w, struct display_line *dl, } 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); @@ -1168,6 +1140,7 @@ x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p, int x, GC gc; XGCValues gcv; unsigned long pixmap_mask; + int need_clipping = (clip_x || clip_y); if (!override_gc) { @@ -1181,16 +1154,17 @@ x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p, int x, { 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); @@ -1201,6 +1175,19 @@ x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p, int x, /* 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 @@ -1209,32 +1196,125 @@ x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p, int x, 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; + } + + x_clear_region (window, findex, clear_x, clear_y, + clear_width, clear_height); + } /* Output the pixmap. */ { @@ -1246,19 +1326,20 @@ x_output_pixmap (struct window *w, Lisp_Object image_instance, 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 @@ -1266,17 +1347,17 @@ x_output_pixmap (struct window *w, Lisp_Object image_instance, 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); } } @@ -1293,18 +1374,21 @@ x_output_vertical_divider (struct window *w, int clear) 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); - + width = window_divider_width (w); shadow_thickness = XINT (w->vertical_divider_shadow_thickness); spacing = XINT (w->vertical_divider_spacing); @@ -1312,18 +1396,89 @@ x_output_vertical_divider (struct window *w, int clear) x = WINDOW_RIGHT (w) - width; y1 = WINDOW_TOP (w); y2 = WINDOW_BOTTOM (w); - + memset (&gcv, ~0, sizeof (XGCValues)); - + tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face); 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 dithrered 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 Adress XLib error ;-) */ + shadow_thickness = - shadow_thickness; + } /* Clear the divider area first. This needs to be done when a window split occurs. */ @@ -1331,24 +1486,15 @@ x_output_vertical_divider (struct window *w, int clear) XClearArea (dpy, x_win, x, y1, width, y2 - y1, False); /* Draw the divider line. */ - XFillRectangle (dpy, x_win, background_gc, + XFillRectangle (dpy, x_win, background_gc, 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); } /***************************************************************************** @@ -1377,12 +1523,9 @@ x_output_blank (struct window *w, struct display_line *dl, struct rune *rb, 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) { @@ -1420,7 +1563,7 @@ x_output_blank (struct window *w, struct display_line *dl, struct rune *rb, { 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), @@ -1476,10 +1619,10 @@ x_output_hline (struct window *w, struct display_line *dl, struct rune *rb) 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; @@ -1513,12 +1656,12 @@ x_output_hline (struct window *w, struct display_line *dl, struct rune *rb) x_output_shadows Draw a shadow around the given area using the given GC's. It is the - callers responsibility to set the GC's appropriately. + callers responsibility to ste the GC's appropriately. ****************************************************************************/ 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); @@ -1540,41 +1683,28 @@ x_output_shadows (struct frame *f, int x, int y, int width, int height, 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; - 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[seg1].x1 = x; + top_shadow[seg1].x2 = x + width - elt - 1; + top_shadow[seg1].y1 = top_shadow[seg1].y2 = y + elt; + + 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); } /***************************************************************************** @@ -1662,6 +1792,54 @@ x_generate_shadow_pixels (struct frame *f, unsigned long *top_shadow, } /***************************************************************************** + 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)) + x_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f), + ypos1, FRAME_BORDER_WIDTH (f), height); + + if (bounds.left_in - bounds.left_out > 0) + x_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) + x_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1, + bounds.right_in - bounds.left_in, height); + + if (bounds.right_out - bounds.right_in > 0) + x_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)) + x_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 @@ -1708,7 +1886,6 @@ x_redraw_exposed_window (struct window *w, int x, int y, int width, int height) f->windows_structure_changed = 1; } - redisplay_clear_top_of_window (w); if (window_needs_vertical_divider (w)) { x_output_vertical_divider (w, 0); @@ -1779,7 +1956,6 @@ x_redraw_exposed_area (struct frame *f, int x, int y, int width, int height) 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) { @@ -1798,27 +1974,110 @@ x_redraw_exposed_area (struct frame *f, int x, int y, int width, int height) given face. ****************************************************************************/ static void -x_clear_region (Lisp_Object locale, struct device* d, struct frame* f, face_index findex, - int x, int y, - int width, int height, Lisp_Object fcolor, Lisp_Object bcolor, - Lisp_Object background_pixmap) +x_clear_region (Lisp_Object locale, face_index findex, int x, int y, + int width, int height) { + struct window *w = NULL; + struct frame *f = NULL; + struct device *d; + Lisp_Object background_pixmap; + Display *dpy; Window x_win; - GC gc = NULL; + if (WINDOWP (locale)) + { + w = XWINDOW (locale); + f = XFRAME (w->frame); + } + else if (FRAMEP (locale)) + { + w = NULL; + f = XFRAME (locale); + } + else + abort (); + + d = XDEVICE (f->device); dpy = DEVICE_X_DISPLAY (d); x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); - if (!UNBOUNDP (background_pixmap)) + /* #### This function is going to have to be made cursor aware. */ + if (width && height) { - gc = x_get_gc (d, Qnil, fcolor, bcolor, background_pixmap, Qnil); - } + GC gc = NULL; - if (gc) - XFillRectangle (dpy, x_win, gc, x, y, width, height); - else - XClearArea (dpy, x_win, x, y, width, height, False); + /* #### This isn't quite right for when this function is called + from the toolbar code. */ + background_pixmap = Qunbound; + + /* Don't use a backing pixmap in the border area */ + if (x >= FRAME_LEFT_BORDER_END (f) + && x < FRAME_RIGHT_BORDER_START (f) + && y >= FRAME_TOP_BORDER_END (f) + && 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))) + { + /* #### maybe we could implement such that a string + can be a background pixmap? */ + background_pixmap = temp; + } + } + 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) + { + Lisp_Object fcolor, bcolor; + + if (w) + { + fcolor = WINDOW_FACE_CACHEL_FOREGROUND (w, findex); + bcolor = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); + } + else + { + fcolor = FACE_FOREGROUND (Vdefault_face, locale); + bcolor = FACE_BACKGROUND (Vdefault_face, locale); + } + + gc = x_get_gc (d, Qnil, fcolor, bcolor, background_pixmap, Qnil); + } + else + { + Lisp_Object color = (w ? + WINDOW_FACE_CACHEL_BACKGROUND (w, findex) : + FACE_BACKGROUND (Vdefault_face, locale)); + + if (UNBOUNDP (background_pixmap)) + background_pixmap = Qnil; + + gc = x_get_gc (d, Qnil, color, Qnil, background_pixmap, Qnil); + } + } + + if (gc) + XFillRectangle (dpy, x_win, gc, x, y, width, height); + else + XClearArea (dpy, x_win, x, y, width, height, False); + } } /***************************************************************************** @@ -1846,14 +2105,14 @@ x_output_eol_cursor (struct window *w, struct display_line *dl, int xpos, 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; XSETWINDOW (window, w); - redisplay_clear_region (window, findex, x, y, width, height); + x_clear_region (window, findex, x, y, width, height); if (NILP (w->text_cursor_visible_p)) return; @@ -1911,8 +2170,7 @@ x_clear_frame_window (Lisp_Object window) 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 @@ -1974,7 +2232,6 @@ x_flash (struct device *d) 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); @@ -1991,22 +2248,8 @@ x_flash (struct device *d) 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 @@ -2026,20 +2269,8 @@ x_flash (struct device *d) #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; @@ -2067,8 +2298,8 @@ x_ring_bell (struct device *d, int volume, int pitch, int duration) /* #### grab server? */ XGetKeyboardControl (display, &state); - ctl.bell_pitch = (pitch >= 0 ? pitch : (int) state.bell_pitch); - ctl.bell_duration = (duration >= 0 ? duration : (int) state.bell_duration); + ctl.bell_pitch = (pitch >= 0 ? pitch : state.bell_pitch); + ctl.bell_duration = (duration >= 0 ? duration : state.bell_duration); XChangeKeyboardControl (display, KBBellPitch|KBBellDuration, &ctl); XBell (display, (volume * 2) - 100); @@ -2096,13 +2327,11 @@ console_type_create_redisplay_x (void) 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 --git a/src/redisplay.c b/src/redisplay.c index e664075..895f520 100644 --- a/src/redisplay.c +++ b/src/redisplay.c @@ -40,17 +40,16 @@ Boston, MA 02111-1307, USA. */ #include <config.h> #include "lisp.h" +#include <limits.h> #include "buffer.h" #include "commands.h" #include "debug.h" #include "device.h" -#include "elhash.h" #include "extents.h" #include "faces.h" #include "frame.h" #include "glyphs.h" -#include "gutter.h" #include "insdel.h" #include "menubar.h" #include "objects.h" @@ -63,10 +62,11 @@ Boston, MA 02111-1307, USA. */ #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 +85,16 @@ Boston, MA 02111-1307, USA. */ #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 +106,6 @@ typedef struct position_redisplay_data_type /* 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 +149,6 @@ typedef struct position_redisplay_data_type (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). @@ -163,20 +162,18 @@ typedef struct position_redisplay_data_type struct extent_fragment *ef; face_index findex; - /* The height of a pixmap may either be predetermined if the user has set a - baseline value, or it may be dependent on whatever the line ascent and - descent values end up being, based just on font and pixmap-ascent - information. In the first case we can immediately update the values, thus - their inclusion here. In the last case we cannot determine the actual - contribution to the line height until we have finished laying out all text - on the line. Thus we propagate the max height of such pixmaps and do a - final calculation (in calculate_baseline()) after all text has been added - to the line. */ + /* The height of a pixmap may either be predetermined if the user + has set a baseline value, or it may be dependent on whatever the + line ascent and descent values end up being, based just on font + information. In the first case we can immediately update the + values, thus their inclusion here. In the last case we cannot + determine the actual contribution to the line height until we + have finished laying out all text on the line. Thus we propagate + the max height of such pixmaps and do a final calculation after + all text has been added to the line. */ int new_ascent; int new_descent; int max_pixmap_height; - int need_baseline_computation; - int end_glyph_width; /* Well, it is the kitchen sink after all ... */ Lisp_Object result_str; /* String where we put the result of generating a formatted string in the modeline. */ @@ -194,24 +191,15 @@ enum prop_type PROP_STRING, PROP_CHAR, PROP_MINIBUF_PROMPT, - PROP_BLANK, - PROP_GLYPH + PROP_BLANK }; /* Data that should be propagated to the next line. Either a single - Emchar, a string of Bufbyte's or a glyph. + Emchar or a string of Bufbyte's. The actual data that is propagated ends up as a Dynarr of these blocks. - prop_blocks are used to indicate that data that was supposed to go - on the previous line couldn't actually be displayed. Generally this - shouldn't happen if we are clipping the end of lines. If we are - wrapping then we need to display the propagation data before moving - on. Its questionable whether we should wrap or clip glyphs in this - instance. Most e-lisp relies on clipping so we preserve this - behavior. - #### It's unclean that both Emchars and Bufbytes are here. */ @@ -240,14 +228,6 @@ struct prop_block int width; face_index findex; } p_blank; - - struct - { - /* Not used as yet, but could be used to wrap rather than clip glyphs. */ - int width; - Lisp_Object glyph; - } p_glyph; - } data; }; @@ -257,20 +237,25 @@ typedef struct } 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, - int type); + 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); static void create_left_glyph_block (struct window *w, @@ -284,9 +269,6 @@ static void free_display_line (struct display_line *dl); static void update_line_start_cache (struct window *w, Bufpos from, Bufpos to, Bufpos point, int no_regen); static int point_visible (struct window *w, Bufpos point, int type); -static void calculate_yoffset (struct display_line *dl, - struct display_block *fixup); -static void calculate_baseline (pos_data *data); /* This used to be 10 but 30 seems to give much better performance. */ #define INIT_MAX_PREEMPTS 30 @@ -309,6 +291,10 @@ static int max_preempts; 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 @@ -316,13 +302,13 @@ display_line_dynarr *cmotion_display_lines; (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 */ -Fixnum cache_adjustment; +int cache_adjustment; /* This holds a string representing the text corresponding to a single modeline % spec. */ @@ -337,10 +323,13 @@ int disable_preemption; /* Used for debugging redisplay and for static int preemption_count; /* Minimum pixel height of clipped bottom display line. */ -Fixnum vertical_clip; +int vertical_clip; /* Minimum visible pixel width of clipped glyphs at right margin. */ -Fixnum horizontal_clip; +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. */ @@ -375,15 +364,6 @@ int frame_changed; int glyphs_changed; int glyphs_changed_set; -/* non-zero if any subwindow has been deleted. */ -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; @@ -414,14 +394,6 @@ int asynch_device_change_pending; int toolbar_changed; int toolbar_changed_set; -/* Nonzero if some frame has changed the layout of internal elements - (gutters or toolbars). */ -int frame_layout_changed; - -/* 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; @@ -433,9 +405,10 @@ int windows_structure_changed; 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, @@ -451,10 +424,10 @@ Lisp_Object Vglobal_mode_string; /* The number of lines scroll a window by when point leaves the window; if it is <=0 then point is centered in the window */ -Fixnum scroll_step; +int scroll_step; /* Scroll up to this many lines, to bring point back on screen. */ -Fixnum scroll_conservatively; +int scroll_conservatively; /* Marker for where to display an arrow on top of the buffer text. */ Lisp_Object Voverlay_arrow_position; @@ -462,12 +435,9 @@ Lisp_Object Voverlay_arrow_position; 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 @@ -477,8 +447,7 @@ Lisp_Object Vpre_redisplay_hook, Vpost_redisplay_hook; Lisp_Object Qpre_redisplay_hook, Qpost_redisplay_hook; #endif /* INHIBIT_REDISPLAY_HOOKS */ -static Fixnum last_display_warning_tick; -static Fixnum display_warning_tick; +int last_display_warning_tick, display_warning_tick; Lisp_Object Qdisplay_warning_buffer; int inhibit_warning_display; @@ -488,11 +457,6 @@ Lisp_Object Vuse_left_overflow, Vuse_right_overflow; 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) - /***************************************************************************/ /* */ @@ -662,8 +626,8 @@ next_tab_position (struct window *w, int start_pixpos, int left_pixpos) 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; @@ -706,108 +670,6 @@ calculate_display_line_boundaries (struct window *w, int modeline) return bounds; } -/* This takes a display_block and its containing line and corrects the yoffset - of each glyph in the block to cater for the ascent of the line as a - whole. Must be called *after* the line-ascent is known! */ - -static void -calculate_yoffset (struct display_line *dl, struct display_block *fixup) -{ - int i; - for (i=0; i<Dynarr_length (fixup->runes); i++) - { - struct rune *r = Dynarr_atp (fixup->runes,i); - if (r->type == RUNE_DGLYPH) - { - if (r->object.dglyph.ascent < dl->ascent) - r->object.dglyph.yoffset = dl->ascent - r->object.dglyph.ascent + - r->object.dglyph.descent; - } - } -} - -/* Calculate the textual baseline (the ascent and descent values for the - display_line as a whole). - - If the baseline is completely blank, or contains no manually positioned - glyphs, then the textual baseline is simply the baseline of the default font. - (The `contains no manually positioned glyphs' part is actually done for - us by `add_emchar_rune'.) - - If the baseline contains pixmaps, and they're all manually positioned, then - the textual baseline location is constrained that way, and we need do no - work. - - If the baseline contains pixmaps, and at least one is automatically - positioned, then the textual ascent is the largest ascent on the line, and - the textual descent is the largest descent (which is how things are set up at - entry to this function anyway): except that if the max_ascent + max_descent - is too small for the height of the line (say you've adjusted the baseline of - a short glyph, and there's a tall one next to it), then take the ascent and - descent for the line individually from the largest of the explicitly set - ascent/descent, and the rescaled ascent/descent of the default font, scaled - such that the largest glyph will fit. - - This means that if you have a short glyph (but taller than the default - font's descent) forced right under the baseline, and a really tall - automatically positioned glyph, that the descent for the line is just big - enough for the manually positioned short glyph, and the tall one uses as - much of that space as the default font would were it as tall as the tall - glyph; but that the ascent is big enough for the tall glyph to fit. - - This behaviour means that under no circumstances will changing the baseline - of a short glyph cause a tall glyph to move around; nor will it move the - textual baseline more than necessary. (Changing a tall glyph's baseline - might move the text's baseline arbitrarily, of course.) */ - -static void -calculate_baseline (pos_data *data) -{ - /* Blank line: baseline is default font's baseline. */ - - 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); - } - - /* No automatically positioned glyphs? Return at once. */ - if (!data->need_baseline_computation) - return; - - /* Is the tallest glyph on the line automatically positioned? - If it's manually positioned, or it's automatically positioned - and there's enough room for it anyway, we need do no more work. */ - if (data->max_pixmap_height > data->new_ascent + data->new_descent) - { - int default_font_ascent, default_font_descent, default_font_height; - int scaled_default_font_ascent, scaled_default_font_descent; - - default_face_font_info (data->window, &default_font_ascent, - &default_font_descent, &default_font_height, - 0, 0); - - scaled_default_font_ascent = data->max_pixmap_height * - default_font_ascent / default_font_height; - - data->new_ascent = max (data->new_ascent, scaled_default_font_ascent); - - /* The ascent may have expanded now. Do we still need to grow the descent, - or are things big enough? - - The +1 caters for the baseline row itself. */ - if (data->max_pixmap_height > data->new_ascent + data->new_descent) - { - scaled_default_font_descent = (data->max_pixmap_height * - default_font_descent / default_font_height) + 1; - - data->new_descent = max (data->new_descent, scaled_default_font_descent); - } - } -} - /* 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 @@ -817,8 +679,8 @@ calculate_baseline (pos_data *data) static Bufpos generate_display_line (struct window *w, struct display_line *dl, int bounds, - Bufpos start_pos, prop_block_dynarr **prop, - int type) + Bufpos start_pos, int start_col, + prop_block_dynarr **prop, int type) { Bufpos ret_bufpos; int overlay_width; @@ -850,7 +712,7 @@ generate_display_line (struct window *w, struct display_line *dl, int bounds, /* #### 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 @@ -924,7 +786,7 @@ add_hscroll_rune (pos_data *data) 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 = @@ -939,14 +801,12 @@ add_hscroll_rune (pos_data *data) return retval; } -/* Adds a character rune to a display block. If there is not enough room - to fit the rune on the display block (as determined by the MAX_PIXPOS) - then it adds nothing and returns ADD_FAILED. If - NO_CONTRIBUTE_TO_LINE_HEIGHT is non-zero, don't allow the char's height - to affect the total line height. (See add_intbyte_string_runes()). */ +/* Adds a character rune to a display block. If there is not enough + room to fit the rune on the display block (as determined by the + MAX_PIXPOS) then it adds nothing and returns ADD_FAILED. */ static prop_block_dynarr * -add_emchar_rune_1 (pos_data *data, int no_contribute_to_line_height) +add_emchar_rune (pos_data *data) { struct rune rb, *crb; int width, local; @@ -982,7 +842,7 @@ add_emchar_rune_1 (pos_data *data, int no_contribute_to_line_height) 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)) { @@ -998,13 +858,8 @@ add_emchar_rune_1 (pos_data *data, int no_contribute_to_line_height) data->last_char_width = fi->width; else data->last_char_width = -1; - - if (!no_contribute_to_line_height) - { - data->new_ascent = max (data->new_ascent, (int) fi->ascent); - data->new_descent = max (data->new_descent, (int) fi->descent); - } - + data->new_ascent = max (data->new_ascent, (int) fi->ascent); + data->new_descent = max (data->new_descent, (int) fi->descent); data->last_charset = charset; data->last_findex = data->findex; } @@ -1039,19 +894,15 @@ add_emchar_rune_1 (pos_data *data, int no_contribute_to_line_height) 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; @@ -1088,24 +939,13 @@ add_emchar_rune_1 (pos_data *data, int no_contribute_to_line_height) return NULL; } -static prop_block_dynarr * -add_emchar_rune (pos_data *data) -{ - return add_emchar_rune_1 (data, 0); -} - -/* Given a string C_STRING of length C_LENGTH, call add_emchar_rune for - each character in the string. Propagate any left-over data unless - NO_PROP is non-zero. If NO_CONTRIBUTE_TO_LINE_HEIGHT is non-zero, don't - allow this character to increase the total height of the line. (This is - used when the character is part of a text glyph. In that case, the - glyph code itself adjusts the line height as necessary, depending on - whether glyph-contrib-p is true.) */ - +/* Given a string C_STRING of length C_LENGTH, call add_emchar_rune + for each character in the string. Propagate any left-over data + unless NO_PROP is non-zero. */ + static prop_block_dynarr * add_bufbyte_string_runes (pos_data *data, Bufbyte *c_string, - Bytecount c_length, int no_prop, - int no_contribute_to_line_height) + Bytecount c_length, int no_prop) { Bufbyte *pos, *end = c_string + c_length; prop_block_dynarr *prop; @@ -1118,11 +958,9 @@ add_bufbyte_string_runes (pos_data *data, Bufbyte *c_string, for (pos = c_string; pos < end;) { - Bufbyte *old_pos = pos; - data->ch = charptr_emchar (pos); - prop = add_emchar_rune_1 (data, no_contribute_to_line_height); + prop = add_emchar_rune (data); if (prop) { @@ -1145,9 +983,6 @@ add_bufbyte_string_runes (pos_data *data, Bufbyte *c_string, } INC_CHARPTR (pos); assert (pos <= end); - /* #### Duplicate code from add_string_to_fstring_db_runes - should we do more?*/ - data->bytepos += pos - old_pos; } return NULL; @@ -1257,11 +1092,12 @@ add_blank_rune (pos_data *data, struct window *w, int char_tab_width) static prop_block_dynarr * add_octal_runes (pos_data *data) { - prop_block_dynarr *add_failed, *prop = 0; + prop_block_dynarr *prop, *add_failed; Emchar orig_char = data->ch; unsigned int orig_cursor_type = data->cursor_type; /* Initialize */ + prop = NULL; add_failed = NULL; if (data->start_col) @@ -1321,7 +1157,7 @@ add_octal_runes (pos_data *data) ADD_NEXT_OCTAL_RUNE_CHAR; data->cursor_type = orig_cursor_type; - return NULL; + return prop; } #undef ADD_NEXT_OCTAL_RUNE_CHAR @@ -1396,17 +1232,71 @@ add_control_char_runes (pos_data *data, struct buffer *b) } } +/* Given a display table entry, call the appropriate functions to + display each element of the entry. */ + static prop_block_dynarr * -add_disp_table_entry_runes_1 (pos_data *data, Lisp_Object entry) +add_disp_table_entry_runes (pos_data *data, Lisp_Object entry) { prop_block_dynarr *prop = NULL; - if (STRINGP (entry)) + if (VECTORP (entry)) + { + struct Lisp_Vector *de = XVECTOR (entry); + long len = vector_length (de); + int elt; + + for (elt = 0; elt < len; elt++) + { + if (NILP (de->contents[elt])) + continue; + else if (STRINGP (de->contents[elt])) + { + prop = + add_bufbyte_string_runes + (data, + XSTRING_DATA (de->contents[elt]), + XSTRING_LENGTH (de->contents[elt]), + 0); + } + else if (GLYPHP (de->contents[elt])) + { + if (data->start_col) + data->start_col--; + + if (!data->start_col && data->bi_start_col_enabled) + { + prop = add_hscroll_rune (data); + } + else + { + struct glyph_block gb; + + gb.glyph = de->contents[elt]; + gb.extent = Qnil; + prop = add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, 0); + } + } + else if (CHAR_OR_CHAR_INTP (de->contents[elt])) + { + data->ch = XCHAR_OR_CHAR_INT (de->contents[elt]); + prop = add_emchar_rune (data); + } + /* Else blow it off because someone added a bad entry and we + don't have any safe way of signaling an error. */ + + /* #### Still need to add any remaining elements to the + propagation information. */ + if (prop) + return prop; + } + } + else if (STRINGP (entry)) { prop = add_bufbyte_string_runes (data, XSTRING_DATA (entry), XSTRING_LENGTH (entry), - 0, 0); + 0); } else if (GLYPHP (entry)) { @@ -1431,80 +1321,10 @@ add_disp_table_entry_runes_1 (pos_data *data, Lisp_Object entry) data->ch = XCHAR_OR_CHAR_INT (entry); prop = add_emchar_rune (data); } - else if (CONSP (entry)) - { - if (EQ (XCAR (entry), Qformat) - && CONSP (XCDR (entry)) - && STRINGP (XCAR (XCDR (entry)))) - { - Lisp_Object format = XCAR (XCDR (entry)); - Bytind len = XSTRING_LENGTH (format); - Bufbyte *src = XSTRING_DATA (format), *end = src + len; - Bufbyte *result = alloca_array (Bufbyte, len); - Bufbyte *dst = result; - - while (src < end) - { - Emchar c = charptr_emchar (src); - INC_CHARPTR (src); - if (c != '%' || src == end) - dst += set_charptr_emchar (dst, c); - else - { - c = charptr_emchar (src); - INC_CHARPTR (src); - switch (c) - { - /*case 'x': - dst += long_to_string_base ((char *)dst, data->ch, 16); - break;*/ - case '%': - dst += set_charptr_emchar (dst, '%'); - break; - /* #### unimplemented */ - } - } - } - prop = add_bufbyte_string_runes (data, result, dst - result, 0, 0); - } - } /* Else blow it off because someone added a bad entry and we don't - have any safe way of signaling an error. */ - return prop; -} - -/* Given a display table entry, call the appropriate functions to - display each element of the entry. */ - -static prop_block_dynarr * -add_disp_table_entry_runes (pos_data *data, Lisp_Object entry) -{ - prop_block_dynarr *prop = NULL; - if (VECTORP (entry)) - { - Lisp_Vector *de = XVECTOR (entry); - EMACS_INT len = vector_length (de); - int elt; - - for (elt = 0; elt < len; elt++) - { - if (NILP (vector_data (de)[elt])) - continue; - else - prop = add_disp_table_entry_runes_1 (data, vector_data (de)[elt]); - /* Else blow it off because someone added a bad entry and we - don't have any safe way of signaling an error. Hey, this - comment sounds familiar. */ - - /* #### Still need to add any remaining elements to the - propagation information. */ - if (prop) - return prop; - } - } - else - prop = add_disp_table_entry_runes_1 (data, entry); + have any safe way of signaling an error. Hey, this comment + sounds familiar. */ return prop; } @@ -1666,25 +1486,12 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, { 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; @@ -1692,20 +1499,18 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, int ascent, descent; Lisp_Object baseline; Lisp_Object face; - Lisp_Object instance; - face_index findex; - prop_block_dynarr *retval = 0; 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); /* If we still have not fully scrolled horizontally after @@ -1741,41 +1546,17 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, if (data->pixpos + width > data->max_pixpos) { /* If this is the first object we are attempting to add to - the line then we ignore the horizontal_clip threshold. - Otherwise we will loop until the bottom of the window - continually failing to add this glyph because it is wider - than the window. We could alternatively just completely - ignore the glyph and proceed from there but I think that - this is a better solution. - - This does, however, create a different problem in that we - can end up adding the object to every single line, never - getting any further - for instance an extent with a long - start-glyph that covers multitple following - characters. */ + the line then we ignore the horizontal_clip threshold. + Otherwise we will loop until the bottom of the window + continually failing to add this glyph because it is wider + than the window. We could alternatively just completely + ignore the glyph and proceed from there but I think that + this is a better solution. */ if (Dynarr_length (data->db->runes) && data->max_pixpos - data->pixpos < horizontal_clip) return ADD_FAILED; - else { - struct prop_block pb; - - /* We need to account for the width of the end-of-line - glyph if there is nothing more in the line to display, - since we will not display it in this instance. It seems - kind of gross doing it here, but otherwise we have to - search the runes in create_text_block(). */ - if (data->ch == '\n') - data->max_pixpos += data->end_glyph_width; + else width = data->max_pixpos - data->pixpos; - /* Add the glyph we are displaying, but clipping, to the - propagation data so that we don't try and do it - again. */ - retval = Dynarr_new (prop_block); - pb.type = PROP_GLYPH; - pb.data.p_glyph.glyph = gb->glyph; - pb.data.p_glyph.width = width; - Dynarr_add (retval, pb); - } } if (cachel) @@ -1785,14 +1566,13 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, } 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); - rb.object.dglyph.descent = 0; /* Gets reset lower down, if it is known. */ - if (glyph_contrib_p (gb->glyph, data->window)) { /* A pixmap that has not had a baseline explicitly set. Its @@ -1800,7 +1580,6 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, if (NILP (baseline)) { int height = ascent + descent; - data->need_baseline_computation = 1; data->max_pixmap_height = max (data->max_pixmap_height, height); } @@ -1823,9 +1602,6 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, data->new_ascent = max (data->new_ascent, pix_ascent); data->new_descent = max (data->new_descent, pix_descent); - data->max_pixmap_height = max (data->max_pixmap_height, height); - - rb.object.dglyph.descent = pix_descent; } /* Otherwise something is screwed up. */ @@ -1835,32 +1611,10 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, 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, 1); - data->findex = orig_findex; - data->bi_bufpos = orig_bufpos; - data->bi_start_col_enabled = orig_start_col_enabled; - return retval; - } + rb.findex = get_builtin_face_cache_index (w, face); - rb.findex = findex; rb.xpos = data->pixpos; rb.width = width; rb.bufpos = 0; /* glyphs are never "at" anywhere */ @@ -1871,12 +1625,16 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, 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; - rb.object.dglyph.ascent = ascent; - rb.object.dglyph.yoffset = 0; /* Until we know better, assume that it has - a normal (textual) baseline. */ if (allow_cursor) { @@ -1912,7 +1670,7 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, Dynarr_add (data->db->runes, rb); data->pixpos += width; - return retval; + return NULL; } else { @@ -1941,7 +1699,7 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type, abort (); /* there are no unknown types */ } - return NULL; + return NULL; /* shut up compiler */ } /* Add all glyphs at position POS_TYPE that are contained in the given @@ -1984,14 +1742,15 @@ add_glyph_runes (pos_data *data, int pos_type) static Bytind create_text_block (struct window *w, struct display_line *dl, - Bytind bi_start_pos, prop_block_dynarr **prop, - int type) + Bytind bi_start_pos, int start_col, + prop_block_dynarr **prop, int type) { struct frame *f = XFRAME (w->frame); struct buffer *b = XBUFFER (w->buffer); struct device *d = XDEVICE (f->device); pos_data data; + struct Lisp_Vector *dt = 0; /* Don't display anything in the minibuffer if this window is not on a selected frame. We consider all other windows to be active @@ -2001,6 +1760,7 @@ create_text_block (struct window *w, struct display_line *dl, is_surrogate_for_selected_frame (f)); int truncate_win = window_truncation_on (w); + int end_glyph_width; /* If the buffer's value of selective_display is an integer then only lines that start with less than selective_display columns of @@ -2008,7 +1768,7 @@ create_text_block (struct window *w, struct display_line *dl, 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. @@ -2023,41 +1783,46 @@ create_text_block (struct window *w, struct display_line *dl, 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"))) + make things way way way way slow. An idea I like is to + be able 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 + pre-defined hex display-table (or maybe computes one if + you give weird parameters to the function) and adds it + to the list of display tables for the current buffer. + + Unfortunately there are still problems dealing with Mule + characters. For example, maybe I want to specify that + all extended characters (i.e. >= 256) are displayed in hex. + It's not reasonable to create a mapping for all possible + such characters, because there are about 2^19 of them. + One way of dealing with this is to extend the concept + of what a display table is. Currently it's only allowed + to be a 256-entry vector. Instead, it should be something + like: + + a) A 256-entry vector, for backward compatibility + b) Some sort of hashtable, mapping characters to values + c) A list that specifies a range of values and the + mapping to provide for those values. + + Also, extend the concept of "mapping" to include a + printf-like spec. Then, you could make all extended + characters show up as hex with a display table like + + ((256 . 524288) . "%x") Since more than one display table is possible, you have - great flexibility in mapping ranges of characters. */ + great flexibility in mapping ranges of characters. + */ Emchar printable_min = (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)); - 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); @@ -2075,7 +1840,6 @@ create_text_block (struct window *w, struct display_line *dl, dl->used_prop_data = 0; dl->num_chars = 0; - dl->line_continuation = 0; xzero (data); data.ef = extent_fragment_new (w->buffer, f); @@ -2084,7 +1848,6 @@ create_text_block (struct window *w, struct display_line *dl, them to this structure for ease of passing. */ data.d = d; XSETWINDOW (data.window, w); - data.string = Qnil; data.db = db; data.dl = dl; @@ -2098,10 +1861,10 @@ create_text_block (struct window *w, struct display_line *dl, glyph. Save the width of the end glyph for later use. */ data.max_pixpos = dl->bounds.right_in; if (truncate_win) - data.end_glyph_width = GLYPH_CACHEL_WIDTH (w, TRUN_GLYPH_INDEX); + end_glyph_width = GLYPH_CACHEL_WIDTH (w, TRUN_GLYPH_INDEX); else - data.end_glyph_width = GLYPH_CACHEL_WIDTH (w, CONT_GLYPH_INDEX); - data.max_pixpos -= data.end_glyph_width; + end_glyph_width = GLYPH_CACHEL_WIDTH (w, CONT_GLYPH_INDEX); + data.max_pixpos -= end_glyph_width; if (cursor_in_echo_area && MINI_WINDOW_P (w) && echo_area_active (f)) { @@ -2128,7 +1891,6 @@ create_text_block (struct window *w, struct display_line *dl, 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; @@ -2194,30 +1956,15 @@ create_text_block (struct window *w, struct display_line *dl, /* Check for face changes. */ if (initial || (!no_more_frags && data.bi_bufpos == data.ef->end)) { - Lisp_Object last_glyph = Qnil; - - /* Deal with glyphs that we have already displayed. The - theory is that if we end up with a PROP_GLYPH in the - propagation data then we are clipping the glyph and there - can be no propagation data before that point. The theory - works because we always recalculate the extent-fragments - for propagated data, we never actually propagate the - fragments that still need to be displayed. */ - if (*prop && Dynarr_atp (*prop, 0)->type == PROP_GLYPH) - { - last_glyph = Dynarr_atp (*prop, 0)->data.p_glyph.glyph; - Dynarr_free (*prop); - *prop = 0; - } /* 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, last_glyph); - - get_display_tables (w, data.findex, &face_dt, &window_dt); + extent_fragment_update (w, data.ef, data.bi_bufpos); if (data.bi_bufpos == data.ef->end) no_more_frags = 1; + + dt = get_display_table (w, data.findex); } initial = 0; @@ -2282,9 +2029,9 @@ create_text_block (struct window *w, struct display_line *dl, } /* 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. */ + 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; @@ -2306,59 +2053,19 @@ create_text_block (struct window *w, struct display_line *dl, 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 - || Dynarr_length (data.ef->begin_glyphs) > 0) + else if (Dynarr_length (data.ef->end_glyphs) > 0) { - glyph_block_dynarr* tmpglyphs = 0; - /* #### I think this is safe, but could be wrong. */ - data.ch = BI_BUF_FETCH_CHAR (b, data.bi_bufpos); - - if (Dynarr_length (data.ef->end_glyphs) > 0) - { - *prop = add_glyph_runes (&data, END_GLYPHS); - tmpglyphs = data.ef->end_glyphs; - } - - /* If there are begin glyphs, add them to the line. */ - if (!*prop && Dynarr_length (data.ef->begin_glyphs) > 0) - { - *prop = add_glyph_runes (&data, BEGIN_GLYPHS); - tmpglyphs = data.ef->begin_glyphs; - } + *prop = add_glyph_runes (&data, END_GLYPHS); + if (*prop) + goto done; + } - if (*prop) - { - /* If we just clipped a glyph and we are at the end of a - line and there are more glyphs to display then do - appropriate processing to not get a continuation - glyph. */ - if (*prop != ADD_FAILED - && Dynarr_atp (*prop, 0)->type == PROP_GLYPH - && data.ch == '\n') - { - /* If there are no more glyphs then do the normal - processing. - - #### This doesn't actually work if the same glyph is - present more than once in the block. To solve - this we would have to carry the index around - which might be problematic since the fragment is - recalculated for each line. */ - if (EQ (Dynarr_end (tmpglyphs)->glyph, - Dynarr_atp (*prop, 0)->data.p_glyph.glyph)) - { - Dynarr_free (*prop); - *prop = 0; - } - else { - data.blank_width = DEVMETH (d, eol_cursor_width, ()); - add_emchar_rune (&data); /* discard prop data. */ - goto done; - } - } - else - 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 @@ -2369,17 +2076,16 @@ create_text_block (struct window *w, struct display_line *dl, else { - Lisp_Object entry = Qnil; /* Get the character at the current buffer position. */ data.ch = BI_BUF_FETCH_CHAR (b, 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))) + if (dt && !NILP (DISP_CHAR_ENTRY (dt, data.ch))) { - *prop = add_disp_table_entry_runes (&data, entry); + *prop = + add_disp_table_entry_runes (&data, + DISP_CHAR_ENTRY (dt, data.ch)); if (*prop) goto done; @@ -2392,7 +2098,7 @@ create_text_block (struct window *w, struct display_line *dl, /* 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 += data.end_glyph_width; + data.max_pixpos += end_glyph_width; if (selective > 0 && (bi_spaces_at_point @@ -2473,7 +2179,7 @@ create_text_block (struct window *w, struct display_line *dl, /* We won't be adding a truncation or continuation glyph so give up the room allocated for them. */ - data.max_pixpos += data.end_glyph_width; + data.max_pixpos += end_glyph_width; if (!NILP (b->selective_display_ellipses)) { @@ -2503,7 +2209,6 @@ create_text_block (struct window *w, struct display_line *dl, 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); @@ -2537,8 +2242,7 @@ create_text_block (struct window *w, struct display_line *dl, 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, @@ -2634,7 +2338,7 @@ done: { /* If data.start_col_enabled is still true, then the window is scrolled far enough so that nothing on this line is visible. - We need to stick a truncation glyph at the beginning of the + We need to stick a trunctation glyph at the beginning of the line in that case unless the line is completely blank. */ if (data.bi_start_col_enabled) { @@ -2682,7 +2386,7 @@ done: 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 += data.end_glyph_width; + data.max_pixpos += end_glyph_width; data.findex = DEFAULT_INDEX; gb.extent = Qnil; @@ -2721,12 +2425,11 @@ done: /* 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') @@ -2746,7 +2449,6 @@ done: 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; @@ -2817,7 +2519,26 @@ done: else db->end_pos = dl->bounds.right_white; - calculate_baseline (&data); + /* 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; @@ -2835,8 +2556,6 @@ done: dl->descent = descent; } - calculate_yoffset (dl, db); - dl->cursor_elt = data.cursor_x; /* #### lossage lossage lossage! Fix this shit! */ if (data.bi_bufpos > BI_BUF_ZV (b)) @@ -2905,7 +2624,6 @@ create_overlay_glyph_block (struct window *w, struct display_line *dl) data.last_charset = Qunbound; data.last_findex = DEFAULT_INDEX; data.result_str = Qnil; - data.string = Qnil; Dynarr_reset (data.db->runes); @@ -2915,7 +2633,7 @@ create_overlay_glyph_block (struct window *w, struct display_line *dl) (&data, XSTRING_DATA (Voverlay_arrow_string), XSTRING_LENGTH (Voverlay_arrow_string), - 1, 0); + 1); } else if (GLYPHP (Voverlay_arrow_string)) { @@ -2926,7 +2644,17 @@ create_overlay_glyph_block (struct window *w, struct display_line *dl) add_glyph_rune (&data, &gb, BEGIN_GLYPHS, 0, 0); } - calculate_baseline (&data); + 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; @@ -2934,8 +2662,6 @@ create_overlay_glyph_block (struct window *w, struct display_line *dl) data.db->start_pos = dl->bounds.left_in; data.db->end_pos = data.pixpos; - calculate_yoffset (dl, data.db); - return data.pixpos - dl->bounds.left_in; } @@ -2949,26 +2675,8 @@ add_margin_runes (struct display_line *dl, struct display_block *db, int start, ? 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)) @@ -2997,24 +2705,79 @@ add_margin_runes (struct display_line *dl, struct display_block *db, int start, || (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; - } - (reverse ? elt-- : elt++); - } + if (glyph_contrib_p (gb->glyph, window)) + { + unsigned short ascent, descent; + Lisp_Object baseline = glyph_baseline (gb->glyph, window); - calculate_baseline (&data); + ascent = glyph_ascent (gb->glyph, Qnil, gb->findex, window); + descent = glyph_descent (gb->glyph, Qnil, gb->findex, window); - dl->ascent = data.new_ascent; - dl->descent = data.new_descent; + /* 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; - calculate_yoffset (dl, data.db); + 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++); + } - return data.pixpos; + return xpos; } /* Add a blank to a margin display block. */ @@ -3080,7 +2843,7 @@ create_left_glyph_block (struct window *w, struct display_line *dl, { 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) { @@ -3108,7 +2871,7 @@ create_left_glyph_block (struct window *w, struct display_line *dl, they should start. The inside margin glyphs get whatever space is left after the whitespace glyphs have been displayed. These are tricky to calculate since if we decide to use the overflow - area we basically have to start over. So for these we build up a + area we basicaly have to start over. So for these we build up a list of just the inside margin glyphs and manipulate it to determine the needed info. */ { @@ -3131,7 +2894,7 @@ create_left_glyph_block (struct window *w, struct display_line *dl, 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); } @@ -3200,7 +2963,7 @@ create_left_glyph_block (struct window *w, struct display_line *dl, 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) { @@ -3237,12 +3000,12 @@ create_left_glyph_block (struct window *w, struct display_line *dl, struct glyph_block *gb = Dynarr_atp (dl->left_glyphs, elt); if (NILP (gb->extent)) - abort (); /* these should have been handled in add_glyph_rune */ + abort (); /* these should have beeb handled in add_glyph_rune */ 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) { @@ -3399,7 +3162,7 @@ create_right_glyph_block (struct window *w, struct display_line *dl) 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) { @@ -3427,7 +3190,7 @@ create_right_glyph_block (struct window *w, struct display_line *dl) they should start. The inside margin glyphs get whatever space is left after the whitespace glyphs have been displayed. These are tricky to calculate since if we decide to use the overflow - area we basically have to start over. So for these we build up a + area we basicaly have to start over. So for these we build up a list of just the inside margin glyphs and manipulate it to determine the needed info. */ { @@ -3449,7 +3212,7 @@ create_right_glyph_block (struct window *w, struct display_line *dl) 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); } @@ -3513,7 +3276,7 @@ create_right_glyph_block (struct window *w, struct display_line *dl) 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) { @@ -3550,11 +3313,11 @@ create_right_glyph_block (struct window *w, struct display_line *dl) struct glyph_block *gb = Dynarr_atp (dl->right_glyphs, elt); if (NILP (gb->extent)) - abort (); /* these should have been handled in add_glyph_rune */ + abort (); /* these should have beeb handled in add_glyph_rune */ 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) { @@ -3670,8 +3433,103 @@ create_right_glyph_block (struct window *w, struct display_line *dl) /* */ /***************************************************************************/ -/* This function is also used in frame.c by `generate_title_string' */ -void +/* 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) +{ + struct buffer *b = XBUFFER (w->buffer); + struct frame *f = XFRAME (w->frame); + struct device *d = XDEVICE (f->device); + + /* Unlike display line and rune pointers, this one can't change underneath + our feet. */ + struct display_block *db = get_display_block_from_line (dl, TEXT); + int max_pixpos, min_pixpos, ypos_adj; + Lisp_Object font_inst; + + /* This will actually determine incorrect inside boundaries for the + modeline since it ignores the margins. However being aware of this fact + we never use those values anywhere so it doesn't matter. */ + dl->bounds = calculate_display_line_boundaries (w, 1); + + /* We are generating a modeline. */ + dl->modeline = 1; + dl->cursor_elt = -1; + + /* Reset the runes on the modeline. */ + Dynarr_reset (db->runes); + + if (!WINDOW_HAS_MODELINE_P (w)) + { + struct rune rb; + + /* If there is a horizontal scrollbar, don't add anything. */ + if (window_scrollbar_height (w)) + return; + + dl->ascent = DEVMETH (d, divider_height, ()); + dl->descent = 0; + /* The modeline is at the bottom of the gutters. */ + dl->ypos = WINDOW_BOTTOM (w); + + rb.findex = MODELINE_INDEX; + rb.xpos = dl->bounds.left_out; + rb.width = dl->bounds.right_out - dl->bounds.left_out; + rb.bufpos = 0; + rb.endpos = 0; + rb.type = RUNE_HLINE; + rb.object.hline.thickness = 1; + rb.object.hline.yoffset = 0; + rb.cursor_type = NO_CURSOR; + + if (!EQ (Qzero, w->modeline_shadow_thickness) + && FRAME_WIN_P (f)) + { + int shadow_thickness = MODELINE_SHADOW_THICKNESS (w); + + dl->ypos -= shadow_thickness; + rb.xpos += shadow_thickness; + rb.width -= 2 * shadow_thickness; + } + + Dynarr_add (db->runes, rb); + return; + } + + /* !!#### not right; needs to compute the max height of + all the charsets */ + font_inst = WINDOW_FACE_CACHEL_FONT (w, MODELINE_INDEX, Vcharset_ascii); + + dl->ascent = XFONT_INSTANCE (font_inst)->ascent; + dl->descent = XFONT_INSTANCE (font_inst)->descent; + + min_pixpos = dl->bounds.left_out; + max_pixpos = dl->bounds.right_out; + + if (!EQ (Qzero, w->modeline_shadow_thickness) && FRAME_WIN_P (f)) + { + int shadow_thickness = MODELINE_SHADOW_THICKNESS (w); + + ypos_adj = shadow_thickness; + min_pixpos += shadow_thickness; + max_pixpos -= shadow_thickness; + } + else + ypos_adj = 0; + + generate_formatted_string_db (b->modeline_format, + b->generated_modeline_string, w, dl, db, + MODELINE_INDEX, min_pixpos, max_pixpos, type); + + /* The modeline is at the bottom of the gutters. We have to wait to + set this until we've generated teh modeline in order to account + for any embedded faces. */ + 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, @@ -3682,7 +3540,6 @@ generate_formatted_string_db (Lisp_Object format_str, Lisp_Object result_str, pos_data data; int c_pixpos; - Charcount offset = 0; xzero (data); data.d = d; @@ -3696,21 +3553,15 @@ generate_formatted_string_db (Lisp_Object format_str, Lisp_Object result_str, 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 amount */ - if (! NILP (result_str)) - offset = w->modeline_hscroll; + /* This recursively builds up the modeline. */ generate_fstring_runes (w, &data, 0, 0, -1, format_str, 0, - max_pixpos - min_pixpos, findex, type, &offset, - Qnil); + max_pixpos - min_pixpos, findex, type); if (Dynarr_length (db->runes)) { @@ -3742,8 +3593,6 @@ generate_formatted_string_db (Lisp_Object format_str, Lisp_Object result_str, 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)); @@ -3780,113 +3629,16 @@ generate_formatted_string_db (Lisp_Object format_str, Lisp_Object result_str, 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) -{ - struct buffer *b = XBUFFER (w->buffer); - struct frame *f = XFRAME (w->frame); - struct device *d = XDEVICE (f->device); - - /* Unlike display line and rune pointers, this one can't change underneath - our feet. */ - struct display_block *db = get_display_block_from_line (dl, TEXT); - int max_pixpos, min_pixpos, ypos_adj; - Lisp_Object font_inst; - - /* This will actually determine incorrect inside boundaries for the - modeline since it ignores the margins. However being aware of this fact - we never use those values anywhere so it doesn't matter. */ - dl->bounds = calculate_display_line_boundaries (w, 1); - - /* We are generating a modeline. */ - dl->modeline = 1; - dl->cursor_elt = -1; - - /* Reset the runes on the modeline. */ - Dynarr_reset (db->runes); - - if (!WINDOW_HAS_MODELINE_P (w)) - { - struct rune rb; - - /* If there is a horizontal scrollbar, don't add anything. */ - if (window_scrollbar_height (w)) - return; - - dl->ascent = DEVMETH (d, divider_height, ()); - dl->descent = 0; - /* The modeline is at the bottom of the gutters. */ - dl->ypos = WINDOW_BOTTOM (w); - - rb.findex = MODELINE_INDEX; - rb.xpos = dl->bounds.left_out; - rb.width = dl->bounds.right_out - dl->bounds.left_out; - rb.bufpos = 0; - rb.endpos = 0; - rb.type = RUNE_HLINE; - rb.object.hline.thickness = 1; - rb.object.hline.yoffset = 0; - rb.cursor_type = NO_CURSOR; - - if (!EQ (Qzero, w->modeline_shadow_thickness) - && FRAME_WIN_P (f)) - { - int shadow_thickness = MODELINE_SHADOW_THICKNESS (w); - - dl->ypos -= shadow_thickness; - rb.xpos += shadow_thickness; - rb.width -= 2 * shadow_thickness; - } - - Dynarr_add (db->runes, rb); - return; - } - - /* !!#### not right; needs to compute the max height of - all the charsets */ - font_inst = WINDOW_FACE_CACHEL_FONT (w, MODELINE_INDEX, Vcharset_ascii); - - dl->ascent = XFONT_INSTANCE (font_inst)->ascent; - dl->descent = XFONT_INSTANCE (font_inst)->descent; - - min_pixpos = dl->bounds.left_out; - max_pixpos = dl->bounds.right_out; - - if (!EQ (Qzero, w->modeline_shadow_thickness) && FRAME_WIN_P (f)) - { - int shadow_thickness = MODELINE_SHADOW_THICKNESS (w); - - ypos_adj = shadow_thickness; - min_pixpos += shadow_thickness; - max_pixpos -= shadow_thickness; } - else - ypos_adj = 0; - - generate_formatted_string_db (b->modeline_format, - b->generated_modeline_string, w, dl, db, - MODELINE_INDEX, min_pixpos, max_pixpos, type); - - /* The modeline is at the bottom of the gutters. We have to wait to - set this until we've generated the modeline in order to account - for any embedded faces. */ - dl->ypos = WINDOW_BOTTOM (w) - dl->descent - ypos_adj; } 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)); @@ -3894,13 +3646,13 @@ add_string_to_fstring_db_runes (pos_data *data, const Bufbyte *str, 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); @@ -3925,8 +3677,7 @@ add_string_to_fstring_db_runes (pos_data *data, const Bufbyte *str, 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; @@ -3942,7 +3693,7 @@ add_glyph_to_fstring_db_runes (pos_data *data, Lisp_Object glyph, end = min (max_pos, end); gb.glyph = glyph; - gb.extent = extent; + gb.extent = Qnil; add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, 0); pos++; @@ -3969,8 +3720,7 @@ 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) { /* This function has been Mule-ized. */ /* #### The other losing things in this function are: @@ -4002,22 +3752,13 @@ tail_recurse: if (this != last) { - /* No %-construct */ + /* The string is just a string. */ Charcount size = - bytecount_to_charcount (last, this - last); + bytecount_to_charcount (last, this - last) + pos; + Charcount tmp_max = (max_pos == -1 ? size : min (size, max_pos)); - 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; - } + pos = add_string_to_fstring_db_runes (data, last, pos, pos, + tmp_max); } else /* *this == '%' */ { @@ -4042,7 +3783,7 @@ tail_recurse: 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 == '-') { @@ -4069,35 +3810,17 @@ tail_recurse: 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) { - Emchar ch = charptr_emchar (this); Bufbyte *str; - Charcount size; - + Emchar ch = charptr_emchar (this); 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 @@ -4123,26 +3846,13 @@ tail_recurse: 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)) @@ -4167,53 +3877,50 @@ tail_recurse: 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); @@ -4252,14 +3959,13 @@ tail_recurse: 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); } } @@ -4298,8 +4004,7 @@ tail_recurse: 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); @@ -4309,956 +4014,147 @@ tail_recurse: } 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; } -/* Update just the modeline. Assumes the desired display structs. If - they do not have a modeline block, it does nothing. */ -static void -regenerate_modeline (struct window *w) +/* 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) { - display_line_dynarr *dla = window_display_lines (w, DESIRED_DISP); + struct display_line *dl; + struct display_block *db; + int elt = 0; - if (!Dynarr_length (dla) || !Dynarr_atp (dla, 0)->modeline) - return; - else + 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)) { - generate_modeline (w, Dynarr_atp (dla, 0), DESIRED_DISP); - redisplay_update_line (w, 0, 0, 0); - } -} - -/* Make sure that modeline display line is present in the given - display structs if the window has a modeline and update that - line. Returns true if a modeline was needed. */ -static int -ensure_modeline_generated (struct window *w, int type) -{ - int need_modeline; - - /* minibuffer windows don't have modelines */ - if (MINI_WINDOW_P (w)) - need_modeline = 0; - /* windows which haven't had it turned off do */ - else if (WINDOW_HAS_MODELINE_P (w)) - need_modeline = 1; - /* windows which have it turned off don't have a divider if there is - a horizontal scrollbar */ - else if (window_scrollbar_height (w)) - need_modeline = 0; - /* and in this case there is none */ - else - need_modeline = 1; - - if (need_modeline) - { - display_line_dynarr *dla; - - dla = window_display_lines (w, type); - - /* We don't care if there is a display line which is not - currently a modeline because it is definitely going to become - one if we have gotten to this point. */ - if (Dynarr_length (dla) == 0) - { - if (Dynarr_largest (dla) > 0) - { - struct display_line *mlp = Dynarr_atp (dla, 0); - Dynarr_add (dla, *mlp); - } - else - { - struct display_line modeline; - xzero (modeline); - Dynarr_add (dla, modeline); - } - } - - /* If we're adding a new place marker go ahead and generate the - modeline so that it is available for use by - window_modeline_height. */ - generate_modeline (w, Dynarr_atp (dla, 0), type); - } - - return need_modeline; -} - -/* #### Kludge or not a kludge. I tend towards the former. */ -int -real_current_modeline_height (struct window *w) -{ - Fset_marker (w->start[CMOTION_DISP], w->start[CURRENT_DISP], w->buffer); - Fset_marker (w->pointm[CMOTION_DISP], w->pointm[CURRENT_DISP], w->buffer); - - if (ensure_modeline_generated (w, CMOTION_DISP)) - { - display_line_dynarr *dla = window_display_lines (w, CMOTION_DISP); - - if (Dynarr_length (dla)) - { - if (Dynarr_atp (dla, 0)->modeline) - return (Dynarr_atp (dla, 0)->ascent + - Dynarr_atp (dla, 0)->descent); - } - } - return 0; -} - - -/***************************************************************************/ -/* */ -/* 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; - - /* We're going to ditch selective display for static text, it's an - FSF thing and invisible 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; - data.max_pixpos -= data.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)) - { - Lisp_Object last_glyph = Qnil; - /* Deal with clipped glyphs that we have already displayed. */ - if (*prop && Dynarr_atp (*prop, 0)->type == PROP_GLYPH) - { - last_glyph = Dynarr_atp (*prop, 0)->data.p_glyph.glyph; - Dynarr_free (*prop); - *prop = 0; - } - /* 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, last_glyph); - /* 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'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) - { - data.ch = string_char (s, data.bi_bufpos); - *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) - { - data.ch = string_char (s, data.bi_bufpos); - *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 += data.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 += data.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 (data.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; - - calculate_baseline (&data); - - 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; - } - - calculate_yoffset (dl, db); - - 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; + if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) + Dynarr_add (formatted_string_emchar_dynarr, + Dynarr_atp (db->runes, elt)->object.chr.ch); + elt++; } - /* 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; + return + convert_emchar_string_into_malloced_string + ( Dynarr_atp (formatted_string_emchar_dynarr, 0), + Dynarr_length (formatted_string_emchar_dynarr), 0); } -/* 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; +/* Update just the modeline. Assumes the desired display structs. If + they do not have a modeline block, it does nothing. */ +static void +regenerate_modeline (struct window *w) +{ + display_line_dynarr *dla = window_display_lines (w, DESIRED_DISP); - while (ypos < yend) + if (!Dynarr_length (dla) || !Dynarr_atp (dla, 0)->modeline) + return; + else { - struct display_line dl; - struct display_line *dlp; - Bufpos next_pos; - int local; + generate_modeline (w, Dynarr_atp (dla, 0), DESIRED_DISP); + redisplay_update_line (w, 0, 0, 0); + } +} - if (Dynarr_length (dla) < Dynarr_largest (dla)) - { - dlp = Dynarr_atp (dla, Dynarr_length (dla)); - local = 0; - } - else - { +/* Make sure that modeline display line is present in the given + display structs if the window has a modeline and update that + line. Returns true if a modeline was needed. */ +static int +ensure_modeline_generated (struct window *w, int type) +{ + int need_modeline; - xzero (dl); - dlp = &dl; - local = 1; - } + /* minibuffer windows don't have modelines */ + if (MINI_WINDOW_P (w)) + need_modeline = 0; + /* windows which haven't had it turned off do */ + else if (WINDOW_HAS_MODELINE_P (w)) + need_modeline = 1; + /* windows which have it turned off don't have a divider if there is + a horizontal scrollbar */ + else if (window_scrollbar_height (w)) + need_modeline = 0; + /* and in this case there is none */ + else + need_modeline = 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; + if (need_modeline) + { + display_line_dynarr *dla; - dlp->ypos = ypos + dlp->ascent; - ypos = dlp->ypos + dlp->descent; + dla = window_display_lines (w, type); - if (ypos > yend) + /* We don't care if there is a display line which is not + currently a modeline because it is definitely going to become + one if we have gotten to this point. */ + if (Dynarr_length (dla) == 0) { - int visible_height = dlp->ascent + dlp->descent; - - dlp->clip = (ypos - yend); - visible_height -= dlp->clip; - - if (visible_height < VERTICAL_CLIP (w, 1)) + if (Dynarr_largest (dla) > 0) { - if (local) - free_display_line (dlp); - break; + struct display_line *mlp = Dynarr_atp (dla, 0); + Dynarr_add (dla, *mlp); + } + else + { + struct display_line modeline; + xzero (modeline); + Dynarr_add (dla, modeline); } } - 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 we're adding a new place marker go ahead and generate the + modeline so that it is available for use by + window_modeline_height. */ + generate_modeline (w, Dynarr_atp (dla, 0), type); } - if (prop) - Dynarr_free (prop); + return need_modeline; +} + +/* #### Kludge or not a kludge. I tend towards the former. */ +int +real_current_modeline_height (struct window *w) +{ + Fset_marker (w->start[CMOTION_DISP], w->start[CURRENT_DISP], w->buffer); + Fset_marker (w->pointm[CMOTION_DISP], w->pointm[CURRENT_DISP], w->buffer); + + if (ensure_modeline_generated (w, CMOTION_DISP)) + { + display_line_dynarr *dla = window_display_lines (w, CMOTION_DISP); + + if (Dynarr_length (dla)) + { + if (Dynarr_atp (dla, 0)->modeline) + return (Dynarr_atp (dla, 0)->ascent + + Dynarr_atp (dla, 0)->descent); + } + } + return 0; } @@ -5281,8 +4177,6 @@ regenerate_window (struct window *w, Bufpos start_pos, Bufpos point, int type) 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; @@ -5336,14 +4230,7 @@ regenerate_window (struct window *w, Bufpos start_pos, Bufpos point, int type) 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; @@ -5356,7 +4243,6 @@ regenerate_window (struct window *w, Bufpos start_pos, Bufpos point, int type) } else { - xzero (dl); dlp = &dl; local = 1; @@ -5364,39 +4250,19 @@ regenerate_window (struct window *w, Bufpos start_pos, Bufpos point, int type) 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); + visible_height -= dlp->clip; - if (visible_height < VERTICAL_CLIP (w, 1) && !force) + if (visible_height < VERTICAL_CLIP (w, 1)) { if (local) free_display_line (dlp); @@ -5440,22 +4306,16 @@ regenerate_window (struct window *w, Bufpos start_pos, Bufpos point, int type) generate_display_line call. */ if (start_pos > BUF_ZV (b)) break; - - force = 0; } if (prop) - Dynarr_free (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) @@ -5643,7 +4503,7 @@ regenerate_window_extents_only_changed (struct window *w, Bufpos startp, 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 @@ -5662,7 +4522,6 @@ regenerate_window_extents_only_changed (struct window *w, Bufpos startp, 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 @@ -5765,9 +4624,11 @@ regenerate_window_incrementally (struct window *w, Bufpos startp, /* If the changes are below the visible area then if point hasn't moved return success otherwise fail in order to be safe. */ if (line > dla_end) - return regenerate_window_extents_only_changed (w, startp, pointm, - extent_beg_unchanged, - extent_end_unchanged); + { + return regenerate_window_extents_only_changed (w, startp, pointm, + extent_beg_unchanged, + extent_end_unchanged); + } else /* At this point we know what line the changes first affect. We now redraw that line. If the changes are contained within it @@ -5786,16 +4647,27 @@ regenerate_window_incrementally (struct window *w, Bufpos startp, 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 @@ -5806,16 +4678,25 @@ regenerate_window_incrementally (struct window *w, Bufpos startp, 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)) { @@ -5871,9 +4752,12 @@ regenerate_window_incrementally (struct window *w, Bufpos startp, && extent_end_unchanged != -1 && ((extent_beg_unchanged < ddl->bufpos) || (extent_end_unchanged > ddl->end_bufpos))) - return regenerate_window_extents_only_changed (w, startp, pointm, - extent_beg_unchanged, - extent_end_unchanged); + { + return + regenerate_window_extents_only_changed (w, startp, pointm, + extent_beg_unchanged, + extent_end_unchanged); + } else return 1; } @@ -6099,7 +4983,7 @@ redisplay_window (Lisp_Object window, int skip_selected) } 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) @@ -6108,11 +4992,10 @@ redisplay_window (Lisp_Object window, int skip_selected) 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); @@ -6166,7 +5049,7 @@ redisplay_window (Lisp_Object window, int skip_selected) Fset_marker (w->pointm[DESIRED_DISP], make_int (pointm), the_buffer); - /* #### BUFU amounts of overkill just to get the cursor + /* #### BUFU amounts of overkil just to get the cursor location marked properly. FIX ME FIX ME FIX ME */ regenerate_window (w, startp, pointm, DESIRED_DISP); } @@ -6183,10 +5066,7 @@ redisplay_window (Lisp_Object window, int skip_selected) temporary change to the echo area. */ && !(MINI_WINDOW_P (w) && f->buffers_changed) && !f->frame_changed - && !truncation_changed - /* check whether start is really at the beginning of a line GE */ - && (!w->start_at_line_beg || beginning_of_line_p (b, startp)) - ) + && !truncation_changed) { /* Check if the cursor has actually moved. */ if (EQ (Fmarker_buffer (w->last_point[CURRENT_DISP]), w->buffer) @@ -6197,8 +5077,6 @@ redisplay_window (Lisp_Object window, int skip_selected) && !f->extents_changed && !f->faces_changed && !f->glyphs_changed - && !f->subwindows_changed - /* && !f->subwindows_state_changed*/ && !f->point_changed && !f->windows_structure_changed) { @@ -6219,8 +5097,6 @@ redisplay_window (Lisp_Object window, int skip_selected) && !f->extents_changed && !f->faces_changed && !f->glyphs_changed - && !f->subwindows_changed - /* && !f->subwindows_state_changed*/ && !f->windows_structure_changed) { if (point_visible (w, pointm, CURRENT_DISP) @@ -6278,8 +5154,6 @@ redisplay_window (Lisp_Object window, int skip_selected) && !f->clip_changed && !f->faces_changed && !f->glyphs_changed - && !f->subwindows_changed - /* && !f->subwindows_state_changed*/ && !f->windows_structure_changed && !f->frame_changed && !truncation_changed @@ -6359,13 +5233,12 @@ regeneration_done: Bufpos end = (w->window_end_pos[DESIRED_DISP] == -1 ? BUF_ZV (b) : BUF_Z (b) - w->window_end_pos[DESIRED_DISP] - 1); - /* Don't pollute the cache if not sure if we are correct */ - if (w->start_at_line_beg) - update_line_start_cache (w, start, end, pointm, 1); + + update_line_start_cache (w, start, end, pointm, 1); redisplay_output_window (w); /* * If we just displayed the echo area, the line start cache is - * no longer valid, because the minibuffer window is associated + * no longer valid, because the minibuffer window is assocaited * with the window now. */ if (echo_active) @@ -6376,12 +5249,6 @@ regeneration_done: 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; } @@ -6461,13 +5328,12 @@ call_redisplay_end_triggers (struct window *w, void *closure) /* 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); - if (preemption_check - && !DEVICE_IMPL_FLAG (d, XDEVIMPF_DONT_PREEMPT_REDISPLAY)) + if (preemption_check) { /* The preemption check itself takes a lot of time, so normally don't do it here. We do it if called @@ -6479,29 +5345,19 @@ redisplay_frame (struct frame *f, int preemption_check) 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) change_frame_size (f, f->new_height, f->new_width, 0); /* If frame size might need to be changed, due to changed size - of toolbars, scrollbars etc, change it now */ + of toolbars, scroolabrs etc, change it now */ if (f->size_slipped) { adjust_frame_size (f); assert (!f->size_slipped); } - + /* The menubar, toolbar, and icon updates must be done before hold_frame_size_changes is called and we are officially 'in_display'. They may eval lisp code which may call Fsignal. @@ -6514,38 +5370,11 @@ redisplay_frame (struct frame *f, int preemption_check) being handled. */ update_frame_menubars (f); #endif /* HAVE_MENUBARS */ + #ifdef HAVE_TOOLBARS - /* Update the toolbars geometry. We don't update the toolbars - themselves at this point since the space they are trying to - occupy may currently by occupied by gutter elements. Instead we - update the geometry, then update the gutter geometry, then update - the gutters - which will cause mapped windows to be repositioned - - and finally update the toolbars. */ - update_frame_toolbars_geometry (f); + /* 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 caches. 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) - reset_frame_subwindow_instance_cache (f); - - 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 (); @@ -6573,23 +5402,13 @@ redisplay_frame (struct frame *f, int preemption_check) #### 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)); /* Do the selected window first. */ redisplay_window (FRAME_SELECTED_WINDOW (f), 0); @@ -6597,21 +5416,30 @@ redisplay_frame (struct frame *f, int preemption_check) /* 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); -#ifdef HAVE_TOOLBARS - /* Finally update the toolbars. It seems its possible to get in a - cycle between updating the gutter and the toolbars. Basically we - want to end up with both being up-to-date and this doesn't seem - possible in a single pass. */ - update_frame_toolbars (f); -#endif /* HAVE_TOOLBARS */ - - 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->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) @@ -6628,41 +5456,28 @@ redisplay_frame (struct frame *f, int preemption_check) 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 && DEVICE_IMPL_FLAG (d, XDEVIMPF_NO_AUTO_REDISPLAY)) - return 0; - if (DEVICE_STREAM_P (d)) /* nothing to do */ return 0; /* It is possible that redisplay has been called before the - device is fully initialized, or that the console implementation - allows frameless devices. If so then continue with the next - device. */ + device is fully initialized. If so then continue with the + next device. */ if (NILP (DEVICE_SELECTED_FRAME (d))) return 0; - if (!DEVICE_IMPL_FLAG (d, XDEVIMPF_DONT_PREEMPT_REDISPLAY)) - { - int preempted; - REDISPLAY_PREEMPTION_CHECK; - if (preempted) - return 1; - } + REDISPLAY_PREEMPTION_CHECK; + if (preempted) + return 1; /* Always do the selected frame first. */ frame = DEVICE_SELECTED_FRAME (d); @@ -6674,13 +5489,18 @@ redisplay_device (struct device *d, int automatic) 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) { - int preempted = redisplay_frame (f, 0); - if (preempted) - return 1; + preempted = redisplay_frame (f, 0); } + if (preempted) + return 1; + /* If the frame redisplay did not get preempted, then this flag should have gotten set to 0. It might be possible for that not to happen if a size change event were to occur at an odd @@ -6703,13 +5523,19 @@ redisplay_device (struct device *d, int automatic) 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) { - int preempted = redisplay_frame (f, 0); - if (preempted) - return 1; + preempted = redisplay_frame (f, 0); } + if (preempted) + return 1; + if (f->size_change_pending) size_change_failed = 1; } @@ -6717,7 +5543,19 @@ redisplay_device (struct device *d, int automatic) /* 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->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; @@ -6752,8 +5590,13 @@ redisplay_without_hooks (void) 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 && + !windows_structure_changed && !disable_preemption && + preemption_count < max_preempts) goto done; DEVICE_LOOP_NO_BREAK (devcons, concons) @@ -6761,9 +5604,14 @@ redisplay_without_hooks (void) struct device *d = XDEVICE (XCAR (devcons)); int preempted; - if (CLASS_REDISPLAY_FLAGS_CHANGEDP (d)) + 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) { - preempted = redisplay_device (d, 1); + preempted = redisplay_device (d); if (preempted) { @@ -6780,7 +5628,18 @@ redisplay_without_hooks (void) 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; + 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) @@ -6841,9 +5700,9 @@ window_line_number (struct window *w, int type) { struct device *d = XDEVICE (XFRAME (w->frame)->device); struct buffer *b = XBUFFER (w->buffer); - /* Be careful in the order of these tests. The first clause will + /* Be careful in the order of these tests. The first clasue will fail if DEVICE_SELECTED_FRAME == Qnil (since w->frame cannot be). - This can occur when the frame title is computed really early */ + This can occur when the frame title is computed really early */ Bufpos pos = ((EQ(DEVICE_SELECTED_FRAME(d), w->frame) && (w == XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame(d)))) && @@ -6877,7 +5736,7 @@ static void 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); @@ -6906,7 +5765,7 @@ decode_mode_spec (struct window *w, Emchar spec, int type) 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; } @@ -7011,6 +5870,7 @@ decode_mode_spec (struct window *w, Emchar spec, int type) 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)) @@ -7027,20 +5887,15 @@ decode_mode_spec (struct window *w, Emchar spec, int type) /* 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; + if (total == 100) + total = 99; - sprintf (buf, "%d%%", percent); + sprintf (buf, "%2d%%", total); Dynarr_add_many (mode_spec_bufbyte_string, (Bufbyte *) buf, strlen (buf)); @@ -7055,6 +5910,7 @@ decode_mode_spec (struct window *w, Emchar spec, int type) { 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, @@ -7074,23 +5930,18 @@ decode_mode_spec (struct window *w, Emchar spec, int type) /* 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)); @@ -7193,7 +6044,7 @@ free_display_line (struct display_line *dl) /* 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; @@ -7226,7 +6077,7 @@ free_display_structs (struct window_mirror *mir) static void -mark_glyph_block_dynarr (glyph_block_dynarr *gba) +mark_glyph_block_dynarr (glyph_block_dynarr *gba, void (*markobj) (Lisp_Object)) { if (gba) { @@ -7235,18 +6086,14 @@ mark_glyph_block_dynarr (glyph_block_dynarr *gba) for (; gb < gb_last; gb++) { - if (!NILP (gb->glyph)) - mark_object (gb->glyph); - if (!NILP (gb->extent)) - mark_object (gb->extent); + if (!NILP (gb->glyph)) ((markobj) (gb->glyph)); + if (!NILP (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)); @@ -7268,43 +6115,43 @@ mark_redisplay_structs (display_line_dynarr *dla) 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; FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) { struct frame *f = XFRAME (XCAR (frmcons)); - mark_window_mirror (f->root_mirror); - mark_gutters (f); + update_frame_window_mirror (f); + mark_window_mirror (f->root_mirror, markobj); } } @@ -7368,7 +6215,7 @@ mark_redisplay (void) /* 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. */ @@ -7414,7 +6261,7 @@ validate_line_start_cache (struct window *w) size changes can cause text shifting. However, the extent covering the region is constantly having its face set and priority altered by the mouse code. This means that the line - start cache is constantly being invalidated. This is bad + start cache is constanty being invalidated. This is bad since the mouse code also triggers heavy usage of the cache. Since it is an unlikely that f->extents being changed indicates that the cache really needs to be updated and if it @@ -7474,8 +6321,7 @@ point_in_line_start_cache (struct window *w, Bufpos point, int min_past) { struct buffer *b = XBUFFER (w->buffer); line_start_cache_dynarr *cache = w->line_start_cache; - unsigned int top, bottom; - EMACS_INT pos; + unsigned int top, bottom, pos; validate_line_start_cache (w); w->line_cache_validation_override++; @@ -7603,7 +6449,7 @@ find_point_loop: while (1) { - EMACS_INT new_pos; + unsigned int new_pos; Bufpos start, end; pos = (bottom + top + 1) >> 1; @@ -7663,7 +6509,7 @@ int 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; @@ -7742,18 +6588,11 @@ point_would_be_visible (struct window *w, Bufpos startp, Bufpos point) displayed. The end of the last line is also know as the window end position. - WARNING: It is possible that redisplay 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; @@ -7773,7 +6612,7 @@ start_end_of_last_line (struct window *w, Bufpos startp, int end, 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) { @@ -7837,7 +6676,7 @@ start_end_of_last_line (struct window *w, Bufpos startp, int end, 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 @@ -7847,16 +6686,9 @@ start_of_last_line (struct window *w, Bufpos startp) Bufpos end_of_last_line (struct window *w, Bufpos startp) { - return start_end_of_last_line (w, startp, 1, 0); -} - -static Bufpos -end_of_last_line_may_error (struct window *w, Bufpos startp) -{ - return start_end_of_last_line (w, startp, 1, 1); + return start_end_of_last_line (w, startp, 1); } - /* For window W, what does the starting position have to be so that the line containing POINT will cover pixel position PIXPOS. */ @@ -7902,7 +6734,7 @@ start_with_line_at_pixpos (struct window *w, Bufpos point, int pixpos) } cur_elt--; - while (cur_elt < 0) + if (cur_elt < 0) { Bufpos from, to; int win_char_height; @@ -7922,20 +6754,7 @@ start_with_line_at_pixpos (struct window *w, Bufpos point, int pixpos) 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; } @@ -8040,6 +6859,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, validate_line_start_cache (w); w->line_cache_validation_override++; + updating_line_start_cache = 1; if (from < BUF_BEGV (b)) from = BUF_BEGV (b); @@ -8048,6 +6868,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, if (from > to) { + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -8060,6 +6881,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, /* 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; } @@ -8088,6 +6910,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, update_internal_cache_list (w, DESIRED_DISP); if (!Dynarr_length (internal_cache)) { + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -8115,6 +6938,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, { Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0), Dynarr_length (internal_cache)); + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -8123,6 +6947,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, 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; } @@ -8145,6 +6970,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, 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; } @@ -8170,6 +6996,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, 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; } @@ -8178,6 +7005,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, Dynarr_length (internal_cache) - ic_elt); } + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -8197,9 +7025,23 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, 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; @@ -8219,7 +7061,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, /* * Handle invisible text properly: - * If the last line we're inserting has the same end as the + * If the last line we're inserting has the same end as the * line before which it will be added, merge the two lines. */ if (Dynarr_length (cache) && @@ -8245,6 +7087,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, startp = new_startp; if (startp > BUF_ZV (b)) { + updating_line_start_cache = 0; w->line_cache_validation_override--; return; } @@ -8278,6 +7121,7 @@ update_line_start_cache (struct window *w, Bufpos from, Bufpos to, while (to > high_bound); } + updating_line_start_cache = 0; w->line_cache_validation_override--; assert (to <= high_bound); } @@ -8453,7 +7297,7 @@ get_position_object (struct display_line *dl, Lisp_Object *obj1, d->pixel_to_glyph_cache.obj1 = *obj1; \ d->pixel_to_glyph_cache.obj2 = *obj2; \ d->pixel_to_glyph_cache.retval = position; \ - RETURN_SANS_WARNINGS position; \ + RETURN__ position; \ } while (0) /* Given x and y coordinates in pixels relative to a frame, return @@ -8985,7 +7829,7 @@ pixel_to_glyph_translation (struct frame *f, int x_coord, int y_coord, 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; @@ -9018,9 +7862,6 @@ Ensure that all minibuffers are correctly showing the echo area. 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 @@ -9029,15 +7870,19 @@ Ensure that all minibuffers are correctly showing the echo area. */ 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; @@ -9072,9 +7917,6 @@ input and is guaranteed to proceed to completion. f->clear = 1; redisplay_frame (f, 1); - /* See the comment in Fredisplay_frame. */ - RESET_CHANGED_SET_FLAGS; - return unbind_to (count, Qnil); } @@ -9102,15 +7944,6 @@ input and is guaranteed to proceed to completion. redisplay_frame (f, 1); - /* If we don't reset the global redisplay flags 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); } @@ -9138,10 +7971,7 @@ input and is guaranteed to proceed to completion. { 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); } @@ -9168,10 +7998,7 @@ input and is guaranteed to proceed to completion. disable_preemption++; } - redisplay_device (d, 0); - - /* See the comment in Fredisplay_frame. */ - RESET_CHANGED_SET_FLAGS; + redisplay_device (d); return unbind_to (count, Qnil); } @@ -9223,37 +8050,46 @@ redisplay_variable_changed (Lisp_Object sym, Lisp_Object *val, 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) { if (WINDOWP (locale)) { - MARK_FRAME_GLYPHS_CHANGED (XFRAME (WINDOW_FRAME (XWINDOW (locale)))); + struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (locale))); + MARK_FRAME_GLYPHS_CHANGED (f); } else if (FRAMEP (locale)) { - MARK_FRAME_GLYPHS_CHANGED (XFRAME (locale)); + struct frame *f = XFRAME (locale); + MARK_FRAME_GLYPHS_CHANGED (f); } else if (DEVICEP (locale)) { Lisp_Object frmcons; DEVICE_FRAME_LOOP (frmcons, XDEVICE (locale)) - MARK_FRAME_GLYPHS_CHANGED (XFRAME (XCAR (frmcons))); + { + struct frame *f = XFRAME (XCAR (frmcons)); + MARK_FRAME_GLYPHS_CHANGED (f); + } } else if (CONSOLEP (locale)) { Lisp_Object frmcons, devcons; CONSOLE_FRAME_LOOP_NO_BREAK (frmcons, devcons, XCONSOLE (locale)) - MARK_FRAME_GLYPHS_CHANGED (XFRAME (XCAR (frmcons))); + { + struct frame *f = XFRAME (XCAR (frmcons)); + MARK_FRAME_GLYPHS_CHANGED (f); + } } else /* global or buffer */ { Lisp_Object frmcons, devcons, concons; FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) - MARK_FRAME_GLYPHS_CHANGED (XFRAME (XCAR (frmcons))); + { + struct frame *f = XFRAME (XCAR (frmcons)); + MARK_FRAME_GLYPHS_CHANGED (f); + } } } @@ -9347,22 +8183,16 @@ init_redisplay (void) 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 */ @@ -9387,15 +8217,6 @@ init_redisplay (void) } #endif /* HAVE_X_WINDOWS */ -#ifdef HAVE_GTK - if (!strcmp (display_use, "gtk")) - { - Vwindow_system = Qgtk; - Vinitial_window_system = Qgtk; - return; - } -#endif - #ifdef HAVE_MS_WINDOWS if (!strcmp (display_use, "mswindows")) { @@ -9442,10 +8263,9 @@ syms_of_redisplay (void) #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); @@ -9459,7 +8279,6 @@ syms_of_redisplay (void) void vars_of_redisplay (void) { - #if 0 staticpro (&last_arrow_position); staticpro (&last_arrow_string); @@ -9467,6 +8286,8 @@ vars_of_redisplay (void) 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 @@ -9478,7 +8299,7 @@ line start cache. Minimum pixel height for clipped bottom display line. A clipped line shorter than this won't be displayed. */ , - redisplay_variable_changed); + redisplay_variable_changed); vertical_clip = 5; DEFVAR_INT_MAGIC ("pixel-horizontal-clip-threshold", &horizontal_clip /* @@ -9486,7 +8307,7 @@ Minimum visible area for clipped glyphs at right boundary. Clipped glyphs shorter than this won't be displayed. Only pixmap glyph instances are currently allowed to be clipped. */ , - redisplay_variable_changed); + redisplay_variable_changed); horizontal_clip = 5; DEFVAR_LISP ("global-mode-string", &Vglobal_mode_string /* @@ -9498,16 +8319,13 @@ String displayed by modeline-format's "%m" specification. Marker for where to display an arrow on top of the buffer text. This must be the beginning of a line in order to work. See also `overlay-arrow-string'. -*/ , - redisplay_variable_changed); +*/ , redisplay_variable_changed); 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); + redisplay_variable_changed); Voverlay_arrow_string = Qnil; DEFVAR_INT ("scroll-step", &scroll_step /* @@ -9526,22 +8344,13 @@ If this is zero, point is always centered after it moves off screen. &truncate_partial_width_windows /* *Non-nil means truncate lines in all windows less than full frame wide. */ , - redisplay_variable_changed); + 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. @@ -9562,7 +8371,7 @@ instead. 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; @@ -9585,29 +8394,24 @@ Non-nil means put cursor in minibuffer, at end of any message there. maybe a caret cursor, etc. */ DEFVAR_LISP ("bar-cursor", &Vbar_cursor /* -*Use vertical bar cursor if non-nil. If t width is 1 pixel, otherwise 2. +Use vertical bar cursor if non-nil. If t width is 1 pixel, otherwise 2. */ ); Vbar_cursor = Qnil; #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 @@ -9666,10 +8470,10 @@ This is a specifier; use `set-specifier' to change it. 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), - margin_width_changed_in_frame, 0); + slot_offset (struct frame, left_margin_width), + margin_width_changed_in_frame); DEFVAR_SPECIFIER ("right-margin-width", &Vright_margin_width /* *Width of right margin. @@ -9678,10 +8482,10 @@ This is a specifier; use `set-specifier' to change it. 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), - margin_width_changed_in_frame, 0); + slot_offset (struct frame, right_margin_width), + margin_width_changed_in_frame); DEFVAR_SPECIFIER ("minimum-line-ascent", &Vminimum_line_ascent /* *Minimum ascent height of lines. @@ -9690,9 +8494,9 @@ This is a specifier; use `set-specifier' to change it. 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, 0); + 0, 0); DEFVAR_SPECIFIER ("minimum-line-descent", &Vminimum_line_descent /* *Minimum descent height of lines. @@ -9701,9 +8505,9 @@ This is a specifier; use `set-specifier' to change it. 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, 0); + 0, 0); DEFVAR_SPECIFIER ("use-left-overflow", &Vuse_left_overflow /* *Non-nil means use the left outside margin as extra whitespace when @@ -9713,9 +8517,9 @@ This is a specifier; use `set-specifier' to change it. 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, 0); + 0, 0); DEFVAR_SPECIFIER ("use-right-overflow", &Vuse_right_overflow /* *Non-nil means use the right outside margin as extra whitespace when @@ -9725,9 +8529,9 @@ This is a specifier; use `set-specifier' to change it. 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, 0); + 0, 0); DEFVAR_SPECIFIER ("text-cursor-visible-p", &Vtext_cursor_visible_p /* *Non-nil means the text cursor is visible (this is usually the case). @@ -9736,8 +8540,8 @@ This is a specifier; use `set-specifier' to change it. 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, 0); + 0, 0); } diff --git a/src/redisplay.h b/src/redisplay.h index b93dfb0..0d609bc 100644 --- a/src/redisplay.h +++ b/src/redisplay.h @@ -22,8 +22,8 @@ Boston, MA 02111-1307, USA. */ /* 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 @@ typedef struct 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 @@ struct rune 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 @@ struct rune /* #### 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 */ { - /* #### Glyphs are rare. Is it really necessary to waste 8 bytes on every - rune for that?! */ /* DGLYPH */ struct { @@ -147,9 +129,6 @@ struct rune If this is a rune in the modeline then this might be nil. */ - int ascent; /* Ascent of this glyph, in pixels. */ - int descent; /* Descent of this glyph, in pixels. */ - int yoffset; /* Offset from line top to reach glyph top */ int xoffset; /* Number of pixels that need to be chopped off the left of the glyph. This has the effect of shifting the @@ -160,14 +139,14 @@ struct rune /* CHAR */ struct { - Emchar ch; /* Character of this rune. */ + Emchar ch; /* Cbaracter of this rune. */ } chr; /* 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 */ }; @@ -254,32 +233,6 @@ typedef struct 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 redisplay 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 { @@ -294,8 +247,6 @@ struct display_line 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 */ @@ -305,67 +256,25 @@ struct display_line int cursor_elt; /* rune block of TEXT display block cursor is at or -1 */ char used_prop_data; /* can't incrementally update if line - used propagation data */ + used propogation data */ layout_bounds bounds; /* line boundary positions */ 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)) -#define DISPLAY_LINE_YPOS(dl) \ -(dl->ypos - (dl->ascent - dl->top_clip)) -#define DISPLAY_LINE_YEND(dl) \ -((dl->ypos + dl->descent) - dl->clip) - 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. */ @@ -401,12 +310,6 @@ struct extent_fragment 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 */ @@ -421,24 +324,24 @@ struct extent_fragment 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, @@ -447,16 +350,6 @@ extern int frame_changed; extern int glyphs_changed; extern int glyphs_changed_set; -/* True if any displayed subwindow is in need of updating - somewhere. */ -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; @@ -465,38 +358,30 @@ extern int icon_changed_set; 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 some frame has changed the layout of internal elements - (gutters or toolbars). */ -extern int frame_layout_changed; - -/* 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 @@ -504,23 +389,23 @@ extern int windows_structure_changed; if each has already been called and don't bother doing most of the work if it is currently set. */ -#define MARK_TYPE_CHANGED(object) do { \ - if (!object##_changed_set) { \ - Lisp_Object MTC_devcons, MTC_concons; \ - DEVICE_LOOP_NO_BREAK (MTC_devcons, MTC_concons) \ - { \ - Lisp_Object MTC_frmcons; \ - struct device *MTC_d = XDEVICE (XCAR (MTC_devcons)); \ - DEVICE_FRAME_LOOP (MTC_frmcons, MTC_d) \ - { \ - struct frame *MTC_f = XFRAME (XCAR (MTC_frmcons)); \ - MTC_f->object##_changed = 1; \ - MTC_f->modiff++; \ - } \ - MTC_d->object##_changed = 1; \ - } \ - object##_changed = 1; \ - object##_changed_set = 1; } \ +#define MARK_TYPE_CHANGED(object) do { \ + if (!object##_changed_set) { \ + Lisp_Object _devcons_, _concons_; \ + DEVICE_LOOP_NO_BREAK (_devcons_, _concons_) \ + { \ + Lisp_Object _frmcons_; \ + struct device *_d_ = XDEVICE (XCAR (_devcons_)); \ + DEVICE_FRAME_LOOP (_frmcons_, _d_) \ + { \ + struct frame *_f_ = XFRAME (XCAR (_frmcons_)); \ + _f_->object##_changed = 1; \ + _f_->modiff++; \ + } \ + _d_->object##_changed = 1; \ + } \ + object##_changed = 1; \ + object##_changed_set = 1; } \ } while (0) #define MARK_BUFFERS_CHANGED MARK_TYPE_CHANGED (buffers) @@ -531,115 +416,29 @@ extern int windows_structure_changed; #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)->frame_layout_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; \ - frame_layout_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)->frame_layout_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 || \ - frame_layout_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; \ + } while (0) /*************************************************************************/ /* redisplay global variables */ /*************************************************************************/ -/* redisplay structure used by various utility routines. */ +/* redisplay structre used by various utility routines. */ extern display_line_dynarr *cmotion_display_lines; /* Nonzero means truncate lines in all windows less wide than the frame. */ @@ -653,8 +452,8 @@ extern int in_display; 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; @@ -674,7 +473,7 @@ extern Lisp_Object Vglobal_mode_string; extern int display_arg; /* Type of display specified. Defined in emacs.c. */ -extern const char *display_use; +extern char *display_use; /* Nonzero means reading single-character input with prompt so put cursor on minibuffer after the prompt. */ @@ -683,8 +482,6 @@ extern int cursor_in_echo_area; extern Lisp_Object Qbar_cursor, Qcursor_in_echo_area, Vwindow_system; -extern Lisp_Object Qtop_bottom; - /*************************************************************************/ /* redisplay exported functions */ @@ -699,7 +496,6 @@ int redisplay_frame_text_width_string (struct frame *f, 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); @@ -711,20 +507,9 @@ int line_at_center (struct window *w, int type, Bufpos start, Bufpos point); 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, @@ -734,7 +519,7 @@ int pixel_to_glyph_translation (struct frame *f, int x_coord, 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, @@ -762,47 +547,17 @@ int compute_line_start_cache_dynarr_usage (line_start_cache_dynarr *dyn, int get_next_display_block (layout_bounds bounds, display_block_dynarr *dba, int start_pos, int *next_start); -void redisplay_output_layout (Lisp_Object domain, - 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_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 yoffset, 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_top_of_window (struct window *w); void redisplay_clear_bottom_of_window (struct window *w, display_line_dynarr *ddla, int min_start, int max_end); 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 --git a/src/regex.c b/src/regex.c index d70f7d6..1b68465 100644 --- a/src/regex.c +++ b/src/regex.c @@ -47,14 +47,6 @@ #define _GNU_SOURCE 1 #endif -#ifdef emacs -/* Converts the pointer to the char to BEG-based offset from the start. */ -#define PTR_TO_OFFSET(d) (MATCHING_IN_FIRST_STRING \ - ? (d) - string1 : (d) - (string2 - size1)) -#else -#define PTR_TO_OFFSET(d) 0 -#endif - /* We assume non-Mule if emacs isn't defined. */ #ifndef emacs #undef MULE @@ -112,10 +104,7 @@ complex_vars_of_regex (void) { } -#endif /* MULE */ - -#define RE_TRANSLATE(ch) TRT_TABLE_OF (translate, (Emchar) ch) -#define TRANSLATE_P(tr) (!NILP (tr)) +#endif /* not MULE */ #else /* not emacs */ @@ -131,19 +120,16 @@ char *malloc (); char *realloc (); #endif -/* Types normally included via lisp.h */ -#include <stddef.h> /* for ptrdiff_t */ +#define charptr_emchar(str) ((Emchar) (str)[0]) -#ifdef REGEX_MALLOC -#ifndef DECLARE_NOTHING -#define DECLARE_NOTHING struct nosuchstruct -#endif +#if (LONGBITS > INTBITS) +# define EMACS_INT long +#else +# define EMACS_INT int #endif typedef int Emchar; -#define charptr_emchar(str) ((Emchar) (str)[0]) - #define INC_CHARPTR(p) ((p)++) #define DEC_CHARPTR(p) ((p)--) @@ -175,7 +161,7 @@ init_syntax_once (void) if (!done) { - const char *word_syntax_chars = + CONST char *word_syntax_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"; memset (re_syntax_table, 0, sizeof (re_syntax_table)); @@ -187,16 +173,11 @@ init_syntax_once (void) } } -#endif /* SYNTAX_TABLE */ +#endif /* not SYNTAX_TABLE */ #define SYNTAX_UNSAFE(ignored, c) re_syntax_table[c] -#undef SYNTAX_FROM_CACHE -#define SYNTAX_FROM_CACHE SYNTAX_UNSAFE - -#define RE_TRANSLATE(c) translate[(unsigned char) (c)] -#define TRANSLATE_P(tr) tr -#endif /* emacs */ +#endif /* not emacs */ /* Under XEmacs, this is needed because we don't define it elsewhere. */ #ifdef SWITCH_ENUM_BUG @@ -305,10 +286,10 @@ init_syntax_once (void) #include <alloca.h> #else /* not __GNUC__ or HAVE_ALLOCA_H */ #ifndef _AIX /* Already did AIX, up at the top. */ -void *alloca (); +char *alloca (); #endif /* not _AIX */ -#endif /* HAVE_ALLOCA_H */ -#endif /* __GNUC__ */ +#endif /* not HAVE_ALLOCA_H */ +#endif /* not __GNUC__ */ #endif /* not alloca */ @@ -323,7 +304,7 @@ void *alloca (); /* No need to do anything to free, after alloca. */ #define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */ -#endif /* REGEX_MALLOC */ +#endif /* not REGEX_MALLOC */ /* Define how to allocate the failure stack. */ @@ -352,8 +333,8 @@ void *alloca (); /* No need to explicitly free anything. */ #define REGEX_FREE_STACK(arg) -#endif /* REGEX_MALLOC */ -#endif /* REL_ALLOC */ +#endif /* not REGEX_MALLOC */ +#endif /* not REL_ALLOC */ /* True if `size1' is non-NULL and PTR is pointing anywhere inside @@ -371,17 +352,14 @@ void *alloca (); #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 #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) -/* Type of source-pattern and string chars. */ -typedef const unsigned char re_char; - -typedef char re_bool; +typedef char boolean; #define false 0 #define true 1 @@ -576,7 +554,7 @@ typedef enum #ifdef DEBUG static void -extract_number (int *dest, re_char *source) +extract_number (int *dest, unsigned char *source) { int temp = SIGN_EXTEND_CHAR (*(source + 1)); *dest = *source & 0377; @@ -679,11 +657,11 @@ print_fastmap (char *fastmap) the START pointer into it and ending just before the pointer END. */ static void -print_partial_compiled_pattern (re_char *start, re_char *end) +print_partial_compiled_pattern (unsigned char *start, unsigned char *end) { int mcnt, mcnt2; - unsigned char *p = (unsigned char *) start; - re_char *pend = end; + unsigned char *p = start; + unsigned char *pend = end; if (start == NULL) { @@ -961,7 +939,7 @@ print_partial_compiled_pattern (re_char *start, re_char *end) static void print_compiled_pattern (struct re_pattern_buffer *bufp) { - re_char *buffer = bufp->buffer; + unsigned char *buffer = bufp->buffer; print_partial_compiled_pattern (buffer, buffer + bufp->used); printf ("%ld bytes used/%ld bytes allocated.\n", bufp->used, @@ -987,14 +965,14 @@ print_compiled_pattern (struct re_pattern_buffer *bufp) static void -print_double_string (re_char *where, re_char *string1, int size1, - re_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)"); else { - Element_count this_char; + unsigned int this_char; if (FIRST_STRING_P (where)) { @@ -1022,7 +1000,7 @@ print_double_string (re_char *where, re_char *string1, int size1, #define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) #define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) -#endif /* DEBUG */ +#endif /* not DEBUG */ /* Set by `re_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own @@ -1053,7 +1031,7 @@ re_set_syntax (reg_syntax_t syntax) 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 */ @@ -1145,7 +1123,7 @@ int re_max_failures = 2000; union fail_stack_elt { - re_char *pointer; + unsigned char *pointer; int integer; }; @@ -1154,8 +1132,8 @@ typedef union fail_stack_elt fail_stack_elt_t; typedef struct { fail_stack_elt_t *stack; - Element_count size; - Element_count avail; /* Offset of next open position. */ + unsigned size; + unsigned avail; /* Offset of next open position. */ } fail_stack_type; #define FAIL_STACK_EMPTY() (fail_stack.avail == 0) @@ -1198,7 +1176,7 @@ typedef struct REGEX_REALLOCATE_STACK requires `destination' be declared. */ #define DOUBLE_FAIL_STACK(fail_stack) \ - ((int) (fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \ + ((fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \ ? 0 \ : ((fail_stack).stack = (fail_stack_elt_t *) \ REGEX_REALLOCATE_STACK ((fail_stack).stack, \ @@ -1265,89 +1243,85 @@ typedef struct Does `return FAILURE_CODE' if runs out of memory. */ #if !defined (REGEX_MALLOC) && !defined (REL_ALLOC) -#define DECLARE_DESTINATION char *destination +#define DECLARE_DESTINATION char *destination; #else -#define DECLARE_DESTINATION DECLARE_NOTHING +#define DECLARE_DESTINATION #endif #define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ -do { \ - DECLARE_DESTINATION; \ - /* Must be int, so when we don't save any registers, the arithmetic \ - of 0 + -1 isn't done as unsigned. */ \ - int this_reg; \ - \ - DEBUG_STATEMENT (failure_id++); \ - DEBUG_STATEMENT (nfailure_points_pushed++); \ - DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \ - DEBUG_PRINT2 (" Before push, next avail: %lu\n", \ - (unsigned long) (fail_stack).avail); \ - DEBUG_PRINT2 (" size: %lu\n", \ - (unsigned long) (fail_stack).size); \ - \ - DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \ - DEBUG_PRINT2 (" available: %ld\n", \ - (long) REMAINING_AVAIL_SLOTS); \ + do { \ + DECLARE_DESTINATION \ + /* Must be int, so when we don't save any registers, the arithmetic \ + of 0 + -1 isn't done as unsigned. */ \ + int this_reg; \ + \ + DEBUG_STATEMENT (failure_id++); \ + DEBUG_STATEMENT (nfailure_points_pushed++); \ + DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \ + DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\ + DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\ \ - /* Ensure we have enough space allocated for what we will push. */ \ - while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ - { \ - if (!DOUBLE_FAIL_STACK (fail_stack)) \ - return failure_code; \ + DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \ + DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \ \ - DEBUG_PRINT2 ("\n Doubled stack; size now: %lu\n", \ - (unsigned long) (fail_stack).size); \ - DEBUG_PRINT2 (" slots available: %ld\n", \ - (long) REMAINING_AVAIL_SLOTS); \ - } \ + /* Ensure we have enough space allocated for what we will push. */ \ + while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ + { \ + if (!DOUBLE_FAIL_STACK (fail_stack)) \ + return failure_code; \ \ - /* Push the info, starting with the registers. */ \ - DEBUG_PRINT1 ("\n"); \ + DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \ + (fail_stack).size); \ + DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\ + } \ \ - for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ - this_reg++) \ - { \ - DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \ - DEBUG_STATEMENT (num_regs_pushed++); \ + /* Push the info, starting with the registers. */ \ + DEBUG_PRINT1 ("\n"); \ \ - DEBUG_PRINT2 (" start: 0x%lx\n", (long) regstart[this_reg]); \ - PUSH_FAILURE_POINTER (regstart[this_reg]); \ + for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ + this_reg++) \ + { \ + DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \ + DEBUG_STATEMENT (num_regs_pushed++); \ \ - DEBUG_PRINT2 (" end: 0x%lx\n", (long) regend[this_reg]); \ - PUSH_FAILURE_POINTER (regend[this_reg]); \ + DEBUG_PRINT2 (" start: 0x%p\n", regstart[this_reg]); \ + PUSH_FAILURE_POINTER (regstart[this_reg]); \ + \ + DEBUG_PRINT2 (" end: 0x%p\n", regend[this_reg]); \ + PUSH_FAILURE_POINTER (regend[this_reg]); \ \ - DEBUG_PRINT2 (" info: 0x%lx\n ", \ - * (long *) (®_info[this_reg])); \ - DEBUG_PRINT2 (" match_null=%d", \ - REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ - DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ - DEBUG_PRINT2 (" matched_something=%d", \ - MATCHED_SOMETHING (reg_info[this_reg])); \ - DEBUG_PRINT2 (" ever_matched_something=%d", \ - EVER_MATCHED_SOMETHING (reg_info[this_reg])); \ - DEBUG_PRINT1 ("\n"); \ - PUSH_FAILURE_ELT (reg_info[this_reg].word); \ - } \ + DEBUG_PRINT2 (" info: 0x%lx\n ", \ + * (unsigned long *) (®_info[this_reg])); \ + DEBUG_PRINT2 (" match_null=%d", \ + REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ + DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ + DEBUG_PRINT2 (" matched_something=%d", \ + MATCHED_SOMETHING (reg_info[this_reg])); \ + DEBUG_PRINT2 (" ever_matched=%d", \ + EVER_MATCHED_SOMETHING (reg_info[this_reg])); \ + DEBUG_PRINT1 ("\n"); \ + PUSH_FAILURE_ELT (reg_info[this_reg].word); \ + } \ \ - DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg); \ - PUSH_FAILURE_INT (lowest_active_reg); \ + DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\ + PUSH_FAILURE_INT (lowest_active_reg); \ \ - DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg); \ - PUSH_FAILURE_INT (highest_active_reg); \ + DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\ + PUSH_FAILURE_INT (highest_active_reg); \ \ - DEBUG_PRINT2 (" Pushing pattern 0x%lx: \n", (long) pattern_place); \ - DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ - PUSH_FAILURE_POINTER (pattern_place); \ + DEBUG_PRINT2 (" Pushing pattern 0x%p: ", pattern_place); \ + DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ + PUSH_FAILURE_POINTER (pattern_place); \ \ - DEBUG_PRINT2 (" Pushing string 0x%lx: `", (long) string_place); \ - DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ - size2); \ - DEBUG_PRINT1 ("'\n"); \ - PUSH_FAILURE_POINTER (string_place); \ + DEBUG_PRINT2 (" Pushing string 0x%p: `", string_place); \ + DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ + size2); \ + DEBUG_PRINT1 ("'\n"); \ + PUSH_FAILURE_POINTER (string_place); \ \ - DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \ - DEBUG_PUSH (failure_id); \ -} while (0) + DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \ + DEBUG_PUSH (failure_id); \ + } while (0) /* This is the number of items that are pushed and popped on the stack for each register. */ @@ -1372,7 +1346,7 @@ do { \ + NUM_NONREG_ITEMS) /* How many items can still be added to the stack without overflowing it. */ -#define REMAINING_AVAIL_SLOTS ((int) ((fail_stack).size - (fail_stack).avail)) +#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) /* Pops what PUSH_FAIL_STACK pushes. @@ -1387,21 +1361,18 @@ do { \ Also assumes the variables `fail_stack' and (if debugging), `bufp', `pend', `string1', `size1', `string2', and `size2'. */ -#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, \ - regstart, regend, reg_info) \ -do { \ +#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\ +{ \ 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 ()); \ \ /* Remove failure points and point to how many regs pushed. */ \ DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \ - DEBUG_PRINT2 (" Before pop, next avail: %lu\n", \ - (unsigned long) fail_stack.avail); \ - DEBUG_PRINT2 (" size: %lu\n", \ - (unsigned long) fail_stack.size); \ + DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \ + DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \ \ assert (fail_stack.avail >= NUM_NONREG_ITEMS); \ \ @@ -1414,14 +1385,14 @@ do { \ saved NULL, thus retaining our current position in the string. */ \ string_temp = POP_FAILURE_POINTER (); \ if (string_temp != NULL) \ - str = string_temp; \ + str = (CONST char *) string_temp; \ \ - DEBUG_PRINT2 (" Popping string 0x%lx: `", (long) str); \ + DEBUG_PRINT2 (" Popping string 0x%p: `", str); \ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ DEBUG_PRINT1 ("'\n"); \ \ pat = (unsigned char *) POP_FAILURE_POINTER (); \ - DEBUG_PRINT2 (" Popping pattern 0x%lx: ", (long) pat); \ + DEBUG_PRINT2 (" Popping pattern 0x%p: ", pat); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ \ /* Restore register info. */ \ @@ -1437,18 +1408,18 @@ do { \ \ reg_info[this_reg].word = POP_FAILURE_ELT (); \ DEBUG_PRINT2 (" info: 0x%lx\n", \ - * (long *) ®_info[this_reg]); \ + * (unsigned long *) ®_info[this_reg]); \ \ - regend[this_reg] = POP_FAILURE_POINTER (); \ - DEBUG_PRINT2 (" end: 0x%lx\n", (long) regend[this_reg]); \ + regend[this_reg] = (CONST char *) POP_FAILURE_POINTER (); \ + DEBUG_PRINT2 (" end: 0x%p\n", regend[this_reg]); \ \ - regstart[this_reg] = POP_FAILURE_POINTER (); \ - DEBUG_PRINT2 (" start: 0x%lx\n", (long) regstart[this_reg]); \ + regstart[this_reg] = (CONST char *) POP_FAILURE_POINTER (); \ + DEBUG_PRINT2 (" start: 0x%p\n", regstart[this_reg]); \ } \ \ set_regs_matched_done = 0; \ DEBUG_STATEMENT (nfailure_points_popped++); \ -} while (0) /* POP_FAILURE_POINT */ +} /* POP_FAILURE_POINT */ @@ -1492,7 +1463,7 @@ typedef union { \ if (!set_regs_matched_done) \ { \ - Element_count r; \ + unsigned r; \ set_regs_matched_done = 1; \ for (r = lowest_active_reg; r <= highest_active_reg; r++) \ { \ @@ -1505,7 +1476,7 @@ typedef union while (0) /* Registers are set to a sentinel when they haven't yet matched. */ -static unsigned char reg_unset_dummy; +static char reg_unset_dummy; #define REG_UNSET_VALUE (®_unset_dummy) #define REG_UNSET(e) ((e) == REG_UNSET_VALUE) @@ -1516,9 +1487,10 @@ static unsigned char reg_unset_dummy; string passed to us by the user to an unsigned char that we can use as an array index (in, e.g., `translate'). */ #define PATFETCH(c) \ - do { \ - PATFETCH_RAW (c); \ - c = TRANSLATE (c); \ + do {if (p == pend) return REG_EEND; \ + assert (p < pend); \ + c = (unsigned char) *p++; \ + if (translate) c = (unsigned char) translate[c]; \ } while (0) /* Fetch the next character in the uncompiled pattern, with no @@ -1526,28 +1498,27 @@ static unsigned char reg_unset_dummy; #define PATFETCH_RAW(c) \ do {if (p == pend) return REG_EEND; \ assert (p < pend); \ - c = charptr_emchar (p); \ - INC_CHARPTR (p); \ + c = (unsigned char) *p++; \ } while (0) /* Go backwards one character in the pattern. */ -#define PATUNFETCH DEC_CHARPTR (p) +#define PATUNFETCH p-- #ifdef MULE #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_P (translate) && emch < 0x80) \ - emch = (Emchar) (unsigned char) RE_TRANSLATE (emch); \ + if (translate && emch < 0x80) \ + emch = (Emchar) (unsigned char) translate[emch]; \ } while (0) #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) @@ -1583,18 +1554,18 @@ static unsigned char reg_unset_dummy; #define PATFETCH_RAW_EITHER(emch) PATFETCH_RAW (emch) #define PATUNFETCH_EITHER PATUNFETCH -#endif /* MULE */ +#endif /* not MULE */ /* If `translate' is non-null, return translate[D], else just D. We cast the subscript to translate because some data is declared as `char *', to avoid warnings when a string constant is passed. But when we use a character as a subscript we must make it unsigned. */ -#define TRANSLATE(d) (TRANSLATE_P (translate) ? RE_TRANSLATE (d) : (d)) +#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d)) #ifdef MULE #define TRANSLATE_EXTENDED_UNSAFE(emch) \ - (TRANSLATE_P (translate) && emch < 0x80 ? RE_TRANSLATE (emch) : (emch)) + (translate && emch < 0x80 ? translate[emch] : (emch)) #endif @@ -1605,14 +1576,14 @@ static unsigned char reg_unset_dummy; /* Make sure we have at least N more bytes of space in buffer. */ #define GET_BUFFER_SPACE(n) \ - while (buf_end - bufp->buffer + (n) > (ptrdiff_t) bufp->allocated) \ + while (b - bufp->buffer + (n) > bufp->allocated) \ EXTEND_BUFFER () /* Make sure we have one more byte of buffer space and then add C to it. */ #define BUF_PUSH(c) \ do { \ GET_BUFFER_SPACE (1); \ - *buf_end++ = (unsigned char) (c); \ + *b++ = (unsigned char) (c); \ } while (0) @@ -1620,8 +1591,8 @@ static unsigned char reg_unset_dummy; #define BUF_PUSH_2(c1, c2) \ do { \ GET_BUFFER_SPACE (2); \ - *buf_end++ = (unsigned char) (c1); \ - *buf_end++ = (unsigned char) (c2); \ + *b++ = (unsigned char) (c1); \ + *b++ = (unsigned char) (c2); \ } while (0) @@ -1629,9 +1600,9 @@ static unsigned char reg_unset_dummy; #define BUF_PUSH_3(c1, c2, c3) \ do { \ GET_BUFFER_SPACE (3); \ - *buf_end++ = (unsigned char) (c1); \ - *buf_end++ = (unsigned char) (c2); \ - *buf_end++ = (unsigned char) (c3); \ + *b++ = (unsigned char) (c1); \ + *b++ = (unsigned char) (c2); \ + *b++ = (unsigned char) (c3); \ } while (0) @@ -1644,15 +1615,13 @@ static unsigned char reg_unset_dummy; #define STORE_JUMP2(op, loc, to, arg) \ store_op2 (op, loc, (to) - (loc) - 3, arg) -/* Like `STORE_JUMP', but for inserting. Assume `buf_end' is the - buffer end. */ +/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */ #define INSERT_JUMP(op, loc, to) \ - insert_op1 (op, loc, (to) - (loc) - 3, buf_end) + insert_op1 (op, loc, (to) - (loc) - 3, b) -/* Like `STORE_JUMP2', but for inserting. Assume `buf_end' is the - buffer end. */ +/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */ #define INSERT_JUMP2(op, loc, to, arg) \ - insert_op2 (op, loc, (to) - (loc) - 3, arg, buf_end) + insert_op2 (op, loc, (to) - (loc) - 3, arg, b) /* This is not an arbitrary limit: the arguments which represent offsets @@ -1667,7 +1636,7 @@ static unsigned char reg_unset_dummy; being larger than MAX_BUF_SIZE, then flag memory exhausted. */ #define EXTEND_BUFFER() \ do { \ - re_char *old_buffer = bufp->buffer; \ + unsigned char *old_buffer = bufp->buffer; \ if (bufp->allocated == MAX_BUF_SIZE) \ return REG_ESIZE; \ bufp->allocated <<= 1; \ @@ -1679,7 +1648,7 @@ static unsigned char reg_unset_dummy; /* If the buffer moved, move all the pointers into it. */ \ if (old_buffer != bufp->buffer) \ { \ - buf_end = (buf_end - old_buffer) + bufp->buffer; \ + b = (b - old_buffer) + bufp->buffer; \ begalt = (begalt - old_buffer) + bufp->buffer; \ if (fixup_alt_jump) \ fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\ @@ -1736,7 +1705,7 @@ typedef struct /* Set the bit for character C in a bit vector. */ #define SET_LIST_BIT(c) \ - (buf_end[((unsigned char) (c)) / BYTEWIDTH] \ + (b[((unsigned char) (c)) / BYTEWIDTH] \ |= 1 << (((unsigned char) c) % BYTEWIDTH)) #ifdef MULE @@ -1793,35 +1762,34 @@ static void insert_op1 (re_opcode_t op, unsigned char *loc, int arg, unsigned char *end); static void insert_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end); -static re_bool at_begline_loc_p (re_char *pattern, re_char *p, +static boolean at_begline_loc_p (CONST char *pattern, CONST char *p, reg_syntax_t syntax); -static re_bool at_endline_loc_p (re_char *p, re_char *pend, int syntax); -static re_bool group_in_compile_stack (compile_stack_type compile_stack, +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 (re_char **p_ptr, re_char *pend, - RE_TRANSLATE_TYPE translate, - reg_syntax_t syntax, +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 (re_char **p_ptr, - re_char *pend, - RE_TRANSLATE_TYPE translate, +static reg_errcode_t compile_extended_range (CONST char **p_ptr, + CONST char *pend, + char *translate, reg_syntax_t syntax, Lisp_Object rtab); #endif /* MULE */ -static re_bool group_match_null_string_p (unsigned char **p, +static boolean group_match_null_string_p (unsigned char **p, unsigned char *end, register_info_type *reg_info); -static re_bool alt_match_null_string_p (unsigned char *p, unsigned char *end, +static boolean alt_match_null_string_p (unsigned char *p, unsigned char *end, register_info_type *reg_info); -static re_bool common_op_match_null_string_p (unsigned char **p, +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, - REGISTER int len, RE_TRANSLATE_TYPE translate); +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, - re_char *string1, int size1, - re_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 @@ -1840,11 +1808,11 @@ static fail_stack_type fail_stack; but never make them smaller. */ static int regs_allocated_size; -static re_char ** regstart, ** regend; -static re_char ** old_regstart, ** old_regend; -static re_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 re_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, @@ -1855,14 +1823,14 @@ regex_grow_registers (int num_regs) { if (num_regs > regs_allocated_size) { - RETALLOC_IF (regstart, num_regs, re_char *); - RETALLOC_IF (regend, num_regs, re_char *); - RETALLOC_IF (old_regstart, num_regs, re_char *); - RETALLOC_IF (old_regend, num_regs, re_char *); - RETALLOC_IF (best_regstart, num_regs, re_char *); - RETALLOC_IF (best_regend, num_regs, re_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, re_char *); + RETALLOC_IF (reg_dummy, num_regs, CONST char *); RETALLOC_IF (reg_info_dummy, num_regs, register_info_type); regs_allocated_size = num_regs; @@ -1894,7 +1862,7 @@ regex_grow_registers (int num_regs) return (free (compile_stack.stack), value) static reg_errcode_t -regex_compile (re_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 @@ -1906,20 +1874,20 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, REGISTER EMACS_INT c, c1; /* A random temporary spot in PATTERN. */ - re_char *p1; + CONST char *p1; /* Points to the end of the buffer, where we should append. */ - REGISTER unsigned char *buf_end; + REGISTER unsigned char *b; /* Keeps track of unclosed groups. */ compile_stack_type compile_stack; /* Points to the current (ending) position in the pattern. */ - re_char *p = pattern; - re_char *pend = pattern + size; + CONST char *p = pattern; + CONST char *pend = pattern + size; /* How to translate the characters in the pattern. */ - RE_TRANSLATE_TYPE translate = bufp->translate; + char *translate = bufp->translate; /* Address of the count-byte of the most recently inserted `exactn' command. This makes it possible to tell if a new exact-match @@ -1937,7 +1905,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, /* Place in the uncompiled pattern (i.e., the {) to which to go back if the interval is invalid. */ - re_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 @@ -1953,7 +1921,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, DEBUG_PRINT1 ("\nCompiling pattern: "); if (debug) { - int debug_count; + unsigned debug_count; for (debug_count = 0; debug_count < size; debug_count++) putchar (pattern[debug_count]); @@ -2004,7 +1972,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, bufp->allocated = INIT_BUF_SIZE; } - begalt = buf_end = bufp->buffer; + begalt = b = bufp->buffer; /* Loop through the uncompiled pattern until we're at the end. */ while (p != pend) @@ -2061,11 +2029,11 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, { /* true means zero/many matches are allowed. */ - re_bool zero_times_ok = c != '+'; - re_bool many_times_ok = c != '?'; + boolean zero_times_ok = c != '+'; + boolean many_times_ok = c != '?'; /* true means match shortest string possible. */ - re_bool minimal = false; + boolean minimal = false; /* If there is a sequence of repetition chars, collapse it down to just one (the right one). We can't combine @@ -2102,9 +2070,9 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, /* 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; @@ -2135,10 +2103,10 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, 9: end of pattern. */ GET_BUFFER_SPACE (6); - INSERT_JUMP (jump, laststart, buf_end + 3); - buf_end += 3; + INSERT_JUMP (jump, laststart, b + 3); + b += 3; INSERT_JUMP (on_failure_jump, laststart, laststart + 6); - buf_end += 3; + b += 3; } else if (zero_times_ok) { @@ -2149,10 +2117,10 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, 9: end of pattern. */ GET_BUFFER_SPACE (6); - INSERT_JUMP (jump, laststart, buf_end + 3); - buf_end += 3; - STORE_JUMP (on_failure_jump, buf_end, laststart + 3); - buf_end += 3; + INSERT_JUMP (jump, laststart, b + 3); + b += 3; + STORE_JUMP (on_failure_jump, b, laststart + 3); + b += 3; } else { @@ -2162,21 +2130,20 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, 6: end of pattern. */ GET_BUFFER_SPACE (3); - STORE_JUMP (on_failure_jump, buf_end, laststart); - buf_end += 3; + STORE_JUMP (on_failure_jump, b, laststart); + b += 3; } } else { /* Are we optimizing this jump? */ - re_bool keep_string_p = false; + boolean keep_string_p = false; if (many_times_ok) - { /* More than one repetition is allowed, so put in - at the end a backward relative jump from - `buf_end' to before the next jump we're going - to put in below (which jumps from laststart to - after this jump). + { /* More than one repetition is allowed, so put in at the + end a backward relative jump from `b' to before the next + jump we're going to put in below (which jumps from + laststart to after this jump). But if we are at the `*' in the exact sequence `.*\n', insert an unconditional jump backwards to the ., @@ -2194,30 +2161,29 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, character after the `*'. Do we have to do something analogous here for null bytes, because of RE_DOT_NOT_NULL? */ - if (*(p - 2) == '.' + if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') && zero_times_ok - && p < pend && *p == '\n' + && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') && !(syntax & RE_DOT_NEWLINE)) { /* We have .*\n. */ - STORE_JUMP (jump, buf_end, laststart); + STORE_JUMP (jump, b, laststart); keep_string_p = true; } else /* Anything else. */ - STORE_JUMP (maybe_pop_jump, buf_end, laststart - 3); + STORE_JUMP (maybe_pop_jump, b, laststart - 3); /* We've added more stuff to the buffer. */ - buf_end += 3; + b += 3; } - /* On failure, jump from laststart to buf_end + 3, - which will be the end of the buffer after this jump - is inserted. */ + /* On failure, jump from laststart to b + 3, which will be the + end of the buffer after this jump is inserted. */ GET_BUFFER_SPACE (3); INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump : on_failure_jump, - laststart, buf_end + 3); - buf_end += 3; + laststart, b + 3); + b += 3; if (!zero_times_ok) { @@ -2228,7 +2194,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, we hit that loop. */ GET_BUFFER_SPACE (3); INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6); - buf_end += 3; + b += 3; } } pending_exact = 0; @@ -2237,7 +2203,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, case '.': - laststart = buf_end; + laststart = b; BUF_PUSH (anychar); break; @@ -2245,9 +2211,9 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, case '[': { /* XEmacs change: this whole section */ - re_bool had_char_class = false; + boolean had_char_class = false; #ifdef MULE - re_bool has_extended_chars = false; + boolean has_extended_chars = false; REGISTER Lisp_Object rtab = Qnil; #endif @@ -2257,7 +2223,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, opcode, the length count, and the bitset; 34 bytes in all. */ GET_BUFFER_SPACE (34); - laststart = buf_end; + laststart = b; /* We test `*p == '^' twice, instead of using an if statement, so we only need one BUF_PUSH. */ @@ -2272,10 +2238,10 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); /* Clear the whole map. */ - memset (buf_end, 0, (1 << BYTEWIDTH) / BYTEWIDTH); + memset (b, 0, (1 << BYTEWIDTH) / BYTEWIDTH); /* charset_not matches newline according to a syntax bit. */ - if ((re_opcode_t) buf_end[-2] == charset_not + if ((re_opcode_t) b[-2] == charset_not && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) SET_LIST_BIT ('\n'); @@ -2285,18 +2251,18 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, { /* There are extended chars here, which means we need to start over and shift to unified range-table format. */ - if (buf_end[-2] == charset) - buf_end[-2] = charset_mule; + if (b[-2] == charset) + b[-2] = charset_mule; else - buf_end[-2] = charset_mule_not; - buf_end--; + b[-2] = charset_mule_not; + b--; p = p1; /* go back to the beginning of the charset, after a possible ^. */ rtab = Vthe_lisp_rangetab; Fclear_range_table (rtab); /* charset_not matches newline according to a syntax bit. */ - if ((re_opcode_t) buf_end[-1] == charset_mule_not + if ((re_opcode_t) b[-1] == charset_mule_not && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) SET_EITHER_BIT ('\n'); } @@ -2307,7 +2273,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, { if (p == pend) FREE_STACK_RETURN (REG_EBRACK); - PATFETCH (c); + PATFETCH_EITHER (c); #ifdef MULE if (c >= 0x80 && !has_extended_chars) @@ -2326,7 +2292,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, { if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); - PATFETCH (c1); + PATFETCH_EITHER (c1); #ifdef MULE if (c1 >= 0x80 && !has_extended_chars) { @@ -2355,7 +2321,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, operator. */ if (c == '-' && !(p - 2 >= pattern && p[-2] == '[') - && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') + && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') && *p != ']') { reg_errcode_t ret; @@ -2371,7 +2337,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, syntax, rtab); else #endif /* MULE */ - ret = compile_range (&p, pend, translate, syntax, buf_end); + ret = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); } @@ -2393,7 +2359,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, syntax, rtab); else #endif /* MULE */ - ret = compile_range (&p, pend, translate, syntax, buf_end); + ret = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); } @@ -2412,35 +2378,38 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, for (;;) { - /* #### This code is unused. - Correctness is not checked after TRT - table change. */ + /* Do not do PATFETCH_EITHER() here. We want + to just see if the bytes match particular + strings, and we put them all back if not. + + #### May need to be changed once trt tables + are working. */ PATFETCH (c); if (c == ':' || c == ']' || p == pend || c1 == CHAR_CLASS_MAX_LENGTH) break; - str[c1++] = (char) c; + str[c1++] = c; } str[c1] = '\0'; - /* If isn't a word bracketed by `[:' and `:]': + /* If isn't a word bracketed by `[:' and:`]': undo the ending character, the letters, and leave the leading `:' and `[' (but set bits for them). */ if (c == ':' && *p == ']') { int ch; - re_bool is_alnum = STREQ (str, "alnum"); - re_bool is_alpha = STREQ (str, "alpha"); - re_bool is_blank = STREQ (str, "blank"); - re_bool is_cntrl = STREQ (str, "cntrl"); - re_bool is_digit = STREQ (str, "digit"); - re_bool is_graph = STREQ (str, "graph"); - re_bool is_lower = STREQ (str, "lower"); - re_bool is_print = STREQ (str, "print"); - re_bool is_punct = STREQ (str, "punct"); - re_bool is_space = STREQ (str, "space"); - re_bool is_upper = STREQ (str, "upper"); - re_bool is_xdigit = STREQ (str, "xdigit"); + boolean is_alnum = STREQ (str, "alnum"); + boolean is_alpha = STREQ (str, "alpha"); + boolean is_blank = STREQ (str, "blank"); + boolean is_cntrl = STREQ (str, "cntrl"); + boolean is_digit = STREQ (str, "digit"); + boolean is_graph = STREQ (str, "graph"); + boolean is_lower = STREQ (str, "lower"); + boolean is_print = STREQ (str, "print"); + boolean is_punct = STREQ (str, "punct"); + boolean is_space = STREQ (str, "space"); + boolean is_upper = STREQ (str, "upper"); + boolean is_xdigit = STREQ (str, "xdigit"); if (!IS_CHAR_CLASS (str)) FREE_STACK_RETURN (REG_ECTYPE); @@ -2497,16 +2466,16 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, int bytes_needed = unified_range_table_bytes_needed (rtab); GET_BUFFER_SPACE (bytes_needed); - unified_range_table_copy_data (rtab, buf_end); - buf_end += unified_range_table_bytes_used (buf_end); + unified_range_table_copy_data (rtab, b); + b += unified_range_table_bytes_used (b); break; } #endif /* MULE */ /* Discard any (non)matching list bytes that are all 0 at the end of the map. Decrease the map-length byte too. */ - while ((int) buf_end[-1] > 0 && buf_end[buf_end[-1] - 1] == 0) - buf_end[-1]--; - buf_end += buf_end[-1]; + while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) + b[-1]--; + b += b[-1]; } break; @@ -2566,10 +2535,10 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, if (!(syntax & RE_NO_SHY_GROUPS) && p != pend - && *p == '?') + && TRANSLATE(*p) == TRANSLATE('?')) { p++; - PATFETCH (c); + PATFETCH(c); switch (c) { case ':': /* shy groups */ @@ -2603,7 +2572,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer; COMPILE_STACK_TOP.fixup_alt_jump = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; - COMPILE_STACK_TOP.laststart_offset = buf_end - bufp->buffer; + COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer; COMPILE_STACK_TOP.regnum = r; /* We will eventually replace the 0 with the number of @@ -2613,7 +2582,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, if (r <= MAX_REGNUM) { COMPILE_STACK_TOP.inner_group_offset - = buf_end - bufp->buffer + 2; + = b - bufp->buffer + 2; BUF_PUSH_3 (start_memory, r, 0); } @@ -2621,7 +2590,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, fixup_alt_jump = 0; laststart = 0; - begalt = buf_end; + begalt = b; /* If we've reached MAX_REGNUM groups, then this open won't actually generate any code, so we'll have to clear pending_exact explicitly. */ @@ -2650,7 +2619,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, /* We allocated space for this jump when we assigned to `fixup_alt_jump', in the `handle_alt' case below. */ - STORE_JUMP (jump_past_alt, fixup_alt_jump, buf_end - 1); + STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); } /* See similar code for backslashed left paren above. */ @@ -2708,9 +2677,9 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, /* Insert before the previous alternative a jump which jumps to this alternative if the former fails. */ GET_BUFFER_SPACE (3); - INSERT_JUMP (on_failure_jump, begalt, buf_end + 6); + INSERT_JUMP (on_failure_jump, begalt, b + 6); pending_exact = 0; - buf_end += 3; + b += 3; /* The alternative before this one has a jump after it which gets executed if it gets matched. Adjust that @@ -2729,17 +2698,17 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, bytes which we'll fill in when we get to after `c'. */ if (fixup_alt_jump) - STORE_JUMP (jump_past_alt, fixup_alt_jump, buf_end); + STORE_JUMP (jump_past_alt, fixup_alt_jump, b); /* Mark and leave space for a jump after this alternative, to be filled in later either by next alternative or when know we're at the end of a series of alternatives. */ - fixup_alt_jump = buf_end; + fixup_alt_jump = b; GET_BUFFER_SPACE (3); - buf_end += 3; + b += 3; laststart = 0; - begalt = buf_end; + begalt = b; break; @@ -2812,7 +2781,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, if (syntax & RE_CONTEXT_INVALID_OPS) FREE_STACK_RETURN (REG_BADRPT); else if (syntax & RE_CONTEXT_INDEP_OPS) - laststart = buf_end; + laststart = b; else goto unfetch_interval; } @@ -2823,8 +2792,8 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, if (upper_bound == 0) { GET_BUFFER_SPACE (3); - INSERT_JUMP (jump, laststart, buf_end + 3); - buf_end += 3; + INSERT_JUMP (jump, laststart, b + 3); + b += 3; } /* Otherwise, we have a nontrivial interval. When @@ -2839,7 +2808,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, else { /* If the upper bound is > 1, we need to insert more at the end of the loop. */ - Memory_count nbytes = 10 + (upper_bound > 1) * 10; + unsigned nbytes = 10 + (upper_bound > 1) * 10; GET_BUFFER_SPACE (nbytes); @@ -2849,16 +2818,16 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, because `re_compile_fastmap' needs to know. Jump to the `jump_n' we might insert below. */ INSERT_JUMP2 (succeed_n, laststart, - buf_end + 5 + (upper_bound > 1) * 5, + b + 5 + (upper_bound > 1) * 5, lower_bound); - buf_end += 5; + b += 5; /* Code to initialize the lower bound. Insert before the `succeed_n'. The `5' is the last two bytes of this `set_number_at', plus 3 bytes of the following `succeed_n'. */ - insert_op2 (set_number_at, laststart, 5, lower_bound, buf_end); - buf_end += 5; + insert_op2 (set_number_at, laststart, 5, lower_bound, b); + b += 5; if (upper_bound > 1) { /* More than one repetition is allowed, so @@ -2868,9 +2837,9 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, When we've reached this during matching, we'll have matched the interval once, so jump back only `upper_bound - 1' times. */ - STORE_JUMP2 (jump_n, buf_end, laststart + 5, + STORE_JUMP2 (jump_n, b, laststart + 5, upper_bound - 1); - buf_end += 5; + b += 5; /* The location we want to set is the second parameter of the `jump_n'; that is `b-2' as @@ -2886,10 +2855,9 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, We insert this at the beginning of the loop so that if we fail during matching, we'll reinitialize the bounds. */ - insert_op2 (set_number_at, laststart, - buf_end - laststart, - upper_bound - 1, buf_end); - buf_end += 5; + insert_op2 (set_number_at, laststart, b - laststart, + upper_bound - 1, b); + b += 5; } } pending_exact = 0; @@ -2921,7 +2889,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, break; case 's': - laststart = buf_end; + laststart = b; PATFETCH (c); /* XEmacs addition */ if (c >= 0x80 || syntax_spec_code[c] == 0377) @@ -2930,7 +2898,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, break; case 'S': - laststart = buf_end; + laststart = b; PATFETCH (c); /* XEmacs addition */ if (c >= 0x80 || syntax_spec_code[c] == 0377) @@ -2941,7 +2909,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, #ifdef MULE /* 97.2.17 jhod merged in to XEmacs from mule-2.3 */ case 'c': - laststart = buf_end; + laststart = b; PATFETCH_RAW (c); if (c < 32 || c > 127) FREE_STACK_RETURN (REG_ECATEGORY); @@ -2949,7 +2917,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, break; case 'C': - laststart = buf_end; + laststart = b; PATFETCH_RAW (c); if (c < 32 || c > 127) FREE_STACK_RETURN (REG_ECATEGORY); @@ -2961,13 +2929,13 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, case 'w': - laststart = buf_end; + laststart = b; BUF_PUSH (wordchar); break; case 'W': - laststart = buf_end; + laststart = b; BUF_PUSH (notwordchar); break; @@ -2998,23 +2966,20 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - { - regnum_t reg; - if (syntax & RE_NO_BK_REFS) - goto normal_char; + if (syntax & RE_NO_BK_REFS) + goto normal_char; - reg = c - '0'; + c1 = c - '0'; - if (reg > regnum) - FREE_STACK_RETURN (REG_ESUBREG); + if (c1 > regnum) + FREE_STACK_RETURN (REG_ESUBREG); - /* Can't back reference to a subexpression if inside of it. */ - if (group_in_compile_stack (compile_stack, reg)) - goto normal_char; + /* Can't back reference to a subexpression if inside of it. */ + if (group_in_compile_stack (compile_stack, c1)) + goto normal_char; - laststart = buf_end; - BUF_PUSH_2 (duplicate, reg); - } + laststart = b; + BUF_PUSH_2 (duplicate, c1); break; @@ -3043,13 +3008,14 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, { /* XEmacs: modifications here for Mule. */ /* `q' points to the beginning of the next char. */ - re_char *q = p; + CONST char *q = p - 1; + INC_CHARPTR (q); /* If no exactn currently being built. */ if (!pending_exact /* If last exactn not at current position. */ - || pending_exact + *pending_exact + 1 != buf_end + || pending_exact + *pending_exact + 1 != b /* We have only one byte following the exactn for the count. */ || ((unsigned int) (*pending_exact + (q - p)) >= @@ -3067,30 +3033,21 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, { /* Start building a new exactn. */ - laststart = buf_end; + laststart = b; BUF_PUSH_2 (exactn, 0); - pending_exact = buf_end - 1; + pending_exact = b - 1; } -#ifndef MULE BUF_PUSH (c); (*pending_exact)++; -#else - { - Bytecount bt_count; - Bufbyte tmp_buf[MAX_EMCHAR_LEN]; - int i; - - bt_count = set_charptr_emchar (tmp_buf, c); - for (i = 0; i < bt_count; i++) - { - BUF_PUSH (tmp_buf[i]); - (*pending_exact)++; - } - } -#endif + while (p < q) + { + PATFETCH (c); + BUF_PUSH (c); + (*pending_exact)++; + } break; } } /* switch (c) */ @@ -3100,7 +3057,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, /* Through the pattern now. */ if (fixup_alt_jump) - STORE_JUMP (jump_past_alt, fixup_alt_jump, buf_end); + STORE_JUMP (jump_past_alt, fixup_alt_jump, b); if (!COMPILE_STACK_EMPTY) FREE_STACK_RETURN (REG_EPAREN); @@ -3113,7 +3070,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, free (compile_stack.stack); /* We have succeeded; set the length of the buffer. */ - bufp->used = buf_end - bufp->buffer; + bufp->used = b - bufp->buffer; #ifdef DEBUG if (debug) @@ -3157,7 +3114,7 @@ regex_compile (re_char *pattern, int size, reg_syntax_t syntax, = (fail_stack_elt_t *) realloc (fail_stack.stack, (fail_stack.size * sizeof (fail_stack_elt_t))); -#endif /* emacs */ +#endif /* not emacs */ } regex_grow_registers (num_regs); @@ -3226,11 +3183,11 @@ insert_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2, after an alternative or a begin-subexpression. We assume there is at least one character before the ^. */ -static re_bool -at_begline_loc_p (re_char *pattern, re_char *p, reg_syntax_t syntax) +static boolean +at_begline_loc_p (CONST char *pattern, CONST char *p, reg_syntax_t syntax) { - re_char *prev = p - 2; - re_bool prev_prev_backslash = prev > pattern && prev[-1] == '\\'; + CONST char *prev = p - 2; + boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; return /* After a subexpression? */ @@ -3243,12 +3200,12 @@ at_begline_loc_p (re_char *pattern, re_char *p, reg_syntax_t syntax) /* The dual of at_begline_loc_p. This one is for $. We assume there is at least one character after the $, i.e., `P < PEND'. */ -static re_bool -at_endline_loc_p (re_char *p, re_char *pend, int syntax) +static boolean +at_endline_loc_p (CONST char *p, CONST char *pend, int syntax) { - re_char *next = p; - re_bool next_backslash = *next == '\\'; - re_char *next_next = p + 1 < pend ? p + 1 : 0; + CONST char *next = p; + boolean next_backslash = *next == '\\'; + CONST char *next_next = p + 1 < pend ? p + 1 : 0; return /* Before a subexpression? */ @@ -3263,7 +3220,7 @@ at_endline_loc_p (re_char *p, re_char *pend, int syntax) /* Returns true if REGNUM is in one of COMPILE_STACK's elements and false if it's not. */ -static re_bool +static boolean group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum) { int this_element; @@ -3290,12 +3247,12 @@ group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum) `regex_compile' itself. */ static reg_errcode_t -compile_range (re_char **p_ptr, re_char *pend, RE_TRANSLATE_TYPE translate, - reg_syntax_t syntax, unsigned char *buf_end) +compile_range (CONST char **p_ptr, CONST char *pend, char *translate, + reg_syntax_t syntax, unsigned char *b) { - Element_count this_char; + unsigned this_char; - re_char *p = *p_ptr; + CONST char *p = *p_ptr; int range_start, range_end; if (p == pend) @@ -3308,9 +3265,9 @@ compile_range (re_char **p_ptr, re_char *pend, RE_TRANSLATE_TYPE translate, 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. */ @@ -3335,17 +3292,16 @@ compile_range (re_char **p_ptr, re_char *pend, RE_TRANSLATE_TYPE translate, #ifdef MULE static reg_errcode_t -compile_extended_range (re_char **p_ptr, re_char *pend, - RE_TRANSLATE_TYPE 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 */ @@ -3359,7 +3315,7 @@ compile_extended_range (re_char **p_ptr, re_char *pend, return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; /* Can't have ranges spanning different charsets, except maybe for - ranges entirely within the first 256 chars. */ + ranges entirely witin the first 256 chars. */ if ((range_start >= 0x100 || range_end >= 0x100) && CHAR_LEADING_BYTE (range_start) != @@ -3415,7 +3371,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) #ifdef MATCH_MAY_ALLOCATE fail_stack_type fail_stack; #endif - DECLARE_DESTINATION; + DECLARE_DESTINATION /* We don't push any register information onto the failure stack. */ REGISTER char *fastmap = bufp->fastmap; @@ -3434,10 +3390,10 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) proven otherwise. We set this false at the bottom of switch statement, to which we get only if a particular path doesn't match the empty string. */ - re_bool path_can_be_null = true; + boolean path_can_be_null = true; /* We aren't doing a `succeed_n' to begin with. */ - re_bool succeed_n_p = false; + boolean succeed_n_p = false; assert (fastmap != NULL && p != NULL); @@ -3458,7 +3414,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) /* Reset for next path. */ path_can_be_null = true; - p = (unsigned char *) fail_stack.stack[--fail_stack.avail].pointer; + p = fail_stack.stack[--fail_stack.avail].pointer; continue; } @@ -3507,10 +3463,10 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) /* And all extended characters must be allowed, too. */ for (j = 0x80; j < 0xA0; j++) fastmap[j] = 1; -#else /* not MULE */ +#else /* ! MULE */ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) fastmap[j] = 1; -#endif /* MULE */ +#endif /* ! MULE */ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) @@ -3637,22 +3593,8 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) } #ifdef emacs - case wordbound: - case notwordbound: - case wordbeg: - case wordend: - case notsyntaxspec: - case syntaxspec: - /* This match depends on text properties. These end with - aborting optimizations. */ - bufp->can_be_null = 1; - goto done; - -#ifdef emacs -#if 0 /* Removed during syntax-table properties patch -- 2000/12/07 mct */ case syntaxspec: k = *p++; -#endif matchsyntax: #ifdef MULE for (j = 0; j < 0x80; j++) @@ -3681,21 +3623,19 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) } } } -#else /* not MULE */ +#else /* ! MULE */ for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX_UNSAFE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), j) == (enum syntaxcode) k) fastmap[j] = 1; -#endif /* MULE */ +#endif /* ! MULE */ break; -#if 0 /* Removed during syntax-table properties patch -- 2000/12/07 mct */ case notsyntaxspec: k = *p++; -#endif matchnotsyntax: #ifdef MULE for (j = 0; j < 0x80; j++) @@ -3724,16 +3664,15 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) } } } -#else /* not MULE */ +#else /* ! MULE */ for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX_UNSAFE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), j) != (enum syntaxcode) k) fastmap[j] = 1; -#endif /* MULE */ +#endif /* ! MULE */ break; -#endif /* emacs */ #ifdef MULE /* 97/2/17 jhod category patch */ @@ -3752,7 +3691,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) case at_dot: case after_dot: continue; -#endif /* emacs */ +#endif /* not emacs */ case no_op: @@ -3760,12 +3699,10 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) case endline: case begbuf: case endbuf: -#ifndef emacs case wordbound: case notwordbound: case wordbeg: case wordend: -#endif case push_dummy_failure: continue; @@ -3921,7 +3858,7 @@ re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs, 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, @@ -3964,21 +3901,19 @@ typedef int Charcount; stack overflow). */ int -re_search_2 (struct re_pattern_buffer *bufp, const char *str1, - int size1, const char *str2, 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; - re_char *string1 = (re_char *) str1; - re_char *string2 = (re_char *) str2; REGISTER char *fastmap = bufp->fastmap; - REGISTER RE_TRANSLATE_TYPE translate = bufp->translate; + REGISTER char *translate = bufp->translate; int total_size = size1 + size2; int endpos = startpos + range; #ifdef REGEX_BEGLINE_CHECK int anchored_at_begline = 0; #endif - re_char *d; + CONST unsigned char *d; Charcount d_size; /* Check for out-of-range STARTPOS. */ @@ -4000,24 +3935,12 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, return -1; else { - d = ((const unsigned char *) + d = ((CONST unsigned char *) (startpos >= size1 ? string2 - size1 : string1) + startpos); range = charcount_to_bytecount (d, 1); } } -#ifdef emacs - /* In a forward search for something that starts with \=. - don't keep searching past point. */ - if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0) - { - range = BUF_PT (regex_emacs_buffer) - BUF_BEGV (regex_emacs_buffer) - - startpos; - if (range < 0) - return -1; - } -#endif /* emacs */ - /* Update the fastmap now if not correct already. */ if (fastmap && !bufp->fastmap_accurate) if (re_compile_fastmap (bufp) == -2) @@ -4025,7 +3948,7 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, #ifdef REGEX_BEGLINE_CHECK { - unsigned long i = 0; + int i = 0; while (i < bufp->used) { @@ -4039,15 +3962,6 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, } #endif -#ifdef emacs - SETUP_SYNTAX_CACHE_FOR_OBJECT (regex_match_object, - regex_emacs_buffer, - SYNTAX_CACHE_OBJECT_BYTE_TO_CHAR (regex_match_object, - regex_emacs_buffer, - startpos), - 1); -#endif - /* Loop through the string, looking for a place to start matching. */ for (;;) { @@ -4066,13 +3980,17 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, 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); - if (TRANSLATE_P (translate)) - while (range > lim && *d != '\n') + if (translate) +#ifdef MULE + while (range > lim && (*d >= 0x80 || translate[*d] != '\n')) +#else + while (range > lim && translate[*d] != '\n') +#endif { d += d_size; /* Speedier INC_CHARPTR(d) */ d_size = charcount_to_bytecount (d, 1); @@ -4104,25 +4022,18 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, 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' inside the loop. */ - if (TRANSLATE_P (translate)) - while (range > lim) - { + if (translate) + while (range > lim && #ifdef MULE - Emchar buf_ch; - - buf_ch = charptr_emchar (d); - buf_ch = RE_TRANSLATE (buf_ch); - if (buf_ch >= 0200 || fastmap[(unsigned char) buf_ch]) - break; -#else - if (fastmap[(unsigned char)RE_TRANSLATE (*d)]) - break; -#endif /* MULE */ + *d < 0x80 && +#endif + !fastmap[(unsigned char)translate[*d]]) + { d_size = charcount_to_bytecount (d, 1); range -= d_size; d += d_size; /* Speedier INC_CHARPTR(d) */ @@ -4139,17 +4050,15 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, } else /* Searching backwards. */ { - Emchar c = (size1 == 0 || startpos >= size1 - ? charptr_emchar (string2 + startpos - size1) - : charptr_emchar (string1 + startpos)); - c = TRANSLATE (c); + unsigned char c = (size1 == 0 || startpos >= size1 + ? string2[startpos - size1] + : string1[startpos]); #ifdef MULE - if (!(c >= 0200 || fastmap[(unsigned char) c])) - goto advance; + if (c < 0x80 && !fastmap[(unsigned char) TRANSLATE (c)]) #else - if (!fastmap[(unsigned char) c]) - goto advance; + if (!fastmap[(unsigned char) TRANSLATE (c)]) #endif + goto advance; } } @@ -4181,7 +4090,7 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, 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; @@ -4191,7 +4100,7 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, { /* 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); @@ -4217,7 +4126,7 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, /* Call before fetching a character with *d. This switches over to string2 if necessary. */ -#define REGEX_PREFETCH() \ +#define PREFETCH() \ while (d == dend) \ { \ /* End of string2 => fail. */ \ @@ -4262,9 +4171,9 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, FREE_VAR (reg_dummy); \ FREE_VAR (reg_info_dummy); \ } while (0) -#else /* not MATCH_MAY_ALLOCATE */ +#else #define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */ -#endif /* MATCH_MAY_ALLOCATE */ +#endif /* not MATCH_MAY_ALLOCATE */ /* These values must meet several constraints. They must not be valid register values; since we have a limit of 255 registers (because @@ -4282,10 +4191,10 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, /* 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, (re_char *) string, size, + int result = re_match_2_internal (bufp, NULL, 0, string, size, pos, regs, size); alloca (0); return result; @@ -4307,25 +4216,12 @@ re_match (struct re_pattern_buffer *bufp, const char *string, int size, 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; - -#ifdef emacs - SETUP_SYNTAX_CACHE_FOR_OBJECT (regex_match_object, - regex_emacs_buffer, - SYNTAX_CACHE_OBJECT_BYTE_TO_CHAR (regex_match_object, - regex_emacs_buffer, - pos), - 1); -#endif - - result = re_match_2_internal (bufp, (re_char *) string1, size1, - (re_char *) string2, size2, - pos, regs, stop); - + int result = re_match_2_internal (bufp, string1, size1, string2, size2, + pos, regs, stop); alloca (0); return result; } @@ -4333,8 +4229,8 @@ re_match_2 (struct re_pattern_buffer *bufp, const char *string1, /* 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, re_char *string1, - int size1, re_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. */ @@ -4343,14 +4239,14 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, int should_succeed; /* XEmacs change */ /* Just past the end of the corresponding string. */ - re_char *end1, *end2; + CONST char *end1, *end2; /* Pointers into string1 and string2, just past the last characters in each to consider matching. */ - re_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. */ - re_char *d, *dend; + CONST char *d, *dend; /* Where we are in the pattern, and the end of the pattern. */ unsigned char *p = bufp->buffer; @@ -4358,10 +4254,10 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, /* Mark the opcode just after a start_memory, so we can test for an empty subpattern when we get to the stop_memory. */ - re_char *just_past_start_mem = 0; + unsigned char *just_past_start_mem = 0; /* We use this to map every character in the string. */ - RE_TRANSLATE_TYPE translate = bufp->translate; + char *translate = bufp->translate; /* Failure point stack. Each place that can handle a failure further down the line pushes a failure point on this stack. It consists of @@ -4377,7 +4273,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, #endif #ifdef DEBUG static unsigned failure_id; - int nfailure_points_pushed = 0, nfailure_points_popped = 0; + unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0; #endif #ifdef REL_ALLOC @@ -4389,11 +4285,11 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, /* We fill all the registers internally, independent of what we return, for use in backreferences. The number here includes an element for register zero. */ - int num_regs = bufp->re_nsub + 1; + unsigned num_regs = bufp->re_nsub + 1; /* The currently active registers. */ - int lowest_active_reg = NO_LOWEST_ACTIVE_REG; - int highest_active_reg = NO_HIGHEST_ACTIVE_REG; + unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG; + unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG; /* Information on the contents of registers. These are pointers into the input strings; they record just what was matched (on this @@ -4403,7 +4299,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, 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. */ - re_char **regstart, **regend; + CONST char **regstart, **regend; #endif /* If a group that's operated upon by a repetition operator fails to @@ -4412,7 +4308,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, are when we last see its open-group operator. Similarly for a register's end. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ - re_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 @@ -4431,7 +4327,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, 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. */ - re_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 @@ -4442,14 +4338,14 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, 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. */ - re_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. */ - re_char **reg_dummy; + CONST char **reg_dummy; register_info_type *reg_info_dummy; #endif @@ -4460,10 +4356,10 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, /* 1 if this match ends in the same string (string1 or string2) as the best previous match. */ - re_bool same_str_p; + boolean same_str_p; /* 1 if this match is the best seen so far. */ - re_bool best_match_p; + boolean best_match_p; DEBUG_PRINT1 ("\n\nEntering re_match_2.\n"); @@ -4477,14 +4373,14 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, array indexing. We should fix this. */ if (bufp->re_nsub) { - regstart = REGEX_TALLOC (num_regs, re_char *); - regend = REGEX_TALLOC (num_regs, re_char *); - old_regstart = REGEX_TALLOC (num_regs, re_char *); - old_regend = REGEX_TALLOC (num_regs, re_char *); - best_regstart = REGEX_TALLOC (num_regs, re_char *); - best_regend = REGEX_TALLOC (num_regs, re_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, re_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 @@ -4524,6 +4420,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, MATCHED_SOMETHING (reg_info[mcnt]) = 0; EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0; } + /* We move `string1' into `string2' if the latter's empty -- but not if `string1' is null. */ if (size2 == 0 && string1 != NULL) @@ -4565,7 +4462,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, dend = end_match_2; } - DEBUG_PRINT1 ("The compiled pattern is: \n"); + DEBUG_PRINT1 ("The compiled pattern is: "); DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); DEBUG_PRINT1 ("The string to match is: `"); DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); @@ -4576,7 +4473,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, fails at this starting point in the input data. */ for (;;) { - DEBUG_PRINT2 ("\n0x%lx: ", (long) p); + DEBUG_PRINT2 ("\n0x%p: ", p); #ifdef emacs /* XEmacs added, w/removal of immediate_quit */ if (!no_quit_in_re_search) QUIT; @@ -4716,23 +4613,15 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]); } } - } /* regs && !bufp->no_sub */ - - /* If we have regs and the regs structure has more elements than - were in the pattern, set the extra elements to -1. If we - (re)allocated the registers, this is the case, because we - always allocate enough to have at least one -1 at the end. - - We do this even when no_sub is set because some applications - (XEmacs) reuse register structures which may contain stale - information, and permit attempts to access those registers. - It would be possible to require the caller to do this, but we'd - have to change the API for this function to reflect that, and - audit all callers. */ - if (regs && regs->num_regs > 0) - for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++) - regs->start[mcnt] = regs->end[mcnt] = -1; + /* If the regs structure we return has more elements than + were in the pattern, set the extra elements to -1. If + we (re)allocated the registers, this is the case, + because we always allocate enough to have at least one + -1 at the end. */ + for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++) + regs->start[mcnt] = regs->end[mcnt] = -1; + } /* regs && !bufp->no_sub */ DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n", nfailure_points_pushed, nfailure_points_popped, @@ -4771,40 +4660,22 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, /* This is written out as an if-else so we don't waste time testing `translate' inside the loop. */ - if (TRANSLATE_P (translate)) + if (translate) { do { -#ifdef MULE - Emchar pat_ch, buf_ch; - Bytecount pat_len; - - REGEX_PREFETCH (); - pat_ch = charptr_emchar (p); - buf_ch = charptr_emchar (d); - if (RE_TRANSLATE (buf_ch) != pat_ch) - goto fail; - - pat_len = charcount_to_bytecount (p, 1); - p += pat_len; - INC_CHARPTR (d); - - mcnt -= pat_len; -#else /* not MULE */ - REGEX_PREFETCH (); - if ((unsigned char) RE_TRANSLATE (*d++) != *p++) + PREFETCH (); + if (translate[(unsigned char) *d++] != (char) *p++) goto fail; - mcnt--; -#endif } - while (mcnt > 0); + while (--mcnt); } else { do { - REGEX_PREFETCH (); - if (*d++ != *p++) goto fail; + PREFETCH (); + if (*d++ != (char) *p++) goto fail; } while (--mcnt); } @@ -4816,7 +4687,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, case anychar: DEBUG_PRINT1 ("EXECUTING anychar.\n"); - REGEX_PREFETCH (); + PREFETCH (); if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n') || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000')) @@ -4832,22 +4703,22 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, case charset_not: { REGISTER unsigned char c; - re_bool not_p = (re_opcode_t) *(p - 1) == charset_not; + boolean not = (re_opcode_t) *(p - 1) == charset_not; - DEBUG_PRINT2 ("EXECUTING charset%s.\n", not_p ? "_not" : ""); + DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); - REGEX_PREFETCH (); + PREFETCH (); c = TRANSLATE (*d); /* The character to match. */ /* Cast to `unsigned' instead of `unsigned char' in case the bit list is a full 32 bytes long. */ if (c < (unsigned) (*p * BYTEWIDTH) && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) - not_p = !not_p; + not = !not; p += 1 + *p; - if (!not_p) goto fail; + if (!not) goto fail; SET_REGS_MATCHED (); INC_CHARPTR (d); /* XEmacs change */ @@ -4859,20 +4730,20 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, case charset_mule_not: { REGISTER Emchar c; - re_bool not_p = (re_opcode_t) *(p - 1) == charset_mule_not; + boolean not = (re_opcode_t) *(p - 1) == charset_mule_not; - DEBUG_PRINT2 ("EXECUTING charset_mule%s.\n", not_p ? "_not" : ""); + DEBUG_PRINT2 ("EXECUTING charset_mule%s.\n", not ? "_not" : ""); - REGEX_PREFETCH (); - c = charptr_emchar ((const Bufbyte *) d); + PREFETCH (); + 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))) - not_p = !not_p; + not = !not; p += unified_range_table_bytes_used (p); - if (!not_p) goto fail; + if (!not) goto fail; SET_REGS_MATCHED (); INC_CHARPTR (d); @@ -4986,16 +4857,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, highest_active_reg = NO_HIGHEST_ACTIVE_REG; } else - { - highest_active_reg = r; - - /* 98/9/21 jhod: We've also gotta set lowest_active_reg, don't we? */ - r = 1; - while (r < highest_active_reg && !IS_ACTIVE(reg_info[r])) - r++; - lowest_active_reg = r; - } - } + highest_active_reg = r; + } /* If just failed to match something this time around with a group that's operated on by a repetition operator, try to @@ -5006,7 +4869,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, || just_past_start_mem == p - 1) && (p + 2) < pend) { - re_bool is_a_jump_n = false; + boolean is_a_jump_n = false; p1 = p + 2; mcnt = 0; @@ -5048,7 +4911,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, if (EVER_MATCHED_SOMETHING (reg_info[*p])) { - int r; + unsigned r; EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; @@ -5079,7 +4942,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, followed by the numeric value of <digit> as the register number. */ case duplicate: { - REGISTER re_char *d2, *dend2; + REGISTER CONST char *d2, *dend2; int regno = *p++; /* Get which register to match against. */ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); @@ -5115,7 +4978,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, if (d2 == dend2) break; /* If necessary, advance to next segment in data. */ - REGEX_PREFETCH (); + PREFETCH (); /* How many characters left in this segment to match. */ mcnt = dend - d; @@ -5127,7 +4990,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, /* Compare that many; failure if mismatch, else move past them. */ - if (TRANSLATE_P (translate) + if (translate ? bcmp_translate ((unsigned char *) d, (unsigned char *) d2, mcnt, translate) : memcmp (d, d2, mcnt)) @@ -5213,9 +5076,9 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); - DEBUG_PRINT3 (" %d (to 0x%lx):\n", mcnt, (long) (p + mcnt)); + DEBUG_PRINT3 (" %d (to 0x%p):\n", mcnt, p + mcnt); - PUSH_FAILURE_POINT (p + mcnt, (unsigned char *) 0, -2); + PUSH_FAILURE_POINT (p + mcnt, (char *) 0, -2); break; @@ -5236,7 +5099,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, DEBUG_PRINT1 ("EXECUTING on_failure_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); - DEBUG_PRINT3 (" %d (to 0x%lx)", mcnt, (long) (p + mcnt)); + DEBUG_PRINT3 (" %d (to 0x%p)", mcnt, p + mcnt); /* If this on_failure_jump comes right before a group (i.e., the original * applied to a group), save the information @@ -5342,15 +5205,15 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, else if ((re_opcode_t) p1[3] == charset || (re_opcode_t) p1[3] == charset_not) { - int not_p = (re_opcode_t) p1[3] == charset_not; + int not = (re_opcode_t) p1[3] == charset_not; if (c < (unsigned char) (p1[4] * BYTEWIDTH) && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) - not_p = !not_p; + not = !not; - /* `not_p' is equal to 1 if c would match, which means + /* `not' is equal to 1 if c would match, which means that we can't change to pop_failure_jump. */ - if (!not_p) + if (!not) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); @@ -5433,9 +5296,9 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, actual values. Otherwise, we will restore only one register from the stack, since lowest will == highest in `pop_failure_point'. */ - int dummy_low_reg, dummy_high_reg; + unsigned dummy_low_reg, dummy_high_reg; unsigned char *pdummy; - re_char *sdummy = NULL; + CONST char *sdummy = NULL; DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); POP_FAILURE_POINT (sdummy, pdummy, @@ -5451,7 +5314,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); p += mcnt; /* Do the jump. */ - DEBUG_PRINT2 ("(to 0x%lx).\n", (long) p); + DEBUG_PRINT2 ("(to 0x%p).\n", p); break; @@ -5471,7 +5334,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n"); /* It doesn't matter what we push for the string here. What the code at `fail' tests is the value for the pattern. */ - PUSH_FAILURE_POINT ((unsigned char *) 0, (unsigned char *) 0, -2); + PUSH_FAILURE_POINT ((unsigned char *) 0, (char *) 0, -2); goto unconditional_jump; @@ -5484,7 +5347,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n"); /* See comments just above at `dummy_failure_jump' about the two zeroes. */ - PUSH_FAILURE_POINT ((unsigned char *) 0, (unsigned char *) 0, -2); + PUSH_FAILURE_POINT ((unsigned char *) 0, (char *) 0, -2); break; /* Have to succeed matching what follows at least n times. @@ -5500,12 +5363,11 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, mcnt--; p += 2; STORE_NUMBER_AND_INCR (p, mcnt); - DEBUG_PRINT3 (" Setting 0x%lx to %d.\n", (long) p, mcnt); + DEBUG_PRINT3 (" Setting 0x%p to %d.\n", p, mcnt); } else if (mcnt == 0) { - DEBUG_PRINT2 (" Setting two bytes from 0x%lx to no_op.\n", - (long) (p+2)); + DEBUG_PRINT2 (" Setting two bytes from 0x%p to no_op.\n", p+2); p[2] = (unsigned char) no_op; p[3] = (unsigned char) no_op; goto on_failure; @@ -5535,7 +5397,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, EXTRACT_NUMBER_AND_INCR (mcnt, p); p1 = p + mcnt; EXTRACT_NUMBER_AND_INCR (mcnt, p); - DEBUG_PRINT3 (" Setting 0x%lx to %d.\n", (long) p1, mcnt); + DEBUG_PRINT3 (" Setting 0x%p to %d.\n", p1, mcnt); STORE_NUMBER (p1, mcnt); break; } @@ -5551,34 +5413,17 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, result = 1; else { - re_char *d_before = POS_BEFORE_GAP_UNSAFE (d); - re_char *d_after = POS_AFTER_GAP_UNSAFE (d); - - /* emch1 is the character before d, syn1 is the syntax of emch1, - emch2 is the character at d, and syn2 is the syntax of emch2. */ + 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; - int syn1, syn2; -#ifdef emacs - int pos_before; -#endif DEC_CHARPTR (d_before); emch1 = charptr_emchar (d_before); emch2 = charptr_emchar (d_after); - -#ifdef emacs - pos_before = SYNTAX_CACHE_BYTE_TO_CHAR (PTR_TO_OFFSET (d)) - 1; - UPDATE_SYNTAX_CACHE (pos_before); -#endif - syn1 = SYNTAX_FROM_CACHE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), - emch1); -#ifdef emacs - UPDATE_SYNTAX_CACHE_FORWARD (pos_before + 1); -#endif - syn2 = SYNTAX_FROM_CACHE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), - emch2); - - result = ((syn1 == Sword) != (syn2 == Sword)); + result = (WORDCHAR_P_UNSAFE (emch1) != + WORDCHAR_P_UNSAFE (emch2)); } if (result == should_succeed) break; @@ -5592,8 +5437,6 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, case wordbeg: DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); - if (AT_STRINGS_END (d)) - goto fail; { /* XEmacs: this originally read: @@ -5601,33 +5444,23 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, break; */ - re_char *dtmp = POS_AFTER_GAP_UNSAFE (d); + CONST unsigned char *dtmp = + (CONST unsigned char *) POS_AFTER_GAP_UNSAFE (d); Emchar emch = charptr_emchar (dtmp); -#ifdef emacs - int charpos = SYNTAX_CACHE_BYTE_TO_CHAR (PTR_TO_OFFSET (d)); - UPDATE_SYNTAX_CACHE (charpos); -#endif - if (SYNTAX_FROM_CACHE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), - emch) != Sword) + if (!WORDCHAR_P_UNSAFE (emch)) goto fail; if (AT_STRINGS_BEG (d)) break; - dtmp = POS_BEFORE_GAP_UNSAFE (d); + dtmp = (CONST unsigned char *) POS_BEFORE_GAP_UNSAFE (d); DEC_CHARPTR (dtmp); emch = charptr_emchar (dtmp); -#ifdef emacs - UPDATE_SYNTAX_CACHE_BACKWARD (charpos - 1); -#endif - if (SYNTAX_FROM_CACHE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), - emch) != Sword) + if (!WORDCHAR_P_UNSAFE (emch)) break; goto fail; } case wordend: DEBUG_PRINT1 ("EXECUTING wordend.\n"); - if (AT_STRINGS_BEG (d)) - goto fail; { /* XEmacs: this originally read: @@ -5637,27 +5470,20 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, The or condition is incorrect (reversed). */ - re_char *dtmp; + CONST unsigned char *dtmp; Emchar emch; -#ifdef emacs - int charpos = SYNTAX_CACHE_BYTE_TO_CHAR (PTR_TO_OFFSET (d)) - 1; - UPDATE_SYNTAX_CACHE (charpos); -#endif - dtmp = POS_BEFORE_GAP_UNSAFE (d); + if (AT_STRINGS_BEG (d)) + goto fail; + dtmp = (CONST unsigned char *) POS_BEFORE_GAP_UNSAFE (d); DEC_CHARPTR (dtmp); emch = charptr_emchar (dtmp); - if (SYNTAX_FROM_CACHE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), - emch) != Sword) + if (!WORDCHAR_P_UNSAFE (emch)) goto fail; if (AT_STRINGS_END (d)) break; - dtmp = POS_AFTER_GAP_UNSAFE (d); + dtmp = (CONST unsigned char *) POS_AFTER_GAP_UNSAFE (d); emch = charptr_emchar (dtmp); -#ifdef emacs - UPDATE_SYNTAX_CACHE_FORWARD (charpos + 1); -#endif - if (SYNTAX_FROM_CACHE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), - emch) != Sword) + if (!WORDCHAR_P_UNSAFE (emch)) break; goto fail; } @@ -5665,25 +5491,22 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, #ifdef emacs case before_dot: DEBUG_PRINT1 ("EXECUTING before_dot.\n"); - if (! (NILP (regex_match_object) || BUFFERP (regex_match_object)) - || (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d) - >= BUF_PT (regex_emacs_buffer))) + if (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d) >= + BUF_PT (regex_emacs_buffer)) goto fail; break; case at_dot: DEBUG_PRINT1 ("EXECUTING at_dot.\n"); - if (! (NILP (regex_match_object) || BUFFERP (regex_match_object)) - || (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d) - != BUF_PT (regex_emacs_buffer))) + if (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d) + != BUF_PT (regex_emacs_buffer)) goto fail; break; case after_dot: DEBUG_PRINT1 ("EXECUTING after_dot.\n"); - if (! (NILP (regex_match_object) || BUFFERP (regex_match_object)) - || (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d) - <= BUF_PT (regex_emacs_buffer))) + if (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d) + <= BUF_PT (regex_emacs_buffer)) goto fail; break; #if 0 /* not emacs19 */ @@ -5710,16 +5533,10 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, int matches; Emchar emch; - REGEX_PREFETCH (); -#ifdef emacs - { - int charpos = SYNTAX_CACHE_BYTE_TO_CHAR (PTR_TO_OFFSET (d)); - UPDATE_SYNTAX_CACHE (charpos); - } -#endif - - emch = charptr_emchar ((const Bufbyte *) d); - matches = (SYNTAX_FROM_CACHE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), + PREFETCH (); + emch = charptr_emchar ((CONST Bufbyte *) d); + matches = (SYNTAX_UNSAFE + (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), emch) == (enum syntaxcode) mcnt); INC_CHARPTR (d); if (matches != should_succeed) @@ -5749,8 +5566,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, Emchar emch; mcnt = *p++; - REGEX_PREFETCH (); - emch = charptr_emchar ((const Bufbyte *) d); + PREFETCH (); + emch = charptr_emchar ((CONST Bufbyte *) d); INC_CHARPTR (d); if (check_category_char(emch, regex_emacs_buffer->category_table, mcnt, should_succeed)) @@ -5767,7 +5584,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, #else /* not emacs */ case wordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n"); - REGEX_PREFETCH (); + PREFETCH (); if (!WORDCHAR_P_UNSAFE ((int) (*d))) goto fail; SET_REGS_MATCHED (); @@ -5776,13 +5593,13 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, case notwordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n"); - REGEX_PREFETCH (); + PREFETCH (); if (!WORDCHAR_P_UNSAFE ((int) (*d))) goto fail; SET_REGS_MATCHED (); d++; break; -#endif /* emacs */ +#endif /* not emacs */ default: abort (); @@ -5807,7 +5624,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, assert (p <= pend); if (p < pend) { - re_bool is_a_jump_n = false; + boolean is_a_jump_n = false; /* If failed to a backwards jump that's part of a repetition loop, need to pop this failure point and use the next one. */ @@ -5860,7 +5677,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, We don't handle duplicates properly (yet). */ -static re_bool +static boolean group_match_null_string_p (unsigned char **p, unsigned char *end, register_info_type *reg_info) { @@ -5968,7 +5785,7 @@ group_match_null_string_p (unsigned char **p, unsigned char *end, It expects P to be the first byte of a single alternative and END one byte past the last. The alternative can contain groups. */ -static re_bool +static boolean alt_match_null_string_p (unsigned char *p, unsigned char *end, register_info_type *reg_info) { @@ -6004,12 +5821,12 @@ alt_match_null_string_p (unsigned char *p, unsigned char *end, Sets P to one after the op and its arguments, if any. */ -static re_bool +static boolean common_op_match_null_string_p (unsigned char **p, unsigned char *end, register_info_type *reg_info) { int mcnt; - re_bool ret; + boolean ret; int reg_no; unsigned char *p1 = *p; @@ -6092,34 +5909,15 @@ common_op_match_null_string_p (unsigned char **p, unsigned char *end, bytes; nonzero otherwise. */ static int -bcmp_translate (re_char *s1, re_char *s2, - REGISTER int len, RE_TRANSLATE_TYPE translate) +bcmp_translate (CONST unsigned char *s1, CONST unsigned char *s2, + REGISTER int len, char *translate) { - REGISTER const unsigned char *p1 = s1, *p2 = s2; -#ifdef MULE - const unsigned char *p1_end = s1 + len; - const unsigned char *p2_end = s2 + len; - - while (p1 != p1_end && p2 != p2_end) - { - Emchar p1_ch, p2_ch; - - p1_ch = charptr_emchar (p1); - p2_ch = charptr_emchar (p2); - - if (RE_TRANSLATE (p1_ch) - != RE_TRANSLATE (p2_ch)) - return 1; - INC_CHARPTR (p1); - INC_CHARPTR (p2); - } -#else /* not MULE */ + REGISTER CONST unsigned char *p1 = s1, *p2 = s2; while (len) { - if (RE_TRANSLATE (*p1++) != RE_TRANSLATE (*p2++)) return 1; + if (translate[*p1++] != translate[*p2++]) return 1; len--; } -#endif /* MULE */ return 0; } @@ -6134,8 +5932,8 @@ bcmp_translate (re_char *s1, re_char *s2, 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; @@ -6152,7 +5950,7 @@ re_compile_pattern (const char *pattern, int length, /* Match anchors at newline. */ bufp->newline_anchor = 1; - ret = regex_compile ((unsigned char *) pattern, length, re_syntax_options, bufp); + ret = regex_compile (pattern, length, re_syntax_options, bufp); if (!ret) return NULL; @@ -6168,7 +5966,7 @@ re_compile_pattern (const char *pattern, int length, static struct re_pattern_buffer re_comp_buf; char * -re_comp (const char *s) +re_comp (CONST char *s) { reg_errcode_t ret; @@ -6197,20 +5995,20 @@ re_comp (const char *s) /* Match anchors at newlines. */ re_comp_buf.newline_anchor = 1; - ret = regex_compile ((unsigned char *)s, strlen (s), re_syntax_options, &re_comp_buf); + ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); 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); } @@ -6255,7 +6053,7 @@ re_exec (const char *s) 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 @@ -6303,7 +6101,7 @@ regcomp (regex_t *preg, const char *pattern, int cflags) /* POSIX says a null character in the pattern terminates it, so we can use strlen here in compiling the pattern. */ - ret = regex_compile ((unsigned char *) pattern, strlen (pattern), syntax, preg); + ret = regex_compile (pattern, strlen (pattern), syntax, preg); /* POSIX doesn't distinguish between an unmatched open-group and an unmatched close-group: both are REG_EPAREN. */ @@ -6328,14 +6126,14 @@ regcomp (regex_t *preg, const char *pattern, int cflags) We return 0 if we find a match and REG_NOMATCH if not. */ int -regexec (const regex_t *preg, const char *string, Element_count nmatch, +regexec (CONST regex_t *preg, CONST char *string, size_t nmatch, regmatch_t pmatch[], int eflags) { int ret; struct re_registers regs; regex_t private_preg; int len = strlen (string); - re_bool want_reg_info = !preg->no_sub && nmatch > 0; + boolean want_reg_info = !preg->no_sub && nmatch > 0; private_preg = *preg; @@ -6366,7 +6164,7 @@ regexec (const regex_t *preg, const char *string, Element_count nmatch, { if (ret >= 0) { - Element_count r; + unsigned r; for (r = 0; r < nmatch; r++) { @@ -6388,16 +6186,14 @@ regexec (const regex_t *preg, const char *string, Element_count nmatch, /* Returns a message corresponding to an error code, ERRCODE, returned from either regcomp or regexec. We don't use PREG here. */ -Memory_count -regerror (int errcode, const regex_t *preg, char *errbuf, - Memory_count errbuf_size) +size_t +regerror (int errcode, CONST regex_t *preg, char *errbuf, size_t errbuf_size) { - const char *msg; - Memory_count msg_size; + CONST char *msg; + size_t msg_size; if (errcode < 0 - || (size_t) errcode >= (sizeof (re_error_msgid) - / sizeof (re_error_msgid[0]))) + || errcode >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0]))) /* Only error codes returned by the rest of the code should be passed to this routine. If we are given anything else, or if other regex code generates an invalid error code, then the program has a bug. diff --git a/src/s/darwin.h b/src/s/darwin.h new file mode 100644 index 0000000..5ba6d03 --- /dev/null +++ b/src/s/darwin.h @@ -0,0 +1,18 @@ +/* s/ file for Darwin/MacOS X systems */ + +#define SYSTEM_TYPE "darwin" + +/* Defines this as a BSD system, used in fakemail, for example */ +#ifndef NOT_C_CODE +#include <sys/param.h> +#endif + +/* The builtin malloc is broken in the sense that replacing it + with a user implementation is impossible. */ +#define SYSTEM_MALLOC + +#define HAVE_PTYS + +/* TAB3 is defined in Unix98, but darwin doesn't have it. + OXTABS is the traditional BSD equivalent. */ +#define TAB3 OXTABS diff --git a/src/s/mingw32.h b/src/s/mingw32.h index 3e56d9e..4f0fd96 100644 --- a/src/s/mingw32.h +++ b/src/s/mingw32.h @@ -20,20 +20,27 @@ Boston, MA 02111-1307, USA. */ /* 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 @@ Boston, MA 02111-1307, USA. */ #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,20 +61,42 @@ Boston, MA 02111-1307, USA. */ #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 + * 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 /* System calls that are encapsulated */ #define ENCAPSULATE_RENAME #define ENCAPSULATE_OPEN #define ENCAPSULATE_FOPEN #define ENCAPSULATE_MKDIR -#define ENCAPSULATE_STAT -#define ENCAPSULATE_FSTAT -/* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT - since there is no load average available. */ +/* 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) /* Define VIRT_ADDR_VARIES if the virtual addresses of pure and impure space as loaded can vary, and even their @@ -81,6 +108,10 @@ Boston, MA 02111-1307, USA. */ /* 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 @@ -118,7 +149,7 @@ Boston, MA 02111-1307, USA. */ /* 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:" @@ -133,10 +164,19 @@ Boston, MA 02111-1307, USA. */ #ifndef NOT_C_CODE #include <stdlib.h> -#include <../mingw/process.h> +#include <mingw32/process.h> #define mkdir __mkdir #include <dir.h> #undef mkdir +#ifdef HAVE_CYGWIN_VERSION_H +#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 @@ -149,8 +189,8 @@ void sleep (int seconds); /* 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); @@ -165,7 +205,7 @@ int kill (int pid, int sig); /* Encapsulation of system calls */ #ifndef DONT_ENCAPSULATE #define getpid sys_getpid -pid_t getpid (void); +int getpid (void); #endif #define DONT_USE_LITOUT @@ -182,40 +222,31 @@ char *getwd (char *dir); 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 (); +#define _timeb timeb /* 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 -#ifndef HAVE_H_ERRNO -#define HAVE_H_ERRNO -#endif -#ifndef HAVE_TZNAME -#define HAVE_TZNAME -#endif +/*#define HAVE_STRUCT_UTIMBUF*/ #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 */ @@ -228,7 +259,11 @@ gid_t getegid (void); #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. */ @@ -243,7 +278,5 @@ gid_t getegid (void); /* 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 --git a/src/s/msdos.h b/src/s/msdos.h new file mode 100644 index 0000000..875083c --- /dev/null +++ b/src/s/msdos.h @@ -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 colour 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 --git a/src/s/windows95.h b/src/s/windows95.h new file mode 100644 index 0000000..a6de39f --- /dev/null +++ b/src/s/windows95.h @@ -0,0 +1,7 @@ +/* Synched up with: FSF 19.31. */ + +/* System description file for Windows 95. */ + +#include "windowsnt.h" + +#define WINDOWS95 diff --git a/src/scrollbar-gtk.c b/src/scrollbar-gtk.c index ba76d43..c7247ff 100644 --- a/src/scrollbar-gtk.c +++ b/src/scrollbar-gtk.c @@ -103,14 +103,6 @@ gtk_create_scrollbar_instance (struct frame *f, int vertical, gtk_object_set_data (GTK_OBJECT (adj), "xemacs::sb_instance", instance); sb = GTK_SCROLLBAR (vertical ? gtk_vscrollbar_new (adj) : gtk_hscrollbar_new (adj)); - /* With gtk version > 1.2.8 the gtk code does not call - gtk_widget_request_size() on the newly created scrollbars - anymore (catering to theme engines). - #### Maybe it is better to postpone this call to just before - gtk_widget_show() is called on the scrollbar? */ -#if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2 && GTK_BINARY_AGE > 8 - gtk_widget_size_request(GTK_WIDGET(sb), &(GTK_WIDGET(sb)->requisition)); -#endif SCROLLBAR_GTK_WIDGET (instance) = GTK_WIDGET (sb); gtk_signal_connect (GTK_OBJECT (adj),"value-changed", diff --git a/src/search.c b/src/search.c index 7c5f447..82e27ca 100644 --- a/src/search.c +++ b/src/search.c @@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */ #include "lisp.h" #include "buffer.h" +#include "commands.h" #include "insdel.h" #include "opaque.h" #ifdef REGION_CACHE_NEEDS_WORK @@ -38,18 +39,13 @@ Boston, MA 02111-1307, USA. */ #include <sys/types.h> #include "regex.h" -#include "casetab.h" -#include "chartab.h" -#define TRANSLATE(table, pos) \ - (!NILP (table) ? TRT_TABLE_OF (table, (Emchar) pos) : pos) #define REGEXP_CACHE_SIZE 20 /* If the regexp is non-nil, then the buffer contains the compiled form of that regexp, suitable for searching. */ -struct regexp_cache -{ +struct regexp_cache { struct regexp_cache *next; Lisp_Object regexp; struct re_pattern_buffer buf; @@ -59,10 +55,10 @@ struct regexp_cache }; /* 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 @@ -108,19 +104,10 @@ Lisp_Object Vforward_word_regexp, Vbackward_word_regexp; Lisp_Object Vskip_chars_range_table; static void set_search_regs (struct buffer *buf, Bufpos beg, Charcount len); -static void clear_unused_search_regs (struct re_registers *regp, int no_sub); -/* #### according to comment in 21.5, unnecessary */ static void save_search_regs (void); -static Bufpos simple_search (struct buffer *buf, Bufbyte *base_pat, - Bytecount len, Bytind pos, Bytind lim, - EMACS_INT n, Lisp_Object trt); -static Bufpos boyer_moore (struct buffer *buf, Bufbyte *base_pat, - Bytecount len, Bytind pos, Bytind lim, - EMACS_INT n, Lisp_Object trt, - Lisp_Object inverse_trt, int charset_base); static Bufpos search_buffer (struct buffer *buf, Lisp_Object str, Bufpos bufpos, Bufpos buflim, EMACS_INT n, int RE, - Lisp_Object trt, Lisp_Object inverse_trt, + unsigned char *trt, unsigned char *inverse_trt, int posix); static void @@ -142,10 +129,10 @@ matcher_overflow (void) static int compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, - Lisp_Object translate, struct re_registers *regp, int posix, + char *translate, struct re_registers *regp, int posix, Error_behavior errb) { - const char *val; + CONST char *val; reg_syntax_t old; cp->regexp = Qnil; @@ -153,7 +140,7 @@ compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, 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); @@ -181,7 +168,7 @@ compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, struct re_pattern_buffer * compile_pattern (Lisp_Object pattern, struct re_registers *regp, - Lisp_Object translate, int posix, Error_behavior errb) + char *translate, int posix, Error_behavior errb) { struct regexp_cache *cp, **cpp; @@ -189,7 +176,7 @@ compile_pattern (Lisp_Object pattern, struct re_registers *regp, { cp = *cpp; if (!NILP (Fstring_equal (cp->regexp, pattern)) - && EQ (cp->buf.translate, translate) + && cp->buf.translate == translate && cp->posix == posix) break; @@ -224,9 +211,8 @@ Lisp_Object Qsearch_failed; static Lisp_Object signal_failure (Lisp_Object arg) { - for (;;) - Fsignal (Qsearch_failed, list1 (arg)); - return Qnil; /* Not reached. */ + Fsignal (Qsearch_failed, list1 (arg)); + return Qnil; } /* Convert the search registers from Bytinds to Bufpos's. Needs to be @@ -301,7 +287,8 @@ looking_at_1 (Lisp_Object string, struct buffer *buf, int posix) CHECK_STRING (string); bufp = compile_pattern (string, &search_regs, (!NILP (buf->case_fold_search) - ? XCASE_TABLE_DOWNCASE (buf->case_table) : Qnil), + ? (char *) MIRROR_DOWNCASE_TABLE_AS_STRING (buf) + : 0), posix, ERROR_ME); QUIT; @@ -314,7 +301,6 @@ looking_at_1 (Lisp_Object string, struct buffer *buf, int posix) s1 = p2 - p1; s2 = BI_BUF_ZV (buf) - p2; - regex_match_object = Qnil; regex_emacs_buffer = buf; i = re_match_2 (bufp, (char *) BI_BUF_BYTE_ADDRESS (buf, p1), s1, (char *) BI_BUF_BYTE_ADDRESS (buf, p2), s2, @@ -400,12 +386,11 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, bufp = compile_pattern (regexp, &search_regs, (!NILP (buf->case_fold_search) - ? XCASE_TABLE_DOWNCASE (buf->case_table) : Qnil), - 0, ERROR_ME); + ? (char *) MIRROR_DOWNCASE_TABLE_AS_STRING (buf) + : 0), 0, ERROR_ME); QUIT; { Bytecount bis = charcount_to_bytecount (XSTRING_DATA (string), s); - regex_match_object = string; regex_emacs_buffer = buf; val = re_search (bufp, (char *) XSTRING_DATA (string), XSTRING_LENGTH (string), bis, @@ -458,7 +443,7 @@ tables) and defaults to the current buffer. 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) @@ -470,8 +455,10 @@ fast_string_match (Lisp_Object regexp, const Bufbyte *nonreloc, bufp = compile_pattern (regexp, 0, (case_fold_search - ? XCASE_TABLE_DOWNCASE (current_buffer->case_table) - : Qnil), + ? (char *) + /* #### evil current-buffer dependency */ + MIRROR_DOWNCASE_TABLE_AS_STRING (current_buffer) + : 0), 0, errb); if (!bufp) return -1; /* will only do this when errb != ERROR_ME */ @@ -497,7 +484,6 @@ fast_string_match (Lisp_Object regexp, const Bufbyte *nonreloc, } /* #### evil current-buffer dependency */ - regex_match_object = reloc; regex_emacs_buffer = current_buffer; val = re_search (bufp, (char *) newnonreloc + offset, length, 0, length, 0); @@ -698,75 +684,31 @@ scan_buffer (struct buffer *buf, Emchar target, Bufpos start, Bufpos end, } Bytind -bi_find_next_newline_no_quit (struct buffer *buf, Bytind from, int count) +bi_find_next_newline_no_quit (struct buffer *buf, Bytind from, int cnt) { - return bi_scan_buffer (buf, '\n', from, 0, count, 0, 0); + return bi_scan_buffer (buf, '\n', from, 0, cnt, 0, 0); } Bufpos -find_next_newline_no_quit (struct buffer *buf, Bufpos from, int count) +find_next_newline_no_quit (struct buffer *buf, Bufpos from, int cnt) { - return scan_buffer (buf, '\n', from, 0, count, 0, 0); + return scan_buffer (buf, '\n', from, 0, cnt, 0, 0); } Bufpos -find_next_newline (struct buffer *buf, Bufpos from, int count) +find_next_newline (struct buffer *buf, Bufpos from, int cnt) { - 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; + return scan_buffer (buf, '\n', from, 0, cnt, 0, 1); } /* 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. */ Bufpos -find_before_next_newline (struct buffer *buf, Bufpos from, Bufpos to, int count) +find_before_next_newline (struct buffer *buf, Bufpos from, Bufpos to, int cnt) { EMACS_INT shortage; - Bufpos pos = scan_buffer (buf, '\n', from, to, count, &shortage, 1); + Bufpos pos = scan_buffer (buf, '\n', from, to, cnt, &shortage, 1); if (shortage == 0) pos--; @@ -774,7 +716,6 @@ find_before_next_newline (struct buffer *buf, Bufpos from, Bufpos to, int count) return pos; } -/* This function synched with FSF 21.1 */ static Lisp_Object skip_chars (struct buffer *buf, int forwardp, int syntaxp, Lisp_Object string, Lisp_Object lim) @@ -787,24 +728,22 @@ skip_chars (struct buffer *buf, int forwardp, int syntaxp, unsigned char fastmap[0400]; int negate = 0; REGISTER int i; -#ifndef emacs - Lisp_Char_Table *syntax_table = XCHAR_TABLE (buf->mirror_syntax_table); -#endif - Bufpos limit; + struct Lisp_Char_Table *syntax_table = + XCHAR_TABLE (buf->mirror_syntax_table); + + CHECK_STRING (string); if (NILP (lim)) - limit = forwardp ? BUF_ZV (buf) : BUF_BEGV (buf); + XSETINT (lim, forwardp ? BUF_ZV (buf) : BUF_BEGV (buf)); else - { - CHECK_INT_COERCE_MARKER (lim); - limit = XINT (lim); + CHECK_INT_COERCE_MARKER (lim); - /* In any case, don't allow scan outside bounds of buffer. */ - if (limit > BUF_ZV (buf)) limit = BUF_ZV (buf); - if (limit < BUF_BEGV (buf)) limit = BUF_BEGV (buf); - } + /* In any case, don't allow scan outside bounds of buffer. */ + if (XINT (lim) > BUF_ZV (buf)) + lim = make_int (BUF_ZV (buf)); + if (XINT (lim) < BUF_BEGV (buf)) + lim = make_int (BUF_BEGV (buf)); - CHECK_STRING (string); p = XSTRING_DATA (string); pend = p + XSTRING_LENGTH (string); memset (fastmap, 0, sizeof (fastmap)); @@ -845,7 +784,6 @@ skip_chars (struct buffer *buf, int forwardp, int syntaxp, { Emchar cend; - /* Skip over the dash. */ p++; if (p == pend) break; cend = charptr_emchar (p); @@ -870,7 +808,6 @@ skip_chars (struct buffer *buf, int forwardp, int syntaxp, } } - /* #### Not in FSF 21.1 */ if (syntaxp && fastmap['-'] != 0) fastmap[' '] = 1; @@ -884,102 +821,72 @@ skip_chars (struct buffer *buf, int forwardp, int syntaxp, { Bufpos start_point = BUF_PT (buf); - Bufpos pos = start_point; - Bytind pos_byte = BI_BUF_PT (buf); if (syntaxp) { - SETUP_SYNTAX_CACHE_FOR_BUFFER (buf, pos, forwardp ? 1 : -1); /* All syntax designators are normal chars so nothing strange to worry about */ if (forwardp) { - if (pos < limit) - while (fastmap[(unsigned char) - syntax_code_spec - [(int) SYNTAX_FROM_CACHE - (syntax_table, - BI_BUF_FETCH_CHAR (buf, pos_byte))]]) - { - pos++; - INC_BYTIND (buf, pos_byte); - if (pos >= limit) - break; - UPDATE_SYNTAX_CACHE_FORWARD (pos); - } + while (BUF_PT (buf) < XINT (lim) + && fastmap[(unsigned char) + syntax_code_spec + [(int) SYNTAX (syntax_table, + BUF_FETCH_CHAR + (buf, BUF_PT (buf)))]]) + BUF_SET_PT (buf, BUF_PT (buf) + 1); } else { - while (pos > limit) - { - Bufpos savepos = pos_byte; - pos--; - DEC_BYTIND (buf, pos_byte); - UPDATE_SYNTAX_CACHE_BACKWARD (pos); - if (!fastmap[(unsigned char) - syntax_code_spec - [(int) SYNTAX_FROM_CACHE - (syntax_table, - BI_BUF_FETCH_CHAR (buf, pos_byte))]]) - { - pos++; - pos_byte = savepos; - break; - } - } + while (BUF_PT (buf) > XINT (lim) + && fastmap[(unsigned char) + syntax_code_spec + [(int) SYNTAX (syntax_table, + BUF_FETCH_CHAR + (buf, BUF_PT (buf) - 1))]]) + BUF_SET_PT (buf, BUF_PT (buf) - 1); } } else { if (forwardp) { - while (pos < limit) + while (BUF_PT (buf) < XINT (lim)) { - Emchar ch = BI_BUF_FETCH_CHAR (buf, pos_byte); + Emchar ch = BUF_FETCH_CHAR (buf, BUF_PT (buf)); if ((ch < 0400) ? fastmap[ch] : (NILP (Fget_range_table (make_int (ch), Vskip_chars_range_table, Qnil)) == negate)) - { - pos++; - INC_BYTIND (buf, pos_byte); - } + BUF_SET_PT (buf, BUF_PT (buf) + 1); else break; } } else { - while (pos > limit) + while (BUF_PT (buf) > XINT (lim)) { - Bufpos prev_pos_byte = pos_byte; - Emchar ch; - - DEC_BYTIND (buf, prev_pos_byte); - ch = BI_BUF_FETCH_CHAR (buf, prev_pos_byte); + Emchar ch = BUF_FETCH_CHAR (buf, BUF_PT (buf) - 1); if ((ch < 0400) ? fastmap[ch] : - (NILP (Fget_range_table (make_int (ch), - Vskip_chars_range_table, - Qnil)) - == negate)) - { - pos--; - pos_byte = prev_pos_byte; - } - else - break; + (NILP (Fget_range_table (make_int (ch), + Vskip_chars_range_table, + Qnil)) + == negate)) + BUF_SET_PT (buf, BUF_PT (buf) - 1); + else + break; } } } QUIT; - BOTH_BUF_SET_PT (buf, pos, pos_byte); return make_int (BUF_PT (buf) - start_point); } } DEFUN ("skip-chars-forward", Fskip_chars_forward, 1, 3, 0, /* -Move point forward, stopping before a char not in STRING, or at pos LIMIT. +Move point forward, stopping before a char not in STRING, or at pos LIM. STRING is like the inside of a `[...]' in a regular expression except that `]' is never special and `\\' quotes `^', `-' or `\\'. Thus, with arg "a-zA-Z", this skips letters stopping before first nonletter. @@ -988,57 +895,57 @@ Returns the distance traveled, either zero or positive. Optional argument BUFFER defaults to the current buffer. */ - (string, limit, buffer)) + (string, lim, buffer)) { - return skip_chars (decode_buffer (buffer, 0), 1, 0, string, limit); + return skip_chars (decode_buffer (buffer, 0), 1, 0, string, lim); } DEFUN ("skip-chars-backward", Fskip_chars_backward, 1, 3, 0, /* -Move point backward, stopping after a char not in STRING, or at pos LIMIT. +Move point backward, stopping after a char not in STRING, or at pos LIM. See `skip-chars-forward' for details. Returns the distance traveled, either zero or negative. Optional argument BUFFER defaults to the current buffer. */ - (string, limit, buffer)) + (string, lim, buffer)) { - return skip_chars (decode_buffer (buffer, 0), 0, 0, string, limit); + return skip_chars (decode_buffer (buffer, 0), 0, 0, string, lim); } DEFUN ("skip-syntax-forward", Fskip_syntax_forward, 1, 3, 0, /* Move point forward across chars in specified syntax classes. SYNTAX is a string of syntax code characters. -Stop before a char whose syntax is not in SYNTAX, or at position LIMIT. +Stop before a char whose syntax is not in SYNTAX, or at position LIM. If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX. This function returns the distance traveled, either zero or positive. Optional argument BUFFER defaults to the current buffer. */ - (syntax, limit, buffer)) + (syntax, lim, buffer)) { - return skip_chars (decode_buffer (buffer, 0), 1, 1, syntax, limit); + return skip_chars (decode_buffer (buffer, 0), 1, 1, syntax, lim); } DEFUN ("skip-syntax-backward", Fskip_syntax_backward, 1, 3, 0, /* Move point backward across chars in specified syntax classes. SYNTAX is a string of syntax code characters. -Stop on reaching a char whose syntax is not in SYNTAX, or at position LIMIT. +Stop on reaching a char whose syntax is not in SYNTAX, or at position LIM. If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX. This function returns the distance traveled, either zero or negative. Optional argument BUFFER defaults to the current buffer. */ - (syntax, limit, buffer)) + (syntax, lim, buffer)) { - return skip_chars (decode_buffer (buffer, 0), 0, 1, syntax, limit); + return skip_chars (decode_buffer (buffer, 0), 0, 1, syntax, lim); } /* Subroutines of Lisp buffer search functions. */ static Lisp_Object -search_command (Lisp_Object string, Lisp_Object limit, Lisp_Object noerror, +search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object no_error, Lisp_Object count, Lisp_Object buffer, int direction, int RE, int posix) { @@ -1056,14 +963,14 @@ search_command (Lisp_Object string, Lisp_Object limit, Lisp_Object noerror, buf = decode_buffer (buffer, 0); CHECK_STRING (string); - if (NILP (limit)) + if (NILP (bound)) lim = n > 0 ? BUF_ZV (buf) : BUF_BEGV (buf); else { - CHECK_INT_COERCE_MARKER (limit); - lim = XINT (limit); + CHECK_INT_COERCE_MARKER (bound); + lim = XINT (bound); if (n > 0 ? lim < BUF_PT (buf) : lim > BUF_PT (buf)) - error ("Invalid search limit (wrong side of point)"); + error ("Invalid search bound (wrong side of point)"); if (lim > BUF_ZV (buf)) lim = BUF_ZV (buf); if (lim < BUF_BEGV (buf)) @@ -1072,17 +979,17 @@ search_command (Lisp_Object string, Lisp_Object limit, Lisp_Object noerror, np = search_buffer (buf, string, BUF_PT (buf), lim, n, RE, (!NILP (buf->case_fold_search) - ? XCASE_TABLE_CANON (buf->case_table) - : Qnil), + ? MIRROR_CANON_TABLE_AS_STRING (buf) + : 0), (!NILP (buf->case_fold_search) - ? XCASE_TABLE_EQV (buf->case_table) - : Qnil), posix); + ? MIRROR_EQV_TABLE_AS_STRING (buf) + : 0), posix); if (np <= 0) { - if (NILP (noerror)) + if (NILP (no_error)) return signal_failure (string); - if (!EQ (noerror, Qt)) + if (!EQ (no_error, Qt)) { if (lim < BUF_BEGV (buf) || lim > BUF_ZV (buf)) abort (); @@ -1154,14 +1061,25 @@ trivial_regexp_p (Lisp_Object regexp) POSIX is nonzero if we want full backtracking (POSIX style) for this pattern. 0 means backtrack only enough to get a valid match. */ + static Bufpos search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, - Bufpos buflim, EMACS_INT n, int RE, Lisp_Object trt, - Lisp_Object inverse_trt, int posix) + Bufpos buflim, EMACS_INT n, int RE, unsigned char *trt, + unsigned char *inverse_trt, int posix) { /* This function has been Mule-ized, except for the trt table handling. */ Bytecount len = XSTRING_LENGTH (string); Bufbyte *base_pat = XSTRING_DATA (string); + REGISTER EMACS_INT *BM_tab; + EMACS_INT *BM_tab_base; + REGISTER int direction = ((n > 0) ? 1 : -1); + REGISTER Bytecount dirlen; + EMACS_INT infinity; + Bytind limit; + EMACS_INT k; + Bytecount stride_for_teases = 0; + REGISTER Bufbyte *pat = 0; + REGISTER Bufbyte *cursor, *p_limit, *ptr2; REGISTER EMACS_INT i, j; Bytind p1, p2; Bytecount s1, s2; @@ -1174,11 +1092,10 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, if (len == 0) { set_search_regs (buf, bufpos, 0); - clear_unused_search_regs (&search_regs, 0); return bufpos; } - /* Searching 0 times means noop---don't move, don't touch registers. */ + /* Searching 0 times means don't move. */ if (n == 0) return bufpos; @@ -1188,7 +1105,7 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, { struct re_pattern_buffer *bufp; - bufp = compile_pattern (string, &search_regs, trt, posix, + bufp = compile_pattern (string, &search_regs, (char *) trt, posix, ERROR_ME); /* Get pointers and sizes of the two strings @@ -1198,7 +1115,6 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, p2 = BI_BUF_CEILING_OF (buf, p1); s1 = p2 - p1; s2 = BI_BUF_ZV (buf) - p2; - regex_match_object = Qnil; while (n < 0) { @@ -1225,8 +1141,6 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, search_regs.start[i] += j; search_regs.end[i] += j; } - /* re_match (called from re_search et al) does this for us */ - /* clear_unused_search_regs (search_regs, bufp->no_sub); */ XSETBUFFER (last_thing_searched, buf); /* Set pos to the new position. */ pos = search_regs.start[0]; @@ -1264,8 +1178,6 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, search_regs.start[i] += j; search_regs.end[i] += j; } - /* re_match (called from re_search et al) does this for us */ - /* clear_unused_search_regs (search_regs, bufp->no_sub); */ XSETBUFFER (last_thing_searched, buf); /* Set pos to the new position. */ pos = search_regs.end[0]; @@ -1282,664 +1194,322 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, return bufpos; } else /* non-RE case */ + /* #### Someone really really really needs to comment the workings + of this junk somewhat better. + + BTW "BM" stands for Boyer-Moore, which is one of the standard + string-searching algorithms. It's the best string-searching + algorithm out there provided + + a) You're not fazed by algorithm complexity. (Rabin-Karp, which + uses hashing, is much much easier to code but not as fast.) + b) You can freely move backwards in the string that you're + searching through. + + As the comment below tries to explain (but garbles in typical + programmer-ese), the idea is that you don't have to do a + string match at every successive position in the text. For + example, let's say the pattern is "a very long string". We + compare the last character in the string (`g') with the + corresponding character in the text. If it mismatches, and + it is, say, `z', then we can skip forward by the entire + length of the pattern because `z' does not occur anywhere + in the pattern. If the mismatching character does occur + in the pattern, we can usually still skip forward by more + than one: e.g. if it is `l', then we can skip forward + by the length of the substring "ong string" -- i.e. the + largest end section of the pattern that does not contain + the mismatched character. So what we do is compute, for + each possible character, the distance we can skip forward + (the "stride") and use it in the string matching. This + is what the BM_tab holds. */ { - int charset_base = -1; - int boyer_moore_ok = 1; - Bufbyte *pat = 0; - Bufbyte *patbuf = alloca_array (Bufbyte, len * MAX_EMCHAR_LEN); - pat = patbuf; -#ifdef MULE - while (len > 0) - { - Bufbyte tmp_str[MAX_EMCHAR_LEN]; - Emchar c, translated, inverse; - Bytecount orig_bytelen, new_bytelen, inv_bytelen; - - /* If we got here and the RE flag is set, it's because - we're dealing with a regexp known to be trivial, so the - backslash just quotes the next character. */ - if (RE && *base_pat == '\\') - { - len--; - base_pat++; - } - c = charptr_emchar (base_pat); - translated = TRANSLATE (trt, c); - inverse = TRANSLATE (inverse_trt, c); - - orig_bytelen = charcount_to_bytecount (base_pat, 1); - inv_bytelen = set_charptr_emchar (tmp_str, inverse); - new_bytelen = set_charptr_emchar (tmp_str, translated); - - - if (new_bytelen != orig_bytelen || inv_bytelen != orig_bytelen) - boyer_moore_ok = 0; - if (translated != c || inverse != c) - { - /* Keep track of which character set row - contains the characters that need translation. */ - int charset_base_code = c & ~CHAR_FIELD3_MASK; - if (charset_base == -1) - charset_base = charset_base_code; - else if (charset_base != charset_base_code) - /* If two different rows appear, needing translation, - then we cannot use boyer_moore search. */ - boyer_moore_ok = 0; - } - memcpy (pat, tmp_str, new_bytelen); - pat += new_bytelen; - base_pat += orig_bytelen; - len -= orig_bytelen; - } -#else /* not MULE */ - while (--len >= 0) - { - /* If we got here and the RE flag is set, it's because - we're dealing with a regexp known to be trivial, so the - backslash just quotes the next character. */ - if (RE && *base_pat == '\\') - { - len--; - base_pat++; - } - *pat++ = TRANSLATE (trt, *base_pat++); - } -#endif /* MULE */ - len = pat - patbuf; - pat = base_pat = patbuf; - if (boyer_moore_ok) - return boyer_moore (buf, base_pat, len, pos, lim, n, - trt, inverse_trt, charset_base); - else - return simple_search (buf, base_pat, len, pos, lim, n, trt); - } -} - -/* Do a simple string search N times for the string PAT, - whose length is LEN/LEN_BYTE, - from buffer position POS/POS_BYTE until LIM/LIM_BYTE. - TRT is the translation table. - - Return the character position where the match is found. - Otherwise, if M matches remained to be found, return -M. - - This kind of search works regardless of what is in PAT and - regardless of what is in TRT. It is used in cases where - boyer_moore cannot work. */ - -static Bufpos -simple_search (struct buffer *buf, Bufbyte *base_pat, Bytecount len_byte, - Bytind idx, Bytind lim, EMACS_INT n, Lisp_Object trt) -{ - int forward = n > 0; - Bytecount buf_len = 0; /* Shut up compiler. */ - - if (lim > idx) - while (n > 0) - { - while (1) - { - Bytecount this_len = len_byte; - Bytind this_idx = idx; - Bufbyte *p = base_pat; - if (idx >= lim) - goto stop; - - while (this_len > 0) - { - Emchar pat_ch, buf_ch; - Bytecount pat_len; - - pat_ch = charptr_emchar (p); - buf_ch = BI_BUF_FETCH_CHAR (buf, this_idx); - - buf_ch = TRANSLATE (trt, buf_ch); - - if (buf_ch != pat_ch) - break; - - pat_len = charcount_to_bytecount (p, 1); - p += pat_len; - this_len -= pat_len; - INC_BYTIND (buf, this_idx); - } - if (this_len == 0) - { - buf_len = this_idx - idx; - idx = this_idx; - break; - } - INC_BYTIND (buf, idx); - } - n--; - } - else - while (n < 0) +#ifdef C_ALLOCA + EMACS_INT BM_tab_space[0400]; + BM_tab = &BM_tab_space[0]; +#else + BM_tab = alloca_array (EMACS_INT, 256); +#endif { - while (1) + Bufbyte *patbuf = alloca_array (Bufbyte, len); + pat = patbuf; + while (--len >= 0) { - Bytecount this_len = len_byte; - Bytind this_idx = idx; - Bufbyte *p; - if (idx <= lim) - goto stop; - p = base_pat + len_byte; - - while (this_len > 0) - { - Emchar pat_ch, buf_ch; - - DEC_CHARPTR (p); - DEC_BYTIND (buf, this_idx); - pat_ch = charptr_emchar (p); - buf_ch = BI_BUF_FETCH_CHAR (buf, this_idx); - - buf_ch = TRANSLATE (trt, buf_ch); - - if (buf_ch != pat_ch) - break; - - this_len -= charcount_to_bytecount (p, 1); - } - if (this_len == 0) + /* If we got here and the RE flag is set, it's because we're + dealing with a regexp known to be trivial, so the backslash + just quotes the next character. */ + if (RE && *base_pat == '\\') { - buf_len = idx - this_idx; - idx = this_idx; - break; + len--; + base_pat++; } - DEC_BYTIND (buf, idx); + *pat++ = (trt ? trt[*base_pat++] : *base_pat++); } - n++; + len = pat - patbuf; + pat = base_pat = patbuf; } - stop: - if (n == 0) - { - Bufpos beg, end, retval; - if (forward) + /* The general approach is that we are going to maintain that we know */ + /* the first (closest to the present position, in whatever direction */ + /* we're searching) character that could possibly be the last */ + /* (furthest from present position) character of a valid match. We */ + /* advance the state of our knowledge by looking at that character */ + /* and seeing whether it indeed matches the last character of the */ + /* pattern. If it does, we take a closer look. If it does not, we */ + /* move our pointer (to putative last characters) as far as is */ + /* logically possible. This amount of movement, which I call a */ + /* stride, will be the length of the pattern if the actual character */ + /* appears nowhere in the pattern, otherwise it will be the distance */ + /* from the last occurrence of that character to the end of the */ + /* pattern. */ + /* As a coding trick, an enormous stride is coded into the table for */ + /* characters that match the last character. This allows use of only */ + /* a single test, a test for having gone past the end of the */ + /* permissible match region, to test for both possible matches (when */ + /* the stride goes past the end immediately) and failure to */ + /* match (where you get nudged past the end one stride at a time). */ + + /* Here we make a "mickey mouse" BM table. The stride of the search */ + /* is determined only by the last character of the putative match. */ + /* If that character does not match, we will stride the proper */ + /* distance to propose a match that superimposes it on the last */ + /* instance of a character that matches it (per trt), or misses */ + /* it entirely if there is none. */ + + dirlen = len * direction; + infinity = dirlen - (lim + pos + len + len) * direction; + if (direction < 0) + pat = (base_pat += len - 1); + BM_tab_base = BM_tab; + BM_tab += 0400; + j = dirlen; /* to get it in a register */ + /* A character that does not appear in the pattern induces a */ + /* stride equal to the pattern length. */ + while (BM_tab_base != BM_tab) { - beg = bytind_to_bufpos (buf, idx - buf_len); - retval = end = bytind_to_bufpos (buf, idx); + *--BM_tab = j; + *--BM_tab = j; + *--BM_tab = j; + *--BM_tab = j; } - else + i = 0; + while (i != infinity) { - retval = beg = bytind_to_bufpos (buf, idx); - end = bytind_to_bufpos (buf, idx + buf_len); - } - set_search_regs (buf, beg, end - beg); - clear_unused_search_regs (&search_regs, 0); - - return retval; - } - else if (n > 0) - return -n; - else - return n; -} - -/* Do Boyer-Moore search N times for the string PAT, - whose length is LEN/LEN_BYTE, - from buffer position POS/POS_BYTE until LIM/LIM_BYTE. - DIRECTION says which direction we search in. - TRT and INVERSE_TRT are translation tables. - - This kind of search works if all the characters in PAT that have - nontrivial translation are the same aside from the last byte. This - makes it possible to translate just the last byte of a character, - and do so after just a simple test of the context. - - If that criterion is not satisfied, do not call this function. */ - -static Bufpos -boyer_moore (struct buffer *buf, Bufbyte *base_pat, Bytecount len, - Bytind pos, Bytind lim, EMACS_INT n, Lisp_Object trt, - Lisp_Object inverse_trt, int charset_base) -{ - /* #### Someone really really really needs to comment the workings - of this junk somewhat better. - - BTW "BM" stands for Boyer-Moore, which is one of the standard - string-searching algorithms. It's the best string-searching - algorithm out there, provided that: - - a) You're not fazed by algorithm complexity. (Rabin-Karp, which - uses hashing, is much much easier to code but not as fast.) - b) You can freely move backwards in the string that you're - searching through. - - As the comment below tries to explain (but garbles in typical - programmer-ese), the idea is that you don't have to do a - string match at every successive position in the text. For - example, let's say the pattern is "a very long string". We - compare the last character in the string (`g') with the - corresponding character in the text. If it mismatches, and - it is, say, `z', then we can skip forward by the entire - length of the pattern because `z' does not occur anywhere - in the pattern. If the mismatching character does occur - in the pattern, we can usually still skip forward by more - than one: e.g. if it is `l', then we can skip forward - by the length of the substring "ong string" -- i.e. the - largest end section of the pattern that does not contain - the mismatched character. So what we do is compute, for - each possible character, the distance we can skip forward - (the "stride") and use it in the string matching. This - is what the BM_tab holds. */ - REGISTER EMACS_INT *BM_tab; - EMACS_INT *BM_tab_base; - REGISTER Bytecount dirlen; - EMACS_INT infinity; - Bytind limit; - Bytecount stride_for_teases = 0; - REGISTER EMACS_INT i, j; - Bufbyte *pat, *pat_end; - REGISTER Bufbyte *cursor, *p_limit, *ptr2; - Bufbyte simple_translate[0400]; - REGISTER int direction = ((n > 0) ? 1 : -1); -#ifdef MULE - Bufbyte translate_prev_byte = 0; - Bufbyte translate_anteprev_byte = 0; -#endif -#ifdef C_ALLOCA - EMACS_INT BM_tab_space[0400]; - BM_tab = &BM_tab_space[0]; -#else - BM_tab = alloca_array (EMACS_INT, 256); -#endif - - /* The general approach is that we are going to maintain that we - know the first (closest to the present position, in whatever - direction we're searching) character that could possibly be - the last (furthest from present position) character of a - valid match. We advance the state of our knowledge by - looking at that character and seeing whether it indeed - matches the last character of the pattern. If it does, we - take a closer look. If it does not, we move our pointer (to - putative last characters) as far as is logically possible. - This amount of movement, which I call a stride, will be the - length of the pattern if the actual character appears nowhere - in the pattern, otherwise it will be the distance from the - last occurrence of that character to the end of the pattern. - As a coding trick, an enormous stride is coded into the table - for characters that match the last character. This allows - use of only a single test, a test for having gone past the - end of the permissible match region, to test for both - possible matches (when the stride goes past the end - immediately) and failure to match (where you get nudged past - the end one stride at a time). - - Here we make a "mickey mouse" BM table. The stride of the - search is determined only by the last character of the - putative match. If that character does not match, we will - stride the proper distance to propose a match that - superimposes it on the last instance of a character that - matches it (per trt), or misses it entirely if there is - none. */ - - dirlen = len * direction; - infinity = dirlen - (lim + pos + len + len) * direction; - /* Record position after the end of the pattern. */ - pat_end = base_pat + len; - if (direction < 0) - base_pat = pat_end - 1; - BM_tab_base = BM_tab; - BM_tab += 0400; - j = dirlen; /* to get it in a register */ - /* A character that does not appear in the pattern induces a - stride equal to the pattern length. */ - while (BM_tab_base != BM_tab) - { - *--BM_tab = j; - *--BM_tab = j; - *--BM_tab = j; - *--BM_tab = j; - } - /* We use this for translation, instead of TRT itself. We - fill this in to handle the characters that actually occur - in the pattern. Others don't matter anyway! */ - xzero (simple_translate); - for (i = 0; i < 0400; i++) - simple_translate[i] = (Bufbyte) i; - i = 0; - while (i != infinity) - { - Bufbyte *ptr = base_pat + i; - i += direction; - if (i == dirlen) - i = infinity; - if (!NILP (trt)) - { -#ifdef MULE - Emchar ch, untranslated; - int this_translated = 1; - - /* Is *PTR the last byte of a character? */ - if (pat_end - ptr == 1 || BUFBYTE_FIRST_BYTE_P (ptr[1])) + j = pat[i]; i += direction; + if (i == dirlen) i = infinity; + if (trt != 0) { - Bufbyte *charstart = ptr; - while (!BUFBYTE_FIRST_BYTE_P (*charstart)) - charstart--; - untranslated = charptr_emchar (charstart); - if (charset_base == (untranslated & ~CHAR_FIELD3_MASK)) - { - ch = TRANSLATE (trt, untranslated); - if (!BUFBYTE_FIRST_BYTE_P (*ptr)) - { - translate_prev_byte = ptr[-1]; - if (!BUFBYTE_FIRST_BYTE_P (translate_prev_byte)) - translate_anteprev_byte = ptr[-2]; - } - } - else - { - this_translated = 0; - ch = *ptr; - } - } - else - { - ch = *ptr; - this_translated = 0; + k = (j = trt[j]); + if (i == infinity) + stride_for_teases = BM_tab[j]; + BM_tab[j] = dirlen - i; + /* A translation table is accompanied by its inverse -- see */ + /* comment following downcase_table for details */ + + while ((j = inverse_trt[j]) != k) + BM_tab[j] = dirlen - i; } - if (ch > 0400) - j = ((unsigned char) ch | 0200); else - j = (unsigned char) ch; - - if (i == infinity) - stride_for_teases = BM_tab[j]; - BM_tab[j] = dirlen - i; - /* A translation table is accompanied by its inverse -- - see comment following downcase_table for details */ - if (this_translated) { - Emchar starting_ch = ch; - EMACS_INT starting_j = j; - while (1) - { - ch = TRANSLATE (inverse_trt, ch); - if (ch > 0400) - j = ((unsigned char) ch | 0200); - else - j = (unsigned char) ch; - - /* For all the characters that map into CH, - set up simple_translate to map the last byte - into STARTING_J. */ - simple_translate[j] = starting_j; - if (ch == starting_ch) - break; - BM_tab[j] = dirlen - i; - } - } -#else - EMACS_INT k; - j = *ptr; - k = (j = TRANSLATE (trt, j)); - if (i == infinity) - stride_for_teases = BM_tab[j]; - BM_tab[j] = dirlen - i; - /* A translation table is accompanied by its inverse -- - see comment following downcase_table for details */ - - while ((j = TRANSLATE (inverse_trt, j)) != k) - { - simple_translate[j] = (Bufbyte) k; + if (i == infinity) + stride_for_teases = BM_tab[j]; BM_tab[j] = dirlen - i; } -#endif - } - else - { - j = *ptr; - - if (i == infinity) - stride_for_teases = BM_tab[j]; - BM_tab[j] = dirlen - i; + /* stride_for_teases tells how much to stride if we get a */ + /* match on the far character but are subsequently */ + /* disappointed, by recording what the stride would have been */ + /* for that character if the last character had been */ + /* different. */ } - /* stride_for_teases tells how much to stride if we get a - match on the far character but are subsequently - disappointed, by recording what the stride would have been - for that character if the last character had been - different. */ - } - infinity = dirlen - infinity; - pos += dirlen - ((direction > 0) ? direction : 0); - /* loop invariant - pos points at where last char (first char if - reverse) of pattern would align in a possible match. */ - while (n != 0) - { - Bytind tail_end; - Bufbyte *tail_end_ptr; - /* It's been reported that some (broken) compiler thinks - that Boolean expressions in an arithmetic context are - unsigned. Using an explicit ?1:0 prevents this. */ - if ((lim - pos - ((direction > 0) ? 1 : 0)) * direction < 0) - return n * (0 - direction); - /* First we do the part we can by pointers (maybe - nothing) */ - QUIT; - pat = base_pat; - limit = pos - dirlen + direction; - /* XEmacs change: definitions of CEILING_OF and FLOOR_OF - have changed. See buffer.h. */ - limit = ((direction > 0) - ? BI_BUF_CEILING_OF (buf, limit) - 1 - : BI_BUF_FLOOR_OF (buf, limit + 1)); - /* LIMIT is now the last (not beyond-last!) value POS can - take on without hitting edge of buffer or the gap. */ - limit = ((direction > 0) - ? min (lim - 1, min (limit, pos + 20000)) - : max (lim, max (limit, pos - 20000))); - tail_end = BI_BUF_CEILING_OF (buf, pos); - tail_end_ptr = BI_BUF_BYTE_ADDRESS (buf, tail_end); - - if ((limit - pos) * direction > 20) + infinity = dirlen - infinity; + pos += dirlen - ((direction > 0) ? direction : 0); + /* loop invariant - pos points at where last char (first char if reverse) + of pattern would align in a possible match. */ + while (n != 0) { - p_limit = BI_BUF_BYTE_ADDRESS (buf, limit); - ptr2 = (cursor = BI_BUF_BYTE_ADDRESS (buf, pos)); - /* In this loop, pos + cursor - ptr2 is the surrogate - for pos */ - while (1) /* use one cursor setting as long as i can */ + /* It's been reported that some (broken) compiler thinks that + Boolean expressions in an arithmetic context are unsigned. + Using an explicit ?1:0 prevents this. */ + if ((lim - pos - ((direction > 0) ? 1 : 0)) * direction < 0) + return n * (0 - direction); + /* First we do the part we can by pointers (maybe nothing) */ + QUIT; + pat = base_pat; + limit = pos - dirlen + direction; + /* XEmacs change: definitions of CEILING_OF and FLOOR_OF + have changed. See buffer.h. */ + limit = ((direction > 0) + ? BI_BUF_CEILING_OF (buf, limit) - 1 + : BI_BUF_FLOOR_OF (buf, limit + 1)); + /* LIMIT is now the last (not beyond-last!) value + POS can take on without hitting edge of buffer or the gap. */ + limit = ((direction > 0) + ? min (lim - 1, min (limit, pos + 20000)) + : max (lim, max (limit, pos - 20000))); + if ((limit - pos) * direction > 20) { - if (direction > 0) /* worth duplicating */ + p_limit = BI_BUF_BYTE_ADDRESS (buf, limit); + ptr2 = (cursor = BI_BUF_BYTE_ADDRESS (buf, pos)); + /* In this loop, pos + cursor - ptr2 is the surrogate for pos */ + while (1) /* use one cursor setting as long as i can */ { - /* Use signed comparison if appropriate to make - cursor+infinity sure to be > p_limit. - Assuming that the buffer lies in a range of - addresses that are all "positive" (as ints) - or all "negative", either kind of comparison - will work as long as we don't step by - infinity. So pick the kind that works when - we do step by infinity. */ - if ((EMACS_INT) (p_limit + infinity) > - (EMACS_INT) p_limit) - while ((EMACS_INT) cursor <= - (EMACS_INT) p_limit) - cursor += BM_tab[*cursor]; - else - while ((EMACS_UINT) cursor <= - (EMACS_UINT) p_limit) - cursor += BM_tab[*cursor]; - } - else - { - if ((EMACS_INT) (p_limit + infinity) < - (EMACS_INT) p_limit) - while ((EMACS_INT) cursor >= - (EMACS_INT) p_limit) - cursor += BM_tab[*cursor]; + if (direction > 0) /* worth duplicating */ + { + /* Use signed comparison if appropriate + to make cursor+infinity sure to be > p_limit. + Assuming that the buffer lies in a range of addresses + that are all "positive" (as ints) or all "negative", + either kind of comparison will work as long + as we don't step by infinity. So pick the kind + that works when we do step by infinity. */ + if ((EMACS_INT) (p_limit + infinity) > + (EMACS_INT) p_limit) + while ((EMACS_INT) cursor <= + (EMACS_INT) p_limit) + cursor += BM_tab[*cursor]; + else + while ((EMACS_UINT) cursor <= + (EMACS_UINT) p_limit) + cursor += BM_tab[*cursor]; + } else - while ((EMACS_UINT) cursor >= - (EMACS_UINT) p_limit) - cursor += BM_tab[*cursor]; - } - /* If you are here, cursor is beyond the end of the - searched region. This can happen if you match on - the far character of the pattern, because the - "stride" of that character is infinity, a number - able to throw you well beyond the end of the - search. It can also happen if you fail to match - within the permitted region and would otherwise - try a character beyond that region */ - if ((cursor - p_limit) * direction <= len) - break; /* a small overrun is genuine */ - cursor -= infinity; /* large overrun = hit */ - i = dirlen - direction; - if (!NILP (trt)) - { - while ((i -= direction) + direction != 0) { -#ifdef MULE - Emchar ch; - cursor -= direction; - /* Translate only the last byte of a character. */ - if ((cursor == tail_end_ptr - || BUFBYTE_FIRST_BYTE_P (cursor[1])) - && (BUFBYTE_FIRST_BYTE_P (cursor[0]) - || (translate_prev_byte == cursor[-1] - && (BUFBYTE_FIRST_BYTE_P (translate_prev_byte) - || translate_anteprev_byte == cursor[-2])))) - ch = simple_translate[*cursor]; + if ((EMACS_INT) (p_limit + infinity) < + (EMACS_INT) p_limit) + while ((EMACS_INT) cursor >= + (EMACS_INT) p_limit) + cursor += BM_tab[*cursor]; else - ch = *cursor; - if (pat[i] != ch) - break; -#else - if (pat[i] != TRANSLATE (trt, *(cursor -= direction))) - break; -#endif + while ((EMACS_UINT) cursor >= + (EMACS_UINT) p_limit) + cursor += BM_tab[*cursor]; } - } - else - { - while ((i -= direction) + direction != 0) - if (pat[i] != *(cursor -= direction)) - break; - } - cursor += dirlen - i - direction; /* fix cursor */ - if (i + direction == 0) - { - cursor -= direction; +/* If you are here, cursor is beyond the end of the searched region. */ + /* This can happen if you match on the far character of the pattern, */ + /* because the "stride" of that character is infinity, a number able */ + /* to throw you well beyond the end of the search. It can also */ + /* happen if you fail to match within the permitted region and would */ + /* otherwise try a character beyond that region */ + if ((cursor - p_limit) * direction <= len) + break; /* a small overrun is genuine */ + cursor -= infinity; /* large overrun = hit */ + i = dirlen - direction; + if (trt != 0) + { + while ((i -= direction) + direction != 0) + if (pat[i] != trt[*(cursor -= direction)]) + break; + } + else + { + while ((i -= direction) + direction != 0) + if (pat[i] != *(cursor -= direction)) + break; + } + cursor += dirlen - i - direction; /* fix cursor */ + if (i + direction == 0) + { + cursor -= direction; - { - Bytind bytstart = (pos + cursor - ptr2 + - ((direction > 0) - ? 1 - len : 0)); - Bufpos bufstart = bytind_to_bufpos (buf, bytstart); - Bufpos bufend = bytind_to_bufpos (buf, bytstart + len); - - set_search_regs (buf, bufstart, bufend - bufstart); - clear_unused_search_regs (&search_regs, 0); - } + { + Bytind bytstart = (pos + cursor - ptr2 + + ((direction > 0) + ? 1 - len : 0)); + Bufpos bufstart = bytind_to_bufpos (buf, bytstart); + Bufpos bufend = bytind_to_bufpos (buf, bytstart + len); - if ((n -= direction) != 0) - cursor += dirlen; /* to resume search */ + set_search_regs (buf, bufstart, bufend - bufstart); + } + + if ((n -= direction) != 0) + cursor += dirlen; /* to resume search */ + else + return ((direction > 0) + ? search_regs.end[0] : search_regs.start[0]); + } else - return ((direction > 0) - ? search_regs.end[0] : search_regs.start[0]); + cursor += stride_for_teases; /* <sigh> we lose - */ } - else - cursor += stride_for_teases; /* <sigh> we lose - */ + pos += cursor - ptr2; } - pos += cursor - ptr2; - } - else - /* Now we'll pick up a clump that has to be done the hard - way because it covers a discontinuity */ - { - /* XEmacs change: definitions of CEILING_OF and FLOOR_OF - have changed. See buffer.h. */ - limit = ((direction > 0) - ? BI_BUF_CEILING_OF (buf, pos - dirlen + 1) - 1 - : BI_BUF_FLOOR_OF (buf, pos - dirlen)); - limit = ((direction > 0) - ? min (limit + len, lim - 1) - : max (limit - len, lim)); - /* LIMIT is now the last value POS can have - and still be valid for a possible match. */ - while (1) + else + /* Now we'll pick up a clump that has to be done the hard */ + /* way because it covers a discontinuity */ { - /* This loop can be coded for space rather than - speed because it will usually run only once. - (the reach is at most len + 21, and typically - does not exceed len) */ - while ((limit - pos) * direction >= 0) - /* *not* BI_BUF_FETCH_CHAR. We are working here - with bytes, not characters. */ - pos += BM_tab[*BI_BUF_BYTE_ADDRESS (buf, pos)]; - /* now run the same tests to distinguish going off - the end, a match or a phony match. */ - if ((pos - limit) * direction <= len) - break; /* ran off the end */ - /* Found what might be a match. - Set POS back to last (first if reverse) char pos. */ - pos -= infinity; - i = dirlen - direction; - while ((i -= direction) + direction != 0) - { -#ifdef MULE - Emchar ch; - Bufbyte *ptr; -#endif - pos -= direction; -#ifdef MULE - ptr = BI_BUF_BYTE_ADDRESS (buf, pos); - if ((ptr == tail_end_ptr - || BUFBYTE_FIRST_BYTE_P (ptr[1])) - && (BUFBYTE_FIRST_BYTE_P (ptr[0]) - || (translate_prev_byte == ptr[-1] - && (BUFBYTE_FIRST_BYTE_P (translate_prev_byte) - || translate_anteprev_byte == ptr[-2])))) - ch = simple_translate[*ptr]; - else - ch = *ptr; - if (pat[i] != ch) - break; - -#else - if (pat[i] != TRANSLATE (trt, - *BI_BUF_BYTE_ADDRESS (buf, pos))) - break; -#endif - } - /* Above loop has moved POS part or all the way back - to the first char pos (last char pos if reverse). - Set it once again at the last (first if reverse) - char. */ - pos += dirlen - i- direction; - if (i + direction == 0) + /* XEmacs change: definitions of CEILING_OF and FLOOR_OF + have changed. See buffer.h. */ + limit = ((direction > 0) + ? BI_BUF_CEILING_OF (buf, pos - dirlen + 1) - 1 + : BI_BUF_FLOOR_OF (buf, pos - dirlen)); + limit = ((direction > 0) + ? min (limit + len, lim - 1) + : max (limit - len, lim)); + /* LIMIT is now the last value POS can have + and still be valid for a possible match. */ + while (1) { - pos -= direction; + /* This loop can be coded for space rather than */ + /* speed because it will usually run only once. */ + /* (the reach is at most len + 21, and typically */ + /* does not exceed len) */ + while ((limit - pos) * direction >= 0) + /* *not* BI_BUF_FETCH_CHAR. We are working here + with bytes, not characters. */ + pos += BM_tab[*BI_BUF_BYTE_ADDRESS (buf, pos)]; + /* now run the same tests to distinguish going off the */ + /* end, a match or a phony match. */ + if ((pos - limit) * direction <= len) + break; /* ran off the end */ + /* Found what might be a match. + Set POS back to last (first if reverse) char pos. */ + pos -= infinity; + i = dirlen - direction; + while ((i -= direction) + direction != 0) + { + pos -= direction; + if (pat[i] != (((Bufbyte *) trt) + /* #### Does not handle TRT right */ + ? trt[*BI_BUF_BYTE_ADDRESS (buf, pos)] + : *BI_BUF_BYTE_ADDRESS (buf, pos))) + break; + } + /* Above loop has moved POS part or all the way + back to the first char pos (last char pos if reverse). + Set it once again at the last (first if reverse) char. */ + pos += dirlen - i- direction; + if (i + direction == 0) + { + pos -= direction; - { - Bytind bytstart = (pos + - ((direction > 0) - ? 1 - len : 0)); - Bufpos bufstart = bytind_to_bufpos (buf, bytstart); - Bufpos bufend = bytind_to_bufpos (buf, bytstart + len); - - set_search_regs (buf, bufstart, bufend - bufstart); - clear_unused_search_regs (&search_regs, 0); - } + { + Bytind bytstart = (pos + + ((direction > 0) + ? 1 - len : 0)); + Bufpos bufstart = bytind_to_bufpos (buf, bytstart); + Bufpos bufend = bytind_to_bufpos (buf, bytstart + len); - if ((n -= direction) != 0) - pos += dirlen; /* to resume search */ + set_search_regs (buf, bufstart, bufend - bufstart); + } + + if ((n -= direction) != 0) + pos += dirlen; /* to resume search */ + else + return ((direction > 0) + ? search_regs.end[0] : search_regs.start[0]); + } else - return ((direction > 0) - ? search_regs.end[0] : search_regs.start[0]); + pos += stride_for_teases; } - else - pos += stride_for_teases; - } + } + /* We have done one clump. Can we continue? */ + if ((lim - pos) * direction < 0) + return (0 - n) * direction; } - /* We have done one clump. Can we continue? */ - if ((lim - pos) * direction < 0) - return (0 - n) * direction; + return bytind_to_bufpos (buf, pos); } - return bytind_to_bufpos (buf, pos); } -/* Record the whole-match data (beginning BEG and end BEG + LEN) and the - buffer for a match just found. */ +/* Record beginning BEG and end BEG + LEN + for a match just found in the current buffer. */ static void set_search_regs (struct buffer *buf, Bufpos beg, Charcount len) @@ -1959,28 +1529,10 @@ set_search_regs (struct buffer *buf, Bufpos beg, Charcount len) XSETBUFFER (last_thing_searched, buf); } -/* Clear unused search registers so match data will be null. - REGP is a pointer to the register structure to clear, usually the global - search_regs. - NO_SUB is the number of subexpressions to allow for. (Does not count - the whole match, ie, for a string search NO_SUB == 0.) - It is an error if NO_SUB > REGP.num_regs - 1. */ - -static void -clear_unused_search_regs (struct re_registers *regp, int no_sub) -{ - /* This function has been Mule-ized. */ - int i; - - assert (no_sub >= 0 && no_sub < regp->num_regs); - for (i = no_sub + 1; i < regp->num_regs; i++) - regp->start[i] = regp->end[i] = -1; -} - /* Given a string of words separated by word delimiters, - compute a regexp that matches those exact words - separated by arbitrary punctuation. */ + compute a regexp that matches those exact words + separated by arbitrary punctuation. */ static Lisp_Object wordify (Lisp_Object buffer, Lisp_Object string) @@ -1988,7 +1540,8 @@ wordify (Lisp_Object buffer, Lisp_Object string) 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); @@ -2045,103 +1598,70 @@ wordify (Lisp_Object buffer, Lisp_Object string) DEFUN ("search-backward", Fsearch_backward, 1, 5, "sSearch backward: ", /* Search backward from point for STRING. Set point to the beginning of the occurrence found, and return point. - -Optional second argument LIMIT bounds the search; it is a buffer -position. The match found must not extend before that position. -The value nil is equivalent to (point-min). - -Optional third argument NOERROR, if t, means just return nil (no -error) if the search fails. If neither nil nor t, set point to LIMIT -and return nil. - -Optional fourth argument COUNT is a repeat count--search for -successive occurrences. - +An optional second argument bounds the search; it is a buffer position. +The match found must not extend before that position. +Optional third argument, if t, means if fail just return nil (no error). + If not nil and not t, position at limit of search and return nil. +Optional fourth argument is repeat count--search for successive occurrences. Optional fifth argument BUFFER specifies the buffer to search in and -defaults to the current buffer. - + defaults to the current buffer. See also the functions `match-beginning', `match-end' and `replace-match'. */ - (string, limit, noerror, count, buffer)) + (string, bound, no_error, count, buffer)) { - return search_command (string, limit, noerror, count, buffer, -1, 0, 0); + return search_command (string, bound, no_error, count, buffer, -1, 0, 0); } DEFUN ("search-forward", Fsearch_forward, 1, 5, "sSearch: ", /* Search forward from point for STRING. Set point to the end of the occurrence found, and return point. - -Optional second argument LIMIT bounds the search; it is a buffer -position. The match found must not extend after that position. The -value nil is equivalent to (point-max). - -Optional third argument NOERROR, if t, means just return nil (no -error) if the search fails. If neither nil nor t, set point to LIMIT -and return nil. - -Optional fourth argument COUNT is a repeat count--search for -successive occurrences. - +An optional second argument bounds the search; it is a buffer position. +The match found must not extend after that position. nil is equivalent + to (point-max). +Optional third argument, if t, means if fail just return nil (no error). + If not nil and not t, move to limit of search and return nil. +Optional fourth argument is repeat count--search for successive occurrences. Optional fifth argument BUFFER specifies the buffer to search in and -defaults to the current buffer. - + defaults to the current buffer. See also the functions `match-beginning', `match-end' and `replace-match'. */ - (string, limit, noerror, count, buffer)) + (string, bound, no_error, count, buffer)) { - return search_command (string, limit, noerror, count, buffer, 1, 0, 0); + return search_command (string, bound, no_error, count, buffer, 1, 0, 0); } DEFUN ("word-search-backward", Fword_search_backward, 1, 5, "sWord search backward: ", /* Search backward from point for STRING, ignoring differences in punctuation. Set point to the beginning of the occurrence found, and return point. - -Optional second argument LIMIT bounds the search; it is a buffer -position. The match found must not extend before that position. -The value nil is equivalent to (point-min). - -Optional third argument NOERROR, if t, means just return nil (no -error) if the search fails. If neither nil nor t, set point to LIMIT -and return nil. - -Optional fourth argument COUNT is a repeat count--search for -successive occurrences. - +An optional second argument bounds the search; it is a buffer position. +The match found must not extend before that position. +Optional third argument, if t, means if fail just return nil (no error). + If not nil and not t, move to limit of search and return nil. +Optional fourth argument is repeat count--search for successive occurrences. Optional fifth argument BUFFER specifies the buffer to search in and -defaults to the current buffer. - -See also the functions `match-beginning', `match-end' and `replace-match'. + defaults to the current buffer. */ - (string, limit, noerror, count, buffer)) + (string, bound, no_error, count, buffer)) { - return search_command (wordify (buffer, string), limit, noerror, count, + return search_command (wordify (buffer, string), bound, no_error, count, buffer, -1, 1, 0); } DEFUN ("word-search-forward", Fword_search_forward, 1, 5, "sWord search: ", /* Search forward from point for STRING, ignoring differences in punctuation. Set point to the end of the occurrence found, and return point. - -Optional second argument LIMIT bounds the search; it is a buffer -position. The match found must not extend after that position. The -value nil is equivalent to (point-max). - -Optional third argument NOERROR, if t, means just return nil (no -error) if the search fails. If neither nil nor t, set point to LIMIT -and return nil. - -Optional fourth argument COUNT is a repeat count--search for -successive occurrences. - +An optional second argument bounds the search; it is a buffer position. +The match found must not extend after that position. +Optional third argument, if t, means if fail just return nil (no error). + If not nil and not t, move to limit of search and return nil. +Optional fourth argument is repeat count--search for successive occurrences. Optional fifth argument BUFFER specifies the buffer to search in and -defaults to the current buffer. - -See also the functions `match-beginning', `match-end' and `replace-match'. + defaults to the current buffer. */ - (string, limit, noerror, count, buffer)) + (string, bound, no_error, count, buffer)) { - return search_command (wordify (buffer, string), limit, noerror, count, + return search_command (wordify (buffer, string), bound, no_error, count, buffer, 1, 1, 0); } @@ -2151,51 +1671,35 @@ Search backward from point for match for regular expression REGEXP. Set point to the beginning of the match, and return point. The match found is the one starting last in the buffer and yet ending before the origin of the search. - -Optional second argument LIMIT bounds the search; it is a buffer -position. The match found must not extend before that position. -The value nil is equivalent to (point-min). - -Optional third argument NOERROR, if t, means just return nil (no -error) if the search fails. If neither nil nor t, set point to LIMIT -and return nil. - -Optional fourth argument COUNT is a repeat count--search for -successive occurrences. - +An optional second argument bounds the search; it is a buffer position. +The match found must start at or after that position. +Optional third argument, if t, means if fail just return nil (no error). + If not nil and not t, move to limit of search and return nil. +Optional fourth argument is repeat count--search for successive occurrences. Optional fifth argument BUFFER specifies the buffer to search in and -defaults to the current buffer. - + defaults to the current buffer. See also the functions `match-beginning', `match-end' and `replace-match'. */ - (regexp, limit, noerror, count, buffer)) + (regexp, bound, no_error, count, buffer)) { - return search_command (regexp, limit, noerror, count, buffer, -1, 1, 0); + return search_command (regexp, bound, no_error, count, buffer, -1, 1, 0); } DEFUN ("re-search-forward", Fre_search_forward, 1, 5, "sRE search: ", /* Search forward from point for regular expression REGEXP. Set point to the end of the occurrence found, and return point. - -Optional second argument LIMIT bounds the search; it is a buffer -position. The match found must not extend after that position. The -value nil is equivalent to (point-max). - -Optional third argument NOERROR, if t, means just return nil (no -error) if the search fails. If neither nil nor t, set point to LIMIT -and return nil. - -Optional fourth argument COUNT is a repeat count--search for -successive occurrences. - +An optional second argument bounds the search; it is a buffer position. +The match found must not extend after that position. +Optional third argument, if t, means if fail just return nil (no error). + If not nil and not t, move to limit of search and return nil. +Optional fourth argument is repeat count--search for successive occurrences. Optional fifth argument BUFFER specifies the buffer to search in and -defaults to the current buffer. - + defaults to the current buffer. See also the functions `match-beginning', `match-end' and `replace-match'. */ - (regexp, limit, noerror, count, buffer)) + (regexp, bound, no_error, count, buffer)) { - return search_command (regexp, limit, noerror, count, buffer, 1, 1, 0); + return search_command (regexp, bound, no_error, count, buffer, 1, 1, 0); } DEFUN ("posix-search-backward", Fposix_search_backward, 1, 5, @@ -2205,52 +1709,36 @@ Find the longest match in accord with Posix regular expression rules. Set point to the beginning of the match, and return point. The match found is the one starting last in the buffer and yet ending before the origin of the search. - -Optional second argument LIMIT bounds the search; it is a buffer -position. The match found must not extend before that position. -The value nil is equivalent to (point-min). - -Optional third argument NOERROR, if t, means just return nil (no -error) if the search fails. If neither nil nor t, set point to LIMIT -and return nil. - -Optional fourth argument COUNT is a repeat count--search for -successive occurrences. - +An optional second argument bounds the search; it is a buffer position. +The match found must start at or after that position. +Optional third argument, if t, means if fail just return nil (no error). + If not nil and not t, move to limit of search and return nil. +Optional fourth argument is repeat count--search for successive occurrences. Optional fifth argument BUFFER specifies the buffer to search in and -defaults to the current buffer. - + defaults to the current buffer. See also the functions `match-beginning', `match-end' and `replace-match'. */ - (regexp, limit, noerror, count, buffer)) + (regexp, bound, no_error, count, buffer)) { - return search_command (regexp, limit, noerror, count, buffer, -1, 1, 1); + return search_command (regexp, bound, no_error, count, buffer, -1, 1, 1); } DEFUN ("posix-search-forward", Fposix_search_forward, 1, 5, "sPosix search: ", /* Search forward from point for regular expression REGEXP. Find the longest match in accord with Posix regular expression rules. Set point to the end of the occurrence found, and return point. - -Optional second argument LIMIT bounds the search; it is a buffer -position. The match found must not extend after that position. The -value nil is equivalent to (point-max). - -Optional third argument NOERROR, if t, means just return nil (no -error) if the search fails. If neither nil nor t, set point to LIMIT -and return nil. - -Optional fourth argument COUNT is a repeat count--search for -successive occurrences. - +An optional second argument bounds the search; it is a buffer position. +The match found must not extend after that position. +Optional third argument, if t, means if fail just return nil (no error). + If not nil and not t, move to limit of search and return nil. +Optional fourth argument is repeat count--search for successive occurrences. Optional fifth argument BUFFER specifies the buffer to search in and -defaults to the current buffer. - + defaults to the current buffer. See also the functions `match-beginning', `match-end' and `replace-match'. */ - (regexp, limit, noerror, count, buffer)) + (regexp, bound, no_error, count, buffer)) { - return search_command (regexp, limit, noerror, count, buffer, 1, 1, 1); + return search_command (regexp, bound, no_error, count, buffer, 1, 1, 1); } @@ -2266,18 +1754,18 @@ free_created_dynarrs (Lisp_Object cons) } DEFUN ("replace-match", Freplace_match, 1, 5, 0, /* -Replace text matched by last search with REPLACEMENT. +Replace text matched by last search with NEWTEXT. If second arg FIXEDCASE is non-nil, do not alter case of replacement text. Otherwise maybe capitalize the whole text, or maybe just word initials, based on the replaced text. If the replaced text has only capital letters -and has at least one multiletter word, convert REPLACEMENT to all caps. +and has at least one multiletter word, convert NEWTEXT to all caps. If the replaced text has at least one word starting with a capital letter, -then capitalize each word in REPLACEMENT. +then capitalize each word in NEWTEXT. -If third arg LITERAL is non-nil, insert REPLACEMENT literally. +If third arg LITERAL is non-nil, insert NEWTEXT literally. Otherwise treat `\\' as special: - `\\&' in REPLACEMENT means substitute original matched text. + `\\&' in NEWTEXT means substitute original matched text. `\\N' means substitute what matched the Nth `\\(...\\)'. If Nth parens didn't match, substitute nothing. `\\\\' means insert one `\\'. @@ -2296,16 +1784,11 @@ In that case, this function creates and returns a new string which is made by replacing the part of STRING that was matched. When fourth argument is a string, fifth argument STRBUFFER specifies the buffer to be used for syntax-table and case-table lookup and -defaults to the current buffer. When fourth argument is not a string, +defaults to the current buffer. (When fourth argument is not a string, the buffer that the match occurred in has automatically been remembered -and you do not need to specify it. - -When fourth argument is nil, STRBUFFER specifies a subexpression of -the match. It says to replace just that subexpression instead of the -whole match. This is useful only after a regular expression search or -match since only regular expressions have distinguished subexpressions. +and you do not need to specify it.) */ - (replacement, fixedcase, literal, string, strbuffer)) + (newtext, fixedcase, literal, string, strbuffer)) { /* This function has been Mule-ized. */ /* This function can GC */ @@ -2318,15 +1801,14 @@ match since only regular expressions have distinguished subexpressions. 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; int_dynarr *ul_pos_dynarr = 0; - int sub = 0; int speccount; - CHECK_STRING (replacement); + CHECK_STRING (newtext); if (! NILP (string)) { @@ -2344,13 +1826,6 @@ match since only regular expressions have distinguished subexpressions. } else { - if (!NILP (strbuffer)) - { - CHECK_INT (strbuffer); - sub = XINT (strbuffer); - if (sub < 0 || sub >= (int) search_regs.num_regs) - args_out_of_range (strbuffer, make_int (search_regs.num_regs)); - } if (!BUFFERP (last_thing_searched)) error ("last thing matched was not a buffer"); buffer = last_thing_searched; @@ -2362,16 +1837,16 @@ match since only regular expressions have distinguished subexpressions. case_action = nochange; /* We tried an initialization */ /* but some C compilers blew it */ - if (search_regs.num_regs == 0) + if (search_regs.num_regs <= 0) error ("replace-match called before any match found"); if (NILP (string)) { - if (search_regs.start[sub] < BUF_BEGV (buf) - || search_regs.start[sub] > search_regs.end[sub] - || search_regs.end[sub] > BUF_ZV (buf)) - args_out_of_range (make_int (search_regs.start[sub]), - make_int (search_regs.end[sub])); + if (search_regs.start[0] < BUF_BEGV (buf) + || search_regs.start[0] > search_regs.end[0] + || search_regs.end[0] > BUF_ZV (buf)) + args_out_of_range (make_int (search_regs.start[0]), + make_int (search_regs.end[0])); } else { @@ -2386,7 +1861,7 @@ match since only regular expressions have distinguished subexpressions. { /* Decide how to casify by examining the matched text. */ - last = search_regs.end[sub]; + last = search_regs.end[0]; prevc = '\n'; case_action = all_caps; @@ -2397,7 +1872,7 @@ match since only regular expressions have distinguished subexpressions. some_nonuppercase_initial = 0; some_uppercase = 0; - for (pos = search_regs.start[sub]; pos < last; pos++) + for (pos = search_regs.start[0]; pos < last; pos++) { if (NILP (string)) c = BUF_FETCH_CHAR (buf, pos); @@ -2457,10 +1932,10 @@ match since only regular expressions have distinguished subexpressions. before = Fsubstring (string, Qzero, make_int (search_regs.start[0])); after = Fsubstring (string, make_int (search_regs.end[0]), Qnil); - /* Do case substitution into REPLACEMENT if desired. */ + /* Do case substitution into NEWTEXT if desired. */ if (NILP (literal)) { - Charcount stlen = XSTRING_CHAR_LENGTH (replacement); + Charcount stlen = XSTRING_CHAR_LENGTH (newtext); Charcount strpos; /* XEmacs change: rewrote this loop somewhat to make it cleaner. Also added \U, \E, etc. */ @@ -2487,10 +1962,10 @@ match since only regular expressions have distinguished subexpressions. Charcount substart = -1; Charcount subend = -1; - c = string_char (XSTRING (replacement), strpos); - if (c == '\\' && strpos < stlen - 1) + c = string_char (XSTRING (newtext), strpos); + if (c == '\\') { - c = string_char (XSTRING (replacement), ++strpos); + c = string_char (XSTRING (newtext), ++strpos); if (c == '&') { literal_end = strpos - 1; @@ -2539,7 +2014,7 @@ match since only regular expressions have distinguished subexpressions. Lisp_Object literal_text = Qnil; Lisp_Object substring = Qnil; if (literal_end != literal_start) - literal_text = Fsubstring (replacement, + literal_text = Fsubstring (newtext, make_int (literal_start), make_int (literal_end)); if (substart >= 0 && subend != substart) @@ -2554,33 +2029,29 @@ match since only regular expressions have distinguished subexpressions. if (strpos != literal_start) /* some literal text at end to be inserted */ - replacement = concat2 (accum, Fsubstring (replacement, - make_int (literal_start), - make_int (strpos))); + newtext = concat2 (accum, Fsubstring (newtext, + make_int (literal_start), + make_int (strpos))); else - replacement = accum; + newtext = accum; } - /* replacement can be nil. */ - if (NILP (replacement)) - replacement = build_string (""); - if (case_action == all_caps) - replacement = Fupcase (replacement, buffer); + newtext = Fupcase (newtext, buffer); else if (case_action == cap_initial) - replacement = Fupcase_initials (replacement, buffer); + newtext = Fupcase_initials (newtext, buffer); /* Now finally, we need to process the \U's, \E's, etc. */ if (ul_pos_dynarr) { int i = 0; int cur_action = 'E'; - Charcount stlen = XSTRING_CHAR_LENGTH (replacement); + Charcount stlen = XSTRING_CHAR_LENGTH (newtext); Charcount strpos; for (strpos = 0; strpos < stlen; strpos++) { - Emchar curchar = string_char (XSTRING (replacement), strpos); + Emchar curchar = string_char (XSTRING (newtext), strpos); Emchar newchar = -1; if (i < Dynarr_length (ul_pos_dynarr) && strpos == Dynarr_at (ul_pos_dynarr, i)) @@ -2604,17 +2075,17 @@ match since only regular expressions have distinguished subexpressions. newchar = curchar; } if (newchar != curchar) - set_string_char (XSTRING (replacement), strpos, newchar); + set_string_char (XSTRING (newtext), strpos, newchar); } } /* frees the Dynarrs if necessary. */ unbind_to (speccount, Qnil); - return concat3 (before, replacement, after); + return concat3 (before, newtext, after); } - mc_count = begin_multiple_change (buf, search_regs.start[sub], - search_regs.end[sub]); + mc_count = begin_multiple_change (buf, search_regs.start[0], + search_regs.end[0]); /* begin_multiple_change() records an unwind-protect, so we need to record this value now. */ @@ -2624,33 +2095,23 @@ match since only regular expressions have distinguished subexpressions. delete the original text. This means that markers at the beginning or end of the original will float to the corresponding position in the replacement. */ - BUF_SET_PT (buf, search_regs.start[sub]); + BUF_SET_PT (buf, search_regs.start[0]); if (!NILP (literal)) - Finsert (1, &replacement); + Finsert (1, &newtext); else { - Charcount stlen = XSTRING_CHAR_LENGTH (replacement); + Charcount stlen = XSTRING_CHAR_LENGTH (newtext); Charcount strpos; struct gcpro gcpro1; - GCPRO1 (replacement); + GCPRO1 (newtext); for (strpos = 0; strpos < stlen; strpos++) { - /* on the first iteration assert(offset==0), - exactly complementing BUF_SET_PT() above. - During the loop, it keeps track of the amount inserted. - */ - Charcount offset = BUF_PT (buf) - search_regs.start[sub]; - - c = string_char (XSTRING (replacement), strpos); - if (c == '\\' && strpos < stlen - 1) + Charcount offset = BUF_PT (buf) - search_regs.start[0]; + + c = string_char (XSTRING (newtext), strpos); + if (c == '\\') { - /* XXX FIXME: replacing just a substring non-literally - using backslash refs to the match looks dangerous. But - <15366.18513.698042.156573@ns.caldera.de> from Torsten Duwe - <duwe@caldera.de> claims Finsert_buffer_substring already - handles this correctly. - */ - c = string_char (XSTRING (replacement), ++strpos); + c = string_char (XSTRING (newtext), ++strpos); if (c == '&') Finsert_buffer_substring (buffer, @@ -2692,9 +2153,9 @@ match since only regular expressions have distinguished subexpressions. UNGCPRO; } - inslen = BUF_PT (buf) - (search_regs.start[sub]); - buffer_delete_range (buf, search_regs.start[sub] + inslen, - search_regs.end[sub] + inslen, 0); + inslen = BUF_PT (buf) - (search_regs.start[0]); + buffer_delete_range (buf, search_regs.start[0] + inslen, search_regs.end[0] + + inslen, 0); if (case_action == all_caps) Fupcase_region (make_int (BUF_PT (buf) - inslen), @@ -2758,7 +2219,7 @@ match_limit (Lisp_Object num, int beginningp) n = XINT (num); if (n < 0 || n >= search_regs.num_regs) args_out_of_range (num, make_int (search_regs.num_regs)); - if (search_regs.num_regs == 0 || + if (search_regs.num_regs <= 0 || search_regs.start[n] < 0) return Qnil; return make_int (beginningp ? search_regs.start[n] : search_regs.end[n]); @@ -2849,7 +2310,7 @@ to hold all the values, and if INTEGERS is non-nil, no consing is done. /* If REUSE is a list, store as many value elements as will fit into the elements of REUSE. */ - for (prev = Qnil, i = 0, tail = reuse; CONSP (tail); i++, tail = XCDR (tail)) + for (i = 0, tail = reuse; CONSP (tail); i++, tail = XCDR (tail)) { if (i < 2 * len + 2) XCAR (tail) = data[i]; @@ -2879,11 +2340,8 @@ LIST should have been created by calling `match-data' previously. int num_regs; int length; -#if 0 - /* #### according to 21.5 comment, unnecessary */ if (running_asynch_code) save_search_regs (); -#endif CONCHECK_LIST (list); @@ -2946,7 +2404,6 @@ LIST should have been created by calling `match-data' previously. return Qnil; } -/* #### according to 21.5 comment, unnecessary */ /* If non-zero the match data have been saved in saved_search_regs during the execution of a sentinel or filter. */ static int search_regs_saved; @@ -2970,8 +2427,6 @@ save_search_regs (void) } } -/* #### according to 21.5 comment, unnecessary - prototype in lisp.h, all calls in process.c */ /* Called upon exit from filters and sentinels. */ void restore_match_data (void) @@ -2996,19 +2451,19 @@ restore_match_data (void) DEFUN ("regexp-quote", Fregexp_quote, 1, 1, 0, /* Return a regexp string which matches exactly STRING and nothing else. */ - (string)) + (str)) { REGISTER Bufbyte *in, *out, *end; REGISTER Bufbyte *temp; - CHECK_STRING (string); + CHECK_STRING (str); - temp = (Bufbyte *) alloca (XSTRING_LENGTH (string) * 2); + temp = (Bufbyte *) alloca (XSTRING_LENGTH (str) * 2); /* Now copy the data into the new string, inserting escapes. */ - in = XSTRING_DATA (string); - end = in + XSTRING_LENGTH (string); + in = XSTRING_DATA (str); + end = in + XSTRING_LENGTH (str); out = temp; while (in < end) @@ -3046,8 +2501,8 @@ void syms_of_search (void) { - DEFERROR_STANDARD (Qsearch_failed, Qinvalid_operation); - DEFERROR_STANDARD (Qinvalid_regexp, Qsyntax_error); + deferror (&Qsearch_failed, "search-failed", "Search failed", Qerror); + deferror (&Qinvalid_regexp, "invalid-regexp", "Invalid regexp", Qerror); DEFSUBR (Flooking_at); DEFSUBR (Fposix_looking_at); @@ -3075,12 +2530,9 @@ syms_of_search (void) } 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) { @@ -3088,16 +2540,13 @@ reinit_vars_of_search (void) 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 --git a/src/select-gtk.c b/src/select-gtk.c index b1251ba..a11cb63 100644 --- a/src/select-gtk.c +++ b/src/select-gtk.c @@ -38,7 +38,6 @@ Boston, MA 02111-1307, USA. */ #include "opaque.h" #include "frame.h" -int lisp_to_time (Lisp_Object, time_t *); static Lisp_Object Vretrieved_selection; static gboolean waiting_for_selection; Lisp_Object Vgtk_sent_selection_hooks; @@ -209,40 +208,6 @@ emacs_gtk_selection_handle (GtkWidget *widget, } -void -emacs_gtk_selection_clear_event_handle (GtkWidget *widget, - GdkEventSelection *event, - gpointer data) -{ - GdkAtom selection = event->selection; - guint32 changed_owner_time = event->time; - struct device *d = decode_gtk_device (Qnil); - - Lisp_Object selection_symbol, local_selection_time_lisp; - guint32 local_selection_time; - - selection_symbol = 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 = *(guint32 *) 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 != GDK_CURRENT_TIME && - local_selection_time > changed_owner_time) - return; - - handle_selection_clear (selection_symbol); -} - - static GtkWidget *reading_selection_reply; static GdkAtom reading_which_selection; diff --git a/src/select-x.c b/src/select-x.c index 05c71a1..cc6031a 100644 --- a/src/select-x.c +++ b/src/select-x.c @@ -46,8 +46,7 @@ Lisp_Object time_to_lisp (time_t); static void hack_motif_clipboard_selection (Atom selection_atom, Lisp_Object selection_value, Time thyme, Display *display, - Window selecting_window, - int owned_p); + Window selecting_window); #endif #define CUT_BUFFER_SUPPORT @@ -73,10 +72,7 @@ Lisp_Object Vx_sent_selection_hooks; /* 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). */ -Fixnum x_selection_timeout; - -/* Enable motif selection optimizations. */ -int x_selection_strict_motif_ownership; +int x_selection_timeout; /* Utility functions */ @@ -88,7 +84,7 @@ static void lisp_data_to_selection_data (struct device *, unsigned int *size_ret, int *format_ret); static Lisp_Object selection_data_to_lisp_data (struct device *, - Extbyte *data, + unsigned char *data, size_t size, Atom type, int format); @@ -142,8 +138,8 @@ symbol_to_x_atom (struct device *d, Lisp_Object sym, int only_if_exists) #endif /* CUT_BUFFER_SUPPORT */ { - const char *nameext; - LISP_STRING_TO_EXTERNAL (Fsymbol_name (sym), nameext, Qctext); + CONST char *nameext; + GET_C_STRING_CTEXT_DATA_ALLOCA (Fsymbol_name (sym), nameext); return XInternAtom (display, nameext, only_if_exists ? True : False); } } @@ -187,26 +183,26 @@ x_atom_to_symbol (struct device *d, Atom atom) #endif { - char *intstr; + Lisp_Object newsym; + CONST Bufbyte *intstr; char *str = XGetAtomName (display, atom); if (! str) return Qnil; - TO_INTERNAL_FORMAT (C_STRING, str, - C_STRING_ALLOCA, intstr, - Qctext); + GET_C_CHARPTR_INT_CTEXT_DATA_ALLOCA (str, intstr); + newsym = intern ((char *) intstr); XFree (str); - return intern (intstr); + 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 Lisp_Object -x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, - Lisp_Object how_to_add, Lisp_Object selection_type, - int owned_p) +x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value) { struct device *d = decode_x_device (Qnil); Display *display = DEVICE_X_DISPLAY (d); @@ -231,14 +227,14 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, 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)); + selection_time = make_opaque (sizeof (thyme), (void *) &thyme); #ifdef MOTIF_CLIPBOARDS hack_motif_clipboard_selection (selection_atom, selection_value, - thyme, display, selecting_window, owned_p); + thyme, display, selecting_window); #endif return selection_time; } @@ -254,8 +250,8 @@ hack_motif_clipboard_selection (Atom selection_atom, Lisp_Object selection_value, Time thyme, Display *display, - Window selecting_window, - int owned_p) + 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 @@ -275,10 +271,7 @@ hack_motif_clipboard_selection (Atom selection_atom, 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 - /* Selectively re-enable this because for most users its - just too painful - especially over a remote link. */ - || x_selection_strict_motif_ownership) +/* && !owned_p */ ) { #ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK @@ -292,13 +285,13 @@ hack_motif_clipboard_selection (Atom selection_atom, #endif XmString fmh; String encoding = "STRING"; - const Bufbyte *data = XSTRING_DATA (selection_value); - Bytecount bytes = XSTRING_LENGTH (selection_value); + 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; + CONST Bufbyte *ptr = data, *end = ptr + bytes; /* Optimize for the common ASCII case */ while (ptr <= end) { @@ -321,14 +314,10 @@ hack_motif_clipboard_selection (Atom selection_atom, } if (chartypes == LATIN_1) - TO_EXTERNAL_FORMAT (LISP_STRING, selection_value, - ALLOCA, (data, bytes), - Qbinary); + GET_STRING_BINARY_DATA_ALLOCA (selection_value, data, bytes); else if (chartypes == WORLD) { - TO_EXTERNAL_FORMAT (LISP_STRING, selection_value, - ALLOCA, (data, bytes), - Qctext); + GET_STRING_CTEXT_DATA_ALLOCA (selection_value, data, bytes); encoding = "COMPOUND_TEXT"; } } @@ -380,34 +369,10 @@ motif_clipboard_cb (Widget widget, int *data_id, int *private_id, int *reason) { 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")); - - + 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, @@ -575,8 +540,8 @@ void x_handle_selection_request (XSelectionRequestEvent *event) { /* This function can GC */ - struct gcpro gcpro1, gcpro2; - Lisp_Object temp_obj; + 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; @@ -585,27 +550,32 @@ x_handle_selection_request (XSelectionRequestEvent *event) int count; struct device *d = get_device_from_display (event->display); - GCPRO2 (converted_selection, target_symbol); + GCPRO3 (local_selection_data, 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 + local_selection_data = assq_no_quit (selection_symbol, Vselection_alist); - temp_obj = Fget_selection_timestamp (selection_symbol); +#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 (temp_obj)) + if (NILP (local_selection_data)) { - /* We don't appear to have the selection. */ + /* 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 (temp_obj); + local_selection_time = + * (Time *) XOPAQUE_DATA (XCAR (XCDR (XCDR (local_selection_data)))); if (event->time != CurrentTime && local_selection_time > event->time) @@ -616,36 +586,35 @@ x_handle_selection_request (XSelectionRequestEvent *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)); + target_symbol = x_atom_to_symbol (d, event->target); - { - 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); - } +#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 = + 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: @@ -654,15 +623,17 @@ x_handle_selection_request (XSelectionRequestEvent *event) /* 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)) { - 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); + call3 (Fcar(rest), selection_symbol, target_symbol, + successful_p); else - call3 (val, selection_symbol, target_symbol, successful_p); + call3 (val, selection_symbol, target_symbol, + successful_p); } } } @@ -678,18 +649,18 @@ x_handle_selection_clear (XSelectionClearEvent *event) Atom selection = event->selection; Time changed_owner_time = event->time; - Lisp_Object selection_symbol, local_selection_time_lisp; + Lisp_Object selection_symbol, local_selection_data; Time local_selection_time; selection_symbol = x_atom_to_symbol (d, selection); - local_selection_time_lisp = Fget_selection_timestamp (selection_symbol); + local_selection_data = assq_no_quit (selection_symbol, Vselection_alist); - /* We don't own the selection, so that's fine. */ - if (NILP (local_selection_time_lisp)) - return; + /* 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 (local_selection_time_lisp); + 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 @@ -698,7 +669,7 @@ x_handle_selection_clear (XSelectionClearEvent *event) if (changed_owner_time != CurrentTime && local_selection_time > changed_owner_time) return; - + handle_selection_clear (selection_symbol); } @@ -943,24 +914,20 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type) 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)); + 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, - Extbyte **data_ret, int *bytes_ret, + unsigned char **data_ret, int *bytes_ret, Atom *actual_type_ret, int *actual_format_ret, unsigned long *actual_size_ret, int delete_p) { - size_t total_size; + int total_size; unsigned long bytes_remaining; int offset = 0; unsigned char *tmp_data = 0; @@ -991,7 +958,7 @@ x_get_window_property (Display *display, Window window, Atom property, } total_size = bytes_remaining + 1; - *data_ret = (Extbyte *) xmalloc (total_size); + *data_ret = (unsigned char *) xmalloc (total_size); /* Now read, until we've gotten it all. */ while (bytes_remaining) @@ -1028,7 +995,7 @@ 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, - Extbyte **data_ret, int *size_bytes_ret, + unsigned char **data_ret, int *size_bytes_ret, Atom *type_ret, int *format_ret, unsigned long *size_ret) { @@ -1036,7 +1003,7 @@ receive_incremental_selection (Display *display, Window window, Atom property, int offset = 0; int prop_id; *size_bytes_ret = min_size_bytes; - *data_ret = (Extbyte *) xmalloc (*size_bytes_ret); + *data_ret = (unsigned char *) xmalloc (*size_bytes_ret); #if 0 stderr_out ("\nread INCR %d\n", min_size_bytes); #endif @@ -1052,7 +1019,7 @@ receive_incremental_selection (Display *display, Window window, Atom property, PropertyNewValue); while (1) { - Extbyte *tmp_data; + unsigned char *tmp_data; int tmp_size_bytes; wait_for_property_change (prop_id); /* expect it again immediately, because x_get_window_property may @@ -1084,7 +1051,7 @@ receive_incremental_selection (Display *display, Window window, Atom property, *size_bytes_ret, offset + tmp_size_bytes); #endif *size_bytes_ret = offset + tmp_size_bytes; - *data_ret = (Extbyte *) xrealloc (*data_ret, *size_bytes_ret); + *data_ret = (unsigned char *) xrealloc (*data_ret, *size_bytes_ret); } memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes); offset += tmp_size_bytes; @@ -1105,7 +1072,7 @@ x_get_window_property_as_lisp_data (Display *display, Atom actual_type; int actual_format; unsigned long actual_size; - Extbyte *data = NULL; + unsigned char *data = NULL; int bytes = 0; Lisp_Object val; struct device *d = get_device_from_display (display); @@ -1150,9 +1117,6 @@ x_get_window_property_as_lisp_data (Display *display, 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. @@ -1187,7 +1151,7 @@ x_get_window_property_as_lisp_data (Display *display, static Lisp_Object selection_data_to_lisp_data (struct device *d, - Extbyte *data, + unsigned char *data, size_t size, Atom type, int format) @@ -1200,7 +1164,7 @@ selection_data_to_lisp_data (struct device *d, return make_ext_string (data, size, type == DEVICE_XATOM_TEXT (d) || type == DEVICE_XATOM_COMPOUND_TEXT (d) - ? Qctext : Qbinary); + ? FORMAT_CTEXT : FORMAT_BINARY); /* Convert a single atom to a Lisp Symbol. Convert a set of atoms to a vector of symbols. */ @@ -1296,12 +1260,13 @@ lisp_data_to_selection_data (struct device *d, } else if (STRINGP (obj)) { - const Extbyte *extval; + CONST Extbyte *extval; Extcount extvallen; - TO_EXTERNAL_FORMAT (LISP_STRING, obj, - ALLOCA, (extval, extvallen), - (NILP (type) ? Qctext : Qbinary)); + 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); @@ -1316,14 +1281,12 @@ lisp_data_to_selection_data (struct device *d, { Bufbyte buf[MAX_EMCHAR_LEN]; Bytecount len; - const Extbyte *extval; + 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); + 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); @@ -1497,8 +1460,7 @@ x_disown_selection (Lisp_Object selection, Lisp_Object timeval) } static Lisp_Object -x_selection_exists_p (Lisp_Object selection, - Lisp_Object selection_type) +x_selection_exists_p (Lisp_Object selection) { struct device *d = decode_x_device (Qnil); Display *dpy = DEVICE_X_DISPLAY (d); @@ -1515,7 +1477,7 @@ static int cut_buffers_initialized; /* Whether we're sure they all exist */ static void initialize_cut_buffers (Display *display, Window window) { - static unsigned const char * const data = (unsigned const char *) ""; + 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); @@ -1530,18 +1492,15 @@ initialize_cut_buffers (Display *display, Window window) 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) +#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). @@ -1552,7 +1511,7 @@ Return the value of the named CUTBUFFER (typically CUT_BUFFER0). Display *display = DEVICE_X_DISPLAY (d); Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ Atom cut_buffer_atom; - Extbyte *data; + unsigned char *data; int bytes; Atom type; int format; @@ -1578,7 +1537,7 @@ Return the value of the named CUTBUFFER (typically CUT_BUFFER0). ret = (bytes ? make_ext_string (data, bytes, memchr (data, 0x1b, bytes) ? - Qctext : Qbinary) + FORMAT_CTEXT : FORMAT_BINARY) : Qnil); xfree (data); return ret; @@ -1594,12 +1553,12 @@ Set the value of the named CUTBUFFER (typically CUT_BUFFER0) to STRING. Display *display = DEVICE_X_DISPLAY (d); Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ Atom cut_buffer_atom; - const Bufbyte *data = XSTRING_DATA (string); - Bytecount bytes = XSTRING_LENGTH (string); - Bytecount bytes_remaining; + 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; + CONST Bufbyte *ptr, *end; enum { ASCII, LATIN_1, WORLD } chartypes = ASCII; #endif @@ -1641,13 +1600,9 @@ Set the value of the named CUTBUFFER (typically CUT_BUFFER0) to STRING. } if (chartypes == LATIN_1) - TO_EXTERNAL_FORMAT (LISP_STRING, string, - ALLOCA, (data, bytes), - Qbinary); + GET_STRING_BINARY_DATA_ALLOCA (string, data, bytes); else if (chartypes == WORLD) - TO_EXTERNAL_FORMAT (LISP_STRING, string, - ALLOCA, (data, bytes), - Qctext); + GET_STRING_CTEXT_DATA_ALLOCA (string, data, bytes); #endif /* MULE */ bytes_remaining = bytes; @@ -1703,7 +1658,7 @@ positive means move values forward, negative means backward. /************************************************************************/ void -syms_of_select_x (void) +syms_of_xselect (void) { #ifdef CUT_BUFFER_SUPPORT @@ -1739,24 +1694,18 @@ console_type_create_select_x (void) } void -reinit_vars_of_select_x (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; -} - -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 @@ -1780,21 +1729,10 @@ 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; - - DEFVAR_BOOL ("x-selection-strict-motif-ownership", &x_selection_strict_motif_ownership /* -*If nil and XEmacs already owns the clipboard, don't own it again in the -Motif way. Owning the selection on the Motif way does a huge amount of -X protocol, and it makes killing text incredibly slow when using an -X terminal. However, when enabled 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. -*/ ); - x_selection_strict_motif_ownership = 1; } void -Xatoms_of_select_x (struct device *d) +Xatoms_of_xselect (struct device *d) { Display *D = DEVICE_X_DISPLAY (d); @@ -1809,7 +1747,5 @@ Xatoms_of_select_x (struct device *d) 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 --git a/src/select.c b/src/select.c index 9e6447e..ecc22ca 100644 --- a/src/select.c +++ b/src/select.c @@ -26,7 +26,6 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" #include "device.h" -#include "extents.h" #include "console.h" #include "objects.h" @@ -34,48 +33,28 @@ Boston, MA 02111-1307, USA. */ #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_DIBV5, 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, Qselect_coerce; - -/* 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. +/* 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_out_alist; -Lisp_Object Vselection_converter_in_alist; -Lisp_Object Vselection_coercion_alist; -Lisp_Object Vselection_appender_alist; -Lisp_Object Vselection_buffer_killed_alist; -Lisp_Object Vselection_coercible_types; +Lisp_Object Vselection_converter_alist; 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-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 @@ -85,305 +64,185 @@ Lisp_Object Vlost_selection_hooks; */ 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) +clean_local_selection_data (Lisp_Object obj) { - Lisp_Object local_value = assq_no_quit (selection_symbol, Vselection_alist); - - if (!NILP (local_value)) + 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))) { - 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); + if (XINT (XCAR (obj)) == 0) + return XCDR (obj); + if (XINT (XCAR (obj)) == -1) + return make_int (- XINT (XCDR (obj))); } - - return Qnil; + 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; } -/* #### 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, /* -Give the selection SELECTION-NAME the value SELECTION-VALUE. -SELECTION-NAME is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. -SELECTION-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. -Optional arg HOW-TO-ADD specifies how the selection will be combined -with any existing selection(s) - see `own-selection' for more -information. -Optional arg DATA-TYPE is a window-system-specific type. -Optional arg DEVICE specifies the device on which to assert the selection. -It defaults to the selected device. -*/ - (selection_name, selection_value, how_to_add, data_type, device)) +/* 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. + */ +Lisp_Object +get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type) { - Lisp_Object selection_time, selection_data, prev_value = Qnil, - value_list = Qnil; - Lisp_Object prev_real_value = Qnil; - struct gcpro gcpro1; - int owned_p = 0; - - CHECK_SYMBOL (selection_name); - if (NILP (selection_value)) error ("selection-value may not be nil."); - - if (NILP (device)) - device = Fselected_device (Qnil); + /* This function can GC */ + Lisp_Object handler_fn, value, check; + Lisp_Object local_value = assq_no_quit (selection_symbol, Vselection_alist); - 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 + if (NILP (local_value)) return Qnil; - /* Examine the how-to-add argument */ - if (EQ (how_to_add, Qreplace_all) || NILP (how_to_add)) + /* TIMESTAMP and MULTIPLE are special cases 'cause that's easiest. */ + if (EQ (target_type, QTIMESTAMP)) { - Lisp_Object local_selection_data = assq_no_quit (selection_name, - Vselection_alist); - - if (!NILP (local_selection_data)) - { - owned_p = 1; - /* 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; - } - } - } + handler_fn = Qnil; + value = XCAR (XCDR (XCDR (local_value))); } - else - { - /* Look for a previous value */ - prev_value = assq_no_quit (selection_name, Vselection_alist); - if (!NILP (prev_value)) - { - owned_p = 1; - 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))) +#if 0 /* #### MULTIPLE doesn't work yet and probably never will */ + else if (CONSP (target_type) && + XCAR (target_type) == QMULTIPLE) { - /* Did we have anything of this type previously? */ - if (!NILP (prev_real_value)) + 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++) { - 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."); + Lisp_Object pair = XVECTOR_DATA (pairs) [i]; + XVECTOR_DATA (pair) [1] = + x_get_local_selection (XVECTOR_DATA (pair) [0], + XVECTOR_DATA (pair) [1]); } - - 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); + return pairs; } +#endif else { - selection_data = prev_value; - Fsetcar (XCDR (selection_data), value_list); + 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))); } - 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, owned_p)); - 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); + /* 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); - if (HAS_DEVMETH_P (XDEVICE (device), register_selection_data_type)) - return DEVMETH (XDEVICE (device), register_selection_data_type, - (data_type)); + /* 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 - return Qnil; -} + signal_error (Qerror, + list3 (build_string + ("unrecognized selection-conversion type"), + handler_fn, + value)); -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; + return Qnil; /* suppress compiler warning */ } -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. +DEFUN ("own-selection-internal", Fown_selection_internal, 2, 3, 0, /* +Assert a 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, device)) + (selection_name, selection_value, device)) { - Lisp_Object types = Qnil, rest; - struct gcpro gcpro1; + Lisp_Object selection_time, selection_data, prev_value; CHECK_SYMBOL (selection_name); + if (NILP (selection_value)) error ("selection-value may not be nil."); 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)) + /* Now update the local cache */ + selection_data = list3 (selection_name, + selection_value, + Qnil); + 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)) { - UNGCPRO; - - return types; + 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; + } } - /* 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); - } + /* 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)); + else + selection_time = Qnil; - UNGCPRO; + Fsetcar (XCDR (XCDR (selection_data)), selection_time); - return types; + return selection_value; } /* remove a selection from our local copy @@ -391,8 +250,7 @@ so it should be taken as a minimal estimate of what is available. void handle_selection_clear (Lisp_Object selection_symbol) { - Lisp_Object local_selection_data = assq_no_quit (selection_symbol, - Vselection_alist); + 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; @@ -442,15 +300,15 @@ If we own the named selection, then disown it (make there be no selection). 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 the current emacs process owns SELECTION. -SELECTION should be the name of the selection in question, typically one of +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.) */ @@ -463,74 +321,48 @@ nil is the same as PRIMARY, and t is the same as SECONDARY.) return NILP (Fassq (selection, Vselection_alist)) ? Qnil : Qt; } -DEFUN ("selection-exists-p", Fselection_exists_p, 0, 3, 0, /* -Whether there is currently an owner for SELECTION. -SELECTION should be the name of the selection in question, typically one of +DEFUN ("selection-exists-p", Fselection_exists_p, 0, 2, 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 window-system DATA-TYPE and the DEVICE may be specified. */ - (selection, data_type, device)) + (selection, device)) { CHECK_SYMBOL (selection); - if (NILP (data_type) - && !NILP (Fselection_owner_p (selection))) + if (!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)) + DEVMETH (XDEVICE (device), selection_exists_p, (selection)) : 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 is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. -TARGET-TYPE is the type of data desired, typically STRING or COMPOUND_TEXT. +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, target_type, device)) + (selection_symbol, target_type, device)) { /* This function can GC */ Lisp_Object val = Qnil; struct gcpro gcpro1, gcpro2; - GCPRO2 (target_type, val); - CHECK_SYMBOL (selection); + GCPRO2 (target_type, val); /* we store newly consed data into these */ + 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) @@ -539,215 +371,40 @@ TEXT or COMPOUND_TEXT, it will be decoded as Compound Text. /* So we don't destructively modify this... */ target_type = copy_multiple_data (target_type); } + else #endif + CHECK_SYMBOL (target_type); - /* 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, target_type); + val = get_local_selection (selection_symbol, target_type); - if (!NILP (val)) - { - /* If we get something from the local cache, we may need to convert - it slightly - to do this, we call select-coerce */ - val = call3 (Qselect_coerce, selection, target_type, val); - } - else if (HAS_DEVMETH_P (XDEVICE (device), get_foreign_selection)) + if (NILP (val) && (HAS_DEVMETH_P (XDEVICE (device), get_foreign_selection))) { - /* Nothing in the local cache; try the window system */ val = DEVMETH (XDEVICE (device), get_foreign_selection, - (selection, target_type)); + (selection_symbol, target_type)); } - - if (NILP (val)) + else { - /* 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) + if (CONSP (val) && SYMBOLP (XCAR (val))) { - val = get_local_selection (selection, element); - - if (NILP (val)) - continue; - - val = call3 (Qselect_coerce, selection, target_type, val); - - if (!NILP (val)) - break; + val = XCDR (val); + if (CONSP (val) && NILP (XCDR (val))) + val = XCAR (val); } + val = clean_local_selection_data (val); } - - /* 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 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_coerce (Lisp_Object selection, - Lisp_Object type, - Lisp_Object value) -{ - return call3 (Qselect_coerce, 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)) - { - /* 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) - { - Lisp_Object ret; - - value = get_local_selection (selection, element); - - if (NILP (value)) - continue; - - ret = call3 (Qselect_convert_out, selection, type, value); - - if (!NILP (ret)) - return ret; - } - - 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 (Fget_selection_timestamp); DEFSUBR (Fselection_exists_p); 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"); - defsymbol (&Qselect_coerce, "select-coerce"); - /* X Atoms */ defsymbol (&QPRIMARY, "PRIMARY"); defsymbol (&QSECONDARY, "SECONDARY"); defsymbol (&QSTRING, "STRING"); @@ -765,35 +422,9 @@ syms_of_select (void) 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_DIBV5, "CF_DIBV5"); - 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_STANDARD (Qselection_conversion_error, Qio_error); + deferror (&Qselection_conversion_error, + "selection-conversion-error", + "selection-conversion error", Qio_error); } void @@ -802,26 +433,14 @@ 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 /* + 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 `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: +selection value (whatever had been passed to `own-selection'). For +historical reasons these functions should return the value to send to +an 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 @@ -855,64 +474,8 @@ For X, the return value should be one of: -- 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-coercion-alist", - &Vselection_coercion_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. -The value passed will be *exactly the same value* that was given to -`own-selection'; it should be converted into something suitable for -return to a program calling `get-selection' with the appropriate -parameters. - -See also `selection-converter-in-alist' and -`selection-converter-out-alist'. */); - Vselection_coercion_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; + will be sent.) */ ); + Vselection_converter_alist = Qnil; DEFVAR_LISP ("lost-selection-hooks", &Vlost_selection_hooks /* A function or functions to be called after we have been notified @@ -922,3 +485,4 @@ CLIPBOARD). */ ); Vlost_selection_hooks = Qunbound; } + diff --git a/src/select.h b/src/select.h index 4e6d00d..03c7640 100644 --- a/src/select.h +++ b/src/select.h @@ -20,49 +20,31 @@ 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_DIBV5, 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; +#ifndef _XEMACS_SELECT_H_ +#define _XEMACS_SELECT_H_ + +extern Lisp_Object QPRIMARY, QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP, + QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL, + QATOM_PAIR, QCOMPOUND_TEXT; + +/* 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. + */ +extern Lisp_Object Vselection_alist; /* "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); -Lisp_Object select_coerce (Lisp_Object selection, - Lisp_Object type, - Lisp_Object value); - -/* Notifications */ +Lisp_Object get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type); 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_ */ +#endif diff --git a/src/symbols.c b/src/symbols.c index b147805..1ecc2d0 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -1,6 +1,6 @@ /* "intern" and friends -- moved here from lread.c and data.c Copyright (C) 1985-1989, 1992-1994 Free Software Foundation, Inc. - Copyright (C) 1995, 2000 Ben Wing. + Copyright (C) 1995 Ben Wing. This file is part of XEmacs. @@ -56,17 +56,17 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" /* for Vbuffer_defaults */ #include "console.h" -#include "elhash.h" + +#include "elhash.h" /* for HASHTABLE_NONWEAK and HASHTABLE_EQ */ Lisp_Object Qad_advice_info, Qad_activate; 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; +Lisp_Object Qset_default, Qmake_variable_buffer_local, Qmake_local_variable; Lisp_Object Qkill_local_variable, Qkill_console_local_variable; Lisp_Object Qsymbol_value_in_buffer, Qsymbol_value_in_console; Lisp_Object Qlocal_variable_p; @@ -80,27 +80,33 @@ static Lisp_Object maybe_call_magic_handler (Lisp_Object sym, Lisp_Object funsym, int nargs, ...); static Lisp_Object fetch_value_maybe_past_magic (Lisp_Object sym, - Lisp_Object follow_past_lisp_magic); + Lisp_Object + follow_past_lisp_magic); static Lisp_Object *value_slot_past_magic (Lisp_Object sym); -static Lisp_Object follow_varalias_pointers (Lisp_Object symbol, - Lisp_Object follow_past_lisp_magic); +static Lisp_Object follow_varalias_pointers (Lisp_Object object, + Lisp_Object + follow_past_lisp_magic); +#ifdef LRECORD_SYMBOL + 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)); + /* No need to mark through ->obarray, because it only holds nil or t. */ + /*((markobj) (sym->obarray));*/ 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 +114,10 @@ mark_symbol (Lisp_Object obj) } } -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); +#endif /* LRECORD_SYMBOL */ /**********************************************************************/ @@ -177,100 +148,88 @@ check_obarray (Lisp_Object obarray) } Lisp_Object -intern (const char *str) +intern (CONST char *str) { + Lisp_Object tem; Bytecount len = strlen (str); - const Bufbyte *buf = (const Bufbyte *) str; Lisp_Object obarray = Vobarray; - if (!VECTORP (obarray) || XVECTOR_LENGTH (obarray) == 0) obarray = check_obarray (obarray); + tem = oblookup (obarray, (CONST Bufbyte *) str, len); - { - Lisp_Object tem = oblookup (obarray, buf, len); - if (SYMBOLP (tem)) - return tem; - } - - return Fintern (make_string (buf, len), obarray); + if (SYMBOLP (tem)) + return tem; + return Fintern (((purify_flag) + ? make_pure_pname ((CONST Bufbyte *) str, len, 0) + : make_string ((CONST Bufbyte *) str, len)), + obarray); } DEFUN ("intern", Fintern, 1, 2, 0, /* Return the canonical symbol whose name is STRING. If there is none, one is created by this function and returned. -Optional second argument OBARRAY specifies the obarray to use; -it defaults to the value of the variable `obarray'. +A second optional argument specifies the obarray to use; +it defaults to the value of `obarray'. */ - (string, obarray)) + (str, obarray)) { - Lisp_Object object, *ptr; - Lisp_Symbol *symbol; + Lisp_Object sym, *ptr; Bytecount len; if (NILP (obarray)) obarray = Vobarray; obarray = check_obarray (obarray); - CHECK_STRING (string); + CHECK_STRING (str); - len = XSTRING_LENGTH (string); - object = oblookup (obarray, XSTRING_DATA (string), len); - if (!INTP (object)) + len = XSTRING_LENGTH (str); + sym = oblookup (obarray, XSTRING_DATA (str), len); + if (!INTP (sym)) /* Found it */ - return object; + return sym; - ptr = &XVECTOR_DATA (obarray)[XINT (object)]; + ptr = &XVECTOR_DATA (obarray)[XINT (sym)]; - object = Fmake_symbol (string); - symbol = XSYMBOL (object); + if (purify_flag && ! purified (str)) + str = make_pure_pname (XSTRING_DATA (str), len, 0); + sym = Fmake_symbol (str); + /* FSFmacs places OBARRAY here, but it is pointless because we do + not mark through this slot, so it is not usable later (because + the obarray might have been collected). Marking through the + ->obarray slot is an even worse idea, because it would keep + obarrays from being collected because of symbols pointed to them. + + NOTE: We place Qt here only if OBARRAY is actually Vobarray. It + is safer to do it this way, to avoid hosing with symbols within + pure objects. */ + if (EQ (obarray, Vobarray)) + XSYMBOL (sym)->obarray = Qt; if (SYMBOLP (*ptr)) - symbol_next (symbol) = XSYMBOL (*ptr); + symbol_next (XSYMBOL (sym)) = XSYMBOL (*ptr); else - symbol_next (symbol) = 0; - *ptr = object; - - if (string_byte (symbol_name (symbol), 0) == ':' && EQ (obarray, Vobarray)) - { - /* The LISP way is to put keywords in their own package, but we - don't have packages, so we do something simpler. Someday, - maybe we'll have packages and then this will be reworked. - --Stig. */ - symbol_value (symbol) = object; - } - - return object; + symbol_next (XSYMBOL (sym)) = 0; + *ptr = sym; + return sym; } DEFUN ("intern-soft", Fintern_soft, 1, 2, 0, /* -Return the canonical symbol named NAME, or nil if none exists. -NAME may be a string or a symbol. If it is a symbol, that exact -symbol is searched for. -Optional second argument OBARRAY specifies the obarray to use; -it defaults to the value of the variable `obarray'. +Return the canonical symbol whose name is STRING, or nil if none exists. +A second optional argument specifies the obarray to use; +it defaults to the value of `obarray'. */ - (name, obarray)) + (str, obarray)) { - /* #### 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; if (NILP (obarray)) obarray = Vobarray; obarray = check_obarray (obarray); - if (!SYMBOLP (name)) - { - CHECK_STRING (name); - string = XSTRING (name); - } - else - string = symbol_name (XSYMBOL (name)); + CHECK_STRING (str); - tem = oblookup (obarray, string_data (string), string_length (string)); - if (INTP (tem) || (SYMBOLP (name) && !EQ (name, tem))) - return Qnil; - else + tem = oblookup (obarray, XSTRING_DATA (str), XSTRING_LENGTH (str)); + if (!INTP (tem)) return tem; + return Qnil; } DEFUN ("unintern", Funintern, 1, 2, 0, /* @@ -278,26 +237,25 @@ Delete the symbol named NAME, if any, from OBARRAY. The value is t if a symbol was found and deleted, nil otherwise. NAME may be a string or a symbol. If it is a symbol, that symbol is deleted, if it belongs to OBARRAY--no other symbol is deleted. -OBARRAY defaults to the value of the variable `obarray'. +OBARRAY defaults to the value of the variable `obarray' */ (name, obarray)) { - Lisp_Object tem; - Lisp_String *string; + Lisp_Object string, tem; int hash; if (NILP (obarray)) obarray = Vobarray; obarray = check_obarray (obarray); if (SYMBOLP (name)) - string = symbol_name (XSYMBOL (name)); + XSETSTRING (string, XSYMBOL (name)->name); else { CHECK_STRING (name); - string = XSTRING (name); + string = name; } - tem = oblookup (obarray, string_data (string), string_length (string)); + tem = oblookup (obarray, XSTRING_DATA (string), XSTRING_LENGTH (string)); if (INTP (tem)) return Qnil; /* If arg was a symbol, don't delete anything but that symbol itself. */ @@ -329,20 +287,21 @@ OBARRAY defaults to the value of the variable `obarray'. } } } + XSYMBOL (tem)->obarray = Qnil; return Qt; } /* Return the symbol in OBARRAY whose names matches the string of SIZE characters at PTR. If there is no such symbol in OBARRAY, - return the index into OBARRAY that the string hashes to. + return nil. 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) || @@ -351,9 +310,16 @@ oblookup (Lisp_Object obarray, const Bufbyte *ptr, Bytecount size) obarray = check_obarray (obarray); obsize = XVECTOR_LENGTH (obarray); } - hash = hash_string (ptr, size) % obsize; - oblookup_last_bucket_number = hash; +#if 0 /* FSFmacs */ + /* #### Huh? */ + /* This is sometimes needed in the middle of GC. */ + obsize &= ~ARRAY_MARK_FLAG; +#endif + /* Combining next two lines breaks VMS C 2.3. */ + hash = hash_string (ptr, size); + hash %= obsize; bucket = XVECTOR_DATA (obarray)[hash]; + oblookup_last_bucket_number = hash; if (ZEROP (bucket)) ; else if (!SYMBOLP (bucket)) @@ -376,10 +342,10 @@ oblookup (Lisp_Object obarray, const Bufbyte *ptr, Bytecount size) #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 +361,7 @@ hash_string (const Bufbyte *ptr, Bytecount len) /* 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 +391,7 @@ map_obarray (Lisp_Object obarray, if (SYMBOLP (tail)) while (1) { - Lisp_Symbol *next; + struct Lisp_Symbol *next; if ((*fn) (tail, arg)) return; next = symbol_next (XSYMBOL (tail)); @@ -449,15 +415,11 @@ OBARRAY defaults to the value of `obarray'. */ (function, obarray)) { - struct gcpro gcpro1; - if (NILP (obarray)) obarray = Vobarray; obarray = check_obarray (obarray); - GCPRO1 (obarray); map_obarray (obarray, mapatoms_1, &function); - UNGCPRO; return Qnil; } @@ -490,24 +452,23 @@ apropos_mapper (Lisp_Object symbol, void *arg) } DEFUN ("apropos-internal", Fapropos_internal, 1, 2, 0, /* -Return a list of all symbols whose names contain match for REGEXP. -If optional 2nd arg PREDICATE is non-nil, only symbols for which -\(funcall PREDICATE SYMBOL) returns non-nil are returned. +Show all symbols whose names contain match for REGEXP. +If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) + is done for each symbol and a symbol is mentioned only if that + returns non-nil. +Return list of symbols found. */ (regexp, predicate)) { struct appropos_mapper_closure closure; - struct gcpro gcpro1; CHECK_STRING (regexp); closure.regexp = regexp; closure.predicate = predicate; closure.accumulation = Qnil; - GCPRO1 (closure.accumulation); map_obarray (Vobarray, apropos_mapper, &closure); closure.accumulation = Fsort (closure.accumulation, Qstring_lessp); - UNGCPRO; return closure.accumulation; } @@ -523,29 +484,29 @@ static void set_up_buffer_local_cache (Lisp_Object sym, DEFUN ("boundp", Fboundp, 1, 1, 0, /* Return t if SYMBOL's value is not void. */ - (symbol)) + (sym)) { - CHECK_SYMBOL (symbol); - return UNBOUNDP (find_symbol_value (symbol)) ? Qnil : Qt; + CHECK_SYMBOL (sym); + return UNBOUNDP (find_symbol_value (sym)) ? Qnil : Qt; } DEFUN ("globally-boundp", Fglobally_boundp, 1, 1, 0, /* Return t if SYMBOL has a global (non-bound) value. This is for the byte-compiler; you really shouldn't be using this. */ - (symbol)) + (sym)) { - CHECK_SYMBOL (symbol); - return UNBOUNDP (top_level_value (symbol)) ? Qnil : Qt; + CHECK_SYMBOL (sym); + return UNBOUNDP (top_level_value (sym)) ? Qnil : Qt; } DEFUN ("fboundp", Ffboundp, 1, 1, 0, /* Return t if SYMBOL's function definition is not void. */ - (symbol)) + (sym)) { - CHECK_SYMBOL (symbol); - return UNBOUNDP (XSYMBOL (symbol)->function) ? Qnil : Qt; + CHECK_SYMBOL (sym); + return UNBOUNDP (XSYMBOL (sym)->function) ? Qnil : Qt; } /* Return non-zero if SYM's value or function (the current contents of @@ -576,7 +537,7 @@ symbol_is_constant (Lisp_Object sym, Lisp_Object val) } /* We don't return true for keywords here because they are handled - specially by reject_constant_symbols(). */ + specially by reject_constant_symbols(). */ return 0; } @@ -585,7 +546,7 @@ symbol_is_constant (Lisp_Object sym, Lisp_Object val) FOLLOW_PAST_LISP_MAGIC specifies whether we delve past symbol-value-lisp-magic objects. */ -void +static void reject_constant_symbols (Lisp_Object sym, Lisp_Object newval, int function_p, Lisp_Object follow_past_lisp_magic) { @@ -599,7 +560,8 @@ reject_constant_symbols (Lisp_Object sym, Lisp_Object newval, int function_p, sym); if (symbol_is_constant (sym, val) - || (SYMBOL_IS_KEYWORD (sym) && !EQ (newval, sym))) + || (SYMBOL_IS_KEYWORD (sym) && !EQ (newval, sym) + && !NILP (XSYMBOL (sym)->obarray))) signal_error (Qsetting_constant, UNBOUNDP (newval) ? list1 (sym) : list2 (sym, newval)); } @@ -641,21 +603,21 @@ verify_ok_for_buffer_local (Lisp_Object sym, DEFUN ("makunbound", Fmakunbound, 1, 1, 0, /* Make SYMBOL's value be void. */ - (symbol)) + (sym)) { - Fset (symbol, Qunbound); - return symbol; + Fset (sym, Qunbound); + return sym; } DEFUN ("fmakunbound", Ffmakunbound, 1, 1, 0, /* Make SYMBOL's function definition be void. */ - (symbol)) + (sym)) { - CHECK_SYMBOL (symbol); - reject_constant_symbols (symbol, Qunbound, 1, Qt); - XSYMBOL (symbol)->function = Qunbound; - return symbol; + CHECK_SYMBOL (sym); + reject_constant_symbols (sym, Qunbound, 1, Qt); + XSYMBOL (sym)->function = Qunbound; + return sym; } DEFUN ("symbol-function", Fsymbol_function, 1, 1, 0, /* @@ -665,49 +627,49 @@ Return SYMBOL's function definition. Error if that is void. { CHECK_SYMBOL (symbol); if (UNBOUNDP (XSYMBOL (symbol)->function)) - signal_void_function_error (symbol); + return Fsignal (Qvoid_function, list1 (symbol)); return XSYMBOL (symbol)->function; } DEFUN ("symbol-plist", Fsymbol_plist, 1, 1, 0, /* Return SYMBOL's property list. */ - (symbol)) + (sym)) { - CHECK_SYMBOL (symbol); - return XSYMBOL (symbol)->plist; + CHECK_SYMBOL (sym); + return XSYMBOL (sym)->plist; } DEFUN ("symbol-name", Fsymbol_name, 1, 1, 0, /* Return SYMBOL's name, a string. */ - (symbol)) + (sym)) { Lisp_Object name; - CHECK_SYMBOL (symbol); - XSETSTRING (name, XSYMBOL (symbol)->name); + CHECK_SYMBOL (sym); + XSETSTRING (name, XSYMBOL (sym)->name); return name; } DEFUN ("fset", Ffset, 2, 2, 0, /* Set SYMBOL's function definition to NEWDEF, and return NEWDEF. */ - (symbol, newdef)) + (sym, newdef)) { /* This function can GC */ - CHECK_SYMBOL (symbol); - reject_constant_symbols (symbol, newdef, 1, Qt); - if (!NILP (Vautoload_queue) && !UNBOUNDP (XSYMBOL (symbol)->function)) - Vautoload_queue = Fcons (Fcons (symbol, XSYMBOL (symbol)->function), + CHECK_SYMBOL (sym); + reject_constant_symbols (sym, newdef, 1, Qt); + if (!NILP (Vautoload_queue) && !UNBOUNDP (XSYMBOL (sym)->function)) + Vautoload_queue = Fcons (Fcons (sym, XSYMBOL (sym)->function), Vautoload_queue); - XSYMBOL (symbol)->function = newdef; + XSYMBOL (sym)->function = newdef; /* Handle automatic advice activation */ - if (CONSP (XSYMBOL (symbol)->plist) && - !NILP (Fget (symbol, Qad_advice_info, Qnil))) + if (CONSP (XSYMBOL (sym)->plist) && !NILP (Fget (sym, Qad_advice_info, + Qnil))) { - call2 (Qad_activate, symbol, Qnil); - newdef = XSYMBOL (symbol)->function; + call2 (Qad_activate, sym, Qnil); + newdef = XSYMBOL (sym)->function; } return newdef; } @@ -717,11 +679,12 @@ DEFUN ("define-function", Fdefine_function, 2, 2, 0, /* Set SYMBOL's function definition to NEWDEF, and return NEWDEF. Associates the function with the current load file, if any. */ - (symbol, newdef)) + (sym, newdef)) { /* This function can GC */ - Ffset (symbol, newdef); - LOADHIST_ATTACH (symbol); + CHECK_SYMBOL (sym); + Ffset (sym, newdef); + LOADHIST_ATTACH (sym); return newdef; } @@ -729,16 +692,16 @@ Associates the function with the current load file, if any. DEFUN ("setplist", Fsetplist, 2, 2, 0, /* Set SYMBOL's property list to NEWPLIST, and return NEWPLIST. */ - (symbol, newplist)) + (sym, newplist)) { - CHECK_SYMBOL (symbol); + CHECK_SYMBOL (sym); #if 0 /* Inserted for debugging 6/28/1997 -slb */ /* Somebody is setting a property list of integer 0, who? */ /* Not this way apparently. */ if (EQ(newplist, Qzero)) abort(); #endif - XSYMBOL (symbol)->plist = newplist; + XSYMBOL (sym)->plist = newplist; return newplist; } @@ -756,7 +719,7 @@ Set SYMBOL's property list to NEWPLIST, and return NEWPLIST. If a symbol is "unbound", then the contents of its value cell is Qunbound. Despite appearances, this is *not* a symbol, but is a symbol-value-forward object. This is so that printing it results - in "INTERNAL OBJECT (XEmacs bug?)", in case it leaks to Lisp, somehow. + in "INTERNAL EMACS BUG", in case it leaks to Lisp, somehow. Logically all of the following objects are "symbol-value-magic" objects, and there are some games played w.r.t. this (#### this @@ -790,15 +753,10 @@ Set SYMBOL's property list to NEWPLIST, and return NEWPLIST. the symbol-value-forward. (See below.) SYMVAL_FIXNUM_FORWARD: - (declare with DEFVAR_INT) - Similar to SYMVAL_OBJECT_FORWARD except that the C variable - is of type "Fixnum", a typedef for "EMACS_INT", and the corresponding - lisp variable is always the corresponding integer. - SYMVAL_BOOLEAN_FORWARD: - (declare with DEFVAR_BOOL) + (declare with DEFVAR_INT or DEFVAR_BOOL) Similar to SYMVAL_OBJECT_FORWARD except that the C variable - is of type "int" and is a boolean. + is of type "int" and is an integer or boolean, respectively. SYMVAL_CONST_OBJECT_FORWARD: SYMVAL_CONST_FIXNUM_FORWARD: @@ -811,8 +769,8 @@ Set SYMBOL's property list to NEWPLIST, and return NEWPLIST. 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: @@ -937,24 +895,24 @@ Set SYMBOL's property list to NEWPLIST, and return NEWPLIST. 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; -#ifdef ERROR_CHECK_TYPECHECK assert (XSYMBOL_VALUE_MAGIC_TYPE (obj) == SYMVAL_BUFFER_LOCAL || XSYMBOL_VALUE_MAGIC_TYPE (obj) == SYMVAL_SOME_BUFFER_LOCAL); -#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; @@ -964,21 +922,22 @@ mark_symbol_value_lisp_magic (Lisp_Object obj) 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; } @@ -988,62 +947,35 @@ print_symbol_value_magic (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { char buf[200]; - sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (%s type %d) 0x%lx>", + sprintf (buf, "#<INTERNAL EMACS BUG (%s type %d) 0x%p>", XRECORD_LHEADER_IMPLEMENTATION (obj)->name, XSYMBOL_VALUE_MAGIC_TYPE (obj), - (long) XPNTR (obj)); + (void *) XPNTR (obj)); 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_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_value) }, - { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_buffer) }, - { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_alist_element) }, - { XD_END } -}; - -static const struct lrecord_description symbol_value_lisp_magic_description[] = { - { XD_LISP_OBJECT_ARRAY, offsetof (struct symbol_value_lisp_magic, handler), 2*MAGIC_HANDLER_MAX+1 }, - { 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); @@ -1068,7 +1000,7 @@ static Lisp_Object 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; @@ -1078,7 +1010,7 @@ do_symval_forwarding (Lisp_Object valcontents, struct buffer *buffer, { case SYMVAL_FIXNUM_FORWARD: case SYMVAL_CONST_FIXNUM_FORWARD: - return make_int (*((Fixnum *)symbol_value_forward_forward (fwd))); + return make_int (*((int *)symbol_value_forward_forward (fwd))); case SYMVAL_BOOLEAN_FORWARD: case SYMVAL_CONST_BOOLEAN_FORWARD: @@ -1136,7 +1068,7 @@ set_default_buffer_slot_variable (Lisp_Object sym, 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); @@ -1149,14 +1081,16 @@ set_default_buffer_slot_variable (Lisp_Object sym, if (mask > 0) /* Not always per-buffer */ { + Lisp_Object tail; + /* Set value in each buffer which hasn't shadowed the default */ - LIST_LOOP_2 (elt, Vbuffer_alist) + LIST_LOOP (tail, Vbuffer_alist) { - struct buffer *b = XBUFFER (XCDR (elt)); + struct buffer *b = XBUFFER (XCDR (XCAR (tail))); if (!(b->local_var_flags & mask)) { if (magicfun) - magicfun (sym, &value, make_buffer (b), 0); + (magicfun) (sym, &value, make_buffer (b), 0); *((Lisp_Object *) (offset + (char *) b)) = value; } } @@ -1176,7 +1110,7 @@ set_default_console_slot_variable (Lisp_Object sym, 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); @@ -1189,14 +1123,17 @@ set_default_console_slot_variable (Lisp_Object sym, if (mask > 0) /* Not always per-console */ { + Lisp_Object tail; + /* Set value in each console which hasn't shadowed the default */ - LIST_LOOP_2 (console, Vconsole_list) + LIST_LOOP (tail, Vconsole_list) { - struct console *d = XCONSOLE (console); + Lisp_Object dev = XCAR (tail); + struct console *d = XCONSOLE (dev); if (!(d->local_var_flags & mask)) { if (magicfun) - magicfun (sym, &value, console, 0); + (magicfun) (sym, &value, dev, 0); *((Lisp_Object *) (offset + (char *) d)) = value; } } @@ -1238,60 +1175,77 @@ store_symval_forwarding (Lisp_Object sym, Lisp_Object ovalue, || !SYMBOL_VALUE_MAGIC_P (*store_pointer)); *store_pointer = newval; } + else { - const struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (ovalue); + CONST struct symbol_value_forward *fwd + = XSYMBOL_VALUE_FORWARD (ovalue); + int type = XSYMBOL_VALUE_MAGIC_TYPE (ovalue); int (*magicfun) (Lisp_Object simm, Lisp_Object *val, - Lisp_Object in_object, int flags) - = symbol_value_forward_magicfun (fwd); + Lisp_Object in_object, int flags) = + symbol_value_forward_magicfun (fwd); - switch (XSYMBOL_VALUE_MAGIC_TYPE (ovalue)) + switch (type) { case SYMVAL_FIXNUM_FORWARD: - CHECK_INT (newval); - if (magicfun) - magicfun (sym, &newval, Qnil, 0); - *((Fixnum *) symbol_value_forward_forward (fwd)) = XINT (newval); - return; + { + CHECK_INT (newval); + if (magicfun) + (magicfun) (sym, &newval, Qnil, 0); + *((int *) symbol_value_forward_forward (fwd)) = XINT (newval); + return; + } case SYMVAL_BOOLEAN_FORWARD: - if (magicfun) - magicfun (sym, &newval, Qnil, 0); - *((int *) symbol_value_forward_forward (fwd)) - = !NILP (newval); - return; + { + if (magicfun) + (magicfun) (sym, &newval, Qnil, 0); + *((int *) symbol_value_forward_forward (fwd)) + = ((NILP (newval)) ? 0 : 1); + return; + } case SYMVAL_OBJECT_FORWARD: - if (magicfun) - magicfun (sym, &newval, Qnil, 0); - *((Lisp_Object *) symbol_value_forward_forward (fwd)) = newval; - return; + { + if (magicfun) + (magicfun) (sym, &newval, Qnil, 0); + *((Lisp_Object *) symbol_value_forward_forward (fwd)) = newval; + return; + } case SYMVAL_DEFAULT_BUFFER_FORWARD: - set_default_buffer_slot_variable (sym, newval); - return; + { + set_default_buffer_slot_variable (sym, newval); + return; + } case SYMVAL_CURRENT_BUFFER_FORWARD: - if (magicfun) - magicfun (sym, &newval, make_buffer (current_buffer), 0); - *((Lisp_Object *) ((char *) current_buffer - + ((char *) symbol_value_forward_forward (fwd) - - (char *) &buffer_local_flags))) - = newval; - return; + { + if (magicfun) + (magicfun) (sym, &newval, make_buffer (current_buffer), 0); + *((Lisp_Object *) ((char *) current_buffer + + ((char *) symbol_value_forward_forward (fwd) + - (char *) &buffer_local_flags))) + = newval; + return; + } case SYMVAL_DEFAULT_CONSOLE_FORWARD: - set_default_console_slot_variable (sym, newval); - return; + { + set_default_console_slot_variable (sym, newval); + return; + } case SYMVAL_SELECTED_CONSOLE_FORWARD: - if (magicfun) - magicfun (sym, &newval, Vselected_console, 0); - *((Lisp_Object *) ((char *) XCONSOLE (Vselected_console) - + ((char *) symbol_value_forward_forward (fwd) - - (char *) &console_local_flags))) - = newval; - return; + { + if (magicfun) + (magicfun) (sym, &newval, Vselected_console, 0); + *((Lisp_Object *) ((char *) XCONSOLE (Vselected_console) + + ((char *) symbol_value_forward_forward (fwd) + - (char *) &console_local_flags))) + = newval; + return; + } default: abort (); @@ -1381,7 +1335,7 @@ set_up_buffer_local_cache (Lisp_Object sym, /* Retrieve the new alist element and new value. */ if (NILP (new_alist_el) && set_it_p) - new_alist_el = buffer_local_alist_element (buf, sym, bfwd); + new_alist_el = buffer_local_alist_element (buf, sym, bfwd); if (NILP (new_alist_el)) new_val = bfwd->default_value; @@ -1402,71 +1356,6 @@ set_up_buffer_local_cache (Lisp_Object sym, store_symval_forwarding (sym, bfwd->current_value, new_val); } - -/* SYM is a buffer-local variable, and BFWD is its buffer-local structure. - Flush the cache. BFWD->CURRENT_BUFFER will be nil after this operation. -*/ - -static void -flush_buffer_local_cache (Lisp_Object sym, - struct symbol_value_buffer_local *bfwd) -{ - if (NILP (bfwd->current_buffer)) - /* Cache is already flushed. */ - return; - - /* Flush out the old cache. */ - write_out_buffer_local_cache (sym, bfwd); - - bfwd->current_alist_element = Qnil; - bfwd->current_buffer = Qnil; - - /* Now store default the value into the current-value slot. - We don't simply write it there, because the current-value - slot might be a forwarding pointer, in which case we need - to instead write the value into the C variable. - - We might also want to call a magic function. - - So instead, we call this function. */ - store_symval_forwarding (sym, bfwd->current_value, bfwd->default_value); -} - -/* Flush all the buffer-local variable caches. Whoever has a - non-interned buffer-local variable will be spanked. Whoever has a - magic variable that interns or uninterns symbols... I don't even - want to think about it. -*/ - -void -flush_all_buffer_local_cache (void) -{ - Lisp_Object *syms = XVECTOR_DATA (Vobarray); - long count = XVECTOR_LENGTH (Vobarray); - long i; - - for (i=0; i<count; i++) - { - Lisp_Object sym = syms[i]; - Lisp_Object value; - - if (!ZEROP (sym)) - for(;;) - { - Lisp_Symbol *next; - assert (SYMBOLP (sym)); - value = fetch_value_maybe_past_magic (sym, Qt); - if (SYMBOL_VALUE_BUFFER_LOCAL_P (value)) - flush_buffer_local_cache (sym, XSYMBOL_VALUE_BUFFER_LOCAL (value)); - - next = symbol_next (XSYMBOL (sym)); - if (!next) - break; - XSETSYMBOL (sym, next); - } - } -} - void kill_buffer_local_variables (struct buffer *buf) @@ -1571,7 +1460,7 @@ find_symbol_value_1 (Lisp_Object sym, struct buffer *buf, else if (NILP (symcons)) { if (set_it_p) - valcontents = assq_no_quit (sym, buf->local_var_alist); + valcontents = assq_no_quit (sym, buf->local_var_alist); if (NILP (valcontents)) valcontents = bfwd->default_value; else @@ -1601,13 +1490,13 @@ symbol_value_in_buffer (Lisp_Object sym, Lisp_Object buffer) CHECK_SYMBOL (sym); - if (NILP (buffer)) - buf = current_buffer; - else + if (!NILP (buffer)) { CHECK_BUFFER (buffer); buf = XBUFFER (buffer); } + else + buf = current_buffer; return find_symbol_value_1 (sym, buf, /* If it bombs out at startup due to a @@ -1621,10 +1510,10 @@ symbol_value_in_console (Lisp_Object sym, Lisp_Object console) { CHECK_SYMBOL (sym); - if (NILP (console)) - console = Vselected_console; - else + if (!NILP (console)) CHECK_CONSOLE (console); + else + console = Vselected_console; return find_symbol_value_1 (sym, current_buffer, XCONSOLE (console), 0, Qnil, 1); @@ -1640,7 +1529,7 @@ find_symbol_value (Lisp_Object sym) { /* WARNING: This function can be called when current_buffer is 0 and Vselected_console is Qnil, early in initialization. */ - struct console *con; + struct console *dev; Lisp_Object valcontents; CHECK_SYMBOL (sym); @@ -1650,19 +1539,17 @@ find_symbol_value (Lisp_Object sym) return valcontents; if (CONSOLEP (Vselected_console)) - con = XCONSOLE (Vselected_console); + dev = XCONSOLE (Vselected_console); else { /* 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; + dev = 0; } - return find_symbol_value_1 (sym, current_buffer, con, 1, Qnil, 1); + return find_symbol_value_1 (sym, current_buffer, dev, 1, Qnil, 1); } /* This is an optimized function for quick lookup of buffer local symbols @@ -1683,24 +1570,22 @@ find_symbol_value_quickly (Lisp_Object symbol_cons, int find_it_p) { /* WARNING: This function can be called when current_buffer is 0 and Vselected_console is Qnil, early in initialization. */ - struct console *con; + struct console *dev; Lisp_Object sym = find_it_p ? XCAR (symbol_cons) : symbol_cons; CHECK_SYMBOL (sym); if (CONSOLEP (Vselected_console)) - con = XCONSOLE (Vselected_console); + dev = XCONSOLE (Vselected_console); else { /* 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; + dev = 0; } - return find_symbol_value_1 (sym, current_buffer, con, 1, + return find_symbol_value_1 (sym, current_buffer, dev, 1, find_it_p ? symbol_cons : Qnil, find_it_p); } @@ -1708,12 +1593,12 @@ find_symbol_value_quickly (Lisp_Object symbol_cons, int find_it_p) DEFUN ("symbol-value", Fsymbol_value, 1, 1, 0, /* Return SYMBOL's value. Error if that is void. */ - (symbol)) + (sym)) { - Lisp_Object val = find_symbol_value (symbol); + Lisp_Object val = find_symbol_value (sym); if (UNBOUNDP (val)) - return Fsignal (Qvoid_variable, list1 (symbol)); + return Fsignal (Qvoid_variable, list1 (sym)); else return val; } @@ -1721,178 +1606,177 @@ Return SYMBOL's value. Error if that is void. DEFUN ("set", Fset, 2, 2, 0, /* Set SYMBOL's value to NEWVAL, and return NEWVAL. */ - (symbol, newval)) + (sym, newval)) { REGISTER Lisp_Object valcontents; - Lisp_Symbol *sym; /* remember, we're called by Fmakunbound() as well */ - CHECK_SYMBOL (symbol); + CHECK_SYMBOL (sym); retry: - sym = XSYMBOL (symbol); - valcontents = sym->value; - - if (EQ (symbol, Qnil) || - EQ (symbol, Qt) || - SYMBOL_IS_KEYWORD (symbol)) - reject_constant_symbols (symbol, newval, 0, + valcontents = XSYMBOL (sym)->value; + if (NILP (sym) || EQ (sym, Qt) || SYMBOL_VALUE_MAGIC_P (valcontents) + || SYMBOL_IS_KEYWORD (sym)) + reject_constant_symbols (sym, newval, 0, UNBOUNDP (newval) ? Qmakunbound : Qset); - - if (!SYMBOL_VALUE_MAGIC_P (valcontents) || UNBOUNDP (valcontents)) + else { - sym->value = newval; + XSYMBOL (sym)->value = newval; return newval; } - reject_constant_symbols (symbol, newval, 0, - UNBOUNDP (newval) ? Qmakunbound : Qset); + retry_2: - switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents)) + if (SYMBOL_VALUE_MAGIC_P (valcontents)) { - case SYMVAL_LISP_MAGIC: - { - if (UNBOUNDP (newval)) - { - maybe_call_magic_handler (symbol, Qmakunbound, 0); - return XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed = Qunbound; - } - else + switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents)) + { + case SYMVAL_LISP_MAGIC: { - maybe_call_magic_handler (symbol, Qset, 1, newval); - return XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed = newval; - } - } + Lisp_Object retval; - case SYMVAL_VARALIAS: - symbol = follow_varalias_pointers (symbol, - UNBOUNDP (newval) - ? Qmakunbound : Qset); - /* presto change-o! */ - goto retry; - - case SYMVAL_FIXNUM_FORWARD: - case SYMVAL_BOOLEAN_FORWARD: - case SYMVAL_OBJECT_FORWARD: - case SYMVAL_DEFAULT_BUFFER_FORWARD: - case SYMVAL_DEFAULT_CONSOLE_FORWARD: - if (UNBOUNDP (newval)) - signal_error (Qerror, - list2 (build_string ("Cannot makunbound"), symbol)); - break; + if (UNBOUNDP (newval)) + retval = maybe_call_magic_handler (sym, Qmakunbound, 0); + else + retval = maybe_call_magic_handler (sym, Qset, 1, newval); + if (!UNBOUNDP (retval)) + return newval; + valcontents = XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed; + /* semi-change-o */ + goto retry_2; + } - /* case SYMVAL_UNBOUND_MARKER: break; */ + case SYMVAL_VARALIAS: + sym = follow_varalias_pointers (sym, + UNBOUNDP (newval) + ? Qmakunbound : Qset); + /* presto change-o! */ + goto retry; - case SYMVAL_CURRENT_BUFFER_FORWARD: - { - const struct symbol_value_forward *fwd - = XSYMBOL_VALUE_FORWARD (valcontents); - int mask = XINT (*((Lisp_Object *) - symbol_value_forward_forward (fwd))); - if (mask > 0) - /* Setting this variable makes it buffer-local */ - current_buffer->local_var_flags |= mask; - break; - } + case SYMVAL_FIXNUM_FORWARD: + case SYMVAL_BOOLEAN_FORWARD: + case SYMVAL_OBJECT_FORWARD: + case SYMVAL_DEFAULT_BUFFER_FORWARD: + case SYMVAL_DEFAULT_CONSOLE_FORWARD: + if (UNBOUNDP (newval)) + signal_error (Qerror, + list2 (build_string ("Cannot makunbound"), sym)); + break; - case SYMVAL_SELECTED_CONSOLE_FORWARD: - { - const struct symbol_value_forward *fwd - = XSYMBOL_VALUE_FORWARD (valcontents); - int mask = XINT (*((Lisp_Object *) - symbol_value_forward_forward (fwd))); - if (mask > 0) - /* Setting this variable makes it console-local */ - XCONSOLE (Vselected_console)->local_var_flags |= mask; - break; - } + case SYMVAL_UNBOUND_MARKER: + break; - case SYMVAL_BUFFER_LOCAL: - case SYMVAL_SOME_BUFFER_LOCAL: - { - /* If we want to examine or set the value and - CURRENT-BUFFER is current, we just examine or set - CURRENT-VALUE. If CURRENT-BUFFER is not current, we - store the current CURRENT-VALUE value into - CURRENT-ALIST- ELEMENT, then find the appropriate alist - element for the buffer now current and set up - CURRENT-ALIST-ELEMENT. Then we set CURRENT-VALUE out - of that element, and store into CURRENT-BUFFER. - - If we are setting the variable and the current buffer does - not have an alist entry for this variable, an alist entry is - created. - - Note that CURRENT-VALUE can be a forwarding pointer. - Each time it is examined or set, forwarding must be - done. */ - struct symbol_value_buffer_local *bfwd - = XSYMBOL_VALUE_BUFFER_LOCAL (valcontents); - int some_buffer_local_p = - (bfwd->magic.type == SYMVAL_SOME_BUFFER_LOCAL); - /* What value are we caching right now? */ - Lisp_Object aelt = bfwd->current_alist_element; + case SYMVAL_CURRENT_BUFFER_FORWARD: + { + CONST struct symbol_value_forward *fwd + = XSYMBOL_VALUE_FORWARD (valcontents); + int mask = XINT (*((Lisp_Object *) + symbol_value_forward_forward (fwd))); + if (mask > 0) + /* Setting this variable makes it buffer-local */ + current_buffer->local_var_flags |= mask; + break; + } - if (!NILP (bfwd->current_buffer) && - current_buffer == XBUFFER (bfwd->current_buffer) - && ((some_buffer_local_p) - ? 1 /* doesn't automatically become local */ - : !NILP (aelt) /* already local */ - )) + case SYMVAL_SELECTED_CONSOLE_FORWARD: { - /* Cache is valid */ - valcontents = bfwd->current_value; + CONST struct symbol_value_forward *fwd + = XSYMBOL_VALUE_FORWARD (valcontents); + int mask = XINT (*((Lisp_Object *) + symbol_value_forward_forward (fwd))); + if (mask > 0) + /* Setting this variable makes it console-local */ + XCONSOLE (Vselected_console)->local_var_flags |= mask; + break; } - else + + case SYMVAL_BUFFER_LOCAL: + case SYMVAL_SOME_BUFFER_LOCAL: { - /* If the current buffer is not the buffer whose binding is - currently cached, or if it's a SYMVAL_BUFFER_LOCAL and - we're looking at the default value, the cache is invalid; we - need to write it out, and find the new CURRENT-ALIST-ELEMENT - */ - - /* Write out the cached value for the old buffer; copy it - back to its alist element. This works if the current - buffer only sees the default value, too. */ - write_out_buffer_local_cache (symbol, bfwd); - - /* Find the new value for CURRENT-ALIST-ELEMENT. */ - aelt = buffer_local_alist_element (current_buffer, symbol, bfwd); - if (NILP (aelt)) + /* If we want to examine or set the value and + CURRENT-BUFFER is current, we just examine or set + CURRENT-VALUE. If CURRENT-BUFFER is not current, we + store the current CURRENT-VALUE value into + CURRENT-ALIST- ELEMENT, then find the appropriate alist + element for the buffer now current and set up + CURRENT-ALIST-ELEMENT. Then we set CURRENT-VALUE out + of that element, and store into CURRENT-BUFFER. + + If we are setting the variable and the current buffer does + not have an alist entry for this variable, an alist entry is + created. + + Note that CURRENT-VALUE can be a forwarding pointer. + Each time it is examined or set, forwarding must be + done. */ + struct symbol_value_buffer_local *bfwd + = XSYMBOL_VALUE_BUFFER_LOCAL (valcontents); + int some_buffer_local_p = + (bfwd->magic.type == SYMVAL_SOME_BUFFER_LOCAL); + /* What value are we caching right now? */ + Lisp_Object aelt = bfwd->current_alist_element; + + if (!NILP (bfwd->current_buffer) && + current_buffer == XBUFFER (bfwd->current_buffer) + && ((some_buffer_local_p) + ? 1 /* doesn't automatically become local */ + : !NILP (aelt) /* already local */ + )) { - /* This buffer is still seeing the default value. */ - if (!some_buffer_local_p) - { - /* If it's a SYMVAL_BUFFER_LOCAL, give this buffer a - new assoc for a local value and set - CURRENT-ALIST-ELEMENT to point to that. */ - aelt = - do_symval_forwarding (bfwd->current_value, - current_buffer, - XCONSOLE (Vselected_console)); - aelt = Fcons (symbol, aelt); - current_buffer->local_var_alist - = Fcons (aelt, current_buffer->local_var_alist); - } - else + /* Cache is valid */ + valcontents = bfwd->current_value; + } + else + { + /* If the current buffer is not the buffer whose binding is + currently cached, or if it's a SYMVAL_BUFFER_LOCAL and + we're looking at the default value, the cache is invalid; we + need to write it out, and find the new CURRENT-ALIST-ELEMENT + */ + + /* Write out the cached value for the old buffer; copy it + back to its alist element. This works if the current + buffer only sees the default value, too. */ + write_out_buffer_local_cache (sym, bfwd); + + /* Find the new value for CURRENT-ALIST-ELEMENT. */ + aelt = buffer_local_alist_element (current_buffer, sym, bfwd); + if (NILP (aelt)) { - /* If the variable is a SYMVAL_SOME_BUFFER_LOCAL, - we're currently seeing the default value. */ - ; + /* This buffer is still seeing the default value. */ + if (!some_buffer_local_p) + { + /* If it's a SYMVAL_BUFFER_LOCAL, give this buffer a + new assoc for a local value and set + CURRENT-ALIST-ELEMENT to point to that. */ + aelt = + do_symval_forwarding (bfwd->current_value, + current_buffer, + XCONSOLE (Vselected_console)); + aelt = Fcons (sym, aelt); + current_buffer->local_var_alist + = Fcons (aelt, current_buffer->local_var_alist); + } + else + { + /* If the variable is a SYMVAL_SOME_BUFFER_LOCAL, + we're currently seeing the default value. */ + ; + } } + /* Cache the new buffer's assoc in CURRENT-ALIST-ELEMENT. */ + bfwd->current_alist_element = aelt; + /* Set BUFFER, now that CURRENT-ALIST-ELEMENT is accurate. */ + XSETBUFFER (bfwd->current_buffer, current_buffer); + valcontents = bfwd->current_value; } - /* Cache the new buffer's assoc in CURRENT-ALIST-ELEMENT. */ - bfwd->current_alist_element = aelt; - /* Set BUFFER, now that CURRENT-ALIST-ELEMENT is accurate. */ - XSETBUFFER (bfwd->current_buffer, current_buffer); - valcontents = bfwd->current_value; + break; } - break; - } - default: - abort (); + default: + abort (); + } } - store_symval_forwarding (symbol, valcontents, newval); + store_symval_forwarding (sym, valcontents, newval); return newval; } @@ -1935,7 +1819,7 @@ default_value (Lisp_Object sym) 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) @@ -1944,7 +1828,7 @@ default_value (Lisp_Object sym) 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) @@ -1974,7 +1858,7 @@ default_value (Lisp_Object sym) XCONSOLE (Vselected_console)); } - RETURN_NOT_REACHED (Qnil) /* suppress compiler warning */ + RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */ } DEFUN ("default-boundp", Fdefault_boundp, 1, 1, 0, /* @@ -1982,9 +1866,9 @@ Return t if SYMBOL has a non-void default value. This is the value that is seen in buffers that do not have their own values for this variable. */ - (symbol)) + (sym)) { - return UNBOUNDP (default_value (symbol)) ? Qnil : Qt; + return UNBOUNDP (default_value (sym)) ? Qnil : Qt; } DEFUN ("default-value", Fdefault_value, 1, 1, 0, /* @@ -1993,51 +1877,51 @@ This is the value that is seen in buffers that do not have their own values for this variable. The default value is meaningful for variables with local bindings in certain buffers. */ - (symbol)) + (sym)) { - Lisp_Object value = default_value (symbol); + Lisp_Object value = default_value (sym); - return UNBOUNDP (value) ? Fsignal (Qvoid_variable, list1 (symbol)) : value; + return UNBOUNDP (value) ? Fsignal (Qvoid_variable, list1 (sym)) : value; } DEFUN ("set-default", Fset_default, 2, 2, 0, /* -Set SYMBOL's default value to VALUE. SYMBOL and VALUE are evaluated. +Set SYMBOL's default value to VAL. SYMBOL and VAL are evaluated. The default value is seen in buffers that do not have their own values for this variable. */ - (symbol, value)) + (sym, value)) { Lisp_Object valcontents; - CHECK_SYMBOL (symbol); + CHECK_SYMBOL (sym); retry: - valcontents = XSYMBOL (symbol)->value; + valcontents = XSYMBOL (sym)->value; retry_2: if (!SYMBOL_VALUE_MAGIC_P (valcontents)) - return Fset (symbol, value); + return Fset (sym, value); switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents)) { case SYMVAL_LISP_MAGIC: - RETURN_IF_NOT_UNBOUND (maybe_call_magic_handler (symbol, Qset_default, 1, + RETURN_IF_NOT_UNBOUND (maybe_call_magic_handler (sym, Qset_default, 1, value)); valcontents = XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed; /* semi-change-o */ goto retry_2; case SYMVAL_VARALIAS: - symbol = follow_varalias_pointers (symbol, Qset_default); + sym = follow_varalias_pointers (sym, Qset_default); /* presto change-o! */ goto retry; case SYMVAL_CURRENT_BUFFER_FORWARD: - set_default_buffer_slot_variable (symbol, value); + set_default_buffer_slot_variable (sym, value); return value; case SYMVAL_SELECTED_CONSOLE_FORWARD: - set_default_console_slot_variable (symbol, value); + set_default_console_slot_variable (sym, value); return value; case SYMVAL_BUFFER_LOCAL: @@ -2051,48 +1935,50 @@ for this variable. /* If current-buffer doesn't shadow default_value, * we must set the CURRENT-VALUE slot too */ if (NILP (bfwd->current_alist_element)) - store_symval_forwarding (symbol, bfwd->current_value, value); + store_symval_forwarding (sym, bfwd->current_value, value); return value; } default: - return Fset (symbol, value); + return Fset (sym, value); } + RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */ } -DEFUN ("setq-default", Fsetq_default, 0, UNEVALLED, 0, /* -Set the default value of variable SYMBOL to VALUE. -SYMBOL, the variable name, is literal (not evaluated); +DEFUN ("setq-default", Fsetq_default, 2, UNEVALLED, 0, /* +Set the default value of variable SYM to VALUE. +SYM, the variable name, is literal (not evaluated); VALUE is an expression and it is evaluated. The default value of a variable is seen in buffers that do not have their own values for the variable. More generally, you can use multiple variables and values, as in - (setq-default SYMBOL VALUE SYMBOL VALUE...) -This sets each SYMBOL's default value to the corresponding VALUE. -The VALUE for the Nth SYMBOL can refer to the new default values -of previous SYMBOLs. + (setq-default SYM VALUE SYM VALUE...) +This sets each SYM's default value to the corresponding VALUE. +The VALUE for the Nth SYM can refer to the new default values +of previous SYMs. */ (args)) { /* This function can GC */ - Lisp_Object symbol, tail, val = Qnil; - int nargs; + Lisp_Object args_left; + Lisp_Object val, sym; struct gcpro gcpro1; - GET_LIST_LENGTH (args, nargs); - - if (nargs & 1) /* Odd number of arguments? */ - Fsignal (Qwrong_number_of_arguments, - list2 (Qsetq_default, make_int (nargs))); + if (NILP (args)) + return Qnil; - GCPRO1 (val); + args_left = args; + GCPRO1 (args); - PROPERTY_LIST_LOOP (tail, symbol, val, args) + do { - val = Feval (val); - Fset_default (symbol, val); + val = Feval (Fcar (Fcdr (args_left))); + sym = Fcar (args_left); + Fset_default (sym, val); + args_left = Fcdr (Fcdr (args_left)); } + while (!NILP (args_left)); UNGCPRO; return val; @@ -2166,9 +2052,8 @@ sets it. { struct symbol_value_buffer_local *bfwd = alloc_lcrecord_type (struct symbol_value_buffer_local, - &lrecord_symbol_value_buffer_local); + lrecord_symbol_value_buffer_local); Lisp_Object foo; - zero_lcrecord (&bfwd->magic); bfwd->magic.type = SYMVAL_BUFFER_LOCAL; bfwd->default_value = find_symbol_value (variable); @@ -2275,8 +2160,7 @@ Use `make-local-hook' instead. /* Make sure variable is set up to hold per-buffer values */ bfwd = alloc_lcrecord_type (struct symbol_value_buffer_local, - &lrecord_symbol_value_buffer_local); - zero_lcrecord (&bfwd->magic); + lrecord_symbol_value_buffer_local); bfwd->magic.type = SYMVAL_SOME_BUFFER_LOCAL; bfwd->current_buffer = Qnil; @@ -2386,7 +2270,7 @@ From now on the default value will apply in this buffer. 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); @@ -2480,7 +2364,7 @@ From now on the default value will apply in this console. 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); @@ -2495,7 +2379,7 @@ From now on the default value will apply in this console. Lisp_Object oldval = * (Lisp_Object *) (offset + (char *) XCONSOLE (Vconsole_defaults)); if (magicfun) - magicfun (variable, &oldval, Vselected_console, 0); + (magicfun) (variable, &oldval, Vselected_console, 0); *(Lisp_Object *) (offset + (char *) XCONSOLE (Vselected_console)) = oldval; XCONSOLE (Vselected_console)->local_var_flags &= ~mask; @@ -2506,6 +2390,7 @@ From now on the default value will apply in this console. default: return variable; } + RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */ } /* Used by specbind to determine what effects it might have. Returns: @@ -2539,7 +2424,7 @@ symbol_value_buffer_local_info (Lisp_Object symbol, struct buffer *buffer) 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))); @@ -2579,7 +2464,10 @@ Return the value of SYMBOL in BUFFER, or UNBOUND-VALUE if it is unbound. CHECK_SYMBOL (symbol); CHECK_BUFFER (buffer); value = symbol_value_in_buffer (symbol, buffer); - return UNBOUNDP (value) ? unbound_value : value; + if (UNBOUNDP (value)) + return unbound_value; + else + return value; } DEFUN ("symbol-value-in-console", Fsymbol_value_in_console, 2, 3, 0, /* @@ -2591,11 +2479,14 @@ Return the value of SYMBOL in CONSOLE, or UNBOUND-VALUE if it is unbound. CHECK_SYMBOL (symbol); CHECK_CONSOLE (console); value = symbol_value_in_console (symbol, console); - return UNBOUNDP (value) ? unbound_value : value; + if (UNBOUNDP (value)) + return unbound_value; + else + return value; } DEFUN ("built-in-variable-type", Fbuilt_in_variable_type, 1, 1, 0, /* -If SYMBOL is a built-in variable, return info about this; else return nil. +If SYM is a built-in variable, return info about this; else return nil. The returned info will be a symbol, one of `object' A simple built-in variable. @@ -2614,62 +2505,91 @@ The returned info will be a symbol, one of `default-console' Forwards to the default value of a built-in console-local variable. */ - (symbol)) + (sym)) { REGISTER Lisp_Object valcontents; - CHECK_SYMBOL (symbol); + CHECK_SYMBOL (sym); retry: - valcontents = XSYMBOL (symbol)->value; - + valcontents = XSYMBOL (sym)->value; retry_2: - if (!SYMBOL_VALUE_MAGIC_P (valcontents)) - return Qnil; - switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents)) + if (SYMBOL_VALUE_MAGIC_P (valcontents)) { - case SYMVAL_LISP_MAGIC: - valcontents = XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed; - /* semi-change-o */ - goto retry_2; + switch (XSYMBOL_VALUE_MAGIC_TYPE (valcontents)) + { + case SYMVAL_LISP_MAGIC: + valcontents = XSYMBOL_VALUE_LISP_MAGIC (valcontents)->shadowed; + /* semi-change-o */ + goto retry_2; - case SYMVAL_VARALIAS: - symbol = follow_varalias_pointers (symbol, Qt); - /* presto change-o! */ - goto retry; + case SYMVAL_VARALIAS: + sym = follow_varalias_pointers (sym, Qt); + /* presto change-o! */ + goto retry; - case SYMVAL_BUFFER_LOCAL: - case SYMVAL_SOME_BUFFER_LOCAL: - valcontents = - XSYMBOL_VALUE_BUFFER_LOCAL (valcontents)->current_value; - /* semi-change-o */ - goto retry_2; + case SYMVAL_BUFFER_LOCAL: + case SYMVAL_SOME_BUFFER_LOCAL: + valcontents = + XSYMBOL_VALUE_BUFFER_LOCAL (valcontents)->current_value; + /* semi-change-o */ + goto retry_2; - case SYMVAL_FIXNUM_FORWARD: return Qinteger; - case SYMVAL_CONST_FIXNUM_FORWARD: return Qconst_integer; - case SYMVAL_BOOLEAN_FORWARD: return Qboolean; - case SYMVAL_CONST_BOOLEAN_FORWARD: return Qconst_boolean; - case SYMVAL_OBJECT_FORWARD: return Qobject; - case SYMVAL_CONST_OBJECT_FORWARD: return Qconst_object; - case SYMVAL_CONST_SPECIFIER_FORWARD: return Qconst_specifier; - case SYMVAL_DEFAULT_BUFFER_FORWARD: return Qdefault_buffer; - case SYMVAL_CURRENT_BUFFER_FORWARD: return Qcurrent_buffer; - case SYMVAL_CONST_CURRENT_BUFFER_FORWARD: return Qconst_current_buffer; - case SYMVAL_DEFAULT_CONSOLE_FORWARD: return Qdefault_console; - case SYMVAL_SELECTED_CONSOLE_FORWARD: return Qselected_console; - case SYMVAL_CONST_SELECTED_CONSOLE_FORWARD: return Qconst_selected_console; - case SYMVAL_UNBOUND_MARKER: return Qnil; + case SYMVAL_FIXNUM_FORWARD: + return Qinteger; - default: - abort (); return Qnil; + case SYMVAL_CONST_FIXNUM_FORWARD: + return Qconst_integer; + + case SYMVAL_BOOLEAN_FORWARD: + return Qboolean; + + case SYMVAL_CONST_BOOLEAN_FORWARD: + return Qconst_boolean; + + case SYMVAL_OBJECT_FORWARD: + return Qobject; + + case SYMVAL_CONST_OBJECT_FORWARD: + return Qconst_object; + + case SYMVAL_CONST_SPECIFIER_FORWARD: + return Qconst_specifier; + + case SYMVAL_DEFAULT_BUFFER_FORWARD: + return Qdefault_buffer; + + case SYMVAL_CURRENT_BUFFER_FORWARD: + return Qcurrent_buffer; + + case SYMVAL_CONST_CURRENT_BUFFER_FORWARD: + return Qconst_current_buffer; + + case SYMVAL_DEFAULT_CONSOLE_FORWARD: + return Qdefault_console; + + case SYMVAL_SELECTED_CONSOLE_FORWARD: + return Qselected_console; + + case SYMVAL_CONST_SELECTED_CONSOLE_FORWARD: + return Qconst_selected_console; + + case SYMVAL_UNBOUND_MARKER: + return Qnil; + + default: + abort (); + } } + + return Qnil; } DEFUN ("local-variable-p", Flocal_variable_p, 2, 3, 0, /* Return t if SYMBOL's value is local to BUFFER. -If optional third arg AFTER-SET is non-nil, return t if SYMBOL would be +If optional third arg AFTER-SET is true, return t if SYMBOL would be buffer-local after it is set, regardless of whether it is so presently. A nil value for BUFFER is *not* the same as (current-buffer), but means "no buffer". Specifically: @@ -2716,7 +2636,7 @@ The interface and/or function name is sure to change before this gets into its final form. I currently like the way everything is set up and it has all the features I want it to have, except for one: I really want to be able to have multiple nested handlers, -to implement an `advice'-like capability. This would allow, +to implement an `advice'-like capabiility. This would allow, for example, a clean way of implementing `debug-if-set' or `debug-if-referenced' and such. @@ -2949,7 +2869,7 @@ maybe_call_magic_handler (Lisp_Object sym, Lisp_Object funsym, int nargs, ...) 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); @@ -2996,8 +2916,7 @@ pity, thereby invalidating your code. if (!SYMBOL_VALUE_LISP_MAGIC_P (valcontents)) { bfwd = alloc_lcrecord_type (struct symbol_value_lisp_magic, - &lrecord_symbol_value_lisp_magic); - zero_lcrecord (&bfwd->magic); + lrecord_symbol_value_lisp_magic); bfwd->magic.type = SYMVAL_LISP_MAGIC; for (i = 0; i < MAGIC_HANDLER_MAX; i++) { @@ -3026,7 +2945,7 @@ pity, thereby invalidating your code. /* functions for working with variable aliases. */ -/* Follow the chain of variable aliases for SYMBOL. Return the +/* Follow the chain of variable aliases for OBJECT. Return the resulting symbol, whose value cell is guaranteed not to be a symbol-value-varalias. @@ -3054,32 +2973,36 @@ pity, thereby invalidating your code. */ static Lisp_Object -follow_varalias_pointers (Lisp_Object symbol, +follow_varalias_pointers (Lisp_Object object, Lisp_Object follow_past_lisp_magic) { -#define VARALIAS_INDIRECTION_SUSPICION_LENGTH 16 - Lisp_Object tortoise, hare, val; - int count; + Lisp_Object tortoise = object; + Lisp_Object hare = object; /* quick out just in case */ - if (!SYMBOL_VALUE_MAGIC_P (XSYMBOL (symbol)->value)) - return symbol; - - /* Compare implementation of indirect_function(). */ - for (hare = tortoise = symbol, count = 0; - val = fetch_value_maybe_past_magic (hare, follow_past_lisp_magic), - SYMBOL_VALUE_VARALIAS_P (val); - hare = symbol_value_varalias_aliasee (XSYMBOL_VALUE_VARALIAS (val)), - count++) + if (!SYMBOL_VALUE_MAGIC_P (XSYMBOL (object)->value)) + return object; + + /* based off of indirect_function() */ + for (;;) { - if (count < VARALIAS_INDIRECTION_SUSPICION_LENGTH) continue; + Lisp_Object value; + + value = fetch_value_maybe_past_magic (hare, follow_past_lisp_magic); + if (!SYMBOL_VALUE_VARALIAS_P (value)) + break; + hare = symbol_value_varalias_aliasee (XSYMBOL_VALUE_VARALIAS (value)); + value = fetch_value_maybe_past_magic (hare, follow_past_lisp_magic); + if (!SYMBOL_VALUE_VARALIAS_P (value)) + break; + hare = symbol_value_varalias_aliasee (XSYMBOL_VALUE_VARALIAS (value)); + + value = fetch_value_maybe_past_magic (tortoise, follow_past_lisp_magic); + tortoise = symbol_value_varalias_aliasee + (XSYMBOL_VALUE_VARALIAS (value)); - if (count & 1) - tortoise = symbol_value_varalias_aliasee - (XSYMBOL_VALUE_VARALIAS (fetch_value_maybe_past_magic - (tortoise, follow_past_lisp_magic))); if (EQ (hare, tortoise)) - return Fsignal (Qcyclic_variable_indirection, list1 (symbol)); + return Fsignal (Qcyclic_variable_indirection, list1 (object)); } return hare; @@ -3133,8 +3056,7 @@ has a buffer-local value in any buffer, or the symbols nil or t. reject_constant_symbols (variable, Qunbound, 0, Qt); bfwd = alloc_lcrecord_type (struct symbol_value_varalias, - &lrecord_symbol_value_varalias); - zero_lcrecord (&bfwd->magic); + lrecord_symbol_value_varalias); bfwd->magic.type = SYMVAL_VARALIAS; bfwd->aliasee = alias; bfwd->shadowed = valcontents; @@ -3210,37 +3132,33 @@ Lisp_Object Qnull_pointer; #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 }; + +Lisp_Object Vpure_uninterned_symbol_table; 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); +#ifndef Qzero + Qzero = make_int (0); /* Only used if Lisp_Object is a union type */ +#endif - reinit_symbols_once_early (); +#ifndef Qnull_pointer + /* C guarantees that Qnull_pointer will be initialized to all 0 bits, + so the following is a actually a no-op. */ + XSETOBJ (Qnull_pointer, (enum Lisp_Type) 0, 0); +#endif + + /* see comment in Fpurecopy() */ + Vpure_uninterned_symbol_table = + make_lisp_hashtable (50, HASHTABLE_NONWEAK, HASHTABLE_EQ); + staticpro (&Vpure_uninterned_symbol_table); - /* Bootstrapping problem: Qnil isn't set when make_string_nocopy is + Qnil = Fmake_symbol (make_pure_pname ((CONST Bufbyte *) "nil", 3, 1)); + /* Bootstrapping problem: Qnil isn't set when make_pure_pname is called the first time. */ - 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; @@ -3252,143 +3170,62 @@ init_symbols_once_early (void) { int hash = hash_string (string_data (XSYMBOL (Qnil)->name), 3); XVECTOR_DATA (Vobarray)[hash % OBARRAY_SIZE] = Qnil; + XSYMBOL (Qnil)->obarray = Qt; } { /* 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 aeterna */ + XSYMBOL (Qt)->value = Qt; /* Veritas aetera */ Vquit_flag = Qnil; - - dump_add_root_object (&Qnil); - dump_add_root_object (&Qunbound); - dump_add_root_object (&Vquit_flag); -} - -void -reinit_symbols_once_early (void) -{ -#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, 0); -#endif -} - -static void -defsymbol_massage_name_1 (Lisp_Object *location, const char *name, int dump_p, - int multiword_predicate_p) -{ - char temp[500]; - size_t len = strlen (name) - 1; - size_t i; - - if (multiword_predicate_p) - assert (len + 1 < sizeof (temp)); - else - assert (len < sizeof (temp)); - strcpy (temp, name + 1); /* Remove initial Q */ - if (multiword_predicate_p) - { - strcpy (temp + len - 1, "_p"); - len++; - } - for (i = 0; i < len; i++) - if (temp[i] == '_') - temp[i] = '-'; - *location = Fintern (make_string ((const Bufbyte *) temp, len), Qnil); - if (dump_p) - staticpro (location); - else - staticpro_nodump (location); } void -defsymbol_massage_name_nodump (Lisp_Object *location, const char *name) +defsymbol (Lisp_Object *location, CONST char *name) { - defsymbol_massage_name_1 (location, name, 0, 0); -} - -void -defsymbol_massage_name (Lisp_Object *location, const char *name) -{ - defsymbol_massage_name_1 (location, name, 1, 0); -} - -void -defsymbol_massage_multiword_predicate_nodump (Lisp_Object *location, - const char *name) -{ - defsymbol_massage_name_1 (location, name, 0, 1); -} - -void -defsymbol_massage_multiword_predicate (Lisp_Object *location, const char *name) -{ - defsymbol_massage_name_1 (location, name, 1, 1); -} - -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, - strlen (name)), + *location = Fintern (make_pure_pname ((CONST Bufbyte *) name, + strlen (name), 1), Qnil); staticpro (location); } void -defkeyword (Lisp_Object *location, const char *name) +defkeyword (Lisp_Object *location, CONST char *name) { defsymbol (location, name); Fset (*location, *location); } void -defkeyword_massage_name (Lisp_Object *location, const char *name) +defsubr (struct Lisp_Subr *subr) { - char temp[500]; - size_t len = strlen (name); - - assert (len < sizeof (temp)); - strcpy (temp, name); - temp[1] = ':'; /* it's an underscore in the C variable */ - - defsymbol_massage_name (location, temp); - Fset (*location, *location); -} + Lisp_Object sym = intern (subr_name (subr)); #ifdef DEBUG_XEMACS -/* Check that nobody spazzed writing a DEFUN. */ -static void -check_sane_subr (Lisp_Subr *subr, Lisp_Object sym) -{ + /* Check that nobody spazzed writing a DEFUN. */ assert (subr->min_args >= 0); assert (subr->min_args <= SUBR_MAX_ARGS); - if (subr->max_args != MANY && - subr->max_args != UNEVALLED) + if (subr->max_args != MANY && subr->max_args != UNEVALLED) { /* Need to fix lisp.h and eval.c if SUBR_MAX_ARGS too small */ assert (subr->max_args <= SUBR_MAX_ARGS); @@ -3396,169 +3233,69 @@ check_sane_subr (Lisp_Subr *subr, Lisp_Object sym) } assert (UNBOUNDP (XSYMBOL (sym)->function)); -} -#else -#define check_sane_subr(subr, sym) /* nothing */ -#endif +#endif /* DEBUG_XEMACS */ -#ifdef HAVE_SHLIB -/* - * If we are not in a pure undumped Emacs, we need to make a duplicate of - * the subr. This is because the only time this function will be called - * in a running Emacs is when a dynamically loaded module is adding a - * subr, and we need to make sure that the subr is in allocated, Lisp- - * accessible memory. The address assigned to the static subr struct - * in the shared object will be a trampoline address, so we need to create - * a copy here to ensure that a real address is used. - * - * Once we have copied everything across, we re-use the original static - * structure to store a pointer to the newly allocated one. This will be - * used in emodules.c by emodules_doc_subr() to find a pointer to the - * allocated object so that we can set its doc string properly. - * - * NOTE: We don't actually use the DOC pointer here any more, but we did - * in an earlier implementation of module support. There is no harm in - * setting it here in case we ever need it in future implementations. - * subr->doc will point to the new subr structure that was allocated. - * Code can then get this value from the static subr structure and use - * it if required. - * - * FIXME: Should newsubr be staticpro()'ed? I don't 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; \ - } \ -} while (0) -#else /* ! HAVE_SHLIB */ -#define check_module_subr() -#endif - -void -defsubr (Lisp_Subr *subr) -{ - Lisp_Object sym = intern (subr_name (subr)); - Lisp_Object fun; - - check_sane_subr (subr, sym); - check_module_subr (); - - XSETSUBR (fun, subr); - XSYMBOL (sym)->function = fun; + XSETSUBR (XSYMBOL (sym)->function, subr); } -/* Define a lisp macro using a Lisp_Subr. */ void -defsubr_macro (Lisp_Subr *subr) -{ - Lisp_Object sym = intern (subr_name (subr)); - Lisp_Object fun; - - check_sane_subr (subr, sym); - check_module_subr(); - - XSETSUBR (fun, subr); - XSYMBOL (sym)->function = Fcons (Qmacro, fun); -} - -static void -deferror_1 (Lisp_Object *symbol, const char *name, const char *messuhhj, - Lisp_Object inherits_from, int massage_p) +deferror (Lisp_Object *symbol, CONST char *name, CONST char *messuhhj, + Lisp_Object inherits_from) { Lisp_Object conds; - if (massage_p) - defsymbol_massage_name (symbol, name); - else - defsymbol (symbol, name); + defsymbol (symbol, name); 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)); -} - -void -deferror (Lisp_Object *symbol, const char *name, const char *messuhhj, - Lisp_Object inherits_from) -{ - deferror_1 (symbol, name, messuhhj, inherits_from, 0); -} - -void -deferror_massage_name (Lisp_Object *symbol, const char *name, - const char *messuhhj, Lisp_Object inherits_from) -{ - deferror_1 (symbol, name, messuhhj, inherits_from, 1); -} - -void -deferror_massage_name_and_message (Lisp_Object *symbol, const char *name, - Lisp_Object inherits_from) -{ - char temp[500]; - size_t i; - size_t len = strlen (name) - 1; - - assert (len < sizeof (temp)); - strcpy (temp, name + 1); /* Remove initial Q */ - temp[0] = toupper (temp[0]); - for (i = 0; i < len; i++) - if (temp[i] == '_') - temp[i] = ' '; - - deferror_1 (symbol, name, temp, inherits_from, 1); + pure_put (*symbol, Qerror_message, build_string (messuhhj)); } void syms_of_symbols (void) { - DEFSYMBOL (Qvariable_documentation); - DEFSYMBOL (Qvariable_domain); /* I18N3 */ - DEFSYMBOL (Qad_advice_info); - DEFSYMBOL (Qad_activate); - - DEFSYMBOL (Qget_value); - DEFSYMBOL (Qset_value); - DEFSYMBOL (Qbound_predicate); - DEFSYMBOL (Qmake_unbound); - DEFSYMBOL (Qlocal_predicate); - DEFSYMBOL (Qmake_local); - - DEFSYMBOL (Qboundp); - DEFSYMBOL (Qglobally_boundp); - DEFSYMBOL (Qmakunbound); - DEFSYMBOL (Qsymbol_value); - DEFSYMBOL (Qset); - DEFSYMBOL (Qsetq_default); - DEFSYMBOL (Qdefault_boundp); - DEFSYMBOL (Qdefault_value); - DEFSYMBOL (Qset_default); - DEFSYMBOL (Qmake_variable_buffer_local); - DEFSYMBOL (Qmake_local_variable); - DEFSYMBOL (Qkill_local_variable); - DEFSYMBOL (Qkill_console_local_variable); - DEFSYMBOL (Qsymbol_value_in_buffer); - DEFSYMBOL (Qsymbol_value_in_console); - DEFSYMBOL (Qlocal_variable_p); - - DEFSYMBOL (Qconst_integer); - DEFSYMBOL (Qconst_boolean); - DEFSYMBOL (Qconst_object); - DEFSYMBOL (Qconst_specifier); - DEFSYMBOL (Qdefault_buffer); - DEFSYMBOL (Qcurrent_buffer); - DEFSYMBOL (Qconst_current_buffer); - DEFSYMBOL (Qdefault_console); - DEFSYMBOL (Qselected_console); - DEFSYMBOL (Qconst_selected_console); + defsymbol (&Qvariable_documentation, "variable-documentation"); + defsymbol (&Qvariable_domain, "variable-domain"); /* I18N3 */ + defsymbol (&Qad_advice_info, "ad-advice-info"); + defsymbol (&Qad_activate, "ad-activate"); + + defsymbol (&Qget_value, "get-value"); + defsymbol (&Qset_value, "set-value"); + defsymbol (&Qbound_predicate, "bound-predicate"); + defsymbol (&Qmake_unbound, "make-unbound"); + defsymbol (&Qlocal_predicate, "local-predicate"); + defsymbol (&Qmake_local, "make-local"); + + defsymbol (&Qboundp, "boundp"); + defsymbol (&Qfboundp, "fboundp"); + defsymbol (&Qglobally_boundp, "globally-boundp"); + defsymbol (&Qmakunbound, "makunbound"); + defsymbol (&Qsymbol_value, "symbol-value"); + defsymbol (&Qset, "set"); + defsymbol (&Qdefault_boundp, "default-boundp"); + defsymbol (&Qdefault_value, "default-value"); + defsymbol (&Qset_default, "set-default"); + defsymbol (&Qmake_variable_buffer_local, "make-variable-buffer-local"); + defsymbol (&Qmake_local_variable, "make-local-variable"); + defsymbol (&Qkill_local_variable, "kill-local-variable"); + defsymbol (&Qkill_console_local_variable, "kill-console-local-variable"); + defsymbol (&Qsymbol_value_in_buffer, "symbol-value-in-buffer"); + defsymbol (&Qsymbol_value_in_console, "symbol-value-in-console"); + defsymbol (&Qlocal_variable_p, "local-variable-p"); + + defsymbol (&Qconst_integer, "const-integer"); + defsymbol (&Qconst_boolean, "const-boolean"); + defsymbol (&Qconst_object, "const-object"); + defsymbol (&Qconst_specifier, "const-specifier"); + defsymbol (&Qdefault_buffer, "default-buffer"); + defsymbol (&Qcurrent_buffer, "current-buffer"); + defsymbol (&Qconst_current_buffer, "const-current-buffer"); + defsymbol (&Qdefault_console, "default-console"); + defsymbol (&Qselected_console, "selected-console"); + defsymbol (&Qconst_selected_console, "const-selected-console"); DEFSUBR (Fintern); DEFSUBR (Fintern_soft); @@ -3576,7 +3313,6 @@ syms_of_symbols (void) DEFSUBR (Ffboundp); DEFSUBR (Ffset); DEFSUBR (Fdefine_function); - Ffset (intern ("defalias"), intern ("define-function")); DEFSUBR (Fsetplist); DEFSUBR (Fsymbol_value_in_buffer); DEFSUBR (Fsymbol_value_in_console); @@ -3598,26 +3334,29 @@ syms_of_symbols (void) DEFSUBR (Fdontusethis_set_symbol_value_handler); } -/* Create and initialize a Lisp variable whose value is forwarded to C data */ +/* Create and initialize a variable whose value is forwarded to C data */ void -defvar_magic (const char *symbol_name, const struct symbol_value_forward *magic) +defvar_mumble (CONST char *namestring, CONST void *magic, size_t sizeof_magic) { - Lisp_Object sym; + Lisp_Object kludge; + Lisp_Object sym = Fintern (make_pure_pname ((CONST Bufbyte *) namestring, + strlen (namestring), + 1), + Qnil); -#if defined(HAVE_SHLIB) - /* - * As with defsubr(), this will only be called in a dumped Emacs when - * we are adding variables from a dynamically loaded module. That means - * we can't use purespace. Take that into account. - */ - if (initialized) - sym = Fintern (build_string (symbol_name), Qnil); + /* Check that magic points somewhere we can represent as a Lisp pointer */ + XSETOBJ (kludge, Lisp_Type_Record, magic); + if (magic != (CONST void *) XPNTR (kludge)) + { + /* This might happen on DATA_SEG_BITS machines. */ + /* abort (); */ + /* Copy it to somewhere which is representable. */ + void *f = xmalloc (sizeof_magic); + memcpy (f, magic, sizeof_magic); + XSETOBJ (XSYMBOL (sym)->value, Lisp_Type_Record, f); + } else -#endif - sym = Fintern (make_string_nocopy ((const Bufbyte *) symbol_name, - strlen (symbol_name)), Qnil); - - XSETOBJ (XSYMBOL (sym)->value, magic); + XSETOBJ (XSYMBOL (sym)->value, Lisp_Type_Record, magic); } void diff --git a/src/symsinit.h b/src/symsinit.h index e48f8d7..1b0b8f2 100644 --- a/src/symsinit.h +++ b/src/symsinit.h @@ -20,8 +20,8 @@ Boston, MA 02111-1307, USA. */ /* 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). */ @@ -32,16 +32,12 @@ void init_intl_very_early (void); void init_process_times_very_early (void); void init_ralloc (void); void init_signals_very_early (void); -void init_mswindows_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). */ @@ -68,11 +64,11 @@ void syms_of_device_tty (void); void syms_of_device_mswindows (void); void syms_of_device_x (void); void syms_of_device (void); -void syms_of_dialog_mswindows (void); void syms_of_dialog_x (void); void syms_of_dialog (void); void syms_of_dired (void); void syms_of_dired_mswindows (void); +void syms_of_dll (void); void syms_of_doc (void); void syms_of_dragdrop (void); void syms_of_editfns (void); @@ -97,15 +93,11 @@ void syms_of_free_hook (void); void syms_of_general (void); void syms_of_glyphs_x (void); void syms_of_glyphs_eimage (void); -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); @@ -116,14 +108,12 @@ void syms_of_menubar_x (void); void syms_of_menubar (void); void syms_of_menubar_mswindows (void); void syms_of_minibuf (void); -void syms_of_module (void); void syms_of_mule (void); 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); void syms_of_objects_x (void); void syms_of_objects_mswindows (void); @@ -138,7 +128,6 @@ void syms_of_redisplay (void); 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); @@ -146,44 +135,34 @@ void syms_of_specifier (void); 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); -void syms_of_win32 (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); @@ -193,20 +172,13 @@ void console_type_create_scrollbar_mswindows (void); 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). */ @@ -214,21 +186,19 @@ void structure_type_create (void); void structure_type_create_chartab (void); void structure_type_create_faces (void); void structure_type_create_rangetab (void); -void structure_type_create_hash_table (void); +void structure_type_create_hashtable (void); /* Initialize the image instantiator types (dump-time only). */ void image_instantiator_format_create (void); void image_instantiator_format_create_glyphs_eimage (void); -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); @@ -241,33 +211,27 @@ void process_type_create_unix (void); 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); @@ -279,117 +243,77 @@ void vars_of_editfns (void); 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_glyphs_widget (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); @@ -397,7 +321,7 @@ void specifier_vars_of_toolbar (void); 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); @@ -405,7 +329,7 @@ void complex_vars_of_event_stream (void); 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); @@ -417,28 +341,26 @@ void complex_vars_of_casetab (void); 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). */ void reinit_alloc (void); void reinit_eval (void); -void init_postgresql_from_environment (void); /* Late initialization -- stuff pertaining only to interactive usage, I/O, or Lisp reading. (Dump-time and run-time.) */ 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); @@ -454,41 +376,5 @@ void init_ntproc (void); /* #### delete me, please! */ void init_xemacs_process (void); void init_redisplay (void); void init_sunpro (void); -void init_win32 (void); - -void syms_of_device_gtk (void); -void syms_of_dialog_gtk (void); -void syms_of_event_gtk (void); -void syms_of_frame_gtk (void); -void syms_of_glyphs_gtk (void); -void syms_of_gui_gtk (void); -void syms_of_menubar_gtk (void); -void syms_of_objects_gtk (void); -void syms_of_select_gtk (void); -void syms_of_ui_gtk (void); -void console_type_create_gtk (void); -void console_type_create_device_gtk (void); -void console_type_create_frame_gtk (void); -void console_type_create_glyphs_gtk (void); -void console_type_create_menubar_gtk (void); -void console_type_create_objects_gtk (void); -void console_type_create_redisplay_gtk (void); -void console_type_create_scrollbar_gtk (void); -void console_type_create_toolbar_gtk (void); -void console_type_create_dialog_gtk (void); -void image_instantiator_format_create_glyphs_gtk (void); -void vars_of_device_gtk (void); -void vars_of_dialog_gtk (void); -void vars_of_event_gtk (void); -void vars_of_frame_gtk (void); -void vars_of_glyphs_gtk (void); -void vars_of_gui_gtk (void); -void vars_of_menubar_gtk (void); -void vars_of_objects_gtk (void); -void vars_of_scrollbar_gtk (void); -void vars_of_select_gtk (void); -void vars_of_ui_gtk (void); -void complex_vars_of_glyphs_gtk (void); -void init_event_gtk_late (void); - -#endif /* INCLUDED_symsinit_h_ */ + +#endif /* _XEMACS_SYMSINIT_H_ */ diff --git a/src/syntax.c b/src/syntax.c index 42628c5..9a1d56b 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -27,8 +27,9 @@ Boston, MA 02111-1307, USA. */ #include "lisp.h" #include "buffer.h" +#include "commands.h" +#include "insdel.h" #include "syntax.h" -#include "extents.h" /* Here is a comment from Ken'ichi HANDA <handa@etl.go.jp> explaining the purpose of the Sextword syntax category: @@ -54,13 +55,6 @@ Sextword is a word-constituent but a word boundary may exist between two such characters. */ /* Mule 2.4 doesn't seem to have Sextword - I'm removing it -- mrb */ -/* Recovered by tomo */ - -#define ST_COMMENT_STYLE 0x101 -#define ST_STRING_STYLE 0x102 - -Lisp_Object Qsyntax_table; -int lookup_syntax_properties; Lisp_Object Qsyntax_table_p; @@ -81,10 +75,6 @@ int no_quit_in_re_search; and the like. */ struct buffer *regex_emacs_buffer; -/* In Emacs, this is the string or buffer in which we - are matching. It is used for looking up syntax properties. */ -Lisp_Object regex_match_object; - Lisp_Object Vstandard_syntax_table; Lisp_Object Vsyntax_designator_chars_string; @@ -96,7 +86,7 @@ struct lisp_parse_state int depth; /* Depth at end of parsing */ Emchar instring; /* -1 if not within string, else desired terminator */ int incomment; /* Nonzero if within a comment at end of parsing */ - int comstyle; /* comment style a=0, or b=1, or ST_COMMENT_STYLE */ + int comstyle; /* comment style a=0, or b=1 */ int quoted; /* Nonzero if just after an escape char at end of parsing */ Bufpos thislevelstart;/* Char number of most recent start-of-expression @@ -104,11 +94,7 @@ struct lisp_parse_state Bufpos prevlevelstart;/* Char number of start of containing expression */ Bufpos location; /* Char number at which parsing stopped */ int mindepth; /* Minimum depth seen while scanning */ - Bufpos comstr_start; /* Position just after last comment/string starter - (if the 'syntax-table text property is not - supported, used only for comment starts) */ - Lisp_Object levelstarts; /* Char numbers of starts-of-expression - of levels (starting from outermost). */ + Bufpos comstart; /* Position just after last comment starter */ }; /* These variables are a cache for finding the start of a defun. @@ -132,6 +118,7 @@ static Bufpos find_defun_start (struct buffer *buf, Bufpos pos) { Bufpos tem; + 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 @@ -147,14 +134,10 @@ find_defun_start (struct buffer *buf, Bufpos pos) /* Back up to start of line. */ tem = find_next_newline (buf, pos, -1); - SCS_STATISTICS_SET_FUNCTION (scs_find_defun_start); - SETUP_SYNTAX_CACHE (tem, 1); while (tem > BUF_BEGV (buf)) { - UPDATE_SYNTAX_CACHE_BACKWARD(tem); - /* Open-paren at start of line means we found our defun-start. */ - if (SYNTAX_FROM_CACHE (mirrortab, BUF_FETCH_CHAR (buf, tem)) == Sopen) + if (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, tem)) == Sopen) break; /* Move to beg of previous line. */ tem = find_next_newline (buf, tem, -2); @@ -171,13 +154,12 @@ find_defun_start (struct buffer *buf, Bufpos pos) } DEFUN ("syntax-table-p", Fsyntax_table_p, 1, 1, 0, /* -Return t if OBJECT is a syntax table. +Return t if ARG is a syntax table. Any vector of 256 elements will do. */ - (object)) + (obj)) { - return (CHAR_TABLEP (object) - && XCHAR_TABLE_TYPE (object) == CHAR_TABLE_TYPE_SYNTAX) + return CHAR_TABLEP (obj) && XCHAR_TABLE_TYPE (obj) == CHAR_TABLE_TYPE_SYNTAX ? Qt : Qnil; } @@ -211,294 +193,39 @@ This is the one used for new buffers. } DEFUN ("copy-syntax-table", Fcopy_syntax_table, 0, 1, 0, /* -Return a new syntax table which is a copy of SYNTAX-TABLE. -SYNTAX-TABLE defaults to the standard syntax table. +Construct a new syntax table and return it. +It is a copy of the TABLE, which defaults to the standard syntax table. */ - (syntax_table)) + (table)) { if (NILP (Vstandard_syntax_table)) return Fmake_char_table (Qsyntax); - syntax_table = check_syntax_table (syntax_table, Vstandard_syntax_table); - return Fcopy_char_table (syntax_table); + table = check_syntax_table (table, Vstandard_syntax_table); + return Fcopy_char_table (table); } DEFUN ("set-syntax-table", Fset_syntax_table, 1, 2, 0, /* -Select SYNTAX-TABLE as the new syntax table for BUFFER. +Select a new syntax table for BUFFER. +One argument, a syntax table. BUFFER defaults to the current buffer if omitted. */ - (syntax_table, buffer)) + (table, buffer)) { struct buffer *buf = decode_buffer (buffer, 0); - syntax_table = check_syntax_table (syntax_table, Qnil); - buf->syntax_table = syntax_table; - buf->mirror_syntax_table = XCHAR_TABLE (syntax_table)->mirror_table; + table = check_syntax_table (table, Qnil); + buf->syntax_table = table; + buf->mirror_syntax_table = XCHAR_TABLE (table)->mirror_table; /* Indicate that this buffer now has a specified syntax table. */ buf->local_var_flags |= XINT (buffer_local_flags.syntax_table); - return syntax_table; -} - -/* The current syntax state */ -struct syntax_cache syntax_cache; - - -/* - Update syntax_cache to an appropriate setting for position POS - - The sign of COUNT gives the relative position of POS wrt the - previously valid interval. (not currently used) - - `syntax_cache.*_change' are the next and previous positions at - which syntax_code and c_s_t will need to be recalculated. - - #### Currently this code uses 'get-char-property', which will - return the "last smallest" extent at a given position. In cases - where overlapping extents are defined, this code will simply use - whatever is returned by get-char-property. - - It might be worth it at some point to merge provided syntax tables - outward to the current buffer. - - sjt sez: - This implementation has to rather inefficient, since it looks at - next-extent-change, and a heavily font-locked buffer will be rife - with irrelevant extents. We could do a sledgehammer check on this - by looking at the distribution of extent lengths. Also count up - cache hits and misses. - - If we assume that syntax-table is a _text_ property (which also - deals with the issue of overlapping syntax-table properties), then - the following strategy recommends itself - o give the syntax cache a `valid' flag, to be reset whenever a - syntax-table property is added, changed, or removed; this could - be done by setting syntax_cache's prev_change > next_change - (but not compatible with using extents/markers here); if it's a - Lisp variable, doing it in Lisp shouldn't be too inefficient - o lazily initialize the cache whenever the object being examined - differs from the object the cache currently refers to - o by using {previous,next-single-property-change} we should be - able to get much bigger cache intervals (in most cases, the - whole buffer) - o cache markers instead of positions so the mere insertion or - deletion of text doesn't invalidate the cache, only if it - involves a syntax-table property (we could also cache the - extents carrying the syntax-table text-property; that gives us - another check for invalid cache). - - If I understand this correctly, we need to invalidate the cache in the - following cases: - o If the referenced object changes (it's a global cache) - o If there are insertions or deletions of text (the positions are - absolute; fix: use markers or an extent instead?) - o If the syntax-table property is altered == added and different or - removed and the same (fix: probably computable from range overlap, - but is it worth it? would interact with ins/del); this includes - detachment of extents with the same value (but only the boundary - extents, as otherwise the range coalesces across the deletion point) - and attachment of extents with a different value - Note: the above looks a lot like what Ben has implemented in 21.5, but - he goes one better by making the cache buffer-local. - - Note: cperl mode uses the text property API, not extents/overlays. -*/ - -#ifdef SYNTAX_CACHE_STATISTICS -struct syntax_cache_statistics scs_statistics = - { 0, 0, 0, 0, -1, -1, 0.0, 0.0, scs_no_function}; - -char* syntax_cache_statistics_function_names[scs_number_of_functions] = { - "find_context", - "find_defun_start", - "scan_words", - "Fforward_comment", - "scan_lists", - "Fbackward_prefix_characters", - "scan_sexps_forward" -}; -#endif /* SYNTAX_CACHE_STATISTICS */ - -void -update_syntax_cache (int pos, int count) -{ - Lisp_Object tmp_table; - -#ifdef SYNTAX_CACHE_STATISTICS - if (scs_statistics.total_updates == 0) - { - int i; - for (i = 0; i < scs_number_of_functions; ++i) - scs_statistics.functions[i] = 0; - } - if (syntax_cache.prev_change > syntax_cache.next_change) - scs_statistics.inits++; - else if (pos < syntax_cache.prev_change) - scs_statistics.misses_lo++; - else if (pos >= syntax_cache.next_change) - scs_statistics.misses_hi++; -#endif /* SYNTAX_CACHE_STATISTICS */ - - /* #### Since font-lock undoes any narrowing, maybe the BUF_ZV and - BUF_BEGV below should be BUF_Z and BUF_BEG respectively? */ - if (BUFFERP (syntax_cache.object)) - { - int get_change_before = pos + 1; - - tmp_table = Fget_char_property (make_int(pos), Qsyntax_table, - syntax_cache.object, Qnil); -#if NEXT_SINGLE_PROPERTY_CHANGE - /* #### shouldn't we be using BUF_BEGV here? */ - syntax_cache.next_change = - XINT (Fnext_single_property_change - (make_int (pos > 0 ? pos : 1), Qsyntax_table, - syntax_cache.object, make_int (BUF_ZV (syntax_cache.buffer)))); -#else - syntax_cache.next_change = - XINT (Fnext_extent_change (make_int (pos > 0 ? pos : 1), - syntax_cache.object)); -#endif - - /* #### shouldn't we be using BUF_BEGV here? */ - if (get_change_before < 1) - get_change_before = 1; - else if (get_change_before > BUF_ZV (syntax_cache.buffer)) - get_change_before = BUF_ZV (syntax_cache.buffer); - -#if PREVIOUS_SINGLE_PROPERTY_CHANGE - /* #### shouldn't we be using BUF_BEGV here? */ - syntax_cache.prev_change = - XINT (Fprevious_single_property_change - (make_int (get_change_before), Qsyntax_table, - syntax_cache.object, make_int(1))); -#else - syntax_cache.prev_change = - XINT (Fprevious_extent_change (make_int (get_change_before), - syntax_cache.object)); -#endif - } - else if (STRINGP (syntax_cache.object)) - { - int get_change_before = pos + 1; - - tmp_table = Fget_char_property (make_int(pos), Qsyntax_table, - syntax_cache.object, Qnil); -#if NEXT_SINGLE_PROPERTY_CHANGE - /* #### shouldn't we be using BUF_BEGV here? */ - syntax_cache.next_change = - XINT (Fnext_single_property_change - (make_int (pos >= 0 ? pos : 0), Qsyntax_table, - syntax_cache.object, - make_int(XSTRING_LENGTH(syntax_cache.object)))); -#else - syntax_cache.next_change = - XINT (Fnext_extent_change (make_int (pos >= 0 ? pos : 0), - syntax_cache.object)); -#endif - - if (get_change_before < 0) - get_change_before = 0; - else if (get_change_before > XSTRING_LENGTH(syntax_cache.object)) - get_change_before = XSTRING_LENGTH(syntax_cache.object); - -#if PREVIOUS_SINGLE_PROPERTY_CHANGE - syntax_cache.prev_change = - XINT (Fprevious_single_property_change - (make_int (get_change_before), Qsyntax_table, - syntax_cache.object, make_int(0))); -#else - syntax_cache.prev_change = - XINT (Fprevious_extent_change (make_int (get_change_before), - syntax_cache.object)); -#endif - } - else - { - tmp_table = Qnil; /* silence compiler */ - /* Always aborts. #### Is there another sensible thing to do here? */ - assert (BUFFERP (syntax_cache.object) || STRINGP (syntax_cache.object)); - } - - if (EQ (Fsyntax_table_p (tmp_table), Qt)) - { - syntax_cache.use_code = 0; - syntax_cache.current_syntax_table = - XCHAR_TABLE (tmp_table)->mirror_table; - } - else if (CONSP (tmp_table) && INTP (XCAR (tmp_table))) - { - syntax_cache.use_code = 1; - syntax_cache.syntax_code = XINT (XCAR(tmp_table)); - } - else - { - syntax_cache.use_code = 0; - syntax_cache.current_syntax_table = - syntax_cache.buffer->mirror_syntax_table; - } - -#ifdef SYNTAX_CACHE_STATISTICS - { - int length = syntax_cache.next_change - syntax_cache.prev_change; - int misses = scs_statistics.misses_lo + - scs_statistics.misses_hi + scs_statistics.inits; - - if (scs_statistics.min_length == -1 || scs_statistics.min_length > length) - scs_statistics.min_length = length; - if (scs_statistics.max_length == -1 || scs_statistics.max_length < length) - scs_statistics.max_length = length; - scs_statistics.mean_length_on_miss = - ((misses - 1) * scs_statistics.mean_length_on_miss + length) / misses; - } - - scs_statistics.mean_length - = scs_statistics.total_updates*scs_statistics.mean_length - + syntax_cache.next_change - syntax_cache.prev_change; - scs_statistics.total_updates++; - scs_statistics.mean_length /= scs_statistics.total_updates; - - if (scs_statistics.this_function != scs_no_function) - { - scs_statistics.functions[scs_statistics.this_function]++; - scs_statistics.this_function = scs_no_function; - } - - if (!(scs_statistics.total_updates % SYNTAX_CACHE_STATISTICS_REPORT_INTERVAL)) - { - fprintf (stderr, "Syntax cache stats:\n "); - fprintf (stderr, "updates %d, inits %d, misses low %d, misses high %d,", - scs_statistics.total_updates, scs_statistics.inits, - scs_statistics.misses_lo, scs_statistics.misses_hi); - fprintf (stderr, "\n "); - -#define REPORT_FUNCTION(i) \ - fprintf (stderr, " %s %d,", \ - syntax_cache_statistics_function_names[i], \ - scs_statistics.functions[i]); - - REPORT_FUNCTION(scs_find_context); - REPORT_FUNCTION(scs_find_defun_start); - REPORT_FUNCTION(scs_scan_words); - REPORT_FUNCTION(scs_Fforward_comment); - fprintf (stderr, "\n "); - REPORT_FUNCTION(scs_scan_lists); - REPORT_FUNCTION(scs_Fbackward_prefix_characters); - REPORT_FUNCTION(scs_scan_sexps_forward); -#undef REPORT_FUNCTION - - fprintf (stderr, "\n min length %d, max length %d,", - scs_statistics.min_length, scs_statistics.max_length); - fprintf (stderr, "\n mean length %.1f, mean length on miss %.1f\n", - scs_statistics.mean_length, - scs_statistics.mean_length_on_miss); - } -#endif /* SYNTAX_CACHE_STATISTICS */ + return table; } - /* Convert a letter which signifies a syntax code 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, @@ -517,10 +244,10 @@ const unsigned char syntax_spec_code[0400] = 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, /* `, a, ... */ 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, (char) Sword, - 0377, 0377, 0377, 0377, (char) Sstring_fence, 0377, 0377, 0377 + 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. @@ -533,26 +260,25 @@ numbered starting at 0. } DEFUN ("char-syntax", Fchar_syntax, 1, 2, 0, /* -Return the syntax code of CHARACTER, described by a character. -For example, if CHARACTER is a word constituent, -the character `?w' is returned. +Return the syntax code of CHAR, described by a character. +For example, if CHAR is a word constituent, the character `?w' is returned. The characters that correspond to various syntax codes are listed in the documentation of `modify-syntax-entry'. -Optional second argument SYNTAX-TABLE defaults to the current buffer's +Optional second argument TABLE defaults to the current buffer's syntax table. */ - (character, syntax_table)) + (ch, table)) { - Lisp_Char_Table *mirrortab; + struct Lisp_Char_Table *mirrortab; - if (NILP (character)) + if (NILP(ch)) { - character = make_char ('\000'); + ch = make_char('\000'); } - CHECK_CHAR_COERCE_INT (character); - syntax_table = check_syntax_table (syntax_table, current_buffer->syntax_table); - mirrortab = XCHAR_TABLE (XCHAR_TABLE (syntax_table)->mirror_table); - return make_char (syntax_code_spec[(int) SYNTAX (mirrortab, XCHAR (character))]); + CHECK_CHAR_COERCE_INT (ch); + table = check_syntax_table (table, current_buffer->syntax_table); + mirrortab = XCHAR_TABLE (XCHAR_TABLE (table)->mirror_table); + return make_char (syntax_code_spec[(int) SYNTAX (mirrortab, XCHAR (ch))]); } #ifdef MULE @@ -568,51 +294,50 @@ charset_syntax (struct buffer *buf, Lisp_Object charset, int *multi_p_out) #endif Lisp_Object -syntax_match (Lisp_Object syntax_table, Emchar ch) +syntax_match (Lisp_Object table, Emchar ch) { - Lisp_Object code = XCHAR_TABLE_VALUE_UNSAFE (syntax_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; } DEFUN ("matching-paren", Fmatching_paren, 1, 2, 0, /* -Return the matching parenthesis of CHARACTER, or nil if none. -Optional second argument SYNTAX-TABLE defaults to the current buffer's +Return the matching parenthesis of CHAR, or nil if none. +Optional second argument TABLE defaults to the current buffer's syntax table. */ - (character, syntax_table)) + (ch, table)) { - Lisp_Char_Table *mirrortab; + struct Lisp_Char_Table *mirrortab; int code; - CHECK_CHAR_COERCE_INT (character); - syntax_table = check_syntax_table (syntax_table, current_buffer->syntax_table); - mirrortab = XCHAR_TABLE (XCHAR_TABLE (syntax_table)->mirror_table); - code = SYNTAX (mirrortab, XCHAR (character)); + CHECK_CHAR_COERCE_INT (ch); + table = check_syntax_table (table, current_buffer->syntax_table); + mirrortab = XCHAR_TABLE (XCHAR_TABLE (table)->mirror_table); + code = SYNTAX (mirrortab, XCHAR (ch)); if (code == Sopen || code == Sclose || code == Sstring) - return syntax_match (syntax_table, XCHAR (character)); + return syntax_match (table, XCHAR (ch)); return Qnil; } -#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. @@ -622,13 +347,7 @@ Bufpos scan_words (struct buffer *buf, Bufpos from, int count) { Bufpos limit = count > 0 ? BUF_ZV (buf) : BUF_BEGV (buf); - Emchar ch0, ch1; - enum syntaxcode code; - - SCS_STATISTICS_SET_FUNCTION (scs_scan_words); - SETUP_SYNTAX_CACHE_FOR_BUFFER (buf, from, count); - - /* #### 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; @@ -637,37 +356,15 @@ scan_words (struct buffer *buf, Bufpos from, int count) { if (from == limit) return 0; - - UPDATE_SYNTAX_CACHE_FORWARD (from); - ch0 = BUF_FETCH_CHAR (buf, from); - code = SYNTAX_FROM_CACHE (mirrortab, ch0); - - from++; - if (words_include_escapes - && (code == Sescape || code == Scharquote)) - break; - if (code == Sword) + if (word_constituent_p (buf, from, mirrortab)) break; + from++; } QUIT; - while (from != limit) + while ((from != limit) && word_constituent_p (buf, from, mirrortab)) { - UPDATE_SYNTAX_CACHE_FORWARD (from); - ch1 = BUF_FETCH_CHAR (buf, from); - code = SYNTAX_FROM_CACHE (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--; @@ -681,38 +378,15 @@ scan_words (struct buffer *buf, Bufpos from, int count) { if (from == limit) return 0; - - UPDATE_SYNTAX_CACHE_BACKWARD (from - 1); - ch1 = BUF_FETCH_CHAR (buf, from - 1); - code = SYNTAX_FROM_CACHE (mirrortab, ch1); - from--; - - if (words_include_escapes - && (code == Sescape || code == Scharquote)) - break; - if (code == Sword) + if (word_constituent_p (buf, from - 1, mirrortab)) break; + from--; } QUIT; - while (from != limit) + while ((from != limit) && word_constituent_p (buf, from - 1, mirrortab)) { - UPDATE_SYNTAX_CACHE_BACKWARD (from - 1); - ch0 = BUF_FETCH_CHAR (buf, from - 1); - code = SYNTAX_FROM_CACHE (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++; @@ -721,43 +395,25 @@ scan_words (struct buffer *buf, Bufpos from, int count) return from; } -DEFUN ("forward-word", Fforward_word, 0, 2, "_p", /* -Move point forward COUNT words (backward if COUNT is negative). -Normally t is returned, but if an edge of the buffer is reached, -point is left there and nil is returned. - -The characters that are moved over may be added to the current selection -\(i.e. active region) if the Shift key is held down, a motion key is used -to invoke this command, and `shifted-motion-keys-select-region' is t; see -the documentation for this variable for more details. - -COUNT defaults to 1, and BUFFER defaults to the current buffer. +DEFUN ("forward-word", Fforward_word, 1, 2, "_p", /* +Move point forward ARG words (backward if ARG is negative). +Normally returns t. +If an edge of the buffer is reached, point is left there +and nil is returned. */ (count, buffer)) { Bufpos val; struct buffer *buf = decode_buffer (buffer, 0); - EMACS_INT n; - - if (NILP (count)) - n = 1; - else - { - CHECK_INT (count); - n = XINT (count); - } + CHECK_INT (count); - val = scan_words (buf, BUF_PT (buf), n); - if (val) + if (!(val = scan_words (buf, BUF_PT (buf), XINT (count)))) { - BUF_SET_PT (buf, val); - return Qt; - } - else - { - BUF_SET_PT (buf, n > 0 ? BUF_ZV (buf) : BUF_BEGV (buf)); + BUF_SET_PT (buf, XINT (count) > 0 ? BUF_ZV (buf) : BUF_BEGV (buf)); return Qnil; } + BUF_SET_PT (buf, val); + return Qt; } static void scan_sexps_forward (struct buffer *buf, @@ -768,11 +424,11 @@ static void scan_sexps_forward (struct buffer *buf, int commentstop); static int -find_start_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, - int comstyle) +find_start_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int mask) { Emchar c; enum syntaxcode code; + 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. @@ -790,88 +446,52 @@ find_start_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, Bufpos comstart_pos = 0; int comstart_parity = 0; int styles_match_p = 0; - /* mask to match comment styles against; for ST_COMMENT_STYLE, this - will get set to SYNTAX_COMMENT_STYLE_B, but never get checked */ - int mask = comstyle ? SYNTAX_COMMENT_STYLE_B : SYNTAX_COMMENT_STYLE_A; /* At beginning of range to scan, we're outside of strings; that determines quote parity to the comment-end. */ while (from != stop) { - int syncode; - /* Move back and examine a character. */ from--; - UPDATE_SYNTAX_CACHE_BACKWARD (from); c = BUF_FETCH_CHAR (buf, from); - syncode = SYNTAX_CODE_FROM_CACHE (mirrortab, c); - code = SYNTAX_FROM_CODE (syncode); + code = SYNTAX_UNSAFE (mirrortab, c); /* is this a 1-char comment end sequence? if so, try to see if style matches previously extracted mask */ if (code == Sendcomment) { - /* MT had SYNTAX_CODE_COMMENT_1CHAR_MASK (syncode) & mask - but (as a Boolean) that's just a complicated way to write: */ - styles_match_p = SYNTAX_CODE_MATCHES_1CHAR_P (syncode, mask); + styles_match_p = SYNTAX_STYLES_MATCH_1CHAR_P (mirrortab, c, mask); + } + + /* otherwise, is this a 2-char comment end sequence? */ + else if (from >= stop + && SYNTAX_END_P (mirrortab, c, BUF_FETCH_CHAR (buf, from+1))) + { + code = Sendcomment; + styles_match_p = + SYNTAX_STYLES_MATCH_END_P (mirrortab, c, + BUF_FETCH_CHAR (buf, from+1), + mask); } /* or are we looking at a 1-char comment start sequence of the style matching mask? */ - else if (code == Scomment) + else if (code == Scomment + && SYNTAX_STYLES_MATCH_1CHAR_P (mirrortab, c, mask)) { - styles_match_p = SYNTAX_CODE_MATCHES_1CHAR_P (syncode, mask); + styles_match_p = 1; } - /* otherwise, is this a 2-char comment end or start sequence? */ - else if (from > stop) - do - { - /* 2-char comment end sequence? */ - if (SYNTAX_CODE_END_SECOND_P (syncode)) - { - int prev_syncode; - UPDATE_SYNTAX_CACHE_BACKWARD (from - 1); - prev_syncode = - SYNTAX_CODE_FROM_CACHE (mirrortab, - BUF_FETCH_CHAR (buf, from - 1)); - - if (SYNTAX_CODES_END_P (prev_syncode, syncode)) - { - code = Sendcomment; - styles_match_p = - SYNTAX_CODES_MATCH_END_P (prev_syncode, syncode, mask); - from--; - UPDATE_SYNTAX_CACHE_BACKWARD (from); - c = BUF_FETCH_CHAR (buf, from); - - /* Found a comment-end sequence, so skip past the - check for a comment-start */ - break; - } - } - - /* 2-char comment start sequence? */ - if (SYNTAX_CODE_START_SECOND_P (syncode)) - { - int prev_syncode; - UPDATE_SYNTAX_CACHE_BACKWARD (from - 1); - prev_syncode = - SYNTAX_CODE_FROM_CACHE (mirrortab, - BUF_FETCH_CHAR (buf, from - 1)); - - if (SYNTAX_CODES_START_P (prev_syncode, syncode)) - { - code = Scomment; - styles_match_p = - SYNTAX_CODES_MATCH_START_P (prev_syncode, syncode, mask); - from--; - UPDATE_SYNTAX_CACHE_BACKWARD (from); - c = BUF_FETCH_CHAR (buf, from); - } - } - } while (0); + /* or possibly, a 2-char comment start sequence */ + else if (from >= stop + && SYNTAX_STYLES_MATCH_START_P (mirrortab, c, + BUF_FETCH_CHAR (buf, from+1), + mask)) + { + code = Scomment; + styles_match_p = 1; + } /* Ignore escaped characters. */ if (char_quoted (buf, from)) @@ -889,19 +509,6 @@ find_start_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, string_lossage = 1; } - if (code == Sstring_fence || code == Scomment_fence) - { - parity ^= 1; - if (my_stringend == 0) - my_stringend = - code == Sstring_fence ? ST_STRING_STYLE : ST_COMMENT_STYLE; - /* If we have two kinds of string delimiters. - There's no way to grok this scanning backwards. */ - else if (my_stringend != (code == Sstring_fence - ? ST_STRING_STYLE : ST_COMMENT_STYLE)) - string_lossage = 1; - } - /* Record comment-starters according to that quote-parity to the comment-end. */ if (code == Scomment && styles_match_p) @@ -943,67 +550,42 @@ find_start_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, scan_sexps_forward (buf, &state, find_defun_start (buf, comment_end), comment_end - 1, -10000, 0, Qnil, 0); if (state.incomment) - from = state.comstr_start; + from = state.comstart; else /* We can't grok this as a comment; scan it normally. */ from = comment_end; - UPDATE_SYNTAX_CACHE_FORWARD (from - 1); } return from; } static Bufpos -find_end_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int comstyle) +find_end_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int mask) { int c; - int syncode; - enum syntaxcode code, next_code; - /* mask to match comment styles against; for ST_COMMENT_STYLE, this - will get set to SYNTAX_COMMENT_STYLE_B, but never get checked */ - int mask = comstyle ? SYNTAX_COMMENT_STYLE_B : SYNTAX_COMMENT_STYLE_A; - - /* This is only called by functions which have already set up the - syntax_cache and are keeping it up-to-date */ + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); + while (1) { if (from == stop) { return -1; } - - UPDATE_SYNTAX_CACHE_FORWARD (from); c = BUF_FETCH_CHAR (buf, from); - syncode = SYNTAX_CODE_FROM_CACHE (mirrortab, c); - code = SYNTAX_FROM_CODE (syncode); + if (SYNTAX_UNSAFE (mirrortab, c) == Sendcomment + && SYNTAX_STYLES_MATCH_1CHAR_P (mirrortab, c, mask)) + /* we have encountered a comment end of the same style + as the comment sequence which began this comment + section */ + break; from++; - UPDATE_SYNTAX_CACHE_FORWARD (from); - - /* At end of current generic comment? */ - if (comstyle == ST_COMMENT_STYLE) - { - if (code == Scomment_fence) - break; /* matched */ - else - continue; /* Ignore other styles in generic comments */ - } - /* At end of current one-character comment of specified style? */ - else if (code == Sendcomment && - SYNTAX_CODE_MATCHES_1CHAR_P (syncode, mask)) - { - /* pre-MT code effectively does from-- here, that seems wrong */ - break; - } - - /* At end of current two-character comment of specified style? */ - c = BUF_FETCH_CHAR (buf, from); - next_code = SYNTAX_CODE_FROM_CACHE (mirrortab, c); - if (from < stop && SYNTAX_CODES_MATCH_END_P (syncode, next_code, mask)) - { - from++; - UPDATE_SYNTAX_CACHE_FORWARD (from); - break; - } + if (from < stop + && SYNTAX_STYLES_MATCH_END_P (mirrortab, c, + BUF_FETCH_CHAR (buf, from), mask)) + /* we have encountered a comment end of the same style + as the comment sequence which began this comment + section */ + { from++; break; } } return from; } @@ -1016,46 +598,38 @@ find_end_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int comstyle) ever complains about this function not working properly, take a look at those changes. --ben */ -DEFUN ("forward-comment", Fforward_comment, 0, 2, 0, /* -Move forward across up to COUNT comments, or backwards if COUNT is negative. +DEFUN ("forward-comment", Fforward_comment, 1, 2, 0, /* +Move forward across up to N comments. If N is negative, move backward. Stop scanning if we find something other than a comment or whitespace. Set point to where scanning stops. -If COUNT comments are found as expected, with nothing except whitespace +If N comments are found as expected, with nothing except whitespace between them, return t; otherwise return nil. Point is set in either case. -COUNT defaults to 1, and BUFFER defaults to the current buffer. +Optional argument BUFFER defaults to the current buffer. */ - (count, buffer)) + (n, buffer)) { Bufpos from; Bufpos stop; Emchar c; enum syntaxcode code; - int syncode; - EMACS_INT n; + int count; struct buffer *buf = decode_buffer (buffer, 0); + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); - if (NILP (count)) - n = 1; - else - { - CHECK_INT (count); - n = XINT (count); - } + CHECK_INT (n); + count = XINT (n); from = BUF_PT (buf); - SCS_STATISTICS_SET_FUNCTION (scs_Fforward_comment); - SETUP_SYNTAX_CACHE (from, n); - while (n > 0) + while (count > 0) { QUIT; stop = BUF_ZV (buf); while (from < stop) { - int comstyle = 0; /* Code for comment style: 0 for A, 1 for B, - or ST_COMMENT_STYLE */ + int mask = 0; /* mask for finding matching comment style */ if (char_quoted (buf, from)) { @@ -1063,10 +637,8 @@ COUNT defaults to 1, and BUFFER defaults to the current buffer. continue; } - UPDATE_SYNTAX_CACHE_FORWARD (from); c = BUF_FETCH_CHAR (buf, from); - syncode = SYNTAX_CODE_FROM_CACHE (mirrortab, c); - code = SYNTAX_FROM_CODE (syncode); + code = SYNTAX (mirrortab, c); if (code == Scomment) { @@ -1075,44 +647,28 @@ COUNT defaults to 1, and BUFFER defaults to the current buffer. we must record the comment style this character begins so that later, only a comment end of the same style actually ends the comment section */ - comstyle = - SYNTAX_CODE_COMMENT_1CHAR_MASK (syncode) - == SYNTAX_COMMENT_STYLE_A ? 0 : 1; + mask = SYNTAX_COMMENT_1CHAR_MASK (mirrortab, c); } - else if (code == Scomment_fence) + else if (from < stop + && SYNTAX_START_P (mirrortab, c, BUF_FETCH_CHAR (buf, from+1))) { - from++; + /* we have encountered a 2char comment start sequence and we + are ignoring all text inside comments. we must record + the comment style this sequence begins so that later, + only a comment end of the same style actually ends + the comment section */ code = Scomment; - comstyle = ST_COMMENT_STYLE; - } - - else if (from < stop && SYNTAX_CODE_START_FIRST_P (syncode)) - { - int next_syncode; - UPDATE_SYNTAX_CACHE_FORWARD (from + 1); - next_syncode = - SYNTAX_CODE_FROM_CACHE (mirrortab, - BUF_FETCH_CHAR (buf, from + 1)); - - if (SYNTAX_CODES_START_P (syncode, next_syncode)) - { - /* we have encountered a 2char comment start sequence and we - are ignoring all text inside comments. we must record - the comment style this sequence begins so that later, - only a comment end of the same style actually ends - the comment section */ - code = Scomment; - comstyle = - SYNTAX_CODES_COMMENT_MASK_START (syncode, next_syncode) - == SYNTAX_COMMENT_STYLE_A ? 0 : 1; - from++; - } + mask = SYNTAX_COMMENT_MASK_START (mirrortab, c, + BUF_FETCH_CHAR (buf, from+1)); + from++; } if (code == Scomment) { - Bufpos newfrom = find_end_of_comment (buf, from, stop, comstyle); + Bufpos newfrom; + + newfrom = find_end_of_comment (buf, from, stop, mask); if (newfrom < 0) { /* we stopped because from==stop */ @@ -1135,18 +691,17 @@ COUNT defaults to 1, and BUFFER defaults to the current buffer. } /* End of comment reached */ - n--; + count--; } - while (n < 0) + while (count < 0) { QUIT; stop = BUF_BEGV (buf); while (from > stop) { - int comstyle = 0; /* Code for comment style: 0 for A, 1 for B, - or ST_COMMENT_STYLE */ + int mask = 0; /* mask for finding matching comment style */ from--; if (char_quoted (buf, from)) @@ -1156,64 +711,46 @@ COUNT defaults to 1, and BUFFER defaults to the current buffer. } c = BUF_FETCH_CHAR (buf, from); - syncode = SYNTAX_CODE_FROM_CACHE (mirrortab, c); - code = SYNTAX_FROM_CODE (syncode); + code = SYNTAX (mirrortab, c); if (code == Sendcomment) { /* we have found a single char end comment. we must record the comment style encountered so that later, we can match only the proper comment begin sequence of the same style */ - comstyle = - SYNTAX_CODE_COMMENT_1CHAR_MASK (syncode) - == SYNTAX_COMMENT_STYLE_A ? 0 : 1; - } - - else if (code == Scomment_fence) - { - code = Sendcomment; - comstyle = ST_COMMENT_STYLE; + mask = SYNTAX_COMMENT_1CHAR_MASK (mirrortab, c); } else if (from > stop - /* #### This seems logical but it's not in 21.4.9 */ - /* && !char_quoted (buf, from - 1) */ - && SYNTAX_CODE_END_SECOND_P (syncode)) + && SYNTAX_END_P (mirrortab, BUF_FETCH_CHAR (buf, from - 1), c) + && !char_quoted (buf, from - 1)) { - int prev_syncode; - UPDATE_SYNTAX_CACHE_BACKWARD (from - 1); - prev_syncode = - SYNTAX_CODE_FROM_CACHE (mirrortab, - BUF_FETCH_CHAR (buf, from - 1)); - if (SYNTAX_CODES_END_P (prev_syncode, syncode)) - { - /* We must record the comment style encountered so that - later, we can match only the proper comment begin - sequence of the same style. */ - code = Sendcomment; - comstyle = - SYNTAX_CODES_COMMENT_MASK_END (prev_syncode, syncode) - == SYNTAX_COMMENT_STYLE_A ? 0 : 1; - from--; - } + /* We must record the comment style encountered so that + later, we can match only the proper comment begin + sequence of the same style. */ + code = Sendcomment; + mask = SYNTAX_COMMENT_MASK_END (mirrortab, + BUF_FETCH_CHAR (buf, from - 1), + c); + from--; } if (code == Sendcomment) { - from = find_start_of_comment (buf, from, stop, comstyle); + from = find_start_of_comment (buf, from, stop, mask); break; } else if (code != Swhitespace - && code != Scomment - && code != Sendcomment) + && SYNTAX (mirrortab, c) != Scomment + && SYNTAX (mirrortab, c) != Sendcomment) { BUF_SET_PT (buf, from + 1); return Qnil; } } - n++; + count++; } BUF_SET_PT (buf, from); @@ -1223,20 +760,19 @@ COUNT defaults to 1, and BUFFER defaults to the current buffer. Lisp_Object scan_lists (struct buffer *buf, Bufpos from, int count, int depth, - int sexpflag, int noerror) + int sexpflag, int no_error) { Bufpos stop; Emchar c; int quoted; int mathexit = 0; enum syntaxcode code; - int syncode; int min_depth = depth; /* Err out if depth gets less than this. */ + Lisp_Object syntaxtab = buf->syntax_table; + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); if (depth > 0) min_depth = 0; - SCS_STATISTICS_SET_FUNCTION (scs_scan_lists); - SETUP_SYNTAX_CACHE_FOR_BUFFER (buf, from, count); while (count > 0) { QUIT; @@ -1244,49 +780,35 @@ scan_lists (struct buffer *buf, Bufpos from, int count, int depth, stop = BUF_ZV (buf); while (from < stop) { - int comstyle = 0; /* mask for finding matching comment style */ - Emchar stringterm = '\0'; /* Used by Sstring case in switch */ + int mask = 0; /* mask for finding matching comment style */ - UPDATE_SYNTAX_CACHE_FORWARD (from); c = BUF_FETCH_CHAR (buf, from); - syncode = SYNTAX_CODE_FROM_CACHE (mirrortab, c); - code = SYNTAX_FROM_CODE (syncode); + code = SYNTAX_UNSAFE (mirrortab, c); from++; /* a 1-char comment start sequence */ if (code == Scomment && parse_sexp_ignore_comments) { - comstyle = SYNTAX_CODE_COMMENT_1CHAR_MASK (syncode) == - SYNTAX_COMMENT_STYLE_A ? 0 : 1; + mask = SYNTAX_COMMENT_1CHAR_MASK (mirrortab, c); } /* else, a 2-char comment start sequence? */ else if (from < stop - && SYNTAX_CODE_START_FIRST_P (syncode) + && SYNTAX_START_P (mirrortab, c, BUF_FETCH_CHAR (buf, from)) && parse_sexp_ignore_comments) { - int next_syncode; - UPDATE_SYNTAX_CACHE_FORWARD (from); - next_syncode = - SYNTAX_CODE_FROM_CACHE (mirrortab, BUF_FETCH_CHAR (buf, from)); - - if (SYNTAX_CODES_START_P (syncode, next_syncode)) - { - /* we have encountered a comment start sequence and we - are ignoring all text inside comments. we must record - the comment style this sequence begins so that later, - only a comment end of the same style actually ends - the comment section */ - code = Scomment; - comstyle = - SYNTAX_CODES_COMMENT_MASK_START (syncode, next_syncode) - == SYNTAX_COMMENT_STYLE_A ? 0 : 1; - from++; - } + /* we have encountered a comment start sequence and we + are ignoring all text inside comments. we must record + the comment style this sequence begins so that later, + only a comment end of the same style actually ends + the comment section */ + code = Scomment; + mask = SYNTAX_COMMENT_MASK_START (mirrortab, c, + BUF_FETCH_CHAR (buf, from)); + from++; } - UPDATE_SYNTAX_CACHE_FORWARD (from); - if (SYNTAX_CODE_PREFIX (syncode)) + if (SYNTAX_PREFIX_UNSAFE (mirrortab, c)) continue; switch (code) @@ -1302,9 +824,7 @@ scan_lists (struct buffer *buf, Bufpos from, int count, int depth, /* This word counts as a sexp; return at end of it. */ while (from < stop) { - UPDATE_SYNTAX_CACHE_FORWARD (from); - switch (SYNTAX_FROM_CACHE (mirrortab, - BUF_FETCH_CHAR (buf, from))) + switch (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, from))) { case Scharquote: case Sescape: @@ -1322,16 +842,11 @@ scan_lists (struct buffer *buf, Bufpos from, int count, int depth, } goto done; - case Scomment_fence: - comstyle = ST_COMMENT_STYLE; - /* falls through! */ case Scomment: if (!parse_sexp_ignore_comments) break; - UPDATE_SYNTAX_CACHE_FORWARD (from); { - Bufpos newfrom = - find_end_of_comment (buf, from, stop, comstyle); + Bufpos newfrom = find_end_of_comment (buf, from, stop, mask); if (newfrom < 0) { /* we stopped because from == stop in search forward */ @@ -1365,51 +880,45 @@ scan_lists (struct buffer *buf, Bufpos from, int count, int depth, if (!--depth) goto done; if (depth < min_depth) { - if (noerror) + if (no_error) return Qnil; error ("Containing expression ends prematurely"); } break; case Sstring: - { + { /* XEmacs change: call syntax_match on character */ - Emchar ch = BUF_FETCH_CHAR (buf, from - 1); - Lisp_Object stermobj = - syntax_match (syntax_cache.current_syntax_table, ch); + Emchar ch = BUF_FETCH_CHAR (buf, from - 1); + Lisp_Object stermobj = syntax_match (syntaxtab, ch); + Emchar stringterm; if (CHARP (stermobj)) stringterm = XCHAR (stermobj); else stringterm = ch; - } - /* falls through! */ - case Sstring_fence: - while (1) - { - if (from >= stop) - goto lose; - UPDATE_SYNTAX_CACHE_FORWARD (from); - c = BUF_FETCH_CHAR (buf, from); - if (code == Sstring - ? c == stringterm - : SYNTAX_FROM_CACHE (mirrortab, c) == Sstring_fence) - break; - - switch (SYNTAX_FROM_CACHE (mirrortab, c)) - { - case Scharquote: - case Sescape: - from++; - break; - default: + + while (1) + { + if (from >= stop) + goto lose; + if (BUF_FETCH_CHAR (buf, from) == stringterm) break; - } - from++; - } - from++; - if (!depth && sexpflag) goto done; - break; + switch (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, from))) + { + case Scharquote: + case Sescape: + from++; + break; + default: + break; + } + from++; + } + from++; + if (!depth && sexpflag) goto done; + break; + } default: break; @@ -1434,58 +943,43 @@ scan_lists (struct buffer *buf, Bufpos from, int count, int depth, stop = BUF_BEGV (buf); while (from > stop) { - int comstyle = 0; /* mask for finding matching comment style */ - Emchar stringterm = '\0'; /* used by case Sstring in switch below */ + int mask = 0; /* mask for finding matching comment style */ from--; - UPDATE_SYNTAX_CACHE_BACKWARD (from); quoted = char_quoted (buf, from); if (quoted) - { from--; - UPDATE_SYNTAX_CACHE_BACKWARD (from); - } c = BUF_FETCH_CHAR (buf, from); - syncode = SYNTAX_CODE_FROM_CACHE (mirrortab, c); - code = SYNTAX_FROM_CODE (syncode); + code = SYNTAX_UNSAFE (mirrortab, c); if (code == Sendcomment && parse_sexp_ignore_comments) { /* we have found a single char end comment. we must record the comment style encountered so that later, we can match only the proper comment begin sequence of the same style */ - comstyle = SYNTAX_CODE_COMMENT_1CHAR_MASK (syncode) - == SYNTAX_COMMENT_STYLE_A ? 0 : 1; + mask = SYNTAX_COMMENT_1CHAR_MASK (mirrortab, c); } else if (from > stop - && SYNTAX_CODE_END_SECOND_P (syncode) + && SYNTAX_END_P (mirrortab, BUF_FETCH_CHAR (buf, from-1), c) && !char_quoted (buf, from - 1) && parse_sexp_ignore_comments) { - int prev_syncode; - UPDATE_SYNTAX_CACHE_BACKWARD (from - 1); - prev_syncode = SYNTAX_CODE_FROM_CACHE - (mirrortab, BUF_FETCH_CHAR (buf, from - 1)); - - if (SYNTAX_CODES_END_P (prev_syncode, syncode)) - { - /* we must record the comment style encountered so that - later, we can match only the proper comment begin - sequence of the same style */ - code = Sendcomment; - comstyle = - SYNTAX_CODES_COMMENT_MASK_END (prev_syncode, syncode) - == SYNTAX_COMMENT_STYLE_A ? 0 : 1; - from--; - } + /* we must record the comment style encountered so that + later, we can match only the proper comment begin + sequence of the same style */ + code = Sendcomment; + mask = SYNTAX_COMMENT_MASK_END (mirrortab, + BUF_FETCH_CHAR (buf, from - 1), + c); + from--; } - if (SYNTAX_CODE_PREFIX (syncode)) + if (SYNTAX_PREFIX_UNSAFE (mirrortab, c)) continue; - switch (quoted ? Sword : code) + switch (((quoted) ? Sword : code)) { case Sword: case Ssymbol: @@ -1494,16 +988,14 @@ scan_lists (struct buffer *buf, Bufpos from, int count, int depth, passing it. */ while (from > stop) { - /* enum syntaxcode syncode; */ - UPDATE_SYNTAX_CACHE_BACKWARD (from); + enum syntaxcode syncode; quoted = char_quoted (buf, from - 1); if (quoted) from--; if (! (quoted || (syncode = - SYNTAX_FROM_CACHE (mirrortab, - BUF_FETCH_CHAR (buf, from - 1))) + SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, from - 1))) == Sword || syncode == Ssymbol || syncode == Squote)) @@ -1533,53 +1025,41 @@ scan_lists (struct buffer *buf, Bufpos from, int count, int depth, if (!--depth) goto done2; if (depth < min_depth) { - if (noerror) + if (no_error) return Qnil; error ("Containing expression ends prematurely"); } break; - case Scomment_fence: - comstyle = ST_COMMENT_STYLE; - /* falls through! */ case Sendcomment: if (parse_sexp_ignore_comments) - from = find_start_of_comment (buf, from, stop, comstyle); + from = find_start_of_comment (buf, from, stop, mask); break; case Sstring: { /* XEmacs change: call syntax_match() on character */ Emchar ch = BUF_FETCH_CHAR (buf, from); - Lisp_Object stermobj = - syntax_match (syntax_cache.current_syntax_table, ch); + Lisp_Object stermobj = syntax_match (syntaxtab, ch); + Emchar stringterm; + if (CHARP (stermobj)) stringterm = XCHAR (stermobj); else stringterm = ch; - } - /* falls through! */ - case Sstring_fence: - while (1) - { - if (from == stop) goto lose; - - UPDATE_SYNTAX_CACHE_BACKWARD (from - 1); - c = BUF_FETCH_CHAR (buf, from - 1); - if ((code == Sstring - ? c == stringterm - : SYNTAX_FROM_CACHE (mirrortab, c) == Sstring_fence) - && !char_quoted (buf, from - 1)) - { + while (1) + { + if (from == stop) goto lose; + if (!char_quoted (buf, from - 1) + && stringterm == BUF_FETCH_CHAR (buf, from - 1)) break; - } - - from--; - } - from--; - if (!depth && sexpflag) goto done2; - break; + from--; + } + from--; + if (!depth && sexpflag) goto done2; + break; + } } } @@ -1597,7 +1077,7 @@ scan_lists (struct buffer *buf, Bufpos from, int count, int depth, return (make_int (from)); lose: - if (!noerror) + if (!no_error) error ("Unbalanced parentheses"); return Qnil; } @@ -1608,20 +1088,13 @@ char_quoted (struct buffer *buf, Bufpos pos) enum syntaxcode code; Bufpos beg = BUF_BEGV (buf); int quoted = 0; - Bufpos startpos = pos; - - while (pos > beg) - { - UPDATE_SYNTAX_CACHE_BACKWARD (pos - 1); - code = SYNTAX_FROM_CACHE (mirrortab, BUF_FETCH_CHAR (buf, pos - 1)); - - if (code != Scharquote && code != Sescape) - break; - pos--; - quoted = !quoted; - } + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); - UPDATE_SYNTAX_CACHE (startpos); + while (pos > beg + && ((code = SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1))) + == Scharquote + || code == Sescape)) + pos--, quoted = !quoted; return quoted; } @@ -1646,7 +1119,7 @@ of in the current buffer. If optional arg NOERROR is non-nil, scan-lists will return nil instead of signalling an error. */ - (from, count, depth, buffer, noerror)) + (from, count, depth, buffer, no_error)) { struct buffer *buf; @@ -1656,7 +1129,7 @@ signalling an error. buf = decode_buffer (buffer, 0); return scan_lists (buf, XINT (from), XINT (count), XINT (depth), 0, - !NILP (noerror)); + !NILP (no_error)); } DEFUN ("scan-sexps", Fscan_sexps, 2, 4, 0, /* @@ -1677,13 +1150,13 @@ of in the current buffer. If optional arg NOERROR is non-nil, scan-sexps will return nil instead of signalling an error. */ - (from, count, buffer, noerror)) + (from, count, buffer, no_error)) { struct buffer *buf = decode_buffer (buffer, 0); CHECK_INT (from); CHECK_INT (count); - return scan_lists (buf, XINT (from), XINT (count), 0, 1, !NILP (noerror)); + return scan_lists (buf, XINT (from), XINT (count), 0, 1, !NILP (no_error)); } DEFUN ("backward-prefix-chars", Fbackward_prefix_chars, 0, 1, 0, /* @@ -1697,20 +1170,11 @@ Optional arg BUFFER defaults to the current buffer. struct buffer *buf = decode_buffer (buffer, 0); Bufpos beg = BUF_BEGV (buf); Bufpos pos = BUF_PT (buf); -#ifndef emacs - Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); -#endif - Emchar c = '\0'; /* initialize to avoid compiler warnings */ - - - SCS_STATISTICS_SET_FUNCTION (scs_Fbackward_prefix_characters); - SETUP_SYNTAX_CACHE_FOR_BUFFER (buf, pos, -1); + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); while (pos > beg && !char_quoted (buf, pos - 1) - /* Previous statement updates syntax table. */ - && (SYNTAX_FROM_CACHE (mirrortab, c = BUF_FETCH_CHAR (buf, pos - 1)) == Squote - /* equivalent to SYNTAX_PREFIX (mirrortab, c) */ - || SYNTAX_CODE_PREFIX (SYNTAX_CODE_FROM_CACHE (mirrortab, c)))) + && (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1)) == Squote + || SYNTAX_PREFIX (mirrortab, BUF_FETCH_CHAR (buf, pos - 1)))) pos--; BUF_SET_PT (buf, pos); @@ -1722,8 +1186,7 @@ Optional arg BUFFER defaults to the current buffer. assuming that FROM has state OLDSTATE (nil means FROM is start of function), and return a description of the state of the parse at END. If STOPBEFORE is nonzero, stop at the start of an atom. - If COMMENTSTOP is 1, stop at the start of a comment; if it is -1, - stop at the start of a comment or a string */ + If COMMENTSTOP is nonzero, stop at the start of a comment. */ static void scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, @@ -1744,18 +1207,18 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, when the depth becomes negative. */ int mindepth; /* Lowest DEPTH value seen. */ int start_quoted = 0; /* Nonzero means starting after a char quote */ - int boundary_stop = commentstop == -1; Lisp_Object tem; + int mask; /* comment mask */ + Lisp_Object syntaxtab = buf->syntax_table; + struct Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); - SCS_STATISTICS_SET_FUNCTION (scs_scan_sexps_forward); - SETUP_SYNTAX_CACHE (from, 1); if (NILP (oldstate)) { depth = 0; state.instring = -1; state.incomment = 0; state.comstyle = 0; /* comment style a by default */ - state.comstr_start = -1; /* no comment/string seen. */ + mask = SYNTAX_COMMENT_STYLE_A; } else { @@ -1769,12 +1232,10 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, oldstate = Fcdr (oldstate); oldstate = Fcdr (oldstate); tem = Fcar (oldstate); /* elt 3, instring */ - state.instring = ( !NILP (tem) - ? ( INTP (tem) ? XINT (tem) : ST_STRING_STYLE) - : -1); + state.instring = !NILP (tem) ? XINT (tem) : -1; - oldstate = Fcdr (oldstate); - tem = Fcar (oldstate); /* elt 4, incomment */ + oldstate = Fcdr (oldstate); /* elt 4, incomment */ + tem = Fcar (oldstate); state.incomment = !NILP (tem); oldstate = Fcdr (oldstate); @@ -1782,36 +1243,13 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, start_quoted = !NILP (tem); /* if the eighth element of the list is nil, we are in comment style - a; if it is t, we are in comment style b; if it is 'syntax-table, - we are in a generic comment */ + a. if it is non-nil, we are in comment style b */ oldstate = Fcdr (oldstate); oldstate = Fcdr (oldstate); - /* The code below was changed radically for syntax-table properties. - A reasonable place to look if a bug manifests. */ - tem = Fcar (oldstate); /* elt 7, comment style a/b/fence */ - state.comstyle = NILP (tem) ? 0 : ( EQ (tem, Qsyntax_table) - ? ST_COMMENT_STYLE : 1 ); - - oldstate = Fcdr (oldstate); /* elt 8, start of last comment/string */ - tem = Fcar (oldstate); - state.comstr_start = NILP (tem) ? -1 : XINT (tem); - - /* elt 9, char numbers of starts-of-expression of levels - (starting from outermost). */ oldstate = Fcdr (oldstate); - tem = Fcar (oldstate); /* elt 9, intermediate data for - continuation of parsing (subject - to change). */ - while (!NILP (tem)) /* >= second enclosing sexps. */ - { - curlevel->last = XINT (Fcar (tem)); - if (++curlevel == endlevel) - error ("Nesting too deep for parser"); - curlevel->prev = -1; - curlevel->last = -1; - tem = Fcdr (tem); - } - /* end radical change section */ + tem = Fcar (oldstate); /* elt 8, comment style a */ + state.comstyle = !NILP (tem); + mask = state.comstyle ? SYNTAX_COMMENT_STYLE_B : SYNTAX_COMMENT_STYLE_A; } state.quoted = 0; mindepth = depth; @@ -1831,57 +1269,39 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, while (from < end) { - Emchar c; - int syncode; - QUIT; - UPDATE_SYNTAX_CACHE_FORWARD (from); - c = BUF_FETCH_CHAR (buf, from); - syncode = SYNTAX_CODE_FROM_CACHE (mirrortab, c); - code = SYNTAX_FROM_CODE (syncode); + code = SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, from)); from++; + if (code == Scomment) + { /* record the comment style we have entered so that only the comment-ender sequence (or single char) of the same style actually terminates the comment section. */ - if (code == Scomment) - { - state.comstyle = - SYNTAX_CODE_COMMENT_1CHAR_MASK (syncode) - == SYNTAX_COMMENT_STYLE_A ? 0 : 1; - state.comstr_start = from - 1; - } - - /* a generic comment delimiter? */ - else if (code == Scomment_fence) - { - state.comstyle = ST_COMMENT_STYLE; - state.comstr_start = from - 1; - code = Scomment; + mask = SYNTAX_COMMENT_1CHAR_MASK (mirrortab, + BUF_FETCH_CHAR (buf, from-1)); + state.comstyle = (mask == SYNTAX_COMMENT_STYLE_B); + state.comstart = from - 1; } else if (from < end && - SYNTAX_CODE_START_FIRST_P (syncode)) + SYNTAX_START_P (mirrortab, BUF_FETCH_CHAR (buf, from-1), + BUF_FETCH_CHAR (buf, from))) { - int next_syncode; - UPDATE_SYNTAX_CACHE_FORWARD (from); - next_syncode = - SYNTAX_CODE_FROM_CACHE (mirrortab, BUF_FETCH_CHAR (buf, from)); - - if (SYNTAX_CODES_START_P (syncode, next_syncode)) - { - code = Scomment; - state.comstyle = - SYNTAX_CODES_COMMENT_MASK_START (syncode, next_syncode) - == SYNTAX_COMMENT_STYLE_A ? 0 : 1; - state.comstr_start = from - 1; - from++; - UPDATE_SYNTAX_CACHE_FORWARD (from); - } + /* Record the comment style we have entered so that only + the comment-end sequence of the same style actually + terminates the comment section. */ + code = Scomment; + mask = SYNTAX_COMMENT_MASK_START (mirrortab, + BUF_FETCH_CHAR (buf, from-1), + BUF_FETCH_CHAR (buf, from)); + state.comstyle = (mask == SYNTAX_COMMENT_STYLE_B); + state.comstart = from-1; + from++; } - if (SYNTAX_CODE_PREFIX (syncode)) + if (SYNTAX_PREFIX (mirrortab, BUF_FETCH_CHAR (buf, from - 1))) continue; switch (code) { @@ -1901,8 +1321,7 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, symstarted: while (from < end) { - UPDATE_SYNTAX_CACHE_FORWARD (from); - switch (SYNTAX_FROM_CACHE (mirrortab, BUF_FETCH_CHAR (buf, from))) + switch (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, from))) { case Scharquote: case Sescape: @@ -1924,13 +1343,11 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, case Scomment: state.incomment = 1; - if (commentstop || boundary_stop) goto done; startincomment: - if (commentstop == 1) + if (commentstop) goto done; - UPDATE_SYNTAX_CACHE_FORWARD (from); { - Bufpos newfrom = find_end_of_comment (buf, from, end, state.comstyle); + Bufpos newfrom = find_end_of_comment (buf, from, end, mask); if (newfrom < 0) { /* we terminated search because from == end */ @@ -1941,7 +1358,7 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, } state.incomment = 0; state.comstyle = 0; /* reset the comment style */ - if (boundary_stop) goto done; + mask = 0; break; case Sopen: @@ -1967,49 +1384,28 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, break; case Sstring: - case Sstring_fence: - state.comstr_start = from - 1; + { + Emchar ch; if (stopbefore) goto stop; /* this arg means stop at sexp start */ curlevel->last = from - 1; - if (code == Sstring_fence) - { - state.instring = ST_STRING_STYLE; - } - else + /* XEmacs change: call syntax_match() on character */ + ch = BUF_FETCH_CHAR (buf, from - 1); { - /* XEmacs change: call syntax_match() on character */ - Emchar ch = BUF_FETCH_CHAR (buf, from - 1); - Lisp_Object stermobj = - syntax_match (syntax_cache.current_syntax_table, ch); + Lisp_Object stermobj = syntax_match (syntaxtab, ch); if (CHARP (stermobj)) state.instring = XCHAR (stermobj); else state.instring = ch; } - if (boundary_stop) goto done; + } startinstring: while (1) { - enum syntaxcode temp_code; - if (from >= end) goto done; - - UPDATE_SYNTAX_CACHE_FORWARD (from); - c = BUF_FETCH_CHAR (buf, from); - temp_code = SYNTAX_FROM_CACHE (mirrortab, c); - - if ( - state.instring != ST_STRING_STYLE && - temp_code == Sstring && - c == state.instring) break; - - switch (temp_code) + if (BUF_FETCH_CHAR (buf, from) == state.instring) break; + switch (SYNTAX (mirrortab, BUF_FETCH_CHAR (buf, from))) { - case Sstring_fence: - if (state.instring == ST_STRING_STYLE) - goto string_end; - break; case Scharquote: case Sescape: { @@ -2023,11 +1419,9 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, } from++; } - string_end: state.instring = -1; curlevel->prev = curlevel->last; from++; - if (boundary_stop) goto done; break; case Smath: @@ -2037,7 +1431,6 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, case Spunct: case Squote: case Sendcomment: - case Scomment_fence: case Sinherit: case Smax: break; @@ -2058,10 +1451,6 @@ scan_sexps_forward (struct buffer *buf, struct lisp_parse_state *stateptr, state.prevlevelstart = (curlevel == levelstart) ? -1 : (curlevel - 1)->last; state.location = from; - state.levelstarts = Qnil; - while (--curlevel >= levelstart) - state.levelstarts = Fcons (make_int (curlevel->last), - state.levelstarts); *stateptr = state; } @@ -2070,33 +1459,26 @@ DEFUN ("parse-partial-sexp", Fparse_partial_sexp, 2, 7, 0, /* Parse Lisp syntax starting at FROM until TO; return status of parse at TO. Parsing stops at TO or when certain criteria are met; point is set to where parsing stops. -If fifth arg OLDSTATE is omitted or nil, +If fifth arg STATE is omitted or nil, parsing assumes that FROM is the beginning of a function. -Value is a list of nine elements describing final state of parsing: +Value is a list of eight elements describing final state of parsing: 0. depth in parens. 1. character address of start of innermost containing list; nil if none. 2. character address of start of last complete sexp terminated. 3. non-nil if inside a string. - (It is the character that will terminate the string, - or t if the string should be terminated by an explicit - `syntax-table' property.) + (It is the character that will terminate the string.) 4. t if inside a comment. 5. t if following a quote character. 6. the minimum paren-depth encountered during this scan. - 7. nil if in comment style a, or not in a comment; t if in comment style b; - `syntax-table' if given by an explicit `syntax-table' property. - 8. character address of start of last comment or string; nil if none. - 9. Intermediate data for continuation of parsing (subject to change). + 7. nil if in comment style a, or not in a comment; t if in comment style b If third arg TARGETDEPTH is non-nil, parsing stops if the depth in parentheses becomes equal to TARGETDEPTH. Fourth arg STOPBEFORE non-nil means stop when come to any character that starts a sexp. -Fifth arg OLDSTATE is a nine-element list like what this function returns. +Fifth arg STATE is an eight-element list like what this function returns. It is used to initialize the state of the parse. Its second and third elements are ignored. -Sixth arg COMMENTSTOP non-nil means stop at the start of a comment. If it -is `syntax-table', stop after the start of a comment or a string, or after -the end of a comment or string. +Sixth arg COMMENTSTOP non-nil means stop at the start of a comment. */ (from, to, targetdepth, stopbefore, oldstate, commentstop, buffer)) { @@ -2117,24 +1499,17 @@ the end of a comment or string. get_buffer_range_char (buf, from, to, &start, &end, 0); scan_sexps_forward (buf, &state, start, end, target, !NILP (stopbefore), oldstate, - (NILP (commentstop) - ? 0 : (EQ (commentstop, Qsyntax_table) ? -1 : 1))); + !NILP (commentstop)); + BUF_SET_PT (buf, state.location); /* reverse order */ val = Qnil; - val = Fcons (state.levelstarts, val); - val = Fcons ((state.incomment || (state.instring >= 0)) - ? make_int (state.comstr_start) : Qnil, val); - val = Fcons (state.comstyle ? (state.comstyle == ST_COMMENT_STYLE - ? Qsyntax_table : Qt) : Qnil, val); + val = Fcons (state.comstyle ? Qt : Qnil, val); val = Fcons (make_int (state.mindepth), val); val = Fcons (state.quoted ? Qt : Qnil, val); val = Fcons (state.incomment ? Qt : Qnil, val); - val = Fcons (state.instring < 0 - ? Qnil - : (state.instring == ST_STRING_STYLE - ? Qt : make_int (state.instring)), val); + val = Fcons (state.instring < 0 ? Qnil : make_int (state.instring), val); val = Fcons (state.thislevelstart < 0 ? Qnil : make_int (state.thislevelstart), val); val = Fcons (state.prevlevelstart < 0 ? Qnil : make_int (state.prevlevelstart), val); val = Fcons (make_int (state.depth), val); @@ -2188,7 +1563,7 @@ cmst_mapfun (struct chartab_range *range, Lisp_Object val, void *arg) } 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; @@ -2206,7 +1581,7 @@ update_just_this_syntax_table (Lisp_Char_Table *ct) 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) @@ -2231,7 +1606,6 @@ void syms_of_syntax (void) { defsymbol (&Qsyntax_table_p, "syntax-table-p"); - defsymbol (&Qsyntax_table, "syntax-table"); DEFSUBR (Fsyntax_table_p); DEFSUBR (Fsyntax_table); @@ -2259,38 +1633,18 @@ vars_of_syntax (void) 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; - - DEFVAR_BOOL ("lookup-syntax-properties", &lookup_syntax_properties /* -Non-nil means `forward-sexp', etc., look up character syntax in the -table that is the value of the `syntax-table' text property, if non-nil. -The value of this property should be either a syntax table, or a cons -of the form (SYNTAXCODE . MATCHCHAR), SYNTAXCODE being the numeric -syntax code, MATCHCHAR being nil or the character to match (which is -relevant only for open/close type. -*/ ); - lookup_syntax_properties = 0; /* #### default off until optimized */ + 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 */ @@ -2298,35 +1652,72 @@ complex_vars_of_syntax (void) Vstandard_syntax_table = Fcopy_syntax_table (Qnil); staticpro (&Vstandard_syntax_table); - Vsyntax_designator_chars_string = make_string_nocopy (syntax_code_spec, - Smax); + Vsyntax_designator_chars_string = make_pure_string (syntax_code_spec, + Smax, Qnil, 1); 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 (']'), Fcons (make_int ((int) Sclose), + 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) 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 --git a/src/syntax.h b/src/syntax.h index 8ea4fcb..9b66c7a 100644 --- a/src/syntax.h +++ b/src/syntax.h @@ -20,8 +20,8 @@ Boston, MA 02111-1307, USA. */ /* 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" @@ -61,10 +61,6 @@ enum syntaxcode Scomment, /* a comment-starting character */ Sendcomment, /* a comment-ending character */ Sinherit, /* use the standard syntax table for this character */ - Scomment_fence, /* Starts/ends comment which is delimited on the - other side by a char with the same syntaxcode. */ - Sstring_fence, /* Starts/ends string which is delimited on the - other side by a char with the same syntaxcode. */ Smax /* Upper bound on codes that are meaningful */ }; @@ -76,9 +72,9 @@ enum syntaxcode charset_syntax (struct buffer *buf, Lisp_Object charset, #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); } @@ -89,11 +85,12 @@ SYNTAX_CODE (Lisp_Char_Table *table, Emchar c) #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; + int syncode = SYNTAX (table, c); + return syncode == Sword; } /* OK, here's a graphic diagram of the format of the syntax values: @@ -151,33 +148,10 @@ WORD_SYNTAX_P (Lisp_Char_Table *table, Emchar c) 6. first of a one or two character comment-end sequence of style b. 7. second of a two-character comment-end sequence of style a. 8. second of a two-character comment-end sequence of style b. - -From the internals manual: - -Syntax codes are implemented as bitfields in an int. Bits 0-6 contain -the syntax code itself, bit 7 is a special prefix flag used for Lisp, -and bits 16-23 contain comment syntax flags. From the Lisp programmer's -point of view, there are 11 flags: 2 styles X 2 characters X @{start, -end@} flags for two-character comment delimiters, 2 style flags for -one-character comment delimiters, and the prefix flag. - -Internally, however, the characters used in multi-character delimiters -will have non-comment-character syntax classes (@emph{e.g.}, the -@samp{/} in C's @samp{/}@samp{*} comment-start delimiter has ``punctuation'' -\(here meaning ``operator-like'') class in C modes). Thus in a mixed -comment style, such as C++'s @samp{//} to end of line, is represented by -giving @samp{/} the ``punctuation'' class and the ``style b first -character of start sequence'' and ``style b second character of start -sequence'' flags. The fact that class is @emph{not} punctuation allows -the syntax scanner to recognize that this is a multi-character -delimiter. The @samp{newline} character is given (single-character) -``comment-end'' @emph{class} and the ``style b first character of end -sequence'' @emph{flag}. The ``comment-end'' class allows the scanner to -determine that no second character is needed to terminate the comment. */ -#define SYNTAX_COMMENT_BITS(c) \ - ((SYNTAX_CODE (mirrortab, c) >> 16) &0xff) +#define SYNTAX_COMMENT_BITS(table, c) \ + ((SYNTAX_CODE (table, c) >> 16) &0xff) #define SYNTAX_FIRST_OF_START_A 0x80 #define SYNTAX_FIRST_OF_START_B 0x40 @@ -197,61 +171,55 @@ determine that no second character is needed to terminate the comment. #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(a, b) \ - (((SYNTAX_COMMENT_BITS (a) & SYNTAX_FIRST_CHAR_START) >> 2) \ - & (SYNTAX_COMMENT_BITS (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(a, b) \ - (((SYNTAX_COMMENT_BITS (a) & SYNTAX_FIRST_CHAR_END) >> 2) \ - & (SYNTAX_COMMENT_BITS (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(a, b, mask) \ - ((SYNTAX_COMMENT_BITS (a) & SYNTAX_FIRST_CHAR_START & (mask)) \ - && (SYNTAX_COMMENT_BITS (b) & SYNTAX_SECOND_CHAR_START & (mask))) +#define SYNTAX_STYLES_MATCH_START_P(table, a, b, mask) \ + ((SYNTAX_COMMENT_BITS (table, a) & SYNTAX_FIRST_CHAR_START & (mask)) \ + && (SYNTAX_COMMENT_BITS (table, b) & SYNTAX_SECOND_CHAR_START & (mask))) -#define SYNTAX_STYLES_MATCH_END_P(a, b, mask) \ - ((SYNTAX_COMMENT_BITS (a) & SYNTAX_FIRST_CHAR_END & (mask)) \ - && (SYNTAX_COMMENT_BITS (b) & SYNTAX_SECOND_CHAR_END & (mask))) +#define SYNTAX_STYLES_MATCH_END_P(table, a, b, mask) \ + ((SYNTAX_COMMENT_BITS (table, a) & SYNTAX_FIRST_CHAR_END & (mask)) \ + && (SYNTAX_COMMENT_BITS (table, b) & SYNTAX_SECOND_CHAR_END & (mask))) -#define SYNTAX_STYLES_MATCH_1CHAR_P(a, mask) \ - ((SYNTAX_COMMENT_BITS (a) & (mask))) +#define SYNTAX_STYLES_MATCH_1CHAR_P(table, a, mask) \ + ((SYNTAX_COMMENT_BITS (table, a) & (mask))) -#define STYLE_FOUND_P(a, b, startp, style) \ - ((SYNTAX_COMMENT_BITS (a) & \ +#define STYLE_FOUND_P(table, a, b, startp, style) \ + ((SYNTAX_COMMENT_BITS (table, a) & \ ((startp) ? SYNTAX_FIRST_CHAR_START : \ SYNTAX_FIRST_CHAR_END) & (style)) \ - && (SYNTAX_COMMENT_BITS (b) & \ + && (SYNTAX_COMMENT_BITS (table, b) & \ ((startp) ? SYNTAX_SECOND_CHAR_START : \ SYNTAX_SECOND_CHAR_END) & (style))) -#define SYNTAX_COMMENT_MASK_START(a, b) \ - ((STYLE_FOUND_P (a, b, 1, SYNTAX_COMMENT_STYLE_A) \ - ? SYNTAX_COMMENT_STYLE_A \ - : (STYLE_FOUND_P (a, b, 1, SYNTAX_COMMENT_STYLE_B) \ - ? SYNTAX_COMMENT_STYLE_B \ +#define SYNTAX_COMMENT_MASK_START(table, a, b) \ + ((STYLE_FOUND_P (table, a, b, 1, SYNTAX_COMMENT_STYLE_A) \ + ? SYNTAX_COMMENT_STYLE_A \ + : (STYLE_FOUND_P (table, a, b, 1, SYNTAX_COMMENT_STYLE_B) \ + ? SYNTAX_COMMENT_STYLE_B \ : 0))) -#define SYNTAX_COMMENT_MASK_END(a, b) \ - ((STYLE_FOUND_P (a, b, 0, SYNTAX_COMMENT_STYLE_A) \ - ? SYNTAX_COMMENT_STYLE_A \ - : (STYLE_FOUND_P (a, b, 0, SYNTAX_COMMENT_STYLE_B) \ - ? SYNTAX_COMMENT_STYLE_B \ +#define SYNTAX_COMMENT_MASK_END(table, a, b) \ + ((STYLE_FOUND_P (table, a, b, 0, SYNTAX_COMMENT_STYLE_A) \ + ? SYNTAX_COMMENT_STYLE_A \ + : (STYLE_FOUND_P (table, a, b, 0, SYNTAX_COMMENT_STYLE_B) \ + ? SYNTAX_COMMENT_STYLE_B \ : 0))) -#define STYLE_FOUND_1CHAR_P(a, style) \ - ((SYNTAX_COMMENT_BITS (a) & (style))) +#define STYLE_FOUND_1CHAR_P(table, a, style) \ + ((SYNTAX_COMMENT_BITS (table, a) & (style))) -#define SYNTAX_COMMENT_1CHAR_MASK(a) \ - ((STYLE_FOUND_1CHAR_P (a, SYNTAX_COMMENT_STYLE_A) \ - ? SYNTAX_COMMENT_STYLE_A \ - : (STYLE_FOUND_1CHAR_P (a, SYNTAX_COMMENT_STYLE_B) \ - ? SYNTAX_COMMENT_STYLE_B \ +#define SYNTAX_COMMENT_1CHAR_MASK(table, a) \ + ((STYLE_FOUND_1CHAR_P (table, a, SYNTAX_COMMENT_STYLE_A) \ + ? SYNTAX_COMMENT_STYLE_A \ + : (STYLE_FOUND_1CHAR_P (table, a, SYNTAX_COMMENT_STYLE_B) \ + ? SYNTAX_COMMENT_STYLE_B \ : 0))) EXFUN (Fchar_syntax, 2); @@ -265,15 +233,15 @@ extern Lisp_Object Vstandard_syntax_table; 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. */ @@ -282,329 +250,6 @@ Lisp_Object syntax_match (Lisp_Object table, Emchar ch); extern int no_quit_in_re_search; extern struct buffer *regex_emacs_buffer; -/* Target text (string or buffer), used for syntax-table properties. */ -extern Lisp_Object regex_match_object; - -void update_syntax_table (Lisp_Char_Table *ct); - -/* The syntax table cache */ - -/* - The *-single-property-change versions turn out to be unbearably slow. - Do not enable them in a production or distribution version. -*/ -#define NEXT_SINGLE_PROPERTY_CHANGE 0 -#define PREVIOUS_SINGLE_PROPERTY_CHANGE 0 - -/* Test instruments, used in macros below. - Define SYNTAX_CACHE_STATISTICS to enable them. */ -/* #undef SYNTAX_CACHE_STATISTICS */ - -#ifdef SYNTAX_CACHE_STATISTICS -#define SYNTAX_CACHE_STATISTICS_REPORT_INTERVAL 100000 - -enum syntax_cache_statistics_functions { - scs_no_function = -1, - scs_find_context = 0, - scs_find_defun_start, - scs_scan_words, - scs_Fforward_comment, - scs_scan_lists, - scs_Fbackward_prefix_characters, - scs_scan_sexps_forward, - scs_number_of_functions -}; - -/* keep this in synch with syntax.c */ -extern char* syntax_cache_statistics_function_names[scs_number_of_functions]; - -struct syntax_cache_statistics { - /* inits + misses_hi + misses_lo + #HITS = total_updates */ - int total_updates; - int inits; - int misses_lo; - int misses_hi; - int min_length; - int max_length; - double mean_length; - double mean_length_on_miss; - enum syntax_cache_statistics_functions this_function; - int functions[scs_number_of_functions]; -}; - -extern struct syntax_cache_statistics scs_statistics; - -#define SCS_STATISTICS_SET_FUNCTION(fndx) scs_statistics.this_function = fndx -/* used in macros below */ -#define SYNTAX_CACHE_STATISTICS_COUNT_INIT scs_statistics.inits++ - -#else - -#define SCS_STATISTICS_SET_FUNCTION(fndx) -#define SYNTAX_CACHE_STATISTICS_COUNT_INIT - -#endif /* SYNTAX_CACHE_STATISTICS */ - -/* Theory of the syntax table cache - - This cache cooperates with but is conceptually different from the - mirror table. The mirror table precomputes (and caches, if you like) - the syntax codes for characters in a given syntax table, taking into - account possible inheritance from a table given by a parent text object. - The syntax table cache checks for overriding tables defined by - _subobjects_. - - This implementation defines the "subobjects" by _extent properties_. - We may restrict them to _text_ properties. There are two lookup - styles for the cache, "single code" and "full table". In the "single - code" style, a given syntax code, kept in the `syntax_code' member, is - applied to the entire range (#### check this). In the "full table" - style, a syntax table kept in the `current_syntax_table' member is - checked for each character in the range. If the flag `use_code' is - non-zero, the "single code" is used, otherwise the "full table". - - The cache is valid for the range `[prev_change, next_change)' in the - text object (buffer or string) `object'. - - If the current position is outside the range valid for the cache, the - cache is updated by checking for the text property `syntax-table'. If - present, its value is either a syntax code or a syntax table, and the - appropriate member and `use_code' are updated accordingly. If absent - or nil, the default syntax table from the `buffer' member is used. The - extent of the property is used to reinitialize the cache's validity - range. (We would like to improve this by checking the property value - against `old_prop', and if the same, extend the validity range of the - cache by the extent of the property.) - - Note: the values Qt and Qnil for `object' are not supported in this - implementation. GNU Emacs uses them for reasons not yet (####) clear. -*/ - -extern int lookup_syntax_properties; - -struct syntax_cache -{ - int use_code; /* Whether to use syntax_code - or current_syntax_table. */ - struct buffer* buffer; /* The buffer providing the default - syntax table to the cache. */ - Lisp_Object object; /* The buffer or string the current - syntax cache applies to. */ - int syntax_code; /* Syntax code of current char. */ - Lisp_Object current_syntax_table; /* Syntax table for current pos. */ - Lisp_Object old_prop; /* Syntax-table prop at prev pos. */ - - Bufpos next_change; /* Position of the next extent - change. */ - Bufpos prev_change; /* Position of the previous - extent change. */ -}; -extern struct syntax_cache syntax_cache; - -/* - The macros below handle the internal structure of the cache. - ALWAYS USE THE MACROS TO MANIPULATE THE CACHE. - - o Use the SETUP_SYNTAX_CACHE* macros to set the object and buffer members. - - OBJECT is either a Lisp buffer or a Lisp string. BUFFER is a - pointer to struct buffer. If OBJECT is a buffer, it must refer to - BUFFER. If OBJECT is a string, then BUFFER will supply the default - syntax table when the `syntax-table' property is nil. - - For convenience and backward compatibility, the values Qt and Qnil are - accepted for OBJECT. These are taken to refer to the current buffer, - and that substitution is made immediately. The value Qt is treated - specially in the *BYTE_TO_CHAR macros below. This appears (####) to - be a GNU kludge related to `enable-multibyte-characters' and was used - only in dired.c. - - FROM is the starting character position in OBJECT. - COUNT is currently used only as a flag. If positive, we are proceeding - forward through OBJECT, otherwise in reverse. - - o All other members are updated using the update_syntax_cache - function, normally wrapped in the UPDATE_SYNTAX_CACHE* macros. -*/ - -void update_syntax_cache (int pos, int count); - -/* in one example the high misses vastly outweigh the low ones - seems plausible, since we typically are moving forward through the buffer */ -#define UPDATE_SYNTAX_CACHE_INTERNAL(pos, dir) \ - ((lookup_syntax_properties && \ - (pos >= syntax_cache.next_change || \ - pos < syntax_cache.prev_change)) \ - ? (update_syntax_cache ((pos), dir), 1) \ - : 0) - -/* In the current implementation, all of the following are identical. */ -/* Make syntax cache state good for CHARPOS, assuming it is - currently good for a position before CHARPOS. */ -#define UPDATE_SYNTAX_CACHE_FORWARD(pos) UPDATE_SYNTAX_CACHE_INTERNAL(pos, 1) - -/* Make syntax cache state good for CHARPOS, assuming it is - currently good for a position after CHARPOS. */ -#define UPDATE_SYNTAX_CACHE_BACKWARD(pos) UPDATE_SYNTAX_CACHE_INTERNAL(pos, -1) - -/* Make syntax cache state good for CHARPOS */ -#define UPDATE_SYNTAX_CACHE(pos) UPDATE_SYNTAX_CACHE_INTERNAL(pos, 0) - -#define SYNTAX_FROM_CACHE(table, c) \ - SYNTAX_FROM_CODE (SYNTAX_CODE_FROM_CACHE (table, c)) - -#define SYNTAX_CODE_FROM_CACHE(table, c) \ - ( syntax_cache.use_code \ - ? syntax_cache.syntax_code \ - : SYNTAX_CODE (XCHAR_TABLE (syntax_cache.current_syntax_table), \ - c) \ - ) - -/* Convert the byte offset BYTEPOS into a character position, - for the object recorded in syntax_cache with SETUP_SYNTAX_CACHE*. - - The value is meant for use in the UPDATE_SYNTAX_CACHE... macros. - These macros do nothing when lookup_syntax_properties is 0, - so we return 0 in that case, for speed. - - The default case does no conversion; this seems (####) to be an - evil hangover from GNU Emacs. */ -#define SYNTAX_CACHE_OBJECT_BYTE_TO_CHAR(obj, buf, bytepos) \ - (! lookup_syntax_properties \ - ? 0 \ - : STRINGP (obj) \ - ? bytecount_to_charcount (XSTRING_DATA (obj), bytepos) \ - : (BUFFERP (obj) || NILP (obj)) \ - ? bytind_to_bufpos (buf, bytepos + BI_BUF_BEGV (buf)) \ - : (bytepos)) - -#define SYNTAX_CACHE_BYTE_TO_CHAR(bytepos) \ - SYNTAX_CACHE_OBJECT_BYTE_TO_CHAR (syntax_cache.object, syntax_cache.buffer, \ - (bytepos)) - -#define SETUP_SYNTAX_CACHE(FROM, COUNT) \ - SETUP_SYNTAX_CACHE_FOR_BUFFER (current_buffer, (FROM), (COUNT)) - -#define SETUP_SYNTAX_CACHE_FOR_BUFFER(BUFFER, FROM, COUNT) \ - SETUP_SYNTAX_CACHE_FOR_OBJECT (Qnil, (BUFFER), (FROM), (COUNT)) - -#define SETUP_SYNTAX_CACHE_FOR_OBJECT(OBJECT, BUFFER, FROM, COUNT) \ - do { \ - syntax_cache.buffer = (BUFFER); \ - syntax_cache.object = (OBJECT); \ - if (NILP (syntax_cache.object)) \ - { \ - XSETBUFFER (syntax_cache.object, syntax_cache.buffer); \ - } \ - else if (EQ (syntax_cache.object, Qt)) \ - { \ - XSETBUFFER (syntax_cache.object, syntax_cache.buffer); \ - } \ - else if (STRINGP (syntax_cache.object)) \ - { \ - /* do nothing */; \ - } \ - else if (BUFFERP (syntax_cache.object)) \ - { \ - syntax_cache.buffer = XBUFFER (syntax_cache.object); \ - } \ - else \ - { \ - /* OBJECT must be buffer/string/t/nil */ \ - assert(0); \ - } \ - syntax_cache.current_syntax_table \ - = syntax_cache.buffer->mirror_syntax_table; \ - syntax_cache.use_code = 0; \ - if (lookup_syntax_properties) \ - { \ - SYNTAX_CACHE_STATISTICS_COUNT_INIT; \ - update_syntax_cache ((FROM) + ((COUNT) > 0 ? 0 : -1), (COUNT)); \ - } \ - } while (0) - -#define SYNTAX_CODE_PREFIX(c) \ - ((c >> 7) & 1) - -#define SYNTAX_CODE_COMMENT_BITS(c) \ - ((c >> 16) &0xff) - -#define SYNTAX_CODES_START_P(a, b) \ - (((SYNTAX_CODE_COMMENT_BITS (a) & SYNTAX_FIRST_CHAR_START) >> 2) \ - & (SYNTAX_CODE_COMMENT_BITS (b) & SYNTAX_SECOND_CHAR_START)) - -#define SYNTAX_CODES_END_P(a, b) \ - (((SYNTAX_CODE_COMMENT_BITS (a) & SYNTAX_FIRST_CHAR_END) >> 2) \ - & (SYNTAX_CODE_COMMENT_BITS (b) & SYNTAX_SECOND_CHAR_END)) - -#define SYNTAX_CODES_COMMENT_MASK_START(a, b) \ - (SYNTAX_CODES_MATCH_START_P (a, b, SYNTAX_COMMENT_STYLE_A) \ - ? SYNTAX_COMMENT_STYLE_A \ - : (SYNTAX_CODES_MATCH_START_P (a, b, SYNTAX_COMMENT_STYLE_B) \ - ? SYNTAX_COMMENT_STYLE_B \ - : 0)) -#define SYNTAX_CODES_COMMENT_MASK_END(a, b) \ - (SYNTAX_CODES_MATCH_END_P (a, b, SYNTAX_COMMENT_STYLE_A) \ - ? SYNTAX_COMMENT_STYLE_A \ - : (SYNTAX_CODES_MATCH_END_P (a, b, SYNTAX_COMMENT_STYLE_B) \ - ? SYNTAX_COMMENT_STYLE_B \ - : 0)) - -#define SYNTAX_CODE_START_FIRST_P(a) \ - (SYNTAX_CODE_COMMENT_BITS (a) & SYNTAX_FIRST_CHAR_START) - -#define SYNTAX_CODE_START_SECOND_P(a) \ - (SYNTAX_CODE_COMMENT_BITS (a) & SYNTAX_SECOND_CHAR_START) - -#define SYNTAX_CODE_END_FIRST_P(a) \ - (SYNTAX_CODE_COMMENT_BITS (a) & SYNTAX_FIRST_CHAR_END) - -#define SYNTAX_CODE_END_SECOND_P(a) \ - (SYNTAX_CODE_COMMENT_BITS (a) & SYNTAX_SECOND_CHAR_END) - - -#define SYNTAX_CODES_MATCH_START_P(a, b, mask) \ - ((SYNTAX_CODE_COMMENT_BITS (a) & SYNTAX_FIRST_CHAR_START & (mask)) \ - && (SYNTAX_CODE_COMMENT_BITS (b) & SYNTAX_SECOND_CHAR_START & (mask))) - -#define SYNTAX_CODES_MATCH_END_P(a, b, mask) \ - ((SYNTAX_CODE_COMMENT_BITS (a) & SYNTAX_FIRST_CHAR_END & (mask)) \ - && (SYNTAX_CODE_COMMENT_BITS (b) & SYNTAX_SECOND_CHAR_END & (mask))) - -#define SYNTAX_CODE_MATCHES_1CHAR_P(a, mask) \ - ((SYNTAX_CODE_COMMENT_BITS (a) & (mask))) - -#define SYNTAX_CODE_COMMENT_1CHAR_MASK(a) \ - ((SYNTAX_CODE_MATCHES_1CHAR_P (a, SYNTAX_COMMENT_STYLE_A) \ - ? SYNTAX_COMMENT_STYLE_A \ - : (SYNTAX_CODE_MATCHES_1CHAR_P (a, SYNTAX_COMMENT_STYLE_B) \ - ? SYNTAX_COMMENT_STYLE_B \ - : 0))) - -#if 0 -/* These are the things that need to be #defined away to create a - no syntax-table property version. */ - -/* This should be entirely encapsulated in macros -#define update_syntax_cache(pos, count) -*/ -#define lookup_syntax_properties 0 - -#define SETUP_SYNTAX_CACHE(FROM, COUNT) -#define SETUP_SYNTAX_CACHE_FOR_BUFFER(BUFFER, FROM, COUNT) -#define SETUP_SYNTAX_CACHE_FOR_OBJECT(OBJECT, BUFFER, FROM, COUNT) -#define UPDATE_SYNTAX_CACHE_FORWARD(pos) -#define UPDATE_SYNTAX_CACHE_BACKWARD(pos) -#define UPDATE_SYNTAX_CACHE(pos) - -#define SYNTAX_FROM_CACHE SYNTAX -#define SYNTAX_CODE_FROM_CACHE SYNTAX_CODE - -#define SYNTAX_CACHE_BYTE_TO_CHAR(x) 0 - -/* cache statistics */ -#define SCS_STATISTICS_SET_FUNCTION(fndx) -#define SYNTAX_CACHE_STATISTICS_COUNT_INIT +void update_syntax_table (struct Lisp_Char_Table *ct); -#endif /* 0 */ -#endif /* INCLUDED_syntax_h_ */ +#endif /* _XEMACS_SYNTAX_H_ */ diff --git a/src/syscommctrl.h b/src/syscommctrl.h index 45cbb95..34955a6 100644 --- a/src/syscommctrl.h +++ b/src/syscommctrl.h @@ -28,11 +28,7 @@ Boston, MA 02111-1307, USA. */ #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) diff --git a/src/syswindows.h b/src/syswindows.h index 14d7a6f..51063e4 100644 --- a/src/syswindows.h +++ b/src/syswindows.h @@ -29,52 +29,18 @@ Boston, MA 02111-1307, USA. */ #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) && CYGWIN_VERSION_DLL_MAJOR < 21 +#if (defined (__CYGWIN32__) || defined(__MINGW32__)) && \ + 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) -#ifdef HAVE_X_WINDOWS -/* Christ almighty. The problems you get when combining two large code bases, - neither with any respect for namespace purity. */ -#undef Status -#endif #include <winspool.h> -#ifdef HAVE_X_WINDOWS -#define Status int -#endif #include <mmsystem.h> -#include <shlobj.h> #include <shellapi.h> #include <ddeml.h> #endif @@ -107,19 +73,8 @@ extern BOOL WINAPI PlaySound(LPCSTR,HMODULE,DWORD); #define PHYSICALOFFSETY 113 #endif -/* shlobj.h defines. */ -#ifndef BIF_EDITBOX -#define BIF_EDITBOX 0x10 -#endif -#ifndef BIF_VALIDATE -#define BIF_VALIDATE 0x20 -#endif -#ifndef BFFM_VALIDATEFAILED -#define BFFM_VALIDATEFAILED 3 -#endif - /* windows.h defines. */ -#if defined (CYGWIN) && (CYGWIN_VERSION_DLL_MAJOR < 20) +#if defined (__CYGWIN32__) && (CYGWIN_VERSION_DLL_MAJOR < 20) typedef NMHDR *LPNMHDR; #endif @@ -180,132 +135,18 @@ typedef NMHDR *LPNMHDR; #ifndef MAC_CHARSET #define MAC_CHARSET 77 #endif -#ifndef LOCALE_RETURN_NUMBER -#define LOCALE_RETURN_NUMBER 0x20000000 -#endif /***************************************************************/ /* Definitions for Mule under MS Windows */ -#include <wchar.h> - -#ifdef CYGWIN - -/* All but wcscmp and wcslen left out of Cygwin headers -- but present - in /usr/include/mingw32/string.h! */ -wchar_t* wcscat (wchar_t*, const wchar_t*); -wchar_t* wcschr (const wchar_t*, wchar_t); -int wcscoll (const wchar_t*, const wchar_t*); -wchar_t* wcscpy (wchar_t*, const wchar_t*); -size_t wcscspn (const wchar_t*, const wchar_t*); -/* Note: No wcserror in CRTDLL. */ -wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t); -int wcsncmp(const wchar_t*, const wchar_t*, size_t); -wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t); -wchar_t* wcspbrk(const wchar_t*, const wchar_t*); -wchar_t* wcsrchr(const wchar_t*, wchar_t); -size_t wcsspn(const wchar_t*, const wchar_t*); -wchar_t* wcsstr(const wchar_t*, const wchar_t*); -wchar_t* wcstok(wchar_t*, const wchar_t*); -size_t wcsxfrm(wchar_t*, const wchar_t*, size_t); - -#endif /* CYGWIN */ - -// extern int mswindows_windows9x_p; -/* #define XEUNICODE_P (!mswindows_windows9x_p) */ -#define XEUNICODE_P 0 - -#define XETCHAR_SIZE (XEUNICODE_P ? sizeof (WCHAR) : sizeof (CHAR)) -#define MAX_XETCHAR_SIZE sizeof (WCHAR) -#define XETEXT1(arg) (XEUNICODE_P ? ((char *) (L##arg)) : (arg)) -/* We need to do this indirection in case ARG is also a manifest constant. - I don't really understand why. --ben */ -#define XETEXT(arg) XETEXT1(arg) -#define XECOPY_TCHAR(ptr, ch) \ - (XEUNICODE_P ? (* (LPWSTR) (ptr) = L##ch) : (* (LPSTR) (ptr) = (ch))) -#define xetcslen(arg) (XEUNICODE_P ? wcslen ((wchar_t *) arg) : strlen (arg)) -#define xetcscmp(s1, s2) \ - (XEUNICODE_P ? wcscmp ((wchar_t *) s1, (wchar_t *) s2) \ - : strcmp (s1, s2)) -#define xetcscpy(s1, s2) \ - (XEUNICODE_P ? (char *) wcscpy ((wchar_t *) s1, (wchar_t *) s2) \ - : strcpy (s1, s2)) -#define xetcschr(s, ch) \ - (XEUNICODE_P ? (char *) wcschr ((wchar_t *) s, (WCHAR) ch) \ - : strchr (s, ch)) -#define xetcsrchr(s, ch) \ - (XEUNICODE_P ? (char *) wcsrchr ((wchar_t *) s, (WCHAR) ch) \ - : strrchr (s, ch)) - - -#define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \ -do { \ - Bufbyte *lttff; \ - \ - LOCAL_TO_WIN32_FILE_FORMAT (path, lttff); \ - C_STRING_TO_EXTERNAL (lttff, out, Qmswindows_tstr); \ -} while (0) - -Lisp_Object tstr_to_local_file_format (Extbyte *pathout); - -#ifdef CYGWIN -#define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout) \ -do { \ - Lisp_Object ltwff1 = (path); \ - Bufbyte* ltwffp = XSTRING_DATA (ltwff1); \ - if (isalpha (ltwffp[0]) && (IS_DEVICE_SEP (ltwffp[1]))) \ - pathout = ltwffp; \ - else { \ - int ltwff2 = \ - cygwin_posix_to_win32_path_list_buf_size (ltwffp); \ - pathout = (Bufbyte *) alloca (ltwff2); \ - cygwin_posix_to_win32_path_list (ltwffp, pathout); \ - } \ -} while (0) -#else -#define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout) \ -do { \ - (pathout) = XSTRING_DATA (path); \ -} while (0) -#endif - -#ifdef CYGWIN -#define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \ -do { \ - Bufbyte *wtlff1 = (path); \ - int wtlff2 = \ - cygwin_win32_to_posix_path_list_buf_size (wtlff1); \ - Bufbyte *wtlff3 = (Bufbyte *) alloca (wtlff2); \ - cygwin_win32_to_posix_path_list (wtlff1, wtlff3); \ - (pathout) = build_string (wtlff3); \ -} while (0) -#else -#define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \ -do { \ - (pathout) = build_string (path); \ -} while (0) -#endif - -extern BOOL (WINAPI *xSwitchToThread) (VOID); - -extern HKL (WINAPI *xGetKeyboardLayout) (DWORD); -extern BOOL (WINAPI *xSetMenuDefaultItem) (HMENU, UINT, UINT); -extern BOOL (WINAPI *xInsertMenuItemA) (HMENU, UINT, BOOL, LPCMENUITEMINFOA); -extern BOOL (WINAPI *xInsertMenuItemW) (HMENU, UINT, BOOL, LPCMENUITEMINFOW); -extern HANDLE (WINAPI *xLoadImageA) (HINSTANCE, LPCSTR, UINT, int, int, UINT); -extern HANDLE (WINAPI *xLoadImageW) (HINSTANCE, LPCWSTR, UINT, int, int, UINT); -extern ATOM (WINAPI *xRegisterClassExA) (CONST WNDCLASSEXA *); -extern ATOM (WINAPI *xRegisterClassExW) (CONST WNDCLASSEXW *); - -extern int (WINAPI *xEnumFontFamiliesExA) (HDC, LPLOGFONTA, FONTENUMPROCA, - LPARAM, DWORD); -extern int (WINAPI *xEnumFontFamiliesExW) (HDC, LPLOGFONTW, FONTENUMPROCW, - LPARAM, DWORD); +/* extern int mswindows_windows9x_p; */ +/* #define EIUNICODE_P (!mswindows_windows9x_p) */ +#define EIUNICODE_P 0 -extern DWORD (WINAPI *xSHGetFileInfoA) (LPCSTR, DWORD, SHFILEINFOA FAR *, UINT, - UINT); -extern DWORD (WINAPI *xSHGetFileInfoW) (LPCWSTR, DWORD, SHFILEINFOW FAR *, - UINT, UINT); +#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 --git a/src/toolbar-gtk.c b/src/toolbar-gtk.c index c0b6132..f2ec8c5 100644 --- a/src/toolbar-gtk.c +++ b/src/toolbar-gtk.c @@ -336,8 +336,7 @@ gtk_get_button_size (struct frame *f, Lisp_Object window, || tb->y != y \ || tb->width != width \ || tb->height != height \ - || tb->dirty \ - || f->clear) /* This is clearly necessary. */ \ + || tb->dirty) \ { \ if (width && height) \ { \ @@ -543,30 +542,22 @@ gtk_output_frame_toolbars (struct frame *f) if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) gtk_output_toolbar (f, TOP_TOOLBAR); + else if (f->top_toolbar_was_visible) + gtk_clear_toolbar (f, TOP_TOOLBAR, 0); + if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) gtk_output_toolbar (f, BOTTOM_TOOLBAR); + else if (f->bottom_toolbar_was_visible) + gtk_clear_toolbar (f, BOTTOM_TOOLBAR, 0); + if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) gtk_output_toolbar (f, LEFT_TOOLBAR); + else if (f->left_toolbar_was_visible) + gtk_clear_toolbar (f, LEFT_TOOLBAR, 0); + if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) gtk_output_toolbar (f, RIGHT_TOOLBAR); -} - -static void -gtk_clear_frame_toolbars (struct frame *f) -{ - assert (FRAME_GTK_P (f)); - - if (f->top_toolbar_was_visible - && !FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) - gtk_clear_toolbar (f, TOP_TOOLBAR, 0); - if (f->bottom_toolbar_was_visible - && !FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) - gtk_clear_toolbar (f, BOTTOM_TOOLBAR, 0); - if (f->left_toolbar_was_visible - && !FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) - gtk_clear_toolbar (f, LEFT_TOOLBAR, 0); - if (f->right_toolbar_was_visible - && !FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) + else if (f->right_toolbar_was_visible) gtk_clear_toolbar (f, RIGHT_TOOLBAR, 0); } @@ -672,7 +663,6 @@ void console_type_create_toolbar_gtk (void) { CONSOLE_HAS_METHOD (gtk, output_frame_toolbars); - CONSOLE_HAS_METHOD (gtk, clear_frame_toolbars); CONSOLE_HAS_METHOD (gtk, initialize_frame_toolbars); CONSOLE_HAS_METHOD (gtk, free_frame_toolbars); CONSOLE_HAS_METHOD (gtk, output_toolbar_button); diff --git a/src/toolbar-x.c b/src/toolbar-x.c index 0e5a731..40c2f02 100644 --- a/src/toolbar-x.c +++ b/src/toolbar-x.c @@ -23,16 +23,16 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: Not in FSF. */ -/* This file Mule-ized (more like Mule-verified) by Ben Wing, 7-8-00. */ - #include <config.h> #include "lisp.h" #include "console-x.h" #include "glyphs-x.h" #include "objects-x.h" +#include "xgccache.h" #include "EmacsFrame.h" #include "EmacsFrameP.h" +#include "EmacsManager.h" #include "faces.h" #include "frame.h" @@ -79,8 +79,7 @@ x_draw_blank_toolbar_button (struct frame *f, int x, int y, int width, /* 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, @@ -111,7 +110,7 @@ x_output_toolbar_button (struct frame *f, Lisp_Object button) 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; @@ -161,8 +160,7 @@ x_output_toolbar_button (struct frame *f, Lisp_Object button) 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, @@ -215,8 +213,8 @@ x_output_toolbar_button (struct frame *f, Lisp_Object button) } 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) { @@ -298,9 +296,9 @@ x_get_button_size (struct frame *f, Lisp_Object window, 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) @@ -348,8 +346,7 @@ x_get_button_size (struct frame *f, Lisp_Object window, || tb->y != y \ || tb->width != width \ || tb->height != height \ - || tb->dirty \ - || f->clear) /* This is clearly necessary. */ \ + || tb->dirty) \ { \ if (width && height) \ { \ @@ -509,9 +506,9 @@ x_output_toolbar (struct frame *f, enum toolbar_pos pos) Lisp_Object frame; XSETFRAME (frame, f); - redisplay_clear_region (frame, - DEFAULT_INDEX, FRAME_PIXWIDTH (f) - 1, y, 1, - bar_height); + DEVMETH (d, clear_region, (frame, + DEFAULT_INDEX, FRAME_PIXWIDTH (f) - 1, y, 1, + bar_height)); } SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1); @@ -547,7 +544,7 @@ x_clear_toolbar (struct frame *f, enum toolbar_pos pos, int thickness_change) SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0); - redisplay_clear_region (frame, DEFAULT_INDEX, x, y, width, height); + DEVMETH (d, clear_region, (frame, DEFAULT_INDEX, x, y, width, height)); XFlush (DEVICE_X_DISPLAY (d)); } @@ -558,30 +555,22 @@ x_output_frame_toolbars (struct frame *f) if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) x_output_toolbar (f, TOP_TOOLBAR); + else if (f->top_toolbar_was_visible) + x_clear_toolbar (f, TOP_TOOLBAR, 0); + if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) x_output_toolbar (f, BOTTOM_TOOLBAR); + else if (f->bottom_toolbar_was_visible) + x_clear_toolbar (f, BOTTOM_TOOLBAR, 0); + if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) x_output_toolbar (f, LEFT_TOOLBAR); + else if (f->left_toolbar_was_visible) + x_clear_toolbar (f, LEFT_TOOLBAR, 0); + if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) x_output_toolbar (f, RIGHT_TOOLBAR); -} - -static void -x_clear_frame_toolbars (struct frame *f) -{ - assert (FRAME_X_P (f)); - - if (f->top_toolbar_was_visible - && !FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) - x_clear_toolbar (f, TOP_TOOLBAR, 0); - if (f->bottom_toolbar_was_visible - && !FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) - x_clear_toolbar (f, BOTTOM_TOOLBAR, 0); - if (f->left_toolbar_was_visible - && !FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) - x_clear_toolbar (f, LEFT_TOOLBAR, 0); - if (f->right_toolbar_was_visible - && !FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) + else if (f->right_toolbar_was_visible) x_clear_toolbar (f, RIGHT_TOOLBAR, 0); } @@ -802,7 +791,6 @@ void console_type_create_toolbar_x (void) { CONSOLE_HAS_METHOD (x, output_frame_toolbars); - CONSOLE_HAS_METHOD (x, clear_frame_toolbars); CONSOLE_HAS_METHOD (x, initialize_frame_toolbars); CONSOLE_HAS_METHOD (x, free_frame_toolbars); CONSOLE_HAS_METHOD (x, output_toolbar_button); diff --git a/src/win32.c b/src/win32.c index 0ebbc51..203053b 100644 --- a/src/win32.c +++ b/src/win32.c @@ -22,9 +22,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "lisp.h" #include "buffer.h" - -#include "syssignal.h" -#include "systime.h" #include "syswindows.h" typedef BOOL (WINAPI *pfSwitchToThread_t) (VOID); @@ -154,11 +151,8 @@ otherwise it is an integer representing a ShowWindow flag: /* Encode filename and current directory. */ Lisp_Object current_dir = Ffile_name_directory (document); char* path = NULL; -#ifdef CYGWIN - char* fname1, *fname2; - int pos, sz; -#endif char* doc = NULL; + Extbyte* f=0; int ret; struct gcpro gcpro1, gcpro2; @@ -172,37 +166,25 @@ otherwise it is an integer representing a ShowWindow flag: /* Use mule and cygwin-safe APIs top get at file data. */ if (STRINGP (current_dir)) { - LOCAL_TO_WIN32_FILE_FORMAT (current_dir, path); + 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)) { - doc = XSTRING_DATA (document); + TO_EXTERNAL_FORMAT (LISP_STRING, document, + C_STRING_ALLOCA, f, + Qfile_name); #ifdef CYGWIN - if ((fname1 = strchr (doc, ':')) != NULL - && *++fname1 == '/' && *++fname1 == '/') - { - // URL-style if we get here, but we must only convert file - // arguments, since win32 paths are illegal in http etc. - if (strncmp (doc, "file://", 7) == 0) - { - fname1++; - pos = fname1 - doc; - if (!(isalpha (fname1[0]) && (IS_DEVICE_SEP (fname1[1])))) - { - sz = cygwin_posix_to_win32_path_list_buf_size (fname1); - fname2 = alloca (sz + pos); - strncpy (fname2, doc, pos); - doc = fname2; - fname2 += pos; - cygwin_posix_to_win32_path_list (fname1, fname2); - } - } - } - else { - // Not URL-style, must be a straight filename. - LOCAL_TO_WIN32_FILE_FORMAT (document, doc); - } + CYGWIN_WIN32_PATH (f, doc); +#else + doc = f; #endif } @@ -233,171 +215,10 @@ otherwise it is an integer representing a ShowWindow flag: return Qnil; } -#ifdef CYGWIN -DEFUN ("mswindows-cygwin-to-win32-path", Fmswindows_cygwin_to_win32_path, 1, 1, 0, /* -Get the cygwin environment to convert the Unix PATH to win32 format. -No expansion is performed, all conversion is done by the cygwin runtime. -*/ - (path)) -{ - Extbyte* f; - Bufbyte* p; - CHECK_STRING (path); - - /* There appears to be a bug in the cygwin conversion routines in - that they are not idempotent. */ - p = XSTRING_DATA (path); - if (isalpha (p[0]) && (IS_DEVICE_SEP (p[1]))) - return path; - - /* Use mule and cygwin-safe APIs top get at file data. */ - LOCAL_TO_WIN32_FILE_FORMAT (path, f); - return build_ext_string (f, Qnative); -} -#endif - - -/*--------------------------------------------------------------------*/ -/* Async timers */ -/*--------------------------------------------------------------------*/ - -/* setitimer() does not exist on native MS Windows, and appears broken - on Cygwin (random lockups when BROKEN_SIGIO is defined), so we - emulate in both cases by using multimedia timers. */ - -/* We emulate two timers, one for SIGALRM, another for SIGPROF. - - itimerproc() function has an implementation limitation: it does - not allow to set *both* interval and period. If an attempt is - made to set both, and then they are unequal, the function - asserts. - - Minimum timer resolution on Win32 systems varies, and is greater - than or equal than 1 ms. The resolution is always wrapped not to - attempt to get below the system defined limit. - */ - -/* Timer precision, denominator of one fraction: for 100 ms - interval, request 10 ms precision - */ -const int setitimer_helper_timer_prec = 10; - -/* Last itimervals, as set by calls to setitimer */ -static struct itimerval it_alarm; -static struct itimerval it_prof; - -/* Timer IDs as returned by MM */ -MMRESULT tid_alarm = 0; -MMRESULT tid_prof = 0; - -static void CALLBACK -setitimer_helper_proc (UINT uID, UINT uMsg, DWORD dwUser, - DWORD dw1, DWORD dw2) -{ - /* Just raise the signal indicated by the dwUser parameter */ -#ifdef CYGWIN - kill (getpid (), dwUser); -#else - mswindows_raise (dwUser); -#endif -} - -/* Divide time in ms specified by IT by DENOM. Return 1 ms - if division results in zero */ -static UINT -setitimer_helper_period (const struct itimerval* it, UINT denom) -{ - static TIMECAPS time_caps; - - UINT res; - const struct timeval* tv = - (it->it_value.tv_sec == 0 && it->it_value.tv_usec == 0) - ? &it->it_interval : &it->it_value; - - /* Zero means stop timer */ - if (tv->tv_sec == 0 && tv->tv_usec == 0) - return 0; - - /* Convert to ms and divide by denom */ - res = (tv->tv_sec * 1000 + (tv->tv_usec + 500) / 1000) / denom; - - /* Converge to minimum timer resolution */ - if (time_caps.wPeriodMin == 0) - timeGetDevCaps (&time_caps, sizeof(time_caps)); - - if (res < time_caps.wPeriodMin) - res = time_caps.wPeriodMin; - - return res; -} - -static int -setitimer_helper (const struct itimerval* itnew, - struct itimerval* itold, struct itimerval* itcurrent, - MMRESULT* tid, DWORD sigkind) -{ - UINT delay, resolution, event_type; - - /* First stop the old timer */ - if (*tid) - { - timeKillEvent (*tid); - timeEndPeriod (setitimer_helper_period (itcurrent, - setitimer_helper_timer_prec)); - *tid = 0; - } - - /* Return old itimerval if requested */ - if (itold) - *itold = *itcurrent; - - *itcurrent = *itnew; - - /* Determine if to start new timer */ - delay = setitimer_helper_period (itnew, 1); - if (delay) - { - resolution = setitimer_helper_period (itnew, - setitimer_helper_timer_prec); - event_type = (itnew->it_value.tv_sec == 0 && - itnew->it_value.tv_usec == 0) - ? TIME_ONESHOT : TIME_PERIODIC; - timeBeginPeriod (resolution); - *tid = timeSetEvent (delay, resolution, setitimer_helper_proc, sigkind, - event_type); - } - - return !delay || *tid; -} - -int -mswindows_setitimer (int kind, const struct itimerval *itnew, - struct itimerval *itold) -{ - /* In this version, both interval and value are allowed - only if they are equal. */ - assert ((itnew->it_value.tv_sec == 0 && itnew->it_value.tv_usec == 0) - || (itnew->it_interval.tv_sec == 0 && - itnew->it_interval.tv_usec == 0) - || (itnew->it_value.tv_sec == itnew->it_interval.tv_sec && - itnew->it_value.tv_usec == itnew->it_interval.tv_usec)); - - if (kind == ITIMER_REAL) - return setitimer_helper (itnew, itold, &it_alarm, &tid_alarm, SIGALRM); - else if (kind == ITIMER_PROF) - return setitimer_helper (itnew, itold, &it_prof, &tid_prof, SIGPROF); - else - return errno = EINVAL; -} - - void syms_of_win32 (void) { DEFSUBR (Fmswindows_shell_execute); -#ifdef CYGWIN - DEFSUBR (Fmswindows_cygwin_to_win32_path); -#endif } void diff --git a/src/xselect.c b/src/xselect.c new file mode 100644 index 0000000..b974d25 --- /dev/null +++ b/src/xselect.c @@ -0,0 +1,2160 @@ +/* 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; + XSelectionEvent reply; + 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); + + reply.type = SelectionNotify; /* Construct the reply event */ + reply.display = event->display; + reply.requestor = event->requestor; + reply.selection = event->selection; + reply.time = event->time; + reply.target = event->target; + reply.property = (event->property == None ? event->target : event->property); + + selection_symbol = x_atom_to_symbol (d, event->selection); + + local_selection_data = assq_no_quit (selection_symbol, Vselection_alist); + +#if 0 +# define CDR(x) (XCDR (x)) +# define CAR(x) (XCAR (x)) + /* This list isn't user-visible, so it can't "go bad." */ + if (!CONSP (local_selection_data)) abort (); + if (!CONSP (CDR (local_selection_data))) abort (); + if (!CONSP (CDR (CDR (local_selection_data)))) abort (); + if (!NILP (CDR (CDR (CDR (local_selection_data))))) abort (); + if (!CONSP (CAR (CDR (CDR (local_selection_data))))) abort (); + if (!INTP (CAR (CAR (CDR (CDR (local_selection_data)))))) abort (); + if (!INTP (CDR (CAR (CDR (CDR (local_selection_data)))))) abort (); +# undef CAR +# undef CDR +#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 weve 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 wont, I dont 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 --git a/tests/automated/base64-tests.el b/tests/automated/base64-tests.el index 264ff6b..e0ae3b1 100644 Binary files a/tests/automated/base64-tests.el and b/tests/automated/base64-tests.el differ diff --git a/tests/automated/case-tests.el b/tests/automated/case-tests.el index 5b0f037..2a294d5 100644 Binary files a/tests/automated/case-tests.el and b/tests/automated/case-tests.el differ diff --git a/tests/automated/extent-tests.el b/tests/automated/extent-tests.el new file mode 100644 index 0000000..d7f4d4f --- /dev/null +++ b/tests/automated/extent-tests.el @@ -0,0 +1,371 @@ +;; Copyright (C) 2001 Free Software Foundation, Inc. + +;; Author: Hrvoje Niksic <hniksic@xemacs.org> +;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org> +;; 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 extents operations. +;; 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)))) + + +;;----------------------------------------------------- +;; Creating and attaching. +;;----------------------------------------------------- + +(with-temp-buffer + (let ((extent (make-extent nil nil)) + (string "somecoolstring")) + + ;; Detached extent. + (Assert (extent-detached-p extent)) + + ;; Put it in a buffer. + (set-extent-endpoints extent 1 1 (current-buffer)) + (Assert (eq (extent-object extent) (current-buffer))) + + ;; And then into another buffer. + (with-temp-buffer + (set-extent-endpoints extent 1 1 (current-buffer)) + (Assert (eq (extent-object extent) (current-buffer)))) + + ;; Now that the buffer doesn't exist, extent should be detached + ;; again. + (Assert (extent-detached-p extent)) + + ;; This line crashes XEmacs 21.2.46 and prior. + (set-extent-endpoints extent 1 (length string) string) + (Assert (eq (extent-object extent) string)) + ) + + (let ((extent (make-extent 1 1))) + ;; By default, extent should be closed-open + (Assert (eq (get extent 'start-closed) t)) + (Assert (eq (get extent 'start-open) nil)) + (Assert (eq (get extent 'end-open) t)) + (Assert (eq (get extent 'end-closed) nil)) + + ;; Make it closed-closed. + (set-extent-property extent 'end-closed t) + + (Assert (eq (get extent 'start-closed) t)) + (Assert (eq (get extent 'start-open) nil)) + (Assert (eq (get extent 'end-open) nil)) + (Assert (eq (get extent 'end-closed) t)) + + ;; open-closed + (set-extent-property extent 'start-open t) + + (Assert (eq (get extent 'start-closed) nil)) + (Assert (eq (get extent 'start-open) t)) + (Assert (eq (get extent 'end-open) nil)) + (Assert (eq (get extent 'end-closed) t)) + + ;; open-open + (set-extent-property extent 'end-open t) + + (Assert (eq (get extent 'start-closed) nil)) + (Assert (eq (get extent 'start-open) t)) + (Assert (eq (get extent 'end-open) t)) + (Assert (eq (get extent 'end-closed) nil))) + + ) + +;;----------------------------------------------------- +;; Insertion behavior. +;;----------------------------------------------------- + +(defun et-range (extent) + "List (START-POSITION END-POSITION) of EXTENT." + (list (extent-start-position extent) + (extent-end-position extent))) + +(defun et-insert-at (string position) + "Insert STRING at POSITION in the current buffer." + (save-excursion + (goto-char position) + (insert string))) + +;; Test insertion at the beginning, middle, and end of the extent. + +;; closed-open + +(with-temp-buffer + (insert "###eee###") + (let ((e (make-extent 4 7))) + ;; current state: "###[eee)###" + ;; 123 456 789 + (Assert (equal (et-range e) '(4 7))) + + (et-insert-at "xxx" 4) + + ;; current state: "###[xxxeee)###" + ;; 123 456789 012 + (Assert (equal (et-range e) '(4 10))) + + (et-insert-at "yyy" 7) + + ;; current state: "###[xxxyyyeee)###" + ;; 123 456789012 345 + (Assert (equal (et-range e) '(4 13))) + + (et-insert-at "zzz" 13) + + ;; current state: "###[xxxyyyeee)zzz###" + ;; 123 456789012 345678 + (Assert (equal (et-range e) '(4 13))) + )) + +;; closed-closed + +(with-temp-buffer + (insert "###eee###") + (let ((e (make-extent 4 7))) + (put e 'end-closed t) + + ;; current state: "###[eee]###" + ;; 123 456 789 + (Assert (equal (et-range e) '(4 7))) + + (et-insert-at "xxx" 4) + + ;; current state: "###[xxxeee]###" + ;; 123 456789 012 + (Assert (equal (et-range e) '(4 10))) + + (et-insert-at "yyy" 7) + + ;; current state: "###[xxxyyyeee]###" + ;; 123 456789012 345 + (Assert (equal (et-range e) '(4 13))) + + (et-insert-at "zzz" 13) + + ;; current state: "###[xxxyyyeeezzz]###" + ;; 123 456789012345 678 + (Assert (equal (et-range e) '(4 16))) + )) + +;; open-closed + +(with-temp-buffer + (insert "###eee###") + (let ((e (make-extent 4 7))) + (put e 'start-open t) + (put e 'end-closed t) + + ;; current state: "###(eee]###" + ;; 123 456 789 + (Assert (equal (et-range e) '(4 7))) + + (et-insert-at "xxx" 4) + + ;; current state: "###xxx(eee]###" + ;; 123456 789 012 + (Assert (equal (et-range e) '(7 10))) + + (et-insert-at "yyy" 8) + + ;; current state: "###xxx(eyyyee]###" + ;; 123456 789012 345 + (Assert (equal (et-range e) '(7 13))) + + (et-insert-at "zzz" 13) + + ;; current state: "###xxx(eyyyeezzz]###" + ;; 123456 789012345 678 + (Assert (equal (et-range e) '(7 16))) + )) + +;; open-open + +(with-temp-buffer + (insert "###eee###") + (let ((e (make-extent 4 7))) + (put e 'start-open t) + + ;; current state: "###(eee)###" + ;; 123 456 789 + (Assert (equal (et-range e) '(4 7))) + + (et-insert-at "xxx" 4) + + ;; current state: "###xxx(eee)###" + ;; 123456 789 012 + (Assert (equal (et-range e) '(7 10))) + + (et-insert-at "yyy" 8) + + ;; current state: "###xxx(eyyyee)###" + ;; 123456 789012 345 + (Assert (equal (et-range e) '(7 13))) + + (et-insert-at "zzz" 13) + + ;; current state: "###xxx(eyyyee)zzz###" + ;; 123456 789012 345678 + (Assert (equal (et-range e) '(7 13))) + )) + + +;;----------------------------------------------------- +;; Deletion behavior. +;;----------------------------------------------------- + +(dolist (props '((start-closed t end-open t) + (start-closed t end-open nil) + (start-closed nil end-open nil) + (start-closed nil end-open t))) + ;; Deletion needs to behave the same regardless of the open-ness of + ;; the boundaries. + + (with-temp-buffer + (insert "xxxxxxxxxx") + (let ((e (make-extent 3 9))) + (set-extent-properties e props) + + ;; current state: xx[xxxxxx]xx + ;; 12 345678 90 + (Assert (equal (et-range e) '(3 9))) + + (delete-region 1 2) + + ;; current state: x[xxxxxx]xx + ;; 1 234567 89 + (Assert (equal (et-range e) '(2 8))) + + (delete-region 2 4) + + ;; current state: x[xxxx]xx + ;; 1 2345 67 + (Assert (equal (et-range e) '(2 6))) + + (delete-region 1 3) + + ;; current state: [xxx]xx + ;; 123 45 + (Assert (equal (et-range e) '(1 4))) + + (delete-region 3 5) + + ;; current state: [xx]x + ;; 12 3 + (Assert (equal (et-range e) '(1 3))) + + ))) + +;;; #### Should have a test for read-only-ness and insertion and +;;; deletion! + +;;----------------------------------------------------- +;; `detachable' property +;;----------------------------------------------------- + +(dolist (props '((start-closed t end-open t) + (start-closed t end-open nil) + (start-closed nil end-open nil) + (start-closed nil end-open t))) + ;; `detachable' shouldn't relate to region properties, hence the + ;; loop. + (with-temp-buffer + (insert "###eee###") + (let ((e (make-extent 4 7))) + (set-extent-properties e props) + (Assert (get e 'detachable)) + + (Assert (not (extent-detached-p e))) + + (delete-region 4 5) + ;; ###ee### (not detached yet) + (Assert (not (extent-detached-p e))) + + (delete-region 4 6) + ;; ###### (should be detached now) + (Assert (extent-detached-p e)))) + + (with-temp-buffer + (insert "###eee###") + (let ((e (make-extent 4 7))) + (set-extent-properties e props) + (put e 'detachable nil) + (Assert (not (get e 'detachable))) + + (Assert (not (extent-detached-p e))) + + (delete-region 4 5) + ;; ###ee### + (Assert (not (extent-detached-p e))) + + (delete-region 4 6) + ;; ###[]### + (Assert (not (extent-detached-p e))) + (Assert (equal (et-range e) '(4 4))) + )) + ) + + +;;----------------------------------------------------- +;; Zero-length extents. +;;----------------------------------------------------- + +;; closed-open (should stay put) +(with-temp-buffer + (insert "######") + (let ((e (make-extent 4 4))) + (et-insert-at "foo" 4) + (Assert (equal (et-range e) '(4 4))))) + +;; open-closed (should move) +(with-temp-buffer + (insert "######") + (let ((e (make-extent 4 4))) + (put e 'start-open t) + (put e 'end-closed t) + (et-insert-at "foo" 4) + (Assert (equal (et-range e) '(7 7))))) + +;; closed-closed (should extend) +(with-temp-buffer + (insert "######") + (let ((e (make-extent 4 4))) + (put e 'end-closed t) + (et-insert-at "foo" 4) + (Assert (equal (et-range e) '(4 7))))) + +;; open-open (illegal; forced to behave like closed-open) +(with-temp-buffer + (insert "######") + (let ((e (make-extent 4 4))) + (put e 'start-open t) + (et-insert-at "foo" 4) + (Assert (equal (et-range e) '(4 4))))) diff --git a/tests/automated/mule-tests.el b/tests/automated/mule-tests.el index 4d962b3..729d134 100644 --- a/tests/automated/mule-tests.el +++ b/tests/automated/mule-tests.el @@ -1,8 +1,7 @@ ;; Copyright (C) 1999 Free Software Foundation, Inc. ;; Author: Hrvoje Niksic <hniksic@xemacs.org> -;; Maintainers: Hrvoje Niksic <hniksic@xemacs.org>, -;; Martin Buchholz <martin@xemacs.org> +;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org> ;; Created: 1999 ;; Keywords: tests @@ -30,9 +29,6 @@ ;; 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. ;;----------------------------------------------------------------- @@ -77,254 +73,3 @@ the Assert macro checks for correctness." ;; 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 - (file-truename (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... - - ;;--------------------------------------------------------------- - ;; Test Unicode-related functions - ;;--------------------------------------------------------------- - (let* ((scaron (make-char 'latin-iso8859-2 57))) - (loop for code in '(#x0000 #x2222 #x4444 #xffff) do - (progn - (set-ucs-char code scaron) - (Assert (eq scaron (ucs-char code))))) - - (Assert (eq nil (set-ucs-char #x1ffff scaron))) - (Check-Error wrong-type-argument (set-ucs-char -10000 scaron))) - - ) diff --git a/tests/automated/regexp-tests.el b/tests/automated/regexp-tests.el index b24296c..2df3156 100644 --- a/tests/automated/regexp-tests.el +++ b/tests/automated/regexp-tests.el @@ -204,51 +204,3 @@ (setq i (1+ i)))))) ;; (test-regex-charset-mule-paranoid) - -;; Test replace-match -(with-temp-buffer - (insert "This is a test buffer.") - (goto-char (point-min)) - (search-forward "this is a test ") - (looking-at "Unmatchable text") - (replace-match "") - (Assert (looking-at "^buffer.$"))) - -;; Test that trivial regexps reset unused registers -;; Thanks to Martin Sternholm for the report. -;; xemacs-beta <5blm6h2ki5.fsf@lister.roxen.com> -(with-temp-buffer - (insert "ab") - (goto-char (point-min)) - (re-search-forward "\\(a\\)") - ;; test the whole-match data, too -- one try scotched that, too! - (Assert (string= (match-string 0) "a")) - (Assert (string= (match-string 1) "a")) - (re-search-forward "b") - (Assert (string= (match-string 0) "b")) - (Assert (not (match-string 1)))) - -;; Test word boundaries -(Assert (= (string-match " \\<a" " a") 0)) -(Assert (= (string-match "a\\> " "a ") 0)) -(Assert (= (string-match " \\ba" " a") 0)) -(Assert (= (string-match "a\\b " "a ") 0)) -(Assert (= (string-match "\\ba" " a") 1)) -(Assert (= (string-match "a\\b" "a ") 0)) -;; should work at target boundaries -(Assert (= (string-match "\\<a" "a") 0)) -(Assert (= (string-match "a\\>" "a") 0)) -(Assert (= (string-match "\\ba" "a") 0)) -(Assert (= (string-match "a\\b" "a") 0)) -;; but not if the "word" would be on the null side of the boundary! -(Assert (not (string-match "\\<" ""))) -(Assert (not (string-match "\\>" ""))) -(Assert (not (string-match " \\<" " "))) -(Assert (not (string-match "\\> " " "))) -(Assert (not (string-match "a\\<" "a"))) -(Assert (not (string-match "\\>a" "a"))) -;; Expect these to fail :-( -(Assert (not (string-match "\\b" ""))) -(Assert (not (string-match " \\b" " "))) -(Assert (not (string-match "\\b " " "))) - diff --git a/tests/automated/symbol-tests.el b/tests/automated/symbol-tests.el index dc8037e..d8c680f 100644 --- a/tests/automated/symbol-tests.el +++ b/tests/automated/symbol-tests.el @@ -1,7 +1,7 @@ ;; Copyright (C) 1999 Free Software Foundation, Inc. -;; Author: Hrvoje Niksic <hniksic@xemacs.org> -;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org> +;; Author: Hrvoje Niksic <hniksic@srce.hr> +;; Maintainer: Hrvoje Niksic <hniksic@srce.hr> ;; 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)) - ) - -(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))) + `(,mysym (foo) set nil nil)))) + +;; #### These two make XEmacs crash! +;(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 --git a/tests/automated/syntax-tests.el b/tests/automated/syntax-tests.el index 1ebb9f1..e848e11 100644 --- a/tests/automated/syntax-tests.el +++ b/tests/automated/syntax-tests.el @@ -100,58 +100,3 @@ (test-backward-word "WO " 3) (test-backward-word "W !" 3) (test-backward-word "WO !" 4)) - -;; Works like test-forward-word, except for the following: -;; after <string> is inserted, the syntax-table <apply-syntax> -;; is applied to position <apply-pos>. -;; <apply-pos> can be in the form (start . end), or can be a -;; character position. -(defun test-syntax-table (string apply-pos apply-syntax stop) - ;; We don't necessarily have syntax-table properties ... - (when (boundp 'lookup-syntax-properties) ; backwards compatible kludge - ;; ... and they may not be enabled by default if we do. - (setq lookup-syntax-properties t) - (goto-char (point-max)) - (unless (consp apply-pos) - (setq apply-pos `(,apply-pos . ,(+ 1 apply-pos)))) - (let ((point (point))) - (insert string) - (put-text-property (+ point (car apply-pos)) (+ point (cdr apply-pos)) - 'syntax-table apply-syntax) - (goto-char point) - (forward-word 1) - (Assert (eq (point) (+ point stop)))))) - -;; test syntax-table extents -(with-temp-buffer - ;; Apply punctuation to word - (test-syntax-table "WO" 1 `(,(syntax-string-to-code ".")) 1) - ;; Apply word to punctuation - (test-syntax-table "W." 1 `(,(syntax-string-to-code "w")) 2)) - -;; Test forward-comment at buffer boundaries -;; #### The second Assert fails (once interpreted, once compiled) on 21.4.9 -;; with sjt's version of Andy's syntax-text-property-killer patch. -(with-temp-buffer - (if (not (fboundp 'c-mode)) - ;; #### This whole thing should go inside a macro Skip-Test - (let* ((reason "c-mode unavailable") - (count (gethash reason skipped-test-reasons))) - ;;(message "%S: %S" reason count) - (puthash reason (if (null count) 1 (1+ count)) - skipped-test-reasons) - (Print-Skip "comment and parse-partial-sexp tests" reason)) - (c-mode) - - (insert "// comment\n") - (forward-comment -2) - (Assert (eq (point) (point-min))) - - (let ((point (point))) - (insert "/* comment */") - (goto-char point) - (forward-comment 2) - (Assert (eq (point) (point-max))) - - ;; this last used to crash - (parse-partial-sexp point (point-max))))) diff --git a/tests/basic-lisp.el b/tests/basic-lisp.el new file mode 100644 index 0000000..07a2676 --- /dev/null +++ b/tests/basic-lisp.el @@ -0,0 +1,89 @@ +;;; Test basic Lisp functionality + +;;(when (not (boundp 'foo)) (setq foo 1)) +;;(incf foo) +;;(print foo) + +(let ((my-vector [1 2 3 4]) + (my-bit-vector (bit-vector 1 0 1 0)) + (my-string "1234") + (my-list '(1 2 3 4))) + + ;;(Assert (fooooo)) ;; Generate Other failure + ;;(Assert (eq 1 2)) ;; Generate Assertion failure + + (Assert (eq (elt my-vector 0) 1)) + (Assert (eq (elt my-bit-vector 0) 1)) + (Assert (eq (elt my-string 0) ?1)) + (Assert (eq (elt my-list 0) 1)) + + (Assert (eq 4 (length my-vector))) + (Assert (eq 4 (length my-bit-vector))) + (Assert (eq 4 (length my-string))) + + (fillarray my-vector 5) + (fillarray my-bit-vector 1) + (fillarray my-string ?5) + + (Assert (eq 4 (length my-vector))) + (Assert (eq 4 (length my-bit-vector))) + (Assert (eq 4 (length my-string))) + + (Assert (eq (elt my-vector 0) 5)) + (Assert (eq (elt my-bit-vector 0) 1)) + (Assert (eq (elt my-string 0) ?5)) + + (Assert (eq (elt my-vector 3) 5)) + (Assert (eq (elt my-bit-vector 3) 1)) + (Assert (eq (elt my-string 3) ?5)) + + (fillarray my-bit-vector 0) + (Assert (eq 4 (length my-bit-vector))) + (Assert (eq (elt my-bit-vector 2) 0)) + + ;; Test nconc + (let ((x (list 0 1 2))) + (Assert (eq (nconc) nil)) + (Assert (eq (nconc nil) nil)) + (Assert (eq (nconc nil x) x)) + (Assert (eq (nconc x nil) x)) + (let ((y (nconc x nil (list 3 4 5) nil))) + (Assert (eq (length y) 6)) + (Assert (eq (nth 3 y) 3)) + )) + ) + +;;; Old cruft +;;;(run-tests) + +;(defmacro Assert (assertion) +; `(condition-case error +; (progn +; (assert ,assertion) +; (princ (format "Assertion passed: %S" (quote ,assertion))) +; (terpri) +; (incf Assert-successes)) +; (cl-assertion-failed +; (princ (format "Assertion failed: %S" (quote ,assertion))) +; (terpri) +; (incf Assert-failures)) +; (t (princ (format "Test harness error: %S" error)) +; (terpri) +; (incf Harness-failures) +; ))) + + +;(defun run-tests () +; (with-output-to-temp-buffer "*Test-Log*" +; (let ((Assert-successes 0) +; (Assert-failures 0) +; (Harness-failures 0)) +; (basic-lisp-test) +; (byte-compile 'basic-lisp-test) +; (basic-lisp-test) +; (print (format "%d successes, %d assertion failures, %d harness failures" +; Assert-successes +; Assert-failures +; Harness-failures))))) + +;(defun the-test () diff --git a/tests/database.el b/tests/database.el new file mode 100644 index 0000000..bc133df --- /dev/null +++ b/tests/database.el @@ -0,0 +1,29 @@ +;;; Test database functionality + +(defun test-database (db) + (Assert (databasep db)) + (put-database "key1" "val1" db) + (Assert (equal "val1" (get-database "key1" db))) + (remove-database "key1" db) + (Assert (equal nil (get-database "key1" db))) + (close-database db) + (Assert (not (database-live-p db))) + (Assert (databasep db)) + (let ((filename (database-file-name db))) + (loop for fn in (list filename (concat filename ".db")) do + (when (file-exists-p fn) + (delete-file fn)))) + ) + +(let ((filename (expand-file-name "test-emacs" (temp-directory)))) + + (when (featurep 'dbm) + (let ((db (open-database filename 'dbm))) + (test-database db))) + + (princ "\n") + + (when (featurep 'berkeley-db) + (let ((db (open-database filename 'berkeley-db))) + (test-database db))) + ) diff --git a/tests/gutter-test.el b/tests/gutter-test.el index c73b09f..41a870a 100644 --- a/tests/gutter-test.el +++ b/tests/gutter-test.el @@ -1,39 +1,17 @@ -(setq str "Hello\nAgain") -(setq str-ext (make-extent 0 5 str)) +(setq str "Hello There\nHello Again") (set-extent-begin-glyph - str-ext + (make-extent 0 0 str) (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-extent 3 3 str) (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 - (make-glyph - [layout :orientation vertical - :justify left :margin-width 4 - :items ([string :data "Fontifying glyphs.c..."] - [layout :orientation horizontal - :items - ([progress-gauge :value 0 :pixel-height 24 - :pixel-width 250 :descriptor - "Progress"] - [button :pixel-height 24 - :descriptor " Stop " - :callback (quote quit)])])])) - -(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) - +(set-specifier default-gutter-height 'autodetect) +(set-specifier default-gutter-width 40) +(set-specifier default-gutter-border-width 2) +(set-specifier default-gutter str) +(set-default-gutter-position 'bottom) diff --git a/tests/test-emacs.el b/tests/test-emacs.el new file mode 100644 index 0000000..bd34433 --- /dev/null +++ b/tests/test-emacs.el @@ -0,0 +1,219 @@ +;; test-emacs.el --- Run Emacs Lisp test suites. + +;;; Copyright (C) 1998 Free Software Foundation, Inc. + +;; Author: Martin Buchholz +;; Keywords: testing + +;; 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 + +(defvar test-emacs-verbose + (and (not noninteractive) (> (device-baud-rate) search-slow-speed)) + "*Non-nil means print messages describing progress of emacs-tester.") + +(defvar test-emacs-current-file nil) + +(defvar emacs-lisp-file-regexp (purecopy "\\.el$") + "*Regexp which matches Emacs Lisp source files.") + +(defun test-emacs-test-file (filename) + "Test a file of Lisp code named FILENAME. +The output file's name is made by appending `c' to the end of FILENAME." + ;; (interactive "fTest file: ") + (interactive + (let ((file buffer-file-name) + (file-name nil) + (file-dir nil)) + (and file + (eq (cdr (assq 'major-mode (buffer-local-variables))) + 'emacs-lisp-mode) + (setq file-name (file-name-nondirectory file) + file-dir (file-name-directory file))) + (list (read-file-name "Test file: " file-dir nil nil file-name)))) + ;; Expand now so we get the current buffer's defaults + (setq filename (expand-file-name filename)) + + ;; If we're testing a file that's in a buffer and is modified, offer + ;; to save it first. + (or noninteractive + (let ((b (get-file-buffer (expand-file-name filename)))) + (if (and b (buffer-modified-p b) + (y-or-n-p (format "save buffer %s first? " (buffer-name b)))) + (save-excursion (set-buffer b) (save-buffer))))) + + (if (or noninteractive test-emacs-verbose) + (message "Testing %s..." filename)) + (let ((test-emacs-current-file filename) + input-buffer) + (save-excursion + (setq input-buffer (get-buffer-create " *Test Input*")) + (set-buffer input-buffer) + (erase-buffer) + (insert-file-contents filename) + ;; Run hooks including the uncompression hook. + ;; If they change the file name, then change it for the output also. + (let ((buffer-file-name filename) + (default-major-mode 'emacs-lisp-mode) + (enable-local-eval nil)) + (normal-mode) + (setq filename buffer-file-name))) + (test-emacs-from-buffer input-buffer filename) + (kill-buffer input-buffer) + )) + +(defun test-emacs-read-from-buffer (buffer) + "Read forms from BUFFER, and turn it into a lambda test form." + (let ((body nil)) + (goto-char (point-min) buffer) + (condition-case nil + (while t + (setq body (cons (read inbuffer) body))) + (error nil)) + `(lambda () + (defvar passes) + (defvar assertion-failures) + (defvar other-failures) + ,@(nreverse body)))) + +(defun test-emacs-from-buffer (inbuffer filename) + "Run tests in buffer INBUFFER, visiting FILENAME." + (let ((passes 0) + (assertion-failures 0) + (other-failures 0)) + (with-output-to-temp-buffer "*Test-Log*" + (defmacro Assert (assertion) + `(condition-case error + (progn + (assert ,assertion) + (princ (format "PASS: %S" (quote ,assertion))) + (terpri) + (incf passes)) + (cl-assertion-failed + (princ (format "Assertion failed: %S" (quote ,assertion))) + (terpri) + (incf assertion-failures)) + (t (princ "Error during test execution:\n\t") + (display-error error nil) + (terpri) + (incf other-failures) + ))) + + (princ "Testing Interpreted Lisp\n\n") + (funcall (test-emacs-read-from-buffer inbuffer)) + (princ "\nTesting Compiled Lisp\n\n") + (funcall (byte-compile (test-emacs-read-from-buffer inbuffer))) + (princ (format + "\nSUMMARY: %d passes, %d assertion failures, %d other failures\n" + passes + assertion-failures + other-failures)) + (let* ((total (+ passes assertion-failures other-failures)) + (basename (file-name-nondirectory filename)) + (summary-msg + (if (> total 0) + (format "%s: %d of %d (%d%%) tests successful." + basename passes total (/ (* 100 passes) total)) + (format "%s: No tests run" basename)))) + (message "%s" summary-msg)) + (fmakunbound 'Assert)))) + +(defvar test-emacs-results-point-max nil) +(defmacro displaying-emacs-test-results (&rest body) + `(let ((test-emacs-results-point-max test-emacs-results-point-max)) + ;; Log the file name. + (test-emacs-log-file) + ;; Record how much is logged now. + ;; We will display the log buffer if anything more is logged + ;; before the end of BODY. + (or test-emacs-results-point-max + (save-excursion + (set-buffer (get-buffer-create "*Test-Log*")) + (setq test-emacs-results-point-max (point-max)))) + (unwind-protect + (condition-case error-info + (progn ,@body) + (error + (test-emacs-report-error error-info))) + (save-excursion + ;; If there were compilation warnings, display them. + (set-buffer "*Test-Log*") + (if (= test-emacs-results-point-max (point-max)) + nil + (if temp-buffer-show-function + (let ((show-buffer (get-buffer-create "*Test-Log-Show*"))) + (save-excursion + (set-buffer show-buffer) + (setq buffer-read-only nil) + (erase-buffer)) + (copy-to-buffer show-buffer + (save-excursion + (goto-char test-emacs-results-point-max) + (forward-line -1) + (point)) + (point-max)) + (funcall temp-buffer-show-function show-buffer)) + (select-window + (prog1 (selected-window) + (select-window (display-buffer (current-buffer))) + (goto-char test-emacs-results-point-max) + (recenter 1))))))))) + +(defun batch-test-emacs-1 (file) + (condition-case err + (progn (test-emacs-test-file file) t) + (error + (princ ">>Error occurred processing ") + (princ file) + (princ ": ") + (display-error err nil) + (terpri) + nil))) + +(defun batch-test-emacs () + "Run `test-emacs' on the files remaining on the command line. +Use this from the command line, with `-batch'; +it won't work in an interactive Emacs. +Each file is processed even if an error occurred previously. +For example, invoke \"xemacs -batch -f batch-test-emacs tests/*.el\"" + ;; 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-test-emacs' is to be used only with -batch")) + (let ((error nil) + (debug-issue-ebola-notices 0)) + (loop for file in command-line-args-left + do + (if (file-directory-p (expand-file-name file)) + (let ((files (directory-files file)) + source) + (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)) + (if (null (batch-test-emacs-1 source)) + (setq error t))) + (setq files (cdr files))))) + (if (null (batch-test-emacs-1 file)) + (setq error t)))) + (message "Done") + (kill-emacs (if error 1 0))))